Match get_overriding_player_anim (#631)

This commit is contained in:
JoshDuMan 2022-01-24 08:51:48 -05:00 committed by GitHub
parent 4ef25a394d
commit ee0918018d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 98 additions and 223 deletions

View File

@ -1091,14 +1091,21 @@ enum PlayerAnims {
ANIM_3001E = 0x0003001E, ANIM_3001E = 0x0003001E,
ANIM_3001F = 0x0003001F, ANIM_3001F = 0x0003001F,
ANIM_30020 = 0x00030020, ANIM_30020 = 0x00030020,
ANIM_6000C = 0x0006000C,
ANIM_80003 = 0x00080003, ANIM_80003 = 0x00080003,
ANIM_80007 = 0x00080007, ANIM_80007 = 0x00080007,
ANIM_8000B = 0x0008000B, ANIM_8000B = 0x0008000B,
ANIM_8000C = 0x0008000C, ANIM_8000C = 0x0008000C,
ANIM_8000E = 0x0008000E,
ANIM_80017 = 0x00080017, ANIM_80017 = 0x00080017,
ANIM_8001B = 0x0008001B, ANIM_8001B = 0x0008001B,
ANIM_8001D = 0x0008001D, ANIM_8001D = 0x0008001D,
ANIM_8001E = 0x0008001E, ANIM_8001E = 0x0008001E,
ANIM_C0000 = 0x000C0000,
ANIM_C0001 = 0x000C0001,
ANIM_C0002 = 0x000C0002,
ANIM_C0010 = 0x000C0010,
ANIM_D0000 = 0x000D0000,
}; };
enum AmbientSounds { enum AmbientSounds {

View File

@ -1,5 +1,6 @@
#include "common.h" #include "common.h"
#include "ld_addrs.h" #include "ld_addrs.h"
#include "world/actions.h"
#define E20110_VRAM_DEF (void*)0x802B7000 #define E20110_VRAM_DEF (void*)0x802B7000
#define E20EB0_VRAM_DEF (void*)0x802B7000 #define E20EB0_VRAM_DEF (void*)0x802B7000
@ -55,7 +56,6 @@ void func_802BE070_31DBE0(void);
void reset_player_status(void); void reset_player_status(void);
void func_800E6B68(void); void func_800E6B68(void);
void func_800E5520(void); void func_800E5520(void);
s32 get_overriding_player_anim(s32);
void func_802B7000_E225B0(void); void func_802B7000_E225B0(void);
void func_802B71D4(void); void func_802B71D4(void);
void func_802B71C8(void); void func_802B71C8(void);
@ -813,7 +813,55 @@ s32 func_800DFCF4(void) {
return 1; return 1;
} }
INCLUDE_ASM(s32, "77480", get_overriding_player_anim); s32 get_overriding_player_anim(s32 anim) {
PlayerStatus* playerStatus = &gPlayerStatus;
PartnerActionStatus* actionStatus = &gPartnerActionStatus;
if (playerStatus->actionState == ACTION_STATE_USE_SPINNING_FLOWER && anim != ANIM_1002B && anim != ANIM_MIDAIR_STILL) {
return -1;
}
if (actionStatus->actionState.b[0] != 0) {
if (actionStatus->actionState.b[3] == 8 && anim == ANIM_10002) {
anim = ANIM_8000E;
}
if (actionStatus->actionState.b[0] != 0) {
if (actionStatus->actionState.b[3] == 9) {
if (anim != ANIM_CROUCH && anim != ANIM_10002) {
return -1;
}
}
}
}
if (anim == ANIM_THUMBS_UP && actionStatus->actionState.b[0] == 1) {
return -1;
}
if (anim == ANIM_6000C || anim == ANIM_C0010 || anim == ANIM_10002) {
if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS)) {
if (!func_800DFCF4()) {
return -1;
}
} else if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_IN_DISGUISE)) {
anim = ANIM_C0010;
} else {
peach_set_disguise_anim(world_actions_peachDisguises[playerStatus->peachDisguise].unk_14);
return -1;
}
} else if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) {
if (playerStatus->unk_C4 && (anim == ANIM_C0000 || anim == ANIM_C0001 || anim == ANIM_C0002)) {
anim = ANIM_D0000;
}
}
if (anim == ANIM_80003) {
exec_ShakeCam1(0, 0, 2);
}
return anim;
}
void suggest_player_anim_clearUnkFlag(s32 arg0) { void suggest_player_anim_clearUnkFlag(s32 arg0) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
@ -1091,7 +1139,47 @@ void func_800E06C0(s32 arg0) {
D_8010C950 = (arg0 == 1); D_8010C950 = (arg0 == 1);
} }
INCLUDE_ASM(s32, "77480", func_800E06D8); s32 func_800E06D8(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
Npc* npc = playerStatus->unk_C8;
s32 temp = playerStatus->unk_C6;
s32 wall;
if (playerStatus->decorationList || playerStatus->statusMenuCounterinputEnabledCounter) {
return FALSE;
}
if (gCollisionStatus.currentWall == -1) {
return FALSE;
}
if (playerStatus->flags & PLAYER_STATUS_FLAGS_HAS_CONVERSATION_NPC && !(playerStatus->flags & PLAYER_STATUS_FLAGS_INPUT_DISABLED)
&& npc != NULL && npc->flags & NPC_FLAG_10000000) {
playerStatus->unk_C6 = -1;
return TRUE;
}
wall = gCollisionStatus.currentWall;
if (!(wall & 0x4000)) {
if (!should_collider_allow_interact(wall)) {
return FALSE;
}
} else if (!phys_can_player_interact()) {
playerStatus->unk_C6 = -1;
return FALSE;
} else if (get_entity_type(wall) == 0xC) {
return FALSE;
}
if (temp == wall) {
if (playerStatus->flags & PLAYER_STATUS_FLAGS_8000000) {
return FALSE;
}
} else {
playerStatus->flags &= ~PLAYER_STATUS_FLAGS_8000000;
}
playerStatus->unk_C6 = -1;
return TRUE;
}
static const f32 pad[1] = { 0.0f}; static const f32 pad[1] = { 0.0f};

