From 7800d68feed7cde8927a4f576471f9c3d8363462 Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Fri, 12 Nov 2010 04:20:00 +0000 Subject: [PATCH] add ProcessorInterface::Read16. wii64 uses this (by accident), but real hardware supports it, so why not. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6384 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/HW/Memmap.cpp | 2 ++ Source/Core/Core/Src/HW/ProcessorInterface.cpp | 7 +++++++ Source/Core/Core/Src/HW/ProcessorInterface.h | 2 ++ 3 files changed, 11 insertions(+) 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);