From 6221cd2d066713da656d45b84ab15ad99df085a7 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 11 Feb 2025 05:12:35 -0800 Subject: [PATCH] Qt: Enable ROM preloading by default --- CHANGES | 1 + src/platform/qt/ConfigController.cpp | 1 + src/platform/qt/CoreController.cpp | 2 +- src/platform/qt/CoreController.h | 2 +- src/platform/qt/CoreManager.h | 2 +- src/platform/qt/SettingsView.cpp | 2 +- src/platform/qt/SettingsView.ui | 3 +++ 7 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index af0702264..cdef7640e 100644 --- a/CHANGES +++ b/CHANGES @@ -60,6 +60,7 @@ Misc: - Qt: Allow passing multiple games on command line for multiplayer (closes mgba.io/i/3061) - Qt: Support building against Qt 6 - Qt: Add shortcuts to increment fast forward speed (mgba.io/i/2903) + - Qt: Enable ROM preloading by default - Res: Port hq2x and OmniScale shaders from SameBoy - Res: Port NSO-gba-colors shader (closes mgba.io/i/2834) - Res: Update gba-colors shader (closes mgba.io/i/2976) diff --git a/src/platform/qt/ConfigController.cpp b/src/platform/qt/ConfigController.cpp index a12768709..eae75fea4 100644 --- a/src/platform/qt/ConfigController.cpp +++ b/src/platform/qt/ConfigController.cpp @@ -149,6 +149,7 @@ ConfigController::ConfigController(QObject* parent) mCoreConfigSetDefaultIntValue(&m_config, "sgb.borders", 1); mCoreConfigSetDefaultIntValue(&m_config, "gb.colors", GB_COLORS_CGB); #endif + mCoreConfigSetDefaultIntValue(&m_config, "preload", true); mCoreConfigMap(&m_config, &m_opts); mSubParserGraphicsInit(&m_subparsers[0], &m_graphicsOpts); diff --git a/src/platform/qt/CoreController.cpp b/src/platform/qt/CoreController.cpp index 53d5b3892..7cd6c58d5 100644 --- a/src/platform/qt/CoreController.cpp +++ b/src/platform/qt/CoreController.cpp @@ -305,7 +305,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(); + m_preload = config->getOption("preload", true).toInt(); QSize sizeBefore = screenDimensions(); m_activeBuffer.resize(256 * 224 * sizeof(mColor)); diff --git a/src/platform/qt/CoreController.h b/src/platform/qt/CoreController.h index 4de454d4b..a6b6a03ca 100644 --- a/src/platform/qt/CoreController.h +++ b/src/platform/qt/CoreController.h @@ -263,7 +263,7 @@ private: QString m_savePath; bool m_patched = false; - bool m_preload = false; + bool m_preload = true; bool m_saveBlocked = false; uint32_t m_crc32; diff --git a/src/platform/qt/CoreManager.h b/src/platform/qt/CoreManager.h index da7460f22..e910886f6 100644 --- a/src/platform/qt/CoreManager.h +++ b/src/platform/qt/CoreManager.h @@ -36,7 +36,7 @@ signals: private: const mCoreConfig* m_config = nullptr; MultiplayerController* m_multiplayer = nullptr; - bool m_preload = false; + bool m_preload = true; }; } diff --git a/src/platform/qt/SettingsView.cpp b/src/platform/qt/SettingsView.cpp index f4eea01db..195fe0441 100644 --- a/src/platform/qt/SettingsView.cpp +++ b/src/platform/qt/SettingsView.cpp @@ -747,7 +747,7 @@ void SettingsView::reloadConfig() { loadSetting("patchPath", m_ui.patchPath); loadSetting("cheatsPath", m_ui.cheatsPath); loadSetting("showLibrary", m_ui.showLibrary); - loadSetting("preload", m_ui.preload); + loadSetting("preload", m_ui.preload, true); loadSetting("showFps", m_ui.showFps, true); loadSetting("cheatAutoload", m_ui.cheatAutoload, true); loadSetting("cheatAutosave", m_ui.cheatAutosave, true); diff --git a/src/platform/qt/SettingsView.ui b/src/platform/qt/SettingsView.ui index 8539e6bdb..bce56f730 100644 --- a/src/platform/qt/SettingsView.ui +++ b/src/platform/qt/SettingsView.ui @@ -1263,6 +1263,9 @@ Preload entire ROM into memory + + true +