mirror of https://github.com/zeldaret/tmc.git
Merge remote-tracking branch 'upstream/master' into misc
This commit is contained in:
commit
a48548ad93
|
@ -0,0 +1,91 @@
|
||||||
|
|
||||||
|
|
||||||
|
.syntax unified
|
||||||
|
|
||||||
|
.text
|
||||||
|
|
||||||
|
push {r4, r5, r6, lr}
|
||||||
|
adds r4, r0, #0
|
||||||
|
movs r1, #2
|
||||||
|
bl UpdateAnimationVariableFrames
|
||||||
|
adds r0, r4, #0
|
||||||
|
bl ProcessMovement
|
||||||
|
cmp r0, #0
|
||||||
|
bne _08038334
|
||||||
|
adds r0, r4, #0
|
||||||
|
adds r0, #0x78
|
||||||
|
ldrb r0, [r0]
|
||||||
|
ldrb r1, [r4, #0x15]
|
||||||
|
cmp r0, r1
|
||||||
|
bne _08038330
|
||||||
|
movs r0, #0x5a
|
||||||
|
strb r0, [r4, #0xf]
|
||||||
|
adds r0, r4, #0
|
||||||
|
bl sub_080383AC
|
||||||
|
b _080383AA
|
||||||
|
_08038330:
|
||||||
|
strb r0, [r4, #0x15]
|
||||||
|
b _080383AA
|
||||||
|
_08038334:
|
||||||
|
ldrb r0, [r4, #0xe]
|
||||||
|
adds r0, #1
|
||||||
|
strb r0, [r4, #0xe]
|
||||||
|
lsls r0, r0, #0x18
|
||||||
|
lsrs r0, r0, #0x18
|
||||||
|
movs r1, #0xa
|
||||||
|
bl __modsi3
|
||||||
|
lsls r0, r0, #0x18
|
||||||
|
lsrs r0, r0, #0x18
|
||||||
|
cmp r0, #0
|
||||||
|
bne _080383AA
|
||||||
|
strb r0, [r4, #0xe]
|
||||||
|
adds r0, r4, #0
|
||||||
|
adds r0, #0x78
|
||||||
|
ldrb r0, [r0]
|
||||||
|
ldrb r3, [r4, #0x15]
|
||||||
|
cmp r0, r3
|
||||||
|
bne _08038398
|
||||||
|
bl Random
|
||||||
|
movs r1, #2
|
||||||
|
ands r1, r0
|
||||||
|
subs r1, #1
|
||||||
|
lsls r1, r1, #0x1b
|
||||||
|
lsrs r1, r1, #0x18
|
||||||
|
adds r0, r4, #0
|
||||||
|
adds r0, #0x79
|
||||||
|
lsls r5, r1, #0x18
|
||||||
|
lsrs r3, r5, #0x18
|
||||||
|
adds r2, r0, #0
|
||||||
|
movs r6, #0x7a
|
||||||
|
adds r6, r6, r4
|
||||||
|
mov ip, r6
|
||||||
|
ldrb r0, [r2]
|
||||||
|
cmp r3, r0
|
||||||
|
bne _08038388
|
||||||
|
ldrb r6, [r6]
|
||||||
|
cmp r3, r6
|
||||||
|
bne _08038388
|
||||||
|
rsbs r0, r5, #0
|
||||||
|
lsrs r1, r0, #0x18
|
||||||
|
_08038388:
|
||||||
|
ldrb r0, [r2]
|
||||||
|
mov r3, ip
|
||||||
|
strb r0, [r3]
|
||||||
|
strb r1, [r2]
|
||||||
|
ldrb r0, [r4, #0x15]
|
||||||
|
adds r0, r0, r1
|
||||||
|
movs r1, #0x18
|
||||||
|
ands r0, r1
|
||||||
|
_08038398:
|
||||||
|
strb r0, [r4, #0x15]
|
||||||
|
ldrb r0, [r4, #0x15]
|
||||||
|
lsrs r0, r0, #3
|
||||||
|
strb r0, [r4, #0x14]
|
||||||
|
ldrb r1, [r4, #0x14]
|
||||||
|
adds r1, #4
|
||||||
|
adds r0, r4, #0
|
||||||
|
bl InitializeAnimation
|
||||||
|
_080383AA:
|
||||||
|
pop {r4, r5, r6, pc}
|
||||||
|
|
||||||
|
.syntax divided
|
403
asm/rope.s
403
asm/rope.s
|
@ -1,403 +0,0 @@
|
||||||
.include "asm/macros.inc"
|
|
||||||
|
|
||||||
.include "constants/constants.inc"
|
|
||||||
|
|
||||||
.syntax unified
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
|
|
||||||
thumb_func_start Rope
|
|
||||||
Rope: @ 0x08031374
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
ldr r1, _08031390 @ =gUnk_080CE448
|
|
||||||
bl EnemyFunctionHandler
|
|
||||||
movs r3, #0x10
|
|
||||||
rsbs r3, r3, #0
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #0
|
|
||||||
movs r2, #1
|
|
||||||
bl SetChildOffset
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08031390: .4byte gUnk_080CE448
|
|
||||||
|
|
||||||
thumb_func_start sub_08031394
|
|
||||||
sub_08031394: @ 0x08031394
|
|
||||||
push {lr}
|
|
||||||
ldr r2, _080313A8 @ =gUnk_080CE460
|
|
||||||
ldrb r1, [r0, #0xc]
|
|
||||||
lsls r1, r1, #2
|
|
||||||
adds r1, r1, r2
|
|
||||||
ldr r1, [r1]
|
|
||||||
bl _call_via_r1
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
_080313A8: .4byte gUnk_080CE460
|
|
||||||
|
|
||||||
thumb_func_start sub_080313AC
|
|
||||||
sub_080313AC: @ 0x080313AC
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
ldrb r0, [r4, #0xc]
|
|
||||||
cmp r0, #3
|
|
||||||
bne _080313C8
|
|
||||||
movs r0, #0x1e
|
|
||||||
strb r0, [r4, #0xf]
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x78
|
|
||||||
movs r0, #0x3c
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08031600
|
|
||||||
_080313C8:
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x43
|
|
||||||
ldrb r0, [r0]
|
|
||||||
cmp r0, #0
|
|
||||||
beq _080313DA
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #0x1c
|
|
||||||
bl sub_0804A9FC
|
|
||||||
_080313DA:
|
|
||||||
ldr r1, _080313E4 @ =gUnk_080CE448
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0804AA30
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_080313E4: .4byte gUnk_080CE448
|
|
||||||
|
|
||||||
thumb_func_start sub_080313E8
|
|
||||||
sub_080313E8: @ 0x080313E8
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
bl sub_0806F520
|
|
||||||
cmp r0, #0
|
|
||||||
beq _08031404
|
|
||||||
ldr r0, _08031408 @ =gUnk_080CE470
|
|
||||||
ldrb r1, [r4, #0xd]
|
|
||||||
lsls r1, r1, #2
|
|
||||||
adds r1, r1, r0
|
|
||||||
ldr r1, [r1]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl _call_via_r1
|
|
||||||
_08031404:
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08031408: .4byte gUnk_080CE470
|
|
||||||
|
|
||||||
thumb_func_start sub_0803140C
|
|
||||||
sub_0803140C: @ 0x0803140C
|
|
||||||
movs r1, #1
|
|
||||||
strb r1, [r0, #0xd]
|
|
||||||
movs r1, #0x3c
|
|
||||||
strb r1, [r0, #0x1d]
|
|
||||||
bx lr
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_08031418
|
|
||||||
sub_08031418: @ 0x08031418
|
|
||||||
push {lr}
|
|
||||||
bl sub_0806F4E8
|
|
||||||
pop {pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_08031420
|
|
||||||
sub_08031420: @ 0x08031420
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
bl sub_0806F3E4
|
|
||||||
cmp r0, #0
|
|
||||||
beq _08031432
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0804A7D4
|
|
||||||
_08031432:
|
|
||||||
pop {r4, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_08031434
|
|
||||||
sub_08031434: @ 0x08031434
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
bl sub_0804A720
|
|
||||||
movs r0, #1
|
|
||||||
rsbs r0, r0, #0
|
|
||||||
adds r3, r0, #0
|
|
||||||
movs r0, #0xff
|
|
||||||
strb r0, [r4, #0x14]
|
|
||||||
movs r2, #1
|
|
||||||
strb r2, [r4, #0x1c]
|
|
||||||
ldrh r0, [r4, #0x24]
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x7a
|
|
||||||
strh r0, [r1]
|
|
||||||
ldrb r0, [r4, #0xa]
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08031460
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08031600
|
|
||||||
b _0803147A
|
|
||||||
_08031460:
|
|
||||||
strb r2, [r4, #0xc]
|
|
||||||
movs r0, #0
|
|
||||||
strb r0, [r4, #0xd]
|
|
||||||
ldrb r1, [r4, #0x18]
|
|
||||||
movs r0, #4
|
|
||||||
rsbs r0, r0, #0
|
|
||||||
ands r0, r1
|
|
||||||
strb r0, [r4, #0x18]
|
|
||||||
ldr r0, _0803147C @ =0x0000FF80
|
|
||||||
strh r0, [r4, #0x36]
|
|
||||||
ldrb r0, [r4, #0x1e]
|
|
||||||
orrs r0, r3
|
|
||||||
strb r0, [r4, #0x1e]
|
|
||||||
_0803147A:
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_0803147C: .4byte 0x0000FF80
|
|
||||||
|
|
||||||
thumb_func_start sub_08031480
|
|
||||||
sub_08031480: @ 0x08031480
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
ldrb r0, [r4, #0xd]
|
|
||||||
cmp r0, #0
|
|
||||||
bne _080314CC
|
|
||||||
ldrb r0, [r4, #0xe]
|
|
||||||
cmp r0, #0
|
|
||||||
beq _08031496
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
b _080314FA
|
|
||||||
_08031496:
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08031600
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
strb r0, [r4, #0xd]
|
|
||||||
ldrb r0, [r4, #0x18]
|
|
||||||
movs r1, #3
|
|
||||||
orrs r0, r1
|
|
||||||
strb r0, [r4, #0x18]
|
|
||||||
ldrb r2, [r4, #0x19]
|
|
||||||
movs r1, #0x3f
|
|
||||||
adds r0, r1, #0
|
|
||||||
ands r0, r2
|
|
||||||
movs r2, #0x40
|
|
||||||
orrs r0, r2
|
|
||||||
strb r0, [r4, #0x19]
|
|
||||||
ldrb r0, [r4, #0x1b]
|
|
||||||
ands r1, r0
|
|
||||||
orrs r1, r2
|
|
||||||
strb r1, [r4, #0x1b]
|
|
||||||
ldr r0, _080314C8 @ =0x0000012D
|
|
||||||
bl SoundReq
|
|
||||||
b _080314FA
|
|
||||||
.align 2, 0
|
|
||||||
_080314C8: .4byte 0x0000012D
|
|
||||||
_080314CC:
|
|
||||||
movs r1, #0xc0
|
|
||||||
lsls r1, r1, #5
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08003FC4
|
|
||||||
cmp r0, #0
|
|
||||||
bne _080314FA
|
|
||||||
movs r0, #2
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
movs r0, #0xf
|
|
||||||
strb r0, [r4, #0xf]
|
|
||||||
ldrb r1, [r4, #0x18]
|
|
||||||
subs r0, #0x13
|
|
||||||
ands r0, r1
|
|
||||||
movs r1, #1
|
|
||||||
orrs r0, r1
|
|
||||||
strb r0, [r4, #0x18]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl UpdateSpriteForCollisionLayer
|
|
||||||
movs r0, #0x84
|
|
||||||
bl EnqueueSFX
|
|
||||||
_080314FA:
|
|
||||||
pop {r4, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_080314FC
|
|
||||||
sub_080314FC: @ 0x080314FC
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
bl GetNextFrame
|
|
||||||
ldrb r0, [r4, #0xf]
|
|
||||||
cmp r0, #0
|
|
||||||
beq _08031510
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r4, #0xf]
|
|
||||||
b _080315BA
|
|
||||||
_08031510:
|
|
||||||
adds r5, r4, #0
|
|
||||||
adds r5, #0x78
|
|
||||||
ldrb r0, [r5]
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0803151E
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r5]
|
|
||||||
_0803151E:
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08049FA0
|
|
||||||
cmp r0, #0
|
|
||||||
beq _08031578
|
|
||||||
ldrb r0, [r5]
|
|
||||||
cmp r0, #0
|
|
||||||
bne _080315A2
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #1
|
|
||||||
bl sub_08049FDC
|
|
||||||
cmp r0, #0
|
|
||||||
beq _080315A2
|
|
||||||
ldr r0, _08031574 @ =gUnk_020000B0
|
|
||||||
ldr r1, [r0]
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r2, #0xc
|
|
||||||
bl sub_0804A044
|
|
||||||
adds r1, r0, #0
|
|
||||||
cmp r1, #0xff
|
|
||||||
beq _080315A2
|
|
||||||
movs r0, #3
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
movs r0, #0x1e
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
movs r0, #0xd0
|
|
||||||
lsls r0, r0, #1
|
|
||||||
strh r0, [r4, #0x24]
|
|
||||||
adds r2, r4, #0
|
|
||||||
adds r2, #0x7a
|
|
||||||
strh r0, [r2]
|
|
||||||
strb r1, [r4, #0x15]
|
|
||||||
lsls r0, r1, #0x18
|
|
||||||
lsrs r0, r0, #0x1b
|
|
||||||
strb r0, [r4, #0x14]
|
|
||||||
ldrb r1, [r4, #0x14]
|
|
||||||
adds r1, #4
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
b _080315BA
|
|
||||||
.align 2, 0
|
|
||||||
_08031574: .4byte gUnk_020000B0
|
|
||||||
_08031578:
|
|
||||||
bl Random
|
|
||||||
movs r1, #1
|
|
||||||
ands r1, r0
|
|
||||||
cmp r1, #0
|
|
||||||
beq _080315A2
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08049EE4
|
|
||||||
adds r0, #4
|
|
||||||
movs r1, #0x18
|
|
||||||
ands r0, r1
|
|
||||||
strb r0, [r4, #0x15]
|
|
||||||
lsrs r1, r0, #3
|
|
||||||
ldrb r0, [r4, #0x14]
|
|
||||||
cmp r1, r0
|
|
||||||
beq _080315A2
|
|
||||||
strb r1, [r4, #0x14]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
_080315A2:
|
|
||||||
ldrb r0, [r4, #0xe]
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
cmp r0, #0
|
|
||||||
bne _080315B4
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08031600
|
|
||||||
_080315B4:
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0803163C
|
|
||||||
_080315BA:
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_080315BC
|
|
||||||
sub_080315BC: @ 0x080315BC
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
ldrb r0, [r4, #0xe]
|
|
||||||
cmp r0, #0
|
|
||||||
beq _080315D4
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #2
|
|
||||||
bl UpdateAnimationVariableFrames
|
|
||||||
b _080315FC
|
|
||||||
_080315D4:
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08049FA0
|
|
||||||
cmp r0, #0
|
|
||||||
beq _080315EE
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl GetNextFrame
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0803163C
|
|
||||||
cmp r0, #0
|
|
||||||
bne _080315FC
|
|
||||||
_080315EE:
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x78
|
|
||||||
movs r0, #0x1e
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08031600
|
|
||||||
_080315FC:
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_08031600
|
|
||||||
sub_08031600: @ 0x08031600
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
movs r0, #2
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
bl Random
|
|
||||||
movs r1, #0x30
|
|
||||||
ands r0, r1
|
|
||||||
adds r0, #0x3c
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
movs r0, #0x80
|
|
||||||
strh r0, [r4, #0x24]
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x7a
|
|
||||||
strh r0, [r1]
|
|
||||||
bl Random
|
|
||||||
movs r1, #0x18
|
|
||||||
ands r0, r1
|
|
||||||
strb r0, [r4, #0x15]
|
|
||||||
lsrs r1, r0, #3
|
|
||||||
ldrb r0, [r4, #0x14]
|
|
||||||
cmp r1, r0
|
|
||||||
beq _08031638
|
|
||||||
strb r1, [r4, #0x14]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
_08031638:
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_0803163C
|
|
||||||
sub_0803163C: @ 0x0803163C
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
bl sub_080002B8
|
|
||||||
cmp r0, #0x13
|
|
||||||
bne _08031652
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x7a
|
|
||||||
ldrh r0, [r0]
|
|
||||||
lsrs r0, r0, #1
|
|
||||||
b _08031658
|
|
||||||
_08031652:
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x7a
|
|
||||||
ldrh r0, [r0]
|
|
||||||
_08031658:
|
|
||||||
strh r0, [r4, #0x24]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl ProcessMovement
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
342
asm/ropeGolden.s
342
asm/ropeGolden.s
|
@ -1,342 +0,0 @@
|
||||||
.include "asm/macros.inc"
|
|
||||||
|
|
||||||
.include "constants/constants.inc"
|
|
||||||
|
|
||||||
.syntax unified
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
|
|
||||||
thumb_func_start RopeGolden
|
|
||||||
RopeGolden: @ 0x080381AC
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r5, r0, #0
|
|
||||||
bl sub_080012DC
|
|
||||||
adds r1, r0, #0
|
|
||||||
cmp r1, #0
|
|
||||||
beq _080381D0
|
|
||||||
ldr r0, _080381CC @ =gUnk_080012C8
|
|
||||||
lsls r1, r1, #2
|
|
||||||
adds r1, r1, r0
|
|
||||||
ldr r1, [r1]
|
|
||||||
adds r0, r5, #0
|
|
||||||
bl _call_via_r1
|
|
||||||
b _080381F2
|
|
||||||
.align 2, 0
|
|
||||||
_080381CC: .4byte gUnk_080012C8
|
|
||||||
_080381D0:
|
|
||||||
ldr r4, _080381F4 @ =gUnk_080CF4C8
|
|
||||||
adds r0, r5, #0
|
|
||||||
bl GetNextFunction
|
|
||||||
lsls r0, r0, #2
|
|
||||||
adds r0, r0, r4
|
|
||||||
ldr r1, [r0]
|
|
||||||
adds r0, r5, #0
|
|
||||||
bl _call_via_r1
|
|
||||||
movs r3, #0x10
|
|
||||||
rsbs r3, r3, #0
|
|
||||||
adds r0, r5, #0
|
|
||||||
movs r1, #0
|
|
||||||
movs r2, #1
|
|
||||||
bl SetChildOffset
|
|
||||||
_080381F2:
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_080381F4: .4byte gUnk_080CF4C8
|
|
||||||
|
|
||||||
thumb_func_start sub_080381F8
|
|
||||||
sub_080381F8: @ 0x080381F8
|
|
||||||
push {lr}
|
|
||||||
ldr r2, _0803820C @ =gUnk_080CF4E0
|
|
||||||
ldrb r1, [r0, #0xc]
|
|
||||||
lsls r1, r1, #2
|
|
||||||
adds r1, r1, r2
|
|
||||||
ldr r1, [r1]
|
|
||||||
bl _call_via_r1
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
_0803820C: .4byte gUnk_080CF4E0
|
|
||||||
|
|
||||||
thumb_func_start sub_08038210
|
|
||||||
sub_08038210: @ 0x08038210
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
adds r0, #0x43
|
|
||||||
ldrb r0, [r0]
|
|
||||||
cmp r0, #0
|
|
||||||
beq _08038224
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #0x1c
|
|
||||||
bl sub_0804A9FC
|
|
||||||
_08038224:
|
|
||||||
ldr r1, _08038230 @ =gUnk_080CF4C8
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0804AA30
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08038230: .4byte gUnk_080CF4C8
|
|
||||||
|
|
||||||
thumb_func_start sub_08038234
|
|
||||||
sub_08038234: @ 0x08038234
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
adds r0, #0x3a
|
|
||||||
ldrb r1, [r0]
|
|
||||||
movs r0, #2
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0803824A
|
|
||||||
ldrb r0, [r4, #0xb]
|
|
||||||
bl SetGlobalFlag
|
|
||||||
_0803824A:
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #0xff
|
|
||||||
movs r2, #0x58
|
|
||||||
bl CreateDeathFx
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_08038258
|
|
||||||
sub_08038258: @ 0x08038258
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
ldrb r0, [r4, #0xb]
|
|
||||||
bl CheckGlobalFlag
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0803826A
|
|
||||||
bl DeleteThisEntity
|
|
||||||
_0803826A:
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0804A720
|
|
||||||
movs r0, #0xff
|
|
||||||
strb r0, [r4, #0x14]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_080383AC
|
|
||||||
pop {r4, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_0803827C
|
|
||||||
sub_0803827C: @ 0x0803827C
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
ldrb r0, [r4, #0xf]
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0803828C
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r4, #0xf]
|
|
||||||
b _080382BC
|
|
||||||
_0803828C:
|
|
||||||
ldr r5, _080382B8 @ =gPlayerEntity
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r1, r5, #0
|
|
||||||
movs r2, #8
|
|
||||||
bl sub_0804A044
|
|
||||||
cmp r0, #0xff
|
|
||||||
bne _080382B0
|
|
||||||
movs r0, #0x2e
|
|
||||||
ldrsh r1, [r5, r0]
|
|
||||||
movs r0, #0x32
|
|
||||||
ldrsh r2, [r5, r0]
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r3, #0x24
|
|
||||||
bl sub_0806FCB8
|
|
||||||
cmp r0, #0
|
|
||||||
beq _080382BC
|
|
||||||
_080382B0:
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_080383E4
|
|
||||||
b _080382E8
|
|
||||||
.align 2, 0
|
|
||||||
_080382B8: .4byte gPlayerEntity
|
|
||||||
_080382BC:
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #2
|
|
||||||
bl UpdateAnimationVariableFrames
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl ProcessMovement
|
|
||||||
cmp r0, #0
|
|
||||||
bne _080382D6
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_080383AC
|
|
||||||
b _080382E8
|
|
||||||
_080382D6:
|
|
||||||
ldrb r0, [r4, #0xe]
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
cmp r0, #0
|
|
||||||
bne _080382E8
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_080383AC
|
|
||||||
_080382E8:
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_080382EC
|
|
||||||
sub_080382EC: @ 0x080382EC
|
|
||||||
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 _08038300
|
|
||||||
movs r0, #3
|
|
||||||
strb r0, [r1, #0xc]
|
|
||||||
_08038300:
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_08038304
|
|
||||||
sub_08038304: @ 0x08038304
|
|
||||||
push {r4, r5, r6, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
movs r1, #2
|
|
||||||
bl UpdateAnimationVariableFrames
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl ProcessMovement
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08038334
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x78
|
|
||||||
ldrb r0, [r0]
|
|
||||||
ldrb r1, [r4, #0x15]
|
|
||||||
cmp r0, r1
|
|
||||||
bne _08038330
|
|
||||||
movs r0, #0x5a
|
|
||||||
strb r0, [r4, #0xf]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_080383AC
|
|
||||||
b _080383AA
|
|
||||||
_08038330:
|
|
||||||
strb r0, [r4, #0x15]
|
|
||||||
b _080383AA
|
|
||||||
_08038334:
|
|
||||||
ldrb r0, [r4, #0xe]
|
|
||||||
adds r0, #1
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
lsrs r0, r0, #0x18
|
|
||||||
movs r1, #0xa
|
|
||||||
bl __modsi3
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
lsrs r0, r0, #0x18
|
|
||||||
cmp r0, #0
|
|
||||||
bne _080383AA
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x78
|
|
||||||
ldrb r0, [r0]
|
|
||||||
ldrb r3, [r4, #0x15]
|
|
||||||
cmp r0, r3
|
|
||||||
bne _08038398
|
|
||||||
bl Random
|
|
||||||
movs r1, #2
|
|
||||||
ands r1, r0
|
|
||||||
subs r1, #1
|
|
||||||
lsls r1, r1, #0x1b
|
|
||||||
lsrs r1, r1, #0x18
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x79
|
|
||||||
lsls r5, r1, #0x18
|
|
||||||
lsrs r3, r5, #0x18
|
|
||||||
adds r2, r0, #0
|
|
||||||
movs r6, #0x7a
|
|
||||||
adds r6, r6, r4
|
|
||||||
mov ip, r6
|
|
||||||
ldrb r0, [r2]
|
|
||||||
cmp r3, r0
|
|
||||||
bne _08038388
|
|
||||||
ldrb r6, [r6]
|
|
||||||
cmp r3, r6
|
|
||||||
bne _08038388
|
|
||||||
rsbs r0, r5, #0
|
|
||||||
lsrs r1, r0, #0x18
|
|
||||||
_08038388:
|
|
||||||
ldrb r0, [r2]
|
|
||||||
mov r3, ip
|
|
||||||
strb r0, [r3]
|
|
||||||
strb r1, [r2]
|
|
||||||
ldrb r0, [r4, #0x15]
|
|
||||||
adds r0, r0, r1
|
|
||||||
movs r1, #0x18
|
|
||||||
ands r0, r1
|
|
||||||
_08038398:
|
|
||||||
strb r0, [r4, #0x15]
|
|
||||||
ldrb r0, [r4, #0x15]
|
|
||||||
lsrs r0, r0, #3
|
|
||||||
strb r0, [r4, #0x14]
|
|
||||||
ldrb r1, [r4, #0x14]
|
|
||||||
adds r1, #4
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
_080383AA:
|
|
||||||
pop {r4, r5, r6, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_080383AC
|
|
||||||
sub_080383AC: @ 0x080383AC
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
movs r0, #8
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
adds r0, #0xf8
|
|
||||||
strh r0, [r4, #0x24]
|
|
||||||
ldr r1, _080383E0 @ =gPlayerEntity
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl GetFacingDirection
|
|
||||||
adds r0, #4
|
|
||||||
movs r1, #0x18
|
|
||||||
ands r0, r1
|
|
||||||
strb r0, [r4, #0x15]
|
|
||||||
lsrs r1, r0, #3
|
|
||||||
ldrb r0, [r4, #0x14]
|
|
||||||
cmp r1, r0
|
|
||||||
beq _080383DC
|
|
||||||
strb r1, [r4, #0x14]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
_080383DC:
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_080383E0: .4byte gPlayerEntity
|
|
||||||
|
|
||||||
thumb_func_start sub_080383E4
|
|
||||||
sub_080383E4: @ 0x080383E4
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
movs r0, #2
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
movs r0, #8
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
movs r0, #0xa0
|
|
||||||
lsls r0, r0, #2
|
|
||||||
strh r0, [r4, #0x24]
|
|
||||||
ldr r1, _0803842C @ =gPlayerEntity
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl GetFacingDirection
|
|
||||||
adds r0, #4
|
|
||||||
movs r1, #0x18
|
|
||||||
ands r0, r1
|
|
||||||
strb r0, [r4, #0x15]
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x78
|
|
||||||
strb r0, [r1]
|
|
||||||
ldrb r0, [r4, #0x15]
|
|
||||||
lsrs r0, r0, #3
|
|
||||||
strb r0, [r4, #0x14]
|
|
||||||
adds r1, #1
|
|
||||||
movs r0, #0xff
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r1, #1
|
|
||||||
movs r0, #1
|
|
||||||
rsbs r0, r0, #0
|
|
||||||
strb r0, [r1]
|
|
||||||
ldrb r1, [r4, #0x14]
|
|
||||||
adds r1, #4
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_0803842C: .4byte gPlayerEntity
|
|
|
@ -747,7 +747,7 @@ gUnk_080CE404:: @ 080CE404
|
||||||
gUnk_080CE407:: @ 080CE407
|
gUnk_080CE407:: @ 080CE407
|
||||||
.incbin "baserom.gba", 0x0CE407, 0x0000041
|
.incbin "baserom.gba", 0x0CE407, 0x0000041
|
||||||
|
|
||||||
gUnk_080CE448:: @ 080CE448
|
gRope:: @ 080CE448
|
||||||
.incbin "baserom.gba", 0x0CE448, 0x0000018
|
.incbin "baserom.gba", 0x0CE448, 0x0000018
|
||||||
|
|
||||||
gUnk_080CE460:: @ 080CE460
|
gUnk_080CE460:: @ 080CE460
|
||||||
|
|
|
@ -377,7 +377,7 @@ SECTIONS {
|
||||||
asm/code_080300AC.o(.text); /* ??? */
|
asm/code_080300AC.o(.text); /* ??? */
|
||||||
asm/armos.o(.text);
|
asm/armos.o(.text);
|
||||||
asm/eyegore.o(.text);
|
asm/eyegore.o(.text);
|
||||||
asm/rope.o(.text);
|
src/enemy/rope.o(.text);
|
||||||
src/enemy/smallPesto.o(.text);
|
src/enemy/smallPesto.o(.text);
|
||||||
src/enemy/acroBandits.o(.text);
|
src/enemy/acroBandits.o(.text);
|
||||||
src/enemy/bladeTrap.o(.text);
|
src/enemy/bladeTrap.o(.text);
|
||||||
|
@ -395,7 +395,7 @@ SECTIONS {
|
||||||
src/enemy/gibdo.o(.text);
|
src/enemy/gibdo.o(.text);
|
||||||
asm/octorokGolden.o(.text);
|
asm/octorokGolden.o(.text);
|
||||||
src/enemy/tektiteGolden.o(.text);
|
src/enemy/tektiteGolden.o(.text);
|
||||||
asm/ropeGolden.o(.text);
|
src/enemy/ropeGolden.o(.text);
|
||||||
asm/cloudPiranha.o(.text);
|
asm/cloudPiranha.o(.text);
|
||||||
asm/scissorsBeetle.o(.text);
|
asm/scissorsBeetle.o(.text);
|
||||||
asm/cuccoAggr.o(.text);
|
asm/cuccoAggr.o(.text);
|
||||||
|
|
|
@ -0,0 +1,112 @@
|
||||||
|
#include "global.h"
|
||||||
|
#include "entity.h"
|
||||||
|
#include "sprite.h"
|
||||||
|
#include "functions.h"
|
||||||
|
#include "enemy.h"
|
||||||
|
|
||||||
|
extern void (*const gUnk_080012C8[])(Entity*);
|
||||||
|
extern void (*const gUnk_080CF4C8[6])(Entity*);
|
||||||
|
extern void (*const gUnk_080CF4E0[4])(Entity*);
|
||||||
|
|
||||||
|
extern s32 sub_080012DC(Entity*);
|
||||||
|
extern void SetGlobalFlag(u32);
|
||||||
|
extern u32 CheckGlobalFlag(u32);
|
||||||
|
extern u32 sub_0804A044(Entity*, Entity*, u32);
|
||||||
|
|
||||||
|
void sub_080383AC(Entity*);
|
||||||
|
void sub_080383E4(Entity*);
|
||||||
|
|
||||||
|
void RopeGolden(Entity* this) {
|
||||||
|
u32 x;
|
||||||
|
x = sub_080012DC(this);
|
||||||
|
if (x != 0) {
|
||||||
|
gUnk_080012C8[x](this);
|
||||||
|
} else {
|
||||||
|
gUnk_080CF4C8[GetNextFunction(this)](this);
|
||||||
|
SetChildOffset(this, 0, 1, -0x10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RopeGolden_OnTick(Entity* this) {
|
||||||
|
gUnk_080CF4E0[this->action](this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08038210(Entity* this) {
|
||||||
|
if (this->field_0x43 != 0) {
|
||||||
|
sub_0804A9FC(this, 0x1c);
|
||||||
|
}
|
||||||
|
sub_0804AA30(this, gUnk_080CF4C8);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08038234(Entity* this) {
|
||||||
|
if ((this->field_0x3a & 2) == 0) {
|
||||||
|
SetGlobalFlag(this->type2);
|
||||||
|
}
|
||||||
|
CreateDeathFx(this, 0xff, 0x58);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08038258(Entity* this) {
|
||||||
|
if (CheckGlobalFlag(this->type2) != 0) {
|
||||||
|
DeleteThisEntity();
|
||||||
|
}
|
||||||
|
sub_0804A720(this);
|
||||||
|
this->animationState = 0xff;
|
||||||
|
sub_080383AC(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_0803827C(Entity* this) {
|
||||||
|
if (this->field_0xf != 0) {
|
||||||
|
this->field_0xf--;
|
||||||
|
} else {
|
||||||
|
if ((sub_0804A044(this, &gPlayerEntity, 0x8) != 0xff) ||
|
||||||
|
(sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x24) != 0)) {
|
||||||
|
sub_080383E4(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
UpdateAnimationVariableFrames(this, 0x2);
|
||||||
|
if (ProcessMovement(this) == 0) {
|
||||||
|
sub_080383AC(this);
|
||||||
|
} else {
|
||||||
|
if (!(--this->actionDelay)) {
|
||||||
|
sub_080383AC(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080382EC(Entity* this) {
|
||||||
|
if (!(--this->actionDelay)) {
|
||||||
|
this->action = 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NONMATCH("asm/non_matching/ropeGolden/sub_08038304.inc", void sub_08038304(Entity* this)) {
|
||||||
|
}
|
||||||
|
END_NONMATCH
|
||||||
|
|
||||||
|
void sub_080383AC(Entity* this) {
|
||||||
|
u32 v;
|
||||||
|
this->action = 1;
|
||||||
|
this->actionDelay = 0x8;
|
||||||
|
this->nonPlanarMovement = 0x100;
|
||||||
|
this->direction = DirectionRoundUp(GetFacingDirection(this, &gPlayerEntity));
|
||||||
|
v = this->direction >> 3;
|
||||||
|
if (v != this->animationState) {
|
||||||
|
this->animationState = v;
|
||||||
|
InitializeAnimation(this, v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080383E4(Entity* this) {
|
||||||
|
u32 v;
|
||||||
|
this->action = 2;
|
||||||
|
this->actionDelay = 0x8;
|
||||||
|
this->nonPlanarMovement = 0x280;
|
||||||
|
v = DirectionRoundUp(GetFacingDirection(this, &gPlayerEntity));
|
||||||
|
this->direction = v;
|
||||||
|
this->field_0x78.HALF.LO = v;
|
||||||
|
this->animationState = this->direction >> 3;
|
||||||
|
this->field_0x78.HALF.HI = 0xff;
|
||||||
|
this->field_0x7a.HALF.LO = -1;
|
||||||
|
InitializeAnimation(this, this->animationState + 4);
|
||||||
|
}
|
|
@ -1,31 +1,25 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "entity.h"
|
#include "entity.h"
|
||||||
#include "room.h"
|
#include "room.h"
|
||||||
|
|
||||||
extern void sub_080A2CC0();
|
extern void sub_080A2CC0();
|
||||||
extern void sub_0806F69C();
|
extern void sub_0806F69C();
|
||||||
extern void EnqueueSFX();
|
extern void EnqueueSFX();
|
||||||
|
|
||||||
void BladeTrap(Entity* ent) {
|
void BladeTrap(Entity* this) {
|
||||||
u16 uVar1;
|
if (this->action == 0) {
|
||||||
Entity* pEVar2;
|
this->action = 1;
|
||||||
u16* puVar3;
|
this->attachedEntity = GetCurrentRoomProperty(this->type);
|
||||||
if (ent->action == 0) {
|
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74);
|
||||||
ent->action = 1;
|
|
||||||
pEVar2 = GetCurrentRoomProperty((u8)ent->type);
|
|
||||||
ent->attachedEntity = pEVar2;
|
|
||||||
sub_080A2CC0((EntityData*)ent, &ent->attachedEntity, &ent->field_0x74);
|
|
||||||
}
|
}
|
||||||
if ((ent->direction & 0x80) == 0) {
|
if (!(this->direction & 0x80)) {
|
||||||
sub_0806F69C(ent);
|
sub_0806F69C(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
puVar3 = &(ent->field_0x74.HWORD);
|
if (!(--this->field_0x74.HWORD)) {
|
||||||
uVar1 = *puVar3;
|
if (!(this->direction & 0x80)) {
|
||||||
*puVar3 = uVar1 - 1;
|
|
||||||
if ((*puVar3) == 0) {
|
|
||||||
if ((u16)(ent->direction & 0x80) == 0) {
|
|
||||||
EnqueueSFX(0x74);
|
EnqueueSFX(0x74);
|
||||||
}
|
}
|
||||||
sub_080A2CC0((EntityData*)ent, &ent->attachedEntity, puVar3);
|
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74.HWORD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,180 @@
|
||||||
|
#include "global.h"
|
||||||
|
#include "entity.h"
|
||||||
|
#include "sprite.h"
|
||||||
|
#include "functions.h"
|
||||||
|
#include "enemy.h"
|
||||||
|
|
||||||
|
extern void (*const gRope[6])(Entity*);
|
||||||
|
extern void (*const gUnk_080CE460[4])(Entity*);
|
||||||
|
extern void (*const gUnk_080CE470[3])(Entity*);
|
||||||
|
extern Entity* gUnk_020000B0;
|
||||||
|
extern u32 sub_0804A044();
|
||||||
|
|
||||||
|
void sub_08031600();
|
||||||
|
u32 sub_0803163C();
|
||||||
|
|
||||||
|
void Rope(Entity* this) {
|
||||||
|
EnemyFunctionHandler(this, gRope);
|
||||||
|
SetChildOffset(this, 0, 1, -16);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Rope_OnTick(Entity* this) {
|
||||||
|
gUnk_080CE460[this->action](this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080313AC(Entity* this) {
|
||||||
|
if (this->action == 3) {
|
||||||
|
this->field_0xf = 0x1e;
|
||||||
|
this->field_0x78.HALF.LO = 0x3c;
|
||||||
|
sub_08031600(this);
|
||||||
|
}
|
||||||
|
if (this->field_0x43) {
|
||||||
|
sub_0804A9FC(this, 0x1c);
|
||||||
|
}
|
||||||
|
sub_0804AA30(this, gRope);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080313E8(Entity* this) {
|
||||||
|
if (sub_0806F520()) {
|
||||||
|
gUnk_080CE470[this->previousActionFlag](this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_0803140C(Entity* this) {
|
||||||
|
this->previousActionFlag = 1;
|
||||||
|
this->field_0x1d = 0x3c;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031418(Entity* this) {
|
||||||
|
sub_0806F4E8(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031420(Entity* this) {
|
||||||
|
if (sub_0806F3E4(this)) {
|
||||||
|
sub_0804A7D4(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031434(Entity* this) {
|
||||||
|
|
||||||
|
sub_0804A720(this);
|
||||||
|
this->animationState = 0xff;
|
||||||
|
this->field_0x1c = 1;
|
||||||
|
this->field_0x7a.HWORD = this->nonPlanarMovement;
|
||||||
|
if (!(this->type)) {
|
||||||
|
sub_08031600(this);
|
||||||
|
} else {
|
||||||
|
this->action = 1;
|
||||||
|
this->previousActionFlag = 0;
|
||||||
|
this->spriteSettings.b.draw = (this->spriteSettings.b.draw & 0xfc);
|
||||||
|
this->height.HALF.HI = -0x80;
|
||||||
|
this->frameIndex = 0xff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031480(Entity* this) {
|
||||||
|
if (this->previousActionFlag == 0) {
|
||||||
|
if (this->actionDelay != 0) {
|
||||||
|
this->actionDelay--;
|
||||||
|
} else {
|
||||||
|
sub_08031600(this);
|
||||||
|
this->action = 1;
|
||||||
|
this->previousActionFlag = 1;
|
||||||
|
this->spriteSettings.b.draw = 3;
|
||||||
|
this->spriteRendering.b3 = 1;
|
||||||
|
this->spriteOrientation.flipY = 1;
|
||||||
|
PlaySFX(0x12d);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (sub_08003FC4(this, 0x1800) == 0) {
|
||||||
|
this->action = 2;
|
||||||
|
this->field_0xf = 0xf;
|
||||||
|
this->spriteSettings.b.draw = 1;
|
||||||
|
UpdateSpriteForCollisionLayer(this);
|
||||||
|
EnqueueSFX(0x84);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void sub_080314FC(Entity* this) {
|
||||||
|
u32 u;
|
||||||
|
|
||||||
|
GetNextFrame(this);
|
||||||
|
if (this->field_0xf) {
|
||||||
|
this->field_0xf--;
|
||||||
|
} else {
|
||||||
|
if (this->field_0x78.HALF.LO) {
|
||||||
|
this->field_0x78.HALF.LO--;
|
||||||
|
}
|
||||||
|
if (sub_08049FA0(this)) {
|
||||||
|
if (!(this->field_0x78.HALF.LO)) {
|
||||||
|
if (sub_08049FDC(this, 1)) {
|
||||||
|
u = sub_0804A044(this, gUnk_020000B0, 0xc);
|
||||||
|
if (u != 0xff) {
|
||||||
|
this->action = 3;
|
||||||
|
this->actionDelay = 0x1e;
|
||||||
|
this->field_0x7a.HWORD = this->nonPlanarMovement = 0x1a0;
|
||||||
|
this->direction = u;
|
||||||
|
this->animationState = this->direction >> 3;
|
||||||
|
InitializeAnimation(this, this->animationState + 4);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ((Random() & 1)) {
|
||||||
|
this->direction = DirectionRoundUp(sub_08049EE4(this));
|
||||||
|
u = this->direction >> 3;
|
||||||
|
if (u != this->animationState) {
|
||||||
|
this->animationState = u;
|
||||||
|
InitializeAnimation(this, u);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!(--this->actionDelay)) {
|
||||||
|
sub_08031600(this);
|
||||||
|
}
|
||||||
|
sub_0803163C(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080315BC(Entity* this) {
|
||||||
|
if (this->actionDelay) {
|
||||||
|
this->actionDelay--;
|
||||||
|
UpdateAnimationVariableFrames(this, 2);
|
||||||
|
} else {
|
||||||
|
if (sub_08049FA0(this)) {
|
||||||
|
GetNextFrame(this);
|
||||||
|
if (sub_0803163C(this)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this->field_0x78.HALF.LO = 0x1e;
|
||||||
|
sub_08031600(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031600(Entity* this) {
|
||||||
|
u32 r;
|
||||||
|
this->action = 2;
|
||||||
|
this->actionDelay = (Random() & 0x30) + 0x3c;
|
||||||
|
this->nonPlanarMovement = 0x80;
|
||||||
|
this->field_0x7a.HWORD = 0x80;
|
||||||
|
r = Random() & 0x18;
|
||||||
|
this->direction = r;
|
||||||
|
r = r / 8;
|
||||||
|
if (r != this->animationState) {
|
||||||
|
this->animationState = r;
|
||||||
|
InitializeAnimation(this, r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 sub_0803163C(Entity* this) {
|
||||||
|
u32 h;
|
||||||
|
if (sub_080002B8(this) == 0x13) {
|
||||||
|
h = this->field_0x7a.HWORD / 2;
|
||||||
|
} else {
|
||||||
|
h = this->field_0x7a.HWORD;
|
||||||
|
}
|
||||||
|
this->nonPlanarMovement = h;
|
||||||
|
return ProcessMovement(this);
|
||||||
|
}
|
Loading…
Reference in New Issue