diff --git a/src/DiskCaddy.cpp b/src/DiskCaddy.cpp index 04f01e8..e84677c 100644 --- a/src/DiskCaddy.cpp +++ b/src/DiskCaddy.cpp @@ -292,7 +292,11 @@ void DiskCaddy::ShowSelectedImage(u32 index) x = 0; y = 0; - snprintf(buffer, 256, " D %d/%d ", index + 1, numberOfImages); + snprintf(buffer, 256, " D %d/%d %c " + , index + 1 + , numberOfImages + , GetImage(index)->GetReadOnly() ? 'R' : ' ' + ); screenLCD->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), RGBA(0xff, 0xff, 0xff, 0xff)); y += LCDFONTHEIGHT; diff --git a/src/FileBrowser.cpp b/src/FileBrowser.cpp index 5f380be..d5918bb 100644 --- a/src/FileBrowser.cpp +++ b/src/FileBrowser.cpp @@ -1153,7 +1153,11 @@ void FileBrowser::ShowDeviceAndROM() u32 x = 0; // 43 * 8 u32 y = screenMain->ScaleY(STATUS_BAR_POSITION_Y) - 20; - snprintf(buffer, 256, "Device %2d %s\r\n", *deviceID, roms->ROMNames[roms->currentROMIndex]); + snprintf(buffer, 256, "Device %2d %*s\r\n" + , *deviceID + , roms->GetLongestRomNameLen() + , roms->ROMNames[roms->currentROMIndex] + ); screenMain->PrintText(false, x, y, buffer, textColour, bgColour); } diff --git a/src/ROMs.cpp b/src/ROMs.cpp index 4d7ca2f..97f29e1 100644 --- a/src/ROMs.cpp +++ b/src/ROMs.cpp @@ -43,3 +43,10 @@ void ROMs::SelectROM(const char* ROMName) } } +unsigned ROMs::UpdateLongestRomNameLen( unsigned maybeLongest ) +{ + if (maybeLongest > longestRomNameLen) + longestRomNameLen = maybeLongest; + + return longestRomNameLen; +} diff --git a/src/ROMs.h b/src/ROMs.h index 38cf962..8e01a95 100644 --- a/src/ROMs.h +++ b/src/ROMs.h @@ -42,5 +42,12 @@ public: unsigned currentROMIndex; unsigned lastManualSelectedROMIndex; + + unsigned GetLongestRomNameLen() { return longestRomNameLen; } + unsigned UpdateLongestRomNameLen( unsigned maybeLongest ); + +protected: + unsigned longestRomNameLen; }; + #endif diff --git a/src/main.cpp b/src/main.cpp index 59ea88a..bd5f501 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1238,6 +1238,7 @@ static void CheckOptions() { strncpy(roms.ROMNames[ROMIndex], ROMName, 255); roms.ROMValid[ROMIndex] = true; + roms.UpdateLongestRomNameLen( strlen(roms.ROMNames[ROMIndex]) ); } f_close(&fp); //DEBUG_LOG("Read ROM %s from options\r\n", ROMName);