From 8762c89422b2e0d558d3ce907ba431dc980e2302 Mon Sep 17 00:00:00 2001 From: Rain Date: Thu, 3 Dec 2020 10:06:26 -0600 Subject: [PATCH] fix some style things --- src/code_1A5830.c | 9 +++++---- src/code_1a1f0_len_5390.c | 29 ++++++++++------------------- src/os/code_4ac90_len_3910.c | 2 +- undefined_syms.txt | 1 - 4 files changed, 16 insertions(+), 25 deletions(-) diff --git a/src/code_1A5830.c b/src/code_1A5830.c index 536725fbe1..2549089621 100644 --- a/src/code_1A5830.c +++ b/src/code_1A5830.c @@ -101,7 +101,7 @@ ApiStatus ResumeTakeTurn(ScriptInstance* script, s32 isInitialCall) { ApiStatus BindIdle(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; ActorID actorID = get_variable(script, *args++); - s32 var0; + Bytecode* idleCode; Actor* actor; ScriptInstance* newScriptContext; @@ -109,15 +109,16 @@ ApiStatus BindIdle(ScriptInstance* script, s32 isInitialCall) { actorID = script->owner1.actorID; } - var0 = get_variable(script, *args++); + idleCode = get_variable(script, *args++); actor = get_actor(actorID); + if (actor->idleScript != 0) { kill_script_by_ID(actor->idleScriptID); actor->idleScript = 0; } - actor->idleCode = var0; - newScriptContext = start_script(var0, 10, 0); + actor->idleCode = idleCode; + newScriptContext = start_script(idleCode, 10, 0); actor->idleScript = newScriptContext; actor->idleScriptID = newScriptContext->id; newScriptContext->owner1.enemyID = actorID; diff --git a/src/code_1a1f0_len_5390.c b/src/code_1a1f0_len_5390.c index a678f9e1c0..e8b5810ca0 100644 --- a/src/code_1a1f0_len_5390.c +++ b/src/code_1a1f0_len_5390.c @@ -103,7 +103,7 @@ ApiStatus func_8003F084(ScriptInstance* script, s32 isInitialCall) { INCLUDE_ASM(s32, "code_1a1f0_len_5390", func_8003F0C4); -ApiStatus func_8003F384() { +ApiStatus func_8003F384(ScriptInstance* script, s32 isInitialCall) { D_800A0BB8 = 1; return ApiStatus_DONE2; } @@ -126,31 +126,22 @@ ApiStatus HasMerleeCasts(ScriptInstance* script, s32 isInitialCall) { } ApiStatus func_8003F414(ScriptInstance* script, s32 isInitialCall) { - s32 tempVar0; - s32 tempVar1; - s32 tempVar2; - s32 tempConst0 = 6; - f32 tempConst1 = 1.2; - s32 tempConst2 = 30; Bytecode* args = script->ptrReadPos; - - tempVar0 = get_variable(script, *args++); - tempVar1 = get_variable(script, *args++); - tempVar2 = get_variable(script, *args++); - func_800720B0(tempConst0, tempVar0, tempVar1, tempVar2, tempConst1, tempConst2); + s32 var0 = get_variable(script, *args++); + s32 var1 = get_variable(script, *args++); + s32 var2 = get_variable(script, *args++); + + func_800720B0(6, var0, var1, var2, 1.2f, 30); return ApiStatus_DONE2; } ApiStatus func_8003F4CC(ScriptInstance* script, s32 isInitialCall) { - s32 tempVar0; - s32 tempVar1; - s32 tempVar2; Bytecode* args = script->ptrReadPos; + s32 var0 = get_variable(script, *args++); + s32 var1 = get_variable(script, *args++); + s32 var2 = get_variable(script, *args++); - tempVar0 = get_variable(script, *args++); - tempVar1 = get_variable(script, *args++); - tempVar2 = get_variable(script, *args++); - func_80071750(9, tempVar0, tempVar1, tempVar2, 5.0f, 0xF); + func_80071750(9, var0, var1, var2, 5.0f, 15); return ApiStatus_DONE2; } diff --git a/src/os/code_4ac90_len_3910.c b/src/os/code_4ac90_len_3910.c index 4eb4ba8cd3..0e74612759 100644 --- a/src/os/code_4ac90_len_3910.c +++ b/src/os/code_4ac90_len_3910.c @@ -215,7 +215,7 @@ INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_80071FF0); INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_80072050); -INCLUDE_ASM(void, "os/code_4ac90_len_3910", func_800720B0, s32 tempConst0, f32 tempVar0, f32 tempVar1, f32 tempVar2, f32 tempConst1, s32 tempConst2); +INCLUDE_ASM(void, "os/code_4ac90_len_3910", func_800720B0, s32 a0, f32 a1, f32 a2, f32 a3, f32 a4, s32 a5); INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_80072110); diff --git a/undefined_syms.txt b/undefined_syms.txt index 1c0bdf4c24..5f64481f84 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -42,7 +42,6 @@ D_800A095F = 0x800A095D; D_800A0960 = 0x800A0960; D_800A0963 = 0x800A0963; D_800A0964 = 0x800A0964; -D_800A0BB8 = 0x800A0BB8; D_800E92D8 = 0x800E92D8;