remove some duplicate printing code and declare more global text strings

This commit is contained in:
smesgr9000 2024-04-22 18:51:01 +02:00
parent 5d0ae986c9
commit e7e0da80b0
15 changed files with 232 additions and 316 deletions

View File

@ -49,7 +49,6 @@ byte a2600[] = { 2, 4, 8, 12, 16, 32, 64 };
byte a2600mapper = 0;
byte new2600mapper;
byte a2600size;
byte e7size;
// EEPROM MAPPING
// 07 MAPPER
@ -273,6 +272,7 @@ boolean checkE7(int bank) {
}
void readROM_2600() {
byte e7size;
strcpy(fileName, romName);
strcat(fileName, ".a26");
@ -576,8 +576,8 @@ void readROM_2600() {
// ROM SIZE
//******************************************
void println_Mapper2600(byte mapper) {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void println_Mapper(byte mapper) {
if (mapper == 0x04)
println_Msg(F("F4SC"));
else if (mapper == 0x06)
@ -598,8 +598,29 @@ void println_Mapper(byte mapper) {
println_Msg(F("TP"));
else
println_Msg(mapper, HEX);
}
#else
if (mapper == 0x04)
Serial.println(F("F4SC"));
else if (mapper == 0x06)
Serial.println(F("F6SC"));
else if (mapper == 0x08)
Serial.println(F("F8SC"));
else if (mapper == 0x20)
Serial.println(F("2K"));
else if (mapper == 0x40)
Serial.println(F("4K"));
else if (mapper == 0x0A)
Serial.println(F("UA"));
else if (mapper == 0xC0)
Serial.println(F("CV"));
else if (mapper == 0xD0)
Serial.println(F("DPC"));
else if (mapper == 0xF9)
Serial.println(F("TP"));
else
Serial.println(mapper, HEX);
#endif
}
void checkStatus_2600() {
EEPROM_readAnything(7, a2600mapper);
@ -612,10 +633,10 @@ void checkStatus_2600() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("ATARI 2600 READER"));
println_Msg(F("CURRENT SETTINGS"));
println_Msg(FS(FSTRING_CURRENT_SETTINGS));
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("MAPPER: "));
println_Mapper(a2600mapper);
println_Mapper2600(a2600mapper);
print_Msg(F("ROM SIZE: "));
if (a2600mapper == 0xD0)
print_Msg(F("10"));
@ -626,26 +647,7 @@ void checkStatus_2600() {
wait();
#else
Serial.print(F("MAPPER: "));
if (mapper == 0x04)
Serial.println(F("F4SC"));
else if (mapper == 0x06)
Serial.println(F("F6SC"));
else if (mapper == 0x08)
Serial.println(F("F8SC"));
else if (a2600mapper == 0x20)
Serial.println(F("2K"));
else if (a2600mapper == 0x40)
Serial.println(F("4K"));
else if (a2600mapper == 0x0A)
Serial.println(F("UA"));
else if (a2600mapper == 0xC0)
Serial.println(F("CV"));
else if (a2600mapper == 0xD0)
Serial.println(F("DPC"));
else if (a2600mapper == 0xF9)
Serial.println(F("TP"));
else
Serial.println(a2600mapper, HEX);
println_Mapper2600(a2600mapper);
Serial.print(F("ROM SIZE: "));
if (a2600mapper == 0xD0)
@ -662,20 +664,23 @@ void checkStatus_2600() {
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void displayMapperSelect_2600(int index) {
void displayMapperSelect_2600(uint8_t index, boolean printInstructions) {
display_Clear();
print_Msg(F("Mapper: "));
a2600index = index * 2;
a2600mapselect = pgm_read_byte(a2600mapsize + a2600index);
println_Mapper(a2600mapselect);
println_Msg(FS(FSTRING_EMPTY));
println_Mapper2600(a2600mapselect);
if(printInstructions) {
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1);
print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1);
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
}
display_Update();
}
#endif
@ -706,12 +711,7 @@ void setMapper_2600() {
i--;
break;
}
display_Clear();
print_Msg(F("Mapper: "));
a2600index = i * 2;
a2600mapselect = pgm_read_byte(a2600mapsize + a2600index);
println_Mapper(a2600mapselect);
display_Update();
displayMapperSelect_2600(i, false);
if (i == (a2600mapcount - 1))
i = 0;
else
@ -719,8 +719,9 @@ void setMapper_2600() {
delay(250);
}
}
b = 0;
displayMapperSelect_2600(i);
displayMapperSelect_2600(i, true);
while (1) {
b = checkButton();
@ -731,7 +732,7 @@ void setMapper_2600() {
i--;
// Only update display after input because of slow LCD library
displayMapperSelect_2600(i);
displayMapperSelect_2600(i, true);
}
if (b == 1) { // Next Mapper (press)
if (i == (a2600mapcount - 1))
@ -740,7 +741,7 @@ void setMapper_2600() {
i++;
// Only update display after input because of slow LCD library
displayMapperSelect_2600(i);
displayMapperSelect_2600(i, true);
}
if (b == 3) { // Long Press - Execute (hold)
new2600mapper = a2600mapselect;
@ -749,7 +750,7 @@ void setMapper_2600() {
}
display.setCursor(0, 56);
print_Msg(F("MAPPER "));
println_Mapper(new2600mapper);
println_Mapper2600(new2600mapper);
println_Msg(F(" SELECTED"));
display_Update();
delay(1000);
@ -774,7 +775,7 @@ setmapper:
Serial.println(F("14 = FA [CBS RAM Plus]"));
Serial.println(F("15 = FE [Activision]"));
Serial.println(F("16 = TP [Time Pilot 8K]"));
Serial.println(F("16 = UA [UA Ltd]"));
Serial.println(F("17 = UA [UA Ltd]"));
Serial.print(F("Enter Mapper [0-17]: "));
while (Serial.available() == 0) {}
newmap = Serial.readStringUntil('\n');
@ -957,10 +958,10 @@ bool getCartListInfo_2600() {
}
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("END OF FILE"));
println_Msg(FS(FSTRING_END_OF_FILE));
display_Update();
#else
Serial.println(F("END OF FILE"));
Serial.println(FS(FSTRING_END_OF_FILE));
#endif
return false;
@ -970,7 +971,7 @@ void checkCSV_2600() {
if (getCartListInfo_2600()) {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("CART SELECTED"));
println_Msg(FS(FSTRING_CART_SELECTED));
println_Msg(FS(FSTRING_EMPTY));
println_Msg(a2600game);
display_Update();
@ -981,7 +982,7 @@ void checkCSV_2600() {
display_Update();
#else
Serial.println(FS(FSTRING_EMPTY));
Serial.println(F("CART SELECTED"));
Serial.println(FS(FSTRING_CART_SELECTED));
Serial.println(a2600game);
// Display Settings
Serial.print(F("CODE: "));
@ -991,10 +992,10 @@ void checkCSV_2600() {
} else {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56);
println_Msg(F("NO SELECTION"));
println_Msg(FS(FSTRING_NO_SELECTION));
display_Update();
#else
Serial.println(F("NO SELECTION"));
Serial.println(FS(FSTRING_NO_SELECTION));
#endif
}
}

View File

@ -342,6 +342,24 @@ void readROM_5200() {
// ROM SIZE
//******************************************
void println_Mapper5200(byte mapper) {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
if (mapper == 0)
println_Msg(F("STANDARD"));
else if (mapper == 1)
println_Msg(F("TWO CHIP"));
else if (mapper == 2)
println_Msg(F("BOUNTY BOB"));
#else
if (mapper == 0)
Serial.println(F("STANDARD"));
else if (mapper == 1)
Serial.println(F("TWO CHIP"));
else if (mapper == 2)
Serial.println(F("BOUNTY BOB"));
#endif
}
void checkMapperSize_5200() {
for (int i = 0; i < a5200mapcount; i++) {
a5200index = i * 3;
@ -477,16 +495,11 @@ void checkStatus_5200() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("ATARI 5200 READER"));
println_Msg(F("CURRENT SETTINGS"));
println_Msg(FS(FSTRING_CURRENT_SETTINGS));
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("MAPPER: "));
println_Msg(a5200mapper);
if (a5200mapper == 0)
println_Msg(F("STANDARD"));
else if (a5200mapper == 1)
println_Msg(F("TWO CHIP"));
else if (a5200mapper == 2)
println_Msg(F("BOUNTY BOB"));
println_Mapper5200(a5200mapper);
print_Msg(F("ROM SIZE: "));
print_Msg(a5200[a5200size]);
println_Msg(F("K"));
@ -495,12 +508,7 @@ void checkStatus_5200() {
#else
Serial.print(F("MAPPER: "));
Serial.println(a5200mapper);
if (a5200mapper == 0)
Serial.println(F("STANDARD"));
else if (a5200mapper == 1)
Serial.println(F("TWO CHIP"));
else if (a5200mapper == 2)
Serial.println(F("BOUNTY BOB"));
println_Mapper5200(a5200mapper);
Serial.print(F("ROM SIZE: "));
Serial.print(a5200[a5200size]);
Serial.println(F("K"));
@ -511,6 +519,29 @@ void checkStatus_5200() {
//******************************************
// SET MAPPER
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void displayMapperSelect_5200(int index, boolean printInstructions) {
display_Clear();
print_Msg(F("Mapper: "));
a5200index = index * 3;
a5200mapselect = pgm_read_byte(a5200mapsize + a5200index);
println_Msg(a5200mapselect);
println_Mapper5200(a5200mapselect);
if(printInstructions) {
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1);
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
}
display_Update();
}
#endif
void setMapper_5200() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
@ -537,18 +568,7 @@ void setMapper_5200() {
i--;
break;
}
display_Clear();
print_Msg(F("Mapper: "));
a5200index = i * 3;
a5200mapselect = pgm_read_byte(a5200mapsize + a5200index);
println_Msg(a5200mapselect);
if (a5200mapselect == 0)
println_Msg(F("STANDARD"));
else if (a5200mapselect == 1)
println_Msg(F("TWO CHIP"));
else if (a5200mapselect == 2)
println_Msg(F("BOUNTY BOB"));
display_Update();
displayMapperSelect_5200(i, false);
if (i == (a5200mapcount - 1))
i = 0;
else
@ -557,26 +577,7 @@ void setMapper_5200() {
}
}
display_Clear();
print_Msg(F("Mapper: "));
a5200index = i * 3;
a5200mapselect = pgm_read_byte(a5200mapsize + a5200index);
println_Msg(a5200mapselect);
if (a5200mapselect == 0)
println_Msg(F("STANDARD"));
else if (a5200mapselect == 1)
println_Msg(F("TWO CHIP"));
else if (a5200mapselect == 2)
println_Msg(F("BOUNTY BOB"));
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1);
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
display_Update();
displayMapperSelect_5200(i, true);
while (1) {
b = checkButton();
@ -587,26 +588,7 @@ void setMapper_5200() {
i--;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("Mapper: "));
a5200index = i * 3;
a5200mapselect = pgm_read_byte(a5200mapsize + a5200index);
println_Msg(a5200mapselect);
if (a5200mapselect == 0)
println_Msg(F("STANDARD"));
else if (a5200mapselect == 1)
println_Msg(F("TWO CHIP"));
else if (a5200mapselect == 2)
println_Msg(F("BOUNTY BOB"));
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1);
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
display_Update();
displayMapperSelect_5200(i, true);
}
if (b == 1) { // Next Mapper (press)
if (i == (a5200mapcount - 1))
@ -615,26 +597,7 @@ void setMapper_5200() {
i++;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("Mapper: "));
a5200index = i * 3;
a5200mapselect = pgm_read_byte(a5200mapsize + a5200index);
println_Msg(a5200mapselect);
if (a5200mapselect == 0)
println_Msg(F("STANDARD"));
else if (a5200mapselect == 1)
println_Msg(F("TWO CHIP"));
else if (a5200mapselect == 2)
println_Msg(F("BOUNTY BOB"));
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1);
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
display_Update();
displayMapperSelect_5200(i, true);
}
if (b == 3) { // Long Press - Execute (hold)
@ -839,10 +802,10 @@ bool getCartListInfo_5200() {
}
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("END OF FILE"));
println_Msg(FS(FSTRING_END_OF_FILE));
display_Update();
#else
Serial.println(F("END OF FILE"));
Serial.println(FS(FSTRING_END_OF_FILE));
#endif
return false;
@ -852,7 +815,7 @@ void checkCSV_5200() {
if (getCartListInfo_5200()) {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("CART SELECTED"));
println_Msg(FS(FSTRING_CART_SELECTED));
println_Msg(FS(FSTRING_EMPTY));
println_Msg(a5200game);
display_Update();
@ -865,7 +828,7 @@ void checkCSV_5200() {
display_Update();
#else
Serial.println(FS(FSTRING_EMPTY));
Serial.println(F("CART SELECTED"));
Serial.println(FS(FSTRING_CART_SELECTED));
Serial.println(a5200game);
// Display Settings
Serial.print(F("CODE: M"));
@ -877,10 +840,10 @@ void checkCSV_5200() {
} else {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56);
println_Msg(F("NO SELECTION"));
println_Msg(FS(FSTRING_NO_SELECTION));
display_Update();
#else
Serial.println(F("NO SELECTION"));
Serial.println(FS(FSTRING_NO_SELECTION));
#endif
}
}

View File

@ -627,7 +627,7 @@ void checkStatus_7800() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("ATARI 7800 READER"));
println_Msg(F("CURRENT SETTINGS"));
println_Msg(FS(FSTRING_CURRENT_SETTINGS));
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("MAPPER: "));
println_Msg(a7800mapper);
@ -668,21 +668,24 @@ void checkStatus_7800() {
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void displayMapperSelect_7800(int index) {
void displayMapperSelect_7800(int index, boolean printInstructions) {
display_Clear();
print_Msg(F("Mapper: "));
a7800index = index * 3;
a7800mapselect = pgm_read_byte(a7800mapsize + a7800index);
println_Msg(a7800mapselect);
println_Mapper7800(a7800mapselect);
println_Msg(FS(FSTRING_EMPTY));
if(printInstructions) {
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1);
print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1);
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
}
display_Update();
}
#endif
@ -712,13 +715,7 @@ void setMapper_7800() {
i--;
break;
}
display_Clear();
print_Msg(F("Mapper: "));
a7800index = i * 3;
a7800mapselect = pgm_read_byte(a7800mapsize + a7800index);
println_Msg(a7800mapselect);
println_Mapper7800(a7800mapselect);
display_Update();
displayMapperSelect_7800(i, false);
if (i == (a7800mapcount - 1))
i = 0;
else
@ -727,7 +724,7 @@ void setMapper_7800() {
}
}
displayMapperSelect_7800(i);
displayMapperSelect_7800(i, true);
while (1) {
b = checkButton();
@ -736,17 +733,14 @@ void setMapper_7800() {
i = a7800mapcount - 1;
else
i--;
displayMapperSelect_7800(i);
displayMapperSelect_7800(i, true);
}
if (b == 1) { // Next Mapper (press)
if (i == (a7800mapcount - 1))
i = 0;
else
i++;
displayMapperSelect_7800(i);
displayMapperSelect_7800(i, true);
}
if (b == 3) { // Long Press - Execute (hold)
new7800mapper = a7800mapselect;
@ -958,10 +952,10 @@ bool getCartListInfo_7800() {
}
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("END OF FILE"));
println_Msg(FS(FSTRING_END_OF_FILE));
display_Update();
#else
Serial.println(F("END OF FILE"));
Serial.println(FS(FSTRING_END_OF_FILE));
#endif
return false;
@ -971,7 +965,7 @@ void checkCSV_7800() {
if (getCartListInfo_7800()) {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("CART SELECTED"));
println_Msg(FS(FSTRING_CART_SELECTED));
println_Msg(FS(FSTRING_EMPTY));
println_Msg(a7800game);
display_Update();
@ -984,7 +978,7 @@ void checkCSV_7800() {
display_Update();
#else
Serial.println(FS(FSTRING_EMPTY));
Serial.println(F("CART SELECTED"));
Serial.println(FS(FSTRING_CART_SELECTED));
Serial.println(a7800game);
// Display Settings
Serial.print(F("CODE: M"));
@ -996,10 +990,10 @@ void checkCSV_7800() {
} else {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56);
println_Msg(F("NO SELECTION"));
println_Msg(FS(FSTRING_NO_SELECTION));
display_Update();
#else
Serial.println(F("NO SELECTION"));
Serial.println(FS(FSTRING_NO_SELECTION));
#endif
}
}

View File

@ -318,7 +318,7 @@ void checkStatus_ARC() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("ARCADIA 2001 READER"));
println_Msg(F("CURRENT SETTINGS"));
println_Msg(FS(FSTRING_CURRENT_SETTINGS));
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("ROM SIZE: "));
print_Msg(ARC[arcsize]);
@ -501,10 +501,10 @@ bool getCartListInfo_ARC() {
}
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("END OF FILE"));
println_Msg(FS(FSTRING_END_OF_FILE));
display_Update();
#else
Serial.println(F("END OF FILE"));
Serial.println(FS(FSTRING_END_OF_FILE));
#endif
return false;
@ -514,7 +514,7 @@ void checkCSV_ARC() {
if (getCartListInfo_ARC()) {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("CART SELECTED"));
println_Msg(FS(FSTRING_CART_SELECTED));
println_Msg(FS(FSTRING_EMPTY));
println_Msg(arcgame);
display_Update();
@ -525,7 +525,7 @@ void checkCSV_ARC() {
display_Update();
#else
Serial.println(FS(FSTRING_EMPTY));
Serial.println(F("CART SELECTED"));
Serial.println(FS(FSTRING_CART_SELECTED));
Serial.println(arcgame);
// Display Settings
Serial.print(F("CODE: R"));
@ -535,10 +535,10 @@ void checkCSV_ARC() {
} else {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56);
println_Msg(F("NO SELECTION"));
println_Msg(FS(FSTRING_NO_SELECTION));
display_Update();
#else
Serial.println(F("NO SELECTION"));
Serial.println(FS(FSTRING_NO_SELECTION));
#endif
}
}

