COP0 TLB: Fix mapping ScratchpadRam Entries

Unsure why that was there. It would vtlbVMapBuffer if the mapping was for SPR (correct) but then continue and map on top of that as if it were a normal mapping.
This commit is contained in:
Ty Lamontagne 2024-06-22 10:14:37 -04:00 committed by refractionpcsx2
parent ba73a4cf3f
commit a00cb49035
1 changed files with 32 additions and 25 deletions

View File

@ -233,13 +233,19 @@ void MapTLB(const tlbs& t, int i)
i, t.VPN2, t.PFN0, t.PFN1, t.S >> 31, t.G, t.ASID,
t.Mask, t.EntryLo0 >> 6, (t.EntryLo0 & 0x38) >> 3, t.EntryLo1 >> 6, (t.EntryLo1 & 0x38) >> 3, t.VPN2);
// According to the manual
// 'It [SPR] must be mapped into a contiguous 16 KB of virtual address space that is
// aligned on a 16KB boundary.Results are not guaranteed if this restriction is not followed.'
// Assume that the game isn't doing anything less-than-ideal with the scratchpad mapping and map it directly to eeMem->Scratch.
if (t.S)
{
if (t.VPN2 != 0x70000000)
Console.Warning("COP0: Mapping Scratchpad to non-default address 0x%08X", t.VPN2);
vtlb_VMapBuffer(t.VPN2, eeMem->Scratch, Ps2MemSize::Scratch);
}
if (t.VPN2 == 0x70000000)
return; //uh uhh right ...
else
{
if (t.EntryLo0 & 0x2)
{
mask = ((~t.Mask) << 1) & 0xfffff;
@ -271,6 +277,7 @@ void MapTLB(const tlbs& t, int i)
}
}
}
}
}
void UnmapTLB(const tlbs& t, int i)