From 48bce5a05a0a6d21cb6208f3b23a77ed3b06c9de Mon Sep 17 00:00:00 2001 From: hrydgard Date: Mon, 10 Nov 2008 21:54:11 +0000 Subject: [PATCH] Map ARAM to MEM2 on Wii the way I think it works. If this breaks stuff or is wrong, please tell me or revert. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1116 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/HW/DSP.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/Src/HW/DSP.cpp b/Source/Core/Core/Src/HW/DSP.cpp index 90c4e8ba86..840abdbbd1 100644 --- a/Source/Core/Core/Src/HW/DSP.cpp +++ b/Source/Core/Core/Src/HW/DSP.cpp @@ -176,7 +176,8 @@ u16 g_AR_MODE = 0x43; // 0x23 -> Zelda standard mode (standard ARAM access ??) void DoState(PointerWrap &p) { - p.DoArray(g_ARAM, ARAM_SIZE); + if (!Core::GetStartupParameter().bWii) + p.DoArray(g_ARAM, ARAM_SIZE); p.Do(g_dspState); p.Do(g_audioDMA); p.Do(g_arDMA); @@ -200,7 +201,15 @@ void GenerateDSPInterrupt_Wrapper(u64 userdata, int cyclesLate) void Init() { - g_ARAM = (u8 *)AllocateMemoryPages(ARAM_SIZE); + if (Core::GetStartupParameter().bWii) + { + // On the Wii, ARAM is simply mapped to EXRAM. + g_ARAM = Memory::GetPointer(0x10000000); + } + else + { + g_ARAM = (u8 *)AllocateMemoryPages(ARAM_SIZE); + } g_dspState.DSPControl.Hex = 0; g_dspState.DSPControl.DSPHalt = 1; et_GenerateDSPInterrupt = CoreTiming::RegisterEvent("DSPint", GenerateDSPInterrupt_Wrapper); @@ -208,7 +217,8 @@ void Init() void Shutdown() { - FreeMemoryPages(g_ARAM, ARAM_SIZE); + if (!Core::GetStartupParameter().bWii) + FreeMemoryPages(g_ARAM, ARAM_SIZE); g_ARAM = NULL; }