Update GBA.ino

This commit is contained in:
sanni 2024-07-09 20:53:34 +02:00
parent cb962b007b
commit 0a3ca11dfb

View File

@ -1941,7 +1941,6 @@ void resetIntel_GBA(unsigned long partitionSize) {
} }
void resetF0088H0_GBA() { void resetF0088H0_GBA() {
writeWord_GBA(0, 0x50);
writeWord_GBA(0, 0xFF); writeWord_GBA(0, 0xFF);
} }
@ -2329,17 +2328,21 @@ void writeF0088H0_GBA() {
uint32_t totalProgressBar = fileSize; uint32_t totalProgressBar = fileSize;
draw_progressbar(0, totalProgressBar); draw_progressbar(0, totalProgressBar);
unsigned long lastBlock = 0x2000000;
if (fileSize < lastBlock)
lastBlock = fileSize;
// 32MB max GBA bank size // 32MB max GBA bank size
for (unsigned long currBank = 0; currBank < fileSize; currBank += 0x2000000) { for (unsigned long currBank = 0; currBank < fileSize; currBank += 0x2000000) {
// 4MB minimum repro block size // 4MB minimum repro block size
for (unsigned long currBlock = 0; currBlock < 0x2000000; currBlock += 0x400000) { for (unsigned long currBlock = 0; currBlock < lastBlock; currBlock += 0x400000) {
// 256KB flashrom sector size // 256KB flashrom sector size
for (unsigned long currSector = 0; currSector < 0x400000; currSector += 0x40000) { for (unsigned long currSector = 0; currSector < 0x400000; currSector += 0x40000) {
// Unlock Sector // Unlock Sector
writeWord_GBA(currBlock + currSector, 0x60); //writeWord_GBA(currBlock + currSector, 0x60);
writeWord_GBA(currBlock + currSector, 0xD0); //writeWord_GBA(currBlock + currSector, 0xD0);
// Blink led // Blink led
blinkLED(); blinkLED();