GB: Improve accuracy of video timings
Jeffrey Pfau jeffrey@endrift.com
Wed, 11 May 2016 23:05:24 -0700
2 files changed,
5 insertions(+),
5 deletions(-)
M
src/gb/video.c
→
src/gb/video.c
@@ -179,11 +179,11 @@ _cleanOAM(video, video->ly);
video->dotCounter = 0; video->nextEvent = GB_VIDEO_HORIZONTAL_LENGTH; video->x = 0; - video->nextMode = GB_VIDEO_MODE_3_LENGTH_BASE + video->objMax * 8; + video->nextMode = GB_VIDEO_MODE_3_LENGTH_BASE + video->objMax * 12; video->mode = 3; break; case 3: - video->nextMode = GB_VIDEO_MODE_0_LENGTH_BASE - video->objMax * 8; + video->nextMode = GB_VIDEO_MODE_0_LENGTH_BASE - video->objMax * 12; video->mode = 0; if (GBRegisterSTATIsHblankIRQ(video->stat)) { video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT);
M
src/gb/video.h
→
src/gb/video.h
@@ -19,9 +19,9 @@ GB_VIDEO_VBLANK_PIXELS = 10,
GB_VIDEO_VERTICAL_TOTAL_PIXELS = GB_VIDEO_VERTICAL_PIXELS + GB_VIDEO_VBLANK_PIXELS, // TODO: Figure out exact lengths - GB_VIDEO_MODE_2_LENGTH = 85, - GB_VIDEO_MODE_3_LENGTH_BASE = 167, - GB_VIDEO_MODE_0_LENGTH_BASE = 204, + GB_VIDEO_MODE_2_LENGTH = 80, + GB_VIDEO_MODE_3_LENGTH_BASE = 176, + GB_VIDEO_MODE_0_LENGTH_BASE = 200, GB_VIDEO_HORIZONTAL_LENGTH = GB_VIDEO_MODE_0_LENGTH_BASE + GB_VIDEO_MODE_2_LENGTH + GB_VIDEO_MODE_3_LENGTH_BASE,