From 6d608cd6bce88aacbbbe105d8967b9c9b86b6f4e Mon Sep 17 00:00:00 2001 From: zilmar Date: Sat, 30 May 2015 13:46:16 +1000 Subject: [PATCH] [Project64] Handle SW const to 0x1fc00000 --- .../N64 System/Mips/Memory Virtual Mem.cpp | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index 03da90f8e..eb4ffbcd8 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -1543,11 +1543,35 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) } } break; + case 0x1fc00000: + { + m_RegWorkingSet.SetBlockCycleCount(m_RegWorkingSet.GetBlockCycleCount()-g_System->CountPerOp()); + UpdateCounters(m_RegWorkingSet,false,true); + m_RegWorkingSet.SetBlockCycleCount(m_RegWorkingSet.GetBlockCycleCount()+g_System->CountPerOp()); + + BeforeCallDirect(m_RegWorkingSet); + PushImm32(Value); + PushImm32(PAddr); + MoveConstToX86reg((ULONG)((CMipsMemoryVM *)this),x86_ECX); + Call_Direct(AddressOf(&CMipsMemoryVM::SW_NonMemory),"CMipsMemoryVM::SW_NonMemory"); + AfterCallDirect(m_RegWorkingSet); + } + break; default: if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); } + m_RegWorkingSet.SetBlockCycleCount(m_RegWorkingSet.GetBlockCycleCount()-g_System->CountPerOp()); + UpdateCounters(m_RegWorkingSet,false,true); + m_RegWorkingSet.SetBlockCycleCount(m_RegWorkingSet.GetBlockCycleCount()+g_System->CountPerOp()); + + BeforeCallDirect(m_RegWorkingSet); + PushImm32(Value); + PushImm32(PAddr); + MoveConstToX86reg((ULONG)((CMipsMemoryVM *)this),x86_ECX); + Call_Direct(AddressOf(&CMipsMemoryVM::SW_NonMemory),"CMipsMemoryVM::SW_NonMemory"); + AfterCallDirect(m_RegWorkingSet); } }