From 9212454667b0c0e331bc08c4afa90f12507dafd9 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 21 Jun 2020 11:47:27 +1000 Subject: [PATCH] Decompile func0f0375b0 --- src/game/chr/chraction.c | 26 +++++++++----------------- src/include/game/chr/chraction.h | 4 ++-- src/include/types.h | 2 +- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/game/chr/chraction.c b/src/game/chr/chraction.c index 5b1481cca..7a180fd4a 100644 --- a/src/game/chr/chraction.c +++ b/src/game/chr/chraction.c @@ -8959,23 +8959,15 @@ void func0f037580(struct chrdata *chr) chrPatrolGetCurWaypointInfo(chr, &chr->act_patrol.waydata.pos, rooms); } -GLOBAL_ASM( -glabel func0f0375b0 -/* f0375b0: 27bdffe8 */ addiu $sp,$sp,-24 -/* f0375b4: afbf0014 */ sw $ra,0x14($sp) -/* f0375b8: afa40018 */ sw $a0,0x18($sp) -/* f0375bc: 24850034 */ addiu $a1,$a0,0x34 -/* f0375c0: 0fc0dcf7 */ jal func0f0373dc -/* f0375c4: 24060001 */ addiu $a2,$zero,0x1 -/* f0375c8: 8fa40018 */ lw $a0,0x18($sp) -/* f0375cc: ac820030 */ sw $v0,0x30($a0) -/* f0375d0: 0fc0dd60 */ jal func0f037580 -/* f0375d4: a0820333 */ sb $v0,0x333($a0) -/* f0375d8: 8fbf0014 */ lw $ra,0x14($sp) -/* f0375dc: 27bd0018 */ addiu $sp,$sp,0x18 -/* f0375e0: 03e00008 */ jr $ra -/* f0375e4: 00000000 */ sll $zero,$zero,0x0 -); +void func0f0375b0(struct chrdata *chr) +{ + s32 nextstep = func0f0373dc(chr, &chr->act_patrol.unk034, true); + + chr->act_patrol.nextstep = nextstep; + chr->patrolnextstep = nextstep; + + func0f037580(chr); +} GLOBAL_ASM( glabel func0f0375e8 diff --git a/src/include/game/chr/chraction.h b/src/include/game/chr/chraction.h index 6b68120e6..59edcc6f2 100644 --- a/src/include/game/chr/chraction.h +++ b/src/include/game/chr/chraction.h @@ -72,11 +72,11 @@ s32 func0f037124(struct chrdata *chr); void chrGoPosConsiderRestart(struct chrdata *chr); void chrGoPosInitExpensive(struct chrdata *chr); void chrGoPosAdvanceWaypoint(struct chrdata *chr); -u32 func0f0373dc(void); +s32 func0f0373dc(struct chrdata *chr, u32 *arg1, bool arg2); s32 func0f0374a0(struct chrdata *chr, s32 arg1); void chrPatrolGetCurWaypointInfoWithFlags(struct chrdata *chr, struct coord *pos, s16 *rooms, u32 *flags); void func0f037580(struct chrdata *chr); -u32 func0f0375b0(void); +void func0f0375b0(struct chrdata *chr); void func0f0375e8(struct chrdata *chr, struct waydata *waydata, f32 arg2, struct coord *arg3, s16 *rooms); void chrCalculatePosition(struct chrdata *chr, struct coord *pos); void chrGoPosChooseAnimation(struct chrdata *chr); diff --git a/src/include/types.h b/src/include/types.h index d02ba131a..49c9f17f1 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -548,7 +548,7 @@ struct waydata { struct act_patrol { /*0x02c*/ u32 unk02c; - /*0x030*/ u32 unk030; + /*0x030*/ s32 nextstep; /*0x034*/ u32 unk034; /*0x038*/ struct waydata waydata; };