From 19a0e65352411b390e02eedf7b1a900e8169531e Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Mon, 25 May 2015 22:17:37 -0700 Subject: [PATCH] room stuff for oot; fixes --- Lua/actor lister.lua | 3 +++ Lua/addrs/O/common.lua | 3 +++ Lua/classes/ActorLister.lua | 1 - Lua/data/object names oot.lua | 1 + Lua/room debug.lua | 10 ++++++---- 5 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 Lua/data/object names oot.lua diff --git a/Lua/actor lister.lua b/Lua/actor lister.lua index e45ebae..b47c6e9 100755 --- a/Lua/actor lister.lua +++ b/Lua/actor lister.lua @@ -4,6 +4,9 @@ require "addrs.init" require "messages" require "classes" +local suffix = oot and " oot" or "" +local damage_names = require("data.damage names"..suffix) + -- check for errors in the actor linked lists local validate = false diff --git a/Lua/addrs/O/common.lua b/Lua/addrs/O/common.lua index 3cf65ce..5a96a06 100644 --- a/Lua/addrs/O/common.lua +++ b/Lua/addrs/O/common.lua @@ -162,6 +162,9 @@ return { z_cursor_actor = AG(0x1CC8, 4), z_target_actor = AG(0x1CCC, 4), + room_number = AG(0x11CBC, 1), + room_pointer = AG(0x11CC8, 4), + link_actor = setmetatable({ item_in_hand = AA(0x142, 1), animation_id = AA(0x1AE, 2), diff --git a/Lua/classes/ActorLister.lua b/Lua/classes/ActorLister.lua index c91cff8..cd05e9b 100644 --- a/Lua/classes/ActorLister.lua +++ b/Lua/classes/ActorLister.lua @@ -9,7 +9,6 @@ local actor_t = Actor(0) local suffix = oot and " oot" or "" local actor_names = require("data.actor names"..suffix) -local damage_names = require("data.damage names"..suffix) local ActorLister = Class() function ActorLister:init(input_handler, debug_mode) diff --git a/Lua/data/object names oot.lua b/Lua/data/object names oot.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/Lua/data/object names oot.lua @@ -0,0 +1 @@ +return {} diff --git a/Lua/room debug.lua b/Lua/room debug.lua index 021f179..2f0bb80 100755 --- a/Lua/room debug.lua +++ b/Lua/room debug.lua @@ -2,6 +2,10 @@ require "boilerplate" require "addrs.init" require "messages" +local suffix = oot and " oot" or "" +local actor_names = require("data.actor names"..suffix) +local object_names = require("data.object names"..suffix) + local print = dprint local printf = dprintf @@ -134,26 +138,24 @@ function dump_room(start, addr) if actors then print("# actors") - local actor_names = require "data.actor names" local buf = "" for i = 0, actor_n - 1 do local id = R2(actors + 16*i) id = bit.band(id, 0x0FFF) local name = actor_names[id] - buf = buf..("%04X: %s\n"):format(id, name or "unset") + buf = buf..("%04X: %s\n"):format(id, name or "undefined") end print(buf) end if objects then print("# objects") - local object_names = require "data.object names" local buf = "" for i = 0, object_n - 1 do local id = R2(objects + 2*i) local rid = bit.band(id, 0x0FFF) local name = object_names[rid] - buf = buf..("%04X: %s\n"):format(id, name or "unset") + buf = buf..("%04X: %s\n"):format(id, name or "undefined") end print(buf) end