Skip to content

Commit

Permalink
n64: simulate CPU freeze when accessing physical addresses >= 0x80000000
Browse files Browse the repository at this point in the history
  • Loading branch information
rasky committed Dec 3, 2023
1 parent b79974d commit ba956a6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ares/n64/memory/bus.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ inline auto Bus::read(u32 address, Thread& thread, const char *peripheral) -> u6
if(address <= 0x1fbf'ffff) return pi.read<Size>(address, thread);
if(address <= 0x1fcf'ffff) return si.read<Size>(address, thread);
if(address <= 0x7fff'ffff) return pi.read<Size>(address, thread);
debug(unusual, "[Bus::write] CPU frozen because of read from physical address ", hex(address, 8L), " outside of RCP mapped range");
cpu.scc.sysadFrozen = true;
return unmapped;
}

Expand Down Expand Up @@ -70,7 +72,8 @@ inline auto Bus::write(u32 address, u64 data, Thread& thread, const char *periph
if(address <= 0x1fbf'ffff) return pi.write<Size>(address, data, thread);
if(address <= 0x1fcf'ffff) return si.write<Size>(address, data, thread);
if(address <= 0x7fff'ffff) return pi.write<Size>(address, data, thread);
return;
debug(unusual, "[Bus::write] CPU frozen because of write to physical address ", hex(address, 8L), " outside of RCP mapped range");
cpu.scc.sysadFrozen = true;
}

template<u32 Size>
Expand Down

0 comments on commit ba956a6

Please sign in to comment.