From 5b9746084d8a060b1a7b7a0d1cca67d079774012 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 23 Oct 2021 23:51:48 +0300 Subject: [PATCH] Writes to SVBK should work before the boot ROM is disabled --- Core/memory.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Core/memory.c b/Core/memory.c index 297656c..43cc98f 100644 --- a/Core/memory.c +++ b/Core/memory.c @@ -1243,12 +1243,11 @@ static void write_high_memory(GB_gameboy_t *gb, uint16_t addr, uint8_t value) gb->io_registers[GB_IO_DMA] = value; return; case GB_IO_SVBK: - if (!gb->cgb_mode) { - return; - } - gb->cgb_ram_bank = value & 0x7; - if (!gb->cgb_ram_bank) { - gb->cgb_ram_bank++; + if (gb->cgb_mode || (GB_is_cgb(gb) && !gb->boot_rom_finished)) { + gb->cgb_ram_bank = value & 0x7; + if (!gb->cgb_ram_bank) { + gb->cgb_ram_bank++; + } } return; case GB_IO_VBK: