mirror of
https://github.com/pmret/papermario.git
synced 2024-11-18 08:52:40 +01:00
Merge pull request #43 from nanaian/physics
match some in code_7bb60, fix coverage.py, fix lint action
This commit is contained in:
commit
373969d474
4
.github/workflows/lint.yaml
vendored
4
.github/workflows/lint.yaml
vendored
@ -23,7 +23,11 @@ jobs:
|
||||
uses: trilom/file-changes-action@v1.2.4
|
||||
with:
|
||||
output: ' '
|
||||
continue-on-error: true
|
||||
- run: ./format.sh ${{ steps.files.outputs.files}}
|
||||
if: ${{ steps.files.outcome == 'success' }}
|
||||
- run: ./format.sh
|
||||
if: ${{ steps.files.outcome == 'failure' }}
|
||||
|
||||
# fail if any files were changed by ./format.sh
|
||||
- id: files_formatted
|
||||
|
@ -1,40 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
|
||||
glabel check_input_hammer
|
||||
/* 07F590 800E60E0 27BDFFE8 */ addiu $sp, $sp, -0x18
|
||||
/* 07F594 800E60E4 3C038011 */ lui $v1, 0x8011
|
||||
/* 07F598 800E60E8 2463EFC8 */ addiu $v1, $v1, -0x1038
|
||||
/* 07F59C 800E60EC AFBF0010 */ sw $ra, 0x10($sp)
|
||||
/* 07F5A0 800E60F0 8C6200E0 */ lw $v0, 0xe0($v1)
|
||||
/* 07F5A4 800E60F4 3C048011 */ lui $a0, 0x8011
|
||||
/* 07F5A8 800E60F8 2484F290 */ addiu $a0, $a0, -0xd70
|
||||
/* 07F5AC 800E60FC 30424000 */ andi $v0, $v0, 0x4000
|
||||
/* 07F5B0 800E6100 10400014 */ beqz $v0, .L800E6154
|
||||
/* 07F5B4 800E6104 0000102D */ daddu $v0, $zero, $zero
|
||||
/* 07F5B8 800E6108 8C620000 */ lw $v0, ($v1)
|
||||
/* 07F5BC 800E610C 30420004 */ andi $v0, $v0, 4
|
||||
/* 07F5C0 800E6110 14400010 */ bnez $v0, .L800E6154
|
||||
/* 07F5C4 800E6114 0000102D */ daddu $v0, $zero, $zero
|
||||
/* 07F5C8 800E6118 3C038011 */ lui $v1, 0x8011
|
||||
/* 07F5CC 800E611C 8063EBB0 */ lb $v1, -0x1450($v1)
|
||||
/* 07F5D0 800E6120 24020001 */ addiu $v0, $zero, 1
|
||||
/* 07F5D4 800E6124 14620004 */ bne $v1, $v0, .L800E6138
|
||||
/* 07F5D8 800E6128 24020006 */ addiu $v0, $zero, 6
|
||||
/* 07F5DC 800E612C 80830012 */ lb $v1, 0x12($a0)
|
||||
/* 07F5E0 800E6130 10620008 */ beq $v1, $v0, .L800E6154
|
||||
/* 07F5E4 800E6134 0000102D */ daddu $v0, $zero, $zero
|
||||
.L800E6138:
|
||||
/* 07F5E8 800E6138 80830001 */ lb $v1, 1($a0)
|
||||
/* 07F5EC 800E613C 2402FFFF */ addiu $v0, $zero, -1
|
||||
/* 07F5F0 800E6140 10620004 */ beq $v1, $v0, .L800E6154
|
||||
/* 07F5F4 800E6144 0000102D */ daddu $v0, $zero, $zero
|
||||
/* 07F5F8 800E6148 0C039769 */ jal set_action_state
|
||||
/* 07F5FC 800E614C 24040012 */ addiu $a0, $zero, 0x12
|
||||
/* 07F600 800E6150 24020001 */ addiu $v0, $zero, 1
|
||||
.L800E6154:
|
||||
/* 07F604 800E6154 8FBF0010 */ lw $ra, 0x10($sp)
|
||||
/* 07F608 800E6158 03E00008 */ jr $ra
|
||||
/* 07F60C 800E615C 27BD0018 */ addiu $sp, $sp, 0x18
|
||||
|
@ -1,34 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
|
||||
glabel move_player
|
||||
/* 07BC28 800E2778 27BDFFE8 */ addiu $sp, $sp, -0x18
|
||||
/* 07BC2C 800E277C 44861000 */ mtc1 $a2, $f2
|
||||
/* 07BC30 800E2780 3C068011 */ lui $a2, 0x8011
|
||||
/* 07BC34 800E2784 24C6EFC8 */ addiu $a2, $a2, -0x1038
|
||||
/* 07BC38 800E2788 AFBF0010 */ sw $ra, 0x10($sp)
|
||||
/* 07BC3C 800E278C 8CC20000 */ lw $v0, ($a2)
|
||||
/* 07BC40 800E2790 34424000 */ ori $v0, $v0, 0x4000
|
||||
/* 07BC44 800E2794 ACC20000 */ sw $v0, ($a2)
|
||||
/* 07BC48 800E2798 8CC20004 */ lw $v0, 4($a2)
|
||||
/* 07BC4C 800E279C 3C030040 */ lui $v1, 0x40
|
||||
/* 07BC50 800E27A0 ACC500A0 */ sw $a1, 0xa0($a2)
|
||||
/* 07BC54 800E27A4 A4C40012 */ sh $a0, 0x12($a2)
|
||||
/* 07BC58 800E27A8 00431024 */ and $v0, $v0, $v1
|
||||
/* 07BC5C 800E27AC 14400009 */ bnez $v0, .L800E27D4
|
||||
/* 07BC60 800E27B0 E4C20054 */ swc1 $f2, 0x54($a2)
|
||||
/* 07BC64 800E27B4 C4C00058 */ lwc1 $f0, 0x58($a2)
|
||||
/* 07BC68 800E27B8 4602003C */ c.lt.s $f0, $f2
|
||||
/* 07BC6C 800E27BC 00000000 */ nop
|
||||
/* 07BC70 800E27C0 45000002 */ bc1f .L800E27CC
|
||||
/* 07BC74 800E27C4 24040001 */ addiu $a0, $zero, 1
|
||||
/* 07BC78 800E27C8 24040002 */ addiu $a0, $zero, 2
|
||||
.L800E27CC:
|
||||
/* 07BC7C 800E27CC 0C039769 */ jal set_action_state
|
||||
/* 07BC80 800E27D0 00000000 */ nop
|
||||
.L800E27D4:
|
||||
/* 07BC84 800E27D4 8FBF0010 */ lw $ra, 0x10($sp)
|
||||
/* 07BC88 800E27D8 03E00008 */ jr $ra
|
||||
/* 07BC8C 800E27DC 27BD0018 */ addiu $sp, $sp, 0x18
|
||||
|
@ -1,133 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
|
||||
glabel set_action_state
|
||||
/* 07F254 800E5DA4 27BDFFE0 */ addiu $sp, $sp, -0x20
|
||||
/* 07F258 800E5DA8 AFB00010 */ sw $s0, 0x10($sp)
|
||||
/* 07F25C 800E5DAC 3C108011 */ lui $s0, 0x8011
|
||||
/* 07F260 800E5DB0 2610EFC8 */ addiu $s0, $s0, -0x1038
|
||||
/* 07F264 800E5DB4 AFBF0018 */ sw $ra, 0x18($sp)
|
||||
/* 07F268 800E5DB8 AFB10014 */ sw $s1, 0x14($sp)
|
||||
/* 07F26C 800E5DBC 8E030000 */ lw $v1, ($s0)
|
||||
/* 07F270 800E5DC0 30620200 */ andi $v0, $v1, 0x200
|
||||
/* 07F274 800E5DC4 10400005 */ beqz $v0, .L800E5DDC
|
||||
/* 07F278 800E5DC8 0080882D */ daddu $s1, $a0, $zero
|
||||
/* 07F27C 800E5DCC 2402FDFF */ addiu $v0, $zero, -0x201
|
||||
/* 07F280 800E5DD0 00621024 */ and $v0, $v1, $v0
|
||||
/* 07F284 800E5DD4 0C038069 */ jal func_800E01A4
|
||||
/* 07F288 800E5DD8 AE020000 */ sw $v0, ($s0)
|
||||
.L800E5DDC:
|
||||
/* 07F28C 800E5DDC 8E040004 */ lw $a0, 4($s0)
|
||||
/* 07F290 800E5DE0 30824000 */ andi $v0, $a0, 0x4000
|
||||
/* 07F294 800E5DE4 1040000C */ beqz $v0, .L800E5E18
|
||||
/* 07F298 800E5DE8 2A22000C */ slti $v0, $s1, 0xc
|
||||
/* 07F29C 800E5DEC 10400059 */ beqz $v0, .L800E5F54
|
||||
/* 07F2A0 800E5DF0 00000000 */ nop
|
||||
/* 07F2A4 800E5DF4 06200057 */ bltz $s1, .L800E5F54
|
||||
/* 07F2A8 800E5DF8 3C038000 */ lui $v1, 0x8000
|
||||
/* 07F2AC 800E5DFC 920200B4 */ lbu $v0, 0xb4($s0)
|
||||
/* 07F2B0 800E5E00 A20200B5 */ sb $v0, 0xb5($s0)
|
||||
/* 07F2B4 800E5E04 8E020000 */ lw $v0, ($s0)
|
||||
/* 07F2B8 800E5E08 A21100B4 */ sb $s1, 0xb4($s0)
|
||||
/* 07F2BC 800E5E0C 00431025 */ or $v0, $v0, $v1
|
||||
/* 07F2C0 800E5E10 080397D5 */ j .L800E5F54
|
||||
/* 07F2C4 800E5E14 AE020000 */ sw $v0, ($s0)
|
||||
|
||||
.L800E5E18:
|
||||
/* 07F2C8 800E5E18 24020015 */ addiu $v0, $zero, 0x15
|
||||
/* 07F2CC 800E5E1C 12220003 */ beq $s1, $v0, .L800E5E2C
|
||||
/* 07F2D0 800E5E20 24020017 */ addiu $v0, $zero, 0x17
|
||||
/* 07F2D4 800E5E24 1622001A */ bne $s1, $v0, .L800E5E90
|
||||
/* 07F2D8 800E5E28 24020011 */ addiu $v0, $zero, 0x11
|
||||
.L800E5E2C:
|
||||
/* 07F2DC 800E5E2C 820300BF */ lb $v1, 0xbf($s0)
|
||||
/* 07F2E0 800E5E30 24020003 */ addiu $v0, $zero, 3
|
||||
/* 07F2E4 800E5E34 50620001 */ beql $v1, $v0, .L800E5E3C
|
||||
/* 07F2E8 800E5E38 24110015 */ addiu $s1, $zero, 0x15
|
||||
.L800E5E3C:
|
||||
/* 07F2EC 800E5E3C 3C028011 */ lui $v0, 0x8011
|
||||
/* 07F2F0 800E5E40 2442F290 */ addiu $v0, $v0, -0xd70
|
||||
/* 07F2F4 800E5E44 90430012 */ lbu $v1, 0x12($v0)
|
||||
/* 07F2F8 800E5E48 2462FFF9 */ addiu $v0, $v1, -7
|
||||
/* 07F2FC 800E5E4C 2C420002 */ sltiu $v0, $v0, 2
|
||||
/* 07F300 800E5E50 14400005 */ bnez $v0, .L800E5E68
|
||||
/* 07F304 800E5E54 00031600 */ sll $v0, $v1, 0x18
|
||||
/* 07F308 800E5E58 00021603 */ sra $v0, $v0, 0x18
|
||||
/* 07F30C 800E5E5C 24030004 */ addiu $v1, $zero, 4
|
||||
/* 07F310 800E5E60 1443000B */ bne $v0, $v1, .L800E5E90
|
||||
/* 07F314 800E5E64 24020011 */ addiu $v0, $zero, 0x11
|
||||
.L800E5E68:
|
||||
/* 07F318 800E5E68 3C028011 */ lui $v0, 0x8011
|
||||
/* 07F31C 800E5E6C 8042EBB0 */ lb $v0, -0x1450($v0)
|
||||
/* 07F320 800E5E70 10400006 */ beqz $v0, .L800E5E8C
|
||||
/* 07F324 800E5E74 34830004 */ ori $v1, $a0, 4
|
||||
/* 07F328 800E5E78 8E020000 */ lw $v0, ($s0)
|
||||
/* 07F32C 800E5E7C AE030004 */ sw $v1, 4($s0)
|
||||
/* 07F330 800E5E80 34420800 */ ori $v0, $v0, 0x800
|
||||
/* 07F334 800E5E84 080397D5 */ j .L800E5F54
|
||||
/* 07F338 800E5E88 AE020000 */ sw $v0, ($s0)
|
||||
|
||||
.L800E5E8C:
|
||||
/* 07F33C 800E5E8C 24020011 */ addiu $v0, $zero, 0x11
|
||||
.L800E5E90:
|
||||
/* 07F340 800E5E90 16220007 */ bne $s1, $v0, .L800E5EB0
|
||||
/* 07F344 800E5E94 2403BFFF */ addiu $v1, $zero, -0x4001
|
||||
/* 07F348 800E5E98 8E020000 */ lw $v0, ($s0)
|
||||
/* 07F34C 800E5E9C A6000012 */ sh $zero, 0x12($s0)
|
||||
/* 07F350 800E5EA0 34420010 */ ori $v0, $v0, 0x10
|
||||
/* 07F354 800E5EA4 AE020000 */ sw $v0, ($s0)
|
||||
/* 07F358 800E5EA8 00431024 */ and $v0, $v0, $v1
|
||||
/* 07F35C 800E5EAC AE020000 */ sw $v0, ($s0)
|
||||
.L800E5EB0:
|
||||
/* 07F360 800E5EB0 920200B4 */ lbu $v0, 0xb4($s0)
|
||||
/* 07F364 800E5EB4 A20200B5 */ sb $v0, 0xb5($s0)
|
||||
/* 07F368 800E5EB8 2402001F */ addiu $v0, $zero, 0x1f
|
||||
/* 07F36C 800E5EBC 52220001 */ beql $s1, $v0, .L800E5EC4
|
||||
/* 07F370 800E5EC0 A20000B5 */ sb $zero, 0xb5($s0)
|
||||
.L800E5EC4:
|
||||
/* 07F374 800E5EC4 2402001B */ addiu $v0, $zero, 0x1b
|
||||
/* 07F378 800E5EC8 16220004 */ bne $s1, $v0, .L800E5EDC
|
||||
/* 07F37C 800E5ECC 00000000 */ nop
|
||||
/* 07F380 800E5ED0 8E020004 */ lw $v0, 4($s0)
|
||||
/* 07F384 800E5ED4 34420004 */ ori $v0, $v0, 4
|
||||
/* 07F388 800E5ED8 AE020004 */ sw $v0, 4($s0)
|
||||
.L800E5EDC:
|
||||
/* 07F38C 800E5EDC 8E030000 */ lw $v1, ($s0)
|
||||
/* 07F390 800E5EE0 3C028000 */ lui $v0, 0x8000
|
||||
/* 07F394 800E5EE4 A21100B4 */ sb $s1, 0xb4($s0)
|
||||
/* 07F398 800E5EE8 00622825 */ or $a1, $v1, $v0
|
||||
/* 07F39C 800E5EEC 820300B4 */ lb $v1, 0xb4($s0)
|
||||
/* 07F3A0 800E5EF0 2402001A */ addiu $v0, $zero, 0x1a
|
||||
/* 07F3A4 800E5EF4 10620017 */ beq $v1, $v0, .L800E5F54
|
||||
/* 07F3A8 800E5EF8 AE050000 */ sw $a1, ($s0)
|
||||
/* 07F3AC 800E5EFC 3C02FFFD */ lui $v0, 0xfffd
|
||||
/* 07F3B0 800E5F00 3442FFFF */ ori $v0, $v0, 0xffff
|
||||
/* 07F3B4 800E5F04 3C04FFFE */ lui $a0, 0xfffe
|
||||
/* 07F3B8 800E5F08 3484FFFF */ ori $a0, $a0, 0xffff
|
||||
/* 07F3BC 800E5F0C 00A21024 */ and $v0, $a1, $v0
|
||||
/* 07F3C0 800E5F10 3C038011 */ lui $v1, 0x8011
|
||||
/* 07F3C4 800E5F14 2463F250 */ addiu $v1, $v1, -0xdb0
|
||||
/* 07F3C8 800E5F18 AE020000 */ sw $v0, ($s0)
|
||||
/* 07F3CC 800E5F1C 8E020004 */ lw $v0, 4($s0)
|
||||
/* 07F3D0 800E5F20 8C630030 */ lw $v1, 0x30($v1)
|
||||
/* 07F3D4 800E5F24 00441024 */ and $v0, $v0, $a0
|
||||
/* 07F3D8 800E5F28 10600003 */ beqz $v1, .L800E5F38
|
||||
/* 07F3DC 800E5F2C AE020004 */ sw $v0, 4($s0)
|
||||
/* 07F3E0 800E5F30 0C05271B */ jal stop_sound
|
||||
/* 07F3E4 800E5F34 0060202D */ daddu $a0, $v1, $zero
|
||||
.L800E5F38:
|
||||
/* 07F3E8 800E5F38 8E0200D8 */ lw $v0, 0xd8($s0)
|
||||
/* 07F3EC 800E5F3C 10400005 */ beqz $v0, .L800E5F54
|
||||
/* 07F3F0 800E5F40 00000000 */ nop
|
||||
/* 07F3F4 800E5F44 8C43000C */ lw $v1, 0xc($v0)
|
||||
/* 07F3F8 800E5F48 2402000A */ addiu $v0, $zero, 0xa
|
||||
/* 07F3FC 800E5F4C AC620024 */ sw $v0, 0x24($v1)
|
||||
/* 07F400 800E5F50 AE0000D8 */ sw $zero, 0xd8($s0)
|
||||
.L800E5F54:
|
||||
/* 07F404 800E5F54 8FBF0018 */ lw $ra, 0x18($sp)
|
||||
/* 07F408 800E5F58 8FB10014 */ lw $s1, 0x14($sp)
|
||||
/* 07F40C 800E5F5C 8FB00010 */ lw $s0, 0x10($sp)
|
||||
/* 07F410 800E5F60 03E00008 */ jr $ra
|
||||
/* 07F414 800E5F64 27BD0020 */ addiu $sp, $sp, 0x20
|
||||
|
@ -67,7 +67,7 @@ if __name__ == "__main__":
|
||||
exit(1)
|
||||
elif "--delete-matched" in argv or input("Delete them [y/N]? ").upper() == "Y":
|
||||
for func in matched_but_undeleted_asm:
|
||||
file = glob(path.join(DIR, f"../asm/nonmatchings/*/{func}.s"))[0]
|
||||
file = glob(path.join(DIR, f"asm/nonmatchings/*/{func}.s"))[0]
|
||||
remove(file)
|
||||
elif len(asm) != len(non_matched):
|
||||
print(f"warning: number of INCLUDE_ASM macros ({len(asm)}) != number of asm files ({len(non_matched)})")
|
||||
|
@ -105,7 +105,7 @@ typedef struct PlayerData {
|
||||
/* 0x00F */ u8 starPieces;
|
||||
/* 0x010 */ s8 starPoints;
|
||||
/* 0x011 */ char unk_11;
|
||||
/* 0x012 */ u8 currentPartner;
|
||||
/* 0x012 */ s8 currentPartner;
|
||||
/* 0x013 */ char unk_13;
|
||||
/* 0x014 */ struct PartnerData partners[12];
|
||||
/* 0x074 */ s16 keyItems[32];
|
||||
@ -1339,7 +1339,7 @@ typedef struct PlayerStatus {
|
||||
/* 0x044 */ f32 decorationPos[2];
|
||||
/* 0x04C */ char unk_4C[4];
|
||||
/* 0x050 */ f32 jumpApexHeight;
|
||||
/* 0x054 */ s32 currentSpeed;
|
||||
/* 0x054 */ f32 currentSpeed;
|
||||
/* 0x058 */ f32 walkSpeed;
|
||||
/* 0x05C */ f32 runSpeed;
|
||||
/* 0x060 */ char unk_60[8];
|
||||
@ -1366,7 +1366,8 @@ typedef struct PlayerStatus {
|
||||
/* 0x0C0 */ u32* decorationList;
|
||||
/* 0x0C4 */ char unk_C4[8];
|
||||
/* 0x0CC */ s32 shadowID;
|
||||
/* 0x0D0 */ char unk_D0[12];
|
||||
/* 0x0D0 */ char unk_D0[8];
|
||||
/* 0x0D8 */ UNK_PTR** unk_D8;
|
||||
/* 0x0DC */ s32 currentButtons;
|
||||
/* 0x0E0 */ s32 pressedButtons;
|
||||
/* 0x0E4 */ s32 heldButtons;
|
||||
|
@ -11,19 +11,18 @@ typedef UNK_TYPE EncounterTriggerFlags;
|
||||
#define EncounterTriggerFlags_HAMMER 0x00000004
|
||||
#define EncounterTriggerFlags_PARTNER 0x00000006
|
||||
|
||||
typedef UNK_TYPE PartnerId;
|
||||
#define PartnerId_NONE 0x00000000
|
||||
#define PartnerId_GOOMBARIO 0x00000001
|
||||
#define PartnerId_KOOPER 0x00000002
|
||||
#define PartnerId_BOMBETTE 0x00000003
|
||||
#define PartnerId_PARAKARRY 0x00000004
|
||||
#define PartnerId_GOOMPA 0x00000005
|
||||
#define PartnerId_WATT 0x00000006
|
||||
#define PartnerId_SUSHIE 0x00000007
|
||||
#define PartnerId_LAKILESTER 0x00000008
|
||||
#define PartnerId_BOW 0x00000009
|
||||
#define PartnerId_GOOMBARIA 0x0000000A
|
||||
#define PartnerId_TWINK 0x0000000B
|
||||
#define PartnerId_NONE 0x00
|
||||
#define PartnerId_GOOMBARIO 0x01
|
||||
#define PartnerId_KOOPER 0x02
|
||||
#define PartnerId_BOMBETTE 0x03
|
||||
#define PartnerId_PARAKARRY 0x04
|
||||
#define PartnerId_GOOMPA 0x05
|
||||
#define PartnerId_WATT 0x06
|
||||
#define PartnerId_SUSHIE 0x07
|
||||
#define PartnerId_LAKILESTER 0x08
|
||||
#define PartnerId_BOW 0x09
|
||||
#define PartnerId_GOOMBARIA 0x0A
|
||||
#define PartnerId_TWINK 0x0B
|
||||
|
||||
typedef UNK_TYPE SpriteId;
|
||||
#define SpriteId_WORLD_GOOMBARIO 0x00000001
|
||||
@ -1236,7 +1235,7 @@ typedef s8 ActionState;
|
||||
#define ActionState_STEP_DOWN 0x00000009
|
||||
#define ActionState_LAND 0x0000000A
|
||||
#define ActionState_STEP_DOWN_LAND 0x0000000B
|
||||
#define ActionState_CONVERSATION 0x0000000C
|
||||
#define ActionState_CONVERSATION 0x0000000C // This and following states prohibit normal movement.
|
||||
#define ActionState_SPIN_JUMP 0x0000000D
|
||||
#define ActionState_GROUND_POUND 0x0000000E
|
||||
#define ActionState_ULTRA_JUMP 0x0000000F
|
||||
|
@ -83,5 +83,7 @@ extern UNK_TYPE D_80147474;
|
||||
extern UNK_TYPE D_80147574;
|
||||
extern UNK_TYPE D_80109270;
|
||||
extern UNK_TYPE D_80108558;
|
||||
extern UNK_TYPE D_8010F250; // play_sound state struct?
|
||||
extern s8 D_8010EBB0;
|
||||
|
||||
#endif
|
||||
|
@ -4,7 +4,20 @@ INCLUDE_ASM("code_7bb60_len_41b0", func_800E26B0);
|
||||
|
||||
INCLUDE_ASM("code_7bb60_len_41b0", func_800E26C4);
|
||||
|
||||
INCLUDE_ASM("code_7bb60_len_41b0", move_player);
|
||||
void set_action_state(s32 actionState);
|
||||
|
||||
void move_player(s16 duration, f32 heading, f32 speed) {
|
||||
PlayerStatus* player_status = &gPlayerStatus;
|
||||
|
||||
player_status->flags = player_status->flags | 0x4000;
|
||||
player_status->heading = heading;
|
||||
player_status->moveFrames = duration;
|
||||
player_status->currentSpeed = speed;
|
||||
|
||||
if (!(player_status->animFlags & 0x00400000)) {
|
||||
set_action_state(speed > player_status->walkSpeed ? ActionState_RUN : ActionState_WALK);
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM("code_7bb60_len_41b0", func_800E27E0);
|
||||
|
||||
@ -70,7 +83,78 @@ INCLUDE_ASM("code_7bb60_len_41b0", func_800E5A2C);
|
||||
|
||||
INCLUDE_ASM("code_7bb60_len_41b0", func_800E5C78);
|
||||
|
||||
INCLUDE_ASM("code_7bb60_len_41b0", set_action_state);
|
||||
void set_action_state(s32 actionState) {
|
||||
PlayerStatus* player_status = &gPlayerStatus;
|
||||
PlayerData* player_data = &gPlayerData;
|
||||
UNK_TYPE* unknown_struct = &D_8010F250;
|
||||
|
||||
if (player_status->flags & 0x200) {
|
||||
player_status->flags &= ~0x200;
|
||||
func_800E01A4();
|
||||
}
|
||||
|
||||
if (player_status->animFlags & 0x4000) {
|
||||
if (actionState < ActionState_CONVERSATION) {
|
||||
if (actionState >= 0) {
|
||||
player_status->prevActionState = player_status->actionState;
|
||||
player_status->actionState = actionState;
|
||||
player_status->flags |= 0x80000000;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (actionState == ActionState_HIT_HAZARD || actionState == ActionState_HIT_LAVA) {
|
||||
u8 partner;
|
||||
|
||||
if (player_status->unk_BF == 3) {
|
||||
actionState = ActionState_HIT_HAZARD;
|
||||
}
|
||||
|
||||
// Whilst Lakilester, Bow, or Parakarry's ability is active, hazards have no effect.
|
||||
partner = player_data->currentPartner;
|
||||
if ((partner - 7) < 2u || (s8)partner == PartnerId_PARAKARRY) {
|
||||
if (D_8010EBB0) {
|
||||
player_status->animFlags |= 0x4;
|
||||
player_status->flags |= 0x800;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (actionState == ActionState_SLIDING) {
|
||||
player_status->flags |= 0x10;
|
||||
player_status->moveFrames = 0;
|
||||
player_status->flags &= ~0x4000;
|
||||
}
|
||||
|
||||
player_status->prevActionState = player_status->actionState;
|
||||
if (actionState == ActionState_USE_TWEESTER) {
|
||||
player_status->prevActionState = ActionState_IDLE;
|
||||
}
|
||||
|
||||
if (actionState == ActionState_ENEMY_FIRST_STRIKE) {
|
||||
player_status->animFlags |= 4;
|
||||
}
|
||||
player_status->actionState = actionState;
|
||||
player_status->flags |= 0x80000000;
|
||||
|
||||
if (player_status->actionState == ActionState_SPIN) {
|
||||
return;
|
||||
}
|
||||
|
||||
player_status->flags &= 0xFFFDFFFF;
|
||||
player_status->animFlags &= 0xFFFEFFFF;
|
||||
|
||||
if (unknown_struct[0xC]) {
|
||||
stop_sound(unknown_struct[0xC]);
|
||||
}
|
||||
|
||||
if (player_status->unk_D8) {
|
||||
player_status->unk_D8[3][9] = 0xA;
|
||||
player_status->unk_D8 = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM("code_7bb60_len_41b0", update_locomotion_state);
|
||||
|
||||
@ -80,7 +164,23 @@ INCLUDE_ASM("code_7bb60_len_41b0", start_bounce_a);
|
||||
|
||||
INCLUDE_ASM("code_7bb60_len_41b0", start_bounce_b);
|
||||
|
||||
INCLUDE_ASM("code_7bb60_len_41b0", check_input_hammer);
|
||||
s32 check_input_hammer(void) {
|
||||
PlayerStatus* player_status = &gPlayerStatus;
|
||||
PlayerData* player_data = &gPlayerData;
|
||||
|
||||
if (player_status->pressedButtons & Buttons_B) {
|
||||
if (!(player_status->flags & 4)) {
|
||||
if (D_8010EBB0 != 1 || player_data->currentPartner != PartnerId_WATT) {
|
||||
if (player_data->hammerLevel != -1) {
|
||||
set_action_state(ActionState_HAMMER);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
INCLUDE_ASM("code_7bb60_len_41b0", check_input_jump);
|
||||
|
||||
|
@ -11,6 +11,8 @@ gCurrentScriptListPtr = 0x802DA890;
|
||||
gGlobalTimeSpace = 0x802D9CA8;
|
||||
gPlayerNpcPtr = 0x802D9D20;
|
||||
D_80147574 = 0x80147574;
|
||||
D_8010EBB0 = 0x8010EBB0;
|
||||
D_8010F250 = 0x8010F250;
|
||||
|
||||
gMapTransitionAlpha = 0x800A0940;
|
||||
D_800E92D8 = 0x800E92D8;
|
||||
|
Loading…
Reference in New Issue
Block a user