From 96e92d33b7f81a6ceb9123d9c7497ee1be32fda8 Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Sat, 6 Sep 2014 17:42:31 +1200 Subject: [PATCH] Don't write to EXRAM if it doesn't exist. Previously, if a gamecube game wrote to an EXRAM address, dolphin would segfault. --- Source/Core/Core/HW/MemmapFunctions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/HW/MemmapFunctions.cpp b/Source/Core/Core/HW/MemmapFunctions.cpp index 78192556a5..b47587940f 100644 --- a/Source/Core/Core/HW/MemmapFunctions.cpp +++ b/Source/Core/Core/HW/MemmapFunctions.cpp @@ -186,9 +186,9 @@ inline void WriteToHardware(u32 em_address, const T data, u32 effective_address, *(T*)&m_pRAM[em_address & RAM_MASK] = bswap(data); return; } - else if (((em_address & 0xF0000000) == 0x90000000) || + else if (m_pEXRAM && (((em_address & 0xF0000000) == 0x90000000) || ((em_address & 0xF0000000) == 0xD0000000) || - ((em_address & 0xF0000000) == 0x10000000)) + ((em_address & 0xF0000000) == 0x10000000))) { *(T*)&m_pEXRAM[em_address & EXRAM_MASK] = bswap(data); return;