mirror of
https://github.com/notwa/mm
synced 2024-07-02 14:17:12 -07:00
misc monitor for everything else
This commit is contained in:
parent
d306362f16
commit
02af8b23f2
|
@ -101,6 +101,7 @@ end
|
||||||
return {
|
return {
|
||||||
link = A(link, 0x4000),
|
link = A(link, 0x4000),
|
||||||
exit_value = AL(0x02, 2),
|
exit_value = AL(0x02, 2),
|
||||||
|
mask_worn = AL(0x04, 1),
|
||||||
intro_completed = AL(0x05, 1),
|
intro_completed = AL(0x05, 1),
|
||||||
cutscene_status = AL(0x0A, 2),
|
cutscene_status = AL(0x0A, 2),
|
||||||
time = AL(0x0C, 2),
|
time = AL(0x0C, 2),
|
||||||
|
@ -119,6 +120,7 @@ return {
|
||||||
has_magic = AL(0x38, 1), -- ?
|
has_magic = AL(0x38, 1), -- ?
|
||||||
magic = AL(0x39, 1),
|
magic = AL(0x39, 1),
|
||||||
rupees = AL(0x3A, 2),
|
rupees = AL(0x3A, 2),
|
||||||
|
navi_timer = AL(0x3C, 4), -- ?
|
||||||
has_normal_magic = AL(0x40, 1),
|
has_normal_magic = AL(0x40, 1),
|
||||||
has_double_magic = AL(0x41, 1),
|
has_double_magic = AL(0x41, 1),
|
||||||
owls_hit = AL(0x46, 2),
|
owls_hit = AL(0x46, 2),
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
local Monitor = require "classes.Monitor"
|
local Monitor = require "classes.Monitor"
|
||||||
local ByteMonitor = Class(Monitor)
|
local ByteMonitor = Class(Monitor)
|
||||||
|
|
||||||
|
local printf = dprintf or printf
|
||||||
|
|
||||||
function ByteMonitor:mark(i, x, x1)
|
function ByteMonitor:mark(i, x, x1)
|
||||||
|
if self.ignore and self:ignore(i) then return end
|
||||||
local now = emu.framecount()
|
local now = emu.framecount()
|
||||||
local str = ('%02i=%02X (%s)'):format(i, x, self.name)
|
local str = ('%04X=%02X (%s)'):format(i, x, self.name)
|
||||||
|
if self.byvalue then
|
||||||
if not self.modified[i] then
|
if not self.modified[i] then
|
||||||
self.modified[i] = {}
|
self.modified[i] = {}
|
||||||
end
|
end
|
||||||
|
@ -12,6 +16,13 @@ function ByteMonitor:mark(i, x, x1)
|
||||||
self.dirty = true
|
self.dirty = true
|
||||||
str = str..' (NEW!)'
|
str = str..' (NEW!)'
|
||||||
end
|
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)
|
printf('%s @%i', str, now)
|
||||||
message(str, 180)
|
message(str, 180)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,13 +1,51 @@
|
||||||
require "boilerplate"
|
require "boilerplate"
|
||||||
require "addrs.init"
|
require "addrs.init"
|
||||||
require "classes"
|
|
||||||
require "messages"
|
require "messages"
|
||||||
|
require "classes"
|
||||||
|
|
||||||
|
local unk_only = false
|
||||||
|
|
||||||
local unk = ByteMonitor('unk', AL(0xF6, 0x37A))
|
local unk = ByteMonitor('unk', AL(0xF6, 0x37A))
|
||||||
|
unk.byvalue = true
|
||||||
unk:load('data/_unk.lua')
|
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
|
while mm do
|
||||||
|
if unk_only then
|
||||||
unk:diff()
|
unk:diff()
|
||||||
unk:save()
|
unk:save()
|
||||||
|
else
|
||||||
|
link:diff()
|
||||||
|
end
|
||||||
draw_messages()
|
draw_messages()
|
||||||
|
print_deferred()
|
||||||
emu.frameadvance()
|
emu.frameadvance()
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user