GB Video: Improved video timings (again)

This commit is contained in:
Vicki Pfau 2017-05-17 00:00:29 -07:00
parent 53bcea6373
commit b5c350bc5b
3 changed files with 6 additions and 5 deletions

View File

@ -117,6 +117,7 @@ Misc:
- Core: Move rewind diffing to its own thread
- Util: Tune patch-fast extent sizes
- Qt: Relax hard dependency on OpenGL
- GB Video: Improved video timings
0.5.2: (2016-12-31)
Bugfixes:

View File

@ -20,9 +20,9 @@ enum {
GB_VIDEO_VERTICAL_TOTAL_PIXELS = 154,
// TODO: Figure out exact lengths
GB_VIDEO_MODE_2_LENGTH = 76,
GB_VIDEO_MODE_3_LENGTH_BASE = 171,
GB_VIDEO_MODE_0_LENGTH_BASE = 209,
GB_VIDEO_MODE_2_LENGTH = 80,
GB_VIDEO_MODE_3_LENGTH_BASE = 172,
GB_VIDEO_MODE_0_LENGTH_BASE = 204,
GB_VIDEO_HORIZONTAL_LENGTH = 456,

View File

@ -215,7 +215,7 @@ void _endMode2(struct mTiming* timing, void* context, uint32_t cyclesLate) {
_cleanOAM(video, video->ly);
video->x = 0;
video->dotClock = timing->masterCycles - cyclesLate;
int32_t next = GB_VIDEO_MODE_3_LENGTH_BASE + video->objMax * 11 - (video->p->memory.io[REG_SCX] & 7);
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;
GBRegisterSTAT oldStat = video->stat;
@ -245,7 +245,7 @@ void _endMode3(struct mTiming* timing, void* context, uint32_t cyclesLate) {
GBUpdateIRQs(video->p);
}
video->p->memory.io[REG_STAT] = video->stat;
int32_t next = GB_VIDEO_MODE_0_LENGTH_BASE - video->objMax * 11;
int32_t next = GB_VIDEO_MODE_0_LENGTH_BASE - video->objMax * 6;
mTimingSchedule(timing, &video->modeEvent, (next << video->p->doubleSpeed) - cyclesLate);
}