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

View File

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

View File

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

View File

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

View File

@ -787,7 +787,7 @@ void getCartInfo_SNES() {
display_Update();
// 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("Press Button..."));

View File

@ -15,7 +15,7 @@
#define fastcrc
#endif
#if defined(HW2) || defined(HW3)
#if (defined(HW2) || defined(HW3))
#define enable_OLED
#define enable_Button2
#endif
@ -59,15 +59,17 @@
// DISABLE MODULES
//******************************************
// 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_NP
#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_NGP