all repos — mgba @ f73bc930809e76f01a13cd9c7850667f73a70f3a

mGBA Game Boy Advance Emulator

Qt: Fix directory sets in BIOS-only boot
Jeffrey Pfau jeffrey@endrift.com
Wed, 10 Aug 2016 22:43:25 -0700
commit

f73bc930809e76f01a13cd9c7850667f73a70f3a

parent

051198395dc108415035ac37f779e9f063b6d2eb

1 files changed, 13 insertions(+), 10 deletions(-)

jump to
M src/platform/qt/GameController.cppsrc/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)) {