Skip to content

Commit

Permalink
n64: optimize RDRAM accesses by special casing them
Browse files Browse the repository at this point in the history
  • Loading branch information
rasky committed Sep 8, 2024
1 parent 9233aa5 commit 1afdf6c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ares/n64/cpu/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ auto CPU::devirtualize(u64 vaddr, bool raiseAlignedError, bool raiseExceptions)
if (raiseAlignedError && vaddrAlignedError<Size>(vaddr, Dir == Write)) {
return PhysAccess{false};
}
//fast path for RDRAM, which is by far the most accessed memory region
if (vaddr >= 0xffff'ffff'8000'0000ull && vaddr <= 0xffff'ffff'83ef'ffffull) {
if constexpr(Dir == Read) return PhysAccess{true, true, (u32)vaddr & 0x3eff'ffff, vaddr};
if constexpr(Dir == Write) return PhysAccess{true, true, (u32)vaddr & 0x3eff'ffff, vaddr};
}
switch(segment(vaddr)) {
case Context::Segment::Unused:
if(raiseExceptions) {
Expand Down

0 comments on commit 1afdf6c

Please sign in to comment.