View File

@ -105,7 +105,6 @@ byte c64lo = 0; // Lowest Entry
byte c64hi = 9; // Highest Entry
byte c64mapcount = 22; // (sizeof(mapsize)/sizeof(mapsize[0])) / 3;
boolean c64mapfound = false;
byte c64mapselect;
int c64index;
@ -742,6 +741,30 @@ void readROM_C64() {
//******************************************
// MAPPER CODE
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void displayMapperSelect_C64(int index, boolean printInstructions) {
display_Clear();
print_Msg(F("Mapper: "));
c64index = index * 3;
c64mapselect = pgm_read_byte(c64mapsize + c64index);
println_Msg(c64mapselect);
printMapper_C64(c64mapselect);
if(printInstructions) {
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1);
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
}
display_Update();
}
#endif
void setMapper_C64() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
uint8_t b = 0;
@ -767,13 +790,7 @@ void setMapper_C64() {
i--;
break;
}
display_Clear();
print_Msg(F("Mapper: "));
c64index = i * 3;
c64mapselect = pgm_read_byte(c64mapsize + c64index);
println_Msg(c64mapselect);
printMapper_C64(c64mapselect);
display_Update();
displayMapperSelect_C64(i, false);
if (i == (c64mapcount - 1))
i = 0;
else
@ -782,21 +799,7 @@ void setMapper_C64() {
}
}
display_Clear();
print_Msg(F("Mapper: "));
c64index = i * 3;
c64mapselect = pgm_read_byte(c64mapsize + c64index);
println_Msg(c64mapselect);
printMapper_C64(c64mapselect);
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1);
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
display_Update();
displayMapperSelect_C64(i, true);
while (1) {
b = checkButton();
@ -806,22 +809,7 @@ void setMapper_C64() {
else
i--;
display_Clear();
print_Msg(F("Mapper: "));
c64index = i * 3;
c64mapselect = pgm_read_byte(c64mapsize + c64index);
println_Msg(c64mapselect);
printMapper_C64(c64mapselect);
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1);
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
display_Update();
displayMapperSelect_C64(i, true);
}
if (b == 1) { // Next Mapper (press)
if (i == (c64mapcount - 1))
@ -829,22 +817,7 @@ void setMapper_C64() {
else
i++;
display_Clear();
print_Msg(F("Mapper: "));
c64index = i * 3;
c64mapselect = pgm_read_byte(c64mapsize + c64index);
println_Msg(c64mapselect);
printMapper_C64(c64mapselect);
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1);
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
display_Update();
displayMapperSelect_C64(i, true);
}
if (b == 3) { // Long Press - Execute (hold)
newc64mapper = c64mapselect;
@ -860,7 +833,7 @@ void setMapper_C64() {
#else
setmapper:
String newmap;
c64mapfound = false;
boolean c64mapfound = false;
printMapper_C64(0);
Serial.print(F("Enter Mapper [0-22]: "));
while (Serial.available() == 0) {}
@ -1119,7 +1092,7 @@ void checkStatus_C64() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("C64 READER"));
println_Msg(F("CURRENT SETTINGS"));
println_Msg(FS(FSTRING_CURRENT_SETTINGS));
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("MAPPER: "));
println_Msg(c64mapper);
@ -1416,10 +1389,10 @@ bool getCartListInfo_C64() {
}
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("END OF FILE"));
println_Msg(FS(FSTRING_END_OF_FILE));
display_Update();
#else
Serial.println(F("END OF FILE"));
Serial.println(FS(FSTRING_END_OF_FILE));
#endif
return false;
@ -1429,7 +1402,7 @@ void checkCSV_C64() {
if (getCartListInfo_C64()) {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("CART SELECTED"));
println_Msg(FS(FSTRING_CART_SELECTED));
println_Msg(FS(FSTRING_EMPTY));
println_Msg(c64game);
display_Update();
@ -1444,7 +1417,7 @@ void checkCSV_C64() {
display_Update();
#else
Serial.println(FS(FSTRING_EMPTY));
Serial.println(F("CART SELECTED"));
Serial.println(FS(FSTRING_CART_SELECTED));
Serial.println(c64game);
// Display Settings
Serial.print(F("CODE: M"));
@ -1458,10 +1431,10 @@ void checkCSV_C64() {
} else {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56);
println_Msg(F("NO SELECTION"));
println_Msg(FS(FSTRING_NO_SELECTION));
display_Update();
#else
Serial.println(F("NO SELECTION"));
Serial.println(FS(FSTRING_NO_SELECTION));
#endif
}
}

