From ffa2b4990384158b7dd23a46794627dd1de97d81 Mon Sep 17 00:00:00 2001 From: John Peterson Date: Tue, 11 Nov 2008 23:35:51 +0000 Subject: [PATCH] Wii sound fix. May remove the broken sound that was sometimes heard in Wii Sports. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1135 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/HW/DSP.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/Src/HW/DSP.cpp b/Source/Core/Core/Src/HW/DSP.cpp index bc1c83f997..ebd10b0ff9 100644 --- a/Source/Core/Core/Src/HW/DSP.cpp +++ b/Source/Core/Core/Src/HW/DSP.cpp @@ -70,7 +70,8 @@ enum enum { ARAM_SIZE = 0x01000000, // 16 MB - ARAM_MASK = 0x00FFFFFF + ARAM_MASK = 0x00FFFFFF, + WII_MASK = 0x017FFFFF }; // UARAMCount @@ -611,12 +612,19 @@ void Update_ARAM_DMA() GenerateDSPInterrupt(INT_ARAM); } -u8 ReadARAM(const u32 _iAddress) +u8 ReadARAM(u32 _iAddress) { //LOGV(DSPINTERFACE, 0, "ARAM (r) 0x%08x", _iAddress); // _dbg_assert_(DSPINTERFACE,(_iAddress) < ARAM_SIZE); - return g_ARAM[_iAddress & ARAM_MASK]; + if(Core::GetStartupParameter().bWii) + { + if(_iAddress > WII_MASK) + _iAddress = (_iAddress & WII_MASK); + return g_ARAM[_iAddress]; + } + else + return g_ARAM[_iAddress & ARAM_MASK]; } u8* GetARAMPtr() @@ -626,7 +634,7 @@ u8* GetARAMPtr() void WriteARAM(u8 _iValue, u32 _iAddress) { - //LOGV(DSPINTERFACE, 0, "ARAM (w) 0x%08x 0x%08x", _iAddress); + //LOGV(DSPINTERFACE, 0, "ARAM (w) 0x%08x = 0x%08x", _iAddress, (_iAddress & ARAM_MASK)); // _dbg_assert_(DSPINTERFACE,(_iAddress) < ARAM_SIZE); //rouge leader writes WAY outside