diff --git a/Source/Core/Core/Src/HW/Memmap.cpp b/Source/Core/Core/Src/HW/Memmap.cpp index f10f4cfe2f..dc9f853ba7 100644 --- a/Source/Core/Core/Src/HW/Memmap.cpp +++ b/Source/Core/Core/Src/HW/Memmap.cpp @@ -193,6 +193,7 @@ void InitHWMemFuncs() hwWrite16[VI_START+i] = VideoInterface::Write16; hwWrite32[VI_START+i] = VideoInterface::Write32; + hwRead16 [PI_START+i] = ProcessorInterface::Read16; hwRead32 [PI_START+i] = ProcessorInterface::Read32; hwWrite32[PI_START+i] = ProcessorInterface::Write32; @@ -259,6 +260,7 @@ void InitHWMemFuncsWii() hwWrite16[PE_START+i] = CPluginManager::GetInstance().GetVideo()->Video_PixelEngineWrite16; hwWrite32[PE_START+i] = CPluginManager::GetInstance().GetVideo()->Video_PixelEngineWrite32; + hwRead16 [PI_START+i] = ProcessorInterface::Read16; hwRead32 [PI_START+i] = ProcessorInterface::Read32; hwWrite32[PI_START+i] = ProcessorInterface::Write32; diff --git a/Source/Core/Core/Src/HW/ProcessorInterface.cpp b/Source/Core/Core/Src/HW/ProcessorInterface.cpp index d3dc1df779..4957a1e59f 100644 --- a/Source/Core/Core/Src/HW/ProcessorInterface.cpp +++ b/Source/Core/Core/Src/HW/ProcessorInterface.cpp @@ -102,6 +102,13 @@ void Init() toggleResetButton = CoreTiming::RegisterEvent("ToggleResetButton", &ToggleResetButtonCallback); } +void Read16(u16& _uReturnValue, const u32 _iAddress) +{ + u32 word; + Read32(word, _iAddress & ~3); + _uReturnValue = word >> (_iAddress & 3) ? 16 : 0; +} + void Read32(u32& _uReturnValue, const u32 _iAddress) { //INFO_LOG(PROCESSORINTERFACE, "(r32) 0x%08x", _iAddress); diff --git a/Source/Core/Core/Src/HW/ProcessorInterface.h b/Source/Core/Core/Src/HW/ProcessorInterface.h index 9560f482ca..38301984b2 100644 --- a/Source/Core/Core/Src/HW/ProcessorInterface.h +++ b/Source/Core/Core/Src/HW/ProcessorInterface.h @@ -57,6 +57,8 @@ extern u32 Fifo_CPUWritePointer; void Init(); void DoState(PointerWrap &p); +void Read16(u16& _uReturnValue, const u32 _iAddress); + void Read32(u32& _uReturnValue, const u32 _iAddress); void Write32(const u32 _iValue, const u32 _iAddress);