View File

@ -343,7 +343,7 @@ void checkStatus_COL() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("COLECOVISION READER"));
println_Msg(F("CURRENT SETTINGS"));
println_Msg(FS(FSTRING_CURRENT_SETTINGS));
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("ROM SIZE: "));
print_Msg(pgm_read_byte(&(COL[colsize])));

View File

@ -654,7 +654,7 @@ void checkStatus_FAIRCHILD() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("CHANNEL F READER"));
println_Msg(F("CURRENT SETTINGS"));
println_Msg(FS(FSTRING_CURRENT_SETTINGS));
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("ROM SIZE: "));
print_Msg(FAIRCHILD[fairchildsize]);
@ -837,10 +837,10 @@ bool getCartListInfo_FAIRCHILD() {
}
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("END OF FILE"));
println_Msg(FS(FSTRING_END_OF_FILE));
display_Update();
#else
Serial.println(F("END OF FILE"));
Serial.println(FS(FSTRING_END_OF_FILE));
#endif
return false;
@ -850,7 +850,7 @@ void checkCSV_FAIRCHILD() {
if (getCartListInfo_FAIRCHILD()) {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("CART SELECTED"));
println_Msg(FS(FSTRING_CART_SELECTED));
println_Msg(FS(FSTRING_EMPTY));
println_Msg(fairchildgame);
display_Update();
@ -861,7 +861,7 @@ void checkCSV_FAIRCHILD() {
display_Update();
#else
Serial.println(FS(FSTRING_EMPTY));
Serial.println(F("CART SELECTED"));
Serial.println(FS(FSTRING_CART_SELECTED));
Serial.println(fairchildgame);
// Display Settings
Serial.print(F("CODE: R"));
@ -871,10 +871,10 @@ void checkCSV_FAIRCHILD() {
} else {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56);
println_Msg(F("NO SELECTION"));
println_Msg(FS(FSTRING_NO_SELECTION));
display_Update();
#else
Serial.println(F("NO SELECTION"));
Serial.println(FS(FSTRING_NO_SELECTION));
#endif
}
}

