Qt: Fix directory sets in BIOS-only boot
Jeffrey Pfau jeffrey@endrift.com
Wed, 10 Aug 2016 22:43:25 -0700
1 files changed,
13 insertions(+),
10 deletions(-)
M
src/platform/qt/GameController.cpp
→
src/platform/qt/GameController.cpp
@@ -341,6 +341,10 @@ m_frontBuffer = new uint32_t[width * height];
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 @@ m_threadContext.core->loadBIOS(m_threadContext.core, bios, 0);
} } - 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 @@ }
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)) {