Skip to content

Instantly share code, notes, and snippets.

@taotao54321
Created March 6, 2023 05:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taotao54321/9beb91a9f08edb2ea0075ac77b0f617b to your computer and use it in GitHub Desktop.
Save taotao54321/9beb91a9f08edb2ea0075ac77b0f617b to your computer and use it in GitHub Desktop.
NES Dragon Quest (J): log fetching script commands from strange addresses
--[[
NES Dragon Quest (J) - log fetching script commands from strange addresses
--]]
local function on_exec()
local script_ptr = mainmemory.read_u16_le(0x99)
if 0x2008 <= script_ptr and script_ptr <= 0x3FFF then
console.log(string.format("fetch script command from $%04X", script_ptr))
end
end
local function main()
event.onmemoryexecute(on_exec, 0xBD29)
end
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment