From 8ca38ef7b227bd578e4221c3aa5714c6ba4a9602 Mon Sep 17 00:00:00 2001 From: Marko Pusljar Date: Sun, 24 Apr 2011 11:14:53 +0000 Subject: [PATCH] dsphle - dkjb wii ( fixes issue 3415 ) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7483 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp | 5 --- .../Core/Core/Src/HW/DSPHLE/UCodes/UCodes.h | 32 ++++++++++++++----- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp b/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp index 07e6cb1b4d..069bbedc63 100644 --- a/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp +++ b/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp @@ -240,12 +240,7 @@ void DSPHLE::DSP_SendAIBuffer(unsigned int address, unsigned int num_samples) if (pMixer && address) { short* samples = (short*)HLEMemory_Get_Pointer(address); - // Internal sample rate is always 32khz pMixer->PushSamples(samples, num_samples); - - // FIXME: Write the audio to a file - //if (log_ai) - // g_wave_writer.AddStereoSamples(samples, 8); } soundStream->Update(); diff --git a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCodes.h b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCodes.h index 5b322e861b..cb3bc6a4f0 100644 --- a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCodes.h +++ b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCodes.h @@ -30,28 +30,44 @@ class CMailHandler; +inline bool ExramRead(u32 _uAddress) +{ + if (_uAddress & 0x10000000) + return true; + else + return false; +} + inline u8 HLEMemory_Read_U8(u32 _uAddress) { - _uAddress &= Memory::RAM_MASK; - return Memory::m_pRAM[_uAddress]; + if (ExramRead(_uAddress)) + return Memory::m_pEXRAM[_uAddress & Memory::EXRAM_MASK]; + else + return Memory::m_pRAM[_uAddress & Memory::RAM_MASK]; } inline u16 HLEMemory_Read_U16(u32 _uAddress) { - _uAddress &= Memory::RAM_MASK; - return Common::swap16(*(u16*)&Memory::m_pRAM[_uAddress]); + if (ExramRead(_uAddress)) + return Common::swap16(*(u16*)&Memory::m_pEXRAM[_uAddress & Memory::EXRAM_MASK]); + else + return Common::swap16(*(u16*)&Memory::m_pRAM[_uAddress & Memory::RAM_MASK]); } inline u32 HLEMemory_Read_U32(u32 _uAddress) { - _uAddress &= Memory::RAM_MASK; - return Common::swap32(*(u32*)&Memory::m_pRAM[_uAddress]); + if (ExramRead(_uAddress)) + return Common::swap32(*(u32*)&Memory::m_pEXRAM[_uAddress & Memory::EXRAM_MASK]); + else + return Common::swap32(*(u32*)&Memory::m_pRAM[_uAddress & Memory::RAM_MASK]); } inline void* HLEMemory_Get_Pointer(u32 _uAddress) { - _uAddress &= Memory::RAM_MASK; - return &Memory::m_pRAM[_uAddress]; + if (ExramRead(_uAddress)) + return &Memory::m_pEXRAM[_uAddress & Memory::EXRAM_MASK]; + else + return &Memory::m_pRAM[_uAddress & Memory::RAM_MASK]; } class IUCode