all repos — mgba @ 5dc56b98e896c9e246443354d77bb91a90c16c0a

mGBA Game Boy Advance Emulator

Qt: Fix savestate problems in BIOS boot
Jeffrey Pfau jeffrey@endrift.com
Mon, 11 Jan 2016 02:36:56 -0800
commit

5dc56b98e896c9e246443354d77bb91a90c16c0a

parent

9c5852a896f042222d6e411dd39a65b3ea58ce40

1 files changed, 9 insertions(+), 1 deletions(-)

jump to
M src/platform/qt/GameController.cppsrc/platform/qt/GameController.cpp

@@ -110,7 +110,7 @@ context->gba->video.renderer->disableBG[3] = !controller->m_videoLayers[3];

context->gba->video.renderer->disableOBJ = !controller->m_videoLayers[4]; controller->m_fpsTarget = context->fpsTarget; - if (GBALoadState(context, context->dirs.state, 0, SAVESTATE_SCREENSHOT)) { + if (context->dirs.state && GBALoadState(context, context->dirs.state, 0, SAVESTATE_SCREENSHOT)) { VFile* vf = GBAGetState(context->gba, context->dirs.state, 0, true); if (vf) { vf->truncate(vf, 0);

@@ -696,6 +696,10 @@ }

} void GameController::loadState(int slot) { + if (!m_threadContext.fname) { + // We're in the BIOS + return; + } if (slot > 0 && slot != m_stateSlot) { m_stateSlot = slot; m_backupSaveState.clear();

@@ -714,6 +718,10 @@ });

} void GameController::saveState(int slot) { + if (!m_threadContext.fname) { + // We're in the BIOS + return; + } if (slot > 0) { m_stateSlot = slot; }