GB Video: Fix event timing on LCD enable

This commit is contained in:
Jeffrey Pfau 2016-01-17 01:15:18 -08:00
parent e019c54aad
commit 76c41a62ba
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}