aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLesserkuma <[email protected]>2022-09-28 21:31:49 +0200
committerLesserkuma <[email protected]>2022-09-28 21:31:49 +0200
commitdab124def7a198872a8d956d331a128381103c18 (patch)
treee69cdbe05c9551e426f2b240fc26a95ada17d294
parent786a8586fb07eb9f9e8c57b030847295ac3d7e6b (diff)
downloadcartreader-dab124def7a198872a8d956d331a128381103c18.tar.gz
cartreader-dab124def7a198872a8d956d331a128381103c18.zip
Find Game Serial for Game Boy
-rw-r--r--Cart_Reader/GB.ino31
-rw-r--r--Cart_Reader/GBA.ino6
-rw-r--r--Cart_Reader/N64.ino2
3 files changed, 28 insertions, 11 deletions
diff --git a/Cart_Reader/GB.ino b/Cart_Reader/GB.ino
index 7bce920..3f60d33 100644
--- a/Cart_Reader/GB.ino
+++ b/Cart_Reader/GB.ino
@@ -410,7 +410,10 @@ void showCartInfo_GB() {
if (strcmp(checksumStr, "00") != 0) {
print_Msg(F("Title: "));
println_Msg(romName);
-
+ if (cartID[0] != 0) {
+ print_Msg(F("Serial: "));
+ println_Msg(cartID);
+ }
print_Msg(F("Revision: "));
println_Msg(romVersion);
@@ -497,7 +500,7 @@ void showCartInfo_GB() {
print_Msg(F("512 Byte"));
}
else if (romType == 0x22) {
- if (strncmp(romName, "CMASTER_KCEJ", 12) == 0) {
+ if (strncmp(cartID, "KCEJ", 4) == 0) {
print_Msg(F("512 Byte"));
}
else {
@@ -538,9 +541,9 @@ void showCartInfo_GB() {
default: print_Msg(F("None"));
}
println_Msg(F(""));
- print_Msg(F("Checksum: "));
- println_Msg(checksumStr);
- display_Update();
+ //print_Msg(F("Checksum: "));
+ //println_Msg(checksumStr);
+ //display_Update();
// Wait for user input
println_Msg(F(""));
@@ -860,6 +863,20 @@ void getCartInfo_GB() {
myLength++;
}
+ // Find Game Serial
+ cartID[0] = 0;
+ if (sdBuffer[0x143] == 0x80 || sdBuffer[0x143] == 0xC0) {
+ Serial.println(romName[myLength - 4]);
+ if ((romName[myLength - 4] == 'A' || romName[myLength - 4] == 'B' || romName[myLength - 4] == 'H' || romName[myLength - 4] == 'K' || romName[myLength - 4] == 'V') && (romName[myLength - 1] == 'A' || romName[myLength - 1] == 'B' || romName[myLength - 1] == 'D' || romName[myLength - 1] == 'E' || romName[myLength - 1] == 'F' || romName[myLength - 1] == 'I' || romName[myLength - 1] == 'J' || romName[myLength - 1] == 'K' || romName[myLength - 1] == 'P' || romName[myLength - 1] == 'S' || romName[myLength - 1] == 'U' || romName[myLength - 1] == 'X' || romName[myLength - 1] == 'Y')) {
+ cartID[0] = romName[myLength - 4];
+ cartID[1] = romName[myLength - 3];
+ cartID[2] = romName[myLength - 2];
+ cartID[3] = romName[myLength - 1];
+ myLength -= 4;
+ romName[myLength] = 0;
+ }
+ }
+
// Strip trailing white space
for (unsigned int i = myLength - 1; i > 0; i--) {
if ((romName[i] != 0x5F) && (romName[i] != 0x20)) break;
@@ -1274,7 +1291,7 @@ unsigned long verifySRAM_GB() {
}
}
-// Read MBC6 (SRAM + FLASH) save data
+// Read SRAM + FLASH save data of MBC6
void readSRAMFLASH_MBC6_GB() {
// Get name, add extension and convert to char array for sd lib
strcpy(fileName, romName);
@@ -1369,7 +1386,7 @@ void readSRAMFLASH_MBC6_GB() {
display_Update();
}
-// Write MBC6 (SRAM + FLASH) save data
+// Write RAM
void writeSRAMFLASH_MBC6_GB() {
// Create filepath
sprintf(filePath, "%s/%s", filePath, fileName);
diff --git a/Cart_Reader/GBA.ino b/Cart_Reader/GBA.ino
index 6eb3cf2..75d49eb 100644
--- a/Cart_Reader/GBA.ino
+++ b/Cart_Reader/GBA.ino
@@ -545,7 +545,7 @@ void setup_GBA() {
// Print start page
print_Msg(F("Title: "));
println_Msg(romName);
- print_Msg(F("Code: "));
+ print_Msg(F("Serial: "));
println_Msg(cartID);
print_Msg(F("Revision: "));
println_Msg(romVersion);
@@ -921,12 +921,12 @@ void getCartInfo_GBA() {
// Print current database entry
println_Msg(gamename);
- print_Msg(F("Cart ID: "));
+ print_Msg(F("Serial: "));
println_Msg(tempStr);
print_Msg(F("ROM Size: "));
print_Msg(cartSize);
println_Msg(F(" MB"));
- print_Msg(F("Save: "));
+ print_Msg(F("Save Lib: "));
println_Msg(saveTypeStr);
#if defined(enable_OLED)
diff --git a/Cart_Reader/N64.ino b/Cart_Reader/N64.ino
index a77da71..07dfc8a 100644
--- a/Cart_Reader/N64.ino
+++ b/Cart_Reader/N64.ino
@@ -2447,7 +2447,7 @@ void printCartInfo_N64() {
display_Clear();
print_Msg(F("Title: "));
println_Msg(romName);
- print_Msg(F("Code: "));
+ print_Msg(F("Serial: "));
println_Msg(cartID);
print_Msg(F("Revision: "));
println_Msg(romVersion);