Skip to content

Commit

Permalink
define more commonly used string in OSCR and reuse them
Browse files Browse the repository at this point in the history
  • Loading branch information
smesgr9000 committed May 28, 2024
1 parent 0d9596e commit d039c59
Show file tree
Hide file tree
Showing 22 changed files with 50 additions and 44 deletions.
6 changes: 3 additions & 3 deletions Cart_Reader/2600.ino
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ void checkStatus_2600() {
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("MAPPER: "));
println_Mapper2600(a2600mapper);
print_Msg(F("ROM SIZE: "));
print_Msg(FS(FSTRING_ROM_SIZE));
if (a2600mapper == 0xD0)
print_Msg(F("10"));
else
Expand All @@ -610,7 +610,7 @@ void checkStatus_2600() {
Serial.print(F("MAPPER: "));
println_Mapper2600(a2600mapper);

Serial.print(F("ROM SIZE: "));
Serial.print(FS(FSTRING_ROM_SIZE));
if (a2600mapper == 0xD0)
Serial.print(F("10"));
else
Expand All @@ -627,7 +627,7 @@ void checkStatus_2600() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void printMapperSelection_2600(int index) {
display_Clear();
print_Msg(F("Mapper: "));
print_Msg(FS(FSTRING_MAPPER));
a2600index = index * 2;
a2600mapselect = pgm_read_byte(a2600mapsize + a2600index);
println_Mapper2600(a2600mapselect);
Expand Down
8 changes: 4 additions & 4 deletions Cart_Reader/5200.ino
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ void setROMSize_5200() {

display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(a5200[new5200size]);
println_Msg(F("K"));
display_Update();
Expand Down Expand Up @@ -422,7 +422,7 @@ void checkStatus_5200() {
print_Msg(F("MAPPER: "));
println_Msg(a5200mapper);
println_Mapper5200(a5200mapper);
print_Msg(F("ROM SIZE: "));
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(a5200[a5200size]);
println_Msg(F("K"));
display_Update();
Expand All @@ -431,7 +431,7 @@ void checkStatus_5200() {
Serial.print(F("MAPPER: "));
Serial.println(a5200mapper);
println_Mapper5200(a5200mapper);
Serial.print(F("ROM SIZE: "));
Serial.print(FS(FSTRING_ROM_SIZE));
Serial.print(a5200[a5200size]);
Serial.println(F("K"));
Serial.println(FS(FSTRING_EMPTY));
Expand All @@ -445,7 +445,7 @@ void checkStatus_5200() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void printMapperSelection_5200(int index) {
display_Clear();
print_Msg(F("Mapper: "));
print_Msg(FS(FSTRING_MAPPER));
a5200index = index * 3;
a5200mapselect = pgm_read_byte(a5200mapsize + a5200index);
println_Msg(a5200mapselect);
Expand Down
8 changes: 4 additions & 4 deletions Cart_Reader/7800.ino
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ void setROMSize_7800() {
new7800size = navigateMenu(a7800lo, a7800hi, &printRomSize_7800);
display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(a7800[new7800size]);
println_Msg(F("K"));
display_Update();
Expand Down Expand Up @@ -552,7 +552,7 @@ void checkStatus_7800() {
print_Msg(F("MAPPER: "));
println_Msg(a7800mapper);
println_Mapper7800(a7800mapper);
print_Msg(F("ROM SIZE: "));
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(a7800[a7800size]);
println_Msg(F("K"));
display_Update();
Expand All @@ -576,7 +576,7 @@ void checkStatus_7800() {
Serial.println(F("Karateka (PAL) [78S4 Variant]"));
else if (a7800mapper == 7)
Serial.println(F("Bankset"));
Serial.print(F("ROM SIZE: "));
Serial.print(FS(FSTRING_ROM_SIZE));
Serial.print(A7800[a7800size]);
Serial.println(F("K"));
Serial.println(FS(FSTRING_EMPTY));
Expand All @@ -590,7 +590,7 @@ void checkStatus_7800() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void printMapperSelection_7800(int index) {
display_Clear();
print_Msg(F("Mapper: "));
print_Msg(FS(FSTRING_MAPPER));
a7800index = index * 3;
a7800mapselect = pgm_read_byte(a7800mapsize + a7800index);
println_Msg(a7800mapselect);
Expand Down
4 changes: 2 additions & 2 deletions Cart_Reader/ARC.ino
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void setROMSize_ARC() {

display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(ARC[newarcsize]);
println_Msg(F("K"));
display_Update();
Expand Down Expand Up @@ -244,7 +244,7 @@ void checkStatus_ARC() {
println_Msg(F("ARCADIA 2001 READER"));
println_Msg(FS(FSTRING_CURRENT_SETTINGS));
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("ROM SIZE: "));
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(ARC[arcsize]);
println_Msg(F("K"));
display_Update();
Expand Down
4 changes: 2 additions & 2 deletions Cart_Reader/C64.ino
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ void readROM_C64() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void printMapperSelection_C64(int index) {
display_Clear();
print_Msg(F("Mapper: "));
print_Msg(FS(FSTRING_MAPPER));
c64index = index * 3;
c64mapselect = pgm_read_byte(c64mapsize + c64index);
println_Msg(c64mapselect);
Expand Down Expand Up @@ -645,7 +645,7 @@ void setROMSize_C64() {

display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(C64[newc64size]);
println_Msg(F("K"));
display_Update();
Expand Down
6 changes: 3 additions & 3 deletions Cart_Reader/COLV.ino
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void setROMSize_COL() {
display.setCursor(0, 56); // Display selection at bottom
}

print_Msg(F("ROM SIZE "));
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(pgm_read_byte(&(COL[newcolsize])));
println_Msg(F("K"));
display_Update();
Expand Down Expand Up @@ -271,7 +271,7 @@ void checkStatus_COL() {
println_Msg(F("COLECOVISION READER"));
println_Msg(FS(FSTRING_CURRENT_SETTINGS));
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("ROM SIZE: "));
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(pgm_read_byte(&(COL[colsize])));
println_Msg(F("K"));
println_Msg(FS(FSTRING_EMPTY));
Expand Down Expand Up @@ -325,7 +325,7 @@ void readDataLine_COL(FsFile& database, void* entry) {
void printDataLine_COL(void* entry) {
struct database_entry_COL* castEntry = (database_entry_COL*)entry;

print_Msg(F("Size: "));
print_Msg(FS(FSTRING_SIZE));
print_Msg(castEntry->gameSize);
println_Msg(F("KB"));
}
Expand Down
4 changes: 2 additions & 2 deletions Cart_Reader/FAIRCHILD.ino
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ void setROMSize_FAIRCHILD() {

display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(FAIRCHILD[newfairchildsize]);
println_Msg(F("K"));
display_Update();
Expand Down Expand Up @@ -576,7 +576,7 @@ void checkStatus_FAIRCHILD() {
println_Msg(F("CHANNEL F READER"));
println_Msg(FS(FSTRING_CURRENT_SETTINGS));
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("ROM SIZE: "));
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(FAIRCHILD[fairchildsize]);
println_Msg(F("K"));
display_Update();
Expand Down
2 changes: 1 addition & 1 deletion Cart_Reader/GB.ino
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ void showCartInfo_GB() {
print_Msg(F("Revision: "));
println_Msg(romVersion);

print_Msg(F("Mapper: "));
print_Msg(FS(FSTRING_MAPPER));
if ((romType == 0) || (romType == 8) || (romType == 9))
print_Msg(F("none"));
else if ((romType == 1) || (romType == 2) || (romType == 3))
Expand Down
10 changes: 5 additions & 5 deletions Cart_Reader/INTV.ino
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ void ecsBank(uint32_t addr, uint8_t bank) {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void printMapperSelection_INTV(int index) {
display_Clear();
print_Msg(F("Mapper: "));
print_Msg(FS(FSTRING_MAPPER));
intvindex = index * 4;
intvmapselect = pgm_read_byte(intvmapsize + intvindex);
println_Msg(intvmapselect);
Expand Down Expand Up @@ -540,7 +540,7 @@ void setROMSize_INTV() {

display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(pgm_read_byte(&(INTV[newintvsize])));
println_Msg(F("K"));
display_Update();
Expand Down Expand Up @@ -596,7 +596,7 @@ void checkStatus_INTV() {
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("MAPPER: "));
println_Msg(intvmapper);
print_Msg(F("ROM SIZE: "));
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(pgm_read_byte(&(INTV[intvsize])));
println_Msg(F("K"));
display_Update();
Expand Down Expand Up @@ -660,10 +660,10 @@ void readDataLine_INTV(FsFile& database, void* entry) {

void printDataLine_INTV(void* entry) {
struct database_entry_INTV* castEntry = (database_entry_INTV*)entry;
print_Msg(F("Size: "));
print_Msg(FS(FSTRING_SIZE));
print_Msg(castEntry->gameSize);
println_Msg(F("KB"));
print_Msg(F("Mapper: "));
print_Msg(FS(FSTRING_MAPPER));
println_Msg(castEntry->gameMapper);
}

Expand Down
2 changes: 1 addition & 1 deletion Cart_Reader/LOOPY.ino
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ void getCartInfo_LOOPY() {
println_Msg(loopyRomNameLong);
print_Msg(F("Checksum: "));
println_Msg(checksumStr);
print_Msg(F("Size: "));
print_Msg(FS(FSTRING_SIZE));
print_Msg(cartSize * 8 / 1024 / 1024);
println_Msg(F(" MBit"));
print_Msg(F("Sram: "));
Expand Down
2 changes: 1 addition & 1 deletion Cart_Reader/MD.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,7 @@ void getCartInfo_MD() {
print_Msg(F("bramSize(KB): "));
println_Msg(bramSize >> 10);
}
print_Msg(F("Size: "));
print_Msg(FS(FSTRING_SIZE));
print_Msg(cartSize * 8 / 1024 / 1024);
switch (SnKmode) {
case 2:
Expand Down
6 changes: 3 additions & 3 deletions Cart_Reader/MSX.ino
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ void writeRAM_MSX() {
#if (defined(ENABLE_OLED) || defined(ENABLE_LCD))
void printMapperSelection_MSX(int index) {
display_Clear();
print_Msg(F("Mapper: "));
print_Msg(FS(FSTRING_MAPPER));
msxindex = index * 5;
msxmapselect = pgm_read_byte(msxmapsize + msxindex);
println_Msg(msxmapselect);
Expand Down Expand Up @@ -950,7 +950,7 @@ void setROMSize_MSX() {
}
display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));
print_Msg(FS(FSTRING_ROM_SIZE));
if (msxmapper == 12) // R-Type
print_Msg(F("384"));
else
Expand Down Expand Up @@ -1143,7 +1143,7 @@ void checkStatus_MSX() {
print_Msg(F("MAPPER: "));
println_Msg(msxmapper);
printMapper(msxmapper);
print_Msg(F("ROM SIZE: "));
print_Msg(FS(FSTRING_ROM_SIZE));
if (msxmapper == 12) // R-Type
print_Msg(F("384"));
else
Expand Down
2 changes: 1 addition & 1 deletion Cart_Reader/NES.ino
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ void CreateRAMFileInSD() {
void printMapperSelection_NES(int index) {
display_Clear();
mapselect = pgm_read_word(mapsize + index);
print_Msg(F("Mapper: "));
print_Msg(FS(FSTRING_MAPPER));
println_Msg(mapselect);
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions Cart_Reader/ODY2.ino
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ void setROMSize_ODY2() {

display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(ODY2[newody2size]);
println_Msg(F("K"));
display_Update();
Expand Down Expand Up @@ -329,7 +329,7 @@ void checkStatus_ODY2() {
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("MAPPER: "));
println_Msg(ody2mapper);
print_Msg(F("ROM SIZE: "));
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(ODY2[ody2size]);
println_Msg(F("K"));
display_Update();
Expand Down
3 changes: 3 additions & 0 deletions Cart_Reader/OSCR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ constexpr char PROGMEM FSTRING_SELECT_CART[] = "Select Cart";
constexpr char PROGMEM FSTRING_SELECT_CART_TYPE[] = "Select Cart Type";
constexpr char PROGMEM FSTRING_SET_SIZE[] = "Set Size";
constexpr char PROGMEM FSTRING_REFRESH_CART[] = "Refresh Cart";
constexpr char PROGMEM FSTRING_MAPPER[] = "Mapper: ";
constexpr char PROGMEM FSTRING_SIZE[] = "Size: ";
constexpr char PROGMEM FSTRING_ROM_SIZE[] ="ROM SIZE: ";

/*==== /CONSTANTS =================================================*/

Expand Down
3 changes: 3 additions & 0 deletions Cart_Reader/OSCR.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ extern const char PROGMEM FSTRING_SELECT_CART[];
extern const char PROGMEM FSTRING_SELECT_CART_TYPE[];
extern const char PROGMEM FSTRING_SET_SIZE[];
extern const char PROGMEM FSTRING_REFRESH_CART[];
extern const char PROGMEM FSTRING_MAPPER[];
extern const char PROGMEM FSTRING_SIZE[];
extern const char PROGMEM FSTRING_ROM_SIZE[];

#define FS(pmem_string) (reinterpret_cast<const __FlashStringHelper *>(pmem_string))

Expand Down
2 changes: 1 addition & 1 deletion Cart_Reader/SFM.ino
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ void getCartInfo_SFM() {
print_Msg(F("Checksum: "));
println_Msg(checksumStr);

print_Msg(F("Size: "));
print_Msg(FS(FSTRING_SIZE));
print_Msg(romSize);
println_Msg(F("Mbit "));

Expand Down
2 changes: 1 addition & 1 deletion Cart_Reader/SMS.ino
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ void getCartInfo_SMS() {
println_Msg(FS(FSTRING_SPACE));
print_Msg(F("Name: "));
println_Msg(romName);
print_Msg(F("Size: "));
print_Msg(FS(FSTRING_SIZE));
print_Msg(cartSize / 1024);
println_Msg(F("KB"));
println_Msg(FS(FSTRING_SPACE));
Expand Down
2 changes: 1 addition & 1 deletion Cart_Reader/SNES.ino
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ void checkAltConf(char crcStr[9]) {
if (((romSize != romSize2) || (numBanks != numBanks2)) && ((romSize2 == 10) || (romSize2 == 12) || (romSize2 == 20) || (romSize2 == 24) || (romSize2 == 40) || (romSize2 == 48))) {
// Correct size
println_Msg(F("Correcting size"));
print_Msg(F("Size: "));
print_Msg(FS(FSTRING_SIZE));
print_Msg(romSize);
print_Msg(F(" -> "));
print_Msg(romSize2);
Expand Down
2 changes: 1 addition & 1 deletion Cart_Reader/VBOY.ino
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ void getCartInfo_VB() {
println_Msg(FS(FSTRING_SPACE));
print_Msg(F("Name: "));
println_Msg(romName);
print_Msg(F("Size: "));
print_Msg(FS(FSTRING_SIZE));
print_Msg(cartSize * 8 / 1024 / 1024);
println_Msg(F(" MBit"));
print_Msg(F("Sram: "));
Expand Down
6 changes: 3 additions & 3 deletions Cart_Reader/VECTREX.ino
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ void setROMSize_VECTREX() {

display.setCursor(0, 56); // Display selection at bottom
}
print_Msg(F("ROM SIZE "));
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(VECTREX[newvectrexsize]);
println_Msg(F("KB"));
display_Update();
Expand Down Expand Up @@ -303,13 +303,13 @@ void checkStatus_VECTREX() {
println_Msg(F("VECTREX READER"));
println_Msg(FS(FSTRING_CURRENT_SETTINGS));
println_Msg(FS(FSTRING_EMPTY));
print_Msg(F("ROM SIZE: "));
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(VECTREX[vectrexsize]);
println_Msg(F("KB"));
display_Update();
wait();
#else
Serial.print(F("ROM SIZE: "));
Serial.print(FS(FSTRING_ROM_SIZE));
Serial.print(VECTREX[vectrexsize]);
Serial.println(F("KB"));
Serial.println(FS(FSTRING_EMPTY));
Expand Down
Loading

0 comments on commit d039c59

Please sign in to comment.