diff --git a/cube/swiss/source/devices/fat/deviceHandler-FAT.c b/cube/swiss/source/devices/fat/deviceHandler-FAT.c index f29fbc2b..222d28ac 100644 --- a/cube/swiss/source/devices/fat/deviceHandler-FAT.c +++ b/cube/swiss/source/devices/fat/deviceHandler-FAT.c @@ -131,10 +131,9 @@ s32 deviceHandler_FAT_readDir(file_handle* ffile, file_handle** dir, u32 type) { } memset(&(*dir)[i], 0, sizeof(file_handle)); if(concat_path((*dir)[i].name, ffile->name, entry.fname) < PATHNAME_MAX && entry.fsize <= UINT32_MAX) { - (*dir)[i].size = entry.fsize; - (*dir)[i].fileType = (entry.fattrib & AM_DIR) ? IS_DIR : IS_FILE; - (*dir)[i].fileAttrib = entry.fattrib; - (*dir)[i].fileAttrib |= (entry.fname[0] == '.') ? AM_HID : 0; + (*dir)[i].size = entry.fsize; + (*dir)[i].fileType = (entry.fattrib & AM_DIR) ? IS_DIR : IS_FILE; + (*dir)[i].fileAttrib = entry.fattrib; ++i; } } diff --git a/cube/swiss/source/devices/filemeta.c b/cube/swiss/source/devices/filemeta.c index 0e6aa5dd..4254ef71 100644 --- a/cube/swiss/source/devices/filemeta.c +++ b/cube/swiss/source/devices/filemeta.c @@ -352,7 +352,10 @@ void populate_meta(file_handle *f) { } devices[DEVICE_CUR]->closeFile(bootFile); free(bootFile); - } + } else if (!fnmatch("*/apps", f->name, FNM_PATHNAME | FNM_CASEFOLD)) + f->meta->displayName = "Applications"; + else if (!fnmatch("*/games", f->name, FNM_PATHNAME | FNM_CASEFOLD)) + f->meta->displayName = "Games"; if (!fnmatch("*/apps/*", f->name, FNM_PATHNAME | FNM_CASEFOLD)) { file_handle *bootFile = calloc(1, sizeof(file_handle)); concat_path(bootFile->name, f->name, "boot.dol"); diff --git a/cube/swiss/source/devices/flippydrive/deviceHandler-flippydrive.c b/cube/swiss/source/devices/flippydrive/deviceHandler-flippydrive.c index f25331a3..57c1e9fe 100644 --- a/cube/swiss/source/devices/flippydrive/deviceHandler-flippydrive.c +++ b/cube/swiss/source/devices/flippydrive/deviceHandler-flippydrive.c @@ -56,7 +56,7 @@ s32 deviceHandler_Flippy_readDir(file_handle* ffile, file_handle** dir, u32 type // Read each entry of the directory while( flippy_readdir(dp, &entry, &result) == FLIPPY_RESULT_OK && result == &entry ) { - if(!strcmp(entry.name, ".") || !strcmp(entry.name, "..")) { + if(!strcmp(entry.name, ".") || !strcmp(entry.name, "..") || !strcmp(entry.name, "?")) { continue; } // Do we want this one? @@ -331,12 +331,15 @@ bool deviceHandler_Flippy_test() { } case 0x20220426: flippyversion *version = (flippyversion *)driveInfo.pad; + u32 flippy_version = FLIPPY_VERSION(version->major, version->minor, version->build); + __device_flippy.quirks = QUIRK_NO_DEINIT; - if (FLIPPY_VERSION(version->major, version->minor, version->build) < FLIPPY_VERSION(1,3,3)) + if (flippy_version >= FLIPPY_VERSION(1,3,0) && + flippy_version <= FLIPPY_VERSION(1,3,2)) __device_flippy.quirks |= QUIRK_FDI_BYTESWAP_SIZE; - if (FLIPPY_VERSION(version->major, version->minor, version->build) < FLIPPY_VERSION(1,3,1)) { + if (flippy_version < FLIPPY_VERSION(1,3,1)) { __device_flippy.extraExtensions = NULL; __device_flippy.quirks |= QUIRK_FDI_EXCLUSIVE_OPEN; } diff --git a/cube/swiss/source/files.c b/cube/swiss/source/files.c index aa3e1b84..f6ae1a0b 100644 --- a/cube/swiss/source/files.c +++ b/cube/swiss/source/files.c @@ -38,11 +38,15 @@ int sortFiles(file_handle* dir, int numFiles, file_handle*** sortedDir) *sortedDir = calloc(numFiles, sizeof(file_handle*)); if(*sortedDir) { for(int j = 0; j < numFiles; j++) { - if((dir[j].fileAttrib & ATTRIB_HIDDEN) && !swissSettings.showHiddenFiles) { - continue; - } - if(dir[j].fileType == IS_FILE && !checkExtension(dir[j].name, devices[DEVICE_CUR]->extraExtensions)) { - continue; + switch(dir[j].fileType) { + case IS_SPECIAL: + break; + case IS_FILE: + if(!checkExtension(dir[j].name, devices[DEVICE_CUR]->extraExtensions)) + continue; + default: + if(!swissSettings.showHiddenFiles && ((dir[j].fileAttrib & ATTRIB_HIDDEN) || *getRelativeName(dir[j].name) == '.')) + continue; } (*sortedDir)[i++] = &dir[j]; } diff --git a/cube/swiss/source/gui/FrameBufferMagic.c b/cube/swiss/source/gui/FrameBufferMagic.c index 537a35ed..56e6af30 100644 --- a/cube/swiss/source/gui/FrameBufferMagic.c +++ b/cube/swiss/source/gui/FrameBufferMagic.c @@ -1356,7 +1356,7 @@ uiDrawObj_t* DrawFileBrowserButton(int x1, int y1, int x2, int y2, const char *m } } } - eventData->alpha = (eventData->file->fileAttrib & ATTRIB_HIDDEN) ? 128 : 255; + eventData->alpha = (eventData->file->fileAttrib & ATTRIB_HIDDEN) || *getRelativeName(eventData->file->name) == '.' ? 128 : 255; eventData->isAutoLoadEntry = !strcmp(swissSettings.autoload, file->name) || !fnmatch(swissSettings.autoload, file->name, FNM_PATHNAME | FNM_PREFIX_DIRS); uiDrawObj_t *event = calloc(1, sizeof(uiDrawObj_t)); diff --git a/cube/swiss/source/main.c b/cube/swiss/source/main.c index fb54d9c8..1854eb6b 100644 --- a/cube/swiss/source/main.c +++ b/cube/swiss/source/main.c @@ -236,12 +236,13 @@ int main(int argc, char *argv[]) } else if(device == &__device_flippy) { flippyversion *version = (flippyversion*)driveInfo.pad; - if(FLIPPY_VERSION(version->major, version->minor, version->build) < FLIPPY_VERSION(FLIPPY_MINVER_MAJOR, FLIPPY_MINVER_MINOR, FLIPPY_MINVER_BUILD)) { + u32 flippy_version = FLIPPY_VERSION(version->major, version->minor, version->build); + if(flippy_version < FLIPPY_VERSION(FLIPPY_MINVER_MAJOR, FLIPPY_MINVER_MINOR, FLIPPY_MINVER_BUILD)) { uiDrawObj_t *msgBox = DrawPublish(DrawMessageBox(D_WARN, "A firmware update is required.\nflippydrive.com/updates")); wait_press_A(); DrawDispose(msgBox); } - else if(FLIPPY_VERSION(version->major, version->minor, version->build) < FLIPPY_VERSION(1,3,2)) { + else if(flippy_version < FLIPPY_VERSION(1,3,2)) { uiDrawObj_t *msgBox = DrawPublish(DrawMessageBox(D_INFO, "A firmware update is available.\nflippydrive.com/updates")); wait_press_A(); DrawDispose(msgBox);