all repos — mgba @ ff735e35b77c2ee4246ed0413605a45ed6158847

mGBA Game Boy Advance Emulator

GB: mVL-related fixes
Vicki Pfau vi@endrift.com
Sun, 02 Jun 2019 17:21:44 -0700
commit

ff735e35b77c2ee4246ed0413605a45ed6158847

parent

00e8b9877f76420e1e85c34cc2a156d1a52b8a30

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

jump to
M src/gb/core.csrc/gb/core.c

@@ -984,6 +984,7 @@ if (!mVideoLoggerRendererRun(gbcore->proxyRenderer.logger, true)) {

GBVideoProxyRendererUnshim(&gb->video, &gbcore->proxyRenderer); mVideoLogContextRewind(gbcore->logContext, core); GBVideoProxyRendererShim(&gb->video, &gbcore->proxyRenderer); + gb->earlyExit = true; } }

@@ -999,6 +1000,7 @@ memset(&gbcore->logCallbacks, 0, sizeof(gbcore->logCallbacks));

gbcore->logCallbacks.videoFrameStarted = _GBVLPStartFrameCallback; gbcore->logCallbacks.context = core; core->addCoreCallbacks(core, &gbcore->logCallbacks); + core->videoLogger = gbcore->proxyRenderer.logger; return true; }
M src/gb/video.csrc/gb/video.c

@@ -343,19 +343,19 @@ if (video->p->cpu->executionState != LR35902_CORE_FETCH) {

mTimingSchedule(timing, &video->frameEvent, 4 - ((video->p->cpu->executionState + 1) & 3)); return; } + if (!GBRegisterLCDCIsEnable(video->p->memory.io[REG_LCDC])) { + mTimingSchedule(timing, &video->frameEvent, GB_VIDEO_TOTAL_LENGTH); + } - GBFrameEnded(video->p); - mCoreSyncPostFrame(video->p->sync); --video->frameskipCounter; if (video->frameskipCounter < 0) { video->renderer->finishFrame(video->renderer); video->frameskipCounter = video->frameskip; } + GBFrameEnded(video->p); + mCoreSyncPostFrame(video->p->sync); ++video->frameCounter; - if (!GBRegisterLCDCIsEnable(video->p->memory.io[REG_LCDC])) { - mTimingSchedule(timing, &video->frameEvent, GB_VIDEO_TOTAL_LENGTH); - } GBFrameStarted(video->p); }