View File

@ -484,6 +484,27 @@ void ecsBank(uint32_t addr, uint8_t bank) {
//******************************************
// MAPPER CODE
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void displayMapperSelect_INTV(int index, boolean printInstructions) {
display_Clear();
print_Msg(F("Mapper: "));
intvindex = index * 4;
intvmapselect = pgm_read_byte(intvmapsize + intvindex);
println_Msg(intvmapselect);
if(printInstructions) {
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1);
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
}
display_Update();
}
#endif
void setMapper_INTV() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
@ -510,12 +531,7 @@ void setMapper_INTV() {
i--;
break;
}
display_Clear();
print_Msg(F("Mapper: "));
intvindex = i * 4;
intvmapselect = pgm_read_byte(intvmapsize + intvindex);
println_Msg(intvmapselect);
display_Update();
displayMapperSelect_INTV(i, false);
if (i == (intvmapcount - 1))
i = 0;
else
@ -524,20 +540,7 @@ void setMapper_INTV() {
}
}
display_Clear();
print_Msg(F("Mapper: "));
intvindex = i * 4;
intvmapselect = pgm_read_byte(intvmapsize + intvindex);
println_Msg(intvmapselect);
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1);
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
display_Update();
displayMapperSelect_INTV(i, true);
while (1) {
b = checkButton();
@ -549,20 +552,7 @@ void setMapper_INTV() {
i--;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("Mapper: "));
intvindex = i * 4;
intvmapselect = pgm_read_byte(intvmapsize + intvindex);
println_Msg(intvmapselect);
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1);
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
display_Update();
displayMapperSelect_INTV(i, true);
}
if (b == 1) { // Next Mapper (press)
if (i == (intvmapcount - 1))
@ -571,20 +561,7 @@ void setMapper_INTV() {
i++;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("Mapper: "));
intvindex = i * 4;
intvmapselect = pgm_read_byte(intvmapsize + intvindex);
println_Msg(intvmapselect);
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
print_STR(right_to_select_STR, 1);
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
display_Update();
displayMapperSelect_INTV(i, true);
}
if (b == 3) { // Long Press - Execute (hold)
newintvmapper = intvmapselect;
@ -758,7 +735,7 @@ void checkStatus_INTV() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("INTELLIVISION READER"));
println_Msg(F("CURRENT SETTINGS"));
println_Msg(FS(FSTRING_CURRENT_SETTINGS));
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("MAPPER: "));
println_Msg(intvmapper);

