1
0
Fork 0
mirror of https://github.com/notwa/mm synced 2024-06-25 19:47:12 -07:00

misc monitor for oot

This commit is contained in:
Connor Olding 2015-05-26 01:26:42 -07:00
parent abb05dc67e
commit 86173f3014
2 changed files with 30 additions and 8 deletions

View File

@ -125,6 +125,7 @@ return {
event_chk_inf = AL(0xED4, 0x1C), event_chk_inf = AL(0xED4, 0x1C),
item_get_inf = AL(0xEF0, 0x8), item_get_inf = AL(0xEF0, 0x8),
inf_table = AL(0xEF8, 0x3C), inf_table = AL(0xEF8, 0x3C),
checksum = AL(0x1352, 2),
event_inf = AL(0x13FA, 0x8), event_inf = AL(0x13FA, 0x8),
magic_max = AL(0x13F4, 2), magic_max = AL(0x13F4, 2),

View File

@ -1,16 +1,19 @@
require = require "depend"
require "boilerplate" require "boilerplate"
require "addrs.init" require "addrs.init"
require "messages" require "messages"
require "classes" require "classes"
-- no effect on OoT
local unk_only = false local unk_only = false
local unk = ByteMonitor('unk', AL(0xF6, 0x37A)) local unk = ByteMonitor('unk', AL(0xF6, 0x37A))
unk.byvalue = true unk.byvalue = true
unk:load('data/_unk.lua') unk:load('data/_unk.lua')
local link = ByteMonitor('link', AL(0,0x100C)) local size = addrs.checksum.addr - addrs.exit_value.addr + 4
local ignore_fields = { local link = ByteMonitor('link', AL(0, size))
local ignore_fields = mm and {
"exit_value", "exit_value",
"mask_worn", "mask_worn",
"cutscene_status", "cutscene_status",
@ -26,20 +29,38 @@ local ignore_fields = {
"inventory_items", "inventory_items",
"inventory_masks", "inventory_masks",
"inventory_quantities", "inventory_quantities",
} or {
"exit_value",
"cutscene_status",
"time",
"hearts",
"magic",
"rupees",
"navi_timer",
"scene_flags_save",
"inventory_items",
"inventory_quantities",
"event_chk_inf",
"item_get_inf",
"inf_table",
"event_inf",
} }
function link:ignore(i) function link:ignore(i)
for _, k in ipairs(ignore_fields) do for _, k in ipairs(ignore_fields) do
local size = addrs[k].type local v = addrs[k]
if not v then
error('unknown addr: '..tostring(k), 1)
end
local size = v.type
if size == 'f' then size = 4 end if size == 'f' then size = 4 end
local a = addrs[k].addr - self.begin local a = v.addr - self.begin
local b = a + size if i >= a and i < a + size then return true end
if i >= a and i < b then return true end
end end
end end
while mm do while mm or oot do
if unk_only then if mm and unk_only then
unk:diff() unk:diff()
unk:save() unk:save()
else else