From 2039b5524e7c975de1404ca02241f531b30aa38f Mon Sep 17 00:00:00 2001 From: cristian64 Date: Tue, 15 Sep 2026 20:53:31 +0100 Subject: [PATCH] Core: Fix RAM override setup in IOS. This is a correction for 0cab1731d6 (part of #14665), where it was overlooked that the condition to enable the RAM override was flawed: if the user had enabled the emulated memory size override in Dolphin, but the running game did not define a simulated memory size greater than the retail memory size, the RAM override in IOS was wrongly misconfigured, causing issues with Wii games. Test plan: - Launch Dolphin. - In the **Settings > Advanced** section, tick the **Enable Emulated Memory Size Override** check box, and set the maximum memory size for both **MEM1** and **MEM2** (i.e. 64 MiB and 128 MiB respectively). - Play any Wii game (e.g. _Mario Kart Wii_ (RMCE01)). **Without** the patch, the emulator will hit an invalid read from `0x83FEE78C` at `0x8019FE6C`: Invalid read when starting Wii game after having enabled the emulated memory override in Dolphin **With** the patch, the emulator can execute the game as usual. --- Source/Core/Core/IOS/IOS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Core/IOS/IOS.cpp b/Source/Core/Core/IOS/IOS.cpp index 49c0b2bbd3..f49b82e0ec 100644 --- a/Source/Core/Core/IOS/IOS.cpp +++ b/Source/Core/Core/IOS/IOS.cpp @@ -221,7 +221,7 @@ static void ReleasePPCAncast(Core::System& system) void RAMOverrideForIOSMemoryValues(Memory::MemoryManager& memory, MemorySetupType setup_type) { // Don't touch anything if the feature isn't enabled. - if (!Config::Get(Config::MAIN_RAM_OVERRIDE_ENABLE) || + if (!Config::Get(Config::MAIN_RAM_OVERRIDE_ENABLE) && SConfig::GetInstance().GetSimulatedMemorySize() <= Memory::MEM1_SIZE_RETAIL) { return;