Skip to content

Commit

Permalink
n64: correct implementation of out of bounds RDRAM reads and writes
Browse files Browse the repository at this point in the history
  • Loading branch information
rasky authored and LukeUsher committed Jul 21, 2023
1 parent c94c7a9 commit 8b45d04
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ares/n64/rdram/rdram.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,20 @@

struct RDRAM : Memory::RCP<RDRAM> {
Node::Object node;
Memory::Writable ram;

struct Writable : public Memory::Writable {
template<u32 Size>
auto read(u32 address) -> u64 {
if (address >= size) return 0;
return Memory::Writable::read<Size>(address);
}

template<u32 Size>
auto write(u32 address, u64 value) -> void {
if (address >= size) return;
Memory::Writable::write<Size>(address, value);
}
} ram;

struct Debugger {
//debugger.cpp
Expand Down

0 comments on commit 8b45d04

Please sign in to comment.