mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-30 08:24:14 +01:00
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:
commit
02bea92716
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user