1
0
Fork 0
mirror of https://github.com/notwa/mm synced 2024-11-05 00:19:02 -08:00

use arrays for actor types

This commit is contained in:
Connor Olding 2015-03-18 21:50:35 -07:00
parent c8a222883a
commit 6d7d4975b6
3 changed files with 64 additions and 53 deletions

View file

@ -151,32 +151,37 @@ local common = {
}, },
camera_target = AG(0x270, 4), camera_target = AG(0x270, 4),
actor_count = AG(0x1C2C, 1), actor_count = AG(0x1C2C, 1),
-- TODO: use array here instead of individual keys actor_counts = {
actor_count_0 = AG(0x1C30, 4), [0]=AG(0x1C30, 4),
actor_first_0 = AG(0x1C34, 4), AG(0x1C38, 4),
actor_count_1 = AG(0x1C38, 4), AG(0x1C40, 4),
actor_first_1 = AG(0x1C3C, 4), AG(0x1C48, 4),
actor_count_2 = AG(0x1C40, 4), AG(0x1C50, 4),
actor_first_2 = AG(0x1C44, 4), AG(0x1C58, 4),
actor_count_3 = AG(0x1C48, 4), AG(0x1C60, 4),
actor_first_3 = AG(0x1C4C, 4), AG(0x1C68, 4),
actor_count_4 = AG(0x1C50, 4), AG(0x1C70, 4),
actor_first_4 = AG(0x1C54, 4), AG(0x1C78, 4),
actor_count_5 = AG(0x1C58, 4), AG(0x1C80, 4),
actor_first_5 = AG(0x1C5C, 4), AG(0x1C88, 4),
actor_count_6 = AG(0x1C60, 4), },
actor_first_6 = AG(0x1C64, 4), actor_firsts = {
actor_count_7 = AG(0x1C68, 4), [0]=AG(0x1C34, 4),
actor_first_7 = AG(0x1C6C, 4), AG(0x1C3C, 4),
actor_count_8 = AG(0x1C70, 4), AG(0x1C44, 4),
actor_first_8 = AG(0x1C74, 4), AG(0x1C4C, 4),
actor_count_9 = AG(0x1C78, 4), AG(0x1C54, 4),
actor_first_9 = AG(0x1C7C, 4), AG(0x1C5C, 4),
actor_count_10 = AG(0x1C80, 4), AG(0x1C64, 4),
actor_first_10 = AG(0x1C84, 4), AG(0x1C6C, 4),
actor_count_11 = AG(0x1C88, 4), AG(0x1C74, 4),
actor_first_11 = AG(0x1C8C, 4), AG(0x1C7C, 4),
AG(0x1C84, 4),
AG(0x1C8C, 4),
},
z_cursor_actor = AG(0x1CC8, 4), z_cursor_actor = AG(0x1CC8, 4),
z_target_actor = AG(0x1CCC, 4), z_target_actor = AG(0x1CCC, 4),
} }

View file

@ -205,30 +205,37 @@ return {
buttons_2 = AG(0x1B, 1), buttons_2 = AG(0x1B, 1),
framerate_limiter = AG(0xA2, 1), framerate_limiter = AG(0xA2, 1),
camera_target = AG(0x2B0, 4), camera_target = AG(0x2B0, 4),
actor_count_0 = AG(0x1CB0, 4),
actor_first_0 = AG(0x1CB4, 4), actor_count = AG(0x1CAE, 1),
actor_count_1 = AG(0x1CBC, 4), actor_counts = {
actor_first_1 = AG(0x1CC0, 4), [0]=AG(0x1CB0, 4),
actor_count_2 = AG(0x1CC8, 4), AG(0x1CBC, 4),
actor_first_2 = AG(0x1CCC, 4), AG(0x1CC8, 4),
actor_count_3 = AG(0x1CD4, 4), AG(0x1CD4, 4),
actor_first_3 = AG(0x1CD8, 4), AG(0x1CE0, 4),
actor_count_4 = AG(0x1CE0, 4), AG(0x1CEC, 4),
actor_first_4 = AG(0x1CE4, 4), AG(0x1CF8, 4),
actor_count_5 = AG(0x1CEC, 4), AG(0x1D04, 4),
actor_first_5 = AG(0x1CF0, 4), AG(0x1D10, 4),
actor_count_6 = AG(0x1CF8, 4), AG(0x1D1C, 4),
actor_first_6 = AG(0x1CFC, 4), AG(0x1D28, 4),
actor_count_7 = AG(0x1D04, 4), AG(0x1D34, 4),
actor_first_7 = AG(0x1D08, 4), },
actor_count_8 = AG(0x1D10, 4), actor_firsts = {
actor_first_8 = AG(0x1D14, 4), [0]=AG(0x1CB4, 4),
actor_count_9 = AG(0x1D1C, 4), AG(0x1CC0, 4),
actor_first_9 = AG(0x1D20, 4), AG(0x1CCC, 4),
actor_count_10 = AG(0x1D28, 4), AG(0x1CD8, 4),
actor_first_10 = AG(0x1D2C, 4), AG(0x1CE4, 4),
actor_count_11 = AG(0x1D34, 4), AG(0x1CF0, 4),
actor_first_11 = AG(0x1D38, 4), AG(0x1CFC, 4),
AG(0x1D08, 4),
AG(0x1D14, 4),
AG(0x1D20, 4),
AG(0x1D2C, 4),
AG(0x1D38, 4),
},
bomb_counter = AG(0x1CD4, 1), bomb_counter = AG(0x1CD4, 1),
z_cursor_actor = AG(0x1DF8, 4), z_cursor_actor = AG(0x1DF8, 4),
z_target_actor = AG(0x1DFC, 4), z_target_actor = AG(0x1DFC, 4),

View file

@ -7,7 +7,6 @@ require "addrs"
local actor_t = Actor(0) local actor_t = Actor(0)
local oot = version:sub(1, 2) == "O " local oot = version:sub(1, 2) == "O "
local al_next = addrs.actor_count_1.addr - addrs.actor_count_0.addr
local actor_names, damage_names local actor_names, damage_names
if oot then if oot then
@ -34,11 +33,11 @@ function pmask(p)
end end
function get_actor_count(i) function get_actor_count(i)
return R4(addrs.actor_count_0.addr + i*al_next) return R4(addrs.actor_counts[i].addr)
end end
function get_first_actor(i) function get_first_actor(i)
return pmask(R4(addrs.actor_first_0.addr + i*al_next)) return pmask(R4(addrs.actor_firsts[i].addr))
end end
function get_next_actor(addr) function get_next_actor(addr)
@ -112,7 +111,7 @@ local focus_at = 2
local focus_ai = 0 local focus_ai = 0
-- hack to avoid N64 logo spitting errors -- hack to avoid N64 logo spitting errors
local stupid = addrs.actor_count_0.addr - 0x8 local stupid = addrs.actor_counts[0].addr - 0x8
while true do while true do
local any = 0 local any = 0