From 91513ced220d63c4d586ce375f4d978674db2487 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Mon, 20 Feb 2017 14:20:45 +0200 Subject: [PATCH] Minor adjustment to LCD timing after enabling it. --- Core/memory.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/memory.c b/Core/memory.c index a22c746..879503a 100644 --- a/Core/memory.c +++ b/Core/memory.c @@ -441,7 +441,9 @@ static void write_high_memory(GB_gameboy_t *gb, uint16_t addr, uint8_t value) case GB_IO_LCDC: if ((value & 0x80) && !(gb->io_registers[GB_IO_LCDC] & 0x80)) { - gb->display_cycles = 0; + /* It appears that there's a slight delay after enabling the screen? */ + /* Todo: verify this. */ + gb->display_cycles = gb->cgb_double_speed? -2 : -4; } gb->io_registers[GB_IO_LCDC] = value; return;