1
0
Fork 0
mirror of https://github.com/notwa/mm synced 2024-11-05 05:39:02 -08:00
mm/Lua/lib/classes/SceneFlagMonitor.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

19 lines
583 B
Lua

local Monitor = require "classes.Monitor"
local SceneFlagMonitor = Class(Monitor)
function SceneFlagMonitor:mark(i, x, x1)
if not x1 then return end
local now = emu.framecount()
local diff = bit.bxor(x, x1)
for which = 0, 7 do
if bit.band(diff, 2^which) ~= 0 then
local state = bit.band(x, 2^which) ~= 0 and 1 or 0
local col = (3 - i)*8 + which
local str = ('%s: %02i=%i'):format(self.name, col, state)
printf('%s @%i', str, now)
message(str, 180)
end
end
end
return SceneFlagMonitor