mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-30 08:24:14 +01:00
[GBA] Fixed reading 32 MB carts that use EEPROM saves
This commit is contained in:
parent
4c3e618f6e
commit
d1bfd53593
@ -894,6 +894,18 @@ void readROM_GBA() {
|
||||
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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user