From cc17c70e304fb106b0399b333f86fcc68d70dc32 Mon Sep 17 00:00:00 2001 From: sanni Date: Mon, 31 Oct 2022 15:41:29 +0100 Subject: Fix reading/writing 4MB HiROM HiROM starts at bank 192 and has 64 banks so byte variable currBank overflows. --- Cart_Reader/GBA.ino | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Cart_Reader/GBA.ino') diff --git a/Cart_Reader/GBA.ino b/Cart_Reader/GBA.ino index 1feb4bb..96ad616 100644 --- a/Cart_Reader/GBA.ino +++ b/Cart_Reader/GBA.ino @@ -565,12 +565,12 @@ void writeByte_GBA(unsigned long myAddress, byte myData) { *****************************************/ // Compute the checksum of rom header // "header" must contain at least the rom's first 188 bytes -byte checksumHeader_GBA(const byte *header) { - byte result = 0x00; - for (byte n = 0xA0; n < 0xBD; n++) { - result -= header[n]; - } - return result - 0x19; +byte checksumHeader_GBA(const byte* header) { + byte result = 0x00; + for (byte n = 0xA0; n < 0xBD; n++) { + result -= header[n]; + } + return result - 0x19; } // Read info out of rom header -- cgit v1.2.3