Merge pull request #158 from Henny022p/vaati

This commit is contained in:
notyourav
2021-10-22 20:23:42 -07:00
committed by GitHub
50 changed files with 6898 additions and 15035 deletions
-652
View File
@@ -1,652 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start Enemy5A
Enemy5A: @ 0x080456D8
push {lr}
ldr r1, _080456E4 @ =gUnk_080D1888
bl EnemyFunctionHandler
pop {pc}
.align 2, 0
_080456E4: .4byte gUnk_080D1888
thumb_func_start sub_080456E8
sub_080456E8: @ 0x080456E8
push {lr}
ldr r2, _080456FC @ =gUnk_080D18A0
ldrb r1, [r0, #0xc]
lsls r1, r1, #2
adds r1, r1, r2
ldr r1, [r1]
bl _call_via_r1
pop {pc}
.align 2, 0
_080456FC: .4byte gUnk_080D18A0
thumb_func_start sub_08045700
sub_08045700: @ 0x08045700
push {r4, r5, lr}
adds r5, r0, #0
ldrb r0, [r5, #0xa]
cmp r0, #0
beq _080457D0
ldr r0, [r5, #0x50]
ldr r3, [r0, #0x50]
adds r0, r5, #0
adds r0, #0x41
ldrb r1, [r0]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _080457D0
movs r0, #0x3f
ands r0, r1
cmp r0, #0xe
beq _08045728
cmp r0, #0x15
bne _08045778
_08045728:
adds r1, r5, #0
adds r1, #0x81
ldrb r0, [r1]
cmp r0, #0
bne _0804575C
movs r0, #3
strb r0, [r5, #0xc]
ldrb r0, [r1]
adds r0, #1
strb r0, [r1]
ldrb r1, [r5, #0xa]
lsls r1, r1, #3
ldrb r0, [r5, #0xe]
adds r0, #2
orrs r1, r0
adds r0, r5, #0
bl InitializeAnimation
ldr r0, [r5, #0x50]
ldrb r1, [r0, #0xa]
lsls r1, r1, #3
ldrb r2, [r5, #0xe]
adds r2, #2
orrs r1, r2
bl InitializeAnimation
_0804575C:
ldrb r0, [r5, #0xe]
cmp r0, #0
beq _0804576C
movs r0, #0xbd
lsls r0, r0, #1
bl SoundReq
b _080457D0
_0804576C:
ldr r0, _08045774 @ =0x00000119
bl SoundReq
b _080457D0
.align 2, 0
_08045774: .4byte 0x00000119
_08045778:
adds r2, r5, #0
adds r2, #0x45
ldrb r1, [r2]
adds r0, r1, #0
cmp r0, #0xff
beq _080457D0
movs r0, #0xff
strb r0, [r2]
ldrb r0, [r5, #0xe]
cmp r0, #0
beq _080457D0
adds r0, r3, #0
adds r0, #0x81
ldrb r0, [r0]
cmp r0, #0
beq _080457D0
adds r0, r3, #0
adds r0, #0x76
movs r1, #1
ldrb r2, [r5, #0xb]
lsls r1, r2
ldrb r2, [r0]
orrs r1, r2
strb r1, [r0]
adds r1, r5, #0
adds r1, #0x85
ldrb r0, [r1]
cmp r0, #0
bne _080457D0
adds r0, #1
strb r0, [r1]
ldrb r1, [r5, #0xa]
lsls r1, r1, #3
movs r4, #6
orrs r1, r4
adds r0, r5, #0
bl InitializeAnimation
ldr r0, [r5, #0x50]
ldrb r1, [r0, #0xa]
lsls r1, r1, #3
orrs r1, r4
bl InitializeAnimation
_080457D0:
ldr r1, _080457DC @ =gUnk_080D1888
adds r0, r5, #0
bl sub_0804AA30
pop {r4, r5, pc}
.align 2, 0
_080457DC: .4byte gUnk_080D1888
thumb_func_start nullsub_173
nullsub_173: @ 0x080457E0
bx lr
.align 2, 0
thumb_func_start sub_080457E4
sub_080457E4: @ 0x080457E4
push {r4, lr}
adds r4, r0, #0
ldr r0, _08045850 @ =gTextBox
ldrb r0, [r0]
movs r2, #0x7f
ands r2, r0
cmp r2, #0
bne _08045868
movs r3, #1
strb r3, [r4, #0xc]
ldrb r1, [r4, #0x18]
movs r0, #4
rsbs r0, r0, #0
ands r0, r1
strb r0, [r4, #0x18]
adds r0, r4, #0
adds r0, #0x80
strb r2, [r0]
adds r0, #1
strb r2, [r0]
adds r0, #4
strb r2, [r0]
strb r2, [r4, #0xf]
adds r1, r4, #0
adds r1, #0x82
movs r0, #0x30
strb r0, [r1]
adds r0, r4, #0
adds r0, #0x83
strb r2, [r0]
ldrb r0, [r4, #0xa]
cmp r0, #0
bne _08045854
adds r0, r4, #0
bl sub_08045A00
movs r0, #0x5a
movs r1, #1
bl CreateEnemy
adds r1, r0, #0
cmp r1, #0
beq _0804585A
str r4, [r1, #0x50]
str r1, [r4, #0x54]
ldrb r0, [r4, #0xe]
strb r0, [r1, #0xe]
ldrb r0, [r4, #0xb]
strb r0, [r1, #0xb]
adds r0, r4, #0
bl CopyPosition
b _0804585A
.align 2, 0
_08045850: .4byte gTextBox
_08045854:
adds r0, r4, #0
adds r0, #0x63
strb r3, [r0]
_0804585A:
ldrb r1, [r4, #0xa]
lsls r1, r1, #3
movs r0, #1
orrs r1, r0
adds r0, r4, #0
bl InitializeAnimation
_08045868:
pop {r4, pc}
.align 2, 0
thumb_func_start sub_0804586C
sub_0804586C: @ 0x0804586C
push {r4, lr}
adds r4, r0, #0
bl sub_08045A28
adds r1, r4, #0
adds r1, #0x82
ldrb r0, [r1]
cmp r0, #0
bne _080458AA
adds r0, r4, #0
adds r0, #0x5a
ldrb r1, [r0]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _080458C2
ldrb r0, [r4, #0xa]
cmp r0, #0
beq _0804589A
ldrb r1, [r4, #0x10]
movs r0, #0x80
orrs r0, r1
strb r0, [r4, #0x10]
_0804589A:
movs r0, #2
strb r0, [r4, #0xc]
ldrb r1, [r4, #0xa]
lsls r1, r1, #3
adds r0, r4, #0
bl InitializeAnimation
b _080458C2
_080458AA:
subs r0, #1
strb r0, [r1]
lsls r0, r0, #0x18
cmp r0, #0
bne _080458C2
ldrb r0, [r4, #0x18]
movs r1, #4
rsbs r1, r1, #0
ands r1, r0
movs r0, #1
orrs r1, r0
strb r1, [r4, #0x18]
_080458C2:
pop {r4, pc}
thumb_func_start sub_080458C4
sub_080458C4: @ 0x080458C4
push {r4, r5, lr}
adds r5, r0, #0
bl sub_08045A28
ldr r1, [r5, #0x50]
ldrb r2, [r5, #0xa]
cmp r2, #0
beq _080458D6
ldr r1, [r1, #0x50]
_080458D6:
ldrb r0, [r1, #0xc]
cmp r0, #3
bne _08045934
adds r0, r1, #0
adds r0, #0x80
ldrb r0, [r0]
cmp r0, #1
bne _08045934
movs r0, #0
movs r4, #4
strb r4, [r5, #0xc]
strb r0, [r5, #0xf]
cmp r2, #0
beq _08045934
ldrb r0, [r5, #0x10]
movs r1, #0x7f
ands r1, r0
strb r1, [r5, #0x10]
ldrb r0, [r5, #0xe]
cmp r0, #0
beq _0804591C
ldrb r1, [r5, #0xa]
lsls r1, r1, #3
movs r4, #5
orrs r1, r4
adds r0, r5, #0
bl InitializeAnimation
ldr r0, [r5, #0x50]
ldrb r1, [r0, #0xa]
lsls r1, r1, #3
orrs r1, r4
bl InitializeAnimation
b _08045934
_0804591C:
ldrb r1, [r5, #0xa]
lsls r1, r1, #3
orrs r1, r4
adds r0, r5, #0
bl InitializeAnimation
ldr r0, [r5, #0x50]
ldrb r1, [r0, #0xa]
lsls r1, r1, #3
orrs r1, r4
bl InitializeAnimation
_08045934:
pop {r4, r5, pc}
.align 2, 0
thumb_func_start sub_08045938
sub_08045938: @ 0x08045938
push {r4, lr}
adds r4, r0, #0
bl sub_08045A28
adds r0, r4, #0
adds r0, #0x5a
ldrb r1, [r0]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _08045980
movs r0, #2
strb r0, [r4, #0xc]
ldrb r0, [r4, #0xa]
cmp r0, #0
beq _08045980
ldrb r0, [r4, #0xe]
cmp r0, #0
bne _08045966
adds r1, r4, #0
adds r1, #0x3f
movs r0, #0x32
b _0804597E
_08045966:
ldr r0, [r4, #0x50]
ldr r2, [r0, #0x50]
adds r2, #0x76
movs r0, #1
ldrb r1, [r4, #0xb]
lsls r0, r1
ldrb r1, [r2]
orrs r0, r1
strb r0, [r2]
adds r1, r4, #0
adds r1, #0x3f
movs r0, #0x31
_0804597E:
strb r0, [r1]
_08045980:
pop {r4, pc}
.align 2, 0
thumb_func_start sub_08045984
sub_08045984: @ 0x08045984
push {r4, lr}
adds r4, r0, #0
bl sub_08045A28
ldrb r0, [r4, #0xf]
cmp r0, #0
bne _080459A6
adds r0, r4, #0
adds r0, #0x5a
ldrb r1, [r0]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _080459FE
movs r0, #0x20
strb r0, [r4, #0xf]
b _080459FE
_080459A6:
ldr r2, [r4, #0x50]
ldrb r0, [r4, #0xa]
cmp r0, #0
beq _080459B0
ldr r2, [r2, #0x50]
_080459B0:
ldrb r0, [r2, #0x14]
cmp r0, #2
bhi _080459FE
ldrb r0, [r2, #0xc]
cmp r0, #3
beq _080459FE
movs r0, #0
movs r3, #1
strb r3, [r4, #0xc]
strb r0, [r4, #0xf]
adds r1, r4, #0
adds r1, #0x81
strb r0, [r1]
adds r1, #4
strb r0, [r1]
ldrb r0, [r4, #0xa]
cmp r0, #0
beq _080459DA
subs r1, #0x46
movs r0, #0x33
strb r0, [r1]
_080459DA:
adds r0, r2, #0
adds r0, #0x75
ldrb r0, [r0]
ldrb r1, [r4, #0xb]
asrs r0, r1
ands r0, r3
cmp r0, #0
beq _080459EE
strb r3, [r4, #0xe]
b _080459F0
_080459EE:
strb r0, [r4, #0xe]
_080459F0:
ldrb r1, [r4, #0xa]
lsls r1, r1, #3
movs r0, #1
orrs r1, r0
adds r0, r4, #0
bl InitializeAnimation
_080459FE:
pop {r4, pc}
thumb_func_start sub_08045A00
sub_08045A00: @ 0x08045A00
push {lr}
adds r1, r0, #0
ldrb r3, [r1, #0xb]
lsls r3, r3, #1
ldr r0, _08045A24 @ =gUnk_080D18B4
adds r3, r3, r0
ldr r0, [r1, #0x50]
movs r2, #0
ldrsb r2, [r3, r2]
lsls r2, r2, #0x10
ldrb r3, [r3, #1]
lsls r3, r3, #0x18
asrs r3, r3, #0x18
adds r3, #3
lsls r3, r3, #0x10
bl PositionRelative
pop {pc}
.align 2, 0
_08045A24: .4byte gUnk_080D18B4
thumb_func_start sub_08045A28
sub_08045A28: @ 0x08045A28
push {r4, r5, r6, r7, lr}
mov r7, r8
push {r7}
adds r5, r0, #0
adds r0, #0x82
ldrb r0, [r0]
cmp r0, #0
bne _08045A3E
adds r0, r5, #0
bl GetNextFrame
_08045A3E:
adds r6, r5, #0
adds r6, #0x5a
ldrb r0, [r6]
movs r1, #0x70
mov r8, r1
mov r4, r8
ands r4, r0
ldrb r7, [r5, #0xa]
cmp r7, #0
bne _08045AF8
adds r0, r5, #0
bl sub_08045A00
adds r1, r5, #0
adds r1, #0x83
ldrb r0, [r1]
adds r2, r1, #0
cmp r0, #1
beq _08045AA4
cmp r0, #1
bgt _08045A6E
cmp r0, #0
beq _08045A78
b _08045B7C
_08045A6E:
cmp r0, #2
beq _08045ABC
cmp r0, #3
beq _08045AE8
b _08045B7C
_08045A78:
cmp r4, #0x20
beq _08045A8C
cmp r4, #0x20
bhi _08045A86
cmp r4, #0
beq _08045A96
b _08045B7C
_08045A86:
cmp r4, #0x40
beq _08045A96
b _08045B7C
_08045A8C:
movs r0, #1
strb r0, [r1]
movs r1, #0x9f
lsls r1, r1, #1
b _08045B5A
_08045A96:
movs r0, #2
strb r0, [r2]
ldr r1, _08045AA0 @ =0x0000013F
b _08045B5A
.align 2, 0
_08045AA0: .4byte 0x0000013F
_08045AA4:
cmp r4, #0
beq _08045AB0
cmp r4, #0x10
bne _08045B7C
strb r7, [r1]
b _08045B58
_08045AB0:
movs r0, #2
strb r0, [r1]
ldr r1, _08045AB8 @ =0x0000013F
b _08045B5A
.align 2, 0
_08045AB8: .4byte 0x0000013F
_08045ABC:
cmp r4, #0x20
beq _08045AD0
cmp r4, #0x20
bhi _08045ACA
cmp r4, #0x10
beq _08045ADA
b _08045B7C
_08045ACA:
cmp r4, #0x40
beq _08045ADE
b _08045B7C
_08045AD0:
movs r0, #1
strb r0, [r1]
movs r1, #0x9f
lsls r1, r1, #1
b _08045B5A
_08045ADA:
strb r7, [r1]
b _08045B58
_08045ADE:
strb r0, [r1]
ldr r1, _08045AE4 @ =0x0000013F
b _08045B5A
.align 2, 0
_08045AE4: .4byte 0x0000013F
_08045AE8:
cmp r4, #0
bne _08045B7C
movs r0, #2
strb r0, [r1]
ldr r1, _08045AF4 @ =0x0000013F
b _08045B5A
.align 2, 0
_08045AF4: .4byte 0x0000013F
_08045AF8:
ldr r0, [r5, #0x50]
ldr r3, _08045B18 @ =0xFFFF0000
adds r1, r5, #0
movs r2, #0
bl PositionRelative
adds r2, r5, #0
adds r2, #0x83
ldrb r0, [r2]
cmp r0, #1
beq _08045B3A
cmp r0, #1
bgt _08045B1C
cmp r0, #0
beq _08045B22
b _08045B7C
.align 2, 0
_08045B18: .4byte 0xFFFF0000
_08045B1C:
cmp r0, #2
beq _08045B68
b _08045B7C
_08045B22:
ldrb r0, [r6]
mov r1, r8
ands r1, r0
cmp r1, #0x10
beq _08045B54
cmp r1, #0x20
bne _08045B7C
movs r0, #1
strb r0, [r2]
movs r1, #0x9f
lsls r1, r1, #1
b _08045B5A
_08045B3A:
ldrb r0, [r6]
mov r1, r8
ands r1, r0
cmp r1, #0
beq _08045B4A
cmp r1, #0x10
beq _08045B54
b _08045B7C
_08045B4A:
strb r1, [r2]
ldr r1, _08045B50 @ =0x0000013F
b _08045B5A
.align 2, 0
_08045B50: .4byte 0x0000013F
_08045B54:
movs r0, #2
strb r0, [r2]
_08045B58:
ldr r1, _08045B64 @ =0x0000013B
_08045B5A:
adds r0, r5, #0
bl sub_0801D2B4
b _08045B7C
.align 2, 0
_08045B64: .4byte 0x0000013B
_08045B68:
ldrb r0, [r6]
mov r1, r8
ands r1, r0
cmp r1, #0
bne _08045B7C
strb r1, [r2]
ldr r1, _08045B84 @ =0x0000013F
adds r0, r5, #0
bl sub_0801D2B4
_08045B7C:
pop {r3}
mov r8, r3
pop {r4, r5, r6, r7, pc}
.align 2, 0
_08045B84: .4byte 0x0000013F
-474
View File
@@ -1,474 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start Enemy5F
Enemy5F: @ 0x080482C4
push {r4, lr}
adds r4, r0, #0
ldr r0, [r4, #0x50]
ldr r0, [r0, #4]
cmp r0, #0
bne _080482D4
bl DeleteThisEntity
_080482D4:
ldr r0, _080482E8 @ =gUnk_080D1D48
ldrb r1, [r4, #0xc]
lsls r1, r1, #2
adds r1, r1, r0
ldr r1, [r1]
adds r0, r4, #0
bl _call_via_r1
pop {r4, pc}
.align 2, 0
_080482E8: .4byte gUnk_080D1D48
thumb_func_start sub_080482EC
sub_080482EC: @ 0x080482EC
push {r4, lr}
adds r4, r0, #0
ldr r0, _08048310 @ =gScreenTransition
adds r0, #0x38
ldrb r1, [r0]
movs r2, #1
adds r0, r2, #0
ands r0, r1
cmp r0, #0
beq _08048314
movs r0, #2
strb r0, [r4, #0xc]
adds r0, r4, #0
movs r1, #1
bl InitializeAnimation
b _08048326
.align 2, 0
_08048310: .4byte gScreenTransition
_08048314:
strb r2, [r4, #0xc]
adds r0, r4, #0
movs r1, #0
bl InitializeAnimation
movs r0, #0xb3
lsls r0, r0, #1
bl SoundReq
_08048326:
adds r0, r4, #0
bl sub_080485D8
pop {r4, pc}
.align 2, 0
thumb_func_start sub_08048330
sub_08048330: @ 0x08048330
push {r4, lr}
adds r4, r0, #0
bl sub_080485D8
adds r0, r4, #0
bl GetNextFrame
adds r0, r4, #0
adds r0, #0x5a
ldrb r1, [r0]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _08048358
movs r0, #2
strb r0, [r4, #0xc]
adds r0, r4, #0
movs r1, #1
bl InitializeAnimation
_08048358:
pop {r4, pc}
.align 2, 0
thumb_func_start sub_0804835C
sub_0804835C: @ 0x0804835C
push {r4, lr}
adds r4, r0, #0
bl sub_080485D8
ldr r0, _08048384 @ =gScreenTransition
adds r0, #0x39
ldrb r1, [r0]
movs r2, #3
adds r0, r2, #0
ands r0, r1
cmp r0, #0
bne _08048382
strb r2, [r4, #0xc]
ldrb r0, [r4, #0x10]
movs r1, #0x80
orrs r1, r0
strb r1, [r4, #0x10]
movs r0, #0x80
strh r0, [r4, #0x24]
_08048382:
pop {r4, pc}
.align 2, 0
_08048384: .4byte gScreenTransition
thumb_func_start sub_08048388
sub_08048388: @ 0x08048388
push {r4, r5, r6, lr}
adds r5, r0, #0
ldr r2, [r5, #0x50]
adds r0, r2, #0
adds r0, #0x79
ldrb r0, [r0]
cmp r0, #0
beq _080483A0
adds r0, r5, #0
bl sub_080485D8
b _080483F2
_080483A0:
ldrb r1, [r5, #0xa]
lsls r1, r1, #1
ldr r0, _080483F4 @ =gUnk_080D1D98
adds r1, r1, r0
movs r0, #0x2e
ldrsh r4, [r2, r0]
movs r0, #0
ldrsb r0, [r1, r0]
adds r4, r4, r0
movs r0, #0x32
ldrsh r2, [r2, r0]
movs r0, #1
ldrsb r0, [r1, r0]
adds r6, r2, r0
movs r1, #0x2e
ldrsh r0, [r5, r1]
movs r2, #0x32
ldrsh r1, [r5, r2]
adds r2, r4, #0
adds r3, r6, #0
bl sub_080045D4
strb r0, [r5, #0x15]
adds r0, r5, #0
bl sub_0806F69C
ldr r0, [r5, #0x50]
ldrh r0, [r0, #0x36]
strh r0, [r5, #0x36]
movs r1, #0x2e
ldrsh r0, [r5, r1]
cmp r0, r4
bne _080483F2
movs r2, #0x32
ldrsh r0, [r5, r2]
cmp r0, r6
bne _080483F2
movs r0, #4
strb r0, [r5, #0xc]
movs r0, #0x3c
strb r0, [r5, #0xe]
_080483F2:
pop {r4, r5, r6, pc}
.align 2, 0
_080483F4: .4byte gUnk_080D1D98
thumb_func_start sub_080483F8
sub_080483F8: @ 0x080483F8
push {r4, r5, lr}
adds r4, r0, #0
bl sub_080485FC
ldrb r0, [r4, #0xe]
adds r5, r0, #0
cmp r5, #0
beq _0804841C
subs r0, #1
strb r0, [r4, #0xe]
lsls r0, r0, #0x18
cmp r0, #0
bne _08048436
adds r0, r4, #0
movs r1, #3
bl InitializeAnimation
b _08048436
_0804841C:
adds r0, r4, #0
bl GetNextFrame
adds r0, r4, #0
adds r0, #0x5a
ldrb r1, [r0]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _08048436
movs r0, #5
strb r0, [r4, #0xc]
strb r5, [r4, #0xe]
_08048436:
pop {r4, r5, pc}
thumb_func_start sub_08048438
sub_08048438: @ 0x08048438
push {r4, lr}
adds r4, r0, #0
ldrb r0, [r4, #0xe]
cmp r0, #0
beq _0804846A
movs r0, #6
strb r0, [r4, #0xc]
ldr r0, [r4, #0x50]
adds r0, #0x45
ldrb r0, [r0]
cmp r0, #0x14
bls _08048454
movs r0, #0x78
b _08048456
_08048454:
movs r0, #0x3c
_08048456:
strb r0, [r4, #0xe]
movs r0, #0
str r0, [r4, #0x54]
adds r0, r4, #0
movs r1, #5
bl InitializeAnimation
ldr r0, _08048474 @ =0x0000019B
bl SoundReq
_0804846A:
adds r0, r4, #0
bl sub_080485FC
pop {r4, pc}
.align 2, 0
_08048474: .4byte 0x0000019B
thumb_func_start sub_08048478
sub_08048478: @ 0x08048478
push {r4, lr}
adds r4, r0, #0
bl sub_080485FC
adds r0, r4, #0
bl GetNextFrame
ldrb r0, [r4, #0xe]
adds r2, r0, #0
cmp r2, #0
beq _080484A2
subs r0, #1
strb r0, [r4, #0xe]
lsls r0, r0, #0x18
cmp r0, #0
bne _080484E6
adds r0, r4, #0
movs r1, #6
bl InitializeAnimation
b _080484E6
_080484A2:
adds r3, r4, #0
adds r3, #0x5a
ldrb r1, [r3]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _080484BC
movs r0, #7
strb r0, [r4, #0xc]
movs r0, #0x78
strb r0, [r4, #0xe]
strb r2, [r4, #0xf]
b _080484E6
_080484BC:
movs r0, #1
ands r0, r1
cmp r0, #0
beq _080484E6
movs r0, #0xfe
ands r0, r1
strb r0, [r3]
movs r0, #0x24
bl CreateProjectile
adds r1, r0, #0
cmp r1, #0
beq _080484E6
str r4, [r1, #0x50]
str r1, [r4, #0x54]
movs r3, #0xc0
lsls r3, r3, #0xc
adds r0, r4, #0
movs r2, #0
bl PositionRelative
_080484E6:
pop {r4, pc}
thumb_func_start sub_080484E8
sub_080484E8: @ 0x080484E8
push {r4, lr}
adds r4, r0, #0
bl sub_080485FC
adds r0, r4, #0
bl GetNextFrame
ldrb r0, [r4, #0xf]
cmp r0, #0
beq _08048528
movs r0, #8
strb r0, [r4, #0xc]
movs r0, #0x3c
strb r0, [r4, #0xe]
ldrb r1, [r4, #0x10]
movs r0, #0x7f
ands r0, r1
strb r0, [r4, #0x10]
ldrb r1, [r4, #0x18]
movs r0, #4
rsbs r0, r0, #0
ands r0, r1
strb r0, [r4, #0x18]
adds r0, r4, #0
movs r1, #0x1f
movs r2, #0x40
bl CreateFx
ldr r2, [r4, #0x50]
adds r2, #0x7b
movs r0, #0x10
b _08048542
_08048528:
ldrb r0, [r4, #0xe]
subs r0, #1
strb r0, [r4, #0xe]
lsls r0, r0, #0x18
lsrs r1, r0, #0x18
cmp r1, #0
bne _0804854C
movs r0, #5
strb r0, [r4, #0xc]
strb r1, [r4, #0xe]
ldr r2, [r4, #0x50]
adds r2, #0x7b
movs r0, #1
_08048542:
ldrb r4, [r4, #0xa]
lsls r0, r4
ldrb r1, [r2]
orrs r0, r1
strb r0, [r2]
_0804854C:
pop {r4, pc}
.align 2, 0
thumb_func_start sub_08048550
sub_08048550: @ 0x08048550
push {r4, lr}
adds r4, r0, #0
ldr r0, [r4, #0x50]
ldrb r0, [r0, #0xc]
cmp r0, #0xb
bne _08048562
movs r0, #0x3c
strb r0, [r4, #0xe]
b _0804859E
_08048562:
ldrb r0, [r4, #0xe]
subs r0, #1
strb r0, [r4, #0xe]
lsls r0, r0, #0x18
cmp r0, #0
bne _0804859E
movs r0, #9
strb r0, [r4, #0xc]
ldrb r0, [r4, #0x10]
movs r1, #0x80
orrs r0, r1
strb r0, [r4, #0x10]
ldrb r1, [r4, #0x18]
movs r0, #4
rsbs r0, r0, #0
ands r0, r1
movs r1, #1
orrs r0, r1
strb r0, [r4, #0x18]
adds r0, r4, #0
movs r1, #0
bl InitializeAnimation
adds r0, r4, #0
bl sub_080485FC
movs r0, #0xb3
lsls r0, r0, #1
bl SoundReq
_0804859E:
pop {r4, pc}
thumb_func_start sub_080485A0
sub_080485A0: @ 0x080485A0
push {r4, lr}
adds r4, r0, #0
bl sub_080485FC
adds r0, r4, #0
bl GetNextFrame
adds r0, r4, #0
adds r0, #0x5a
ldrb r1, [r0]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _080485D6
movs r0, #4
strb r0, [r4, #0xc]
movs r1, #1
strb r1, [r4, #0xe]
ldr r2, [r4, #0x50]
adds r2, #0x7b
ldrb r3, [r2]
movs r0, #0xf
ands r0, r3
ldrb r4, [r4, #0xa]
lsls r1, r4
orrs r0, r1
strb r0, [r2]
_080485D6:
pop {r4, pc}
thumb_func_start sub_080485D8
sub_080485D8: @ 0x080485D8
push {lr}
adds r1, r0, #0
ldrb r3, [r1, #0xa]
lsls r3, r3, #1
ldr r0, _080485F8 @ =gUnk_080D1D70
adds r3, r3, r0
ldr r0, [r1, #0x50]
movs r2, #0
ldrsb r2, [r3, r2]
ldrb r3, [r3, #1]
lsls r3, r3, #0x18
asrs r3, r3, #0x18
bl sub_0806FA90
pop {pc}
.align 2, 0
_080485F8: .4byte gUnk_080D1D70
thumb_func_start sub_080485FC
sub_080485FC: @ 0x080485FC
push {r4, lr}
adds r4, r0, #0
ldrb r1, [r4, #0xa]
lsls r1, r1, #1
ldr r0, _08048638 @ =gUnk_080D1D98
adds r1, r1, r0
ldr r0, [r4, #0x50]
movs r2, #0
ldrsb r2, [r1, r2]
movs r3, #1
ldrsb r3, [r1, r3]
adds r1, r4, #0
bl sub_0806FA90
ldr r3, _0804863C @ =gUnk_080D1D78
ldrb r1, [r4, #0xa]
lsls r1, r1, #3
ldr r0, [r4, #0x50]
adds r0, #0x78
ldrb r0, [r0]
lsrs r0, r0, #4
movs r2, #7
ands r0, r2
adds r1, r1, r0
adds r1, r1, r3
movs r0, #0
ldrsb r0, [r1, r0]
strh r0, [r4, #0x36]
pop {r4, pc}
.align 2, 0
_08048638: .4byte gUnk_080D1D98
_0804863C: .4byte gUnk_080D1D78
+89
View File
@@ -0,0 +1,89 @@
.syntax unified
push {r4, r5, r6, r7, lr}
adds r4, r0, #0
movs r3, #3
movs r2, #0
ldr r0, [r4, #0x64]
adds r1, r0, #0
adds r1, #0x48
ldrb r0, [r1, #0xc]
cmp r0, #2
bls _080432C2
subs r0, #1
strb r0, [r1, #0xc]
movs r2, #1
_080432C2:
subs r3, #1
cmp r3, #0
blt _080432E0
lsls r0, r3, #4
adds r0, #0x18
ldr r1, [r4, #0x64]
adds r1, r1, r0
ldrb r0, [r1, #0xc]
cmp r0, #2
bls _080432C2
subs r0, #1
strb r0, [r1, #0xc]
adds r2, #1
cmp r2, #1
ble _080432C2
_080432E0:
ldr r0, [r4, #0x64]
adds r1, r0, #0
adds r1, #0x18
ldrb r0, [r1, #5]
subs r0, #2
strb r0, [r1, #5]
movs r3, #0
movs r6, #0x80
movs r7, #4
rsbs r7, r7, #0
movs r5, #1
_080432F6:
ldr r0, [r4, #0x64]
lsls r1, r3, #2
adds r0, r0, r1
ldr r2, [r0]
movs r1, #0x36
ldrsh r0, [r2, r1]
cmp r0, #3
bgt _08043316
ldrb r0, [r2, #0x10]
orrs r0, r6
strb r0, [r2, #0x10]
ldrb r1, [r2, #0x18]
adds r0, r7, #0
ands r0, r1
orrs r0, r5
strb r0, [r2, #0x18]
_08043316:
adds r3, #1
cmp r3, #3
ble _080432F6
ldr r1, [r4, #0x64]
ldr r0, [r1]
ldrb r0, [r0, #0x18]
lsls r0, r0, #0x1e
lsrs r2, r0, #0x1e
cmp r2, #1
bne _08043348
adds r0, r1, #0
adds r0, #0x34
ldrb r0, [r0]
cmp r0, #2
bhi _08043348
strb r2, [r4, #0xd]
movs r0, #0x1e
strb r0, [r4, #0xe]
movs r0, #0x80
lsls r0, r0, #7
strh r0, [r1, #0x1c]
ldr r0, [r4, #0x64]
ldr r0, [r0, #0x10]
bl sub_0804AA1C
_08043348:
pop {r4, r5, r6, r7, pc}
.align 2, 0
.syntax divided
+111
View File
@@ -0,0 +1,111 @@
.syntax unified
push {r4, r5, r6, r7, lr}
adds r4, r0, #0
ldrb r0, [r4, #0xe]
cmp r0, #0
beq _08043388
subs r0, #1
strb r0, [r4, #0xe]
lsls r0, r0, #0x18
cmp r0, #0
bne _0804341C
movs r5, #0
movs r7, #0x80
movs r6, #4
rsbs r6, r6, #0
movs r3, #1
_0804336A:
ldr r0, [r4, #0x64]
lsls r1, r5, #2
adds r0, r0, r1
ldr r2, [r0]
ldrb r0, [r2, #0x10]
orrs r0, r7
strb r0, [r2, #0x10]
ldrb r1, [r2, #0x18]
adds r0, r6, #0
ands r0, r1
orrs r0, r3
strb r0, [r2, #0x18]
adds r5, #1
cmp r5, #4
bls _0804336A
_08043388:
ldr r3, [r4, #0x64]
adds r2, r3, #0
adds r2, #0x18
ldr r1, _080433AC @ =gUnk_080D131C
ldrb r0, [r4, #0xb]
adds r0, r0, r1
ldrb r0, [r0]
ldrb r1, [r2, #1]
subs r0, r0, r1
adds r0, #1
cmp r0, #2
bls _080433B0
ldrh r0, [r2, #8]
ldrh r1, [r3, #0x18]
adds r0, r0, r1
strh r0, [r3, #0x18]
movs r7, #0
b _080433B2
.align 2, 0
_080433AC: .4byte gUnk_080D131C
_080433B0:
movs r7, #1
_080433B2:
adds r0, r4, #0
bl sub_08043B9C
movs r5, #0
movs r6, #0x18
_080433BC:
ldr r0, [r4, #0x64]
adds r2, r0, r6
ldr r0, _080433E4 @ =gUnk_080D1414
adds r0, r5, r0
ldrb r1, [r2, #0xc]
ldrb r3, [r0]
cmp r3, r1
bls _080433E8
adds r0, r1, #1
strb r0, [r2, #0xc]
lsls r0, r0, #0x18
lsrs r0, r0, #0x18
cmp r3, r0
bne _0804341C
movs r0, #0xaf
lsls r0, r0, #1
bl SoundReq
b _0804341C
.align 2, 0
_080433E4: .4byte gUnk_080D1414
_080433E8:
cmp r7, #0
beq _08043414
cmp r5, #4
bne _08043414
adds r0, r4, #0
bl sub_08043BC8
adds r0, r4, #0
movs r1, #7
bl InitAnimationForceUpdate
adds r1, r4, #0
adds r1, #0x7e
ldrb r0, [r1]
cmp r0, #0
beq _08043414
movs r0, #0
strb r0, [r1]
ldr r0, [r4, #0x64]
ldr r1, [r0, #0x14]
movs r0, #2
strb r0, [r1, #0xd]
_08043414:
adds r6, #0x10
adds r5, #1
cmp r5, #4
bls _080433BC
_0804341C:
pop {r4, r5, r6, r7, pc}
.align 2, 0
.syntax divided
+75
View File
@@ -0,0 +1,75 @@
.syntax unified
push {r4, lr}
adds r4, r0, #0
ldr r0, [r4, #0x64]
ldr r0, [r0, #0x10]
mov ip, r0
ldrh r1, [r0, #0x36]
movs r2, #0x36
ldrsh r0, [r0, r2]
movs r2, #4
rsbs r2, r2, #0
cmp r0, r2
bge _080434C4
movs r0, #0xc0
lsls r0, r0, #9
mov r3, ip
str r0, [r3, #0x20]
movs r0, #0
movs r1, #2
strb r1, [r4, #0xd]
adds r2, r4, #0
adds r2, #0x7e
strb r0, [r2]
ldr r0, [r4, #0x64]
ldr r0, [r0, #0x14]
strb r1, [r0, #0xd]
b _08043514
_080434C4:
subs r0, r1, #2
mov r1, ip
strh r0, [r1, #0x36]
lsls r0, r0, #0x10
cmp r0, #0
bge _08043514
ldrb r0, [r1, #0x10]
movs r3, #0x80
orrs r0, r3
strb r0, [r1, #0x10]
ldrb r1, [r1, #0x18]
adds r0, r2, #0
ands r0, r1
movs r1, #1
orrs r0, r1
mov r2, ip
strb r0, [r2, #0x18]
adds r2, #0x3c
ldrb r1, [r2]
movs r0, #0xef
ands r0, r1
strb r0, [r2]
mov r1, ip
adds r1, #0x3f
movs r0, #0x3a
strb r0, [r1]
ldr r0, _0804351C @ =gUnk_080FD450
mov r1, ip
str r0, [r1, #0x48]
ldr r0, [r4, #0x64]
ldr r1, [r0, #8]
ldrb r0, [r1, #0x10]
orrs r3, r0
strb r3, [r1, #0x10]
ldr r0, [r4, #0x64]
ldr r2, [r0, #0xc]
ldrb r1, [r2, #0x10]
movs r0, #0x7f
ands r0, r1
strb r0, [r2, #0x10]
_08043514:
adds r0, r4, #0
bl UpdateAnimationSingleFrame
pop {r4, pc}
.align 2, 0
_0804351C: .4byte gUnk_080FD450
.syntax divided
+58
View File
@@ -0,0 +1,58 @@
.syntax unified
push {r4, r5, lr}
adds r2, r0, #0
ldrb r0, [r2, #0xe]
subs r0, #1
strb r0, [r2, #0xe]
lsls r0, r0, #0x18
lsrs r4, r0, #0x18
cmp r4, #0
bne _080437D8
ldr r0, [r2, #0x64]
ldr r3, [r0, #0x14]
ldr r0, _080437AC @ =gScreenTransition
adds r5, r0, #0
adds r5, #0x39
ldrb r1, [r5]
movs r0, #0xc
ands r0, r1
cmp r0, #0
bne _0804379A
movs r0, #2
strb r0, [r3, #0xd]
_0804379A:
ldrb r0, [r2, #0xb]
cmp r0, #0
bne _080437B0
ldr r0, [r3, #0x64]
str r4, [r0, #0x14]
ldrb r1, [r5]
movs r0, #0xfe
b _080437B8
.align 2, 0
_080437AC: .4byte gScreenTransition
_080437B0:
ldr r0, [r3, #0x64]
str r4, [r0, #0x18]
ldrb r1, [r5]
movs r0, #0xfd
_080437B8:
ands r0, r1
strb r0, [r5]
ldr r0, [r2, #0x64]
ldr r0, [r0, #0x10]
movs r1, #0
str r1, [r0, #0x64]
ldr r0, [r2, #0x64]
ldr r0, [r0, #0x10]
adds r0, #0x45
strb r1, [r0]
ldr r1, [r2, #0x68]
ldr r0, [r2, #0x64]
ldr r0, [r0, #0x10]
str r0, [r1, #0x50]
bl DeleteThisEntity
_080437D8:
pop {r4, r5, pc}
.align 2, 0
.syntax divided
+109
View File
@@ -0,0 +1,109 @@
.syntax unified
push {r4, r5, r6, r7, lr}
mov r7, r8
push {r7}
adds r5, r0, #0
ldr r0, [r5, #0x64]
ldr r1, [r0]
adds r0, r1, #0
adds r0, #0x7c
ldrb r0, [r0]
lsls r2, r0, #0x18
cmp r2, #0
beq _0804397C
adds r0, r1, #0
adds r0, #0x7d
ldrb r0, [r0]
ldrb r1, [r5, #0xa]
cmp r0, r1
bhi _0804397C
ldr r4, _08043978 @ =gUnk_080D1362
ldrb r3, [r5, #0xa]
lsls r1, r3, #4
lsrs r0, r2, #0x1b
movs r2, #0xf
ands r0, r2
adds r1, r1, r0
adds r1, r1, r4
ldrb r4, [r1]
adds r6, r3, #0
b _08043980
.align 2, 0
_08043978: .4byte gUnk_080D1362
_0804397C:
movs r4, #0
ldrb r6, [r5, #0xa]
_08043980:
lsls r0, r6, #4
adds r0, #0x18
ldr r2, [r5, #0x64]
mov ip, r2
adds r2, r2, r0
ldrb r0, [r2, #0xc]
adds r0, r4, r0
lsls r4, r0, #8
ldr r3, _08043A0C @ =gSineTable
ldrb r1, [r2, #5]
adds r0, r1, #0
adds r0, #0x40
lsls r0, r0, #1
adds r0, r0, r3
movs r7, #0
ldrsh r0, [r0, r7]
rsbs r0, r0, #0
adds r7, r0, #0
muls r7, r4, r7
mov r8, r7
movs r0, #0x7f
ands r1, r0
lsls r1, r1, #1
adds r1, r1, r3
movs r7, #0
ldrsh r0, [r1, r7]
muls r0, r4, r0
cmp r0, #0
bge _080439BC
adds r0, #0xff
_080439BC:
asrs r4, r0, #8
ldrb r1, [r2, #1]
lsls r0, r1, #1
adds r0, r0, r3
movs r2, #0
ldrsh r0, [r0, r2]
adds r2, r0, #0
muls r2, r4, r2
adds r1, #0x40
lsls r1, r1, #1
adds r1, r1, r3
movs r3, #0
ldrsh r0, [r1, r3]
rsbs r0, r0, #0
adds r3, r0, #0
muls r3, r4, r3
adds r0, r6, #1
lsls r0, r0, #2
add r0, ip
ldr r0, [r0]
adds r1, r5, #0
bl PositionRelative
ldr r0, [r5, #0x34]
add r0, r8
str r0, [r5, #0x34]
ldr r1, [r5, #0x64]
ldrb r0, [r5, #0xa]
adds r0, #1
lsls r0, r0, #2
adds r1, r1, r0
ldr r0, [r1]
adds r0, #0x63
ldrb r1, [r0]
adds r0, r5, #0
adds r0, #0x63
strb r1, [r0]
pop {r3}
mov r8, r3
pop {r4, r5, r6, r7, pc}
.align 2, 0
_08043A0C: .4byte gSineTable
.syntax divided
+67
View File
@@ -0,0 +1,67 @@
.syntax unified
push {r4, r5, r6, lr}
ldrb r3, [r0, #0xa]
lsls r1, r3, #4
adds r4, r1, #0
adds r4, #8
ldr r2, [r0, #0x64]
adds r6, r2, r4
adds r1, #0x18
adds r4, r2, r1
ldr r0, _08043B40 @ =gUnk_080D13B2
adds r3, r3, r0
ldrb r5, [r3]
ldr r0, [r2]
ldrb r0, [r0, #0xb]
cmp r0, #0
bne _08043B44
ldrb r1, [r6, #1]
ldrb r0, [r4, #1]
subs r0, r1, r0
lsls r0, r0, #0x18
asrs r3, r0, #0x18
cmp r5, r3
bhs _08043B5E
cmp r3, #0
ble _08043B56
subs r0, r1, r5
b _08043B5C
.align 2, 0
_08043B40: .4byte gUnk_080D13B2
_08043B44:
ldrb r0, [r4, #1]
ldrb r1, [r6, #1]
subs r0, r0, r1
lsls r0, r0, #0x18
asrs r3, r0, #0x18
cmp r5, r3
bhs _08043B5E
cmp r3, #0
bge _08043B5A
_08043B56:
strb r1, [r4, #1]
b _08043B5E
_08043B5A:
adds r0, r1, r5
_08043B5C:
strb r0, [r4, #1]
_08043B5E:
ldrb r2, [r6, #5]
ldrb r0, [r4, #5]
subs r3, r2, r0
lsls r1, r5, #1
adds r0, r3, r5
cmp r1, r0
bhs _08043B78
cmp r3, #0
ble _08043B74
subs r0, r2, r5
b _08043B76
_08043B74:
adds r0, r2, r5
_08043B76:
strb r0, [r4, #5]
_08043B78:
pop {r4, r5, r6, pc}
.align 2, 0
.syntax divided
+59
View File
@@ -0,0 +1,59 @@
.syntax unified
push {r4, r5, r6, r7, lr}
adds r4, r0, #0
ldrb r0, [r4, #0xb]
lsls r1, r0, #2
adds r1, r1, r0
lsls r1, r1, #1
ldr r0, _08044070 @ =gUnk_080D1400
movs r3, #0
ldr r2, _08044074 @ =gUnk_080D1414
mov ip, r2
movs r7, #8
rsbs r7, r7, #0
adds r5, r1, r0
movs r6, #0x18
_0804401C:
ldr r0, [r4, #0x64]
lsls r1, r3, #2
adds r0, r0, r1
ldr r2, [r0]
ldrb r1, [r2, #0x10]
movs r0, #0x80
orrs r0, r1
strb r0, [r2, #0x10]
adds r2, #0x29
ldrb r1, [r2]
adds r0, r7, #0
ands r0, r1
movs r1, #4
orrs r0, r1
strb r0, [r2]
ldr r1, [r4, #0x64]
adds r1, r1, r6
ldrh r0, [r5]
strh r0, [r1]
movs r0, #0x80
lsls r0, r0, #7
strh r0, [r1, #4]
mov r2, ip
adds r0, r3, r2
ldrb r0, [r0]
strb r0, [r1, #0xc]
adds r5, #2
adds r6, #0x10
adds r3, #1
cmp r3, #4
bls _0804401C
adds r0, r4, #0
movs r1, #7
bl InitAnimationForceUpdate
ldr r1, [r4, #0x64]
ldr r0, [r1, #0x14]
ldr r1, [r1, #0x10]
bl CopyPosition
pop {r4, r5, r6, r7, pc}
.align 2, 0
_08044070: .4byte gUnk_080D1400
_08044074: .4byte gUnk_080D1414
.syntax divided
-33
View File
@@ -1,33 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start ObjectB5
ObjectB5: @ 0x080A0E28
push {lr}
adds r1, r0, #0
ldrb r0, [r1, #0xc]
cmp r0, #0
bne _080A0E36
movs r0, #1
strb r0, [r1, #0xc]
_080A0E36:
.ifndef EU
ldr r0, _080A0E48 @ =gRoomControls
str r1, [r0, #0x30]
.endif
ldr r0, _080A0E4C @ =gPlayerEntity
ldr r3, _080A0E50 @ =0xFFD80000
movs r2, #0
bl PositionRelative
pop {pc}
.align 2, 0
.ifndef EU
_080A0E48: .4byte gRoomControls
.endif
_080A0E4C: .4byte gPlayerEntity
_080A0E50: .4byte 0xFFD80000
-335
View File
@@ -1,335 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start Vaati
Vaati: @ 0x08066A5C
push {r4, lr}
adds r4, r0, #0
ldr r1, _08066A90 @ =gUnk_08110734
ldrb r0, [r4, #0xc]
lsls r0, r0, #2
adds r0, r0, r1
ldr r1, [r0]
adds r0, r4, #0
bl _call_via_r1
ldrb r3, [r4, #0x1a]
lsrs r1, r3, #4
adds r0, r4, #0
adds r0, #0x5b
ldrb r2, [r0]
movs r0, #1
ands r0, r2
adds r1, r1, r0
movs r0, #0xf
ands r1, r0
movs r0, #0x10
rsbs r0, r0, #0
ands r0, r3
orrs r0, r1
strb r0, [r4, #0x1a]
pop {r4, pc}
.align 2, 0
_08066A90: .4byte gUnk_08110734
thumb_func_start sub_08066A94
sub_08066A94: @ 0x08066A94
push {r4, lr}
adds r4, r0, #0
movs r2, #0
movs r3, #1
movs r0, #1
strb r0, [r4, #0xc]
strb r2, [r4, #0xd]
ldrb r1, [r4, #0x18]
subs r0, #5
ands r0, r1
orrs r0, r3
strb r0, [r4, #0x18]
adds r0, r4, #0
adds r0, #0x68
strb r2, [r0]
adds r0, #1
strb r2, [r0]
adds r0, r4, #0
movs r1, #2
bl sub_0805E3A0
adds r0, r4, #0
bl sub_0807DD64
adds r0, r4, #0
bl sub_08066ACC
pop {r4, pc}
thumb_func_start sub_08066ACC
sub_08066ACC: @ 0x08066ACC
push {r4, r5, lr}
adds r4, r0, #0
ldr r1, _08066B18 @ =sub_08066B74
bl sub_0807DD94
adds r0, r4, #0
adds r0, #0x69
ldrb r0, [r0]
lsls r0, r0, #0x18
asrs r0, r0, #0x18
cmp r0, #0
beq _08066AF6
ldr r0, _08066B1C @ =gScreenTransition
ldr r0, [r0]
movs r1, #3
ands r0, r1
cmp r0, #0
bne _08066AF6
adds r0, r4, #0
bl sub_08095CB0
_08066AF6:
adds r1, r4, #0
adds r1, #0x5a
ldrb r2, [r1]
movs r0, #0x81
rsbs r0, r0, #0
ands r2, r0
adds r5, r1, #0
cmp r2, #0
beq _08066B6E
cmp r2, #2
beq _08066B34
cmp r2, #2
bhi _08066B20
cmp r2, #1
beq _08066B2A
b _08066B66
.align 2, 0
_08066B18: .4byte sub_08066B74
_08066B1C: .4byte gScreenTransition
_08066B20:
cmp r2, #3
beq _08066B40
cmp r2, #4
beq _08066B52
b _08066B66
_08066B2A:
movs r0, #0x87
lsls r0, r0, #2
bl EnqueueSFX
b _08066B66
_08066B34:
ldr r0, _08066B3C @ =0x0000021E
bl EnqueueSFX
b _08066B66
.align 2, 0
_08066B3C: .4byte 0x0000021E
_08066B40:
adds r0, r4, #0
adds r0, #0x84
ldr r1, [r0]
movs r0, #4
str r0, [r1, #4]
adds r0, r4, #0
bl CreateManager36
b _08066B66
_08066B52:
adds r0, r4, #0
adds r0, #0x84
ldr r1, [r0]
str r2, [r1, #4]
adds r0, r4, #0
bl DeleteManager36
ldr r0, _08066B70 @ =0x0000021D
bl EnqueueSFX
_08066B66:
ldrb r1, [r5]
movs r0, #0x7f
ands r0, r1
strb r0, [r5]
_08066B6E:
pop {r4, r5, pc}
.align 2, 0
_08066B70: .4byte 0x0000021D
thumb_func_start sub_08066B74
sub_08066B74: @ 0x08066B74
push {r4, r5, r6, lr}
mov ip, r0
ldr r0, [r1, #8]
ldr r4, _08066BCC @ =0xFFF00000
ands r4, r0
ldr r2, _08066BD0 @ =0x000FFFFF
ands r0, r2
str r0, [r1, #8]
cmp r4, #0
bne _08066B8A
b _08066C86
_08066B8A:
mov r3, ip
adds r3, #0x80
mov r5, ip
adds r5, #0x68
movs r6, #1
_08066B94:
mvns r0, r4
adds r1, r0, #1
ands r1, r4
eors r4, r1
mov r2, ip
ldrb r0, [r2, #0x14]
lsrs r2, r0, #1
movs r0, #0x80
lsls r0, r0, #0x12
cmp r1, r0
beq _08066C4C
cmp r1, r0
bhi _08066BE6
movs r0, #0x80
lsls r0, r0, #0xf
cmp r1, r0
beq _08066C34
cmp r1, r0
bhi _08066BD4
movs r0, #0x80
lsls r0, r0, #0xd
cmp r1, r0
beq _08066C24
movs r0, #0x80
lsls r0, r0, #0xe
cmp r1, r0
beq _08066C2C
b _08066C82
.align 2, 0
_08066BCC: .4byte 0xFFF00000
_08066BD0: .4byte 0x000FFFFF
_08066BD4:
movs r0, #0x80
lsls r0, r0, #0x10
cmp r1, r0
beq _08066C3C
movs r0, #0x80
lsls r0, r0, #0x11
cmp r1, r0
beq _08066C44
b _08066C82
_08066BE6:
movs r0, #0x80
lsls r0, r0, #0x15
cmp r1, r0
beq _08066C64
cmp r1, r0
bhi _08066C04
movs r0, #0x80
lsls r0, r0, #0x13
cmp r1, r0
beq _08066C54
movs r0, #0x80
lsls r0, r0, #0x14
cmp r1, r0
beq _08066C5C
b _08066C82
_08066C04:
movs r0, #0x80
lsls r0, r0, #0x17
cmp r1, r0
beq _08066C70
cmp r1, r0
bhi _08066C1A
movs r0, #0x80
lsls r0, r0, #0x16
cmp r1, r0
beq _08066C6C
b _08066C82
_08066C1A:
movs r0, #0x80
lsls r0, r0, #0x18
cmp r1, r0
beq _08066C76
b _08066C82
_08066C24:
adds r0, r2, #0
adds r0, #0x10
strh r0, [r3]
b _08066C82
_08066C2C:
adds r0, r2, #0
adds r0, #0x14
strh r0, [r3]
b _08066C82
_08066C34:
adds r0, r2, #0
adds r0, #0x18
strh r0, [r3]
b _08066C82
_08066C3C:
adds r0, r2, #0
adds r0, #0x1c
strh r0, [r3]
b _08066C82
_08066C44:
adds r0, r2, #0
adds r0, #0x20
strh r0, [r3]
b _08066C82
_08066C4C:
adds r0, r2, #0
adds r0, #0x24
strh r0, [r3]
b _08066C82
_08066C54:
adds r0, r2, #0
adds r0, #0x28
strh r0, [r3]
b _08066C82
_08066C5C:
adds r0, r2, #0
adds r0, #0x2c
strh r0, [r3]
b _08066C82
_08066C64:
adds r0, r2, #0
adds r0, #0x30
strh r0, [r3]
b _08066C82
_08066C6C:
strb r6, [r5]
b _08066C82
_08066C70:
movs r0, #0xff
strb r0, [r5]
b _08066C82
_08066C76:
mov r2, ip
adds r2, #0x69
ldrb r1, [r2]
adds r0, r6, #0
eors r0, r1
strb r0, [r2]
_08066C82:
cmp r4, #0
bne _08066B94
_08066C86:
mov r0, ip
adds r0, #0x84
ldr r1, [r0]
mov r0, ip
bl HandlePostScriptActions
pop {r4, r5, r6, pc}
thumb_func_start sub_08066C94
sub_08066C94: @ 0x08066C94
push {lr}
movs r1, #0
bl sub_0805DA90
movs r0, #0xf7
bl SoundReq
pop {pc}
thumb_func_start sub_08066CA4
sub_08066CA4: @ 0x08066CA4
push {lr}
movs r1, #1
bl sub_0805DA90
movs r0, #0xf6
bl SoundReq
pop {pc}
-3793
View File
File diff suppressed because it is too large Load Diff
-631
View File
@@ -1,631 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start VaatiEyesMacro
VaatiEyesMacro: @ 0x0802EC6C
push {r4, r5, lr}
adds r4, r0, #0
ldr r5, _0802EC94 @ =gUnk_080CDE34
bl GetNextFunction
lsls r0, r0, #2
adds r0, r0, r5
ldr r1, [r0]
adds r0, r4, #0
bl _call_via_r1
movs r3, #0x10
rsbs r3, r3, #0
adds r0, r4, #0
movs r1, #0
movs r2, #1
bl SetChildOffset
pop {r4, r5, pc}
.align 2, 0
_0802EC94: .4byte gUnk_080CDE34
thumb_func_start sub_0802EC98
sub_0802EC98: @ 0x0802EC98
push {r4, lr}
adds r4, r0, #0
ldr r1, _0802ECBC @ =gUnk_080CDE4C
ldrb r0, [r4, #0xa]
lsls r0, r0, #2
adds r0, r0, r1
ldr r1, [r0]
adds r0, r4, #0
bl _call_via_r1
ldrb r0, [r4, #0xa]
cmp r0, #1
bhi _0802ECB8
adds r0, r4, #0
bl sub_0802EF90
_0802ECB8:
pop {r4, pc}
.align 2, 0
_0802ECBC: .4byte gUnk_080CDE4C
thumb_func_start sub_0802ECC0
sub_0802ECC0: @ 0x0802ECC0
push {r4, r5, r6, lr}
adds r4, r0, #0
ldrb r0, [r4, #0xa]
cmp r0, #0
bne _0802ED2A
adds r0, r4, #0
adds r0, #0x45
ldrb r1, [r0]
adds r5, r0, #0
ldr r3, _0802ED00 @ =gScreenTransition
cmp r1, #0
bne _0802ECEE
adds r2, r3, #0
adds r2, #0x39
adds r0, r3, #0
adds r0, #0x3c
ldrb r0, [r0]
adds r0, #2
movs r1, #1
lsls r1, r0
ldrb r0, [r2]
bics r0, r1
strb r0, [r2]
_0802ECEE:
ldr r0, _0802ED04 @ =gRoomControls
ldrb r0, [r0, #5]
cmp r0, #0
bne _0802ED08
ldrb r1, [r5]
adds r0, r3, #0
adds r0, #0x3a
b _0802ED0E
.align 2, 0
_0802ED00: .4byte gScreenTransition
_0802ED04: .4byte gRoomControls
_0802ED08:
ldrb r1, [r5]
adds r0, r3, #0
adds r0, #0x3b
_0802ED0E:
strb r1, [r0]
adds r6, r4, #0
adds r6, #0x79
ldrb r0, [r6]
ldrb r1, [r5]
cmp r0, r1
beq _0802ED24
movs r0, #0xbd
lsls r0, r0, #1
bl EnqueueSFX
_0802ED24:
ldrb r0, [r5]
strb r0, [r6]
b _0802ED52
_0802ED2A:
cmp r0, #1
bne _0802ED52
adds r1, r4, #0
adds r1, #0x3d
movs r0, #0
ldrsb r0, [r1, r0]
cmp r0, #0
ble _0802ED3E
rsbs r0, r0, #0
strb r0, [r1]
_0802ED3E:
adds r5, r4, #0
adds r5, #0x45
ldrb r0, [r5]
cmp r0, #0xff
beq _0802ED4E
movs r0, #0xe5
bl EnqueueSFX
_0802ED4E:
movs r0, #0xff
strb r0, [r5]
_0802ED52:
adds r0, r4, #0
adds r0, #0x43
ldrb r0, [r0]
cmp r0, #0
beq _0802ED64
adds r0, r4, #0
movs r1, #0x1c
bl sub_0804A9FC
_0802ED64:
ldr r1, _0802ED70 @ =gUnk_080CDE34
adds r0, r4, #0
bl sub_0804AA30
pop {r4, r5, r6, pc}
.align 2, 0
_0802ED70: .4byte gUnk_080CDE34
thumb_func_start sub_0802ED74
sub_0802ED74: @ 0x0802ED74
push {lr}
ldr r2, _0802ED88 @ =gUnk_080CDE5C
ldrb r1, [r0, #0xc]
lsls r1, r1, #2
adds r1, r1, r2
ldr r1, [r1]
bl _call_via_r1
pop {pc}
.align 2, 0
_0802ED88: .4byte gUnk_080CDE5C
thumb_func_start sub_0802ED8C
sub_0802ED8C: @ 0x0802ED8C
push {r4, lr}
adds r4, r0, #0
ldr r0, _0802EDD0 @ =gEntCount
ldrb r0, [r0]
cmp r0, #0x46
bhi _0802EE0A
bl GetEmptyManager
adds r1, r0, #0
cmp r1, #0
beq _0802EE0A
movs r0, #9
strb r0, [r1, #8]
movs r0, #0x34
strb r0, [r1, #9]
str r4, [r1, #0x14]
adds r0, r1, #0
movs r1, #8
bl AppendEntityToList
movs r0, #0x25
movs r1, #2
bl CreateEnemy
str r4, [r0, #0x50]
movs r0, #1
strb r0, [r4, #0xc]
ldr r0, _0802EDD4 @ =gRoomControls
ldrb r0, [r0, #5]
cmp r0, #0
bne _0802EDDC
ldr r0, _0802EDD8 @ =gScreenTransition
adds r0, #0x3a
b _0802EDE0
.align 2, 0
_0802EDD0: .4byte gEntCount
_0802EDD4: .4byte gRoomControls
_0802EDD8: .4byte gScreenTransition
_0802EDDC:
ldr r0, _0802EE0C @ =gScreenTransition
adds r0, #0x3b
_0802EDE0:
ldrb r0, [r0]
adds r1, r4, #0
adds r1, #0x45
strb r0, [r1]
adds r1, #0x34
strb r0, [r1]
bl Random
adds r1, r4, #0
adds r1, #0x78
strb r0, [r1]
adds r0, r4, #0
bl sub_0802EFB8
adds r0, r4, #0
movs r1, #0
bl InitializeAnimation
adds r0, r4, #0
bl sub_0802EF58
_0802EE0A:
pop {r4, pc}
.align 2, 0
_0802EE0C: .4byte gScreenTransition
thumb_func_start sub_0802EE10
sub_0802EE10: @ 0x0802EE10
push {r4, lr}
adds r4, r0, #0
bl sub_0802F04C
adds r0, r4, #0
bl GetNextFrame
pop {r4, pc}
thumb_func_start sub_0802EE20
sub_0802EE20: @ 0x0802EE20
push {lr}
ldr r2, _0802EE34 @ =gUnk_080CDE64
ldrb r1, [r0, #0xc]
lsls r1, r1, #2
adds r1, r1, r2
ldr r1, [r1]
bl _call_via_r1
pop {pc}
.align 2, 0
_0802EE34: .4byte gUnk_080CDE64
thumb_func_start sub_0802EE38
sub_0802EE38: @ 0x0802EE38
push {r4, r5, lr}
adds r5, r0, #0
ldr r0, _0802EE84 @ =gEntCount
ldrb r0, [r0]
cmp r0, #0x46
bhi _0802EE82
movs r0, #0x25
movs r1, #3
bl CreateEnemy
str r5, [r0, #0x50]
movs r0, #1
strb r0, [r5, #0xc]
bl Random
adds r4, r0, #0
movs r1, #3
ands r0, r1
adds r0, #1
strb r0, [r5, #0xe]
bl Random
lsrs r0, r0, #8
adds r1, r5, #0
adds r1, #0x78
strb r0, [r1]
ldr r1, _0802EE88 @ =gUnk_080CDE6C
lsrs r4, r4, #0x10
movs r0, #3
ands r4, r0
adds r4, r4, r1
ldrb r0, [r4]
strb r0, [r5, #0x15]
adds r0, r5, #0
movs r1, #1
bl InitializeAnimation
_0802EE82:
pop {r4, r5, pc}
.align 2, 0
_0802EE84: .4byte gEntCount
_0802EE88: .4byte gUnk_080CDE6C
thumb_func_start sub_0802EE8C
sub_0802EE8C: @ 0x0802EE8C
push {r4, lr}
adds r4, r0, #0
ldr r0, [r4, #0x50]
ldr r2, [r0, #4]
cmp r2, #0
bne _0802EEA8
ldrb r0, [r4, #0x10]
movs r1, #0x7f
ands r1, r0
strb r1, [r4, #0x10]
adds r0, r4, #0
adds r0, #0x45
strb r2, [r0]
b _0802EEB4
_0802EEA8:
adds r0, r4, #0
bl sub_0802F04C
adds r0, r4, #0
bl GetNextFrame
_0802EEB4:
pop {r4, pc}
.align 2, 0
thumb_func_start sub_0802EEB8
sub_0802EEB8: @ 0x0802EEB8
push {r4, lr}
adds r4, r0, #0
ldr r0, [r4, #0x50]
ldr r0, [r0, #4]
cmp r0, #0
bne _0802EEC8
bl DeleteThisEntity
_0802EEC8:
ldrb r0, [r4, #0xc]
cmp r0, #0
bne _0802EED6
movs r0, #1
strb r0, [r4, #0xc]
movs r0, #0xff
strb r0, [r4, #0x14]
_0802EED6:
ldr r0, [r4, #0x50]
adds r1, r4, #0
bl CopyPositionAndSpriteOffset
ldr r1, _0802EF14 @ =gPlayerEntity
adds r0, r4, #0
bl GetFacingDirection
adds r0, #1
movs r1, #0x1e
ands r0, r1
ldr r1, _0802EF18 @ =gUnk_080CDE70
adds r0, r0, r1
ldrb r2, [r0]
ldrb r1, [r4, #0x1e]
cmp r2, r1
beq _0802EF00
ldrb r0, [r0, #1]
cmp r0, r1
beq _0802EF00
strb r2, [r4, #0x1e]
_0802EF00:
ldrh r0, [r4, #0x32]
adds r0, #1
strh r0, [r4, #0x32]
adds r1, r4, #0
adds r1, #0x63
ldrb r0, [r1]
subs r0, #1
strb r0, [r1]
pop {r4, pc}
.align 2, 0
_0802EF14: .4byte gPlayerEntity
_0802EF18: .4byte gUnk_080CDE70
thumb_func_start sub_0802EF1C
sub_0802EF1C: @ 0x0802EF1C
push {r4, lr}
adds r4, r0, #0
ldr r0, [r4, #0x50]
ldr r0, [r0, #4]
cmp r0, #0
bne _0802EF2C
bl DeleteThisEntity
_0802EF2C:
ldrb r0, [r4, #0xc]
cmp r0, #0
bne _0802EF4A
movs r0, #1
strb r0, [r4, #0xc]
movs r0, #0x11
strb r0, [r4, #0x1e]
adds r2, r4, #0
adds r2, #0x29
ldrb r1, [r2]
subs r0, #0x19
ands r0, r1
movs r1, #6
orrs r0, r1
strb r0, [r2]
_0802EF4A:
ldr r0, [r4, #0x50]
adds r1, r4, #0
bl CopyPositionAndSpriteOffset
movs r0, #0
strh r0, [r4, #0x36]
pop {r4, pc}
thumb_func_start sub_0802EF58
sub_0802EF58: @ 0x0802EF58
push {r4, r5, r6, lr}
adds r6, r0, #0
movs r5, #0
_0802EF5E:
movs r0, #0x25
movs r1, #1
bl CreateEnemy
adds r4, r0, #0
cmp r4, #0
beq _0802EF86
strb r5, [r4, #0xb]
adds r1, r4, #0
adds r1, #0x38
movs r0, #1
strb r0, [r1]
str r6, [r4, #0x50]
adds r0, r4, #0
bl UpdateSpriteForCollisionLayer
adds r0, r6, #0
adds r1, r4, #0
bl CopyPosition
_0802EF86:
adds r5, #1
cmp r5, #6
bls _0802EF5E
pop {r4, r5, r6, pc}
.align 2, 0
thumb_func_start sub_0802EF90
sub_0802EF90: @ 0x0802EF90
push {r4, lr}
ldr r4, _0802EFB4 @ =gUnk_080CDE90
adds r3, r0, #0
adds r3, #0x78
ldrb r1, [r3]
adds r2, r1, #1
strb r2, [r3]
lsls r1, r1, #0x18
lsrs r1, r1, #0x1b
movs r2, #7
ands r1, r2
adds r1, r1, r4
ldrb r1, [r1]
lsls r1, r1, #0x18
asrs r1, r1, #0x18
strh r1, [r0, #0x36]
pop {r4, pc}
.align 2, 0
_0802EFB4: .4byte gUnk_080CDE90
thumb_func_start sub_0802EFB8
sub_0802EFB8: @ 0x0802EFB8
push {r4, r5, r6, r7, lr}
adds r4, r0, #0
bl Random
adds r6, r0, #0
lsrs r0, r6, #0x10
movs r1, #3
ands r0, r1
cmp r0, #0
beq _0802EFD2
movs r5, #0x18
ands r5, r6
b _0802EFE0
_0802EFD2:
ldr r0, _0802F01C @ =gPlayerEntity
adds r1, r4, #0
bl GetFacingDirection
adds r5, r0, #4
movs r0, #0x18
ands r5, r0
_0802EFE0:
movs r1, #0x2e
ldrsh r0, [r4, r1]
ldr r2, _0802F020 @ =gRoomControls
ldrh r1, [r2, #6]
subs r0, r0, r1
asrs r0, r0, #4
movs r3, #0x3f
ands r0, r3
movs r7, #0x32
ldrsh r1, [r4, r7]
ldrh r2, [r2, #8]
subs r1, r1, r2
asrs r1, r1, #4
ands r1, r3
lsls r1, r1, #6
orrs r0, r1
ldr r2, _0802F024 @ =gUnk_080B4488
lsrs r1, r5, #2
adds r1, r1, r2
movs r2, #0
ldrsh r1, [r1, r2]
adds r0, r0, r1
movs r1, #1
bl sub_080002E0
cmp r0, #0
beq _0802F028
movs r0, #0xff
strb r0, [r4, #0x15]
b _0802F044
.align 2, 0
_0802F01C: .4byte gPlayerEntity
_0802F020: .4byte gRoomControls
_0802F024: .4byte gUnk_080B4488
_0802F028:
movs r1, #3
adds r0, r6, #0
ands r0, r1
adds r0, #1
strb r0, [r4, #0xe]
strb r5, [r4, #0x15]
ldr r2, _0802F048 @ =gUnk_080CDE98
lsrs r0, r6, #0x18
movs r1, #3
ands r0, r1
lsls r0, r0, #1
adds r0, r0, r2
ldrh r0, [r0]
strh r0, [r4, #0x24]
_0802F044:
pop {r4, r5, r6, r7, pc}
.align 2, 0
_0802F048: .4byte gUnk_080CDE98
thumb_func_start sub_0802F04C
sub_0802F04C: @ 0x0802F04C
push {r4, r5, r6, lr}
adds r4, r0, #0
movs r0, #0x2e
ldrsh r5, [r4, r0]
movs r1, #0x32
ldrsh r6, [r4, r1]
adds r0, r4, #0
bl ProcessMovement
cmp r0, #0
bne _0802F06A
adds r0, r4, #0
bl sub_0802EFB8
b _0802F112
_0802F06A:
ldrb r0, [r4, #0x15]
lsrs r0, r0, #3
cmp r0, #1
beq _0802F098
cmp r0, #1
bgt _0802F07C
cmp r0, #0
beq _0802F082
b _0802F0DC
_0802F07C:
cmp r0, #2
beq _0802F0AE
b _0802F0DC
_0802F082:
movs r2, #0xf
adds r0, r6, #0
ands r0, r2
cmp r0, #8
ble _0802F102
ldrh r1, [r4, #0x32]
adds r0, r2, #0
ands r0, r1
cmp r0, #8
bgt _0802F102
b _0802F0C2
_0802F098:
movs r2, #0xf
adds r0, r5, #0
ands r0, r2
cmp r0, #7
bgt _0802F102
ldrh r1, [r4, #0x2e]
adds r0, r2, #0
ands r0, r1
cmp r0, #7
ble _0802F102
b _0802F0F0
_0802F0AE:
movs r2, #0xf
adds r0, r6, #0
ands r0, r2
cmp r0, #7
bgt _0802F102
ldrh r1, [r4, #0x32]
adds r0, r2, #0
ands r0, r1
cmp r0, #7
ble _0802F102
_0802F0C2:
ldrb r0, [r4, #0xe]
subs r0, #1
strb r0, [r4, #0xe]
movs r1, #0x32
ldrsh r0, [r4, r1]
ldr r1, _0802F0D8 @ =0x0000FFF0
ands r0, r1
adds r6, r0, #0
adds r6, #8
b _0802F102
.align 2, 0
_0802F0D8: .4byte 0x0000FFF0
_0802F0DC:
movs r2, #0xf
adds r0, r5, #0
ands r0, r2
cmp r0, #8
ble _0802F102
ldrh r1, [r4, #0x2e]
adds r0, r2, #0
ands r0, r1
cmp r0, #8
bgt _0802F102
_0802F0F0:
ldrb r0, [r4, #0xe]
subs r0, #1
strb r0, [r4, #0xe]
movs r1, #0x2e
ldrsh r0, [r4, r1]
ldr r1, _0802F114 @ =0x0000FFF0
ands r0, r1
adds r5, r0, #0
adds r5, #8
_0802F102:
ldrb r0, [r4, #0xe]
cmp r0, #0
bne _0802F112
strh r5, [r4, #0x2e]
strh r6, [r4, #0x32]
adds r0, r4, #0
bl sub_0802EFB8
_0802F112:
pop {r4, r5, r6, pc}
.align 2, 0
_0802F114: .4byte 0x0000FFF0
-713
View File
@@ -1,713 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start VaatiProjectile
VaatiProjectile: @ 0x0803E08C
push {r4, r5, lr}
adds r5, r0, #0
bl sub_0803E4A0
cmp r0, #0
beq _0803E0AA
ldrb r0, [r5, #0x10]
movs r1, #0x7f
ands r1, r0
movs r0, #0
strb r1, [r5, #0x10]
adds r1, r5, #0
adds r1, #0x45
strb r0, [r1]
str r0, [r5, #0x50]
_0803E0AA:
ldr r4, _0803E0C0 @ =gUnk_080D0648
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
pop {r4, r5, pc}
.align 2, 0
_0803E0C0: .4byte gUnk_080D0648
thumb_func_start sub_0803E0C4
sub_0803E0C4: @ 0x0803E0C4
push {lr}
ldr r2, _0803E0D8 @ =gUnk_080D0660
ldrb r1, [r0, #0xc]
lsls r1, r1, #2
adds r1, r1, r2
ldr r1, [r1]
bl _call_via_r1
pop {pc}
.align 2, 0
_0803E0D8: .4byte gUnk_080D0660
thumb_func_start sub_0803E0DC
sub_0803E0DC: @ 0x0803E0DC
.ifdef EU
push {r4, r5, lr}
adds r5, r0, #0
adds r0, #0x41
ldrb r0, [r0]
cmp r0, #0x80
bne _0803E08E
movs r0, #5
strb r0, [r5, #0xc]
ldrb r2, [r5, #0x10]
movs r1, #0x7f
adds r0, r1, #0
ands r0, r2
strb r0, [r5, #0x10]
adds r3, r5, #0
adds r3, #0x29
ldrb r2, [r3]
movs r0, #0x39
rsbs r0, r0, #0
ands r0, r2
strb r0, [r3]
ldr r3, _0803E098 @ =gPlayerEntity
ldrb r0, [r3, #0x10]
ands r1, r0
strb r1, [r3, #0x10]
ldrb r2, [r5, #0x1b]
lsrs r2, r2, #6
lsls r2, r2, #6
ldrb r4, [r3, #0x1b]
movs r1, #0x3f
adds r0, r1, #0
ands r0, r4
orrs r0, r2
strb r0, [r3, #0x1b]
ldrb r0, [r5, #0x19]
lsrs r0, r0, #6
lsls r0, r0, #6
ldrb r2, [r3, #0x19]
ands r1, r2
orrs r1, r0
strb r1, [r3, #0x19]
adds r0, r5, #0
bl sub_0803E444
_0803E08E:
ldr r1, _0803E09C @ =gUnk_080D0648
adds r0, r5, #0
bl sub_0804AA30
pop {r4, r5, pc}
.align 2, 0
_0803E098: .4byte gPlayerEntity
_0803E09C: .4byte gUnk_080D0648
.else
push {r4, r5, r6, lr}
adds r5, r0, #0
adds r0, #0x41
ldrb r0, [r0]
cmp r0, #0x80
bne _0803E16C
adds r0, r5, #0
adds r0, #0x45
ldrb r0, [r0]
cmp r0, #0
beq _0803E158
movs r0, #5
strb r0, [r5, #0xc]
ldrb r1, [r5, #0x10]
movs r6, #0x7f
adds r0, r6, #0
ands r0, r1
strb r0, [r5, #0x10]
adds r2, r5, #0
adds r2, #0x29
ldrb r1, [r2]
movs r0, #0x39
rsbs r0, r0, #0
ands r0, r1
strb r0, [r2]
ldr r3, _0803E154 @ =gPlayerEntity
ldrb r1, [r3, #0x10]
adds r0, r6, #0
ands r0, r1
strb r0, [r3, #0x10]
ldrb r2, [r5, #0x1b]
lsrs r2, r2, #6
lsls r2, r2, #6
ldrb r4, [r3, #0x1b]
movs r1, #0x3f
adds r0, r1, #0
ands r0, r4
orrs r0, r2
strb r0, [r3, #0x1b]
ldrb r0, [r5, #0x19]
lsrs r0, r0, #6
lsls r0, r0, #6
ldrb r2, [r3, #0x19]
ands r1, r2
orrs r1, r0
strb r1, [r3, #0x19]
adds r0, r5, #0
bl sub_0803E444
movs r0, #2
bl sub_08078A90
ldr r2, [r5, #0x50]
cmp r2, #0
beq _0803E16C
ldrb r1, [r2, #0x10]
adds r0, r6, #0
ands r0, r1
b _0803E16A
.align 2, 0
_0803E154: .4byte gPlayerEntity
_0803E158:
ldr r2, _0803E178 @ =gPlayerState
ldr r0, [r2, #0x30]
ldr r1, _0803E17C @ =0xFFFFFEFF
ands r0, r1
str r0, [r2, #0x30]
ldr r2, _0803E180 @ =gPlayerEntity
ldrb r1, [r2, #0x10]
movs r0, #0x80
orrs r0, r1
_0803E16A:
strb r0, [r2, #0x10]
_0803E16C:
ldr r1, _0803E184 @ =gUnk_080D0648
adds r0, r5, #0
bl sub_0804AA30
pop {r4, r5, r6, pc}
.align 2, 0
_0803E178: .4byte gPlayerState
_0803E17C: .4byte 0xFFFFFEFF
_0803E180: .4byte gPlayerEntity
_0803E184: .4byte gUnk_080D0648
.endif
thumb_func_start sub_0803E188
sub_0803E188: @ 0x0803E188
push {lr}
adds r3, r0, #0
ldr r2, [r3, #0x50]
cmp r2, #0
beq _0803E19C
ldrb r0, [r2, #0xf]
subs r0, #1
movs r1, #0
strb r0, [r2, #0xf]
str r1, [r3, #0x50]
_0803E19C:
adds r0, r3, #0
bl sub_0804A7D4
pop {pc}
thumb_func_start nullsub_19
nullsub_19: @ 0x0803E1A4
bx lr
.align 2, 0
thumb_func_start sub_0803E1A8
sub_0803E1A8: @ 0x0803E1A8
push {r4, r5, lr}
adds r5, r0, #0
ldrb r0, [r5, #0xa]
cmp r0, #0
bne _0803E1F8
movs r0, #0x4b
movs r1, #1
bl CreateEnemy
cmp r0, #0
beq _0803E250
str r5, [r0, #0x50]
str r0, [r5, #0x54]
ldrb r0, [r5, #0xb]
cmp r0, #0
bne _0803E1D8
movs r0, #1
strb r0, [r5, #0xc]
ldr r0, _0803E1D4 @ =0x0000FFE8
strh r0, [r5, #0x36]
b _0803E1E8
.align 2, 0
_0803E1D4: .4byte 0x0000FFE8
_0803E1D8:
movs r0, #9
strb r0, [r5, #0xc]
ldr r0, _0803E1F4 @ =0x0000FF80
strh r0, [r5, #0x36]
adds r1, r5, #0
adds r1, #0x3b
movs r0, #1
strb r0, [r1]
_0803E1E8:
adds r0, r5, #0
movs r1, #0
bl InitializeAnimation
b _0803E250
.align 2, 0
_0803E1F4: .4byte 0x0000FF80
_0803E1F8:
movs r0, #8
strb r0, [r5, #0xc]
ldrb r1, [r5, #0x10]
movs r0, #0x7f
ands r0, r1
strb r0, [r5, #0x10]
adds r1, r5, #0
adds r1, #0x63
movs r0, #1
strb r0, [r1]
ldr r4, [r5, #0x50]
ldrb r2, [r4, #0x1b]
lsrs r2, r2, #6
lsls r2, r2, #6
ldrb r3, [r5, #0x1b]
movs r1, #0x3f
adds r0, r1, #0
ands r0, r3
orrs r0, r2
strb r0, [r5, #0x1b]
ldrb r0, [r4, #0x19]
lsrs r0, r0, #6
lsls r0, r0, #6
ldrb r2, [r5, #0x19]
ands r1, r2
orrs r1, r0
strb r1, [r5, #0x19]
adds r2, r5, #0
adds r2, #0x29
ldrb r1, [r2]
movs r0, #0x39
rsbs r0, r0, #0
ands r0, r1
strb r0, [r2]
ldr r0, [r5, #0x50]
ldr r3, _0803E254 @ =0xFFFF0000
adds r1, r5, #0
movs r2, #0
bl PositionRelative
adds r0, r5, #0
movs r1, #1
bl InitializeAnimation
_0803E250:
pop {r4, r5, pc}
.align 2, 0
_0803E254: .4byte 0xFFFF0000
thumb_func_start sub_0803E258
sub_0803E258: @ 0x0803E258
push {r4, lr}
adds r4, r0, #0
bl sub_0803E480
adds r0, r4, #0
movs r1, #0
movs r2, #8
bl PlayerInRange
cmp r0, #0
beq _0803E280
movs r0, #2
strb r0, [r4, #0xc]
movs r0, #0xa
strb r0, [r4, #0xe]
ldr r0, [r4, #0x54]
movs r1, #2
bl InitializeAnimation
b _0803E29C
_0803E280:
ldr r0, _0803E2A4 @ =gUnk_020000B0
ldr r1, [r0]
cmp r1, #0
beq _0803E29C
adds r0, r4, #0
bl GetFacingDirection
adds r1, r0, #0
adds r0, r4, #0
bl sub_08004596
adds r0, r4, #0
bl sub_0806F69C
_0803E29C:
adds r0, r4, #0
bl GetNextFrame
pop {r4, pc}
.align 2, 0
_0803E2A4: .4byte gUnk_020000B0
thumb_func_start sub_0803E2A8
sub_0803E2A8: @ 0x0803E2A8
push {lr}
adds r1, r0, #0
ldrb r0, [r1, #0xe]
cmp r0, #0
beq _0803E2B8
subs r0, #1
strb r0, [r1, #0xe]
b _0803E2C8
_0803E2B8:
ldrh r0, [r1, #0x36]
adds r0, #1
strh r0, [r1, #0x36]
lsls r0, r0, #0x10
cmp r0, #0
bne _0803E2C8
movs r0, #3
strb r0, [r1, #0xc]
_0803E2C8:
adds r0, r1, #0
bl GetNextFrame
pop {pc}
thumb_func_start sub_0803E2D0
sub_0803E2D0: @ 0x0803E2D0
push {r4, lr}
adds r4, r0, #0
ldr r0, [r4, #0x54]
adds r0, #0x5a
ldrb r1, [r0]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _0803E312
ldrh r0, [r4, #0x36]
subs r0, #1
strh r0, [r4, #0x36]
lsls r0, r0, #0x10
asrs r0, r0, #0x10
movs r1, #0x18
rsbs r1, r1, #0
cmp r0, r1
bgt _0803E30C
movs r0, #4
strb r0, [r4, #0xc]
bl Random
movs r1, #0xf
ands r0, r1
adds r0, #0xf
strb r0, [r4, #0xe]
ldr r0, [r4, #0x54]
movs r1, #1
bl InitializeAnimation
_0803E30C:
adds r0, r4, #0
bl GetNextFrame
_0803E312:
pop {r4, pc}
thumb_func_start sub_0803E314
sub_0803E314: @ 0x0803E314
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 _0803E332
movs r0, #1
strb r0, [r4, #0xc]
ldr r1, _0803E33C @ =gPlayerEntity
adds r0, r4, #0
bl GetFacingDirection
strb r0, [r4, #0x15]
_0803E332:
adds r0, r4, #0
bl GetNextFrame
pop {r4, pc}
.align 2, 0
_0803E33C: .4byte gPlayerEntity
thumb_func_start sub_0803E340
sub_0803E340: @ 0x0803E340
push {r4, lr}
adds r4, r0, #0
bl sub_0803E444
ldrb r0, [r4, #0xe]
cmp r0, #0
beq _0803E352
subs r0, #1
b _0803E36A
_0803E352:
ldrh r0, [r4, #0x36]
subs r0, #1
strh r0, [r4, #0x36]
lsls r0, r0, #0x10
asrs r0, r0, #0x10
movs r1, #0x18
rsbs r1, r1, #0
cmp r0, r1
bgt _0803E36C
movs r0, #6
strb r0, [r4, #0xc]
movs r0, #0x14
_0803E36A:
strb r0, [r4, #0xe]
_0803E36C:
pop {r4, pc}
.align 2, 0
thumb_func_start sub_0803E370
sub_0803E370: @ 0x0803E370
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 _0803E38E
movs r0, #7
strb r0, [r1, #0xc]
movs r0, #0x10
strb r0, [r1, #0x15]
movs r0, #0xc0
lsls r0, r0, #2
strh r0, [r1, #0x24]
_0803E38E:
adds r0, r1, #0
bl sub_0803E444
pop {pc}
.align 2, 0
thumb_func_start sub_0803E398
sub_0803E398: @ 0x0803E398
push {r4, lr}
adds r4, r0, #0
bl sub_0803E444
adds r0, r4, #0
bl sub_0806F69C
adds r0, r4, #0
bl sub_0803E4D8
ldr r1, _0803E3CC @ =gRoomControls
ldrh r0, [r1, #8]
ldrh r1, [r1, #0x20]
adds r0, r0, r1
subs r0, #0x10
movs r2, #0x32
ldrsh r1, [r4, r2]
cmp r0, r1
bgt _0803E3C8
bl sub_0805E5A8
ldr r0, _0803E3D0 @ =gUnk_0813AB94
bl DoExitTransition
_0803E3C8:
pop {r4, pc}
.align 2, 0
_0803E3CC: .4byte gRoomControls
_0803E3D0: .4byte gUnk_0813AB94
thumb_func_start sub_0803E3D4
sub_0803E3D4: @ 0x0803E3D4
push {r4, lr}
adds r4, r0, #0
ldr r0, [r4, #0x50]
ldr r0, [r0, #4]
cmp r0, #0
bne _0803E3E4
bl DeleteThisEntity
_0803E3E4:
ldr r0, [r4, #0x50]
ldr r3, _0803E3F8 @ =0xFFFF0000
adds r1, r4, #0
movs r2, #0
bl PositionRelative
adds r0, r4, #0
bl GetNextFrame
pop {r4, pc}
.align 2, 0
_0803E3F8: .4byte 0xFFFF0000
thumb_func_start sub_0803E3FC
sub_0803E3FC: @ 0x0803E3FC
push {r4, lr}
adds r4, r0, #0
ldr r1, _0803E438 @ =gPlayerEntity
ldrh r0, [r1, #0x2e]
strh r0, [r4, #0x2e]
ldrh r0, [r1, #0x32]
strh r0, [r4, #0x32]
ldrh r2, [r4, #0x36]
movs r0, #0x36
ldrsh r1, [r4, r0]
movs r0, #8
rsbs r0, r0, #0
cmp r1, r0
bge _0803E43C
adds r0, r4, #0
adds r0, #0x58
ldrb r0, [r0]
cmp r0, #2
beq _0803E42E
movs r0, #0
strb r0, [r4, #0xe]
ldr r0, [r4, #0x54]
movs r1, #2
bl InitializeAnimation
_0803E42E:
adds r0, r4, #0
bl sub_0803E2A8
b _0803E442
.align 2, 0
_0803E438: .4byte gPlayerEntity
_0803E43C:
adds r0, r2, #0
adds r0, #8
strh r0, [r4, #0x36]
_0803E442:
pop {r4, pc}
thumb_func_start sub_0803E444
sub_0803E444: @ 0x0803E444
push {r4, lr}
adds r4, r0, #0
bl ResetPlayer
ldr r2, _0803E478 @ =gPlayerState
ldrb r1, [r2, #0x1a]
movs r0, #0x80
orrs r1, r0
strb r1, [r2, #0x1a]
ldrb r1, [r2, #0xa]
orrs r0, r1
strb r0, [r2, #0xa]
ldr r1, [r4, #0x4c]
movs r3, #2
rsbs r3, r3, #0
adds r0, r4, #0
movs r2, #0
bl sub_0806FA90
ldr r1, _0803E47C @ =gPlayerEntity
adds r1, #0x63
ldrb r0, [r1]
adds r0, #0xe
strb r0, [r1]
pop {r4, pc}
.align 2, 0
_0803E478: .4byte gPlayerState
_0803E47C: .4byte gPlayerEntity
thumb_func_start sub_0803E480
sub_0803E480: @ 0x0803E480
push {lr}
adds r3, r0, #0
adds r2, r3, #0
adds r2, #0x78
ldrh r1, [r2]
movs r0, #0x96
lsls r0, r0, #3
cmp r1, r0
bls _0803E49A
movs r0, #0xc0
lsls r0, r0, #1
strh r0, [r3, #0x24]
b _0803E49E
_0803E49A:
adds r0, r1, #1
strh r0, [r2]
_0803E49E:
pop {pc}
thumb_func_start sub_0803E4A0
sub_0803E4A0: @ 0x0803E4A0
.ifdef EU
push {lr}
adds r1, r0, #0
ldr r0, _0803E3CCEU @ =gScreenTransition
adds r0, #0x39
ldrb r0, [r0]
cmp r0, #0
bne _0803E3D0EU
movs r0, #1
b _0803E3E6
.align 2, 0
_0803E3CCEU: .4byte gScreenTransition
_0803E3D0EU:
ldr r0, [r1, #0x50]
cmp r0, #0
bne _0803E3DA
movs r0, #0
b _0803E3E6
_0803E3DA:
movs r1, #0
ldr r0, [r0, #4]
cmp r0, #0
bne _0803E3E4EU
movs r1, #1
_0803E3E4EU:
adds r0, r1, #0
_0803E3E6:
pop {pc}
.else
push {lr}
adds r1, r0, #0
ldr r0, _0803E4B8 @ =gScreenTransition
adds r0, #0x39
ldrb r0, [r0]
cmp r0, #0
beq _0803E4C6
ldr r1, [r1, #0x50]
cmp r1, #0
bne _0803E4BC
movs r0, #0
b _0803E4D6
.align 2, 0
_0803E4B8: .4byte gScreenTransition
_0803E4BC:
adds r0, r1, #0
adds r0, #0x45
ldrb r0, [r0]
cmp r0, #0
bne _0803E4CA
_0803E4C6:
movs r0, #1
b _0803E4D6
_0803E4CA:
movs r2, #0
ldr r0, [r1, #4]
cmp r0, #0
bne _0803E4D4
movs r2, #1
_0803E4D4:
adds r0, r2, #0
_0803E4D6:
pop {pc}
.endif
thumb_func_start sub_0803E4D8
sub_0803E4D8: @ 0x0803E4D8
push {r4, r5, lr}
movs r2, #0x2e
ldrsh r1, [r0, r2]
ldr r3, _0803E51C @ =gRoomControls
ldrh r2, [r3, #6]
subs r1, r1, r2
asrs r4, r1, #4
movs r2, #0x3f
ands r4, r2
movs r1, #0x32
ldrsh r0, [r0, r1]
ldrh r1, [r3, #8]
subs r1, #8
subs r0, r0, r1
asrs r0, r0, #4
ands r0, r2
lsls r0, r0, #6
orrs r4, r0
ldr r0, _0803E520 @ =gPlayerEntity
adds r5, r0, #0
adds r5, #0x38
ldrb r1, [r5]
adds r0, r4, #0
bl sub_080002E0
cmp r0, #0xff
beq _0803E518
ldr r0, _0803E524 @ =0x00004074
ldrb r2, [r5]
adds r1, r4, #0
bl SetTile
_0803E518:
pop {r4, r5, pc}
.align 2, 0
_0803E51C: .4byte gRoomControls
_0803E520: .4byte gPlayerEntity
_0803E524: .4byte 0x00004074
-451
View File
@@ -1,451 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start VaatiReborn
VaatiReborn: @ 0x0806B664
push {lr}
ldr r2, _0806B678 @ =gUnk_08112F78
ldrb r1, [r0, #0xc]
lsls r1, r1, #2
adds r1, r1, r2
ldr r1, [r1]
bl _call_via_r1
pop {pc}
.align 2, 0
_0806B678: .4byte gUnk_08112F78
thumb_func_start sub_0806B67C
sub_0806B67C: @ 0x0806B67C
push {r4, r5, r6, lr}
adds r6, r0, #0
movs r1, #0
movs r0, #1
strb r0, [r6, #0xc]
strb r1, [r6, #0xd]
strb r1, [r6, #0xe]
ldrb r0, [r6, #0xa]
cmp r0, #5
bls _0806B692
b _0806B7B8
_0806B692:
lsls r0, r0, #2
ldr r1, _0806B69C @ =_0806B6A0
adds r0, r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_0806B69C: .4byte _0806B6A0
_0806B6A0: @ jump table
.4byte _0806B6B8 @ case 0
.4byte _0806B7A6 @ case 1
.4byte _0806B70C @ case 2
.4byte _0806B726 @ case 3
.4byte _0806B7B0 @ case 4
.4byte _0806B7A6 @ case 5
_0806B6B8:
ldrh r0, [r6, #0x32]
subs r0, #0xa0
strh r0, [r6, #0x32]
movs r0, #0xa0
strb r0, [r6, #0xe]
movs r0, #0x20
strb r0, [r6, #0xf]
adds r1, r6, #0
adds r1, #0x63
strb r0, [r1]
movs r5, #0
_0806B6CE:
movs r0, #0x3b
movs r1, #2
adds r2, r5, #0
bl CreateNPC
adds r4, r0, #0
cmp r4, #0
beq _0806B6E0
str r6, [r4, #0x50]
_0806B6E0:
adds r5, #1
cmp r5, #3
bls _0806B6CE
movs r0, #0x3b
movs r1, #1
movs r2, #0
bl CreateNPC
adds r4, r0, #0
str r6, [r4, #0x50]
adds r1, r4, #0
adds r1, #0x63
movs r0, #0xff
strb r0, [r1]
movs r3, #0x80
lsls r3, r3, #9
adds r0, r6, #0
adds r1, r4, #0
movs r2, #0
bl PositionRelative
b _0806B7A6
_0806B70C:
ldrb r1, [r6, #0xb]
movs r0, #2
ands r0, r1
cmp r0, #0
beq _0806B71E
ldrb r0, [r6, #0x18]
movs r1, #0x40
orrs r0, r1
strb r0, [r6, #0x18]
_0806B71E:
adds r0, r6, #0
bl sub_0806B96C
b _0806B7A6
_0806B726:
movs r0, #1
strb r0, [r6, #0xe]
movs r0, #0x20
strb r0, [r6, #0xf]
movs r0, #0x3b
movs r1, #4
movs r2, #0
bl CreateNPC
adds r4, r0, #0
cmp r4, #0
beq _0806B76C
adds r0, r6, #0
adds r1, r4, #0
bl CopyPosition
str r6, [r4, #0x50]
adds r0, r6, #0
adds r0, #0x29
ldrb r1, [r0]
lsls r1, r1, #0x1d
lsrs r1, r1, #0x1d
subs r1, #1
adds r3, r4, #0
adds r3, #0x29
movs r0, #7
ands r1, r0
ldrb r2, [r3]
movs r0, #8
rsbs r0, r0, #0
ands r0, r2
orrs r0, r1
strb r0, [r3]
movs r0, #0
strb r0, [r4, #0x1e]
_0806B76C:
movs r0, #0x3b
movs r1, #5
movs r2, #0
bl CreateNPC
adds r4, r0, #0
cmp r4, #0
beq _0806B7A6
adds r0, r6, #0
adds r1, r4, #0
bl CopyPosition
str r6, [r4, #0x50]
adds r0, r6, #0
adds r0, #0x29
ldrb r1, [r0]
lsls r1, r1, #0x1d
lsrs r1, r1, #0x1d
adds r1, #1
adds r3, r4, #0
adds r3, #0x29
movs r0, #7
ands r1, r0
ldrb r2, [r3]
movs r0, #8
rsbs r0, r0, #0
ands r0, r2
orrs r0, r1
strb r0, [r3]
_0806B7A6:
adds r0, r6, #0
movs r1, #0
bl InitAnimationForceUpdate
b _0806B7B8
_0806B7B0:
adds r0, r6, #0
movs r1, #0
bl InitializeAnimation
_0806B7B8:
pop {r4, r5, r6, pc}
.align 2, 0
thumb_func_start sub_0806B7BC
sub_0806B7BC: @ 0x0806B7BC
push {r4, r5, lr}
adds r5, r0, #0
movs r0, #3
bl CheckRoomFlag
cmp r0, #0
bne _0806B7CC
b _0806B968
_0806B7CC:
ldrb r0, [r5, #0xa]
cmp r0, #1
beq _0806B84C
cmp r0, #1
bgt _0806B7DC
cmp r0, #0
beq _0806B7E6
b _0806B93C
_0806B7DC:
cmp r0, #2
beq _0806B86C
cmp r0, #3
beq _0806B874
b _0806B93C
_0806B7E6:
ldrh r0, [r5, #0x32]
adds r0, #1
strh r0, [r5, #0x32]
ldrb r0, [r5, #0xe]
subs r0, #1
strb r0, [r5, #0xe]
movs r1, #0xff
lsls r0, r0, #0x18
cmp r0, #0
bne _0806B82C
movs r0, #0x3b
movs r1, #3
movs r2, #0
bl CreateNPC
adds r4, r0, #0
cmp r4, #0
bne _0806B80C
b _0806B968
_0806B80C:
adds r0, r5, #0
adds r1, r4, #0
bl CopyPosition
ldr r0, _0806B828 @ =0x00001634
bl TextboxNoOverlapFollow
ldrb r0, [r5, #0xd]
adds r0, #1
strb r0, [r5, #0xd]
bl DeleteThisEntity
b _0806B968
.align 2, 0
_0806B828: .4byte 0x00001634
_0806B82C:
ldrb r0, [r5, #0xf]
subs r0, #1
strb r0, [r5, #0xf]
ands r0, r1
cmp r0, #0
beq _0806B83A
b _0806B95A
_0806B83A:
movs r0, #0x20
strb r0, [r5, #0xf]
ldr r0, _0806B848 @ =0x000001A9
bl SoundReq
b _0806B95A
.align 2, 0
_0806B848: .4byte 0x000001A9
_0806B84C:
adds r0, r5, #0
bl sub_0806B9BC
adds r4, r0, #0
cmp r4, #0
bne _0806B85C
bl DeleteThisEntity
_0806B85C:
movs r3, #0x84
lsls r3, r3, #0xe
adds r0, r4, #0
adds r1, r5, #0
movs r2, #0
bl PositionRelative
b _0806B95A
_0806B86C:
adds r0, r5, #0
bl sub_0806B96C
b _0806B95A
_0806B874:
ldrb r0, [r5, #0xd]
cmp r0, #1
beq _0806B8A2
cmp r0, #1
bgt _0806B884
cmp r0, #0
beq _0806B88E
b _0806B91E
_0806B884:
cmp r0, #2
beq _0806B8C4
cmp r0, #3
beq _0806B906
b _0806B91E
_0806B88E:
ldrb r0, [r5, #0xe]
subs r0, #1
strb r0, [r5, #0xe]
lsls r0, r0, #0x18
cmp r0, #0
bne _0806B91E
ldrb r0, [r5, #0xd]
adds r0, #1
strb r0, [r5, #0xd]
b _0806B91E
_0806B8A2:
adds r0, r5, #0
adds r0, #0x5a
ldrb r1, [r0]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _0806B91E
movs r0, #2
strb r0, [r5, #0xd]
ldr r1, _0806B8C0 @ =0x0000013F
adds r0, r5, #0
bl sub_0801D2B4
b _0806B8FA
.align 2, 0
_0806B8C0: .4byte 0x0000013F
_0806B8C4:
adds r2, r5, #0
adds r2, #0x5a
ldrb r1, [r2]
movs r0, #0x10
ands r0, r1
cmp r0, #0
beq _0806B91E
movs r0, #0xef
ands r0, r1
strb r0, [r2]
ldrb r0, [r5, #0xe]
adds r0, #1
strb r0, [r5, #0xe]
lsls r0, r0, #0x18
lsrs r0, r0, #0x18
cmp r0, #1
beq _0806B91E
cmp r0, #0xa
bne _0806B91E
ldrb r0, [r5, #0xd]
adds r0, #1
strb r0, [r5, #0xd]
movs r0, #0xf4
bl EnqueueSFX
movs r0, #0
strb r0, [r5, #0xe]
_0806B8FA:
ldrb r1, [r5, #0xd]
subs r1, #1
adds r0, r5, #0
bl InitAnimationForceUpdate
b _0806B91E
_0806B906:
adds r0, r5, #0
adds r0, #0x5a
ldrb r1, [r0]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _0806B91E
movs r0, #0
bl SetRoomFlag
bl DeleteThisEntity
_0806B91E:
ldrb r0, [r5, #0xf]
subs r0, #1
strb r0, [r5, #0xf]
lsls r0, r0, #0x18
cmp r0, #0
bne _0806B95A
movs r0, #0x20
strb r0, [r5, #0xf]
ldr r0, _0806B938 @ =0x000001A9
bl SoundReq
b _0806B95A
.align 2, 0
_0806B938: .4byte 0x000001A9
_0806B93C:
adds r0, r5, #0
bl sub_0806B9BC
adds r4, r0, #0
cmp r4, #0
bne _0806B94E
bl DeleteThisEntity
b _0806B968
_0806B94E:
ldrb r0, [r4, #0xd]
cmp r0, #0
beq _0806B968
ldrb r0, [r5, #0xa]
cmp r0, #4
beq _0806B962
_0806B95A:
adds r0, r5, #0
bl UpdateAnimationSingleFrame
b _0806B968
_0806B962:
adds r0, r5, #0
bl GetNextFrame
_0806B968:
pop {r4, r5, pc}
.align 2, 0
thumb_func_start sub_0806B96C
sub_0806B96C: @ 0x0806B96C
push {r4, r5, lr}
adds r4, r0, #0
bl sub_0806B9BC
adds r5, r0, #0
cmp r5, #0
bne _0806B97E
bl DeleteThisEntity
_0806B97E:
ldrb r3, [r4, #0xb]
lsls r3, r3, #1
ldr r0, _0806B9B8 @ =gUnk_08112F80
adds r3, r3, r0
ldrb r1, [r5, #0x18]
lsls r1, r1, #0x1e
lsrs r1, r1, #0x1e
ldrb r2, [r4, #0x18]
movs r0, #4
rsbs r0, r0, #0
ands r0, r2
orrs r0, r1
strb r0, [r4, #0x18]
movs r2, #0
ldrsb r2, [r3, r2]
lsls r2, r2, #0x10
ldrb r3, [r3, #1]
lsls r3, r3, #0x18
asrs r3, r3, #0x18
adds r3, #0x21
lsls r3, r3, #0x10
adds r0, r5, #0
adds r1, r4, #0
bl PositionRelative
adds r0, r4, #0
bl UpdateAnimationSingleFrame
pop {r4, r5, pc}
.align 2, 0
_0806B9B8: .4byte gUnk_08112F80
thumb_func_start sub_0806B9BC
sub_0806B9BC: @ 0x0806B9BC
push {lr}
ldr r1, [r0, #0x50]
cmp r1, #0
beq _0806B9CC
ldr r0, [r1, #4]
cmp r0, #0
bne _0806B9CC
movs r1, #0
_0806B9CC:
adds r0, r1, #0
pop {pc}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-2541
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1,7 +1,7 @@
#!/bin/bash
buildname=tmc
baserom=baserom
buildname=tmc_eu
baserom=baserom_eu
OBJDUMP="$DEVKITARM/bin/arm-none-eabi-objdump -D -bbinary -marmv4t -Mforce-thumb"
OPTIONS="--start-address=$(($1)) --stop-address=$(($1 + $2))"
-24
View File
@@ -1,24 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gUnk_080D1888:: @ 080D1888
.4byte sub_080456E8
.4byte sub_08045700
.4byte sub_080456E8
.4byte sub_0804A7D4
.4byte sub_08001242
.4byte nullsub_173
gUnk_080D18A0:: @ 080D18A0
.4byte sub_080457E4
.4byte sub_0804586C
.4byte sub_080458C4
.4byte sub_08045938
.4byte sub_08045984
gUnk_080D18B4:: @ 080D18B4
.incbin "baserom.gba", 0x0D18B4, 0x0000010
-26
View File
@@ -1,26 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gUnk_080D1D48:: @ 080D1D48
.4byte sub_080482EC
.4byte sub_08048330
.4byte sub_0804835C
.4byte sub_08048388
.4byte sub_080483F8
.4byte sub_08048438
.4byte sub_08048478
.4byte sub_080484E8
.4byte sub_08048550
.4byte sub_080485A0
gUnk_080D1D70:: @ 080D1D70
.incbin "baserom.gba", 0x0D1D70, 0x0000008
gUnk_080D1D78:: @ 080D1D78
.incbin "baserom.gba", 0x0D1D78, 0x0000020
gUnk_080D1D98:: @ 080D1D98
.incbin "baserom.gba", 0x0D1D98, 0x0000008
-193
View File
@@ -1,193 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gUnk_080D1230:: @ 080D1230
.4byte sub_08042570
.4byte sub_08042588
.4byte sub_08001324
.4byte sub_0804A7D4
.4byte sub_08001242
.4byte nullsub_170
gUnk_080D1248:: @ 080D1248
.4byte sub_0804259C
.4byte sub_08044078
.4byte sub_08044078
.4byte sub_08044078
.4byte sub_080440CC
gUnk_080D125C:: @ 080D125C
.4byte sub_080425B4
.4byte sub_08042654
.4byte sub_08042818
.4byte sub_08042870
.4byte sub_08042A3C
.4byte sub_08042C14
.4byte sub_0804325C
.4byte sub_08043420
.4byte sub_08043680
gUnk_080D1280:: @ 080D1280
.incbin "baserom.gba", 0x0D1280, 0x0000004
gUnk_080D1284:: @ 080D1284
.incbin "baserom.gba", 0x0D1284, 0x0000002
gUnk_080D1286:: @ 080D1286
.incbin "baserom.gba", 0x0D1286, 0x000000A
gUnk_080D1290:: @ 080D1290
.4byte sub_08042894
.4byte sub_080428AC
.4byte sub_080428FC
.4byte sub_08042944
.4byte sub_08042970
.4byte sub_080429D4
.4byte sub_080429FC
gUnk_080D12AC:: @ 080D12AC
.incbin "baserom.gba", 0x0D12AC, 0x0000004
gUnk_080D12B0:: @ 080D12B0
.incbin "baserom.gba", 0x0D12B0, 0x0000002
gUnk_080D12B2:: @ 080D12B2
.incbin "baserom.gba", 0x0D12B2, 0x0000002
gUnk_080D12B4:: @ 080D12B4
.incbin "baserom.gba", 0x0D12B4, 0x0000002
gUnk_080D12B6:: @ 080D12B6
.incbin "baserom.gba", 0x0D12B6, 0x0000002
gUnk_080D12B8:: @ 080D12B8
.4byte sub_08042A6C
.4byte sub_08042A88
.4byte sub_08042AEC
.4byte sub_08042B20
gUnk_080D12C8:: @ 080D12C8
.incbin "baserom.gba", 0x0D12C8, 0x0000002
gUnk_080D12CA:: @ 080D12CA
.incbin "baserom.gba", 0x0D12CA, 0x0000006
gUnk_080D12D0:: @ 080D12D0
.4byte sub_08042C34
.4byte sub_08042D24
.4byte sub_08042D6C
.4byte sub_08042E30
.4byte sub_08042EF4
.4byte sub_08042FD8
.4byte sub_08043048
.4byte sub_080430D0
.4byte sub_08043130
.4byte sub_080431E8
gUnk_080D12F8:: @ 080D12F8
.incbin "baserom.gba", 0x0D12F8, 0x0000006
gUnk_080D12FE:: @ 080D12FE
.incbin "baserom.gba", 0x0D12FE, 0x0000002
gUnk_080D1300:: @ 080D1300
.incbin "baserom.gba", 0x0D1300, 0x0000004
gUnk_080D1304:: @ 080D1304
.incbin "baserom.gba", 0x0D1304, 0x0000008
gUnk_080D130C:: @ 080D130C
.incbin "baserom.gba", 0x0D130C, 0x0000001
gUnk_080D130D:: @ 080D130D
.incbin "baserom.gba", 0x0D130D, 0x0000003
gUnk_080D1310:: @ 080D1310
.incbin "baserom.gba", 0x0D1310, 0x0000004
gUnk_080D1314:: @ 080D1314
.4byte sub_080432A8
gUnk_080D1318:: @ 080D1318
.4byte sub_0804334C
gUnk_080D131C:: @ 080D131C
.incbin "baserom.gba", 0x0D131C, 0x0000004
gUnk_080D1320:: @ 080D1320
.4byte sub_08043440
.4byte sub_08043490
.4byte sub_08043520
.4byte sub_0804355C
.4byte sub_08043580
.4byte sub_080435F4
gUnk_080D1338:: @ 080D1338
.incbin "baserom.gba", 0x0D1338, 0x0000004
gUnk_080D133C:: @ 080D133C
.incbin "baserom.gba", 0x0D133C, 0x0000004
gUnk_080D1340:: @ 080D1340
.incbin "baserom.gba", 0x0D1340, 0x0000008
gUnk_080D1348:: @ 080D1348
.4byte sub_08043698
.4byte sub_080436C0
.4byte sub_08043700
.4byte sub_08043738
.4byte sub_08043770
gUnk_080D135C:: @ 080D135C
.incbin "baserom.gba", 0x0D135C, 0x0000006
gUnk_080D1362:: @ 080D1362
.incbin "baserom.gba", 0x0D1362, 0x0000050
gUnk_080D13B2:: @ 080D13B2
.incbin "baserom.gba", 0x0D13B2, 0x0000005
gUnk_080D13B7:: @ 080D13B7
.incbin "baserom.gba", 0x0D13B7, 0x0000021
gUnk_080D13D8:: @ 080D13D8
.incbin "baserom.gba", 0x0D13D8, 0x0000008
gUnk_080D13E0:: @ 080D13E0
.incbin "baserom.gba", 0x0D13E0, 0x0000003
gUnk_080D13E3:: @ 080D13E3
.incbin "baserom.gba", 0x0D13E3, 0x0000006
gUnk_080D13E9:: @ 080D13E9
.incbin "baserom.gba", 0x0D13E9, 0x0000003
gUnk_080D13EC:: @ 080D13EC
.incbin "baserom.gba", 0x0D13EC, 0x0000014
gUnk_080D1400:: @ 080D1400
.incbin "baserom.gba", 0x0D1400, 0x000000D
gUnk_080D140D:: @ 080D140D
.incbin "baserom.gba", 0x0D140D, 0x0000005
gUnk_080D1412:: @ 080D1412
.incbin "baserom.gba", 0x0D1412, 0x0000002
gUnk_080D1414:: @ 080D1414
.incbin "baserom.gba", 0x0D1414, 0x0000003
gUnk_080D1417:: @ 080D1417
.incbin "baserom.gba", 0x0D1417, 0x0000001
gUnk_080D1418:: @ 080D1418
.incbin "baserom.gba", 0x0D1418, 0x0000001
gUnk_080D1419:: @ 080D1419
.incbin "baserom.gba", 0x0D1419, 0x0000003
gUnk_080D141C:: @ 080D141C
.incbin "baserom.gba", 0x0D141C, 0x0000002
-39
View File
@@ -1,39 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gUnk_080CDE34:: @ 080CDE34
.4byte sub_0802EC98
.4byte sub_0802ECC0
.4byte sub_08001324
.4byte sub_0804A7D4
.4byte sub_08001242
.4byte sub_0802EC98
gUnk_080CDE4C:: @ 080CDE4C
.4byte sub_0802ED74
.4byte sub_0802EE20
.4byte sub_0802EEB8
.4byte sub_0802EF1C
gUnk_080CDE5C:: @ 080CDE5C
.4byte sub_0802ED8C
.4byte sub_0802EE10
gUnk_080CDE64:: @ 080CDE64
.4byte sub_0802EE38
.4byte sub_0802EE8C
gUnk_080CDE6C:: @ 080CDE6C
.incbin "baserom.gba", 0x0CDE6C, 0x0000004
gUnk_080CDE70:: @ 080CDE70
.incbin "baserom.gba", 0x0CDE70, 0x0000020
gUnk_080CDE90:: @ 080CDE90
.incbin "baserom.gba", 0x0CDE90, 0x0000008
gUnk_080CDE98:: @ 080CDE98
.incbin "baserom.gba", 0x0CDE98, 0x0000008
-25
View File
@@ -1,25 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gUnk_080D0648:: @ 080D0648
.4byte sub_0803E0C4
.4byte sub_0803E0DC
.4byte sub_08001328
.4byte sub_0803E188
.4byte sub_08001242
.4byte nullsub_19
gUnk_080D0660:: @ 080D0660
.4byte sub_0803E1A8
.4byte sub_0803E258
.4byte sub_0803E2A8
.4byte sub_0803E2D0
.4byte sub_0803E314
.4byte sub_0803E340
.4byte sub_0803E370
.4byte sub_0803E398
.4byte sub_0803E3D4
.4byte sub_0803E3FC
-49
View File
@@ -1,49 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gUnk_080D0470:: @ 080D0470
.4byte sub_0803D134
.4byte sub_0803D264
.4byte sub_0803D408
.4byte sub_0803D560
.4byte sub_0803D658
.4byte sub_0803D700
.4byte sub_0803D830
.4byte sub_0803D8FC
gUnk_080D0490:: @ 080D0490
.4byte sub_0803D974
.4byte sub_0803D9BC
gUnk_080D0498:: @ 080D0498
.4byte sub_0803DAA8
.4byte sub_0803DAE4
gUnk_080D04A0:: @ 080D04A0
.4byte sub_0803DB88
.4byte sub_0803DBB8
gUnk_080D04A8:: @ 080D04A8
.incbin "baserom.gba", 0x0D04A8, 0x0000004
gUnk_080D04AC:: @ 080D04AC
.incbin "baserom.gba", 0x0D04AC, 0x0000014
gUnk_080D04C0:: @ 080D04C0
.incbin "baserom.gba", 0x0D04C0, 0x0000008
gUnk_080D04C8:: @ 080D04C8
.incbin "baserom.gba", 0x0D04C8, 0x0000008
gUnk_080D04D0:: @ 080D04D0
.ifdef EU
.incbin "baserom_eu.gba", 0x0CFBFC, 0x0000003
.else
.incbin "baserom.gba", 0x0D04D0, 0x0000003
.endif
gUnk_080D04D3:: @ 080D04D3
.incbin "baserom.gba", 0x0D04D3, 0x0000004
-69
View File
@@ -1,69 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gUnk_080D0ABC:: @ 080D0ABC
.ifdef EU
.incbin "baserom_eu.gba", 0x0D01E8, 0x0000003
.else
.incbin "baserom.gba", 0x0D0ABC, 0x0000003
.endif
gUnk_080D0ABF:: @ 080D0ABF
.incbin "baserom.gba", 0x0D0ABF, 0x0000009
gUnk_080D0AC8:: @ 080D0AC8
.4byte sub_0803F818
.4byte sub_0803F914
.4byte sub_0803FAC8
.4byte sub_0803FAD0
.4byte sub_0803FD50
.4byte sub_0803FE90
.4byte sub_0803FF7C
.4byte sub_0804006C
gUnk_080D0AE8:: @ 080D0AE8
.4byte sub_08040130
.4byte sub_0804015C
gUnk_080D0AF0:: @ 080D0AF0
.4byte sub_080401E0
.4byte sub_08040268
.4byte sub_0804038C
gUnk_080D0AFC:: @ 080D0AFC
.4byte sub_080403CC
gUnk_080D0B00:: @ 080D0B00
.4byte sub_080403EC
gUnk_080D0B04:: @ 080D0B04
.4byte sub_0804041C
.4byte sub_0804044C
gUnk_080D0B0C:: @ 080D0B0C
.4byte sub_080404D0
gUnk_080D0B10:: @ 080D0B10
.4byte sub_0804051C
.4byte sub_080405D8
gUnk_080D0B18:: @ 080D0B18
.incbin "baserom.gba", 0x0D0B18, 0x0000011
gUnk_080D0B29:: @ 080D0B29
.incbin "baserom.gba", 0x0D0B29, 0x000002F
gUnk_080D0B58:: @ 080D0B58
.incbin "baserom.gba", 0x0D0B58, 0x000000C
gUnk_080D0B64:: @ 080D0B64
.incbin "baserom.gba", 0x0D0B64, 0x0000010
gUnk_080D0B74:: @ 080D0B74
.incbin "baserom.gba", 0x0D0B74, 0x0000010
gUnk_080D0B84:: @ 080D0B84
.incbin "baserom.gba", 0x0D0B84, 0x0000020
-56
View File
@@ -1,56 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gUnk_080D0E1C:: @ 080D0E1C
.4byte sub_080413A0
.4byte sub_08042428
.4byte sub_080424A0
.4byte sub_0804250C
gUnk_080D0E2C:: @ 080D0E2C
.4byte sub_080413C0
.4byte sub_08041490
.4byte sub_080415E8
.4byte sub_08041618
.4byte sub_080416A4
.4byte sub_080416DC
.4byte sub_080417AC
.4byte sub_08041828
.4byte sub_08041880
.4byte sub_08041904
.4byte sub_0804197C
.4byte sub_08041A00
.4byte sub_08041AF4
.4byte sub_08041BD0
gUnk_080D0E64:: @ 080D0E64
.incbin "baserom.gba", 0x0D0E64, 0x0000004
gUnk_080D0E68:: @ 080D0E68
.4byte sub_08041BE8
.4byte sub_08041CD0
.4byte sub_08041D14
.4byte sub_08041D84
.4byte sub_08041E20
.4byte sub_08041E50
gUnk_080D0E80:: @ 080D0E80
.incbin "baserom.gba", 0x0D0E80, 0x0000010
gUnk_080D0E90:: @ 080D0E90
.incbin "baserom.gba", 0x0D0E90, 0x0000010
gUnk_080D0EA0:: @ 080D0EA0
.incbin "baserom.gba", 0x0D0EA0, 0x0000008
gUnk_080D0EA8:: @ 080D0EA8
.incbin "baserom.gba", 0x0D0EA8, 0x0000004
gUnk_080D0EAC:: @ 080D0EAC
.incbin "baserom.gba", 0x0D0EAC, 0x0000004
gUnk_080D0EB0:: @ 080D0EB0
.incbin "baserom.gba", 0x0D0EB0, 0x0000020
-9
View File
@@ -1,9 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gUnk_08110734:: @ 08110734
.4byte sub_08066A94
.4byte sub_08066ACC
-12
View File
@@ -1,12 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gUnk_08112F78:: @ 08112F78
.4byte sub_0806B67C
.4byte sub_0806B7BC
gUnk_08112F80:: @ 08112F80
.incbin "baserom.gba", 0x112F80, 0x0000008
+4 -4
View File
@@ -95,12 +95,12 @@ typedef enum {
/*0x57*/ MINI_SLIME,
/*0x58*/ FIREBALL_GUY,
/*0x59*/ MINI_FIREBALL_GUY,
/*0x5a*/ ENEMY_5A,
/*0x5a*/ VAATI_TRANSFIGURED_EYE,
/*0x5b*/ BUSINESS_SCRUB_PROLOGUE,
/*0x5c*/ GYORG_FEMALE,
/*0x5d*/ GYORG_MALE,
/*0x5e*/ CURTAIN,
/*0x5f*/ ENEMY_5F,
/*0x5f*/ VAATI_WRATH_EYE,
/*0x60*/ GYORG_CHILD,
/*0x61*/ GYORG_FEMALE_EYE,
/*0x62*/ ENEMY_62,
@@ -199,12 +199,12 @@ extern void Slime(Entity*);
extern void MiniSlime(Entity*);
extern void FireballGuy(Entity*);
extern void MiniFireballGuy(Entity*);
extern void Enemy5A(Entity*);
extern void VaatiTransfiguredEye(Entity*);
extern void BusinessScrubPrologue(Entity*);
extern void GyorgFemale(Entity*);
extern void GyorgMale(Entity*);
extern void Curtain(Entity*);
extern void Enemy5F(Entity*);
extern void VaatiWrathEye(Entity*);
extern void GyorgChild(Entity*);
extern void GyorgFemaleEye(Entity*);
extern void Enemy62(Entity*);
+131
View File
@@ -5,6 +5,137 @@
#ifndef NPC_H
#define NPC_H
enum NPC {
/*0x00*/ NPC_NONE_0,
/*0x01*/ GENTARI,
/*0x02*/ FESTARI,
/*0x03*/ FOREST_MINISH,
/*0x04*/ POSTMAN,
/*0x05*/ NPC_UNK_5,
/*0x06*/ TPWNSPERSON,
/*0x07*/ KID,
/*0x08*/ GUARD,
/*0x09*/ NPC_UNK_9,
/*0x0a*/ STAMP,
/*0x0b*/ MAID,
/*0x0c*/ MARCY,
/*0x0d*/ WHEATON,
/*0x0e*/ PITA,
/*0x0f*/ MINISH_EZLO,
/*0x10*/ MAILBOX,
/*0x11*/ BEEDLE,
/*0x12*/ BROCCO,
/*0x13*/ SITTING_PERSON,
/*0x14*/ PINA,
/*0x15*/ GUARD_1,
/*0x16*/ MAID_1,
/*0x17*/ DIN,
/*0x18*/ NAYRU,
/*0x19*/ FARORE,
/*0x1a*/ STURGEON,
/*0x1b*/ TINGLE_SIBLINGS,
/*0x1c*/ STOCKWELL,
/*0x1d*/ TALON,
/*0x1e*/ MALON,
/*0x1f*/ EPONA,
/*0x20*/ MILK_CART,
/*0x21*/ GHOST_BROTHERS,
/*0x22*/ SMITH,
/*0x23*/ NPC_UNK_23,
/*0x24*/ KING_DALTUS,
/*0x25*/ MINISTER_POTHO,
/*0x26*/ NPC_UNK_26,
/*0x27*/ VAATI,
/*0x28*/ ZELDA,
/*0x29*/ MUTOH,
/*0x2a*/ CARPENTER,
/*0x2b*/ CASTOR_WILDS_STATUE,
/*0x2c*/ CAT,
/*0x2d*/ MOUNTAIN_MINISH,
/*0x2e*/ ZELDA_FOLLOWER,
/*0x2f*/ MELARI,
/*0x30*/ BLADE_BROTHERS,
/*0x31*/ COW,
/*0x32*/ GORON,
/*0x33*/ GORON_MERCHANT,
/*0x34*/ GORMAN,
/*0x35*/ DOG,
/*0x36*/ SYRUP,
/*0x37*/ REM,
/*0x38*/ TOWN_MINISH,
/*0x39*/ LIBRARI,
/*0x3a*/ PERCY,
/*0x3b*/ VAATI_REBORN,
/*0x3c*/ MOBLIN_LADY,
/*0x3d*/ LIBRARIANS,
/*0x3e*/ FARMERS,
/*0x3f*/ CARLOV,
/*0x40*/ DAMPE,
/*0x41*/ DR_LEFT,
/*0x42*/ KING_GUSTAF,
/*0x43*/ GINA,
/*0x44*/ SIMON,
/*0x45*/ ANJU,
/*0x46*/ MAMA,
/*0x47*/ EMMA,
/*0x48*/ TEACHERS,
/*0x49*/ WIND_TRIBESPEOPLE,
/*0x4a*/ GREGAL,
/*0x4b*/ MAYOR_HAGEN,
/*0x4c*/ BIG_GORON,
/*0x4d*/ EZLO_CAP,
/*0x4e*/ NPC_UNK_4E,
/*0x4f*/ NPC_UNK_4F,
/*0x50*/ CLOTHES_RACK,
/*0x51*/ PICOLYTE_BOTTLE,
/*0x52*/ SMALL_TOWN_MINISH,
/*0x53*/ HURDY_GURDY_MAN,
/*0x54*/ CUCCO,
/*0x55*/ CUCCO_CHICK,
/*0x56*/ FUSION_MENU_NPC,
/*0x57*/ PHONOGRAPH,
/*0x58*/ NPC_UNK_58,
/*0x59*/ NPC_NONE_1,
/*0x5a*/ NPC_NONE_2,
/*0x5b*/ NPC_NONE_3,
/*0x5c*/ NPC_NONE_4,
/*0x5d*/ NPC_NONE_5,
/*0x5e*/ NPC_NONE_6,
/*0x5f*/ NPC_NONE_7,
/*0x60*/ NPC_NONE_8,
/*0x61*/ NPC_NONE_9,
/*0x62*/ NPC_NONE_10,
/*0x63*/ NPC_NONE_11,
/*0x64*/ NPC_NONE_12,
/*0x65*/ NPC_NONE_13,
/*0x66*/ NPC_NONE_14,
/*0x67*/ NPC_NONE_15,
/*0x68*/ NPC_NONE_16,
/*0x69*/ NPC_NONE_17,
/*0x6a*/ NPC_NONE_18,
/*0x6b*/ NPC_NONE_19,
/*0x6c*/ NPC_NONE_20,
/*0x6d*/ NPC_NONE_21,
/*0x6e*/ NPC_NONE_22,
/*0x6f*/ NPC_NONE_23,
/*0x70*/ NPC_NONE_24,
/*0x71*/ NPC_NONE_25,
/*0x72*/ NPC_NONE_26,
/*0x73*/ NPC_NONE_27,
/*0x74*/ NPC_NONE_28,
/*0x75*/ NPC_NONE_29,
/*0x76*/ NPC_NONE_30,
/*0x77*/ NPC_NONE_31,
/*0x78*/ NPC_NONE_32,
/*0x79*/ NPC_NONE_33,
/*0x7a*/ NPC_NONE_34,
/*0x7b*/ NPC_NONE_35,
/*0x7c*/ NPC_NONE_36,
/*0x7d*/ NPC_NONE_37,
/*0x7e*/ NPC_NONE_38,
/*0x7f*/ NPC_NONE_39,
};
extern void Gentari(Entity*);
extern void Gentari_Fusion(Entity*);
extern void Festari(Entity*);
+1
View File
@@ -36,6 +36,7 @@ void sub_0807DEDC(Entity*, ScriptExecutionContext*, u32, u32);
ScriptExecutionContext* StartCutscene(Entity* entity, u16* script);
void ExecuteScriptForEntity(Entity* entity, void (*postScriptCallback)(Entity*, ScriptExecutionContext*));
void HandlePostScriptActions(Entity* entity, ScriptExecutionContext* context);
void HandleEntity0x82Actions(Entity* entity);
void sub_0807DD94(Entity*, void (*function)(Entity*, ScriptExecutionContext*));
#endif
+6 -2
View File
@@ -56,9 +56,13 @@ typedef struct {
u8 field_0x24[0x14];
u8 field_0x38;
u8 field_0x39;
u16 field_0x3a;
u8 field_0x3a;
u8 field_0x3b;
u8 field_0x3c;
u8 filler[6];
u8 field_0x3d;
u16 field_0x3e;
u16 field_0x40;
u16 field_0x42;
u16 field_0x44;
u16 field_0x46;
u16 field_0x48;
+24 -24
View File
@@ -162,7 +162,7 @@ SECTIONS {
#else
. = 0x00036A50; gEEPROMConfig = .;
. = 0x00036A58; gUnk_02036A58 = .;
. = 0x00036AD8; gUnk_02036AD8 = .;
. = 0x00036AD8; gUnk_02036AD8 = .;
. = 0x00036BB8; gUnk_02036BB8 = .;
. = 0x00036BC0; gMPlayTracks = .;
. = 0x00038560; gUnk_02038560 = .;
@@ -398,7 +398,7 @@ SECTIONS {
src/enemy/bobomb.o(.text);
src/enemy/wallMaster2.o(.text);
asm/gleerok.o(.text);
asm/vaatiEyesMacro.o(.text);
src/enemy/vaatiEyesMacro.o(.text);
src/enemy/tektite.o(.text);
asm/wizzrobeWind.o(.text);
asm/wizzrobeFire.o(.text);
@@ -438,16 +438,16 @@ SECTIONS {
src/enemy/lakitu.o(.text);
src/enemy/lakituCloud.o(.text);
asm/enemy49.o(.text);
asm/vaatiRebornEnemy.o(.text);
asm/vaatiProjectile.o(.text);
src/enemy/vaatiRebornEnemy.o(.text);
src/enemy/vaatiProjectile.o(.text);
asm/ballChainSoldier.o(.text);
src/enemy/enemy4D.o(.text);
asm/enemy4D.o(.text);
asm/ghini.o(.text);
asm/vaatiTransfigured.o(.text);
src/enemy/vaatiTransfigured.o(.text);
asm/enemy50.o(.text);
asm/vaatiWrath.o(.text);
asm/vaatiArm.o(.text);
src/enemy/vaatiWrath.o(.text);
src/enemy/vaatiArm.o(.text);
asm/dust.o(.text);
src/enemy/vaatiBall.o(.text);
src/enemy/slime.o(.text);
@@ -455,12 +455,12 @@ SECTIONS {
src/enemy/miniSlime.o(.text);
src/enemy/fireballGuy.o(.text);
src/enemy/miniFireballGuy.o(.text);
asm/enemy5A.o(.text);
src/enemy/vaatiTransfiguredEye.o(.text);
asm/businessScrubPrologue.o(.text);
asm/gyorgFemale.o(.text);
src/enemy/gyorgMale.o(.text);
asm/curtain.o(.text);
asm/enemy5F.o(.text);
src/enemy/vaatiWrathEye.o(.text);
asm/gyorgChild.o(.text);
asm/gyorgFemaleEye.o(.text);
asm/enemy62.o(.text);
@@ -605,7 +605,7 @@ SECTIONS {
src/npc/kingDaltus.o(.text);
src/npc/ministerPotho.o(.text);
src/npc/npc26.o(.text);
asm/vaati.o(.text);
src/npc/vaati.o(.text);
src/npc/zelda.o(.text);
src/npc/mutoh.o(.text);
src/npc/carpenter.o(.text);
@@ -625,7 +625,7 @@ SECTIONS {
src/npc/townMinish.o(.text);
src/npc/librari.o(.text);
src/npc/percy.o(.text);
asm/vaatiReborn.o(.text);
src/npc/vaatiReborn.o(.text);
src/npc/moblinLady.o(.text);
src/npc/librarians.o(.text);
src/npc/farmers.o(.text);
@@ -892,7 +892,7 @@ SECTIONS {
src/object/objectB2.o(.text);
asm/objectB3.o(.text);
asm/objectB4.o(.text);
asm/objectB5.o(.text);
src/object/objectB5.o(.text);
asm/objectB6.o(.text);
src/object/well.o(.text);
asm/windTribeTeleporter.o(.text);
@@ -1067,7 +1067,7 @@ SECTIONS {
src/enemy/wallMaster2.o(.rodata);
data/const/enemy/gleerok.o(.rodata);
data/animations/enemy/gleerok.o(.rodata);
data/const/enemy/vaatiEyesMacro.o(.rodata);
src/enemy/vaatiEyesMacro.o(.rodata);
data/animations/enemy/vaatiEyesMacro.o(.rodata);
data/const/enemy/tektite.o(.rodata);
data/animations/enemy/tektite.o(.rodata);
@@ -1131,21 +1131,21 @@ SECTIONS {
data/animations/enemy/lakitu.o(.rodata);
src/enemy/lakituCloud.o(.rodata);
data/const/enemy/enemy49.o(.rodata);
data/const/enemy/vaatiRebornEnemy.o(.rodata);
src/enemy/vaatiRebornEnemy.o(.rodata);
data/animations/enemy/vaatiRebornEnemy.o(.rodata);
data/const/enemy/vaatiProjectile.o(.rodata);
src/enemy/vaatiProjectile.o(.rodata);
data/animations/enemy/vaatiProjectile.o(.rodata);
data/const/enemy/ballChainSoldier.o(.rodata);
data/animations/enemy/ballChainSoldier.o(.rodata);
data/const/enemy/enemy4D.o(.rodata);
data/const/enemy/ghini.o(.rodata);
data/animations/enemy/ghini.o(.rodata);
data/const/enemy/vaatiTransfigured.o(.rodata);
src/enemy/vaatiTransfigured.o(.rodata);
data/animations/enemy/vaatiTransfigured.o(.rodata);
data/const/enemy/enemy50.o(.rodata);
data/const/enemy/vaatiWrath.o(.rodata);
src/enemy/vaatiWrath.o(.rodata);
data/animations/enemy/vaatiWrath.o(.rodata);
data/const/enemy/vaatiArm.o(.rodata);
src/enemy/vaatiArm.o(.rodata);
data/animations/enemy/vaatiArm.o(.rodata);
data/const/enemy/dust.o(.rodata);
data/const/enemy/vaatiBall.o(.rodata);
@@ -1156,16 +1156,16 @@ SECTIONS {
data/const/enemy/fireballGuy.o(.rodata);
data/animations/enemy/fireballGuy.o(.rodata);
data/const/enemy/miniFireballGuy.o(.rodata);
data/const/enemy/enemy5A.o(.rodata);
data/animations/enemy/enemy5A.o(.rodata);
src/enemy/vaatiTransfiguredEye.o(.rodata);
data/animations/enemy/vaatiTransfiguredEye.o(.rodata);
data/const/enemy/businessScrubPrologue.o(.rodata);
data/const/enemy/gyorgFemale.o(.rodata);
src/enemy/gyorgMale.o(.rodata);
data/animations/enemy/gyorgMale.o(.rodata);
data/const/enemy/curtain.o(.rodata);
data/animations/enemy/curtain.o(.rodata);
data/const/enemy/enemy5F.o(.rodata);
data/animations/enemy/enemy5F.o(.rodata);
src/enemy/vaatiWrathEye.o(.rodata);
data/animations/enemy/vaatiWrathEye.o(.rodata);
data/const/enemy/gyorgChild.o(.rodata);
data/animations/enemy/gyorgChild.o(.rodata);
data/const/enemy/gyorgFemaleEye.o(.rodata);
@@ -1304,7 +1304,7 @@ SECTIONS {
data/animations/npc/ministerPotho.o(.rodata);
src/npc/npc26.o(.rodata);
data/animations/npc/npc26.o(.rodata);
data/const/npc/vaati.o(.rodata);
src/npc/vaati.o(.rodata);
data/animations/npc/vaati.o(.rodata);
data/const/npc/zelda.o(.rodata);
data/const/npc/mutoh.o(.rodata);
@@ -1341,7 +1341,7 @@ SECTIONS {
data/animations/npc/librari.o(.rodata);
data/const/npc/percy.o(.rodata);
data/animations/npc/percy.o(.rodata);
data/const/npc/vaatiReborn.o(.rodata);
src/npc/vaatiReborn.o(.rodata);
data/animations/npc/vaatiReborn.o(.rodata);
data/const/npc/moblinLady.o(.rodata);
data/animations/npc/moblinLady.o(.rodata);
+2 -2
View File
@@ -94,12 +94,12 @@ void (*const gEnemyFunctions[])(Entity* ent) = {
[MINI_SLIME] = MiniSlime,
[FIREBALL_GUY] = FireballGuy,
[MINI_FIREBALL_GUY] = MiniFireballGuy,
[ENEMY_5A] = Enemy5A,
[VAATI_TRANSFIGURED_EYE] = VaatiTransfiguredEye,
[BUSINESS_SCRUB_PROLOGUE] = BusinessScrubPrologue,
[GYORG_FEMALE] = GyorgFemale,
[GYORG_MALE] = GyorgMale,
[CURTAIN] = Curtain,
[ENEMY_5F] = Enemy5F,
[VAATI_WRATH_EYE] = VaatiWrathEye,
[GYORG_CHILD] = GyorgChild,
[GYORG_FEMALE_EYE] = GyorgFemaleEye,
[ENEMY_62] = Enemy62,
+1474
View File
File diff suppressed because it is too large Load Diff
+302
View File
@@ -0,0 +1,302 @@
#include "global.h"
#include "enemy.h"
#include "audio.h"
#include "random.h"
#include "functions.h"
extern u32 sub_080002E0(u32, u32);
extern s16 gUnk_080B4488[];
void VaatiEyesMacroFunction0(Entity*);
void VaatiEyesMacroFunction1(Entity*);
void VaatiEyesMacroFunction0Type0(Entity*);
void VaatiEyesMacroFunction0Type1(Entity*);
void VaatiEyesMacroFunction0Type2(Entity*);
void VaatiEyesMacroFunction0Type3(Entity*);
void VaatiEyesMacroFunction0Type0Action0(Entity*);
void VaatiEyesMacroFunction0Type0Action1(Entity*);
void VaatiEyesMacroFunction0Type1Action0(Entity*);
void VaatiEyesMacroFunction0Type1Action1(Entity*);
void sub_0802EF90(Entity*);
void sub_0802EFB8(Entity*);
void sub_0802EF58(Entity*);
void sub_0802F04C(Entity*);
void (*const vaatiEyesMacroFunctions[])(Entity*) = {
VaatiEyesMacroFunction0, VaatiEyesMacroFunction1, sub_08001324, sub_0804A7D4, sub_08001242, VaatiEyesMacroFunction0,
};
void (*const vaatiEyesMacroFunction0Types[])(Entity*) = {
VaatiEyesMacroFunction0Type0,
VaatiEyesMacroFunction0Type1,
VaatiEyesMacroFunction0Type2,
VaatiEyesMacroFunction0Type3,
};
void (*const vaatiEyesMacroFunction0Type0Actions[])(Entity*) = {
VaatiEyesMacroFunction0Type0Action0,
VaatiEyesMacroFunction0Type0Action1,
};
void (*const vaatiEyesMacroFunction0Type1Actions[])(Entity*) = {
VaatiEyesMacroFunction0Type1Action0,
VaatiEyesMacroFunction0Type1Action1,
};
const u8 gUnk_080CDE6C[] = { 0, 8, 0x18, 0 };
const u8 gUnk_080CDE70[] = {
9, 9, 8, 9, 8, 8, 8, 7, 7, 7, 6, 7, 6, 6, 6, 5, 5, 5, 12, 5, 12, 12, 12, 11, 11, 11, 10, 11, 10, 10, 10, 9,
};
const s8 gUnk_080CDE90[] = { -2, -3, -4, -5, -6, -5, -4, -3 };
const u16 gUnk_080CDE98[] = { 0xc0, 0x100, 0x140, 0x180 };
extern u8 gEntCount;
void VaatiEyesMacro(Entity* this) {
vaatiEyesMacroFunctions[GetNextFunction(this)](this);
SetChildOffset(this, 0, 1, -0x10);
}
void VaatiEyesMacroFunction0(Entity* this) {
vaatiEyesMacroFunction0Types[this->type](this);
if (this->type < 2) {
sub_0802EF90(this);
}
}
void VaatiEyesMacroFunction1(Entity* this) {
if (this->type == 0) {
if (this->currentHealth == 0) {
gScreenTransition.field_0x39 &= ~(1 << (gScreenTransition.field_0x3c + 2));
}
if (gRoomControls.roomID == 0) {
gScreenTransition.field_0x3a = this->currentHealth;
} else {
gScreenTransition.field_0x3b = this->currentHealth;
}
if (this->field_0x78.HALF.HI != this->currentHealth) {
EnqueueSFX(SFX_17A);
}
this->field_0x78.HALF.HI = this->currentHealth;
} else {
if (this->type == 1) {
if (0 < this->iframes) {
this->iframes *= -1;
}
if (this->currentHealth != 0xff) {
EnqueueSFX(SFX_BUTTON_DEPRESS);
}
this->currentHealth = 0xff;
}
}
if (this->field_0x43 != 0) {
sub_0804A9FC(this, 0x1c);
}
sub_0804AA30(this, vaatiEyesMacroFunctions);
}
void VaatiEyesMacroFunction0Type0(Entity* this) {
vaatiEyesMacroFunction0Type0Actions[this->action](this);
}
void VaatiEyesMacroFunction0Type0Action0(Entity* this) {
Manager* manager;
Entity* enemy;
if ((gEntCount < 0x47) && (manager = GetEmptyManager(), manager != NULL)) {
manager->type = 9;
manager->subtype = 0x34;
manager->parent = (Manager*)this;
AppendEntityToList((Entity*)manager, 8);
enemy = CreateEnemy(VAATI_EYES_MACRO, 2);
enemy->parent = this;
this->action = 1;
if (gRoomControls.roomID == 0) {
this->field_0x78.HALF.HI = this->currentHealth = gScreenTransition.field_0x3a;
} else {
this->field_0x78.HALF.HI = this->currentHealth = gScreenTransition.field_0x3b;
}
this->field_0x78.HALF.LO = Random();
sub_0802EFB8(this);
InitializeAnimation(this, 0);
sub_0802EF58(this);
}
}
void VaatiEyesMacroFunction0Type0Action1(Entity* this) {
sub_0802F04C(this);
GetNextFrame(this);
}
void VaatiEyesMacroFunction0Type1(Entity* this) {
vaatiEyesMacroFunction0Type1Actions[this->action](this);
}
void VaatiEyesMacroFunction0Type1Action0(Entity* this) {
Entity* entity;
u32 rand;
if (gEntCount < 0x47) {
entity = CreateEnemy(VAATI_EYES_MACRO, 3);
entity->parent = this;
this->action = 1;
rand = Random();
this->actionDelay = (rand & 3) + 1;
this->field_0x78.HALF.LO = Random() >> 8;
this->direction = gUnk_080CDE6C[rand >> 0x10 & 3];
InitializeAnimation(this, 1);
}
}
void VaatiEyesMacroFunction0Type1Action1(Entity* this) {
if (this->parent->next == NULL) {
this->flags &= 0x7f;
this->currentHealth = 0;
} else {
sub_0802F04C(this);
GetNextFrame(this);
}
}
typedef struct xy {
u8 x;
u8 y;
} xy;
void VaatiEyesMacroFunction0Type2(Entity* this) {
u32 uVar2;
xy* temp;
if (this->parent->next == NULL) {
DeleteThisEntity();
}
if (this->action == 0) {
this->action = 1;
this->animationState = 0xff;
}
CopyPositionAndSpriteOffset(this->parent, this);
uVar2 = (GetFacingDirection(this, &gPlayerEntity) + 1) & 0x1e;
temp = (xy*)&gUnk_080CDE70[uVar2];
if (temp->x != this->frameIndex) {
if (temp->y != this->frameIndex) {
this->frameIndex = temp->x;
}
}
this->y.HALF.HI++;
this->spriteOffsetY -= 1;
}
void VaatiEyesMacroFunction0Type3(Entity* this) {
if (this->parent->next == NULL) {
DeleteThisEntity();
}
if (this->action == 0) {
this->action = 1;
this->frameIndex = 0x11;
this->spritePriority.b0 = 6;
}
CopyPositionAndSpriteOffset(this->parent, this);
this->height.HALF.HI = 0;
}
void sub_0802EF58(Entity* this) {
Entity* entity;
u32 i;
for (i = 0; i < 7; i++) {
entity = CreateEnemy(VAATI_EYES_MACRO, 1);
if (entity != NULL) {
entity->type2 = i;
entity->collisionLayer = 1;
entity->parent = this;
UpdateSpriteForCollisionLayer(entity);
CopyPosition(this, entity);
}
}
}
void sub_0802EF90(Entity* this) {
this->height.HALF.HI = gUnk_080CDE90[this->field_0x78.HALF.LO++ >> 3 & 7];
}
void sub_0802EFB8(Entity* this) {
u32 uVar1;
u32 rand;
u32 uVar3;
int iVar4;
rand = Random();
if ((rand >> 0x10 & 3) != 0) {
uVar1 = rand & 0x18;
} else {
uVar3 = GetFacingDirection(&gPlayerEntity, this);
uVar1 = (uVar3 + 4) & 0x18;
}
iVar4 = sub_080002E0(TILE(this->x.HALF.HI, this->y.HALF.HI) + gUnk_080B4488[((uVar1) >> 3)], 1);
if (iVar4 != 0) {
this->direction = 0xff;
} else {
this->actionDelay = (rand & 3) + 1;
this->direction = (uVar1 & 0x18);
this->speed = gUnk_080CDE98[rand >> 0x18 & 3];
}
}
void sub_0802F04C(Entity* this) {
s32 oldX;
s32 oldY;
oldX = this->x.HALF.HI;
oldY = this->y.HALF.HI;
if (ProcessMovement(this) == 0) {
sub_0802EFB8(this);
return;
}
switch (this->direction >> 3) {
case 0:
if (((oldY & 0xf) > 8) && ((this->y.HALF.HI & 0xf) < 9)) {
this->actionDelay--;
oldY = (this->y.HALF.HI & 0xfff0) + 8;
}
if (this->actionDelay == 0) {
this->x.HALF.HI = oldX;
this->y.HALF.HI = oldY;
} else {
return;
}
break;
case 1:
if (((oldX & 0xf) < 8) && ((this->x.HALF.HI & 0xf) >= 8)) {
this->actionDelay--;
oldX = (this->x.HALF.HI & 0xfff0) + 8;
}
if (this->actionDelay == 0) {
this->x.HALF.HI = oldX;
this->y.HALF.HI = oldY;
} else {
return;
}
break;
case 2:
if (((oldY & 0xf) < 8) && ((this->y.HALF.HI & 0xf) >= 8)) {
this->actionDelay--;
oldY = (this->y.HALF.HI & 0xfff0) + 8;
}
if (this->actionDelay == 0) {
this->x.HALF.HI = oldX;
this->y.HALF.HI = oldY;
} else {
return;
}
break;
default:
if (((oldX & 0xf) >= 9) && ((this->x.HALF.HI & 0xf) < 9)) {
this->actionDelay--;
oldX = (this->x.HALF.HI & 0xfff0) + 8;
}
if (this->actionDelay == 0) {
this->x.HALF.HI = oldX;
this->y.HALF.HI = oldY;
} else {
return;
}
break;
}
sub_0802EFB8(this);
}
+279
View File
@@ -0,0 +1,279 @@
#include "global.h"
#include "enemy.h"
#include "random.h"
#include "functions.h"
extern bool32 PlayerInRange(Entity*, u32, u32);
extern void DoExitTransition(ScreenTransitionData*);
extern u32 sub_080002E0(u32, u32);
extern Entity* gUnk_020000B0;
extern const ScreenTransitionData gUnk_0813AB94;
bool32 sub_0803E4A0(Entity*);
void VaatiProjectileFunction0(Entity*);
void VaatiProjectileFunction1(Entity*);
void sub_08001328(Entity*);
void VaatiProjectileFunction3(Entity*);
void VaatiProjectileNoop(Entity*);
void VaatiProjectileFunction0Action0(Entity*);
void VaatiProjectileFunction0Action1(Entity*);
void VaatiProjectileFunction0Action2(Entity*);
void VaatiProjectileFunction0Action3(Entity*);
void VaatiProjectileFunction0Action4(Entity*);
void VaatiProjectileFunction0Action5(Entity*);
void VaatiProjectileFunction0Action6(Entity*);
void VaatiProjectileFunction0Action7(Entity*);
void VaatiProjectileFunction0Action8(Entity*);
void VaatiProjectileFunction0Action9(Entity*);
void sub_0803E444(Entity*);
void sub_0803E480(Entity*);
void sub_0803E4D8(Entity*);
void (*const vaatiProjectileFunctions[])(Entity*) = {
VaatiProjectileFunction0, VaatiProjectileFunction1, sub_08001328, VaatiProjectileFunction3, sub_08001242,
VaatiProjectileNoop,
};
void (*const vaatiProjectileFunction0Actions[])(Entity*) = {
VaatiProjectileFunction0Action0, VaatiProjectileFunction0Action1, VaatiProjectileFunction0Action2,
VaatiProjectileFunction0Action3, VaatiProjectileFunction0Action4, VaatiProjectileFunction0Action5,
VaatiProjectileFunction0Action6, VaatiProjectileFunction0Action7, VaatiProjectileFunction0Action8,
VaatiProjectileFunction0Action9,
};
void VaatiProjectile(Entity* this) {
if (sub_0803E4A0(this)) {
this->flags &= 0x7f;
this->currentHealth = 0;
this->parent = NULL;
}
vaatiProjectileFunctions[GetNextFunction(this)](this);
}
void VaatiProjectileFunction0(Entity* this) {
vaatiProjectileFunction0Actions[this->action](this);
}
void VaatiProjectileFunction1(Entity* this) {
Entity* entity;
if (this->bitfield == 0x80) {
#ifndef EU
if (this->currentHealth != 0) {
#endif
this->action = 5;
this->flags = this->flags & 0x7f;
this->spritePriority.b1 = 0;
gPlayerEntity.flags &= 0x7f;
gPlayerEntity.spriteOrientation.flipY = this->spriteOrientation.flipY;
gPlayerEntity.spriteRendering.b3 = this->spriteRendering.b3;
sub_0803E444(this);
#ifndef EU
sub_08078A90(2);
entity = this->parent;
if (entity != NULL) {
entity->flags = entity->flags & 0x7f;
}
} else {
gPlayerState.flags.all &= 0xfffffeff; // using b.unk8 does not match
entity = &gPlayerEntity;
entity->flags = gPlayerEntity.flags | 0x80;
}
#endif
}
sub_0804AA30(this, vaatiProjectileFunctions);
}
void VaatiProjectileFunction3(Entity* this) {
if (this->parent != NULL) {
this->parent->field_0xf--;
this->parent = NULL;
}
sub_0804A7D4(this);
}
void VaatiProjectileNoop(Entity* this) {
}
void VaatiProjectileFunction0Action0(Entity* this) {
Entity* entity;
if (this->type == 0) {
entity = CreateEnemy(VAATI_PROJECTILE, 1);
if (entity != NULL) {
entity->parent = this;
this->attachedEntity = entity;
if (this->type2 == 0) {
this->action = 1;
this->height.HALF.HI = -0x18;
} else {
this->action = 9;
this->height.HALF.HI = -0x80;
this->flags2 = 1;
}
InitializeAnimation(this, 0);
}
} else {
this->action = 8;
this->flags = this->flags & 0x7f;
this->spriteOffsetY = 1;
this->spriteOrientation.flipY = this->parent->spriteOrientation.flipY;
this->spriteRendering.b3 = this->parent->spriteRendering.b3;
this->spritePriority.b1 = 0;
PositionRelative(this->parent, this, 0, -0x10000);
InitializeAnimation(this, 1);
}
}
void VaatiProjectileFunction0Action1(Entity* this) {
sub_0803E480(this);
if (PlayerInRange(this, 0, 8) != 0) {
this->action = 2;
this->actionDelay = 10;
InitializeAnimation(this->attachedEntity, 2);
} else {
if (gUnk_020000B0 != NULL) {
sub_08004596(this, GetFacingDirection(this, gUnk_020000B0));
sub_0806F69C(this);
}
}
GetNextFrame(this);
}
void VaatiProjectileFunction0Action2(Entity* this) {
if (this->actionDelay != 0) {
this->actionDelay--;
} else {
if (++this->height.HALF.HI == 0) {
this->action = 3;
}
}
GetNextFrame(this);
}
void VaatiProjectileFunction0Action3(Entity* this) {
if ((this->attachedEntity->frames.b.f3) != 0) {
if (--this->height.HALF.HI <= -0x18) {
this->action = 4;
this->actionDelay = (Random() & 0xf) + 0xf;
InitializeAnimation(this->attachedEntity, 1);
}
GetNextFrame(this);
}
}
void VaatiProjectileFunction0Action4(Entity* this) {
if (--this->actionDelay == 0) {
this->action = 1;
this->direction = GetFacingDirection(this, &gPlayerEntity);
}
GetNextFrame(this);
}
void VaatiProjectileFunction0Action5(Entity* this) {
sub_0803E444(this);
if (this->actionDelay != 0) {
this->actionDelay--;
} else {
if (-0x18 < --this->height.HALF.HI) {
return;
}
this->action = 6;
this->actionDelay = 0x14;
}
}
void VaatiProjectileFunction0Action6(Entity* this) {
if (--this->actionDelay == 0) {
this->action = 7;
this->direction = 0x10;
this->speed = 0x300;
}
sub_0803E444(this);
}
void VaatiProjectileFunction0Action7(Entity* this) {
sub_0803E444(this);
sub_0806F69C(this);
sub_0803E4D8(this);
if ((gRoomControls.roomOriginY + gRoomControls.height + -0x10) <= this->y.HALF.HI) {
sub_0805E5A8();
DoExitTransition((ScreenTransitionData*)&gUnk_0813AB94);
}
}
void VaatiProjectileFunction0Action8(Entity* this) {
if (this->parent->next == NULL) {
DeleteThisEntity();
}
PositionRelative(this->parent, this, 0, -0x10000);
GetNextFrame(this);
}
void VaatiProjectileFunction0Action9(Entity* this) {
this->x.HALF.HI = gPlayerEntity.x.HALF.HI;
this->y.HALF.HI = gPlayerEntity.y.HALF.HI;
if (this->height.HALF.HI < -8) {
if (this->animIndex != 2) {
this->actionDelay = 0;
InitializeAnimation(this->attachedEntity, 2);
}
VaatiProjectileFunction0Action2(this);
} else {
this->height.HALF.HI += 8;
}
}
void sub_0803E444(Entity* this) {
ResetPlayer();
gPlayerState.field_0x1a[0] = gPlayerState.field_0x1a[0] | 0x80;
gPlayerState.field_0xa = gPlayerState.field_0xa | 0x80;
sub_0806FA90(this, this->field_0x4c, 0, -2);
gPlayerEntity.spriteOffsetY += 0xe;
}
void sub_0803E480(Entity* this) {
if (this->field_0x78.HWORD >= 0x4b1) {
this->speed = 0x180;
} else {
this->field_0x78.HWORD++;
}
}
bool32 sub_0803E4A0(Entity* this) {
#ifdef EU
bool32 ret;
if (gScreenTransition.field_0x39 == 0) {
return TRUE;
} else {
if (this->parent == NULL) {
return FALSE;
}
ret = this->parent->next == NULL;
}
return ret;
#else
bool32 ret;
if (gScreenTransition.field_0x39 != 0) {
if (this->parent == NULL) {
return FALSE;
}
if (this->parent->currentHealth == 0) {
return TRUE;
} else {
ret = this->parent->next == NULL;
}
} else {
return TRUE;
}
return ret;
#endif
}
void sub_0803E4D8(Entity* this) {
u32 tile;
tile = TILE(this->x.HALF.HI, this->y.HALF.HI + 8);
if (sub_080002E0(tile, gPlayerEntity.collisionLayer) != 0xff) {
SetTile(0x4074, tile, gPlayerEntity.collisionLayer);
}
}
+902
View File
@@ -0,0 +1,902 @@
#include "global.h"
#include "enemy.h"
#include "coord.h"
#include "flags.h"
#include "random.h"
#include "audio.h"
#include "area.h"
#include "functions.h"
extern void sub_080AEFB4(Entity*);
extern u8 gEntCount;
void VaatiRebornEnemyType0PreAction(Entity*);
void VaatiRebornEnemyType1PreAction(Entity*);
void VaatiRebornEnemyType0Action0(Entity*);
void VaatiRebornEnemyType0Action1(Entity*);
void VaatiRebornEnemyType0Action2(Entity*);
void VaatiRebornEnemyType0Action3(Entity*);
void VaatiRebornEnemyType0Action4(Entity*);
void VaatiRebornEnemyType0Action5(Entity*);
void VaatiRebornEnemyType0Action6(Entity*);
void VaatiRebornEnemyType0Action7(Entity*);
void VaatiRebornEnemyType1Action0(Entity*);
void VaatiRebornEnemyType1Action1(Entity*);
void VaatiRebornEnemyType2Action0(Entity*);
void VaatiRebornEnemyType2Action1(Entity*);
void VaatiRebornEnemyType3Action0(Entity*);
void VaatiRebornEnemyType3Action1(Entity*);
void sub_0803DD78(Entity*);
u32 sub_0803DEE0(Entity*);
u32 sub_0803E028(Entity*);
void sub_0803DC0C(Entity*);
typedef struct xy {
s8 x;
s8 y;
} PACKED xy;
void (*const vaatiRebornEnemyType0Actions[])(Entity*) = {
VaatiRebornEnemyType0Action0, VaatiRebornEnemyType0Action1, VaatiRebornEnemyType0Action2,
VaatiRebornEnemyType0Action3, VaatiRebornEnemyType0Action4, VaatiRebornEnemyType0Action5,
VaatiRebornEnemyType0Action6, VaatiRebornEnemyType0Action7,
};
void (*const vaatiRebornEnemyType1Actions[])(Entity*) = {
VaatiRebornEnemyType1Action0,
VaatiRebornEnemyType1Action1,
};
void (*const vaatiRebornEnemyType2Actions[])(Entity*) = {
VaatiRebornEnemyType2Action0,
VaatiRebornEnemyType2Action1,
};
void (*const vaatiRebornEnemyType3Actions[])(Entity*) = {
VaatiRebornEnemyType3Action0,
VaatiRebornEnemyType3Action1,
};
const xy gUnk_080D04A8[] = { { 16, -43 }, { -16, -43 } };
const Coords gUnk_080D04AC[] = { { .HALF = { 0x58, 0x60 } },
{ .HALF = { 0x58, 0x90 } },
{ .HALF = { 0x98, 0x78 } },
{ .HALF = { 0xd8, 0x60 } },
{ .HALF = { 0xd8, 0x90 } } };
const u8 gUnk_080D04C0[] = { 2, 0, 0, 2, 2, 2, 4, 4 };
const xy gUnk_080D04C8[] = { { 10, -29 }, { -10, -29 }, { 15, -21 }, { -15, -21 } };
#ifdef EU
const u8 gUnk_080D04D0[] = { -12, -20, -32 };
#else
const u8 gUnk_080D04D0[] = { -24, -40, -48 };
#endif
const u8 gUnk_080D04D3[] = { 0, 1, 0, -1 };
void VaatiRebornEnemy(Entity* this) {
switch (this->type) {
case 0:
VaatiRebornEnemyType0PreAction(this);
vaatiRebornEnemyType0Actions[this->action](this);
break;
case 1:
VaatiRebornEnemyType1PreAction(this);
vaatiRebornEnemyType1Actions[this->action](this);
break;
case 2:
vaatiRebornEnemyType2Actions[this->action](this);
break;
case 3:
vaatiRebornEnemyType3Actions[this->action](this);
break;
}
}
void VaatiRebornEnemyType0Action0(Entity* this) {
s32 i;
Entity* entity;
const xy* ptr;
if (CheckLocalFlag(0x7b) != 0) {
DeleteThisEntity();
}
sub_0804A720(this);
if (CheckRoomFlag(0) && (gEntCount < 0x42)) {
ClearRoomFlag(0);
this->action = 3;
this->field_0x74.HALF.LO = -1;
this->actionDelay = 0;
this->field_0x76.HALF.LO = 0;
this->spriteSettings.b.draw = 1;
this->direction = 0xff;
this->spritePriority.b0 = 4;
this->height.WORD = 0;
this->field_0x80.HALF.LO = 2;
this->field_0x86.HALF.LO = 0;
this->cutsceneBeh.HALF.HI = 0x30;
this->cutsceneBeh.HALF.LO = -1;
this->field_0x86.HALF.HI = 0;
this->field_0x82.HALF.LO = 0;
this->field_0x82.HALF.HI = 0;
*(u32*)(&this->field_0x78) = this->x.WORD;
this->field_0x7c = this->y;
entity = CreateEnemy(VAATI_REBORN_ENEMY, 1);
entity->parent = this;
this->attachedEntity = entity;
for (i = 0; i < 6; i++) {
entity = CreateEnemy(VAATI_BALL, 0);
entity->parent = this;
entity->field_0x78.HALF.HI = i;
}
for (i = 0; i < 4; i++) {
entity = CreateEnemy(VAATI_REBORN_ENEMY, 3);
entity->parent = this;
entity->actionDelay = i;
}
for (i = 0; i < 2; i++) {
entity = CreateEnemy(VAATI_BALL, 1);
entity->parent = this;
entity->spriteSettings.b.flipX = i;
ptr = &gUnk_080D04A8[i];
PositionRelative(this, entity, ptr->x << 0x10, ptr->y << 0x10);
}
InitAnimationForceUpdate(this, 0);
}
}
void VaatiRebornEnemyType0Action1(Entity* this) {
if (this->actionDelay != 0) {
if (--this->actionDelay == 0) {
if ((this->field_0x74.HALF.LO & 0x70) == 0) {
if (this->attachedEntity->actionDelay == 0) {
sub_0803DD78(this);
if (this->field_0x74.HALF.HI != 0) {
this->action = 2;
this->field_0x74.HALF.LO = 0;
this->actionDelay = 0x10;
this->direction = 0xff;
} else {
if ((this->field_0x86.HALF.LO != 0) || (this->field_0x80.HALF.LO != 0)) {
this->direction = ((Random() & 0x80) >> 3) | 8;
} else {
this->direction = 0xff;
}
}
} else {
this->actionDelay = 2;
}
} else {
this->action = 3;
this->field_0x74.HALF.HI = this->field_0x74.HALF.LO & 0x80;
this->field_0x74.HALF.LO = 0;
this->actionDelay = 0xc0;
this->direction = 0xff;
this->spriteSettings.b.draw = 1;
InitAnimationForceUpdate(this, 0);
}
}
} else {
if (--this->field_0x76.HALF.HI == 0) {
switch (sub_0803DEE0(this)) {
case 0:
this->action = 4;
this->actionDelay = 0xa0;
this->direction = 0xff;
this->cutsceneBeh.HALF.LO = 0xff;
InitAnimationForceUpdate(this, 1);
break;
case 1:
this->action = 6;
this->field_0x74.HALF.LO = 0;
this->actionDelay = 0;
this->direction = 0xff;
break;
case 3:
this->action = 5;
this->field_0x74.HALF.LO = 0;
this->field_0xf = 0x20;
this->direction = 0xff;
break;
case 2:
this->field_0x74.HALF.LO = 0;
this->actionDelay = 0x20;
if ((this->field_0x86.HALF.LO != 0) || (this->field_0x80.HALF.LO != 0)) {
this->direction = ((Random() & 0x80) >> 3) | 8;
} else {
this->direction = 0xff;
}
break;
}
}
if (this->attachedEntity->actionDelay == 0) {
this->cutsceneBeh.HALF.HI++;
if ((this->cutsceneBeh.HALF.HI & 3) == 0) {
switch (this->cutsceneBeh.HALF.HI & 0x30) {
case 0:
case 0x30:
this->y.HALF.HI++;
break;
case 0x10:
case 0x20:
this->y.HALF.HI--;
}
}
sub_080AEFB4(this);
}
}
UpdateAnimationSingleFrame(this);
}
void VaatiRebornEnemyType0Action2(Entity* this) {
const Coords* ptr;
switch (this->field_0x74.HALF.LO) {
case 0:
if (--this->actionDelay == 0) {
this->field_0x74.HALF.LO++;
this->actionDelay = 0x20;
InitAnimationForceUpdate(this, 3);
SoundReq(SFX_19B);
}
break;
case 1:
if ((this->frames.all & 0x80) != 0) {
this->field_0x74.HALF.LO = 2;
this->spriteSettings.b.draw = 0;
this->actionDelay = 0x10;
}
break;
case 2:
if (--this->actionDelay == 0) {
this->field_0x74.HALF.LO++;
if (sub_0803E028(this) == 0) {
s32 tmp;
this->field_0x80.HALF.HI += 1 + (Random() & 3);
tmp = this->field_0x80.HALF.HI;
this->field_0x80.HALF.HI = tmp % 5;
ptr = &gUnk_080D04AC[this->field_0x80.HALF.HI];
this->x.HALF.HI = gRoomControls.roomOriginX + ptr->HALF.x + 0x10;
this->y.HALF.HI = gRoomControls.roomOriginY + ptr->HALF.y + 0x10;
}
this->spriteSettings.b.draw = 1;
this->actionDelay = 0x20;
InitAnimationForceUpdate(this, 4);
SoundReq(SFX_F5);
}
break;
case 3:
if ((this->frames.all & 0x80) != 0) {
this->spriteSettings.b.draw = 1;
if (4 < this->field_0x80.HALF.HI) {
this->x.HALF.HI = gPlayerEntity.x.HALF.HI;
this->y.HALF.HI = gPlayerEntity.y.HALF.HI - 0x18;
}
if (--this->field_0x76.HALF.HI == 0) {
this->action = 1;
this->actionDelay = 1;
} else {
this->field_0x74.HALF.LO = 0;
this->actionDelay = 0x10;
}
InitAnimationForceUpdate(this, 0);
}
break;
}
UpdateAnimationSingleFrame(this);
}
void VaatiRebornEnemyType0Action3(Entity* this) {
u8 temp;
switch (this->field_0x74.HALF.LO) {
case 0xfe:
this->field_0x74.HALF.LO = 0;
this->actionDelay = 1;
break;
case 0xff:
if (this->height.HALF.HI != -4) {
this->height.WORD -= 0x2000;
}
if (this->actionDelay == 2) {
this->field_0x74.HALF.LO = 0xfe;
}
break;
case 0:
if (--this->actionDelay == 0) {
this->field_0x74.HALF.LO++;
if ((this->field_0x74.HALF.HI & 0x80) != 0) {
temp = 0x14;
} else {
temp = 0x20;
}
this->actionDelay = temp;
this->field_0x80.HALF.LO = ((this->field_0x86.HALF.LO + 1) >> 1) * 2 + 2;
}
break;
case 1:
if (--this->actionDelay == 0) {
this->field_0x74.HALF.LO++;
if ((this->field_0x74.HALF.HI & 0x80) == 0) {
SoundReq(SFX_1B0);
}
InitAnimationForceUpdate(this, 1);
}
break;
case 2:
if ((this->frames.all & 0x80) != 0) {
this->field_0x74.HALF.LO = 3;
InitAnimationForceUpdate(this, 0);
}
break;
case 3:
this->action = 1;
this->field_0x74.HALF.LO = 0;
this->actionDelay = 1;
break;
}
UpdateAnimationSingleFrame(this);
}
void VaatiRebornEnemyType0Action4(Entity* this) {
u32 index;
Entity* entity;
if (--this->actionDelay == 0) {
this->action = 1;
this->cutsceneBeh.HALF.LO = 0xff;
this->actionDelay = 1;
this->direction = (this->direction + 0x10) & 0x1f;
InitAnimationForceUpdate(this, 0);
} else {
if ((this->frames.all & 0x10) != 0) {
this->frames.all &= 0xef;
if (this->cutsceneBeh.HALF.LO == 0xff) {
index = Direction8RoundUp(GetFacingDirection(this, &gPlayerEntity));
this->cutsceneBeh.HALF.LO = gUnk_080D04C0[index >> 2];
this->field_0xf = 0;
}
if ((this->field_0xf < 0x10) &&
(entity = CreateProjectileWithParent(this, 0x1a, this->cutsceneBeh.HALF.LO), entity != NULL)) {
entity->field_0xf = this->field_0xf;
entity->parent = this;
entity->height.HALF.HI = this->height.HALF.HI;
this->field_0xf = this->field_0xf + 1;
}
}
}
UpdateAnimationSingleFrame(this);
}
void VaatiRebornEnemyType0Action5(Entity* this) {
u32 uVar3;
if (this->field_0x80.HALF.LO == 0) {
this->action = 1;
this->actionDelay = 1;
this->direction = 0xff;
InitAnimationForceUpdate(this, 0);
return;
}
switch (this->field_0x74.HALF.LO) {
case 0:
if (--this->field_0xf == 0) {
this->field_0x74.HALF.LO++;
InitAnimationForceUpdate(this, 1);
}
break;
case 1:
if ((this->frames.all & 0x10) != 0) {
this->field_0x74.HALF.LO = 2;
this->field_0xf = (Random() & 0x3f) + 0x40;
SoundReq(SFX_SUMMON);
}
break;
case 2:
if (--this->field_0xf == 0) {
if (!((this->field_0x86.HALF.LO < 2) || (3 < this->field_0x86.HALF.HI)) && (Random() & 0x10) != 0) {
this->field_0x86.HALF.HI++;
this->field_0xf = (Random() & 0x3f) + 0x40;
uVar3 = GetFacingDirection(this, &gPlayerEntity);
this->direction = (uVar3 & 0x10) | 8;
} else {
this->field_0x74.HALF.LO++;
this->field_0x86.HALF.HI = 0;
this->field_0xf = 0x30;
InitAnimationForceUpdate(this, 0);
}
}
break;
case 3:
if (--this->field_0xf == 0) {
this->action = 1;
this->field_0x74.HALF.LO = 0;
this->actionDelay = 1;
this->direction = 0xff;
}
break;
}
if (this->field_0x86.HALF.HI != 0) {
sub_080AEFB4(this);
}
UpdateAnimationSingleFrame(this);
}
void VaatiRebornEnemyType0Action6(Entity* this) {
Entity* target;
if (this->field_0x80.HALF.LO == 0) {
this->action = 1;
this->actionDelay = 1;
return;
}
switch (this->field_0x74.HALF.LO) {
case 0:
if (this->actionDelay != 0) {
this->field_0x74.HALF.LO = 1;
this->actionDelay = 0x70;
}
break;
case 1:
if (--this->actionDelay == 0) {
this->field_0x74.HALF.LO++;
SoundReq(SFX_150);
target = CreateProjectileWithParent(this, 0x18, 0);
if (target != NULL) {
PositionRelative(this, target, 0, -0x100000);
target->parent = this;
}
} else if (this->actionDelay == 0x40) {
SoundReq(SFX_196);
}
break;
case 2:
if (this->field_0xf != 0) {
this->field_0xf = 0;
}
break;
case 3:
if (this->field_0xf == 0) {
this->field_0xf = 1;
SoundReq(SFX_14F);
}
if (this->actionDelay) {
this->action = 1;
this->field_0x74.HALF.LO = 0;
this->actionDelay = 1;
}
break;
}
UpdateAnimationSingleFrame(this);
}
void VaatiRebornEnemyType0Action7(Entity* this) {
Entity* fx;
u32 tmp;
if (this->actionDelay != 0) {
if (--this->actionDelay == 0) {
SetRoomFlag(1);
} else {
if ((this->actionDelay & 7) == 0) {
fx = CreateFx(this, 2, 0);
if (fx != NULL) {
tmp = Random() & 0x3f3f;
fx->x.HALF.HI = ((tmp & 0xff) - 0x20) + fx->x.HALF.HI;
fx->y.HALF.HI = ((tmp >> 8) & 0xff) - 0x20 + fx->y.HALF.HI;
#ifndef EU
fx->spritePriority.b0 = 2;
#endif
}
}
}
}
}
void VaatiRebornEnemyType1Action0(Entity* this) {
Entity* enemy;
this->action = 1;
this->field_0x74.HALF.LO = 0;
this->field_0x74.HALF.HI = 1;
this->actionDelay = 0;
this->spriteOffsetY = -1;
PositionRelative(this->parent, this, 0, 0x10000);
enemy = CreateEnemy(VAATI_REBORN_ENEMY, 2);
enemy->parent = this;
enemy->attachedEntity = this->parent;
InitAnimationForceUpdate(this, this->field_0x74.HALF.LO);
}
void VaatiRebornEnemyType1Action1(Entity* this) {
Entity* parent;
parent = this->parent;
if (this->field_0x74.HALF.LO == 0) {
if (parent->field_0x80.HALF.LO == 0) {
this->field_0x74.HALF.LO = 1;
this->damageType = 0x30;
InitAnimationForceUpdate(this, this->field_0x74.HALF.LO);
}
} else {
if (parent->field_0x80.HALF.LO != 0) {
this->field_0x74.HALF.LO = 0;
this->damageType = 0x2f;
InitAnimationForceUpdate(this, this->field_0x74.HALF.LO);
} else {
if (((this->bitfield & 0x80) != 0) && (0 < this->iframes)) {
parent->iframes = this->iframes;
parent->bitfield = this->bitfield;
}
if ((this->frames.all & 0x40) != 0) {
InitAnimationForceUpdate(this, 2);
}
}
}
if (this->field_0x74.HALF.HI == 0) {
if (parent->action != 2) {
this->field_0x74.HALF.HI = 1;
this->flags |= 0x80;
}
} else {
if (parent->action == 2) {
this->field_0x74.HALF.HI = 0;
this->flags &= 0x7f;
}
}
this->spriteSettings.b.draw = parent->spriteSettings.b.draw;
this->spriteOffsetX = parent->spriteOffsetX;
PositionRelative(this->parent, this, 0, 0x10000);
UpdateAnimationSingleFrame(this);
}
void VaatiRebornEnemyType2Action0(Entity* this) {
Entity* source;
source = this->parent->parent;
this->action = 1;
this->field_0x74.HALF.LO = 1;
this->field_0x74.HALF.HI = 0;
this->spriteOffsetY = -2;
this->direction = 0xff;
PositionRelative(source, this, 0, 0x20000);
InitAnimationForceUpdate(this, 2);
}
void VaatiRebornEnemyType2Action1(Entity* this) {
u8 parentDirection;
Entity* parent;
parent = this->parent;
if (parent->field_0x74.HALF.LO == 0) {
if (this->field_0x74.HALF.LO != 0) {
this->field_0x74.HALF.LO = 0;
}
parentDirection = parent->parent->direction;
if (parentDirection != 0xff) {
if (this->field_0x74.HALF.HI == 0) {
this->field_0x74.HALF.HI = 1;
}
if (parentDirection != this->direction) {
this->direction = parentDirection;
InitAnimationForceUpdate(this, parentDirection >> 3);
}
} else {
if (this->field_0x74.HALF.HI != 0) {
this->field_0x74.HALF.HI = 0;
InitAnimationForceUpdate(this, 0);
}
}
} else {
if (this->field_0x74.HALF.LO == 0) {
this->field_0x74.HALF.LO = 1;
InitAnimationForceUpdate(this, 2);
}
}
this->spriteSettings.b.draw = parent->spriteSettings.b.draw;
this->spriteOffsetX = parent->spriteOffsetX;
PositionRelative(parent->parent, this, 0, 0x20000);
UpdateAnimationSingleFrame(this);
}
void VaatiRebornEnemyType3Action0(Entity* this) {
this->action = 1;
this->field_0x74.HALF.LO = 0;
this->direction = 0xff;
this->spriteOffsetY = -1;
InitAnimationForceUpdate(this, this->field_0x74.HALF.LO);
sub_0803DC0C(this);
}
void VaatiRebornEnemyType3Action1(Entity* this) {
Entity* parent = this->parent;
if (this->parent->direction != 0xff) {
if (this->field_0x74.HALF.LO == 0) {
this->field_0x74.HALF.LO = 1;
}
if (parent->direction != this->direction) {
this->direction = parent->direction;
InitAnimationForceUpdate(this, this->direction >> 3);
}
} else {
if (this->field_0x74.HALF.LO != 0) {
this->field_0x74.HALF.LO = 0;
this->direction = 0xff;
InitAnimationForceUpdate(this, 2);
}
}
sub_0803DC0C(this);
}
void sub_0803DC0C(Entity* this) {
Entity* parent;
const xy* tmp;
parent = this->parent;
tmp = &gUnk_080D04C8[this->actionDelay];
this->spriteSettings.b.draw = parent->spriteSettings.b.draw;
this->spriteOffsetX = parent->spriteOffsetX;
PositionRelative(parent, this, tmp->x << 0x10, (tmp->y + 1) * 0x10000);
UpdateAnimationSingleFrame(this);
}
void VaatiRebornEnemyType1PreAction(Entity* this) {
Entity* parent;
if (this->damageType != 0x30) {
return;
}
parent = this->parent;
this->field_0x76.HALF.HI = 0;
if ((this->bitfield & 0x80) != 0) {
if (gUnk_080D04D0[parent->field_0x86.HALF.LO] > this->currentHealth) {
if (2 < ++parent->field_0x86.HALF.LO) {
this->flags &= 0x7f;
parent->action = 7;
parent->flags &= 0x7f;
parent->actionDelay = 0x80;
parent->spriteOffsetX = 0;
parent->direction = -1;
this->actionDelay = 0;
SoundReq(SONG_STOP_BGM);
gArea.musicIndex = gArea.pMusicIndex;
return;
}
this->actionDelay = 1;
this->field_0x76.HALF.HI = 0xff;
}
if (0 < this->iframes) {
SoundReq(0x127);
sub_08080964(0xc, 1);
if (this->actionDelay == 0)
this->actionDelay = 0x48;
}
}
if (this->actionDelay != 0) {
if (--this->actionDelay == 0) {
this->damageType = 0x2f;
this->field_0x74.HALF.LO = 1;
if (this->field_0x76.HALF.HI == 0) {
parent->field_0x74.HALF.LO = 0xf0;
} else {
parent->field_0x74.HALF.LO = 0x70;
this->currentHealth = 0xff;
}
parent->action = 1;
parent->actionDelay = 1;
InitAnimationForceUpdate(this, 0);
}
}
}
void sub_0803DD78(Entity* this) {
u32 random_number;
random_number = ((u32)Random() & 0x7c) >> 2;
switch (this->field_0x86.HALF.LO) {
case 0:
if (this->field_0x80.HALF.LO == 0) {
this->field_0x74.HALF.HI = 0;
this->field_0x76.HALF.HI = 0x50;
break;
}
switch (this->field_0x82.HALF.HI) {
case 0:
case 2:
case 4:
this->field_0x74.HALF.HI = 0;
this->field_0x76.HALF.HI = 0x50;
break;
case 1:
case 3:
case 5:
this->field_0x74.HALF.HI = 0;
this->field_0x76.HALF.HI = 1;
break;
default:
break;
}
break;
case 1:
switch (this->field_0x82.HALF.HI) {
case 1:
case 3:
case 5:
this->field_0x74.HALF.HI = 0;
this->field_0x76.HALF.HI = 1;
break;
case 2:
if ((random_number & 8) != 0) {
this->field_0x74.HALF.HI = 0;
this->field_0x76.HALF.HI = 1;
} else {
this->field_0x74.HALF.HI = 0;
this->field_0x76.HALF.HI = 0x50;
}
break;
case 4:
if ((random_number & 8) != 0) {
this->field_0x74.HALF.HI = 0;
this->field_0x76.HALF.HI = 0x50;
break;
}
case 0:
this->field_0x74.HALF.HI = 1;
this->field_0x76.HALF.HI = 1;
break;
default:
break;
}
break;
case 2:
switch (this->field_0x82.HALF.HI) {
case 2:
if ((random_number & 0xf) < 3) {
this->field_0x74.HALF.HI = 0;
this->field_0x76.HALF.HI = 1;
} else {
this->field_0x74.HALF.HI = 1;
this->field_0x76.HALF.HI = 1;
}
break;
case 0:
this->field_0x74.HALF.HI = 1;
this->field_0x76.HALF.HI = 1;
break;
case 4:
if (9 < random_number) {
this->field_0x74.HALF.HI = 2;
this->field_0x76.HALF.HI = (Random() & 1) + 2;
break;
}
case 1:
case 3:
case 5:
this->field_0x74.HALF.HI = 0;
this->field_0x76.HALF.HI = 1;
break;
default:
break;
}
}
this->field_0x82.HALF.HI = (this->field_0x82.HALF.HI + 1) % 6;
}
u32 sub_0803DEE0(Entity* this) {
u32 randomValue;
u32 ret;
ret = 2;
randomValue = (Random() & 0xf8) >> 3;
if (this->field_0x80.HALF.LO) {
switch (this->field_0x86.HALF.LO) {
case 0:
ret = this->field_0x82.HALF.LO & 1;
this->field_0x82.HALF.LO = (this->field_0x82.HALF.LO + 1) & 3;
break;
case 1:
switch (this->field_0x82.HALF.LO) {
case 0:
case 2:
ret = 3;
break;
case 1:
case 3:
ret = 1;
break;
case 4:
if (randomValue & 8) {
ret = 3;
} else {
ret = 0;
}
break;
}
this->field_0x82.HALF.LO = (this->field_0x82.HALF.LO + 1) % 5;
break;
case 2:
switch (this->field_0x82.HALF.LO) {
case 0:
case 3:
ret = 3;
break;
case 1:
ret = 0;
if (randomValue > 5) {
ret = 3;
}
break;
case 2:
ret = 0;
if (randomValue < 10) {
ret = 3;
}
break;
case 4:
ret = 0;
break;
default:
ret = 2;
}
this->field_0x82.HALF.LO = (this->field_0x82.HALF.LO + 1) % 5;
break;
}
}
return ret;
}
void VaatiRebornEnemyType0PreAction(Entity* this) {
u32 bVar1;
if (this->action != 0) {
*(u32*)&this->field_0x78 = this->x.WORD;
this->field_0x7c = this->y;
}
if (this->field_0x76.HALF.LO == 0) {
if ((this->direction == 0xff) || sub_08049FA0(this)) {
if (this->field_0x80.HALF.LO == 0) {
this->animationState = (this->animationState + 1) & 3;
this->spriteOffsetX = gUnk_080D04D3[this->animationState];
}
return;
}
bVar1 = sub_08049EE4(this);
this->direction = (bVar1 & 0x10) | 8;
this->field_0x76.HALF.LO = 0x10;
} else {
this->field_0x76.HALF.LO--;
}
if (this->field_0x80.HALF.LO == 0) {
this->animationState = (this->animationState + 1) & 3;
this->spriteOffsetX = gUnk_080D04D3[this->animationState];
}
}
u32 sub_0803E028(Entity* this) {
u32 ret;
s32 tmp;
ret = 0;
if ((this->field_0x74.HALF.HI != 2) && ((Random() & 1) != 0)) {
return 0;
}
if (this->field_0x76.HALF.HI != 1) {
return ret;
}
tmp = gRoomControls.roomOriginX + 0x58;
if (tmp > gPlayerEntity.x.HALF.HI) {
return ret;
}
tmp = gRoomControls.roomOriginY + 0x58;
if (tmp > gPlayerEntity.x.HALF.HI) {
return ret;
}
tmp = gRoomControls.roomOriginY + 0xf8;
if (tmp >= gPlayerEntity.x.HALF.HI) {
this->field_0x80.HALF.HI += 5;
ret = 1;
}
return ret;
}
File diff suppressed because it is too large Load Diff
+333
View File
@@ -0,0 +1,333 @@
#include "entity.h"
#include "enemy.h"
#include "audio.h"
#include "textbox.h"
#include "coord.h"
#include "functions.h"
void sub_08045A00(Entity*);
void sub_08045A28(Entity*);
void VaatiTransfiguredEyeFunction0(Entity*);
void VaatiTransfiguredEyeFunction1(Entity*);
void VaatiTransfiguredEyeNoop(Entity*);
void VaatiTransfiguredEyeFunction0Action0(Entity*);
void VaatiTransfiguredEyeFunction0Action1(Entity*);
void VaatiTransfiguredEyeFunction0Action2(Entity*);
void VaatiTransfiguredEyeFunction0Action3(Entity*);
void VaatiTransfiguredEyeFunction0Action4(Entity*);
void (*const vaatiTransfiguredEyeFunctions[])(Entity*) = {
VaatiTransfiguredEyeFunction0,
VaatiTransfiguredEyeFunction1,
VaatiTransfiguredEyeFunction0,
sub_0804A7D4,
sub_08001242,
VaatiTransfiguredEyeNoop,
};
void (*const vaatiTransfiguredEyeFunction0Actions[])(Entity*) = {
VaatiTransfiguredEyeFunction0Action0, VaatiTransfiguredEyeFunction0Action1, VaatiTransfiguredEyeFunction0Action2,
VaatiTransfiguredEyeFunction0Action3, VaatiTransfiguredEyeFunction0Action4,
};
struct xy {
s8 x;
s8 y;
} PACKED;
const struct xy gUnk_080D18B4[] = { { 0xe8, 0xf6 }, { 0xf6, 0xe8 }, { 0x0a, 0xe8 }, { 0x18, 0xf6 },
{ 0x18, 0x0a }, { 0x0a, 0x18 }, { 0xf6, 0x18 }, { 0xe8, 0x0a } };
void VaatiTransfiguredEye(Entity* this) {
EnemyFunctionHandler(this, vaatiTransfiguredEyeFunctions);
}
void VaatiTransfiguredEyeFunction0(Entity* this) {
vaatiTransfiguredEyeFunction0Actions[this->action](this);
}
void VaatiTransfiguredEyeFunction1(Entity* this) {
u8 bVar1;
Entity* pEVar4;
if (this->type != 0) {
pEVar4 = this->parent->parent;
if ((this->bitfield & 0x80) != 0) {
bVar1 = this->bitfield & 0x3f;
if ((bVar1 == 0xe) || (bVar1 == 0x15)) {
if (this->field_0x80.HALF.HI == 0) {
this->action = 3;
this->field_0x80.HALF.HI += 1;
InitializeAnimation(this, (this->type << 3) | (this->actionDelay + 2));
InitializeAnimation(this->parent, (this->parent->type << 3) | (this->actionDelay + 2));
}
if (this->actionDelay != 0) {
SoundReq(SFX_17A);
} else {
SoundReq(SFX_ITEM_GLOVES_KNOCKBACK);
}
} else {
if (this->currentHealth != 0xff) {
this->currentHealth = 0xff;
if (this->actionDelay != 0 && (pEVar4->field_0x80.HALF.HI != 0)) {
pEVar4->field_0x76.HALF.LO |= (1 << this->type2);
if (this->cutsceneBeh.HALF.HI == 0) {
this->cutsceneBeh.HALF.HI += 1;
InitializeAnimation(this, this->type << 3 | 6);
InitializeAnimation(this->parent, this->parent->type << 3 | 6);
}
}
}
}
}
}
sub_0804AA30(this, vaatiTransfiguredEyeFunctions);
}
void VaatiTransfiguredEyeNoop(Entity* this) {
}
void VaatiTransfiguredEyeFunction0Action0(Entity* this) {
Entity* child;
u8 bVar2;
bVar2 = gTextBox.doTextBox & 0x7f;
if ((gTextBox.doTextBox & 0x7f) == 0) {
this->action = 1;
this->spriteSettings.b.draw = 0;
this->field_0x80.HALF.LO = bVar2;
this->field_0x80.HALF.HI = bVar2;
this->cutsceneBeh.HALF.HI = bVar2;
this->field_0xf = bVar2;
this->field_0x82.HALF.LO = 0x30;
this->field_0x82.HALF.HI = bVar2;
if (this->type == 0) {
sub_08045A00(this);
child = CreateEnemy(VAATI_TRANSFIGURED_EYE, 1);
if (child != NULL) {
child->parent = this;
this->attachedEntity = child;
child->actionDelay = this->actionDelay;
child->type2 = this->type2;
CopyPosition(this, child);
}
} else {
this->spriteOffsetY = 1;
}
InitializeAnimation(this, (u32)this->type << 3 | 1);
}
}
void VaatiTransfiguredEyeFunction0Action1(Entity* this) {
sub_08045A28(this);
if (this->field_0x82.HALF.LO == 0) {
if ((this->frames.all & 0x80) != 0) {
if (this->type != 0) {
this->flags |= 0x80;
}
this->action = 2;
InitializeAnimation(this, this->type << 3);
}
} else {
if (--this->field_0x82.HALF.LO == 0) {
this->spriteSettings.b.draw = 1;
}
}
}
void VaatiTransfiguredEyeFunction0Action2(Entity* this) {
Entity* parent;
sub_08045A28(this);
parent = this->parent;
if (this->type != 0) {
parent = parent->parent;
}
if ((parent->action == 3) && (parent->field_0x80.HALF.LO == 1)) {
this->action = 4;
this->field_0xf = 0;
if (this->type != 0) {
this->flags &= 0x7f;
if (this->actionDelay != 0) {
InitializeAnimation(this, this->type << 3 | 5);
InitializeAnimation(this->parent, this->parent->type << 3 | 5);
} else {
InitializeAnimation(this, this->type << 3 | 4);
InitializeAnimation(this->parent, this->parent->type << 3 | 4);
}
}
}
}
void VaatiTransfiguredEyeFunction0Action3(Entity* this) {
sub_08045A28(this);
if ((this->frames.all & 0x80) != 0) {
this->action = 2;
if (this->type != 0) {
if (this->actionDelay == 0) {
this->damageType = 0x32;
} else {
this->parent->parent->field_0x76.HALF.LO |= (1 << this->type2);
this->damageType = 0x31;
}
}
}
}
void VaatiTransfiguredEyeFunction0Action4(Entity* this) {
Entity* parent;
sub_08045A28(this);
if (this->field_0xf == 0) {
if ((this->frames.all & 0x80) != 0) {
this->field_0xf = 0x20;
}
} else {
parent = this->parent;
if (this->type != 0) {
parent = parent->parent;
}
if ((parent->animationState < 3) && (parent->action != 3)) {
this->action = 1;
this->field_0xf = 0;
this->field_0x80.HALF.HI = 0;
this->cutsceneBeh.HALF.HI = 0;
if (this->type != 0) {
this->damageType = 0x33;
}
if ((parent->field_0x74.HALF.HI >> this->type2 & 1U) != 0) {
this->actionDelay = 1;
} else {
this->actionDelay = 0;
}
InitializeAnimation(this, this->type << 3 | 1);
}
}
}
void sub_08045A00(Entity* this) {
const struct xy* t = &gUnk_080D18B4[this->type2];
PositionRelative(this->parent, this, t->x << 0x10, (t->y + 3) * 0x10000);
}
void sub_08045A28(Entity* this) {
u32 frames;
u32 type;
if (this->field_0x82.HALF.LO == 0) {
GetNextFrame(this);
}
frames = this->frames.all & 0x70;
type = this->type;
if (type == 0) {
sub_08045A00(this);
switch (this->field_0x82.HALF.HI) {
case 0:
switch (frames) {
case 0x20:
this->field_0x82.HALF.HI = 1;
sub_0801D2B4(this, 0x13e);
break;
case 0x00:
case 0x40:
this->field_0x82.HALF.HI = 2;
sub_0801D2B4(this, 0x13f);
break;
default:
break;
}
break;
case 1:
switch (frames) {
case 0x10:
this->field_0x82.HALF.HI = type;
sub_0801D2B4(this, 0x13b);
break;
case 0:
this->field_0x82.HALF.HI = 2;
sub_0801D2B4(this, 0x13f);
break;
default:
break;
}
break;
case 2:
switch (frames) {
case 0x20:
this->field_0x82.HALF.HI = 1;
sub_0801D2B4(this, 0x13e);
break;
case 0x10:
this->field_0x82.HALF.HI = 0;
sub_0801D2B4(this, 0x13b);
break;
case 0x40:
this->field_0x82.HALF.HI = 2;
sub_0801D2B4(this, 0x13f);
break;
default:
break;
}
break;
case 3:
switch (frames) {
case 0:
this->field_0x82.HALF.HI = 2;
sub_0801D2B4(this, 0x13f);
break;
default:
break;
}
break;
default:
break;
}
} else {
PositionRelative(this->parent, this, 0, -0x10000);
switch (this->field_0x82.HALF.HI) {
case 0:
switch (this->frames.all & 0x70) {
case 0x10:
this->field_0x82.HALF.HI = 2;
sub_0801D2B4(this, 0x13b);
break;
case 0x20:
this->field_0x82.HALF.HI = 1;
sub_0801D2B4(this, 0x13e);
break;
default:
break;
}
break;
case 1: {
u32 temp = this->frames.all & 0x70;
switch (temp) {
case 0:
this->field_0x82.HALF.HI = temp;
sub_0801D2B4(this, 0x13f);
break;
case 0x10:
this->field_0x82.HALF.HI = 2;
sub_0801D2B4(this, 0x13b);
break;
default:
break;
}
} break;
case 2:
switch (this->frames.all & 0x70) {
case 0:
this->field_0x82.HALF.HI = this->frames.all & 0x70;
sub_0801D2B4(this, 0x13f);
break;
default:
break;
}
break;
default:
break;
}
}
}
File diff suppressed because it is too large Load Diff
+211
View File
@@ -0,0 +1,211 @@
#include "entity.h"
#include "audio.h"
#include "structures.h"
#include "functions.h"
void sub_080485D8(Entity*);
void sub_080485FC(Entity*);
void VaatiWrathEyeAction0(Entity*);
void VaatiWrathEyeAction1(Entity*);
void VaatiWrathEyeAction2(Entity*);
void VaatiWrathEyeAction3(Entity*);
void VaatiWrathEyeAction4(Entity*);
void VaatiWrathEyeAction5(Entity*);
void VaatiWrathEyeAction6(Entity*);
void VaatiWrathEyeAction7(Entity*);
void VaatiWrathEyeAction8(Entity*);
void VaatiWrathEyeAction9(Entity*);
void (*const vaatiWrathEyeActions[])(Entity*) = {
VaatiWrathEyeAction0, VaatiWrathEyeAction1, VaatiWrathEyeAction2, VaatiWrathEyeAction3, VaatiWrathEyeAction4,
VaatiWrathEyeAction5, VaatiWrathEyeAction6, VaatiWrathEyeAction7, VaatiWrathEyeAction8, VaatiWrathEyeAction9,
};
const s8 gUnk_080D1D70[] = { 0xee, 0x01, 0xfa, 0x04, 0x06, 0x04, 0x13, 0x01 };
const s8 gUnk_080D1D78[] = { 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xfa, 0xfb, 0xfc, 0xfc, 0xfd, 0xfc,
0xfb, 0xfa, 0xf9, 0xfa, 0xfb, 0xfb, 0xfc, 0xfd, 0xfc, 0xfb, 0xfa,
0xf9, 0xfa, 0xfa, 0xfb, 0xfc, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9 };
const s8 gUnk_080D1D98[] = { 0xe8, 0x04, 0xf8, 0x08, 0x08, 0x08, 0x18, 0x04 };
void VaatiWrathEye(Entity* this) {
if (this->parent->next == NULL) {
DeleteThisEntity();
}
vaatiWrathEyeActions[this->action](this);
}
void VaatiWrathEyeAction0(Entity* this) {
if ((gScreenTransition.field_0x38 & 1) != 0) {
this->action = 2;
InitializeAnimation(this, 1);
} else {
this->action = 1;
InitializeAnimation(this, 0);
SoundReq(SFX_166);
}
sub_080485D8(this);
}
void VaatiWrathEyeAction1(Entity* this) {
sub_080485D8(this);
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
this->action = 2;
InitializeAnimation(this, 1);
}
}
void VaatiWrathEyeAction2(Entity* this) {
sub_080485D8(this);
if ((gScreenTransition.field_0x39 & 3) == 0) {
this->action = 3;
this->flags |= 0x80;
this->speed = 0x80;
}
}
void VaatiWrathEyeAction3(Entity* this) {
u32 direction;
Entity* parent;
u32 x;
u32 y;
const s8* ptr;
parent = this->parent;
if (parent->field_0x78.HALF.HI != 0) {
sub_080485D8(this);
} else {
ptr = &gUnk_080D1D98[this->type * 2];
x = parent->x.HALF.HI + ptr[0];
y = parent->y.HALF.HI + ptr[1];
direction = sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, x, y);
this->direction = direction;
sub_0806F69C(this);
this->height.HALF.HI = this->parent->height.HALF.HI;
if ((this->x.HALF.HI == x) && (this->y.HALF.HI == y)) {
this->action = 4;
this->actionDelay = 0x3c;
}
}
}
void VaatiWrathEyeAction4(Entity* this) {
sub_080485FC(this);
if (this->actionDelay != 0) {
if (--this->actionDelay == 0) {
InitializeAnimation(this, 3);
}
} else {
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
this->action = 5;
this->actionDelay = 0;
}
}
}
void VaatiWrathEyeAction5(Entity* this) {
if (this->actionDelay != 0) {
this->action = 6;
if (this->parent->currentHealth >= 0x15) {
this->actionDelay = 120;
} else {
this->actionDelay = 0x3c;
}
this->attachedEntity = NULL;
InitializeAnimation(this, 5);
SoundReq(SFX_19B);
}
sub_080485FC(this);
}
void VaatiWrathEyeAction6(Entity* this) {
Entity* pEVar3;
sub_080485FC(this);
GetNextFrame(this);
if (this->actionDelay != 0) {
if (--this->actionDelay == 0) {
InitializeAnimation(this, 6);
}
} else {
if (this->frames.b.f3) {
this->action = 7;
this->actionDelay = 120;
this->field_0xf = 0;
} else {
if (this->frames.b.f0 != 0) {
this->frames.all &= 0xfe;
pEVar3 = CreateProjectile(0x24);
if (pEVar3 != NULL) {
pEVar3->parent = this;
this->attachedEntity = pEVar3;
PositionRelative(this, pEVar3, 0, 0xc0000);
}
}
}
}
}
void VaatiWrathEyeAction7(Entity* this) {
sub_080485FC(this);
GetNextFrame(this);
if (this->field_0xf != 0) {
this->action = 8;
this->actionDelay = 0x3c;
this->flags &= 0x7f;
this->spriteSettings.b.draw = 0;
CreateFx(this, 0x1f, 0x40);
this->parent->field_0x7a.HALF.HI |= 0x10 << this->type;
} else {
if (--this->actionDelay != 0) {
return;
}
this->action = 5;
this->actionDelay = 0;
this->parent->field_0x7a.HALF.HI |= 1 << this->type;
}
}
void VaatiWrathEyeAction8(Entity* this) {
if (this->parent->action == 0xb) {
this->actionDelay = 0x3c;
} else {
if (--this->actionDelay == 0) {
this->action = 9;
this->flags |= 0x80;
this->spriteSettings.b.draw = 1;
InitializeAnimation(this, 0);
sub_080485FC(this);
SoundReq(SFX_166);
}
}
}
void VaatiWrathEyeAction9(Entity* this) {
sub_080485FC(this);
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
this->action = 4;
this->actionDelay = 1;
this->parent->field_0x7a.HALF.HI = (this->parent->field_0x7a.HALF.HI & 0xf) | (1 << this->type);
}
}
void sub_080485D8(Entity* this) {
const s8* ptr;
ptr = &gUnk_080D1D70[this->type * 2];
sub_0806FA90(this->parent, this, ptr[0], ptr[1]);
}
void sub_080485FC(Entity* this) {
const s8* ptr;
ptr = &gUnk_080D1D98[this->type * 2];
sub_0806FA90(this->parent, this, ptr[0], ptr[1]);
this->height.HALF.HI = gUnk_080D1D78[this->type * 8 + (this->parent->field_0x78.HALF.LO >> 4 & 7)];
}
+1 -1
View File
@@ -22,7 +22,7 @@ void Manager34_Main(Manager34* this) {
void sub_0805DBB4(Manager34* this) {
this->manager.action = 1;
this->field_0x20 = gScreenTransition.filler[0] * 0x3c;
this->field_0x20 = gScreenTransition.field_0x3d * 0x3c;
}
void sub_0805DBCC(Manager34* this) {
+128 -128
View File
@@ -4,134 +4,134 @@
//clang-format off
void (*const gNPCFunctions[][3])(Entity* ent) = {
/*0x00*/ { DeleteEntity, NULL, NULL },
/*0x01*/ { Gentari, NULL, Gentari_Fusion },
/*0x02*/ { Festari, NULL, Festari_Fusion },
/*0x03*/ { ForestMinish, ForestMinish_Head, ForestMinish_Fusion },
/*0x04*/ { Postman, NULL, Postman_Fusion },
/*0x05*/ { NPC5, NULL, NULL },
/*0x06*/ { Townsperson, Townsperson_Head, Townsperson_Fusion },
/*0x07*/ { Kid, Kid_Head, Kid_Fusion },
/*0x08*/ { Guard, Guard_Head, NULL },
/*0x09*/ { NPC9, NULL, NULL },
/*0x0a*/ { Stamp, NULL, NULL },
/*0x0b*/ { Maid, Maid_Head, NULL },
/*0x0c*/ { Marcy, NULL, NULL },
/*0x0d*/ { Wheaton, NULL, NULL },
/*0x0e*/ { Pita, NULL, NULL },
/*0x0f*/ { MinishEzlo, MinishEzlo_Head, NULL },
/*0x10*/ { Mailbox, NULL, NULL },
/*0x11*/ { Beedle, Beedle_Head, NULL },
/*0x12*/ { Brocco, NULL, Brocco_Fusion },
/*0x13*/ { SittingPerson, SittingPerson_Head, SittingPerson_Fusion },
/*0x14*/ { Pina, NULL, Pina_Fusion },
/*0x15*/ { Guard, Guard_Head, NULL },
/*0x16*/ { Maid, Maid_Head, NULL },
/*0x17*/ { Din, NULL, Din_Fusion },
/*0x18*/ { Nayru, NULL, Nayru_Fusion },
/*0x19*/ { Farore, NULL, Farore_Fusion },
/*0x1a*/ { Sturgeon, Sturgeon_Head, Sturgeon_Fusion },
/*0x1b*/ { TingleSiblings, NULL, TingleSiblings_Fusion },
/*0x1c*/ { Stockwell, NULL, NULL },
/*0x1d*/ { Talon, Talon_Head, Talon_Fusion },
/*0x1e*/ { Malon, NULL, Malon_Fusion },
/*0x1f*/ { Epona, NULL, Epona_Fusion },
/*0x20*/ { MilkCart, NULL, NULL },
/*0x21*/ { GhostBrothers, NULL, GhostBrothers_Fusion },
/*0x22*/ { Smith, Smith_Head, Smith_Fusion },
/*0x23*/ { NPC23, NULL, NULL },
/*0x24*/ { KingDaltus, NULL, KingDaltus_Fusion },
/*0x25*/ { MinisterPotho, NULL, MinisterPotho_Fusion },
/*0x26*/ { NPC26, NULL, NULL },
/*0x27*/ { Vaati, NULL, NULL },
/*0x28*/ { Zelda, NULL, NULL },
/*0x29*/ { Mutoh, Mutoh_Head, Mutoh_Fusion },
/*0x2a*/ { Carpenter, Carpenter_Head, Carpenter_Fusion },
/*0x2b*/ { CastorWildsStatue, NULL, CastorWildsStatue_Fusion },
/*0x2c*/ { Cat, NULL, Cat_Fusion },
/*0x2d*/ { MountainMinish, MountainMinish_Head, MountainMinish_Fusion },
/*0x2e*/ { ZeldaFollower, NULL, NULL },
/*0x2f*/ { Melari, Melari_Head, Melari_Fusion },
/*0x30*/ { BladeBrothers, NULL, BladeBrothers_Fusion },
/*0x31*/ { Cow, NULL, Cow_Fusion },
/*0x32*/ { Goron, NULL, Goron_Fusion },
/*0x33*/ { GoronMerchant, NULL, NULL },
/*0x34*/ { Gorman, Gorman_Head, NULL },
/*0x35*/ { Dog, Dog_Head, Dog_Fusion },
/*0x36*/ { Syrup, Syrup_Head, NULL },
/*0x37*/ { Rem, NULL, NULL },
/*0x38*/ { TownMinish, TownMinish_Head, TownMinish_Fusion },
/*0x39*/ { Librari, NULL, Librari_Fusion },
/*0x3a*/ { Percy, Percy_Head, Percy_Fusion },
/*0x3b*/ { VaatiReborn, NULL, NULL },
/*0x3c*/ { MoblinLady, NULL, NULL },
/*0x3d*/ { Librarians, NULL, NULL },
/*0x3e*/ { Farmers, Farmers_Head, Farmers_Fusion },
/*0x3f*/ { Carlov, NULL, NULL },
/*0x40*/ { Dampe, NULL, Dampe_Fusion },
/*0x41*/ { DrLeft, NULL, NULL },
/*0x42*/ { KingGustaf, NULL, NULL },
/*0x43*/ { Gina, NULL, Gina_Fusion },
/*0x44*/ { Simon, NULL, NULL },
/*0x45*/ { Anju, NULL, Anju_Fusion },
/*0x46*/ { Mama, Mama_Head, Mama_Fusion },
/*0x47*/ { Emma, NULL, NULL },
/*0x48*/ { Teachers, Teachers_Head, Teachers_Fusion },
/*0x49*/ { WindTribespeople, WindTribespeople_Head, WindTribespeople_Fusion },
/*0x4a*/ { Gregal, NULL, Gregal_Fusion },
/*0x4b*/ { MayorHagen, NULL, MayorHagen_Fusion },
/*0x4c*/ { BigGoron, NULL, NULL },
/*0x4d*/ { EzloCap, NULL, NULL },
/*0x4e*/ { NPC4E, NULL, NPC4E_Fusion },
/*0x4f*/ { NPC4F, NULL, NULL },
/*0x50*/ { ClothesRack, NULL, NULL },
/*0x51*/ { PicolyteBottle, NULL, NULL },
/*0x52*/ { SmallTownMinish, NULL, NULL },
/*0x53*/ { HurdyGurdyMan, HurdyGurdyMan_Head, HurdyGurdyMan_Fusion },
/*0x54*/ { Cucco, NULL, Cucco_Fusion },
/*0x55*/ { CuccoChick, NULL, CuccoChick_Fusion },
/*0x56*/ { FusionMenuNPC, FusionMenuNPC_Head, NULL },
/*0x57*/ { Phonograph, NULL, NULL },
/*0x58*/ { NPC58, NPC58_Head, NULL },
/*0x59*/ { DeleteEntity, NULL, NULL },
/*0x5a*/ { DeleteEntity, NULL, NULL },
/*0x5b*/ { DeleteEntity, NULL, NULL },
/*0x5c*/ { DeleteEntity, NULL, NULL },
/*0x5d*/ { DeleteEntity, NULL, NULL },
/*0x5e*/ { DeleteEntity, NULL, NULL },
/*0x5f*/ { DeleteEntity, NULL, NULL },
/*0x60*/ { DeleteEntity, NULL, NULL },
/*0x61*/ { DeleteEntity, NULL, NULL },
/*0x62*/ { DeleteEntity, NULL, NULL },
/*0x63*/ { DeleteEntity, NULL, NULL },
/*0x64*/ { DeleteEntity, NULL, NULL },
/*0x65*/ { DeleteEntity, NULL, NULL },
/*0x66*/ { DeleteEntity, NULL, NULL },
/*0x67*/ { DeleteEntity, NULL, NULL },
/*0x68*/ { DeleteEntity, NULL, NULL },
/*0x69*/ { DeleteEntity, NULL, NULL },
/*0x6a*/ { DeleteEntity, NULL, NULL },
/*0x6b*/ { DeleteEntity, NULL, NULL },
/*0x6c*/ { DeleteEntity, NULL, NULL },
/*0x6d*/ { DeleteEntity, NULL, NULL },
/*0x6e*/ { DeleteEntity, NULL, NULL },
/*0x6f*/ { DeleteEntity, NULL, NULL },
/*0x70*/ { DeleteEntity, NULL, NULL },
/*0x71*/ { DeleteEntity, NULL, NULL },
/*0x72*/ { DeleteEntity, NULL, NULL },
/*0x73*/ { DeleteEntity, NULL, NULL },
/*0x74*/ { DeleteEntity, NULL, NULL },
/*0x75*/ { DeleteEntity, NULL, NULL },
/*0x76*/ { DeleteEntity, NULL, NULL },
/*0x77*/ { DeleteEntity, NULL, NULL },
/*0x78*/ { DeleteEntity, NULL, NULL },
/*0x79*/ { DeleteEntity, NULL, NULL },
/*0x7a*/ { DeleteEntity, NULL, NULL },
/*0x7b*/ { DeleteEntity, NULL, NULL },
/*0x7c*/ { DeleteEntity, NULL, NULL },
/*0x7d*/ { DeleteEntity, NULL, NULL },
/*0x7e*/ { DeleteEntity, NULL, NULL },
/*0x7f*/ { DeleteEntity, NULL, NULL }
[NPC_NONE_0] = { DeleteEntity, NULL, NULL },
[GENTARI] = { Gentari, NULL, Gentari_Fusion },
[FESTARI] = { Festari, NULL, Festari_Fusion },
[FOREST_MINISH] = { ForestMinish, ForestMinish_Head, ForestMinish_Fusion },
[POSTMAN] = { Postman, NULL, Postman_Fusion },
[NPC_UNK_5] = { NPC5, NULL, NULL },
[TPWNSPERSON] = { Townsperson, Townsperson_Head, Townsperson_Fusion },
[KID] = { Kid, Kid_Head, Kid_Fusion },
[GUARD] = { Guard, Guard_Head, NULL },
[NPC_UNK_9] = { NPC9, NULL, NULL },
[STAMP] = { Stamp, NULL, NULL },
[MAID] = { Maid, Maid_Head, NULL },
[MARCY] = { Marcy, NULL, NULL },
[WHEATON] = { Wheaton, NULL, NULL },
[PITA] = { Pita, NULL, NULL },
[MINISH_EZLO] = { MinishEzlo, MinishEzlo_Head, NULL },
[MAILBOX] = { Mailbox, NULL, NULL },
[BEEDLE] = { Beedle, Beedle_Head, NULL },
[BROCCO] = { Brocco, NULL, Brocco_Fusion },
[SITTING_PERSON] = { SittingPerson, SittingPerson_Head, SittingPerson_Fusion },
[PINA] = { Pina, NULL, Pina_Fusion },
[GUARD_1] = { Guard, Guard_Head, NULL },
[MAID_1] = { Maid, Maid_Head, NULL },
[DIN] = { Din, NULL, Din_Fusion },
[NAYRU] = { Nayru, NULL, Nayru_Fusion },
[FARORE] = { Farore, NULL, Farore_Fusion },
[STURGEON] = { Sturgeon, Sturgeon_Head, Sturgeon_Fusion },
[TINGLE_SIBLINGS] = { TingleSiblings, NULL, TingleSiblings_Fusion },
[STOCKWELL] = { Stockwell, NULL, NULL },
[TALON] = { Talon, Talon_Head, Talon_Fusion },
[MALON] = { Malon, NULL, Malon_Fusion },
[EPONA] = { Epona, NULL, Epona_Fusion },
[MILK_CART] = { MilkCart, NULL, NULL },
[GHOST_BROTHERS] = { GhostBrothers, NULL, GhostBrothers_Fusion },
[SMITH] = { Smith, Smith_Head, Smith_Fusion },
[NPC_UNK_23] = { NPC23, NULL, NULL },
[KING_DALTUS] = { KingDaltus, NULL, KingDaltus_Fusion },
[MINISTER_POTHO] = { MinisterPotho, NULL, MinisterPotho_Fusion },
[NPC_UNK_26] = { NPC26, NULL, NULL },
[VAATI] = { Vaati, NULL, NULL },
[ZELDA] = { Zelda, NULL, NULL },
[MUTOH] = { Mutoh, Mutoh_Head, Mutoh_Fusion },
[CARPENTER] = { Carpenter, Carpenter_Head, Carpenter_Fusion },
[CASTOR_WILDS_STATUE] = { CastorWildsStatue, NULL, CastorWildsStatue_Fusion },
[CAT] = { Cat, NULL, Cat_Fusion },
[MOUNTAIN_MINISH] = { MountainMinish, MountainMinish_Head, MountainMinish_Fusion },
[ZELDA_FOLLOWER] = { ZeldaFollower, NULL, NULL },
[MELARI] = { Melari, Melari_Head, Melari_Fusion },
[BLADE_BROTHERS] = { BladeBrothers, NULL, BladeBrothers_Fusion },
[COW] = { Cow, NULL, Cow_Fusion },
[GORON] = { Goron, NULL, Goron_Fusion },
[GORON_MERCHANT] = { GoronMerchant, NULL, NULL },
[GORMAN] = { Gorman, Gorman_Head, NULL },
[DOG] = { Dog, Dog_Head, Dog_Fusion },
[SYRUP] = { Syrup, Syrup_Head, NULL },
[REM] = { Rem, NULL, NULL },
[TOWN_MINISH] = { TownMinish, TownMinish_Head, TownMinish_Fusion },
[LIBRARI] = { Librari, NULL, Librari_Fusion },
[PERCY] = { Percy, Percy_Head, Percy_Fusion },
[VAATI_REBORN] = { VaatiReborn, NULL, NULL },
[MOBLIN_LADY] = { MoblinLady, NULL, NULL },
[LIBRARIANS] = { Librarians, NULL, NULL },
[FARMERS] = { Farmers, Farmers_Head, Farmers_Fusion },
[CARLOV] = { Carlov, NULL, NULL },
[DAMPE] = { Dampe, NULL, Dampe_Fusion },
[DR_LEFT] = { DrLeft, NULL, NULL },
[KING_GUSTAF] = { KingGustaf, NULL, NULL },
[GINA] = { Gina, NULL, Gina_Fusion },
[SIMON] = { Simon, NULL, NULL },
[ANJU] = { Anju, NULL, Anju_Fusion },
[MAMA] = { Mama, Mama_Head, Mama_Fusion },
[EMMA] = { Emma, NULL, NULL },
[TEACHERS] = { Teachers, Teachers_Head, Teachers_Fusion },
[WIND_TRIBESPEOPLE] = { WindTribespeople, WindTribespeople_Head, WindTribespeople_Fusion },
[GREGAL] = { Gregal, NULL, Gregal_Fusion },
[MAYOR_HAGEN] = { MayorHagen, NULL, MayorHagen_Fusion },
[BIG_GORON] = { BigGoron, NULL, NULL },
[EZLO_CAP] = { EzloCap, NULL, NULL },
[NPC_UNK_4E] = { NPC4E, NULL, NPC4E_Fusion },
[NPC_UNK_4F] = { NPC4F, NULL, NULL },
[CLOTHES_RACK] = { ClothesRack, NULL, NULL },
[PICOLYTE_BOTTLE] = { PicolyteBottle, NULL, NULL },
[SMALL_TOWN_MINISH] = { SmallTownMinish, NULL, NULL },
[HURDY_GURDY_MAN] = { HurdyGurdyMan, HurdyGurdyMan_Head, HurdyGurdyMan_Fusion },
[CUCCO] = { Cucco, NULL, Cucco_Fusion },
[CUCCO_CHICK] = { CuccoChick, NULL, CuccoChick_Fusion },
[FUSION_MENU_NPC] = { FusionMenuNPC, FusionMenuNPC_Head, NULL },
[PHONOGRAPH] = { Phonograph, NULL, NULL },
[NPC_UNK_58] = { NPC58, NPC58_Head, NULL },
[NPC_NONE_1] = { DeleteEntity, NULL, NULL },
[NPC_NONE_2] = { DeleteEntity, NULL, NULL },
[NPC_NONE_3] = { DeleteEntity, NULL, NULL },
[NPC_NONE_4] = { DeleteEntity, NULL, NULL },
[NPC_NONE_5] = { DeleteEntity, NULL, NULL },
[NPC_NONE_6] = { DeleteEntity, NULL, NULL },
[NPC_NONE_7] = { DeleteEntity, NULL, NULL },
[NPC_NONE_8] = { DeleteEntity, NULL, NULL },
[NPC_NONE_9] = { DeleteEntity, NULL, NULL },
[NPC_NONE_10] = { DeleteEntity, NULL, NULL },
[NPC_NONE_11] = { DeleteEntity, NULL, NULL },
[NPC_NONE_12] = { DeleteEntity, NULL, NULL },
[NPC_NONE_13] = { DeleteEntity, NULL, NULL },
[NPC_NONE_14] = { DeleteEntity, NULL, NULL },
[NPC_NONE_15] = { DeleteEntity, NULL, NULL },
[NPC_NONE_16] = { DeleteEntity, NULL, NULL },
[NPC_NONE_17] = { DeleteEntity, NULL, NULL },
[NPC_NONE_18] = { DeleteEntity, NULL, NULL },
[NPC_NONE_19] = { DeleteEntity, NULL, NULL },
[NPC_NONE_20] = { DeleteEntity, NULL, NULL },
[NPC_NONE_21] = { DeleteEntity, NULL, NULL },
[NPC_NONE_22] = { DeleteEntity, NULL, NULL },
[NPC_NONE_23] = { DeleteEntity, NULL, NULL },
[NPC_NONE_24] = { DeleteEntity, NULL, NULL },
[NPC_NONE_25] = { DeleteEntity, NULL, NULL },
[NPC_NONE_26] = { DeleteEntity, NULL, NULL },
[NPC_NONE_27] = { DeleteEntity, NULL, NULL },
[NPC_NONE_28] = { DeleteEntity, NULL, NULL },
[NPC_NONE_29] = { DeleteEntity, NULL, NULL },
[NPC_NONE_30] = { DeleteEntity, NULL, NULL },
[NPC_NONE_31] = { DeleteEntity, NULL, NULL },
[NPC_NONE_32] = { DeleteEntity, NULL, NULL },
[NPC_NONE_33] = { DeleteEntity, NULL, NULL },
[NPC_NONE_34] = { DeleteEntity, NULL, NULL },
[NPC_NONE_35] = { DeleteEntity, NULL, NULL },
[NPC_NONE_36] = { DeleteEntity, NULL, NULL },
[NPC_NONE_37] = { DeleteEntity, NULL, NULL },
[NPC_NONE_38] = { DeleteEntity, NULL, NULL },
[NPC_NONE_39] = { DeleteEntity, NULL, NULL }
};
//clang-format on
const u8 npc_unk[] = { 0x04, 0x05, 0x06, 0x06 };
+130
View File
@@ -0,0 +1,130 @@
#include "global.h"
#include "entity.h"
#include "script.h"
#include "audio.h"
#include "structures.h"
#include "functions.h"
extern void sub_08095CB0(Entity*);
extern void CreateManager36(Entity*);
extern void DeleteManager36(Entity*);
extern void sub_0805DA90(Entity*, u32);
void VaatiAction0(Entity*);
void VaatiAction1(Entity*);
void sub_08066B74(Entity*, ScriptExecutionContext*);
void (*const vaatiActions[])(Entity*) = { VaatiAction0, VaatiAction1 };
void Vaati(Entity* this) {
vaatiActions[this->action](this);
this->palette.b.b0 = this->palette.b.b4 + (this->frameSpriteSettings & 1);
}
void VaatiAction0(Entity* this) {
this->action = 1;
this->subAction = 0;
this->spriteSettings.b.draw = 1;
this->field_0x68.HALF.LO = 0;
this->field_0x68.HALF.HI = 0;
sub_0805E3A0(this, 2);
sub_0807DD64(this);
VaatiAction1(this);
}
void VaatiAction1(Entity* this) {
ScriptExecutionContext* tmp;
sub_0807DD94(this, sub_08066B74);
if ((*(s8*)&this->field_0x68.HALF.HI != 0) && ((gScreenTransition.frameCount & 3) == 0)) {
sub_08095CB0(this);
}
if ((this->frames.all & ~0x80) != 0) {
switch (this->frames.all & ~0x80u) {
case 1:
EnqueueSFX(SFX_21C);
break;
case 2:
EnqueueSFX(SFX_21E);
break;
case 3:
tmp = (*(ScriptExecutionContext**)&this->cutsceneBeh);
tmp->intVariable = 4;
CreateManager36(this);
break;
case 4:
tmp = (*(ScriptExecutionContext**)&this->cutsceneBeh);
tmp->intVariable = 4;
DeleteManager36(this);
EnqueueSFX(SFX_21D);
break;
}
this->frames.b.f3 = 0;
}
}
void sub_08066B74(Entity* this, ScriptExecutionContext* context) {
u8 animationState;
u32 currentAction;
u32 actions;
actions = context->postScriptActions & 0xfff00000;
context->postScriptActions = context->postScriptActions & 0xfffff;
if (actions != 0) {
do {
currentAction = (~actions + 1) & actions;
actions = actions ^ currentAction;
animationState = this->animationState >> 1;
switch (currentAction) {
case 1 << 20:
this->field_0x80.HWORD = animationState + 0x10;
break;
case 1 << 21:
this->field_0x80.HWORD = animationState + 0x14;
break;
case 1 << 22:
this->field_0x80.HWORD = animationState + 0x18;
break;
case 1 << 23:
this->field_0x80.HWORD = animationState + 0x1c;
break;
case 1 << 24:
this->field_0x80.HWORD = animationState + 0x20;
break;
case 1 << 25:
this->field_0x80.HWORD = animationState + 0x24;
break;
case 1 << 26:
this->field_0x80.HWORD = animationState + 0x28;
break;
case 1 << 27:
this->field_0x80.HWORD = animationState + 0x2c;
break;
case 1 << 28:
this->field_0x80.HWORD = animationState + 0x30;
break;
case 1 << 29:
this->field_0x68.HALF.LO = 1;
break;
case 1 << 30:
this->field_0x68.HALF.LO = 0xff;
break;
case 1 << 31:
this->field_0x68.HALF.HI ^= 1;
break;
}
} while (actions != 0);
}
HandlePostScriptActions(this, *(ScriptExecutionContext**)&this->cutsceneBeh);
}
void sub_08066C94(Entity* this) {
sub_0805DA90(this, 0);
SoundReq(SFX_APPARATE);
}
void sub_08066CA4(Entity* this) {
sub_0805DA90(this, 1);
SoundReq(SFX_EVAPORATE);
}
+213
View File
@@ -0,0 +1,213 @@
#include "global.h"
#include "npc.h"
#include "coord.h"
#include "flags.h"
#include "audio.h"
#include "textbox.h"
#include "functions.h"
void VaatiRebornAction0(Entity* this);
void VaatiRebornAction1(Entity* this);
void sub_0806B96C(Entity*);
Entity* sub_0806B9BC(Entity*);
typedef struct xy {
s8 x;
s8 y;
} PACKED xy;
void (*const vaatiRebornActions[])(Entity*) = {
VaatiRebornAction0,
VaatiRebornAction1,
};
const xy gUnk_08112F80[] = { { 10, -29 }, { -10, -29 }, { 15, -21 }, { -15, -21 } };
void VaatiReborn(Entity* this) {
vaatiRebornActions[this->action](this);
}
void VaatiRebornAction0(Entity* this) {
Entity* entity;
u32 i;
this->action = 1;
this->subAction = 0;
this->actionDelay = 0;
switch (this->type) {
case 0:
this->y.HALF.HI -= 0xa0;
this->actionDelay = 0xa0;
this->field_0xf = 0x20;
this->spriteOffsetY = 0x20;
for (i = 0; i < 4; i++) {
entity = CreateNPC(VAATI_REBORN, 2, i);
if (entity != NULL) {
entity->parent = this;
}
}
entity = CreateNPC(VAATI_REBORN, 1, 0);
entity->parent = this;
entity->spriteOffsetY = -1;
PositionRelative(this, entity, 0, 0x10000);
InitAnimationForceUpdate(this, 0);
break;
case 1:
case 5:
InitAnimationForceUpdate(this, 0);
break;
case 2:
if ((this->type2 & 2) != 0) {
this->spriteSettings.b.flipX = 1;
}
sub_0806B96C(this);
InitAnimationForceUpdate(this, 0);
break;
case 3:
this->actionDelay = 1;
this->field_0xf = 0x20;
entity = CreateNPC(VAATI_REBORN, 4, 0);
if (entity != NULL) {
CopyPosition(this, entity);
entity->parent = this;
entity->spritePriority.b0 = this->spritePriority.b0 - 1;
entity->frameIndex = 0;
}
entity = CreateNPC(VAATI_REBORN, 5, 0);
if (entity != NULL) {
CopyPosition(this, entity);
entity->parent = this;
entity->spritePriority.b0 = this->spritePriority.b0 + 1;
}
InitAnimationForceUpdate(this, 0);
break;
case 4:
InitializeAnimation(this, 0);
break;
default:
break;
}
}
void VaatiRebornAction1(Entity* this) {
Entity* entity;
if (CheckRoomFlag(3) == 0) {
return;
}
switch (this->type) {
case 0:
this->y.HALF.HI++;
if (--this->actionDelay == 0) {
entity = CreateNPC(VAATI_REBORN, 3, 0);
if (entity == NULL) {
break;
}
CopyPosition(this, entity);
TextboxNoOverlapFollow(0x1634);
this->subAction = this->subAction + 1;
DeleteThisEntity();
return;
}
if (this->field_0xf-- == 1) {
this->field_0xf = 0x20;
SoundReq(SFX_1A9);
}
UpdateAnimationSingleFrame(this);
break;
case 1:
entity = sub_0806B9BC(this);
if (entity == NULL) {
DeleteThisEntity();
}
PositionRelative(entity, this, 0, 0x210000);
UpdateAnimationSingleFrame(this);
break;
case 2:
sub_0806B96C(this);
UpdateAnimationSingleFrame(this);
break;
case 3:
switch (this->subAction) {
case 0:
if (--this->actionDelay == 0) {
this->subAction += 1;
}
break;
case 1:
if (this->frames.b.f3 != 0) {
this->subAction = 2;
sub_0801D2B4(this, 0x13f);
InitAnimationForceUpdate(this, this->subAction - 1);
}
break;
case 2:
if ((this->frames.all & 0x10) != 0) {
this->frames.all &= 0xef;
switch (++this->actionDelay) {
case 1:
break;
case 10:
this->subAction++;
EnqueueSFX(SFX_SUMMON);
this->actionDelay = 0;
InitAnimationForceUpdate(this, this->subAction - 1);
break;
}
}
break;
case 3:
if (this->frames.b.f3 != 0) {
SetRoomFlag(0);
DeleteThisEntity();
}
break;
}
if (--this->field_0xf == 0) {
this->field_0xf = 0x20;
SoundReq(SFX_1A9);
}
UpdateAnimationSingleFrame(this);
break;
default:
entity = sub_0806B9BC(this);
if (entity == NULL) {
DeleteThisEntity();
break;
}
if (entity->subAction == 0) {
break;
}
if (this->type != 4) {
UpdateAnimationSingleFrame(this);
} else {
GetNextFrame(this);
}
break;
}
}
void sub_0806B96C(Entity* this) {
Entity* entity;
const xy* ptr;
entity = sub_0806B9BC(this);
if (entity == NULL) {
DeleteThisEntity();
}
ptr = &gUnk_08112F80[this->type2];
this->spriteSettings.b.draw = entity->spriteSettings.b.draw;
PositionRelative(entity, this, ptr->x << 0x10, (ptr->y + 0x21) << 0x10);
UpdateAnimationSingleFrame(this);
}
Entity* sub_0806B9BC(Entity* this) {
Entity* entity;
entity = this->parent;
if (entity != NULL && entity->next == NULL) {
entity = NULL;
}
return entity;
}
+14
View File
@@ -0,0 +1,14 @@
#include "entity.h"
#include "room.h"
#include "player.h"
#include "coord.h"
void ObjectB5(Entity* this) {
if (this->action == 0) {
this->action = 1;
}
#ifndef EU
gRoomControls.cameraTarget = this;
#endif
PositionRelative(&gPlayerEntity, this, 0, -0x280000);
}