aboutsummaryrefslogtreecommitdiffhomepage
path: root/Cart_Reader/GBA.ino
diff options
context:
space:
mode:
authorLesserkuma <[email protected]>2023-06-17 14:24:17 +0200
committerLesserkuma <[email protected]>2023-06-17 14:24:17 +0200
commitd1bfd53593490e8cf09a9e21de83ca0a551f5a7a (patch)
tree759ddf6f32b45ba481dda571d3b226cbb53f5250 /Cart_Reader/GBA.ino
parent4c3e618f6ea3f167e27cd6f3f013ea72d358b9a0 (diff)
downloadcartreader-d1bfd53593490e8cf09a9e21de83ca0a551f5a7a.tar.gz
cartreader-d1bfd53593490e8cf09a9e21de83ca0a551f5a7a.zip
[GBA] Fixed reading 32 MB carts that use EEPROM saves
Diffstat (limited to 'Cart_Reader/GBA.ino')
-rw-r--r--Cart_Reader/GBA.ino12
1 files changed, 12 insertions, 0 deletions
diff --git a/Cart_Reader/GBA.ino b/Cart_Reader/GBA.ino
index a1e972b..09427c2 100644
--- a/Cart_Reader/GBA.ino
+++ b/Cart_Reader/GBA.ino
@@ -893,6 +893,18 @@ void readROM_GBA() {
processedProgressBar += 512;
draw_progressbar(processedProgressBar, totalProgressBar);
}
+
+ // Fix unmapped ROM area of cartridges with 32 MB ROM + EEPROM save type
+ if ((cartSize == 0x2000000) && ((saveType == 1) || (saveType == 2))) {
+ byte padding_byte[256];
+ char tempStr[32];
+ myFile.seek(0x1FFFEFF);
+ myFile.read(padding_byte, 1);
+ sprintf(tempStr, "Fixing ROM padding (0x%02X)", padding_byte[0]);
+ println_Msg(tempStr);
+ memset(padding_byte+1, padding_byte[0], 255);
+ myFile.write(padding_byte, 256);
+ }
// Close the file:
myFile.close();