Skip to content

Commit

Permalink
declare "Revision: " and "Serial: " as common string and reuse string
Browse files Browse the repository at this point in the history
  • Loading branch information
smesgr9000 committed Jun 29, 2024
1 parent 9e13964 commit 4e7ef93
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cart_Reader/GB.ino
Original file line number Diff line number Diff line change
Expand Up @@ -558,10 +558,10 @@ void showCartInfo_GB() {
print_Msg(FS(FSTRING_NAME));
println_Msg(romName);
if (cartID[0] != 0) {
print_Msg(F("Serial: "));
print_Msg(FS(FSTRING_SERIAL));
println_Msg(cartID);
}
print_Msg(F("Revision: "));
print_Msg(FS(FSTRING_REVISION));
println_Msg(romVersion);

print_Msg(FS(FSTRING_MAPPER));
Expand Down
6 changes: 3 additions & 3 deletions Cart_Reader/GBA.ino
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ void setup_GBA() {
// Print start page
print_Msg(FS(FSTRING_NAME));
println_Msg(romName);
print_Msg(F("Serial: "));
print_Msg(FS(FSTRING_SERIAL));
println_Msg(cartID);
print_Msg(F("Revision: "));
print_Msg(FS(FSTRING_REVISION));
println_Msg(romVersion);
print_Msg(FS(FSTRING_ROM_SIZE));
if (cartSize == 0)
Expand Down Expand Up @@ -681,7 +681,7 @@ void getCartInfo_GBA() {

// Print current database entry
println_Msg(gamename);
print_Msg(F("Serial: "));
print_Msg(FS(FSTRING_SERIAL));
println_Msg(tempStr);
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(cartSize);
Expand Down
6 changes: 3 additions & 3 deletions Cart_Reader/N64.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1925,9 +1925,9 @@ void printCartInfo_N64() {
display_Clear();
print_Msg(FS(FSTRING_NAME));
println_Msg(romName);
print_Msg(F("Serial: "));
print_Msg(FS(FSTRING_SERIAL));
println_Msg(cartID);
print_Msg(F("Revision: "));
print_Msg(FS(FSTRING_REVISION));
println_Msg(romVersion);
print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(cartSize);
Expand Down Expand Up @@ -1969,7 +1969,7 @@ void printCartInfo_N64() {
println_Msg("");
print_Msg(FS(FSTRING_NAME));
println_Msg(romName);
print_Msg(F("Serial: "));
print_Msg(FS(FSTRING_SERIAL));
println_Msg(cartID);
print_Msg(F("CRC1: "));
println_Msg(checksumStr);
Expand Down
4 changes: 3 additions & 1 deletion Cart_Reader/OSCR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ constexpr char PROGMEM FSTRING_MAPPER[] = "Mapper: ";
constexpr char PROGMEM FSTRING_SIZE[] = "Size: ";
constexpr char PROGMEM FSTRING_NAME[] = "Name: ";
constexpr char PROGMEM FSTRING_CHECKSUM[] = "Checksum: ";
constexpr char PROGMEM FSTRING_ROM_SIZE[] ="ROM Size: ";
constexpr char PROGMEM FSTRING_ROM_SIZE[] = "ROM Size: ";
constexpr char PROGMEM FSTRING_REVISION[] = "Revision: ";
constexpr char PROGMEM FSTRING_SERIAL[] = "Serial: ";

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

Expand Down
2 changes: 2 additions & 0 deletions Cart_Reader/OSCR.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ extern const char PROGMEM FSTRING_SIZE[];
extern const char PROGMEM FSTRING_ROM_SIZE[];
extern const char PROGMEM FSTRING_NAME[];
extern const char PROGMEM FSTRING_CHECKSUM[];
extern const char PROGMEM FSTRING_REVISION[];
extern const char PROGMEM FSTRING_SERIAL[];

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

Expand Down
2 changes: 1 addition & 1 deletion Cart_Reader/SNES.ino
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ void getCartInfo_SNES() {
print_Msg(FS(FSTRING_NAME));
println_Msg(romName);

print_Msg(F("Revision: "));
print_Msg(FS(FSTRING_REVISION));
println_Msg(romVersion);

print_Msg(F("Type: "));
Expand Down

0 comments on commit 4e7ef93

Please sign in to comment.