From d30e09c73f4d9f82fd41baa90dcaa160ee5620a3 Mon Sep 17 00:00:00 2001 From: zilmar Date: Tue, 22 Dec 2015 16:57:18 +1100 Subject: [PATCH] [Project64] Add Write32RDRAMInterface --- .../N64System/Mips/MemoryVirtualMem.cpp | 36 +++++++++++-------- .../N64System/Mips/MemoryVirtualMem.h | 1 + 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp b/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp index 70d661ad2..ba01ac240 100644 --- a/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp +++ b/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp @@ -2666,21 +2666,7 @@ bool CMipsMemoryVM::SW_NonMemory(uint32_t PAddr, uint32_t Value) case 0x04400000: Write32VideoInterface(); break; case 0x04500000: Write32AudioInterface(); break; case 0x04600000: Write32PeripheralInterface(); break; - case 0x04700000: - switch (PAddr) - { - case 0x04700000: g_Reg->RI_MODE_REG = Value; break; - case 0x04700004: g_Reg->RI_CONFIG_REG = Value; break; - case 0x04700008: g_Reg->RI_CURRENT_LOAD_REG = Value; break; - case 0x0470000C: g_Reg->RI_SELECT_REG = Value; break; - case 0x04700010: g_Reg->RI_REFRESH_REG = Value; break; - case 0x04700014: g_Reg->RI_LATENCY_REG = Value; break; - case 0x04700018: g_Reg->RI_RERROR_REG = Value; break; - case 0x0470001C: g_Reg->RI_WERROR_REG = Value; break; - default: - return false; - } - break; + case 0x04700000: Write32RDRAMInterface(); break; case 0x04800000: switch (PAddr) { @@ -5761,4 +5747,24 @@ void CMipsMemoryVM::Write32PeripheralInterface(void) g_Notify->BreakPoint(__FILE__, __LINE__); } } +} + +void CMipsMemoryVM::Write32RDRAMInterface(void) +{ + switch (m_MemLookupAddress & 0xFFFFFFF) + { + case 0x04700000: g_Reg->RI_MODE_REG = m_MemLookupValue.UW[0]; break; + case 0x04700004: g_Reg->RI_CONFIG_REG = m_MemLookupValue.UW[0]; break; + case 0x04700008: g_Reg->RI_CURRENT_LOAD_REG = m_MemLookupValue.UW[0]; break; + case 0x0470000C: g_Reg->RI_SELECT_REG = m_MemLookupValue.UW[0]; break; + case 0x04700010: g_Reg->RI_REFRESH_REG = m_MemLookupValue.UW[0]; break; + case 0x04700014: g_Reg->RI_LATENCY_REG = m_MemLookupValue.UW[0]; break; + case 0x04700018: g_Reg->RI_RERROR_REG = m_MemLookupValue.UW[0]; break; + case 0x0470001C: g_Reg->RI_WERROR_REG = m_MemLookupValue.UW[0]; break; + default: + if (bHaveDebugger()) + { + g_Notify->BreakPoint(__FILE__, __LINE__); + } + } } \ No newline at end of file diff --git a/Source/Project64-core/N64System/Mips/MemoryVirtualMem.h b/Source/Project64-core/N64System/Mips/MemoryVirtualMem.h index 99d35f055..251cae70c 100644 --- a/Source/Project64-core/N64System/Mips/MemoryVirtualMem.h +++ b/Source/Project64-core/N64System/Mips/MemoryVirtualMem.h @@ -203,6 +203,7 @@ private: static void Write32VideoInterface(void); static void Write32AudioInterface(void); static void Write32PeripheralInterface(void); + static void Write32RDRAMInterface(void); CMipsMemory_CallBack * const m_CBClass;