remove duplicate code to select mapper, rom and ram configurations

This commit is contained in:
smesgr9000 2024-05-01 21:27:45 +02:00
parent 2826ded431
commit 330e615b8c
14 changed files with 299 additions and 1430 deletions

View File

@ -653,91 +653,21 @@ void checkStatus_2600() {
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void displayMapperSelect_2600(uint8_t index, boolean printInstructions) {
void printMapperSelection_2600(uint8_t index) {
display_Clear();
print_Msg(F("Mapper: "));
a2600index = index * 2;
a2600mapselect = pgm_read_byte(a2600mapsize + a2600index);
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);
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
}
display_Update();
}
#endif
void setMapper_2600() {
byte new2600mapper;
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
uint8_t b = 0;
int i = 0;
// Check Button Status
#if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif
navigateMenu(0, a2600mapcount - 1, &printMapperSelection_2600);
new2600mapper = a2600mapselect;
if (buttonVal1 == LOW) { // Button Pressed
while (1) { // Scroll Mapper List
#if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2
#endif
if (buttonVal1 == HIGH) { // Button Released
// Correct Overshoot
if (i == 0)
i = a2600mapcount - 1;
else
i--;
break;
}
displayMapperSelect_2600(i, false);
if (i == (a2600mapcount - 1))
i = 0;
else
i++;
delay(250);
}
}
b = 0;
displayMapperSelect_2600(i, true);
while (1) {
b = checkButton();
if (b == 2) { // Previous Mapper (doubleclick)
if (i == 0)
i = a2600mapcount - 1;
else
i--;
// Only update display after input because of slow LCD library
displayMapperSelect_2600(i, true);
}
if (b == 1) { // Next Mapper (press)
if (i == (a2600mapcount - 1))
i = 0;
else
i++;
// Only update display after input because of slow LCD library
displayMapperSelect_2600(i, true);
}
if (b == 3) { // Long Press - Execute (hold)
new2600mapper = a2600mapselect;
break;
}
}
display.setCursor(0, 56);
print_Msg(F("MAPPER "));
println_Mapper2600(new2600mapper);

View File

@ -73,9 +73,7 @@ byte a5200[] = { 4, 8, 16, 32, 40 };
byte a5200lo = 0; // Lowest Entry
byte a5200hi = 4; // Highest Entry
byte a5200mapper = 0;
byte new5200mapper;
byte a5200size;
byte new5200size;
// EEPROM MAPPING
// 07 MAPPER
@ -370,75 +368,23 @@ void checkMapperSize_5200() {
}
}
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void printRomSize_5200(int index) {
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(a5200[index]);
}
#endif
void setROMSize_5200() {
byte new5200size;
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
if (a5200lo == a5200hi)
new5200size = a5200lo;
else {
uint8_t b = 0;
int i = a5200lo;
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(a5200[i]);
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();
while (1) {
b = checkButton();
if (b == 2) { // Previous (doubleclick)
if (i == a5200lo)
i = a5200hi;
else
i--;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(a5200[i]);
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();
}
if (b == 1) { // Next (press)
if (i == a5200hi)
i = a5200lo;
else
i++;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(a5200[i]);
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();
}
if (b == 3) { // Long Press - Execute (hold)
new5200size = i;
break;
}
}
new5200size = navigateMenu(a5200lo, a5200hi, &printRomSize_5200);
display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));
@ -517,92 +463,24 @@ void checkStatus_5200() {
//******************************************
// SET MAPPER
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void displayMapperSelect_5200(int index, boolean printInstructions) {
void printMapperSelection_5200(int index) {
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() {
byte new5200mapper;
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
uint8_t b = 0;
int i = 0;
// Check Button Status
#if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif
if (buttonVal1 == LOW) { // Button Pressed
while (1) { // Scroll Mapper List
#if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2
#endif
if (buttonVal1 == HIGH) { // Button Released
// Correct Overshoot
if (i == 0)
i = a5200mapcount - 1;
else
i--;
break;
}
displayMapperSelect_5200(i, false);
if (i == (a5200mapcount - 1))
i = 0;
else
i++;
delay(250);
}
}
navigateMenu(0, a5200mapcount - 1, &printMapperSelection_5200);
new5200mapper = a5200mapselect;
displayMapperSelect_5200(i, true);
while (1) {
b = checkButton();
if (b == 2) { // Previous Mapper (doubleclick)
if (i == 0)
i = a5200mapcount - 1;
else
i--;
// Only update display after input because of slow LCD library
displayMapperSelect_5200(i, true);
}
if (b == 1) { // Next Mapper (press)
if (i == (a5200mapcount - 1))
i = 0;
else
i++;
// Only update display after input because of slow LCD library
displayMapperSelect_5200(i, true);
}
if (b == 3) { // Long Press - Execute (hold)
new5200mapper = a5200mapselect;
break;
}
}
display.setCursor(0, 56);
print_Msg(F("MAPPER "));
print_Msg(new5200mapper);

View File

@ -500,6 +500,12 @@ void println_Mapper7800(byte mapper) {
else if (mapper == 7)
println_Msg(F("BANKSET"));
}
void printRomSize_7800(int index) {
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(a7800[index]);
}
#endif
void setROMSize_7800() {
@ -510,66 +516,10 @@ void setROMSize_7800() {
new7800size = a7800lo;
else {
uint8_t b = 0;
int i = a7800lo;
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(a7800[i]);
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();
while (1) {
b = checkButton();
if (b == 2) { // Previous (doubleclick)
if (i == a7800lo)
i = a7800hi;
else
i--;
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(a7800[i]);
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();
}
if (b == 1) { // Next (press)
if (i == a7800hi)
i = a7800lo;
else
i++;
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(a7800[i]);
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();
}
if (b == 3) { // Long Press - Execute (hold)
new7800size = i;
break;
}
}
new7800size = navigateMenu(a7800lo, a7800hi, &printRomSize_7800);
display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));
@ -665,86 +615,22 @@ void checkStatus_7800() {
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void displayMapperSelect_7800(int index, boolean printInstructions) {
void printMapperSelection_7800(int index) {
display_Clear();
print_Msg(F("Mapper: "));
a7800index = index * 3;
a7800mapselect = pgm_read_byte(a7800mapsize + a7800index);
println_Msg(a7800mapselect);
println_Mapper7800(a7800mapselect);
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_7800() {
byte new7800mapper = 0;
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
uint8_t b = 0;
int i = 0;
// Check Button Status
#if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif
if (buttonVal1 == LOW) { // Button Pressed
while (1) { // Scroll Mapper List
#if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif
if (buttonVal1 == HIGH) { // Button Released
// Correct Overshoot
if (i == 0)
i = a7800mapcount - 1;
else
i--;
break;
}
displayMapperSelect_7800(i, false);
if (i == (a7800mapcount - 1))
i = 0;
else
i++;
delay(250);
}
}
navigateMenu(0, a7800mapcount - 1, &printMapperSelection_7800);
new7800mapper = a7800mapselect;
displayMapperSelect_7800(i, true);
while (1) {
b = checkButton();
if (b == 2) { // Previous Mapper (doubleclick)
if (i == 0)
i = a7800mapcount - 1;
else
i--;
displayMapperSelect_7800(i, true);
}
if (b == 1) { // Next Mapper (press)
if (i == (a7800mapcount - 1))
i = 0;
else
i++;
displayMapperSelect_7800(i, true);
}
if (b == 3) { // Long Press - Execute (hold)
new7800mapper = a7800mapselect;
break;
}
}
display.setCursor(0, 56);
print_Msg(F("MAPPER "));
print_Msg(new7800mapper);

View File

@ -40,7 +40,6 @@ byte arclo = 0; // Lowest Entry
byte archi = 3; // Highest Entry
byte arcsize;
byte newarcsize;
// EEPROM MAPPING
// 08 ROM SIZE
@ -198,75 +197,23 @@ void readROM_ARC() {
// ROM SIZE
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void printRomSize_ARC(int index) {
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(ARC[index]);
}
#endif
void setROMSize_ARC() {
byte newarcsize;
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
if (arclo == archi)
newarcsize = arclo;
else {
uint8_t b = 0;
int i = arclo;
newarcsize = navigateMenu(arclo, archi, &printRomSize_ARC);
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(ARC[i]);
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();
while (1) {
b = checkButton();
if (b == 2) { // Previous (doubleclick)
if (i == arclo)
i = archi;
else
i--;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(ARC[i]);
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();
}
if (b == 1) { // Next (press)
if (i == archi)
i = arclo;
else
i++;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(ARC[i]);
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();
}
if (b == 3) { // Long Press - Execute (hold)
newarcsize = i;
break;
}
}
display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));

View File

@ -652,26 +652,15 @@ void readROM_C64() {
//******************************************
// MAPPER CODE
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void displayMapperSelect_C64(int index, boolean printInstructions) {
void printMapperSelection_C64(int index) {
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
@ -679,63 +668,9 @@ void displayMapperSelect_C64(int index, boolean printInstructions) {
void setMapper_C64() {
byte newc64mapper;
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
uint8_t b = 0;
int i = 0;
// Check Button Status
#if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif
if (buttonVal1 == LOW) { // Button Pressed
while (1) { // Scroll Mapper List
#if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif
if (buttonVal1 == HIGH) { // Button Released
// Correct Overshoot
if (i == 0)
i = c64mapcount - 1;
else
i--;
break;
}
displayMapperSelect_C64(i, false);
if (i == (c64mapcount - 1))
i = 0;
else
i++;
delay(250);
}
}
navigateMenu(0, c64mapcount - 1, &printMapperSelection_C64);
newc64mapper = c64mapselect;
displayMapperSelect_C64(i, true);
while (1) {
b = checkButton();
if (b == 2) { // Previous Mapper (doubleclick)
if (i == 0)
i = c64mapcount - 1;
else
i--;
displayMapperSelect_C64(i, true);
}
if (b == 1) { // Next Mapper (press)
if (i == (c64mapcount - 1))
i = 0;
else
i++;
displayMapperSelect_C64(i, true);
}
if (b == 3) { // Long Press - Execute (hold)
newc64mapper = c64mapselect;
break;
}
}
display.setCursor(0, 56);
print_Msg(F("MAPPER "));
print_Msg(newc64mapper);
@ -784,6 +719,15 @@ void checkMapperSize_C64() {
//******************************************
// SET ROM SIZE
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void printRomSize_C64(int index) {
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(C64[index]);
}
#endif
void setROMSize_C64() {
byte newc64size;
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
@ -791,67 +735,8 @@ void setROMSize_C64() {
if (c64lo == c64hi)
newc64size = c64lo;
else {
uint8_t b = 0;
int i = c64lo;
newc64size = navigateMenu(c64lo, c64hi, &printRomSize_C64);
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(C64[i]);
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();
while (1) {
b = checkButton();
if (b == 2) { // Previous (doubleclick)
if (i == c64lo)
i = c64hi;
else
i--;
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(C64[i]);
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();
}
if (b == 1) { // Next (press)
if (i == c64hi)
i = c64lo;
else
i++;
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(C64[i]);
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();
}
if (b == 3) { // Long Press - Execute (hold)
newc64size = i;
break;
}
}
display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));

View File

@ -39,7 +39,6 @@ byte collo = 0; // Lowest Entry
byte colhi = 5; // Highest Entry
byte colsize;
byte newcolsize;
// EEPROM MAPPING
// 08 ROM SIZE
@ -225,77 +224,26 @@ void readROM_COL() {
// ROM SIZE
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void printRomSize_COL(int index) {
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(pgm_read_byte(&(COL[index])));
}
#endif
void setROMSize_COL() {
byte newcolsize;
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
if (collo == colhi)
newcolsize = collo;
else {
uint8_t b = 0;
int i = collo;
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(pgm_read_byte(&(COL[i])));
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();
while (1) {
b = checkButton();
if (b == 2) { // Previous (doubleclick)
if (i == collo)
i = colhi;
else
i--;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(pgm_read_byte(&(COL[i])));
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();
}
if (b == 1) { // Next (press)
if (i == colhi)
i = collo;
else
i++;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(pgm_read_byte(&(COL[i])));
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();
}
if (b == 3) { // Long Press - Execute (hold)
newcolsize = i;
break;
}
}
newcolsize = navigateMenu(collo, colhi, &printRomSize_COL);
display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));
print_Msg(pgm_read_byte(&(COL[newcolsize])));
println_Msg(F("K"));

View File

@ -783,6 +783,89 @@ boolean checkCartSelection(FsFile& database, void (*readData)(FsFile&, void*), v
return false;
}
#if (defined(ENABLE_ODY2) || defined(ENABLE_ARC) || defined(ENABLE_FAIRCHILD) || defined(ENABLE_MSX) || defined(ENABLE_POKE) || defined(ENABLE_2600) || defined(ENABLE_5200) || defined(ENABLE_7800) || defined(ENABLE_C64) || defined(ENABLE_VECTREX) || defined(ENABLE_NES))
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void 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();
}
int navigateMenu(int min, int max, void (*printSelection)(int)) {
uint8_t b = 0;
int i = min;
// Check Button Status
#if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif
if (buttonVal1 == LOW) { // Button Pressed
while (1) { // Scroll Mapper List
#if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2
#endif
if (buttonVal1 == HIGH) { // Button Released
// Correct Overshoot
if (i == min)
i = max;
else
i--;
break;
}
printSelection(i);
display_Update();
if (i == max)
i = min;
else
i++;
delay(250);
}
}
b = 0;
printSelection(i);
printInstructions();
while (1) {
b = checkButton();
if (b == 2) { // Previous Mapper (doubleclick)
if (i == min)
i = max;
else
i--;
// Only update display after input because of slow LCD library
printSelection(i);
printInstructions();
}
if (b == 1) { // Next Mapper (press)
if (i == max)
i = min;
else
i++;
// Only update display after input because of slow LCD library
printSelection(i);
printInstructions();
}
if (b == 3) { // Long Press - Execute (hold)
return i;
}
}
}
#endif
#endif
void starting_letter__subDraw(byte selection, byte line) {
display.setDrawColor(0);
for (uint8_t i = 0; i < 4; i++) display.drawLine(0, 10 + i * 16, 128, 10 + i * 16);

View File

@ -538,6 +538,14 @@ void read16K_FAIRCHILD() // Read 16K Bytes
// ROM SIZE
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void printRomSize_FAIRCHILD(int index) {
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(FAIRCHILD[index]);
}
#endif
void setROMSize_FAIRCHILD() {
byte newfairchildsize;
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
@ -545,66 +553,8 @@ void setROMSize_FAIRCHILD() {
if (fairchildlo == fairchildhi)
newfairchildsize = fairchildlo;
else {
uint8_t b = 0;
int i = fairchildlo;
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(FAIRCHILD[i]);
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();
while (1) {
b = checkButton();
if (b == 2) { // Previous (doubleclick)
if (i == fairchildlo)
i = fairchildhi;
else
i--;
newfairchildsize = navigateMenu(fairchildlo, fairchildhi, &printRomSize_FAIRCHILD);
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(FAIRCHILD[i]);
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();
}
if (b == 1) { // Next (press)
if (i == fairchildhi)
i = fairchildlo;
else
i++;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(FAIRCHILD[i]);
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();
}
if (b == 3) { // Long Press - Execute (hold)
newfairchildsize = i;
break;
}
}
display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));

View File

@ -80,9 +80,7 @@ byte intvlo = 0; // Lowest Entry
byte intvhi = 5; // Highest Entry
byte intvmapper;
byte newintvmapper;
byte intvsize;
byte newintvsize;
// EEPROM MAPPING
// 07 MAPPER
@ -485,89 +483,21 @@ void ecsBank(uint32_t addr, uint8_t bank) {
// MAPPER CODE
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void displayMapperSelect_INTV(int index, boolean printInstructions) {
void printMapperSelection_INTV(int index) {
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() {
byte newintvmapper;
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
uint8_t b = 0;
int i = 0;
// Check Button Status
#if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); // PG2
#endif
if (buttonVal1 == LOW) { // Button Pressed
while (1) { // Scroll Mapper List
#if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); // PG2
#endif
if (buttonVal1 == HIGH) { // Button Released
// Correct Overshoot
if (i == 0)
i = intvmapcount - 1;
else
i--;
break;
}
displayMapperSelect_INTV(i, false);
if (i == (intvmapcount - 1))
i = 0;
else
i++;
delay(250);
}
}
displayMapperSelect_INTV(i, true);
while (1) {
b = checkButton();
if (b == 2) { // Previous Mapper (doubleclick)
if (i == 0)
i = intvmapcount - 1;
else
i--;
// Only update display after input because of slow LCD library
displayMapperSelect_INTV(i, true);
}
if (b == 1) { // Next Mapper (press)
if (i == (intvmapcount - 1))
i = 0;
else
i++;
// Only update display after input because of slow LCD library
displayMapperSelect_INTV(i, true);
}
if (b == 3) { // Long Press - Execute (hold)
newintvmapper = intvmapselect;
break;
}
}
navigateMenu(0, intvmapcount - 1, &printMapperSelection_INTV);
newintvmapper = intvmapselect;
display.setCursor(0, 56);
print_Msg(F("MAPPER "));
print_Msg(newintvmapper);
@ -612,75 +542,23 @@ void checkMapperSize_INTV() {
}
}
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void printRomSize_INTV(int index) {
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(pgm_read_byte(&(INTV[index])));
}
#endif
void setROMSize_INTV() {
byte newintvsize;
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
if (intvlo == intvhi)
newintvsize = intvlo;
else {
uint8_t b = 0;
int i = intvlo;
newintvsize = navigateMenu(intvlo, intvhi, &printRomSize_INTV);
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(pgm_read_byte(&(INTV[i])));
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();
while (1) {
b = checkButton();
if (b == 2) { // Previous (doubleclick)
if (i == intvlo)
i = intvhi;
else
i--;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(pgm_read_byte(&(INTV[i])));
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();
}
if (b == 1) { // Next (press)
if (i == intvhi)
i = intvlo;
else
i++;
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(pgm_read_byte(&(INTV[i])));
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();
}
if (b == 3) { // Long Press - Execute (hold)
newintvsize = i;
break;
}
}
display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));

View File

@ -855,116 +855,24 @@ void writeRAM_MSX() {
//******************************************
// MAPPER CODE
//******************************************
void setMapper_MSX() {
byte newmsxmapper;
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
uint8_t b = 0;
int i = 0;
// Check Button Status
#if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(ENABLE_LCD)
boolean buttonVal1 = (PING & (1 << 2)); //PG2
#endif
if (buttonVal1 == LOW) { // Button Pressed
while (1) { // Scroll Mapper List
#if defined(ENABLE_OLED)
buttonVal1 = (PIND & (1 << 7)); // PD7
#elif defined(ENABLE_LCD)
buttonVal1 = (PING & (1 << 2)); //PG2
#endif
if (buttonVal1 == HIGH) { // Button Released
// Correct Overshoot
if (i == 0)
i = msxmapcount - 1;
else
i--;
break;
}
display_Clear();
print_Msg(F("Mapper: "));
msxindex = i * 5;
msxmapselect = pgm_read_byte(msxmapsize + msxindex);
println_Msg(msxmapselect);
printMapper(msxmapselect);
display_Update();
if (i == (msxmapcount - 1))
i = 0;
else
i++;
delay(250);
}
}
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void printMapperSelection_MSX(int index) {
display_Clear();
print_Msg(F("Mapper: "));
msxindex = i * 5;
msxindex = index * 5;
msxmapselect = pgm_read_byte(msxmapsize + msxindex);
println_Msg(msxmapselect);
printMapper(msxmapselect);
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();
while (1) {
b = checkButton();
if (b == 2) { // Previous Mapper (doubleclick)
if (i == 0)
i = msxmapcount - 1;
else
i--;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("Mapper: "));
msxindex = i * 5;
msxmapselect = pgm_read_byte(msxmapsize + msxindex);
println_Msg(msxmapselect);
printMapper(msxmapselect);
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();
}
if (b == 1) { // Next Mapper (press)
if (i == (msxmapcount - 1))
i = 0;
else
i++;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("Mapper: "));
msxindex = i * 5;
msxmapselect = pgm_read_byte(msxmapsize + msxindex);
println_Msg(msxmapselect);
printMapper(msxmapselect);
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();
}
if (b == 3) { // Long Press - Execute (hold)
newmsxmapper = msxmapselect;
break;
}
}
void setMapper_MSX() {
byte newmsxmapper;
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
navigateMenu(0, msxmapcount - 1, &printMapperSelection_MSX);
newmsxmapper = msxmapselect;
display.setCursor(0, 56);
print_Msg(F("MAPPER "));
print_Msg(newmsxmapper);
@ -1015,6 +923,15 @@ void checkMapperSize_MSX() {
//******************************************
// SET ROM SIZE
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void printRomSize_MSX(uint8_t index) {
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(MSX[index]);
}
#endif
void setROMSize_MSX() {
byte newmsxsize;
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
@ -1025,18 +942,8 @@ void setROMSize_MSX() {
uint8_t b = 0;
int i = msxlo;
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(MSX[i]);
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();
printRomSize_MSX(i);
printInstructions();
while (1) {
b = checkButton();
@ -1053,18 +960,8 @@ void setROMSize_MSX() {
i--;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(MSX[i]);
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();
printRomSize_MSX(i);
printInstructions();
}
}
if (b == 1) { // Next (press)
@ -1080,18 +977,8 @@ void setROMSize_MSX() {
i++;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(MSX[i]);
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();
printRomSize_MSX(i);
printInstructions();
}
}
if (b == 3) { // Long Press - Execute (hold)
@ -1157,6 +1044,15 @@ setrom:
//******************************************
// SET RAM SIZE
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void printRamSize_MSX(uint8_t index) {
display_Clear();
print_Msg(F("RAM Size: "));
println_Msg(MSXRAM[index]);
}
#endif
void setRAMSize_MSX() {
byte newmsxramsize;
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
@ -1167,18 +1063,8 @@ void setRAMSize_MSX() {
uint8_t b = 0;
int i = msxramlo;
display_Clear();
print_Msg(F("RAM Size: "));
println_Msg(MSXRAM[i]);
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();
printRamSize_MSX(i);
printInstructions();
while (1) {
b = checkButton();
@ -1195,18 +1081,8 @@ void setRAMSize_MSX() {
i--;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("RAM Size: "));
println_Msg(MSXRAM[i]);
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();
printRamSize_MSX(i);
printInstructions();
}
}
if (b == 1) { // Next (press)
@ -1222,18 +1098,8 @@ void setRAMSize_MSX() {
i++;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("RAM Size: "));
println_Msg(MSXRAM[i]);
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();
printRamSize_MSX(i);
printInstructions();
}
}
if (b == 3) { // Long Press - Execute (hold)

View File

@ -241,11 +241,8 @@ bool busConflict = false;
// Cartridge Config
uint8_t mapper;
uint8_t prgsize;
uint8_t newprgsize;
uint8_t chrsize;
uint8_t newchrsize;
uint8_t ramsize;
uint8_t newramsize;
/******************************************
Menus
@ -1077,6 +1074,16 @@ void CreateRAMFileInSD() {
/******************************************
Config Functions
*****************************************/
#if defined(ENABLE_LCD)
void printMapperSelection_NES(int index) {
display_Clear();
mapselect = pgm_read_byte(mapsize + index * 7);
print_Msg(F("Mapper: "));
println_Msg(mapselect);
}
#endif
void setMapper() {
uint8_t newmapper;
#ifdef ENABLE_GLOBAL_LOG
@ -1224,58 +1231,9 @@ chooseMapper:
// LCD
#elif defined(ENABLE_LCD)
int i = 0;
display_Clear();
mapselect = pgm_read_byte(mapsize + i * 7);
print_Msg(F("Mapper: "));
println_Msg(mapselect);
println_Msg(FS(FSTRING_EMPTY));
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
display_Update();
while (1) {
uint8_t b = checkButton();
if (b == 2) { // Previous Mapper
if (i == 0)
i = mapcount - 1;
else
i--;
display_Clear();
mapselect = pgm_read_byte(mapsize + i * 7);
print_Msg(F("Mapper: "));
println_Msg(mapselect);
println_Msg(FS(FSTRING_EMPTY));
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
display_Update();
}
else if (b == 1) { // Next Mapper
if (i == (mapcount - 1))
i = 0;
else
i++;
display_Clear();
mapselect = pgm_read_byte(mapsize + i * 7);
print_Msg(F("Mapper: "));
println_Msg(mapselect);
println_Msg(FS(FSTRING_EMPTY));
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
display_Update();
}
else if (b == 3) { // Long Press - Execute
newmapper = mapselect;
break;
}
}
navigateMenu(0, mapcount - 1, &printMapperSelection_NES);
newmapper = mapselect;
display.setCursor(0, 56 + 8);
print_Msg(F("MAPPER "));
print_Msg(newmapper);
@ -1347,7 +1305,17 @@ void checkMapperSize() {
}
}
#if (defined(ENABLE_LCD) || defined(ENABLE_OLED))
void printPrgSize_NES(int index) {
display_Clear();
print_Msg(F("PRG Size: "));
println_Msg(pgm_read_word(&(PRG[index])));
}
#endif
void setPRGSize() {
uint8_t newprgsize;
#ifdef ENABLE_GLOBAL_LOG
// Disable log to prevent unnecessary logging
println_Log(F("Set PRG Size"));
@ -1359,67 +1327,7 @@ void setPRGSize() {
if (prglo == prghi)
newprgsize = prglo;
else {
int i = prglo;
display_Clear();
print_Msg(F("PRG Size: "));
println_Msg(pgm_read_word(&(PRG[i])));
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
println_Msg(F("Press right to select"));
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
display_Update();
while (1) {
uint8_t b = checkButton();
if (b == doubleclick) { // Previous
if (i == prglo)
i = prghi;
else
i--;
display_Clear();
print_Msg(F("PRG Size: "));
println_Msg(pgm_read_word(&(PRG[i])));
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
println_Msg(F("Press right to select"));
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
display_Update();
}
if (b == press) { // Next
if (i == prghi)
i = prglo;
else
i++;
display_Clear();
print_Msg(F("PRG Size: "));
println_Msg(pgm_read_word(&(PRG[i])));
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
println_Msg(F("Press right to select"));
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
display_Update();
}
if (b == hold) { // Long Press - Execute
newprgsize = i;
break;
}
}
newprgsize = navigateMenu(prglo, prghi, &printPrgSize_NES);
display.setCursor(0, 56); // Display selection at bottom
}
@ -1466,7 +1374,16 @@ setprg:
#endif
}
#if (defined(ENABLE_LCD) || defined(ENABLE_OLED))
void printChrSize_NES(int index) {
display_Clear();
print_Msg(F("CHR Size: "));
println_Msg(pgm_read_word(&(CHR[index])));
}
#endif
void setCHRSize() {
uint8_t newchrsize;
#ifdef ENABLE_GLOBAL_LOG
// Disable log to prevent unnecessary logging
println_Log(F("Set CHR Size"));
@ -1478,69 +1395,8 @@ void setCHRSize() {
if (chrlo == chrhi)
newchrsize = chrlo;
else {
int i = chrlo;
newchrsize = navigateMenu(chrlo, chrhi, &printChrSize_NES);
display_Clear();
print_Msg(F("CHR Size: "));
println_Msg(pgm_read_word(&(CHR[i])));
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
println_Msg(F("Press right to select"));
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
display_Update();
while (1) {
uint8_t b = checkButton();
if (b == doubleclick) { // Previous
if (i == chrlo)
i = chrhi;
else
i--;
display_Clear();
print_Msg(F("CHR Size: "));
println_Msg(pgm_read_word(&(CHR[i])));
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
println_Msg(F("Press right to select"));
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
display_Update();
}
if (b == press) { // Next
if (i == chrhi)
i = chrlo;
else
i++;
display_Clear();
print_Msg(F("CHR Size: "));
println_Msg(pgm_read_word(&(CHR[i])));
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
println_Msg(F("Press right to select"));
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
display_Update();
}
if (b == hold) { // Long Press - Execute
newchrsize = i;
break;
}
}
display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("CHR SIZE "));
@ -1586,7 +1442,30 @@ setchr:
#endif
}
#if (defined(ENABLE_LCD) || defined(ENABLE_OLED))
void printRamSize_NES(int index) {
display_Clear();
print_Msg(F("RAM Size: "));
if (mapper == 0)
println_Msg(pgm_read_byte(&(RAM[index])) / 4);
else if (mapper == 16)
println_Msg(pgm_read_byte(&(RAM[index])) * 32);
else if (mapper == 19) {
if (index == 2)
println_Msg(F("128"));
else
println_Msg(pgm_read_byte(&(RAM[index])));
} else if ((mapper == 159) || (mapper == 80))
println_Msg(pgm_read_byte(&(RAM[index])) * 16);
else if (mapper == 82)
println_Msg(index * 5);
else
println_Msg(pgm_read_byte(&(RAM[index])));
}
#endif
void setRAMSize() {
uint8_t newramsize;
#ifdef ENABLE_GLOBAL_LOG
// Disable log to prevent unnecessary logging
println_Log(F("Set RAM Size"));
@ -1598,111 +1477,7 @@ void setRAMSize() {
if (ramlo == ramhi)
newramsize = ramlo;
else {
int i = 0;
display_Clear();
print_Msg(F("RAM Size: "));
if (mapper == 0)
println_Msg(pgm_read_byte(&(RAM[i])) / 4);
else if (mapper == 16)
println_Msg(pgm_read_byte(&(RAM[i])) * 32);
else if (mapper == 19) {
if (i == 2)
println_Msg(F("128"));
else
println_Msg(pgm_read_byte(&(RAM[i])));
} else if ((mapper == 159) || (mapper == 80))
println_Msg(pgm_read_byte(&(RAM[i])) * 16);
else if (mapper == 82)
println_Msg(i * 5);
else
println_Msg(pgm_read_byte(&(RAM[i])));
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
println_Msg(F("Press right to select"));
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
display_Update();
while (1) {
uint8_t b = checkButton();
if (b == doubleclick) { // Previous Mapper
if (i == 0)
i = ramhi;
else
i--;
display_Clear();
print_Msg(F("RAM Size: "));
if (mapper == 0)
println_Msg(pgm_read_byte(&(RAM[i])) / 4);
else if (mapper == 16)
println_Msg(pgm_read_byte(&(RAM[i])) * 32);
else if (mapper == 19) {
if (i == 2)
println_Msg(F("128"));
else
println_Msg(pgm_read_byte(&(RAM[i])));
} else if ((mapper == 159) || (mapper == 80))
println_Msg(pgm_read_byte(&(RAM[i])) * 16);
else if (mapper == 82)
println_Msg(i * 5);
else
println_Msg(pgm_read_byte(&(RAM[i])));
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
println_Msg(F("Press right to select"));
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
display_Update();
}
if (b == press) { // Next
if (i == ramhi)
i = 0;
else
i++;
display_Clear();
print_Msg(F("RAM Size: "));
if (mapper == 0)
println_Msg(pgm_read_byte(&(RAM[i])) / 4);
else if (mapper == 16)
println_Msg(pgm_read_byte(&(RAM[i])) * 32);
else if (mapper == 19) {
if (i == 2)
println_Msg(F("128"));
else
println_Msg(pgm_read_byte(&(RAM[i])));
} else if ((mapper == 159) || (mapper == 80))
println_Msg(pgm_read_byte(&(RAM[i])) * 16);
else if (mapper == 82)
println_Msg(i * 5);
else
println_Msg(pgm_read_byte(&(RAM[i])));
println_Msg(FS(FSTRING_EMPTY));
#if defined(ENABLE_OLED)
print_STR(press_to_change_STR, 1);
println_Msg(F("Press right to select"));
#elif defined(ENABLE_LCD)
print_STR(rotate_to_change_STR, 1);
print_STR(press_to_select_STR, 1);
#endif
display_Update();
}
if (b == hold) { // Long Press - Execute
newramsize = i;
break;
}
}
newramsize = navigateMenu(0, ramhi, &printRamSize_NES);
display.setCursor(0, 56); // Display selection at bottom
}

View File

@ -276,6 +276,14 @@ void readROM_ODY2() {
// ROM SIZE
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void printRomSize_ODY2(int index) {
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(ODY2[index]);
}
#endif
void setROMSize_ODY2() {
byte newody2size;
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
@ -283,69 +291,8 @@ void setROMSize_ODY2() {
if (ody2lo == ody2hi)
newody2size = ody2lo;
else {
uint8_t b = 0;
int i = ody2lo;
newody2size = navigateMenu(ody2lo, ody2hi, &printRomSize_ODY2);
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(ODY2[i]);
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();
while (1) {
b = checkButton();
if (b == 2) { // Previous (doubleclick)
if (i == ody2lo)
i = ody2hi;
else
i--;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(ODY2[i]);
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();
}
if (b == 1) { // Next (press)
if (i == ody2hi)
i = ody2lo;
else
i++;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(ODY2[i]);
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();
}
if (b == 3) { // Long Press - Execute (hold)
newody2size = i;
break;
}
}
display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));

View File

@ -256,6 +256,14 @@ void readROM_VECTREX() {
// ROM SIZE
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void printRomSize_VECTREX(int index) {
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(VECTREX[index]);
}
#endif
void setROMSize_VECTREX() {
byte newvectrexsize;
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
@ -263,67 +271,8 @@ void setROMSize_VECTREX() {
if (vectrexlo == vectrexhi)
newvectrexsize = vectrexlo;
else {
uint8_t b = 0;
int i = vectrexlo;
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(VECTREX[i]);
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();
while (1) {
b = checkButton();
if (b == 2) { // Previous (doubleclick)
if (i == vectrexlo)
i = vectrexhi;
else
i--;
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(VECTREX[i]);
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();
}
if (b == 1) { // Next (press)
if (i == vectrexhi)
i = vectrexlo;
else
i++;
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(VECTREX[i]);
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();
}
if (b == 3) { // Long Press - Execute (hold)
newvectrexsize = i;
break;
}
}
newvectrexsize = navigateMenu(vectrexlo, vectrexhi, &printRomSize_VECTREX);
display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));

View File

@ -43,7 +43,6 @@ byte wsvlo = 0; // Lowest Entry
byte wsvhi = 2; // Highest Entry
byte wsvsize;
byte newwsvsize;
// EEPROM MAPPING
// 08 ROM SIZE
@ -242,75 +241,23 @@ void readROM_WSV() {
// ROM SIZE
//******************************************
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void printRomSize_WSV(int index) {
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(pgm_read_word(&(WSV[index])));
}
#endif
void setROMSize_WSV() {
byte newwsvsize;
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
display_Clear();
if (wsvlo == wsvhi)
newwsvsize = wsvlo;
else {
uint8_t b = 0;
int i = wsvlo;
newwsvsize = navigateMenu(wsvlo, wsvhi, &printRomSize_WSV);
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(pgm_read_word(&(WSV[i])));
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();
while (1) {
b = checkButton();
if (b == 2) { // Previous (doubleclick)
if (i == wsvlo)
i = wsvhi;
else
i--;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(pgm_read_word(&(WSV[i])));
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();
}
if (b == 1) { // Next (press)
if (i == wsvhi)
i = wsvlo;
else
i++;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(pgm_read_word(&(WSV[i])));
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();
}
if (b == 3) { // Long Press - Execute (hold)
newwsvsize = i;
break;
}
}
display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));