mirror of
https://github.com/ares-emulator/ares.git
synced 2026-11-08 08:03:07 -10:00
n64: fix (again) TLB logic in case of invalid TLBs
This is a revert of56458d5b, while keepingb7f96b7109which is the real fix that should have been done all along. The former just papered over the issue and actually introduced a regression (Goldeneye wouldn't boot). Co-Authored-By: remutro <[email protected]>
This commit is contained in:
1 parent
a527ed6d1d
commit
0bf24b3161
1 file changed
+2
-2
@@ -2,6 +2,7 @@
|
||||
|
||||
auto CPU::TLB::load(u32 address) -> Match {
|
||||
for(auto& entry : this->entry) {
|
||||
if(!entry.globals && entry.addressSpaceID != self.scc.tlb.addressSpaceID) continue;
|
||||
if((address & entry.addressMaskHi) != (u32)entry.addressCompare) continue;
|
||||
bool lo = address & entry.addressSelect;
|
||||
if(!entry.valid[lo]) {
|
||||
@@ -10,7 +11,6 @@ auto CPU::TLB::load(u32 address) -> Match {
|
||||
self.exception.tlbLoadInvalid();
|
||||
return {false};
|
||||
}
|
||||
if(!entry.globals && entry.addressSpaceID != self.scc.tlb.addressSpaceID) continue;
|
||||
physicalAddress = entry.physicalAddress[lo] + (address & entry.addressMaskLo);
|
||||
self.debugger.tlbLoad(address, physicalAddress);
|
||||
return {true, entry.cacheAlgorithm[lo] != 2, physicalAddress};
|
||||
@@ -23,6 +23,7 @@ auto CPU::TLB::load(u32 address) -> Match {
|
||||
|
||||
auto CPU::TLB::store(u32 address) -> Match {
|
||||
for(auto& entry : this->entry) {
|
||||
if(!entry.globals && entry.addressSpaceID != self.scc.tlb.addressSpaceID) continue;
|
||||
if((address & entry.addressMaskHi) != (u32)entry.addressCompare) continue;
|
||||
bool lo = address & entry.addressSelect;
|
||||
if(!entry.valid[lo]) {
|
||||
@@ -37,7 +38,6 @@ auto CPU::TLB::store(u32 address) -> Match {
|
||||
self.exception.tlbModification();
|
||||
return {false};
|
||||
}
|
||||
if(!entry.globals && entry.addressSpaceID != self.scc.tlb.addressSpaceID) continue;
|
||||
physicalAddress = entry.physicalAddress[lo] + (address & entry.addressMaskLo);
|
||||
self.debugger.tlbStore(address, physicalAddress);
|
||||
return {true, entry.cacheAlgorithm[lo] != 2, physicalAddress};
|
||||
|
||||
Reference in new issue
Block a user