mirror of https://github.com/zeldaret/tmc.git
warpPoint.c: ok
This commit is contained in:
parent
820b3a6829
commit
c50c628c80
568
asm/warpPoint.s
568
asm/warpPoint.s
|
@ -1,568 +0,0 @@
|
|||
.include "asm/macros.inc"
|
||||
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
|
||||
thumb_func_start WarpPoint
|
||||
WarpPoint: @ 0x0808B448
|
||||
push {lr}
|
||||
adds r2, r0, #0
|
||||
adds r0, #0x70
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #0
|
||||
bne _0808B46C
|
||||
ldr r0, _0808B468 @ =gUnk_08121368
|
||||
ldrb r1, [r2, #0xc]
|
||||
lsls r1, r1, #2
|
||||
adds r1, r1, r0
|
||||
ldr r1, [r1]
|
||||
adds r0, r2, #0
|
||||
bl _call_via_r1
|
||||
b _0808B472
|
||||
.align 2, 0
|
||||
_0808B468: .4byte gUnk_08121368
|
||||
_0808B46C:
|
||||
adds r0, r2, #0
|
||||
bl sub_0808B73C
|
||||
_0808B472:
|
||||
pop {pc}
|
||||
|
||||
thumb_func_start sub_0808B474
|
||||
sub_0808B474: @ 0x0808B474
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
movs r1, #0
|
||||
movs r0, #1
|
||||
strb r0, [r4, #0xc]
|
||||
strb r1, [r4, #0xf]
|
||||
ldr r1, _0808B4D8 @ =gUnk_08121380
|
||||
ldrb r0, [r4, #0xa]
|
||||
adds r0, r0, r1
|
||||
ldrb r1, [r0]
|
||||
movs r0, #0xf
|
||||
ands r1, r0
|
||||
ldrb r3, [r4, #0x1a]
|
||||
movs r2, #0x10
|
||||
rsbs r2, r2, #0
|
||||
adds r0, r2, #0
|
||||
ands r0, r3
|
||||
orrs r0, r1
|
||||
strb r0, [r4, #0x1a]
|
||||
adds r3, r4, #0
|
||||
adds r3, #0x29
|
||||
ldrb r1, [r3]
|
||||
movs r0, #8
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r1
|
||||
movs r1, #6
|
||||
orrs r0, r1
|
||||
strb r0, [r3]
|
||||
ldr r0, _0808B4DC @ =gUnk_080FD168
|
||||
str r0, [r4, #0x48]
|
||||
ldrb r0, [r4, #0x11]
|
||||
ands r2, r0
|
||||
movs r0, #3
|
||||
orrs r2, r0
|
||||
strb r2, [r4, #0x11]
|
||||
adds r0, r4, #0
|
||||
movs r1, #0
|
||||
bl InitializeAnimation
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x86
|
||||
ldrh r0, [r0]
|
||||
bl CheckFlags
|
||||
cmp r0, #0
|
||||
beq _0808B4E0
|
||||
adds r0, r4, #0
|
||||
bl sub_0808B830
|
||||
b _0808B4F8
|
||||
.align 2, 0
|
||||
_0808B4D8: .4byte gUnk_08121380
|
||||
_0808B4DC: .4byte gUnk_080FD168
|
||||
_0808B4E0:
|
||||
bl CheckIsDungeon
|
||||
cmp r0, #0
|
||||
beq _0808B4F8
|
||||
ldrb r0, [r4, #0xa]
|
||||
bl sub_0807CAEC
|
||||
cmp r0, #0
|
||||
beq _0808B4F8
|
||||
adds r0, r4, #0
|
||||
bl sub_0808B830
|
||||
_0808B4F8:
|
||||
adds r0, r4, #0
|
||||
bl sub_0808B7C8
|
||||
cmp r0, #0
|
||||
beq _0808B528
|
||||
movs r2, #4
|
||||
strb r2, [r4, #0xc]
|
||||
movs r0, #0x60
|
||||
strb r0, [r4, #0xf]
|
||||
ldr r1, _0808B52C @ =gPlayerEntity
|
||||
ldrh r0, [r4, #0x2e]
|
||||
strh r0, [r1, #0x2e]
|
||||
ldrh r0, [r4, #0x32]
|
||||
strh r0, [r1, #0x32]
|
||||
strb r2, [r1, #0x14]
|
||||
movs r0, #0x89
|
||||
lsls r0, r0, #1
|
||||
bl EnqueueSFX
|
||||
ldrb r1, [r4, #0xf]
|
||||
adds r1, #0x10
|
||||
adds r0, r4, #0
|
||||
bl sub_0805E4E0
|
||||
_0808B528:
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
_0808B52C: .4byte gPlayerEntity
|
||||
|
||||
thumb_func_start sub_0808B530
|
||||
sub_0808B530: @ 0x0808B530
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
adds r0, #0x86
|
||||
ldrh r0, [r0]
|
||||
bl CheckFlags
|
||||
cmp r0, #0
|
||||
beq _0808B562
|
||||
adds r0, r4, #0
|
||||
bl sub_0808B830
|
||||
bl CheckIsDungeon
|
||||
cmp r0, #0
|
||||
beq _0808B554
|
||||
ldrb r0, [r4, #0xa]
|
||||
bl sub_0807CAC8
|
||||
_0808B554:
|
||||
movs r0, #2
|
||||
strb r0, [r4, #0xc]
|
||||
movs r0, #0x3c
|
||||
strb r0, [r4, #0xf]
|
||||
adds r0, #0xd6
|
||||
bl EnqueueSFX
|
||||
_0808B562:
|
||||
pop {r4, pc}
|
||||
|
||||
thumb_func_start sub_0808B564
|
||||
sub_0808B564: @ 0x0808B564
|
||||
push {lr}
|
||||
adds r3, r0, #0
|
||||
ldrb r0, [r3, #0xf]
|
||||
subs r1, r0, #1
|
||||
strb r1, [r3, #0xf]
|
||||
lsls r0, r1, #0x18
|
||||
cmp r0, #0
|
||||
bne _0808B57A
|
||||
movs r0, #3
|
||||
strb r0, [r3, #0xc]
|
||||
b _0808B58E
|
||||
_0808B57A:
|
||||
lsls r0, r1, #0x18
|
||||
lsrs r0, r0, #0x19
|
||||
movs r1, #1
|
||||
bics r1, r0
|
||||
ldrb r2, [r3, #0x18]
|
||||
movs r0, #4
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r2
|
||||
orrs r0, r1
|
||||
strb r0, [r3, #0x18]
|
||||
_0808B58E:
|
||||
pop {pc}
|
||||
|
||||
thumb_func_start sub_0808B590
|
||||
sub_0808B590: @ 0x0808B590
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
bl GetNextFrame
|
||||
adds r0, r4, #0
|
||||
bl sub_0808B7C8
|
||||
cmp r0, #0
|
||||
beq _0808B5E4
|
||||
ldrb r0, [r4, #0xe]
|
||||
cmp r0, #0
|
||||
bne _0808B5E6
|
||||
movs r0, #5
|
||||
strb r0, [r4, #0xc]
|
||||
movs r0, #0x60
|
||||
strb r0, [r4, #0xf]
|
||||
bl sub_08077B20
|
||||
ldr r1, _0808B5DC @ =gPlayerEntity
|
||||
ldrh r0, [r4, #0x2e]
|
||||
strh r0, [r1, #0x2e]
|
||||
ldrh r0, [r4, #0x32]
|
||||
strh r0, [r1, #0x32]
|
||||
movs r0, #4
|
||||
strb r0, [r1, #0x14]
|
||||
ldrb r2, [r1, #0x10]
|
||||
movs r0, #0x7f
|
||||
ands r0, r2
|
||||
strb r0, [r1, #0x10]
|
||||
ldrb r1, [r4, #0xf]
|
||||
adds r1, #0x10
|
||||
adds r0, r4, #0
|
||||
bl sub_0805E4E0
|
||||
ldr r0, _0808B5E0 @ =0x00000113
|
||||
bl SoundReq
|
||||
b _0808B5E6
|
||||
.align 2, 0
|
||||
_0808B5DC: .4byte gPlayerEntity
|
||||
_0808B5E0: .4byte 0x00000113
|
||||
_0808B5E4:
|
||||
strb r0, [r4, #0xe]
|
||||
_0808B5E6:
|
||||
pop {r4, pc}
|
||||
|
||||
thumb_func_start sub_0808B5E8
|
||||
sub_0808B5E8: @ 0x0808B5E8
|
||||
push {r4, r5, lr}
|
||||
adds r4, r0, #0
|
||||
ldrb r0, [r4, #0xf]
|
||||
subs r1, r0, #1
|
||||
strb r1, [r4, #0xf]
|
||||
lsls r0, r1, #0x18
|
||||
cmp r0, #0
|
||||
bne _0808B610
|
||||
movs r0, #3
|
||||
strb r0, [r4, #0xc]
|
||||
movs r0, #1
|
||||
strb r0, [r4, #0xe]
|
||||
ldr r1, _0808B60C @ =gPlayerEntity
|
||||
movs r0, #4
|
||||
strb r0, [r1, #0x14]
|
||||
movs r0, #0x10
|
||||
strb r0, [r1, #0x15]
|
||||
b _0808B67E
|
||||
.align 2, 0
|
||||
_0808B60C: .4byte gPlayerEntity
|
||||
_0808B610:
|
||||
movs r5, #0
|
||||
movs r0, #0x60
|
||||
ands r0, r1
|
||||
cmp r0, #0x20
|
||||
beq _0808B644
|
||||
cmp r0, #0x20
|
||||
bgt _0808B624
|
||||
cmp r0, #0
|
||||
beq _0808B64E
|
||||
b _0808B66E
|
||||
_0808B624:
|
||||
cmp r0, #0x40
|
||||
bne _0808B66E
|
||||
lsls r0, r1, #0x18
|
||||
lsrs r0, r0, #0x18
|
||||
cmp r0, #0x58
|
||||
bne _0808B638
|
||||
movs r0, #0x8a
|
||||
lsls r0, r0, #1
|
||||
bl SoundReq
|
||||
_0808B638:
|
||||
ldrb r1, [r4, #0xf]
|
||||
movs r0, #1
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
bne _0808B66E
|
||||
b _0808B672
|
||||
_0808B644:
|
||||
movs r0, #3
|
||||
ands r1, r0
|
||||
cmp r1, #0
|
||||
bne _0808B66E
|
||||
b _0808B672
|
||||
_0808B64E:
|
||||
movs r0, #7
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
bne _0808B66E
|
||||
ldr r0, _0808B668 @ =gPlayerEntity
|
||||
ldrb r0, [r0, #0x14]
|
||||
cmp r0, #4
|
||||
bne _0808B66C
|
||||
lsls r0, r1, #0x18
|
||||
lsrs r0, r0, #0x18
|
||||
cmp r0, #0x18
|
||||
bls _0808B66E
|
||||
b _0808B672
|
||||
.align 2, 0
|
||||
_0808B668: .4byte gPlayerEntity
|
||||
_0808B66C:
|
||||
movs r5, #1
|
||||
_0808B66E:
|
||||
cmp r5, #0
|
||||
beq _0808B67E
|
||||
_0808B672:
|
||||
ldr r0, _0808B680 @ =gPlayerEntity
|
||||
ldrb r1, [r0, #0x14]
|
||||
adds r1, #2
|
||||
movs r2, #6
|
||||
ands r1, r2
|
||||
strb r1, [r0, #0x14]
|
||||
_0808B67E:
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
_0808B680: .4byte gPlayerEntity
|
||||
|
||||
thumb_func_start sub_0808B684
|
||||
sub_0808B684: @ 0x0808B684
|
||||
push {lr}
|
||||
mov ip, r0
|
||||
ldrb r0, [r0, #0xf]
|
||||
subs r1, r0, #1
|
||||
mov r0, ip
|
||||
strb r1, [r0, #0xf]
|
||||
lsls r0, r1, #0x18
|
||||
lsrs r2, r0, #0x18
|
||||
cmp r2, #0
|
||||
bne _0808B6E8
|
||||
ldr r3, _0808B6E4 @ =gScreenTransition
|
||||
movs r0, #1
|
||||
strb r0, [r3, #8]
|
||||
strb r2, [r3, #9]
|
||||
mov r0, ip
|
||||
adds r0, #0x7c
|
||||
ldrb r0, [r0]
|
||||
strb r0, [r3, #0xc]
|
||||
mov r0, ip
|
||||
adds r0, #0x7d
|
||||
ldrb r0, [r0]
|
||||
strb r0, [r3, #0xd]
|
||||
mov r0, ip
|
||||
adds r0, #0x84
|
||||
ldrh r1, [r0]
|
||||
movs r0, #0x3f
|
||||
ands r0, r1
|
||||
lsls r0, r0, #4
|
||||
adds r0, #8
|
||||
movs r2, #0
|
||||
strh r0, [r3, #0x10]
|
||||
movs r0, #0xfc
|
||||
lsls r0, r0, #4
|
||||
ands r0, r1
|
||||
lsrs r0, r0, #2
|
||||
adds r0, #8
|
||||
strh r0, [r3, #0x12]
|
||||
strb r2, [r3, #0x14]
|
||||
movs r0, #4
|
||||
strb r0, [r3, #0xe]
|
||||
strb r2, [r3, #0xf]
|
||||
mov r1, ip
|
||||
ldrb r0, [r1, #0xa]
|
||||
cmp r0, #2
|
||||
bne _0808B736
|
||||
strb r0, [r3, #9]
|
||||
b _0808B736
|
||||
.align 2, 0
|
||||
_0808B6E4: .4byte gScreenTransition
|
||||
_0808B6E8:
|
||||
movs r0, #0x60
|
||||
ands r0, r1
|
||||
cmp r0, #0x20
|
||||
beq _0808B702
|
||||
cmp r0, #0x20
|
||||
bgt _0808B6FA
|
||||
cmp r0, #0
|
||||
beq _0808B706
|
||||
b _0808B724
|
||||
_0808B6FA:
|
||||
cmp r0, #0x40
|
||||
bne _0808B724
|
||||
movs r0, #7
|
||||
b _0808B710
|
||||
_0808B702:
|
||||
movs r0, #3
|
||||
b _0808B710
|
||||
_0808B706:
|
||||
lsls r0, r1, #0x18
|
||||
lsrs r0, r0, #0x18
|
||||
cmp r0, #0x10
|
||||
bls _0808B718
|
||||
movs r0, #1
|
||||
_0808B710:
|
||||
ands r1, r0
|
||||
cmp r1, #0
|
||||
bne _0808B724
|
||||
b _0808B72A
|
||||
_0808B718:
|
||||
ldr r2, _0808B738 @ =gPlayerEntity
|
||||
ldrb r1, [r2, #0x18]
|
||||
movs r0, #4
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r1
|
||||
strb r0, [r2, #0x18]
|
||||
_0808B724:
|
||||
movs r0, #0
|
||||
cmp r0, #0
|
||||
beq _0808B736
|
||||
_0808B72A:
|
||||
ldr r0, _0808B738 @ =gPlayerEntity
|
||||
ldrb r1, [r0, #0x14]
|
||||
adds r1, #2
|
||||
movs r2, #6
|
||||
ands r1, r2
|
||||
strb r1, [r0, #0x14]
|
||||
_0808B736:
|
||||
pop {pc}
|
||||
.align 2, 0
|
||||
_0808B738: .4byte gPlayerEntity
|
||||
|
||||
thumb_func_start sub_0808B73C
|
||||
sub_0808B73C: @ 0x0808B73C
|
||||
push {r4, r5, lr}
|
||||
adds r4, r0, #0
|
||||
ldrb r0, [r4, #0xc]
|
||||
cmp r0, #0
|
||||
bne _0808B766
|
||||
movs r0, #1
|
||||
strb r0, [r4, #0xc]
|
||||
ldr r0, [r4, #0x50]
|
||||
ldrb r1, [r0, #0x1a]
|
||||
lsls r1, r1, #0x1c
|
||||
lsrs r1, r1, #0x1c
|
||||
ldrb r2, [r4, #0x1a]
|
||||
movs r0, #0x10
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r2
|
||||
orrs r0, r1
|
||||
strb r0, [r4, #0x1a]
|
||||
adds r0, r4, #0
|
||||
movs r1, #1
|
||||
bl InitializeAnimation
|
||||
_0808B766:
|
||||
ldr r5, _0808B78C @ =gPlayerEntity
|
||||
movs r0, #0x2e
|
||||
ldrsh r1, [r5, r0]
|
||||
movs r0, #0x32
|
||||
ldrsh r2, [r5, r0]
|
||||
adds r0, r4, #0
|
||||
movs r3, #0x28
|
||||
bl sub_0806FCB8
|
||||
cmp r0, #0
|
||||
beq _0808B790
|
||||
ldrb r0, [r4, #0x18]
|
||||
movs r1, #4
|
||||
rsbs r1, r1, #0
|
||||
ands r1, r0
|
||||
movs r0, #1
|
||||
orrs r1, r0
|
||||
strb r1, [r4, #0x18]
|
||||
b _0808B7C0
|
||||
.align 2, 0
|
||||
_0808B78C: .4byte gPlayerEntity
|
||||
_0808B790:
|
||||
movs r0, #0x2e
|
||||
ldrsh r1, [r5, r0]
|
||||
movs r0, #0x32
|
||||
ldrsh r2, [r5, r0]
|
||||
adds r0, r4, #0
|
||||
movs r3, #0x2e
|
||||
bl sub_0806FCB8
|
||||
cmp r0, #0
|
||||
beq _0808B7B6
|
||||
ldrb r2, [r4, #0x18]
|
||||
lsls r1, r2, #0x1e
|
||||
lsrs r1, r1, #0x1e
|
||||
movs r0, #1
|
||||
eors r1, r0
|
||||
subs r0, #5
|
||||
ands r0, r2
|
||||
orrs r0, r1
|
||||
b _0808B7BE
|
||||
_0808B7B6:
|
||||
ldrb r1, [r4, #0x18]
|
||||
movs r0, #4
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r1
|
||||
_0808B7BE:
|
||||
strb r0, [r4, #0x18]
|
||||
_0808B7C0:
|
||||
adds r0, r4, #0
|
||||
bl GetNextFrame
|
||||
pop {r4, r5, pc}
|
||||
|
||||
thumb_func_start sub_0808B7C8
|
||||
sub_0808B7C8: @ 0x0808B7C8
|
||||
push {r4, r5, lr}
|
||||
adds r5, r0, #0
|
||||
ldr r2, _0808B824 @ =gPlayerState
|
||||
ldr r0, [r2, #0x30]
|
||||
movs r1, #0x80
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
bne _0808B82C
|
||||
adds r0, r2, #0
|
||||
adds r0, #0xa8
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #0x12
|
||||
beq _0808B82C
|
||||
ldr r4, _0808B828 @ =gPlayerEntity
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x45
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #0
|
||||
beq _0808B82C
|
||||
bl sub_08079F8C
|
||||
cmp r0, #0
|
||||
beq _0808B82C
|
||||
adds r0, r5, #0
|
||||
adds r1, r4, #0
|
||||
movs r2, #5
|
||||
movs r3, #5
|
||||
bl sub_080041A0
|
||||
cmp r0, #0
|
||||
beq _0808B82C
|
||||
movs r1, #0x36
|
||||
ldrsh r0, [r4, r1]
|
||||
cmp r0, #0
|
||||
bne _0808B82C
|
||||
ldrb r0, [r5, #0xe]
|
||||
cmp r0, #0
|
||||
bne _0808B81E
|
||||
ldrb r0, [r4, #0xc]
|
||||
cmp r0, #0x1b
|
||||
bne _0808B81E
|
||||
bl sub_080791D0
|
||||
_0808B81E:
|
||||
movs r0, #1
|
||||
b _0808B82E
|
||||
.align 2, 0
|
||||
_0808B824: .4byte gPlayerState
|
||||
_0808B828: .4byte gPlayerEntity
|
||||
_0808B82C:
|
||||
movs r0, #0
|
||||
_0808B82E:
|
||||
pop {r4, r5, pc}
|
||||
|
||||
thumb_func_start sub_0808B830
|
||||
sub_0808B830: @ 0x0808B830
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
movs r1, #0
|
||||
movs r0, #3
|
||||
strb r0, [r4, #0xc]
|
||||
strb r1, [r4, #0xe]
|
||||
ldrb r1, [r4, #0x18]
|
||||
subs r0, #7
|
||||
ands r0, r1
|
||||
movs r1, #1
|
||||
orrs r0, r1
|
||||
strb r0, [r4, #0x18]
|
||||
movs r0, #0x34
|
||||
movs r1, #0
|
||||
movs r2, #0
|
||||
bl CreateObject
|
||||
adds r2, r0, #0
|
||||
cmp r2, #0
|
||||
beq _0808B86A
|
||||
adds r1, r2, #0
|
||||
adds r1, #0x70
|
||||
movs r0, #1
|
||||
strb r0, [r1]
|
||||
str r4, [r2, #0x50]
|
||||
adds r0, r4, #0
|
||||
adds r1, r2, #0
|
||||
bl CopyPosition
|
||||
_0808B86A:
|
||||
pop {r4, pc}
|
|
@ -289,4 +289,8 @@ extern void sub_080806BC(u32, u32, u32, u32);
|
|||
extern void sub_080186C0(u32);
|
||||
extern void sub_0801855C(void);
|
||||
|
||||
extern u32 sub_0807CAEC(u32);
|
||||
extern void sub_0807CAC8(u32);
|
||||
extern void sub_0805E4E0(Entity*, u32);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -39,7 +39,7 @@ extern struct_02000010 gUnk_02000010;
|
|||
typedef struct {
|
||||
s32 frameCount; // regular frame count? does anything reset it?
|
||||
u8 field_0x4[0x2];
|
||||
u16 field_0x8;
|
||||
u16 field_0x6;
|
||||
bool8 transitioningOut;
|
||||
u8 transitionType; // transition when changing areas
|
||||
u16 field_0xa; // seems to be a tile type
|
||||
|
|
|
@ -757,7 +757,7 @@ SECTIONS {
|
|||
src/object/frozenFlower.o(.text);
|
||||
asm/pullableMushroom.o(.text);
|
||||
asm/bollard.o(.text);
|
||||
asm/warpPoint.o(.text);
|
||||
src/object/warpPoint.o(.text);
|
||||
asm/object35.o(.text);
|
||||
asm/object36.o(.text);
|
||||
asm/object37.o(.text);
|
||||
|
@ -1480,7 +1480,7 @@ data/const/object/object1D.o(.rodata);
|
|||
data/animations/object/pullableMushroom.o(.rodata);
|
||||
data/const/object/bollard.o(.rodata);
|
||||
data/animations/object/bollard.o(.rodata);
|
||||
data/const/object/warpPoint.o(.rodata);
|
||||
src/object/warpPoint.o(.rodata);
|
||||
data/animations/object/warpPoint.o(.rodata);
|
||||
data/const/object/object35.o(.rodata);
|
||||
data/animations/object/object35.o(.rodata);
|
||||
|
|
|
@ -296,8 +296,6 @@ void sub_0805A758(Manager15* this) {
|
|||
}
|
||||
}
|
||||
|
||||
extern void sub_0805E4E0(Manager*, u32);
|
||||
|
||||
void sub_0805A76C(Manager15* this) {
|
||||
if ((gPlayerEntity.currentHealth != 0) && (gPlayerEntity.height.HALF.HI == 0) && (!gPlayerState.field_0x2c)) {
|
||||
switch (gPlayerState.field_0xa9) {
|
||||
|
@ -307,7 +305,7 @@ void sub_0805A76C(Manager15* this) {
|
|||
this->manager.action++;
|
||||
sub_08004168(&gPlayerEntity);
|
||||
gPlayerEntity.animationState = 4;
|
||||
sub_0805E4E0(&this->manager, 0x258);
|
||||
sub_0805E4E0((Entity*)this, 0x258);
|
||||
sub_08078A90(0xFF);
|
||||
gUnk_02034490[0] = 1;
|
||||
gRoomControls.cameraTarget = 0;
|
||||
|
|
|
@ -19,7 +19,6 @@ extern void (*const gUnk_08108D3C[])(Manager2E*);
|
|||
extern void (*const gUnk_08108D44[])(Manager2E*);
|
||||
|
||||
void sub_0805D2F4(Manager2E*);
|
||||
extern void sub_0805E4E0(void*, u32);
|
||||
|
||||
extern void (*const gUnk_08108D50[])(Manager2E*);
|
||||
|
||||
|
@ -52,7 +51,7 @@ void sub_0805D2C0(Manager2E* this) {
|
|||
if (this->manager.unk_0e == 1) {
|
||||
sub_0805D2F4(this);
|
||||
}
|
||||
sub_0805E4E0(this, this->manager.unk_0e);
|
||||
sub_0805E4E0((Entity*)this, this->manager.unk_0e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,6 @@ void sub_08059064(ManagerF*);
|
|||
void sub_080592EC(ManagerF*);
|
||||
void sub_0805930C(ManagerF*);
|
||||
u32 sub_080593CC(ManagerF*);
|
||||
void sub_0805E4E0(ManagerF*, u32);
|
||||
|
||||
// to be moved to headers
|
||||
extern EntityData gUnk_080F4B88[];
|
||||
|
@ -151,7 +150,7 @@ void sub_08058FB0(ManagerF* this) {
|
|||
if (CheckFlags(this->unk_3e)) {
|
||||
this->manager.action = 2;
|
||||
this->manager.unk_0e = 120;
|
||||
sub_0805E4E0(this, 0xF0);
|
||||
sub_0805E4E0((Entity*)this, 0xF0);
|
||||
sub_08059064(this);
|
||||
}
|
||||
break;
|
||||
|
@ -241,7 +240,7 @@ void sub_08059124(ManagerF* this) {
|
|||
break;
|
||||
case 1:
|
||||
if (CheckFlags(this->unk_3e)) {
|
||||
sub_0805E4E0(this, 0x4b);
|
||||
sub_0805E4E0((Entity*)this, 0x4b);
|
||||
this->manager.unk_0e = 0x2d;
|
||||
this->manager.action++;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ void sub_0806DF00(Entity* this) {
|
|||
npc->parent = this;
|
||||
this->field_0x74.HWORD = 0;
|
||||
this->field_0x76.HWORD = 10;
|
||||
gScreenTransition.field_0x8 = 10;
|
||||
gScreenTransition.field_0x6 = 10;
|
||||
sub_0806E014(this);
|
||||
sub_0807DD50(this);
|
||||
} else {
|
||||
|
@ -108,17 +108,17 @@ void sub_0806E1FC(Entity* this) {
|
|||
}
|
||||
|
||||
void sub_0806E20C(void) {
|
||||
if (gScreenTransition.field_0x8 != 0) {
|
||||
if (gScreenTransition.field_0x6 != 0) {
|
||||
TextboxNoOverlapFollow(0x421f);
|
||||
gTextBox.field_0x10 = gScreenTransition.field_0x8;
|
||||
gTextBox.field_0x10 = gScreenTransition.field_0x6;
|
||||
} else {
|
||||
TextboxNoOverlapFollow(0x4220);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0806E23C(void) {
|
||||
if (gScreenTransition.field_0x8 != 0) {
|
||||
ModRupees(gScreenTransition.field_0x8);
|
||||
if (gScreenTransition.field_0x6 != 0) {
|
||||
ModRupees(gScreenTransition.field_0x6);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,230 @@
|
|||
#include "global.h"
|
||||
#include "object.h"
|
||||
#include "player.h"
|
||||
#include "flags.h"
|
||||
#include "game.h"
|
||||
#include "audio.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern Hitbox gUnk_080FD168;
|
||||
|
||||
void WarpPoint(Entity*);
|
||||
void sub_0808B474(Entity*);
|
||||
void sub_0808B530(Entity*);
|
||||
void sub_0808B564(Entity*);
|
||||
void sub_0808B590(Entity*);
|
||||
void sub_0808B5E8(Entity*);
|
||||
void sub_0808B684(Entity*);
|
||||
void sub_0808B73C(Entity*);
|
||||
u32 sub_0808B7C8(Entity*);
|
||||
void sub_0808B830(Entity*);
|
||||
|
||||
void (*const gUnk_08121368[])(Entity*) = {
|
||||
sub_0808B474, sub_0808B530, sub_0808B564, sub_0808B590, sub_0808B5E8, sub_0808B684,
|
||||
};
|
||||
|
||||
const u8 gUnk_08121380[3] = { 1, 0, 2 };
|
||||
|
||||
void WarpPoint(Entity* this) {
|
||||
if (!this->field_0x70.BYTES.byte0) {
|
||||
gUnk_08121368[this->action](this);
|
||||
} else {
|
||||
sub_0808B73C(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0808B474(Entity* this) {
|
||||
u32 tmp;
|
||||
this->action = 1;
|
||||
this->field_0xf = 0;
|
||||
tmp = gUnk_08121380[this->type];
|
||||
this->palette.b.b0 = tmp;
|
||||
this->spritePriority.b0 = 6;
|
||||
this->hitbox = &gUnk_080FD168;
|
||||
this->scriptedScene = 3;
|
||||
InitializeAnimation(this, 0);
|
||||
if (CheckFlags(this->field_0x86.HWORD)) {
|
||||
sub_0808B830(this);
|
||||
} else {
|
||||
if (CheckIsDungeon() && sub_0807CAEC(this->type)) {
|
||||
sub_0808B830(this);
|
||||
}
|
||||
}
|
||||
if (!sub_0808B7C8(this))
|
||||
return;
|
||||
this->action = 4;
|
||||
this->field_0xf = 0x60;
|
||||
gPlayerEntity.x.HALF.HI = this->x.HALF.HI;
|
||||
gPlayerEntity.y.HALF.HI = this->y.HALF.HI;
|
||||
gPlayerEntity.animationState = 4;
|
||||
EnqueueSFX(0x112);
|
||||
sub_0805E4E0(this, this->field_0xf + 0x10);
|
||||
}
|
||||
|
||||
void sub_0808B530(Entity* this) {
|
||||
if (CheckFlags(this->field_0x86.HWORD)) {
|
||||
sub_0808B830(this);
|
||||
if (CheckIsDungeon()) {
|
||||
sub_0807CAC8(this->type);
|
||||
}
|
||||
this->action = 2;
|
||||
this->field_0xf = 60;
|
||||
EnqueueSFX(0x112);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0808B564(Entity* this) {
|
||||
if (!--this->field_0xf) {
|
||||
this->action = 3;
|
||||
} else {
|
||||
this->spriteSettings.b.draw = this->field_0xf & 2 ? 0 : 1;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0808B590(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (sub_0808B7C8(this)) {
|
||||
if (this->actionDelay)
|
||||
return;
|
||||
this->action = 5;
|
||||
this->field_0xf = 0x60;
|
||||
sub_08077B20();
|
||||
gPlayerEntity.x.HALF.HI = this->x.HALF.HI;
|
||||
gPlayerEntity.y.HALF.HI = this->y.HALF.HI;
|
||||
gPlayerEntity.animationState = 4;
|
||||
gPlayerEntity.flags &= ~0x80;
|
||||
sub_0805E4E0(this, this->field_0xf + 0x10);
|
||||
SoundReq(0x113);
|
||||
} else {
|
||||
this->actionDelay = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0808B5E8(Entity* this) {
|
||||
u32 tmp;
|
||||
if (!--this->field_0xf) {
|
||||
this->action = 3;
|
||||
this->actionDelay = 1;
|
||||
gPlayerEntity.animationState = 4;
|
||||
gPlayerEntity.direction = DirectionSouth;
|
||||
return;
|
||||
}
|
||||
tmp = 0;
|
||||
switch (this->field_0xf & 0x60) {
|
||||
case 0x40:
|
||||
if (this->field_0xf == 0x58) {
|
||||
SoundReq(0x114);
|
||||
}
|
||||
if (!(this->field_0xf & 1)) {
|
||||
tmp = 1;
|
||||
}
|
||||
break;
|
||||
case 0x20:
|
||||
if (!(this->field_0xf & 3)) {
|
||||
tmp = 1;
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
if (!(this->field_0xf & 7)) {
|
||||
if (gPlayerEntity.animationState == 4) {
|
||||
if (this->field_0xf > 0x18) {
|
||||
tmp = 1;
|
||||
}
|
||||
} else {
|
||||
tmp = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (tmp) {
|
||||
gPlayerEntity.animationState += 2;
|
||||
gPlayerEntity.animationState &= 6;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0808B684(Entity* this) {
|
||||
u32 tmp;
|
||||
if (!--this->field_0xf) {
|
||||
gScreenTransition.transitioningOut = 1;
|
||||
gScreenTransition.transitionType = 0;
|
||||
gScreenTransition.areaID = this->field_0x7c.BYTES.byte0;
|
||||
gScreenTransition.roomID = this->field_0x7c.BYTES.byte1;
|
||||
gScreenTransition.playerStartPos.HALF.x = ((this->cutsceneBeh.HWORD & 0x3f) << 4) + 8;
|
||||
gScreenTransition.playerStartPos.HALF.y = ((this->cutsceneBeh.HWORD & 0xfc0) >> 2) + 8;
|
||||
gScreenTransition.playerLayer = 0;
|
||||
gScreenTransition.playerState = 4;
|
||||
gScreenTransition.field_0xf = 0;
|
||||
if (this->type == 2) {
|
||||
gScreenTransition.transitionType = 2;
|
||||
}
|
||||
return;
|
||||
}
|
||||
tmp = 0;
|
||||
switch (this->field_0xf & 0x60) {
|
||||
case 0x40:
|
||||
if (!(this->field_0xf & 7)) {
|
||||
tmp = 1;
|
||||
}
|
||||
break;
|
||||
case 0x20:
|
||||
if (!(this->field_0xf & 3)) {
|
||||
tmp = 1;
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
if (this->field_0xf > 0x10) {
|
||||
if (!(this->field_0xf & 1)) {
|
||||
tmp = 1;
|
||||
}
|
||||
} else {
|
||||
gPlayerEntity.spriteSettings.b.draw = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (tmp) {
|
||||
gPlayerEntity.animationState += 2;
|
||||
gPlayerEntity.animationState &= 6;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0808B73C(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->palette.b.b0 = this->parent->palette.b.b0;
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
if (sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x28)) {
|
||||
this->spriteSettings.b.draw = 1;
|
||||
} else {
|
||||
if (sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x2e)) {
|
||||
this->spriteSettings.b.draw ^= 1;
|
||||
} else {
|
||||
this->spriteSettings.b.draw = 0;
|
||||
}
|
||||
}
|
||||
GetNextFrame(this);
|
||||
}
|
||||
|
||||
u32 sub_0808B7C8(Entity* this) {
|
||||
if (!(gPlayerState.flags.all & 0x80) && gPlayerState.field_0xa8 != 0x12 && gPlayerEntity.currentHealth != 0 &&
|
||||
sub_08079F8C() && sub_080041A0(this, &gPlayerEntity, 5, 5) && gPlayerEntity.height.HALF.HI == 0) {
|
||||
if (this->actionDelay == 0 && gPlayerEntity.action == 0x1b) {
|
||||
sub_080791D0();
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_0808B830(Entity* this) {
|
||||
Entity* tmp;
|
||||
this->action = 3;
|
||||
this->actionDelay = 0;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
tmp = CreateObject(0x34, 0, 0);
|
||||
if (tmp) {
|
||||
tmp->field_0x70.BYTES.byte0 = 1;
|
||||
tmp->parent = this;
|
||||
CopyPosition(this, tmp);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue