From da496232ea91c11a7494e7efedf539f25fefc0ba Mon Sep 17 00:00:00 2001 From: Craig Carnell <1188869+cscd98@users.noreply.github.com> Date: Tue, 8 Sep 2026 17:35:12 +0100 Subject: [PATCH] libretro: add load who game into memory option --- Source/Core/DolphinLibretro/Boot.cpp | 3 +++ Source/Core/DolphinLibretro/Common/Options.cpp | 14 ++++++++++++++ Source/Core/DolphinLibretro/Common/Options.h | 1 + 3 files changed, 18 insertions(+) diff --git a/Source/Core/DolphinLibretro/Boot.cpp b/Source/Core/DolphinLibretro/Boot.cpp index 67476b959da5..83922568aa91 100644 --- a/Source/Core/DolphinLibretro/Boot.cpp +++ b/Source/Core/DolphinLibretro/Boot.cpp @@ -337,6 +337,9 @@ bool retro_load_game(const struct retro_game_info* game) Config::SetBase(Config::MAIN_CPU_THREAD, Libretro::GetOption(core::MAIN_CPU_THREAD, /*def=*/true)); + Config::SetBase(Config::MAIN_LOAD_GAME_INTO_MEMORY, + Libretro::GetOption(core::MAIN_LOAD_GAME_INTO_MEMORY, /*def=*/false)); + Config::SetBase(Config::MAIN_ENABLE_CHEATS, Libretro::GetOption(core::CHEATS_ENABLED, /*def=*/false)); diff --git a/Source/Core/DolphinLibretro/Common/Options.cpp b/Source/Core/DolphinLibretro/Common/Options.cpp index a64654b1fc72..7d27a1ea3ce6 100644 --- a/Source/Core/DolphinLibretro/Common/Options.cpp +++ b/Source/Core/DolphinLibretro/Common/Options.cpp @@ -169,6 +169,20 @@ static struct retro_core_option_v2_definition option_defs[] = { }, "enabled" }, + { + Libretro::Options::core::MAIN_LOAD_GAME_INTO_MEMORY, + "Core > Load Whole Game Into Memory", + "Load Whole Game Into Memory", + "Load Whole Game Into Memory. Requires core RESTART.", + nullptr, + CATEGORY_CORE, + { + { "disabled", "Disabled" }, + { "enabled", "Enabled" }, + { nullptr, nullptr } + }, + "disabled" + }, { Libretro::Options::core::MAIN_PRECISION_FRAME_TIMING, "Core > Precision Frame Timing", diff --git a/Source/Core/DolphinLibretro/Common/Options.h b/Source/Core/DolphinLibretro/Common/Options.h index 9936e5ecee74..0601c80065bb 100644 --- a/Source/Core/DolphinLibretro/Common/Options.h +++ b/Source/Core/DolphinLibretro/Common/Options.h @@ -135,6 +135,7 @@ namespace core { constexpr const char CPU_CLOCK_RATE[] = "dolphin_cpu_clock_rate"; constexpr const char EMULATION_SPEED[] = "dolphin_emulation_speed"; constexpr const char MAIN_CPU_THREAD[] = "dolphin_main_cpu_thread"; + constexpr const char MAIN_LOAD_GAME_INTO_MEMORY[] = "dolphin_main_load_game_into_memory"; constexpr const char MAIN_PRECISION_FRAME_TIMING[] = "dolphin_precision_frame_timing"; constexpr const char FASTMEM[] = "dolphin_fastmem"; constexpr const char FASTMEM_ARENA[] = "dolphin_fastmem_arena";