From 6d4ea6d6935991fda3ee2d72452fb804d2a1d489 Mon Sep 17 00:00:00 2001 From: zilmar Date: Mon, 21 Dec 2015 21:01:56 +1100 Subject: [PATCH] [Projext64] Add Load32VideoInterface --- .../N64System/Mips/MemoryVirtualMem.cpp | 55 +++++++++++-------- .../N64System/Mips/MemoryVirtualMem.h | 1 + 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp b/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp index 56a8ffa97..22a6fcd36 100644 --- a/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp +++ b/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp @@ -2527,29 +2527,8 @@ bool CMipsMemoryVM::LW_NonMemory(uint32_t PAddr, uint32_t* Value) *Value = m_MemLookupValue.UW[0]; break; case 0x04400000: - switch (PAddr) - { - case 0x04400000: *Value = g_Reg->VI_STATUS_REG; break; - case 0x04400004: *Value = g_Reg->VI_ORIGIN_REG; break; - case 0x04400008: *Value = g_Reg->VI_WIDTH_REG; break; - case 0x0440000C: *Value = g_Reg->VI_INTR_REG; break; - case 0x04400010: - UpdateHalfLine(); - *Value = m_HalfLine; - break; - case 0x04400014: *Value = g_Reg->VI_BURST_REG; break; - case 0x04400018: *Value = g_Reg->VI_V_SYNC_REG; break; - case 0x0440001C: *Value = g_Reg->VI_H_SYNC_REG; break; - case 0x04400020: *Value = g_Reg->VI_LEAP_REG; break; - case 0x04400024: *Value = g_Reg->VI_H_START_REG; break; - case 0x04400028: *Value = g_Reg->VI_V_START_REG; break; - case 0x0440002C: *Value = g_Reg->VI_V_BURST_REG; break; - case 0x04400030: *Value = g_Reg->VI_X_SCALE_REG; break; - case 0x04400034: *Value = g_Reg->VI_Y_SCALE_REG; break; - default: - *Value = 0; - return false; - } + Load32VideoInterface(); + *Value = m_MemLookupValue.UW[0]; break; case 0x04500000: switch (PAddr) @@ -5662,4 +5641,34 @@ void CMipsMemoryVM::Load32MIPSInterface(void) g_Notify->BreakPoint(__FILE__, __LINE__); } } +} + +void CMipsMemoryVM::Load32VideoInterface(void) +{ + switch (m_MemLookupAddress & 0x1FFFFFFF) + { + case 0x04400000: m_MemLookupValue.UW[0] = g_Reg->VI_STATUS_REG; break; + case 0x04400004: m_MemLookupValue.UW[0] = g_Reg->VI_ORIGIN_REG; break; + case 0x04400008: m_MemLookupValue.UW[0] = g_Reg->VI_WIDTH_REG; break; + case 0x0440000C: m_MemLookupValue.UW[0] = g_Reg->VI_INTR_REG; break; + case 0x04400010: + g_MMU->UpdateHalfLine(); + m_MemLookupValue.UW[0] = g_MMU->m_HalfLine; + break; + case 0x04400014: m_MemLookupValue.UW[0] = g_Reg->VI_BURST_REG; break; + case 0x04400018: m_MemLookupValue.UW[0] = g_Reg->VI_V_SYNC_REG; break; + case 0x0440001C: m_MemLookupValue.UW[0] = g_Reg->VI_H_SYNC_REG; break; + case 0x04400020: m_MemLookupValue.UW[0] = g_Reg->VI_LEAP_REG; break; + case 0x04400024: m_MemLookupValue.UW[0] = g_Reg->VI_H_START_REG; break; + case 0x04400028: m_MemLookupValue.UW[0] = g_Reg->VI_V_START_REG; break; + case 0x0440002C: m_MemLookupValue.UW[0] = g_Reg->VI_V_BURST_REG; break; + case 0x04400030: m_MemLookupValue.UW[0] = g_Reg->VI_X_SCALE_REG; break; + case 0x04400034: m_MemLookupValue.UW[0] = g_Reg->VI_Y_SCALE_REG; break; + default: + m_MemLookupValue.UW[0] = 0; + 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 1b84c040c..6cd21d7f7 100644 --- a/Source/Project64-core/N64System/Mips/MemoryVirtualMem.h +++ b/Source/Project64-core/N64System/Mips/MemoryVirtualMem.h @@ -186,6 +186,7 @@ private: static void Load32SPRegisters(void); static void Load32DPCommand(void); static void Load32MIPSInterface(void); + static void Load32VideoInterface(void); CMipsMemory_CallBack * const m_CBClass;