From 791d1ea0a804fdeb958c810352737d3feafed9a8 Mon Sep 17 00:00:00 2001 From: penfold42 Date: Sun, 1 Jul 2018 20:46:07 +1000 Subject: [PATCH] Hide deleted files from BAM view --- src/FileBrowser.cpp | 48 +++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/src/FileBrowser.cpp b/src/FileBrowser.cpp index 2320904..b05fd79 100644 --- a/src/FileBrowser.cpp +++ b/src/FileBrowser.cpp @@ -1023,30 +1023,32 @@ void FileBrowser::DisplayDiskInfo(DiskImage* diskImage, const char* filenameForI u8 fileType = buffer[DIR_ENTRY_OFFSET_TYPE + entryOffset]; u16 blocks = (buffer[DIR_ENTRY_OFFSET_BLOCKS + entryOffset + 1] << 8) | buffer[DIR_ENTRY_OFFSET_BLOCKS + entryOffset]; - x = 0; - for (charIndex = 0; charIndex < DIR_ENTRY_NAME_LENGTH; ++charIndex) - { - char c = buffer[DIR_ENTRY_OFFSET_NAME + entryOffset + charIndex]; - if (c == 0xa0) c = 0x20; - name[charIndex] = c; - } - name[charIndex] = 0; + if (fileType != 0) { // hide scratched files + x = 0; + for (charIndex = 0; charIndex < DIR_ENTRY_NAME_LENGTH; ++charIndex) + { + char c = buffer[DIR_ENTRY_OFFSET_NAME + entryOffset + charIndex]; + if (c == 0xa0) c = 0x20; + name[charIndex] = c; + } + name[charIndex] = 0; - //DEBUG_LOG("%d name = %s %x\r\n", blocks, name, fileType); - snprintf(bufferOut, 128, "%d", blocks); - screenMain->PrintText(true, x, y, bufferOut, textColour, bgColour); - x += 5 * 8; - snprintf(bufferOut, 128, "\"%s\"", name); - screenMain->PrintText(true, x, y, bufferOut, textColour, bgColour); - x += 19 * 8; - char modifier = 0x20; - if ((fileType & 0x80) == 0) - modifier = screen2petscii(42); - else if (fileType & 0x40) - modifier = screen2petscii(60); - snprintf(bufferOut, 128, "%s%c", fileTypes[fileType & 7], modifier); - screenMain->PrintText(true, x, y, bufferOut, textColour, bgColour); - y += fontHeight; + //DEBUG_LOG("%d name = %s %x\r\n", blocks, name, fileType); + snprintf(bufferOut, 128, "%d", blocks); + screenMain->PrintText(true, x, y, bufferOut, textColour, bgColour); + x += 5 * 8; + snprintf(bufferOut, 128, "\"%s\"", name); + screenMain->PrintText(true, x, y, bufferOut, textColour, bgColour); + x += 19 * 8; + char modifier = 0x20; + if ((fileType & 0x80) == 0) + modifier = screen2petscii(42); + else if (fileType & 0x40) + modifier = screen2petscii(60); + snprintf(bufferOut, 128, "%s%c", fileTypes[fileType & 7], modifier); + screenMain->PrintText(true, x, y, bufferOut, textColour, bgColour); + y += fontHeight; + } } entryOffset += 32; }