mirror of
https://github.com/notwa/mm
synced 2024-11-04 22:49:03 -08:00
misc monitor for everything else
This commit is contained in:
parent
d306362f16
commit
02af8b23f2
3 changed files with 62 additions and 11 deletions
|
@ -101,6 +101,7 @@ end
|
|||
return {
|
||||
link = A(link, 0x4000),
|
||||
exit_value = AL(0x02, 2),
|
||||
mask_worn = AL(0x04, 1),
|
||||
intro_completed = AL(0x05, 1),
|
||||
cutscene_status = AL(0x0A, 2),
|
||||
time = AL(0x0C, 2),
|
||||
|
@ -119,6 +120,7 @@ return {
|
|||
has_magic = AL(0x38, 1), -- ?
|
||||
magic = AL(0x39, 1),
|
||||
rupees = AL(0x3A, 2),
|
||||
navi_timer = AL(0x3C, 4), -- ?
|
||||
has_normal_magic = AL(0x40, 1),
|
||||
has_double_magic = AL(0x41, 1),
|
||||
owls_hit = AL(0x46, 2),
|
||||
|
|
|
@ -1,16 +1,27 @@
|
|||
local Monitor = require "classes.Monitor"
|
||||
local ByteMonitor = Class(Monitor)
|
||||
|
||||
local printf = dprintf or printf
|
||||
|
||||
function ByteMonitor:mark(i, x, x1)
|
||||
if self.ignore and self:ignore(i) then return end
|
||||
local now = emu.framecount()
|
||||
local str = ('%02i=%02X (%s)'):format(i, x, self.name)
|
||||
if not self.modified[i] then
|
||||
self.modified[i] = {}
|
||||
end
|
||||
if not self.modified[i][x] then
|
||||
self.modified[i][x] = true
|
||||
self.dirty = true
|
||||
str = str..' (NEW!)'
|
||||
local str = ('%04X=%02X (%s)'):format(i, x, self.name)
|
||||
if self.byvalue then
|
||||
if not self.modified[i] then
|
||||
self.modified[i] = {}
|
||||
end
|
||||
if not self.modified[i][x] then
|
||||
self.modified[i][x] = true
|
||||
self.dirty = true
|
||||
str = str..' (NEW!)'
|
||||
end
|
||||
else
|
||||
if not self.modified[i] then
|
||||
self.modified[i] = true
|
||||
self.dirty = true
|
||||
str = str..' (NEW!)'
|
||||
end
|
||||
end
|
||||
printf('%s @%i', str, now)
|
||||
message(str, 180)
|
||||
|
|
|
@ -1,13 +1,51 @@
|
|||
require "boilerplate"
|
||||
require "addrs.init"
|
||||
require "classes"
|
||||
require "messages"
|
||||
require "classes"
|
||||
|
||||
local unk_only = false
|
||||
|
||||
local unk = ByteMonitor('unk', AL(0xF6, 0x37A))
|
||||
unk.byvalue = true
|
||||
unk:load('data/_unk.lua')
|
||||
|
||||
local link = ByteMonitor('link', AL(0,0x100C))
|
||||
local ignore_fields = {
|
||||
"exit_value",
|
||||
"mask_worn",
|
||||
"cutscene_status",
|
||||
"time",
|
||||
"transformation",
|
||||
"hearts",
|
||||
"magic",
|
||||
"rupees",
|
||||
"navi_timer",
|
||||
"scene_flags_save",
|
||||
"week_event_reg",
|
||||
"event_inf",
|
||||
"inventory_items",
|
||||
"inventory_masks",
|
||||
"inventory_quantities",
|
||||
}
|
||||
|
||||
function link:ignore(i)
|
||||
for _, k in ipairs(ignore_fields) do
|
||||
local size = addrs[k].type
|
||||
if size == 'f' then size = 4 end
|
||||
local a = addrs[k].addr - self.begin
|
||||
local b = a + size
|
||||
if i >= a and i < b then return true end
|
||||
end
|
||||
end
|
||||
|
||||
while mm do
|
||||
unk:diff()
|
||||
unk:save()
|
||||
if unk_only then
|
||||
unk:diff()
|
||||
unk:save()
|
||||
else
|
||||
link:diff()
|
||||
end
|
||||
draw_messages()
|
||||
print_deferred()
|
||||
emu.frameadvance()
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue