From 5ee1dfcea7fb0de91b976e047053b8b1aace0d84 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sun, 28 Feb 2016 11:24:11 -0800 Subject: [PATCH] GBA Core: Fix initializing video render buffer --- src/gba/core.c | 1 + src/platform/test/perf-main.c | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gba/core.c b/src/gba/core.c index db9d97398..7623a8d86 100644 --- a/src/gba/core.c +++ b/src/gba/core.c @@ -44,6 +44,7 @@ static bool _GBACoreInit(struct mCore* core) { ARMInit(cpu); GBAVideoSoftwareRendererCreate(&gbacore->renderer); + gbacore->renderer.outputBuffer = NULL; gbacore->keys = 0; gba->keySource = &gbacore->keys; diff --git a/src/platform/test/perf-main.c b/src/platform/test/perf-main.c index 9b828d305..39fbee85e 100644 --- a/src/platform/test/perf-main.c +++ b/src/platform/test/perf-main.c @@ -103,10 +103,6 @@ int main(int argc, char** argv) { didFail = 1; goto cleanup; } - - if (!perfOpts.noVideo) { - core->setVideoBuffer(core, outputBuffer, 256); - } if (perfOpts.savestate) { _savestate = VFileOpen(perfOpts.savestate, O_RDONLY); free(perfOpts.savestate); @@ -116,6 +112,9 @@ int main(int argc, char** argv) { char gameCode[5] = { 0 }; core->init(core); + if (!perfOpts.noVideo) { + core->setVideoBuffer(core, outputBuffer, 256); + } mCoreLoadFile(core, args.fname); mCoreConfigInit(&core->config, "perf"); mCoreConfigLoad(&core->config);