Fix display flicker on HW5 with Arc, Atari, Fairchild and Ody2 size/mapper selection

This commit is contained in:
sanni 2023-01-15 15:25:24 +01:00
parent 8114721d9d
commit 978fc80287
4 changed files with 238 additions and 54 deletions

View File

@ -192,7 +192,7 @@ void readROM_ARC() {
calcCRC(fileName, crcsize, NULL, 0);
println_Msg(F(""));
println_Msg(F("Press Button..."));
print_STR(press_button_STR, 1);
display_Update();
wait();
}
@ -209,26 +209,61 @@ void setROMSize_ARC() {
else {
int b = 0;
int i = arclo;
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(ARC[i]);
println_Msg(F(""));
#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) {
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(ARC[i]);
println_Msg(F(""));
println_Msg(F("Press to Change"));
println_Msg(F("Hold to Select"));
display_Update();
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(F(""));
#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(F(""));
#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;
@ -423,8 +458,13 @@ bool getCartListInfo_ARC() {
println_Msg(F(""));
println_Msg(arcgame);
display.setCursor(0, 48);
println_Msg(F("Press to Change"));
println_Msg(F("Hold to Select"));
#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();
#else
Serial.print(F("CART TITLE:"));

View File

@ -456,7 +456,7 @@ void readROM_ATARI() {
calcCRC(fileName, crcsize, NULL, 0);
println_Msg(F(""));
println_Msg(F("Press Button..."));
print_STR(press_button_STR, 1);
display_Update();
wait();
}
@ -537,6 +537,7 @@ void setMapper_ATARI() {
#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)
@ -576,39 +577,100 @@ void setMapper_ATARI() {
delay(250);
}
}
display_Clear();
print_Msg(F("Mapper: "));
atariindex = i * 2;
atarimapselect = pgm_read_byte(atarimapsize + atariindex);
if (atarimapselect == 0x20)
println_Msg(F("2K"));
else if (atarimapselect == 0x40)
println_Msg(F("4K"));
else if (atarimapselect == 0x0A)
println_Msg(F("UA"));
else if (atarimapselect == 0xC0)
println_Msg(F("CV"));
else if (atarimapselect == 0xD0)
println_Msg(F("DPC"));
else
println_Msg(atarimapselect, HEX);
println_Msg(F(""));
#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) {
display_Clear();
print_Msg(F("Mapper: "));
atariindex = i * 2;
atarimapselect = pgm_read_byte(atarimapsize + atariindex);
if (atarimapselect == 0x20)
println_Msg(F("2K"));
else if (atarimapselect == 0x40)
println_Msg(F("4K"));
else if (atarimapselect == 0x0A)
println_Msg(F("UA"));
else if (atarimapselect == 0xC0)
println_Msg(F("CV"));
else if (atarimapselect == 0xD0)
println_Msg(F("DPC"));
else
println_Msg(atarimapselect, HEX);
println_Msg(F(""));
println_Msg(F("Press to Change"));
println_Msg(F("Hold to Select"));
display_Update();
b = checkButton();
if (b == 2) { // Previous Mapper (doubleclick)
if (i == 0)
i = atarimapcount - 1;
else
i--;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("Mapper: "));
atariindex = i * 2;
atarimapselect = pgm_read_byte(atarimapsize + atariindex);
if (atarimapselect == 0x20)
println_Msg(F("2K"));
else if (atarimapselect == 0x40)
println_Msg(F("4K"));
else if (atarimapselect == 0x0A)
println_Msg(F("UA"));
else if (atarimapselect == 0xC0)
println_Msg(F("CV"));
else if (atarimapselect == 0xD0)
println_Msg(F("DPC"));
else
println_Msg(atarimapselect, HEX);
println_Msg(F(""));
#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 == (atarimapcount - 1))
i = 0;
else
i++;
// Only update display after input because of slow LCD library
display_Clear();
print_Msg(F("Mapper: "));
atariindex = i * 2;
atarimapselect = pgm_read_byte(atarimapsize + atariindex);
if (atarimapselect == 0x20)
println_Msg(F("2K"));
else if (atarimapselect == 0x40)
println_Msg(F("4K"));
else if (atarimapselect == 0x0A)
println_Msg(F("UA"));
else if (atarimapselect == 0xC0)
println_Msg(F("CV"));
else if (atarimapselect == 0xD0)
println_Msg(F("DPC"));
else
println_Msg(atarimapselect, HEX);
println_Msg(F(""));
#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)
newatarimapper = atarimapselect;
@ -788,8 +850,13 @@ bool getCartListInfo_ATARI() {
println_Msg(F(""));
println_Msg(atarigame);
display.setCursor(0, 48);
println_Msg(F("Press to Change"));
println_Msg(F("Hold to Select"));
#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();
#else
Serial.print(F("CART TITLE:"));

View File

@ -467,7 +467,7 @@ void readROM_FAIRCHILD() {
calcCRC(fileName, cartsize, NULL, 0);
println_Msg(F(""));
println_Msg(F("Press Button..."));
print_STR(press_button_STR, 1);
display_Update();
wait();
}
@ -523,7 +523,7 @@ void read16K_FAIRCHILD() // Read 16K Bytes
calcCRC(fileName, 0x4000, NULL, 0);
println_Msg(F(""));
println_Msg(F("Press Button..."));
print_STR(press_button_STR, 1);
display_Update();
wait();
}
@ -540,26 +540,58 @@ void setROMSize_FAIRCHILD() {
else {
int b = 0;
int i = fairchildlo;
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(FAIRCHILD[i]);
println_Msg(F(""));
#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) {
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(FAIRCHILD[i]);
println_Msg(F(""));
println_Msg(F("Press to Change"));
println_Msg(F("Hold to Select"));
display_Update();
b = checkButton();
if (b == 2) { // Previous (doubleclick)
if (i == fairchildlo)
i = fairchildhi;
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(F(""));
#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(F(""));
#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;
@ -754,8 +786,13 @@ bool getCartListInfo_FAIRCHILD() {
println_Msg(F(""));
println_Msg(fairchildgame);
display.setCursor(0, 48);
println_Msg(F("Press to Change"));
println_Msg(F("Hold to Select"));
#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();
#else
Serial.print(F("CART TITLE:"));

View File

@ -272,7 +272,7 @@ void readROM_ODY2() {
calcCRC(fileName, crcsize, NULL, 0);
println_Msg(F(""));
println_Msg(F("Press Button..."));
print_STR(press_button_STR, 1);
display_Update();
wait();
}
@ -289,26 +289,61 @@ void setROMSize_ODY2() {
else {
int b = 0;
int i = ody2lo;
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(ODY2[i]);
println_Msg(F(""));
#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) {
display_Clear();
print_Msg(F("ROM Size: "));
println_Msg(ODY2[i]);
println_Msg(F(""));
println_Msg(F("Press to Change"));
println_Msg(F("Hold to Select"));
display_Update();
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(F(""));
#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(F(""));
#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;
@ -515,8 +550,13 @@ bool getCartListInfo_ODY2() {
println_Msg(F(""));
println_Msg(ody2game);
display.setCursor(0, 48);
println_Msg(F("Press to Change"));
println_Msg(F("Hold to Select"));
#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();
#else
Serial.print(F("CART TITLE:"));