diff --git a/Core/gb.c b/Core/gb.c index e89cac8..b22a01c 100644 --- a/Core/gb.c +++ b/Core/gb.c @@ -549,7 +549,10 @@ int GB_load_isx(GB_gameboy_t *gb, const char *path) bank = byte; if (byte >= 0x80) { READ(byte); - bank |= byte << 8; + /* TODO: This is just a guess, the docs don't elaborator on how banks > 0xFF are saved, + other than the fact that banks >= 80 requires two bytes to store them, and I haven't + encountered an ISX file for a ROM larger than 4MBs yet. */ + bank += byte << 7; } READ(address); @@ -603,7 +606,6 @@ int GB_load_isx(GB_gameboy_t *gb, const char *path) uint8_t flag; uint16_t bank; uint16_t address; - uint8_t byte; READ(count); count = LE16(count); while (count--) {