From 8dd8f4c36af6fcbdc3117320a0724bdeb586c379 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 30 Nov 2019 22:07:11 +1000 Subject: [PATCH] Decompile heliSetField90 --- src/game/chr/chraicommands.c | 4 ++-- src/game/game_066310.c | 30 +++++++++++------------------- src/include/game/game_066310.h | 2 +- 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index e0c4b4cff..a2833d0f9 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -11598,7 +11598,7 @@ bool aiSetPadPresetToInvestigationTerminal(void) bool ai0143(void) { if (g_Vars.hovdata) { - func0f07b0bc(g_Vars.hovdata, true); + heliSetField90(&g_Vars.hovdata->base, true); } g_Vars.aioffset += 2; @@ -11612,7 +11612,7 @@ bool ai0143(void) bool ai0144(void) { if (g_Vars.hovdata) { - func0f07b0bc(g_Vars.hovdata, false); + heliSetField90(&g_Vars.hovdata->base, false); } g_Vars.aioffset += 2; diff --git a/src/game/game_066310.c b/src/game/game_066310.c index 32591d47e..99bf5fb9c 100644 --- a/src/game/game_066310.c +++ b/src/game/game_066310.c @@ -24801,25 +24801,17 @@ glabel func0f07b078 /* f07b0b8: 00000000 */ sll $zero,$zero,0x0 ); -GLOBAL_ASM( -glabel func0f07b0bc -/* f07b0bc: 27bdffe8 */ addiu $sp,$sp,-24 -/* f07b0c0: afbf0014 */ sw $ra,0x14($sp) -/* f07b0c4: 0fc1eb7d */ jal func0f07adf4 -/* f07b0c8: afa5001c */ sw $a1,0x1c($sp) -/* f07b0cc: 10400004 */ beqz $v0,.L0f07b0e0 -/* f07b0d0: 8fae001c */ lw $t6,0x1c($sp) -/* f07b0d4: a44e0090 */ sh $t6,0x90($v0) -/* f07b0d8: 10000002 */ beqz $zero,.L0f07b0e4 -/* f07b0dc: 24020001 */ addiu $v0,$zero,0x1 -.L0f07b0e0: -/* f07b0e0: 00001025 */ or $v0,$zero,$zero -.L0f07b0e4: -/* f07b0e4: 8fbf0014 */ lw $ra,0x14($sp) -/* f07b0e8: 27bd0018 */ addiu $sp,$sp,0x18 -/* f07b0ec: 03e00008 */ jr $ra -/* f07b0f0: 00000000 */ sll $zero,$zero,0x0 -); +bool heliSetField90(struct defaultobj *obj, bool value) +{ + struct heliobj *heli = func0f07adf4(obj); + + if (heli) { + heli->unk90 = value; + return true; + } + + return false; +} GLOBAL_ASM( glabel func0f07b0f4 diff --git a/src/include/game/game_066310.h b/src/include/game/game_066310.h index f39e089d8..aea225001 100644 --- a/src/include/game/game_066310.h +++ b/src/include/game/game_066310.h @@ -167,7 +167,7 @@ u32 func0f07af34(struct heliobj *heli); void func0f07afd0(struct heliobj *heli, s32 arg1); u32 func0f07b038(struct heliobj *heli); void func0f07b078(struct heliobj *heli); -u32 func0f07b0bc(struct heliobj *heli, u32 arg1); +bool heliSetField90(struct defaultobj *obj, u32 value); u32 func0f07b0f4(struct heliobj *heli); float heliGetTimer(struct heliobj *heli); u32 func0f07b158(void);