View File

@ -1313,7 +1313,7 @@ void checkStatus_MSX() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("MSX READER"));
println_Msg(F("CURRENT SETTINGS"));
println_Msg(FS(FSTRING_CURRENT_SETTINGS));
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("MAPPER: "));
println_Msg(msxmapper);
@ -1586,10 +1586,10 @@ bool getCartListInfo_MSX() {
}
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("END OF FILE"));
println_Msg(FS(FSTRING_END_OF_FILE));
display_Update();
#else
Serial.println(F("END OF FILE"));
Serial.println(FS(FSTRING_END_OF_FILE));
#endif
return false;
@ -1599,7 +1599,7 @@ void checkCSV_MSX() {
if (getCartListInfo_MSX()) {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("CART SELECTED"));
println_Msg(FS(FSTRING_CART_SELECTED));
println_Msg(FS(FSTRING_EMPTY));
println_Msg(msxgame);
display_Update();
@ -1614,7 +1614,7 @@ void checkCSV_MSX() {
display_Update();
#else
Serial.println(FS(FSTRING_EMPTY));
Serial.println(F("CART SELECTED"));
Serial.println(FS(FSTRING_CART_SELECTED));
Serial.println(msxgame);
// Display Settings
Serial.print(F("CODE: M"));
@ -1628,10 +1628,10 @@ void checkCSV_MSX() {
} else {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56);
println_Msg(F("NO SELECTION"));
println_Msg(FS(FSTRING_NO_SELECTION));
display_Update();
#else
Serial.println(F("NO SELECTION"));
Serial.println(FS(FSTRING_NO_SELECTION));
#endif
}
}

