all repos — mgba @ b5c350bc5bfdf3845779b430496712d7b6ebf004

mGBA Game Boy Advance Emulator

GB Video: Improved video timings (again)
Vicki Pfau vi@endrift.com
Wed, 17 May 2017 00:00:29 -0700
commit

b5c350bc5bfdf3845779b430496712d7b6ebf004

parent

53bcea63735d973c4fe09221d29dbb58545405ba

3 files changed, 6 insertions(+), 5 deletions(-)

jump to
M CHANGESCHANGES

@@ -117,6 +117,7 @@ - VFS: Add VFileFIFO for operating on circle buffers

- 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:
M include/mgba/internal/gb/video.hinclude/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.csrc/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); }