diff --git a/CHANGES b/CHANGES index 4111b34da..1114e5ae7 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,7 @@ Bugfixes: - GBA: Reset active region as needed when loading a ROM - Qt: Fix command line debugger closing second game - GB Serialize: Fix audio state loading + - GB Video: Fix dot clock timing being slightly wrong Misc: - GBA Timer: Use global cycles for timers - GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722) diff --git a/src/gb/video.c b/src/gb/video.c index 605fcdd7f..830f71c30 100644 --- a/src/gb/video.c +++ b/src/gb/video.c @@ -211,7 +211,7 @@ void _endMode2(struct mTiming* timing, void* context, uint32_t cyclesLate) { struct GBVideo* video = context; _cleanOAM(video, video->ly); video->x = 0; - video->dotClock = timing->masterCycles - cyclesLate; + video->dotClock = mTimingCurrentTime(timing) - cyclesLate; int32_t next = GB_VIDEO_MODE_3_LENGTH_BASE + video->objMax * 6 - (video->p->memory.io[REG_SCX] & 7); video->mode = 3; video->modeEvent.callback = _endMode3;