From 51b1c9acfbfc7bfbff28e1906ad25e8a5996836a Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Fri, 30 Oct 2020 19:03:29 -0400 Subject: [PATCH] CheckPartnerFlags1000 --- .../area_kmr/kmr_02/8B36B0/func_80243640_8B36B0.s | 15 --------------- .../area_kmr/kmr_03/8C7F90/func_80240184_8C8114.s | 15 --------------- .../area_kmr/kmr_04/8CA900/func_80240000_8CA900.s | 15 --------------- .../area_kmr/kmr_04/8CA960/func_8024029C_8CAB9C.s | 15 --------------- src/world/area_kmr/kmr_02/8B36B0.c | 2 +- src/world/area_kmr/kmr_03/8C7F90.c | 2 +- src/world/area_kmr/kmr_04/8CA900.c | 2 +- src/world/area_kmr/kmr_04/8CA960.c | 3 +-- src/world/common/CheckPartnerFlags1000.inc.c | 5 +++++ 9 files changed, 9 insertions(+), 65 deletions(-) delete mode 100644 asm/nonmatchings/world/area_kmr/kmr_02/8B36B0/func_80243640_8B36B0.s delete mode 100644 asm/nonmatchings/world/area_kmr/kmr_03/8C7F90/func_80240184_8C8114.s delete mode 100644 asm/nonmatchings/world/area_kmr/kmr_04/8CA900/func_80240000_8CA900.s delete mode 100644 asm/nonmatchings/world/area_kmr/kmr_04/8CA960/func_8024029C_8CAB9C.s create mode 100644 src/world/common/CheckPartnerFlags1000.inc.c diff --git a/asm/nonmatchings/world/area_kmr/kmr_02/8B36B0/func_80243640_8B36B0.s b/asm/nonmatchings/world/area_kmr/kmr_02/8B36B0/func_80243640_8B36B0.s deleted file mode 100644 index 53d1d0587e..0000000000 --- a/asm/nonmatchings/world/area_kmr/kmr_02/8B36B0/func_80243640_8B36B0.s +++ /dev/null @@ -1,15 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80243640_8B36B0 -/* 8B36B0 80243640 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 8B36B4 80243644 AFBF0010 */ sw $ra, 0x10($sp) -/* 8B36B8 80243648 0C00EABB */ jal get_npc_unsafe -/* 8B36BC 8024364C 2404FFFC */ addiu $a0, $zero, -4 -/* 8B36C0 80243650 8C420000 */ lw $v0, ($v0) -/* 8B36C4 80243654 8FBF0010 */ lw $ra, 0x10($sp) -/* 8B36C8 80243658 30421000 */ andi $v0, $v0, 0x1000 -/* 8B36CC 8024365C 0002102B */ sltu $v0, $zero, $v0 -/* 8B36D0 80243660 00021040 */ sll $v0, $v0, 1 -/* 8B36D4 80243664 03E00008 */ jr $ra -/* 8B36D8 80243668 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/world/area_kmr/kmr_03/8C7F90/func_80240184_8C8114.s b/asm/nonmatchings/world/area_kmr/kmr_03/8C7F90/func_80240184_8C8114.s deleted file mode 100644 index 5b71f3006b..0000000000 --- a/asm/nonmatchings/world/area_kmr/kmr_03/8C7F90/func_80240184_8C8114.s +++ /dev/null @@ -1,15 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240184_8C8114 -/* 8C8114 80240184 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 8C8118 80240188 AFBF0010 */ sw $ra, 0x10($sp) -/* 8C811C 8024018C 0C00EABB */ jal get_npc_unsafe -/* 8C8120 80240190 2404FFFC */ addiu $a0, $zero, -4 -/* 8C8124 80240194 8C420000 */ lw $v0, ($v0) -/* 8C8128 80240198 8FBF0010 */ lw $ra, 0x10($sp) -/* 8C812C 8024019C 30421000 */ andi $v0, $v0, 0x1000 -/* 8C8130 802401A0 0002102B */ sltu $v0, $zero, $v0 -/* 8C8134 802401A4 00021040 */ sll $v0, $v0, 1 -/* 8C8138 802401A8 03E00008 */ jr $ra -/* 8C813C 802401AC 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/world/area_kmr/kmr_04/8CA900/func_80240000_8CA900.s b/asm/nonmatchings/world/area_kmr/kmr_04/8CA900/func_80240000_8CA900.s deleted file mode 100644 index 231ffcd1af..0000000000 --- a/asm/nonmatchings/world/area_kmr/kmr_04/8CA900/func_80240000_8CA900.s +++ /dev/null @@ -1,15 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240000_8CA900 -/* 8CA900 80240000 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 8CA904 80240004 AFBF0010 */ sw $ra, 0x10($sp) -/* 8CA908 80240008 0C00EABB */ jal get_npc_unsafe -/* 8CA90C 8024000C 2404FFFC */ addiu $a0, $zero, -4 -/* 8CA910 80240010 8C420000 */ lw $v0, ($v0) -/* 8CA914 80240014 8FBF0010 */ lw $ra, 0x10($sp) -/* 8CA918 80240018 30421000 */ andi $v0, $v0, 0x1000 -/* 8CA91C 8024001C 0002102B */ sltu $v0, $zero, $v0 -/* 8CA920 80240020 00021040 */ sll $v0, $v0, 1 -/* 8CA924 80240024 03E00008 */ jr $ra -/* 8CA928 80240028 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/world/area_kmr/kmr_04/8CA960/func_8024029C_8CAB9C.s b/asm/nonmatchings/world/area_kmr/kmr_04/8CA960/func_8024029C_8CAB9C.s deleted file mode 100644 index c594351fac..0000000000 --- a/asm/nonmatchings/world/area_kmr/kmr_04/8CA960/func_8024029C_8CAB9C.s +++ /dev/null @@ -1,15 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8024029C_8CAB9C -/* 8CAB9C 8024029C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 8CABA0 802402A0 AFBF0010 */ sw $ra, 0x10($sp) -/* 8CABA4 802402A4 0C00EABB */ jal get_npc_unsafe -/* 8CABA8 802402A8 2404FFFC */ addiu $a0, $zero, -4 -/* 8CABAC 802402AC 8C420000 */ lw $v0, ($v0) -/* 8CABB0 802402B0 8FBF0010 */ lw $ra, 0x10($sp) -/* 8CABB4 802402B4 30421000 */ andi $v0, $v0, 0x1000 -/* 8CABB8 802402B8 0002102B */ sltu $v0, $zero, $v0 -/* 8CABBC 802402BC 00021040 */ sll $v0, $v0, 1 -/* 8CABC0 802402C0 03E00008 */ jr $ra -/* 8CABC4 802402C4 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/src/world/area_kmr/kmr_02/8B36B0.c b/src/world/area_kmr/kmr_02/8B36B0.c index dc6524e5e0..3032631199 100644 --- a/src/world/area_kmr/kmr_02/8B36B0.c +++ b/src/world/area_kmr/kmr_02/8B36B0.c @@ -1,6 +1,6 @@ #include "kmr_02.h" -INCLUDE_ASM(s32, "world/area_kmr/kmr_02/8B36B0", func_80243640_8B36B0); +#include "world/common/CheckPartnerFlags1000.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_02/8B36B0", func_8024366C_8B36DC); diff --git a/src/world/area_kmr/kmr_03/8C7F90.c b/src/world/area_kmr/kmr_03/8C7F90.c index 6f289df621..ce0c09531c 100644 --- a/src/world/area_kmr/kmr_03/8C7F90.c +++ b/src/world/area_kmr/kmr_03/8C7F90.c @@ -2,7 +2,7 @@ INCLUDE_ASM(s32, "world/area_kmr/kmr_03/8C7F90", func_80240000_8C7F90); -INCLUDE_ASM(s32, "world/area_kmr/kmr_03/8C7F90", func_80240184_8C8114); +#include "world/common/CheckPartnerFlags1000.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_03/8C7F90", func_802401B0_8C8140); diff --git a/src/world/area_kmr/kmr_04/8CA900.c b/src/world/area_kmr/kmr_04/8CA900.c index 3920cad638..3326b00c98 100644 --- a/src/world/area_kmr/kmr_04/8CA900.c +++ b/src/world/area_kmr/kmr_04/8CA900.c @@ -1,5 +1,5 @@ #include "kmr_04.h" -INCLUDE_ASM(s32, "world/area_kmr/kmr_04/8CA900", func_80240000_8CA900); +#include "world/common/CheckPartnerFlags1000.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_04/8CA900", func_8024002C_8CA92C); diff --git a/src/world/area_kmr/kmr_04/8CA960.c b/src/world/area_kmr/kmr_04/8CA960.c index 6843ad0c92..fa5c2991fd 100644 --- a/src/world/area_kmr/kmr_04/8CA960.c +++ b/src/world/area_kmr/kmr_04/8CA960.c @@ -2,8 +2,7 @@ #include "world/common/SomeMatrixOperations.inc.c" - -INCLUDE_ASM(s32, "world/area_kmr/kmr_04/8CA960", func_8024029C_8CAB9C); +#include "world/common/CheckPartnerFlags1000.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_04/8CA960", func_802402C8_8CABC8); diff --git a/src/world/common/CheckPartnerFlags1000.inc.c b/src/world/common/CheckPartnerFlags1000.inc.c new file mode 100644 index 0000000000..f34f84ba9c --- /dev/null +++ b/src/world/common/CheckPartnerFlags1000.inc.c @@ -0,0 +1,5 @@ +#include "common.h" + +static ApiStatus CheckPartnerFlags1000(ScriptInstance* script, s32 isInitialCall) { + return ((get_npc_unsafe(NpcId_PARTNER)->flags & 0x1000) != 0) * ApiStatus_DONE2; +}