diff options
author | David Li <li.davidm96@gmail.com> | 2016-01-09 15:33:23 -0700 |
---|---|---|
committer | David Li <li.davidm96@gmail.com> | 2016-01-09 15:33:23 -0700 |
commit | b7ba05db1185849b955f23e1ab023b1819243ddf (patch) | |
tree | 3c89812dc0d86a8a7a35eb5f850b33546da4f285 /src/memory.rs | |
parent | cd85da118c61e91a4e70407ee52725d799d3994b (diff) |
Fix ReverseMmu address translation
Diffstat (limited to 'src/memory.rs')
-rw-r--r-- | src/memory.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/memory.rs b/src/memory.rs index b822fac..768ce59 100644 --- a/src/memory.rs +++ b/src/memory.rs @@ -154,7 +154,8 @@ impl ReverseMmu { impl Mmu for ReverseMmu { fn translate(&self, address: isa::Address) -> isa::Address { - self.top - address + let offset = address % 4; + (self.top - (address - offset)) + offset } } |