View File

@ -1972,7 +1972,7 @@ void checkStatus_NES() {
display_Clear();
println_Msg(F("NES CART READER"));
println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("CURRENT SETTINGS"));
println_Msg(FS(FSTRING_CURRENT_SETTINGS));
println_Msg(FS(FSTRING_EMPTY));
printNESSettings();
println_Msg(FS(FSTRING_EMPTY));

View File

@ -403,7 +403,7 @@ void checkStatus_ODY2() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("ODYSSEY 2 READER"));
println_Msg(F("CURRENT SETTINGS"));
println_Msg(FS(FSTRING_CURRENT_SETTINGS));
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("MAPPER: "));
println_Msg(ody2mapper);
@ -595,10 +595,10 @@ bool getCartListInfo_ODY2() {
}
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("END OF FILE"));
println_Msg(FS(FSTRING_END_OF_FILE));
display_Update();
#else
Serial.println(F("END OF FILE"));
Serial.println(FS(FSTRING_END_OF_FILE));
#endif
return false;
@ -608,7 +608,7 @@ void checkCSV_ODY2() {
if (getCartListInfo_ODY2()) {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("CART SELECTED"));
println_Msg(FS(FSTRING_CART_SELECTED));
println_Msg(FS(FSTRING_EMPTY));
println_Msg(ody2game);
display_Update();
@ -621,7 +621,7 @@ void checkCSV_ODY2() {
display_Update();
#else
Serial.println(FS(FSTRING_EMPTY));
Serial.println(F("CART SELECTED"));
Serial.println(FS(FSTRING_CART_SELECTED));
Serial.println(ody2game);
// Display Settings
Serial.print(F("CODE: M"));
@ -633,10 +633,10 @@ void checkCSV_ODY2() {
} else {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56);
println_Msg(F("NO SELECTION"));
println_Msg(FS(FSTRING_NO_SELECTION));
display_Update();
#else
Serial.println(F("NO SELECTION"));
Serial.println(FS(FSTRING_NO_SELECTION));
#endif
}
}

View File

@ -56,6 +56,9 @@ constexpr char PROGMEM FSTRING_RESET[] = "Reset";
constexpr char PROGMEM FSTRING_OK[] = "OK";
constexpr char PROGMEM FSTRING_EMPTY[] = "";
constexpr char PROGMEM FSTRING_SPACE[] = " ";
constexpr char PROGMEM FSTRING_CURRENT_SETTINGS[] = "CURRENT SETTINGS";
constexpr char PROGMEM FSTRING_NO_SELECTION[] = "NO SELECTION";
constexpr char PROGMEM FSTRING_END_OF_FILE[] = "END OF FILE";
// Messages
constexpr char PROGMEM FSTRING_OSCR[] = "OSCR";
@ -69,6 +72,7 @@ constexpr char PROGMEM FSTRING_SELECT_CART[] = "Select Cart";
constexpr char PROGMEM FSTRING_SELECT_CART_TYPE[] = "Select Cart Type";
constexpr char PROGMEM FSTRING_SET_SIZE[] = "Set Size";
constexpr char PROGMEM FSTRING_REFRESH_CART[] = "Refresh Cart";
constexpr char PROGMEM FSTRING_CART_SELECTED[] = "CART SELECTED";
/*==== /CONSTANTS =================================================*/

View File

@ -36,6 +36,9 @@ extern const char PROGMEM FSTRING_OK[];
extern const char PROGMEM FSTRING_EMPTY[];
extern const char PROGMEM FSTRING_SPACE[];
extern const char PROGMEM FSTRING_RESET[];
extern const char PROGMEM FSTRING_CURRENT_SETTINGS[];
extern const char PROGMEM FSTRING_NO_SELECTION[];
extern const char PROGMEM FSTRING_END_OF_FILE[];
// Messages
extern const char PROGMEM FSTRING_OSCR[];
@ -49,6 +52,7 @@ extern const char PROGMEM FSTRING_SELECT_CART[];
extern const char PROGMEM FSTRING_SELECT_CART_TYPE[];
extern const char PROGMEM FSTRING_SET_SIZE[];
extern const char PROGMEM FSTRING_REFRESH_CART[];
extern const char PROGMEM FSTRING_CART_SELECTED[];
#define FS(pmem_string) (reinterpret_cast<const __FlashStringHelper *>(pmem_string))