View File

@ -1,94 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_800E06D8
/* 79B88 800E06D8 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 79B8C 800E06DC AFB10014 */ sw $s1, 0x14($sp)
/* 79B90 800E06E0 3C118011 */ lui $s1, %hi(gPlayerStatus)
/* 79B94 800E06E4 2631EFC8 */ addiu $s1, $s1, %lo(gPlayerStatus)
/* 79B98 800E06E8 AFBF001C */ sw $ra, 0x1c($sp)
/* 79B9C 800E06EC AFB20018 */ sw $s2, 0x18($sp)
/* 79BA0 800E06F0 AFB00010 */ sw $s0, 0x10($sp)
/* 79BA4 800E06F4 8E2400C8 */ lw $a0, 0xc8($s1)
/* 79BA8 800E06F8 862200C0 */ lh $v0, 0xc0($s1)
/* 79BAC 800E06FC 863200C6 */ lh $s2, 0xc6($s1)
/* 79BB0 800E0700 1440003F */ bnez $v0, .L800E0800
/* 79BB4 800E0704 0000102D */ daddu $v0, $zero, $zero
/* 79BB8 800E0708 82220015 */ lb $v0, 0x15($s1)
/* 79BBC 800E070C 1440003C */ bnez $v0, .L800E0800
/* 79BC0 800E0710 0000102D */ daddu $v0, $zero, $zero
/* 79BC4 800E0714 3C028016 */ lui $v0, %hi(gCollisionStatus+0x12)
/* 79BC8 800E0718 8442A562 */ lh $v0, %lo(gCollisionStatus+0x12)($v0)
/* 79BCC 800E071C 2405FFFF */ addiu $a1, $zero, -1
/* 79BD0 800E0720 14450003 */ bne $v0, $a1, .L800E0730
/* 79BD4 800E0724 3C020200 */ lui $v0, 0x200
.L800E0728:
/* 79BD8 800E0728 08038200 */ j .L800E0800
/* 79BDC 800E072C 0000102D */ daddu $v0, $zero, $zero
.L800E0730:
/* 79BE0 800E0730 8E230000 */ lw $v1, ($s1)
/* 79BE4 800E0734 34422000 */ ori $v0, $v0, 0x2000
/* 79BE8 800E0738 00621824 */ and $v1, $v1, $v0
/* 79BEC 800E073C 3C020200 */ lui $v0, 0x200
/* 79BF0 800E0740 14620009 */ bne $v1, $v0, .L800E0768
/* 79BF4 800E0744 00000000 */ nop
/* 79BF8 800E0748 10800007 */ beqz $a0, .L800E0768
/* 79BFC 800E074C 3C031000 */ lui $v1, 0x1000
/* 79C00 800E0750 8C820000 */ lw $v0, ($a0)
/* 79C04 800E0754 00431024 */ and $v0, $v0, $v1
/* 79C08 800E0758 10400003 */ beqz $v0, .L800E0768
/* 79C0C 800E075C 00000000 */ nop
/* 79C10 800E0760 080381FF */ j .L800E07FC
/* 79C14 800E0764 A62500C6 */ sh $a1, 0xc6($s1)
.L800E0768:
/* 79C18 800E0768 3C108016 */ lui $s0, %hi(gCollisionStatus+0x12)
/* 79C1C 800E076C 8610A562 */ lh $s0, %lo(gCollisionStatus+0x12)($s0)
/* 79C20 800E0770 32024000 */ andi $v0, $s0, 0x4000
/* 79C24 800E0774 14400007 */ bnez $v0, .L800E0794
/* 79C28 800E0778 00000000 */ nop
/* 79C2C 800E077C 0C05173A */ jal should_collider_allow_interact
/* 79C30 800E0780 0200202D */ daddu $a0, $s0, $zero
/* 79C34 800E0784 1440000E */ bnez $v0, .L800E07C0
/* 79C38 800E0788 0000102D */ daddu $v0, $zero, $zero
/* 79C3C 800E078C 08038200 */ j .L800E0800
/* 79C40 800E0790 00000000 */ nop
.L800E0794:
/* 79C44 800E0794 0C0394BE */ jal phys_can_player_interact
/* 79C48 800E0798 00000000 */ nop
/* 79C4C 800E079C 14400003 */ bnez $v0, .L800E07AC
/* 79C50 800E07A0 2402FFFF */ addiu $v0, $zero, -1
/* 79C54 800E07A4 080381CA */ j .L800E0728
/* 79C58 800E07A8 A62200C6 */ sh $v0, 0xc6($s1)
.L800E07AC:
/* 79C5C 800E07AC 0C0441A9 */ jal get_entity_type
/* 79C60 800E07B0 0200202D */ daddu $a0, $s0, $zero
/* 79C64 800E07B4 2403000C */ addiu $v1, $zero, 0xc
/* 79C68 800E07B8 10430011 */ beq $v0, $v1, .L800E0800
/* 79C6C 800E07BC 0000102D */ daddu $v0, $zero, $zero
.L800E07C0:
/* 79C70 800E07C0 16500008 */ bne $s2, $s0, .L800E07E4
/* 79C74 800E07C4 3C03F7FF */ lui $v1, 0xf7ff
/* 79C78 800E07C8 8E220000 */ lw $v0, ($s1)
/* 79C7C 800E07CC 3C030800 */ lui $v1, 0x800
/* 79C80 800E07D0 00431024 */ and $v0, $v0, $v1
/* 79C84 800E07D4 10400007 */ beqz $v0, .L800E07F4
/* 79C88 800E07D8 0000102D */ daddu $v0, $zero, $zero
/* 79C8C 800E07DC 08038200 */ j .L800E0800
/* 79C90 800E07E0 00000000 */ nop
.L800E07E4:
/* 79C94 800E07E4 8E220000 */ lw $v0, ($s1)
/* 79C98 800E07E8 3463FFFF */ ori $v1, $v1, 0xffff
/* 79C9C 800E07EC 00431024 */ and $v0, $v0, $v1
/* 79CA0 800E07F0 AE220000 */ sw $v0, ($s1)
.L800E07F4:
/* 79CA4 800E07F4 2402FFFF */ addiu $v0, $zero, -1
/* 79CA8 800E07F8 A62200C6 */ sh $v0, 0xc6($s1)
.L800E07FC:
/* 79CAC 800E07FC 24020001 */ addiu $v0, $zero, 1
.L800E0800:
/* 79CB0 800E0800 8FBF001C */ lw $ra, 0x1c($sp)
/* 79CB4 800E0804 8FB20018 */ lw $s2, 0x18($sp)
/* 79CB8 800E0808 8FB10014 */ lw $s1, 0x14($sp)
/* 79CBC 800E080C 8FB00010 */ lw $s0, 0x10($sp)
/* 79CC0 800E0810 03E00008 */ jr $ra
/* 79CC4 800E0814 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,126 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel get_overriding_player_anim
/* 791F8 800DFD48 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 791FC 800DFD4C AFB00010 */ sw $s0, 0x10($sp)
/* 79200 800DFD50 0080802D */ daddu $s0, $a0, $zero
/* 79204 800DFD54 3C058011 */ lui $a1, %hi(gPlayerStatus)
/* 79208 800DFD58 24A5EFC8 */ addiu $a1, $a1, %lo(gPlayerStatus)
/* 7920C 800DFD5C 3C048011 */ lui $a0, %hi(gPartnerActionStatus)
/* 79210 800DFD60 2484EBB0 */ addiu $a0, $a0, %lo(gPartnerActionStatus)
/* 79214 800DFD64 AFBF0014 */ sw $ra, 0x14($sp)
/* 79218 800DFD68 80A300B4 */ lb $v1, 0xb4($a1)
/* 7921C 800DFD6C 2402001D */ addiu $v0, $zero, 0x1d
/* 79220 800DFD70 14620007 */ bne $v1, $v0, .L800DFD90
/* 79224 800DFD74 3C020001 */ lui $v0, 1
/* 79228 800DFD78 3442002B */ ori $v0, $v0, 0x2b
/* 7922C 800DFD7C 12020004 */ beq $s0, $v0, .L800DFD90
/* 79230 800DFD80 3C020001 */ lui $v0, 1
/* 79234 800DFD84 34420007 */ ori $v0, $v0, 7
/* 79238 800DFD88 16020058 */ bne $s0, $v0, .L800DFEEC
/* 7923C 800DFD8C 2402FFFF */ addiu $v0, $zero, -1
.L800DFD90:
/* 79240 800DFD90 80820000 */ lb $v0, ($a0)
/* 79244 800DFD94 10400017 */ beqz $v0, .L800DFDF4
/* 79248 800DFD98 24020008 */ addiu $v0, $zero, 8
/* 7924C 800DFD9C 80830003 */ lb $v1, 3($a0)
/* 79250 800DFDA0 14620006 */ bne $v1, $v0, .L800DFDBC
/* 79254 800DFDA4 3C020001 */ lui $v0, 1
/* 79258 800DFDA8 34420002 */ ori $v0, $v0, 2
/* 7925C 800DFDAC 16020003 */ bne $s0, $v0, .L800DFDBC
/* 79260 800DFDB0 00000000 */ nop
/* 79264 800DFDB4 3C100008 */ lui $s0, 8
/* 79268 800DFDB8 3610000E */ ori $s0, $s0, 0xe
.L800DFDBC:
/* 7926C 800DFDBC 80820000 */ lb $v0, ($a0)
/* 79270 800DFDC0 1040000C */ beqz $v0, .L800DFDF4
/* 79274 800DFDC4 24020009 */ addiu $v0, $zero, 9
/* 79278 800DFDC8 80830003 */ lb $v1, 3($a0)
/* 7927C 800DFDCC 1462000A */ bne $v1, $v0, .L800DFDF8
/* 79280 800DFDD0 3C020001 */ lui $v0, 1
/* 79284 800DFDD4 34420014 */ ori $v0, $v0, 0x14
/* 79288 800DFDD8 12020006 */ beq $s0, $v0, .L800DFDF4
/* 7928C 800DFDDC 3C020001 */ lui $v0, 1
/* 79290 800DFDE0 34420002 */ ori $v0, $v0, 2
/* 79294 800DFDE4 12020004 */ beq $s0, $v0, .L800DFDF8
/* 79298 800DFDE8 3C020001 */ lui $v0, 1
.L800DFDEC:
/* 7929C 800DFDEC 08037FBB */ j .L800DFEEC
/* 792A0 800DFDF0 2402FFFF */ addiu $v0, $zero, -1
.L800DFDF4:
/* 792A4 800DFDF4 3C020001 */ lui $v0, 1
.L800DFDF8:
/* 792A8 800DFDF8 34420032 */ ori $v0, $v0, 0x32
/* 792AC 800DFDFC 16020005 */ bne $s0, $v0, .L800DFE14
/* 792B0 800DFE00 3C020006 */ lui $v0, 6
/* 792B4 800DFE04 80830000 */ lb $v1, ($a0)
/* 792B8 800DFE08 24020001 */ addiu $v0, $zero, 1
/* 792BC 800DFE0C 1062FFF7 */ beq $v1, $v0, .L800DFDEC
/* 792C0 800DFE10 3C020006 */ lui $v0, 6
.L800DFE14:
/* 792C4 800DFE14 3442000C */ ori $v0, $v0, 0xc
/* 792C8 800DFE18 12020007 */ beq $s0, $v0, .L800DFE38
/* 792CC 800DFE1C 3C02000C */ lui $v0, 0xc
/* 792D0 800DFE20 34420010 */ ori $v0, $v0, 0x10
/* 792D4 800DFE24 12020004 */ beq $s0, $v0, .L800DFE38
/* 792D8 800DFE28 3C020001 */ lui $v0, 1
/* 792DC 800DFE2C 34420002 */ ori $v0, $v0, 2
/* 792E0 800DFE30 1602001A */ bne $s0, $v0, .L800DFE9C
/* 792E4 800DFE34 00000000 */ nop
.L800DFE38:
/* 792E8 800DFE38 8CA30004 */ lw $v1, 4($a1)
/* 792EC 800DFE3C 30621000 */ andi $v0, $v1, 0x1000
/* 792F0 800DFE40 14400007 */ bnez $v0, .L800DFE60
/* 792F4 800DFE44 30622000 */ andi $v0, $v1, 0x2000
/* 792F8 800DFE48 0C037F3D */ jal func_800DFCF4
/* 792FC 800DFE4C 00000000 */ nop
/* 79300 800DFE50 1440001E */ bnez $v0, .L800DFECC
/* 79304 800DFE54 3C020008 */ lui $v0, 8
/* 79308 800DFE58 08037FBB */ j .L800DFEEC
/* 7930C 800DFE5C 2402FFFF */ addiu $v0, $zero, -1
.L800DFE60:
/* 79310 800DFE60 14400003 */ bnez $v0, .L800DFE70
/* 79314 800DFE64 3C10000C */ lui $s0, 0xc
/* 79318 800DFE68 08037FB2 */ j .L800DFEC8
/* 7931C 800DFE6C 36100010 */ ori $s0, $s0, 0x10
.L800DFE70:
/* 79320 800DFE70 80A3000C */ lb $v1, 0xc($a1)
/* 79324 800DFE74 00031040 */ sll $v0, $v1, 1
/* 79328 800DFE78 00431021 */ addu $v0, $v0, $v1
/* 7932C 800DFE7C 000210C0 */ sll $v0, $v0, 3
/* 79330 800DFE80 3C04800F */ lui $a0, %hi(world_actions_peachDisguises+0x14)
/* 79334 800DFE84 00822021 */ addu $a0, $a0, $v0
/* 79338 800DFE88 8C847C30 */ lw $a0, %lo(world_actions_peachDisguises+0x14)($a0)
/* 7933C 800DFE8C 0C0398DB */ jal peach_set_disguise_anim
/* 79340 800DFE90 00000000 */ nop
/* 79344 800DFE94 08037FBB */ j .L800DFEEC
/* 79348 800DFE98 2402FFFF */ addiu $v0, $zero, -1
.L800DFE9C:
/* 7934C 800DFE9C 8CA20004 */ lw $v0, 4($a1)
/* 79350 800DFEA0 30421000 */ andi $v0, $v0, 0x1000
/* 79354 800DFEA4 10400009 */ beqz $v0, .L800DFECC
/* 79358 800DFEA8 3C020008 */ lui $v0, 8
/* 7935C 800DFEAC 80A200C4 */ lb $v0, 0xc4($a1)
/* 79360 800DFEB0 10400005 */ beqz $v0, .L800DFEC8
/* 79364 800DFEB4 3C02FFF4 */ lui $v0, 0xfff4
/* 79368 800DFEB8 02021021 */ addu $v0, $s0, $v0
/* 7936C 800DFEBC 2C420003 */ sltiu $v0, $v0, 3
/* 79370 800DFEC0 54400001 */ bnel $v0, $zero, .L800DFEC8
/* 79374 800DFEC4 3C10000D */ lui $s0, 0xd
.L800DFEC8:
/* 79378 800DFEC8 3C020008 */ lui $v0, 8
.L800DFECC:
/* 7937C 800DFECC 34420003 */ ori $v0, $v0, 3
/* 79380 800DFED0 16020006 */ bne $s0, $v0, .L800DFEEC
/* 79384 800DFED4 0200102D */ daddu $v0, $s0, $zero
/* 79388 800DFED8 0000202D */ daddu $a0, $zero, $zero
/* 7938C 800DFEDC 0080282D */ daddu $a1, $a0, $zero
/* 79390 800DFEE0 0C0B2D5B */ jal exec_ShakeCam1
/* 79394 800DFEE4 24060002 */ addiu $a2, $zero, 2
/* 79398 800DFEE8 0200102D */ daddu $v0, $s0, $zero
.L800DFEEC:
/* 7939C 800DFEEC 8FBF0014 */ lw $ra, 0x14($sp)
/* 793A0 800DFEF0 8FB00010 */ lw $s0, 0x10($sp)
/* 793A4 800DFEF4 03E00008 */ jr $ra
/* 793A8 800DFEF8 27BD0018 */ addiu $sp, $sp, 0x18