GB Video: Fix event timing on LCD enable
Jeffrey Pfau jeffrey@endrift.com
Sun, 17 Jan 2016 01:15:18 -0800
1 files changed,
2 insertions(+),
2 deletions(-)
jump to
M
src/gb/video.c
→
src/gb/video.c
@@ -140,8 +140,8 @@ video->nextEvent = video->nextMode;
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; }