mirror of https://github.com/zeldaret/tmc.git
Decompile most of leftover playerItem3
This commit is contained in:
parent
fdff9eb12c
commit
ae4bea3554
|
@ -1,203 +0,0 @@
|
||||||
.ifdef EU
|
|
||||||
.syntax unified
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
ldr r3, _0801B564 @ =gPlayerState
|
|
||||||
str r4, [r3, #0x2c]
|
|
||||||
movs r2, #0
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
ldr r0, _0801B568 @ =gUnk_081271CC
|
|
||||||
str r0, [r4, #0x48]
|
|
||||||
movs r0, #0xff
|
|
||||||
strb r0, [r4, #0x1e]
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x80
|
|
||||||
strb r2, [r0]
|
|
||||||
ldr r5, _0801B56C @ =gPlayerEntity
|
|
||||||
adds r0, r5, #0
|
|
||||||
adds r0, #0x60
|
|
||||||
ldrh r1, [r0]
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x60
|
|
||||||
strh r1, [r0]
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x58
|
|
||||||
movs r0, #0xb
|
|
||||||
strb r0, [r1]
|
|
||||||
str r5, [r4, #0x50]
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x86
|
|
||||||
strh r2, [r0]
|
|
||||||
ldrb r1, [r4, #0x14]
|
|
||||||
movs r0, #2
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0801B550
|
|
||||||
ldrb r0, [r5, #0x18]
|
|
||||||
lsls r0, r0, #0x19
|
|
||||||
lsrs r0, r0, #0x1f
|
|
||||||
movs r1, #1
|
|
||||||
bics r1, r0
|
|
||||||
lsls r1, r1, #6
|
|
||||||
ldrb r2, [r4, #0x18]
|
|
||||||
movs r0, #0x41
|
|
||||||
rsbs r0, r0, #0
|
|
||||||
ands r0, r2
|
|
||||||
orrs r0, r1
|
|
||||||
strb r0, [r4, #0x18]
|
|
||||||
_0801B550:
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x68
|
|
||||||
ldrb r0, [r0]
|
|
||||||
cmp r0, #0xc
|
|
||||||
bne _0801B570
|
|
||||||
movs r0, #0xa0
|
|
||||||
lsls r0, r0, #2
|
|
||||||
strh r0, [r4, #0x24]
|
|
||||||
movs r0, #0x3c
|
|
||||||
b _0801B578
|
|
||||||
.align 2, 0
|
|
||||||
_0801B564: .4byte gPlayerState
|
|
||||||
_0801B568: .4byte gUnk_081271CC
|
|
||||||
_0801B56C: .4byte gPlayerEntity
|
|
||||||
_0801B570:
|
|
||||||
movs r0, #0x80
|
|
||||||
lsls r0, r0, #2
|
|
||||||
strh r0, [r4, #0x24]
|
|
||||||
movs r0, #0x1e
|
|
||||||
_0801B578:
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
ldrb r1, [r3, #0xd]
|
|
||||||
movs r0, #0xd
|
|
||||||
ldrsb r0, [r3, r0]
|
|
||||||
cmp r0, #0
|
|
||||||
blt _0801B588
|
|
||||||
strb r1, [r4, #0x15]
|
|
||||||
b _0801B58E
|
|
||||||
_0801B588:
|
|
||||||
ldrb r0, [r4, #0x14]
|
|
||||||
lsls r0, r0, #2
|
|
||||||
strb r0, [r4, #0x15]
|
|
||||||
_0801B58E:
|
|
||||||
ldrb r0, [r4, #0x15]
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x83
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x38
|
|
||||||
ldrb r0, [r0]
|
|
||||||
cmp r0, #2
|
|
||||||
bne _0801B5A4
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r4, #0xb]
|
|
||||||
_0801B5A4:
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #1
|
|
||||||
movs r2, #3
|
|
||||||
bl LoadSwapGFX
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0801766C
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0801B584
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
.syntax divided
|
|
||||||
.else
|
|
||||||
.syntax unified
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
ldr r3, _0801B52C @ =gPlayerState
|
|
||||||
str r4, [r3, #0x2c]
|
|
||||||
movs r2, #0
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
ldr r0, _0801B530 @ =gUnk_081271CC
|
|
||||||
str r0, [r4, #0x48]
|
|
||||||
movs r0, #0xff
|
|
||||||
strb r0, [r4, #0x1e]
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x80
|
|
||||||
strb r2, [r0]
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x58
|
|
||||||
movs r0, #0xb
|
|
||||||
strb r0, [r1]
|
|
||||||
ldr r5, _0801B534 @ =gPlayerEntity
|
|
||||||
str r5, [r4, #0x50]
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x86
|
|
||||||
strh r2, [r0]
|
|
||||||
ldrb r1, [r4, #0x14]
|
|
||||||
movs r0, #2
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0801B518
|
|
||||||
ldrb r0, [r5, #0x18]
|
|
||||||
lsls r0, r0, #0x19
|
|
||||||
lsrs r0, r0, #0x1f
|
|
||||||
movs r1, #1
|
|
||||||
bics r1, r0
|
|
||||||
lsls r1, r1, #6
|
|
||||||
ldrb r2, [r4, #0x18]
|
|
||||||
movs r0, #0x41
|
|
||||||
rsbs r0, r0, #0
|
|
||||||
ands r0, r2
|
|
||||||
orrs r0, r1
|
|
||||||
strb r0, [r4, #0x18]
|
|
||||||
_0801B518:
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x68
|
|
||||||
ldrb r0, [r0]
|
|
||||||
cmp r0, #0xc
|
|
||||||
bne _0801B538
|
|
||||||
movs r0, #0xa0
|
|
||||||
lsls r0, r0, #2
|
|
||||||
strh r0, [r4, #0x24]
|
|
||||||
movs r0, #0x3c
|
|
||||||
b _0801B540
|
|
||||||
.align 2, 0
|
|
||||||
_0801B52C: .4byte gPlayerState
|
|
||||||
_0801B530: .4byte gUnk_081271CC
|
|
||||||
_0801B534: .4byte gPlayerEntity
|
|
||||||
_0801B538:
|
|
||||||
movs r0, #0x80
|
|
||||||
lsls r0, r0, #2
|
|
||||||
strh r0, [r4, #0x24]
|
|
||||||
movs r0, #0x1e
|
|
||||||
_0801B540:
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
ldrb r1, [r3, #0xd]
|
|
||||||
movs r0, #0xd
|
|
||||||
ldrsb r0, [r3, r0]
|
|
||||||
cmp r0, #0
|
|
||||||
blt _0801B550
|
|
||||||
strb r1, [r4, #0x15]
|
|
||||||
b _0801B556
|
|
||||||
_0801B550:
|
|
||||||
ldrb r0, [r4, #0x14]
|
|
||||||
lsls r0, r0, #2
|
|
||||||
strb r0, [r4, #0x15]
|
|
||||||
_0801B556:
|
|
||||||
ldrb r0, [r4, #0x15]
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x83
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x38
|
|
||||||
ldrb r0, [r0]
|
|
||||||
cmp r0, #2
|
|
||||||
bne _0801B56C
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r4, #0xb]
|
|
||||||
_0801B56C:
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #1
|
|
||||||
movs r2, #3
|
|
||||||
bl LoadSwapGFX
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0801766C
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0801B584
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
.syntax divided
|
|
||||||
.endif
|
|
|
@ -1,127 +0,0 @@
|
||||||
.syntax unified
|
|
||||||
push {r4, r5, r6, r7, lr}
|
|
||||||
adds r6, r0, #0
|
|
||||||
bl sub_0801B804
|
|
||||||
ldr r1, _0801B5F8 @ =gPlayerState
|
|
||||||
ldrb r0, [r1, #4]
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0801B5A8
|
|
||||||
ldrb r0, [r1, #0x1a]
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0801B5A8
|
|
||||||
ldr r0, [r1, #0x2c]
|
|
||||||
cmp r0, r6
|
|
||||||
bne _0801B5B4
|
|
||||||
ldr r0, _0801B5FC @ =gPlayerEntity
|
|
||||||
ldrb r0, [r0, #0xc]
|
|
||||||
cmp r0, #1
|
|
||||||
beq _0801B5B8
|
|
||||||
_0801B5A8:
|
|
||||||
ldr r1, _0801B5F8 @ =gPlayerState
|
|
||||||
ldr r0, [r1, #0x2c]
|
|
||||||
cmp r0, r6
|
|
||||||
bne _0801B5B4
|
|
||||||
movs r0, #0
|
|
||||||
str r0, [r1, #0x2c]
|
|
||||||
_0801B5B4:
|
|
||||||
bl DeleteThisEntity
|
|
||||||
_0801B5B8:
|
|
||||||
ldr r7, _0801B5FC @ =gPlayerEntity
|
|
||||||
adds r0, r7, #0
|
|
||||||
adds r0, #0x5a
|
|
||||||
ldrb r1, [r0]
|
|
||||||
movs r3, #1
|
|
||||||
movs r0, #1
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0801B600
|
|
||||||
adds r0, r6, #0
|
|
||||||
adds r0, #0x68
|
|
||||||
ldrb r0, [r0]
|
|
||||||
movs r2, #0
|
|
||||||
cmp r0, #0xc
|
|
||||||
bne _0801B5D8
|
|
||||||
movs r2, #6
|
|
||||||
_0801B5D8:
|
|
||||||
lsrs r0, r1, #4
|
|
||||||
adds r1, r0, r2
|
|
||||||
ldrb r0, [r6, #0x1e]
|
|
||||||
cmp r0, r1
|
|
||||||
beq _0801B5EE
|
|
||||||
strb r1, [r6, #0x1e]
|
|
||||||
ldrb r1, [r6, #0x1e]
|
|
||||||
ldrh r2, [r6, #0x12]
|
|
||||||
adds r0, r6, #0
|
|
||||||
bl sub_080042D0
|
|
||||||
_0801B5EE:
|
|
||||||
adds r0, r6, #0
|
|
||||||
adds r1, r7, #0
|
|
||||||
bl sub_08078E84
|
|
||||||
b _0801B674
|
|
||||||
.align 2, 0
|
|
||||||
_0801B5F8: .4byte gPlayerState
|
|
||||||
_0801B5FC: .4byte gPlayerEntity
|
|
||||||
_0801B600:
|
|
||||||
movs r5, #0
|
|
||||||
movs r0, #2
|
|
||||||
strb r0, [r6, #0xc]
|
|
||||||
adds r1, r6, #0
|
|
||||||
adds r1, #0x60
|
|
||||||
movs r0, #0xd5
|
|
||||||
strh r0, [r1]
|
|
||||||
ldrb r0, [r6, #0x10]
|
|
||||||
movs r4, #0x80
|
|
||||||
orrs r0, r4
|
|
||||||
strb r0, [r6, #0x10]
|
|
||||||
subs r1, #0x24
|
|
||||||
ldrb r0, [r1]
|
|
||||||
orrs r0, r3
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r0, r7, #0
|
|
||||||
adds r0, #0x3b
|
|
||||||
ldrb r0, [r0]
|
|
||||||
adds r2, r6, #0
|
|
||||||
adds r2, #0x3b
|
|
||||||
strb r0, [r2]
|
|
||||||
movs r0, #0xa6
|
|
||||||
strh r0, [r6, #0x12]
|
|
||||||
ldrb r1, [r6, #0x18]
|
|
||||||
subs r0, #0xe7
|
|
||||||
ands r0, r1
|
|
||||||
movs r1, #4
|
|
||||||
rsbs r1, r1, #0
|
|
||||||
ands r0, r1
|
|
||||||
orrs r0, r3
|
|
||||||
strb r0, [r6, #0x18]
|
|
||||||
ldrb r1, [r6, #0x14]
|
|
||||||
lsrs r1, r1, #1
|
|
||||||
lsls r1, r1, #1
|
|
||||||
ldr r2, _0801B678 @ =gUnk_080B7826
|
|
||||||
adds r0, r1, r2
|
|
||||||
ldrb r0, [r0]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
asrs r0, r0, #0x18
|
|
||||||
ldrh r3, [r6, #0x2e]
|
|
||||||
adds r0, r0, r3
|
|
||||||
strh r0, [r6, #0x2e]
|
|
||||||
adds r1, #1
|
|
||||||
adds r1, r1, r2
|
|
||||||
movs r0, #0
|
|
||||||
ldrsb r0, [r1, r0]
|
|
||||||
ldrh r1, [r6, #0x32]
|
|
||||||
adds r0, r0, r1
|
|
||||||
strh r0, [r6, #0x32]
|
|
||||||
adds r0, r6, #0
|
|
||||||
movs r1, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
ldr r0, _0801B67C @ =gPlayerState
|
|
||||||
str r5, [r0, #0x2c]
|
|
||||||
ldrb r1, [r0, #4]
|
|
||||||
orrs r4, r1
|
|
||||||
strb r4, [r0, #4]
|
|
||||||
_0801B674:
|
|
||||||
pop {r4, r5, r6, r7, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_0801B678: .4byte gUnk_080B7826
|
|
||||||
_0801B67C: .4byte gPlayerState
|
|
||||||
.syntax divided
|
|
|
@ -1,54 +0,0 @@
|
||||||
.syntax unified
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r5, r0, #0
|
|
||||||
movs r0, #0xc
|
|
||||||
bl IsItemEquipped
|
|
||||||
cmp r0, #1
|
|
||||||
beq _0801B820
|
|
||||||
cmp r0, #1
|
|
||||||
blo _0801B81C
|
|
||||||
cmp r0, #2
|
|
||||||
beq _0801B824
|
|
||||||
b _0801B826
|
|
||||||
_0801B81C:
|
|
||||||
movs r4, #1
|
|
||||||
b _0801B826
|
|
||||||
_0801B820:
|
|
||||||
movs r4, #2
|
|
||||||
b _0801B826
|
|
||||||
_0801B824:
|
|
||||||
movs r4, #0
|
|
||||||
_0801B826:
|
|
||||||
ldr r3, _0801B850 @ =gPlayerState
|
|
||||||
adds r0, r3, #0
|
|
||||||
adds r0, #0x90
|
|
||||||
ldrh r0, [r0]
|
|
||||||
ands r4, r0
|
|
||||||
cmp r4, #0
|
|
||||||
bne _0801B854
|
|
||||||
adds r1, r5, #0
|
|
||||||
adds r1, #0x80
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r1]
|
|
||||||
ldrb r2, [r3, #0xa]
|
|
||||||
movs r1, #0x7f
|
|
||||||
adds r0, r1, #0
|
|
||||||
ands r0, r2
|
|
||||||
strb r0, [r3, #0xa]
|
|
||||||
ldrb r0, [r3, #0xb]
|
|
||||||
ands r1, r0
|
|
||||||
strb r1, [r3, #0xb]
|
|
||||||
b _0801B862
|
|
||||||
.align 2, 0
|
|
||||||
_0801B850: .4byte gPlayerState
|
|
||||||
_0801B854:
|
|
||||||
ldrb r1, [r3, #0xa]
|
|
||||||
movs r0, #0x80
|
|
||||||
orrs r1, r0
|
|
||||||
strb r1, [r3, #0xa]
|
|
||||||
ldrb r1, [r3, #0xb]
|
|
||||||
orrs r0, r1
|
|
||||||
strb r0, [r3, #0xb]
|
|
||||||
_0801B862:
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
.syntax divided
|
|
|
@ -20860,21 +20860,6 @@
|
||||||
"start": 751604,
|
"start": 751604,
|
||||||
"size": 8
|
"size": 8
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "playerItem3/gUnk_080B77FC.bin",
|
|
||||||
"start": 751628,
|
|
||||||
"size": 26
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "playerItem3/gUnk_080B7826.bin",
|
|
||||||
"start": 751654,
|
|
||||||
"size": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "playerItem3/gUnk_080B782E.bin",
|
|
||||||
"start": 751662,
|
|
||||||
"size": 18
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "playerItemC/gUnk_080B7848.bin",
|
"path": "playerItemC/gUnk_080B7848.bin",
|
||||||
"start": 751688,
|
"start": 751688,
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
.include "asm/macros.inc"
|
|
||||||
.include "constants/constants.inc"
|
|
||||||
|
|
||||||
.section .rodata
|
|
||||||
.align 2
|
|
||||||
|
|
||||||
gUnk_080B77FC:: @ 080B77FC
|
|
||||||
.4byte sub_0801B4C8
|
|
||||||
.4byte sub_0801B584
|
|
||||||
.4byte sub_0801B680
|
|
||||||
.4byte sub_0801B7A8
|
|
||||||
.incbin "playerItem3/gUnk_080B77FC.bin"
|
|
||||||
|
|
||||||
gUnk_080B7826:: @ 080B7826
|
|
||||||
.incbin "playerItem3/gUnk_080B7826.bin"
|
|
||||||
|
|
||||||
gUnk_080B782E:: @ 080B782E
|
|
||||||
.incbin "playerItem3/gUnk_080B782E.bin"
|
|
|
@ -931,7 +931,7 @@ SECTIONS {
|
||||||
data/const/playerItem/playerItemSwordBeam.o(.rodata);
|
data/const/playerItem/playerItemSwordBeam.o(.rodata);
|
||||||
data/data_080B4410.o(.rodata);
|
data/data_080B4410.o(.rodata);
|
||||||
data/const/playerItem/playerItemBomb.o(.rodata);
|
data/const/playerItem/playerItemBomb.o(.rodata);
|
||||||
data/const/playerItem/playerItem3.o(.rodata);
|
src/playerItem/playerItem3.o(.rodata);
|
||||||
data/const/playerItem/playerItemC.o(.rodata);
|
data/const/playerItem/playerItemC.o(.rodata);
|
||||||
data/const/playerItem/playerItemSwordSpin.o(.rodata);
|
data/const/playerItem/playerItemSwordSpin.o(.rodata);
|
||||||
data/data_080B7910.o(.rodata);
|
data/data_080B7910.o(.rodata);
|
||||||
|
|
|
@ -1,17 +1,32 @@
|
||||||
#include "entity.h"
|
#include "entity.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
|
#include "asm.h"
|
||||||
extern void (*const gUnk_080B77FC[])(Entity*);
|
|
||||||
|
|
||||||
void sub_0801B804(Entity*);
|
void sub_0801B804(Entity*);
|
||||||
void sub_0801B864(Entity*);
|
Entity* sub_0801B864(Entity*);
|
||||||
|
void sub_0801B584(Entity*);
|
||||||
|
void PlayerItem3_Init(Entity*);
|
||||||
|
void sub_0801B680(Entity*);
|
||||||
|
void sub_0801B7A8(Entity*);
|
||||||
|
|
||||||
extern s8 gUnk_080B782E[];
|
extern Entity* sub_08008782(Entity*, u32, s32, s32);
|
||||||
extern void sub_08008782(Entity*, u32, s32, s32);
|
extern bool32 sub_080040E2(Entity*, u8*);
|
||||||
|
extern Hitbox gUnk_081271CC;
|
||||||
|
extern u8 gUnk_08003E44;
|
||||||
|
|
||||||
void PlayerItem3(Entity* this) {
|
void PlayerItem3(Entity* this) {
|
||||||
gUnk_080B77FC[this->action](this);
|
static void (*const PlayerItem3_Actions[])(Entity*) = {
|
||||||
|
PlayerItem3_Init,
|
||||||
|
sub_0801B584,
|
||||||
|
sub_0801B680,
|
||||||
|
sub_0801B7A8,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Unused
|
||||||
|
static const u16 gUnk_080B780C[] = { 0x75, 0x1, 0x76, 0x1, 0x3ac, 0x1, 0x4050, 0x1, 0x377, 0x1, 0x378, 0x1, 0x0 };
|
||||||
|
|
||||||
|
PlayerItem3_Actions[this->action](this);
|
||||||
if (this->animIndex != 0xb) {
|
if (this->animIndex != 0xb) {
|
||||||
if (this->animationState == 6) {
|
if (this->animationState == 6) {
|
||||||
this->field_0x86.HWORD += 0x2000;
|
this->field_0x86.HWORD += 0x2000;
|
||||||
|
@ -27,11 +42,148 @@ void PlayerItem3(Entity* this) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ASM_FUNC("asm/non_matching/playerItem3/sub_0801B4C8.inc", void sub_0801B4C8(Entity* this))
|
void PlayerItem3_Init(Entity* this) {
|
||||||
|
u32 uVar1;
|
||||||
|
|
||||||
ASM_FUNC("asm/non_matching/playerItem3/sub_0801B584.inc", void sub_0801B584(Entity* this))
|
gPlayerState.item = this;
|
||||||
|
this->action = 1;
|
||||||
|
this->hitbox = &gUnk_081271CC;
|
||||||
|
this->frameIndex = 0xff;
|
||||||
|
this->field_0x80.HALF.LO = 0;
|
||||||
|
#ifdef EU
|
||||||
|
this->spriteVramOffset = gPlayerEntity.spriteVramOffset;
|
||||||
|
#endif
|
||||||
|
this->animIndex = 11;
|
||||||
|
this->parent = &gPlayerEntity;
|
||||||
|
this->field_0x86.HWORD = 0;
|
||||||
|
if ((this->animationState & 2) != 0) {
|
||||||
|
this->spriteSettings.flipX = ~gPlayerEntity.spriteSettings.flipX;
|
||||||
|
}
|
||||||
|
if (this->field_0x68.HALF.LO == 12) {
|
||||||
|
this->speed = 0x280;
|
||||||
|
uVar1 = 60;
|
||||||
|
} else {
|
||||||
|
this->speed = 0x200;
|
||||||
|
uVar1 = 30;
|
||||||
|
}
|
||||||
|
this->actionDelay = uVar1;
|
||||||
|
if (((s8)gPlayerState.field_0xd) >= 0) {
|
||||||
|
this->direction = gPlayerState.field_0xd;
|
||||||
|
} else {
|
||||||
|
this->direction = this->animationState << 2;
|
||||||
|
}
|
||||||
|
this->field_0x82.HALF.HI = this->direction;
|
||||||
|
if (this->collisionLayer == 2) {
|
||||||
|
this->type2 = 1;
|
||||||
|
}
|
||||||
|
LoadSwapGFX(this, 1, 3);
|
||||||
|
sub_0801766C(this);
|
||||||
|
sub_0801B584(this);
|
||||||
|
}
|
||||||
|
|
||||||
ASM_FUNC("asm/non_matching/playerItem3/sub_0801B680.inc", void sub_0801B680(Entity* this))
|
void sub_0801B584(Entity* this) {
|
||||||
|
static const s8 gUnk_080B7826[] = { 0, -8, 8, -4, 0, 8, -8, -4 };
|
||||||
|
u32 frameIndex;
|
||||||
|
int iVar2;
|
||||||
|
u32 cVar3;
|
||||||
|
|
||||||
|
sub_0801B804(this);
|
||||||
|
if ((gPlayerState.field_0x3[1] == 0) || (gPlayerState.mobility != 0) || gPlayerState.item != this ||
|
||||||
|
(gPlayerState.item == this && gPlayerEntity.action != 1)) {
|
||||||
|
if (gPlayerState.item == this) {
|
||||||
|
gPlayerState.item = NULL;
|
||||||
|
}
|
||||||
|
DeleteThisEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((gPlayerEntity.frame & 1) == 0) {
|
||||||
|
if (this->field_0x68.HALF.LO == 12) {
|
||||||
|
cVar3 = 6;
|
||||||
|
} else {
|
||||||
|
cVar3 = 0;
|
||||||
|
}
|
||||||
|
frameIndex = (gPlayerEntity.frame >> 4) + cVar3;
|
||||||
|
if (this->frameIndex != frameIndex) {
|
||||||
|
this->frameIndex = frameIndex;
|
||||||
|
sub_080042D0(this, this->frameIndex, this->spriteIndex);
|
||||||
|
}
|
||||||
|
sub_08078E84(this, &gPlayerEntity);
|
||||||
|
} else {
|
||||||
|
this->action = 2;
|
||||||
|
this->spriteVramOffset = 0xd5;
|
||||||
|
COLLISION_ON(this);
|
||||||
|
this->field_0x3c |= 1;
|
||||||
|
this->flags2 = gPlayerEntity.flags2;
|
||||||
|
this->spriteIndex = 0xa6;
|
||||||
|
this->spriteSettings.flipX = 0;
|
||||||
|
this->spriteSettings.draw = 1;
|
||||||
|
|
||||||
|
iVar2 = (this->animationState >> 1) * 2;
|
||||||
|
this->x.HALF.HI += gUnk_080B7826[iVar2];
|
||||||
|
this->y.HALF.HI += gUnk_080B7826[iVar2 + 1];
|
||||||
|
InitializeAnimation(this, 0);
|
||||||
|
gPlayerState.item = NULL;
|
||||||
|
gPlayerState.field_0x3[1] |= 0x80;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NONMATCH("asm/non_matching/playerItem3/sub_0801B680.inc", void sub_0801B680(Entity* this)) {
|
||||||
|
u32 uvar1;
|
||||||
|
u32 uVar6;
|
||||||
|
|
||||||
|
sub_0801B804(this);
|
||||||
|
if ((this->field_0x68.HALF.LO == 12) && (this->field_0x80.HALF.LO == 0) && ((gPlayerState.field_0xd & 0x80) == 0)) {
|
||||||
|
;
|
||||||
|
if (((this->field_0x82.HALF.HI - gPlayerState.field_0xd) & 0x1f) > 0x10) {
|
||||||
|
this->field_0x82.HWORD += 0x40;
|
||||||
|
} else {
|
||||||
|
this->field_0x82.HWORD -= 0x40;
|
||||||
|
}
|
||||||
|
this->field_0x82.HALF.HI &= 0x1f;
|
||||||
|
this->direction = this->field_0x82.HALF.HI;
|
||||||
|
}
|
||||||
|
LinearMoveUpdate(this);
|
||||||
|
uVar6 = 0;
|
||||||
|
if (sub_0801B864(this) != 0) {
|
||||||
|
uvar1 = (this->field_0x68.HALF.LO);
|
||||||
|
uvar1 ^= 0xc;
|
||||||
|
uVar6 = ((u32)(-uvar1 | uvar1)) >> 0x1f;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sub_080002F0(COORD_TO_TILE(this), gPlayerEntity.collisionLayer, 0x80) == 0) {
|
||||||
|
if (uVar6 == 0) {
|
||||||
|
uVar6 = sub_080040E2(this, &gUnk_08003E44);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (uVar6 == 0) {
|
||||||
|
if (--this->actionDelay < 0xc) {
|
||||||
|
this->speed = this->speed + -0x10;
|
||||||
|
}
|
||||||
|
if (this->actionDelay == '\0') {
|
||||||
|
uVar6 = 1;
|
||||||
|
}
|
||||||
|
if ((this->bitfield & 0x80) != 0) {
|
||||||
|
uVar6 = 1;
|
||||||
|
}
|
||||||
|
if (uVar6 == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this->field_0x68.HALF.LO == 12) {
|
||||||
|
this->actionDelay = 30;
|
||||||
|
} else {
|
||||||
|
this->actionDelay = 12;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this->actionDelay = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (uVar6 != 0) {
|
||||||
|
this->action = this->action + 1;
|
||||||
|
this->speed = 0x1c0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
END_NONMATCH
|
||||||
|
|
||||||
void sub_0801B7A8(Entity* this) {
|
void sub_0801B7A8(Entity* this) {
|
||||||
sub_0801B804(this);
|
sub_0801B804(this);
|
||||||
|
@ -50,14 +202,40 @@ void sub_0801B7A8(Entity* this) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ASM_FUNC("asm/non_matching/playerItem3/sub_0801B804.inc", void sub_0801B804(Entity* this))
|
void sub_0801B804(Entity* this) {
|
||||||
|
u32 itemSlot;
|
||||||
|
u32 uVar1;
|
||||||
|
|
||||||
void sub_0801B864(Entity* this) {
|
itemSlot = IsItemEquipped(0xc);
|
||||||
|
switch (itemSlot) {
|
||||||
|
case 0:
|
||||||
|
uVar1 = 1;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
uVar1 = 2;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
uVar1 = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((uVar1 & gPlayerState.field_0x90) == 0) {
|
||||||
|
this->field_0x80.HALF.LO = 1;
|
||||||
|
gPlayerState.field_0xa &= 0x7f;
|
||||||
|
gPlayerState.keepFacing &= 0x7f;
|
||||||
|
} else {
|
||||||
|
gPlayerState.field_0xa |= 0x80;
|
||||||
|
gPlayerState.keepFacing |= 0x80;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Entity* sub_0801B864(Entity* this) {
|
||||||
|
static const s8 gUnk_080B782E[] = { 0, -6, 4, -4, 4, 0, 4, 4, 0, 4, -4, 4, -4, 0, -4, 0, 0, 0 };
|
||||||
s32 iVar1;
|
s32 iVar1;
|
||||||
|
|
||||||
if (this->type2 == 0) {
|
if (this->type2 == 0) {
|
||||||
sub_0800451C(this);
|
sub_0800451C(this);
|
||||||
}
|
}
|
||||||
iVar1 = (this->direction >> 2) * 2;
|
iVar1 = (this->direction >> 2) * 2;
|
||||||
sub_08008782(this, 2, gUnk_080B782E[iVar1], gUnk_080B782E[iVar1 + 1]);
|
return sub_08008782(this, 2, gUnk_080B782E[iVar1], gUnk_080B782E[iVar1 + 1]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue