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/SNES.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Cart_Reader/SNES.ino') diff --git a/Cart_Reader/SNES.ino b/Cart_Reader/SNES.ino index eab1339..a9e5ec7 100644 --- a/Cart_Reader/SNES.ino +++ b/Cart_Reader/SNES.ino @@ -602,7 +602,7 @@ void readLoRomBanks(unsigned int start, unsigned int total, FsFile* file) { uint32_t totalProgressBar = (uint32_t)(total - start) * 1024; draw_progressbar(0, totalProgressBar); - for (byte currBank = start; currBank < total; currBank++) { + for (word currBank = start; currBank < total; currBank++) { PORTL = currBank; // Blink led @@ -653,7 +653,7 @@ void readHiRomBanks(unsigned int start, unsigned int total, FsFile* file) { uint32_t totalProgressBar = (uint32_t)(total - start) * 1024; draw_progressbar(0, totalProgressBar); - for (byte currBank = start; currBank < total; currBank++) { + for (word currBank = start; currBank < total; currBank++) { PORTL = currBank; // Blink led -- cgit v1.2.3