declare "Revision: " and "Serial: " as common string and reuse string

This commit is contained in:
smesgr9000 2024-06-29 11:48:32 +02:00
parent 9e13964889
commit 4e7ef93cc6
6 changed files with 14 additions and 10 deletions

View File

@ -558,10 +558,10 @@ void showCartInfo_GB() {
print_Msg(FS(FSTRING_NAME)); print_Msg(FS(FSTRING_NAME));
println_Msg(romName); println_Msg(romName);
if (cartID[0] != 0) { if (cartID[0] != 0) {
print_Msg(F("Serial: ")); print_Msg(FS(FSTRING_SERIAL));
println_Msg(cartID); println_Msg(cartID);
} }
print_Msg(F("Revision: ")); print_Msg(FS(FSTRING_REVISION));
println_Msg(romVersion); println_Msg(romVersion);
print_Msg(FS(FSTRING_MAPPER)); print_Msg(FS(FSTRING_MAPPER));

View File

@ -254,9 +254,9 @@ void setup_GBA() {
// Print start page // Print start page
print_Msg(FS(FSTRING_NAME)); print_Msg(FS(FSTRING_NAME));
println_Msg(romName); println_Msg(romName);
print_Msg(F("Serial: ")); print_Msg(FS(FSTRING_SERIAL));
println_Msg(cartID); println_Msg(cartID);
print_Msg(F("Revision: ")); print_Msg(FS(FSTRING_REVISION));
println_Msg(romVersion); println_Msg(romVersion);
print_Msg(FS(FSTRING_ROM_SIZE)); print_Msg(FS(FSTRING_ROM_SIZE));
if (cartSize == 0) if (cartSize == 0)
@ -681,7 +681,7 @@ void getCartInfo_GBA() {
// Print current database entry // Print current database entry
println_Msg(gamename); println_Msg(gamename);
print_Msg(F("Serial: ")); print_Msg(FS(FSTRING_SERIAL));
println_Msg(tempStr); println_Msg(tempStr);
print_Msg(FS(FSTRING_ROM_SIZE)); print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(cartSize); print_Msg(cartSize);

View File

@ -1925,9 +1925,9 @@ void printCartInfo_N64() {
display_Clear(); display_Clear();
print_Msg(FS(FSTRING_NAME)); print_Msg(FS(FSTRING_NAME));
println_Msg(romName); println_Msg(romName);
print_Msg(F("Serial: ")); print_Msg(FS(FSTRING_SERIAL));
println_Msg(cartID); println_Msg(cartID);
print_Msg(F("Revision: ")); print_Msg(FS(FSTRING_REVISION));
println_Msg(romVersion); println_Msg(romVersion);
print_Msg(FS(FSTRING_ROM_SIZE)); print_Msg(FS(FSTRING_ROM_SIZE));
print_Msg(cartSize); print_Msg(cartSize);
@ -1969,7 +1969,7 @@ void printCartInfo_N64() {
println_Msg(""); println_Msg("");
print_Msg(FS(FSTRING_NAME)); print_Msg(FS(FSTRING_NAME));
println_Msg(romName); println_Msg(romName);
print_Msg(F("Serial: ")); print_Msg(FS(FSTRING_SERIAL));
println_Msg(cartID); println_Msg(cartID);
print_Msg(F("CRC1: ")); print_Msg(F("CRC1: "));
println_Msg(checksumStr); println_Msg(checksumStr);

View File

@ -78,6 +78,8 @@ constexpr char PROGMEM FSTRING_SIZE[] = "Size: ";
constexpr char PROGMEM FSTRING_NAME[] = "Name: "; constexpr char PROGMEM FSTRING_NAME[] = "Name: ";
constexpr char PROGMEM FSTRING_CHECKSUM[] = "Checksum: "; 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 =================================================*/ /*==== /CONSTANTS =================================================*/

View File

@ -102,6 +102,8 @@ extern const char PROGMEM FSTRING_SIZE[];
extern const char PROGMEM FSTRING_ROM_SIZE[]; extern const char PROGMEM FSTRING_ROM_SIZE[];
extern const char PROGMEM FSTRING_NAME[]; extern const char PROGMEM FSTRING_NAME[];
extern const char PROGMEM FSTRING_CHECKSUM[]; 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)) #define FS(pmem_string) (reinterpret_cast<const __FlashStringHelper *>(pmem_string))

View File

@ -858,7 +858,7 @@ void getCartInfo_SNES() {
print_Msg(FS(FSTRING_NAME)); print_Msg(FS(FSTRING_NAME));
println_Msg(romName); println_Msg(romName);
print_Msg(F("Revision: ")); print_Msg(FS(FSTRING_REVISION));
println_Msg(romVersion); println_Msg(romVersion);
print_Msg(F("Type: ")); print_Msg(F("Type: "));