From f73bc930809e76f01a13cd9c7850667f73a70f3a Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Wed, 10 Aug 2016 22:43:25 -0700 Subject: [PATCH] Qt: Fix directory sets in BIOS-only boot --- src/platform/qt/GameController.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/platform/qt/GameController.cpp b/src/platform/qt/GameController.cpp index f05dff82d..3c664aa54 100644 --- a/src/platform/qt/GameController.cpp +++ b/src/platform/qt/GameController.cpp @@ -341,6 +341,10 @@ void GameController::openGame(bool biosOnly) { if (!biosOnly) { mCoreLoadFile(m_threadContext.core, m_fname.toUtf8().constData()); + } else { + char dirname[PATH_MAX]; + separatePath(m_bios.toUtf8().constData(), dirname, m_threadContext.core->dirs.baseName, 0); + mDirectorySetAttachBase(&m_threadContext.core->dirs, VDirOpen(dirname)); } m_threadContext.core->setVideoBuffer(m_threadContext.core, m_drawContext, width); @@ -353,16 +357,6 @@ void GameController::openGame(bool biosOnly) { } } - if (!m_patch.isNull()) { - VFile* patch = VFileDevice::open(m_patch, O_RDONLY); - if (patch) { - m_threadContext.core->loadPatch(m_threadContext.core, patch); - } - patch->close(patch); - } else { - mCoreAutoloadPatch(m_threadContext.core); - } - m_inputController->recalibrateAxes(); memset(m_drawContext, 0xF8, width * height * 4); @@ -374,6 +368,15 @@ void GameController::openGame(bool biosOnly) { if (!biosOnly) { mCoreAutoloadSave(m_threadContext.core); + if (!m_patch.isNull()) { + VFile* patch = VFileDevice::open(m_patch, O_RDONLY); + if (patch) { + m_threadContext.core->loadPatch(m_threadContext.core, patch); + } + patch->close(patch); + } else { + mCoreAutoloadPatch(m_threadContext.core); + } } if (!mCoreThreadStart(&m_threadContext)) {