SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit c7298ae5a6bec7d6d46a2e8ac26a2f309373396d parent 8e675295a82c1861cc89aca62c2ba7380a33634b Author: Lior Halphon <LIJI32@gmail.com> Date: Mon, 3 Jan 2022 16:51:05 +0200 Fix a silly underflow Diffstat:
| M | Core/memory.c | 8 | +++++--- |
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/Core/memory.c b/Core/memory.c @@ -1194,6 +1194,7 @@ static void write_high_memory(GB_gameboy_t *gb, uint16_t addr, uint8_t value) if (GB_is_cgb(gb)) { if (addr < 0xFEA0) { gb->oam[addr & 0xFF] = value; + return; } switch (gb->model) { case GB_MODEL_CGB_D: @@ -1209,6 +1210,9 @@ static void write_high_memory(GB_gameboy_t *gb, uint16_t addr, uint8_t value) addr &= ~0x18; gb->extra_oam[addr - 0xfea0] = value; break; + case GB_MODEL_CGB_E: + case GB_MODEL_AGB: + break; case GB_MODEL_DMG_B: case GB_MODEL_MGB: case GB_MODEL_SGB_NTSC: @@ -1217,9 +1221,7 @@ static void write_high_memory(GB_gameboy_t *gb, uint16_t addr, uint8_t value) case GB_MODEL_SGB_PAL_NO_SFC: case GB_MODEL_SGB2: case GB_MODEL_SGB2_NO_SFC: - case GB_MODEL_CGB_E: - case GB_MODEL_AGB: - break; + __builtin_unreachable(); } return; }
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.