GB Video: Improved video timings (again)
Vicki Pfau vi@endrift.com
Wed, 17 May 2017 00:00:29 -0700
3 files changed,
6 insertions(+),
5 deletions(-)
M
include/mgba/internal/gb/video.h
→
include/mgba/internal/gb/video.h
@@ -20,9 +20,9 @@ GB_VIDEO_VBLANK_PIXELS = 10,
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,
M
src/gb/video.c
→
src/gb/video.c
@@ -215,7 +215,7 @@ struct GBVideo* video = context;
_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 @@ video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT);
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); }