From 3bbca2b22159e7abace718ee94244f863daf1183 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sun, 24 May 2015 03:20:24 -0700 Subject: [PATCH] flag wiping function; clean up flag addrs --- Lua/addrs/O/common.lua | 6 ++++++ Lua/event flag monitor.lua | 16 ++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Lua/addrs/O/common.lua b/Lua/addrs/O/common.lua index 6e85209..67c9657 100644 --- a/Lua/addrs/O/common.lua +++ b/Lua/addrs/O/common.lua @@ -119,6 +119,12 @@ return { beans = AL(0x9A, 1), }, + + event_chk_inf = AL(0xED4, 0x1C), + item_get_inf = AL(0xEF0, 0x8), + inf_table = AL(0xEF8, 0x3C), + event_inf = AL(0x13FA, 0x8), + buttons = AG(0x14, 2), scene_number = AG(0xA4, 2), camera_target = AG(0x270, 4), diff --git a/Lua/event flag monitor.lua b/Lua/event flag monitor.lua index d3f7838..1e5c621 100644 --- a/Lua/event flag monitor.lua +++ b/Lua/event flag monitor.lua @@ -96,10 +96,10 @@ if mm then inf:load('data/_inf.lua') fms = {weg, inf} elseif oot then - eci = FlagMonitor('eci', AL(0xED4, 0x1C)) - igi = FlagMonitor('igi', AL(0xEF0, 0x8)) - it_ = FlagMonitor('it ', AL(0xEF8, 0x3C)) - ei_ = FlagMonitor('ei ', AL(0x13FA, 0x8)) + 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) eci:load('data/_eci.lua') igi:load('data/_igi.lua') it_:load('data/_it.lua') @@ -108,6 +108,14 @@ elseif oot then for i, fm in ipairs(fms) do fm.oot = true end end +function ef_wipe() + for _, fm in ipairs(fms) do + for i = 0, fm.len-1 do + W1(fm.begin+i, 0) + end + end +end + while mm or oot do for i, fm in ipairs(fms) do fm:diff()