diff --git a/Core/gb.h b/Core/gb.h index 1904d1a77..5a2b48d49 100644 --- a/Core/gb.h +++ b/Core/gb.h @@ -192,7 +192,7 @@ enum { /* Missing */ GB_IO_VBK = 0x4F, // CGB Mode Only - VRAM Bank - GB_IO_BANK = 0x50, // Write to disable the BIOS mapping + GB_IO_BANK = 0x50, // Write to disable the boot ROM mapping /* CGB DMA */ GB_IO_HDMA1 = 0x51, // CGB Mode Only - New DMA Source, High diff --git a/Core/memory.c b/Core/memory.c index 5ada0929f..ad0875dd7 100644 --- a/Core/memory.c +++ b/Core/memory.c @@ -702,7 +702,8 @@ static uint8_t read_high_memory(GB_gameboy_t *gb, uint16_t addr) return 0xFF; } return (gb->io_registers[GB_IO_KEY1] & 0x7F) | (gb->cgb_double_speed? 0xFE : 0x7E); - + case GB_IO_BANK: + return 0xFE | gb->boot_rom_finished; case GB_IO_RP: { if (!gb->cgb_mode) return 0xFF; /* You will read your own IR LED if it's on. */ @@ -1572,7 +1573,7 @@ static void write_high_memory(GB_gameboy_t *gb, uint16_t addr, uint8_t value) return; case GB_IO_BANK: - gb->boot_rom_finished = true; + gb->boot_rom_finished |= value & 1; return; case GB_IO_KEY0: