papermario/src/code_e92d0_len_5da0.c

318 lines
8.4 KiB
C
Raw Normal View History

2020-08-04 08:49:11 +02:00
#include "common.h"
INCLUDE_ASM(code_e92d0_len_5da0, fixed_var_to_float);
INCLUDE_ASM(code_e92d0_len_5da0, float_to_fixed_var);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_return);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_label);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_goto);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_Loop);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_loop);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_break_loop);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_wait);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_wait_seconds);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_equal);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_not_equal);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_less);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_greater);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_less_equal);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_greater_equal);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_AND);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_not_AND);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_else);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_if);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_switch);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_switch_const);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_case_equal);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_case_not_equal);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_case_less);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_case_less_equal);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_case_greater);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_case_greater_equal);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_case_range);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_case_default);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_case_AND);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_case_equal_OR);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_case_equal_AND);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_case_group);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_break_case);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_switch);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_var);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_const);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_float);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_add);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_subtract);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_multiply);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_divide);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_mod);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_addF);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_subtractF);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_multiplyF);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_divideF);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_int_buffer_ptr);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_float_buffer_ptr);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_1_word);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_2_word);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_3_word);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_4_word);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_Nth_word);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_1_float);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_2_float);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_3_float);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_4_float);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_Nth_float);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_array);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_flag_array);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_allocate_array);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_AND);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_AND_const);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_OR);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_OR_const);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_call);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_exec1);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_exec2);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_exec_wait);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_jump);
INCLUDE_ASM(code_e92d0_len_5da0, _bound_script_trigger_handler);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_bind);
INCLUDE_ASM(code_e92d0_len_5da0, DeleteTrigger);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_unbind);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_kill);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_priority);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_timescale);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_group);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_suspend_all);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_resume_all);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_suspend_others);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_resume_others);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_suspend);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_resume);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_does_script_exist);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_bind_lock);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_thread);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_thread);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_child_thread);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_child_thread);
INCLUDE_ASM(code_e92d0_len_5da0, func_802C6E14);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_print_debug_var);
INCLUDE_ASM(code_e92d0_len_5da0, func_802C739C);
INCLUDE_ASM(code_e92d0_len_5da0, func_802C73B0);
INCLUDE_ASM(code_e92d0_len_5da0, func_802C73B8);
INCLUDE_ASM(code_e92d0_len_5da0, si_execute_next_command);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end);
2020-08-10 07:03:56 +02:00
s32 INCLUDE_ASM(code_e92d0_len_5da0, get_variable, script_context* script, s32 pos);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM(code_e92d0_len_5da0, get_variable_index);
INCLUDE_ASM(code_e92d0_len_5da0, get_variable_index_alt);
INCLUDE_ASM(code_e92d0_len_5da0, set_variable);
2020-08-10 07:03:56 +02:00
f32 INCLUDE_ASM(code_e92d0_len_5da0, get_float_variable, script_context* script, s32 pos);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM(code_e92d0_len_5da0, set_float_variable);
INCLUDE_ASM(code_e92d0_len_5da0, si_goto_label);
INCLUDE_ASM(code_e92d0_len_5da0, si_skip_if);
INCLUDE_ASM(code_e92d0_len_5da0, si_skip_else);
INCLUDE_ASM(code_e92d0_len_5da0, si_goto_end_case);
INCLUDE_ASM(code_e92d0_len_5da0, si_goto_next_case);
INCLUDE_ASM(code_e92d0_len_5da0, si_goto_end_loop);
INCLUDE_ASM(code_e92d0_len_5da0, TranslateModel);
INCLUDE_ASM(code_e92d0_len_5da0, RotateModel);
INCLUDE_ASM(code_e92d0_len_5da0, ScaleModel);
INCLUDE_ASM(code_e92d0_len_5da0, GetModelIndex);
2020-08-10 09:42:50 +02:00
s32 CloneModel(script_context* script) {
s32* thisPos = script->ptrReadPos;
s32 srcModelID = get_variable(script, *thisPos++);
s32 newModelID = get_variable(script, *thisPos++);
clone_model(srcModelID, newModelID);
return 2;
}
2020-08-04 08:49:11 +02:00
INCLUDE_ASM(code_e92d0_len_5da0, GetModelCenter);
INCLUDE_ASM(code_e92d0_len_5da0, SetTexPanner);
INCLUDE_ASM(code_e92d0_len_5da0, SetModelFlag10);
INCLUDE_ASM(code_e92d0_len_5da0, EnableTexPanning);
INCLUDE_ASM(code_e92d0_len_5da0, EnableModel);
INCLUDE_ASM(code_e92d0_len_5da0, SetGroupEnabled);
INCLUDE_ASM(code_e92d0_len_5da0, SetTexPanOffset);
INCLUDE_ASM(code_e92d0_len_5da0, SetModelFlags);
INCLUDE_ASM(code_e92d0_len_5da0, func_802C95A0);
INCLUDE_ASM(code_e92d0_len_5da0, TranslateGroup);
INCLUDE_ASM(code_e92d0_len_5da0, RotateGroup);
INCLUDE_ASM(code_e92d0_len_5da0, ScaleGroup);
INCLUDE_ASM(code_e92d0_len_5da0, EnableGroup);
INCLUDE_ASM(code_e92d0_len_5da0, modify_collider_family_flags);
INCLUDE_ASM(code_e92d0_len_5da0, ModifyColliderFlags);
INCLUDE_ASM(code_e92d0_len_5da0, ResetFromLava);
INCLUDE_ASM(code_e92d0_len_5da0, GetColliderCenter);
INCLUDE_ASM(code_e92d0_len_5da0, ParentColliderToModel);
2020-08-10 09:42:50 +02:00
s32 UpdateColliderTransform(script_context* script) {
update_collider_transform(get_variable(script, *script->ptrReadPos));
return 2;
}
2020-08-04 08:49:11 +02:00
INCLUDE_ASM(code_e92d0_len_5da0, func_802CA1B8);
INCLUDE_ASM(code_e92d0_len_5da0, goto_map);
2020-08-10 07:03:56 +02:00
s32 GotoMap(script_context* script) {
goto_map(script, 0);
return 1;
}
2020-08-04 08:49:11 +02:00
2020-08-10 07:03:56 +02:00
s32 GotoMapSpecial(script_context* script) {
goto_map(script, 1);
return 1;
}
2020-08-04 08:49:11 +02:00
2020-08-10 07:03:56 +02:00
s32 GotoMapByID(script_context* script) {
goto_map(script, 2);
return 1;
}
2020-08-04 08:49:11 +02:00
INCLUDE_ASM(code_e92d0_len_5da0, GetEntryID);
2020-08-10 09:42:50 +02:00
s32 GetMapID(script_context* script) {
game_status* gameStatus = *gGameStatusPtr;
set_variable(script, *script->ptrReadPos, gameStatus->mapID);
return 2;
}
2020-08-04 08:49:11 +02:00
INCLUDE_ASM(code_e92d0_len_5da0, GetLoadType);
INCLUDE_ASM(code_e92d0_len_5da0, SetRenderMode);
INCLUDE_ASM(code_e92d0_len_5da0, PlaySoundAtModel);
INCLUDE_ASM(code_e92d0_len_5da0, PlaySoundAtCollider);