mirror of https://github.com/zeldaret/tmc.git
commit
74029cb5e0
|
@ -1,717 +0,0 @@
|
|||
.include "asm/macros.inc"
|
||||
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_0803C1E0
|
||||
sub_0803C1E0: @ 0x0803C1E0
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
bl sub_0804A720
|
||||
movs r1, #0
|
||||
movs r2, #1
|
||||
strb r2, [r4, #0xc]
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x7b
|
||||
strb r1, [r0]
|
||||
adds r0, #5
|
||||
strb r1, [r0]
|
||||
adds r0, #3
|
||||
strb r1, [r0]
|
||||
subs r0, #2
|
||||
strb r1, [r0]
|
||||
subs r0, #7
|
||||
strb r1, [r0]
|
||||
adds r0, #8
|
||||
strb r2, [r0]
|
||||
ldrb r0, [r4, #0xe]
|
||||
cmp r0, #0
|
||||
beq _0803C228
|
||||
ldrb r1, [r4, #0xb]
|
||||
lsls r0, r1, #1
|
||||
strb r0, [r4, #0x14]
|
||||
movs r0, #0x1e
|
||||
strb r0, [r4, #0xe]
|
||||
movs r0, #0x80
|
||||
strh r0, [r4, #0x24]
|
||||
lsls r1, r1, #3
|
||||
strb r1, [r4, #0x15]
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C690
|
||||
b _0803C232
|
||||
_0803C228:
|
||||
movs r0, #0x10
|
||||
strb r0, [r4, #0x14]
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C4B0
|
||||
_0803C232:
|
||||
pop {r4, pc}
|
||||
|
||||
thumb_func_start sub_0803C234
|
||||
sub_0803C234: @ 0x0803C234
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x81
|
||||
ldrb r0, [r1]
|
||||
cmp r0, #0
|
||||
beq _0803C246
|
||||
subs r0, #1
|
||||
strb r0, [r1]
|
||||
_0803C246:
|
||||
ldrb r0, [r4, #0xe]
|
||||
subs r0, #1
|
||||
strb r0, [r4, #0xe]
|
||||
movs r3, #0xff
|
||||
lsls r0, r0, #0x18
|
||||
cmp r0, #0
|
||||
bne _0803C292
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x80
|
||||
ldrb r0, [r1]
|
||||
adds r2, r0, #1
|
||||
strb r2, [r1]
|
||||
adds r0, r2, #0
|
||||
ands r0, r3
|
||||
cmp r0, #0xf
|
||||
bls _0803C26E
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C5C4
|
||||
b _0803C2D2
|
||||
_0803C26E:
|
||||
movs r0, #3
|
||||
ands r2, r0
|
||||
cmp r2, #0
|
||||
bne _0803C28A
|
||||
bl Random
|
||||
movs r1, #0x10
|
||||
ands r1, r0
|
||||
cmp r1, #0
|
||||
beq _0803C28A
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C624
|
||||
b _0803C2D2
|
||||
_0803C28A:
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C4B0
|
||||
b _0803C2D2
|
||||
_0803C292:
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C6F8
|
||||
cmp r0, #0
|
||||
beq _0803C2C2
|
||||
ldrh r1, [r4, #0x2a]
|
||||
adds r0, r4, #0
|
||||
bl sub_0800417E
|
||||
ldrb r0, [r4, #0x15]
|
||||
adds r0, #4
|
||||
movs r1, #0x18
|
||||
ands r0, r1
|
||||
asrs r0, r0, #2
|
||||
strb r0, [r4, #0x14]
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x83
|
||||
ldrb r0, [r1]
|
||||
adds r0, #1
|
||||
strb r0, [r1]
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C690
|
||||
b _0803C2D2
|
||||
_0803C2C2:
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C568
|
||||
cmp r0, #0
|
||||
beq _0803C2D2
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C5F0
|
||||
_0803C2D2:
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C6DC
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0803C2DC
|
||||
sub_0803C2DC: @ 0x0803C2DC
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
ldrb r0, [r4, #0xe]
|
||||
subs r0, #1
|
||||
strb r0, [r4, #0xe]
|
||||
lsls r0, r0, #0x18
|
||||
lsrs r1, r0, #0x18
|
||||
cmp r1, #0
|
||||
bne _0803C308
|
||||
movs r0, #3
|
||||
strb r0, [r4, #0xc]
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x82
|
||||
strb r1, [r0]
|
||||
subs r0, #2
|
||||
strb r1, [r0]
|
||||
movs r0, #0x10
|
||||
strb r0, [r4, #0x14]
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C4B0
|
||||
b _0803C31E
|
||||
_0803C308:
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C568
|
||||
cmp r0, #0
|
||||
beq _0803C31E
|
||||
adds r2, r4, #0
|
||||
adds r2, #0x7b
|
||||
ldrb r0, [r2]
|
||||
movs r1, #1
|
||||
orrs r0, r1
|
||||
strb r0, [r2]
|
||||
_0803C31E:
|
||||
ldrb r0, [r4, #0xf]
|
||||
cmp r0, #0xb
|
||||
bls _0803C336
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x7b
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #0
|
||||
beq _0803C33A
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C5F0
|
||||
b _0803C33A
|
||||
_0803C336:
|
||||
adds r0, #1
|
||||
strb r0, [r4, #0xf]
|
||||
_0803C33A:
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C6DC
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0803C344
|
||||
sub_0803C344: @ 0x0803C344
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
ldrb r0, [r4, #0xe]
|
||||
subs r0, #1
|
||||
strb r0, [r4, #0xe]
|
||||
lsls r0, r0, #0x18
|
||||
cmp r0, #0
|
||||
bne _0803C3F8
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x82
|
||||
ldrb r1, [r0]
|
||||
adds r2, r0, #0
|
||||
cmp r1, #5
|
||||
bhi _0803C3C8
|
||||
lsls r0, r1, #2
|
||||
ldr r1, _0803C36C @ =_0803C370
|
||||
adds r0, r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.align 2, 0
|
||||
_0803C36C: .4byte _0803C370
|
||||
_0803C370: @ jump table
|
||||
.4byte _0803C3C8 @ case 0
|
||||
.4byte _0803C3C8 @ case 1
|
||||
.4byte _0803C3A6 @ case 2
|
||||
.4byte _0803C388 @ case 3
|
||||
.4byte _0803C3BE @ case 4
|
||||
.4byte _0803C39C @ case 5
|
||||
_0803C388:
|
||||
movs r0, #4
|
||||
strb r0, [r4, #0xc]
|
||||
movs r0, #0x80
|
||||
strh r0, [r4, #0x24]
|
||||
adds r0, r4, #0
|
||||
movs r1, #1
|
||||
bl sub_08049F84
|
||||
strb r0, [r4, #0x15]
|
||||
b _0803C3E2
|
||||
_0803C39C:
|
||||
movs r0, #4
|
||||
strb r0, [r4, #0xc]
|
||||
movs r0, #0x80
|
||||
strh r0, [r4, #0x24]
|
||||
b _0803C3E2
|
||||
_0803C3A6:
|
||||
movs r1, #0
|
||||
movs r0, #2
|
||||
strb r0, [r4, #0xc]
|
||||
strh r1, [r4, #0x24]
|
||||
bl Random
|
||||
movs r1, #7
|
||||
ands r0, r1
|
||||
lsls r1, r0, #1
|
||||
adds r1, r1, r0
|
||||
adds r1, #0x40
|
||||
b _0803C3E0
|
||||
_0803C3BE:
|
||||
ldrb r0, [r4, #0x15]
|
||||
adds r0, #0x10
|
||||
movs r1, #0x18
|
||||
ands r0, r1
|
||||
strb r0, [r4, #0x15]
|
||||
_0803C3C8:
|
||||
movs r0, #1
|
||||
strb r0, [r4, #0xc]
|
||||
strb r0, [r2]
|
||||
movs r0, #0x80
|
||||
strh r0, [r4, #0x24]
|
||||
bl Random
|
||||
movs r1, #7
|
||||
ands r0, r1
|
||||
lsls r1, r0, #1
|
||||
adds r1, r1, r0
|
||||
adds r1, #0x22
|
||||
_0803C3E0:
|
||||
strb r1, [r4, #0xe]
|
||||
_0803C3E2:
|
||||
movs r0, #0
|
||||
strb r0, [r4, #0xf]
|
||||
ldrb r0, [r4, #0x15]
|
||||
adds r0, #4
|
||||
movs r1, #0x18
|
||||
ands r0, r1
|
||||
asrs r0, r0, #2
|
||||
strb r0, [r4, #0x14]
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C690
|
||||
_0803C3F8:
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C6DC
|
||||
pop {r4, pc}
|
||||
|
||||
thumb_func_start sub_0803C400
|
||||
sub_0803C400: @ 0x0803C400
|
||||
push {r4, r5, lr}
|
||||
adds r4, r0, #0
|
||||
ldrb r0, [r4, #0xf]
|
||||
adds r1, r0, #0
|
||||
cmp r1, #0
|
||||
beq _0803C458
|
||||
subs r0, #1
|
||||
strb r0, [r4, #0xf]
|
||||
movs r2, #0xff
|
||||
lsls r0, r0, #0x18
|
||||
lsrs r5, r0, #0x18
|
||||
cmp r5, #0
|
||||
bne _0803C4AC
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x82
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #3
|
||||
bne _0803C450
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x7a
|
||||
ldrb r0, [r1]
|
||||
adds r0, #1
|
||||
strb r0, [r1]
|
||||
ands r0, r2
|
||||
cmp r0, #2
|
||||
bhi _0803C450
|
||||
bl Random
|
||||
movs r1, #0xc0
|
||||
ands r1, r0
|
||||
cmp r1, #0
|
||||
beq _0803C450
|
||||
strb r5, [r4, #0xe]
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C690
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C6DC
|
||||
b _0803C4AC
|
||||
_0803C450:
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C634
|
||||
b _0803C4AC
|
||||
_0803C458:
|
||||
ldrb r0, [r4, #0xe]
|
||||
adds r0, #1
|
||||
strb r0, [r4, #0xe]
|
||||
lsls r0, r0, #0x18
|
||||
lsrs r0, r0, #0x18
|
||||
cmp r0, #1
|
||||
beq _0803C46C
|
||||
cmp r0, #0x18
|
||||
beq _0803C494
|
||||
b _0803C49A
|
||||
_0803C46C:
|
||||
ldrb r2, [r4, #0x14]
|
||||
lsls r0, r2, #2
|
||||
strb r0, [r4, #0x15]
|
||||
lsls r2, r2, #0x18
|
||||
lsrs r2, r2, #0x19
|
||||
adds r0, r4, #0
|
||||
movs r1, #0xd
|
||||
bl CreateProjectileWithParent
|
||||
adds r2, r0, #0
|
||||
cmp r2, #0
|
||||
beq _0803C49A
|
||||
str r2, [r4, #0x54]
|
||||
ldrb r0, [r4, #0x15]
|
||||
adds r0, #4
|
||||
movs r1, #0x18
|
||||
ands r0, r1
|
||||
strb r0, [r2, #0x15]
|
||||
str r4, [r2, #0x50]
|
||||
b _0803C49A
|
||||
_0803C494:
|
||||
strb r1, [r4, #0xe]
|
||||
movs r0, #0x20
|
||||
strb r0, [r4, #0xf]
|
||||
_0803C49A:
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C6DC
|
||||
ldr r0, [r4, #0x54]
|
||||
cmp r0, #0
|
||||
beq _0803C4AC
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C714
|
||||
_0803C4AC:
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0803C4B0
|
||||
sub_0803C4B0: @ 0x0803C4B0
|
||||
push {r4, r5, r6, r7, lr}
|
||||
adds r5, r0, #0
|
||||
movs r1, #0
|
||||
strb r1, [r5, #0xf]
|
||||
adds r0, #0x82
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #1
|
||||
bne _0803C54C
|
||||
bl Random
|
||||
ldr r1, _0803C4F0 @ =gUnk_080CFFA4
|
||||
movs r7, #7
|
||||
ands r0, r7
|
||||
adds r0, r0, r1
|
||||
ldrb r0, [r0]
|
||||
strb r0, [r5, #0xe]
|
||||
movs r0, #0x80
|
||||
strh r0, [r5, #0x24]
|
||||
adds r0, r5, #0
|
||||
bl sub_08049FA0
|
||||
cmp r0, #0
|
||||
beq _0803C4F4
|
||||
bl Random
|
||||
adds r4, r0, #0
|
||||
movs r0, #6
|
||||
ands r4, r0
|
||||
lsls r0, r4, #2
|
||||
strb r0, [r5, #0x15]
|
||||
b _0803C556
|
||||
.align 2, 0
|
||||
_0803C4F0: .4byte gUnk_080CFFA4
|
||||
_0803C4F4:
|
||||
adds r0, r5, #0
|
||||
bl sub_08049EE4
|
||||
adds r4, r0, #0
|
||||
adds r6, r5, #0
|
||||
adds r6, #0x83
|
||||
ldrb r0, [r6]
|
||||
cmp r0, #0
|
||||
bne _0803C520
|
||||
bl Random
|
||||
ldr r2, _0803C51C @ =gUnk_080CFFAC
|
||||
movs r1, #0xf
|
||||
ands r1, r0
|
||||
adds r1, r1, r2
|
||||
movs r0, #0
|
||||
ldrsb r0, [r1, r0]
|
||||
adds r4, r4, r0
|
||||
b _0803C53E
|
||||
.align 2, 0
|
||||
_0803C51C: .4byte gUnk_080CFFAC
|
||||
_0803C520:
|
||||
bl Random
|
||||
ldr r1, _0803C548 @ =gUnk_080CFFAC
|
||||
ands r0, r7
|
||||
adds r0, r0, r1
|
||||
ldrb r0, [r0]
|
||||
lsls r0, r0, #0x18
|
||||
asrs r0, r0, #0x18
|
||||
adds r4, r4, r0
|
||||
ldrb r0, [r5, #0xe]
|
||||
adds r0, #0x10
|
||||
strb r0, [r5, #0xe]
|
||||
ldrb r0, [r6]
|
||||
subs r0, #1
|
||||
strb r0, [r6]
|
||||
_0803C53E:
|
||||
adds r0, r4, #4
|
||||
movs r1, #0x18
|
||||
ands r0, r1
|
||||
strb r0, [r5, #0x15]
|
||||
b _0803C554
|
||||
.align 2, 0
|
||||
_0803C548: .4byte gUnk_080CFFAC
|
||||
_0803C54C:
|
||||
movs r0, #0xc
|
||||
strb r0, [r5, #0xe]
|
||||
strh r1, [r5, #0x24]
|
||||
ldrb r0, [r5, #0x15]
|
||||
_0803C554:
|
||||
lsrs r4, r0, #2
|
||||
_0803C556:
|
||||
ldrb r0, [r5, #0x14]
|
||||
cmp r4, r0
|
||||
beq _0803C564
|
||||
strb r4, [r5, #0x14]
|
||||
adds r0, r5, #0
|
||||
bl sub_0803C690
|
||||
_0803C564:
|
||||
pop {r4, r5, r6, r7, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0803C568
|
||||
sub_0803C568: @ 0x0803C568
|
||||
push {r4, r5, lr}
|
||||
adds r5, r0, #0
|
||||
adds r0, #0x81
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #0
|
||||
bne _0803C5C0
|
||||
movs r0, #1
|
||||
bl sub_08049DF4
|
||||
adds r4, r0, #0
|
||||
cmp r4, #0
|
||||
beq _0803C5C0
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x82
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #2
|
||||
bne _0803C598
|
||||
adds r0, r5, #0
|
||||
adds r1, r4, #0
|
||||
movs r2, #0x30
|
||||
bl sub_0806FC80
|
||||
cmp r0, #0
|
||||
bne _0803C5BC
|
||||
_0803C598:
|
||||
adds r0, r5, #0
|
||||
adds r1, r4, #0
|
||||
movs r2, #0x40
|
||||
bl sub_0806FC80
|
||||
cmp r0, #0
|
||||
beq _0803C5C0
|
||||
adds r0, r5, #0
|
||||
adds r1, r4, #0
|
||||
bl GetFacingDirection
|
||||
adds r0, #4
|
||||
movs r1, #0x18
|
||||
ands r0, r1
|
||||
lsrs r0, r0, #2
|
||||
ldrb r5, [r5, #0x14]
|
||||
cmp r0, r5
|
||||
bne _0803C5C0
|
||||
_0803C5BC:
|
||||
movs r0, #1
|
||||
b _0803C5C2
|
||||
_0803C5C0:
|
||||
movs r0, #0
|
||||
_0803C5C2:
|
||||
pop {r4, r5, pc}
|
||||
|
||||
thumb_func_start sub_0803C5C4
|
||||
sub_0803C5C4: @ 0x0803C5C4
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
ldrb r0, [r4, #0x15]
|
||||
adds r0, #4
|
||||
movs r1, #0x18
|
||||
ands r0, r1
|
||||
asrs r0, r0, #2
|
||||
strb r0, [r4, #0x14]
|
||||
lsls r0, r0, #2
|
||||
strb r0, [r4, #0x15]
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x83
|
||||
ldrb r0, [r1]
|
||||
lsrs r0, r0, #1
|
||||
strb r0, [r1]
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C664
|
||||
adds r4, #0x82
|
||||
movs r0, #2
|
||||
strb r0, [r4]
|
||||
pop {r4, pc}
|
||||
|
||||
thumb_func_start sub_0803C5F0
|
||||
sub_0803C5F0: @ 0x0803C5F0
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
movs r1, #1
|
||||
bl sub_08049F84
|
||||
movs r2, #0
|
||||
strb r0, [r4, #0x15]
|
||||
ldrb r0, [r4, #0x15]
|
||||
adds r0, #4
|
||||
movs r1, #0x18
|
||||
ands r0, r1
|
||||
asrs r0, r0, #2
|
||||
strb r0, [r4, #0x14]
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x83
|
||||
strb r2, [r0]
|
||||
subs r0, #9
|
||||
strb r2, [r0]
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C664
|
||||
adds r4, #0x82
|
||||
movs r0, #3
|
||||
strb r0, [r4]
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0803C624
|
||||
sub_0803C624: @ 0x0803C624
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
bl sub_0803C664
|
||||
adds r4, #0x82
|
||||
movs r0, #5
|
||||
strb r0, [r4]
|
||||
pop {r4, pc}
|
||||
|
||||
thumb_func_start sub_0803C634
|
||||
sub_0803C634: @ 0x0803C634
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
ldrb r0, [r4, #0x15]
|
||||
adds r0, #4
|
||||
movs r1, #0x18
|
||||
ands r0, r1
|
||||
asrs r0, r0, #2
|
||||
movs r1, #0
|
||||
strb r0, [r4, #0x14]
|
||||
lsls r0, r0, #2
|
||||
strb r0, [r4, #0x15]
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x83
|
||||
strb r1, [r0]
|
||||
adds r0, r4, #0
|
||||
bl sub_0803C664
|
||||
ldrb r0, [r4, #0xe]
|
||||
lsls r0, r0, #1
|
||||
strb r0, [r4, #0xe]
|
||||
adds r4, #0x82
|
||||
movs r0, #4
|
||||
strb r0, [r4]
|
||||
pop {r4, pc}
|
||||
|
||||
thumb_func_start sub_0803C664
|
||||
sub_0803C664: @ 0x0803C664
|
||||
push {lr}
|
||||
adds r2, r0, #0
|
||||
movs r1, #0
|
||||
movs r0, #3
|
||||
strb r0, [r2, #0xc]
|
||||
movs r0, #0x20
|
||||
strb r0, [r2, #0xe]
|
||||
strb r1, [r2, #0xf]
|
||||
adds r0, r2, #0
|
||||
adds r0, #0x80
|
||||
strb r1, [r0]
|
||||
subs r0, #5
|
||||
strb r1, [r0]
|
||||
movs r0, #0
|
||||
strh r1, [r2, #0x24]
|
||||
adds r1, r2, #0
|
||||
adds r1, #0x82
|
||||
strb r0, [r1]
|
||||
adds r0, r2, #0
|
||||
bl sub_0803C690
|
||||
pop {pc}
|
||||
|
||||
thumb_func_start sub_0803C690
|
||||
sub_0803C690: @ 0x0803C690
|
||||
push {lr}
|
||||
adds r3, r0, #0
|
||||
ldrb r0, [r3, #0x14]
|
||||
lsrs r2, r0, #1
|
||||
adds r0, r3, #0
|
||||
adds r0, #0x82
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #5
|
||||
bhi _0803C6D2
|
||||
lsls r0, r0, #2
|
||||
ldr r1, _0803C6AC @ =_0803C6B0
|
||||
adds r0, r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.align 2, 0
|
||||
_0803C6AC: .4byte _0803C6B0
|
||||
_0803C6B0: @ jump table
|
||||
.4byte _0803C6D2 @ case 0
|
||||
.4byte _0803C6C8 @ case 1
|
||||
.4byte _0803C6D0 @ case 2
|
||||
.4byte _0803C6CC @ case 3
|
||||
.4byte _0803C6C8 @ case 4
|
||||
.4byte _0803C6CC @ case 5
|
||||
_0803C6C8:
|
||||
adds r2, #4
|
||||
b _0803C6D2
|
||||
_0803C6CC:
|
||||
adds r2, #8
|
||||
b _0803C6D2
|
||||
_0803C6D0:
|
||||
adds r2, #0xc
|
||||
_0803C6D2:
|
||||
adds r0, r3, #0
|
||||
adds r1, r2, #0
|
||||
bl InitializeAnimation
|
||||
pop {pc}
|
||||
|
||||
thumb_func_start sub_0803C6DC
|
||||
sub_0803C6DC: @ 0x0803C6DC
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
adds r0, #0x82
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #0
|
||||
bne _0803C6EA
|
||||
strh r0, [r4, #0x24]
|
||||
_0803C6EA:
|
||||
adds r0, r4, #0
|
||||
bl ProcessMovement
|
||||
adds r0, r4, #0
|
||||
bl GetNextFrame
|
||||
pop {r4, pc}
|
||||
|
||||
thumb_func_start sub_0803C6F8
|
||||
sub_0803C6F8: @ 0x0803C6F8
|
||||
ldr r2, _0803C710 @ =gUnk_080CFFBC
|
||||
ldrb r1, [r0, #0x14]
|
||||
lsrs r1, r1, #1
|
||||
lsls r1, r1, #1
|
||||
adds r1, r1, r2
|
||||
ldrh r0, [r0, #0x2a]
|
||||
ldrh r1, [r1]
|
||||
ands r1, r0
|
||||
rsbs r0, r1, #0
|
||||
orrs r0, r1
|
||||
lsrs r0, r0, #0x1f
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_0803C710: .4byte gUnk_080CFFBC
|
||||
|
||||
thumb_func_start sub_0803C714
|
||||
sub_0803C714: @ 0x0803C714
|
||||
push {lr}
|
||||
ldr r1, [r0, #0x54]
|
||||
ldrb r3, [r0, #0x14]
|
||||
ldr r2, _0803C734 @ =gUnk_080CFFC4
|
||||
adds r3, r3, r2
|
||||
movs r2, #0
|
||||
ldrsb r2, [r3, r2]
|
||||
lsls r2, r2, #0x10
|
||||
ldrb r3, [r3, #1]
|
||||
lsls r3, r3, #0x18
|
||||
asrs r3, r3, #0x18
|
||||
lsls r3, r3, #0x10
|
||||
bl PositionRelative
|
||||
pop {pc}
|
||||
.align 2, 0
|
||||
_0803C734: .4byte gUnk_080CFFC4
|
|
@ -12,7 +12,7 @@
|
|||
#include "entity.h"
|
||||
|
||||
extern u32 GetNextFunction(Entity*);
|
||||
extern void EnemyFunctionHandler(Entity*, void (*const func[])(Entity*));
|
||||
extern void EnemyFunctionHandler(Entity*, EntityActionArray);
|
||||
extern void sub_08001324(Entity*);
|
||||
|
||||
extern Entity* sub_0804A9FC(Entity*, u32);
|
||||
|
|
|
@ -149,6 +149,10 @@ typedef struct Entity_ {
|
|||
#endif
|
||||
} Entity;
|
||||
|
||||
typedef void(EntityAction)(Entity*);
|
||||
typedef void(*EntityActionPtr)(Entity*);
|
||||
typedef void(*const* EntityActionArray)(Entity*);
|
||||
|
||||
typedef struct LinkedList {
|
||||
Entity* last;
|
||||
Entity* first;
|
||||
|
|
|
@ -48,7 +48,7 @@ extern void ChangeObjPalette(Entity*, u32);
|
|||
extern void sub_0806FD3C(Entity*);
|
||||
extern void sub_0805ED14(u32*);
|
||||
extern void sub_080A7C18(u32, u32, u32);
|
||||
extern void sub_0804AA30(Entity*, void (*const funcs[])(Entity*));
|
||||
extern void sub_0804AA30(Entity*, EntityActionArray);
|
||||
extern void sub_0804A720(Entity*);
|
||||
extern u32 sub_080AEFE0(Entity*);
|
||||
extern u32 sub_08049FA0(Entity*);
|
||||
|
|
|
@ -393,7 +393,6 @@ SECTIONS {
|
|||
src/enemy/mazaalBracelet.o(.text);
|
||||
asm/enemy/takkuri.o(.text);
|
||||
src/enemy/bowMoblin.o(.text);
|
||||
asm/enemy/bowMoblin.o(.text);
|
||||
src/enemy/lakitu.o(.text);
|
||||
src/enemy/lakituCloud.o(.text);
|
||||
asm/enemy/enemy49.o(.text);
|
||||
|
|
|
@ -1,37 +1,384 @@
|
|||
#define NENT_DEPRECATED
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void sub_0803C5F0(Entity*);
|
||||
typedef struct {
|
||||
Entity base;
|
||||
u8 filler[0x12];
|
||||
u8 unk_0x7a;
|
||||
u8 unk_0x7b;
|
||||
u8 filter[0x4];
|
||||
u8 unk_0x80;
|
||||
u8 unk_0x81;
|
||||
u8 unk_0x82;
|
||||
u8 unk_0x83;
|
||||
} BowMoblinEntity;
|
||||
|
||||
extern void (*const gUnk_080CFF78[])(Entity*);
|
||||
extern void (*const gUnk_080CFF90[])(Entity*);
|
||||
void sub_0803C5F0(BowMoblinEntity*);
|
||||
void sub_0803C690(BowMoblinEntity*);
|
||||
void sub_0803C4B0(BowMoblinEntity*);
|
||||
void sub_0803C5C4(BowMoblinEntity*);
|
||||
void sub_0803C624(BowMoblinEntity*);
|
||||
void sub_0803C6DC(BowMoblinEntity*);
|
||||
void sub_0803C714(BowMoblinEntity*);
|
||||
void sub_0803C634(BowMoblinEntity*);
|
||||
u32 sub_0803C6F8(BowMoblinEntity*);
|
||||
u32 sub_0803C568(BowMoblinEntity*);
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
extern u32 sub_0806FC80(Entity*, Entity*, s32);
|
||||
void sub_0803C664(BowMoblinEntity*);
|
||||
|
||||
extern void (*const gUnk_080CFF78[])(BowMoblinEntity*);
|
||||
extern void (*const gUnk_080CFF90[])(BowMoblinEntity*);
|
||||
|
||||
extern const s8 gUnk_080CFFC4[8];
|
||||
extern const s8 gUnk_080CFFA4[8];
|
||||
extern const s8 gUnk_080CFFAC[16];
|
||||
extern const u16 gUnk_080CFFBC[4];
|
||||
|
||||
void BowMoblin(Entity* this) {
|
||||
EnemyFunctionHandler(this, gUnk_080CFF78);
|
||||
EnemyFunctionHandler(this, (EntityActionArray)gUnk_080CFF78);
|
||||
SetChildOffset(this, 0, 1, -0x18);
|
||||
}
|
||||
|
||||
void sub_0803C180(Entity* this) {
|
||||
gUnk_080CFF90[this->action](this);
|
||||
void sub_0803C180(BowMoblinEntity* this) {
|
||||
gUnk_080CFF90[super->action](this);
|
||||
}
|
||||
|
||||
void sub_0803C198(Entity* this) {
|
||||
void sub_0803C198(BowMoblinEntity* this) {
|
||||
Entity* pEVar1;
|
||||
|
||||
if (this->field_0x43 != 0) {
|
||||
sub_0804A9FC(this, 0x1c);
|
||||
if (super->field_0x43 != 0) {
|
||||
sub_0804A9FC(super, 0x1c);
|
||||
}
|
||||
sub_0804AA30(this, gUnk_080CFF78);
|
||||
if ((this->bitfield & 0x80) != 0) {
|
||||
sub_0804AA30(super, (EntityActionArray)gUnk_080CFF78);
|
||||
if ((super->bitfield & 0x80) != 0) {
|
||||
sub_0803C5F0(this);
|
||||
pEVar1 = this->child;
|
||||
pEVar1 = super->child;
|
||||
if (pEVar1 != NULL) {
|
||||
pEVar1->field_0xf++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void nullsub_168(Entity* this) {
|
||||
void nullsub_168(BowMoblinEntity* this) {
|
||||
}
|
||||
|
||||
void sub_0803C1E0(BowMoblinEntity* this) {
|
||||
sub_0804A720(super);
|
||||
|
||||
super->action = 1;
|
||||
this->unk_0x7b = 0;
|
||||
this->unk_0x80 = 0;
|
||||
this->unk_0x83 = 0;
|
||||
this->unk_0x81 = 0;
|
||||
this->unk_0x7a = 0;
|
||||
this->unk_0x82 = 1;
|
||||
|
||||
if (super->actionDelay) {
|
||||
super->animationState = super->type2 << 1;
|
||||
super->actionDelay = 0x1e;
|
||||
super->speed = 0x80;
|
||||
super->direction = super->type2 << 3;
|
||||
sub_0803C690(this);
|
||||
} else {
|
||||
super->animationState = 0x10;
|
||||
sub_0803C4B0(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0803C234(BowMoblinEntity* this) {
|
||||
u8 mask;
|
||||
if (this->unk_0x81) {
|
||||
this->unk_0x81--;
|
||||
}
|
||||
mask = 0xff;
|
||||
if (((--super->actionDelay) & mask) == 0) {
|
||||
u8 tmp = ++this->unk_0x80;
|
||||
|
||||
if ((tmp) > 0xf) {
|
||||
sub_0803C5C4(this);
|
||||
} else if (((this->unk_0x80 & 0x3) == 0) && (Random() & 0x10)) {
|
||||
sub_0803C624(this);
|
||||
} else {
|
||||
sub_0803C4B0(this);
|
||||
}
|
||||
|
||||
} else if (sub_0803C6F8(this)) {
|
||||
sub_0800417E(super, super->collisions);
|
||||
super->animationState = ((super->direction + 4) & 0x18) >> 2;
|
||||
this->unk_0x83++;
|
||||
sub_0803C690(this);
|
||||
} else if (sub_0803C568(this)) {
|
||||
sub_0803C5F0(this);
|
||||
}
|
||||
|
||||
sub_0803C6DC(this);
|
||||
}
|
||||
|
||||
void sub_0803C2DC(BowMoblinEntity* this) {
|
||||
u32 res;
|
||||
u32 actionDelay = --super->actionDelay;
|
||||
if (actionDelay == 0) {
|
||||
super->action = 3;
|
||||
this->unk_0x82 = actionDelay;
|
||||
this->unk_0x80 = actionDelay;
|
||||
super->animationState = 0x10;
|
||||
sub_0803C4B0(this);
|
||||
} else if (res = sub_0803C568(this), res) {
|
||||
this->unk_0x7b |= 0x1;
|
||||
}
|
||||
|
||||
if (super->field_0xf > 0xb) {
|
||||
if (this->unk_0x7b != 0) {
|
||||
sub_0803C5F0(this);
|
||||
}
|
||||
} else {
|
||||
super->field_0xf++;
|
||||
}
|
||||
|
||||
sub_0803C6DC(this);
|
||||
}
|
||||
|
||||
void sub_0803C344(BowMoblinEntity* this) {
|
||||
if (--super->actionDelay == 0) {
|
||||
switch (this->unk_0x82) {
|
||||
case 3: {
|
||||
super->action = 4;
|
||||
super->speed = 0x80;
|
||||
super->direction = sub_08049F84(super, 1);
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
super->action = 4;
|
||||
super->speed = 0x80;
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
u32 tmp;
|
||||
super->action = 2;
|
||||
super->speed = 0;
|
||||
tmp = Random() & 0x7;
|
||||
super->actionDelay = (tmp << 1) + tmp + 0x40;
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
super->direction = (super->direction + 0x10) & 0x18;
|
||||
}
|
||||
case 0:
|
||||
case 1:
|
||||
default: {
|
||||
u32 tmp;
|
||||
super->action = 1;
|
||||
this->unk_0x82 = 1;
|
||||
super->speed = 0x80;
|
||||
tmp = (Random() & 0x7);
|
||||
super->actionDelay = (tmp << 1) + tmp + 0x22;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
super->field_0xf = 0;
|
||||
super->animationState = ((super->direction + 4) & 0x18) >> 2;
|
||||
sub_0803C690(this);
|
||||
}
|
||||
sub_0803C6DC(this);
|
||||
}
|
||||
|
||||
void sub_0803C400(BowMoblinEntity* this) {
|
||||
if (super->field_0xf) {
|
||||
u8 mask;
|
||||
super->field_0xf--;
|
||||
mask = 0xff;
|
||||
if ((super->field_0xf & mask) == 0) {
|
||||
if (this->unk_0x82 == 3) {
|
||||
this->unk_0x7a++;
|
||||
if ((this->unk_0x7a & mask) <= 2) {
|
||||
if (Random() & 0xc0) {
|
||||
super->actionDelay = 0;
|
||||
sub_0803C690(this);
|
||||
sub_0803C6DC(this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
sub_0803C634(this);
|
||||
}
|
||||
} else {
|
||||
Entity* projectile;
|
||||
switch (++super->actionDelay) {
|
||||
case 1:
|
||||
super->direction = super->animationState << 2;
|
||||
projectile = CreateProjectileWithParent(super, 0xd, super->animationState >> 1);
|
||||
if (projectile) {
|
||||
super->child = projectile;
|
||||
projectile->direction = (super->direction + 4) & 0x18;
|
||||
projectile->parent = super;
|
||||
}
|
||||
break;
|
||||
case 24:
|
||||
super->actionDelay = 0;
|
||||
super->field_0xf = 0x20;
|
||||
break;
|
||||
}
|
||||
|
||||
sub_0803C6DC(this);
|
||||
if (super->child) {
|
||||
sub_0803C714(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0803C4B0(BowMoblinEntity* this) {
|
||||
u32 dir;
|
||||
super->field_0xf = 0;
|
||||
if (this->unk_0x82 == 1) {
|
||||
super->actionDelay = gUnk_080CFFA4[Random() & 7];
|
||||
super->speed = 0x80;
|
||||
if (sub_08049FA0(super)) {
|
||||
dir = Random();
|
||||
dir &= 6;
|
||||
super->direction = dir << 2;
|
||||
} else {
|
||||
dir = sub_08049EE4(super);
|
||||
if (this->unk_0x83 == 0) {
|
||||
dir += gUnk_080CFFAC[Random() & 0xf];
|
||||
} else {
|
||||
dir += gUnk_080CFFAC[Random() & 0x7];
|
||||
super->actionDelay += 0x10;
|
||||
this->unk_0x83--;
|
||||
}
|
||||
dir = (super->direction = (dir + 4) & 0x18) >> 2;
|
||||
}
|
||||
} else {
|
||||
super->actionDelay = 0xc;
|
||||
super->speed = super->field_0xf;
|
||||
dir = super->direction >> 2;
|
||||
}
|
||||
if (dir != super->animationState) {
|
||||
super->animationState = dir;
|
||||
sub_0803C690(this);
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_0803C568(BowMoblinEntity* this) {
|
||||
if (this->unk_0x81 == 0) {
|
||||
Entity* ent = sub_08049DF4(1);
|
||||
if (ent) {
|
||||
if (this->unk_0x82 == 2) {
|
||||
if (sub_0806FC80(super, ent, 0x30)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (sub_0806FC80(super, ent, 0x40)) {
|
||||
u32 direction = (GetFacingDirection(super, ent) + 4) & 0x18;
|
||||
direction = direction >> 2;
|
||||
if (direction == super->animationState) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_0803C5C4(BowMoblinEntity* this) {
|
||||
u32 state = ((super->direction + 4) & 0x18) >> 2;
|
||||
super->animationState = state;
|
||||
super->direction = state << 2;
|
||||
this->unk_0x83 >>= 1;
|
||||
sub_0803C664(this);
|
||||
this->unk_0x82 = 2;
|
||||
}
|
||||
|
||||
void sub_0803C5F0(BowMoblinEntity* this) {
|
||||
super->direction = sub_08049F84(super, 1);
|
||||
super->animationState = ((super->direction + 4) & 0x18) >> 2;
|
||||
this->unk_0x83 = 0;
|
||||
this->unk_0x7a = 0;
|
||||
sub_0803C664(this);
|
||||
this->unk_0x82 = 3;
|
||||
}
|
||||
|
||||
void sub_0803C624(BowMoblinEntity* this) {
|
||||
sub_0803C664(this);
|
||||
this->unk_0x82 = 5;
|
||||
}
|
||||
|
||||
void sub_0803C634(BowMoblinEntity* this) {
|
||||
super->animationState = ((super->direction + 4) & 0x18) >> 2;
|
||||
super->direction = super->animationState << 2;
|
||||
this->unk_0x83 = 0;
|
||||
sub_0803C664(this);
|
||||
super->actionDelay <<= 1;
|
||||
this->unk_0x82 = 4;
|
||||
}
|
||||
|
||||
void sub_0803C664(BowMoblinEntity* this) {
|
||||
super->action = 3;
|
||||
super->actionDelay = 0x20;
|
||||
super->field_0xf = 0;
|
||||
this->unk_0x80 = 0;
|
||||
this->unk_0x7b = 0;
|
||||
super->speed = 0;
|
||||
this->unk_0x82 = 0;
|
||||
sub_0803C690(this);
|
||||
}
|
||||
|
||||
void sub_0803C690(BowMoblinEntity* this) {
|
||||
u32 tmp = super->animationState >> 1;
|
||||
switch (this->unk_0x82) {
|
||||
case 1:
|
||||
case 4: {
|
||||
tmp += 0x4;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
case 5: {
|
||||
tmp += 0x8;
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
tmp += 0xc;
|
||||
break;
|
||||
}
|
||||
case 0: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
InitializeAnimation(super, tmp);
|
||||
}
|
||||
|
||||
void sub_0803C6DC(BowMoblinEntity* this) {
|
||||
u8 tmp = this->unk_0x82;
|
||||
if (tmp == 0) {
|
||||
super->speed = tmp;
|
||||
}
|
||||
|
||||
ProcessMovement(super);
|
||||
GetNextFrame(super);
|
||||
}
|
||||
|
||||
u32 sub_0803C6F8(BowMoblinEntity* this) {
|
||||
u32 tmp = (super->collisions & gUnk_080CFFBC[(super->animationState ^ 1) / 2]);
|
||||
u32 tmp2 = -tmp;
|
||||
return (tmp2 | tmp) >> 0x1f;
|
||||
}
|
||||
|
||||
void sub_0803C714(BowMoblinEntity* this) {
|
||||
Entity* child = super->child;
|
||||
const s8* tmp;
|
||||
u32 offsetX;
|
||||
u32 offsetY;
|
||||
tmp = &gUnk_080CFFC4[super->animationState];
|
||||
// TODO fix array access
|
||||
offsetX = tmp[0] << 0x10;
|
||||
offsetY = tmp[1] << 0x10;
|
||||
|
||||
PositionRelative(super, child, offsetX, offsetY);
|
||||
}
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
|
||||
#define DEFAULT_ANIM 0x100
|
||||
|
||||
typedef void(EntityAction)(Entity*);
|
||||
|
||||
static EntityAction PlayerInit;
|
||||
static EntityAction PlayerNormal;
|
||||
// static EntityAction PlayerInit;
|
||||
|
|
Loading…
Reference in New Issue