GB Video: Fix dot clock timing being slightly wrong

This commit is contained in:
Vicki Pfau 2017-07-25 13:46:24 -07:00
parent 1a30dcc553
commit 6c0d67cf5f
2 changed files with 2 additions and 1 deletions

View File

@ -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)

View File

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