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

113 lines
2.5 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,
2016-01-26 01:12:20 -08:00
addrs.intro_completed,
2015-11-25 03:02:21 -08:00
addrs.anti_mash_timer,
addrs.cutscene_status,
addrs.time,
2016-01-26 01:12:20 -08:00
addrs.owl_id,
addrs.day_night,
addrs.time_speed,
addrs.day,
addrs.days_elapsed,
2015-11-25 03:02:21 -08:00
addrs.transformation,
2016-01-26 01:12:20 -08:00
addrs.have_tatl,
addrs.owl_save,
addrs.ZELDA3,
addrs.sot_count,
addrs.name,
addrs.max_hearts,
2015-11-25 03:02:21 -08:00
addrs.hearts,
2016-01-26 01:12:20 -08:00
addrs.magic_level,
2015-11-25 03:02:21 -08:00
addrs.magic,
addrs.rupees,
addrs.navi_timer,
2016-01-26 01:12:20 -08:00
addrs.has_normal_magic,
addrs.has_double_magic,
addrs.owls_hit,
-- addrs.tunic_boots,
addrs.sword_shield,
addrs.inventory_items,
addrs.inventory_masks,
addrs.inventory_quantities,
addrs.upgrades,
addrs.quest_items,
addrs.items_wft,
addrs.items_sht,
addrs.items_gbt,
addrs.items_stt,
addrs.keys_wft,
addrs.keys_sht,
addrs.keys_gbt,
addrs.keys_stt,
addrs.doubled_hearts,
addrs.fairies_wft,
addrs.fairies_sht,
addrs.fairies_gbt,
addrs.fairies_stt,
-- addrs.strange_string,
2015-11-25 03:02:21 -08:00
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,
2016-01-26 01:12:20 -08:00
addrs.scene_flags_ingame,
2015-11-25 03:02:21 -08:00
addrs.week_event_reg,
addrs.event_inf,
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