From 76c41a62ba989549d3dc75580e6dde16b8b5f9bb Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sun, 17 Jan 2016 01:15:18 -0800 Subject: [PATCH] GB Video: Fix event timing on LCD enable --- src/gb/video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gb/video.c b/src/gb/video.c index 3facda86e..4de6f1bf5 100644 --- a/src/gb/video.c +++ b/src/gb/video.c @@ -140,8 +140,8 @@ void GBVideoWriteLCDC(struct GBVideo* video, GBRegisterLCDC value) { video->stat = GBRegisterSTATSetMode(video->stat, video->mode); video->p->memory.io[REG_STAT] = video->stat; video->eventDiff = 0; - if (video->nextEvent < video->p->cpu->nextEvent) { - video->p->cpu->nextEvent = video->nextEvent; + if (video->p->cpu->cycles + video->nextEvent < video->p->cpu->nextEvent) { + video->p->cpu->nextEvent = video->p->cpu->cycles + video->nextEvent; } return; }