diff options
author | sanni <[email protected]> | 2022-10-31 15:41:29 +0100 |
---|---|---|
committer | sanni <[email protected]> | 2022-10-31 15:41:29 +0100 |
commit | cc17c70e304fb106b0399b333f86fcc68d70dc32 (patch) | |
tree | 472604fdd66f984868077018f1bfc8d8e77c6070 /Cart_Reader/GBA.ino | |
parent | a3feb32e156309bbe80c8f1f08283664cc3c1914 (diff) | |
download | cartreader-cc17c70e304fb106b0399b333f86fcc68d70dc32.tar.gz cartreader-cc17c70e304fb106b0399b333f86fcc68d70dc32.zip |
Fix reading/writing 4MB HiROM
HiROM starts at bank 192 and has 64 banks so byte variable currBank overflows.
Diffstat (limited to 'Cart_Reader/GBA.ino')
-rw-r--r-- | Cart_Reader/GBA.ino | 12 |
1 files changed, 6 insertions, 6 deletions
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
|