diff --git a/Core/memory.c b/Core/memory.c index ce25b040..a3010b06 100644 --- a/Core/memory.c +++ b/Core/memory.c @@ -357,6 +357,10 @@ static uint8_t read_high_memory(GB_gameboy_t *gb, uint16_t addr) if (!gb->cgb_mode && gb->boot_rom_finished) { return 0xFF; } + /* TODO: Verify actual access timing */ + if (gb->vram_read_blocked) { + return 0xFF; + } uint8_t index_reg = (addr & 0xFF) - 1; return ((addr & 0xFF) == GB_IO_BGPD? gb->background_palettes_data : @@ -788,6 +792,10 @@ static void write_high_memory(GB_gameboy_t *gb, uint16_t addr, uint8_t value) is required. */ return; } + /* TODO: Verify actual access timing */ + if (gb->vram_write_blocked) { + return; + } uint8_t index_reg = (addr & 0xFF) - 1; ((addr & 0xFF) == GB_IO_BGPD? gb->background_palettes_data :