1
0
Fork 0
mirror of https://github.com/notwa/mm synced 2024-11-05 04:29:03 -08:00
mm/Lua/monitor misc.lua

77 lines
1.7 KiB
Lua
Raw Normal View History

2016-01-12 15:54:42 -08:00
require "lib.setup"
require "boilerplate"
2016-01-13 07:56:18 -08:00
require "addrs"
require "messages"
2015-05-26 00:40:12 -07:00
require "classes"
2015-05-26 01:26:42 -07:00
-- no effect on OoT
2015-05-26 00:40:12 -07:00
local unk_only = false
local unk = ByteMonitor('unk', AL(0xF6, 0x37A))
2015-05-26 00:40:12 -07:00
unk.byvalue = true
unk:load('data/_unk.lua')
2015-05-26 00:40:12 -07:00
2015-05-26 01:26:42 -07:00
local size = addrs.checksum.addr - addrs.exit_value.addr + 4
local link = ByteMonitor('link', AL(0, size))
local ignore_fields = mm and {
2015-11-25 03:02:21 -08:00
addrs.exit_value,
addrs.mask_worn,
addrs.anti_mash_timer,
addrs.cutscene_status,
addrs.time,
addrs.transformation,
addrs.hearts,
addrs.magic,
addrs.rupees,
addrs.navi_timer,
addrs.inventory.b_button_item,
addrs.inventory.c_left_item,
addrs.inventory.c_down_item,
addrs.inventory.c_right_item,
addrs.inventory.c_left_slot,
addrs.inventory.c_down_slot,
addrs.inventory.c_right_slot,
addrs.scene_flags_save,
addrs.week_event_reg,
addrs.event_inf,
addrs.inventory_items,
addrs.inventory_masks,
addrs.inventory_quantities,
2015-05-26 01:26:42 -07:00
} or {
2015-11-25 03:02:21 -08:00
addrs.exit_value,
addrs.cutscene_status,
addrs.time,
addrs.hearts,
addrs.magic,
addrs.rupees,
addrs.navi_timer,
addrs.scene_flags_save,
addrs.inventory_items,
addrs.inventory_quantities,
addrs.event_chk_inf,
addrs.item_get_inf,
addrs.inf_table,
addrs.event_inf,
2015-05-26 00:40:12 -07:00
}
function link:ignore(i)
2015-11-25 03:02:21 -08:00
for _, v in pairs(ignore_fields) do
2015-05-26 01:26:42 -07:00
local size = v.type
2015-05-26 00:40:12 -07:00
if size == 'f' then size = 4 end
2015-05-26 01:26:42 -07:00
local a = v.addr - self.begin
if i >= a and i < a + size then return true end
2015-05-26 00:40:12 -07:00
end
end
2015-05-26 01:26:42 -07:00
while mm or oot do
if mm and unk_only then
2015-05-26 00:40:12 -07:00
unk:diff()
unk:save()
else
link:diff()
end
draw_messages()
2015-05-26 00:40:12 -07:00
print_deferred()
emu.frameadvance()
end