Fix video cycle timing to match audio timing fix

This commit is contained in:
Jeffrey Pfau 2013-10-18 09:41:01 -07:00
parent 093c86c943
commit 565ee43bb2
1 changed files with 2 additions and 1 deletions

View File

@ -63,6 +63,7 @@ void GBAVideoAssociateRenderer(struct GBAVideo* video, struct GBAVideoRenderer*
int32_t GBAVideoProcessEvents(struct GBAVideo* video, int32_t cycles) { int32_t GBAVideoProcessEvents(struct GBAVideo* video, int32_t cycles) {
video->nextEvent -= cycles; video->nextEvent -= cycles;
video->eventDiff += cycles;
if (video->nextEvent <= 0) { if (video->nextEvent <= 0) {
video->lastHblank -= video->eventDiff; video->lastHblank -= video->eventDiff;
video->nextHblank -= video->eventDiff; video->nextHblank -= video->eventDiff;
@ -124,7 +125,7 @@ int32_t GBAVideoProcessEvents(struct GBAVideo* video, int32_t cycles) {
} }
} }
video->eventDiff = video->nextEvent; video->eventDiff = 0;
} }
return video->nextEvent; return video->nextEvent;
} }