summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2021-04-22 21:50:05 +0200
committerLéo Lam <leo@leolam.fr>2021-04-22 21:50:05 +0200
commit568428ca679dfd1ca7eeef3927b83597540f8060 (patch)
treec134ab71223076149a8be6e3eaf7f7cb348d2754
parent4d37dad20d230b003b74e38ff4c5af68e6ed232e (diff)
HLE: Do not clobber 0x1800-0x3000 when using MIOS to fix IPL crash
MIOS puts patch data in low MEM1 (0x1800-0x3000) for its own use. Overwriting data in this range can cause the IPL to crash when launching games that get patched by MIOS. See https://bugs.dolphin-emu.org/issues/11952 for more info. Not applying the Gecko HLE patches means that Gecko codes will not work under MIOS, but this is better than the alternative of having specific games crash.
-rw-r--r--Source/Core/Core/HLE/HLE.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/Core/Core/HLE/HLE.cpp b/Source/Core/Core/HLE/HLE.cpp
index a598e8d2b0..9c9471434d 100644
--- a/Source/Core/Core/HLE/HLE.cpp
+++ b/Source/Core/Core/HLE/HLE.cpp
@@ -76,6 +76,14 @@ void Patch(u32 addr, std::string_view func_name)
void PatchFixedFunctions()
{
+ // MIOS puts patch data in low MEM1 (0x1800-0x3000) for its own use.
+ // Overwriting data in this range can cause the IPL to crash when launching games
+ // that get patched by MIOS. See https://bugs.dolphin-emu.org/issues/11952 for more info.
+ // Not applying the Gecko HLE patches means that Gecko codes will not work under MIOS,
+ // but this is better than the alternative of having specific games crash.
+ if (SConfig::GetInstance().m_is_mios)
+ return;
+
// HLE jump to loader (homebrew). Disabled when Gecko is active as it interferes with the code
// handler
if (!SConfig::GetInstance().bEnableCheats)