Skip to content

Commit

Permalink
Core: Do not set m_MemoryReadMap/m_MemoryWriteMap if tlb mapping is o…
Browse files Browse the repository at this point in the history
…utside rdram
  • Loading branch information
project64 committed Nov 14, 2022
1 parent 97e3f50 commit 989827c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1019,11 +1019,17 @@ void CMipsMemoryVM::TLB_Mapped(uint32_t VAddr, uint32_t Len, uint32_t PAddr, boo
for (uint32_t Address = VAddr; Address < VEnd; Address += 0x1000)
{
size_t Index = Address >> 12;
m_MemoryReadMap[Index] = (size_t)((m_RDRAM + (Address - VAddr + PAddr)) - Address);
if ((Address - VAddr + PAddr) < m_AllocatedRdramSize)
{
m_MemoryReadMap[Index] = (size_t)((m_RDRAM + (Address - VAddr + PAddr)) - Address);
}
m_TLB_ReadMap[Index] = ((size_t)(Address - VAddr + PAddr)) - Address;
if (!bReadOnly)
{
m_MemoryWriteMap[Index] = (size_t)((m_RDRAM + (Address - VAddr + PAddr)) - Address);
if ((Address - VAddr + PAddr) < m_AllocatedRdramSize)
{
m_MemoryWriteMap[Index] = (size_t)((m_RDRAM + (Address - VAddr + PAddr)) - Address);
}
m_TLB_WriteMap[Index] = ((size_t)(Address - VAddr + PAddr)) - Address;
}
}
Expand Down

0 comments on commit 989827c

Please sign in to comment.