mirror of
https://github.com/zeldaret/tmc
synced 2026-06-17 07:08:05 -04:00
thumb interwork finished
This commit is contained in:
@@ -111,7 +111,8 @@ NODEP := 1
|
||||
endif
|
||||
|
||||
#$(C_BUILDDIR)/need_interworking_file_name.o: CFLAGS += -mthumb-interwork
|
||||
$(C_BUILDDIR)/arm_proxy.o: CFLAGS += -mthumb-interwork
|
||||
$(C_BUILDDIR)/interrupts.o: CFLAGS += -mthumb-interwork
|
||||
$(C_BUILDDIR)/collision.o: CFLAGS += -mthumb-interwork
|
||||
$(C_BUILDDIR)/gba/m4a.o: CFLAGS = -O2 -mthumb-interwork -Wimplicit -Wparentheses -Werror -Wno-multichar
|
||||
$(C_BUILDDIR)/eeprom.o: CFLAGS = -O1 -mthumb-interwork -Wimplicit -Wparentheses -Werror -Wno-multichar
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ EnemyUpdate: @ 0x080011C4
|
||||
bne _080011EA
|
||||
bl DeleteThisEntity
|
||||
_080011DC:
|
||||
bl sub_0805E3B0
|
||||
bl CheckDontUpdate
|
||||
cmp r0, #0
|
||||
bne _0800120A
|
||||
adds r0, r4, #0
|
||||
|
||||
@@ -1,226 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_08016B30
|
||||
sub_08016B30: @ 0x08016B30
|
||||
bx lr
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_08016B34
|
||||
sub_08016B34: @ 0x08016B34
|
||||
ldr r1, _08016B54 @ =0x03007FFC
|
||||
ldr r0, _08016B58 @ =gIntrMain
|
||||
str r0, [r1]
|
||||
ldr r1, _08016B5C @ =0x04000004
|
||||
ldr r2, _08016B60 @ =0x00005028
|
||||
adds r0, r2, #0
|
||||
strh r0, [r1]
|
||||
ldr r1, _08016B64 @ =0x04000200
|
||||
ldr r2, _08016B68 @ =0x00002005
|
||||
adds r0, r2, #0
|
||||
strh r0, [r1]
|
||||
adds r1, #8
|
||||
movs r0, #1
|
||||
strh r0, [r1]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_08016B54: .4byte 0x03007FFC
|
||||
_08016B58: .4byte gIntrMain
|
||||
_08016B5C: .4byte 0x04000004
|
||||
_08016B60: .4byte 0x00005028
|
||||
_08016B64: .4byte 0x04000200
|
||||
_08016B68: .4byte 0x00002005
|
||||
|
||||
thumb_func_start sub_08016B6C
|
||||
sub_08016B6C: @ 0x08016B6C
|
||||
push {r4, r5, lr}
|
||||
ldr r4, _08016BBC @ =0x040000B0
|
||||
ldrh r1, [r4, #0xa]
|
||||
ldr r0, _08016BC0 @ =0x0000C5FF
|
||||
ands r0, r1
|
||||
strh r0, [r4, #0xa]
|
||||
ldrh r1, [r4, #0xa]
|
||||
ldr r0, _08016BC4 @ =0x00007FFF
|
||||
ands r0, r1
|
||||
strh r0, [r4, #0xa]
|
||||
ldrh r0, [r4, #0xa]
|
||||
bl m4aSoundVSync
|
||||
ldr r5, _08016BC8 @ =gMain
|
||||
ldrb r0, [r5]
|
||||
cmp r0, #0
|
||||
bne _08016BA6
|
||||
bl DispCtrlSet
|
||||
ldr r0, _08016BCC @ =gUnk_03000FBC
|
||||
str r0, [r4]
|
||||
ldr r0, _08016BD0 @ =gUnk_02022730
|
||||
str r0, [r4, #4]
|
||||
ldr r0, _08016BD4 @ =0x84000004
|
||||
str r0, [r4, #8]
|
||||
ldr r0, [r4, #8]
|
||||
ldrb r0, [r5]
|
||||
movs r0, #1
|
||||
strb r0, [r5]
|
||||
_08016BA6:
|
||||
bl sub_08016BF8
|
||||
ldr r0, _08016BD8 @ =0x03007FF8
|
||||
ldrh r1, [r0]
|
||||
movs r2, #1
|
||||
orrs r1, r2
|
||||
strh r1, [r0]
|
||||
pop {r4, r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08016BBC: .4byte 0x040000B0
|
||||
_08016BC0: .4byte 0x0000C5FF
|
||||
_08016BC4: .4byte 0x00007FFF
|
||||
_08016BC8: .4byte gMain
|
||||
_08016BCC: .4byte gUnk_03000FBC
|
||||
_08016BD0: .4byte gUnk_02022730
|
||||
_08016BD4: .4byte 0x84000004
|
||||
_08016BD8: .4byte 0x03007FF8
|
||||
|
||||
thumb_func_start HBlankIntr
|
||||
HBlankIntr: @ 0x08016BDC
|
||||
push {lr}
|
||||
ldr r1, _08016BF0 @ =0x04000004
|
||||
ldr r2, _08016BF4 @ =0x00005028
|
||||
adds r0, r2, #0
|
||||
strh r0, [r1]
|
||||
bl m4aSoundMain
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08016BF0: .4byte 0x04000004
|
||||
_08016BF4: .4byte 0x00005028
|
||||
|
||||
thumb_func_start sub_08016BF8
|
||||
sub_08016BF8: @ 0x08016BF8
|
||||
push {lr}
|
||||
ldr r1, _08016C30 @ =gUnk_02022730
|
||||
ldrb r0, [r1]
|
||||
cmp r0, #0
|
||||
beq _08016C2C
|
||||
ldr r3, [r1, #4]
|
||||
ldr r2, [r1, #8]
|
||||
ldr r1, [r1, #0xc]
|
||||
ldr r0, _08016C34 @ =0x040000B0
|
||||
str r3, [r0]
|
||||
str r2, [r0, #4]
|
||||
str r1, [r0, #8]
|
||||
ldr r0, [r0, #8]
|
||||
ldr r0, _08016C38 @ =0x00003FFF
|
||||
ands r1, r0
|
||||
cmp r1, #0
|
||||
bne _08016C1E
|
||||
movs r1, #0x80
|
||||
lsls r1, r1, #7
|
||||
_08016C1E:
|
||||
ldrh r0, [r3]
|
||||
strh r0, [r2]
|
||||
adds r3, #2
|
||||
adds r2, #2
|
||||
subs r1, #1
|
||||
cmp r1, #0
|
||||
bgt _08016C1E
|
||||
_08016C2C:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08016C30: .4byte gUnk_02022730
|
||||
_08016C34: .4byte 0x040000B0
|
||||
_08016C38: .4byte 0x00003FFF
|
||||
|
||||
thumb_func_start UpdateDisplayControls
|
||||
UpdateDisplayControls: @ 0x08016C3C
|
||||
push {r4, lr}
|
||||
ldr r2, _08016C94 @ =gUnk_03000000
|
||||
ldrb r0, [r2]
|
||||
cmp r0, #0
|
||||
beq _08016C6C
|
||||
ldr r0, _08016C98 @ =gScreen
|
||||
ldrh r1, [r0]
|
||||
movs r0, #0x80
|
||||
lsls r0, r0, #5
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _08016C6C
|
||||
movs r0, #0
|
||||
strb r0, [r2]
|
||||
ldr r1, _08016C9C @ =0x040000D4
|
||||
adds r0, r2, #0
|
||||
adds r0, #0x20
|
||||
str r0, [r1]
|
||||
movs r0, #0xe0
|
||||
lsls r0, r0, #0x13
|
||||
str r0, [r1, #4]
|
||||
ldr r0, _08016CA0 @ =0x84000100
|
||||
str r0, [r1, #8]
|
||||
ldr r0, [r1, #8]
|
||||
_08016C6C:
|
||||
ldr r4, _08016CA4 @ =gBG0Settings
|
||||
adds r0, r4, #0
|
||||
bl sub_08016CA8
|
||||
adds r0, r4, #0
|
||||
adds r0, #0xc
|
||||
bl sub_08016CA8
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x18
|
||||
bl sub_08016CA8
|
||||
adds r4, #0x24
|
||||
adds r0, r4, #0
|
||||
bl sub_08016CA8
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08016C94: .4byte gUnk_03000000
|
||||
_08016C98: .4byte gScreen
|
||||
_08016C9C: .4byte 0x040000D4
|
||||
_08016CA0: .4byte 0x84000100
|
||||
_08016CA4: .4byte gBG0Settings
|
||||
|
||||
thumb_func_start sub_08016CA8
|
||||
sub_08016CA8: @ 0x08016CA8
|
||||
push {lr}
|
||||
adds r1, r0, #0
|
||||
ldrh r0, [r1, #6]
|
||||
cmp r0, #0
|
||||
beq _08016CE8
|
||||
ldr r2, [r1, #8]
|
||||
cmp r2, #0
|
||||
beq _08016CE8
|
||||
movs r0, #0
|
||||
strh r0, [r1, #6]
|
||||
ldrh r1, [r1]
|
||||
ldr r3, _08016CEC @ =0x040000D4
|
||||
str r2, [r3]
|
||||
lsls r0, r1, #3
|
||||
movs r2, #0xf8
|
||||
lsls r2, r2, #8
|
||||
ands r0, r2
|
||||
movs r2, #0xc0
|
||||
lsls r2, r2, #0x13
|
||||
adds r0, r0, r2
|
||||
str r0, [r3, #4]
|
||||
ldr r0, _08016CF0 @ =gUnk_080B2CD8
|
||||
lsrs r1, r1, #0xe
|
||||
lsls r1, r1, #1
|
||||
adds r1, r1, r0
|
||||
ldrh r0, [r1]
|
||||
lsrs r0, r0, #2
|
||||
movs r1, #0x84
|
||||
lsls r1, r1, #0x18
|
||||
orrs r0, r1
|
||||
str r0, [r3, #8]
|
||||
ldr r0, [r3, #8]
|
||||
_08016CE8:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08016CEC: .4byte 0x040000D4
|
||||
_08016CF0: .4byte gUnk_080B2CD8
|
||||
-1730
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -58,8 +58,8 @@ _0806EC6E:
|
||||
.align 2, 0
|
||||
_0806EC74: .4byte gUnk_08114AE4
|
||||
|
||||
thumb_func_start sub_0806EC78
|
||||
sub_0806EC78: @ 0x0806EC78
|
||||
thumb_func_start InitNPC
|
||||
InitNPC: @ 0x0806EC78
|
||||
push {r4, r5, lr}
|
||||
adds r4, r0, #0
|
||||
ldrb r1, [r4, #0x10]
|
||||
|
||||
+1
-1
@@ -625,7 +625,7 @@ _080800C6:
|
||||
bne _080800FC
|
||||
movs r0, #3
|
||||
strb r0, [r5, #3]
|
||||
bl sub_0805E9F4
|
||||
bl DeleteSleepingEntities
|
||||
bl sub_0807C810
|
||||
ldr r1, _080800F4 @ =gUnk_08109194
|
||||
ldr r0, _080800F8 @ =gUnk_03004030
|
||||
|
||||
+1
-1
@@ -1263,7 +1263,7 @@ _080A4550:
|
||||
cmp r0, #7
|
||||
bne _080A456A
|
||||
adds r0, r4, #0
|
||||
bl sub_0806EC78
|
||||
bl InitNPC
|
||||
ldrb r0, [r4, #9]
|
||||
strb r0, [r4, #0xf]
|
||||
movs r0, #0x56
|
||||
|
||||
@@ -1,12 +1,4 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start DispCtrlSet
|
||||
DispCtrlSet: @ 0x08016CF4
|
||||
ldr r3, _08016DF0 @ =gScreen
|
||||
ldrh r1, [r3]
|
||||
ldrh r0, [r3, #6]
|
||||
@@ -136,3 +128,4 @@ DispCtrlSet: @ 0x08016CF4
|
||||
.align 2, 0
|
||||
_08016DF0: .4byte gScreen
|
||||
_08016DF4: .4byte 0x04000020
|
||||
.syntax divided
|
||||
+2
-2
@@ -242,7 +242,7 @@ _0805173E:
|
||||
adds r0, r2, #0
|
||||
bl SoundReq
|
||||
_08051796:
|
||||
bl sub_0805E9F4
|
||||
bl DeleteSleepingEntities
|
||||
bl sub_0805BC04
|
||||
adds r4, r0, #0
|
||||
cmp r4, #0
|
||||
@@ -324,7 +324,7 @@ _08051B02:
|
||||
adds r0, r2, #0
|
||||
bl SoundReq
|
||||
_08051B5A:
|
||||
bl sub_0805E9F4
|
||||
bl DeleteSleepingEntities
|
||||
bl sub_0805BC04
|
||||
adds r4, r0, #0
|
||||
cmp r4, #0
|
||||
|
||||
+12
-10
@@ -268,8 +268,8 @@ UpdateCollision: @ 0x080B1C54
|
||||
strb r1, [r3]
|
||||
bx lr
|
||||
|
||||
arm_func_start sub_080B1C7C
|
||||
sub_080B1C7C: @ 0x080B1C7C
|
||||
arm_func_start CollideAll
|
||||
CollideAll: @ 0x080B1C7C
|
||||
push {r4, r5, r6, r7, r8, sb, sl, lr}
|
||||
add r0, pc, #0x104 @ =_080B1D8C
|
||||
ldm r0, {r8, sb, sl}
|
||||
@@ -314,7 +314,7 @@ _080B1CC8:
|
||||
orrs r0, r0, r2
|
||||
bne _080B1CC8
|
||||
_080B1D20:
|
||||
bl sub_080B1D98
|
||||
bl CalcCollision
|
||||
cmp r0, #0
|
||||
beq _080B1CC8
|
||||
ldrb r3, [r4, #0x3c]
|
||||
@@ -348,8 +348,10 @@ _080B1D8C: .4byte gUnk_02018EA0
|
||||
_080B1D90: .4byte gCollidableList
|
||||
_080B1D94: .4byte gCollidableCount
|
||||
|
||||
arm_func_start sub_080B1D98
|
||||
sub_080B1D98: @ 0x080B1D98
|
||||
arm_func_start CalcCollision
|
||||
CalcCollision: @ 0x080B1D98
|
||||
@ r6 = this, r7 = other
|
||||
|
||||
push {r2, r3, r6, r7, r8, sb, ip, lr}
|
||||
ldr r6, [r4, #0x48]
|
||||
ldr r7, [r5, #0x48]
|
||||
@@ -408,7 +410,7 @@ sub_080B1D98: @ 0x080B1D98
|
||||
_080B1E74:
|
||||
mov r2, #0
|
||||
mov ip, #0
|
||||
bl sub_080B237C
|
||||
bl CalcCollisionDirection
|
||||
mov r6, r0
|
||||
ldrb r1, [r5, #0x3f]
|
||||
mov r0, #0x22
|
||||
@@ -417,7 +419,7 @@ _080B1E74:
|
||||
add r0, r0, r1
|
||||
mov r1, #0xc
|
||||
mul r2, r0, r1
|
||||
ldr r1, _080B2014 @ =gUnk_080B7B74
|
||||
ldr r1, _080B2014 @ =gCollisionMtx
|
||||
add r3, r2, r1
|
||||
mov r1, #0
|
||||
ldrb r0, [r3]
|
||||
@@ -532,7 +534,7 @@ _080B2004: .4byte gUnk_03005D18
|
||||
_080B2008: .4byte gUnk_03005D58
|
||||
_080B200C: .4byte gCollidableList
|
||||
_080B2010: .4byte gCollidableCount
|
||||
_080B2014: .4byte gUnk_080B7B74
|
||||
_080B2014: .4byte gCollisionMtx
|
||||
_080B2018: .4byte gUnk_080B3744
|
||||
|
||||
arm_func_start IntrMain
|
||||
@@ -796,8 +798,8 @@ _080B236C:
|
||||
.align 2, 0
|
||||
_080B2378: .4byte sub_080044AE
|
||||
|
||||
arm_func_start sub_080B237C
|
||||
sub_080B237C: @ 0x080B237C
|
||||
arm_func_start CalcCollisionDirection
|
||||
CalcCollisionDirection: @ 0x080B237C
|
||||
subs r2, r2, r0
|
||||
movpl r0, #0
|
||||
movmi r0, #0x20
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
@@ -23,10 +23,10 @@ _08017550:
|
||||
cmp r0, #0
|
||||
bne _08017566
|
||||
adds r0, r4, #0
|
||||
bl sub_0806EC78
|
||||
bl InitNPC
|
||||
_08017566:
|
||||
adds r0, r4, #0
|
||||
bl sub_0805E3B0
|
||||
bl CheckDontUpdate
|
||||
cmp r0, #0
|
||||
bne _08017584
|
||||
ldr r2, _080175DC @ =gNPCFunctions
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
.syntax unified
|
||||
push {r4, r5, lr}
|
||||
adds r4, r0, #0
|
||||
adds r3, r1, #0
|
||||
movs r5, #0x10
|
||||
eors r2, r5
|
||||
adds r0, r2, #0
|
||||
subs r0, #0xc
|
||||
movs r2, #0x1f
|
||||
ands r0, r2
|
||||
ldrb r1, [r3, #0x15]
|
||||
subs r1, r1, r0
|
||||
ands r1, r2
|
||||
cmp r1, #0x18
|
||||
bhi _08017CF0
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x3d
|
||||
movs r0, #0xf4
|
||||
strb r0, [r1]
|
||||
adds r1, r3, #0
|
||||
adds r1, #0x3d
|
||||
strb r0, [r1]
|
||||
adds r0, r4, #0
|
||||
adds r1, r3, #0
|
||||
bl sub_08017940
|
||||
b _08017D1E
|
||||
_08017CF0:
|
||||
adds r1, r3, #0
|
||||
adds r1, #0x42
|
||||
movs r0, #0xc
|
||||
strb r0, [r1]
|
||||
adds r0, r3, #0
|
||||
adds r0, #0x3d
|
||||
strb r5, [r0]
|
||||
adds r1, #1
|
||||
movs r0, #0xf0
|
||||
strb r0, [r1]
|
||||
adds r1, #3
|
||||
movs r0, #0xc0
|
||||
lsls r0, r0, #2
|
||||
strh r0, [r1]
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x3d
|
||||
ldrb r2, [r1]
|
||||
movs r0, #0
|
||||
ldrsb r0, [r1, r0]
|
||||
cmp r0, #0
|
||||
bne _08017D1E
|
||||
movs r0, #0xff
|
||||
strb r0, [r1]
|
||||
_08017D1E:
|
||||
movs r0, #1
|
||||
pop {r4, r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.align 2, 0
|
||||
.syntax divided
|
||||
@@ -0,0 +1,75 @@
|
||||
.syntax unified
|
||||
push {r4, r5, r6, lr}
|
||||
adds r4, r0, #0
|
||||
adds r5, r1, #0
|
||||
adds r6, r2, #0
|
||||
ldrb r0, [r4, #8]
|
||||
cmp r0, #1
|
||||
bne _08018058
|
||||
bl sub_08079F8C
|
||||
cmp r0, #0
|
||||
beq _08018090
|
||||
movs r0, #0x10
|
||||
eors r0, r6
|
||||
ldrb r1, [r5, #0x14]
|
||||
lsls r1, r1, #2
|
||||
subs r0, r0, r1
|
||||
adds r0, #5
|
||||
movs r1, #0x1f
|
||||
ands r0, r1
|
||||
cmp r0, #0xa
|
||||
bhi _08018090
|
||||
b _0801807A
|
||||
_08018058:
|
||||
cmp r0, #8
|
||||
bne _08018086
|
||||
ldrb r0, [r4, #0x15]
|
||||
movs r1, #0x10
|
||||
eors r1, r0
|
||||
ldrb r0, [r5, #0x14]
|
||||
lsls r0, r0, #2
|
||||
subs r1, r1, r0
|
||||
adds r1, #5
|
||||
movs r0, #0x1f
|
||||
ands r1, r0
|
||||
cmp r1, #0xa
|
||||
bgt _08018090
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x45
|
||||
movs r0, #0
|
||||
strb r0, [r1]
|
||||
_0801807A:
|
||||
adds r0, r4, #0
|
||||
adds r1, r5, #0
|
||||
bl sub_080180BC
|
||||
movs r0, #1
|
||||
b _080180AE
|
||||
_08018086:
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x45
|
||||
movs r0, #0
|
||||
strb r0, [r1]
|
||||
b _080180AE
|
||||
_08018090:
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x40
|
||||
ldrb r0, [r0]
|
||||
ldr r1, _080180B4 @ =0x000011AA
|
||||
adds r0, r0, r1
|
||||
lsls r3, r0, #1
|
||||
adds r3, r3, r0
|
||||
lsls r3, r3, #2
|
||||
ldr r0, _080180B8 @ =gCollisionMtx
|
||||
adds r3, r3, r0
|
||||
adds r0, r4, #0
|
||||
adds r1, r5, #0
|
||||
adds r2, r6, #0
|
||||
bl sub_08018308
|
||||
_080180AE:
|
||||
pop {r4, r5, r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.align 2, 0
|
||||
_080180B4: .4byte 0x000011AA
|
||||
_080180B8: .4byte gCollisionMtx
|
||||
.syntax divided
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
Object11: @ 0x08084D34
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
bl sub_0805E3B0
|
||||
bl CheckDontUpdate
|
||||
cmp r0, #0
|
||||
bne _08084D50
|
||||
ldr r0, _08084D54 @ =gUnk_0812057C
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
Object1E: @ 0x08087504
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
bl sub_0805E3B0
|
||||
bl CheckDontUpdate
|
||||
cmp r0, #0
|
||||
bne _08087520
|
||||
ldr r0, _08087524 @ =gUnk_081208B8
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ ProjectileUpdate: @ 0x08016AE4
|
||||
bne _08016B0A
|
||||
bl DeleteThisEntity
|
||||
_08016AFC:
|
||||
bl sub_0805E3B0
|
||||
bl CheckDontUpdate
|
||||
cmp r0, #0
|
||||
bne _08016B22
|
||||
adds r0, r4, #0
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_080A2838
|
||||
sub_080A2838: @ 0x080A2838
|
||||
thumb_func_start InitObject
|
||||
InitObject: @ 0x080A2838
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
ldrb r2, [r4, #9]
|
||||
|
||||
+13
-13
@@ -5,20 +5,20 @@
|
||||
.align 2
|
||||
|
||||
gUnk_080B2A70:: @ 080B2A70
|
||||
.4byte sub_08016B30
|
||||
.4byte sub_08016B30
|
||||
.4byte sub_08016B30
|
||||
.4byte DummyIntr
|
||||
.4byte DummyIntr
|
||||
.4byte DummyIntr
|
||||
.4byte HBlankIntr
|
||||
.4byte sub_08016B6C
|
||||
.4byte sub_08016B30
|
||||
.4byte sub_08016B30
|
||||
.4byte sub_08016B30
|
||||
.4byte sub_08016B30
|
||||
.4byte sub_08016B30
|
||||
.4byte sub_08016B30
|
||||
.4byte sub_08016B30
|
||||
.4byte sub_08016B30
|
||||
.4byte sub_08016B30
|
||||
.4byte VBlankIntr
|
||||
.4byte DummyIntr
|
||||
.4byte DummyIntr
|
||||
.4byte DummyIntr
|
||||
.4byte DummyIntr
|
||||
.4byte DummyIntr
|
||||
.4byte DummyIntr
|
||||
.4byte DummyIntr
|
||||
.4byte DummyIntr
|
||||
.4byte DummyIntr
|
||||
|
||||
|
||||
@ TODO contains some pointers to iwram
|
||||
|
||||
@@ -9,9 +9,9 @@ gUnk_080B3740:: @ 080B3740
|
||||
|
||||
gUnk_080B3744:: @ 080B3744
|
||||
.4byte sub_08018308
|
||||
.4byte sub_08017AD8
|
||||
.4byte sub_08017AD8
|
||||
.4byte sub_08017ADC
|
||||
.4byte CollisionNoOp
|
||||
.4byte CollisionNoOp
|
||||
.4byte CollisionGroundItem
|
||||
.4byte sub_08017B58
|
||||
.4byte sub_08017EB0
|
||||
.4byte sub_08017F3C
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
.section .rodata
|
||||
.align 2
|
||||
|
||||
gUnk_080B7B74:: @ 080B7B74
|
||||
gCollisionMtx:: @ 080B7B74
|
||||
.incbin "baserom.gba", 0x0B7B74, 0x00004BA
|
||||
|
||||
gUnk_080B802E:: @ 080B802E
|
||||
|
||||
+24
-12
@@ -42,17 +42,17 @@ typedef struct {
|
||||
typedef struct Entity {
|
||||
/*0x00*/ struct Entity* prev;
|
||||
/*0x04*/ struct Entity* next;
|
||||
/*0x08*/ u8 kind; // was: type
|
||||
/*0x09*/ u8 id; // was: subtype
|
||||
/*0x0a*/ u8 type; // was: form
|
||||
/*0x0b*/ u8 type2; // was: parameter
|
||||
/*0x08*/ u8 kind;
|
||||
/*0x09*/ u8 id;
|
||||
/*0x0a*/ u8 type;
|
||||
/*0x0b*/ u8 type2;
|
||||
/*0x0c*/ u8 action;
|
||||
/*0x0d*/ u8 subAction;
|
||||
/*0x0e*/ u8 actionDelay;
|
||||
/*0x0f*/ u8 field_0xf;
|
||||
/*0x10*/ u8 flags;
|
||||
/*0x11*/ u8 scriptedScene : 4;
|
||||
/* */ u8 scriptedScene2 : 4;
|
||||
/*0x11*/ u8 updateConditions : 4; // should we update this sprite during pause
|
||||
/* */ u8 updateConditions2 : 4;
|
||||
/*0x12*/ s16 spriteIndex;
|
||||
/*0x14*/ u8 animationState;
|
||||
/*0x15*/ u8 direction;
|
||||
@@ -110,12 +110,12 @@ typedef struct Entity {
|
||||
/*0x3c*/ u8 field_0x3c;
|
||||
/*0x3d*/ s8 iframes;
|
||||
/*0x3e*/ u8 knockbackDirection;
|
||||
/*0x3f*/ u8 damageType;
|
||||
/*0x40*/ u8 field_0x40;
|
||||
/*0x3f*/ u8 hitType; // behavior as a collision sender
|
||||
/*0x40*/ u8 hurtType; // behavior as a collision reciever
|
||||
/*0x41*/ u8 bitfield;
|
||||
/*0x42*/ u8 knockbackDuration;
|
||||
/*0x43*/ u8 field_0x43;
|
||||
/*0x44*/ u8 field_0x44;
|
||||
/*0x44*/ u8 damage;
|
||||
/*0x45*/ u8 currentHealth;
|
||||
/*0x46*/ u16 field_0x46;
|
||||
/*0x48*/ Hitbox* hitbox;
|
||||
@@ -165,9 +165,20 @@ extern LinkedList gUnk_03003D90;
|
||||
|
||||
extern LinkedList gUnk_03003DA0;
|
||||
|
||||
enum {
|
||||
ENT_DID_INIT = 0x1,
|
||||
ENT_SCRIPTED = 0x2,
|
||||
ENT_ASLEEP = 0x10,
|
||||
ENT_20 = 0x20,
|
||||
ENT_COLLIDE = 0x80,
|
||||
};
|
||||
|
||||
#define COLLISION_OFF(entity) ((entity)->flags &= ~ENT_COLLIDE)
|
||||
#define COLLISION_ON(entity) ((entity)->flags |= ENT_COLLIDE)
|
||||
|
||||
#define TILE(x, y) \
|
||||
(((((x) - gRoomControls.roomOriginX) >> 4) & 0x3fU) | \
|
||||
((((y) - gRoomControls.roomOriginY) >> 4) & 0x3fU) << 6)
|
||||
(((((x) - gRoomControls.roomOriginX) >> 4) & 0x3F) | \
|
||||
((((y) - gRoomControls.roomOriginY) >> 4) & 0x3F) << 6)
|
||||
|
||||
#define COORD_TO_TILE(entity) \
|
||||
TILE((entity)->x.HALF.HI, (entity)->y.HALF.HI)
|
||||
@@ -186,9 +197,10 @@ enum {
|
||||
#define DirectionRoundUp(expr) DirectionRound((expr) + 4)
|
||||
#define DirectionIsHorizontal(expr) ((expr) & 0x08)
|
||||
#define DirectionIsVertical(expr) ((expr) & 0x10)
|
||||
#define DirectionTurnAround(expr) (DirectionRoundUp(expr) ^ 0x10)
|
||||
#define DirectionTurnAround(expr) ((expr) ^ 0x10)
|
||||
#define DirectionToAnimationState(expr) (DirectionRoundUp(expr) >> 3)
|
||||
#define DirectionFromAnimationState(expr) ((expr) << 3)
|
||||
#define DirectionNormalize(expr) ((expr) & 0x1f)
|
||||
|
||||
#define Direction8Round(expr) ((expr) & 0x1c)
|
||||
#define Direction8RoundUp(expr) Direction8Round((expr) + 2)
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ extern void sub_0804FF84(u32);
|
||||
extern u16 gPaletteBuffer[];
|
||||
extern void VBlankInterruptWait(void);
|
||||
extern void DisableInterruptsAndDMA(void);
|
||||
extern void sub_08016B34(void);
|
||||
extern void EnableVBlankIntr(void);
|
||||
|
||||
static void sub_08055F70(void);
|
||||
static bool32 SoftResetKeysPressed(void);
|
||||
|
||||
+5
-1
@@ -92,7 +92,7 @@ typedef struct {
|
||||
/* */ u8 swordBlueParticle : 1;
|
||||
/* */ u8 filler14 : 6;
|
||||
/*0x3f*/ u8 field_0x3f;
|
||||
/*0x40*/ u8 field_0x40[64];
|
||||
/*0x40*/ u8 hurtType[64];
|
||||
/*0x80*/ u16 field_0x80;
|
||||
/*0x82*/ u8 field_0x82[9];
|
||||
/*0x8b*/ u8 field_0x8b;
|
||||
@@ -161,6 +161,10 @@ extern Entity gPlayerEntity;
|
||||
extern u32 GetInventoryValue(u32);
|
||||
extern s32 ModHealth(s32);
|
||||
extern void ModRupees(s32);
|
||||
|
||||
#define COPY_FLAG_FROM_TO(base, src, dest) (base) = ((base) & ~(dest)) | (((dest) * ((base) & (src))) / src)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
// clang-format on
|
||||
|
||||
@@ -61,7 +61,7 @@ typedef struct {
|
||||
u8 field_0x3c;
|
||||
u8 field_0x3d;
|
||||
u16 field_0x3e;
|
||||
u16 field_0x40;
|
||||
u16 hurtType;
|
||||
u16 field_0x42;
|
||||
u16 field_0x44;
|
||||
u16 field_0x46;
|
||||
|
||||
@@ -331,10 +331,8 @@ SECTIONS {
|
||||
|
||||
|
||||
/* C source compiled with interworking */
|
||||
asm/code_08016B30.o(.text);
|
||||
asm/updateBackgroundRegisters.o(.text);
|
||||
src/arm_proxy.o(.text);
|
||||
asm/code_08016DF8.o(.text);
|
||||
src/interrupts.o(.text);
|
||||
src/collision.o(.text);
|
||||
/* C source compiled without interworking */
|
||||
asm/code_08018500.o(.text);
|
||||
src/code_08018C58.o(.text);
|
||||
@@ -757,7 +755,6 @@ SECTIONS {
|
||||
asm/object36.o(.text);
|
||||
asm/object37.o(.text);
|
||||
src/object/jarPortal.o(.text);
|
||||
asm/jarPortal.o(.text);
|
||||
asm/bossDoor.o(.text);
|
||||
asm/object3A.o(.text);
|
||||
asm/macroMushroomStalks.o(.text);
|
||||
|
||||
+714
@@ -0,0 +1,714 @@
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "player.h"
|
||||
#include "save.h"
|
||||
#include "random.h"
|
||||
#include "utils.h"
|
||||
#include "functions.h"
|
||||
#include "enemy.h"
|
||||
#include "effects.h"
|
||||
|
||||
extern u8 gCollidableCount;
|
||||
extern u8 gUnk_080B3740[];
|
||||
|
||||
typedef struct {
|
||||
u8 _0;
|
||||
u8 _1;
|
||||
u8 _2;
|
||||
u8 _3;
|
||||
u8 _4;
|
||||
u8 _5;
|
||||
s8 _6;
|
||||
u8 _7;
|
||||
u8 _8;
|
||||
u8 _9;
|
||||
u8 _a;
|
||||
u8 _b;
|
||||
} ColSettings;
|
||||
|
||||
extern ColSettings gCollisionMtx[173 * 34];
|
||||
|
||||
extern void gDoCollision(void);
|
||||
u32 sub_08081420(Entity*);
|
||||
extern void sub_0800449C(Entity*, u32);
|
||||
s32 sub_08018308(Entity*, Entity*, u32, ColSettings*);
|
||||
void sub_08079D84(void);
|
||||
void sub_080180BC(Entity*, Entity*);
|
||||
void sub_0807AFE8(void);
|
||||
|
||||
typedef struct {
|
||||
void* last;
|
||||
void* first;
|
||||
void* node;
|
||||
u8 flags;
|
||||
} LinkedList2;
|
||||
|
||||
extern LinkedList2 gUnk_03003C70[16];
|
||||
extern LinkedList2* gUnk_02018EA0;
|
||||
|
||||
void ClearHitboxList(void) {
|
||||
gCollidableCount = 0;
|
||||
}
|
||||
|
||||
void CollisionMain(void) {
|
||||
void (*doCollision)(void);
|
||||
u32 temp;
|
||||
|
||||
temp = gUnk_03003DC0.unk0;
|
||||
if (gUnk_03003DC0.unk0 <= gUnk_03003DC0.unk1)
|
||||
temp = gUnk_03003DC0.unk1;
|
||||
if (temp != 0)
|
||||
return;
|
||||
|
||||
doCollision = &gDoCollision;
|
||||
// Check to see if we should disable collision this frame
|
||||
if (gPlayerState.field_0x8b != 0) {
|
||||
u32 flags = gPlayerEntity.flags;
|
||||
COLLISION_OFF(&gPlayerEntity);
|
||||
doCollision();
|
||||
gPlayerEntity.flags = flags; // reset collision to before
|
||||
} else {
|
||||
doCollision();
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterPlayerHitbox(void) {
|
||||
MemClear(&gUnk_03003C70, sizeof(gUnk_03003C70));
|
||||
gUnk_02018EA0 = (LinkedList2*)&gUnk_03003C70[0].last;
|
||||
gUnk_03003C70[0].last = &gUnk_03003C70[0].last;
|
||||
gUnk_03003C70[0].first = &gUnk_03003C70[0].last;
|
||||
gUnk_03003C70[0].node = &gPlayerEntity;
|
||||
}
|
||||
|
||||
// Loop declaration seems wrong
|
||||
NONMATCH("asm/non_matching/arm_proxy/sub_0801766C.inc", u32 sub_0801766C(Entity* this)) {
|
||||
u32 uVar1;
|
||||
LinkedList2* puVar3;
|
||||
LinkedList2* puVar2;
|
||||
LinkedList2* pLVar2;
|
||||
LinkedList2* i;
|
||||
u8* pbVar4;
|
||||
|
||||
if (this->spritePriority.b2 != 0) {
|
||||
return 1;
|
||||
} else {
|
||||
for (i = &gUnk_03003C70[0]; i < &gUnk_03003C70[16]; ++i) {
|
||||
if (i->node == NULL) {
|
||||
i->node = this;
|
||||
i->flags = 0;
|
||||
this->spritePriority.b2 = 1;
|
||||
pLVar2 = gUnk_02018EA0;
|
||||
if (gUnk_02018EA0->flags != 0) {
|
||||
do {
|
||||
pLVar2 = pLVar2->first;
|
||||
} while (pLVar2->flags != 0);
|
||||
i->first = pLVar2;
|
||||
puVar3 = pLVar2->last;
|
||||
i->last = puVar3;
|
||||
puVar3->first = i;
|
||||
pLVar2->last = i;
|
||||
} else {
|
||||
i->first = gUnk_02018EA0;
|
||||
puVar2 = gUnk_02018EA0->last;
|
||||
i->last = puVar2;
|
||||
puVar2->first = i;
|
||||
gUnk_02018EA0->last = i;
|
||||
gUnk_02018EA0 = i;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
// same loop issue
|
||||
NONMATCH("asm/non_matching/arm_proxy/sub_080176E4.inc", u32 sub_080176E4(Entity* this)) {
|
||||
u32 uVar1;
|
||||
LinkedList2* j;
|
||||
LinkedList2* i;
|
||||
u8* pbVar4;
|
||||
|
||||
if (this->spritePriority.b2 != 0) {
|
||||
return 1;
|
||||
} else {
|
||||
for (i = &gUnk_03003C70[0]; i < &gUnk_03003C70[16]; ++i) {
|
||||
if (i->node == NULL) {
|
||||
i->node = this;
|
||||
i->flags = 1;
|
||||
this->spritePriority.b2 = 1;
|
||||
i->first = gUnk_02018EA0;
|
||||
j = gUnk_02018EA0->last;
|
||||
i->last = j;
|
||||
j->first = i;
|
||||
gUnk_02018EA0->last = i;
|
||||
gUnk_02018EA0 = i;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
// you guessed it
|
||||
NONMATCH("asm/non_matching/arm_proxy/sub_08017744.inc", void sub_08017744(Entity* this)) {
|
||||
LinkedList2* i;
|
||||
for (i = &gUnk_03003C70[0]; i < &gUnk_03003C70[16]; ++i) {
|
||||
if (i->node == this) {
|
||||
if (this->spritePriority.b2 != 0) {
|
||||
this->spritePriority.b2 = 0;
|
||||
i->node = NULL;
|
||||
((LinkedList2*)i->last)->first = i->first;
|
||||
((LinkedList2*)i->first)->last = i->last;
|
||||
if (i != gUnk_02018EA0)
|
||||
return;
|
||||
gUnk_02018EA0 = i->first;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
// regalloc
|
||||
NONMATCH("asm/non_matching/arm_proxy/sub_080177A0.inc", bool32 sub_080177A0(Entity* this, Entity* that)) {
|
||||
u32 this_d;
|
||||
u32 depth;
|
||||
|
||||
if ((that->collisionLayer & this->collisionLayer) != 0) {
|
||||
Hitbox* bb_this = this->hitbox;
|
||||
Hitbox* bb_that = that->hitbox;
|
||||
u32 this_w = bb_this->width;
|
||||
u32 that_w = bb_that->width;
|
||||
if ((((this->x.HALF.HI - that->x.HALF.HI) + bb_this->offset_x) - bb_that->offset_x) + this_w + that_w <=
|
||||
(this_w + that_w) * 2) {
|
||||
u32 this_h = bb_this->height;
|
||||
u32 that_h = bb_that->height;
|
||||
if ((((this->y.HALF.HI - that->y.HALF.HI) + bb_this->offset_y) - bb_that->offset_y) + this_h + that_h <=
|
||||
(this_h + that_h) * 2) {
|
||||
if ((this->field_0x3c & 0x10) != 0)
|
||||
this_d = ((Hitbox3D*)bb_this)->depth;
|
||||
else
|
||||
this_d = 5;
|
||||
if ((that->field_0x3c & 0x10) != 0)
|
||||
depth = this_d + ((Hitbox3D*)bb_that)->depth;
|
||||
else
|
||||
depth = this_d + 5;
|
||||
if ((this->height.HALF.HI - that->height.HALF.HI) + depth <= depth * 2)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
bool32 sub_08017850(Entity* this) {
|
||||
if (sub_08079F8C())
|
||||
return sub_080177A0(this, &gPlayerEntity);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 sub_08017874(Entity* a, Entity* b) {
|
||||
s32 newDmg;
|
||||
s32 v5;
|
||||
s32 v6;
|
||||
|
||||
asm("" ::: "r1");
|
||||
if (a->kind == 1) {
|
||||
newDmg = b->damage;
|
||||
switch (gSave.stats.charm) {
|
||||
case 47:
|
||||
newDmg /= 4;
|
||||
break;
|
||||
case 48:
|
||||
newDmg /= 2;
|
||||
break;
|
||||
}
|
||||
if (newDmg <= 0)
|
||||
newDmg = 1;
|
||||
v5 = ModHealth(-newDmg);
|
||||
sub_0800449C(a, 122);
|
||||
} else {
|
||||
v6 = b->damage;
|
||||
if (b->kind == 8) {
|
||||
switch (gSave.stats.charm) {
|
||||
case 48:
|
||||
v6 = 3 * v6 / 2;
|
||||
break;
|
||||
case 49:
|
||||
v6 *= 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
v5 = a->currentHealth - v6;
|
||||
if (a->kind == 3) {
|
||||
if ((a->field_0x6c.HALF.HI & 1) != 0)
|
||||
sub_0800449C(a, 295);
|
||||
else
|
||||
sub_0800449C(a, 254);
|
||||
}
|
||||
}
|
||||
if (v5 <= 0) {
|
||||
COLLISION_OFF(a);
|
||||
return 0;
|
||||
}
|
||||
return v5;
|
||||
}
|
||||
|
||||
void sub_08017940(Entity* org, Entity* tgt) {
|
||||
Entity* e;
|
||||
u32 r1;
|
||||
|
||||
e = CreateFx(tgt, FX_REFECT3, 0);
|
||||
if (e != NULL) {
|
||||
e->spritePriority.b0 = 2;
|
||||
e->x.HALF.HI = (org->x.HALF.HI + org->hitbox->offset_x + tgt->x.HALF.HI + tgt->hitbox->offset_x) >> 1;
|
||||
e->y.HALF.HI = (org->y.HALF.HI + org->hitbox->offset_y + tgt->y.HALF.HI + tgt->hitbox->offset_y) >> 1;
|
||||
e->height.HALF.HI = (org->height.HALF.HI + tgt->height.HALF.HI) >> 1;
|
||||
e->collisionLayer = org->collisionLayer;
|
||||
UpdateSpriteForCollisionLayer(e);
|
||||
}
|
||||
|
||||
r1 = 0;
|
||||
|
||||
r1 = (u32)(org == &gPlayerEntity ? gPlayerEntity.knockbackDuration
|
||||
: (tgt == &gPlayerEntity ? tgt->knockbackDuration : 0)) >>
|
||||
3;
|
||||
|
||||
// Anything requiring the evaluation of r1 could be written here.
|
||||
// The compiler is not smart enough to know that r1 has no side effects,
|
||||
// so the above code will still generate.
|
||||
r1 = !r1 ? !!r1 : !!!r1;
|
||||
}
|
||||
|
||||
void sub_080179EC(Entity* a1, Entity* a2) {
|
||||
u8* p = gUnk_080B3740;
|
||||
u32 rand = Random();
|
||||
Entity* e = CreateFx(a2, p[rand & 3], 0);
|
||||
if (e != NULL) {
|
||||
PositionRelative(a2, e, a2->hitbox->offset_x << 16, a2->hitbox->offset_y << 16);
|
||||
e->spritePriority.b0 = 2;
|
||||
e->spriteOffsetX = (a1->x.HALF.HI + a1->hitbox->offset_x - (a2->x.HALF.HI + a2->hitbox->offset_x)) >> 1;
|
||||
e->spriteOffsetY = (a1->y.HALF.HI + a1->hitbox->offset_y - (a2->y.HALF.HI + a2->hitbox->offset_y)) >> 1;
|
||||
e->attachedEntity = a2;
|
||||
}
|
||||
}
|
||||
|
||||
Entity* sub_08017A90(Entity* a1, Entity* parent) {
|
||||
Entity* e;
|
||||
|
||||
e = (Entity*)CreateObject(153, 0, 0);
|
||||
if (e != NULL) {
|
||||
e->animationState = (a1->direction >> 3) & 3;
|
||||
e->spriteOffsetX = a1->x.HALF.HI - parent->x.HALF.HI;
|
||||
e->spriteOffsetY = a1->y.HALF.HI - parent->y.HALF.HI;
|
||||
e->parent = parent;
|
||||
return e;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
u32 CollisionNoOp(Entity* org, Entity* tgt, u32 direction) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// origin: player or sword
|
||||
// target: item
|
||||
s32 CollisionGroundItem(Entity* org, Entity* tgt, u32 direction) {
|
||||
COLLISION_OFF(tgt);
|
||||
tgt->bitfield = org->hurtType | 0x80;
|
||||
if ((tgt->type == 0x5F || tgt->type == 0x60) && sub_08081420(tgt))
|
||||
tgt->currentHealth = 0;
|
||||
return 2;
|
||||
}
|
||||
|
||||
s32 sub_08017B1C(Entity* org, Entity* tgt, u32 direction) {
|
||||
if ((gPlayerState.field_0x1d[1] & 0x60) != 0) {
|
||||
COLLISION_OFF(tgt);
|
||||
} else {
|
||||
org->knockbackDuration = 0x10;
|
||||
org->iframes = -20;
|
||||
org->field_0x46 = 640;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08017B58(Entity* org, Entity* tgt, u32 direction) {
|
||||
if ((tgt->field_0x3a & 4) != 0) {
|
||||
if (tgt->field_0x1d) {
|
||||
s32 x = tgt->field_0x1d = tgt->field_0x1d - gPlayerState.field_0x1d[0];
|
||||
if (x << 24 <= 0) {
|
||||
tgt->field_0x1d = 0;
|
||||
tgt->subAction = 2;
|
||||
tgt->field_0x46 = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
tgt->subAction = 0;
|
||||
tgt->field_0x3a |= 4u;
|
||||
}
|
||||
if (tgt->iframes == 0)
|
||||
tgt->iframes = -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08017BBC(Entity* org, Entity* tgt, u32 direction) {
|
||||
if ((gPlayerState.flags & (0x1 | 0x80 | 0x400 | 0x1000)) == 0) {
|
||||
Entity* e = CreateObject(66, 1, 0);
|
||||
if (e != NULL) {
|
||||
e->attachedEntity = org;
|
||||
gPlayerState.flags |= 0x400;
|
||||
org->animationState = (direction ^ 0x10) >> 2;
|
||||
}
|
||||
}
|
||||
tgt->damage = 4;
|
||||
org->currentHealth = sub_08017874(org, tgt);
|
||||
org->knockbackDuration = 12;
|
||||
org->iframes = 30;
|
||||
org->field_0x46 = 384;
|
||||
if (tgt->iframes == 0)
|
||||
tgt->iframes = -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08017C40(Entity* org, Entity* tgt, u32 direction) {
|
||||
if ((gPlayerState.flags & (0x1 | 0x80 | 0x800 | 0x1000)) == 0 && gPlayerState.playerAction == 0) {
|
||||
if (org->action == 1 || org->action == 24) {
|
||||
tgt->damage = 4;
|
||||
org->currentHealth = sub_08017874(org, tgt);
|
||||
gPlayerState.flags = 0x800;
|
||||
gPlayerState.playerAction = 13;
|
||||
}
|
||||
}
|
||||
org->knockbackDuration = 12;
|
||||
org->iframes = 16;
|
||||
org->field_0x46 = 640;
|
||||
if (tgt->iframes == 0)
|
||||
tgt->iframes = -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/collision/sub_08017CBC.inc", s32 sub_08017CBC(Entity* org, Entity* tgt, u32 direction)) {
|
||||
if (((-(((direction ^ 0x10) - 0xc) & 0x1f) + tgt->direction) & 0x1f) < 0x19) {
|
||||
org->iframes = -12;
|
||||
tgt->iframes = -12;
|
||||
sub_08017940(org, tgt);
|
||||
} else {
|
||||
tgt->knockbackDuration = 12;
|
||||
tgt->iframes = 16;
|
||||
tgt->field_0x43 = -16;
|
||||
tgt->field_0x46 = 768;
|
||||
if (org->iframes == 0)
|
||||
org->iframes = -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
s32 sub_08017D28(Entity* org, Entity* tgt, u32 direction) {
|
||||
gPlayerState.field_0x1a[0] = 1;
|
||||
org->field_0x7a.HWORD = 600;
|
||||
org->knockbackDuration = 12;
|
||||
org->iframes = 16;
|
||||
org->field_0x46 = 640;
|
||||
if (tgt->iframes == 0)
|
||||
tgt->iframes = -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08017D6C(Entity* org, Entity* tgt, u32 direction) {
|
||||
u32 x;
|
||||
u32 y;
|
||||
ColSettings* p;
|
||||
|
||||
if (((-(((direction ^ 0x10) - 5) & 0x1f) + (tgt->animationState << 3)) & 0x1f) >= 0xb) {
|
||||
x = org->hurtType;
|
||||
y = 0xac2;
|
||||
} else {
|
||||
tgt->bitfield = 0xcb;
|
||||
tgt->field_0x78.HALF.HI = org->hurtType;
|
||||
x = org->hurtType;
|
||||
y = 0xae4;
|
||||
}
|
||||
p = &gCollisionMtx[x + y];
|
||||
return sub_08018308(org, tgt, direction, p);
|
||||
}
|
||||
|
||||
int sub_08017DD4(Entity* org, Entity* tgt, u32 direction) {
|
||||
org->bitfield = 0;
|
||||
if (tgt->damage & 0x80)
|
||||
tgt->damage &= ~0x80;
|
||||
else
|
||||
tgt->damage = 4;
|
||||
gPlayerEntity.currentHealth = sub_08017874(&gPlayerEntity, tgt);
|
||||
tgt->iframes = -12;
|
||||
if ((gPlayerState.flags & 0x80) == 0) {
|
||||
sub_08079D84();
|
||||
org->iframes = 90;
|
||||
} else {
|
||||
gPlayerEntity.bitfield = tgt->hurtType | 0x80;
|
||||
gPlayerEntity.iframes = 12;
|
||||
gPlayerEntity.knockbackDuration = 16;
|
||||
gPlayerEntity.knockbackDirection = DirectionTurnAround(direction);
|
||||
gPlayerEntity.field_0x46 = 640;
|
||||
}
|
||||
if (tgt->iframes == 0)
|
||||
tgt->iframes = -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08017E88(Entity* org, Entity* tgt, u32 direction) {
|
||||
org->knockbackDuration = 2;
|
||||
org->field_0x46 = 640;
|
||||
if (tgt->iframes == 0)
|
||||
tgt->iframes = -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08017EB0(Entity* org, Entity* tgt, u32 direction) {
|
||||
if (tgt->damage == 0)
|
||||
return 0;
|
||||
if (org == &gPlayerEntity) {
|
||||
u32 temp = tgt->damage;
|
||||
tgt->damage = 8;
|
||||
gPlayerEntity.currentHealth = sub_08017874(&gPlayerEntity, tgt);
|
||||
tgt->damage = temp;
|
||||
gPlayerEntity.knockbackDuration = 12;
|
||||
gPlayerEntity.iframes = 16;
|
||||
gPlayerEntity.field_0x46 = 384;
|
||||
} else if (org->kind == 8 && org->id == 5) {
|
||||
org->knockbackDuration = 8;
|
||||
org->iframes = -6;
|
||||
org->field_0x46 = 384;
|
||||
gPlayerEntity.iframes = 0x80;
|
||||
}
|
||||
if (tgt->iframes == 0)
|
||||
tgt->iframes = -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08017F3C(Entity* org, Entity* tgt, u32 direction) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08017F40(Entity* org, Entity* tgt, u32 direction) {
|
||||
if (tgt->field_0x43 == 0) {
|
||||
if (org == &gPlayerEntity) {
|
||||
if (sub_08079F8C() && (gPlayerState.flags & 0x80) == 0 && !gPlayerState.swimState) {
|
||||
gPlayerState.field_0x1a[0] |= 0x80u;
|
||||
gPlayerState.field_0xa |= 0x80u;
|
||||
gPlayerState.flags |= 0x10u;
|
||||
gPlayerState.jumpStatus = 0;
|
||||
if (tgt->kind == ENEMY && (tgt->id == GHINI || tgt->id == ENEMY_50)) {
|
||||
org->height.HALF.HI = 0;
|
||||
PositionRelative(org, tgt, 0, 0x10000);
|
||||
} else {
|
||||
PositionRelative(tgt, org, 0, 0x10000);
|
||||
}
|
||||
COLLISION_OFF(org);
|
||||
org->spriteRendering.b3 = tgt->spriteRendering.b3;
|
||||
org->spriteOrientation.flipY = tgt->spriteOrientation.flipY;
|
||||
org->iframes = -1;
|
||||
tgt->iframes = -8;
|
||||
ResetPlayer();
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
org->currentHealth = 0;
|
||||
}
|
||||
} else if (tgt->kind == 3 && org == &gPlayerEntity) {
|
||||
sub_08004484(tgt, org);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// inverted branch
|
||||
NONMATCH("asm/non_matching/collision/sub_0801802C.inc", s32 sub_0801802C(Entity* org, Entity* tgt, u32 direction)) {
|
||||
int kind;
|
||||
ColSettings* p;
|
||||
u32 x;
|
||||
|
||||
kind = org->kind;
|
||||
if (kind == 1) {
|
||||
if (sub_08079F8C() && (((direction ^ 0x10) - 4 * tgt->animationState + 5) & 0x1Fu) <= 0xA)
|
||||
goto _0801807A;
|
||||
} else if (kind == 8) {
|
||||
if ((((org->direction ^ 0x10) - 4 * tgt->animationState + 5) & 0x1Fu) <= 0xA) {
|
||||
org->currentHealth = 0;
|
||||
_0801807A:
|
||||
sub_080180BC(org, tgt);
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
org->currentHealth = 0;
|
||||
return 0;
|
||||
}
|
||||
x = 0x11aa;
|
||||
return sub_08018308(org, tgt, direction, &gCollisionMtx[x + org->hurtType]);
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_080180BC(Entity* org, Entity* tgt) {
|
||||
if (org->iframes == 0)
|
||||
org->iframes = -30;
|
||||
if (tgt->iframes == 0)
|
||||
tgt->iframes = -1;
|
||||
tgt->subAction = -1;
|
||||
}
|
||||
|
||||
s32 sub_080180E8(Entity* org, Entity* tgt, u32 direction) {
|
||||
u32 v3;
|
||||
u32 x;
|
||||
|
||||
v3 = DirectionNormalize(DirectionTurnAround(direction) - 0xc);
|
||||
if (DirectionNormalize(tgt->direction - v3) <= 0x18) {
|
||||
org->knockbackDuration = 12;
|
||||
org->iframes = -16;
|
||||
org->field_0x46 = 640;
|
||||
tgt->knockbackDuration = 12;
|
||||
tgt->iframes = -16;
|
||||
tgt->field_0x46 = 768;
|
||||
sub_08017940(org, tgt);
|
||||
return 1;
|
||||
}
|
||||
x = 0x352;
|
||||
return sub_08018308(org, tgt, v3, &gCollisionMtx[org->hurtType + x]);
|
||||
}
|
||||
|
||||
s32 sub_08018168(Entity* org, Entity* tgt, u32 direction) {
|
||||
if (tgt->field_0x43 == 0) {
|
||||
if (org == &gPlayerEntity) {
|
||||
if (((sub_08079F8C() != 0) && ((gPlayerState.flags & 0x40080) == 0)) && (gPlayerState.swimState == 0)) {
|
||||
gPlayerState.field_0x1a[0] |= 0x80;
|
||||
gPlayerState.field_0xa |= 0x80;
|
||||
gPlayerState.flags |= 0x100;
|
||||
gPlayerState.jumpStatus = 0;
|
||||
gPlayerEntity.flags &= ~0x80;
|
||||
gPlayerEntity.spriteRendering.b3 = tgt->spriteRendering.b3;
|
||||
gPlayerEntity.spriteOrientation.flipY = tgt->spriteOrientation.flipY;
|
||||
gPlayerEntity.iframes = 0xff;
|
||||
tgt->iframes = -8;
|
||||
sub_08077B20();
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
org->currentHealth = 0;
|
||||
}
|
||||
} else if ((tgt->kind == 3) && (org == &gPlayerEntity)) {
|
||||
sub_08004484(tgt, &gPlayerEntity);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 sub_08018228(Entity* org, Entity* tgt, u32 direction) {
|
||||
if (org == &gPlayerEntity && sub_08079F8C())
|
||||
sub_08004484(tgt, org);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 sub_08018250(Entity* org, Entity* tgt, u32 direction) {
|
||||
org->iframes = -1;
|
||||
if (org->direction == 0) {
|
||||
tgt->iframes = 16;
|
||||
sub_08017A90(org, tgt);
|
||||
} else {
|
||||
tgt->iframes = -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08018288(Entity* org, Entity* tgt, u32 direction) {
|
||||
if (org == &gPlayerEntity)
|
||||
sub_0807AFE8();
|
||||
else
|
||||
org->currentHealth = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_080182A8(Entity* org, Entity* tgt, u32 direction) {
|
||||
if (tgt->field_0x43 == 0) {
|
||||
if (org->iframes == 0)
|
||||
org->iframes = -1;
|
||||
if (tgt->iframes == 0)
|
||||
tgt->iframes = -1;
|
||||
} else {
|
||||
u32 x = 0x92a;
|
||||
return sub_08018308(org, tgt, direction, &gCollisionMtx[org->hurtType + x]);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 sub_08018308(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
|
||||
u32 temp = 0;
|
||||
if (tgt->field_0x43 && tgt->kind == 3 && org == &gPlayerEntity) {
|
||||
sub_08004484(tgt, org);
|
||||
temp = 1;
|
||||
}
|
||||
if ((org->kind == 8 && org->id == 0x5) && gPlayerEntity.animationState == ((((direction + 4) & 0x18) >> 2) ^ 4)) {
|
||||
return 0;
|
||||
}
|
||||
if (!temp) {
|
||||
u32 tmp2;
|
||||
org->field_0x46 = 16 * settings->_0;
|
||||
org->iframes = settings->_1;
|
||||
if (org->iframes == 0)
|
||||
org->iframes = -1;
|
||||
org->knockbackDuration = settings->_2;
|
||||
tgt->damage = settings->_3;
|
||||
tmp2 = 0xFF;
|
||||
if (settings->_3 != 0)
|
||||
org->currentHealth = sub_08017874(org, tgt);
|
||||
if (settings->_4 > org->field_0x43)
|
||||
org->field_0x43 = settings->_4;
|
||||
tgt->field_0x46 = 16 * settings->_5;
|
||||
tgt->iframes = settings->_6;
|
||||
if (settings->_6 == 0)
|
||||
tgt->iframes = -1;
|
||||
tgt->knockbackDuration = settings->_7;
|
||||
tmp2 &= org->damage = settings->_8;
|
||||
if (tmp2 != 0)
|
||||
tgt->currentHealth = sub_08017874(tgt, org);
|
||||
if (settings->_9 > tgt->field_0x43)
|
||||
tgt->field_0x43 = settings->_9;
|
||||
}
|
||||
if (settings->_a & 1)
|
||||
sub_08017940(org, tgt);
|
||||
if (settings->_a & 2)
|
||||
org->bitfield = 0xca;
|
||||
if (settings->_a & 4) {
|
||||
Entity* parent = tgt->parent;
|
||||
if (parent != NULL) {
|
||||
parent->bitfield = 0xcc;
|
||||
parent->iframes = tgt->iframes;
|
||||
parent->knockbackDirection = direction;
|
||||
parent->knockbackDuration = tgt->knockbackDuration;
|
||||
if (parent->field_0x43 == 0)
|
||||
parent->field_0x43 = tgt->field_0x43;
|
||||
parent->field_0x46 = tgt->field_0x46;
|
||||
parent->field_0x4c = org;
|
||||
}
|
||||
}
|
||||
if (org->kind == 8) {
|
||||
if (org->id == 1) {
|
||||
if (settings->_8) {
|
||||
sub_080179EC(org, tgt);
|
||||
}
|
||||
} else if (org->id == 4) {
|
||||
if (org->damage || (settings->_a & 8)) {
|
||||
sub_08017A90(org, tgt);
|
||||
}
|
||||
} else if (org->id == 3) {
|
||||
if (settings->_9) {
|
||||
sub_0800449C(tgt, 254);
|
||||
}
|
||||
} else if (org->id == 5) {
|
||||
gPlayerEntity.iframes = 0x80;
|
||||
}
|
||||
}
|
||||
if (tgt->kind == 8 && org->id == 5) {
|
||||
gPlayerEntity.iframes = 0x80;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -160,7 +160,7 @@ void sub_08031B48(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.b.f0) {
|
||||
this->frames.all = 0;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
} else {
|
||||
if (this->frames.b.f3) {
|
||||
this->action = 0x3;
|
||||
@@ -188,7 +188,7 @@ void sub_08031B98(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->actionDelay == 0) {
|
||||
this->action = 4;
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, 2);
|
||||
}
|
||||
}
|
||||
@@ -255,7 +255,7 @@ void sub_08031C58(Entity* this) {
|
||||
} else {
|
||||
if (this->frames.b.f0) {
|
||||
this->frames.all = 0;
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -264,7 +264,7 @@ void sub_08031D70(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (--this->actionDelay == '\0') {
|
||||
this->action = 7;
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->actionDelay = 5;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
}
|
||||
@@ -289,7 +289,7 @@ void sub_08031DC4(Entity* this) {
|
||||
} else {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0xf) == 2) {
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -349,7 +349,7 @@ void sub_08031EE8(Entity* this) {
|
||||
|
||||
if (this->hVelocity < 1) {
|
||||
this->action = 2;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
InitializeAnimation(this, 5);
|
||||
}
|
||||
}
|
||||
@@ -494,7 +494,7 @@ void sub_08032248(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
|
||||
if ((this->frames.all & 0xf) == 2)
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -34,7 +34,7 @@ void sub_08021780(Entity* this) {
|
||||
this->action = 5;
|
||||
this->actionDelay = 0xb4;
|
||||
this->field_0xf = 0;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->spritePriority.b0 = 3;
|
||||
CopyPositionAndSpriteOffset(&gPlayerEntity, this);
|
||||
this->height.HALF.HI = -1;
|
||||
@@ -119,7 +119,7 @@ void sub_080218CC(Entity* this) {
|
||||
this->action = 2;
|
||||
this->actionDelay = (Random() & 0x38) + 8;
|
||||
this->field_0xf = 1;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->speed = 0x180;
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
@@ -128,7 +128,7 @@ void sub_080218CC(Entity* this) {
|
||||
void sub_08021984(Entity* this) {
|
||||
if (this->subAction == 0) {
|
||||
this->subAction = 1;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spriteSettings.b.draw = 3;
|
||||
this->height.HALF.HI = -0x80;
|
||||
this->spriteRendering.b3 = 1;
|
||||
@@ -270,7 +270,7 @@ void sub_08021C58(Entity* this) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 60;
|
||||
this->field_0xf = 1;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spritePriority.b0 = 4;
|
||||
((u8*)&this->field_0x86)[0] = 60;
|
||||
InitializeAnimation(this, 0);
|
||||
|
||||
+11
-11
@@ -52,7 +52,7 @@ void sub_0802C688(Entity* this) {
|
||||
break;
|
||||
case 2:
|
||||
this->action = 3;
|
||||
this->damageType = 0x6e;
|
||||
this->hitType = 0x6e;
|
||||
this->field_0xf = 1;
|
||||
this->hVelocity = 0x18000;
|
||||
this->speed = 0;
|
||||
@@ -112,15 +112,15 @@ void sub_0802C83C(Entity* this) {
|
||||
sub_0802CBC4(this);
|
||||
} else {
|
||||
sub_0802CC18(this);
|
||||
this->flags &= ~0x80;
|
||||
this->damageType = 0x6e;
|
||||
COLLISION_OFF(this);
|
||||
this->hitType = 0x6e;
|
||||
}
|
||||
} else {
|
||||
this->field_0x82.HALF.LO = 2;
|
||||
this->actionDelay = 120;
|
||||
InitializeAnimation(this, (this->direction >> 4) | 6);
|
||||
this->flags &= ~0x80;
|
||||
this->damageType = 0x6e;
|
||||
COLLISION_OFF(this);
|
||||
this->hitType = 0x6e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ void sub_0802C9B8(Entity* this) {
|
||||
|
||||
void sub_0802C9D0(Entity* this) {
|
||||
this->subAction = 1;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->spritePriority.b1 = 0;
|
||||
this->field_0x82.HALF.HI = 1;
|
||||
sub_0802CC18(this);
|
||||
@@ -222,7 +222,7 @@ void sub_0802CA6C(Entity* this) {
|
||||
|
||||
void sub_0802CA94(Entity* this) {
|
||||
this->action = 3;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->field_0xf = 1;
|
||||
this->spritePriority.b1 = 1;
|
||||
this->hVelocity = 0x18000;
|
||||
@@ -244,8 +244,8 @@ void sub_0802CAF8(Entity* this) {
|
||||
sub_08078930(this);
|
||||
if (this->field_0xf && this->height.HALF.HI == 0) {
|
||||
this->field_0xf = 0;
|
||||
this->flags = this->flags | 0x80;
|
||||
this->damageType = 0x6e;
|
||||
COLLISION_ON(this);
|
||||
this->hitType = 0x6e;
|
||||
}
|
||||
GetNextFrame(this);
|
||||
}
|
||||
@@ -260,7 +260,7 @@ void sub_0802CB68(Entity* this) {
|
||||
this->subAction = 0;
|
||||
this->direction = Random() & 0x18;
|
||||
this->direction |= 4;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
if (this->field_0x82.HALF.LO) {
|
||||
this->actionDelay = 200;
|
||||
this->speed = 0x200;
|
||||
@@ -277,7 +277,7 @@ void sub_0802CBC4(Entity* this) {
|
||||
|
||||
this->action = 4;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->currentHealth = 0;
|
||||
if (this->field_0x82.HALF.HI) {
|
||||
sub_08079184();
|
||||
|
||||
@@ -507,9 +507,9 @@ void sub_0802B048(Entity* this) {
|
||||
if (this->field_0x7a.HALF.HI) {
|
||||
if (gRoomControls.roomOriginY > this->y.HALF.HI ||
|
||||
(gRoomControls.roomOriginY + gRoomControls.height + 0x20) < this->y.HALF.HI) {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
} else {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -540,7 +540,7 @@ void sub_0802B048(Entity* this) {
|
||||
this->hitbox = (Hitbox*)&gUnk_080CD17C;
|
||||
this->actionDelay = 0xf;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->field_0x7a.HALF.HI = 0;
|
||||
sub_08078954(this);
|
||||
if (this->parent->next) {
|
||||
|
||||
@@ -55,11 +55,11 @@ void sub_0802891C(Entity* this) {
|
||||
void sub_08028934(Entity* this) {
|
||||
Entity* pEVar1;
|
||||
|
||||
if (this->damageType == 1 && (this->bitfield & 0x7f) == 0x42) {
|
||||
if (this->hitType == 1 && (this->bitfield & 0x7f) == 0x42) {
|
||||
this->action = 3;
|
||||
this->subAction = 0;
|
||||
this->actionDelay = 0x28;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
sub_080290E0(this, 4);
|
||||
pEVar1 = CreateFx(this, FX_BUSH, 0);
|
||||
if (pEVar1 != NULL) {
|
||||
@@ -90,7 +90,7 @@ void sub_08028994(Entity* this) {
|
||||
this->actionDelay = 0;
|
||||
this->field_0x76.HWORD = COORD_TO_TILE(this);
|
||||
this->field_0x74.HWORD = sub_080001DA(this->field_0x76.HWORD, this->collisionLayer);
|
||||
this->field_0x40 = 0x41;
|
||||
this->hurtType = 0x41;
|
||||
sub_08028FFC(this);
|
||||
}
|
||||
}
|
||||
@@ -417,7 +417,7 @@ bool32 sub_08028FDC(Entity* this) {
|
||||
|
||||
void sub_08028FFC(Entity* this) {
|
||||
this->action = 1;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->spritePriority.b1 = 0;
|
||||
sub_080AE068(this);
|
||||
UnloadOBJPalette(this);
|
||||
@@ -433,7 +433,7 @@ void sub_08028FFC(Entity* this) {
|
||||
|
||||
void sub_08029078(Entity* this) {
|
||||
this->action = 2;
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spritePriority.b1 = 1;
|
||||
if (LoadFixedGFX(this, 0x72) == 0) {
|
||||
DeleteEntity(this);
|
||||
|
||||
+18
-18
@@ -52,11 +52,11 @@ void Chuchu(Entity* this) {
|
||||
if (index != this->field_0x80.HALF.HI) {
|
||||
switch (this->type) {
|
||||
case 0:
|
||||
if (this->flags & 0x80) {
|
||||
if (this->flags & ENT_COLLIDE) {
|
||||
this->action = 6;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->speed = 0x20;
|
||||
this->damageType = 0x5c;
|
||||
this->hitType = 0x5c;
|
||||
InitializeAnimation(this, 5);
|
||||
}
|
||||
break;
|
||||
@@ -100,7 +100,7 @@ void sub_0801EF40(Entity* this) {
|
||||
|
||||
if (this->type == 2) {
|
||||
if (this->bitfield == 0x8e || this->bitfield == 0x95) {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->currentHealth = 0;
|
||||
}
|
||||
}
|
||||
@@ -180,7 +180,7 @@ void sub_0801F0C8(Entity* this) {
|
||||
this->actionDelay = (Random() & 3) + 0xc;
|
||||
this->field_0xf = Random();
|
||||
this->direction = sub_08049F84(this, 1);
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spritePriority.b0 = 4;
|
||||
this->spritePriority.b1 = 3;
|
||||
InitializeAnimation(this, 2);
|
||||
@@ -213,7 +213,7 @@ void sub_0801F1B0(Entity* this) {
|
||||
if (this->frames.all & 0x10) {
|
||||
if (this->frames.all & 1) {
|
||||
this->frames.all ^= 1;
|
||||
this->damageType = 90;
|
||||
this->hitType = 90;
|
||||
EnqueueSFX(299);
|
||||
}
|
||||
sub_080AEFE0(this);
|
||||
@@ -287,7 +287,7 @@ void sub_0801F2F8(Entity* this) {
|
||||
|
||||
void sub_0801F328(Entity* this) {
|
||||
this->action = 6;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, 5);
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ void sub_0801F340(Entity* this) {
|
||||
this->action = 5;
|
||||
this->actionDelay = 60;
|
||||
this->speed = 0x20;
|
||||
this->damageType = 92;
|
||||
this->hitType = 92;
|
||||
InitializeAnimation(this, 2);
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ void sub_0801F428(Entity* this) {
|
||||
|
||||
this->action = 3;
|
||||
this->field_0xf = 30;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spritePriority.b1 = 3;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
InitializeAnimation(this, 2);
|
||||
@@ -363,7 +363,7 @@ void sub_0801F494(Entity* this) {
|
||||
this->action = 3;
|
||||
this->field_0xf = 30;
|
||||
this->direction = sub_08049F84(this, 1);
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spritePriority.b0 = 4;
|
||||
this->spritePriority.b1 = 3;
|
||||
InitializeAnimation(this, 2);
|
||||
@@ -404,7 +404,7 @@ void sub_0801F584(Entity* this) {
|
||||
if (this->frames.all & 0x10) {
|
||||
if (this->frames.all & 0x1) {
|
||||
this->frames.all ^= 1;
|
||||
this->damageType = 91;
|
||||
this->hitType = 91;
|
||||
EnqueueSFX(299);
|
||||
}
|
||||
sub_080AEFE0(this);
|
||||
@@ -423,7 +423,7 @@ void sub_0801F584(Entity* this) {
|
||||
this->action = 6;
|
||||
this->field_0xf = 60;
|
||||
this->speed = 0x20;
|
||||
this->damageType = 92;
|
||||
this->hitType = 92;
|
||||
InitializeAnimation(this, 2);
|
||||
}
|
||||
}
|
||||
@@ -482,7 +482,7 @@ void sub_0801F6F8(Entity* this) {
|
||||
|
||||
void sub_0801F730(Entity* this) {
|
||||
this->action = 7;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, 5);
|
||||
}
|
||||
|
||||
@@ -537,7 +537,7 @@ void sub_0801F840(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
sub_0801FB14(this);
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spritePriority.b0 = 4;
|
||||
this->spritePriority.b1 = 3;
|
||||
}
|
||||
@@ -552,7 +552,7 @@ void sub_0801F884(Entity* this) {
|
||||
if (ent) {
|
||||
ent->type2 = 64;
|
||||
this->action = 4;
|
||||
this->damageType = 165;
|
||||
this->hitType = 165;
|
||||
EnqueueSFX(0x193);
|
||||
}
|
||||
}
|
||||
@@ -656,7 +656,7 @@ void sub_0801FAAC(Entity* this) {
|
||||
|
||||
void sub_0801FAE0(Entity* this) {
|
||||
this->action = 7;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, 5);
|
||||
}
|
||||
|
||||
@@ -687,13 +687,13 @@ void sub_0801FB68(Entity* this) {
|
||||
break;
|
||||
case 1:
|
||||
this->action = 10;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spritePriority.b1 = 3;
|
||||
break;
|
||||
case 2:
|
||||
this->action = 10;
|
||||
this->damageType = 92;
|
||||
this->hitType = 92;
|
||||
sub_0804AA1C(this);
|
||||
break;
|
||||
}
|
||||
|
||||
+7
-7
@@ -63,7 +63,7 @@ void sub_08020BB8(Entity* this) {
|
||||
case 0x1c:
|
||||
this->action = 11;
|
||||
this->actionDelay = gUnk_080CAB0C[this->type];
|
||||
this->damageType = 81;
|
||||
this->hitType = 81;
|
||||
sub_08021218(this, 8, DirectionToAnimationState(this->knockbackDirection ^ 0x10));
|
||||
sub_08021588(this);
|
||||
sub_0804A9FC(this, 0x1c);
|
||||
@@ -71,7 +71,7 @@ void sub_08020BB8(Entity* this) {
|
||||
case 0x16:
|
||||
this->action = 11;
|
||||
this->actionDelay = gUnk_080CAB10[this->type];
|
||||
this->damageType = 81;
|
||||
this->hitType = 81;
|
||||
sub_08021218(this, 8, DirectionToAnimationState(this->knockbackDirection ^ 0x10));
|
||||
sub_08021588(this);
|
||||
sub_0804A9FC(this, 0x1c);
|
||||
@@ -263,7 +263,7 @@ void sub_08020FE4(Entity* this) {
|
||||
void sub_08021010(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
this->damageType = 0x56;
|
||||
this->hitType = 0x56;
|
||||
sub_080213F0(this);
|
||||
}
|
||||
}
|
||||
@@ -288,7 +288,7 @@ void sub_08021038(Entity* this) {
|
||||
} else {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (this->frames.all == 4)
|
||||
this->damageType = 81;
|
||||
this->hitType = 81;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ void sub_08021380(Entity* this) {
|
||||
void sub_08021390(Entity* this) {
|
||||
this->action = 7;
|
||||
this->speed = 0x200;
|
||||
this->damageType = 0x56;
|
||||
this->hitType = 0x56;
|
||||
sub_08021218(this, 6, this->animationState);
|
||||
}
|
||||
|
||||
@@ -568,7 +568,7 @@ void sub_0802159C(Entity* this) {
|
||||
Entity* ent;
|
||||
|
||||
this->frames.all = 0;
|
||||
this->damageType = 0x51;
|
||||
this->hitType = 0x51;
|
||||
ent = CreateProjectileWithParent(this, 0, 3);
|
||||
if (ent) {
|
||||
ent->parent = this;
|
||||
@@ -589,7 +589,7 @@ void sub_08021600(Entity* this) {
|
||||
Entity* ent;
|
||||
|
||||
this->frames.all = 0;
|
||||
this->damageType = 0x51;
|
||||
this->hitType = 0x51;
|
||||
ent = CreateProjectileWithParent(this, 0, 4);
|
||||
if (ent) {
|
||||
ent->parent = this;
|
||||
|
||||
@@ -77,7 +77,7 @@ void sub_080220F0(Entity* this) {
|
||||
|
||||
this->action = 4;
|
||||
this->actionDelay = 0x78;
|
||||
this->field_0x44 = 0;
|
||||
this->damage = 0;
|
||||
off = gUnk_080CB76C[this->type2];
|
||||
for (i = 0; i < 6; i++, off++) {
|
||||
Entity* fx = CreateFx(this, FX_DASH, 0);
|
||||
@@ -88,7 +88,7 @@ void sub_080220F0(Entity* this) {
|
||||
}
|
||||
EnqueueSFX(260);
|
||||
} else if (this->frames.all & 1) {
|
||||
this->field_0x44 = 4;
|
||||
this->damage = 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ void sub_0803EB44(Entity* this) {
|
||||
if (pEVar1 != NULL) {
|
||||
pEVar1->parent = this;
|
||||
this->attachedEntity = pEVar1;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spriteSettings.b.draw = TRUE;
|
||||
this->animationState = 2;
|
||||
*((u8*)&this->field_0x7a + 1) = 0;
|
||||
|
||||
@@ -76,7 +76,7 @@ NONMATCH("asm/non_matching/fallingBoulder/sub_0802C334.inc", void sub_0802C334(E
|
||||
this->field_0x7c.HALF.HI = COORD_TO_TILE(this);
|
||||
if (sub_080044EC(this, *(u32*)&this->cutsceneBeh) == 1) {
|
||||
EnqueueSFX(0x14c);
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->field_0x7a.HWORD = 0xc;
|
||||
sub_0802C4B0(this);
|
||||
} else {
|
||||
@@ -86,7 +86,7 @@ NONMATCH("asm/non_matching/fallingBoulder/sub_0802C334.inc", void sub_0802C334(E
|
||||
u16 tmp = --this->field_0x7a.HWORD;
|
||||
switch (tmp) {
|
||||
case 0:
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
break;
|
||||
case 8:
|
||||
if (this->type2 != 0 && !sub_08049FA0(this)) {
|
||||
@@ -211,7 +211,7 @@ void sub_0802C62C(Entity* this) {
|
||||
this->y.HALF.HI = this->field_0x82.HWORD;
|
||||
this->x.HALF.HI = this->field_0x80.HWORD;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->field_0x7c.HALF.LO = 0;
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -47,18 +47,18 @@ NONMATCH("asm/non_matching/gibdo/sub_080374A4.inc", void sub_080374A4(Entity* th
|
||||
}
|
||||
this->action = 0x8;
|
||||
this->actionDelay = 0x3c;
|
||||
this->flags &= 0x7F;
|
||||
COLLISION_OFF(this);
|
||||
sub_08037B48(this);
|
||||
} else {
|
||||
if (this->action != 0x6) {
|
||||
if (this->damageType == 0x27) {
|
||||
if (this->hitType == 0x27) {
|
||||
if (this->bitfield == 0x80) {
|
||||
sub_08037A14(this);
|
||||
}
|
||||
} else {
|
||||
if ((u8)(this->action - 1) < 2) {
|
||||
this->action = 1;
|
||||
x = DirectionTurnAround(this->knockbackDirection);
|
||||
x = DirectionTurnAround(DirectionRoundUp(this->knockbackDirection));
|
||||
this->direction = x;
|
||||
this->animationState = x >> 3;
|
||||
InitAnimationForceUpdate(this, this->animationState);
|
||||
@@ -153,7 +153,7 @@ void sub_08037690(Entity* this) {
|
||||
sub_08037794(this);
|
||||
} else {
|
||||
if ((this->frames.all & 1) != 0) {
|
||||
this->damageType = 0x27;
|
||||
this->hitType = 0x27;
|
||||
ProcessMovement(this);
|
||||
}
|
||||
}
|
||||
@@ -202,7 +202,7 @@ void sub_0803775C(Entity* this) {
|
||||
void sub_08037794(Entity* this) {
|
||||
this->action = 1;
|
||||
this->field_0x74.HWORD = 0x1e;
|
||||
this->damageType = 0x26;
|
||||
this->hitType = 0x26;
|
||||
InitAnimationForceUpdate(this, this->animationState);
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ void sub_08037A58(Entity* this) {
|
||||
if (this->iframes == 0) {
|
||||
this->iframes = 0xec;
|
||||
}
|
||||
this->damageType = 0x26;
|
||||
this->hitType = 0x26;
|
||||
this->flags2 |= 1;
|
||||
this->iframes = 0xf4;
|
||||
this->knockbackDirection = DirectionFromAnimationState(this->animationState) ^ 0x10;
|
||||
|
||||
@@ -1113,7 +1113,7 @@ void sub_08048004(Entity* this) {
|
||||
if (this->action == 0)
|
||||
return;
|
||||
if (this->animIndex == 0) {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
if (gPlayerEntity.height.HALF.HI != 0)
|
||||
return;
|
||||
if (!sub_08079F8C())
|
||||
@@ -1151,7 +1151,7 @@ void sub_08048004(Entity* this) {
|
||||
this->field_0x7c.BYTES.byte0 = 0;
|
||||
}
|
||||
} else {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ void sub_0802BBAC(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802BBC4(Entity* this) {
|
||||
if (this->damageType != 0x19) {
|
||||
if (this->hitType != 0x19) {
|
||||
switch (this->bitfield & 0x7f) {
|
||||
case 0:
|
||||
case 2:
|
||||
@@ -62,7 +62,7 @@ void sub_0802BBC4(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802BC20(Entity* this) {
|
||||
if (this->damageType != 0x19) {
|
||||
if (this->hitType != 0x19) {
|
||||
if (sub_0806F520(this)) {
|
||||
gUnk_080CD42C[this->subAction](this);
|
||||
}
|
||||
@@ -84,13 +84,13 @@ void sub_0802BCA0(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802BCA8(Entity* this) {
|
||||
if (this->damageType != 0x19) {
|
||||
if (this->hitType != 0x19) {
|
||||
Entity* ent;
|
||||
|
||||
this->action = 7;
|
||||
this->actionDelay = 0x5a;
|
||||
this->hVelocity = 0x18000;
|
||||
this->damageType = 0x19;
|
||||
this->hitType = 0x19;
|
||||
this->field_0x3a = this->field_0x3a & 0xfb;
|
||||
this->field_0x1c = 0x12;
|
||||
ent = CreateEnemy(HELMASAUR, 1);
|
||||
@@ -112,7 +112,7 @@ void sub_0802BD08(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802BD10(Entity* this) {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
UpdateAnimationVariableFrames(this, 2);
|
||||
}
|
||||
|
||||
@@ -121,8 +121,8 @@ void nullsub_145(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802BD28(Entity* this) {
|
||||
if (this->flags & 0x80) {
|
||||
this->flags |= 0x80;
|
||||
if (this->flags & ENT_COLLIDE) {
|
||||
COLLISION_ON(this);
|
||||
this->field_0x3a &= ~0x4;
|
||||
} else {
|
||||
this->currentHealth = 0;
|
||||
@@ -265,7 +265,7 @@ void sub_0802BF98(Entity* this) {
|
||||
} else {
|
||||
this->action = 2;
|
||||
this->actionDelay = 30;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ void sub_080323F4(Entity* this) {
|
||||
if (this->action != 3 && this->action != 4) {
|
||||
this->action = 3;
|
||||
this->actionDelay = 0xC;
|
||||
this->direction = DirectionTurnAround(this->knockbackDirection);
|
||||
this->direction = DirectionTurnAround(DirectionRoundUp(this->knockbackDirection));
|
||||
InitAnimationForceUpdate(this, this->direction >> 3);
|
||||
} else if (this->bitfield == 0xCC) {
|
||||
if (this->field_0x43 == 0) {
|
||||
|
||||
+7
-7
@@ -61,7 +61,7 @@ void sub_0803C784(Entity* this) {
|
||||
|
||||
sub_0803CBAC(this);
|
||||
} else {
|
||||
if (this->damageType == 0x43) {
|
||||
if (this->hitType == 0x43) {
|
||||
Entity* fx = CreateFx(this, FX_DEATH, 0);
|
||||
|
||||
if (fx != NULL) {
|
||||
@@ -154,7 +154,7 @@ void Lakitu_EndHide(Entity* this) {
|
||||
this->action = IDLE;
|
||||
this->actionDelay = 0x3c;
|
||||
|
||||
this->damageType = 0x42;
|
||||
this->hitType = 0x42;
|
||||
|
||||
InitAnimationForceUpdate(this, this->animationState + 4);
|
||||
}
|
||||
@@ -168,7 +168,7 @@ void Lakitu_Idle(Entity* this) {
|
||||
if (!sub_0803CA4C(this)) {
|
||||
this->action = BEGIN_HIDE;
|
||||
|
||||
this->damageType = 0x43;
|
||||
this->hitType = 0x43;
|
||||
InitAnimationForceUpdate(this, this->animationState + 0xc);
|
||||
} else {
|
||||
sub_0803CA84(this, 4);
|
||||
@@ -196,7 +196,7 @@ void Lakitu_Lightning(Entity* this) {
|
||||
Lakitu_SpawnLightning(this);
|
||||
|
||||
this->action = LIGHTNING_DELAY;
|
||||
this->damageType = 0x42;
|
||||
this->hitType = 0x42;
|
||||
|
||||
if ((Random() & 1) && !this->field_0x78.HALF.HI) {
|
||||
this->actionDelay = 0xf;
|
||||
@@ -293,7 +293,7 @@ bool32 sub_0803CB04(Entity* this) {
|
||||
|
||||
void sub_0803CB34(Entity* this) {
|
||||
this->action = LIGHTNING_THROW;
|
||||
this->damageType = 0xa6;
|
||||
this->hitType = 0xa6;
|
||||
|
||||
this->field_0x78.HALF.LO = GetFacingDirection(this, &gPlayerEntity);
|
||||
|
||||
@@ -325,7 +325,7 @@ void sub_0803CBAC(Entity* this) {
|
||||
cloud = this->attachedEntity;
|
||||
if (cloud != NULL) {
|
||||
cloud->flags |= 0x80;
|
||||
cloud->damageType = 0x43;
|
||||
cloud->hitType = 0x43;
|
||||
}
|
||||
|
||||
this->action = CLOUDLESS;
|
||||
@@ -335,7 +335,7 @@ void sub_0803CBAC(Entity* this) {
|
||||
|
||||
this->flags2 &= 0x7b;
|
||||
|
||||
this->damageType = 0x42;
|
||||
this->hitType = 0x42;
|
||||
|
||||
InitAnimationForceUpdate(this, this->animationState + 16);
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ void sub_0803CDD8(Entity* this) {
|
||||
if (this->actionDelay == 0) {
|
||||
this->action = 1;
|
||||
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
|
||||
this->spriteSettings.b.draw = one;
|
||||
}
|
||||
@@ -132,7 +132,7 @@ void sub_0803CE3C(Entity* this) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 60;
|
||||
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
|
||||
this->field_0x3a &= 0xfb;
|
||||
|
||||
|
||||
+2
-2
@@ -92,7 +92,7 @@ void Leever_DigUp(Entity* this) {
|
||||
InitializeAnimation(this, LeeverAnimation_Attack);
|
||||
} else if (this->frames.b.f0 != 0) {
|
||||
this->frames.all &= 0xfe;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ void Leever_Attack(Entity* this) {
|
||||
|
||||
if (--this->field_0x74.HWORD == 0) {
|
||||
this->action = 4;
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, LeeverAnimation_DigDown);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,10 +26,10 @@ void sub_08027D8C(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08027DA4(Entity* this) {
|
||||
if (this->damageType == 1) {
|
||||
if (this->hitType == 1) {
|
||||
this->action = 3;
|
||||
this->flags &= ~0x80;
|
||||
this->damageType = 0x8c;
|
||||
COLLISION_OFF(this);
|
||||
this->hitType = 0x8c;
|
||||
} else {
|
||||
if (this->action == 7) {
|
||||
sub_0802810C(this);
|
||||
@@ -75,7 +75,7 @@ void sub_08027E70(Entity* this) {
|
||||
case 0:
|
||||
this->action = 3;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->actionDelay = 0;
|
||||
break;
|
||||
case 1:
|
||||
@@ -88,7 +88,7 @@ void sub_08027E70(Entity* this) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->actionDelay = 0;
|
||||
this->damageType = 1;
|
||||
this->hitType = 1;
|
||||
InitializeAnimation(this, 0);
|
||||
break;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ void sub_08027E70(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08027EFC(Entity* this) {
|
||||
if (this->damageType == 1)
|
||||
if (this->hitType == 1)
|
||||
return;
|
||||
|
||||
if (sub_08049FDC(this, 1)) {
|
||||
@@ -120,7 +120,7 @@ void sub_08027EFC(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
} else {
|
||||
this->action = 6;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, 2);
|
||||
}
|
||||
}
|
||||
@@ -151,7 +151,7 @@ void sub_08027FE0(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 1) {
|
||||
this->action = 1;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->direction = sub_08049F84(this, 1);
|
||||
this->actionDelay = 8;
|
||||
this->spritePriority.b1 = 1;
|
||||
|
||||
@@ -55,7 +55,7 @@ void sub_080298A4(Entity* this) {
|
||||
default:
|
||||
this->action = 2;
|
||||
this->actionDelay = 0;
|
||||
this->damageType = 0x6b;
|
||||
this->hitType = 0x6b;
|
||||
this->field_0x76.HALF.HI = 0;
|
||||
sub_0801D2B4(this, 0x7f);
|
||||
EnqueueSFX(0xfe);
|
||||
@@ -115,7 +115,7 @@ void sub_0802999C(Entity* this) {
|
||||
ent5->attachedEntity = ent6;
|
||||
|
||||
this->action = 1;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->direction = DirectionRound(Random());
|
||||
this->speed = 0xa0;
|
||||
this->animationState = 0xff;
|
||||
@@ -138,7 +138,7 @@ void sub_08029AA4(Entity* this) {
|
||||
if (this->field_0x76.HALF.HI != 0) {
|
||||
this->action = 3;
|
||||
this->speed = 0x108;
|
||||
this->damageType = 0x6a;
|
||||
this->hitType = 0x6a;
|
||||
this->field_0x7a.HWORD = 0x168;
|
||||
this->field_0x74.HALF.HI = 4;
|
||||
sub_08029EEC(this);
|
||||
@@ -168,7 +168,7 @@ void sub_08029B2C(Entity* this) {
|
||||
DeleteEntity(this);
|
||||
}
|
||||
} else {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->actionDelay = -(this->type * 15 - 90);
|
||||
this->field_0x86.HALF.LO = 1;
|
||||
}
|
||||
@@ -210,7 +210,7 @@ void sub_08029BC4(Entity* this) {
|
||||
void sub_08029C08(Entity* this) {
|
||||
this->action = 3;
|
||||
this->actionDelay = gUnk_080CCDA0[this->type];
|
||||
this->damageType = 0x6b;
|
||||
this->hitType = 0x6b;
|
||||
this->attachedEntity->action = 2;
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ void sub_08029C2C(Entity* this) {
|
||||
void sub_08029C50(Entity* this) {
|
||||
if (this->parent->field_0x76.HALF.HI != 0) {
|
||||
this->action = 5;
|
||||
this->damageType = 0x6a;
|
||||
this->hitType = 0x6a;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ void sub_08029D14(Entity* this) {
|
||||
if (this->frames.all & 0x80) {
|
||||
this->action = 4;
|
||||
this->actionDelay = 0x78;
|
||||
this->damageType = 0x6c;
|
||||
this->hitType = 0x6c;
|
||||
this->hitbox = &gUnk_080FD298;
|
||||
EnqueueSFX(0x6b);
|
||||
}
|
||||
@@ -290,7 +290,7 @@ void sub_08029D78(Entity* this) {
|
||||
sub_0802A0F8(this);
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 5;
|
||||
this->damageType = 0x6a;
|
||||
this->hitType = 0x6a;
|
||||
this->hitbox = (Hitbox*)&gUnk_080FD2A0;
|
||||
InitializeAnimation(this, this->animationState + 0x10);
|
||||
}
|
||||
|
||||
+20
-20
@@ -143,7 +143,7 @@ NONMATCH("asm/non_matching/mazaal/sub_0803A188.inc", void sub_0803A188(Entity* t
|
||||
if (this->action != 0x2b) {
|
||||
if ((0 < this->iframes) && ((this->bitfield == 0x95 || (this->bitfield == 0x8e)))) {
|
||||
this->action = 0x28;
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
pEVar3 = this->parent;
|
||||
pEVar3->field_0x7c.BYTES.byte1 = pEVar3->field_0x7c.BYTES.byte1 | (this->type == 0 ? 1 : 2);
|
||||
pEVar3->field_0x80.HALF.LO = (this->type == 0 ? 1 : 2) | pEVar3->field_0x80.HALF.LO;
|
||||
@@ -203,7 +203,7 @@ void sub_0803A274(Entity* this) {
|
||||
}
|
||||
if (gScreenTransition.field_0x38 != 0) {
|
||||
this->action = 3;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->attachedEntity->spriteSettings.b.draw = 1;
|
||||
InitializeAnimation(this, 0x10);
|
||||
@@ -312,7 +312,7 @@ void sub_0803A364(Entity* this) {
|
||||
default:
|
||||
this->actionDelay--;
|
||||
if (this->actionDelay == 0) {
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
sub_0803B4D4(this);
|
||||
}
|
||||
break;
|
||||
@@ -352,7 +352,7 @@ void sub_0803A5D0(Entity* this) {
|
||||
s8* ptr;
|
||||
|
||||
this->action = 5;
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
ptr = gUnk_080CED6C;
|
||||
index = ((this->parent->field_0xf >> 4) + 3);
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
@@ -500,7 +500,7 @@ void sub_0803A86C(Entity* this) {
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
sub_0803B59C(this);
|
||||
}
|
||||
}
|
||||
@@ -558,7 +558,7 @@ void sub_0803A978(Entity* this) {
|
||||
if (this->direction == 0x10) {
|
||||
this->action = 0x12;
|
||||
this->actionDelay = 3;
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
*(u8*)(*(int*)&this->field_0x74 + 0x10) &= 0x7f;
|
||||
InitializeAnimation(this, 8);
|
||||
InitAnimationForceUpdate(this->attachedEntity, 3);
|
||||
@@ -605,7 +605,7 @@ NONMATCH("asm/non_matching/mazaal/sub_0803AA98.inc", void sub_0803AA98(Entity* t
|
||||
InitializeAnimation(this, 10);
|
||||
(*(Entity**)&this->field_0x74)->flags |= 0x80;
|
||||
temp = this->attachedEntity;
|
||||
temp->damageType = 0x13;
|
||||
temp->hitType = 0x13;
|
||||
InitAnimationForceUpdate(temp, 5);
|
||||
SoundReq(SFX_16E);
|
||||
}
|
||||
@@ -654,7 +654,7 @@ void sub_0803ABB4(Entity* this) {
|
||||
sub_0803B55C(this);
|
||||
if ((this->attachedEntity->frames.all & 0x80) != 0) {
|
||||
this->action = 0x17;
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->speed = 0x180;
|
||||
InitializeAnimation(this, 0x10);
|
||||
InitAnimationForceUpdate(this->attachedEntity, 0);
|
||||
@@ -807,14 +807,14 @@ void sub_0803AEC4(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
sub_0803B59C(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0803AF18(Entity* this) {
|
||||
this->action = 0x1f;
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, 5);
|
||||
this->height.HALF.HI = gUnk_080CED6C[(this->parent->field_0xf >> 4) & 7] + 4;
|
||||
}
|
||||
@@ -907,7 +907,7 @@ void sub_0803B0D4(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
sub_0803B59C(this);
|
||||
}
|
||||
}
|
||||
@@ -943,8 +943,8 @@ void sub_0803B17C(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->action = 0x2b;
|
||||
this->flags |= 0x80;
|
||||
this->damageType = 0x18;
|
||||
COLLISION_ON(this);
|
||||
this->hitType = 0x18;
|
||||
this->currentHealth = 0xff;
|
||||
this->field_0x7c.HALF.HI = 600;
|
||||
}
|
||||
@@ -962,7 +962,7 @@ void sub_0803B1B8(Entity* this) {
|
||||
this->action = 0x32;
|
||||
this->field_0x7c.HALF.HI = 0x5dc;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->damageType = 0x14;
|
||||
this->hitType = 0x14;
|
||||
temp = CreateFx(this, FX_GIANT_EXPLOSION4, 0);
|
||||
if (temp != (Entity*)0x0) {
|
||||
temp->x.HALF.HI += this->hitbox->offset_x;
|
||||
@@ -1068,7 +1068,7 @@ void sub_0803B3F4(Entity* this) {
|
||||
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->damageType = 0x17;
|
||||
this->hitType = 0x17;
|
||||
if (this->type == 0) {
|
||||
this->hitbox = (Hitbox*)&gUnk_080FD35C;
|
||||
} else {
|
||||
@@ -1185,7 +1185,7 @@ void sub_0803B6A4(Entity* this) {
|
||||
Entity* temp;
|
||||
|
||||
this->action = 0x2c;
|
||||
this->damageType = 0x14;
|
||||
this->hitType = 0x14;
|
||||
temp = this->parent;
|
||||
temp->field_0x80.HALF.LO |= (this->type == 0) ? 0x10 : 0x20;
|
||||
temp->field_0x80.HALF.LO &= (this->type == 0) ? -5 : -9;
|
||||
@@ -1264,12 +1264,12 @@ u32 sub_0803B870(Entity* this) {
|
||||
gPlayerEntity.flags = gPlayerEntity.flags & 0x7f;
|
||||
gPlayerEntity.iframes = -0x10;
|
||||
sub_0803B824(this);
|
||||
entity->damageType = 0x13;
|
||||
entity->hitType = 0x13;
|
||||
InitAnimationForceUpdate(entity, 7);
|
||||
SoundReq(SFX_16E);
|
||||
return 1;
|
||||
} else {
|
||||
entity->damageType = 0x15;
|
||||
entity->hitType = 0x15;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -1277,9 +1277,9 @@ u32 sub_0803B870(Entity* this) {
|
||||
void sub_0803B8E8(Entity* this, u32 unk) {
|
||||
Entity* entity;
|
||||
entity = this->attachedEntity;
|
||||
entity->damageType = unk;
|
||||
entity->hitType = unk;
|
||||
entity = (*(Entity**)&this->field_0x74);
|
||||
entity->damageType = unk;
|
||||
entity->hitType = unk;
|
||||
}
|
||||
|
||||
void sub_0803B8F8(Entity* this) {
|
||||
|
||||
@@ -144,7 +144,7 @@ void sub_08033F3C(Entity* this) {
|
||||
this->action = 0xd;
|
||||
this->subAction = 0;
|
||||
this->actionDelay = 0xfc;
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
} else {
|
||||
pEVar2 = CreateEnemy(MAZAAL_BRACELET, 0);
|
||||
pEVar2->parent = this;
|
||||
|
||||
@@ -229,7 +229,7 @@ void sub_08034FA0(Entity* this) {
|
||||
void sub_08035050(Entity* this) {
|
||||
Entity* entity;
|
||||
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->currentHealth = 0;
|
||||
entity = CreateEnemy(VAATI_PROJECTILE, 0);
|
||||
if (entity != NULL) {
|
||||
|
||||
+2
-2
@@ -50,7 +50,7 @@ void sub_08022BEC(Entity* this) {
|
||||
void sub_08022C58(Entity* this) {
|
||||
Entity *tail0, *tail1, *tail2;
|
||||
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
|
||||
if (gEntCount >= 0x45)
|
||||
return;
|
||||
@@ -77,7 +77,7 @@ void sub_08022C58(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 1;
|
||||
this->field_0xf = 1;
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->parent = this;
|
||||
this->attachedEntity = tail0;
|
||||
*(Entity**)&this->field_0x7c = tail1;
|
||||
|
||||
+10
-10
@@ -67,7 +67,7 @@ void sub_080230E4(Entity* this) {
|
||||
this->action = 7;
|
||||
this->actionDelay = 1;
|
||||
this->subAction = 0;
|
||||
this->damageType = 0x85;
|
||||
this->hitType = 0x85;
|
||||
this->iframes = -8;
|
||||
this->field_0x7c.BYTES.byte3 = 0;
|
||||
this->field_0x7a.HALF.HI = 0;
|
||||
@@ -170,7 +170,7 @@ void sub_08023330(Entity* this) {
|
||||
if (this->frames.all & 0x80) {
|
||||
this->action = 4;
|
||||
this->actionDelay = 0x19;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->field_0x78.HWORD = 600;
|
||||
this->direction = Random() & 0x1c;
|
||||
this->animationState = this->direction >> 2;
|
||||
@@ -196,8 +196,8 @@ void sub_08023398(Entity* this) {
|
||||
if (sub_08023A38(GetTileTypeByEntity(this))) {
|
||||
this->action = 5;
|
||||
this->field_0x7c.BYTES.byte3 = 0;
|
||||
this->flags = this->flags & 0x7f;
|
||||
this->damageType = 0x85;
|
||||
COLLISION_OFF(this);
|
||||
this->hitType = 0x85;
|
||||
this->attachedEntity->actionDelay = 1;
|
||||
sub_08023A68(this);
|
||||
CreateFx(this, FX_ROCK, 0);
|
||||
@@ -299,7 +299,7 @@ void sub_08023604(Entity* this) {
|
||||
if (((u8*)&this->field_0x78)[this->parent->field_0x7c.BYTES.byte0 & 0xf] != 0x88) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 0;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spriteSettings.b.draw = 1;
|
||||
sub_08023644(this);
|
||||
}
|
||||
@@ -311,7 +311,7 @@ void sub_08023644(Entity* this) {
|
||||
if (parent->animIndex == 0x17 && this->actionDelay != 0 && this->x.HALF.HI == parent->x.HALF.HI &&
|
||||
this->y.HALF.HI == parent->y.HALF.HI) {
|
||||
this->action = 1;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->attachedEntity->actionDelay = 1;
|
||||
sub_080239F0(this);
|
||||
@@ -364,7 +364,7 @@ void sub_0802376C(Entity* this) {
|
||||
if (((u8*)&this->field_0x78)[parent->field_0x7c.BYTES.byte0 & 0xf] != 0x88) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 0;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->parent->field_0x7c.BYTES.byte3 = 1;
|
||||
sub_08023A88(this, 20);
|
||||
sub_080237D8(this);
|
||||
@@ -377,7 +377,7 @@ void sub_080237D8(Entity* this) {
|
||||
if (parent->animIndex == 0x17 && this->actionDelay != 0 && this->x.HALF.HI == parent->x.HALF.HI &&
|
||||
this->y.HALF.HI == parent->y.HALF.HI) {
|
||||
this->action = 1;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->spriteSettings.b.draw = 0;
|
||||
parent->field_0x7c.BYTES.byte3 = 1;
|
||||
sub_080239F0(this);
|
||||
@@ -499,7 +499,7 @@ void sub_08023AB0(Entity* this) {
|
||||
if (this->field_0x7c.BYTES.byte2) {
|
||||
this->field_0x7c.BYTES.byte2--;
|
||||
} else if (!sub_08023B38(this) || 0x1d >= this->field_0x78.HWORD) {
|
||||
this->damageType = 0x85;
|
||||
this->hitType = 0x85;
|
||||
this->field_0x7a.HALF.HI = 0;
|
||||
this->field_0x7c.BYTES.byte2 = 30;
|
||||
InitializeAnimation(this, this->animationState);
|
||||
@@ -507,7 +507,7 @@ void sub_08023AB0(Entity* this) {
|
||||
} else if (this->field_0x7c.BYTES.byte2) {
|
||||
this->field_0x7c.BYTES.byte2--;
|
||||
} else if (this->field_0x78.HWORD >= 90 && sub_08023B38(this)) {
|
||||
this->damageType = 0x87;
|
||||
this->hitType = 0x87;
|
||||
this->field_0x7a.HALF.HI = 8;
|
||||
this->field_0x7c.BYTES.byte2 = 10;
|
||||
InitializeAnimation(this, this->animationState + 8);
|
||||
|
||||
+3
-3
@@ -71,7 +71,7 @@ void sub_0801EB7C(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0801EB84(Entity* this) {
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
UpdateAnimationVariableFrames(this, 2);
|
||||
}
|
||||
|
||||
@@ -80,8 +80,8 @@ void nullsub_3(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0801EB9C(Entity* this) {
|
||||
if (this->flags & 0x80) {
|
||||
this->flags |= 0x80;
|
||||
if (this->flags & ENT_COLLIDE) {
|
||||
COLLISION_ON(this);
|
||||
this->field_0x3a &= 0xfb;
|
||||
} else {
|
||||
this->currentHealth = 0;
|
||||
|
||||
+7
-7
@@ -101,7 +101,7 @@ void sub_080200B4(Entity* this) {
|
||||
if (this->animationState == PeahatAnimation_Flying) {
|
||||
this->animationState = PeahatAnimation_BrokenPropeller;
|
||||
this->action = 5;
|
||||
this->damageType = 0x71;
|
||||
this->hitType = 0x71;
|
||||
this->field_0x80.HALF.HI = 0;
|
||||
InitializeAnimation(this, this->animationState);
|
||||
}
|
||||
@@ -116,15 +116,15 @@ void sub_080200EC(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_080200F4(Entity* this) {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
}
|
||||
|
||||
void nullsub_5(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08020104(Entity* this) {
|
||||
if (this->flags & 0x80) {
|
||||
this->flags |= 0x80;
|
||||
if (this->flags & ENT_COLLIDE) {
|
||||
COLLISION_ON(this);
|
||||
this->field_0x3a &= 0xfb;
|
||||
} else {
|
||||
this->currentHealth = 0;
|
||||
@@ -230,7 +230,7 @@ void Peahat_Stunned(Entity* this) {
|
||||
this->action = 6;
|
||||
this->actionDelay = 240;
|
||||
this->field_0xf = 10;
|
||||
this->damageType = 0x71;
|
||||
this->hitType = 0x71;
|
||||
}
|
||||
|
||||
if (this->direction == 0xff)
|
||||
@@ -245,7 +245,7 @@ void Peahat_Stunned(Entity* this) {
|
||||
this->action = 7;
|
||||
this->actionDelay = 150;
|
||||
this->field_0xf = 10;
|
||||
this->damageType = 0x71;
|
||||
this->hitType = 0x71;
|
||||
}
|
||||
break;
|
||||
};
|
||||
@@ -310,7 +310,7 @@ void Peahat_Takeoff(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
this->action = 1;
|
||||
this->damageType = 0x70;
|
||||
this->hitType = 0x70;
|
||||
this->field_0x82.HALF.LO = 1;
|
||||
this->field_0x80.HALF.HI = 1;
|
||||
this->animationState = PeahatAnimation_Flying;
|
||||
|
||||
+6
-6
@@ -49,7 +49,7 @@ void sub_08023F44(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08023F5C(Entity* this) {
|
||||
if (this->damageType != 0x6e) {
|
||||
if (this->hitType != 0x6e) {
|
||||
if (this->bitfield == 0x80) {
|
||||
this->field_0x86.HALF.LO = 0x30;
|
||||
|
||||
@@ -83,8 +83,8 @@ void sub_08023FF0(Entity* this) {
|
||||
if (this->subAction < 3 && !sub_0806F520(this)) {
|
||||
this->action = 1;
|
||||
this->subAction = 0;
|
||||
this->flags |= 0x80;
|
||||
this->damageType = 0x77;
|
||||
COLLISION_ON(this);
|
||||
this->hitType = 0x77;
|
||||
this->actionDelay = 1;
|
||||
this->speed = 0x40;
|
||||
} else {
|
||||
@@ -108,9 +108,9 @@ void sub_08024058(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08024060(Entity* this) {
|
||||
if (this->damageType != 0x6e) {
|
||||
this->flags = this->flags & 0x7f;
|
||||
this->damageType = 0x6e;
|
||||
if (this->hitType != 0x6e) {
|
||||
COLLISION_OFF(this);
|
||||
this->hitType = 0x6e;
|
||||
this->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ void sub_08025020(Entity* this) {
|
||||
this->field_0x82.HALF.LO -= gUnk_080CBFE8[(*(Entity**)&this->field_0x4c)->type];
|
||||
} else {
|
||||
this->cutsceneBeh.HWORD = 0x294;
|
||||
this->damageType = 0x83;
|
||||
this->hitType = 0x83;
|
||||
this->field_0x82.HALF.LO = 0;
|
||||
sub_0801D2B4(this, 0x7c);
|
||||
}
|
||||
@@ -85,7 +85,7 @@ void sub_08025020(Entity* this) {
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (this->damageType == 0x82 && this->iframes < 0) {
|
||||
if (this->hitType == 0x82 && this->iframes < 0) {
|
||||
Entity* ent = CreateObject(OBJECT_21, 2, 0);
|
||||
if (ent != NULL) {
|
||||
ent->spritePriority.b0 = 3;
|
||||
@@ -131,7 +131,7 @@ void sub_080251AC(Entity* this) {
|
||||
}
|
||||
} else {
|
||||
this->cutsceneBeh.HWORD = 0x294;
|
||||
this->damageType = 0x83;
|
||||
this->hitType = 0x83;
|
||||
this->field_0x82.HALF.LO = 0;
|
||||
sub_0801D2B4(this, 0x7c);
|
||||
}
|
||||
@@ -275,7 +275,7 @@ void sub_080254B4(Entity* this) {
|
||||
if (this->frames.all & 0x80) {
|
||||
if (this->height.HALF.HI == 0) {
|
||||
if (this->cutsceneBeh.HWORD == 0) {
|
||||
this->damageType = 0x82;
|
||||
this->hitType = 0x82;
|
||||
this->field_0x82.HALF.LO = -0x10;
|
||||
sub_080256B4(this);
|
||||
} else {
|
||||
@@ -361,7 +361,7 @@ void sub_0802563C(Entity* this) {
|
||||
|
||||
if (--this->cutsceneBeh.HWORD == 0) {
|
||||
sub_0801D2B4(this, 0x28);
|
||||
this->damageType = 0x82;
|
||||
this->hitType = 0x82;
|
||||
this->field_0x82.HALF.LO = 240;
|
||||
sub_080256B4(this);
|
||||
sub_0804AA1C(this);
|
||||
|
||||
@@ -50,14 +50,14 @@ void sub_08022254(Entity* this) {
|
||||
#endif
|
||||
sub_0804A4E4(this, ent);
|
||||
this->action = 2;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->direction = this->knockbackDirection;
|
||||
this->attachedEntity = ent;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this->damageType != 0x94)
|
||||
if (this->hitType != 0x94)
|
||||
InitializeAnimation(this, 2);
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -30,12 +30,12 @@ void Rollobite_OnTick(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08020668(Entity* this) {
|
||||
if (this->damageType == 34 && this->currentHealth != 0xff) {
|
||||
if (this->hitType == 34 && this->currentHealth != 0xff) {
|
||||
this->action = 4;
|
||||
this->hVelocity = 0x20000;
|
||||
this->direction = 0xff;
|
||||
this->currentHealth = 0xff;
|
||||
this->damageType = 35;
|
||||
this->hitType = 35;
|
||||
InitializeAnimation(this, this->animationState + 8);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ void sub_080206E0(Entity* this) {
|
||||
void sub_08020734(Entity* this) {
|
||||
if (this->subAction < 3 && !sub_0806F520(this)) {
|
||||
this->action = 4;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->direction = 0xff;
|
||||
InitializeAnimation(this, this->animationState + 0x10);
|
||||
} else {
|
||||
@@ -89,7 +89,7 @@ void sub_08020790(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08020798(Entity* this) {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
}
|
||||
|
||||
void nullsub_6(Entity* this) {
|
||||
@@ -98,7 +98,7 @@ void nullsub_6(Entity* this) {
|
||||
|
||||
void sub_080207A8(Entity* this) {
|
||||
this->action = 4;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spritePriority.b0 = 4;
|
||||
this->field_0x3a &= 0xfb;
|
||||
this->direction ^= 0x10;
|
||||
@@ -139,7 +139,7 @@ void sub_08020874(Entity* this) {
|
||||
|
||||
void sub_0802088C(Entity* this) {
|
||||
this->subAction = 1;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->cutsceneBeh.HALF.HI = gPlayerEntity.animationState;
|
||||
this->spritePriority.b1 = 0;
|
||||
}
|
||||
@@ -159,7 +159,7 @@ void sub_080208F0(Entity* this) {
|
||||
|
||||
void sub_08020904(Entity* this) {
|
||||
this->action = 4;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->direction = -1;
|
||||
InitializeAnimation(this, this->animationState + 0x10);
|
||||
}
|
||||
@@ -195,9 +195,9 @@ void Rollobite_RolledUp(Entity* this) {
|
||||
void Rollobite_Unroll(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 0x80) {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->speed = 0x100;
|
||||
this->damageType = 34;
|
||||
this->hitType = 34;
|
||||
sub_08020A30(this);
|
||||
this->direction = DirectionFromAnimationState(this->animationState);
|
||||
InitializeAnimation(this, this->animationState);
|
||||
@@ -257,7 +257,7 @@ bool32 Rollobite_TryToHoleUp(Entity* this) {
|
||||
int iVar1 = GetTileType(tile, this->collisionLayer);
|
||||
if ((iVar1 * 0x10000 - 0x710000U) >> 0x10 < 2) {
|
||||
this->action = 6;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->x.HALF.HI &= 0xfff0;
|
||||
this->x.HALF.HI += 8;
|
||||
this->y.HALF.HI &= 0xfff0;
|
||||
|
||||
@@ -47,7 +47,7 @@ void sub_08029300(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08029318(Entity* this) {
|
||||
if (this->damageType == 0x8e) {
|
||||
if (this->hitType == 0x8e) {
|
||||
sub_08029770(this);
|
||||
} else {
|
||||
if (this->action == 4) {
|
||||
@@ -126,7 +126,7 @@ void sub_08029474(Entity* this) {
|
||||
} else {
|
||||
if (this->frames.all == 1) {
|
||||
this->frames.all = 0;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -142,7 +142,7 @@ void sub_080294D4(Entity* this) {
|
||||
sub_080296C8(this);
|
||||
} else {
|
||||
this->action = 6;
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, 3);
|
||||
InitializeAnimation(this->attachedEntity, 7);
|
||||
}
|
||||
@@ -252,12 +252,12 @@ void sub_08029770(Entity* this) {
|
||||
u32 temp;
|
||||
if (LoadFixedGFX(this, 0x73) != 0) {
|
||||
this->action = 2;
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->spriteIndex = 0xd1;
|
||||
this->spritePriority.b1 = 3;
|
||||
temp = this->field_0x82.HALF.LO;
|
||||
this->palette.b.b0 = temp;
|
||||
this->damageType = 0x8d;
|
||||
this->hitType = 0x8d;
|
||||
this->hitbox = &gUnk_080FD260;
|
||||
InitializeAnimation(this, 2);
|
||||
this->attachedEntity->spriteSettings.b.draw = TRUE;
|
||||
@@ -270,9 +270,9 @@ void sub_080297F0(Entity* this) {
|
||||
u32 temp;
|
||||
this->action = 1;
|
||||
this->actionDelay = 0x78;
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spriteSettings.b.draw = TRUE;
|
||||
this->damageType = 0x8e;
|
||||
this->hitType = 0x8e;
|
||||
sub_080AE068(this);
|
||||
#ifdef EU
|
||||
this->spriteIndex = 0x142;
|
||||
|
||||
@@ -36,7 +36,7 @@ void sub_0803169C(Entity* this) {
|
||||
if (iVar1 == 0) {
|
||||
this->action = 1;
|
||||
this->subAction = 0;
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->speed = 0x40;
|
||||
this->field_0xf = 1;
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ void sub_0802B2E0(Entity* this) {
|
||||
|
||||
if (this->bitfield & 0x80) {
|
||||
if ((this->bitfield & 0x7f) == 0x14) {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->iframes = 0;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->action = 2;
|
||||
|
||||
@@ -54,7 +54,7 @@ void sub_0802B628(Entity* this) {
|
||||
this->direction = this->knockbackDirection;
|
||||
this->knockbackDuration = 0;
|
||||
this->iframes = -8;
|
||||
this->damageType = 100;
|
||||
this->hitType = 100;
|
||||
InitializeAnimation(this, 9);
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@ void sub_0802B8E0(Entity* this) {
|
||||
this->action = 8;
|
||||
this->hVelocity = 0x10000;
|
||||
this->speed = 0x60;
|
||||
this->damageType = 99;
|
||||
this->hitType = 99;
|
||||
InitializeAnimation(this, this->animationState);
|
||||
EnqueueSFX(299);
|
||||
}
|
||||
|
||||
@@ -33,13 +33,13 @@ void sub_08022434(Entity* this) {
|
||||
|
||||
void sub_0802244C(Entity* this) {
|
||||
if (this->currentHealth) {
|
||||
if (this->damageType == 0x65) {
|
||||
if (this->hitType == 0x65) {
|
||||
switch (this->bitfield & 0x7f) {
|
||||
case 2:
|
||||
case 3:
|
||||
this->action = 2;
|
||||
this->field_0xf = 0x3c;
|
||||
this->damageType = 0x5c;
|
||||
this->hitType = 0x5c;
|
||||
this->hitbox = &gUnk_080FD468;
|
||||
InitializeAnimation(this, 0);
|
||||
break;
|
||||
@@ -54,7 +54,7 @@ void sub_0802244C(Entity* this) {
|
||||
case 0x1a:
|
||||
sub_0804A9FC(this, 0x1c);
|
||||
this->action = 5;
|
||||
this->damageType = 0x5c;
|
||||
this->hitType = 0x5c;
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
} else if (this->bitfield == 0x94) {
|
||||
@@ -65,7 +65,7 @@ void sub_0802244C(Entity* this) {
|
||||
|
||||
if (this->field_0x80.HALF.LO != this->currentHealth) {
|
||||
this->action = 5;
|
||||
this->damageType = 0x5c;
|
||||
this->hitType = 0x5c;
|
||||
InitializeAnimation(this, 1);
|
||||
} else {
|
||||
if (this->action == 3) {
|
||||
@@ -141,7 +141,7 @@ void sub_08022654(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 3;
|
||||
this->damageType = 0x65;
|
||||
this->hitType = 0x65;
|
||||
InitializeAnimation(this, 2);
|
||||
}
|
||||
break;
|
||||
@@ -152,7 +152,7 @@ void sub_080226EC(Entity* this) {
|
||||
if (sub_08049FDC(this, 1)) {
|
||||
if (sub_080228CC(this)) {
|
||||
this->action = 3;
|
||||
this->damageType = 0x65;
|
||||
this->hitType = 0x65;
|
||||
InitializeAnimation(this, 2);
|
||||
return;
|
||||
}
|
||||
@@ -162,7 +162,7 @@ void sub_080226EC(Entity* this) {
|
||||
this->hVelocity = 0x12000;
|
||||
this->speed = 0x140;
|
||||
this->direction = GetFacingDirection(this, gUnk_020000B0);
|
||||
this->damageType = 0x5a;
|
||||
this->hitType = 0x5a;
|
||||
InitializeAnimation(this, 4);
|
||||
return;
|
||||
}
|
||||
@@ -196,7 +196,7 @@ void sub_080227AC(Entity* this) {
|
||||
|
||||
if (this->frames.all & 2) {
|
||||
this->frames.all &= ~2;
|
||||
this->damageType = 0x5c;
|
||||
this->hitType = 0x5c;
|
||||
}
|
||||
|
||||
if (this->frames.all & 0x80) {
|
||||
@@ -223,7 +223,7 @@ void sub_08022854(Entity* this) {
|
||||
sub_080AEFE0(this);
|
||||
if (sub_08003FC4(this, 0x1800) == 0) {
|
||||
this->action = 7;
|
||||
this->damageType = 0x5c;
|
||||
this->hitType = 0x5c;
|
||||
InitializeAnimation(this, 5);
|
||||
EnqueueSFX(0x7d);
|
||||
}
|
||||
|
||||
+19
-19
@@ -355,7 +355,7 @@ void sub_080428FC(Entity* this) {
|
||||
SoundReq(SFX_153);
|
||||
uVar2 = 0;
|
||||
do {
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[uVar2]->damageType = 0x3b;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[uVar2]->hitType = 0x3b;
|
||||
uVar2 = uVar2 + 1;
|
||||
} while (uVar2 < 5);
|
||||
}
|
||||
@@ -387,7 +387,7 @@ void sub_08042970(Entity* this) {
|
||||
this->actionDelay = 0x3c;
|
||||
uVar2 = 0;
|
||||
do {
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[uVar2]->damageType = 0x39;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[uVar2]->hitType = 0x39;
|
||||
uVar2 = uVar2 + 1;
|
||||
} while (uVar2 < 5);
|
||||
}
|
||||
@@ -460,9 +460,9 @@ void sub_08042AEC(Entity* this) {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->subAction = 3;
|
||||
this->actionDelay = 4;
|
||||
this->damageType = 0x3d;
|
||||
this->hitType = 0x3d;
|
||||
InitAnimationForceUpdate(this, 0xe);
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->damageType = 0x3d;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x3d;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -508,8 +508,8 @@ void sub_08042B20(Entity* this) {
|
||||
this->action = 5;
|
||||
this->subAction = 0;
|
||||
this->actionDelay = 0x1e;
|
||||
this->damageType = 0x39;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->damageType = 0x39;
|
||||
this->hitType = 0x39;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x39;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -565,7 +565,7 @@ void sub_08042C34(Entity* this) {
|
||||
entity->x.HALF.HI = x;
|
||||
entity->y.HALF.HI = y;
|
||||
entity->height.HALF.HI = 0x32;
|
||||
entity->damageType = 0x39;
|
||||
entity->hitType = 0x39;
|
||||
ptr = &((VaatiArm_HeapStruct*)this->myHeap)->s1[i];
|
||||
ptr->unk00.HWORD = 0x80;
|
||||
ptr->unk04.HWORD = 0;
|
||||
@@ -582,8 +582,8 @@ void sub_08042D24(Entity* this) {
|
||||
|
||||
if (--this->actionDelay == 0) {
|
||||
this->subAction = 2;
|
||||
this->damageType = 0x3d;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->damageType = 0x3d;
|
||||
this->hitType = 0x3d;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x3d;
|
||||
entity = CreateObject(OBJECT_AF, 1, 0);
|
||||
if (entity != NULL) {
|
||||
entity->parent = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3];
|
||||
@@ -618,10 +618,10 @@ void sub_08042D6C(Entity* this) {
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->s1[0].unk0a = 0xc0;
|
||||
this->subAction = 3;
|
||||
this->actionDelay = 0x1e;
|
||||
this->damageType = 0x39;
|
||||
this->hitType = 0x39;
|
||||
this->field_0x7c.BYTES.byte3 = 0x2d;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->damageType = 0x39;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x39;
|
||||
} else {
|
||||
entity->height.HALF.HI -= 2;
|
||||
}
|
||||
@@ -742,7 +742,7 @@ void sub_08043048(Entity* this) {
|
||||
ptr[0].unk04.HWORD += 0x200;
|
||||
if (0x4f < ptr[0].unk04.HALF.HI) {
|
||||
for (i = 0; i < 5; i++) {
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->damageType = 0x3b;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->hitType = 0x3b;
|
||||
}
|
||||
SoundReq(SFX_153);
|
||||
}
|
||||
@@ -751,7 +751,7 @@ void sub_08043048(Entity* this) {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->subAction = 7;
|
||||
for (i = 0; i < 5; i++) {
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->damageType = 0x39;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->hitType = 0x39;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -962,7 +962,7 @@ NONMATCH("asm/non_matching/vaati/sub_08043490.inc", void sub_08043490(Entity* th
|
||||
entity->flags = entity->flags | 0x80;
|
||||
entity->spriteSettings.b.draw = 1;
|
||||
entity->field_0x3c = entity->field_0x3c & 0xef;
|
||||
entity->damageType = 0x3a;
|
||||
entity->hitType = 0x3a;
|
||||
entity->hitbox = (Hitbox*)&gUnk_080FD450;
|
||||
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[2];
|
||||
entity->flags = entity->flags | 0x80;
|
||||
@@ -1011,7 +1011,7 @@ void sub_08043580(Entity* this) {
|
||||
this->actionDelay = 0x3c;
|
||||
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4];
|
||||
entity->field_0x3c = entity->field_0x3c | 0x10;
|
||||
entity->damageType = 0x39;
|
||||
entity->hitType = 0x39;
|
||||
entity->hitbox = (Hitbox*)&gUnk_080FD538;
|
||||
sub_0804AA1C(this);
|
||||
}
|
||||
@@ -1341,7 +1341,7 @@ void sub_08043D08(Entity* this) {
|
||||
CopyPosition(((VaatiArm_HeapStruct*)this->myHeap)->entities[3], entity);
|
||||
entity->height.HALF.HI += ((VaatiArm_HeapStruct*)this->myHeap)->s1[3].unk0c;
|
||||
for (i = 0; i < 5; i++) {
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->damageType = 0x39;
|
||||
((VaatiArm_HeapStruct*)this->myHeap)->entities[i]->hitType = 0x39;
|
||||
}
|
||||
EnqueueSFX(SFX_HIT);
|
||||
}
|
||||
@@ -1364,7 +1364,7 @@ void sub_08043DB0(Entity* this) {
|
||||
gScreenTransition.field_0x3d = 0x1e - (cVar1 / 0x3c);
|
||||
gScreenTransition.field_0x3c = this->type2;
|
||||
pEVar2 = ((VaatiArm_HeapStruct*)this->myHeap)->parent;
|
||||
gScreenTransition.field_0x40 = pEVar2->x.HALF.HI;
|
||||
gScreenTransition.hurtType = pEVar2->x.HALF.HI;
|
||||
gScreenTransition.field_0x42 = pEVar2->y.HALF.HI;
|
||||
pEVar4 = ((VaatiArm_HeapStruct*)pEVar2->myHeap)->parent;
|
||||
if (pEVar4 != NULL) {
|
||||
@@ -1391,7 +1391,7 @@ void sub_08043EB8(Entity* this) {
|
||||
Entity* pEVar4;
|
||||
VaatiArm_HeapStruct1* ptr;
|
||||
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spritePriority.b0 = 4;
|
||||
InitAnimationForceUpdate(this, 0xd);
|
||||
pEVar4 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[1];
|
||||
@@ -1412,7 +1412,7 @@ void sub_08043EB8(Entity* this) {
|
||||
pEVar4->y.HALF.HI = (this->type2 == 0) ? gScreenTransition.field_0x46 : gScreenTransition.field_0x4a;
|
||||
pEVar4->height.HALF.HI = 0;
|
||||
pEVar4->field_0x3c = pEVar4->field_0x3c & 0xef;
|
||||
pEVar4->damageType = 0x3a;
|
||||
pEVar4->hitType = 0x3a;
|
||||
pEVar4->hitbox = (Hitbox*)&gUnk_080FD450;
|
||||
pEVar4 = CreateObject(OBJECT_AF, 0, 0);
|
||||
if (pEVar4 != NULL) {
|
||||
|
||||
+12
-12
@@ -40,7 +40,7 @@ void VaatiBall(Entity* this) {
|
||||
if (this->currentHealth < 0xfd) {
|
||||
#endif
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->currentHealth = -1;
|
||||
parent->field_0x80.HALF.LO--;
|
||||
CreateDust(this);
|
||||
@@ -99,7 +99,7 @@ void sub_0804474C(Entity* this) {
|
||||
case 2:
|
||||
this->action = 2;
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->damageType = 0;
|
||||
this->hitType = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -121,14 +121,14 @@ void sub_080447E0(Entity* this) {
|
||||
|
||||
if (vaati->action == 1) {
|
||||
this->action = 1;
|
||||
this->damageType = 43;
|
||||
this->hitType = 43;
|
||||
sub_08044E74(this, 0);
|
||||
if (this->flags & 0x80)
|
||||
if (this->flags & ENT_COLLIDE)
|
||||
this->spriteSettings.b.draw = 1;
|
||||
} else {
|
||||
this->field_0x76.HALF.HI++;
|
||||
this->field_0x76.HALF.HI &= 7;
|
||||
if (this->flags & 0x80) {
|
||||
if (this->flags & ENT_COLLIDE) {
|
||||
if (this->field_0x76.HALF.HI & 1) {
|
||||
this->spriteSettings.b.draw = 1;
|
||||
} else {
|
||||
@@ -190,7 +190,7 @@ void sub_08044868(Entity* this) {
|
||||
vaati->type2 = 1;
|
||||
vaati->parent = this;
|
||||
this->cutsceneBeh.HALF.LO = 1;
|
||||
this->damageType = 0;
|
||||
this->hitType = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -207,9 +207,9 @@ void sub_08044868(Entity* this) {
|
||||
sub_08044E74(this, 1);
|
||||
draw = this->spriteSettings.b.draw;
|
||||
if (draw == 1) {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
} else {
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -390,7 +390,7 @@ void sub_08044B04(Entity* this) {
|
||||
case 3:
|
||||
this->field_0x74.HALF.LO = 1;
|
||||
this->actionDelay = 80;
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
PositionRelative(vaati, this, 0, -0x100000);
|
||||
if (this->field_0xf)
|
||||
this->spriteSettings.b.draw = 0;
|
||||
@@ -429,9 +429,9 @@ void sub_08044B04(Entity* this) {
|
||||
sub_08044E74(this, 1);
|
||||
draw = this->spriteSettings.b.draw;
|
||||
if (draw == 1) {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
} else {
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
}
|
||||
vaati->actionDelay++;
|
||||
break;
|
||||
@@ -452,7 +452,7 @@ void sub_08044DEC(Entity* this) {
|
||||
} else {
|
||||
this->spriteSettings.b.draw = 0;
|
||||
}
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->field_0x78.HALF.LO = 0;
|
||||
this->speed = 0x300;
|
||||
off = this->parent->field_0x80.HALF.LO - 1;
|
||||
|
||||
@@ -146,7 +146,7 @@ void VaatiEyesMacroFunction0Type1Action0(Entity* this) {
|
||||
|
||||
void VaatiEyesMacroFunction0Type1Action1(Entity* this) {
|
||||
if (this->parent->next == NULL) {
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->currentHealth = 0;
|
||||
} else {
|
||||
sub_0802F04C(this);
|
||||
|
||||
@@ -42,7 +42,7 @@ void (*const vaatiProjectileFunction0Actions[])(Entity*) = {
|
||||
|
||||
void VaatiProjectile(Entity* this) {
|
||||
if (sub_0803E4A0(this)) {
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->currentHealth = 0;
|
||||
this->parent = NULL;
|
||||
}
|
||||
@@ -61,7 +61,7 @@ void VaatiProjectileFunction1(Entity* this) {
|
||||
if (this->currentHealth != 0) {
|
||||
#endif
|
||||
this->action = 5;
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->spritePriority.b1 = 0;
|
||||
gPlayerEntity.flags &= 0x7f;
|
||||
gPlayerEntity.spriteOrientation.flipY = this->spriteOrientation.flipY;
|
||||
@@ -114,7 +114,7 @@ void VaatiProjectileFunction0Action0(Entity* this) {
|
||||
}
|
||||
} else {
|
||||
this->action = 8;
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->spriteOffsetY = 1;
|
||||
this->spriteOrientation.flipY = this->parent->spriteOrientation.flipY;
|
||||
this->spriteRendering.b3 = this->parent->spriteRendering.b3;
|
||||
|
||||
@@ -514,13 +514,13 @@ void VaatiRebornEnemyType1Action1(Entity* this) {
|
||||
if (this->field_0x74.HALF.LO == 0) {
|
||||
if (parent->field_0x80.HALF.LO == 0) {
|
||||
this->field_0x74.HALF.LO = 1;
|
||||
this->damageType = 0x30;
|
||||
this->hitType = 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;
|
||||
this->hitType = 0x2f;
|
||||
InitAnimationForceUpdate(this, this->field_0x74.HALF.LO);
|
||||
} else {
|
||||
if (((this->bitfield & 0x80) != 0) && (0 < this->iframes)) {
|
||||
@@ -536,12 +536,12 @@ void VaatiRebornEnemyType1Action1(Entity* this) {
|
||||
if (this->field_0x74.HALF.HI == 0) {
|
||||
if (parent->action != 2) {
|
||||
this->field_0x74.HALF.HI = 1;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
}
|
||||
} else {
|
||||
if (parent->action == 2) {
|
||||
this->field_0x74.HALF.HI = 0;
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
}
|
||||
}
|
||||
this->spriteSettings.b.draw = parent->spriteSettings.b.draw;
|
||||
@@ -644,7 +644,7 @@ void sub_0803DC0C(Entity* this) {
|
||||
void VaatiRebornEnemyType1PreAction(Entity* this) {
|
||||
Entity* parent;
|
||||
|
||||
if (this->damageType != 0x30) {
|
||||
if (this->hitType != 0x30) {
|
||||
return;
|
||||
}
|
||||
parent = this->parent;
|
||||
@@ -652,7 +652,7 @@ void VaatiRebornEnemyType1PreAction(Entity* this) {
|
||||
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;
|
||||
COLLISION_OFF(this);
|
||||
parent->action = 7;
|
||||
parent->flags &= 0x7f;
|
||||
parent->actionDelay = 0x80;
|
||||
@@ -675,7 +675,7 @@ void VaatiRebornEnemyType1PreAction(Entity* this) {
|
||||
}
|
||||
if (this->actionDelay != 0) {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->damageType = 0x2f;
|
||||
this->hitType = 0x2f;
|
||||
this->field_0x74.HALF.LO = 1;
|
||||
if (this->field_0x76.HALF.HI == 0) {
|
||||
parent->field_0x74.HALF.LO = 0xf0;
|
||||
|
||||
@@ -269,14 +269,14 @@ void VaatiTransfiguredType0Action3(Entity* this) {
|
||||
break;
|
||||
this->field_0x80.HALF.LO = 1;
|
||||
this->actionDelay = 0xc0;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
SoundReq(SFX_14C);
|
||||
sub_08080964(0x14, 4);
|
||||
break;
|
||||
case 1:
|
||||
if (--this->actionDelay == 0) {
|
||||
this->field_0x80.HALF.LO = 2;
|
||||
this->damageType = 0x35;
|
||||
this->hitType = 0x35;
|
||||
this->spriteOffsetX = 0;
|
||||
}
|
||||
if (this->currentHealth < gUnk_080D0ABC[this->animationState]) {
|
||||
@@ -287,7 +287,7 @@ void VaatiTransfiguredType0Action3(Entity* this) {
|
||||
}
|
||||
if (tmp) {
|
||||
this->field_0x80.HALF.LO = 2;
|
||||
this->damageType = 0x35;
|
||||
this->hitType = 0x35;
|
||||
this->spriteOffsetX = 0;
|
||||
this->animationState++;
|
||||
if (this->animationState > 2) {
|
||||
@@ -312,7 +312,7 @@ void VaatiTransfiguredType0Action3(Entity* this) {
|
||||
case 3:
|
||||
if (this->actionDelay != 0) {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->hVelocity = 0x38000;
|
||||
this->field_0xf = 0x10;
|
||||
}
|
||||
@@ -321,7 +321,7 @@ void VaatiTransfiguredType0Action3(Entity* this) {
|
||||
if (sub_08003FC4(this, 0x2800) == 0) {
|
||||
this->field_0x80.HALF.LO = 5;
|
||||
this->actionDelay = 0x10;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->currentHealth = 0xff;
|
||||
this->field_0x86.HALF.LO = 0;
|
||||
sub_080408EC(this);
|
||||
@@ -1059,8 +1059,8 @@ void sub_080409B0(Entity* this) {
|
||||
this->action = 3;
|
||||
this->field_0x80.HALF.LO = 0;
|
||||
this->field_0x80.HALF.HI = 3;
|
||||
this->flags &= 0x7f;
|
||||
this->damageType = 0x36;
|
||||
COLLISION_OFF(this);
|
||||
this->hitType = 0x36;
|
||||
this->hVelocity = 0x18000;
|
||||
SoundReq(SFX_164);
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ void VaatiTransfiguredEyeFunction0Action1(Entity* this) {
|
||||
if (this->field_0x82.HALF.LO == 0) {
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if (this->type != 0) {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
}
|
||||
this->action = 2;
|
||||
InitializeAnimation(this, this->type << 3);
|
||||
@@ -149,7 +149,7 @@ void VaatiTransfiguredEyeFunction0Action2(Entity* this) {
|
||||
this->action = 4;
|
||||
this->field_0xf = 0;
|
||||
if (this->type != 0) {
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
if (this->actionDelay != 0) {
|
||||
InitializeAnimation(this, this->type << 3 | 5);
|
||||
InitializeAnimation(this->parent, this->parent->type << 3 | 5);
|
||||
@@ -167,10 +167,10 @@ void VaatiTransfiguredEyeFunction0Action3(Entity* this) {
|
||||
this->action = 2;
|
||||
if (this->type != 0) {
|
||||
if (this->actionDelay == 0) {
|
||||
this->damageType = 0x32;
|
||||
this->hitType = 0x32;
|
||||
} else {
|
||||
this->parent->parent->field_0x76.HALF.LO |= (1 << this->type2);
|
||||
this->damageType = 0x31;
|
||||
this->hitType = 0x31;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -195,7 +195,7 @@ void VaatiTransfiguredEyeFunction0Action4(Entity* this) {
|
||||
this->field_0x80.HALF.HI = 0;
|
||||
this->cutsceneBeh.HALF.HI = 0;
|
||||
if (this->type != 0) {
|
||||
this->damageType = 0x33;
|
||||
this->hitType = 0x33;
|
||||
}
|
||||
if ((parent->field_0x74.HALF.HI >> this->type2 & 1U) != 0) {
|
||||
this->actionDelay = 1;
|
||||
|
||||
@@ -104,7 +104,7 @@ const s8 gUnk_080D0EB0[] = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x0
|
||||
|
||||
void VaatiWrath(Entity* this) {
|
||||
if (((this->type == 0) && ((this->bitfield & 0x80) != 0)) && (this->currentHealth == 0)) {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->currentHealth = 0xff;
|
||||
if (--this->cutsceneBeh.HALF.LO == 0) {
|
||||
this->action = 0xd;
|
||||
@@ -138,7 +138,7 @@ void VaatiWrathType0Action0(Entity* this) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 0x3c;
|
||||
}
|
||||
this->x.HALF.HI = gScreenTransition.field_0x40;
|
||||
this->x.HALF.HI = gScreenTransition.hurtType;
|
||||
this->y.HALF.HI = gScreenTransition.field_0x42;
|
||||
sub_08042004(this);
|
||||
} else {
|
||||
@@ -480,7 +480,7 @@ void VaatiWrathType0ActionB(Entity* this) {
|
||||
this->subAction = 1;
|
||||
this->actionDelay = 0xf0;
|
||||
this->currentHealth = 8;
|
||||
this->damageType = 0x38;
|
||||
this->hitType = 0x38;
|
||||
sub_08080964(0x14, 0);
|
||||
InitAnimationForceUpdate(this, 6);
|
||||
InitializeAnimation(((VaatiWrathHeapStruct*)this->myHeap)->type2, 0x16);
|
||||
@@ -492,7 +492,7 @@ void VaatiWrathType0ActionB(Entity* this) {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->subAction = 2;
|
||||
this->actionDelay = 0x3c;
|
||||
this->damageType = 0x39;
|
||||
this->hitType = 0x39;
|
||||
this->currentHealth = 0xff;
|
||||
}
|
||||
break;
|
||||
@@ -567,7 +567,7 @@ void sub_08041BE8(Entity* this) {
|
||||
if (sub_08079F8C() != 0) {
|
||||
this->subAction = 1;
|
||||
this->actionDelay = 120;
|
||||
this->scriptedScene = 3;
|
||||
this->updateConditions = 3;
|
||||
InitAnimationForceUpdate(this, 10);
|
||||
|
||||
entity = ((VaatiWrathHeapStruct*)this->myHeap)->type1;
|
||||
@@ -576,7 +576,7 @@ void sub_08041BE8(Entity* this) {
|
||||
((VaatiWrathHeapStruct*)this->myHeap)->type1 = NULL;
|
||||
|
||||
entity = ((VaatiWrathHeapStruct*)this->myHeap)->type2;
|
||||
entity->scriptedScene = 3;
|
||||
entity->updateConditions = 3;
|
||||
sub_080AE068(entity);
|
||||
LoadFixedGFX(entity, 0x1f5);
|
||||
sub_0801D2B4(entity, 0x16b);
|
||||
|
||||
@@ -62,7 +62,7 @@ void VaatiWrathEyeAction2(Entity* this) {
|
||||
sub_080485D8(this);
|
||||
if ((gScreenTransition.field_0x39 & 3) == 0) {
|
||||
this->action = 3;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->speed = 0x80;
|
||||
}
|
||||
}
|
||||
@@ -157,7 +157,7 @@ void VaatiWrathEyeAction7(Entity* this) {
|
||||
if (this->field_0xf != 0) {
|
||||
this->action = 8;
|
||||
this->actionDelay = 0x3c;
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->spriteSettings.b.draw = 0;
|
||||
CreateFx(this, FX_REFLECT2, 0x40);
|
||||
this->parent->field_0x7a.HALF.HI |= 0x10 << this->type;
|
||||
@@ -177,7 +177,7 @@ void VaatiWrathEyeAction8(Entity* this) {
|
||||
} else {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 9;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spriteSettings.b.draw = 1;
|
||||
InitializeAnimation(this, 0);
|
||||
sub_080485FC(this);
|
||||
|
||||
@@ -26,9 +26,9 @@ void sub_0802A434(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802A454(Entity* this) {
|
||||
if (this->damageType != 0x75 && ((this->bitfield & 0x7f) == 0 || (this->bitfield & 0x7f) == 0x1e)) {
|
||||
if (this->hitType != 0x75 && ((this->bitfield & 0x7f) == 0 || (this->bitfield & 0x7f) == 0x1e)) {
|
||||
this->action = 5;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->field_0x7c.HALF.HI = gPlayerEntity.x.HALF.HI;
|
||||
this->field_0x80.HWORD = gPlayerEntity.y.HALF.HI;
|
||||
this->field_0x82.HWORD = gPlayerEntity.height.HALF.HI;
|
||||
@@ -72,7 +72,7 @@ void sub_0802A534(Entity* this) {
|
||||
if (ent != NULL) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 0x5a;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spriteSettings.b.draw = 3;
|
||||
this->x.HALF.HI = ent->x.HALF.HI;
|
||||
this->y.HALF.HI = ent->y.HALF.HI;
|
||||
@@ -115,7 +115,7 @@ void sub_0802A610(Entity* this) {
|
||||
this->actionDelay = 0x1e;
|
||||
} else if (this->frames.all & 1) {
|
||||
this->frames.all = flags;
|
||||
this->damageType = 0x75;
|
||||
this->hitType = 0x75;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,9 +124,9 @@ void sub_0802A650(Entity* this) {
|
||||
this->height.HALF.HI -= 2;
|
||||
if (-0xa0 > this->height.HALF.HI) {
|
||||
this->action = 1;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->damageType = 0x74;
|
||||
this->hitType = 0x74;
|
||||
this->field_0x78.HWORD = this->field_0x7c.BYTES.byte0 * 0x3c;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ void sub_0802CC80(Entity* this) {
|
||||
case 0 ... 1:
|
||||
case 0x1e:
|
||||
this->action = 3;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
InitializeAnimation(this, 1);
|
||||
gPlayerEntity.flags &= ~0x80;
|
||||
break;
|
||||
|
||||
@@ -55,7 +55,7 @@ void sub_0802A2FC(Entity* this) {
|
||||
if (this->frames.all & 0x80) {
|
||||
DeleteEntity(this);
|
||||
} else if (this->frames.all & 1) {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
} else {
|
||||
sub_0802A39C(this);
|
||||
}
|
||||
@@ -76,9 +76,9 @@ void sub_0802A39C(Entity* this) {
|
||||
u32 x = (gPlayerEntity.x.HALF.HI - gRoomControls.roomScrollX + gScreen.bg.bg1xOffset) >> 3;
|
||||
u32 y = (gPlayerEntity.y.HALF.HI - gRoomControls.roomScrollY + gScreen.bg.bg1yOffset - 10) >> 3;
|
||||
if (gBG3Buffer[(x & 0x1fU) + (y & 0x1fU) * 0x20 + 0x400]) {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
} else {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -35,7 +35,7 @@ void sub_08033564(Entity* this) {
|
||||
case 0:
|
||||
this->action = 2;
|
||||
this->spriteSettings.b.draw = FALSE;
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->field_0x7c.HALF.LO = 0x27c;
|
||||
gPlayerState.flags |= 0x4000;
|
||||
gSave.stats.effect = this->type + 1;
|
||||
@@ -50,7 +50,7 @@ void sub_08033564(Entity* this) {
|
||||
this->currentHealth = 0;
|
||||
break;
|
||||
case 0x14:
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->iframes = 0;
|
||||
this->spriteSettings.b.draw = FALSE;
|
||||
ent = CreateFx(this, FX_DEATH, 0);
|
||||
@@ -119,7 +119,7 @@ void sub_080336DC(Entity* this) {
|
||||
break;
|
||||
case 0x0:
|
||||
this->action = 1;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
sub_08033744(this);
|
||||
break;
|
||||
}
|
||||
|
||||
+17
-17
@@ -66,14 +66,14 @@ void sub_0805E374(Entity* param_1) {
|
||||
|
||||
void sub_0805E3A0(void* ent, u32 param) {
|
||||
Entity* e = (Entity*)ent;
|
||||
e->scriptedScene2 = param;
|
||||
e->scriptedScene = param;
|
||||
e->updateConditions2 = param;
|
||||
e->updateConditions = param;
|
||||
}
|
||||
|
||||
bool32 sub_0805E3B0(Entity* this) {
|
||||
bool32 CheckDontUpdate(Entity* this) {
|
||||
u32 value;
|
||||
|
||||
if (this->flags & 0x10)
|
||||
if (this->flags & ENT_ASLEEP)
|
||||
return TRUE;
|
||||
if (this->action == 0)
|
||||
return FALSE;
|
||||
@@ -85,7 +85,7 @@ bool32 sub_0805E3B0(Entity* this) {
|
||||
|
||||
if (gMessage.doTextBox & 0x7F)
|
||||
value = value < 2 ? 2 : value;
|
||||
return value > this->scriptedScene;
|
||||
return value > this->updateConditions;
|
||||
}
|
||||
|
||||
bool32 sub_0805E40C(void) {
|
||||
@@ -124,16 +124,16 @@ void sub_0805E470(void) {
|
||||
}
|
||||
|
||||
void sub_0805E47C(Entity* this) {
|
||||
this->scriptedScene2 = this->scriptedScene;
|
||||
this->scriptedScene = 2;
|
||||
this->updateConditions2 = this->updateConditions;
|
||||
this->updateConditions = 2;
|
||||
if (sub_0805E450(2))
|
||||
gUnk_03003DC0.unk4 = this;
|
||||
}
|
||||
|
||||
void sub_0805E4A0(Entity* this) {
|
||||
sub_08078A90(1);
|
||||
this->scriptedScene2 = this->scriptedScene;
|
||||
this->scriptedScene = 3;
|
||||
this->updateConditions2 = this->updateConditions;
|
||||
this->updateConditions = 3;
|
||||
if (sub_0805E450(1))
|
||||
gUnk_03003DC0.unk4 = this;
|
||||
}
|
||||
@@ -145,8 +145,8 @@ void sub_0805E4CC(Entity* this) {
|
||||
|
||||
void sub_0805E4E0(Entity* a1, u32 a2) {
|
||||
if (a1 != NULL) {
|
||||
a1->scriptedScene2 = a1->scriptedScene;
|
||||
a1->scriptedScene = 3;
|
||||
a1->updateConditions2 = a1->updateConditions;
|
||||
a1->updateConditions = 3;
|
||||
}
|
||||
if (sub_0805E450(1u))
|
||||
gUnk_03003DC0.unk4 = a1;
|
||||
@@ -167,16 +167,16 @@ void sub_0805E524(void) {
|
||||
|
||||
void sub_0805E544(void) {
|
||||
gUnk_03003DC0.unk0 = 6;
|
||||
gPlayerEntity.scriptedScene = 6;
|
||||
gPlayerEntity.updateConditions = 6;
|
||||
}
|
||||
|
||||
void UnfreezeTime() {
|
||||
gUnk_03003DC0.unk0 = 0;
|
||||
gPlayerEntity.scriptedScene = 1;
|
||||
gPlayerEntity.updateConditions = 1;
|
||||
}
|
||||
|
||||
void sub_0805E584(Entity* e) {
|
||||
e->scriptedScene = e->scriptedScene2;
|
||||
e->updateConditions = e->updateConditions2;
|
||||
sub_0805E470();
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ void DeleteEntity(Entity* ent) {
|
||||
if (ent->kind == ENEMY) {
|
||||
sub_0804AA1C(ent);
|
||||
}
|
||||
ent->flags = ent->flags & 0x7f;
|
||||
COLLISION_OFF(ent);
|
||||
ent->spriteSettings.b.draw = 0;
|
||||
ent->field_0x3c = 0;
|
||||
ent->bitfield = 0;
|
||||
@@ -440,7 +440,7 @@ void sub_0805E9A8(void) {
|
||||
} while (++list < &gEntityLists[9]);
|
||||
}
|
||||
|
||||
void sub_0805E9F4(void) {
|
||||
void DeleteSleepingEntities(void) {
|
||||
Entity* ent;
|
||||
Entity* next;
|
||||
LinkedList* list;
|
||||
@@ -449,7 +449,7 @@ void sub_0805E9F4(void) {
|
||||
do {
|
||||
for (ent = list->first; (u32)ent != (u32)list; ent = next) {
|
||||
next = ent->next;
|
||||
if (ent->flags & 0x10)
|
||||
if (ent->flags & ENT_ASLEEP)
|
||||
DeleteEntityAny(ent);
|
||||
}
|
||||
} while (++list < &gEntityLists[9]);
|
||||
|
||||
+1
-1
@@ -259,7 +259,7 @@ void InitializePlayer(void) {
|
||||
MemClear((void*)&gUnk_03000B80, sizeof(gUnk_03000B80));
|
||||
MemClear((void*)&gPlayerState, 0xb0);
|
||||
|
||||
MemFill32(0xffffffff, &gPlayerState.field_0x40, 0x40);
|
||||
MemFill32(0xffffffff, &gPlayerState.hurtType, 0x40);
|
||||
pl = &gPlayerEntity;
|
||||
MemClear((void*)pl, 0x88);
|
||||
gRoomControls.cameraTarget = pl;
|
||||
|
||||
+125
-198
@@ -11,6 +11,7 @@
|
||||
#include "utils.h"
|
||||
#include "npc.h"
|
||||
#include "effects.h"
|
||||
#include "screen.h"
|
||||
|
||||
extern u8 gUnk_03003DE0;
|
||||
extern u8 gUnk_03000C30;
|
||||
@@ -22,15 +23,13 @@ extern u8 gUnk_03003DF0[];
|
||||
extern u8 gUnk_03003BE0;
|
||||
extern Entity* gUnk_03004040[3];
|
||||
extern u8 gUnk_020342F8;
|
||||
extern u8 gCollidableCount;
|
||||
extern void gDoCollision(void);
|
||||
|
||||
extern void sub_080ADD70();
|
||||
extern void sub_0801C25C();
|
||||
extern void UpdateDisplayControls();
|
||||
extern void LoadResources();
|
||||
extern void FadeMain();
|
||||
extern u32 sub_0805E3B0();
|
||||
extern u32 CheckDontUpdate();
|
||||
extern void HandlePlayerLife();
|
||||
extern void DoPlayerAction();
|
||||
extern void sub_080171F0();
|
||||
@@ -46,9 +45,11 @@ extern void sub_0807B0C8(void);
|
||||
extern void sub_0807A8D8(Entity*);
|
||||
extern void sub_08077FEC(u32);
|
||||
extern void ItemInit(Entity*);
|
||||
extern void sub_080A2838(Entity*);
|
||||
extern void InitObject(Entity*);
|
||||
extern u32 ReadBit(void*, u32);
|
||||
extern void sub_0806EC78(Entity*);
|
||||
extern void InitNPC(Entity*);
|
||||
extern void m4aSoundMain();
|
||||
extern void m4aSoundVSync();
|
||||
|
||||
typedef struct {
|
||||
u8 unk0;
|
||||
@@ -70,15 +71,108 @@ typedef struct {
|
||||
} NPCStruct;
|
||||
extern NPCStruct gUnk_02031EC0[100];
|
||||
|
||||
// todo: merge with screen.h
|
||||
typedef struct {
|
||||
void* last;
|
||||
void* first;
|
||||
void* node;
|
||||
u8 flags;
|
||||
} LinkedList2;
|
||||
u16 dest;
|
||||
u16 _2;
|
||||
u16 _4;
|
||||
u16 _6;
|
||||
u8* src;
|
||||
} DmaSettings;
|
||||
|
||||
extern LinkedList2 gUnk_03003C70[16];
|
||||
extern LinkedList2* gUnk_02018EA0;
|
||||
extern u16 gDmaPresets[];
|
||||
|
||||
struct {
|
||||
u8 update;
|
||||
u8 _0[0x1c];
|
||||
struct OamData oam[0x80];
|
||||
} extern gUnk_03000000;
|
||||
|
||||
struct {
|
||||
u8 ready;
|
||||
u16* src;
|
||||
u16* dest;
|
||||
u32 size;
|
||||
} extern gUnk_02022730;
|
||||
|
||||
void sub_08016CA8(DmaSettings* s);
|
||||
void sub_08016BF8(void);
|
||||
void DispCtrlSet(void);
|
||||
|
||||
extern u16 gUnk_080B2CD8[];
|
||||
|
||||
extern u32 gUnk_03000FBC;
|
||||
|
||||
void gIntrMain(void);
|
||||
|
||||
typedef void (*fp)(void);
|
||||
|
||||
void DummyIntr(void) {
|
||||
/* .. */
|
||||
}
|
||||
|
||||
void EnableVBlankIntr(void) {
|
||||
INTR_VECTOR = gIntrMain;
|
||||
REG_DISPSTAT = 0x5028;
|
||||
REG_IE = 0x2005;
|
||||
REG_IME = 1;
|
||||
}
|
||||
|
||||
void VBlankIntr(void) {
|
||||
DmaStop(0);
|
||||
m4aSoundVSync();
|
||||
if (gMain.interruptFlag == 0) {
|
||||
DispCtrlSet();
|
||||
DmaCopy32(0, &gUnk_03000FBC, &gUnk_02022730, 16);
|
||||
gMain.interruptFlag = 1;
|
||||
}
|
||||
sub_08016BF8();
|
||||
INTR_CHECK |= 1;
|
||||
}
|
||||
|
||||
void HBlankIntr(void) {
|
||||
REG_DISPSTAT = 0x5028;
|
||||
m4aSoundMain();
|
||||
}
|
||||
|
||||
void sub_08016BF8(void) {
|
||||
if (gUnk_02022730.ready) {
|
||||
const u16* src = gUnk_02022730.src;
|
||||
u16* dest = gUnk_02022730.dest;
|
||||
s32 size, i = size = gUnk_02022730.size;
|
||||
DmaSet(0, src, dest, size);
|
||||
|
||||
i = size & 0x3fff;
|
||||
if (i == 0) {
|
||||
i = 0x4000;
|
||||
}
|
||||
do {
|
||||
*dest++ = *src++;
|
||||
} while (--i > 0);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateDisplayControls(void) {
|
||||
if (gUnk_03000000.update && ((gScreen.lcd.displayControl & 0x1000) != 0)) {
|
||||
gUnk_03000000.update = 0;
|
||||
DmaCopy32(3, &gUnk_03000000.oam, 0x07000000, 0x400);
|
||||
}
|
||||
sub_08016CA8((DmaSettings*)&gScreen.bg.bg0Control);
|
||||
sub_08016CA8((DmaSettings*)&gScreen.bg.bg1Control);
|
||||
sub_08016CA8((DmaSettings*)&gScreen.affine.bg2Control);
|
||||
sub_08016CA8((DmaSettings*)&gScreen.affine.bg3Control);
|
||||
}
|
||||
|
||||
void sub_08016CA8(DmaSettings* s) {
|
||||
if (s->_6 && s->src != 0) {
|
||||
u32 dest;
|
||||
s->_6 = 0;
|
||||
dest = s->dest;
|
||||
DmaCopy32(3, s->src, ((dest << 3) & 0xF800) + 0x06000000, gUnk_080B2CD8[dest >> 14]);
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/dispCtrlSet.s", void DispCtrlSet(void));
|
||||
|
||||
// Load any resources that were requested with LoadResourceAsync
|
||||
void LoadResources(void) {
|
||||
@@ -133,16 +227,16 @@ void PlayerUpdate(Entity* this) {
|
||||
else
|
||||
gPlayerState.flags &= ~0x4000;
|
||||
|
||||
if (sub_0805E3B0(this) == 0) {
|
||||
if (CheckDontUpdate(this) == 0) {
|
||||
if ((gPlayerState.flags & 0x80000) != 0) {
|
||||
sub_08077B20();
|
||||
if ((gPlayerState.flags & 0x200000) != 0) {
|
||||
gPlayerState.playerAction = 0x18;
|
||||
gPlayerState.flags &= ~0x80000;
|
||||
gPlayerState.hurtBlinkSpeed = 0xf0;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
} else {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
gPlayerState.field_0xa8 = 0xf;
|
||||
}
|
||||
}
|
||||
@@ -185,8 +279,8 @@ void HandlePlayerLife(Entity* this) {
|
||||
|
||||
gPlayerState.field_0xa9 = gPlayerState.field_0xa8;
|
||||
gPlayerState.field_0xa8 = 0;
|
||||
if (gPlayerState.field_0x40[0x4a] != 0) {
|
||||
gPlayerState.field_0x40[0x4a]--;
|
||||
if (gPlayerState.hurtType[0x4a] != 0) {
|
||||
gPlayerState.hurtType[0x4a]--;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -243,7 +337,7 @@ void sub_080171F0(void) {
|
||||
|
||||
gPlayerEntity.bitfield &= ~0x80;
|
||||
if (gPlayerEntity.action != 0x14)
|
||||
gPlayerState.flags = (gPlayerState.flags & ~0x10000) | (0x10000 * (gPlayerState.flags & 2) / 2);
|
||||
COPY_FLAG_FROM_TO(gPlayerState.flags, 0x2, 0x10000);
|
||||
|
||||
gPlayerState.flags &= ~2;
|
||||
sub_080028E0(&gPlayerEntity);
|
||||
@@ -281,10 +375,10 @@ void sub_080171F0(void) {
|
||||
}
|
||||
|
||||
void ItemUpdate(Entity* this) {
|
||||
if ((this->flags & 1) == 0 && this->action == 0 && this->subAction == 0)
|
||||
if ((this->flags & ENT_DID_INIT) == 0 && this->action == 0 && this->subAction == 0)
|
||||
ItemInit(this);
|
||||
|
||||
if (!sub_0805E3B0(this)) {
|
||||
if (!CheckDontUpdate(this)) {
|
||||
gPlayerItemFunctions[this->id](this);
|
||||
this->bitfield &= ~0x80;
|
||||
if (this->iframes != 0) {
|
||||
@@ -309,9 +403,9 @@ NONMATCH("asm/non_matching/arm_proxy/ItemInit.inc", void ItemInit(Entity* this))
|
||||
}
|
||||
|
||||
this->palette.raw = ((entry->unk0 & 0xf) << 4) | entry->unk0;
|
||||
this->field_0x44 = entry->unk1;
|
||||
this->field_0x40 = entry->unk3;
|
||||
this->damageType = entry->unk4;
|
||||
this->damage = entry->unk1;
|
||||
this->hurtType = entry->unk3;
|
||||
this->hitType = entry->unk4;
|
||||
this->spriteIndex = entry->unk5;
|
||||
if (entry->unk6 == 0)
|
||||
this->spriteVramOffset = gPlayerEntity.spriteVramOffset;
|
||||
@@ -326,18 +420,16 @@ NONMATCH("asm/non_matching/arm_proxy/ItemInit.inc", void ItemInit(Entity* this))
|
||||
this->spritePriority.b0 = gPlayerEntity.spritePriority.b0;
|
||||
this->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
|
||||
this->currentHealth = 1;
|
||||
this->flags |= 1;
|
||||
this->flags |= ENT_DID_INIT;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void ObjectUpdate(Entity* this) {
|
||||
int iVar1;
|
||||
|
||||
if (((this->flags & 1) == 0) && (this->action == 0))
|
||||
sub_080A2838(this);
|
||||
if ((this->flags & ENT_DID_INIT) == 0 && this->action == 0)
|
||||
InitObject(this);
|
||||
if (this->iframes != 0)
|
||||
this->iframes++;
|
||||
if (!sub_0805E3B0(this)) {
|
||||
if (!CheckDontUpdate(this)) {
|
||||
gObjectFunctions[this->id](this);
|
||||
this->bitfield &= ~0x80;
|
||||
}
|
||||
@@ -345,7 +437,7 @@ void ObjectUpdate(Entity* this) {
|
||||
}
|
||||
|
||||
void ManagerUpdate(Entity* this) {
|
||||
if (!sub_0805E3B0(this))
|
||||
if (!CheckDontUpdate(this))
|
||||
gManagerFunctions[this->id](this);
|
||||
}
|
||||
|
||||
@@ -353,9 +445,9 @@ void ManagerUpdate(Entity* this) {
|
||||
NONMATCH("asm/non_matching/arm_proxy/NPCUpdate.inc", void NPCUpdate(Entity* this)) {
|
||||
if ((this->currentHealth & 0x7f) && !ReadBit(&gUnk_020342F8, this->currentHealth - 1))
|
||||
DeleteThisEntity();
|
||||
if ((this->action == 0) && ((this->flags & 1) == 0))
|
||||
sub_0806EC78(this);
|
||||
if (!sub_0805E3B0(this))
|
||||
if (this->action == 0 && (this->flags & ENT_DID_INIT) == 0)
|
||||
InitNPC(this);
|
||||
if (!CheckDontUpdate(this))
|
||||
gNPCFunctions[this->id][0](this);
|
||||
if (this->next != NULL) {
|
||||
if (gNPCFunctions[this->id][1] != NULL)
|
||||
@@ -369,168 +461,3 @@ NONMATCH("asm/non_matching/arm_proxy/NPCUpdate.inc", void NPCUpdate(Entity* this
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void ClearHitboxList(void) {
|
||||
gCollidableCount = 0;
|
||||
}
|
||||
|
||||
void CollisionMain(void) {
|
||||
void (*doCollision)(void);
|
||||
u32 flags;
|
||||
u32 temp;
|
||||
|
||||
temp = gUnk_03003DC0.unk0;
|
||||
if (gUnk_03003DC0.unk0 <= gUnk_03003DC0.unk1)
|
||||
temp = gUnk_03003DC0.unk1;
|
||||
if (temp != 0)
|
||||
return;
|
||||
|
||||
doCollision = &gDoCollision;
|
||||
// Check to see if we should disable collision this frame
|
||||
if (gPlayerState.field_0x8b != 0) {
|
||||
u32 temp = gPlayerEntity.flags;
|
||||
gPlayerEntity.flags &= ~0x80;
|
||||
doCollision();
|
||||
gPlayerEntity.flags = temp; // reset collision to before
|
||||
} else {
|
||||
doCollision();
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterPlayerHitbox(void) {
|
||||
MemClear(&gUnk_03003C70, sizeof(gUnk_03003C70));
|
||||
gUnk_02018EA0 = (LinkedList2*)&gUnk_03003C70[0].last;
|
||||
gUnk_03003C70[0].last = &gUnk_03003C70[0].last;
|
||||
gUnk_03003C70[0].first = &gUnk_03003C70[0].last;
|
||||
gUnk_03003C70[0].node = &gPlayerEntity;
|
||||
}
|
||||
|
||||
// Loop declaration seems wrong
|
||||
NONMATCH("asm/non_matching/arm_proxy/sub_0801766C.inc", u32 sub_0801766C(Entity* this)) {
|
||||
u32 uVar1;
|
||||
LinkedList2* puVar3;
|
||||
LinkedList2* puVar2;
|
||||
LinkedList2* pLVar2;
|
||||
LinkedList2* i;
|
||||
u8* pbVar4;
|
||||
|
||||
if (this->spritePriority.b2 != 0) {
|
||||
return 1;
|
||||
} else {
|
||||
for (i = &gUnk_03003C70[0]; i < &gUnk_03003C70[16]; ++i) {
|
||||
if (i->node == NULL) {
|
||||
i->node = this;
|
||||
i->flags = 0;
|
||||
this->spritePriority.b2 = 1;
|
||||
pLVar2 = gUnk_02018EA0;
|
||||
if (gUnk_02018EA0->flags != 0) {
|
||||
do {
|
||||
pLVar2 = pLVar2->first;
|
||||
} while (pLVar2->flags != 0);
|
||||
i->first = pLVar2;
|
||||
puVar3 = pLVar2->last;
|
||||
i->last = puVar3;
|
||||
puVar3->first = i;
|
||||
pLVar2->last = i;
|
||||
} else {
|
||||
i->first = gUnk_02018EA0;
|
||||
puVar2 = gUnk_02018EA0->last;
|
||||
i->last = puVar2;
|
||||
puVar2->first = i;
|
||||
gUnk_02018EA0->last = i;
|
||||
gUnk_02018EA0 = i;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
// same loop issue
|
||||
NONMATCH("asm/non_matching/arm_proxy/sub_080176E4.inc", u32 sub_080176E4(Entity* this)) {
|
||||
u32 uVar1;
|
||||
LinkedList2* j;
|
||||
LinkedList2* i;
|
||||
u8* pbVar4;
|
||||
|
||||
if (this->spritePriority.b2 != 0) {
|
||||
return 1;
|
||||
} else {
|
||||
for (i = &gUnk_03003C70[0]; i < &gUnk_03003C70[16]; ++i) {
|
||||
if (i->node == NULL) {
|
||||
i->node = this;
|
||||
i->flags = 1;
|
||||
this->spritePriority.b2 = 1;
|
||||
i->first = gUnk_02018EA0;
|
||||
j = gUnk_02018EA0->last;
|
||||
i->last = j;
|
||||
j->first = i;
|
||||
gUnk_02018EA0->last = i;
|
||||
gUnk_02018EA0 = i;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
// you guessed it
|
||||
NONMATCH("asm/non_matching/arm_proxy/sub_08017744.inc", void sub_08017744(Entity* this)) {
|
||||
LinkedList2* i;
|
||||
for (i = &gUnk_03003C70[0]; i < &gUnk_03003C70[16]; ++i) {
|
||||
if (i->node == this) {
|
||||
if (this->spritePriority.b2 != 0) {
|
||||
this->spritePriority.b2 = 0;
|
||||
i->node = NULL;
|
||||
((LinkedList2*)i->last)->first = i->first;
|
||||
((LinkedList2*)i->first)->last = i->last;
|
||||
if (i != gUnk_02018EA0)
|
||||
return;
|
||||
gUnk_02018EA0 = i->first;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
// regalloc
|
||||
NONMATCH("asm/non_matching/arm_proxy/sub_080177A0.inc", bool32 sub_080177A0(Entity* this, Entity* that)) {
|
||||
u32 this_d;
|
||||
u32 depth;
|
||||
|
||||
if ((that->collisionLayer & this->collisionLayer) != 0) {
|
||||
Hitbox* bb_this = this->hitbox;
|
||||
Hitbox* bb_that = that->hitbox;
|
||||
u32 this_w = bb_this->width;
|
||||
u32 that_w = bb_that->width;
|
||||
if ((((this->x.HALF.HI - that->x.HALF.HI) + bb_this->offset_x) - bb_that->offset_x) + this_w + that_w <=
|
||||
(this_w + that_w) * 2) {
|
||||
u32 this_h = bb_this->height;
|
||||
u32 that_h = bb_that->height;
|
||||
if ((((this->y.HALF.HI - that->y.HALF.HI) + bb_this->offset_y) - bb_that->offset_y) + this_h + that_h <=
|
||||
(this_h + that_h) * 2) {
|
||||
if ((this->field_0x3c & 0x10) != 0)
|
||||
this_d = ((Hitbox3D*)bb_this)->depth;
|
||||
else
|
||||
this_d = 5;
|
||||
if ((that->field_0x3c & 0x10) != 0)
|
||||
depth = this_d + ((Hitbox3D*)bb_that)->depth;
|
||||
else
|
||||
depth = this_d + 5;
|
||||
if ((this->height.HALF.HI - that->height.HALF.HI) + depth <= depth * 2)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
bool32 sub_08017850(Entity* this) {
|
||||
if (sub_08079F8C())
|
||||
return sub_080177A0(this, &gPlayerEntity);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ void sub_08075694(ItemBehavior* this, u32 arg1) {
|
||||
gPlayerState.field_0xa = (8 >> arg1) | gPlayerState.field_0xa;
|
||||
this->stateID = 4;
|
||||
this->field_0xf = 6;
|
||||
gPlayerEntity.field_0x40 = 0x1e;
|
||||
gPlayerEntity.hurtType = 0x1e;
|
||||
gPlayerState.field_0x1a[1] |= 0x40;
|
||||
gPlayerState.field_0x1a[1] &= 0xdf;
|
||||
if ((gPlayerState.field_0xa0[0] == 0x04) && ((gPlayerState.flags & 0x400000) == 0)) {
|
||||
@@ -122,7 +122,7 @@ ASM_FUNC("asm/non_matching/itemSword/sub_08075900.inc", void sub_08075900(ItemBe
|
||||
|
||||
void sub_080759B8(ItemBehavior* this, u32 arg1) {
|
||||
if ((gPlayerState.flags & 0x80) == 0) {
|
||||
gPlayerEntity.field_0x40 = 0;
|
||||
gPlayerEntity.hurtType = 0;
|
||||
}
|
||||
gPlayerState.flags &= 0xf7ffffff;
|
||||
gPlayerState.field_0x1a[1] = 0;
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ static void sub_08055F70(void) {
|
||||
}
|
||||
|
||||
DispReset(0);
|
||||
sub_08016B34();
|
||||
EnableVBlankIntr();
|
||||
}
|
||||
|
||||
#define SOFT_RESET_KEYS (A_BUTTON | B_BUTTON | SELECT_BUTTON | START_BUTTON)
|
||||
|
||||
+4
-4
@@ -66,8 +66,8 @@ void sub_080677EC(Entity* this) {
|
||||
this->direction = 8;
|
||||
this->speed = 0x80;
|
||||
this->field_0x3c = 7;
|
||||
this->field_0x40 = 0x48;
|
||||
this->damageType = -0x58;
|
||||
this->hurtType = 0x48;
|
||||
this->hitType = -0x58;
|
||||
this->flags2 = 1;
|
||||
this->field_0x68.HALF.HI = 0xff;
|
||||
if (this->x.HALF.HI < gPlayerEntity.x.HALF.HI) {
|
||||
@@ -183,7 +183,7 @@ void sub_08067A0C(Entity* this) {
|
||||
} else {
|
||||
tmp = (this->frames.all & 7);
|
||||
if (tmp != 0) {
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->hitbox = gUnk_08111154[tmp - 1 + ((this->spriteSettings.b.flipX << 2))];
|
||||
} else {
|
||||
sub_08067DDC(this);
|
||||
@@ -381,7 +381,7 @@ void sub_08067DCC(Entity* this, u32 param) {
|
||||
}
|
||||
|
||||
void sub_08067DDC(Entity* this) {
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->bitfield = 0;
|
||||
this->iframes = 0;
|
||||
this->hitbox = &gUnk_08110EF0;
|
||||
|
||||
+3
-3
@@ -134,11 +134,11 @@ void sub_08060AE0(Entity* this) {
|
||||
this->myHeap = (u32*)heapObj;
|
||||
heapObj->unk_0b = 0x20;
|
||||
this->action = 1;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->animationState &= 3;
|
||||
this->field_0x3c = 7;
|
||||
this->field_0x40 = 0x48;
|
||||
this->damageType = 0x49;
|
||||
this->hurtType = 0x48;
|
||||
this->hitType = 0x49;
|
||||
this->flags2 = 3;
|
||||
this->hitbox = &gUnk_080FD150;
|
||||
this->field_0x17 &= 0xfe;
|
||||
|
||||
+4
-4
@@ -15,8 +15,8 @@ void Button(Entity* this) {
|
||||
extern u32 sub_08081E3C(Entity*);
|
||||
|
||||
void sub_08081AE0(Entity* this) {
|
||||
this->flags &= 0x7F;
|
||||
this->scriptedScene = 3;
|
||||
COLLISION_OFF(this);
|
||||
this->updateConditions = 3;
|
||||
this->y.HALF.HI++;
|
||||
if (this->cutsceneBeh.HWORD != 0) {
|
||||
this->collisionLayer = this->cutsceneBeh.HWORD;
|
||||
@@ -234,13 +234,13 @@ u32 sub_08081F00(u32* unk1, u32* unk2) {
|
||||
void sub_08081F24(Entity* this) {
|
||||
Entity* fx = CreateFx(this, FX_DASH, 0x40);
|
||||
if (fx) {
|
||||
fx->scriptedScene = 3;
|
||||
fx->updateConditions = 3;
|
||||
fx->x.HALF.HI += 7;
|
||||
fx->y.HALF.HI += 5;
|
||||
}
|
||||
fx = CreateFx(this, FX_DASH, 0x40);
|
||||
if (fx) {
|
||||
fx->scriptedScene = 3;
|
||||
fx->updateConditions = 3;
|
||||
fx->x.HALF.HI -= 7;
|
||||
fx->y.HALF.HI += 5;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ static void sub_0808E6A0(Entity* this) {
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->hitbox = &gUnk_08121C58;
|
||||
this->collisionLayer = 3;
|
||||
this->scriptedScene = 3;
|
||||
this->updateConditions = 3;
|
||||
}
|
||||
|
||||
static void sub_0808E6E4(Entity* this) {
|
||||
|
||||
+19
-19
@@ -50,7 +50,7 @@ void ItemOnGround(Entity* this) {
|
||||
switch (this->bitfield & 0x7F) {
|
||||
case 20:
|
||||
this->action = 3;
|
||||
this->flags &= 0x7F;
|
||||
COLLISION_OFF(this);
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->field_0x3c |= 0x10;
|
||||
this->attachedEntity = this->field_0x4c;
|
||||
@@ -93,22 +93,22 @@ void sub_08080F20(Entity* this) {
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spritePriority.b1 = 3;
|
||||
this->spriteSettings.b.shadow = 0;
|
||||
this->damageType = 7;
|
||||
this->hitType = 7;
|
||||
this->field_0x3c = 0x47;
|
||||
this->field_0x40 = 0x44;
|
||||
this->hurtType = 0x44;
|
||||
this->currentHealth = 0xFF;
|
||||
this->hitbox = &gUnk_080FD1A8;
|
||||
switch (this->type - 0x3F) {
|
||||
case 0:
|
||||
case 21:
|
||||
case 22:
|
||||
case 23:
|
||||
case 24:
|
||||
case 25:
|
||||
case 29:
|
||||
case 30:
|
||||
case 31:
|
||||
case 32:
|
||||
switch (this->type) {
|
||||
case 0x3f:
|
||||
case 0x54:
|
||||
case 0x55:
|
||||
case 0x56:
|
||||
case 0x57:
|
||||
case 0x58:
|
||||
case 0x5c:
|
||||
case 0x5d:
|
||||
case 0x5e:
|
||||
case 0x5f:
|
||||
this->flags2 = 0x17;
|
||||
break;
|
||||
default:
|
||||
@@ -165,7 +165,7 @@ void sub_080810FC(Entity* this) {
|
||||
} else {
|
||||
this->action = 2;
|
||||
this->subAction = 0;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->flags2 = 0x11;
|
||||
CopyPosition(&gPlayerEntity, this);
|
||||
}
|
||||
@@ -179,7 +179,7 @@ void sub_08081134(Entity* this) {
|
||||
|
||||
void sub_08081150(Entity* this) {
|
||||
this->action = 2;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->height.HALF.HI = -0x80;
|
||||
this->spriteOrientation.flipY = 1;
|
||||
this->spriteRendering.b3 = 1;
|
||||
@@ -188,7 +188,7 @@ void sub_08081150(Entity* this) {
|
||||
|
||||
void sub_08081188(Entity* this) {
|
||||
this->action = 2;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
if (this->collisionLayer == 2) {
|
||||
sub_08016A30(this);
|
||||
}
|
||||
@@ -220,7 +220,7 @@ void sub_080811EC(Entity* this) {
|
||||
sub_08003FC4(this, 0x2800);
|
||||
if (this->hVelocity <= 0) {
|
||||
this->action = 2;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
sub_080814A4(this);
|
||||
}
|
||||
}
|
||||
@@ -430,7 +430,7 @@ void sub_08081598(Entity* this) {
|
||||
sub_08081404(this, 1);
|
||||
}
|
||||
|
||||
this->flags &= 0x7F;
|
||||
COLLISION_OFF(this);
|
||||
this->action = 4;
|
||||
this->actionDelay = 14;
|
||||
this->hVelocity = 0x20000;
|
||||
|
||||
@@ -20,10 +20,10 @@ void JarPortal(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0808BE9C(Entity* this) {
|
||||
this->flags |= 0x80;
|
||||
this->damageType = 1;
|
||||
COLLISION_ON(this);
|
||||
this->hitType = 1;
|
||||
this->field_0x3c = 0x47;
|
||||
this->field_0x40 = 0x44;
|
||||
this->hurtType = 0x44;
|
||||
this->flags2 = 0x80;
|
||||
this->field_0x68.HALF.LO = 0;
|
||||
if (CheckLocalFlag(this->type)) {
|
||||
|
||||
@@ -26,11 +26,11 @@ void sub_0809EA1C(Entity* this) {
|
||||
|
||||
void sub_0809EA34(Entity* this) {
|
||||
this->action = 1;
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->frameIndex = 0;
|
||||
this->field_0x3c = 7;
|
||||
this->field_0x40 = 0x48;
|
||||
this->damageType = 0x28;
|
||||
this->hurtType = 0x48;
|
||||
this->hitType = 0x28;
|
||||
this->flags2 = 10;
|
||||
this->hitbox = &gUnk_080FD150;
|
||||
sub_0809EAD8(this);
|
||||
@@ -98,11 +98,11 @@ void sub_0809EB68(Entity* this) {
|
||||
void sub_0809EB80(Entity* this) {
|
||||
|
||||
this->action = 1;
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->frameIndex = 3;
|
||||
this->field_0x3c = 7;
|
||||
this->field_0x40 = 0x48;
|
||||
this->damageType = 0x28;
|
||||
this->hurtType = 0x48;
|
||||
this->hitType = 0x28;
|
||||
this->flags2 = 10;
|
||||
this->hitbox = &gUnk_080FD150;
|
||||
sub_0809EAD8(this);
|
||||
|
||||
+12
-12
@@ -45,10 +45,10 @@ void sub_080916EC(Entity* this) {
|
||||
this->type2 = unk->field_0x6;
|
||||
this->action = 1;
|
||||
this->hitbox = &gUnk_080FD310;
|
||||
this->flags |= 0x80;
|
||||
this->damageType = 1;
|
||||
COLLISION_ON(this);
|
||||
this->hitType = 1;
|
||||
this->field_0x3c = 0x47;
|
||||
this->field_0x40 = 0x44;
|
||||
this->hurtType = 0x44;
|
||||
this->flags2 = 0x80;
|
||||
this->direction = DirectionFromAnimationState(this->animationState);
|
||||
this->speed = 0x700;
|
||||
@@ -105,12 +105,12 @@ void sub_080918A4(Entity* this) {
|
||||
gPlayerState.flags = (gPlayerState.flags ^ 0x4000000) | 0x1000;
|
||||
this->action++;
|
||||
this->field_0xf = 1;
|
||||
this->flags |= 0x20;
|
||||
this->damageType = 0x97;
|
||||
this->flags |= ENT_20;
|
||||
this->hitType = 0x97;
|
||||
this->field_0x3c = (gPlayerEntity.field_0x3c + 1) | 0x20;
|
||||
this->flags2 = gPlayerEntity.flags2;
|
||||
this->field_0x40 = 0x18;
|
||||
this->field_0x44 = 8;
|
||||
this->hurtType = 0x18;
|
||||
this->damage = 8;
|
||||
sub_0801766C(this);
|
||||
sub_0807BA8C(COORD_TO_TILE(this), this->collisionLayer);
|
||||
SoundReq(SFX_137);
|
||||
@@ -134,7 +134,7 @@ void sub_080919AC(Entity* this) {
|
||||
}
|
||||
|
||||
if ((gPlayerEntity.frames.all & 0xf) == 0) {
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
CopyPosition(this, &gPlayerEntity);
|
||||
if ((gPlayerEntity.frames.all & 0xf0) == 0x10) {
|
||||
this->spriteOffsetY = 1;
|
||||
@@ -142,7 +142,7 @@ void sub_080919AC(Entity* this) {
|
||||
this->spriteOffsetY = 0;
|
||||
}
|
||||
} else {
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
gPlayerEntity.speed = 0;
|
||||
sub_0806F69C(this);
|
||||
CopyPosition(this, &gPlayerEntity);
|
||||
@@ -166,10 +166,10 @@ void sub_080919AC(Entity* this) {
|
||||
} else {
|
||||
switch (uVar3) {
|
||||
case 0x64:
|
||||
this->flags = this->flags & 0xdf;
|
||||
this->damageType = 1;
|
||||
this->flags &= ~ENT_20;
|
||||
this->hitType = 1;
|
||||
this->field_0x3c = 0x47;
|
||||
this->field_0x40 = 0x44;
|
||||
this->hurtType = 0x44;
|
||||
this->flags2 = 0x80;
|
||||
this->action = 6;
|
||||
sub_08017744(this);
|
||||
|
||||
@@ -28,15 +28,15 @@ void MineralWaterSource_Init(Entity* this) {
|
||||
unknownParameters = &MineralWaterSourceParameters[this->type];
|
||||
|
||||
this->type2 = unknownParameters->field_0x00;
|
||||
this->field_0x40 = unknownParameters->field_0x03;
|
||||
this->hurtType = unknownParameters->field_0x03;
|
||||
|
||||
this->hitbox->width = unknownParameters->field_0x01;
|
||||
this->hitbox->height = unknownParameters->field_0x02;
|
||||
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
|
||||
this->field_0x3c = 7;
|
||||
this->damageType = 145;
|
||||
this->hitType = 145;
|
||||
this->flags2 = 2;
|
||||
|
||||
this->action = 1;
|
||||
|
||||
@@ -188,14 +188,14 @@ void sub_0808F3DC(Entity* this) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
this->damageType = this->attachedEntity->damageType;
|
||||
this->attachedEntity->damageType = 0x7E;
|
||||
this->hitType = this->attachedEntity->hitType;
|
||||
this->attachedEntity->hitType = 0x7E;
|
||||
}
|
||||
ResolveEntityOnTop(this->attachedEntity, this);
|
||||
} else {
|
||||
if (*(u32*)&this->parent->field_0x74 == 0) {
|
||||
if (this->type == 8) {
|
||||
this->attachedEntity->damageType = this->damageType;
|
||||
this->attachedEntity->hitType = this->hitType;
|
||||
}
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
@@ -16,13 +16,13 @@ void Object9E(Entity* this) {
|
||||
this->action = 1;
|
||||
this->spritePriority.b0 = 6;
|
||||
if (this->type == 0) {
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->frameIndex = 1;
|
||||
layer = &this->collisionLayer;
|
||||
*layer = 1;
|
||||
this->field_0x3c = 7;
|
||||
this->field_0x40 = 0x48;
|
||||
this->damageType = 0x7a;
|
||||
this->hurtType = 0x48;
|
||||
this->hitType = 0x7a;
|
||||
this->flags2 = 1;
|
||||
this->hitbox = &gUnk_080FD168;
|
||||
tilePos = COORD_TO_TILE(this);
|
||||
|
||||
+5
-5
@@ -37,10 +37,10 @@ void sub_0808222C(Entity* this) {
|
||||
this->speed = 0x80;
|
||||
this->y.HALF.HI += 3;
|
||||
this->field_0x16 = 0;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->currentHealth = 1;
|
||||
this->field_0x3c = 7;
|
||||
this->damageType = 0x6E;
|
||||
this->hitType = 0x6E;
|
||||
this->flags2 = 0x84;
|
||||
this->field_0x1c = 0x12;
|
||||
if (this->collisionLayer == 0) {
|
||||
@@ -71,7 +71,7 @@ void sub_08082310(Entity* this) {
|
||||
this->spriteOffsetY = 0;
|
||||
this->spriteSettings.b.shadow = 1;
|
||||
this->spritePriority.b1 = 3;
|
||||
this->flags &= 0x7F;
|
||||
COLLISION_OFF(this);
|
||||
sub_08082824(this);
|
||||
break;
|
||||
default:
|
||||
@@ -118,10 +118,10 @@ void sub_080824F8(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08082510(Entity* this) {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->hitbox = &gUnk_080FD340;
|
||||
this->field_0x3c = 7;
|
||||
this->damageType = 1;
|
||||
this->hitType = 1;
|
||||
this->flags2 = gPlayerEntity.flags2;
|
||||
this->spriteOffsetY = 0;
|
||||
SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
|
||||
|
||||
@@ -41,7 +41,7 @@ void sub_0808B474(Entity* this) {
|
||||
this->palette.b.b0 = tmp;
|
||||
this->spritePriority.b0 = 6;
|
||||
this->hitbox = &gUnk_080FD168;
|
||||
this->scriptedScene = 3;
|
||||
this->updateConditions = 3;
|
||||
InitializeAnimation(this, 0);
|
||||
if (CheckFlags(this->field_0x86.HWORD)) {
|
||||
sub_0808B830(this);
|
||||
|
||||
+32
-32
@@ -90,13 +90,13 @@ void PlayerInit(Entity* this) {
|
||||
gPlayerState.field_0x0[0] = 0xff;
|
||||
gPlayerState.startPosX = gPlayerEntity.x.HALF.HI;
|
||||
gPlayerState.startPosY = gPlayerEntity.y.HALF.HI;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spritePriority.b0 = 0xc;
|
||||
this->spritePriority.b1 = 1;
|
||||
this->spriteSettings.b.shadow = 1;
|
||||
this->field_0x16 = 0x20;
|
||||
this->flags2 = 8;
|
||||
this->damageType = 0x79;
|
||||
this->hitType = 0x79;
|
||||
this->hitbox = &gUnk_08114F88;
|
||||
this->spriteIndex = 1;
|
||||
#ifndef EU
|
||||
@@ -168,7 +168,7 @@ void sub_08070C3C(Entity* this) {
|
||||
gPlayerState.field_0x8 = 0x1b8;
|
||||
|
||||
this->subAction++;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->spritePriority.b1 = 0;
|
||||
ResetPlayer();
|
||||
sub_0807A108();
|
||||
@@ -197,7 +197,7 @@ void PlayerBounce(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08070D38(Entity* this) {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->direction = ((this->animationState & 0xe) << 2) ^ 0x10;
|
||||
this->speed = 0x100;
|
||||
this->knockbackDuration = 0;
|
||||
@@ -246,7 +246,7 @@ NONMATCH("asm/non_matching/player/sub_08070DC4.inc", void sub_08070DC4(Entity* t
|
||||
return;
|
||||
}
|
||||
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
|
||||
if ((gPlayerState.field_0x14 == 0) && sub_08008B22()) {
|
||||
gPlayerState.field_0x10[1] = 7;
|
||||
@@ -285,7 +285,7 @@ void sub_08070E9C(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08070EDC(Entity* this) {
|
||||
this->scriptedScene = 2;
|
||||
this->updateConditions = 2;
|
||||
|
||||
if ((gMessage.doTextBox & 0x7f) != 0)
|
||||
this->subAction = 1;
|
||||
@@ -299,7 +299,7 @@ void sub_08070EDC(Entity* this) {
|
||||
void sub_08070f24(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
this->scriptedScene = this->scriptedScene2;
|
||||
this->updateConditions = this->updateConditions2;
|
||||
sub_080791D0();
|
||||
}
|
||||
}
|
||||
@@ -309,7 +309,7 @@ void PlayerItemGet(Entity* this) {
|
||||
u8* temp; // todo: retype
|
||||
|
||||
gPlayerState.field_0xa8 = 0x15;
|
||||
this->flags &= ~(0x80);
|
||||
COLLISION_OFF(this);
|
||||
gUnk_0811BA7C[this->subAction](this);
|
||||
|
||||
child = this->attachedEntity;
|
||||
@@ -486,7 +486,7 @@ void sub_08071208(Entity* this) {
|
||||
void PlayerDrown(Entity* this) {
|
||||
gPlayerState.field_0xa8 = 0x16;
|
||||
gPlayerState.flags |= 4;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
gUnk_0811BA94[this->subAction](this);
|
||||
}
|
||||
|
||||
@@ -568,7 +568,7 @@ void PortalJumpOnUpdate(Entity* this) {
|
||||
u16 x;
|
||||
u16 y;
|
||||
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->knockbackDuration = 0;
|
||||
|
||||
x = gArea.curPortalX;
|
||||
@@ -735,7 +735,7 @@ void PlayerTalkEzlo(Entity* this) {
|
||||
sub_08071A6C();
|
||||
} else {
|
||||
gPlayerState.field_0xa8 = 0x13;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
gUnk_0811BAD4[this->subAction](this);
|
||||
}
|
||||
}
|
||||
@@ -745,7 +745,7 @@ void sub_080718A0(Entity* this) {
|
||||
gUnk_03000B80.filler[0x63] = 0;
|
||||
this->iframes = 0;
|
||||
gUnk_03003DC0.unk0 = 6;
|
||||
this->scriptedScene = 6;
|
||||
this->updateConditions = 6;
|
||||
|
||||
if (gPlayerState.flags & 0x80) {
|
||||
this->subAction = 2;
|
||||
@@ -838,7 +838,7 @@ void sub_08071A4C(Entity* this) {
|
||||
|
||||
void sub_08071A6C(void) {
|
||||
gUnk_03003DC0.unk0 = 0;
|
||||
gPlayerEntity.scriptedScene = gPlayerEntity.scriptedScene2;
|
||||
gPlayerEntity.updateConditions = gPlayerEntity.updateConditions2;
|
||||
}
|
||||
|
||||
void PlayerPush(Entity* this) {
|
||||
@@ -901,7 +901,7 @@ void sub_08071B60(Entity* this) {
|
||||
extern void (*const gUnk_0811BB2C[])(Entity*);
|
||||
|
||||
void PlayerMinishDie(Entity* this) {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
gUnk_0811BB2C[this->subAction](this);
|
||||
gPlayerState.field_0xa8 = 0x12;
|
||||
}
|
||||
@@ -1101,7 +1101,7 @@ void PlayerFrozen(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08071F50(Entity* this) {
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->actionDelay = 0x78;
|
||||
this->subAction++;
|
||||
gPlayerState.field_0x8 = 0x294;
|
||||
@@ -1141,7 +1141,7 @@ void sub_08071F80(Entity* this) {
|
||||
void sub_08072008(Entity* this) {
|
||||
this->iframes = 160;
|
||||
this->knockbackDuration = 0;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spriteOffsetX = 0;
|
||||
gPlayerState.flags &= ~(0x800 | 0x1);
|
||||
CreateFx(this, FX_ICE, 0);
|
||||
@@ -1156,7 +1156,7 @@ void sub_0807204C(Entity* this) {
|
||||
|
||||
void sub_08072064(Entity* this) {
|
||||
this->subAction = 1;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->actionDelay = gPlayerState.field_0x3a;
|
||||
gPlayerState.field_0x8 = gPlayerState.field_0x38 | (gPlayerState.field_0x39 << 8);
|
||||
ResetPlayer();
|
||||
@@ -1173,7 +1173,7 @@ void sub_08072098(Entity* this) {
|
||||
return;
|
||||
|
||||
if (this->currentHealth != 0)
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
sub_080791BC();
|
||||
}
|
||||
|
||||
@@ -1190,7 +1190,7 @@ void sub_08072100(Entity* this) {
|
||||
this->hitbox = &gUnk_08114F88;
|
||||
this->actionDelay = gPlayerState.field_0x38;
|
||||
this->subAction = 1;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
if (gPlayerState.field_0x39)
|
||||
this->direction = 0xff;
|
||||
|
||||
@@ -1218,7 +1218,7 @@ void sub_08072168(Entity* this) {
|
||||
sub_08019840();
|
||||
if (--this->actionDelay == 0xff) {
|
||||
this->knockbackDuration = 0;
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
sub_080791BC();
|
||||
}
|
||||
@@ -1272,7 +1272,7 @@ void PlayerLava(Entity* this) {
|
||||
void sub_080722DC(Entity* this) {
|
||||
Entity* ent;
|
||||
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
if (!(gPlayerState.flags & 0x80)) {
|
||||
this->subAction = 1;
|
||||
this->hVelocity = 0x28000;
|
||||
@@ -1368,7 +1368,7 @@ void sub_080724DC(Entity* this) {
|
||||
sub_0807AE20(this);
|
||||
}
|
||||
if (gRoomControls.unk2 == 0) {
|
||||
this->scriptedScene = this->scriptedScene2;
|
||||
this->updateConditions = this->updateConditions2;
|
||||
sub_080728AC(this);
|
||||
} else if (gPlayerState.field_0x1c == 0) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
@@ -1394,7 +1394,7 @@ void sub_0807258C(Entity* this) {
|
||||
if (sub_080797C4() != 0) {
|
||||
gPlayerState.startPosX = gPlayerEntity.x.HALF.HI;
|
||||
gPlayerState.startPosY = gPlayerEntity.y.HALF.HI;
|
||||
this->scriptedScene = this->scriptedScene2;
|
||||
this->updateConditions = this->updateConditions2;
|
||||
sub_080728AC(this);
|
||||
} else {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
@@ -1402,7 +1402,7 @@ void sub_0807258C(Entity* this) {
|
||||
} else {
|
||||
gPlayerState.startPosX = gPlayerEntity.x.HALF.HI;
|
||||
gPlayerState.startPosY = gPlayerEntity.y.HALF.HI;
|
||||
this->scriptedScene = this->scriptedScene2;
|
||||
this->updateConditions = this->updateConditions2;
|
||||
sub_080728AC(this);
|
||||
}
|
||||
}
|
||||
@@ -1433,7 +1433,7 @@ void sub_08072650(Entity* this) {
|
||||
this->spritePriority.b1 = 0;
|
||||
gPlayerState.field_0x8 = 0xc08;
|
||||
} else {
|
||||
*(u8*)&this->field_0x40 = 0x1e;
|
||||
*(u8*)&this->hurtType = 0x1e;
|
||||
if (temp & 8) {
|
||||
gPlayerState.field_0x8 = 0x438;
|
||||
} else {
|
||||
@@ -1509,7 +1509,7 @@ void sub_080726F4(Entity* this) {
|
||||
sub_08079E08();
|
||||
}
|
||||
if (((this->frames.all & 0x10) == 0) && ((gPlayerState.flags & 0x80) == 0)) {
|
||||
*(u8*)&this->field_0x40 = 0;
|
||||
*(u8*)&this->hurtType = 0;
|
||||
}
|
||||
if ((this->frames.all & 0x40) != 0) {
|
||||
sub_08077698(this);
|
||||
@@ -1539,7 +1539,7 @@ void sub_080728AC(Entity* this) {
|
||||
|
||||
if (!(gRoomControls.unk6 & 4)) {
|
||||
if ((gPlayerState.flags & 0x40))
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
sub_080791D0();
|
||||
}
|
||||
if (!(gPlayerState.flags & 2)) {
|
||||
@@ -1559,7 +1559,7 @@ void sub_08072970(Entity* this) {
|
||||
this->subAction = 1;
|
||||
this->x.HALF.HI = (this->x.HALF.HI & ~0xF) | 8;
|
||||
this->y.HALF.HI = (this->y.HALF.HI & ~0XF) | 10;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->spritePriority.b0 = 7;
|
||||
this->spritePriority.b1 = 0;
|
||||
this->actionDelay = 0;
|
||||
@@ -1604,7 +1604,7 @@ void sub_08072ACC(Entity* this) {
|
||||
if (gPlayerState.field_0xd == 0xff) {
|
||||
this->field_0xf = 0;
|
||||
} else if (this->field_0xf > 7) {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->direction = gPlayerState.field_0xd;
|
||||
this->hVelocity = 0x1a000;
|
||||
this->speed = 0x78;
|
||||
@@ -1633,7 +1633,7 @@ void sub_08072B5C(Entity* this) {
|
||||
this->direction = this->animationState << 2;
|
||||
temp = sub_0807A2F8(1);
|
||||
if (!temp) {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->spritePriority.b0 = 4;
|
||||
this->speed = 0x40;
|
||||
this->hVelocity = 0x39000;
|
||||
@@ -1685,7 +1685,7 @@ void sub_08072C9C(Entity* this) {
|
||||
|
||||
void sub_08072CC0(Entity* this) {
|
||||
this->subAction = 1;
|
||||
this->flags &= ~0x80;
|
||||
COLLISION_OFF(this);
|
||||
this->field_0xf = (gPlayerState.field_0x3a >> 2) + 1;
|
||||
this->direction = gPlayerState.field_0x39;
|
||||
this->speed = 0x400;
|
||||
@@ -1773,7 +1773,7 @@ NONMATCH("asm/non_matching/player/sub_08072D54.inc", void sub_08072D54(Entity* t
|
||||
|
||||
this->actionDelay = bVar1;
|
||||
if (!sub_08003FC4(this, 0x2000)) {
|
||||
this->flags |= 0x80;
|
||||
COLLISION_ON(this);
|
||||
if (this->collisionLayer == 1) {
|
||||
sub_0800455E(this);
|
||||
} else {
|
||||
|
||||
@@ -86,7 +86,7 @@ void sub_080ACC04(Entity* this) {
|
||||
this->flags2 = gPlayerEntity.flags2;
|
||||
this->direction = this->animationState << 2;
|
||||
this->speed = 0x200;
|
||||
this->flags |= 0xa0;
|
||||
this->flags |= ENT_COLLIDE | ENT_20;
|
||||
this->field_0x3c = 2;
|
||||
this->hitbox = (Hitbox*)gUnk_0812AAD8[this->type];
|
||||
this->field_0x70.WORD = 0x10;
|
||||
|
||||
@@ -33,16 +33,16 @@ void sub_08018CBC(Entity* this) {
|
||||
uVar2 = this->animationState = gPlayerEntity.animationState & 0xe;
|
||||
this->direction = (u8)(uVar2 << 2);
|
||||
this->speed = 0x400;
|
||||
this->damageType = 0x96;
|
||||
this->hitType = 0x96;
|
||||
this->field_0x3c = (gPlayerEntity.field_0x3c + 1) | 0x80;
|
||||
this->flags2 = gPlayerEntity.flags2;
|
||||
pEVar3 = this->attachedEntity;
|
||||
if (pEVar3 != NULL) {
|
||||
this->action = 1;
|
||||
this->flags = this->flags & 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->actionDelay = 0x56;
|
||||
this->field_0x40 = 0x1c;
|
||||
this->field_0x44 = 6;
|
||||
this->hurtType = 0x1c;
|
||||
this->damage = 6;
|
||||
this->hitbox = &gUnk_080B3E18;
|
||||
this->attachedEntity->spriteOffsetX = 0;
|
||||
this->attachedEntity->spriteSettings.b.draw = 0;
|
||||
@@ -57,8 +57,8 @@ void sub_08018CBC(Entity* this) {
|
||||
this->spriteVramOffset = 0;
|
||||
this->type = gPlayerState.field_0x1d[0] - 1;
|
||||
this->actionDelay = gUnk_080B3DE0[this->type * 2];
|
||||
this->field_0x44 = gUnk_080B3DE0[this->type * 2 + 1];
|
||||
this->field_0x40 = 0x1b;
|
||||
this->damage = gUnk_080B3DE0[this->type * 2 + 1];
|
||||
this->hurtType = 0x1b;
|
||||
this->hitbox = gUnk_080B3DE8[this->type];
|
||||
(u32*)gPlayerEntity.field_0x70.WORD = this;
|
||||
sub_08078CD0(&gPlayerEntity);
|
||||
@@ -83,7 +83,7 @@ void sub_08018DE8(Entity* this) {
|
||||
break;
|
||||
case 5:
|
||||
this->attachedEntity->subAction = 4;
|
||||
this->flags = this->flags | 0x80;
|
||||
COLLISION_ON(this);
|
||||
this->action = 2;
|
||||
this->spritePriority.b0 = 2;
|
||||
this->attachedEntity->spriteSettings.b.draw = 1;
|
||||
|
||||
@@ -33,7 +33,7 @@ ASM_FUNC("asm/non_matching/playerItem12/sub_080703BC.inc", void sub_080703BC(Ent
|
||||
|
||||
void sub_08070458(Entity* this) {
|
||||
this->action = 2;
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
this->speed = 0;
|
||||
if (this->field_0x7c.WORD != 0) {
|
||||
SetTile(this->field_0x7c.WORD, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer);
|
||||
|
||||
@@ -33,7 +33,7 @@ void sub_08019444(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08019468(Entity* this) {
|
||||
if (this->field_0x40 == 0x0e) {
|
||||
if (this->hurtType == 0x0e) {
|
||||
CreateFx(this, FX_REFLECT5, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,6 @@ END_NONMATCH
|
||||
ASM_FUNC("asm/non_matching/playerItemC/sub_0801B938.inc", void sub_0801B938(Entity* this))
|
||||
|
||||
void sub_0801B9F0(Entity* this) {
|
||||
this->flags &= 0x7f;
|
||||
COLLISION_OFF(this);
|
||||
sub_08017744(this);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ NONMATCH("asm/non_matching/playerItemLantern/sub_08054A60.inc", void sub_08054A6
|
||||
this->actionDelay = 0x04;
|
||||
this->frameIndex = -1;
|
||||
// TODO regalloc and mov 6 too early
|
||||
this->scriptedScene = (this->scriptedScene & 0xf0) | 6;
|
||||
this->updateConditions = (this->updateConditions & 0xf0) | 6;
|
||||
this->field_0x3c = 7;
|
||||
this->flags2 = -0x80;
|
||||
this->animationState = gPlayerEntity.animationState & 0xe;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user