Lengthen displayed name in NES database list

This commit is contained in:
sanni 2022-08-06 15:08:01 +02:00
parent 511902eb56
commit df9873aea8
2 changed files with 30 additions and 25 deletions

View File

@ -773,9 +773,6 @@ byte starting_letter() {
else if (b == 3) { // Long Press - Execute else if (b == 3) { // Long Press - Execute
display_Clear(); display_Clear();
println_Msg(F(""));
println_Msg(F(""));
println_Msg(F(""));
println_Msg(F("Please wait...")); println_Msg(F("Please wait..."));
display_Update(); display_Update();
break; break;

View File

@ -621,13 +621,21 @@ void selectMapping() {
if ((myLetter > 0) && (myLetter <= 26)) { if ((myLetter > 0) && (myLetter <= 26)) {
while (myFile.available()) { while (myFile.available()) {
// Read current name // Read current name
#if defined(enable_OLED)
get_line(gamename, &myFile, 42);
#else
get_line(gamename, &myFile, 96); get_line(gamename, &myFile, 96);
#endif
// Compare selected letter with first letter of current name until match // Compare selected letter with first letter of current name until match
while (gamename[0] != 64 + myLetter) { while (gamename[0] != 64 + myLetter) {
skip_line(&myFile); skip_line(&myFile);
skip_line(&myFile); skip_line(&myFile);
#if defined(enable_OLED)
get_line(gamename, &myFile, 42);
#else
get_line(gamename, &myFile, 96); get_line(gamename, &myFile, 96);
#endif
} }
break; break;
} }
@ -748,27 +756,7 @@ void selectMapping() {
ram = 1; // 1K ram = 1; // 1K
} }
// Get name println_Msg(gamename);
byte myLength = 0;
for (unsigned int i = 0; i < 20; i++) {
// Stop at first "(" to remove "(Country)"
if (char(gamename[i]) == 40) {
break;
}
if (((char(gamename[i]) >= 48 && char(gamename[i]) <= 57) || (char(gamename[i]) >= 65 && char(gamename[i]) <= 90) || (char(gamename[i]) >= 97 && char(gamename[i]) <= 122) || (char(gamename[i]) == 32)) && (myLength < 15)) {
romName[myLength] = char(gamename[i]);
myLength++;
}
}
// If name consists out of all japanese characters use CART as name
if (myLength == 0) {
romName[0] = 'C';
romName[1] = 'A';
romName[2] = 'R';
romName[3] = 'T';
}
println_Msg(romName);
print_Msg(F("MAPPER: ")); print_Msg(F("MAPPER: "));
println_Msg(mapper); println_Msg(mapper);
print_Msg(F("PRG SIZE: ")); print_Msg(F("PRG SIZE: "));
@ -801,7 +789,6 @@ void selectMapping() {
print_Msg(ram); print_Msg(ram);
println_Msg(F("K")); println_Msg(F("K"));
} }
println_Msg(F(""));
#if defined(enable_OLED) #if defined(enable_OLED)
println_Msg(F("Press left to Change")); println_Msg(F("Press left to Change"));
println_Msg(F("and right to Select")); println_Msg(F("and right to Select"));
@ -847,6 +834,27 @@ void selectMapping() {
// Selection // Selection
else if (b == 3) { else if (b == 3) {
// Get name
byte myLength = 0;
for (unsigned int i = 0; i < 20; i++) {
// Stop at first "(" to remove "(Country)"
if (char(gamename[i]) == 40) {
break;
}
if (((char(gamename[i]) >= 48 && char(gamename[i]) <= 57) || (char(gamename[i]) >= 65 && char(gamename[i]) <= 90) || (char(gamename[i]) >= 97 && char(gamename[i]) <= 122)) && (myLength < 15)) {
romName[myLength] = char(gamename[i]);
myLength++;
}
}
// If name consists out of all japanese characters use CART as name
if (myLength == 0) {
romName[0] = 'C';
romName[1] = 'A';
romName[2] = 'R';
romName[3] = 'T';
}
// Save Mapper // Save Mapper
EEPROM_writeAnything(7, mapper); EEPROM_writeAnything(7, mapper);
EEPROM_writeAnything(8, prgsize); EEPROM_writeAnything(8, prgsize);