From a727ca4152028621d12a61785d1195225cac608c Mon Sep 17 00:00:00 2001 From: Pk11 Date: Sat, 30 Dec 2023 18:47:51 -0600 Subject: [PATCH] Fix dumping EEPROM registers in 32 MB ROMs (#222) --- arm9/source/dumpOperations.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arm9/source/dumpOperations.cpp b/arm9/source/dumpOperations.cpp index 46359a1..dd2ba69 100644 --- a/arm9/source/dumpOperations.cpp +++ b/arm9/source/dumpOperations.cpp @@ -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