mirror of
https://github.com/notwa/mm
synced 2024-11-05 02:39:02 -08:00
256 lines
8.8 KiB
Lua
Executable file
256 lines
8.8 KiB
Lua
Executable file
-- version-agnostic addresses
|
|
A = require "boilerplate"
|
|
|
|
function merge(t1, t2)
|
|
for k, v in pairs(t1) do
|
|
t2[k] = v
|
|
end
|
|
return t2
|
|
end
|
|
|
|
function Actor(addr)
|
|
local function AA(a, s) return A(addr+a, s) end
|
|
return {
|
|
num = AA(0x0, 2),
|
|
type = AA(0x2, 1),
|
|
flags = AA(0x4, 4),
|
|
x_copy = AA(0x8, 'f'),
|
|
y_copy = AA(0xC, 'f'),
|
|
z_copy = AA(0x10, 'f'),
|
|
var = AA(0x1C, 2),
|
|
x = AA(0x24, 'f'),
|
|
y = AA(0x28, 'f'),
|
|
z = AA(0x2C, 'f'),
|
|
angle_old = AA(0x4A, 2),
|
|
x_scale = AA(0x58, 'f'),
|
|
y_scale = AA(0x5C, 'f'),
|
|
z_scale = AA(0x60, 'f'),
|
|
x_vel = AA(0x64, 'f'),
|
|
y_vel = AA(0x68, 'f'),
|
|
z_vel = AA(0x6C, 'f'),
|
|
lin_vel_old = AA(0x70, 'f'),
|
|
ground_y = AA(0x88, 'f'),
|
|
damage_table = AA(0xA0, 4),
|
|
hp = AA(0xB7, 1),
|
|
angle = AA(0xBA, 2),
|
|
foot_left_x = AA(0xD4, 'f'), -- tested on Link, may be other things
|
|
foot_left_y = AA(0xD8, 'f'),
|
|
foot_left_z = AA(0xDC, 'f'),
|
|
foot_right_x = AA(0xE0, 'f'), -- tested on Link, may be other things
|
|
foot_right_y = AA(0xE4, 'f'),
|
|
foot_right_z = AA(0xE8, 'f'),
|
|
camera_rel_x = AA(0xEC, 'f'),
|
|
camera_rel_y = AA(0xF0, 'f'),
|
|
camera_rel_z = AA(0xF4, 'f'),
|
|
unknown_z = AA(0xF8, 'f'),
|
|
x_old = AA(0x108, 'f'),
|
|
y_old = AA(0x10C, 'f'),
|
|
z_old = AA(0x108, 'f'),
|
|
prev = AA(0x128, 4),
|
|
next = AA(0x12C, 4),
|
|
}
|
|
end
|
|
|
|
return {
|
|
link = A(link, 0x4000),
|
|
exit_value = AL(0x02, 2),
|
|
intro_completed = AL(0x05, 1),
|
|
cutscene_status = AL(0x0A, 2),
|
|
time = AL(0x0C, 2),
|
|
owl_id = AL(0x0E, 2),
|
|
day_night = AL(0x10, 4),
|
|
time_speed = AL(0x14, 4),
|
|
day = AL(0x18, 4),
|
|
day_again = AL(0x1C, 4),
|
|
transformation = AL(0x20, 1),
|
|
owl_save = AL(0x23, 1), -- "zeroth day" effect
|
|
ZELDA3 = AL(0x24, 6),
|
|
sot_count = AL(0x2A, 2),
|
|
name = AL(0x2C, 8),
|
|
max_hearts = AL(0x34, 2),
|
|
hearts = AL(0x36, 2),
|
|
has_magic = AL(0x38, 1), -- ?
|
|
magic = AL(0x39, 1),
|
|
rupees = AL(0x3A, 2),
|
|
has_normal_magic = AL(0x40, 1),
|
|
has_double_magic = AL(0x41, 1),
|
|
owls_hit = AL(0x46, 2),
|
|
sword_shield = AL(0x6D, 1),
|
|
inventory_items = AL(0x70, 24),
|
|
inventory_masks = AL(0x88, 24),
|
|
inventory_quantities= AL(0xA0, 24),
|
|
wallet_size = AL(0xBA, 1), -- 0, 16, 32, unused 48
|
|
quiver_bag = AL(0xBB, 1),
|
|
quest_items = AL(0xBC, 4),
|
|
items_wft = AL(0xC0, 1),
|
|
items_sht = AL(0xC1, 1),
|
|
items_gbt = AL(0xC2, 1),
|
|
items_stt = AL(0xC3, 1),
|
|
keys_wft = AL(0xCA, 1),
|
|
keys_sht = AL(0xCB, 1),
|
|
keys_gbt = AL(0xCC, 1),
|
|
keys_stt = AL(0xCD, 1),
|
|
doubled_hearts = AL(0xD3, 1), -- set to 20 by the game
|
|
fairies_wft = AL(0xD4, 1),
|
|
fairies_sht = AL(0xD5, 1),
|
|
fairies_gbt = AL(0xD6, 1),
|
|
fairies_stt = AL(0xD7, 1),
|
|
strange_string = AL(0xDE, 6),
|
|
scene_flags_save = AL(0x470, 0x960),
|
|
--clock_town_map = AL(0xEB2, 1),
|
|
slulltula_count_wf = AL(0xEC0, 2),
|
|
slulltula_count_gb = AL(0xEC2, 2),
|
|
banked_rupees = AL(0xEDE, 2),
|
|
archery = AL(0xF00, 1),
|
|
chateau_romani = AL(0xF06, 1), -- 8
|
|
disable_c_buttons = AL(0xF4A, 1), -- 8
|
|
sword_disable_c = AL(0xF52, 1), -- 32
|
|
map_visited = AL(0xF5E, 2),
|
|
map_visible = AL(0xF62, 2),
|
|
bombers_caught = AL(0xFE6, 1),
|
|
bombers_order_1 = AL(0xFE7, 1),
|
|
bombers_order_2 = AL(0xFE8, 1),
|
|
bombers_order_3 = AL(0xFE9, 1),
|
|
bombers_order_4 = AL(0xFEA, 1),
|
|
bombers_order_5 = AL(0xFEB, 1),
|
|
lottery_code_1 = AL(0xFEC, 3),
|
|
lottery_code_2 = AL(0xFEF, 3),
|
|
lottery_code_3 = AL(0xFF2, 3),
|
|
spider_mask_color_1 = AL(0xFF5, 1), -- 0: red; 1: blue; 2: green; 3: yellow
|
|
spider_mask_color_2 = AL(0xFF6, 1),
|
|
spider_mask_color_3 = AL(0xFF7, 1),
|
|
spider_mask_color_4 = AL(0xFF8, 1),
|
|
spider_mask_color_5 = AL(0xFF9, 1),
|
|
bombers_code_1 = AL(0xFFB, 1),
|
|
bombers_code_2 = AL(0xFFC, 1),
|
|
bombers_code_3 = AL(0xFFD, 1),
|
|
bombers_code_4 = AL(0xFFE, 1),
|
|
bombers_code_5 = AL(0xFFF, 1),
|
|
|
|
inventory = {
|
|
b_button_item = AL(0x4C, 1),
|
|
c_left_item = AL(0x4D, 1),
|
|
c_down_item = AL(0x4E, 1),
|
|
c_right_item = AL(0x4F, 1),
|
|
b_button_goron = AL(0x50, 1),
|
|
b_button_zora = AL(0x54, 1),
|
|
b_button_deku = AL(0x58, 1),
|
|
b_button_slot = AL(0x5C, 1), -- unused?
|
|
c_left_slot = AL(0x5D, 1),
|
|
c_down_slot = AL(0x5E, 1),
|
|
c_right_slot = AL(0x5F, 1),
|
|
|
|
ocarina = AL(0x70, 1),
|
|
bow = AL(0x71, 1),
|
|
fire_arrows = AL(0x72, 1),
|
|
ice_arrows = AL(0x73, 1),
|
|
light_arrows = AL(0x74, 1),
|
|
event_1 = AL(0x75, 1),
|
|
bombs = AL(0x76, 1),
|
|
bombchu = AL(0x77, 1),
|
|
deku_stick = AL(0x78, 1),
|
|
deku_nut = AL(0x79, 1),
|
|
magic_beans = AL(0x7A, 1),
|
|
event_2 = AL(0x7B, 1),
|
|
powder_keg = AL(0x7C, 1),
|
|
pictograph = AL(0x7D, 1),
|
|
lens_of_truth = AL(0x7E, 1),
|
|
hookshot = AL(0x7F, 1),
|
|
fairy_sword = AL(0x80, 1),
|
|
event_3 = AL(0x81, 1),
|
|
bottle_1 = AL(0x82, 1),
|
|
bottle_2 = AL(0x83, 1),
|
|
bottle_3 = AL(0x84, 1),
|
|
bottle_4 = AL(0x85, 1),
|
|
bottle_5 = AL(0x86, 1),
|
|
bottle_6 = AL(0x87, 1),
|
|
},
|
|
masks = {
|
|
postman = AL(0x88, 1),
|
|
all_night = AL(0x89, 1),
|
|
blast = AL(0x8A, 1),
|
|
stone = AL(0x8B, 1),
|
|
great_fairy = AL(0x8C, 1),
|
|
deku = AL(0x8D, 1),
|
|
keaton = AL(0x8E, 1),
|
|
bremen = AL(0x8F, 1),
|
|
bunny = AL(0x90, 1),
|
|
don_gero = AL(0x91, 1),
|
|
scents = AL(0x92, 1),
|
|
goron = AL(0x93, 1),
|
|
romani = AL(0x94, 1),
|
|
troupe_leader = AL(0x95, 1),
|
|
kafei = AL(0x96, 1),
|
|
couples = AL(0x97, 1),
|
|
truth = AL(0x98, 1),
|
|
zora = AL(0x99, 1),
|
|
kamaro = AL(0x9A, 1),
|
|
gibdo = AL(0x9B, 1),
|
|
garos = AL(0x9C, 1),
|
|
captains = AL(0x9D, 1),
|
|
giants = AL(0x9E, 1),
|
|
fierce_deity = AL(0x9F, 1),
|
|
},
|
|
quantities = {
|
|
arrows = AL(0xA1, 1),
|
|
bombs = AL(0xA6, 1),
|
|
bombchu = AL(0xA7, 1),
|
|
sticks = AL(0xA8, 1),
|
|
nuts = AL(0xA9, 1),
|
|
beans = AL(0xAA, 1),
|
|
kegs = AL(0xAC, 1),
|
|
},
|
|
|
|
buttons_1 = AG(0x1A, 1),
|
|
buttons_2 = AG(0x1B, 1),
|
|
framerate_limiter = AG(0xA2, 1),
|
|
camera_target = AG(0x2B0, 4),
|
|
|
|
actor_count = AG(0x1CAE, 1),
|
|
actor_counts = {
|
|
[0]=AG(0x1CB0, 4),
|
|
AG(0x1CBC, 4),
|
|
AG(0x1CC8, 4),
|
|
AG(0x1CD4, 4),
|
|
AG(0x1CE0, 4),
|
|
AG(0x1CEC, 4),
|
|
AG(0x1CF8, 4),
|
|
AG(0x1D04, 4),
|
|
AG(0x1D10, 4),
|
|
AG(0x1D1C, 4),
|
|
AG(0x1D28, 4),
|
|
AG(0x1D34, 4),
|
|
},
|
|
actor_firsts = {
|
|
[0]=AG(0x1CB4, 4),
|
|
AG(0x1CC0, 4),
|
|
AG(0x1CCC, 4),
|
|
AG(0x1CD8, 4),
|
|
AG(0x1CE4, 4),
|
|
AG(0x1CF0, 4),
|
|
AG(0x1CFC, 4),
|
|
AG(0x1D08, 4),
|
|
AG(0x1D14, 4),
|
|
AG(0x1D20, 4),
|
|
AG(0x1D2C, 4),
|
|
AG(0x1D38, 4),
|
|
},
|
|
|
|
bomb_counter = AG(0x1CD4, 1),
|
|
z_cursor_actor = AG(0x1DF8, 4),
|
|
z_target_actor = AG(0x1DFC, 4),
|
|
current_scene_flags_2 = AG(0x1E58, 4), -- note: I use SRAM ordering here
|
|
current_scene_flags_3 = AG(0x1E5C, 4),
|
|
current_scene_flags_1 = AG(0x1E68, 4),
|
|
current_scene_flags_4 = AG(0x1E6C, 4),
|
|
current_scene_flags_5 = AG(0x1E74, 4),
|
|
|
|
link_actor = merge(Actor(AA(0,0).addr), {
|
|
item_in_hand = AA(0x148, 1),
|
|
animation_id = AA(0x24A, 2),
|
|
link_flags = AA(0xA6C, 0xC),
|
|
lin_vel = AA(0xAD0, 'f'),
|
|
movement_angle = AA(0xAD4, 2),
|
|
active_sword = AA(0xADB, 1),
|
|
}),
|
|
}
|