all repos — mgba @ 98922b7a87f6d18bc0d63bc2fd9db092ee4b8318

mGBA Game Boy Advance Emulator

GB: Improve accuracy of video timings
Jeffrey Pfau jeffrey@endrift.com
Wed, 11 May 2016 23:05:24 -0700
commit

98922b7a87f6d18bc0d63bc2fd9db092ee4b8318

parent

273d2db575de606126b68e52dd04c71d8969dbcf

2 files changed, 5 insertions(+), 5 deletions(-)

jump to
M src/gb/video.csrc/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.hsrc/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,