Skip to content

Commit 6c38b22

Browse files
Fix crashes when running games, tests, etc.
Need the graphicsContext value to stick around.
1 parent 9f24b68 commit 6c38b22

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

UI/EmuScreen.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ void EmuScreen::bootGame(const std::string &filename) {
101101
if (g_Config.iGPUBackend == GPU_BACKEND_DIRECT3D9) {
102102
coreParam.gpuCore = GPU_DIRECTX9;
103103
}
104+
// Preserve the existing graphics context.
105+
coreParam.graphicsContext = PSP_CoreParameter().graphicsContext;
104106
coreParam.enableSound = g_Config.bEnableSound;
105107
coreParam.fileToStart = filename;
106108
coreParam.mountIso = "";

android/jni/TestRunner.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ void RunTests()
7272
coreParam.cpuCore = g_Config.bJit ? CPU_JIT : CPU_INTERPRETER;
7373
coreParam.gpuCore = g_Config.bSoftwareRendering ? GPU_SOFTWARE : GPU_GLES;
7474
coreParam.enableSound = g_Config.bEnableSound;
75+
coreParam.graphicsContext = PSP_CoreParameter().graphicsContext;
7576
coreParam.mountIso = "";
7677
coreParam.mountRoot = baseDirectory + "pspautotests/";
7778
coreParam.startPaused = false;

headless/Headless.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ int main(int argc, const char* argv[])
316316
CoreParameter coreParameter;
317317
coreParameter.cpuCore = useJit ? CPU_JIT : CPU_INTERPRETER;
318318
coreParameter.gpuCore = glWorking ? gpuCore : GPU_NULL;
319+
coreParameter.graphicsContext = graphicsContext;
319320
coreParameter.enableSound = false;
320321
coreParameter.mountIso = mountIso ? mountIso : "";
321322
coreParameter.mountRoot = mountRoot ? mountRoot : "";

0 commit comments

Comments
 (0)