1
0
Fork 0
mirror of https://github.com/notwa/mm synced 2024-05-18 05:23:22 -07:00
mm/Lua/lib/classes/ByteMonitor.lua
Connor Olding 1acbaba58c be super strict about globals
theres still a lot of work to do\nsince most scripts just set globals explicitly\nthis is still better than implied globals though
2016-01-13 09:21:24 -08:00

31 lines
813 B
Lua

local Monitor = require "classes.Monitor"
local ByteMonitor = Class(Monitor)
local printf = rawget(_G, 'dprintf') or printf
function ByteMonitor:mark(i, x, x1)
if self.ignore and self:ignore(i) then return end
local now = emu.framecount()
local str = ('%04X=%02X (%s)'):format(i, x, self.name)
if self.byvalue then
if not self.modified[i] then
self.modified[i] = {}
end
if not self.modified[i][x] then
self.modified[i][x] = true
self.dirty = true
str = str..' (NEW!)'
end
else
if not self.modified[i] then
self.modified[i] = true
self.dirty = true
str = str..' (NEW!)'
end
end
printf('%s @%i', str, now)
message(str, 180)
end
return ByteMonitor