Fix dumping EEPROM registers in 32 MB ROMs (#222)

This commit is contained in:
Pk11 2023-12-30 18:47:51 -06:00 committed by GitHub
parent 196a85ad15
commit a727ca4152
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1217,6 +1217,14 @@ void gbaCartDump(void) {
}
}
// 32MB + EEPROM: Fix last 256 bytes
if(!failed && (romSize == (32 << 20) && (saveType == SAVE_GBA_EEPROM_05 || saveType == SAVE_GBA_EEPROM_8))) {
u8 buffer[256];
toncset(buffer, ((u8 *)GBAROM)[((32 << 20) - 257)], 256);
fseek(destinationFile, -256, SEEK_END);
fwrite(buffer, 1, 256, destinationFile);
}
// Check for 64MB GBA Video ROM
if ((strncmp((char*)0x080000AC, "MSAE", 4) == 0 // Shark Tale
|| strncmp((char*)0x080000AC, "MSKE", 4) == 0 // Shrek