From 1ecb9cb38291e0f79a093476ad0515c9364a5832 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Fri, 1 May 2015 09:37:56 -0700 Subject: [PATCH] get smart (small fixes) --- .gitignore | 1 + Lua/addrs/M EUDB.lua | 37 +------------------------------ Lua/addrs/M US10.lua | 1 + Lua/classes.lua | 3 ++- Lua/event flag monitor.lua | 11 ++------- Lua/oot memory editor monitor.lua | 5 +++-- 6 files changed, 10 insertions(+), 48 deletions(-) diff --git a/.gitignore b/.gitignore index 82d109b..839ccf2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ lua chest test lua movement test +_ootmemod.lua diff --git a/Lua/addrs/M EUDB.lua b/Lua/addrs/M EUDB.lua index 7ade5c0..756e6c4 100755 --- a/Lua/addrs/M EUDB.lua +++ b/Lua/addrs/M EUDB.lua @@ -1,38 +1,3 @@ return { - checksum = AL(0x100A, 2), - disable_pause = AL(0x100D, 1), - hookshot_ba = AL(0x100E, 1), - disable_c_buttons_2 = AL(0x100F, 1), - disable_items = AL(0x1010, 1), - rock_sirloin = AL(0x1014, 1), - sword_disabler = AL(0x1015, 1), - bubble_timer = AL(0x1016, 2), - rupee_accumulator = AL(0x1018, 2), - spring_water_timers = AL(0x1020, 0xC0), - spring_water_time_1 = AL(0x1020, 0x20), - spring_water_time_2 = AL(0x1040, 0x20), - spring_water_time_3 = AL(0x1060, 0x20), - spring_water_time_4 = AL(0x1080, 0x20), - spring_water_time_5 = AL(0x10A0, 0x20), - spring_water_time_6 = AL(0x10C0, 0x20), - pictograph_picture = AL(0x10E0, 0x2BC0), - title_screen_mod = AL(0x3CA8, 4), - entrance_mod = AL(0x3CAC, 4), - timer_crap = AL(0x3DD0, 4), - timer_x = AL(0x3EFA, 2), - timer_y = AL(0x3F08, 2), - buttons_enabled = AL(0x3F18, 4), - magic_modifier = AL(0x3F28, 4), - magic_max = AL(0x3F2E, 2), - weird_a_graphic = AL(0x3F42, 1), - target_style = AL(0x3F45, 1), - music_mod = AL(0x3F46, 2), - entrance_mod_setter = AL(0x3F4A, 2), - title_screen_thing = AL(0x3F4C, 1), - transition_mod = AL(0x3F55, 2), - suns_song_effect = AL(0x3F58, 2), - health_mod = AL(0x3F5A, 2), - screen_scale_enable = AL(0x3F60, 1), - screen_scale = AL(0x3F64, 'f'), - scene_flags_ingame = AL(0x3F68, 0x960), + mask_mask_bit = A(0x24405A, 3), } diff --git a/Lua/addrs/M US10.lua b/Lua/addrs/M US10.lua index b9da1a5..21e5e7f 100755 --- a/Lua/addrs/M US10.lua +++ b/Lua/addrs/M US10.lua @@ -3,6 +3,7 @@ return { visibility = A(0x166118, 2), stored_epona = A(0x1BDA9F, 1), stored_song = A(0x1C6A7D, 1), + mask_mask_bit = A(0x1F3F3A, 3), buttons_3 = A(0x1FB870, 2), buttons_4 = A(0x1FB876, 2), } diff --git a/Lua/classes.lua b/Lua/classes.lua index ef48e30..1fdda07 100644 --- a/Lua/classes.lua +++ b/Lua/classes.lua @@ -8,7 +8,8 @@ function Monitor:init(name, a) end function Monitor:diff() - local bytes = mainmemory.readbyterange(self.begin, self.len) + -- bizhawk has an off-by-one bug where this returns length + 1 bytes + local bytes = mainmemory.readbyterange(self.begin, self.len-1) local old_bytes = self.old_bytes if self.once then for k, v in pairs(bytes) do diff --git a/Lua/event flag monitor.lua b/Lua/event flag monitor.lua index f7d9cb2..e7071e3 100644 --- a/Lua/event flag monitor.lua +++ b/Lua/event flag monitor.lua @@ -23,13 +23,6 @@ local ignore = { } FlagMonitor = Class(Monitor) -function FlagMonitor:init(name, a) - self.name = name - self.begin = a.addr - self.len = a.type - self.once = false - self.old_bytes = {} -end function FlagMonitor:mark(i, x, x1) local now = emu.framecount() @@ -49,8 +42,8 @@ end local weg = FlagMonitor('weg', addrs.week_event_reg) local inf = FlagMonitor('inf', addrs.event_inf) --local mmb = FlagMonitor('mmb', A(0x24405A, 3)) -local mmb = FlagMonitor('mmb', A(0x1F3F3A, 3)) -while true do +local mmb = FlagMonitor('mmb', addrs.mask_mask_bit) +while mm do weg:diff() inf:diff() mmb:diff() diff --git a/Lua/oot memory editor monitor.lua b/Lua/oot memory editor monitor.lua index 0cd551c..e41732f 100644 --- a/Lua/oot memory editor monitor.lua +++ b/Lua/oot memory editor monitor.lua @@ -52,7 +52,8 @@ function ShortMonitor:dump() local mod = self.modified[ih] local value = R2(self.begin + ih) local vs = mod and 'n/a' or ('%04X'):format(value) - local s = ('%02X\t%i\t%i\t%s\n'):format(block, page+1, row+1, vs) + local name = ('%s%02i'):format(blocknames[block+1], page*16 + row) + local s = ('%s\t%i\t%i\t%s\n'):format(name, page+1, row+1, vs) buff = buff..s end print(buff) @@ -64,7 +65,7 @@ me = ShortMonitor('me', A(0x210A24, 0x15C0)) me.modified = deserialize('_ootmemod.lua') or {} -while true do +while version == "O EUDB MQ" do me:diff() if me.dirty then serialize(me.modified, ('_ootmemod.lua'))