overwrite longer rom names on screen
This commit is contained in:
parent
d26147d93c
commit
ba66f2f929
4 changed files with 20 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -43,3 +43,10 @@ void ROMs::SelectROM(const char* ROMName)
|
|||
}
|
||||
}
|
||||
|
||||
unsigned ROMs::UpdateLongestRomNameLen( unsigned maybeLongest )
|
||||
{
|
||||
if (maybeLongest > longestRomNameLen)
|
||||
longestRomNameLen = maybeLongest;
|
||||
|
||||
return longestRomNameLen;
|
||||
}
|
||||
|
|
|
@ -42,5 +42,12 @@ public:
|
|||
|
||||
unsigned currentROMIndex;
|
||||
unsigned lastManualSelectedROMIndex;
|
||||
|
||||
unsigned GetLongestRomNameLen() { return longestRomNameLen; }
|
||||
unsigned UpdateLongestRomNameLen( unsigned maybeLongest );
|
||||
|
||||
protected:
|
||||
unsigned longestRomNameLen;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1240,6 +1240,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);
|
||||
|
|
Loading…
Reference in a new issue