git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit 5e4a1f6db78f51449d745c66e31c23017443b78e
parent 8c9c97b74fdbe17c6ee7a99856b34fba63953818
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Fri, 23 Feb 2024 19:03:36 +0200

Adjust the handling of >4MB ISX files

Diffstat:
MCore/gb.c6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 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--) {

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.