Show file type for mounted game images

This commit is contained in:
d0k3 2016-11-28 21:44:02 +01:00
parent cdb9000e6a
commit 2876ebf7ef

View File

@ -1045,11 +1045,15 @@ bool GetRootDirContentsWorker(DirStruct* contents) {
if (!DriveType(drvnum[pdrv])) continue; // drive not available if (!DriveType(drvnum[pdrv])) continue; // drive not available
memset(entry->path, 0x00, 64); memset(entry->path, 0x00, 64);
snprintf(entry->path + 0, 4, drvnum[pdrv]); snprintf(entry->path + 0, 4, drvnum[pdrv]);
snprintf(entry->path + 4, 32, "[%s] %s", drvnum[pdrv], drvname[pdrv]); if ((pdrv == 7) && ((GetMountState() == IMG_FAT) || (GetMountState() == IMG_RAMDRV)))
if ((GetMountState() == IMG_FAT) && (pdrv == 7)) // FAT image special handling snprintf(entry->path + 4, 32, "[%s] %s", drvnum[pdrv], // FAT image / RAM drive special handling
snprintf(entry->path + 4, 32, "[7:] FAT IMAGE"); (GetMountState() == IMG_FAT) ? "FAT IMAGE" : "RAMDRIVE");
else if ((GetMountState() == IMG_RAMDRV) && (pdrv == 7)) // RAM drive special handling else if (pdrv == 10) // Game drive special handling
snprintf(entry->path + 4, 32, "[7:] RAMDRIVE"); snprintf(entry->path + 4, 32, "[%s] %s %s", drvnum[pdrv],
(GetMountState() == GAME_CIA) ? "CIA" :
(GetMountState() == GAME_NCSD) ? "NCSD" :
(GetMountState() == GAME_NCCH) ? "NCCH" : "UNK", drvname[pdrv]);
else snprintf(entry->path + 4, 32, "[%s] %s", drvnum[pdrv], drvname[pdrv]);
entry->name = entry->path + 4; entry->name = entry->path + 4;
entry->size = GetTotalSpace(entry->path); entry->size = GetTotalSpace(entry->path);
entry->type = T_ROOT; entry->type = T_ROOT;