Merge pull request #814 from lesserkuma/master

GBA: Fixes ROM name length and reading 32 MB carts that use EEPROM saves
This commit is contained in:
sanni 2023-06-17 15:30:13 +02:00 committed by GitHub
commit 02bea92716
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -761,7 +761,7 @@ void getCartInfo_GBA() {
} }
// Get name // Get name
buildRomName(romName, &sdBuffer[0xA0], 11); buildRomName(romName, &sdBuffer[0xA0], 12);
// Get ROM version // Get ROM version
romVersion = sdBuffer[0xBC]; romVersion = sdBuffer[0xBC];
@ -893,6 +893,18 @@ void readROM_GBA() {
processedProgressBar += 512; processedProgressBar += 512;
draw_progressbar(processedProgressBar, totalProgressBar); 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: // Close the file:
myFile.close(); myFile.close();