From 74352c6e31525a9a9e8164d5d7370969b4e2f16e Mon Sep 17 00:00:00 2001 From: smesgr9000 Date: Sat, 11 May 2024 23:32:06 +0200 Subject: [PATCH] define "File doesn't exist" in OSCR.cpp/h --- Cart_Reader/GB.ino | 6 +++--- Cart_Reader/GBA.ino | 8 ++++---- Cart_Reader/GPC.ino | 2 +- Cart_Reader/OSCR.cpp | 1 + Cart_Reader/OSCR.h | 3 ++- Cart_Reader/PCE.ino | 2 +- Cart_Reader/SNES.ino | 2 +- Cart_Reader/SUPRACAN.ino | 10 +++++----- Cart_Reader/SV.ino | 4 ++-- Cart_Reader/WS.ino | 10 +++++----- 10 files changed, 25 insertions(+), 23 deletions(-) diff --git a/Cart_Reader/GB.ino b/Cart_Reader/GB.ino index 2fed636..8ca130c 100644 --- a/Cart_Reader/GB.ino +++ b/Cart_Reader/GB.ino @@ -1458,7 +1458,7 @@ void writeSRAM_GB() { display_Update(); } else { - print_Error(F("File doesnt exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); } } else { print_Error(F("Cart has no SRAM")); @@ -1744,7 +1744,7 @@ void writeSRAMFLASH_MBC6_GB() { println_Msg(F("Save writing finished")); display_Update(); } else { - print_Error(F("File doesnt exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); } } @@ -1818,7 +1818,7 @@ void writeEEPROM_MBC7_GB() { // open file on sd card if (!myFile.open(filePath, O_READ)) - print_Error(F("File doesnt exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); myFile.read(sdBuffer, lastByte); myFile.close(); diff --git a/Cart_Reader/GBA.ino b/Cart_Reader/GBA.ino index 5702110..8745175 100644 --- a/Cart_Reader/GBA.ino +++ b/Cart_Reader/GBA.ino @@ -1012,7 +1012,7 @@ void writeSRAM_GBA(boolean browseFile, uint32_t sramSize, uint32_t pos) { display_Update(); } else { - print_Error(F("File doesnt exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); } } @@ -1199,7 +1199,7 @@ void writeFRAM_GBA(boolean browseFile, unsigned long framSize) { display_Update(); } else { - print_Error(F("File doesnt exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); } } @@ -1621,7 +1621,7 @@ void writeFLASH_GBA(boolean browseFile, uint32_t flashSize, uint32_t pos, boolea } else { println_Msg(F("Error")); - print_Error(F("File doesnt exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); } } @@ -1717,7 +1717,7 @@ void writeEeprom_GBA(word eepSize) { display_Update(); } else { println_Msg(F("Error")); - print_Error(F("File doesnt exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); } } diff --git a/Cart_Reader/GPC.ino b/Cart_Reader/GPC.ino index 35effbc..561345a 100644 --- a/Cart_Reader/GPC.ino +++ b/Cart_Reader/GPC.ino @@ -377,7 +377,7 @@ void writeRAM_GPC(void) { println_Msg(F("RAM writing finished")); display_Update(); } else { - print_Error(F("File doesnt exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); } } diff --git a/Cart_Reader/OSCR.cpp b/Cart_Reader/OSCR.cpp index 341dc46..9bdf395 100644 --- a/Cart_Reader/OSCR.cpp +++ b/Cart_Reader/OSCR.cpp @@ -62,6 +62,7 @@ constexpr char PROGMEM FSTRING_CURRENT_SETTINGS[] = "CURRENT SETTINGS"; constexpr char PROGMEM FSTRING_OSCR[] = "OSCR"; constexpr char PROGMEM FSTRING_MODULE_NOT_ENABLED[] = "Module is not enabled."; constexpr char PROGMEM FSTRING_DATABASE_FILE_NOT_FOUND[] = "Database file not found"; +constexpr char PROGMEM FSTRING_FILE_DOESNT_EXIST[] = "File doesn't exist"; // Cart constexpr char PROGMEM FSTRING_READ_ROM[] = "Read ROM"; diff --git a/Cart_Reader/OSCR.h b/Cart_Reader/OSCR.h index 7cb215d..9239acf 100644 --- a/Cart_Reader/OSCR.h +++ b/Cart_Reader/OSCR.h @@ -41,7 +41,8 @@ extern const char PROGMEM FSTRING_CURRENT_SETTINGS[]; // Messages extern const char PROGMEM FSTRING_OSCR[]; extern const char PROGMEM FSTRING_MODULE_NOT_ENABLED[]; -extern const char FSTRING_DATABASE_FILE_NOT_FOUND[]; +extern const char PROGMEM FSTRING_DATABASE_FILE_NOT_FOUND[]; +extern const char PROGMEM FSTRING_FILE_DOESNT_EXIST[]; // Cart extern const char PROGMEM FSTRING_READ_ROM[]; diff --git a/Cart_Reader/PCE.ino b/Cart_Reader/PCE.ino index 66060c2..a795c1d 100644 --- a/Cart_Reader/PCE.ino +++ b/Cart_Reader/PCE.ino @@ -725,7 +725,7 @@ void write_tennokoe_bank_PCE(int bank_index) { println_Msg(F("Finished")); } else { - print_Error(F("File doesn't exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); } println_Msg(FS(FSTRING_EMPTY)); diff --git a/Cart_Reader/SNES.ino b/Cart_Reader/SNES.ino index 152654a..a7c1b36 100644 --- a/Cart_Reader/SNES.ino +++ b/Cart_Reader/SNES.ino @@ -1648,7 +1648,7 @@ void writeSRAM(boolean browseFile) { display_Update(); } else { - print_Error(F("File doesnt exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); } } diff --git a/Cart_Reader/SUPRACAN.ino b/Cart_Reader/SUPRACAN.ino index a812e3e..571c301 100644 --- a/Cart_Reader/SUPRACAN.ino +++ b/Cart_Reader/SUPRACAN.ino @@ -232,7 +232,7 @@ static void writeSRAM_Acan() { display_Clear(); if (!myFile.open(filePath, O_READ)) { - print_Error(F("File doesn't exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); return; } @@ -260,7 +260,7 @@ static void verifySRAM_Acan() { display_Update(); if (!myFile.open(filePath, O_READ)) { - print_Error(F("File doesn't exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); return; } @@ -328,7 +328,7 @@ static void verifyUM6650() { display_Update(); if (!myFile.open(filePath, O_READ)) { - print_Error(F("File doesn't exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); return; } @@ -365,7 +365,7 @@ static void writeUM6650() { display_Clear(); if (!myFile.open(filePath, O_READ)) { - print_Error(F("File doesn't exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); return; } @@ -400,7 +400,7 @@ static void flashCart_Acan() { display_Clear(); if (!myFile.open(filePath, O_READ)) { - print_Error(F("File doesn't exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); return; } diff --git a/Cart_Reader/SV.ino b/Cart_Reader/SV.ino index cb253e3..95c6824 100644 --- a/Cart_Reader/SV.ino +++ b/Cart_Reader/SV.ino @@ -373,7 +373,7 @@ void writeSRAM_SV() { println_Msg(F("SRAM writing finished")); display_Update(); } else { - print_Error(F("File doesnt exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); } } @@ -577,7 +577,7 @@ void writeROM_SV(void) { wait(); } else { - print_Error(F("File doesn't exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); } } diff --git a/Cart_Reader/WS.ino b/Cart_Reader/WS.ino index 99edbd4..8509e8b 100644 --- a/Cart_Reader/WS.ino +++ b/Cart_Reader/WS.ino @@ -654,7 +654,7 @@ static void verifySRAM_WS() { print_Error(did_not_verify_STR); } } else { - print_Error(F("File doesn't exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); } } @@ -700,7 +700,7 @@ static void writeSRAM_WS() { println_Msg(F("Writing finished")); display_Update(); } else { - print_Error(F("File doesn't exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); } } @@ -808,7 +808,7 @@ static void verifyEEPROM_WS() { print_Error(did_not_verify_STR); } } else { - print_Error(F("File doesn't exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); } } @@ -859,7 +859,7 @@ static void writeEEPROM_WS() { print_STR(done_STR, 1); } else { - print_Error(F("File doesn't exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); } } @@ -948,7 +948,7 @@ static void writeWitchOS_WS() { print_STR(done_STR, 1); } else { - print_Error(F("File doesn't exist")); + print_Error(FS(FSTRING_FILE_DOESNT_EXIST)); } }