mirror of https://github.com/zeldaret/tmc.git
Merge pull request #380 from octorock/ezloCap
This commit is contained in:
commit
712ca6fc91
|
|
@ -1,770 +0,0 @@
|
|||
.include "asm/macros.inc"
|
||||
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
|
||||
thumb_func_start EzloCap
|
||||
EzloCap: @ 0x080828E0
|
||||
push {lr}
|
||||
adds r2, r0, #0
|
||||
ldrb r1, [r2, #0x10]
|
||||
movs r0, #2
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _080828F8
|
||||
ldr r0, _080828F4 @ =gUnk_0811F15C
|
||||
b _08082900
|
||||
.align 2, 0
|
||||
_080828F4: .4byte gUnk_0811F15C
|
||||
_080828F8:
|
||||
ldrb r0, [r2, #0xa]
|
||||
cmp r0, #0
|
||||
bne _08082914
|
||||
ldr r0, _08082910 @ =gUnk_0811F14C
|
||||
_08082900:
|
||||
ldrb r1, [r2, #0xc]
|
||||
lsls r1, r1, #2
|
||||
adds r1, r1, r0
|
||||
ldr r1, [r1]
|
||||
adds r0, r2, #0
|
||||
bl _call_via_r1
|
||||
b _08082924
|
||||
.align 2, 0
|
||||
_08082910: .4byte gUnk_0811F14C
|
||||
_08082914:
|
||||
ldr r0, _08082928 @ =gUnk_0811F154
|
||||
ldrb r1, [r2, #0xc]
|
||||
lsls r1, r1, #2
|
||||
adds r1, r1, r0
|
||||
ldr r1, [r1]
|
||||
adds r0, r2, #0
|
||||
bl _call_via_r1
|
||||
_08082924:
|
||||
pop {pc}
|
||||
.align 2, 0
|
||||
_08082928: .4byte gUnk_0811F154
|
||||
|
||||
thumb_func_start sub_0808292C
|
||||
sub_0808292C: @ 0x0808292C
|
||||
push {r4, r5, lr}
|
||||
adds r4, r0, #0
|
||||
ldrb r1, [r4, #0x11]
|
||||
movs r3, #0x10
|
||||
rsbs r3, r3, #0
|
||||
adds r0, r3, #0
|
||||
ands r0, r1
|
||||
movs r1, #6
|
||||
orrs r0, r1
|
||||
strb r0, [r4, #0x11]
|
||||
ldr r5, _080829C8 @ =gPlayerEntity
|
||||
ldrb r1, [r5, #0x19]
|
||||
lsrs r1, r1, #6
|
||||
lsls r1, r1, #6
|
||||
ldrb r2, [r4, #0x19]
|
||||
movs r0, #0x3f
|
||||
ands r0, r2
|
||||
orrs r0, r1
|
||||
strb r0, [r4, #0x19]
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x29
|
||||
ldrb r1, [r0]
|
||||
lsls r1, r1, #0x1d
|
||||
lsrs r1, r1, #0x1d
|
||||
subs r1, #1
|
||||
movs r0, #0x29
|
||||
adds r0, r0, r4
|
||||
mov ip, r0
|
||||
movs r0, #7
|
||||
ands r1, r0
|
||||
mov r0, ip
|
||||
ldrb r2, [r0]
|
||||
movs r0, #8
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r2
|
||||
orrs r0, r1
|
||||
mov r1, ip
|
||||
strb r0, [r1]
|
||||
ldrb r0, [r5, #0x1a]
|
||||
lsls r0, r0, #0x1c
|
||||
lsrs r0, r0, #0x1c
|
||||
ldrb r1, [r4, #0x1a]
|
||||
ands r3, r1
|
||||
orrs r3, r0
|
||||
strb r3, [r4, #0x1a]
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x38
|
||||
ldrb r1, [r0]
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x38
|
||||
strb r1, [r0]
|
||||
movs r0, #1
|
||||
strb r0, [r4, #0xc]
|
||||
ldrb r0, [r5, #0x14]
|
||||
cmp r0, #2
|
||||
bne _080829A4
|
||||
ldrb r0, [r4, #0x18]
|
||||
movs r1, #0x40
|
||||
orrs r0, r1
|
||||
strb r0, [r4, #0x18]
|
||||
_080829A4:
|
||||
adds r0, r4, #0
|
||||
movs r1, #1
|
||||
movs r2, #3
|
||||
bl LoadSwapGFX
|
||||
ldrb r0, [r4, #0xa]
|
||||
cmp r0, #0
|
||||
bne _080829CC
|
||||
movs r0, #7
|
||||
strb r0, [r4, #0xf]
|
||||
adds r0, r4, #0
|
||||
movs r1, #7
|
||||
bl InitAnimationForceUpdate
|
||||
movs r0, #0xf3
|
||||
bl SoundReq
|
||||
b _080829E2
|
||||
.align 2, 0
|
||||
_080829C8: .4byte gPlayerEntity
|
||||
_080829CC:
|
||||
movs r0, #0
|
||||
strb r0, [r4, #0xe]
|
||||
movs r0, #0xa
|
||||
strb r0, [r4, #0xf]
|
||||
ldrh r0, [r4, #0x32]
|
||||
subs r0, #0xe
|
||||
strh r0, [r4, #0x32]
|
||||
adds r0, r4, #0
|
||||
movs r1, #0x14
|
||||
bl InitAnimationForceUpdate
|
||||
_080829E2:
|
||||
pop {r4, r5, pc}
|
||||
|
||||
thumb_func_start sub_080829E4
|
||||
sub_080829E4: @ 0x080829E4
|
||||
push {r4, r5, lr}
|
||||
adds r5, r0, #0
|
||||
ldr r0, _08082A10 @ =gPlayerEntity
|
||||
ldrb r1, [r0, #0x1a]
|
||||
lsls r1, r1, #0x1c
|
||||
lsrs r1, r1, #0x1c
|
||||
ldrb r2, [r5, #0x1a]
|
||||
movs r0, #0x10
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r2
|
||||
orrs r0, r1
|
||||
strb r0, [r5, #0x1a]
|
||||
ldr r3, _08082A14 @ =gMessage
|
||||
ldrb r0, [r3]
|
||||
movs r1, #0x7f
|
||||
ands r1, r0
|
||||
cmp r1, #0
|
||||
bne _08082A18
|
||||
adds r0, r5, #0
|
||||
bl DeleteEntity
|
||||
b _08082AB4
|
||||
.align 2, 0
|
||||
_08082A10: .4byte gPlayerEntity
|
||||
_08082A14: .4byte gMessage
|
||||
_08082A18:
|
||||
cmp r1, #5
|
||||
beq _08082A9C
|
||||
ldrb r1, [r3, #1]
|
||||
adds r0, r1, #0
|
||||
cmp r0, #0xa
|
||||
beq _08082A30
|
||||
cmp r0, #0
|
||||
beq _08082A30
|
||||
movs r0, #0xf
|
||||
ands r0, r1
|
||||
cmp r0, #9
|
||||
bls _08082A4A
|
||||
_08082A30:
|
||||
adds r1, r5, #0
|
||||
adds r1, #0x58
|
||||
ldrb r2, [r5, #0xf]
|
||||
movs r0, #3
|
||||
ldrb r1, [r1]
|
||||
orrs r2, r0
|
||||
cmp r1, r2
|
||||
beq _08082A9C
|
||||
adds r0, r5, #0
|
||||
adds r1, r2, #0
|
||||
bl InitAnimationForceUpdate
|
||||
b _08082AB4
|
||||
_08082A4A:
|
||||
movs r0, #0x80
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _08082A78
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x5a
|
||||
ldrb r1, [r0]
|
||||
movs r0, #0x90
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _08082A9C
|
||||
bl Random
|
||||
ldr r4, _08082A74 @ =gUnk_0811F16C
|
||||
movs r1, #9
|
||||
bl __modsi3
|
||||
adds r0, r0, r4
|
||||
ldrb r0, [r0]
|
||||
strb r0, [r5, #0xf]
|
||||
b _08082A8C
|
||||
.align 2, 0
|
||||
_08082A74: .4byte gUnk_0811F16C
|
||||
_08082A78:
|
||||
adds r2, r5, #0
|
||||
adds r2, #0x58
|
||||
ldr r1, _08082A98 @ =gUnk_0811F16C
|
||||
ldrb r0, [r3, #1]
|
||||
adds r0, r0, r1
|
||||
ldrb r1, [r0]
|
||||
ldrb r0, [r2]
|
||||
cmp r0, r1
|
||||
beq _08082A9C
|
||||
strb r1, [r5, #0xf]
|
||||
_08082A8C:
|
||||
ldrb r1, [r5, #0xf]
|
||||
adds r0, r5, #0
|
||||
bl InitAnimationForceUpdate
|
||||
b _08082AB4
|
||||
.align 2, 0
|
||||
_08082A98: .4byte gUnk_0811F16C
|
||||
_08082A9C:
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x58
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #7
|
||||
bls _08082AAA
|
||||
movs r0, #1
|
||||
b _08082AAC
|
||||
_08082AAA:
|
||||
movs r0, #0
|
||||
_08082AAC:
|
||||
strb r0, [r5, #0xe]
|
||||
adds r0, r5, #0
|
||||
bl UpdateAnimationSingleFrame
|
||||
_08082AB4:
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_08082AB8
|
||||
sub_08082AB8: @ 0x08082AB8
|
||||
push {r4, r5, lr}
|
||||
adds r4, r0, #0
|
||||
ldr r0, _08082B10 @ =gPlayerState
|
||||
ldr r0, [r0, #0x30]
|
||||
movs r5, #0x80
|
||||
ands r0, r5
|
||||
cmp r0, #0
|
||||
beq _08082ACC
|
||||
bl DeleteThisEntity
|
||||
_08082ACC:
|
||||
adds r0, r4, #0
|
||||
bl UpdateAnimationSingleFrame
|
||||
ldrb r0, [r4, #0xd]
|
||||
cmp r0, #0
|
||||
bne _08082B5C
|
||||
ldrb r0, [r4, #0xf]
|
||||
subs r0, #1
|
||||
strb r0, [r4, #0xf]
|
||||
lsls r0, r0, #0x18
|
||||
lsrs r0, r0, #0x18
|
||||
cmp r0, #0xff
|
||||
bne _08082B98
|
||||
ldrb r0, [r4, #0xe]
|
||||
adds r0, #1
|
||||
strb r0, [r4, #0xe]
|
||||
movs r0, #0xa
|
||||
strb r0, [r4, #0xf]
|
||||
ldrb r0, [r4, #0xe]
|
||||
subs r5, r0, #1
|
||||
adds r0, r4, #0
|
||||
movs r1, #0x79
|
||||
adds r2, r5, #0
|
||||
movs r3, #0
|
||||
bl CreateObjectWithParent
|
||||
adds r1, r0, #0
|
||||
str r1, [r4, #0x54]
|
||||
cmp r1, #0
|
||||
beq _08082B18
|
||||
cmp r5, #0
|
||||
bne _08082B14
|
||||
str r1, [r4, #0x50]
|
||||
b _08082B18
|
||||
.align 2, 0
|
||||
_08082B10: .4byte gPlayerState
|
||||
_08082B14:
|
||||
ldr r0, [r4, #0x50]
|
||||
str r0, [r1, #0x50]
|
||||
_08082B18:
|
||||
ldrb r0, [r4, #0xe]
|
||||
cmp r0, #6
|
||||
bne _08082B36
|
||||
movs r0, #3
|
||||
strb r0, [r4, #0xd]
|
||||
movs r0, #0x3c
|
||||
strb r0, [r4, #0xe]
|
||||
ldr r1, [r4, #0x50]
|
||||
movs r0, #1
|
||||
strb r0, [r1, #0xb]
|
||||
adds r0, r4, #0
|
||||
movs r1, #0x1c
|
||||
bl InitAnimationForceUpdate
|
||||
b _08082B98
|
||||
_08082B36:
|
||||
ldr r1, _08082B58 @ =gUnk_0811F178
|
||||
ldrb r0, [r4, #0xe]
|
||||
subs r0, #1
|
||||
lsls r0, r0, #2
|
||||
adds r0, r0, r1
|
||||
ldr r1, [r0]
|
||||
adds r0, r4, #0
|
||||
bl InitAnimationForceUpdate
|
||||
ldrb r0, [r4, #0xe]
|
||||
cmp r0, #2
|
||||
bls _08082B98
|
||||
ldrb r0, [r4, #0x18]
|
||||
movs r1, #0x40
|
||||
orrs r0, r1
|
||||
strb r0, [r4, #0x18]
|
||||
b _08082B98
|
||||
.align 2, 0
|
||||
_08082B58: .4byte gUnk_0811F178
|
||||
_08082B5C:
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x5a
|
||||
ldrb r1, [r0]
|
||||
adds r0, r5, #0
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _08082B98
|
||||
bl Random
|
||||
movs r1, #3
|
||||
ands r0, r1
|
||||
strb r0, [r4, #0xe]
|
||||
cmp r0, #0
|
||||
beq _08082B98
|
||||
bl Random
|
||||
movs r1, #1
|
||||
ands r1, r0
|
||||
lsls r1, r1, #6
|
||||
ldrb r2, [r4, #0x18]
|
||||
movs r0, #0x41
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r2
|
||||
orrs r0, r1
|
||||
strb r0, [r4, #0x18]
|
||||
ldrb r1, [r4, #0xe]
|
||||
adds r1, #0x1b
|
||||
adds r0, r4, #0
|
||||
bl InitAnimationForceUpdate
|
||||
_08082B98:
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_08082B9C
|
||||
sub_08082B9C: @ 0x08082B9C
|
||||
push {r4, r5, r6, lr}
|
||||
adds r6, r0, #0
|
||||
ldrb r1, [r6, #0x11]
|
||||
movs r2, #0x10
|
||||
rsbs r2, r2, #0
|
||||
adds r0, r2, #0
|
||||
ands r0, r1
|
||||
movs r1, #2
|
||||
orrs r0, r1
|
||||
strb r0, [r6, #0x11]
|
||||
ldr r5, _08082C34 @ =gPlayerEntity
|
||||
ldrb r0, [r5, #0x1a]
|
||||
lsls r0, r0, #0x1c
|
||||
lsrs r0, r0, #0x1c
|
||||
ldrb r1, [r6, #0x1a]
|
||||
ands r2, r1
|
||||
orrs r2, r0
|
||||
strb r2, [r6, #0x1a]
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x38
|
||||
ldrb r1, [r0]
|
||||
adds r0, r6, #0
|
||||
adds r0, #0x38
|
||||
movs r4, #0
|
||||
strb r1, [r0]
|
||||
adds r2, r6, #0
|
||||
adds r2, #0x29
|
||||
ldrb r1, [r2]
|
||||
movs r0, #0x39
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r1
|
||||
movs r1, #0x18
|
||||
orrs r0, r1
|
||||
strb r0, [r2]
|
||||
ldrb r1, [r6, #0x18]
|
||||
movs r0, #0x31
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r1
|
||||
movs r1, #0x10
|
||||
orrs r0, r1
|
||||
strb r0, [r6, #0x18]
|
||||
movs r0, #1
|
||||
strb r0, [r6, #0xc]
|
||||
adds r0, r6, #0
|
||||
movs r1, #1
|
||||
movs r2, #3
|
||||
bl LoadSwapGFX
|
||||
adds r0, r6, #0
|
||||
movs r1, #0xc
|
||||
bl InitAnimationForceUpdate
|
||||
adds r0, r6, #0
|
||||
adds r0, #0x82
|
||||
strh r4, [r0]
|
||||
adds r4, r6, #0
|
||||
adds r4, #0x84
|
||||
ldr r1, [r4]
|
||||
adds r0, r6, #0
|
||||
bl ExecuteScript
|
||||
ldr r1, [r4]
|
||||
adds r0, r6, #0
|
||||
bl sub_08082D20
|
||||
ldrb r0, [r5, #0x14]
|
||||
cmp r0, #2
|
||||
bne _08082C2C
|
||||
ldrb r0, [r6, #0x18]
|
||||
movs r1, #0x40
|
||||
orrs r0, r1
|
||||
strb r0, [r6, #0x18]
|
||||
_08082C2C:
|
||||
adds r0, r6, #0
|
||||
bl sub_08082C5C
|
||||
pop {r4, r5, r6, pc}
|
||||
.align 2, 0
|
||||
_08082C34: .4byte gPlayerEntity
|
||||
|
||||
thumb_func_start sub_08082C38
|
||||
sub_08082C38: @ 0x08082C38
|
||||
push {r4, r5, lr}
|
||||
adds r5, r0, #0
|
||||
adds r4, r5, #0
|
||||
adds r4, #0x84
|
||||
ldr r1, [r4]
|
||||
bl ExecuteScript
|
||||
ldr r1, [r4]
|
||||
adds r0, r5, #0
|
||||
bl sub_08082D20
|
||||
ldrb r0, [r5, #0xc]
|
||||
cmp r0, #1
|
||||
bhi _08082C5A
|
||||
adds r0, r5, #0
|
||||
bl sub_08082C5C
|
||||
_08082C5A:
|
||||
pop {r4, r5, pc}
|
||||
|
||||
thumb_func_start sub_08082C5C
|
||||
sub_08082C5C: @ 0x08082C5C
|
||||
push {r4, r5, lr}
|
||||
adds r5, r0, #0
|
||||
ldrb r0, [r5, #0xd]
|
||||
cmp r0, #4
|
||||
bhi _08082D0C
|
||||
lsls r0, r0, #2
|
||||
ldr r1, _08082C70 @ =_08082C74
|
||||
adds r0, r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.align 2, 0
|
||||
_08082C70: .4byte _08082C74
|
||||
_08082C74: @ jump table
|
||||
.4byte _08082C88 @ case 0
|
||||
.4byte _08082C9C @ case 1
|
||||
.4byte _08082CB0 @ case 2
|
||||
.4byte _08082CE4 @ case 3
|
||||
.4byte _08082CF8 @ case 4
|
||||
_08082C88:
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x58
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #0x17
|
||||
beq _08082D0C
|
||||
adds r0, r5, #0
|
||||
movs r1, #0x17
|
||||
bl InitAnimationForceUpdate
|
||||
b _08082D1C
|
||||
_08082C9C:
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x58
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #0x18
|
||||
beq _08082D0C
|
||||
adds r0, r5, #0
|
||||
movs r1, #0x18
|
||||
bl InitAnimationForceUpdate
|
||||
b _08082D1C
|
||||
_08082CB0:
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x5a
|
||||
ldrb r1, [r0]
|
||||
movs r0, #0x80
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _08082D0C
|
||||
bl Random
|
||||
adds r4, r0, #0
|
||||
bl Random
|
||||
adds r1, r0, #0
|
||||
ldr r2, _08082CE0 @ =gUnk_0811F18C
|
||||
movs r0, #3
|
||||
ands r4, r0
|
||||
adds r4, r4, r2
|
||||
ands r1, r0
|
||||
ldrb r4, [r4]
|
||||
adds r1, r1, r4
|
||||
adds r0, r5, #0
|
||||
bl InitAnimationForceUpdate
|
||||
b _08082D1C
|
||||
.align 2, 0
|
||||
_08082CE0: .4byte gUnk_0811F18C
|
||||
_08082CE4:
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x58
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #0x13
|
||||
beq _08082D0C
|
||||
adds r0, r5, #0
|
||||
movs r1, #0x13
|
||||
bl InitAnimationForceUpdate
|
||||
b _08082D1C
|
||||
_08082CF8:
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x58
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #0x1a
|
||||
beq _08082D0C
|
||||
adds r0, r5, #0
|
||||
movs r1, #0x1a
|
||||
bl InitAnimationForceUpdate
|
||||
b _08082D1C
|
||||
_08082D0C:
|
||||
movs r1, #0x80
|
||||
lsls r1, r1, #6
|
||||
adds r0, r5, #0
|
||||
bl GravityUpdate
|
||||
adds r0, r5, #0
|
||||
bl UpdateAnimationSingleFrame
|
||||
_08082D1C:
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_08082D20
|
||||
sub_08082D20: @ 0x08082D20
|
||||
push {r4, r5, r6, r7, lr}
|
||||
adds r4, r0, #0
|
||||
adds r3, r1, #0
|
||||
ldr r0, [r3, #8]
|
||||
cmp r0, #0
|
||||
beq _08082E10
|
||||
movs r6, #0
|
||||
movs r5, #1
|
||||
movs r0, #4
|
||||
rsbs r0, r0, #0
|
||||
mov ip, r0
|
||||
_08082D36:
|
||||
ldr r1, [r3, #8]
|
||||
mvns r0, r1
|
||||
adds r2, r0, #1
|
||||
ands r2, r1
|
||||
eors r1, r2
|
||||
str r1, [r3, #8]
|
||||
cmp r2, #0x80
|
||||
beq _08082DB4
|
||||
cmp r2, #0x80
|
||||
bhi _08082D66
|
||||
cmp r2, #4
|
||||
beq _08082D9E
|
||||
cmp r2, #4
|
||||
bhi _08082D5C
|
||||
cmp r2, #1
|
||||
beq _08082D96
|
||||
cmp r2, #2
|
||||
beq _08082D9A
|
||||
b _08082E0A
|
||||
_08082D5C:
|
||||
cmp r2, #8
|
||||
beq _08082DA4
|
||||
cmp r2, #0x40
|
||||
beq _08082DDA
|
||||
b _08082E0A
|
||||
_08082D66:
|
||||
movs r0, #0x80
|
||||
lsls r0, r0, #0xd
|
||||
cmp r2, r0
|
||||
beq _08082DDE
|
||||
cmp r2, r0
|
||||
bhi _08082D84
|
||||
movs r0, #0x80
|
||||
lsls r0, r0, #1
|
||||
cmp r2, r0
|
||||
beq _08082DAA
|
||||
movs r0, #0x80
|
||||
lsls r0, r0, #0xa
|
||||
cmp r2, r0
|
||||
beq _08082DC0
|
||||
b _08082E0A
|
||||
_08082D84:
|
||||
movs r0, #0x80
|
||||
lsls r0, r0, #0xe
|
||||
cmp r2, r0
|
||||
beq _08082DE6
|
||||
movs r0, #0x80
|
||||
lsls r0, r0, #0xf
|
||||
cmp r2, r0
|
||||
beq _08082DF2
|
||||
b _08082E0A
|
||||
_08082D96:
|
||||
strb r6, [r4, #0xd]
|
||||
b _08082E0A
|
||||
_08082D9A:
|
||||
strb r5, [r4, #0xd]
|
||||
b _08082E0A
|
||||
_08082D9E:
|
||||
movs r0, #2
|
||||
strb r0, [r4, #0xd]
|
||||
b _08082E0A
|
||||
_08082DA4:
|
||||
movs r0, #3
|
||||
strb r0, [r4, #0xd]
|
||||
b _08082E0A
|
||||
_08082DAA:
|
||||
ldrb r0, [r4, #0x18]
|
||||
mov r1, ip
|
||||
ands r0, r1
|
||||
strb r0, [r4, #0x18]
|
||||
b _08082E0A
|
||||
_08082DB4:
|
||||
ldrb r0, [r4, #0x18]
|
||||
mov r7, ip
|
||||
ands r0, r7
|
||||
orrs r0, r5
|
||||
strb r0, [r4, #0x18]
|
||||
b _08082E0A
|
||||
_08082DC0:
|
||||
ldrb r0, [r4, #0x18]
|
||||
lsls r1, r0, #0x19
|
||||
lsrs r1, r1, #0x1f
|
||||
eors r1, r5
|
||||
ands r1, r5
|
||||
lsls r1, r1, #6
|
||||
movs r7, #0x41
|
||||
rsbs r7, r7, #0
|
||||
adds r2, r7, #0
|
||||
ands r0, r2
|
||||
orrs r0, r1
|
||||
strb r0, [r4, #0x18]
|
||||
b _08082E0A
|
||||
_08082DDA:
|
||||
bl DeleteThisEntity
|
||||
_08082DDE:
|
||||
movs r0, #2
|
||||
strb r0, [r4, #0xc]
|
||||
strb r6, [r4, #0xd]
|
||||
b _08082E10
|
||||
_08082DE6:
|
||||
movs r0, #4
|
||||
strb r0, [r4, #0xd]
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x62
|
||||
strb r0, [r1]
|
||||
b _08082E0A
|
||||
_08082DF2:
|
||||
movs r0, #3
|
||||
strb r0, [r4, #0xc]
|
||||
strb r6, [r4, #0xd]
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x62
|
||||
movs r0, #4
|
||||
strb r0, [r1]
|
||||
adds r0, r4, #0
|
||||
movs r1, #0x1b
|
||||
bl InitAnimationForceUpdate
|
||||
b _08082E10
|
||||
_08082E0A:
|
||||
ldr r0, [r3, #8]
|
||||
cmp r0, #0
|
||||
bne _08082D36
|
||||
_08082E10:
|
||||
pop {r4, r5, r6, r7, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_08082E14
|
||||
sub_08082E14: @ 0x08082E14
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
adds r0, #0x84
|
||||
ldr r1, [r0]
|
||||
adds r0, r4, #0
|
||||
bl ExecuteScript
|
||||
movs r1, #0xc0
|
||||
lsls r1, r1, #5
|
||||
adds r0, r4, #0
|
||||
bl GravityUpdate
|
||||
ldrb r0, [r4, #0xd]
|
||||
cmp r0, #0
|
||||
beq _08082E38
|
||||
cmp r0, #1
|
||||
beq _08082E44
|
||||
b _08082E5E
|
||||
_08082E38:
|
||||
ldr r0, [r4, #0x20]
|
||||
cmp r0, #0
|
||||
bge _08082E5E
|
||||
movs r0, #1
|
||||
strb r0, [r4, #0xd]
|
||||
b _08082E5E
|
||||
_08082E44:
|
||||
movs r0, #0x36
|
||||
ldrsh r1, [r4, r0]
|
||||
movs r0, #0xa
|
||||
rsbs r0, r0, #0
|
||||
cmp r1, r0
|
||||
ble _08082E5E
|
||||
ldr r0, _08082E68 @ =gActiveScriptInfo
|
||||
ldr r1, [r0]
|
||||
movs r2, #2
|
||||
orrs r1, r2
|
||||
str r1, [r0]
|
||||
bl DeleteThisEntity
|
||||
_08082E5E:
|
||||
adds r0, r4, #0
|
||||
bl UpdateAnimationSingleFrame
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
_08082E68: .4byte gActiveScriptInfo
|
||||
|
||||
thumb_func_start sub_08082E6C
|
||||
sub_08082E6C: @ 0x08082E6C
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
bl UpdateAnimationSingleFrame
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x5a
|
||||
ldrb r1, [r0]
|
||||
movs r0, #0x80
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _08082E98
|
||||
movs r1, #0
|
||||
movs r0, #1
|
||||
strb r0, [r4, #0xc]
|
||||
strb r1, [r4, #0xd]
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x62
|
||||
strb r1, [r0]
|
||||
adds r0, r4, #0
|
||||
movs r1, #0x17
|
||||
bl InitAnimationForceUpdate
|
||||
_08082E98:
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
|
|
@ -42234,21 +42234,6 @@
|
|||
"size": 6,
|
||||
"type": "animation"
|
||||
},
|
||||
{
|
||||
"path": "ezloCap/gUnk_0811F16C.bin",
|
||||
"start": 1175916,
|
||||
"size": 12
|
||||
},
|
||||
{
|
||||
"path": "ezloCap/gUnk_0811F178.bin",
|
||||
"start": 1175928,
|
||||
"size": 20
|
||||
},
|
||||
{
|
||||
"path": "ezloCap/gUnk_0811F18C.bin",
|
||||
"start": 1175948,
|
||||
"size": 4
|
||||
},
|
||||
{
|
||||
"path": "animations/gSpriteAnimations_Object9_0.bin",
|
||||
"start": 1177440,
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.section .rodata
|
||||
.align 2
|
||||
|
||||
gUnk_0811F14C:: @ 0811F14C
|
||||
.4byte sub_0808292C
|
||||
.4byte sub_080829E4
|
||||
|
||||
gUnk_0811F154:: @ 0811F154
|
||||
.4byte sub_0808292C
|
||||
.4byte sub_08082AB8
|
||||
|
||||
gUnk_0811F15C:: @ 0811F15C
|
||||
.4byte sub_08082B9C
|
||||
.4byte sub_08082C38
|
||||
.4byte sub_08082E14
|
||||
.4byte sub_08082E6C
|
||||
|
||||
gUnk_0811F16C:: @ 0811F16C
|
||||
.incbin "ezloCap/gUnk_0811F16C.bin"
|
||||
|
||||
gUnk_0811F178:: @ 0811F178
|
||||
.incbin "ezloCap/gUnk_0811F178.bin"
|
||||
|
||||
gUnk_0811F18C:: @ 0811F18C
|
||||
.incbin "ezloCap/gUnk_0811F18C.bin"
|
||||
|
|
@ -232,7 +232,7 @@ void ItemForSale(Entity*);
|
|||
void Button(Entity*);
|
||||
void MinishEmoticon(Entity*);
|
||||
void Pot(Entity*);
|
||||
void EzloCap(Entity*);
|
||||
void EzloCap();
|
||||
void BlockPushed();
|
||||
void LockedDoor(Entity*);
|
||||
void Object9(Entity*);
|
||||
|
|
|
|||
|
|
@ -649,7 +649,7 @@ SECTIONS {
|
|||
src/object/button.o(.text);
|
||||
asm/object/minishEmoticon.o(.text);
|
||||
src/object/pot.o(.text);
|
||||
asm/object/ezloCap.o(.text);
|
||||
src/object/ezloCap.o(.text);
|
||||
src/object/blockPushed.o(.text);
|
||||
src/object/lockedDoor.o(.text);
|
||||
asm/object/object9.o(.text);
|
||||
|
|
@ -1368,7 +1368,7 @@ SECTIONS {
|
|||
data/animations/object/minishEmoticon.o(.rodata);
|
||||
data/const/object/pot.o(.rodata);
|
||||
data/animations/object/pot.o(.rodata);
|
||||
data/const/object/ezloCap.o(.rodata);
|
||||
src/object/ezloCap.o(.rodata);
|
||||
data/animations/object/ezloCap.o(.rodata);
|
||||
src/object/blockPushed.o(.rodata);
|
||||
src/object/lockedDoor.o(.rodata);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,301 @@
|
|||
/**
|
||||
* @file ezloCap.c
|
||||
* @ingroup Objects
|
||||
*
|
||||
* @brief Ezlo Cap object
|
||||
*/
|
||||
|
||||
#define NENT_DEPRECATED
|
||||
#include "global.h"
|
||||
#include "object.h"
|
||||
#include "functions.h"
|
||||
#include "message.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
/*0x68*/ u8 unk_68[0x1a];
|
||||
/*0x82*/ u16 unk_82;
|
||||
/*0x84*/ ScriptExecutionContext* unk_84;
|
||||
} EzloCapEntity;
|
||||
|
||||
void sub_08082D20(EzloCapEntity*, ScriptExecutionContext*);
|
||||
void sub_08082C5C(EzloCapEntity*);
|
||||
void EzloCap_Type0Init(EzloCapEntity*);
|
||||
void EzloCap_Type0Action1(EzloCapEntity*);
|
||||
void EzloCap_Type1Action1(EzloCapEntity*);
|
||||
void EzloCap_ScriptedInit(EzloCapEntity*);
|
||||
void EzloCap_ScriptedAction1(EzloCapEntity*);
|
||||
void EzloCap_ScriptedAction2(EzloCapEntity*);
|
||||
void EzloCap_ScriptedAction3(EzloCapEntity*);
|
||||
|
||||
void EzloCap(EzloCapEntity* this) {
|
||||
static void (*const EzloCap_Type0Actions[])(EzloCapEntity*) = {
|
||||
EzloCap_Type0Init,
|
||||
EzloCap_Type0Action1,
|
||||
};
|
||||
static void (*const EzloCap_Type1Actions[])(EzloCapEntity*) = {
|
||||
EzloCap_Type0Init,
|
||||
EzloCap_Type1Action1,
|
||||
};
|
||||
static void (*const EzloCap_ScriptedActions[])(EzloCapEntity*) = {
|
||||
EzloCap_ScriptedInit,
|
||||
EzloCap_ScriptedAction1,
|
||||
EzloCap_ScriptedAction2,
|
||||
EzloCap_ScriptedAction3,
|
||||
};
|
||||
void (*ppuVar1[0])(EzloCapEntity*);
|
||||
|
||||
if ((super->flags & ENT_SCRIPTED) != 0) {
|
||||
EzloCap_ScriptedActions[super->action](this);
|
||||
} else {
|
||||
if (super->type == 0) {
|
||||
EzloCap_Type0Actions[super->action](this);
|
||||
} else {
|
||||
EzloCap_Type1Actions[super->action](this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EzloCap_Type0Init(EzloCapEntity* this) {
|
||||
super->updatePriority = 6;
|
||||
super->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
|
||||
super->spritePriority.b0 = gPlayerEntity.spritePriority.b0 - 1;
|
||||
super->palette.b.b0 = gPlayerEntity.palette.b.b0;
|
||||
super->collisionLayer = gPlayerEntity.collisionLayer;
|
||||
super->action = 1;
|
||||
if (gPlayerEntity.animationState == 2) {
|
||||
super->spriteSettings.flipX = 1;
|
||||
}
|
||||
LoadSwapGFX(super, 1, 3);
|
||||
if (super->type == 0) {
|
||||
super->field_0xf = 7;
|
||||
InitAnimationForceUpdate(super, 7);
|
||||
SoundReq(SFX_F3);
|
||||
} else {
|
||||
super->actionDelay = 0;
|
||||
super->field_0xf = 0xa;
|
||||
super->y.HALF.HI -= 0xe;
|
||||
InitAnimationForceUpdate(super, 0x14);
|
||||
}
|
||||
}
|
||||
|
||||
void EzloCap_Type0Action1(EzloCapEntity* this) {
|
||||
static const u8 gUnk_0811F16C[] = { 4, 0, 2, 6, 10, 8, 9, 5, 1, 0, 0, 0 };
|
||||
u32 tmp = gPlayerEntity.palette.b.b0;
|
||||
super->palette.b.b0 = tmp;
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
DeleteEntity(super);
|
||||
return;
|
||||
}
|
||||
if ((gMessage.doTextBox & 0x7f) != 5) {
|
||||
if (((gMessage.unk == 0xa) || (gMessage.unk == 0)) || ((gMessage.unk & 0xf) > 9)) {
|
||||
if (super->animIndex != (super->field_0xf | 3)) {
|
||||
InitAnimationForceUpdate(super, super->field_0xf | 3);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if ((gMessage.unk & 0x80) != 0) {
|
||||
if ((super->frame & 0x90) != 0) {
|
||||
super->field_0xf = gUnk_0811F16C[(s32)Random() % 9];
|
||||
InitAnimationForceUpdate(super, super->field_0xf);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (super->animIndex != gUnk_0811F16C[gMessage.unk]) {
|
||||
super->field_0xf = gUnk_0811F16C[gMessage.unk];
|
||||
InitAnimationForceUpdate(super, super->field_0xf);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (super->animIndex > 7) {
|
||||
super->actionDelay = 1;
|
||||
} else {
|
||||
super->actionDelay = 0;
|
||||
}
|
||||
UpdateAnimationSingleFrame(super);
|
||||
}
|
||||
|
||||
void EzloCap_Type1Action1(EzloCapEntity* this) {
|
||||
static const u32 gUnk_0811F178[] = { 16, 12, 12, 16, 20 };
|
||||
Entity* obj;
|
||||
u32 tmp;
|
||||
|
||||
if ((gPlayerState.flags & PL_MINISH) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
UpdateAnimationSingleFrame(super);
|
||||
if (super->subAction == 0) {
|
||||
if (super->field_0xf-- == 0) {
|
||||
super->actionDelay++;
|
||||
super->field_0xf = 0xa;
|
||||
tmp = super->actionDelay - 1;
|
||||
obj = CreateObjectWithParent(super, OBJECT_79, tmp, 0);
|
||||
super->child = obj;
|
||||
if (obj != NULL) {
|
||||
if (tmp == 0) {
|
||||
super->parent = obj;
|
||||
} else {
|
||||
obj->parent = super->parent;
|
||||
}
|
||||
}
|
||||
if (super->actionDelay == 6) {
|
||||
super->subAction = 3;
|
||||
super->actionDelay = 0x3c;
|
||||
super->parent->type2 = 1;
|
||||
InitAnimationForceUpdate(super, 0x1c);
|
||||
} else {
|
||||
InitAnimationForceUpdate(super, gUnk_0811F178[super->actionDelay - 1]);
|
||||
if (super->actionDelay > 2) {
|
||||
super->spriteSettings.flipX = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ((super->frame & 0x80) != 0) {
|
||||
super->actionDelay = Random() & 3;
|
||||
if (super->actionDelay != 0) {
|
||||
super->spriteSettings.flipX = Random() & 1;
|
||||
InitAnimationForceUpdate(super, super->actionDelay + 0x1b);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EzloCap_ScriptedInit(EzloCapEntity* this) {
|
||||
super->updatePriority = 2;
|
||||
super->palette.b.b0 = gPlayerEntity.palette.b.b0;
|
||||
super->collisionLayer = gPlayerEntity.collisionLayer;
|
||||
super->spritePriority.b1 = 3;
|
||||
super->spriteSettings.shadow = 1;
|
||||
super->action = 1;
|
||||
LoadSwapGFX(super, 1, 3);
|
||||
InitAnimationForceUpdate(super, 0xc);
|
||||
this->unk_82 = 0;
|
||||
ExecuteScript(super, this->unk_84);
|
||||
sub_08082D20(this, this->unk_84);
|
||||
if (gPlayerEntity.animationState == 2) {
|
||||
super->spriteSettings.flipX = 1;
|
||||
}
|
||||
sub_08082C5C(this);
|
||||
}
|
||||
|
||||
void EzloCap_ScriptedAction1(EzloCapEntity* this) {
|
||||
ExecuteScript(super, this->unk_84);
|
||||
sub_08082D20(this, this->unk_84);
|
||||
if (super->action < 2) {
|
||||
sub_08082C5C(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08082C5C(EzloCapEntity* this) {
|
||||
static const u8 gUnk_0811F18C[] = { 12, 20, 16, 20 };
|
||||
switch (super->subAction) {
|
||||
case 0:
|
||||
if (super->animIndex != 0x17) {
|
||||
InitAnimationForceUpdate(super, 0x17);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (super->animIndex != 0x18) {
|
||||
InitAnimationForceUpdate(super, 0x18);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if ((super->frame & 0x80) != 0) {
|
||||
InitAnimationForceUpdate(super, gUnk_0811F18C[Random() & 3] + (Random() & 3));
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (super->animIndex != 0x13) {
|
||||
InitAnimationForceUpdate(super, 0x13);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (super->animIndex != 0x1a) {
|
||||
InitAnimationForceUpdate(super, 0x1a);
|
||||
return;
|
||||
}
|
||||
}
|
||||
GravityUpdate(super, 0x2000);
|
||||
UpdateAnimationSingleFrame(super);
|
||||
}
|
||||
|
||||
void sub_08082D20(EzloCapEntity* this, ScriptExecutionContext* context) {
|
||||
while (context->postScriptActions != 0) {
|
||||
u32 tmp = (~context->postScriptActions + 1) & context->postScriptActions;
|
||||
context->postScriptActions ^= tmp;
|
||||
switch (tmp) {
|
||||
case 1 << 0x00:
|
||||
super->subAction = 0;
|
||||
break;
|
||||
case 1 << 0x01:
|
||||
super->subAction = 1;
|
||||
break;
|
||||
case 1 << 0x02:
|
||||
super->subAction = 2;
|
||||
break;
|
||||
case 1 << 0x03:
|
||||
super->subAction = 3;
|
||||
break;
|
||||
case 1 << 0x08:
|
||||
super->spriteSettings.draw = 0;
|
||||
break;
|
||||
case 1 << 0x07:
|
||||
super->spriteSettings.draw = 1;
|
||||
break;
|
||||
case 1 << 0x11:
|
||||
super->spriteSettings.flipX ^= 1;
|
||||
break;
|
||||
case 1 << 0x06:
|
||||
DeleteThisEntity();
|
||||
// fallthrough
|
||||
case 1 << 0x14:
|
||||
super->action = 2;
|
||||
super->subAction = 0;
|
||||
return;
|
||||
case 1 << 0x15:
|
||||
super->subAction = 4;
|
||||
super->spriteOffsetX = 4;
|
||||
break;
|
||||
case 1 << 0x16:
|
||||
super->action = 3;
|
||||
super->subAction = 0;
|
||||
super->spriteOffsetX = 4;
|
||||
InitAnimationForceUpdate(super, 0x1b);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EzloCap_ScriptedAction2(EzloCapEntity* this) {
|
||||
ExecuteScript(super, this->unk_84);
|
||||
GravityUpdate(super, 0x1800);
|
||||
switch (super->subAction) {
|
||||
case 0:
|
||||
if (super->zVelocity < 0) {
|
||||
super->subAction = 1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (super->z.HALF.HI > -10) {
|
||||
gActiveScriptInfo.syncFlags |= 2;
|
||||
DeleteThisEntity();
|
||||
}
|
||||
break;
|
||||
}
|
||||
UpdateAnimationSingleFrame(super);
|
||||
}
|
||||
|
||||
void EzloCap_ScriptedAction3(EzloCapEntity* this) {
|
||||
UpdateAnimationSingleFrame(super);
|
||||
if ((super->frame & 0x80) != 0) {
|
||||
super->action = 1;
|
||||
super->subAction = 0;
|
||||
super->spriteOffsetX = 0;
|
||||
InitAnimationForceUpdate(super, 0x17);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue