papermario/src/code_e92d0_len_5da0.c

534 lines
15 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);
2020-08-14 17:18:05 +02:00
/*f32 fixed_var_to_float(s32 scriptVar) {
if (scriptVar <= -220000000) {
return (scriptVar + 230000000) * (1 / 1024.f);
}
return scriptVar;
}*/
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", float_to_fixed_var);
2020-08-14 17:18:05 +02:00
/*s32 float_to_fixed_var(f32 arg0) {
return (s32)(arg0 * (f32)1024.0f) + -230000000;
}*/
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_return(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
kill_script(script);
2020-08-16 08:55:51 +02:00
return ApiStatus_FINISH;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_label(ScriptInstance* script) {
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_goto(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
script->ptrNextLine = si_goto_label(script, get_variable(script, *script->ptrReadPos));
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_Loop);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_end_loop);
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_break_loop(ScriptInstance* script) {
2020-08-17 14:09:19 +02:00
ASSERT(script->loopDepth >= 0);
2020-08-14 17:18:05 +02:00
script->ptrNextLine = si_goto_end_loop(script);
script->loopDepth -= 1;
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_wait);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_wait_seconds);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_if_equal);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_if_not_equal);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_if_less);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_if_greater);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_if_less_equal);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_if_greater_equal);
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_if_AND(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
s32 var1;
2020-08-19 02:16:12 +02:00
s32* ptrReadPos = script->ptrReadPos;
2020-08-04 08:49:11 +02:00
2020-08-14 17:18:05 +02:00
var1 = ptrReadPos[0];
ptrReadPos++;
2020-08-04 08:49:11 +02:00
2020-08-14 17:18:05 +02:00
if ((get_variable(script, var1) & *ptrReadPos) == 0) {
script->ptrNextLine = si_skip_if(script);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
//INCLUDE_ASM("code_e92d0_len_5da0", si_handle_if_not_AND);
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_if_not_AND(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
s32 var1;
2020-08-19 02:16:12 +02:00
s32* ptrReadPos = script->ptrReadPos;
2020-08-04 08:49:11 +02:00
2020-08-14 17:18:05 +02:00
var1 = ptrReadPos[0];
ptrReadPos++;
if ((get_variable(script, var1) & *ptrReadPos) != 0) {
script->ptrNextLine = si_skip_if(script);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_else(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
script->ptrNextLine = si_skip_else(script);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_end_if(ScriptInstance* script) {
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-17 19:16:13 +02:00
ApiStatus si_handle_switch(ScriptInstance* script) {
Bytecode value = get_variable(script, *script->ptrReadPos);
s32 switchDepth = ++script->switchDepth;
2020-08-04 08:49:11 +02:00
2020-08-17 14:09:19 +02:00
ASSERT(switchDepth < 8);
script->switchBlockValue[switchDepth] = value;
script->switchBlockState[switchDepth] = 1;
2020-08-16 05:19:00 +02:00
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
}
2020-08-17 19:16:13 +02:00
ApiStatus si_handle_switch_const(ScriptInstance* script) {
s32 value = *script->ptrReadPos;
s32 switchDepth = ++script->switchDepth;
2020-08-17 14:09:19 +02:00
ASSERT(switchDepth < 8);
script->switchBlockValue[switchDepth] = value;
script->switchBlockState[switchDepth] = 1;
2020-08-17 19:16:13 +02:00
return ApiStatus_DONE2;
}
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_case_equal);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_case_not_equal);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_case_less);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_case_less_equal);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_case_greater);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_case_greater_equal);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_case_range);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_case_default);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_case_AND);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_case_equal_OR);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_case_equal_AND);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_end_case_group);
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_break_case(ScriptInstance* script) {
2020-08-17 14:09:19 +02:00
ASSERT(script->switchDepth >= 0);
2020-08-14 17:18:05 +02:00
script->ptrNextLine = si_goto_end_case(script);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_end_switch(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
s32 switchDepth = script->switchDepth;
2020-08-04 08:49:11 +02:00
2020-08-17 14:09:19 +02:00
ASSERT(switchDepth >= 0);
2020-08-17 19:27:37 +02:00
script->switchBlockState[switchDepth] = 0;
2020-08-14 17:18:05 +02:00
script->switchDepth -= 1;
2020-08-04 08:49:11 +02:00
2020-08-17 19:16:13 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_set_var(ScriptInstance* script) {
Bytecode* ptrReadPos = script->ptrReadPos;
2020-08-14 17:18:05 +02:00
s32 curPtrReadPos = ptrReadPos[0];
set_variable(script, curPtrReadPos, get_variable(script, ptrReadPos[1]));
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_set_const(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
set_variable(script, *script->ptrReadPos, script->ptrReadPos[1]);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_set_float(ScriptInstance* script) {
Bytecode* ptrReadPos = script->ptrReadPos;
2020-08-14 17:18:05 +02:00
s32 curPtrReadPos = ptrReadPos[0];
set_float_variable(script, curPtrReadPos, get_float_variable(script, ptrReadPos[1]));
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_add);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_subtract);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_multiply);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_divide);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_mod);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_addF);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_subtractF);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_multiplyF);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_divideF);
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_set_int_buffer_ptr(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
script->buffer = get_variable(script, *script->ptrReadPos);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_set_float_buffer_ptr(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
script->buffer = get_variable(script, *script->ptrReadPos);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_get_1_word(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
s32 ptrReadPos = *script->ptrReadPos;
s32 buffer = *script->buffer++;
2020-08-04 08:49:11 +02:00
2020-08-14 17:18:05 +02:00
set_variable(script, ptrReadPos, buffer);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_get_2_word);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_get_3_word);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_get_4_word);
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_get_Nth_word(ScriptInstance* script) {
Bytecode* ptrReadPos = script->ptrReadPos;
2020-08-14 17:18:05 +02:00
s32 curPtrReadPos = ptrReadPos[0];
set_variable(script, curPtrReadPos, script->buffer[get_variable(script, ptrReadPos[1])]);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_get_1_float);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_get_2_float);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_get_3_float);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_get_4_float);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_get_Nth_float);
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_set_array(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
script->array = get_variable(script, *script->ptrReadPos);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_set_flag_array(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
script->flagArray = get_variable(script, *script->ptrReadPos);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_allocate_array);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_AND);
2020-08-04 08:49:11 +02:00
//INCLUDE_ASM("code_e92d0_len_5da0", si_handle_AND_const);
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_AND_const(ScriptInstance* script) {
Bytecode* ptrReadPos = script->ptrReadPos;
2020-08-14 17:18:05 +02:00
// todo ???
s32 temp_s0 = ptrReadPos[0];
s32 temp_s2 = ptrReadPos[0];
temp_s0 = ptrReadPos[1];
// end todo
set_variable(script, temp_s2, temp_s0 & get_variable(script, temp_s2));
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_OR);
2020-08-04 08:49:11 +02:00
//INCLUDE_ASM("code_e92d0_len_5da0", si_handle_OR_const);
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_OR_const(ScriptInstance* script) {
Bytecode* ptrReadPos = script->ptrReadPos;
2020-08-14 17:18:05 +02:00
// todo ???
s32 temp_s0 = ptrReadPos[0];
s32 temp_s2 = ptrReadPos[0];
temp_s0 = ptrReadPos[1];
// end todo
set_variable(script, temp_s2, temp_s0 | get_variable(script, temp_s2));
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_call);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_exec1);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_exec2);
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_exec_wait(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
start_child_script(script, get_variable(script, *script->ptrReadPos), 0);
script->currentOpcode = 0;
return 0xFF;
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_jump(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
script->ptrFirstLine = get_variable(script, *script->ptrReadPos);
restart_script(script);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", _bound_script_trigger_handler);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_bind);
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus DeleteTrigger(ScriptInstance* script, s32 isInitialCall) {
2020-08-14 17:18:05 +02:00
delete_trigger(get_variable(script, *script->ptrReadPos));
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_unbind(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
delete_trigger(script->ownerID);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_kill(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
kill_script_by_ID(get_variable(script, *script->ptrReadPos));
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_set_priority(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
set_script_priority(script, get_variable(script, *script->ptrReadPos));
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_set_timescale(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
set_script_timescale(script, get_float_variable(script, *script->ptrReadPos));
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_set_group(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
set_script_group(script, get_variable(script, *script->ptrReadPos));
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_suspend_all(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
suspend_all_group(get_variable(script, *script->ptrReadPos));
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_resume_all(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
resume_all_group(get_variable(script, *script->ptrReadPos));
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_suspend_others(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
suspend_group_others(script, get_variable(script, *script->ptrReadPos));
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_resume_others(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
resume_group_others(script, get_variable(script, *script->ptrReadPos));
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_suspend(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
suspend_all_script(get_variable(script, *script->ptrReadPos));
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_resume(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
resume_all_script(get_variable(script, *script->ptrReadPos));
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
ApiStatus INCLUDE_ASM("code_e92d0_len_5da0", si_handle_does_script_exist);
2020-08-04 08:49:11 +02:00
ApiStatus INCLUDE_ASM("code_e92d0_len_5da0", si_handle_bind_lock);
2020-08-04 08:49:11 +02:00
ApiStatus INCLUDE_ASM("code_e92d0_len_5da0", si_handle_thread);
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_end_thread(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
kill_script(script);
2020-08-16 08:55:51 +02:00
return ApiStatus_FINISH;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
ApiStatus INCLUDE_ASM("code_e92d0_len_5da0", si_handle_child_thread);
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus si_handle_end_child_thread(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
kill_script(script);
2020-08-16 08:55:51 +02:00
return ApiStatus_BLOCK;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus func_802C6E14(ScriptInstance* script) {
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
ApiStatus INCLUDE_ASM("code_e92d0_len_5da0", si_handle_print_debug_var);
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus func_802C739C(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
script->ptrSavedPosition = *script->ptrReadPos;
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-16 08:55:51 +02:00
ApiStatus func_802C73B0(ScriptInstance* script) {
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 07:13:03 +02:00
s32 func_802C73B8(ScriptInstance* script) {
2020-08-14 17:18:05 +02:00
s32 i;
2020-08-04 08:49:11 +02:00
2020-08-15 04:55:19 +02:00
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
2020-08-14 17:18:05 +02:00
if (script == get_script_by_index(i)) {
break;
}
}
return 1;
}
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_execute_next_command);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_end);
2020-08-04 08:49:11 +02:00
s32 INCLUDE_ASM("code_e92d0_len_5da0", get_variable, ScriptInstance* script, Bytecode var);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", get_variable_index);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", get_variable_index_alt);
2020-08-04 08:49:11 +02:00
s32 INCLUDE_ASM("code_e92d0_len_5da0", set_variable, ScriptInstance* script, Bytecode var, s32 value);
2020-08-04 08:49:11 +02:00
f32 INCLUDE_ASM("code_e92d0_len_5da0", get_float_variable, ScriptInstance* script, Bytecode var);
2020-08-04 08:49:11 +02:00
f32 INCLUDE_ASM("code_e92d0_len_5da0", set_float_variable, ScriptInstance* script, Bytecode var, f32 value);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_goto_label);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_skip_if);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_skip_else);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_goto_end_case);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_goto_next_case);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", si_goto_end_loop);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", TranslateModel);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", RotateModel);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", ScaleModel);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", GetModelIndex);
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus CloneModel(ScriptInstance* script, s32 isInitialCall) {
Bytecode* thisPos = script->ptrReadPos;
2020-08-10 09:42:50 +02:00
s32 srcModelID = get_variable(script, *thisPos++);
s32 newModelID = get_variable(script, *thisPos++);
clone_model(srcModelID, newModelID);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-10 09:42:50 +02:00
}
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", GetModelCenter);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", SetTexPanner);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", SetModelFlag10);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", EnableTexPanning);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", EnableModel);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", SetGroupEnabled);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", SetTexPanOffset);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", SetModelFlags);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", func_802C95A0);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", TranslateGroup);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", RotateGroup);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", ScaleGroup);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", EnableGroup);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", modify_collider_family_flags);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", ModifyColliderFlags);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", ResetFromLava);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", GetColliderCenter);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", ParentColliderToModel);
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus UpdateColliderTransform(ScriptInstance* script, s32 isInitialCall) {
2020-08-10 09:42:50 +02:00
update_collider_transform(get_variable(script, *script->ptrReadPos));
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-10 09:42:50 +02:00
}
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", func_802CA1B8);
2020-08-04 08:49:11 +02:00
INCLUDE_ASM("code_e92d0_len_5da0", goto_map);
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus GotoMap(ScriptInstance* script, s32 isInitialCall) {
2020-08-10 07:03:56 +02:00
goto_map(script, 0);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE1;
2020-08-10 07:03:56 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus GotoMapSpecial(ScriptInstance* script, s32 isInitialCall) {
2020-08-10 07:03:56 +02:00
goto_map(script, 1);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE1;
2020-08-10 07:03:56 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus GotoMapByID(ScriptInstance* script, s32 isInitialCall) {
2020-08-10 07:03:56 +02:00
goto_map(script, 2);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE1;
2020-08-10 07:03:56 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus GetEntryID(ScriptInstance* script, s32 isInitialCall) {
2020-08-14 17:18:05 +02:00
set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->entryID);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-10 09:42:50 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus GetMapID(ScriptInstance* script, s32 isInitialCall) {
2020-08-14 17:18:05 +02:00
set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->mapID);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-10 09:42:50 +02:00
}
2020-08-04 08:49:11 +02:00
2020-08-16 08:55:51 +02:00
ApiStatus GetLoadType(ScriptInstance* script, s32 isInitialCall) {
2020-08-14 17:18:05 +02:00
set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->loadType != 0);
2020-08-16 08:55:51 +02:00
return ApiStatus_DONE2;
2020-08-14 17:18:05 +02:00
}
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", SetRenderMode);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", PlaySoundAtModel);
2020-08-04 08:49:11 +02:00
INCLUDE_API_ASM("code_e92d0_len_5da0", PlaySoundAtCollider);