all repos — mgba @ 76c41a62ba989549d3dc75580e6dde16b8b5f9bb

mGBA Game Boy Advance Emulator

GB Video: Fix event timing on LCD enable
Jeffrey Pfau jeffrey@endrift.com
Sun, 17 Jan 2016 01:15:18 -0800
commit

76c41a62ba989549d3dc75580e6dde16b8b5f9bb

parent

e019c54aad2e28e7035868bb9e0f14a1b9369e2c

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M src/gb/video.csrc/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; }