2016-01-12 15:54:42 -08:00
|
|
|
require "lib.setup"
|
2015-04-22 16:51:27 -07:00
|
|
|
require "boilerplate"
|
2016-01-13 07:56:18 -08:00
|
|
|
require "addrs"
|
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
|
2015-05-24 03:20:24 -07:00
|
|
|
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
|
|
|
|
|
2015-05-24 03:20:24 -07:00
|
|
|
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
|
2015-05-24 03:20:24 -07:00
|
|
|
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
|