V7.2: LCD bugfix #2

This commit is contained in:
sanni 2021-11-17 21:31:18 +01:00
parent 21736a241a
commit dfec64917d
6 changed files with 39 additions and 25 deletions

View File

@ -4,8 +4,8 @@
This project represents a community-driven effort to provide This project represents a community-driven effort to provide
an easy to build and easy to modify cartridge dumper. an easy to build and easy to modify cartridge dumper.
Date: 27.10.2021 Date: 17.11.2021
Version: 7.1 Version: 7.2
SD lib: https://github.com/greiman/SdFat SD lib: https://github.com/greiman/SdFat
OLED lib: https://github.com/adafruit/Adafruit_SSD1306 OLED lib: https://github.com/adafruit/Adafruit_SSD1306
@ -614,7 +614,7 @@ void aboutScreen() {
while (1) { while (1) {
#if defined(enable_LCD) || defined(enable_OLED) #if (defined(enable_LCD) || defined(enable_OLED))
// get input button // get input button
int b = checkButton(); int b = checkButton();
@ -808,7 +808,7 @@ void print_Error(const __FlashStringHelper *errorMessage, boolean forceReset) {
display_Update(); display_Update();
if (forceReset) { if (forceReset) {
#if defined(enable_OLED) || defined(enable_LCD) #if (defined(enable_OLED) || defined(enable_LCD))
println_Msg(F("")); println_Msg(F(""));
println_Msg(F("Press Button...")); println_Msg(F("Press Button..."));
display_Update(); display_Update();
@ -1192,7 +1192,7 @@ void rgbLed(byte Color) {
} }
void blinkLED() { void blinkLED() {
#if defined(enable_OLED) || defined(enable_serial) #if (defined(enable_OLED) || defined(enable_serial))
PORTB ^= (1 << 4); PORTB ^= (1 << 4);
#elif defined(enable_LCD) #elif defined(enable_LCD)
PORTB ^= (1 << 7); PORTB ^= (1 << 7);
@ -1202,7 +1202,7 @@ void blinkLED() {
/****************************************** /******************************************
LCD Menu Module LCD Menu Module
*****************************************/ *****************************************/
#if defined(enable_LCD) && defined(enable_rotary) #if (defined(enable_LCD) && defined(enable_rotary))
// Read encoder state // Read encoder state
int checkButton() { int checkButton() {
// Read rotary encoder // Read rotary encoder

View File

@ -1036,7 +1036,7 @@ void getCartInfo_MD() {
println_Msg(F(" ")); println_Msg(F(" "));
// Wait for user input // Wait for user input
#if defined(enable_LCD) || defined(enable_OLED) #if (defined(enable_LCD) || defined(enable_OLED))
println_Msg(F("Press Button...")); println_Msg(F("Press Button..."));
display_Update(); display_Update();
wait(); wait();

View File

@ -1126,7 +1126,7 @@ unsigned char* getNES20HeaderBytesFromDatabaseRow(const char* crctest) {
Config Functions Config Functions
*****************************************/ *****************************************/
void setMapper() { void setMapper() {
#if defined(enable_LCD) || defined(enable_OLED) #if (defined(enable_LCD) || defined(enable_OLED))
chooseMapper: chooseMapper:
// Read stored mapper // Read stored mapper
EEPROM_readAnything(7, newmapper); EEPROM_readAnything(7, newmapper);
@ -1168,7 +1168,7 @@ chooseMapper:
display.drawLine(40, 30, 50, 30, BLACK); display.drawLine(40, 30, 50, 30, BLACK);
display.drawLine(60, 30, 70, 30, WHITE); display.drawLine(60, 30, 70, 30, WHITE);
} }
#else if enable_LCD #else
if (digit == 0) { if (digit == 0) {
display.setDrawColor(1); display.setDrawColor(1);
display.drawLine(20, 30, 30, 30); display.drawLine(20, 30, 30, 30);
@ -1258,7 +1258,11 @@ chooseMapper:
else if (b == 3) { else if (b == 3) {
break; break;
} }
#ifdef enable_OLED
display.display(); display.display();
#else
display.updateDisplay();
#endif
} }
} }
display.clearDisplay(); display.clearDisplay();
@ -1277,7 +1281,11 @@ chooseMapper:
if (!validMapper) { if (!validMapper) {
errorLvl = 1; errorLvl = 1;
display.println("Mapper not supported"); display.println("Mapper not supported");
#ifdef enable_OLED
display.display(); display.display();
#else
display.updateDisplay();
#endif
wait(); wait();
goto chooseMapper; goto chooseMapper;
} }
@ -1341,7 +1349,7 @@ void checkMapperSize() {
} }
void setPRGSize() { void setPRGSize() {
#if defined(enable_LCD) || defined(enable_OLED) #if (defined(enable_LCD) || defined(enable_OLED))
display_Clear(); display_Clear();
if (prglo == prghi) if (prglo == prghi)
newprgsize = prglo; newprgsize = prglo;
@ -1416,7 +1424,7 @@ setprg:
} }
void setCHRSize() { void setCHRSize() {
#if defined(enable_LCD) || defined(enable_OLED) #if (defined(enable_LCD) || defined(enable_OLED))
display_Clear(); display_Clear();
if (chrlo == chrhi) if (chrlo == chrhi)
newchrsize = chrlo; newchrsize = chrlo;
@ -1490,7 +1498,7 @@ setchr:
} }
void setRAMSize() { void setRAMSize() {
#if defined(enable_LCD) || defined(enable_OLED) #if (defined(enable_LCD) || defined(enable_OLED))
display_Clear(); display_Clear();
if (ramlo == ramhi) if (ramlo == ramhi)
newramsize = ramlo; newramsize = ramlo;
@ -3607,9 +3615,13 @@ void writeFLASH() {
} }
} }
} }
#ifdef OLED
#if defined(enable_OLED)
display.print(F("*")); display.print(F("*"));
display.display(); display.display();
#elif defined(enable_LCD)
display.print(F("*"));
display.updateDisplay();
#else #else
Serial.print(F("*")); Serial.print(F("*"));
if ((i != 0) && ((i + 1) % 16 == 0)) if ((i != 0) && ((i + 1) % 16 == 0))

View File

@ -376,7 +376,7 @@ void getCartInfo_SMS() {
} }
// Wait for user input // Wait for user input
#if defined(enable_LCD) || defined(enable_OLED) #if (defined(enable_LCD) || defined(enable_OLED))
println_Msg(F("Press Button...")); println_Msg(F("Press Button..."));
display_Update(); display_Update();
wait(); wait();

View File

@ -787,7 +787,7 @@ void getCartInfo_SNES() {
display_Update(); display_Update();
// Wait for user input // Wait for user input
#if defined(enable_LCD) || defined(enable_OLED) #if (defined(enable_LCD) || defined(enable_OLED))
println_Msg(F(" ")); println_Msg(F(" "));
println_Msg(F(" ")); println_Msg(F(" "));
println_Msg(F("Press Button...")); println_Msg(F("Press Button..."));

View File

@ -15,7 +15,7 @@
#define fastcrc #define fastcrc
#endif #endif
#if defined(HW2) || defined(HW3) #if (defined(HW2) || defined(HW3))
#define enable_OLED #define enable_OLED
#define enable_Button2 #define enable_Button2
#endif #endif
@ -59,15 +59,17 @@
// DISABLE MODULES // DISABLE MODULES
//****************************************** //******************************************
// add // before #define to disable a module // add // before #define to disable a module
#define enable_FLASH
#define enable_GBX
#define enable_MD
#define enable_N64
#define enable_NES
#define enable_NGP
#define enable_NP
#define enable_PCE
#define enable_SMS
#define enable_SNES #define enable_SNES
#define enable_NP
#define enable_SV #define enable_SV
#define enable_MD
#define enable_SMS
#define enable_N64
#define enable_GBX
#define enable_NES
#define enable_FLASH
#define enable_PCE
#define enable_WS #define enable_WS
#define enable_NGP