View File

@ -375,7 +375,7 @@ void checkStatus_VECTREX() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("VECTREX READER"));
println_Msg(F("CURRENT SETTINGS"));
println_Msg(FS(FSTRING_CURRENT_SETTINGS));
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("ROM SIZE: "));
print_Msg(VECTREX[vectrexsize]);
@ -558,10 +558,10 @@ bool getCartListInfo_VECTREX() {
}
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("END OF FILE"));
println_Msg(FS(FSTRING_END_OF_FILE));
display_Update();
#else
Serial.println(F("END OF FILE"));
Serial.println(FS(FSTRING_END_OF_FILE));
#endif
return false;
@ -571,7 +571,7 @@ void checkCSV_VECTREX() {
if (getCartListInfo_VECTREX()) {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("CART SELECTED"));
println_Msg(FS(FSTRING_CART_SELECTED));
println_Msg(FS(FSTRING_EMPTY));
println_Msg(vectrexgame);
display_Update();
@ -582,7 +582,7 @@ void checkCSV_VECTREX() {
display_Update();
#else
Serial.println(FS(FSTRING_EMPTY));
Serial.println(F("CART SELECTED"));
Serial.println(FS(FSTRING_CART_SELECTED));
Serial.println(vectrexgame);
// Display Settings
Serial.print(F("CODE: R"));
@ -592,10 +592,10 @@ void checkCSV_VECTREX() {
} else {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display.setCursor(0, 56);
println_Msg(F("NO SELECTION"));
println_Msg(FS(FSTRING_NO_SELECTION));
display_Update();
#else
Serial.println(F("NO SELECTION"));
Serial.println(FS(FSTRING_NO_SELECTION));
#endif
}
}

View File

@ -360,7 +360,7 @@ void checkStatus_WSV() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
println_Msg(F("WATARA SUPERVISION"));
println_Msg(F("CURRENT SETTINGS"));
println_Msg(FS(FSTRING_CURRENT_SETTINGS));
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("ROM SIZE: "));
print_Msg(pgm_read_word(&(WSV[wsvsize])));