Qt: Fix preloading for ROM replacing

This commit is contained in:
Vicki Pfau 2022-05-29 20:37:10 -07:00
parent a9978e9892
commit 6fd3bfb86b
3 changed files with 8 additions and 1 deletions

View File

@ -49,6 +49,7 @@ Other fixes:
- mGUI: Fix FPS counter after closing menu
- Qt: Fix some hangs when using the debugger console
- Qt: Fix crash when clicking past last tile in viewer
- Qt: Fix preloading for ROM replacing
- VFS: Failed file mapping should return NULL on POSIX
Misc:
- Core: Suspend runloop when a core crashes

View File

@ -287,6 +287,7 @@ void CoreController::loadConfig(ConfigController* config) {
m_fastForwardMute = config->getOption("fastForwardMute", -1).toInt();
mCoreConfigCopyValue(&m_threadContext.core->config, config->config(), "volume");
mCoreConfigCopyValue(&m_threadContext.core->config, config->config(), "mute");
m_preload = config->getOption("preload").toInt();
int playerId = m_multiplayer->playerId(this) + 1;
QVariant savePlayerId = config->getOption("savePlayerId");
@ -829,7 +830,11 @@ void CoreController::replaceGame(const QString& path) {
QString fname = info.canonicalFilePath();
Interrupter interrupter(this);
mDirectorySetDetachBase(&m_threadContext.core->dirs);
mCoreLoadFile(m_threadContext.core, fname.toUtf8().constData());
if (m_preload) {
mCorePreloadFile(m_threadContext.core, fname.toUtf8().constData());
} else {
mCoreLoadFile(m_threadContext.core, fname.toUtf8().constData());
}
updateROMInfo();
}

View File

@ -240,6 +240,7 @@ private:
mCoreThread m_threadContext{};
bool m_patched = false;
bool m_preload = false;
uint32_t m_crc32;
QString m_internalTitle;