1
0
Fork 0
mirror of https://github.com/notwa/mm synced 2024-11-05 01:19:02 -08:00
mm/Lua/event flag monitor.lua

65 lines
1.7 KiB
Lua
Raw Normal View History

2015-05-15 21:55:11 -07:00
require = require "depend"
2015-04-22 16:51:27 -07:00
require "boilerplate"
2015-04-26 00:18:33 -07:00
require "addrs.init"
2015-05-07 15:27:50 -07:00
require "messages"
2015-05-25 20:10:00 -07:00
require "classes"
2015-04-22 16:51:27 -07:00
2015-05-25 20:10:00 -07:00
local mm_ignore = {
-- TODO: use list of bytes/bits rather than full strings
2015-04-25 23:23:41 -07:00
-- every time a scene (un)loads
['92,7=0 (weg)'] = true,
2015-04-22 16:51:27 -07:00
['92,7=1 (weg)'] = true,
2015-04-25 23:23:41 -07:00
-- night transition available
['05,2=0 (inf)'] = true,
['05,2=1 (inf)'] = true,
2015-04-22 16:51:27 -07:00
-- daily postman crap
['27,6=0 (weg)'] = true,
['27,7=0 (weg)'] = true,
['28,0=0 (weg)'] = true,
['28,1=0 (weg)'] = true,
['28,2=0 (weg)'] = true,
['27,6=1 (weg)'] = true,
['27,7=1 (weg)'] = true,
['28,0=1 (weg)'] = true,
['28,1=1 (weg)'] = true,
['28,2=1 (weg)'] = true,
}
2015-05-07 15:27:50 -07:00
if mm then
2015-05-25 20:10:00 -07:00
weg = FlagMonitor('weg', addrs.week_event_reg, mm_ignore)
inf = FlagMonitor('inf', addrs.event_inf, mm_ignore)
2015-05-14 21:32:46 -07:00
--mmb = FlagMonitor('mmb', addrs.mask_mask_bit) -- 100% known, no point
2015-05-07 15:27:50 -07:00
weg:load('data/_weg.lua')
inf:load('data/_inf.lua')
2015-05-14 21:32:46 -07:00
fms = {weg, inf}
2015-05-07 15:27:50 -07:00
elseif oot then
eci = FlagMonitor('eci', addrs.event_chk_inf)
igi = FlagMonitor('igi', addrs.item_get_inf)
it_ = FlagMonitor('it ', addrs.inf_table)
ei_ = FlagMonitor('ei ', addrs.event_inf)
2015-05-07 15:27:50 -07:00
eci:load('data/_eci.lua')
igi:load('data/_igi.lua')
it_:load('data/_it.lua')
ei_:load('data/_ei.lua')
2015-05-14 21:32:46 -07:00
fms = {eci, igi, it_, ei_}
for i, fm in ipairs(fms) do fm.oot = true end
end
function ef_wipe()
2015-05-24 06:25:22 -07:00
for _, fm in ipairs(fms) do fm:wipe() end
end
function ef_unk()
for _, fm in ipairs(fms) do fm:set_unknowns() end
end
2015-05-14 21:32:46 -07:00
while mm or oot do
for i, fm in ipairs(fms) do
fm:diff()
fm:save()
2015-05-07 15:27:50 -07:00
end
2015-05-14 21:32:46 -07:00
print_deferred()
draw_messages()
emu.frameadvance()
2015-04-22 16:51:27 -07:00
end