n64: fix exception kind in case of TLB invalid page and with nonmatching asid

Fix several tests in n64-systemtest ROM.
This commit is contained in:
Giovanni Bajo authored and Luke Usher committed 2022-04-23 15:49:13 +01:00
1 parent 8d04515b5f
commit 56458d5ba5
1 file changed
+2 -2
+2 -2
View File
@@ -2,7 +2,6 @@
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]) {
@@ -11,6 +10,7 @@ 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,7 +23,6 @@ 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]) {
@@ -38,6 +37,7 @@ 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};