mirror of https://github.com/zeldaret/tmc.git
decompile rollobite
This commit is contained in:
parent
a8dd952f31
commit
e9f980bef5
735
asm/rollobite.s
735
asm/rollobite.s
|
@ -1,735 +0,0 @@
|
||||||
.include "asm/macros.inc"
|
|
||||||
|
|
||||||
.include "constants/constants.inc"
|
|
||||||
|
|
||||||
.syntax unified
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
|
|
||||||
thumb_func_start Rollobite
|
|
||||||
Rollobite: @ 0x08020638
|
|
||||||
push {lr}
|
|
||||||
ldr r1, _08020644 @ =gUnk_080CA66C
|
|
||||||
bl EnemyFunctionHandler
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08020644: .4byte gUnk_080CA66C
|
|
||||||
|
|
||||||
thumb_func_start sub_08020648
|
|
||||||
sub_08020648: @ 0x08020648
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
bl sub_08020AD0
|
|
||||||
ldr r1, _08020664 @ =gUnk_080CA684
|
|
||||||
ldrb r0, [r4, #0xc]
|
|
||||||
lsls r0, r0, #2
|
|
||||||
adds r0, r0, r1
|
|
||||||
ldr r1, [r0]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl _call_via_r1
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08020664: .4byte gUnk_080CA684
|
|
||||||
|
|
||||||
thumb_func_start sub_08020668
|
|
||||||
sub_08020668: @ 0x08020668
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
adds r2, r4, #0
|
|
||||||
adds r2, #0x3f
|
|
||||||
ldrb r0, [r2]
|
|
||||||
cmp r0, #0x22
|
|
||||||
bne _080206A2
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x45
|
|
||||||
ldrb r0, [r1]
|
|
||||||
cmp r0, #0xff
|
|
||||||
beq _080206A2
|
|
||||||
movs r0, #4
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
movs r0, #0x80
|
|
||||||
lsls r0, r0, #0xa
|
|
||||||
str r0, [r4, #0x20]
|
|
||||||
movs r0, #0xff
|
|
||||||
strb r0, [r4, #0x15]
|
|
||||||
movs r0, #1
|
|
||||||
rsbs r0, r0, #0
|
|
||||||
strb r0, [r1]
|
|
||||||
movs r0, #0x23
|
|
||||||
strb r0, [r2]
|
|
||||||
ldrb r1, [r4, #0x14]
|
|
||||||
adds r1, #8
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
_080206A2:
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x41
|
|
||||||
ldrb r1, [r0]
|
|
||||||
adds r5, r0, #0
|
|
||||||
cmp r1, #0x80
|
|
||||||
beq _080206D0
|
|
||||||
ldrb r0, [r4, #0xc]
|
|
||||||
subs r0, #4
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
lsrs r0, r0, #0x18
|
|
||||||
cmp r0, #1
|
|
||||||
bhi _080206D0
|
|
||||||
movs r0, #4
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
movs r0, #0xb4
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
movs r0, #0xff
|
|
||||||
strb r0, [r4, #0x15]
|
|
||||||
ldrb r1, [r4, #0x14]
|
|
||||||
adds r1, #0x10
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
_080206D0:
|
|
||||||
ldrb r0, [r5]
|
|
||||||
cmp r0, #0x93
|
|
||||||
bne _080206DC
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08020648
|
|
||||||
_080206DC:
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_080206E0
|
|
||||||
sub_080206E0: @ 0x080206E0
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
bl sub_08020AD0
|
|
||||||
cmp r0, #0
|
|
||||||
beq _080206F6
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x42
|
|
||||||
movs r0, #0
|
|
||||||
strb r0, [r1]
|
|
||||||
b _08020730
|
|
||||||
_080206F6:
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08020B6C
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0802072A
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x42
|
|
||||||
ldrb r0, [r1]
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r5, r4, #0
|
|
||||||
adds r5, #0x3e
|
|
||||||
ldrb r1, [r5]
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r2, #0xa
|
|
||||||
bl sub_080AE58C
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x46
|
|
||||||
ldrh r1, [r0]
|
|
||||||
ldrb r2, [r5]
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r3, #0xa
|
|
||||||
bl sub_080AE7E8
|
|
||||||
b _08020730
|
|
||||||
_0802072A:
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08001324
|
|
||||||
_08020730:
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_08020734
|
|
||||||
sub_08020734: @ 0x08020734
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
ldrb r0, [r4, #0xd]
|
|
||||||
cmp r0, #2
|
|
||||||
bhi _08020764
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0806F520
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08020764
|
|
||||||
movs r0, #4
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
ldrb r1, [r4, #0x10]
|
|
||||||
movs r0, #0x80
|
|
||||||
orrs r0, r1
|
|
||||||
strb r0, [r4, #0x10]
|
|
||||||
movs r0, #0xff
|
|
||||||
strb r0, [r4, #0x15]
|
|
||||||
ldrb r1, [r4, #0x14]
|
|
||||||
adds r1, #0x10
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
b _08020774
|
|
||||||
_08020764:
|
|
||||||
ldr r0, _08020778 @ =gUnk_080CA6A4
|
|
||||||
ldrb r1, [r4, #0xd]
|
|
||||||
lsls r1, r1, #2
|
|
||||||
adds r1, r1, r0
|
|
||||||
ldr r1, [r1]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl _call_via_r1
|
|
||||||
_08020774:
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08020778: .4byte gUnk_080CA6A4
|
|
||||||
|
|
||||||
thumb_func_start sub_0802077C
|
|
||||||
sub_0802077C: @ 0x0802077C
|
|
||||||
movs r1, #1
|
|
||||||
strb r1, [r0, #0xd]
|
|
||||||
movs r1, #0x3c
|
|
||||||
strb r1, [r0, #0x1d]
|
|
||||||
bx lr
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_08020788
|
|
||||||
sub_08020788: @ 0x08020788
|
|
||||||
push {lr}
|
|
||||||
bl sub_0806F4E8
|
|
||||||
pop {pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_08020790
|
|
||||||
sub_08020790: @ 0x08020790
|
|
||||||
push {lr}
|
|
||||||
bl sub_0806F3E4
|
|
||||||
pop {pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_08020798
|
|
||||||
sub_08020798: @ 0x08020798
|
|
||||||
ldrb r2, [r0, #0x10]
|
|
||||||
movs r1, #0x7f
|
|
||||||
ands r1, r2
|
|
||||||
strb r1, [r0, #0x10]
|
|
||||||
bx lr
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start nullsub_6
|
|
||||||
nullsub_6: @ 0x080207A4
|
|
||||||
bx lr
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_080207A8
|
|
||||||
sub_080207A8: @ 0x080207A8
|
|
||||||
push {lr}
|
|
||||||
movs r3, #4
|
|
||||||
movs r1, #4
|
|
||||||
strb r1, [r0, #0xc]
|
|
||||||
ldrb r2, [r0, #0x10]
|
|
||||||
movs r1, #0x80
|
|
||||||
orrs r1, r2
|
|
||||||
strb r1, [r0, #0x10]
|
|
||||||
movs r1, #0x29
|
|
||||||
adds r1, r1, r0
|
|
||||||
mov ip, r1
|
|
||||||
ldrb r2, [r1]
|
|
||||||
movs r1, #8
|
|
||||||
rsbs r1, r1, #0
|
|
||||||
ands r1, r2
|
|
||||||
orrs r1, r3
|
|
||||||
mov r2, ip
|
|
||||||
strb r1, [r2]
|
|
||||||
adds r3, r0, #0
|
|
||||||
adds r3, #0x3a
|
|
||||||
ldrb r2, [r3]
|
|
||||||
movs r1, #0xfb
|
|
||||||
ands r1, r2
|
|
||||||
strb r1, [r3]
|
|
||||||
ldrb r1, [r0, #0x15]
|
|
||||||
movs r2, #0x10
|
|
||||||
eors r1, r2
|
|
||||||
strb r1, [r0, #0x15]
|
|
||||||
movs r1, #0xc0
|
|
||||||
lsls r1, r1, #9
|
|
||||||
str r1, [r0, #0x20]
|
|
||||||
movs r1, #0x80
|
|
||||||
strh r1, [r0, #0x24]
|
|
||||||
ldrb r1, [r0, #0x14]
|
|
||||||
adds r1, #0x10
|
|
||||||
bl InitializeAnimation
|
|
||||||
pop {pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_080207F4
|
|
||||||
sub_080207F4: @ 0x080207F4
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
bl sub_0804A720
|
|
||||||
movs r1, #0
|
|
||||||
movs r0, #0x30
|
|
||||||
strb r0, [r4, #0x16]
|
|
||||||
movs r0, #0x12
|
|
||||||
strb r0, [r4, #0x1c]
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x84
|
|
||||||
strb r1, [r0]
|
|
||||||
bl Random
|
|
||||||
movs r1, #0x18
|
|
||||||
ands r0, r1
|
|
||||||
strb r0, [r4, #0x15]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08020A30
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_08020820
|
|
||||||
sub_08020820: @ 0x08020820
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
bl GetNextFrame
|
|
||||||
adds r2, r4, #0
|
|
||||||
adds r2, #0x5a
|
|
||||||
ldrb r1, [r2]
|
|
||||||
movs r5, #1
|
|
||||||
adds r0, r5, #0
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0802084A
|
|
||||||
movs r0, #0xfe
|
|
||||||
ands r0, r1
|
|
||||||
strb r0, [r2]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_080AEF88
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0802084A
|
|
||||||
strb r5, [r4, #0xe]
|
|
||||||
_0802084A:
|
|
||||||
adds r2, r4, #0
|
|
||||||
adds r2, #0x5a
|
|
||||||
ldrb r1, [r2]
|
|
||||||
movs r0, #0x10
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
beq _08020872
|
|
||||||
movs r0, #0xef
|
|
||||||
ands r0, r1
|
|
||||||
strb r0, [r2]
|
|
||||||
ldrb r0, [r4, #0xe]
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08020872
|
|
||||||
movs r0, #3
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
movs r0, #0x3c
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
_08020872:
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_08020874
|
|
||||||
sub_08020874: @ 0x08020874
|
|
||||||
push {lr}
|
|
||||||
ldr r2, _08020888 @ =gUnk_080CA6BC
|
|
||||||
ldrb r1, [r0, #0xd]
|
|
||||||
lsls r1, r1, #2
|
|
||||||
adds r1, r1, r2
|
|
||||||
ldr r1, [r1]
|
|
||||||
bl _call_via_r1
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08020888: .4byte gUnk_080CA6BC
|
|
||||||
|
|
||||||
thumb_func_start sub_0802088C
|
|
||||||
sub_0802088C: @ 0x0802088C
|
|
||||||
movs r1, #1
|
|
||||||
strb r1, [r0, #0xd]
|
|
||||||
ldrb r2, [r0, #0x10]
|
|
||||||
movs r1, #0x7f
|
|
||||||
ands r1, r2
|
|
||||||
strb r1, [r0, #0x10]
|
|
||||||
ldr r1, _080208B0 @ =gPlayerEntity
|
|
||||||
ldrb r1, [r1, #0x14]
|
|
||||||
adds r2, r0, #0
|
|
||||||
adds r2, #0x85
|
|
||||||
strb r1, [r2]
|
|
||||||
adds r0, #0x29
|
|
||||||
ldrb r2, [r0]
|
|
||||||
movs r1, #0x39
|
|
||||||
rsbs r1, r1, #0
|
|
||||||
ands r1, r2
|
|
||||||
strb r1, [r0]
|
|
||||||
bx lr
|
|
||||||
.align 2, 0
|
|
||||||
_080208B0: .4byte gPlayerEntity
|
|
||||||
|
|
||||||
thumb_func_start sub_080208B4
|
|
||||||
sub_080208B4: @ 0x080208B4
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r2, r0, #0
|
|
||||||
adds r4, r2, #0
|
|
||||||
adds r4, #0x85
|
|
||||||
ldrb r0, [r4]
|
|
||||||
ldr r5, _080208EC @ =gPlayerEntity
|
|
||||||
ldrb r1, [r5, #0x14]
|
|
||||||
subs r0, r0, r1
|
|
||||||
lsrs r1, r0, #0x1f
|
|
||||||
adds r0, r0, r1
|
|
||||||
asrs r0, r0, #1
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
lsrs r1, r0, #0x18
|
|
||||||
cmp r0, #0
|
|
||||||
beq _080208E6
|
|
||||||
ldrb r0, [r2, #0x14]
|
|
||||||
adds r0, r0, r1
|
|
||||||
movs r1, #3
|
|
||||||
ands r0, r1
|
|
||||||
strb r0, [r2, #0x14]
|
|
||||||
ldrb r1, [r2, #0x14]
|
|
||||||
adds r1, #0x10
|
|
||||||
adds r0, r2, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
_080208E6:
|
|
||||||
ldrb r0, [r5, #0x14]
|
|
||||||
strb r0, [r4]
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_080208EC: .4byte gPlayerEntity
|
|
||||||
|
|
||||||
thumb_func_start sub_080208F0
|
|
||||||
sub_080208F0: @ 0x080208F0
|
|
||||||
adds r0, #0x29
|
|
||||||
ldrb r2, [r0]
|
|
||||||
movs r1, #0x39
|
|
||||||
rsbs r1, r1, #0
|
|
||||||
ands r1, r2
|
|
||||||
movs r2, #0x18
|
|
||||||
orrs r1, r2
|
|
||||||
strb r1, [r0]
|
|
||||||
bx lr
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_08020904
|
|
||||||
sub_08020904: @ 0x08020904
|
|
||||||
push {lr}
|
|
||||||
movs r1, #4
|
|
||||||
strb r1, [r0, #0xc]
|
|
||||||
ldrb r2, [r0, #0x10]
|
|
||||||
movs r1, #0x80
|
|
||||||
orrs r1, r2
|
|
||||||
strb r1, [r0, #0x10]
|
|
||||||
movs r1, #0xff
|
|
||||||
strb r1, [r0, #0x15]
|
|
||||||
ldrb r1, [r0, #0x14]
|
|
||||||
adds r1, #0x10
|
|
||||||
bl InitializeAnimation
|
|
||||||
pop {pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_08020920
|
|
||||||
sub_08020920: @ 0x08020920
|
|
||||||
push {lr}
|
|
||||||
adds r1, r0, #0
|
|
||||||
ldrb r0, [r1, #0xe]
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r1, #0xe]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08020936
|
|
||||||
adds r0, r1, #0
|
|
||||||
bl sub_08020A30
|
|
||||||
_08020936:
|
|
||||||
pop {pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_08020938
|
|
||||||
sub_08020938: @ 0x08020938
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
adds r0, #0x5a
|
|
||||||
ldrb r1, [r0]
|
|
||||||
movs r5, #0x80
|
|
||||||
adds r0, r5, #0
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08020950
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl GetNextFrame
|
|
||||||
_08020950:
|
|
||||||
movs r1, #0xa0
|
|
||||||
lsls r1, r1, #6
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_080044EC
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08020980
|
|
||||||
ldrb r0, [r4, #0xe]
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08020978
|
|
||||||
movs r0, #5
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
ldrb r1, [r4, #0x14]
|
|
||||||
adds r1, #0xc
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
_08020978:
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08078930
|
|
||||||
b _0802099C
|
|
||||||
_08020980:
|
|
||||||
cmp r0, #1
|
|
||||||
bne _0802098C
|
|
||||||
movs r0, #0x82
|
|
||||||
lsls r0, r0, #1
|
|
||||||
bl sub_08004488
|
|
||||||
_0802098C:
|
|
||||||
ldrb r1, [r4, #0x15]
|
|
||||||
adds r0, r5, #0
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0802099C
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_080AEFE0
|
|
||||||
_0802099C:
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_080209A0
|
|
||||||
sub_080209A0: @ 0x080209A0
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
bl GetNextFrame
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x5a
|
|
||||||
ldrb r1, [r0]
|
|
||||||
movs r0, #0x80
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
beq _080209E2
|
|
||||||
ldrb r1, [r4, #0x10]
|
|
||||||
movs r0, #0x80
|
|
||||||
orrs r0, r1
|
|
||||||
strb r0, [r4, #0x10]
|
|
||||||
movs r0, #0x80
|
|
||||||
lsls r0, r0, #1
|
|
||||||
strh r0, [r4, #0x24]
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x3f
|
|
||||||
movs r0, #0x22
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08020A30
|
|
||||||
ldrb r0, [r4, #0x14]
|
|
||||||
lsls r0, r0, #3
|
|
||||||
strb r0, [r4, #0x15]
|
|
||||||
ldrb r1, [r4, #0x14]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
b _080209F0
|
|
||||||
_080209E2:
|
|
||||||
movs r0, #1
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
bne _080209F0
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08078930
|
|
||||||
_080209F0:
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_080209F4
|
|
||||||
sub_080209F4: @ 0x080209F4
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
movs r1, #0xe0
|
|
||||||
lsls r1, r1, #5
|
|
||||||
bl sub_08003FC4
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08020A14
|
|
||||||
movs r1, #7
|
|
||||||
movs r0, #7
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
adds r2, r4, #0
|
|
||||||
adds r2, #0x29
|
|
||||||
ldrb r0, [r2]
|
|
||||||
orrs r0, r1
|
|
||||||
strb r0, [r2]
|
|
||||||
_08020A14:
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x5a
|
|
||||||
ldrb r0, [r0]
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08020A24
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl GetNextFrame
|
|
||||||
_08020A24:
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_08020A28
|
|
||||||
sub_08020A28: @ 0x08020A28
|
|
||||||
push {lr}
|
|
||||||
bl GetNextFrame
|
|
||||||
pop {pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_08020A30
|
|
||||||
sub_08020A30: @ 0x08020A30
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
adds r5, r4, #0
|
|
||||||
adds r5, #0x84
|
|
||||||
ldrb r0, [r5]
|
|
||||||
cmp r0, #1
|
|
||||||
bhi _08020A68
|
|
||||||
bl Random
|
|
||||||
ldr r2, _08020A64 @ =gUnk_080CA6CC
|
|
||||||
movs r1, #7
|
|
||||||
ands r1, r0
|
|
||||||
adds r1, r1, r2
|
|
||||||
ldrb r0, [r1]
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08020A68
|
|
||||||
movs r0, #3
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
movs r0, #0x3c
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
ldrb r0, [r5]
|
|
||||||
adds r0, #1
|
|
||||||
strb r0, [r5]
|
|
||||||
b _08020A7A
|
|
||||||
.align 2, 0
|
|
||||||
_08020A64: .4byte gUnk_080CA6CC
|
|
||||||
_08020A68:
|
|
||||||
movs r0, #0
|
|
||||||
movs r1, #1
|
|
||||||
strb r1, [r4, #0xc]
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x84
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08020A7C
|
|
||||||
_08020A7A:
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_08020A7C
|
|
||||||
sub_08020A7C: @ 0x08020A7C
|
|
||||||
push {r4, r5, r6, lr}
|
|
||||||
adds r6, r0, #0
|
|
||||||
bl Random
|
|
||||||
ldrb r5, [r6, #0x15]
|
|
||||||
ldr r4, _08020ACC @ =gUnk_080CA6D4
|
|
||||||
movs r1, #3
|
|
||||||
bl __modsi3
|
|
||||||
adds r0, r0, r4
|
|
||||||
ldrb r0, [r0]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
asrs r0, r0, #0x18
|
|
||||||
adds r5, r5, r0
|
|
||||||
movs r4, #0x18
|
|
||||||
ands r5, r4
|
|
||||||
adds r0, r6, #0
|
|
||||||
bl sub_08049FA0
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08020ABA
|
|
||||||
adds r0, r6, #0
|
|
||||||
bl sub_08049EE4
|
|
||||||
adds r0, #4
|
|
||||||
ands r0, r4
|
|
||||||
movs r1, #0x10
|
|
||||||
eors r1, r5
|
|
||||||
cmp r1, r0
|
|
||||||
bne _08020ABA
|
|
||||||
adds r5, r1, #0
|
|
||||||
_08020ABA:
|
|
||||||
strb r5, [r6, #0x15]
|
|
||||||
lsrs r0, r5, #3
|
|
||||||
strb r0, [r6, #0x14]
|
|
||||||
ldrb r1, [r6, #0x14]
|
|
||||||
adds r0, r6, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
pop {r4, r5, r6, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08020ACC: .4byte gUnk_080CA6D4
|
|
||||||
|
|
||||||
thumb_func_start sub_08020AD0
|
|
||||||
sub_08020AD0: @ 0x08020AD0
|
|
||||||
push {r4, r5, r6, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
bl sub_08020B6C
|
|
||||||
cmp r0, #0
|
|
||||||
beq _08020B68
|
|
||||||
movs r1, #0x36
|
|
||||||
ldrsh r0, [r4, r1]
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08020B68
|
|
||||||
movs r1, #0x2e
|
|
||||||
ldrsh r0, [r4, r1]
|
|
||||||
ldr r3, _08020B5C @ =gRoomControls
|
|
||||||
ldrh r1, [r3, #6]
|
|
||||||
subs r0, r0, r1
|
|
||||||
asrs r5, r0, #4
|
|
||||||
movs r2, #0x3f
|
|
||||||
ands r5, r2
|
|
||||||
movs r1, #0x32
|
|
||||||
ldrsh r0, [r4, r1]
|
|
||||||
ldrh r1, [r3, #8]
|
|
||||||
subs r0, r0, r1
|
|
||||||
asrs r0, r0, #4
|
|
||||||
ands r0, r2
|
|
||||||
lsls r0, r0, #6
|
|
||||||
orrs r5, r0
|
|
||||||
adds r6, r4, #0
|
|
||||||
adds r6, #0x38
|
|
||||||
ldrb r1, [r6]
|
|
||||||
adds r0, r5, #0
|
|
||||||
bl GetTileType
|
|
||||||
lsls r0, r0, #0x10
|
|
||||||
ldr r1, _08020B60 @ =0xFF8F0000
|
|
||||||
adds r0, r0, r1
|
|
||||||
lsrs r0, r0, #0x10
|
|
||||||
cmp r0, #1
|
|
||||||
bhi _08020B68
|
|
||||||
movs r0, #6
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
ldrb r1, [r4, #0x10]
|
|
||||||
movs r0, #0x7f
|
|
||||||
ands r0, r1
|
|
||||||
strb r0, [r4, #0x10]
|
|
||||||
ldrh r2, [r4, #0x2e]
|
|
||||||
movs r1, #0x10
|
|
||||||
rsbs r1, r1, #0
|
|
||||||
adds r0, r1, #0
|
|
||||||
ands r0, r2
|
|
||||||
adds r0, #8
|
|
||||||
strh r0, [r4, #0x2e]
|
|
||||||
ldrh r0, [r4, #0x32]
|
|
||||||
ands r1, r0
|
|
||||||
adds r1, #0xd
|
|
||||||
strh r1, [r4, #0x32]
|
|
||||||
movs r0, #0x80
|
|
||||||
lsls r0, r0, #0xa
|
|
||||||
str r0, [r4, #0x20]
|
|
||||||
ldrb r1, [r4, #0x14]
|
|
||||||
adds r1, #0x14
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
ldr r0, _08020B64 @ =0x00004034
|
|
||||||
ldrb r2, [r6]
|
|
||||||
adds r1, r5, #0
|
|
||||||
bl SetTile
|
|
||||||
movs r0, #1
|
|
||||||
b _08020B6A
|
|
||||||
.align 2, 0
|
|
||||||
_08020B5C: .4byte gRoomControls
|
|
||||||
_08020B60: .4byte 0xFF8F0000
|
|
||||||
_08020B64: .4byte 0x00004034
|
|
||||||
_08020B68:
|
|
||||||
movs r0, #0
|
|
||||||
_08020B6A:
|
|
||||||
pop {r4, r5, r6, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_08020B6C
|
|
||||||
sub_08020B6C: @ 0x08020B6C
|
|
||||||
push {lr}
|
|
||||||
adds r0, #0x58
|
|
||||||
ldrb r0, [r0]
|
|
||||||
subs r0, #0x10
|
|
||||||
cmp r0, #3
|
|
||||||
bls _08020B7C
|
|
||||||
movs r0, #0
|
|
||||||
b _08020B7E
|
|
||||||
_08020B7C:
|
|
||||||
movs r0, #1
|
|
||||||
_08020B7E:
|
|
||||||
pop {pc}
|
|
|
@ -4,99 +4,6 @@
|
||||||
.section .rodata
|
.section .rodata
|
||||||
.align 2
|
.align 2
|
||||||
|
|
||||||
gUnk_080CA66C:: @ 080CA66C
|
|
||||||
.incbin "baserom.gba", 0x0CA66C, 0x0000018
|
|
||||||
|
|
||||||
gUnk_080CA684:: @ 080CA684
|
|
||||||
.incbin "baserom.gba", 0x0CA684, 0x0000020
|
|
||||||
|
|
||||||
gUnk_080CA6A4:: @ 080CA6A4
|
|
||||||
.incbin "baserom.gba", 0x0CA6A4, 0x0000018
|
|
||||||
|
|
||||||
gUnk_080CA6BC:: @ 080CA6BC
|
|
||||||
.incbin "baserom.gba", 0x0CA6BC, 0x0000010
|
|
||||||
|
|
||||||
gUnk_080CA6CC:: @ 080CA6CC
|
|
||||||
.incbin "baserom.gba", 0x0CA6CC, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CA6D4:: @ 080CA6D4
|
|
||||||
.incbin "baserom.gba", 0x0CA6D4, 0x0000003
|
|
||||||
|
|
||||||
gUnk_080CA6D7:: @ 080CA6D7
|
|
||||||
.incbin "baserom.gba", 0x0CA6D7, 0x0000021
|
|
||||||
|
|
||||||
gUnk_080CA6F8:: @ 080CA6F8
|
|
||||||
.incbin "baserom.gba", 0x0CA6F8, 0x0000021
|
|
||||||
|
|
||||||
gUnk_080CA719:: @ 080CA719
|
|
||||||
.incbin "baserom.gba", 0x0CA719, 0x0000021
|
|
||||||
|
|
||||||
gUnk_080CA73A:: @ 080CA73A
|
|
||||||
.incbin "baserom.gba", 0x0CA73A, 0x0000021
|
|
||||||
|
|
||||||
gUnk_080CA75B:: @ 080CA75B
|
|
||||||
.incbin "baserom.gba", 0x0CA75B, 0x0000011
|
|
||||||
|
|
||||||
gUnk_080CA76C:: @ 080CA76C
|
|
||||||
.incbin "baserom.gba", 0x0CA76C, 0x0000011
|
|
||||||
|
|
||||||
gUnk_080CA77D:: @ 080CA77D
|
|
||||||
.incbin "baserom.gba", 0x0CA77D, 0x0000011
|
|
||||||
|
|
||||||
gUnk_080CA78E:: @ 080CA78E
|
|
||||||
.incbin "baserom.gba", 0x0CA78E, 0x0000011
|
|
||||||
|
|
||||||
gUnk_080CA79F:: @ 080CA79F
|
|
||||||
.incbin "baserom.gba", 0x0CA79F, 0x0000058
|
|
||||||
|
|
||||||
gUnk_080CA7F7:: @ 080CA7F7
|
|
||||||
.incbin "baserom.gba", 0x0CA7F7, 0x0000058
|
|
||||||
|
|
||||||
gUnk_080CA84F:: @ 080CA84F
|
|
||||||
.incbin "baserom.gba", 0x0CA84F, 0x0000058
|
|
||||||
|
|
||||||
gUnk_080CA8A7:: @ 080CA8A7
|
|
||||||
.incbin "baserom.gba", 0x0CA8A7, 0x0000058
|
|
||||||
|
|
||||||
gUnk_080CA8FF:: @ 080CA8FF
|
|
||||||
.incbin "baserom.gba", 0x0CA8FF, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CA907:: @ 080CA907
|
|
||||||
.incbin "baserom.gba", 0x0CA907, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CA90F:: @ 080CA90F
|
|
||||||
.incbin "baserom.gba", 0x0CA90F, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CA917:: @ 080CA917
|
|
||||||
.incbin "baserom.gba", 0x0CA917, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CA91F:: @ 080CA91F
|
|
||||||
.incbin "baserom.gba", 0x0CA91F, 0x0000004
|
|
||||||
|
|
||||||
gUnk_080CA923:: @ 080CA923
|
|
||||||
.incbin "baserom.gba", 0x0CA923, 0x0000004
|
|
||||||
|
|
||||||
gUnk_080CA927:: @ 080CA927
|
|
||||||
.incbin "baserom.gba", 0x0CA927, 0x0000004
|
|
||||||
|
|
||||||
gUnk_080CA92B:: @ 080CA92B
|
|
||||||
.incbin "baserom.gba", 0x0CA92B, 0x0000004
|
|
||||||
|
|
||||||
gUnk_080CA92F:: @ 080CA92F
|
|
||||||
.incbin "baserom.gba", 0x0CA92F, 0x0000041
|
|
||||||
|
|
||||||
gUnk_080CA970:: @ 080CA970
|
|
||||||
.incbin "baserom.gba", 0x0CA970, 0x0000041
|
|
||||||
|
|
||||||
gUnk_080CA9B1:: @ 080CA9B1
|
|
||||||
.incbin "baserom.gba", 0x0CA9B1, 0x0000041
|
|
||||||
|
|
||||||
gUnk_080CA9F2:: @ 080CA9F2
|
|
||||||
.incbin "baserom.gba", 0x0CA9F2, 0x0000042
|
|
||||||
|
|
||||||
gUnk_080CAA34:: @ 080CAA34
|
|
||||||
.incbin "baserom.gba", 0x0CAA34, 0x0000064
|
|
||||||
|
|
||||||
gUnk_080CAA98:: @ 080CAA98
|
gUnk_080CAA98:: @ 080CAA98
|
||||||
.incbin "baserom.gba", 0x0CAA98, 0x0000018
|
.incbin "baserom.gba", 0x0CAA98, 0x0000018
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,83 @@
|
||||||
|
.include "asm/macros.inc"
|
||||||
|
.include "constants/constants.inc"
|
||||||
|
|
||||||
|
.section .rodata
|
||||||
|
.align 2
|
||||||
|
|
||||||
|
gUnk_080CA6D4:: @ 080CA6D4
|
||||||
|
.incbin "baserom.gba", 0x0CA6D4, 0x0000003
|
||||||
|
|
||||||
|
gUnk_080CA6D7:: @ 080CA6D7
|
||||||
|
.incbin "baserom.gba", 0x0CA6D7, 0x0000021
|
||||||
|
|
||||||
|
gUnk_080CA6F8:: @ 080CA6F8
|
||||||
|
.incbin "baserom.gba", 0x0CA6F8, 0x0000021
|
||||||
|
|
||||||
|
gUnk_080CA719:: @ 080CA719
|
||||||
|
.incbin "baserom.gba", 0x0CA719, 0x0000021
|
||||||
|
|
||||||
|
gUnk_080CA73A:: @ 080CA73A
|
||||||
|
.incbin "baserom.gba", 0x0CA73A, 0x0000021
|
||||||
|
|
||||||
|
gUnk_080CA75B:: @ 080CA75B
|
||||||
|
.incbin "baserom.gba", 0x0CA75B, 0x0000011
|
||||||
|
|
||||||
|
gUnk_080CA76C:: @ 080CA76C
|
||||||
|
.incbin "baserom.gba", 0x0CA76C, 0x0000011
|
||||||
|
|
||||||
|
gUnk_080CA77D:: @ 080CA77D
|
||||||
|
.incbin "baserom.gba", 0x0CA77D, 0x0000011
|
||||||
|
|
||||||
|
gUnk_080CA78E:: @ 080CA78E
|
||||||
|
.incbin "baserom.gba", 0x0CA78E, 0x0000011
|
||||||
|
|
||||||
|
gUnk_080CA79F:: @ 080CA79F
|
||||||
|
.incbin "baserom.gba", 0x0CA79F, 0x0000058
|
||||||
|
|
||||||
|
gUnk_080CA7F7:: @ 080CA7F7
|
||||||
|
.incbin "baserom.gba", 0x0CA7F7, 0x0000058
|
||||||
|
|
||||||
|
gUnk_080CA84F:: @ 080CA84F
|
||||||
|
.incbin "baserom.gba", 0x0CA84F, 0x0000058
|
||||||
|
|
||||||
|
gUnk_080CA8A7:: @ 080CA8A7
|
||||||
|
.incbin "baserom.gba", 0x0CA8A7, 0x0000058
|
||||||
|
|
||||||
|
gUnk_080CA8FF:: @ 080CA8FF
|
||||||
|
.incbin "baserom.gba", 0x0CA8FF, 0x0000008
|
||||||
|
|
||||||
|
gUnk_080CA907:: @ 080CA907
|
||||||
|
.incbin "baserom.gba", 0x0CA907, 0x0000008
|
||||||
|
|
||||||
|
gUnk_080CA90F:: @ 080CA90F
|
||||||
|
.incbin "baserom.gba", 0x0CA90F, 0x0000008
|
||||||
|
|
||||||
|
gUnk_080CA917:: @ 080CA917
|
||||||
|
.incbin "baserom.gba", 0x0CA917, 0x0000008
|
||||||
|
|
||||||
|
gUnk_080CA91F:: @ 080CA91F
|
||||||
|
.incbin "baserom.gba", 0x0CA91F, 0x0000004
|
||||||
|
|
||||||
|
gUnk_080CA923:: @ 080CA923
|
||||||
|
.incbin "baserom.gba", 0x0CA923, 0x0000004
|
||||||
|
|
||||||
|
gUnk_080CA927:: @ 080CA927
|
||||||
|
.incbin "baserom.gba", 0x0CA927, 0x0000004
|
||||||
|
|
||||||
|
gUnk_080CA92B:: @ 080CA92B
|
||||||
|
.incbin "baserom.gba", 0x0CA92B, 0x0000004
|
||||||
|
|
||||||
|
gUnk_080CA92F:: @ 080CA92F
|
||||||
|
.incbin "baserom.gba", 0x0CA92F, 0x0000041
|
||||||
|
|
||||||
|
gUnk_080CA970:: @ 080CA970
|
||||||
|
.incbin "baserom.gba", 0x0CA970, 0x0000041
|
||||||
|
|
||||||
|
gUnk_080CA9B1:: @ 080CA9B1
|
||||||
|
.incbin "baserom.gba", 0x0CA9B1, 0x0000041
|
||||||
|
|
||||||
|
gUnk_080CA9F2:: @ 080CA9F2
|
||||||
|
.incbin "baserom.gba", 0x0CA9F2, 0x0000042
|
||||||
|
|
||||||
|
gUnk_080CAA34:: @ 080CAA34
|
||||||
|
.incbin "baserom.gba", 0x0CAA34, 0x0000064
|
|
@ -100,7 +100,7 @@ typedef struct Entity {
|
||||||
/*0x43*/ u8 field_0x43;
|
/*0x43*/ u8 field_0x43;
|
||||||
/*0x44*/ u8 field_0x44;
|
/*0x44*/ u8 field_0x44;
|
||||||
/*0x45*/ u8 currentHealth;
|
/*0x45*/ u8 currentHealth;
|
||||||
/*0x46*/ s16 field_0x46;
|
/*0x46*/ u16 field_0x46;
|
||||||
/*0x48*/ BoundingBox* boundingBox;
|
/*0x48*/ BoundingBox* boundingBox;
|
||||||
/*0x4c*/ u8 field_0x4c;
|
/*0x4c*/ u8 field_0x4c;
|
||||||
/*0x4d*/ u8 field_0x4d;
|
/*0x4d*/ u8 field_0x4d;
|
||||||
|
|
|
@ -329,6 +329,7 @@ SECTIONS {
|
||||||
src/enemy/chuchu.o(.text);
|
src/enemy/chuchu.o(.text);
|
||||||
src/enemy/leever.o(.text);
|
src/enemy/leever.o(.text);
|
||||||
src/enemy/peahat.o(.text);
|
src/enemy/peahat.o(.text);
|
||||||
|
src/enemy/rollobite.o(.text);
|
||||||
asm/rollobite.o(.text);
|
asm/rollobite.o(.text);
|
||||||
asm/darkNut.o(.text);
|
asm/darkNut.o(.text);
|
||||||
src/enemy/hangingSeed.o(.text);
|
src/enemy/hangingSeed.o(.text);
|
||||||
|
@ -914,6 +915,8 @@ SECTIONS {
|
||||||
data/leeverAnimations.o(.rodata);
|
data/leeverAnimations.o(.rodata);
|
||||||
src/enemy/peahat.o(.rodata);
|
src/enemy/peahat.o(.rodata);
|
||||||
data/peahatAnimations.o(.rodata);
|
data/peahatAnimations.o(.rodata);
|
||||||
|
src/enemy/rollobite.o(.rodata);
|
||||||
|
data/rollobiteAnimations.o(.rodata);
|
||||||
data/data_080CA66C.o(.rodata);
|
data/data_080CA66C.o(.rodata);
|
||||||
src/enemy.o(.rodata);
|
src/enemy.o(.rodata);
|
||||||
data/data_080D3D94.o(.rodata);
|
data/data_080D3D94.o(.rodata);
|
||||||
|
|
|
@ -0,0 +1,325 @@
|
||||||
|
#include "entity.h"
|
||||||
|
#include "functions.h"
|
||||||
|
|
||||||
|
extern void (*const gUnk_080CA66C[])(Entity*);
|
||||||
|
extern void (*const gUnk_080CA684[])(Entity*);
|
||||||
|
extern void (*const gUnk_080CA6A4[])(Entity*);
|
||||||
|
extern void (*const gUnk_080CA6BC[])(Entity*);
|
||||||
|
|
||||||
|
extern const u8 gUnk_080CA6CC[];
|
||||||
|
extern const s8 gUnk_080CA6D4[];
|
||||||
|
|
||||||
|
void sub_08020A30(Entity*);
|
||||||
|
void sub_08020A7C(Entity*);
|
||||||
|
u32 sub_08020AD0(Entity*);
|
||||||
|
u32 sub_08020B6C(Entity*);
|
||||||
|
|
||||||
|
extern void sub_080AE58C();
|
||||||
|
extern void sub_080AE7E8();
|
||||||
|
extern void sub_08078930();
|
||||||
|
extern s32 GetTileType(s32 tilePosition, s32 layerIndex);
|
||||||
|
|
||||||
|
void Rollobite(Entity* this) {
|
||||||
|
EnemyFunctionHandler(this, gUnk_080CA66C);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08020648(Entity* this) {
|
||||||
|
sub_08020AD0(this);
|
||||||
|
gUnk_080CA684[this->action](this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08020668(Entity* this) {
|
||||||
|
if (this->damageType == 34 && this->currentHealth != 0xff) {
|
||||||
|
this->action = 4;
|
||||||
|
this->field_0x20 = 0x20000;
|
||||||
|
this->direction = -1;
|
||||||
|
this->currentHealth = -1;
|
||||||
|
this->damageType = 35;
|
||||||
|
InitializeAnimation(this, this->animationState + 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->bitfield != 0x80) {
|
||||||
|
u8 tmp = this->action - 4;
|
||||||
|
if (tmp < 2) {
|
||||||
|
this->action = 4;
|
||||||
|
this->actionDelay = -76;
|
||||||
|
this->direction = -1;
|
||||||
|
InitializeAnimation(this, this->animationState + 0x10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->bitfield == 0x93)
|
||||||
|
sub_08020648(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080206E0(Entity* this) {
|
||||||
|
if (sub_08020AD0(this)) {
|
||||||
|
this->field_0x42 = 0;
|
||||||
|
} else {
|
||||||
|
if (sub_08020B6C(this)) {
|
||||||
|
this->field_0x42--;
|
||||||
|
sub_080AE58C(this, this->field_0x3e, 10);
|
||||||
|
sub_080AE7E8(this, this->field_0x46, this->field_0x3e, 10);
|
||||||
|
} else {
|
||||||
|
sub_08001324(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08020734(Entity* this) {
|
||||||
|
if (this->previousActionFlag < 3 && !sub_0806F520(this)) {
|
||||||
|
this->action = 4;
|
||||||
|
this->flags |= 0x80;
|
||||||
|
this->direction = -1;
|
||||||
|
InitializeAnimation(this, this->animationState + 0x10);
|
||||||
|
} else {
|
||||||
|
gUnk_080CA6A4[this->previousActionFlag](this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_0802077C(Entity* this) {
|
||||||
|
this->previousActionFlag = 1;
|
||||||
|
this->field_0x1d = 60;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08020788(Entity* this) {
|
||||||
|
sub_0806F4E8(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08020790(Entity* this) {
|
||||||
|
sub_0806F3E4(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08020798(Entity* this) {
|
||||||
|
this->flags &= ~0x80;
|
||||||
|
}
|
||||||
|
|
||||||
|
void nullsub_6(Entity* this) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080207A8(Entity* this) {
|
||||||
|
this->action = 4;
|
||||||
|
this->flags |= 0x80;
|
||||||
|
this->spritePriority.b0 = 4;
|
||||||
|
this->field_0x3a &= 0xfb;
|
||||||
|
this->direction ^= 0x10;
|
||||||
|
this->field_0x20 = 0x18000;
|
||||||
|
this->nonPlanarMovement = 0x80;
|
||||||
|
InitializeAnimation(this, this->animationState + 0x10);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080207F4(Entity* this) {
|
||||||
|
sub_0804A720(this);
|
||||||
|
this->field_0x16 = 0x30;
|
||||||
|
this->field_0x1c = 18;
|
||||||
|
this->cutsceneBeh.HALF.LO = 0;
|
||||||
|
this->direction = Random() & 0x18;
|
||||||
|
sub_08020A30(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08020820(Entity* this) {
|
||||||
|
GetNextFrame(this);
|
||||||
|
if (this->frames.all & 0x1) {
|
||||||
|
this->frames.all &= ~0x1;
|
||||||
|
if (!sub_080AEF88(this))
|
||||||
|
this->actionDelay = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->frames.all & 0x10) {
|
||||||
|
this->frames.all &= ~0x10;
|
||||||
|
if (--this->actionDelay == 0) {
|
||||||
|
this->action = 3;
|
||||||
|
this->actionDelay = 60;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08020874(Entity* this) {
|
||||||
|
gUnk_080CA6BC[this->previousActionFlag](this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_0802088C(Entity* this) {
|
||||||
|
this->previousActionFlag = 1;
|
||||||
|
this->flags &= ~0x80;
|
||||||
|
this->cutsceneBeh.HALF.HI = gPlayerEntity.animationState;
|
||||||
|
this->spritePriority.b1 = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080208B4(Entity* this) {
|
||||||
|
s8 uVar1 = (this->cutsceneBeh.HALF.HI - gPlayerEntity.animationState) / 2;
|
||||||
|
if (uVar1) {
|
||||||
|
this->animationState = (this->animationState + uVar1) & 3;
|
||||||
|
InitializeAnimation(this, this->animationState + 0x10);
|
||||||
|
}
|
||||||
|
this->cutsceneBeh.HALF.HI = gPlayerEntity.animationState;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080208F0(Entity* this) {
|
||||||
|
this->spritePriority.b1 = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08020904(Entity* this) {
|
||||||
|
this->action = 4;
|
||||||
|
this->flags |= 0x80;
|
||||||
|
this->direction = -1;
|
||||||
|
InitializeAnimation(this, this->animationState + 0x10);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08020920(Entity* this) {
|
||||||
|
if (--this->actionDelay == 0)
|
||||||
|
sub_08020A30(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08020938(Entity* this) {
|
||||||
|
u32 unk;
|
||||||
|
|
||||||
|
if ((this->frames.all & 0x80) == 0)
|
||||||
|
GetNextFrame(this);
|
||||||
|
|
||||||
|
unk = sub_080044EC(this, 0x2800);
|
||||||
|
|
||||||
|
if (unk == 0) {
|
||||||
|
if (--this->actionDelay == 0) {
|
||||||
|
this->action = 5;
|
||||||
|
InitializeAnimation(this, this->animationState + 12);
|
||||||
|
}
|
||||||
|
sub_08078930(this);
|
||||||
|
} else {
|
||||||
|
if (unk == 1)
|
||||||
|
sub_08004488(260);
|
||||||
|
|
||||||
|
if ((this->direction & 0x80) == 0)
|
||||||
|
sub_080AEFE0(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080209A0(Entity* this) {
|
||||||
|
GetNextFrame(this);
|
||||||
|
if (this->frames.all & 0x80) {
|
||||||
|
this->flags |= 0x80;
|
||||||
|
this->nonPlanarMovement = 0x100;
|
||||||
|
this->damageType = 34;
|
||||||
|
sub_08020A30(this);
|
||||||
|
this->direction = this->animationState << 3;
|
||||||
|
InitializeAnimation(this, this->animationState);
|
||||||
|
} else {
|
||||||
|
if ((this->frames.all & 1) == 0)
|
||||||
|
sub_08078930(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080209F4(Entity* this) {
|
||||||
|
if (sub_08003FC4(this, 0x1c00) == 0) {
|
||||||
|
this->action = 7;
|
||||||
|
this->spritePriority.b0 = 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->frames.all == 0)
|
||||||
|
GetNextFrame(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08020A28(Entity* this) {
|
||||||
|
GetNextFrame(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08020A30(Entity* this) {
|
||||||
|
if (this->cutsceneBeh.HALF.LO < 2) {
|
||||||
|
this->actionDelay = gUnk_080CA6CC[Random() & 7];
|
||||||
|
if (this->actionDelay == 0) {
|
||||||
|
this->action = 3;
|
||||||
|
this->actionDelay = 60;
|
||||||
|
this->cutsceneBeh.HALF.LO++;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this->action = 1;
|
||||||
|
this->cutsceneBeh.HALF.LO = 0;
|
||||||
|
sub_08020A7C(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08020A7C(Entity* this) {
|
||||||
|
int tmp = Random();
|
||||||
|
u32 state = (this->direction + gUnk_080CA6D4[tmp % 3]) & 0x18;
|
||||||
|
|
||||||
|
if (sub_08049FA0(this) == 0) {
|
||||||
|
int tmp = (sub_08049EE4(this) + 4) & 0x18;
|
||||||
|
if ((state ^ 0x10) == tmp)
|
||||||
|
state ^= 0x10;
|
||||||
|
}
|
||||||
|
|
||||||
|
this->direction = state;
|
||||||
|
this->animationState = (u8)(state >> 3);
|
||||||
|
InitializeAnimation(this, this->animationState);
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 sub_08020AD0(Entity* this) {
|
||||||
|
if (sub_08020B6C(this) && this->height.HALF.HI == 0) {
|
||||||
|
int tile = COORD_TO_TILE(this);
|
||||||
|
int iVar1 = GetTileType(tile, this->collisionLayer);
|
||||||
|
if ((iVar1 * 0x10000 - 0x710000U) >> 0x10 < 2) {
|
||||||
|
this->action = 6;
|
||||||
|
this->flags &= ~0x80;
|
||||||
|
this->x.HALF.HI &= 0xfff0;
|
||||||
|
this->x.HALF.HI += 8;
|
||||||
|
this->y.HALF.HI &= 0xfff0;
|
||||||
|
this->y.HALF.HI += 13;
|
||||||
|
this->field_0x20 = 0x20000;
|
||||||
|
InitializeAnimation(this, this->animationState + 0x14);
|
||||||
|
SetTile(0x4034, tile, this->collisionLayer);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 sub_08020B6C(Entity* this) {
|
||||||
|
u32 tmp = this->animIndex - 0x10;
|
||||||
|
if (tmp < 4) {
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
void (*const gUnk_080CA66C[])(Entity*) = {
|
||||||
|
sub_08020648,
|
||||||
|
sub_08020668,
|
||||||
|
sub_080206E0,
|
||||||
|
sub_0804A7D4,
|
||||||
|
sub_08001242,
|
||||||
|
sub_08020734,
|
||||||
|
};
|
||||||
|
|
||||||
|
void (*const gUnk_080CA684[])(Entity*) = {
|
||||||
|
sub_080207F4,
|
||||||
|
sub_08020820,
|
||||||
|
sub_08020874,
|
||||||
|
sub_08020920,
|
||||||
|
sub_08020938,
|
||||||
|
sub_080209A0,
|
||||||
|
sub_080209F4,
|
||||||
|
sub_08020A28,
|
||||||
|
};
|
||||||
|
|
||||||
|
void (*const gUnk_080CA6A4[])(Entity*) = {
|
||||||
|
sub_0802077C,
|
||||||
|
sub_08020788,
|
||||||
|
sub_08020790,
|
||||||
|
sub_08020798,
|
||||||
|
nullsub_6,
|
||||||
|
sub_080207A8,
|
||||||
|
};
|
||||||
|
|
||||||
|
void (*const gUnk_080CA6BC[])(Entity*) = {
|
||||||
|
sub_0802088C,
|
||||||
|
sub_080208B4,
|
||||||
|
sub_080208F0,
|
||||||
|
sub_08020904,
|
||||||
|
};
|
||||||
|
|
||||||
|
const u8 gUnk_080CA6CC[] = {
|
||||||
|
0,6,9,0,6,6,0,7
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
Loading…
Reference in New Issue