mirror of
https://github.com/notwa/mm
synced 2025-02-05 13:23:23 -08:00
Revert "Revert "update for new readbyterange behaviour""
This reverts commit adab471173
.
This commit is contained in:
parent
a087f2bff0
commit
cfd57b391b
2 changed files with 3 additions and 5 deletions
|
@ -12,12 +12,10 @@ function Monitor:init(name, a)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Monitor:read()
|
function Monitor:read()
|
||||||
-- bizhawk has an off-by-one bug where this returns length + 1 bytes
|
local raw = mainmemory.readbyterange(self.begin, self.len)
|
||||||
local raw = mainmemory.readbyterange(self.begin, self.len-1)
|
|
||||||
local bytes = {}
|
local bytes = {}
|
||||||
local begin = self.begin
|
|
||||||
for k, v in pairs(raw) do
|
for k, v in pairs(raw) do
|
||||||
bytes[k - begin] = v
|
bytes[k] = v
|
||||||
end
|
end
|
||||||
return bytes
|
return bytes
|
||||||
end
|
end
|
||||||
|
|
|
@ -43,7 +43,7 @@ function read_ascii(addr, len)
|
||||||
-- so we'll set up a table we can use ipairs() on
|
-- so we'll set up a table we can use ipairs() on
|
||||||
local ordered_bytes = {}
|
local ordered_bytes = {}
|
||||||
for a, v in pairs(bytes) do
|
for a, v in pairs(bytes) do
|
||||||
ordered_bytes[tonumber(a, 16) - begin + 1] = v
|
ordered_bytes[tonumber(a, 16) + 1] = v
|
||||||
end
|
end
|
||||||
|
|
||||||
local seq = false
|
local seq = false
|
||||||
|
|
Loading…
Add table
Reference in a new issue