Core: LL/LLD store address

This commit is contained in:
zilmar 2023-10-12 19:55:29 +10:30
parent a6405cfa2d
commit 3a68d3d92a
4 changed files with 12 additions and 4 deletions

View File

@ -1192,6 +1192,10 @@ void R4300iOp::LL()
{
_GPR[m_Opcode.rt].DW = (int32_t)MemoryValue;
(*_LLBit) = 1;
uint32_t PhysicalAddr;
bool MemoryUsed;
g_TLB->VAddrToPAddr(Address, PhysicalAddr, MemoryUsed);
_CP0[17] = PhysicalAddr >> 4;
}
}
@ -1234,6 +1238,10 @@ void R4300iOp::LLD()
if (g_MMU->LD_Memory(Address, _GPR[m_Opcode.rt].UDW))
{
(*_LLBit) = 1;
uint32_t PhysicalAddr;
bool MemoryUsed;
g_TLB->VAddrToPAddr(Address, PhysicalAddr, MemoryUsed);
_CP0[17] = PhysicalAddr >> 4;
}
}

View File

@ -323,7 +323,7 @@ bool CTLB::VAddrToPAddr(uint64_t VAddr, uint32_t & PAddr, bool & MemoryUnused)
}
if (Segment == MemorySegment_Direct32 || Segment == MemorySegment_Cached32)
{
PAddr = VAddr & 0x1FFFFFFF;
PAddr = VAddr & 0x7FFFFFFF;
return true;
}
return false;