From 0a320a29535fadbe6bd2365bb99417c64abe68e0 Mon Sep 17 00:00:00 2001 From: zilmar Date: Fri, 5 Oct 2012 19:22:01 +1000 Subject: [PATCH] update cycles before SI dma read/write --- Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index 7c2b6a9e9..37336cea1 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -954,6 +954,9 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) { switch (PAddr) { case 0x04800000: MoveConstToVariable(Value,&_Reg->SI_DRAM_ADDR_REG,"SI_DRAM_ADDR_REG"); break; case 0x04800004: + m_RegWorkingSet.SetBlockCycleCount(m_RegWorkingSet.GetBlockCycleCount() - CountPerOp()) ; + UpdateCounters(m_RegWorkingSet,false, true); + m_RegWorkingSet.SetBlockCycleCount(m_RegWorkingSet.GetBlockCycleCount() + CountPerOp()) ; MoveConstToVariable(Value,&_Reg->SI_PIF_ADDR_RD64B_REG,"SI_PIF_ADDR_RD64B_REG"); BeforeCallDirect(m_RegWorkingSet); MoveConstToX86reg((DWORD)((CPifRam *)this),x86_ECX); @@ -961,6 +964,9 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) { AfterCallDirect(m_RegWorkingSet); break; case 0x04800010: + m_RegWorkingSet.SetBlockCycleCount(m_RegWorkingSet.GetBlockCycleCount() - CountPerOp()) ; + UpdateCounters(m_RegWorkingSet,false, true); + m_RegWorkingSet.SetBlockCycleCount(m_RegWorkingSet.GetBlockCycleCount() + CountPerOp()) ; MoveConstToVariable(Value,&_Reg->SI_PIF_ADDR_WR64B_REG,"SI_PIF_ADDR_WR64B_REG"); BeforeCallDirect(m_RegWorkingSet); MoveConstToX86reg((DWORD)((CPifRam *)this),x86_ECX);