Merge branch 'master' into asset-extraction

This commit is contained in:
octorock
2021-11-12 12:13:13 +01:00
parent b1e2175ffb
commit 9396484df6
340 changed files with 4576 additions and 6192 deletions
+8 -2
View File
@@ -112,8 +112,14 @@ else
NODEP := 1
endif
#$(C_BUILDDIR)/need_interworking_file_name.o: CFLAGS += -mthumb-interwork
$(C_BUILDDIR)/arm_proxy.o: CFLAGS += -mthumb-interwork
interwork := $(C_BUILDDIR)/interrupts.o \
$(C_BUILDDIR)/collision.o \
$(C_BUILDDIR)/playerItem.o \
$(C_BUILDDIR)/object.o \
$(C_BUILDDIR)/manager.o \
$(C_BUILDDIR)/npc.o
$(interwork): 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
+2 -2
View File
@@ -82,7 +82,7 @@ _08000144EU:
thumb_func_start sub_08000108
sub_08000108: @ 0x08000108
push {r4, lr}
ldr r0, _080001E8 @ =gUnk_02000070
ldr r0, _080001E8 @ =gUpdateVisibleTiles
ldrb r1, [r0]
lsls r1, r1, #2
beq _08000136
@@ -195,7 +195,7 @@ sub_080001DA: @ 0x080001DA
ldrh r0, [r1, r0]
bx lr
.align 2, 0
_080001E8: .4byte gUnk_02000070
_080001E8: .4byte gUpdateVisibleTiles
_080001EC: .4byte gUnk_02025EB0
_080001F0: .4byte gUnk_02019EE0
_080001F4: .4byte gUnk_02021F70
+1 -1
View File
@@ -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
-226
View File
@@ -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
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -47,7 +47,7 @@ sub_08019698: @ 0x08019698
ldrh r2, [r5, #0xc]
adds r0, r0, r2
strh r0, [r5, #0xc]
ldr r1, _08019730 @ =gUnk_02000070
ldr r1, _08019730 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
bl sub_08000108
@@ -89,7 +89,7 @@ _08019700:
_08019724: .4byte gUnk_02032EC0
_08019728: .4byte gUnk_080B4410
_0801972C: .4byte gRoomControls
_08019730: .4byte gUnk_02000070
_08019730: .4byte gUpdateVisibleTiles
_08019734: .4byte gScreen
_08019738: .4byte 0x0000FEFF
_0801973C: .4byte gUnk_02018EB0
@@ -118,7 +118,7 @@ _08019760: .4byte gUnk_02018EB0
sub_08019764: @ 0x08019764
push {lr}
bl FlushSprites
bl sub_0805E5C0
bl UpdateEntities
bl sub_080AD9B0
bl sub_080AD918
ldr r2, _08019798 @ =gUnk_02018EB0
+1 -1
View File
@@ -81,7 +81,7 @@ _0804AC18: .4byte gUnk_080D4110
thumb_func_start sub_0804AC1C
sub_0804AC1C: @ 0x0804AC1C
push {r4, lr}
bl sub_0805E5C0
bl UpdateEntities
ldr r0, _0804AC98 @ =gUnk_02018EB0
ldr r2, [r0, #0x14]
cmp r2, #0
-179
View File
@@ -1,179 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start RegisterRoomEntity
RegisterRoomEntity: @ 0x0804AEB0
push {r4, r5, r6, lr}
adds r5, r0, #0
adds r6, r1, #0
ldrb r0, [r6, #1]
movs r1, #0xf
adds r2, r1, #0
ands r2, r0
ldrb r0, [r6]
adds r4, r1, #0
ands r4, r0
ldr r0, [r5]
cmp r0, #0
bne _0804AEF6
cmp r2, #0xf
bne _0804AEE0
ldr r0, _0804AEDC @ =gUnk_081091E4
adds r0, r4, r0
ldrb r1, [r0]
adds r0, r5, #0
bl AppendEntityToList
b _0804AEF6
.align 2, 0
_0804AEDC: .4byte gUnk_081091E4
_0804AEE0:
cmp r2, #8
bne _0804AEEE
adds r0, r5, #0
movs r1, #8
bl AppendEntityToList
b _0804AEF6
_0804AEEE:
adds r0, r5, #0
adds r1, r2, #0
bl AppendEntityToList
_0804AEF6:
adds r1, r5, #0
adds r1, #0x78
cmp r4, #9
bne _0804AF00
subs r1, #0x48
_0804AF00:
adds r0, r6, #0
movs r2, #0x10
bl MemCopy
pop {r4, r5, r6, pc}
.align 2, 0
thumb_func_start sub_0804AF0C
sub_0804AF0C: @ 0x0804AF0C
push {r4, lr}
adds r4, r0, #0
adds r2, r1, #0
ldrb r0, [r2, #1]
movs r1, #0xf0
ands r1, r0
cmp r1, #0x20
beq _0804AF40
cmp r1, #0x20
bgt _0804AF26
cmp r1, #0
beq _0804AF2C
b _0804AF88
_0804AF26:
cmp r1, #0x40
beq _0804AF64
b _0804AF88
_0804AF2C:
ldr r0, _0804AF3C @ =gRoomControls
ldrh r1, [r0, #6]
ldrh r3, [r2, #8]
adds r1, r1, r3
strh r1, [r4, #0x2e]
ldrh r0, [r0, #8]
b _0804AF58
.align 2, 0
_0804AF3C: .4byte gRoomControls
_0804AF40:
adds r3, r4, #0
adds r3, #0x6d
ldrb r1, [r3]
movs r0, #0x20
orrs r0, r1
strb r0, [r3]
ldr r1, _0804AF60 @ =gRoomControls
ldrh r0, [r1, #6]
ldrh r3, [r2, #8]
adds r0, r0, r3
strh r0, [r4, #0x2e]
ldrh r0, [r1, #8]
_0804AF58:
ldrh r2, [r2, #0xa]
adds r0, r0, r2
strh r0, [r4, #0x32]
b _0804AF88
.align 2, 0
_0804AF60: .4byte gRoomControls
_0804AF64:
ldr r1, _0804AF8C @ =gRoomControls
ldrh r0, [r1, #6]
ldrh r3, [r2, #8]
adds r0, r0, r3
strh r0, [r4, #0x2e]
ldrh r0, [r1, #8]
ldrh r1, [r2, #0xa]
adds r0, r0, r1
strh r0, [r4, #0x32]
ldr r1, [r2, #0xc]
adds r0, r4, #0
bl StartCutscene
cmp r0, #0
bne _0804AF88
adds r0, r4, #0
bl DeleteEntity
_0804AF88:
pop {r4, pc}
.align 2, 0
_0804AF8C: .4byte gRoomControls
thumb_func_start sub_0804AF90
sub_0804AF90: @ 0x0804AF90
push {lr}
ldr r0, _0804AFA8 @ =gArea
ldr r1, _0804AFAC @ =0x0000085C
adds r0, r0, r1
ldr r0, [r0]
ldr r0, [r0, #0x1c]
bl sub_0804AFB0
bl sub_080A7C7C
pop {pc}
.align 2, 0
_0804AFA8: .4byte gArea
_0804AFAC: .4byte 0x0000085C
thumb_func_start sub_0804AFB0
sub_0804AFB0: @ 0x0804AFB0
push {r4, lr}
ldr r1, _0804AFD4 @ =gUnk_02017654
str r0, [r1]
movs r2, #0
ldr r0, _0804AFD8 @ =gRoomVars
adds r3, r1, #0
adds r4, r0, #0
adds r4, #0x6c
_0804AFC0:
lsls r0, r2, #2
ldr r1, [r3]
adds r0, r0, r1
ldr r0, [r0]
stm r4!, {r0}
adds r2, #1
cmp r2, #7
bls _0804AFC0
pop {r4, pc}
.align 2, 0
_0804AFD4: .4byte gUnk_02017654
_0804AFD8: .4byte gRoomVars
thumb_func_start sub_0804AFDC
sub_0804AFDC: @ 0x0804AFDC
push {r4, lr}
movs r4, #1
movs r0, #6
bl GetCurrentRoomProperty
cmp r0, #0
beq _0804AFF0
bl _call_via_r0
adds r4, r0, #0
_0804AFF0:
adds r0, r4, #0
pop {r4, pc}
+2 -2
View File
@@ -6,14 +6,14 @@
GetCurrentRoomProperty: @ 0x0804B128
push {lr}
adds r2, r0, #0
ldr r0, _0804B138 @ =gUnk_02017654
ldr r0, _0804B138 @ =gCurrentRoomProperties
ldr r1, [r0]
cmp r1, #0
bne _0804B13C
movs r0, #0
b _0804B166
.align 2, 0
_0804B138: .4byte gUnk_02017654
_0804B138: .4byte gCurrentRoomProperties
_0804B13C:
cmp r2, #0x7f
bls _0804B150
+18 -18
View File
@@ -1992,7 +1992,7 @@ sub_080535AC: @ 0x080535AC
strh r0, [r2, #8]
ldr r0, _080535E0 @ =gUnk_02032EC0
strb r1, [r0, #6]
ldr r0, _080535E4 @ =gUnk_02000070
ldr r0, _080535E4 @ =gUpdateVisibleTiles
strb r1, [r0]
ldr r2, _080535E8 @ =gScreen
ldrh r1, [r2]
@@ -2008,7 +2008,7 @@ sub_080535AC: @ 0x080535AC
.align 2, 0
_080535DC: .4byte gMenu
_080535E0: .4byte gUnk_02032EC0
_080535E4: .4byte gUnk_02000070
_080535E4: .4byte gUpdateVisibleTiles
_080535E8: .4byte gScreen
_080535EC: .4byte 0x0000FEFF
_080535F0: .4byte gUnk_080FCB94
@@ -2177,7 +2177,7 @@ sub_0805370C: @ 0x0805370C
ldrb r0, [r1, #6]
adds r0, #1
strb r0, [r1, #6]
ldr r1, _08053734 @ =gUnk_02000070
ldr r1, _08053734 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
bl sub_08051FF0
@@ -2189,7 +2189,7 @@ sub_0805370C: @ 0x0805370C
pop {pc}
.align 2, 0
_08053730: .4byte gMenu
_08053734: .4byte gUnk_02000070
_08053734: .4byte gUpdateVisibleTiles
_08053738: .4byte gUnk_080FCC54
thumb_func_start sub_0805373C
@@ -2642,7 +2642,7 @@ sub_08053ACC: @ 0x08053ACC
ldrb r0, [r1, #6]
adds r0, #1
strb r0, [r1, #6]
ldr r1, _08053AF8 @ =gUnk_02000070
ldr r1, _08053AF8 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
bl sub_08051FF0
@@ -2655,7 +2655,7 @@ sub_08053ACC: @ 0x08053ACC
pop {pc}
.align 2, 0
_08053AF4: .4byte gMenu
_08053AF8: .4byte gUnk_02000070
_08053AF8: .4byte gUpdateVisibleTiles
_08053AFC: .4byte gUnk_080FCD84
thumb_func_start sub_08053B00
@@ -2727,7 +2727,7 @@ sub_08053B74: @ 0x08053B74
ldrb r0, [r1, #6]
adds r0, #1
strb r0, [r1, #6]
ldr r1, _08053BA4 @ =gUnk_02000070
ldr r1, _08053BA4 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
ldr r0, _08053BA8 @ =gUnk_080FCDE0
@@ -2741,7 +2741,7 @@ sub_08053B74: @ 0x08053B74
pop {pc}
.align 2, 0
_08053BA0: .4byte gMenu
_08053BA4: .4byte gUnk_02000070
_08053BA4: .4byte gUpdateVisibleTiles
_08053BA8: .4byte gUnk_080FCDE0
thumb_func_start sub_08053BAC
@@ -2814,7 +2814,7 @@ sub_08053C20: @ 0x08053C20
strb r2, [r1, #6]
movs r0, #0x78
strh r0, [r1, #8]
ldr r0, _08053C54 @ =gUnk_02000070
ldr r0, _08053C54 @ =gUpdateVisibleTiles
strb r2, [r0]
bl sub_08051FF0
movs r0, #4
@@ -2829,7 +2829,7 @@ sub_08053C20: @ 0x08053C20
pop {pc}
.align 2, 0
_08053C50: .4byte gMenu
_08053C54: .4byte gUnk_02000070
_08053C54: .4byte gUpdateVisibleTiles
_08053C58: .4byte gUnk_080FCEBC
thumb_func_start nullsub_483
@@ -2922,7 +2922,7 @@ sub_08053CC8: @ 0x08053CC8
ldr r0, _08053D2C @ =0x0000FEFF
ands r0, r1
strh r0, [r2]
ldr r0, _08053D30 @ =gUnk_02000070
ldr r0, _08053D30 @ =gUpdateVisibleTiles
strb r5, [r0]
movs r0, #4
movs r1, #0x10
@@ -2938,7 +2938,7 @@ _08053D20: .4byte gMenu
_08053D24: .4byte gUnk_080FCF04
_08053D28: .4byte gScreen
_08053D2C: .4byte 0x0000FEFF
_08053D30: .4byte gUnk_02000070
_08053D30: .4byte gUpdateVisibleTiles
thumb_func_start sub_08053D34
sub_08053D34: @ 0x08053D34
@@ -3020,7 +3020,7 @@ sub_08053DB4: @ 0x08053DB4
ldrb r1, [r4, #5]
bl sub_08052FF4
bl sub_0807C740
ldr r1, _08053E28 @ =gUnk_02000070
ldr r1, _08053E28 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
ldr r1, _08053E2C @ =gRoomControls
@@ -3058,7 +3058,7 @@ _08053E1C:
.align 2, 0
_08053E20: .4byte gFadeControl
_08053E24: .4byte gMenu
_08053E28: .4byte gUnk_02000070
_08053E28: .4byte gUpdateVisibleTiles
_08053E2C: .4byte gRoomControls
thumb_func_start sub_08053E30
@@ -3119,7 +3119,7 @@ sub_08053E74: @ 0x08053E74
ldr r0, _08053EBC @ =0x0000FEFF
ands r0, r1
strh r0, [r2]
ldr r1, _08053EC0 @ =gUnk_02000070
ldr r1, _08053EC0 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #1
@@ -3133,7 +3133,7 @@ _08053EB0: .4byte gUnk_080FCFB8
_08053EB4: .4byte gMenu
_08053EB8: .4byte gScreen
_08053EBC: .4byte 0x0000FEFF
_08053EC0: .4byte gUnk_02000070
_08053EC0: .4byte gUpdateVisibleTiles
thumb_func_start sub_08053EC4
sub_08053EC4: @ 0x08053EC4
@@ -3198,7 +3198,7 @@ sub_08053F20: @ 0x08053F20
ldrb r1, [r4, #9]
bl sub_08052FF4
bl sub_0807C740
ldr r1, _08053F80 @ =gUnk_02000070
ldr r1, _08053F80 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
ldr r1, _08053F84 @ =gRoomControls
@@ -3228,7 +3228,7 @@ _08053F74:
.align 2, 0
_08053F78: .4byte gFadeControl
_08053F7C: .4byte gMenu
_08053F80: .4byte gUnk_02000070
_08053F80: .4byte gUpdateVisibleTiles
_08053F84: .4byte gRoomControls
thumb_func_start sub_08053F88
+3 -3
View File
@@ -58,7 +58,7 @@ sub_080548E8: @ 0x080548E8
ldr r0, [r0]
bl _call_via_r0
bl FlushSprites
bl sub_0805E5C0
bl UpdateEntities
bl sub_080AD9B0
bl sub_080AD918
bl UpdateScroll
@@ -149,7 +149,7 @@ _080549BC:
ldrb r1, [r6, #3]
bl sub_08052FF4
bl sub_0807C740
ldr r1, _08054A00 @ =gUnk_02000070
ldr r1, _08054A00 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
_080549CE:
@@ -177,7 +177,7 @@ _080549F4:
bl sub_08018710
pop {r4, r5, r6, pc}
.align 2, 0
_08054A00: .4byte gUnk_02000070
_08054A00: .4byte gUpdateVisibleTiles
_08054A04: .4byte gScreen
_08054A08: .4byte 0x00001FFF
_08054A0C: .4byte gRoomControls
+48 -48
View File
@@ -36,7 +36,7 @@ sub_08054C20: @ 0x08054C20
ldrb r0, [r4, #6]
adds r0, #1
strb r0, [r4, #6]
ldr r1, _08054C54 @ =gUnk_02000070
ldr r1, _08054C54 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -45,7 +45,7 @@ sub_08054C20: @ 0x08054C20
pop {r4, pc}
.align 2, 0
_08054C50: .4byte gMenu
_08054C54: .4byte gUnk_02000070
_08054C54: .4byte gUpdateVisibleTiles
thumb_func_start sub_08054C58
sub_08054C58: @ 0x08054C58
@@ -152,7 +152,7 @@ sub_08054D04: @ 0x08054D04
ldrb r0, [r4, #6]
adds r0, #1
strb r0, [r4, #6]
ldr r1, _08054D38 @ =gUnk_02000070
ldr r1, _08054D38 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -161,7 +161,7 @@ sub_08054D04: @ 0x08054D04
pop {r4, pc}
.align 2, 0
_08054D34: .4byte gMenu
_08054D38: .4byte gUnk_02000070
_08054D38: .4byte gUpdateVisibleTiles
thumb_func_start sub_08054D3C
sub_08054D3C: @ 0x08054D3C
@@ -246,7 +246,7 @@ sub_08054DAC: @ 0x08054DAC
ldrb r0, [r4, #6]
adds r0, #1
strb r0, [r4, #6]
ldr r1, _08054DF8 @ =gUnk_02000070
ldr r1, _08054DF8 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -256,7 +256,7 @@ sub_08054DAC: @ 0x08054DAC
.align 2, 0
_08054DF0: .4byte gMenu
_08054DF4: .4byte gUnk_080FEED4
_08054DF8: .4byte gUnk_02000070
_08054DF8: .4byte gUpdateVisibleTiles
thumb_func_start nullsub_484
nullsub_484: @ 0x08054DFC
@@ -297,7 +297,7 @@ sub_08054E1C: @ 0x08054E1C
ldrb r0, [r5, #6]
adds r0, #1
strb r0, [r5, #6]
ldr r1, _08054E58 @ =gUnk_02000070
ldr r1, _08054E58 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -306,7 +306,7 @@ sub_08054E1C: @ 0x08054E1C
pop {r4, r5, pc}
.align 2, 0
_08054E54: .4byte gMenu
_08054E58: .4byte gUnk_02000070
_08054E58: .4byte gUpdateVisibleTiles
thumb_func_start sub_08054E5C
sub_08054E5C: @ 0x08054E5C
@@ -521,7 +521,7 @@ _08054FCA:
adds r0, #1
movs r4, #0
strb r0, [r6, #6]
ldr r1, _08055010 @ =gUnk_02000070
ldr r1, _08055010 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -544,7 +544,7 @@ _08055004:
.align 2, 0
_08055008: .4byte gMenu
_0805500C: .4byte gUnk_080FF108
_08055010: .4byte gUnk_02000070
_08055010: .4byte gUpdateVisibleTiles
thumb_func_start sub_08055014
sub_08055014: @ 0x08055014
@@ -594,7 +594,7 @@ sub_08055054: @ 0x08055054
ldrb r0, [r4, #6]
adds r0, #1
strb r0, [r4, #6]
ldr r1, _08055088 @ =gUnk_02000070
ldr r1, _08055088 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -604,7 +604,7 @@ sub_08055054: @ 0x08055054
.align 2, 0
_08055080: .4byte gUnk_080FF128
_08055084: .4byte gMenu
_08055088: .4byte gUnk_02000070
_08055088: .4byte gUpdateVisibleTiles
thumb_func_start sub_0805508C
sub_0805508C: @ 0x0805508C
@@ -649,7 +649,7 @@ sub_080550B0: @ 0x080550B0
ldrb r0, [r4, #6]
adds r0, #1
strb r0, [r4, #6]
ldr r1, _080550F0 @ =gUnk_02000070
ldr r1, _080550F0 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -659,7 +659,7 @@ sub_080550B0: @ 0x080550B0
.align 2, 0
_080550E8: .4byte gMenu
_080550EC: .4byte gUnk_080FF154
_080550F0: .4byte gUnk_02000070
_080550F0: .4byte gUpdateVisibleTiles
thumb_func_start nullsub_487
nullsub_487: @ 0x080550F4
@@ -702,7 +702,7 @@ _0805512A:
ldrb r0, [r4, #6]
adds r0, #1
strb r0, [r4, #6]
ldr r1, _08055160 @ =gUnk_02000070
ldr r1, _08055160 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -714,7 +714,7 @@ _08055150: .4byte gUnk_080FF17C
_08055154: .4byte gSave
_08055158: .4byte 0x00000DB4
_0805515C: .4byte gMenu
_08055160: .4byte gUnk_02000070
_08055160: .4byte gUpdateVisibleTiles
thumb_func_start nullsub_488
nullsub_488: @ 0x08055164
@@ -793,7 +793,7 @@ sub_08055184: @ 0x08055184
strh r0, [r5, #8]
mov r0, r8
strh r0, [r5, #0xa]
ldr r1, _08055220 @ =gUnk_02000070
ldr r1, _08055220 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -808,7 +808,7 @@ _08055210: .4byte gUnk_080FF1D4
_08055214: .4byte gScreen
_08055218: .4byte 0x00001E05
_0805521C: .4byte 0x00003648
_08055220: .4byte gUnk_02000070
_08055220: .4byte gUpdateVisibleTiles
thumb_func_start sub_08055224
sub_08055224: @ 0x08055224
@@ -954,7 +954,7 @@ sub_08055318: @ 0x08055318
ldrb r0, [r4, #6]
adds r0, #1
strb r0, [r4, #6]
ldr r1, _0805534C @ =gUnk_02000070
ldr r1, _0805534C @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -963,7 +963,7 @@ sub_08055318: @ 0x08055318
pop {r4, pc}
.align 2, 0
_08055348: .4byte gMenu
_0805534C: .4byte gUnk_02000070
_0805534C: .4byte gUpdateVisibleTiles
thumb_func_start sub_08055350
sub_08055350: @ 0x08055350
@@ -1097,7 +1097,7 @@ sub_08055430: @ 0x08055430
ldrb r0, [r4, #6]
adds r0, #1
strb r0, [r4, #6]
ldr r1, _08055464 @ =gUnk_02000070
ldr r1, _08055464 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -1106,7 +1106,7 @@ sub_08055430: @ 0x08055430
pop {r4, pc}
.align 2, 0
_08055460: .4byte gMenu
_08055464: .4byte gUnk_02000070
_08055464: .4byte gUpdateVisibleTiles
thumb_func_start sub_08055468
sub_08055468: @ 0x08055468
@@ -1211,7 +1211,7 @@ sub_08055518: @ 0x08055518
ldrb r0, [r4, #6]
adds r0, #1
strb r0, [r4, #6]
ldr r1, _08055544 @ =gUnk_02000070
ldr r1, _08055544 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -1220,7 +1220,7 @@ sub_08055518: @ 0x08055518
pop {r4, pc}
.align 2, 0
_08055540: .4byte gMenu
_08055544: .4byte gUnk_02000070
_08055544: .4byte gUpdateVisibleTiles
thumb_func_start sub_08055548
sub_08055548: @ 0x08055548
@@ -1308,7 +1308,7 @@ sub_080555B8: @ 0x080555B8
ldrb r0, [r5, #6]
adds r0, #1
strb r0, [r5, #6]
ldr r1, _08055608 @ =gUnk_02000070
ldr r1, _08055608 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -1318,7 +1318,7 @@ sub_080555B8: @ 0x080555B8
.align 2, 0
_08055600: .4byte gMenu
_08055604: .4byte gUnk_0811E454
_08055608: .4byte gUnk_02000070
_08055608: .4byte gUpdateVisibleTiles
thumb_func_start sub_0805560C
sub_0805560C: @ 0x0805560C
@@ -1414,7 +1414,7 @@ sub_080556AC: @ 0x080556AC
ldrb r0, [r4, #6]
adds r0, #1
strb r0, [r4, #6]
ldr r1, _080556E8 @ =gUnk_02000070
ldr r1, _080556E8 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
ldr r1, [r4, #0xc]
@@ -1434,7 +1434,7 @@ sub_080556AC: @ 0x080556AC
pop {r4, pc}
.align 2, 0
_080556E4: .4byte gMenu
_080556E8: .4byte gUnk_02000070
_080556E8: .4byte gUpdateVisibleTiles
_080556EC: .4byte gUnk_080FF264
thumb_func_start nullsub_489
@@ -1486,7 +1486,7 @@ _08055734:
ldrb r0, [r4, #6]
adds r0, #1
strb r0, [r4, #6]
ldr r1, _08055768 @ =gUnk_02000070
ldr r1, _08055768 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -1497,7 +1497,7 @@ _08055734:
_0805575C: .4byte gMenu
_08055760: .4byte gUnk_080FEE48
_08055764: .4byte 0x000080FF
_08055768: .4byte gUnk_02000070
_08055768: .4byte gUpdateVisibleTiles
thumb_func_start sub_0805576C
sub_0805576C: @ 0x0805576C
@@ -1562,7 +1562,7 @@ sub_080557D0: @ 0x080557D0
ldrb r0, [r4, #6]
adds r0, #1
strb r0, [r4, #6]
ldr r1, _0805580C @ =gUnk_02000070
ldr r1, _0805580C @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
ldr r1, [r4, #0xc]
@@ -1582,7 +1582,7 @@ sub_080557D0: @ 0x080557D0
pop {r4, pc}
.align 2, 0
_08055808: .4byte gMenu
_0805580C: .4byte gUnk_02000070
_0805580C: .4byte gUpdateVisibleTiles
_08055810: .4byte gUnk_080FF298
thumb_func_start nullsub_490
@@ -1626,7 +1626,7 @@ _0805584A:
ldrb r0, [r4, #6]
adds r0, #1
strb r0, [r4, #6]
ldr r1, _08055880 @ =gUnk_02000070
ldr r1, _08055880 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -1638,7 +1638,7 @@ _08055870: .4byte gUnk_080FF2C0
_08055874: .4byte gSave
_08055878: .4byte 0x00000DB4
_0805587C: .4byte gMenu
_08055880: .4byte gUnk_02000070
_08055880: .4byte gUpdateVisibleTiles
thumb_func_start nullsub_491
nullsub_491: @ 0x08055884
@@ -1678,7 +1678,7 @@ sub_080558A4: @ 0x080558A4
ldrb r0, [r4, #6]
adds r0, #1
strb r0, [r4, #6]
ldr r1, _080558E4 @ =gUnk_02000070
ldr r1, _080558E4 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -1688,7 +1688,7 @@ sub_080558A4: @ 0x080558A4
.align 2, 0
_080558DC: .4byte gMenu
_080558E0: .4byte gUnk_080FF308
_080558E4: .4byte gUnk_02000070
_080558E4: .4byte gUpdateVisibleTiles
thumb_func_start nullsub_492
nullsub_492: @ 0x080558E8
@@ -1729,7 +1729,7 @@ sub_08055908: @ 0x08055908
ldrb r0, [r5, #6]
adds r0, #1
strb r0, [r5, #6]
ldr r1, _08055944 @ =gUnk_02000070
ldr r1, _08055944 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -1738,7 +1738,7 @@ sub_08055908: @ 0x08055908
pop {r4, r5, pc}
.align 2, 0
_08055940: .4byte gMenu
_08055944: .4byte gUnk_02000070
_08055944: .4byte gUpdateVisibleTiles
thumb_func_start sub_08055948
sub_08055948: @ 0x08055948
@@ -1854,7 +1854,7 @@ _08055A0E:
ldrb r0, [r4, #6]
adds r0, #1
strb r0, [r4, #6]
ldr r1, _08055A38 @ =gUnk_02000070
ldr r1, _08055A38 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -1864,7 +1864,7 @@ _08055A0E:
.align 2, 0
_08055A30: .4byte gMenu
_08055A34: .4byte gUnk_080FF33C
_08055A38: .4byte gUnk_02000070
_08055A38: .4byte gUpdateVisibleTiles
thumb_func_start sub_08055A3C
sub_08055A3C: @ 0x08055A3C
@@ -1981,7 +1981,7 @@ _08055B14:
ldrb r0, [r4, #6]
adds r0, #1
strb r0, [r4, #6]
ldr r1, _08055B34 @ =gUnk_02000070
ldr r1, _08055B34 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -1991,7 +1991,7 @@ _08055B14:
.align 2, 0
_08055B2C: .4byte gMenu
_08055B30: .4byte gUnk_080FED18
_08055B34: .4byte gUnk_02000070
_08055B34: .4byte gUpdateVisibleTiles
thumb_func_start sub_08055B38
sub_08055B38: @ 0x08055B38
@@ -2090,7 +2090,7 @@ sub_08055BCC: @ 0x08055BCC
ldrb r0, [r4, #6]
adds r0, #1
strb r0, [r4, #6]
ldr r1, _08055C00 @ =gUnk_02000070
ldr r1, _08055C00 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -2099,7 +2099,7 @@ sub_08055BCC: @ 0x08055BCC
pop {r4, pc}
.align 2, 0
_08055BFC: .4byte gMenu
_08055C00: .4byte gUnk_02000070
_08055C00: .4byte gUpdateVisibleTiles
thumb_func_start sub_08055C04
sub_08055C04: @ 0x08055C04
@@ -2237,7 +2237,7 @@ sub_08055CF4: @ 0x08055CF4
ldrb r0, [r4, #6]
adds r0, #1
strb r0, [r4, #6]
ldr r1, _08055D28 @ =gUnk_02000070
ldr r1, _08055D28 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -2246,7 +2246,7 @@ sub_08055CF4: @ 0x08055CF4
pop {r4, pc}
.align 2, 0
_08055D24: .4byte gMenu
_08055D28: .4byte gUnk_02000070
_08055D28: .4byte gUpdateVisibleTiles
thumb_func_start sub_08055D2C
sub_08055D2C: @ 0x08055D2C
@@ -2316,7 +2316,7 @@ sub_08055D9C: @ 0x08055D9C
ldrb r0, [r1, #6]
adds r0, #1
strb r0, [r1, #6]
ldr r1, _08055DBC @ =gUnk_02000070
ldr r1, _08055DBC @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
movs r0, #4
@@ -2325,7 +2325,7 @@ sub_08055D9C: @ 0x08055D9C
pop {pc}
.align 2, 0
_08055DB8: .4byte gMenu
_08055DBC: .4byte gUnk_02000070
_08055DBC: .4byte gUpdateVisibleTiles
thumb_func_start sub_08055DC0
sub_08055DC0: @ 0x08055DC0
-399
View File
@@ -1,399 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start sub_0805E3B0
sub_0805E3B0: @ 0x0805E3B0
push {lr}
adds r3, r0, #0
ldrb r1, [r3, #0x10]
movs r0, #0x10
ands r0, r1
cmp r0, #0
beq _0805E3C2
movs r0, #1
b _0805E404
_0805E3C2:
ldrb r0, [r3, #0xc]
cmp r0, #0
bne _0805E3CC
movs r0, #0
b _0805E404
_0805E3CC:
ldr r1, _0805E3DC @ =gUnk_03003DC0
ldrb r0, [r1]
ldrb r2, [r1, #1]
cmp r0, r2
bls _0805E3E0
adds r2, r0, #0
b _0805E3E2
.align 2, 0
_0805E3DC: .4byte gUnk_03003DC0
_0805E3E0:
ldrb r2, [r1, #1]
_0805E3E2:
ldr r0, _0805E408 @ =gMessage
ldrb r1, [r0]
movs r0, #0x7f
ands r0, r1
cmp r0, #0
beq _0805E3F4
cmp r2, #2
bhs _0805E3F4
movs r2, #2
_0805E3F4:
movs r1, #0
ldrb r0, [r3, #0x11]
lsls r0, r0, #0x1c
lsrs r0, r0, #0x1c
cmp r2, r0
bls _0805E402
movs r1, #1
_0805E402:
adds r0, r1, #0
_0805E404:
pop {pc}
.align 2, 0
_0805E408: .4byte gMessage
thumb_func_start sub_0805E40C
sub_0805E40C: @ 0x0805E40C
push {lr}
ldr r1, _0805E424 @ =gUnk_03003DC0
ldrb r0, [r1]
ldrb r2, [r1, #1]
cmp r0, r2
bhi _0805E41A
ldrb r0, [r1, #1]
_0805E41A:
cmp r0, #0
beq _0805E420
movs r0, #1
_0805E420:
pop {pc}
.align 2, 0
_0805E424: .4byte gUnk_03003DC0
thumb_func_start sub_0805E428
sub_0805E428: @ 0x0805E428
push {lr}
bl sub_0805E524
ldr r2, _0805E440 @ =gUnk_03003DC0
ldrb r3, [r2, #2]
adds r1, r3, #0
cmp r1, #0
beq _0805E444
movs r0, #0
strb r3, [r2, #1]
strb r0, [r2, #2]
b _0805E44E
.align 2, 0
_0805E440: .4byte gUnk_03003DC0
_0805E444:
ldrb r0, [r2, #3]
cmp r0, #0
beq _0805E44E
strb r1, [r2, #3]
strb r1, [r2, #1]
_0805E44E:
pop {pc}
thumb_func_start sub_0805E450
sub_0805E450: @ 0x0805E450
push {lr}
ldr r1, _0805E464 @ =gUnk_03003DC0
ldrb r2, [r1, #2]
cmp r0, r2
blo _0805E460
ldrb r2, [r1, #1]
cmp r0, r2
bhs _0805E468
_0805E460:
movs r0, #0
b _0805E46C
.align 2, 0
_0805E464: .4byte gUnk_03003DC0
_0805E468:
strb r0, [r1, #2]
movs r0, #1
_0805E46C:
pop {pc}
.align 2, 0
thumb_func_start sub_0805E470
sub_0805E470: @ 0x0805E470
ldr r1, _0805E478 @ =gUnk_03003DC0
movs r0, #1
strb r0, [r1, #3]
bx lr
.align 2, 0
_0805E478: .4byte gUnk_03003DC0
thumb_func_start sub_0805E47C
sub_0805E47C: @ 0x0805E47C
push {r4, lr}
adds r4, r0, #0
ldrb r0, [r4, #0x11]
lsls r0, r0, #0x1c
lsrs r0, r0, #0x18
movs r1, #2
orrs r0, r1
strb r0, [r4, #0x11]
movs r0, #2
bl sub_0805E450
cmp r0, #0
beq _0805E49A
ldr r0, _0805E49C @ =gUnk_03003DC0
str r4, [r0, #4]
_0805E49A:
pop {r4, pc}
.align 2, 0
_0805E49C: .4byte gUnk_03003DC0
thumb_func_start sub_0805E4A0
sub_0805E4A0: @ 0x0805E4A0
push {r4, lr}
adds r4, r0, #0
movs r0, #1
bl sub_08078A90
ldrb r0, [r4, #0x11]
lsls r0, r0, #0x1c
lsrs r0, r0, #0x18
movs r1, #3
orrs r0, r1
strb r0, [r4, #0x11]
movs r0, #1
bl sub_0805E450
cmp r0, #0
beq _0805E4C4
ldr r0, _0805E4C8 @ =gUnk_03003DC0
str r4, [r0, #4]
_0805E4C4:
pop {r4, pc}
.align 2, 0
_0805E4C8: .4byte gUnk_03003DC0
thumb_func_start sub_0805E4CC
sub_0805E4CC: @ 0x0805E4CC
push {r4, lr}
adds r4, r0, #0
movs r0, #0
bl sub_08078A90
adds r0, r4, #0
bl sub_0805E584
pop {r4, pc}
.align 2, 0
thumb_func_start sub_0805E4E0
sub_0805E4E0: @ 0x0805E4E0
push {r4, r5, lr}
adds r4, r0, #0
adds r5, r1, #0
cmp r4, #0
beq _0805E4F6
ldrb r0, [r4, #0x11]
lsls r0, r0, #0x1c
lsrs r0, r0, #0x18
movs r1, #3
orrs r0, r1
strb r0, [r4, #0x11]
_0805E4F6:
movs r0, #1
bl sub_0805E450
cmp r0, #0
beq _0805E504
ldr r0, _0805E50C @ =gUnk_03003DC0
str r4, [r0, #4]
_0805E504:
adds r0, r5, #0
bl sub_0805E510
pop {r4, r5, pc}
.align 2, 0
_0805E50C: .4byte gUnk_03003DC0
thumb_func_start sub_0805E510
sub_0805E510: @ 0x0805E510
push {lr}
adds r1, r0, #0
ldr r2, _0805E520 @ =gUnk_03003DC0
ldrh r0, [r2, #8]
cmp r0, r1
bhs _0805E51E
strh r1, [r2, #8]
_0805E51E:
pop {pc}
.align 2, 0
_0805E520: .4byte gUnk_03003DC0
thumb_func_start sub_0805E524
sub_0805E524: @ 0x0805E524
push {lr}
ldr r1, _0805E540 @ =gUnk_03003DC0
ldrh r0, [r1, #8]
cmp r0, #0
beq _0805E53C
subs r0, #1
strh r0, [r1, #8]
lsls r0, r0, #0x10
cmp r0, #0
bne _0805E53C
bl sub_0805E470
_0805E53C:
pop {pc}
.align 2, 0
_0805E540: .4byte gUnk_03003DC0
thumb_func_start FreezeTime
FreezeTime: @ 0x0805E544
ldr r1, _0805E55C @ =gUnk_03003DC0
movs r3, #6
movs r0, #6
strb r0, [r1]
ldr r2, _0805E560 @ =gPlayerEntity
ldrb r1, [r2, #0x11]
subs r0, #0x16
ands r0, r1
orrs r0, r3
strb r0, [r2, #0x11]
bx lr
.align 2, 0
_0805E55C: .4byte gUnk_03003DC0
_0805E560: .4byte gPlayerEntity
thumb_func_start UnfreezeTime
UnfreezeTime: @ 0x0805E564
ldr r1, _0805E57C @ =gUnk_03003DC0
movs r0, #0
strb r0, [r1]
ldr r2, _0805E580 @ =gPlayerEntity
ldrb r1, [r2, #0x11]
subs r0, #0x10
ands r0, r1
movs r1, #1
orrs r0, r1
strb r0, [r2, #0x11]
bx lr
.align 2, 0
_0805E57C: .4byte gUnk_03003DC0
_0805E580: .4byte gPlayerEntity
thumb_func_start sub_0805E584
sub_0805E584: @ 0x0805E584
push {lr}
ldrb r2, [r0, #0x11]
lsrs r3, r2, #4
movs r1, #0x10
rsbs r1, r1, #0
ands r1, r2
orrs r1, r3
strb r1, [r0, #0x11]
bl sub_0805E470
pop {pc}
.align 2, 0
thumb_func_start sub_0805E59C
sub_0805E59C: @ 0x0805E59C
ldr r1, _0805E5A4 @ =gUnk_03003DC0
movs r0, #6
strb r0, [r1]
bx lr
.align 2, 0
_0805E5A4: .4byte gUnk_03003DC0
thumb_func_start sub_0805E5A8
sub_0805E5A8: @ 0x0805E5A8
ldr r1, _0805E5B0 @ =gUnk_03003DC0
movs r0, #7
strb r0, [r1]
bx lr
.align 2, 0
_0805E5B0: .4byte gUnk_03003DC0
thumb_func_start sub_0805E5B4
sub_0805E5B4: @ 0x0805E5B4
ldr r1, _0805E5BC @ =gUnk_03003DC0
movs r0, #0
strb r0, [r1]
bx lr
.align 2, 0
_0805E5BC: .4byte gUnk_03003DC0
thumb_func_start sub_0805E5C0
sub_0805E5C0: @ 0x0805E5C0
push {lr}
ldr r0, _0805E5F0 @ =gRoomVars
ldrb r1, [r0, #4]
movs r2, #0
strb r1, [r0, #5]
strb r2, [r0, #4]
bl sub_0805ED30
bl sub_0805E428
bl ClearHitboxList
bl sub_0806F0A4
ldr r1, _0805E5F4 @ =_UpdateEntities
movs r0, #0
bl _call_via_r1
bl ClearAllDeletedEntities
bl sub_0805EE88
pop {pc}
.align 2, 0
_0805E5F0: .4byte gRoomVars
_0805E5F4: .4byte _UpdateEntities
thumb_func_start sub_0805E5F8
sub_0805E5F8: @ 0x0805E5F8
push {lr}
ldr r1, _0805E608 @ =_UpdateEntities
movs r0, #1
bl _call_via_r1
bl ClearAllDeletedEntities
pop {pc}
.align 2, 0
_0805E608: .4byte _UpdateEntities
thumb_func_start EraseAllEntities
EraseAllEntities: @ 0x0805E60C
push {lr}
bl DeleteAllEntities
ldr r0, _0805E654 @ =gUnk_03003DC0
movs r1, #0xc
bl MemClear
ldr r0, _0805E658 @ =gPlayerEntity
movs r1, #0xaa
lsls r1, r1, #6
bl MemClear
ldr r0, _0805E65C @ =gUnk_02033290
movs r1, #0x80
lsls r1, r1, #4
bl MemClear
bl sub_0805E98C
ldr r0, _0805E660 @ =gEntCount
movs r1, #0
strb r1, [r0]
ldr r0, _0805E664 @ =gManagerCount
strb r1, [r0]
ldr r1, _0805E668 @ =gUnk_03000000
ldr r2, _0805E66C @ =0x00000427
adds r0, r1, r2
movs r2, #1
strb r2, [r0]
ldr r3, _0805E670 @ =0x00000426
adds r0, r1, r3
strb r2, [r0]
ldr r0, _0805E674 @ =0x0000042E
adds r1, r1, r0
strb r2, [r1]
pop {pc}
.align 2, 0
_0805E654: .4byte gUnk_03003DC0
_0805E658: .4byte gPlayerEntity
_0805E65C: .4byte gUnk_02033290
_0805E660: .4byte gEntCount
_0805E664: .4byte gManagerCount
_0805E668: .4byte gUnk_03000000
_0805E66C: .4byte 0x00000427
_0805E670: .4byte 0x00000426
_0805E674: .4byte 0x0000042E
+2 -2
View File
@@ -5810,7 +5810,7 @@ _0807B3C8:
ldrh r0, [r0]
cmp r0, #1
beq _0807B430
ldr r1, _0807B40C @ =gUnk_02000070
ldr r1, _0807B40C @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
b _0807B430
@@ -5818,7 +5818,7 @@ _0807B3C8:
_0807B400: .4byte gMapDataTopSpecial
_0807B404: .4byte 0x00007004
_0807B408: .4byte gRoomControls
_0807B40C: .4byte gUnk_02000070
_0807B40C: .4byte gUpdateVisibleTiles
_0807B410:
ldr r0, _0807B424 @ =0x00003FFF
cmp r5, r0
+6 -6
View File
@@ -95,7 +95,7 @@ _0807BA44:
ldrh r0, [r0]
cmp r0, #1
beq _0807BA78
ldr r1, _0807BA88 @ =gUnk_02000070
ldr r1, _0807BA88 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
_0807BA78:
@@ -104,7 +104,7 @@ _0807BA78:
_0807BA7C: .4byte gMapDataTopSpecial
_0807BA80: .4byte 0x00007004
_0807BA84: .4byte gRoomControls
_0807BA88: .4byte gUnk_02000070
_0807BA88: .4byte gUpdateVisibleTiles
thumb_func_start sub_0807BA8C
sub_0807BA8C: @ 0x0807BA8C
@@ -197,7 +197,7 @@ _0807BB20:
ldrh r0, [r0]
cmp r0, #1
beq _0807BB54
ldr r1, _0807BB64 @ =gUnk_02000070
ldr r1, _0807BB64 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
_0807BB54:
@@ -206,7 +206,7 @@ _0807BB54:
_0807BB58: .4byte gMapDataTopSpecial
_0807BB5C: .4byte 0x00007004
_0807BB60: .4byte gRoomControls
_0807BB64: .4byte gUnk_02000070
_0807BB64: .4byte gUpdateVisibleTiles
thumb_func_start sub_0807BB68
sub_0807BB68: @ 0x0807BB68
@@ -1847,14 +1847,14 @@ sub_0807C810: @ 0x0807C810
adds r1, r1, r0
strh r1, [r6, #0x32]
bl sub_080809D4
ldr r0, _0807C85C @ =gUnk_02000070
ldr r0, _0807C85C @ =gUpdateVisibleTiles
strb r5, [r0]
pop {r4, r5, r6, pc}
.align 2, 0
_0807C850: .4byte gUnk_03004030
_0807C854: .4byte gPlayerEntity
_0807C858: .4byte gRoomControls
_0807C85C: .4byte gUnk_02000070
_0807C85C: .4byte gUpdateVisibleTiles
thumb_func_start sub_0807C860
sub_0807C860: @ 0x0807C860
+26 -26
View File
@@ -79,7 +79,7 @@ _0807FCBC:
subs r0, r7, r3
cmp r0, #0
bgt _0807FCCE
ldr r1, _0807FCD8 @ =gUnk_02000070
ldr r1, _0807FCD8 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
_0807FCCE:
@@ -89,7 +89,7 @@ _0807FCCE:
blt _0807FD16
b _0807FD14
.align 2, 0
_0807FCD8: .4byte gUnk_02000070
_0807FCD8: .4byte gUpdateVisibleTiles
_0807FCDC:
ldrh r0, [r2, #6]
ldrh r1, [r2, #0x1e]
@@ -113,7 +113,7 @@ _0807FCFC:
subs r0, r7, r3
cmp r0, #7
ble _0807FD0C
ldr r1, _0807FD68 @ =gUnk_02000070
ldr r1, _0807FD68 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
_0807FD0C:
@@ -158,7 +158,7 @@ _0807FD4C:
subs r0, r7, r3
cmp r0, #0
bgt _0807FD5E
ldr r1, _0807FD68 @ =gUnk_02000070
ldr r1, _0807FD68 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
_0807FD5E:
@@ -168,7 +168,7 @@ _0807FD5E:
blt _0807FDA6
b _0807FDA4
.align 2, 0
_0807FD68: .4byte gUnk_02000070
_0807FD68: .4byte gUpdateVisibleTiles
_0807FD6C:
ldrh r0, [r2, #8]
ldrh r1, [r2, #0x20]
@@ -192,7 +192,7 @@ _0807FD8C:
subs r0, r7, r3
cmp r0, #7
ble _0807FD9C
ldr r1, _0807FDAC @ =gUnk_02000070
ldr r1, _0807FDAC @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
_0807FD9C:
@@ -206,7 +206,7 @@ _0807FDA6:
bl sub_08080BC4
pop {r4, r5, r6, r7, pc}
.align 2, 0
_0807FDAC: .4byte gUnk_02000070
_0807FDAC: .4byte gUpdateVisibleTiles
thumb_func_start sub_0807FDB0
sub_0807FDB0: @ 0x0807FDB0
@@ -225,7 +225,7 @@ _0807FDC4: .4byte gUnk_0811E780
sub_0807FDC8: @ 0x0807FDC8
push {r4, r5, lr}
adds r5, r0, #0
ldr r4, _0807FDE0 @ =gUnk_02000070
ldr r4, _0807FDE0 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r4]
bl sub_08000108
@@ -235,7 +235,7 @@ sub_0807FDC8: @ 0x0807FDC8
strb r1, [r4]
pop {r4, r5, pc}
.align 2, 0
_0807FDE0: .4byte gUnk_02000070
_0807FDE0: .4byte gUpdateVisibleTiles
thumb_func_start sub_0807FDE4
sub_0807FDE4: @ 0x0807FDE4
@@ -243,17 +243,17 @@ sub_0807FDE4: @ 0x0807FDE4
movs r1, #2
strb r1, [r0, #3]
strh r2, [r0, #0x18]
ldr r0, _0807FDF4 @ =gUnk_02000070
ldr r0, _0807FDF4 @ =gUpdateVisibleTiles
strb r1, [r0]
bx lr
.align 2, 0
_0807FDF4: .4byte gUnk_02000070
_0807FDF4: .4byte gUpdateVisibleTiles
thumb_func_start sub_0807FDF8
sub_0807FDF8: @ 0x0807FDF8
push {r4, lr}
adds r4, r0, #0
ldr r1, _0807FE18 @ =gUnk_02000070
ldr r1, _0807FE18 @ =gUpdateVisibleTiles
movs r0, #2
strb r0, [r1]
ldrh r0, [r4, #0x18]
@@ -268,7 +268,7 @@ sub_0807FDF8: @ 0x0807FDF8
beq _0807FE26
b _0807FEB6
.align 2, 0
_0807FE18: .4byte gUnk_02000070
_0807FE18: .4byte gUpdateVisibleTiles
_0807FE1C:
cmp r0, #2
beq _0807FE68
@@ -400,12 +400,12 @@ sub_0807FF08: @ 0x0807FF08
movs r1, #1
strb r1, [r0, #3]
strh r2, [r0, #0x18]
ldr r1, _0807FF18 @ =gUnk_02000070
ldr r1, _0807FF18 @ =gUpdateVisibleTiles
movs r0, #3
strb r0, [r1]
bx lr
.align 2, 0
_0807FF18: .4byte gUnk_02000070
_0807FF18: .4byte gUpdateVisibleTiles
thumb_func_start sub_0807FF1C
sub_0807FF1C: @ 0x0807FF1C
@@ -417,7 +417,7 @@ sub_0807FF1C: @ 0x0807FF1C
ands r0, r1
cmp r0, #0
bne _0807FF48
ldr r1, _0807FF50 @ =gUnk_02000070
ldr r1, _0807FF50 @ =gUpdateVisibleTiles
movs r0, #3
strb r0, [r1]
ldrh r0, [r2, #0x18]
@@ -434,7 +434,7 @@ _0807FF48:
pop {pc}
.align 2, 0
_0807FF4C: .4byte gScreenTransition
_0807FF50: .4byte gUnk_02000070
_0807FF50: .4byte gUpdateVisibleTiles
thumb_func_start sub_0807FF54
sub_0807FF54: @ 0x0807FF54
@@ -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
@@ -642,13 +642,13 @@ _080800F0: .4byte gScreen
_080800F4: .4byte gUnk_08109194
_080800F8: .4byte gUnk_03004030
_080800FC:
ldr r1, _08080104 @ =gUnk_02000070
ldr r1, _08080104 @ =gUpdateVisibleTiles
movs r0, #4
strb r0, [r1]
_08080102:
pop {r4, r5, r6, r7, pc}
.align 2, 0
_08080104: .4byte gUnk_02000070
_08080104: .4byte gUpdateVisibleTiles
thumb_func_start sub_08080108
sub_08080108: @ 0x08080108
@@ -717,12 +717,12 @@ sub_08080198: @ 0x08080198
strh r1, [r0, #0x1c]
bl LoadRoom
bl sub_0804AFF4
ldr r0, _080801B8 @ =gUnk_02000070
ldr r0, _080801B8 @ =gUpdateVisibleTiles
strb r4, [r0]
bl sub_080805F8
pop {r4, pc}
.align 2, 0
_080801B8: .4byte gUnk_02000070
_080801B8: .4byte gUpdateVisibleTiles
thumb_func_start sub_080801BC
sub_080801BC: @ 0x080801BC
@@ -815,7 +815,7 @@ _08080232:
_08080260: .4byte gScreen
_08080264: .4byte 0x0000BFFF
_08080268:
ldr r0, _08080274 @ =gUnk_02000070
ldr r0, _08080274 @ =gUpdateVisibleTiles
movs r1, #4
strb r1, [r0]
movs r0, #0
@@ -823,7 +823,7 @@ _08080268:
_08080272:
pop {r4, r5, r6, r7, pc}
.align 2, 0
_08080274: .4byte gUnk_02000070
_08080274: .4byte gUpdateVisibleTiles
thumb_func_start sub_08080278
sub_08080278: @ 0x08080278
@@ -987,7 +987,7 @@ _080803A2:
cmp r4, r6
blo _080803A2
_080803B8:
ldr r1, _080803CC @ =gUnk_02000070
ldr r1, _080803CC @ =gUpdateVisibleTiles
movs r0, #0
strb r0, [r1]
_080803BE:
@@ -996,7 +996,7 @@ _080803BE:
_080803C0: .4byte gUnk_020246B0
_080803C4: .4byte gUnk_02034480
_080803C8: .4byte 0x00000FFF
_080803CC: .4byte gUnk_02000070
_080803CC: .4byte gUpdateVisibleTiles
thumb_func_start sub_080803D0
sub_080803D0: @ 0x080803D0
+1 -1
View File
@@ -1337,7 +1337,7 @@ _080A45D0:
ldr r0, [r0]
bl _call_via_r0
_080A45E0:
bl sub_0805E5C0
bl UpdateEntities
bl sub_0801C1D4
bl sub_0801C208
bl sub_080AD9B0
+6 -6
View File
@@ -4890,7 +4890,7 @@ sub_080A7250: @ 0x080A7250
adds r0, #0x8b
ldrb r0, [r0]
strb r0, [r1, #0xc]
ldr r0, _080A731C @ =gUnk_02017654
ldr r0, _080A731C @ =gCurrentRoomProperties
ldr r0, [r0]
str r0, [r1, #0x10]
ldr r0, _080A7320 @ =gUnk_02025EB0
@@ -4917,7 +4917,7 @@ _080A730C: .4byte gUnk_03000420
_080A7310: .4byte gActiveScriptInfo
_080A7314: .4byte gScreenTransition
_080A7318: .4byte gPlayerState
_080A731C: .4byte gUnk_02017654
_080A731C: .4byte gCurrentRoomProperties
_080A7320: .4byte gUnk_02025EB0
_080A7324: .4byte gUnk_0200B650
@@ -4983,7 +4983,7 @@ sub_080A73A8: @ 0x080A73A8
_080A73B4:
bl DeleteAllEntities
bl sub_0805E974
ldr r1, _080A746C @ =gUnk_02017654
ldr r1, _080A746C @ =gCurrentRoomProperties
ldr r5, _080A7470 @ =gUnk_02032EC0
ldr r0, [r5, #0x10]
str r0, [r1]
@@ -5058,7 +5058,7 @@ _080A73B4:
b _080A74AE
.align 2, 0
_080A7468: .4byte gFadeControl
_080A746C: .4byte gUnk_02017654
_080A746C: .4byte gCurrentRoomProperties
_080A7470: .4byte gUnk_02032EC0
_080A7474: .4byte gPlayerState
_080A7478: .4byte gUnk_02025EB0
@@ -5120,8 +5120,8 @@ sub_080A74F4: @ 0x080A74F4
movs r0, #0
strb r0, [r1, #0xb]
bl FlushSprites
bl sub_0805E5C0
bl sub_0805E5F8
bl UpdateEntities
bl UpdateManagers
bl sub_0801C344
bl sub_0801C208
bl sub_08078CB4
@@ -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
+16 -16
View File
@@ -202,7 +202,7 @@ _08051AEC: .4byte gScreenTransition
sub_08051AF0: @ 0x08051AF0
.ifdef EU
push {r4, lr}
bl sub_0805E5C0
bl UpdateEntities
bl sub_0805BBBC
cmp r0, #0
bne _0805173E
@@ -211,7 +211,7 @@ _0805173E:
bl UpdateBgAnim
bl sub_08000108
bl sub_0801C344
bl sub_0805E5F8
bl UpdateManagers
bl FlushSprites
bl sub_0801C208
bl sub_08078CB4
@@ -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
@@ -280,7 +280,7 @@ _080517F8: .4byte gRoomVars
.else
push {r4, r5, lr}
bl sub_0805E5C0
bl UpdateEntities
bl sub_0805BBBC
cmp r0, #0
bne _08051B02
@@ -289,7 +289,7 @@ _08051B02:
bl UpdateBgAnim
bl sub_08000108
bl sub_0801C344
bl sub_0805E5F8
bl UpdateManagers
bl FlushSprites
bl sub_0801C208
bl sub_08078CB4
@@ -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
@@ -441,7 +441,7 @@ _08051C02:
bl sub_08078B48
_08051C06:
bl FlushSprites
bl sub_0805E5C0
bl UpdateEntities
bl sub_08080A40
bl CollisionMain
bl UpdateScroll
@@ -449,7 +449,7 @@ _08051C06:
bl sub_08000108
bl sub_08052C3C
bl sub_0801C344
bl sub_0805E5F8
bl UpdateManagers
bl sub_0801C208
bl sub_08078CB4
bl sub_080AD9B0
@@ -503,10 +503,10 @@ sub_08051CA8: @ 0x08051CA8
bl sub_080705AC
cmp r0, #0
bne _08051CEA
bl sub_0805E5C0
bl UpdateEntities
bl CollisionMain
bl sub_0801C344
bl sub_0805E5F8
bl UpdateManagers
bl FlushSprites
bl sub_0801C208
bl sub_08078CB4
@@ -586,7 +586,7 @@ InitializeEntities: @ 0x08051D40
movs r0, #0
str r0, [r1]
bl sub_0807C740
ldr r1, _08051D94 @ =gUnk_02000070
ldr r1, _08051D94 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
bl sub_0805283C
@@ -605,7 +605,7 @@ InitializeEntities: @ 0x08051D40
pop {pc}
.align 2, 0
_08051D90: .4byte gUnk_03004030
_08051D94: .4byte gUnk_02000070
_08051D94: .4byte gUpdateVisibleTiles
thumb_func_start sub_08051D98
sub_08051D98: @ 0x08051D98
@@ -788,12 +788,12 @@ sub_08051F04: @ 0x08051F04
ldr r0, [r0]
bl _call_via_r0
bl FlushSprites
bl sub_0805E5C0
bl UpdateEntities
bl sub_080AD9B0
bl sub_080AD918
bl UpdateScroll
bl UpdateBgAnim
bl sub_0805E5F8
bl UpdateManagers
bl sub_08000108
pop {pc}
.align 2, 0
@@ -869,7 +869,7 @@ sub_08051F9C: @ 0x08051F9C
add r0, r8
strh r0, [r1, #0xc]
bl sub_0807C740
ldr r1, _08051FE8 @ =gUnk_02000070
ldr r1, _08051FE8 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
ldr r0, _08051FEC @ =gUsedPalettes
@@ -883,7 +883,7 @@ sub_08051F9C: @ 0x08051F9C
.align 2, 0
_08051FE0: .4byte gScreen
_08051FE4: .4byte gRoomControls
_08051FE8: .4byte gUnk_02000070
_08051FE8: .4byte gUpdateVisibleTiles
_08051FEC: .4byte gUsedPalettes
thumb_func_start sub_08051FF0
+1 -7
View File
@@ -1,12 +1,5 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start GetEmptyEntity
GetEmptyEntity: @ 0x0805E678
push {r4, r5, r6, r7, lr}
mov r7, r8
push {r7}
@@ -111,3 +104,4 @@ _0805E730:
_0805E738: .4byte gUnk_03003BE0
_0805E73C: .4byte gEntityLists
_0805E740: .4byte gUnk_03003DD0
.syntax divided
+2 -2
View File
@@ -524,7 +524,7 @@ _080464DE:
movs r1, #0x80
lsls r1, r1, #4
bl MemClear
ldr r1, _08046514 @ =gUnk_02000070
ldr r1, _08046514 @ =gUpdateVisibleTiles
movs r0, #1
strb r0, [r1]
pop {r4, r5, r6, pc}
@@ -532,7 +532,7 @@ _080464DE:
_08046508: .4byte gUnk_080D1A74
_0804650C: .4byte gUnk_02019EE0
_08046510: .4byte 0x00003260
_08046514: .4byte gUnk_02000070
_08046514: .4byte gUpdateVisibleTiles
thumb_func_start sub_08046518
sub_08046518: @ 0x08046518
+14 -12
View File
@@ -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
@@ -655,8 +657,6 @@ _080B21A4: .4byte 0x01010101
_080B21A8: .4byte gUnk_02000006
_080B21AC: .4byte gUnk_08000F54
arm_func_start UpdateEntities
UpdateEntities: @ 0x080B21B0
ldr r11, _080B2270 @ =gUnk_03003DD0
ldr r1, [r11]
ldm r1, {r7, r8, r9, r10}
@@ -672,6 +672,8 @@ UpdateEntities: @ 0x080B21B0
@ void* restore_sp;
@ }
arm_func_start UpdateEntities_arm
UpdateEntities_arm: @ 0x080B21B0
@ UpdateEntities starts here
@ arg0 (r0) : 0 = entities, 1 = managers
ldr r1, _080B2274 @ =gUnk_080026A4
@@ -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
-8
View File
@@ -1,8 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
+1 -8
View File
@@ -1,12 +1,4 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start LoadRoomEntity
LoadRoomEntity: @ 0x0804ADF8
push {r4, r5, r6, r7, lr}
adds r4, r0, #0
ldrb r0, [r4]
@@ -99,3 +91,4 @@ _0804AEAA:
_0804AEAC:
pop {r4, r5, r6, r7, pc}
.align 2, 0
.syntax divided
+1 -1
View File
@@ -26,7 +26,7 @@ _08017550:
bl NPCInit
_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
+2 -2
View File
@@ -30,14 +30,14 @@ _0804DE32:
ldrb r0, [r4, #8]
cmp r0, #1
beq _0804DE5C
ldr r1, _0804DE58 @ =gUnk_02017654
ldr r1, _0804DE58 @ =gCurrentRoomProperties
ldr r0, [r5]
str r0, [r1]
b _0804DECC
.align 2, 0
_0804DE50: .4byte Area_HyruleTown
_0804DE54: .4byte gSave
_0804DE58: .4byte gUnk_02017654
_0804DE58: .4byte gCurrentRoomProperties
_0804DE5C:
movs r0, #0x1c
bl SetGlobalFlag
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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
-131
View File
@@ -1,131 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start sub_0805E248
sub_0805E248: @ 0x0805E248
push {r4, r5, lr}
ldr r0, _0805E2C8 @ =gUnk_03004030
ldr r0, [r0]
ldrh r5, [r0, #6]
ldr r0, _0805E2CC @ =gRoomControls
ldrb r0, [r0, #4]
cmp r0, #0xa
beq _0805E25C
cmp r0, #0x16
bne _0805E2E8
_0805E25C:
movs r0, #0x9f
lsls r0, r0, #2
adds r4, r5, #0
subs r4, #0x41
adds r1, r4, #0
movs r2, #1
bl SetTileType
ldr r0, _0805E2D0 @ =0x00000283
adds r1, r4, #0
movs r2, #2
bl SetTileType
ldr r0, _0805E2D4 @ =0x0000027D
adds r4, #1
adds r1, r4, #0
movs r2, #1
bl SetTileType
movs r0, #0xa1
lsls r0, r0, #2
adds r1, r4, #0
movs r2, #2
bl SetTileType
ldr r0, _0805E2D8 @ =0x0000027E
adds r4, #1
adds r1, r4, #0
movs r2, #1
bl SetTileType
ldr r0, _0805E2DC @ =0x00000285
adds r1, r4, #0
movs r2, #2
bl SetTileType
ldr r0, _0805E2E0 @ =0x0000027F
subs r1, r5, #1
movs r2, #1
bl SetTileType
movs r0, #0xa0
lsls r0, r0, #2
adds r1, r5, #0
movs r2, #1
bl SetTileType
ldr r0, _0805E2E4 @ =0x00000282
adds r1, r5, #1
movs r2, #1
bl SetTileType
b _0805E350
.align 2, 0
_0805E2C8: .4byte gUnk_03004030
_0805E2CC: .4byte gRoomControls
_0805E2D0: .4byte 0x00000283
_0805E2D4: .4byte 0x0000027D
_0805E2D8: .4byte 0x0000027E
_0805E2DC: .4byte 0x00000285
_0805E2E0: .4byte 0x0000027F
_0805E2E4: .4byte 0x00000282
_0805E2E8:
movs r0, #0x9b
lsls r0, r0, #2
adds r4, r5, #0
subs r4, #0x41
adds r1, r4, #0
movs r2, #1
bl SetTileType
ldr r0, _0805E358 @ =0x00000273
adds r1, r4, #0
movs r2, #2
bl SetTileType
ldr r0, _0805E35C @ =0x0000026D
adds r4, #1
adds r1, r4, #0
movs r2, #1
bl SetTileType
movs r0, #0x9d
lsls r0, r0, #2
adds r1, r4, #0
movs r2, #2
bl SetTileType
ldr r0, _0805E360 @ =0x0000026E
adds r4, #1
adds r1, r4, #0
movs r2, #1
bl SetTileType
ldr r0, _0805E364 @ =0x00000275
adds r1, r4, #0
movs r2, #2
bl SetTileType
ldr r0, _0805E368 @ =0x0000026F
subs r1, r5, #1
movs r2, #1
bl SetTileType
movs r0, #0x9c
lsls r0, r0, #2
adds r1, r5, #0
movs r2, #1
bl SetTileType
ldr r0, _0805E36C @ =0x00000272
adds r1, r5, #1
movs r2, #1
bl SetTileType
_0805E350:
ldr r1, _0805E370 @ =gUnk_02000070
movs r0, #0
strb r0, [r1]
pop {r4, r5, pc}
.align 2, 0
_0805E358: .4byte 0x00000273
_0805E35C: .4byte 0x0000026D
_0805E360: .4byte 0x0000026E
_0805E364: .4byte 0x00000275
_0805E368: .4byte 0x0000026F
_0805E36C: .4byte 0x00000272
_0805E370: .4byte gUnk_02000070
+15 -13
View File
@@ -3,20 +3,22 @@
.section .rodata
.align 2
.4byte sub_08016B30
.4byte sub_08016B30
.4byte sub_08016B30
gUnk_080B2A70:: @ 080B2A70
.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
unusedLabel_0B21D0::
@ TODO contains some pointers to iwram
-28
View File
@@ -4,34 +4,6 @@
.section .rodata
.align 2
gUnk_080B3740:: @ 080B3740
.incbin "data_080B3740/gUnk_080B3740.bin"
gUnk_080B3744:: @ 080B3744
.4byte sub_08018308
.4byte sub_08017AD8
.4byte sub_08017AD8
.4byte sub_08017ADC
.4byte sub_08017B58
.4byte sub_08017EB0
.4byte sub_08017F3C
.4byte sub_08017F40
.4byte sub_0801802C
.4byte sub_08017DD4
.4byte sub_080180E8
.4byte sub_08017BBC
.4byte sub_08017C40
.4byte sub_08017D6C
.4byte sub_08017D28
.4byte sub_08018168
.4byte sub_08018228
.4byte sub_08018250
.4byte sub_08018288
.4byte sub_080182A8
.4byte sub_08017B1C
.4byte sub_08017CBC
.4byte sub_08017E88
gUnk_080B37A0:: @ 080B37A0
.ifdef EU
@ TODO only small differences
+14 -2
View File
@@ -4,8 +4,20 @@
.section .rodata
.align 2
gUnk_080B7B74:: @ 080B7B74
.incbin "data_080B7B74/gUnk_080B7B74.bin"
@ FIXME add to asset configurations
@gUnk_080B7B74:: @ 080B7B74
@ .incbin "data_080B7B74/gUnk_080B7B74.bin"
gCollisionMtx:: @ 080B7B74
.incbin "baserom.gba", 0x0B7B74, 0x00004BA
gUnk_080B802E:: @ 080B802E
.incbin "baserom.gba", 0x0B802E, 0x0002292
gUnk_080BA2C0:: @ 080BA2C0
.incbin "baserom.gba", 0x0BA2C0, 0x0000FE0
gUnk_080BB2A0:: @ 080BB2A0
.ifdef EU
.incbin "data_080B7B74/gUnk_080B7B74_1_EU.bin"
.else
+3 -1
View File
@@ -23,7 +23,8 @@ typedef struct {
u8 unk1A;
u8 filler2[13];
u8 field_0x28;
u8 filler4[0x834];
u8 filler4[0x833];
void*** field_0x85c;
u32 musicIndex;
u32 pMusicIndex;
u8 filler5[0x20];
@@ -31,6 +32,7 @@ typedef struct {
u32 unk3;
u32 unk4;
} Area;
static_assert(sizeof(Area) == 0x894);
extern Area gArea;
+57 -50
View File
@@ -42,32 +42,29 @@ 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;
/*0x16*/ u8 field_0x16;
/*0x17*/ u8 field_0x17;
/*0x18*/ union {
/* */ u8 raw;
/* */ struct {
/* */ u32 draw : 2; // 1-2
/* */ u32 ss2 : 1; // 4
/* */ u32 ss3 : 1; // 8
/* */ u32 shadow : 2; //0x10-0x20
/* */ u32 flipX : 1; //0x40
/* */ u32 flipY : 1; //0x80
/* */ } PACKED b;
/*0x18*/ struct {
/* */ u32 draw : 2; // 1-2
/* */ u32 ss2 : 1; // 4
/* */ u32 ss3 : 1; // 8
/* */ u32 shadow : 2; //0x10-0x20
/* */ u32 flipX : 1; //0x40
/* */ u32 flipY : 1; //0x80
/* */ } PACKED spriteSettings;
/*0x19*/ struct {
/* */ u32 b0 : 2; // 1-2
@@ -91,7 +88,7 @@ typedef struct Entity {
/*0x1d*/ u8 field_0x1d;
/*0x1e*/ u8 frameIndex;
/*0x1f*/ u8 lastFrameIndex;
/*0x20*/ s32 hVelocity;
/*0x20*/ s32 zVelocity;
/*0x24*/ s16 speed;
/*0x26*/ u8 spriteAnimation[3];
/*0x29*/ struct {
@@ -102,7 +99,7 @@ typedef struct Entity {
/*0x2a*/ u16 collisions;
/*0x2c*/ union SplitWord x;
/*0x30*/ union SplitWord y;
/*0x34*/ union SplitWord height; // todo
/*0x34*/ union SplitWord z;
/*0x38*/ u8 collisionLayer;
/*0x39*/ s8 interactType;
/*0x3a*/ u8 field_0x3a;
@@ -110,29 +107,21 @@ 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;
/*0x45*/ u8 currentHealth;
/*0x44*/ u8 damage;
/*0x45*/ u8 health;
/*0x46*/ u16 field_0x46;
/*0x48*/ Hitbox* hitbox;
/*0x4c*/ struct Entity* field_0x4c;
/*0x50*/ struct Entity* parent;
/*0x54*/ struct Entity* attachedEntity;
/*0x54*/ struct Entity* child;
/*0x58*/ u8 animIndex;
/*0x59*/ u8 frameDuration;
/*0x5a*/ union {
/* */ u8 all;
/* */ struct {
/* */ u8 f0 : 1;
/* */ u8 f1 : 5;
/* */ u8 f2 : 1; //0x40
/* */ u8 f3 : 1; //0x80
/* */ } PACKED b;
/* */ } PACKED frames;
/*0x5a*/ u8 frame;
/*0x5b*/ u8 frameSpriteSettings;
/*0x5c*/ Frame* animPtr;
/*0x60*/ u16 spriteVramOffset;
@@ -165,9 +154,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 +186,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)
@@ -197,23 +198,29 @@ enum {
#define Direction8FromAnimationState(expr) (((expr) << 2)
Entity* GetEmptyEntity(void);
extern Entity* CreateEnemy(u32 id, u32 type);
extern Entity* CreateNPC(u32 id, u32 type, u32 type2);
extern Entity* CreateObject(u32 id, u32 type, u32 type2);
extern Entity* CreateObjectWithParent(Entity* parent, u32 id, u32 type, u32 type2);
extern Entity* CreateFx(Entity* parent, u32 type, u32 type2);
void DrawEntity(Entity*);
Entity* CreateEnemy(u32 id, u32 type);
Entity* CreateNPC(u32 id, u32 type, u32 type2);
Entity* CreateObject(u32 id, u32 type, u32 type2);
Entity* CreateObjectWithParent(Entity* parent, u32 id, u32 type, u32 type2);
Entity* CreateFx(Entity* parent, u32 type, u32 type2);
extern void InitializeAnimation(Entity*, u32);
extern void InitAnimationForceUpdate(Entity*, u32);
extern void UpdateAnimationSingleFrame(Entity*);
extern void UpdateSpriteForCollisionLayer(Entity*);
extern void GetNextFrame(Entity*);
extern u32 LoadExtraSpriteData(Entity*, SpriteLoadData*);
extern void SetExtraSpriteFrame(Entity*, u32, u32);
extern void SetSpriteSubEntryOffsetData1(Entity*, u32, u32);
extern void SetSpriteSubEntryOffsetData2(Entity*, u32, u32);
void InitializeAnimation(Entity*, u32);
void InitAnimationForceUpdate(Entity*, u32);
void UpdateAnimationSingleFrame(Entity*);
void UpdateSpriteForCollisionLayer(Entity*);
void GetNextFrame(Entity*);
u32 LoadExtraSpriteData(Entity*, SpriteLoadData*);
void SetExtraSpriteFrame(Entity*, u32, u32);
void SetSpriteSubEntryOffsetData1(Entity*, u32, u32);
void SetSpriteSubEntryOffsetData2(Entity*, u32, u32);
extern u32 GetFacingDirection(Entity*, Entity*);
u32 GetFacingDirection(Entity*, Entity*);
/**
* @brief Check if entity should sleep this frame.
*/
bool32 CheckDontUpdate(Entity* this);
/**
* @brief Delete the entity currently in execution.
+1 -1
View File
@@ -105,7 +105,7 @@ extern void sub_0807AA80(Entity*);
extern s32 sub_0807887C(Entity*, u32, u32);
extern s32 sub_08078904();
extern void sub_0805E5A8(void);
extern void sub_0805E5C0(void);
extern void UpdateEntities(void);
extern void sub_080AD9B0(void);
extern void sub_080AD918(void);
extern void sub_0801E104(void);
+2
View File
@@ -173,6 +173,8 @@ typedef struct MusicPlayer {
extern const MusicPlayer gMusicPlayers[];
extern const Song gSongTable[];
void m4aSoundMain(void);
void m4aSoundVSync(void);
void m4aSoundInit(void);
void m4aSongNumStart(u16 n);
void m4aSongNumStartOrContinue(u16 n);
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -12,7 +12,7 @@ union SplitSHWord {
} PACKED;
typedef struct Manager {
/*0x00*/ struct Manager* previous;
/*0x00*/ struct Manager* prev;
/*0x00*/ struct Manager* next;
/*0x08*/ u8 type;
/*0x09*/ u8 subtype;
+5 -1
View File
@@ -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
+3 -10
View File
@@ -60,20 +60,13 @@ typedef struct {
u8 filler4[48];
u8 filler5[28];
u32 greatFairyState;
u32* field_0x6c;
u32* field_0x70;
u32* field_0x74;
u32 field_0x78;
u8 field_0x79[10];
void* field_0x88;
void* field_0x6c[8];
} RoomVars;
// Packets used to store which entities to load in a room
typedef struct {
u8 kind : 4;
u8 layer : 4;
u8 flags : 4;
u8 unk : 4;
u8 kind;
u8 flags;
u8 id;
u8 type;
u32 type2;
+14 -22
View File
@@ -11,29 +11,19 @@ typedef struct {
} LcdControls;
typedef struct {
u16 bg0Control;
u16 bg0xOffset;
u16 bg0yOffset;
u16 bg0Updated;
void* bg0Tilemap;
u16 bg1Control;
u16 bg1xOffset;
u16 bg1yOffset;
u16 bg1Updated;
void* bg1Tilemap;
u16 control;
u16 xOffset;
u16 yOffset;
u16 updated;
void* tilemap;
} BgSettings;
typedef struct {
u16 bg2Control;
u16 bg2xOffset;
u16 bg2yOffset;
u16 bg2Updated;
void* bg2Tilemap;
u16 bg3Control;
s16 bg3xOffset;
s16 bg3yOffset;
u16 bg3Updated;
void* bg3Tilemap;
u16 control;
s16 xOffset;
s16 yOffset;
u16 updated;
void* tilemap;
} BgAffSettings;
typedef struct {
@@ -67,8 +57,10 @@ typedef struct {
typedef struct {
/*0x00*/ LcdControls lcd;
/*0x08*/ BgSettings bg;
/*0x20*/ BgAffSettings affine;
/*0x08*/ BgSettings bg0;
/*0x14*/ BgSettings bg1;
/*0x20*/ BgAffSettings bg2;
/*0x2c*/ BgAffSettings bg3;
/*0x38*/ BgControls controls;
/*0x6c*/ u8 _6c;
/*0x6d*/ u8 _6d;
+2 -5
View File
@@ -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;
@@ -171,10 +171,7 @@ typedef struct {
u8 unk1;
u8 unk2;
u8 unk3;
u8 freezeTime;
u8 unk9;
u8 unk_0xa;
u8 unk_0xb;
Entity* unk4;
u16 unk_0xc;
} EntityHandler;
+11 -16
View File
@@ -18,7 +18,7 @@ SECTIONS {
. = 0x00000040; gUnk_02000040 = .;
. = 0x00000050; gMessage = .;
. = 0x0000005C; gUnk_0200005C = .;
. = 0x00000070; gUnk_02000070 = .;
. = 0x00000070; gUpdateVisibleTiles = .;
. = 0x00000080; gMenu = .;
. = 0x00000080; gIntroState = .;
. = 0x00000080; gChooseFileState = .;
@@ -64,7 +64,7 @@ SECTIONS {
. = 0x00011654; gUnk_02011654 = .;
. = 0x00012654; gMetatilesTop = .;
. = 0x00016654; gUnk_02016654 = .;
. = 0x00017654; gUnk_02017654 = .;
. = 0x00017654; gCurrentRoomProperties = .;
. = 0x00017660; gUnk_02017660 = .;
. = 0x000176A0; gPaletteBuffer = .;
. = 0x000176E0; gUnk_020176E0 = .;
@@ -278,7 +278,7 @@ SECTIONS {
. = 0x00005E60; gUnk_03005E60 = .;
. = 0x00005E98; gUnk_03005E98 = .;
. = 0x00005F24; _ClearAndUpdateEntities = .;
. = 0x00005F40; _UpdateEntities = .;
. = 0x00005F40; UpdateEntities_arm = .;
. = 0x00005FBC; gUnk_03005FBC = .;
. = 0x00005FF0; gUnk_03005FF0 = .;
. = 0x000060F0; gUnk_030060F0 = .;
@@ -333,10 +333,12 @@ 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/playerItem.o(.text);
src/object.o(.text);
src/manager.o(.text);
src/npc.o(.text);
src/collision.o(.text);
/* C source compiled without interworking */
asm/code_08018500.o(.text);
src/code_08018C58.o(.text);
@@ -479,9 +481,6 @@ SECTIONS {
src/createEnemy.o(.text);
src/code_0804AA84.o(.text);
asm/code_0804AA84.o(.text);
src/loadRoomEntityList.o(.text);
asm/loadRoomEntity.o(.text);
asm/code_0804AEB0.o(.text);
src/loadRoom.o(.text);
asm/code_0804B058.o(.text);
src/room.o(.text);
@@ -560,11 +559,6 @@ SECTIONS {
src/manager/manager37.o(.text);
src/manager/manager38.o(.text);
src/manager/manager39.o(.text);
asm/sub_0805E248.o(.text);
src/sub_0805E374.o(.text);
src/sub_0805E3A0.o(.text);
asm/code_0805E3B0.o(.text);
asm/getEmptyEntity.o(.text);
src/entity.o(.text);
src/code_0805EC04.o(.text);
asm/code_0805EC04.o(.text);
@@ -766,7 +760,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);
@@ -985,10 +978,12 @@ SECTIONS {
asm/intr.o(.text);
/* data */
data/data_080B2A70.o(.rodata);
src/interrupts.o(.rodata);
src/playerItem.o(.rodata);
src/object.o(.rodata);
src/manager.o(.rodata);
src/npc.o(.rodata);
src/collision.o(.rodata);
data/data_080B3740.o(.rodata);
data/const/playerItem/playerItem11.o(.rodata);
data/const/playerItem/playerItemBow.o(.rodata);
-536
View File
@@ -1,536 +0,0 @@
#include "global.h"
#include "audio.h"
#include "main.h"
#include "player.h"
#include "structures.h"
#include "save.h"
#include "textbox.h"
#include "functions.h"
#include "object.h"
#include "manager.h"
#include "utils.h"
#include "npc.h"
#include "effects.h"
extern u8 gUnk_03003DE0;
extern u8 gUnk_03000C30;
extern u16* gUnk_02025EB0;
extern u16* gUnk_0200B650;
extern u8 gUnk_02000070;
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 void HandlePlayerLife();
extern void DoPlayerAction();
extern void sub_080171F0();
extern void sub_08078FB0();
extern void DrawEntity();
extern void sub_0807A050();
extern u32 sub_08079B24();
extern void sub_08079708();
extern void CreateSparkle();
extern void sub_080028E0(Entity*);
extern void sub_08078180(void);
extern void sub_0807B0C8(void);
extern void sub_0807A8D8(Entity*);
extern void sub_08077FEC(u32);
extern void ItemInit(Entity*);
extern void ObjectInit(Entity*);
extern u32 ReadBit(void*, u32);
extern void NPCInit(Entity*);
typedef struct {
u8 unk0;
u8 unk1;
u8 unk2;
u8 unk3;
u8 unk4;
u8 unk5;
u16 unk6;
} ItemFrame;
extern ItemFrame gPlayerItemDefinitions[];
extern ItemFrame* gUnk_08126ED8[3];
typedef struct {
u16 unk0;
u16 unk1;
u16 x;
u16 y;
} NPCStruct;
extern NPCStruct gUnk_02031EC0[100];
typedef struct {
void* last;
void* first;
void* node;
u8 flags;
} LinkedList2;
extern LinkedList2 gUnk_03003C70[16];
extern LinkedList2* gUnk_02018EA0;
// Load any resources that were requested with LoadResourceAsync
void LoadResources(void) {
if (gUnk_03003DE0 != 0) {
u8* buf = &gUnk_03000C30;
s32 i = gUnk_03003DE0;
gUnk_03003DE0 = 0;
do {
switch (*buf) {
case 0:
DmaCopy32(3, *(u32*)(buf + 4), *(u32*)(buf + 8), *(u16*)(buf + 2));
break;
case 1:
LZ77UnCompVram(*(void**)(buf + 4), *(u8**)(buf + 8));
break;
case 2:
DmaFill32(3, *(u32*)(buf + 4), *(u32*)(buf + 8), *(u16*)(buf + 2));
break;
}
buf += 12;
i--;
} while (0 < i);
}
}
void PrepNextFrame(void) {
gMain.interruptFlag = 0;
VBlankIntrWait();
do {
// Our VBlankIntr will set this flag
} while (gMain.interruptFlag == 0);
sub_080ADD70();
sub_0801C25C();
UpdateDisplayControls();
LoadResources();
if (gUnk_02000070) {
gUnk_02000070 = 0;
if (gUnk_02025EB0 != NULL)
// sizeof(BGBuffer) = 0x800, what are we omitting?
DmaCopy32(3, &gBG1Buffer, VRAM + (*gUnk_02025EB0 & 0x1f00) * 8, 0x5C0);
if (gUnk_0200B650 != NULL)
DmaCopy32(3, &gBG2Buffer, VRAM + (*gUnk_0200B650 & 0x1f00) * 8, 0x5C0);
}
FadeMain();
}
void PlayerUpdate(Entity* this) {
if (gSave.stats.effect != 0)
gPlayerState.flags |= 0x4000;
else
gPlayerState.flags &= ~0x4000;
if (sub_0805E3B0(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;
} else {
this->flags &= ~0x80;
gPlayerState.field_0xa8 = 0xf;
}
}
HandlePlayerLife(this);
DoPlayerAction(this);
if ((this->height.WORD == 0) && (this->action == 1 || this->action == 9))
sub_08008790(this, 8);
sub_080171F0();
}
sub_08078FB0(this);
DrawEntity(this);
sub_0807A050();
}
// Responsible for some life things like low health beep and initiating the death sequence
#ifdef EU
ASM_FUNC("asm/non_matching/eu/HandlePlayerLife.inc", void HandlePlayerLife(Entity* this));
#else
void HandlePlayerLife(Entity* this) {
u32 temp;
gUnk_0200AF00.filler25[10] = 0;
gUnk_0200AF00.filler25[8] = 0;
gUnk_0200AF00.filler25[9] = 0;
if ((gPlayerEntity.bitfield & 0x80) && (gPlayerEntity.iframes > 0))
SoundReq(SFX_86);
gPlayerState.flags &= ~(0x2000000 | 0x200);
if (gPlayerState.flags & 0x400)
ResetPlayer();
if ((gPlayerState.flags & 0x400000) && !gPlayerState.field_0xa0[0])
sub_0807A108();
if (sub_08079B24() == 0)
sub_08079708(this);
gUnk_03003DF0[0] = 0;
if (gPlayerState.field_0x27[0] != 0)
gPlayerState.field_0x27[0]--;
gPlayerState.field_0xa9 = gPlayerState.field_0xa8;
gPlayerState.field_0xa8 = 0;
if (gPlayerState.field_0x40[0x4a] != 0) {
gPlayerState.field_0x40[0x4a]--;
return;
}
if ((gPlayerState.field_0x8b != 0) || (gMessage.doTextBox & 0x7f))
return;
gRoomVars.unk2 = gMessage.doTextBox & 0x7f;
temp = gSave.stats.maxHealth / 4;
if (temp > 24)
temp = 24;
if (temp < 8)
temp = 8;
if (gSave.stats.health <= temp) {
gRoomVars.unk2 = 1;
if ((gUnk_0200AF00.filler0[1] == 0) && gScreenTransition.frameCount % 90 == 0) {
EnqueueSFX(SFX_LOW_HEALTH);
}
}
if (gSave.stats.charm == 0) {
gSave.stats.charmTimer = 0;
} else if ((gSave.stats.charmTimer == 0) || --gSave.stats.charmTimer == 0) {
gSave.stats.charm = 0;
SoundReq(SFX_ICE_BLOCK_MELT);
}
if (gSave.stats.unkB == 0) {
gSave.stats.unkTimer = 0;
} else if ((gSave.stats.unkTimer == 0) || (--gSave.stats.unkTimer == 0)) {
gSave.stats.unkB = 0;
SoundReq(SFX_140);
} else if ((gSave.stats.unkTimer & 0xf) == 0) {
CreateSparkle(this);
}
if (gSave.stats.effect == 0) {
gSave.stats.effectTimer = 0;
} else if ((gSave.stats.effectTimer == 0) || --gSave.stats.effectTimer == 0) {
gSave.stats.effect = 0;
} else if ((gSave.stats.effectTimer & 0x3f) == 0) {
CreateFx(this, FX_AURA_BASE + gSave.stats.effect, 0);
}
}
#endif
void sub_080171F0(void) {
if (gPlayerState.field_0x1a[0] != 0)
ResetPlayer();
if (gPlayerState.field_0x14 != 0)
gPlayerState.field_0x14--;
if (gPlayerEntity.field_0x7a.HWORD != 0)
gPlayerEntity.field_0x7a.HWORD--;
gPlayerEntity.bitfield &= ~0x80;
if (gPlayerEntity.action != 0x14)
gPlayerState.flags = (gPlayerState.flags & ~0x10000) | (0x10000 * (gPlayerState.flags & 2) / 2);
gPlayerState.flags &= ~2;
sub_080028E0(&gPlayerEntity);
if (gPlayerState.flags & 0x400000)
gUnk_0200AF00.filler25[10] = 1;
sub_08078180();
gPlayerState.field_0x7 &= ~0x80;
gPlayerState.field_0xa &= 0xf;
gPlayerState.keepFacing &= ~0x80;
gPlayerState.field_0x1a[0] = 0;
gPlayerState.field_0x80 = 0;
gPlayerState.field_0xaa = 0;
MemClear(&gUnk_03003BE0, 0x8c);
gPlayerEntity.spriteOffsetY = gPlayerState.field_0x3f;
gPlayerState.field_0x3f = 0;
sub_0807B0C8();
if (gPlayerState.flags & 0x400000)
gUnk_03004040[0]->spriteOffsetY = gUnk_03004040[1]->spriteOffsetY = gUnk_03004040[2]->spriteOffsetY = 0;
if (gPlayerEntity.action == 0x1d)
gPlayerState.flags |= 0x20000000;
else
gPlayerState.flags &= ~0x20000000;
sub_0807A8D8(&gPlayerEntity);
if (gPlayerState.jumpStatus & 0xc0)
gPlayerEntity.iframes = 0xfe;
if (gPlayerEntity.action != 0x17) {
sub_08077FEC(gPlayerEntity.action);
}
}
void ItemUpdate(Entity* this) {
if ((this->flags & 1) == 0 && this->action == 0 && this->subAction == 0)
ItemInit(this);
if (!sub_0805E3B0(this)) {
gPlayerItemFunctions[this->id](this);
this->bitfield &= ~0x80;
if (this->iframes != 0) {
if (this->iframes > 0)
this->iframes--;
else
this->iframes++;
}
}
DrawEntity(this);
}
// tiny regalloc
NONMATCH("asm/non_matching/arm_proxy/ItemInit.inc", void ItemInit(Entity* this)) {
ItemFrame* entry;
entry = &gPlayerItemDefinitions[this->id];
if (entry->unk0 == 0xff) {
u32 temp = entry->unk2;
ItemFrame* temp2 = gUnk_08126ED8[entry->unk1];
entry = &temp2[this->field_0x68.HALF.LO - temp];
}
this->palette.raw = ((entry->unk0 & 0xf) << 4) | entry->unk0;
this->field_0x44 = entry->unk1;
this->field_0x40 = entry->unk3;
this->damageType = entry->unk4;
this->spriteIndex = entry->unk5;
if (entry->unk6 == 0)
this->spriteVramOffset = gPlayerEntity.spriteVramOffset;
else
this->spriteVramOffset = entry->unk6 & 0x3ff;
if (this->animationState == 0)
this->animationState = gPlayerEntity.animationState & 6;
this->collisionLayer = gPlayerEntity.collisionLayer;
this->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
this->spritePriority.b0 = gPlayerEntity.spritePriority.b0;
this->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
this->currentHealth = 1;
this->flags |= 1;
}
END_NONMATCH
void ObjectUpdate(Entity* this) {
int iVar1;
if (((this->flags & 1) == 0) && (this->action == 0))
ObjectInit(this);
if (this->iframes != 0)
this->iframes++;
if (!sub_0805E3B0(this)) {
gObjectFunctions[this->id](this);
this->bitfield &= ~0x80;
}
DrawEntity(this);
}
void ManagerUpdate(Entity* this) {
if (!sub_0805E3B0(this))
gManagerFunctions[this->id](this);
}
// regalloc
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))
NPCInit(this);
if (!sub_0805E3B0(this))
gNPCFunctions[this->id][0](this);
if (this->next != NULL) {
if (gNPCFunctions[this->id][1] != NULL)
gNPCFunctions[this->id][1](this);
if ((this->currentHealth & 0x7f) != 0) {
u32 temp = this->currentHealth & 0x7f;
gUnk_02031EC0[temp * 2 - 2].x = this->x.HALF.HI - gRoomControls.roomOriginX;
gUnk_02031EC0[temp * 2 - 2].y = this->y.HALF.HI - gRoomControls.roomOriginY;
}
DrawEntity(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;
}
+1 -1
View File
@@ -45,7 +45,7 @@ void sub_0804AAD4(void) {
}
void sub_0804AB04(void) {
sub_0805E5C0();
UpdateEntities();
if (gArea.field_0x10 != 0) {
FlushSprites();
sub_080AD9B0();
+2 -2
View File
@@ -251,11 +251,11 @@ u32 CreateItemDrop(Entity* arg0, u32 itemID, u32 itemParameter) {
}
if (arg0->kind == 6) {
if (arg0->id == 99) {
arg0->attachedEntity = itemEntity;
arg0->child = itemEntity;
} else if (arg0->id == 0x1e) {
itemEntity->direction = arg0->animationState << 3 | 0x80;
itemEntity->speed = 0xc0;
itementity->hVelocity = 0x18000;
itementity->zVelocity = 0x18000;
}
}
CopyPosition(arg0, itemEntity);
+1 -1
View File
@@ -40,7 +40,7 @@ void sub_08077E54(ItemBehavior* beh) {
ent->action = gPlayerEntity.animIndex;
*(u8*)&ent->spriteIndex = gPlayerEntity.frameIndex;
ent->subAction = gPlayerEntity.frameDuration;
ent->actionDelay = gPlayerEntity.frames.all;
ent->actionDelay = gPlayerEntity.frame;
}
void sub_08077E78(ItemBehavior* arg0, u32 bits) {
+3 -3
View File
@@ -8,7 +8,7 @@ extern void sub_08080BC4(void);
extern u32 gUnk_0200B650;
extern u32 gUnk_02025EB0;
extern u8 gUnk_02000070;
extern u8 gUpdateVisibleTiles;
void sub_080808D8(void) {
gScreenTransition.transitionType = 0;
@@ -89,7 +89,7 @@ void sub_08080974(u32 arg0, u32 arg1) {
}
sub_080809D4();
gUnk_02000070 = 1;
gUpdateVisibleTiles = 1;
}
void sub_080809D4(void) {
@@ -128,5 +128,5 @@ void sub_080809D4(void) {
}
sub_08080BC4();
gUnk_02000070 = 1;
gUpdateVisibleTiles = 1;
}
+759
View File
@@ -0,0 +1,759 @@
#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->z.HALF.HI - that->z.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->health - 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->z.HALF.HI = (org->z.HALF.HI + tgt->z.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) {
const u8* p = (const u8[]){ FX_27, FX_32, FX_33, FX_34 };
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->child = 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;
}
typedef s32 (*CollisionHandler)(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_08018308(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 CollisionNoOp(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 CollisionGroundItem(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_08017B58(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_08017EB0(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_08017F3C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_08017F40(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_0801802C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_08017DD4(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_080180E8(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_08017BBC(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_08017C40(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_08017D6C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_08017D28(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_08018168(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_08018228(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_08018250(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_08018288(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_080182A8(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_08017B1C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_08017CBC(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
s32 sub_08017E88(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
const CollisionHandler gUnk_080B3744[] = {
sub_08018308, CollisionNoOp, CollisionNoOp, CollisionGroundItem, sub_08017B58, sub_08017EB0,
sub_08017F3C, sub_08017F40, sub_0801802C, sub_08017DD4, sub_080180E8, sub_08017BBC,
sub_08017C40, sub_08017D6C, sub_08017D28, sub_08018168, sub_08018228, sub_08018250,
sub_08018288, sub_080182A8, sub_08017B1C, sub_08017CBC, sub_08017E88,
};
s32 CollisionNoOp(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
return 0;
}
// origin: player or sword
// target: item
s32 CollisionGroundItem(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
COLLISION_OFF(tgt);
tgt->bitfield = org->hurtType | 0x80;
if ((tgt->type == 0x5F || tgt->type == 0x60) && sub_08081420(tgt))
tgt->health = 0;
return 2;
}
s32 sub_08017B1C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
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, ColSettings* settings) {
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, ColSettings* settings) {
if ((gPlayerState.flags & (0x1 | 0x80 | 0x400 | 0x1000)) == 0) {
Entity* e = CreateObject(66, 1, 0);
if (e != NULL) {
e->child = org;
gPlayerState.flags |= 0x400;
org->animationState = (direction ^ 0x10) >> 2;
}
}
tgt->damage = 4;
org->health = 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, ColSettings* settings) {
if ((gPlayerState.flags & (0x1 | 0x80 | 0x800 | 0x1000)) == 0 && gPlayerState.playerAction == 0) {
if (org->action == 1 || org->action == 24) {
tgt->damage = 4;
org->health = 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, ColSettings* settings)) {
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, ColSettings* settings) {
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, ColSettings* settings) {
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, ColSettings* settings) {
org->bitfield = 0;
if (tgt->damage & 0x80)
tgt->damage &= ~0x80;
else
tgt->damage = 4;
gPlayerEntity.health = 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, ColSettings* settings) {
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, ColSettings* settings) {
if (tgt->damage == 0)
return 0;
if (org == &gPlayerEntity) {
u32 temp = tgt->damage;
tgt->damage = 8;
gPlayerEntity.health = 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, ColSettings* settings) {
return 1;
}
s32 sub_08017F40(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
if (tgt->field_0x43 == 0) {
if (org == &gPlayerEntity) {
if (sub_08079F8C() &&
#ifdef EU
(gPlayerState.flags & 0x81) == 0 &&
#else
(gPlayerState.flags & 0x80) == 0 &&
#endif
!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->z.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->health = 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, ColSettings* settings)) {
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->health = 0;
_0801807A:
sub_080180BC(org, tgt);
return 1;
}
} else {
org->health = 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, ColSettings* settings) {
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, ColSettings* settings) {
if (tgt->field_0x43 == 0) {
if (org == &gPlayerEntity) {
if (((sub_08079F8C() != 0) &&
#ifdef EU
((gPlayerState.flags & 0x81) == 0)) &&
#else
((gPlayerState.flags & 0x40080) == 0)) &&
#endif
(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->health = 0;
}
} else if ((tgt->kind == 3) && (org == &gPlayerEntity)) {
sub_08004484(tgt, &gPlayerEntity);
}
return 0;
}
s32 sub_08018228(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
if (org == &gPlayerEntity && sub_08079F8C())
sub_08004484(tgt, org);
return 0;
}
s32 sub_08018250(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
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, ColSettings* settings) {
if (org == &gPlayerEntity)
sub_0807AFE8();
else
org->health = 0;
return 1;
}
s32 sub_080182A8(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
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->health = 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->health = 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;
}
+1 -1
View File
@@ -39,7 +39,7 @@ void PositionRelative(Entity* source, Entity* target, s32 offsetX, s32 offsetY)
y = source->y.WORD;
target->y.WORD = y + offsetY;
target->height = source->height; // ldr
target->z = source->z; // ldr
target->collisionLayer = source->collisionLayer;
UpdateSpriteForCollisionLayer(target);
}
+11 -11
View File
@@ -18,12 +18,12 @@ void sub_0805FA04(void) {
MemClear(&gBG0Buffer, sizeof(gBG0Buffer));
MemClear(&gBG3Buffer, sizeof(gBG3Buffer));
gScreen.lcd.displayControl = 0x940;
gScreen.bg.bg0xOffset = 0;
gScreen.bg.bg0yOffset = 0;
gScreen.affine.bg3xOffset = 0;
gScreen.affine.bg3yOffset = 0;
gScreen.affine.bg3Control = 0x1e0f;
gScreen.affine.bg3Updated = 1;
gScreen.bg0.xOffset = 0;
gScreen.bg0.yOffset = 0;
gScreen.bg3.xOffset = 0;
gScreen.bg3.yOffset = 0;
gScreen.bg3.control = 0x1e0f;
gScreen.bg3.updated = 1;
MessageInitialize();
MemClear((void*)&gUnk_02032EC0, sizeof(UI));
MemClear((void*)&gMenu, sizeof(Menu));
@@ -48,11 +48,11 @@ void sub_0805FA98(void) {
case 0x200:
gMenu.focusCoords[0] ^= 1;
if (gMenu.focusCoords[0] == 0) {
gScreen.bg.bg0Control = 0x1f0c;
gScreen.affine.bg3Control = 0x1e0f;
gScreen.bg0.control = 0x1f0c;
gScreen.bg3.control = 0x1e0f;
} else {
gScreen.bg.bg0Control = 0x1f0f;
gScreen.affine.bg3Control = 0x1e0c;
gScreen.bg0.control = 0x1f0f;
gScreen.bg3.control = 0x1e0c;
}
break;
case 0x100:
@@ -87,7 +87,7 @@ void sub_0805FA98(void) {
}
}
gMenu.focusCoords[1] = (gMenu.focusCoords[1] + 3) % 3;
gScreen.affine.bg3Updated = 1;
gScreen.bg3.updated = 1;
}
void sub_0805FBC4() {
+6 -6
View File
@@ -49,12 +49,12 @@ void sub_080A2E40(void) {
MemCopy(&gUnk_08A05751, &gBG1Buffer, 0x800);
MemCopy(&gUnk_08A05751[0x800], &gBG2Buffer, 0x800);
gScreen.lcd.displayControl = 0x1f00;
gScreen.bg.bg1Control = 0x1c81;
gScreen.affine.bg2Control = 0x1d82;
gScreen.affine.bg3Control = 0x1e0b;
gScreen.bg.bg1Updated = 1;
gScreen.affine.bg2Updated = 1;
gScreen.affine.bg3Updated = 1;
gScreen.bg1.control = 0x1c81;
gScreen.bg2.control = 0x1d82;
gScreen.bg3.control = 0x1e0b;
gScreen.bg1.updated = 1;
gScreen.bg2.updated = 1;
gScreen.bg3.updated = 1;
gScreen.controls.layerFXControl = 0x1044;
gScreen.controls.alphaBlend = 0xb04;
{
+74 -75
View File
@@ -53,7 +53,7 @@ void sub_080318DC(Entity* this) {
if (this->bitfield != 0x80 && this->bitfield != 0x81) {
if (this->type == 1) {
if (this->action < 7 && this->knockbackDuration != 0) {
brother = this->attachedEntity;
brother = this->child;
if (brother) {
brother->parent = this->parent;
do {
@@ -61,42 +61,42 @@ void sub_080318DC(Entity* this) {
brother->spritePriority.b1 = 1;
if (brother->iframes == 0)
brother->iframes = -12;
} while (brother = brother->attachedEntity, brother != NULL);
} while (brother = brother->child, brother != NULL);
}
if (this->parent) {
this->parent->attachedEntity = this->attachedEntity;
this->parent->child = this->child;
} else {
if (this->attachedEntity)
if (this->child)
this->parent = this;
}
this->action = 9;
this->spritePriority.b1 = 1;
if (this->knockbackDirection < 0x10) {
this->spriteSettings.b.flipX = 0;
this->spriteSettings.flipX = 0;
} else {
this->spriteSettings.b.flipX = 1;
this->spriteSettings.flipX = 1;
}
InitializeAnimation(this, 14);
}
if (this->currentHealth == 0) {
if (this->health == 0) {
this->knockbackDirection = ((this->knockbackDirection + (7 & Random())) - 4) & 0x1f;
this->knockbackDuration += this->type2 * 3;
sub_08032338(this);
}
}
if (this->knockbackDuration != 0 && this->frames.all & 0x10) {
if (this->knockbackDuration != 0 && this->frame & 0x10) {
if (this->type == 0) {
this->action = 8;
} else {
this->action = 9;
}
if (this->knockbackDirection < 0x10) {
this->spriteSettings.b.flipX = 0;
this->spriteSettings.flipX = 0;
} else {
this->spriteSettings.b.flipX = 1;
this->spriteSettings.flipX = 1;
}
this->spritePriority.b1 = 1;
InitializeAnimation(this, 14);
@@ -147,7 +147,7 @@ void sub_08031AC8(Entity* this)
y = this->field_0x76.HWORD + ((s32)(rand >> 4) % 5) * 0x10 - 0x20;
if (sub_080002D4(x, y, this->collisionLayer) == 0) {
this->action = 2;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->x.HALF.HI = x;
this->y.HALF.HI = y;
InitializeAnimation(this, 0);
@@ -158,11 +158,11 @@ void sub_08031AC8(Entity* this)
void sub_08031B48(Entity* this) {
GetNextFrame(this);
if (this->frames.b.f0) {
this->frames.all = 0;
this->flags |= 0x80;
if (this->frame & 1) {
this->frame = 0;
COLLISION_ON(this);
} else {
if (this->frames.b.f3) {
if (this->frame & 0x80) {
this->action = 0x3;
this->actionDelay = gUnk_080CE5B0[Random() & 7];
InitializeAnimation(this, 1);
@@ -174,21 +174,20 @@ void sub_08031B98(Entity* this) {
if (sub_08031E04(this)) {
this->action = 5;
if (this->x.HALF.HI > gUnk_020000B0->x.HALF.HI) {
this->spriteSettings.b.flipX = 0;
this->spriteSettings.flipX = 0;
} else {
this->spriteSettings.b.flipX = 1;
this->spriteSettings.flipX = 1;
}
InitializeAnimation(this, 3);
} else {
if (this->frames.b.f0 && this->actionDelay) {
// this->frames.b.f0 = 0;
this->frames.all &= 0xfe;
if ((this->frame & 1) && this->actionDelay) {
this->frame &= 0xfe;
this->actionDelay--;
}
GetNextFrame(this);
if (this->actionDelay == 0) {
this->action = 4;
this->flags &= 0x7f;
COLLISION_OFF(this);
InitializeAnimation(this, 2);
}
}
@@ -196,10 +195,10 @@ void sub_08031B98(Entity* this) {
void sub_08031C1C(Entity* this) {
GetNextFrame(this);
if (this->frames.b.f3) {
if (this->frame & 0x80) {
this->action = '\x01';
this->actionDelay = gUnk_080CE5B8[Random() & 7];
this->spriteSettings.b.draw = 0;
this->spriteSettings.draw = 0;
}
}
@@ -207,7 +206,7 @@ void sub_08031C58(Entity* this) {
Entity *a, *b;
GetNextFrame(this);
if (this->frames.b.f3) {
if (this->frame & 0x80) {
if (gEntCount < 0x43) {
u32 tmp = Random();
tmp &= 3;
@@ -217,33 +216,33 @@ void sub_08031C58(Entity* this) {
a->parent = NULL;
a->field_0x74.HALF.LO = tmp;
sub_08031E48(this, a);
a->attachedEntity = CreateEnemy(ACRO_BANDIT, 1);
a->child = CreateEnemy(ACRO_BANDIT, 1);
b = a->attachedEntity;
b = a->child;
b->type2 = 1;
b->parent = a;
b->field_0x74.HALF.LO = tmp;
sub_08031E48(this, b);
b->attachedEntity = CreateEnemy(ACRO_BANDIT, 1);
b->child = CreateEnemy(ACRO_BANDIT, 1);
a = b->attachedEntity;
a = b->child;
a->type2 = 2;
a->parent = b;
a->field_0x74.HALF.LO = tmp;
sub_08031E48(this, a);
a->attachedEntity = CreateEnemy(ACRO_BANDIT, 1);
a->child = CreateEnemy(ACRO_BANDIT, 1);
b = a->attachedEntity;
b = a->child;
b->type2 = 3;
b->parent = a;
b->field_0x74.HALF.LO = tmp;
sub_08031E48(this, b);
b->attachedEntity = CreateEnemy(ACRO_BANDIT, 1);
b->child = CreateEnemy(ACRO_BANDIT, 1);
a = b->attachedEntity;
a = b->child;
a->type2 = 4;
a->parent = b;
a->attachedEntity = NULL;
a->child = NULL;
a->field_0x74.HALF.LO = tmp;
sub_08031E48(this, a);
@@ -253,9 +252,9 @@ void sub_08031C58(Entity* this) {
InitializeAnimation(this, 7);
}
} else {
if (this->frames.b.f0) {
this->frames.all = 0;
this->flags &= 0x7f;
if (this->frame & 1) {
this->frame = 0;
COLLISION_OFF(this);
}
}
}
@@ -264,9 +263,9 @@ 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;
this->spriteSettings.draw = 0;
}
}
@@ -282,14 +281,14 @@ void sub_08031DA0(Entity* this) {
}
void sub_08031DC4(Entity* this) {
if (this->frames.b.f3) {
if (this->frame & 0x80) {
this->action = 1;
this->actionDelay = 0xb4;
this->spriteSettings.b.draw = 0;
this->spriteSettings.draw = 0;
} else {
GetNextFrame(this);
if ((this->frames.all & 0xf) == 2) {
this->flags &= 0x7f;
if ((this->frame & 0xf) == 2) {
COLLISION_OFF(this);
}
}
}
@@ -302,7 +301,7 @@ u32 sub_08031E04(Entity* this) {
if (ent == NULL)
return 0;
tmp = &gUnk_080CE5C0[this->frames.all & 6];
tmp = &gUnk_080CE5C0[this->frame & 6];
return sub_0806FCB8(this, ent->x.HALF.HI + tmp[0], ent->y.HALF.HI + tmp[1], 0x50);
}
@@ -323,8 +322,8 @@ void sub_08031E90(Entity* this) {
void sub_08031EA8(Entity* this) {
this->action = 1;
this->spritePriority.b1 = 1;
this->hVelocity = 0x40000;
this->height.HALF.HI = (4 - this->type2) * 0xe;
this->zVelocity = 0x40000;
this->z.HALF.HI = (4 - this->type2) * 0xe;
this->field_0x78.HALF.HI = Random();
InitializeAnimation(this, 4);
}
@@ -332,34 +331,34 @@ void sub_08031EA8(Entity* this) {
void sub_08031EE8(Entity* this) {
int draw;
this->height.WORD -= this->hVelocity;
this->hVelocity -= 0x1800;
this->z.WORD -= this->zVelocity;
this->zVelocity -= 0x1800;
if (this->height.HALF.HI < 1) {
draw = this->spriteSettings.b.draw;
if (this->z.HALF.HI < 1) {
draw = this->spriteSettings.draw;
if (!draw)
EnqueueSFX(299);
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
}
draw = this->spriteSettings.b.draw;
draw = this->spriteSettings.draw;
if (draw == 1)
GetNextFrame(this);
if (this->hVelocity < 1) {
if (this->zVelocity < 1) {
this->action = 2;
this->flags |= 0x80;
COLLISION_ON(this);
InitializeAnimation(this, 5);
}
}
void sub_08031F54(Entity* this) {
sub_08003FC4(this, gUnk_080CE5F0[this->type2]);
if (this->type2 * -0xe <= this->height.HALF.HI) {
if (this->type2 * -0xe <= this->z.HALF.HI) {
this->action = 3;
this->actionDelay = 20;
this->height.HALF.HI = this->type2 * -0xe;
this->z.HALF.HI = this->type2 * -0xe;
if (this->parent != NULL)
this->spritePriority.b1 = 0;
InitializeAnimation(this, 6);
@@ -368,11 +367,11 @@ void sub_08031F54(Entity* this) {
void sub_08031FB0(Entity* this) {
GetNextFrame(this);
if (this->frames.b.f3 && (this->parent || --this->actionDelay == 0)) {
if ((this->frame & 0x80) && (this->parent || --this->actionDelay == 0)) {
this->action = 4;
this->direction = sub_08049F84(this, 1);
*(u8*)&this->field_0x76 = 0;
if (this->attachedEntity) {
if (this->child) {
InitializeAnimation(this, 9);
} else {
InitializeAnimation(this, 8);
@@ -406,7 +405,7 @@ void sub_08032008(Entity* this) {
}
if (this->direction & 0xf)
this->spriteSettings.b.flipX = (this->direction >> 4 ^ 1);
this->spriteSettings.flipX = (this->direction >> 4 ^ 1);
ProcessMovement(this);
} else {
@@ -445,19 +444,19 @@ void sub_08032160(Entity* this) {
dir = gUnk_080CE5FA[this->field_0x74.HALF.LO * 5 + this->type2];
this->direction = dir;
if (dir >= 0x10) {
this->spriteSettings.b.flipX = 1;
this->spriteSettings.flipX = 1;
} else {
this->spriteSettings.b.flipX = 0;
this->spriteSettings.flipX = 0;
}
this->speed = 0xf0;
this->hVelocity = 0x12000;
this->zVelocity = 0x12000;
this->spritePriority.b1 = 1;
InitializeAnimation(this, 12);
}
if (this->attachedEntity == NULL) {
if (this->child == NULL) {
for (tmp = this->parent; tmp != NULL; tmp = tmp->parent) {
if (tmp->currentHealth != 0)
if (tmp->health != 0)
tmp->actionDelay = 0;
}
this->actionDelay = 0;
@@ -473,11 +472,11 @@ void sub_080321E8(Entity* this) {
void sub_08032204(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 1) {
this->frames.all = 0;
if (this->frame & 1) {
this->frame = 0;
this->frameDuration = (Random() & 0x30) + 30;
} else {
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->action = 9;
InitializeAnimation(this, 13);
}
@@ -486,15 +485,15 @@ void sub_08032204(Entity* this) {
void sub_08032248(Entity* this) {
if (sub_08003FC4(this, 0x1800) == 0) {
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
((Entity*)this->field_0x7c.WORD)->actionDelay--;
DeleteEntity(this);
} else {
GetNextFrame(this);
if ((this->frames.all & 0xf) == 2)
this->flags &= 0x7f;
if ((this->frame & 0xf) == 2)
COLLISION_OFF(this);
}
}
}
@@ -506,10 +505,10 @@ void sub_08032290(Entity* this) {
}
u32 sub_080322A4(Entity* this) {
if (this->attachedEntity != NULL && (this->attachedEntity->height.HALF.HI + 8) >= this->height.HALF.HI) {
if (this->height.HALF.HI) {
if (this->child != NULL && (this->child->z.HALF.HI + 8) >= this->z.HALF.HI) {
if (this->z.HALF.HI) {
this->action = 5;
this->height.HALF.HI = this->attachedEntity->height.HALF.HI + 8;
this->z.HALF.HI = this->child->z.HALF.HI + 8;
InitializeAnimation(this, 11);
return 1;
} else {
@@ -524,15 +523,15 @@ void sub_080322E8(Entity* this) {
u8 tmp;
if (this->field_0x78.HALF.LO) {
if (--this->field_0x78.HALF.LO == 0) {
u32 flipX = this->spriteSettings.b.flipX;
this->spriteSettings.b.flipX = flipX ^ 1;
u32 flipX = this->spriteSettings.flipX;
this->spriteSettings.flipX = flipX ^ 1;
}
} else {
tmp = this->direction;
if (tmp & 0xF) {
tmp >>= 4;
tmp ^= 1;
if (tmp != this->spriteSettings.b.flipX) {
if (tmp != this->spriteSettings.flipX) {
this->field_0x78.HALF.LO = 6;
}
}
+23 -23
View File
@@ -34,10 +34,10 @@ 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;
this->z.HALF.HI = -1;
((u8*)&this->field_0x86)[1] = 1;
InitializeAnimation(this, 6);
}
@@ -47,7 +47,7 @@ void sub_08021780(Entity* this) {
break;
}
if (this->currentHealth == 0)
if (this->health == 0)
this->knockbackDuration = 0;
sub_0804AA30(this, gUnk_080CB590);
@@ -71,7 +71,7 @@ void sub_08021848(Entity* this) {
gUnk_080CB5C8[this->subAction](this);
} else {
this->action = 3;
this->height.HALF.HI = 0;
this->z.HALF.HI = 0;
InitializeAnimation(this, 2);
}
}
@@ -102,24 +102,24 @@ void sub_080218B4(Entity* this) {
void sub_080218CC(Entity* this) {
if (this->subAction == 0) {
this->subAction = 1;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->direction = ((sub_08049F84(this, 1) ^ 0x10) + gUnk_080CB5DC[Random() & 7]) & 0x1f;
this->speed = 0x100;
this->hVelocity = 0x12000;
this->zVelocity = 0x12000;
}
GetNextFrame(this);
if (this->frames.all & 1) {
if (this->frame & 1) {
sub_080AEFE0(this);
if (sub_080044EC(this, 0x1c00) == 0)
this->frameDuration = 1;
}
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
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,9 +128,9 @@ void sub_080218CC(Entity* this) {
void sub_08021984(Entity* this) {
if (this->subAction == 0) {
this->subAction = 1;
this->flags |= 0x80;
this->spriteSettings.b.draw = 3;
this->height.HALF.HI = -0x80;
COLLISION_ON(this);
this->spriteSettings.draw = 3;
this->z.HALF.HI = -0x80;
this->spriteRendering.b3 = 1;
this->spriteOrientation.flipY = 1;
EnqueueSFX(0x12d);
@@ -140,7 +140,7 @@ void sub_08021984(Entity* this) {
this->action = 2;
this->actionDelay = 16;
this->field_0xf = 1;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->speed = 0x180;
((u8*)&this->field_0x86)[0] = 60;
InitializeAnimation(this, 0);
@@ -187,7 +187,7 @@ void sub_08021A64(Entity* this) {
void sub_08021AD8(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 1) {
if (this->frame & 1) {
if (this->actionDelay) {
u32 tmp;
@@ -207,7 +207,7 @@ void sub_08021AD8(Entity* this) {
this->frameDuration = 1;
}
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->action = 2;
this->actionDelay = 20;
((u8*)&this->field_0x86)[0] = 60;
@@ -218,7 +218,7 @@ void sub_08021AD8(Entity* this) {
void sub_08021B64(Entity* this) {
if (gPlayerState.flags & 4) {
this->action = 3;
this->height.WORD = 0;
this->z.WORD = 0;
InitializeAnimation(this, 2);
} else {
int iVar4 = 1;
@@ -238,7 +238,7 @@ void sub_08021B64(Entity* this) {
if (iVar4 == 0) {
this->action = 6;
this->hVelocity = 0x10000;
this->zVelocity = 0x10000;
((u8*)&this->field_0x86)[1] = 0;
if (gPlayerEntity.direction != 0xff) {
this->direction = 0x10 ^ gPlayerEntity.direction;
@@ -252,7 +252,7 @@ void sub_08021B64(Entity* this) {
gPlayerState.field_0xaa++;
CopyPositionAndSpriteOffset(&gPlayerEntity, this);
this->x.HALF.HI += gUnk_080CB5E4[(this->field_0xf++ & 0xe) >> 1];
this->height.HALF.HI--;
this->z.HALF.HI--;
GetNextFrame(this);
}
}
@@ -260,17 +260,17 @@ void sub_08021B64(Entity* this) {
void sub_08021C58(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 1) {
if (this->frame & 1) {
sub_080AEFE0(this);
if (sub_08003FC4(this, 0x1800) == 0)
this->frameDuration = 1;
}
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
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);
@@ -278,7 +278,7 @@ void sub_08021C58(Entity* this) {
}
void sub_08021CD0(Entity* this) {
if ((this->frames.all & 0x80) == 0)
if ((this->frame & 0x80) == 0)
GetNextFrame(this);
if (sub_08049F84(this, 1) == 0xff)
@@ -299,7 +299,7 @@ u32 sub_08021D00(Entity* this) {
} else {
this->action = 4;
this->actionDelay = 1;
this->hVelocity = 0x18000;
this->zVelocity = 0x18000;
InitializeAnimation(this, 4);
ret = 1;
}
+3 -3
View File
@@ -8,8 +8,8 @@ extern void sub_080A2CC0();
void BladeTrap(Entity* this) {
if (this->action == 0) {
this->action = 1;
this->attachedEntity = GetCurrentRoomProperty(this->type);
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74);
this->child = GetCurrentRoomProperty(this->type);
sub_080A2CC0(this, &this->child, &this->field_0x74);
}
if (!(this->direction & 0x80)) {
sub_0806F69C(this);
@@ -19,6 +19,6 @@ void BladeTrap(Entity* this) {
if (!(this->direction & 0x80)) {
EnqueueSFX(0x74);
}
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74.HWORD);
sub_080A2CC0(this, &this->child, &this->field_0x74.HWORD);
}
}
+20 -20
View File
@@ -52,9 +52,9 @@ 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->zVelocity = 0x18000;
this->speed = 0;
this->field_0x80.HALF.HI = 1;
InitializeAnimation(this, this->direction >> 4 | 6);
@@ -68,15 +68,15 @@ void sub_0802C7AC(Entity* this) {
if (this->subAction < 3 && !sub_0806F520(this)) {
this->subAction = 0;
this->field_0xf = 1;
this->height.HALF.HI = 0;
this->z.HALF.HI = 0;
if (this->field_0x82.HALF.LO != 2) {
this->speed = this->field_0x82.HALF.LO ? 0x200 : 0x80;
}
this->hVelocity = 0x18000;
this->zVelocity = 0x18000;
this->field_0x82.HALF.HI = 0;
this->field_0x80.HALF.HI = 0;
} else {
this->height.HALF.HI = -1;
this->z.HALF.HI = -1;
gUnk_080CD600[this->subAction](this);
if (this->actionDelay != 0) {
GetNextFrame(this);
@@ -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;
}
}
@@ -135,7 +135,7 @@ void sub_0802C8B8(Entity* this) {
void sub_0802C8C4(Entity* this) {
sub_0804A7D4(this);
this->spriteSettings.b.draw = 0;
this->spriteSettings.draw = 0;
}
void sub_0802C8D8(Entity* this) {
@@ -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,10 +222,10 @@ 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;
this->zVelocity = 0x18000;
this->speed = 0;
this->field_0x82.HALF.HI = 0;
this->field_0x80.HALF.HI = 0;
@@ -242,10 +242,10 @@ void sub_0802CAF8(Entity* this) {
}
sub_0802CC18(this);
sub_08078930(this);
if (this->field_0xf && this->height.HALF.HI == 0) {
if (this->field_0xf && this->z.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;
@@ -276,9 +276,9 @@ void sub_0802CBC4(Entity* this) {
Entity* ent;
this->action = 4;
this->spriteSettings.b.draw = 0;
this->flags &= ~0x80;
this->currentHealth = 0;
this->spriteSettings.draw = 0;
COLLISION_OFF(this);
this->health = 0;
if (this->field_0x82.HALF.HI) {
sub_08079184();
}
+28 -28
View File
@@ -87,7 +87,7 @@ void sub_0802A8F4(Entity* this) {
void sub_0802A8FC(Entity* this) {
if ((gPlayerState.field_0x1c & 0xf) == 0) {
this->currentHealth = gPlayerState.field_0x1c & 0xf;
this->health = gPlayerState.field_0x1c & 0xf;
}
}
@@ -96,7 +96,7 @@ void nullsub_143(Entity* this) {
}
void sub_0802A91C(Entity* this) {
this->currentHealth = 0;
this->health = 0;
}
void sub_0802A924(Entity* this) {
@@ -108,7 +108,7 @@ void sub_0802A924(Entity* this) {
#ifdef EU
this->field_0x3c |= 0x10;
#endif
this->height.HALF.HI = -0x30;
this->z.HALF.HI = -0x30;
this->field_0x80.HALF.LO = Random() & 1;
this->field_0x82.HWORD = 0;
this->field_0x7a.HALF.HI = 0;
@@ -140,7 +140,7 @@ void sub_0802A9A8(Entity* this) {
if (gRoomControls.unk2 != 0) {
return;
}
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->field_0x82.HWORD = 1;
if (this->field_0x80.HALF.LO) {
this->x.HALF.HI = gRoomControls.roomScrollX - 0x10;
@@ -166,10 +166,10 @@ void sub_0802AA40(Entity* this) {
if (this->actionDelay) {
this->actionDelay--;
} else {
Entity* ent = this->attachedEntity;
Entity* ent = this->child;
if (ent) {
if (ent->next == NULL) {
this->attachedEntity = NULL;
this->child = NULL;
} else {
u32 direction = DirectionRound(this->field_0x80.HALF.LO * 0x10 + 0x18);
@@ -198,12 +198,12 @@ void sub_0802AAC0(Entity* this) {
}
if (this->field_0x80.HALF.HI) {
Entity* ent = this->attachedEntity;
Entity* ent = this->child;
if (ent == NULL) {
this->field_0x80.HALF.HI = 0;
} else if (ent->next == NULL) {
this->field_0x80.HALF.HI = 0;
this->attachedEntity = NULL;
this->child = NULL;
} else if (ent->actionDelay == 0 && ent->field_0xf < 0x51) {
this->field_0x80.HALF.HI = 0;
}
@@ -227,10 +227,10 @@ void sub_0802AB40(Entity* this) {
sub_0802AC40(this);
switch (this->field_0x78.HALF.LO) {
case 0:
if (this->height.HALF.HI) {
if (this->z.HALF.HI) {
if (--this->field_0x78.HALF.HI == 0) {
this->field_0x78.HALF.HI = 4;
this->height.HALF.HI++;
this->z.HALF.HI++;
}
} else {
this->field_0x78.HALF.LO = 1;
@@ -247,10 +247,10 @@ void sub_0802AB40(Entity* this) {
}
break;
case 2:
if (-0x30 < this->height.HALF.HI) {
if (-0x30 < this->z.HALF.HI) {
if (--this->field_0x78.HALF.HI == 0) {
this->field_0x78.HALF.HI = 4;
this->height.HALF.HI--;
this->z.HALF.HI--;
sub_0802ACDC(this, 4);
}
} else {
@@ -264,7 +264,7 @@ void sub_0802AB40(Entity* this) {
#endif
void sub_0802AC08(Entity* this) {
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->action = 2;
this->subAction = 0;
this->actionDelay = 0x40;
@@ -286,7 +286,7 @@ void sub_0802AC40(Entity* this) {
this->field_0x7a.HALF.LO = 0;
this->spritePriority.b1 = 0;
} else {
if (this->height.HALF.HI == 0) {
if (this->z.HALF.HI == 0) {
if (this->spritePriority.b1 != 1) {
this->spritePriority.b1 = 1;
}
@@ -299,7 +299,7 @@ void sub_0802AC40(Entity* this) {
} else {
if (sub_0802B234(this)) {
this->field_0x7a.HALF.LO = 1;
if (this->height.HALF.HI == 0) {
if (this->z.HALF.HI == 0) {
this->spritePriority.b1 = 1;
} else {
this->spritePriority.b1 = 3;
@@ -335,19 +335,19 @@ void sub_0802AD1C(Entity* this, u32 param_2) {
void sub_0802AD54(Entity* this) {
if (this->field_0x82.HWORD != 0) {
if (gRoomControls.unk2 != 0) {
this->spriteSettings.b.draw = 0;
this->spriteSettings.draw = 0;
DeleteEntity(this);
return;
}
if (gRoomControls.roomOriginY > this->y.HALF.HI ||
(gRoomControls.roomOriginY + gRoomControls.height + 0x20) < this->y.HALF.HI) {
this->spriteSettings.b.draw = 0;
this->spriteSettings.draw = 0;
} else {
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
}
}
if (this->field_0x80.HALF.HI) {
if (this->attachedEntity == NULL || this->attachedEntity->next == NULL) {
if (this->child == NULL || this->child->next == NULL) {
this->action = 4;
this->actionDelay = 0xc0;
this->field_0xf = 4;
@@ -365,10 +365,10 @@ void sub_0802ADDC(Entity* this) {
if (ent != NULL) {
ent->type2 = !!sub_0802B234(this);
ent->parent = this;
this->attachedEntity = ent;
this->child = ent;
CopyPosition(this, ent);
/*#ifdef EU
this->height.HALF.HI += 8;
this->z.HALF.HI += 8;
#endif*/
this->field_0x80.HALF.HI = 1;
if (this->type == 0) {
@@ -381,7 +381,7 @@ void sub_0802ADDC(Entity* this) {
void sub_0802AE24(Entity* this) {
this->action = 1;
this->actionDelay = 0xf0;
this->hVelocity = 0x8000;
this->zVelocity = 0x8000;
this->hitbox = (Hitbox*)&gUnk_080CD174;
this->field_0x3c = 3;
this->field_0x16 = 0;
@@ -403,7 +403,7 @@ void sub_0802AE68(Entity* this) {
} else {
if (ent->field_0x80.HALF.HI) {
CopyPosition(ent, this);
this->spriteSettings.b.draw = 0;
this->spriteSettings.draw = 0;
} else {
this->action = 3;
this->field_0x80.HALF.LO = 1;
@@ -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);
}
}
@@ -539,8 +539,8 @@ void sub_0802B048(Entity* this) {
this->action = 4;
this->hitbox = (Hitbox*)&gUnk_080CD17C;
this->actionDelay = 0xf;
this->spriteSettings.b.draw = 0;
this->flags |= 0x80;
this->spriteSettings.draw = 0;
COLLISION_ON(this);
this->field_0x7a.HALF.HI = 0;
sub_08078954(this);
if (this->parent->next) {
@@ -621,7 +621,7 @@ Entity* sub_0802B250(Entity* this) {
}
void sub_0802B264(Entity* this) {
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
if (sub_0802B234(this)) {
this->spritePriority.b1 = 3;
} else {
+1 -1
View File
@@ -26,7 +26,7 @@ void sub_0803C198(Entity* this) {
sub_0804AA30(this, gUnk_080CFF78);
if ((this->bitfield & 0x80) != 0) {
sub_0803C5F0(this);
pEVar1 = this->attachedEntity;
pEVar1 = this->child;
if (pEVar1 != NULL) {
pEVar1->field_0xf++;
}
+14 -14
View File
@@ -55,15 +55,15 @@ 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) {
pEVar1->height.HALF.HI -= 8;
pEVar1->z.HALF.HI -= 8;
}
EnqueueSFX(0x1bb);
}
@@ -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);
}
}
@@ -112,7 +112,7 @@ void sub_08028A74(Entity* this) {
switch (this->subAction) {
case 0:
unk = 1;
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->subAction = 1;
this->actionDelay = 0x3c;
this->field_0xf = 0x10;
@@ -138,19 +138,19 @@ void sub_08028A74(Entity* this) {
case 2:
unk = 1;
sub_080290FC(this);
if (this->frames.all & 1) {
if (this->frame & 1) {
Entity* ent = CreateProjectileWithParent(this, 4, 0);
if (ent != NULL) {
ent->parent = this;
ent->direction = this->direction;
this->frames.all &= ~1;
this->frame &= ~1;
this->subAction = 3;
}
}
break;
case 3:
unk = 2;
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->subAction = 4;
this->actionDelay = 0x50;
sub_080290E0(this, 1);
@@ -189,7 +189,7 @@ void sub_08028BC4(Entity* this) {
switch (this->subAction) {
case 0:
if (this->actionDelay == 0) {
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->subAction = 1;
sub_08028FDC(this);
sub_080290E0(this, 5);
@@ -200,7 +200,7 @@ void sub_08028BC4(Entity* this) {
}
break;
case 1:
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->action = 4;
this->subAction = 0;
this->actionDelay = 0x1e;
@@ -209,7 +209,7 @@ void sub_08028BC4(Entity* this) {
iVar1 = sub_0804A9FC(this, 0x1c);
if (iVar1 != NULL) {
iVar1->spritePriority.b0 = 3;
iVar1->height.HALF.HI -= 12;
iVar1->z.HALF.HI -= 12;
sub_0805E3A0(iVar1, 2);
}
SetFlag(this->field_0x86.HWORD);
@@ -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);
@@ -549,7 +549,7 @@ void sub_0802925C(Entity* this) {
void sub_08029270(Entity* this) {
if (this->action == 0) {
this->action++;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 0xe);
} else {
GetNextFrame(this);
+1 -1
View File
@@ -63,7 +63,7 @@ void sub_0802B56C(Entity* this) {
void sub_0802B5C8(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->action = 1;
this->actionDelay = 30;
InitializeAnimation(this, 0);
+63 -63
View File
@@ -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,12 +100,12 @@ void sub_0801EF40(Entity* this) {
if (this->type == 2) {
if (this->bitfield == 0x8e || this->bitfield == 0x95) {
this->flags &= ~0x80;
this->currentHealth = 0;
COLLISION_OFF(this);
this->health = 0;
}
}
health = this->currentHealth;
health = this->health;
if (health) {
if (this->bitfield == 0x94) {
sub_0801FB68(this);
@@ -117,10 +117,10 @@ void sub_0801EF40(Entity* this) {
}
} else {
sub_0804AA1C(this);
this->hVelocity = 0;
this->zVelocity = 0;
InitializeAnimation(this, 9);
}
this->field_0x80.HALF.LO = this->currentHealth;
this->field_0x80.HALF.LO = this->health;
sub_0804AA30(this, gUnk_080CA21C);
}
@@ -157,7 +157,7 @@ void sub_0801F048(Entity* this) {
}
void sub_0801F084(Entity* this) {
if ((this->frames.all & 0x80) == 0)
if ((this->frame & 0x80) == 0)
GetNextFrame(this);
sub_08001242(this);
}
@@ -165,7 +165,7 @@ void sub_0801F084(Entity* this) {
void sub_0801F0A4(Entity* this) {
sub_0804A720(this);
this->action = 1;
this->field_0x80.HALF.LO = this->currentHealth;
this->field_0x80.HALF.LO = this->health;
this->field_0x82.HALF.LO = 0;
}
@@ -175,12 +175,12 @@ void nullsub_4(Entity* this) {
void sub_0801F0C8(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->action = 3;
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);
@@ -210,10 +210,10 @@ void sub_0801F12C(Entity* this) {
}
void sub_0801F1B0(Entity* this) {
if (this->frames.all & 0x10) {
if (this->frames.all & 1) {
this->frames.all ^= 1;
this->damageType = 90;
if (this->frame & 0x10) {
if (this->frame & 1) {
this->frame ^= 1;
this->hitType = 90;
EnqueueSFX(299);
}
sub_080AEFE0(this);
@@ -223,7 +223,7 @@ void sub_0801F1B0(Entity* this) {
GetNextFrame(this);
}
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
if (sub_0801FBD0(this)) {
sub_0801F328(this);
} else {
@@ -242,7 +242,7 @@ void sub_0801F228(Entity* this) {
void sub_0801F250(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80)
if (this->frame & 0x80)
sub_0801F360(this);
}
@@ -269,9 +269,9 @@ void sub_0801F270(Entity* this) {
void sub_0801F2CC(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->action = 1;
this->spriteSettings.b.draw = 0;
this->spriteSettings.draw = 0;
InitializeAnimation(this, 4);
}
}
@@ -279,7 +279,7 @@ void sub_0801F2CC(Entity* this) {
void sub_0801F2F8(Entity* this) {
sub_08003FC4(this, 0x1800);
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
sub_0801F340(this);
sub_0804AA1C(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);
}
@@ -317,7 +317,7 @@ void sub_0801F3AC(Entity* this) {
if (this->field_0x82.HALF.LO || PlayerInRange(this, 1, 0x48)) {
if (this->action == 1) {
this->action = 2;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->field_0x82.HALF.LO = 1;
InitializeAnimation(this, 0);
}
@@ -339,16 +339,16 @@ void sub_0801F428(Entity* this) {
sub_0804A720(this);
this->action = 1;
this->actionDelay = Random();
this->field_0x80.HALF.LO = this->currentHealth;
this->field_0x80.HALF.LO = this->health;
this->field_0x82.HALF.LO = 0;
if (this->type2 == 0)
return;
this->action = 3;
this->field_0xf = 30;
this->flags |= 0x80;
COLLISION_ON(this);
this->spritePriority.b1 = 3;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 2);
}
#endif
@@ -359,11 +359,11 @@ void sub_0801F48C(Entity* this) {
void sub_0801F494(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
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);
@@ -401,10 +401,10 @@ void sub_0801F508(Entity* this) {
}
void sub_0801F584(Entity* this) {
if (this->frames.all & 0x10) {
if (this->frames.all & 0x1) {
this->frames.all ^= 1;
this->damageType = 91;
if (this->frame & 0x10) {
if (this->frame & 0x1) {
this->frame ^= 1;
this->hitType = 91;
EnqueueSFX(299);
}
sub_080AEFE0(this);
@@ -415,7 +415,7 @@ void sub_0801F584(Entity* this) {
GetNextFrame(this);
}
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
if (sub_0801FBD0(this)) {
this->field_0x82.HALF.HI = 0;
sub_0801F730(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);
}
}
@@ -437,7 +437,7 @@ void sub_0801F61C(Entity* this) {
void sub_0801F638(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->action = 8;
this->field_0xf = 30;
this->direction = sub_08049F84(this, 1);
@@ -462,9 +462,9 @@ void sub_0801F688(Entity* this) {
void sub_0801F6CC(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->action = 1;
this->spriteSettings.b.draw = 0;
this->spriteSettings.draw = 0;
InitializeAnimation(this, 4);
}
}
@@ -472,7 +472,7 @@ void sub_0801F6CC(Entity* this) {
void sub_0801F6F8(Entity* this) {
sub_08003FC4(this, 0x1800);
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->action = 4;
this->speed = 0x20;
sub_0804AA1C(this);
@@ -482,13 +482,13 @@ void sub_0801F6F8(Entity* this) {
void sub_0801F730(Entity* this) {
this->action = 7;
this->flags &= ~0x80;
COLLISION_OFF(this);
InitializeAnimation(this, 5);
}
void sub_0801F748(Entity* this) {
this->action = 2;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 4);
}
@@ -500,7 +500,7 @@ void sub_0801F764(Entity* this) {
if (this->action == 1) {
if (this->field_0x82.HALF.LO || PlayerInRange(this, 1, 0x48)) {
this->action = 2;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->field_0x82.HALF.LO = 1;
InitializeAnimation(this, 0);
}
@@ -517,7 +517,7 @@ void sub_0801F7D8(Entity* this) {
sub_0804A720(this);
this->action = 1;
this->actionDelay = Random();
this->field_0x80.HALF.LO = this->currentHealth;
this->field_0x80.HALF.LO = this->health;
this->field_0x82.HALF.LO = 0;
}
@@ -527,7 +527,7 @@ void sub_0801F7FC(Entity* this) {
if (this->field_0x82.HALF.LO || PlayerInRange(this, 1, 0x48)) {
this->action = 2;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->field_0x82.HALF.LO = 1;
InitializeAnimation(this, 0);
}
@@ -535,9 +535,9 @@ void sub_0801F7FC(Entity* this) {
void sub_0801F840(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 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);
}
}
@@ -579,9 +579,9 @@ void sub_0801F8C0(Entity* this) {
}
void sub_0801F940(Entity* this) {
if (this->frames.all & 0x10) {
if (this->frames.all & 1) {
this->frames.all ^= 1;
if (this->frame & 0x10) {
if (this->frame & 1) {
this->frame ^= 1;
EnqueueSFX(299);
}
sub_080AEFE0(this);
@@ -591,7 +591,7 @@ void sub_0801F940(Entity* this) {
GetNextFrame(this);
}
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
if (sub_0801FBD0(this)) {
sub_0801FAE0(this);
} else {
@@ -611,7 +611,7 @@ void sub_0801F9C4(Entity* this) {
void sub_0801F9E0(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->action = 8;
this->field_0xf = 30;
this->direction = sub_08049F84(this, 1);
@@ -636,9 +636,9 @@ void sub_0801FA30(Entity* this) {
void sub_0801FA78(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->action = 1;
this->spriteSettings.b.draw = 0;
this->spriteSettings.draw = 0;
InitializeAnimation(this, 4);
sub_0804AA1C(this);
}
@@ -647,7 +647,7 @@ void sub_0801FA78(Entity* this) {
void sub_0801FAAC(Entity* this) {
sub_08003FC4(this, 0x1800);
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
sub_0801FB14(this);
this->speed = 0x20;
sub_0804AA1C(this);
@@ -656,13 +656,13 @@ void sub_0801FAAC(Entity* this) {
void sub_0801FAE0(Entity* this) {
this->action = 7;
this->flags &= ~0x80;
COLLISION_OFF(this);
InitializeAnimation(this, 5);
}
void sub_0801FAF8(Entity* this) {
this->action = 2;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 4);
}
@@ -675,7 +675,7 @@ void sub_0801FB14(Entity* this) {
void sub_0801FB34(Entity* this) {
if (*(Entity**)&this->field_0x68) {
sub_0806FA90(this, *(Entity**)&this->field_0x68, gUnk_080CA2B4[this->frames.all & 0xf], 1);
sub_0806FA90(this, *(Entity**)&this->field_0x68, gUnk_080CA2B4[this->frame & 0xf], 1);
(*(Entity**)&this->field_0x68)->spriteOffsetY--;
}
}
@@ -687,18 +687,18 @@ void sub_0801FB68(Entity* this) {
break;
case 1:
this->action = 10;
this->flags |= 0x80;
this->spriteSettings.b.draw = 1;
COLLISION_ON(this);
this->spriteSettings.draw = 1;
this->spritePriority.b1 = 3;
break;
case 2:
this->action = 10;
this->damageType = 92;
this->hitType = 92;
sub_0804AA1C(this);
break;
}
this->hVelocity = 0;
this->zVelocity = 0;
}
u32 sub_0801FBD0(Entity* this) {
@@ -711,7 +711,7 @@ u32 sub_0801FBD0(Entity* this) {
void Chuchu_JumpAtPlayer(Entity* this) {
this->speed = 0x180;
this->hVelocity = 0x20000;
this->zVelocity = 0x20000;
this->direction = sub_08049F84(this, 1);
InitializeAnimation(this, 3);
}
+6 -6
View File
@@ -41,7 +41,7 @@ void sub_08022970(Entity* this) {
}
void sub_08022988(Entity* this) {
if (this->height.HALF.HI == 0 && sub_08022B20(this)) {
if (this->z.HALF.HI == 0 && sub_08022B20(this)) {
sub_08022B0C(this);
} else {
if (this->field_0xf) {
@@ -49,7 +49,7 @@ void sub_08022988(Entity* this) {
return;
this->frameIndex = 1;
this->hVelocity = 0x10000;
this->zVelocity = 0x10000;
EnqueueSFX(0xd6);
}
@@ -75,7 +75,7 @@ void sub_080229F8(Entity* this) {
this->speed = 0xc0;
sub_08022B44(this);
} else {
this->hVelocity = 0x10000;
this->zVelocity = 0x10000;
EnqueueSFX(0xd6);
}
}
@@ -120,7 +120,7 @@ void sub_08022AA4(Entity* this) {
}
if (this->direction & 0xf)
this->spriteSettings.b.flipX = (this->direction >> 4) ^ 1;
this->spriteSettings.flipX = (this->direction >> 4) ^ 1;
}
void sub_08022B0C(Entity* this) {
@@ -138,11 +138,11 @@ u32 sub_08022B20(Entity* this) {
}
void sub_08022B44(Entity* this) {
this->hVelocity = 0xc000;
this->zVelocity = 0xc000;
this->direction = GetFacingDirection(this, &gPlayerEntity);
if (this->direction & 0xf)
this->spriteSettings.b.flipX = (this->direction >> 4) ^ 1;
this->spriteSettings.flipX = (this->direction >> 4) ^ 1;
EnqueueSFX(0xd6);
}
+54 -55
View File
@@ -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);
@@ -98,8 +98,8 @@ void sub_08020BB8(Entity* this) {
case 0x4c:
if (this->action == 15) {
u8 bVar3 = 0xff;
if (this->attachedEntity != NULL) {
bVar3 = this->attachedEntity->bitfield & 0x7f;
if (this->child != NULL) {
bVar3 = this->child->bitfield & 0x7f;
}
if (bVar3 == 2) {
sub_080213D0(this, gUnk_080CAB08[this->type]);
@@ -109,14 +109,14 @@ void sub_08020BB8(Entity* this) {
}
break;
default:
if (this->currentHealth != this->field_0x78.HALF.LO) {
if (this->health != this->field_0x78.HALF.LO) {
sub_08021588(this);
sub_08021390(this);
sub_0804AA1C(this);
}
break;
}
this->field_0x78.HALF.LO = this->currentHealth;
this->field_0x78.HALF.LO = this->health;
sub_0804AA30(this, gUnk_080CAA98);
}
@@ -127,7 +127,7 @@ void sub_08020D70(Entity* this) {
sub_0804A720(this);
this->action = 1;
this->field_0x74.HALF.HI = 0;
this->field_0x78.HALF.LO = this->currentHealth;
this->field_0x78.HALF.LO = this->health;
this->animationState = -1;
sub_08021218(this, 0, 2);
}
@@ -139,7 +139,7 @@ void sub_08020D9C(Entity* this) {
void sub_08020DB4(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frames.all & 0x80)
if (this->frame & 0x80)
sub_08021390(this);
}
@@ -159,7 +159,7 @@ void sub_08020DD4(Entity* this) {
void sub_08020E28(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frames.all & 0x80)
if (this->frame & 0x80)
sub_080213B0(this);
}
@@ -168,14 +168,14 @@ void sub_08020E48(Entity* this) {
sub_080213F0(this);
} else {
UpdateAnimationSingleFrame(this);
if (this->frames.all & 0x80)
if (this->frame & 0x80)
sub_080213B0(this);
}
}
void sub_08020E78(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frames.all & 0x80)
if (this->frame & 0x80)
sub_08021390(this);
}
@@ -209,7 +209,7 @@ void sub_08020E98(Entity* this) {
void sub_08020F28(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frames.all & 0x80)
if (this->frame & 0x80)
sub_08021400(this);
}
@@ -227,7 +227,7 @@ void sub_08020F48(Entity* this) {
pEVar3 = CreateProjectileWithParent(this, 0, 1);
if (pEVar3) {
pEVar3->parent = this;
this->attachedEntity = pEVar3;
this->child = pEVar3;
}
}
} else {
@@ -239,7 +239,7 @@ void sub_08020F48(Entity* this) {
}
void sub_08020FAC(Entity* this) {
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
if (this->field_0x7a.HALF.LO) {
this->field_0x7a.HALF.LO--;
} else {
@@ -262,23 +262,23 @@ void sub_08020FE4(Entity* this) {
void sub_08021010(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frames.all & 0x80) {
this->damageType = 0x56;
if (this->frame & 0x80) {
this->hitType = 0x56;
sub_080213F0(this);
}
}
void sub_08021038(Entity* this) {
if (this->attachedEntity == NULL && this->frames.all) {
if (this->child == NULL && this->frame) {
Entity* pEVar2 = (Entity*)CreateProjectileWithParent(this, 0, 0);
if (pEVar2) {
pEVar2->parent = this;
this->attachedEntity = pEVar2;
this->child = pEVar2;
}
EnqueueSFX(270);
}
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
sub_08021588(this);
if (this->field_0x7c.BYTES.byte0) {
this->field_0x7c.BYTES.byte0--;
@@ -287,40 +287,39 @@ void sub_08021038(Entity* this) {
}
} else {
UpdateAnimationSingleFrame(this);
if (this->frames.all == 4)
this->damageType = 81;
if (this->frame == 4)
this->hitType = 81;
}
}
void sub_080210A8(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frames.all & 1) {
this->frames.all = 0;
if (this->frame & 1) {
this->frame = 0;
sub_08021588(this);
EnqueueSFX(349);
} else if (this->frames.all & 0x80) {
} else if (this->frame & 0x80) {
sub_08021390(this);
}
}
void sub_080210E4(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frames.all & 1) {
if (this->frame & 1) {
Entity* ent;
this->frames.all &= ~1;
this->frame &= ~1;
ent = CreateProjectileWithParent(this, 0, 2);
if (ent) {
ent->parent = this;
this->attachedEntity = ent;
this->child = ent;
}
EnqueueSFX(270);
}
sub_08021644(this);
if ((this->frames.all & 0x10) &&
(!ProcessMovement(this) || (this->attachedEntity && (this->attachedEntity->bitfield & 0x80)))) {
if ((this->frame & 0x10) && (!ProcessMovement(this) || (this->child && (this->child->bitfield & 0x80)))) {
sub_080213D0(this, 0);
} else {
if (--this->field_0x76.HWORD == 0)
@@ -329,7 +328,7 @@ void sub_080210E4(Entity* this) {
}
void sub_08021170(Entity* this) {
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
if (this->field_0x7a.HALF.HI) {
this->field_0x7a.HALF.HI--;
} else {
@@ -345,7 +344,7 @@ void sub_080211A0(Entity* this) {
sub_08021390(this);
} else {
UpdateAnimationSingleFrame(this);
if (this->frames.all & 0x80)
if (this->frame & 0x80)
sub_080213B0(this);
}
}
@@ -356,7 +355,7 @@ void sub_080211D0(Entity* this)
UpdateAnimationSingleFrame(this);
sub_0802159C(this);
if (this->frames.all & 0x80)
if (this->frame & 0x80)
sub_08021390(this);
}
@@ -364,7 +363,7 @@ void sub_080211F4(Entity* this) {
UpdateAnimationSingleFrame(this);
sub_08021600(this);
if (this->frames.all & 0x80)
if (this->frame & 0x80)
sub_08021390(this);
}
@@ -414,7 +413,7 @@ void sub_080212B0(Entity* this) {
if (this->type < 2 && tmp == 2)
tmp = gUnk_080CAB52[Random() & 3];
this->attachedEntity = NULL;
this->child = NULL;
gUnk_080CAB58[tmp](this);
}
@@ -445,7 +444,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);
}
@@ -530,7 +529,7 @@ u32 sub_080214FC(Entity* this) {
return 0;
direction = GetFacingDirection(this, gUnk_020000B0);
if (4 < (direction - (this->frames.all & 0x1f)) - 2)
if (4 < (direction - (this->frame & 0x1f)) - 2)
return 0;
this->animationState = DirectionToAnimationState(direction);
@@ -557,54 +556,54 @@ void sub_08021540(Entity* this) {
}
void sub_08021588(Entity* this) {
if (this->attachedEntity) {
this->attachedEntity->parent = NULL;
this->attachedEntity = NULL;
if (this->child) {
this->child->parent = NULL;
this->child = NULL;
}
}
void sub_0802159C(Entity* this) {
if (this->frames.all == 1) {
if (this->frame == 1) {
Entity* ent;
this->frames.all = 0;
this->damageType = 0x51;
this->frame = 0;
this->hitType = 0x51;
ent = CreateProjectileWithParent(this, 0, 3);
if (ent) {
ent->parent = this;
this->attachedEntity = ent;
this->child = ent;
}
EnqueueSFX(0x116);
} else if (this->frames.all == 2) {
this->frames.all = 0;
} else if (this->frame == 2) {
this->frame = 0;
sub_08021588(this);
} else if (this->frames.all & 0x20) {
this->frames.all &= ~0x20;
} else if (this->frame & 0x20) {
this->frame &= ~0x20;
EnqueueSFX(0x115);
}
}
void sub_08021600(Entity* this) {
if (this->frames.all == 1) {
if (this->frame == 1) {
Entity* ent;
this->frames.all = 0;
this->damageType = 0x51;
this->frame = 0;
this->hitType = 0x51;
ent = CreateProjectileWithParent(this, 0, 4);
if (ent) {
ent->parent = this;
this->attachedEntity = ent;
this->child = ent;
}
EnqueueSFX(0x10e);
} else if (this->frames.all == 2) {
this->frames.all = 0;
} else if (this->frame == 2) {
this->frame = 0;
sub_08021588(this);
}
}
void sub_08021644(Entity* this) {
if (this->frames.all & 0x20) {
this->frames.all &= ~0x20;
if (this->frame & 0x20) {
this->frame &= ~0x20;
EnqueueSFX(0x7d);
}
}
+5 -5
View File
@@ -71,13 +71,13 @@ void sub_080220D8(Entity* this) {
void sub_080220F0(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
const PosOffset* off;
u32 i;
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);
@@ -87,8 +87,8 @@ void sub_080220F0(Entity* this) {
}
}
EnqueueSFX(260);
} else if (this->frames.all & 1) {
this->field_0x44 = 4;
} else if (this->frame & 1) {
this->damage = 4;
}
}
@@ -103,7 +103,7 @@ void sub_08022174(Entity* this) {
void sub_08022198(Entity* this) {
sub_0800445C(this);
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->action = 1;
this->actionDelay = 0x5a;
}
+3 -3
View File
@@ -39,9 +39,9 @@ void sub_0803EB44(Entity* this) {
pEVar1 = CreateProjectileWithParent(this, 0x19, 0);
if (pEVar1 != NULL) {
pEVar1->parent = this;
this->attachedEntity = pEVar1;
this->flags |= 0x80;
this->spriteSettings.b.draw = TRUE;
this->child = pEVar1;
COLLISION_ON(this);
this->spriteSettings.draw = TRUE;
this->animationState = 2;
*((u8*)&this->field_0x7a + 1) = 0;
*(u8*)&this->field_0x7c = 0;
+1 -1
View File
@@ -20,7 +20,7 @@ void nullsub_133(Entity* this) {
void sub_08022FD0(Entity* this) {
this->action = 1;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
sub_08023000(this, 0);
}
+9 -9
View File
@@ -32,7 +32,7 @@ void sub_0802C254(Entity* this) {
void sub_0802C258(Entity* this) {
sub_0804A720(this);
this->hVelocity = 0x20000;
this->zVelocity = 0x20000;
this->actionDelay = 2;
this->field_0x7a.HWORD = Random() & 0x70;
switch (this->type) {
@@ -45,7 +45,7 @@ void sub_0802C258(Entity* this) {
}
this->field_0x80.HWORD = this->x.HALF.HI;
this->field_0x82.HWORD = this->y.HALF.HI;
this->height.HALF.HI = -0x10;
this->z.HALF.HI = -0x10;
this->collisionLayer = 3;
this->spriteRendering.b3 = 1;
this->spritePriority.b0 = 2;
@@ -70,13 +70,13 @@ NONMATCH("asm/non_matching/fallingBoulder/sub_0802C334.inc", void sub_0802C334(E
return;
}
this->field_0x7c.HALF.LO = 1;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
}
GetNextFrame(this);
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)) {
@@ -113,7 +113,7 @@ NONMATCH("asm/non_matching/fallingBoulder/sub_0802C334.inc", void sub_0802C334(E
sub_080AEFB4(this);
} else {
sub_0806F69C(this);
if (this->height.HALF.HI - y > 0x38) {
if (this->z.HALF.HI - y > 0x38) {
sub_0802C62C(this);
this->field_0x7a.HWORD = (Random() & 0x7f) | 0x80;
if (this->type == 3) {
@@ -190,7 +190,7 @@ void sub_0802C4B0(Entity* this) {
}
rand = Random() & 7;
this->hVelocity = 0x20000;
this->zVelocity = 0x20000;
if (rand & 4) {
if (rand & 3) {
*(u32*)&this->cutsceneBeh = gUnk_080CD58C[offset | 1];
@@ -210,8 +210,8 @@ void sub_0802C62C(Entity* this) {
this->action = 1;
this->y.HALF.HI = this->field_0x82.HWORD;
this->x.HALF.HI = this->field_0x80.HWORD;
this->spriteSettings.b.draw = 0;
this->flags &= ~0x80;
this->spriteSettings.draw = 0;
COLLISION_OFF(this);
this->field_0x7c.HALF.LO = 0;
}
+6 -6
View File
@@ -28,7 +28,7 @@ void sub_080453A4(Entity* this) {
}
void sub_080453BC(Entity* this) {
if (this->currentHealth && this->cutsceneBeh.HALF.LO != this->currentHealth) {
if (this->health && this->cutsceneBeh.HALF.LO != this->health) {
this->action = 2;
} else {
sub_0804AA30(this, gUnk_080D17E8);
@@ -41,9 +41,9 @@ void nullsub_172(void) {
void sub_080453E8(Entity* this) {
this->action = 1;
this->actionDelay = 0;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->speed = 0x80;
this->cutsceneBeh.HALF.LO = this->currentHealth;
this->cutsceneBeh.HALF.LO = this->health;
this->field_0x3c |= 0x10;
sub_0804A720(this);
InitializeAnimation(this, 0);
@@ -77,11 +77,11 @@ void sub_08045454(Entity* this) {
off = gUnk_080D1810;
for (i = 0; i < count; i++) {
ent = entities[i];
ent->attachedEntity = entities[(i + 1) % count];
ent->child = entities[(i + 1) % count];
ent->parent = entities[(i + count - 1) % count];
tmp = 0;
ent->type2 = 1;
ent->height.HALF.HI = tmp;
ent->z.HALF.HI = tmp;
ent->iframes = -0x10;
/* Set MiniFireballGuy offset relative to killed slime. */
@@ -101,7 +101,7 @@ u32 sub_0804A024(Entity*, u32, u32);
void sub_08045524(Entity* this) {
u32 tmp, tmp1, tmp2;
this->hVelocity = 0x1c000;
this->zVelocity = 0x1c000;
tmp = sub_0804A024(this, 1, 8);
if (tmp != 0xff && (Random() & 3) == 0) {
this->actionDelay = Random() & 3;
+12 -12
View File
@@ -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);
@@ -148,12 +148,12 @@ void sub_08037624(Entity* this) {
void sub_08037690(Entity* this) {
UpdateAnimationSingleFrame(this);
if ((this->frames.all & 0x80) != 0) {
if ((this->frame & 0x80) != 0) {
this->field_0x76.HALF.HI = 0x14;
sub_08037794(this);
} else {
if ((this->frames.all & 1) != 0) {
this->damageType = 0x27;
if ((this->frame & 1) != 0) {
this->hitType = 0x27;
ProcessMovement(this);
}
}
@@ -167,7 +167,7 @@ NONMATCH("asm/non_matching/gibdo/sub_080376D0.inc", void sub_080376D0(Entity* th
gPlayerState.field_0xa = gPlayerState.field_0xa | 0x80;
CopyPositionAndSpriteOffset(&gPlayerEntity, this);
UpdateAnimationSingleFrame(this);
x = &this->frames.all;
x = &this->frame;
if ((*x & 0x1) != 0) {
if (!(--this->field_0x7c.BYTES.byte0)) {
sub_08037A58(this);
@@ -182,7 +182,7 @@ END_NONMATCH
void sub_0803773C(Entity* this) {
UpdateAnimationSingleFrame(this);
if ((this->frames.all & 0x80) != 0) {
if ((this->frame & 0x80) != 0) {
sub_08037794(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;
@@ -396,7 +396,7 @@ NONMATCH("asm/non_matching/gibdo/sub_08037B48.inc", void sub_08037B48(Entity* th
E->spriteOffsetY = 0xf5;
E->parent = this;
}
this->attachedEntity = E;
this->child = E;
}
END_NONMATCH
@@ -409,7 +409,7 @@ NONMATCH("asm/non_matching/gibdo/sub_08037C0C.inc", void sub_08037C0C(Entity* th
this->actionDelay = 0xf;
this->parent = that;
}
if (this->attachedEntity != 0) {
if (this->child != 0) {
this->actionDelay = 0xf;
this->parent = that;
}
+24 -24
View File
@@ -93,7 +93,7 @@ void (*const gUnk_080D1AFC[8])(Entity*) = { sub_08046898, sub_08046910, sub_0804
void GyorgMale(Entity* this) {
if (this->action) {
this->spriteSettings.b.draw = this->field_0x7c.BYTES.byte1;
this->spriteSettings.draw = this->field_0x7c.BYTES.byte1;
}
gUnk_080D1AFC[this->action](this);
if (this->action != 7) {
@@ -101,9 +101,9 @@ void GyorgMale(Entity* this) {
}
this->animationState = -(this->field_0x78.HWORD >> 8);
sub_08048004(this);
this->field_0x7c.BYTES.byte1 = this->spriteSettings.b.draw;
if (this->spriteSettings.b.draw == 1 && (this->y.HALF.HI - gRoomControls.roomScrollY + 0x30) > 0x100u) {
this->spriteSettings.b.draw = 0;
this->field_0x7c.BYTES.byte1 = this->spriteSettings.draw;
if (this->spriteSettings.draw == 1 && (this->y.HALF.HI - gRoomControls.roomScrollY + 0x30) > 0x100u) {
this->spriteSettings.draw = 0;
}
this->cutsceneBeh.HWORD = gPlayerEntity.x.HALF.HI;
this->field_0x86.HWORD = gPlayerEntity.y.HALF.HI;
@@ -116,11 +116,11 @@ void sub_08046898(Entity* this) {
return;
tmp->type = 1;
tmp->parent = this;
this->attachedEntity = tmp;
this->child = tmp;
this->action = 1;
this->subAction = 0;
this->spriteRendering.b0 = 3;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->spriteOrientation.flipY = 2;
this->spriteRendering.b3 = 2;
this->field_0x3c |= 0x10;
@@ -232,7 +232,7 @@ void (*const gUnk_080D1B38[5])(Entity*) = { sub_08046AE8, sub_08046B18, sub_0804
void sub_08046A9C(Entity* this) {
if (this->animIndex == 1) {
if (this->frames.all == 1) {
if (this->frame == 1) {
InitAnimationForceUpdate(this, 0);
}
}
@@ -315,7 +315,7 @@ void (*const gUnk_080D1B4C[5])(Entity*) = { sub_08046D44, sub_08046D98, sub_0804
void sub_08046CEC(Entity* this) {
if (this->animIndex == 0) {
if (this->frames.all == 1) {
if (this->frame == 1) {
InitAnimationForceUpdate(this, 1);
}
}
@@ -418,7 +418,7 @@ void (*const gUnk_080D1B94[0xA])(Entity*) = { sub_08046FE8, sub_0804702C, sub_08
void sub_08046F64(Entity* this) {
if (this->animIndex == 0) {
if (this->frames.all == 1) {
if (this->frame == 1) {
InitAnimationForceUpdate(this, 1);
}
}
@@ -580,13 +580,13 @@ void (*const gUnk_080D1BC0[7])(Entity*) = { sub_080473B8, sub_080473F0, sub_0804
void sub_0804736C(Entity* this) {
if (this->animIndex == 1) {
if (this->frames.all == 1) {
if (this->frame == 1) {
InitAnimationForceUpdate(this, 0);
}
}
gUnk_080D1BC0[this->subAction](this);
UpdateAnimationSingleFrame(this);
if (this->currentHealth == 0) {
if (this->health == 0) {
this->action = 7;
this->subAction = 0;
}
@@ -827,7 +827,7 @@ void sub_08047914(Entity* this) {
void sub_08047978(Entity* this) {
sub_08047D88(this);
if (this->currentHealth != 0) {
if (this->health != 0) {
if (--this->field_0x70.HALF_U.LO == 0) {
this->field_0x70.HALF.HI = 1;
if (this->type == 0) {
@@ -858,9 +858,9 @@ void sub_08047978(Entity* this) {
this->spriteRendering.b3 = 2;
this->direction = this->animationState;
}
if (this->currentHealth != 0)
if (this->health != 0)
return;
if (this->attachedEntity->action != 1)
if (this->child->action != 1)
return;
this->subAction = 4;
if (this->type == 0) {
@@ -959,18 +959,18 @@ void sub_08047BF0(Entity* this) {
} else {
this->actionDelay--;
if (this->actionDelay == 0x5A) {
tmp = this->attachedEntity;
tmp->spriteSettings.b.draw = 0;
tmp = this->child;
tmp->spriteSettings.draw = 0;
CreateFx(tmp, FX_GIANT_EXPLOSION4, 0);
} else {
if (this->actionDelay == 0x3C) {
tmp = this->attachedEntity->attachedEntity;
tmp->spriteSettings.b.draw = 0;
tmp = this->child->child;
tmp->spriteSettings.draw = 0;
CreateFx(tmp, FX_GIANT_EXPLOSION4, 0);
} else {
if (this->actionDelay == 0x1E) {
tmp = this->attachedEntity->attachedEntity->attachedEntity;
tmp->spriteSettings.b.draw = 0;
tmp = this->child->child->child;
tmp->spriteSettings.draw = 0;
CreateFx(tmp, FX_GIANT_EXPLOSION4, 0);
}
}
@@ -1012,7 +1012,7 @@ void sub_08047D88(Entity* this) {
if (!sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x20))
return;
gPlayerState.field_0x14 = 1;
if (gPlayerEntity.height.HALF.HI != 0)
if (gPlayerEntity.z.HALF.HI != 0)
return;
this->field_0x7c.BYTES.byte0 |= 1;
}
@@ -1113,8 +1113,8 @@ void sub_08048004(Entity* this) {
if (this->action == 0)
return;
if (this->animIndex == 0) {
this->flags &= ~0x80;
if (gPlayerEntity.height.HALF.HI != 0)
COLLISION_OFF(this);
if (gPlayerEntity.z.HALF.HI != 0)
return;
if (!sub_08079F8C())
return;
@@ -1151,7 +1151,7 @@ void sub_08048004(Entity* this) {
this->field_0x7c.BYTES.byte0 = 0;
}
} else {
this->flags |= 0x80;
COLLISION_ON(this);
}
}
+1 -1
View File
@@ -27,7 +27,7 @@ void nullsub_7(Entity* this) {
void HangingSeed_Initialize(Entity* this) {
this->action = 1;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->frameIndex = this->type;
this->spriteRendering.b3 = 1;
this->spritePriority.b0 = 3;
+12 -12
View File
@@ -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->zVelocity = 0x18000;
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,11 +121,11 @@ 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;
this->health = 0;
}
}
@@ -265,7 +265,7 @@ void sub_0802BF98(Entity* this) {
} else {
this->action = 2;
this->actionDelay = 30;
this->flags &= ~0x80;
COLLISION_OFF(this);
}
}
@@ -284,7 +284,7 @@ void sub_0802BFE0(Entity* this) {
}
void sub_0802BFF4(Entity* this) {
this->spriteSettings.b.draw ^= 1;
this->spriteSettings.draw ^= 1;
if (--this->actionDelay == 0) {
DeleteEntity(this);
}
@@ -369,7 +369,7 @@ void sub_0802C1CC(Entity* this) {
void sub_0802C218(Entity* this) {
this->action = 6;
this->speed = 0xe0;
this->hVelocity = 0x18000;
this->zVelocity = 0x18000;
}
// clang-format off
+9 -9
View File
@@ -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) {
@@ -82,7 +82,7 @@ void sub_0803248C(Entity* this) {
void sub_080324CC(Entity* this) {
if (sub_080325E8(this) == 0) {
UpdateAnimationSingleFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
sub_080326FC(this);
sub_08032740(this);
}
@@ -118,7 +118,7 @@ void sub_080324FC(Entity* this) {
}
void sub_08032574(Entity* this) {
if (this->attachedEntity && (this->attachedEntity->bitfield & 0x80)) {
if (this->child && (this->child->bitfield & 0x80)) {
sub_0803275C(this);
return;
}
@@ -144,10 +144,10 @@ void sub_080325C4(Entity* this) {
u32 sub_080325E8(Entity* this) {
if (((sub_08049FA0(this) != 0) && (sub_08049FDC(this, 1) != 0)) &&
(sub_080041A0(this, gUnk_020000B0, 0x68, 0x40) != 0)) {
if (((GetFacingDirection(this, gUnk_020000B0) - (DirectionRound(this->frames.all)) + 2) & 0x1F) < 5) {
if (((GetFacingDirection(this, gUnk_020000B0) - (DirectionRound(this->frame)) + 2) & 0x1F) < 5) {
this->action = 3;
this->actionDelay = 0xC;
this->direction = DirectionRound(this->frames.all);
this->direction = DirectionRound(this->frame);
return 1;
}
}
@@ -236,13 +236,13 @@ void sub_080327C8(Entity* this) {
child = CreateProjectileWithParent(this, 11, 0);
if (child != NULL) {
child->parent = this;
this->attachedEntity = child;
this->child = child;
}
}
void sub_080327E0(Entity* this) {
if (this->attachedEntity != NULL) {
this->attachedEntity->parent = NULL;
this->attachedEntity = NULL;
if (this->child != NULL) {
this->child->parent = NULL;
this->child = NULL;
}
}
+3 -3
View File
@@ -59,7 +59,7 @@ void Keese_Initialize(Entity* this) {
sub_0804A720(this);
if (this->type != 0) {
this->spritePriority.b1 = 1;
this->height.HALF.HI = -0x10;
this->z.HALF.HI = -0x10;
}
this->direction = Random() & 0x1f;
this->field_0x1c = 1;
@@ -77,12 +77,12 @@ void Keese_Fly(Entity* this) {
this->field_0x7a.HWORD--;
}
GetNextFrame(this);
if ((this->frames.b.f3) != 0) {
if (this->frame & 0x80) {
sub_08021F24(this);
} else {
sub_080AEFB4(this);
}
this->spriteOffsetY = gKeeseSpriteOffsets[this->frames.all];
this->spriteOffsetY = gKeeseSpriteOffsets[this->frame];
}
void Keese_Rest(Entity* this) {
+26 -26
View File
@@ -57,11 +57,11 @@ void Lakitu_DoAction(Entity* this) {
void sub_0803C784(Entity* this) {
if ((this->bitfield & 0x7f) == 0x1d) {
this->hVelocity = 0x20000;
this->zVelocity = 0x20000;
sub_0803CBAC(this);
} else {
if (this->damageType == 0x43) {
if (this->hitType == 0x43) {
Entity* fx = CreateFx(this, FX_DEATH, 0);
if (fx != NULL) {
@@ -104,7 +104,7 @@ void sub_0803C844(Entity* this) {
}
void sub_0803C850(Entity* this) {
Entity* cloud = this->attachedEntity;
Entity* cloud = this->child;
if (cloud != NULL) {
cloud->spriteOffsetX = this->spriteOffsetX;
}
@@ -114,7 +114,7 @@ void sub_0803C850(Entity* this) {
void sub_0803C86C(Entity* this) {
sub_0803CBAC(this);
this->attachedEntity = NULL;
this->child = NULL;
}
void Lakitu_Initialize(Entity* this) {
@@ -124,13 +124,13 @@ void Lakitu_Initialize(Entity* this) {
}
cloud->parent = this;
this->attachedEntity = cloud;
this->child = cloud;
sub_0804A720(this);
this->action = HIDDEN;
this->height.HALF.HI = -2;
this->z.HALF.HI = -2;
this->spriteOffsetY = 0xff;
@@ -143,18 +143,18 @@ void Lakitu_Hide(Entity* this) {
if (sub_0803CA4C(this)) {
this->action = 2;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
}
}
void Lakitu_EndHide(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frames.b.f3) {
if (this->frame & 0x80) {
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);
@@ -178,9 +178,9 @@ void Lakitu_Idle(Entity* this) {
void Lakitu_BeginHide(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frames.b.f3 != 0) {
if (this->frame & 0x80) {
this->action = 1;
this->spriteSettings.b.draw = 0;
this->spriteSettings.draw = 0;
InitAnimationForceUpdate(this, this->animationState);
}
@@ -189,14 +189,14 @@ void Lakitu_BeginHide(Entity* this) {
void Lakitu_Lightning(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frames.b.f3 == 0) {
if (!(this->frame & 0x80)) {
return;
}
Lakitu_SpawnLightning(this);
this->action = LIGHTNING_DELAY;
this->damageType = 0x42;
this->hitType = 0x42;
if ((Random() & 1) && !this->field_0x78.HALF.HI) {
this->actionDelay = 0xf;
@@ -207,7 +207,7 @@ void Lakitu_Lightning(Entity* this) {
this->field_0x78.HALF.HI = FALSE;
InitAnimationForceUpdate(this->attachedEntity, this->animationState);
InitAnimationForceUpdate(this->child, this->animationState);
}
}
@@ -259,7 +259,7 @@ void sub_0803CA84(Entity* this, u32 unkParameter) {
this->animationState = altAnimState;
InitAnimationForceUpdate(this, altAnimState + unkParameter);
InitAnimationForceUpdate(this->attachedEntity, altAnimState);
InitAnimationForceUpdate(this->child, altAnimState);
}
}
}
@@ -284,7 +284,7 @@ bool32 sub_0803CB04(Entity* this) {
sub_0803CB34(this);
this->field_0x78.HALF.HI = delay;
InitAnimationForceUpdate(this->attachedEntity, this->animationState + 4);
InitAnimationForceUpdate(this->child, this->animationState + 4);
returnValue = 1;
}
@@ -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);
@@ -322,20 +322,20 @@ void Lakitu_SpawnLightning(Entity* this) {
void sub_0803CBAC(Entity* this) {
Entity* cloud;
cloud = this->attachedEntity;
cloud = this->child;
if (cloud != NULL) {
cloud->flags |= 0x80;
cloud->damageType = 0x43;
cloud->hitType = 0x43;
}
this->action = CLOUDLESS;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->spritePriority.b1 = 1;
this->flags2 &= 0x7b;
this->damageType = 0x42;
this->hitType = 0x42;
InitAnimationForceUpdate(this, this->animationState + 16);
}
@@ -344,16 +344,16 @@ void sub_0803CC08(Entity* this) {
Entity* cloud;
Entity* fx;
cloud = this->attachedEntity;
cloud = this->child;
if (cloud == NULL) {
return;
}
if ((u32)(cloud->height.HALF.HI - this->height.HALF.HI) > 2) {
if ((u32)(cloud->z.HALF.HI - this->z.HALF.HI) > 2) {
return;
}
if (this->hVelocity >= 0) {
if (this->zVelocity >= 0) {
return;
}
@@ -385,7 +385,7 @@ void sub_0803CC08(Entity* this) {
fx->y.HALF.HI -= 6;
}
this->attachedEntity = NULL;
this->child = NULL;
DeleteEntity(cloud);
}
+9 -9
View File
@@ -65,11 +65,11 @@ void sub_0803CD6C(Entity* this) {
Entity* lakitu;
this->action = 1;
this->height.HALF.HI = -2;
this->z.HALF.HI = -2;
// Set parent to lakitu
lakitu = GetCurrentRoomProperty(this->type);
this->attachedEntity = lakitu;
this->child = lakitu;
this->parent = lakitu;
this->field_0x78.HWORD = this->x.HALF.HI;
@@ -96,25 +96,25 @@ void sub_0803CDD8(Entity* this) {
u8 one;
u8 draw;
draw = this->spriteSettings.b.draw;
draw = this->spriteSettings.draw;
one = 1;
this->spriteSettings.b.draw = draw ^ one;
this->spriteSettings.draw = draw ^ one;
this->actionDelay--;
if (this->actionDelay == 0) {
this->action = 1;
this->flags |= 0x80;
COLLISION_ON(this);
this->spriteSettings.b.draw = one;
this->spriteSettings.draw = one;
}
}
void sub_0803CE14(Entity* this) {
u8 direction;
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74.HWORD);
sub_080A2CC0(this, &this->child, &this->field_0x74.HWORD);
direction = this->direction;
if (direction & 0x80) {
@@ -132,14 +132,14 @@ void sub_0803CE3C(Entity* this) {
this->action = 2;
this->actionDelay = 60;
this->flags &= 0x7f;
COLLISION_OFF(this);
this->field_0x3a &= 0xfb;
this->x.HALF.HI = this->field_0x78.HWORD;
this->y.HALF.HI = this->field_0x7a.HWORD;
this->attachedEntity = this->parent;
this->child = this->parent;
sub_0803CE14(this);
}
+9 -9
View File
@@ -69,7 +69,7 @@ void Leever_Idle(Entity* this) {
if (--this->actionDelay == 0) {
if (Leever_PlayerInRange(this, Random() & 0x1f)) {
this->action = 2;
this->spriteSettings.b.draw = TRUE;
this->spriteSettings.draw = TRUE;
this->direction = (GetFacingDirection(this, gUnk_020000B0) + gLeeverDrift[Random() & 1]) & 0x1f;
InitializeAnimation(this, LeeverAnimation_DigUp);
UpdateSpriteForCollisionLayer(this);
@@ -82,7 +82,7 @@ void Leever_Idle(Entity* this) {
void Leever_DigUp(Entity* this) {
GetNextFrame(this);
if (this->frames.b.f3 != 0) {
if (this->frame & 0x80) {
this->action = 3;
if (this->type == LeeverForm_Red) {
this->field_0x74.HWORD = 180;
@@ -90,9 +90,9 @@ void Leever_DigUp(Entity* this) {
this->field_0x74.HWORD = 110;
}
InitializeAnimation(this, LeeverAnimation_Attack);
} else if (this->frames.b.f0 != 0) {
this->frames.all &= 0xfe;
this->flags |= 0x80;
} else if ((this->frame & 1) != 0) {
this->frame &= 0xfe;
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);
}
}
@@ -110,10 +110,10 @@ void Leever_Attack(Entity* this) {
void Leever_DigDown(Entity* this) {
Leever_Move(this);
GetNextFrame(this);
if ((this->frames.b.f3) != 0) {
if (this->frame & 0x80) {
this->action = 1;
this->actionDelay = 0xf0;
this->spriteSettings.b.draw = FALSE;
this->spriteSettings.draw = FALSE;
}
}
@@ -167,7 +167,7 @@ void Leever_Move(Entity* this) {
this->field_0x74.HWORD = 1;
}
this->speed = (this->frames.all & 0xf) * 0x20;
this->speed = (this->frame & 0xf) * 0x20;
if (this->type == LeeverForm_Red) {
if ((this->field_0xf++ & 0xf) == 0) {
sub_08004596(this, sub_0800132C(this, gUnk_020000B0));
+18 -18
View File
@@ -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);
@@ -45,7 +45,7 @@ void sub_08027DA4(Entity* this) {
}
}
if (this->currentHealth == 0) {
if (this->health == 0) {
this->actionDelay = 0x20;
}
@@ -74,21 +74,21 @@ void sub_08027E70(Entity* this) {
switch (this->type) {
case 0:
this->action = 3;
this->spriteSettings.b.draw = 0;
this->flags = this->flags & 0x7f;
this->spriteSettings.draw = 0;
COLLISION_OFF(this);
this->actionDelay = 0;
break;
case 1:
this->action = 1;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->actionDelay = 8;
InitializeAnimation(this, 1);
break;
case 2:
this->action = 1;
this->spriteSettings.b.draw = 0;
this->spriteSettings.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);
}
}
@@ -132,7 +132,7 @@ void nullsub_12(Entity* this) {
void sub_08027F84(Entity* this) {
if (sub_08049FDC(this, 1)) {
this->action = 5;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 0);
CreateDust(this);
}
@@ -149,9 +149,9 @@ void sub_08027FB4(Entity* this) {
void sub_08027FE0(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 1) {
if (this->frame & 1) {
this->action = 1;
this->flags |= 0x80;
COLLISION_ON(this);
this->direction = sub_08049F84(this, 1);
this->actionDelay = 8;
this->spritePriority.b1 = 1;
@@ -161,9 +161,9 @@ void sub_08027FE0(Entity* this) {
void sub_0802802C(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 1) {
if (this->frame & 1) {
this->action = 3;
this->spriteSettings.b.draw = 0;
this->spriteSettings.draw = 0;
this->direction = 0;
this->actionDelay = 0;
CreateDust(this);
@@ -209,11 +209,11 @@ NONMATCH("asm/non_matching/likeLike/sub_0802810C.inc", void sub_0802810C(Entity*
gPlayerState.field_0xa = 0;
gPlayerState.flags &= 0xffffffef;
gPlayerEntity.flags |= 0x80;
gPlayerEntity.hVelocity = 0x18000;
gPlayerEntity.zVelocity = 0x18000;
gPlayerEntity.iframes = -60;
gPlayerEntity.direction = gPlayerEntity.animationState << 2;
gPlayerEntity.spritePriority.b1 = this->field_0x82.HALF.HI;
gPlayerEntity.height.HALF.HI = gPlayerEntity.spriteOffsetY;
gPlayerEntity.z.HALF.HI = gPlayerEntity.spriteOffsetY;
gPlayerEntity.spriteOffsetY = 0;
this->action = 4;
this->actionDelay = 0x50;
+26 -26
View File
@@ -55,11 +55,11 @@ 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);
this->attachedEntity->action = 2;
this->child->action = 2;
break;
}
}
@@ -86,36 +86,36 @@ void sub_0802999C(Entity* this) {
ent1 = CreateEnemy(MADDERPILLAR, 1);
ent1->parent = this;
PositionRelative(this, ent1, 0, 5);
this->attachedEntity = ent1;
this->child = ent1;
ent2 = CreateEnemy(MADDERPILLAR, 2);
ent2->parent = this;
PositionRelative(this, ent2, 0, 4);
ent1->attachedEntity = ent2;
ent1->child = ent2;
ent3 = CreateEnemy(MADDERPILLAR, 3);
ent3->parent = this;
PositionRelative(this, ent3, 0, 3);
ent2->attachedEntity = ent3;
ent2->child = ent3;
ent4 = CreateEnemy(MADDERPILLAR, 4);
ent4->parent = this;
PositionRelative(this, ent4, 0, 2);
ent3->attachedEntity = ent4;
ent3->child = ent4;
ent5 = CreateEnemy(MADDERPILLAR, 5);
ent5->parent = this;
PositionRelative(this, ent5, 0, 1);
ent4->attachedEntity = ent5;
ent4->child = ent5;
ent6 = CreateEnemy(MADDERPILLAR, 6);
ent6->attachedEntity = this;
ent6->child = this;
ent6->parent = this;
PositionRelative(this, ent6, 0, 0);
ent5->attachedEntity = ent6;
ent5->child = 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;
}
@@ -179,7 +179,7 @@ void sub_08029B2C(Entity* this) {
void sub_08029B90(Entity* this) {
this->action = 1;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
sub_0802A058(this);
if (this->type < 2) {
InitializeAnimation(this, 0);
@@ -210,8 +210,8 @@ void sub_08029BC4(Entity* this) {
void sub_08029C08(Entity* this) {
this->action = 3;
this->actionDelay = gUnk_080CCDA0[this->type];
this->damageType = 0x6b;
this->attachedEntity->action = 2;
this->hitType = 0x6b;
this->child->action = 2;
}
void sub_08029C2C(Entity* this) {
@@ -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;
}
}
@@ -251,7 +251,7 @@ void sub_08029C98(Entity* this) {
void sub_08029CCC(Entity* this) {
this->action = 1;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
sub_0802A058(this);
InitializeAnimation(this, 8);
}
@@ -276,10 +276,10 @@ void sub_08029D14(Entity* this) {
}
} else {
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 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);
}
@@ -298,7 +298,7 @@ void sub_08029D78(Entity* this) {
void sub_08029DAC(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->action = 6;
this->parent->field_0x76.HALF.HI = 1;
InitializeAnimation(this, this->animationState + 8);
@@ -378,7 +378,7 @@ bool32 sub_08029F48(Entity* this) {
}
void sub_08029FB4(Entity* this, u32 x, u32 y) {
u8* dst = (u8*)&this->attachedEntity->field_0x78;
u8* dst = (u8*)&this->child->field_0x78;
s32 unk = this->parent->field_0x7c.BYTES.byte2;
u8 idx = unk % 0xe;
dst[idx] = ((x + 8) & 0xf) | (((y + 8) & 0xf) << 4);
@@ -458,18 +458,18 @@ void sub_0802A098(Entity* this) {
}
void sub_0802A0F8(Entity* this) {
if (this->currentHealth != 0) {
if (this->health != 0) {
if ((this->bitfield & 0x80) && this->iframes != 0) {
Entity* ent = this;
u32 i;
for (i = 0; i < 6; i++) {
ent = ent->attachedEntity;
ent = ent->child;
ent->iframes = this->iframes;
}
}
} else {
this->parent->flags &= ~0x80;
this->parent->currentHealth = 0;
this->parent->health = 0;
this->parent->field_0xf = 0x69;
}
}
@@ -477,7 +477,7 @@ void sub_0802A0F8(Entity* this) {
bool32 sub_0802A14C(Entity* this) {
u32 ret = FALSE;
if (this->parent->currentHealth == 0 || this->field_0x86.HALF.LO) {
if (this->parent->health == 0 || this->field_0x86.HALF.LO) {
ret = TRUE;
} else {
ret = FALSE;
+156 -156
View File
@@ -143,21 +143,21 @@ 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;
this->attachedEntity->iframes = this->iframes;
this->child->iframes = this->iframes;
entity74 = *(Entity**)&this->field_0x74;
entity74->iframes = this->iframes;
SoundReq(SFX_BOSS_HIT);
}
} else {
this->attachedEntity->iframes = this->iframes;
this->child->iframes = this->iframes;
entity74 = *(Entity**)&this->field_0x74;
entity74->iframes = this->iframes;
InitializeAnimation(this, 0x18);
InitAnimationForceUpdate(this->attachedEntity, 9);
InitAnimationForceUpdate(this->child, 9);
SoundReq(SFX_BOSS_HIT);
}
}
@@ -180,32 +180,32 @@ void sub_0803A274(Entity* this) {
if (this->type == 0) {
pEVar1 = CreateEnemy(MAZAAL_HAND, 0);
pEVar1->parent = this;
this->attachedEntity = pEVar1;
this->child = pEVar1;
pEVar1 = CreateEnemy(MAZAAL_BRACELET, 2);
pEVar1->parent = this;
*(Entity**)&this->field_0x74 = pEVar1;
pEVar1 = CreateObject(OBJECT_7E, 1, 0);
pEVar1->parent = this;
pEVar1->attachedEntity = this->attachedEntity;
pEVar1->child = this->child;
PositionRelative(this->parent, this, 0x100000, 0x200000);
} else {
pEVar1 = CreateEnemy(MAZAAL_HAND, 1);
pEVar1->parent = this;
this->attachedEntity = pEVar1;
this->child = pEVar1;
pEVar1 = CreateEnemy(MAZAAL_BRACELET, 3);
pEVar1->parent = this;
*(Entity**)&this->field_0x74 = pEVar1;
pEVar1 = CreateObject(OBJECT_7E, 2, 0);
pEVar1->parent = this;
pEVar1->attachedEntity = this->attachedEntity;
this->spriteSettings.b.flipX = 1;
pEVar1->child = this->child;
this->spriteSettings.flipX = 1;
PositionRelative(this->parent, this, -0x100000, 0x200000);
}
if (gScreenTransition.field_0x38 != 0) {
this->action = 3;
this->flags |= 0x80;
this->spriteSettings.b.draw = 1;
this->attachedEntity->spriteSettings.b.draw = 1;
COLLISION_ON(this);
this->spriteSettings.draw = 1;
this->child->spriteSettings.draw = 1;
InitializeAnimation(this, 0x10);
} else {
this->action = 1;
@@ -222,25 +222,25 @@ void sub_0803A364(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
switch (this->subAction & 0x7f) {
case 0:
case 2:
break;
case 1:
this->subAction = 2;
pEVar3 = this->attachedEntity;
pEVar3->spriteSettings.b.draw = 1;
pEVar3 = this->child;
pEVar3->spriteSettings.draw = 1;
pEVar3->spriteRendering.alphaBlend = 1;
break;
case 3:
this->subAction = 4;
this->spriteSettings.b.draw = 1;
this->attachedEntity->spriteRendering.alphaBlend = 0;
this->spriteSettings.draw = 1;
this->child->spriteRendering.alphaBlend = 0;
break;
case 4:
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
if ((this->frame & 0x80) != 0) {
this->subAction = 5;
}
break;
@@ -263,16 +263,16 @@ void sub_0803A364(Entity* this) {
break;
case 7:
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
if ((this->frame & 0x80) != 0) {
this->subAction = 8;
this->spriteSettings.b.draw = 0;
InitAnimationForceUpdate(this->attachedEntity, 8);
this->spriteSettings.draw = 0;
InitAnimationForceUpdate(this->child, 8);
SoundReq(SFX_16E);
}
break;
case 8:
sub_0803B55C(this);
if ((this->attachedEntity->frames.all & 0x80) == 0) {
if ((this->child->frame & 0x80) == 0) {
return;
}
uVar1 = 9;
@@ -283,20 +283,20 @@ void sub_0803A364(Entity* this) {
this->actionDelay--;
if (this->actionDelay == 0) {
this->subAction = 10;
InitAnimationForceUpdate(this->attachedEntity, 6);
InitAnimationForceUpdate(this->child, 6);
}
break;
case 10:
sub_0803B55C(this);
if ((this->attachedEntity->frames.all & 0x80) != 0) {
if ((this->child->frame & 0x80) != 0) {
this->subAction = 0xb;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 4);
}
break;
case 0xb:
GetNextFrame(this);
if ((this->frames.all & 0x80) == 0) {
if ((this->frame & 0x80) == 0) {
return;
}
if (this->type2 != 0) {
@@ -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;
@@ -327,7 +327,7 @@ void sub_0803A548(Entity* this) {
UpdateAnimationSingleFrame(this);
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
if (sub_0803B4E4(this) == 0) {
sub_0806F69C(this);
}
@@ -339,7 +339,7 @@ void sub_0803A58C(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
if (sub_0803B4E4(this) != 0) {
sub_0803B59C(this);
} else {
@@ -352,10 +352,10 @@ 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;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
InitializeAnimation(this, 5);
}
@@ -365,12 +365,12 @@ void sub_0803A60C(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
if ((this->frame & 0x80) != 0) {
this->action = 6;
this->spriteSettings.b.draw = 0;
InitAnimationForceUpdate(this->attachedEntity, 8);
this->spriteSettings.draw = 0;
InitAnimationForceUpdate(this->child, 8);
}
}
@@ -381,10 +381,10 @@ void sub_0803A660(Entity* this) {
s8* ptr;
u32 index;
pbVar3 = &this->attachedEntity->frames.all;
pbVar3 = &this->child->frame;
if ((*pbVar3 & 0x80) != 0) {
if (this->height.HALF.HI > -0x50) {
this->height.HALF.HI = this->height.HALF.HI - 2;
if (this->z.HALF.HI > -0x50) {
this->z.HALF.HI = this->z.HALF.HI - 2;
} else {
this->action = 7;
this->actionDelay = 0;
@@ -400,7 +400,7 @@ void sub_0803A660(Entity* this) {
}
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
}
}
@@ -430,10 +430,10 @@ void sub_0803A720(Entity* this) {
void sub_0803A740(Entity* this) {
u16 height;
height = this->height.HALF.HI + 4;
this->height.HALF.HI += 4;
height = this->z.HALF.HI + 4;
this->z.HALF.HI += 4;
if (-1 < height * 0x10000) {
this->height.HALF.HI = 0;
this->z.HALF.HI = 0;
this->action = 10;
this->actionDelay = 10;
this->parent->field_0x7c.BYTES.byte1 |= 0x40;
@@ -454,8 +454,8 @@ void sub_0803A780(Entity* this) {
}
void sub_0803A7AC(Entity* this) {
if (this->height.HALF.HI > -6) {
this->height.HALF.HI--;
if (this->z.HALF.HI > -6) {
this->z.HALF.HI--;
} else {
this->action = 0xc;
}
@@ -467,10 +467,10 @@ void sub_0803A7CC(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
if (sub_0803B4E4(this)) {
this->action = 0xd;
InitAnimationForceUpdate(this->attachedEntity, 6);
InitAnimationForceUpdate(this->child, 6);
} else {
sub_0806F69C(this);
}
@@ -482,11 +482,11 @@ void sub_0803A814(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
sub_0803B55C(this);
if ((this->attachedEntity->frames.all & 0x80) != 0) {
if ((this->child->frame & 0x80) != 0) {
this->action = 0xe;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 4);
}
}
@@ -497,10 +497,10 @@ void sub_0803A86C(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
this->flags = this->flags | 0x80;
if ((this->frame & 0x80) != 0) {
COLLISION_ON(this);
sub_0803B59C(this);
}
}
@@ -516,9 +516,9 @@ void sub_0803A8B8(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
InitializeAnimation(this, 6);
InitAnimationForceUpdate(this->attachedEntity, 1);
InitAnimationForceUpdate(this->child, 1);
SoundReq(SFX_153);
}
@@ -528,7 +528,7 @@ void sub_0803A90C(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
GetNextFrame(this);
sub_0803B55C(this);
sub_0806F69C(this);
@@ -538,7 +538,7 @@ void sub_0803A90C(Entity* this) {
this->direction = this->type * 0x10 + 8;
this->speed = 0x200;
InitializeAnimation(this, 7);
InitAnimationForceUpdate(this->attachedEntity, 2);
InitAnimationForceUpdate(this->child, 2);
}
}
@@ -548,7 +548,7 @@ void sub_0803A978(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
GetNextFrame(this);
sub_0803B55C(this);
if ((++this->actionDelay & 3) == 0) {
@@ -558,10 +558,10 @@ 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);
InitAnimationForceUpdate(this->child, 3);
}
}
@@ -572,7 +572,7 @@ void sub_0803AA00(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
if (sub_0803B870(this) == 0) {
direction = (this->type ^ 1) * 0x10 + 8;
if ((++this->actionDelay & 3) == 0) {
@@ -581,10 +581,10 @@ void sub_0803AA00(Entity* this) {
sub_0806F69C(this);
if ((this->direction == direction) || (this->y.HALF.HI >= gPlayerEntity.y.HALF.HI)) {
this->action = 0x13;
this->spriteSettings.b.draw = 0;
this->spriteSettings.draw = 0;
this->direction = direction;
this->field_0x80.HWORD = gPlayerEntity.x.HALF.HI;
InitAnimationForceUpdate(this->attachedEntity, 4);
InitAnimationForceUpdate(this->child, 4);
}
}
}
@@ -596,7 +596,7 @@ NONMATCH("asm/non_matching/mazaal/sub_0803AA98.inc", void sub_0803AA98(Entity* t
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
if (sub_0803B870(this) == 0) {
sub_0806F69C(this);
if (sub_0803B6F4(this) != 0) {
@@ -604,8 +604,8 @@ NONMATCH("asm/non_matching/mazaal/sub_0803AA98.inc", void sub_0803AA98(Entity* t
this->speed = 0x40;
InitializeAnimation(this, 10);
(*(Entity**)&this->field_0x74)->flags |= 0x80;
temp = this->attachedEntity;
temp->damageType = 0x13;
temp = this->child;
temp->hitType = 0x13;
InitAnimationForceUpdate(temp, 5);
SoundReq(SFX_16E);
}
@@ -619,10 +619,10 @@ void sub_0803AB10(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
sub_0806F69C(this);
sub_0803B55C(this);
if ((this->attachedEntity->frames.all & 0x80) != 0) {
if ((this->child->frame & 0x80) != 0) {
this->action = 0x15;
this->actionDelay = 0xf;
}
@@ -634,12 +634,12 @@ void sub_0803AB5C(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
if (--this->actionDelay == 0) {
this->action = 0x16;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 0xb);
InitAnimationForceUpdate(this->attachedEntity, 6);
InitAnimationForceUpdate(this->child, 6);
}
}
@@ -649,15 +649,15 @@ void sub_0803ABB4(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
GetNextFrame(this);
sub_0803B55C(this);
if ((this->attachedEntity->frames.all & 0x80) != 0) {
if ((this->child->frame & 0x80) != 0) {
this->action = 0x17;
this->flags = this->flags | 0x80;
COLLISION_ON(this);
this->speed = 0x180;
InitializeAnimation(this, 0x10);
InitAnimationForceUpdate(this->attachedEntity, 0);
InitAnimationForceUpdate(this->child, 0);
}
}
@@ -667,7 +667,7 @@ void sub_0803AC1C(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
if (sub_0803B4E4(this)) {
sub_0803B59C(this);
} else {
@@ -681,7 +681,7 @@ void sub_0803AC60(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
GetNextFrame(this);
if (!this->actionDelay) {
if (sub_0803B4E4(this) != 0) {
@@ -707,14 +707,14 @@ void sub_0803ACC0(Entity* this) {
}
break;
case 1:
if (--this->height.HALF.HI * 0x10000 >> 0x10 < -0x20) {
if (--this->z.HALF.HI * 0x10000 >> 0x10 < -0x20) {
this->subAction = 2;
}
break;
case 2:
uVar2 = this->height.HALF.HI += 4;
uVar2 = this->z.HALF.HI += 4;
if (-1 < (uVar2 * 0x10000)) {
this->height.HALF.HI = 0;
this->z.HALF.HI = 0;
this->actionDelay = 0xc;
this->subAction = 3;
sub_08080964(8, 0);
@@ -728,15 +728,15 @@ void sub_0803ACC0(Entity* this) {
}
break;
case 4:
uVar2 = this->height.HALF.HI -= 2;
uVar2 = this->z.HALF.HI -= 2;
if (uVar2 * 0x10000 >> 0x10 < -0x28) {
this->subAction = 5;
}
break;
case 5:
uVar2 = this->height.HALF.HI += 4;
uVar2 = this->z.HALF.HI += 4;
if (-1 < (uVar2 * 0x10000)) {
this->height.HALF.HI = 0;
this->z.HALF.HI = 0;
this->action = 0x1a;
this->actionDelay = 0x3c;
sub_08080964(0x1e, 0);
@@ -752,10 +752,10 @@ void sub_0803ACC0(Entity* this) {
void sub_0803ADAC(Entity* this) {
if (--this->actionDelay == 0) {
this->action = 0x16;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
(*(Entity**)&this->field_0x74)->flags |= 0x80;
InitializeAnimation(this, 0xb);
InitAnimationForceUpdate(this->attachedEntity, 6);
InitAnimationForceUpdate(this->child, 6);
sub_0803B798();
} else {
sub_0803B824(this);
@@ -768,13 +768,13 @@ void sub_0803ADF4(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
UpdateAnimationSingleFrame(this);
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
if ((this->frame & 0x80) != 0) {
this->action = 0x1c;
this->actionDelay = 0x1e;
this->spriteSettings.b.draw = 0;
this->spriteSettings.draw = 0;
}
}
@@ -784,11 +784,11 @@ void sub_0803AE48(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
UpdateAnimationSingleFrame(this);
if (((this->actionDelay == 0) || (--this->actionDelay == 0)) && ((this->parent->field_0x7c.BYTES.byte1 & 3) != 0)) {
this->action = 0x1d;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 4);
} else {
if (sub_0803B4E4(this) == 0) {
@@ -803,34 +803,34 @@ void sub_0803AEC4(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
UpdateAnimationSingleFrame(this);
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
this->flags |= 0x80;
if ((this->frame & 0x80) != 0) {
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;
this->z.HALF.HI = gUnk_080CED6C[(this->parent->field_0xf >> 4) & 7] + 4;
}
void sub_0803AF50(Entity* this) {
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
if ((this->frame & 0x80) != 0) {
this->action = 0x20;
this->spriteSettings.b.draw = 0;
InitAnimationForceUpdate(this->attachedEntity, 8);
this->spriteSettings.draw = 0;
InitAnimationForceUpdate(this->child, 8);
}
}
void sub_0803AF7C(Entity* this) {
sub_0803B55C(this);
if ((this->attachedEntity->frames.all & 0x80) != 0) {
if ((this->child->frame & 0x80) != 0) {
this->action = 0x21;
this->actionDelay = 0xf;
}
@@ -840,8 +840,8 @@ void sub_0803AF9C(Entity* this) {
if (this->actionDelay != 0) {
this->actionDelay--;
} else {
if (-0x20 < this->height.HALF.HI) {
this->height.HALF.HI -= 2;
if (-0x20 < this->z.HALF.HI) {
this->z.HALF.HI -= 2;
} else {
this->action = 0x22;
this->actionDelay = 10;
@@ -856,13 +856,13 @@ void sub_0803AFC8(Entity* this) {
}
void sub_0803AFE0(Entity* this) {
if (this->height.HALF.HI < 0) {
this->height.HALF.HI += 4;
if (this->z.HALF.HI < 0) {
this->z.HALF.HI += 4;
} else {
this->action = 0x24;
this->actionDelay = 0xf0;
*(u8*)&this->cutsceneBeh = 3;
this->height.HALF.HI = 0;
this->z.HALF.HI = 0;
sub_08080964(0xa0, 0);
SoundReq(SFX_158);
}
@@ -879,11 +879,11 @@ void sub_0803B01C(Entity* this) {
}
void sub_0803B04C(Entity* this) {
if (this->height.HALF.HI > -6) {
this->height.HALF.HI--;
if (this->z.HALF.HI > -6) {
this->z.HALF.HI--;
} else {
this->action = 0x26;
InitAnimationForceUpdate(this->attachedEntity, 6);
InitAnimationForceUpdate(this->child, 6);
}
}
@@ -893,21 +893,21 @@ void sub_0803B074(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
sub_0803B55C(this);
if ((this->attachedEntity->frames.all & 0x80) != 0) {
if ((this->child->frame & 0x80) != 0) {
this->action = 0x27;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 4);
InitAnimationForceUpdate(this->attachedEntity, 0);
InitAnimationForceUpdate(this->child, 0);
}
}
void sub_0803B0D4(Entity* this) {
UpdateAnimationSingleFrame(this);
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
this->flags |= 0x80;
if ((this->frame & 0x80) != 0) {
COLLISION_ON(this);
sub_0803B59C(this);
}
}
@@ -916,7 +916,7 @@ void sub_0803B100(Entity* this) {
Entity* temp;
this->action = 0x29;
this->hVelocity = 0x14000;
this->zVelocity = 0x14000;
if (this->type == 0) {
this->hitbox = &gUnk_080FD364;
} else {
@@ -925,12 +925,12 @@ void sub_0803B100(Entity* this) {
temp = *(Entity**)&this->field_0x74;
temp->action = 3;
temp->field_0x74.HALF.LO = 0x20;
InitAnimationForceUpdate(this->attachedEntity, 9);
InitAnimationForceUpdate(this->child, 9);
SoundReq(SFX_14F);
}
void sub_0803B144(Entity* this) {
UpdateAnimationSingleFrame(this->attachedEntity);
UpdateAnimationSingleFrame(this->child);
if (sub_08003FC4(this, 0x2000) == 0) {
this->action = 0x2a;
InitializeAnimation(this, 0x16);
@@ -941,11 +941,11 @@ void sub_0803B144(Entity* this) {
void sub_0803B17C(Entity* this) {
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
if ((this->frame & 0x80) != 0) {
this->action = 0x2b;
this->flags |= 0x80;
this->damageType = 0x18;
this->currentHealth = 0xff;
COLLISION_ON(this);
this->hitType = 0x18;
this->health = 0xff;
this->field_0x7c.HALF.HI = 600;
}
}
@@ -954,15 +954,15 @@ void sub_0803B1B8(Entity* this) {
Entity* temp;
u16 val;
if ((this->frames.all & 0x80) == 0) {
if ((this->frame & 0x80) == 0) {
GetNextFrame(this);
UpdateAnimationSingleFrame(this->attachedEntity);
UpdateAnimationSingleFrame(this->child);
}
if (this->currentHealth < 0xf5) {
if (this->health < 0xf5) {
this->action = 0x32;
this->field_0x7c.HALF.HI = 0x5dc;
this->spriteSettings.b.draw = 0;
this->damageType = 0x14;
this->spriteSettings.draw = 0;
this->hitType = 0x14;
temp = CreateFx(this, FX_GIANT_EXPLOSION4, 0);
if (temp != (Entity*)0x0) {
temp->x.HALF.HI += this->hitbox->offset_x;
@@ -982,7 +982,7 @@ void sub_0803B1B8(Entity* this) {
if ((temp->field_0x80.HALF.LO & 0xc) == 0xc) {
temp->action = 0xb;
temp->actionDelay = 0x78;
temp->hVelocity = 0;
temp->zVelocity = 0;
(*(Entity**)&temp->field_0x74)->field_0x7c.HALF_U.HI = 0x708;
(*(Entity**)&temp->field_0x78)->field_0x7c.HALF_U.HI = 0x708;
}
@@ -997,9 +997,9 @@ void sub_0803B2D0(Entity* this) {
Entity* entity;
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
if ((this->frame & 0x80) != 0) {
this->action = 0x2d;
this->spriteSettings.b.draw = 0;
this->spriteSettings.draw = 0;
entity = *(Entity**)&this->field_0x74;
entity->action = 2;
entity->field_0x74.HALF.LO = 0;
@@ -1012,7 +1012,7 @@ void sub_0803B30C(Entity* this) {
Entity* entity;
entity = *(Entity**)&this->field_0x74;
if ((entity->frames.all & 0x80) != 0) {
if ((entity->frame & 0x80) != 0) {
this->action = 0x2e;
sub_0803B8E8(this, 0x13);
InitializeAnimation(entity, 0);
@@ -1020,8 +1020,8 @@ void sub_0803B30C(Entity* this) {
}
void sub_0803B338(Entity* this) {
if (this->height.HALF.HI > -10) {
this->height.HALF.HI--;
if (this->z.HALF.HI > -10) {
this->z.HALF.HI--;
} else {
this->action = 0x2f;
this->actionDelay = 0xf;
@@ -1034,7 +1034,7 @@ void sub_0803B35C(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
if (--this->actionDelay == 0) {
this->action = 0x30;
}
@@ -1046,12 +1046,12 @@ void sub_0803B398(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
if (sub_0803B4E4(this) != 0) {
this->action = 0x31;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 4);
InitAnimationForceUpdate(this->attachedEntity, 0);
InitAnimationForceUpdate(this->child, 0);
} else {
sub_0806F69C(this);
}
@@ -1065,10 +1065,10 @@ void sub_0803B3F4(Entity* this) {
ptr = gUnk_080CED6C;
index = ((this->parent->field_0xf >> 4) + 3);
this->height.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
this->damageType = 0x17;
if ((this->frame & 0x80) != 0) {
this->hitType = 0x17;
if (this->type == 0) {
this->hitbox = (Hitbox*)&gUnk_080FD35C;
} else {
@@ -1114,7 +1114,7 @@ u32 sub_0803B4E4(Entity* this) {
}
void sub_0803B538(Entity* this) {
PositionRelative(this, this->attachedEntity, 0, -0x10000);
PositionRelative(this, this->child, 0, -0x10000);
PositionRelative(this, *(Entity**)&this->field_0x74, 0, -0x20000);
}
@@ -1123,9 +1123,9 @@ void sub_0803B55C(Entity* this) {
Entity* pEVar1;
pEVar1 = *(Entity**)&this->field_0x74;
entity = this->attachedEntity;
entity = this->child;
UpdateAnimationSingleFrame(entity);
if ((entity->frames.all & 0x10) != 0) {
if ((entity->frame & 0x10) != 0) {
if (pEVar1->animIndex != 1) {
InitializeAnimation(pEVar1, 1);
}
@@ -1157,7 +1157,7 @@ void sub_0803B5C0(Entity* this) {
} else {
temp = gUnk_080CFD0C[0x16 - direction];
}
if (this->frames.all != temp) {
if (this->frame != temp) {
InitializeAnimation(this, temp);
}
}
@@ -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;
@@ -1229,8 +1229,8 @@ void sub_0803B798(void) {
gPlayerState.field_0xa = 0;
gPlayerState.flags &= 0xffef;
gPlayerEntity.flags |= 0x80;
gPlayerEntity.hVelocity = 0x18000;
gPlayerEntity.height.HALF.HI = -10;
gPlayerEntity.zVelocity = 0x18000;
gPlayerEntity.z.HALF.HI = -10;
gPlayerEntity.direction = 0x10;
gPlayerEntity.animationState = 4;
gPlayerEntity.spritePriority.b1 = 1;
@@ -1256,30 +1256,30 @@ void sub_0803B824(Entity* this) {
u32 sub_0803B870(Entity* this) {
Entity* entity;
entity = this->attachedEntity;
entity = this->child;
if ((entity->bitfield & 0x80) != 0 && (gPlayerState.flags & 0x10) != 0) {
this->action = 0x18;
this->actionDelay = 0x44;
this->spriteSettings.b.draw = 0;
this->spriteSettings.draw = 0;
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;
}
}
void sub_0803B8E8(Entity* this, u32 unk) {
Entity* entity;
entity = this->attachedEntity;
entity->damageType = unk;
entity = this->child;
entity->hitType = unk;
entity = (*(Entity**)&this->field_0x74);
entity->damageType = unk;
entity->hitType = unk;
}
void sub_0803B8F8(Entity* this) {
@@ -1289,14 +1289,14 @@ void sub_0803B8F8(Entity* this) {
void sub_0803B910(Entity* this) {
if (gScreenTransition.field_0x38 != 0) {
this->action = 2;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
*(u8*)&this->field_0x74 = 0;
sub_0803BA8C(this, 10);
} else {
this->action = 1;
*(u8*)&this->field_0x74 = 0x80;
}
this->spriteSettings.b.flipX = (this->type - 2);
this->spriteSettings.flipX = (this->type - 2);
InitializeAnimation(this, 0);
CopyPositionAndSpriteOffset(this->parent, this);
}
@@ -1334,7 +1334,7 @@ void sub_0803B978(Entity* this) {
break;
case 4:
this->subAction = 5;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->spriteRendering.alphaBlend = 1;
break;
default:
@@ -1393,7 +1393,7 @@ void sub_0803BA8C(Entity* this, u32 unk) {
sub_0801D2B4(this, sVar2);
(*(Entity**)&this->parent->field_0x78)->palette.b.b0 = this->palette.raw << 0x1c >> 0x1c;
(*(Entity**)&this->parent->field_0x78)->palette.b.b4 = this->palette.b.b0;
this->parent->attachedEntity->palette.b.b0 = this->palette.raw << 0x1c >> 0x1c;
this->parent->attachedEntity->palette.b.b4 = this->palette.b.b0;
this->parent->child->palette.b.b0 = this->palette.raw << 0x1c >> 0x1c;
this->parent->child->palette.b.b4 = this->palette.b.b0;
}
}
+1 -1
View File
@@ -23,7 +23,7 @@ const Hitbox* const gUnk_080CEF58[] = {
void MazaalHand(Entity* this) {
if (this->action == 0) {
this->action = 1;
this->spriteSettings.b.flipX = this->type;
this->spriteSettings.flipX = this->type;
InitAnimationForceUpdate(this, 0);
}
sub_08035194(this);
+13 -13
View File
@@ -132,7 +132,7 @@ void sub_08033F3C(Entity* this) {
} else {
this->action = 1;
}
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->field_0x6c.HALF.HI |= 1;
this->field_0x80.HALF.LO = 0;
InitializeAnimation(this, 0);
@@ -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;
@@ -183,8 +183,8 @@ void sub_08033FFC(Entity* this) {
}
break;
case 4:
this->height.WORD += -0x8000;
if (this->height.HALF.HI == -10) {
this->z.WORD += -0x8000;
if (this->z.HALF.HI == -10) {
this->subAction = 5;
this->field_0x80.HALF.HI = 1;
}
@@ -335,8 +335,8 @@ void sub_08034348(Entity* this) {
if (this->field_0x7c.HALF_U.HI != 0) {
this->field_0x7c.HALF.HI--;
} else {
if (this->height.HALF.HI > -10) {
this->height.HALF.HI--;
if (this->z.HALF.HI > -10) {
this->z.HALF.HI--;
} else {
if (sub_080349D8(this) != 0) {
this->field_0x80.HALF.HI = 1;
@@ -351,7 +351,7 @@ void sub_0803438C(Entity* this) {
const s8* pVar;
if (this->actionDelay == 0) {
this->currentHealth = 0;
this->health = 0;
} else {
this->actionDelay--;
if (this->actionDelay > 0xc0) {
@@ -686,7 +686,7 @@ END_NONMATCH
void sub_0803499C(Entity* this) {
if (((this->field_0x80.HALF.LO & 0xc) != 0xc) && (this->field_0x80.HALF.HI != 0)) {
this->height.HALF.HI = gUnk_080CED6C[(++this->field_0xf >> 4) & 7];
this->z.HALF.HI = gUnk_080CED6C[(++this->field_0xf >> 4) & 7];
}
}
@@ -739,8 +739,8 @@ void sub_08034A84(Entity* this) {
} else {
if (this->action == 0) {
this->action = 1;
this->spriteSettings.b.draw = 1;
this->spriteSettings.b.flipX = 1;
this->spriteSettings.draw = 1;
this->spriteSettings.flipX = 1;
InitializeAnimation(this, 0);
}
CopyPositionAndSpriteOffset(this->parent, this);
@@ -764,7 +764,7 @@ void sub_08034B0C(Entity* this) {
this->actionDelay--;
} else {
GetNextFrame(this);
if ((this->frames.all & 0x80) == 0) {
if ((this->frame & 0x80) == 0) {
return;
}
this->action = 2;
@@ -797,7 +797,7 @@ END_NONMATCH
void sub_08034BA0(Entity* this) {
GetNextFrame(this);
if ((this->frames.all & 0x80) != 0) {
if ((this->frame & 0x80) != 0) {
this->parent->field_0x7c.HALF.HI = 0xff;
DeleteEntity(this);
}
@@ -810,7 +810,7 @@ void sub_08034BC8(Entity* this) {
}
sub_0806FA90(this->parent, this, 0, 1);
sub_0800445C(this);
if (this->height.HALF.HI == 0) {
if (this->z.HALF.HI == 0) {
sub_08034C00(this);
}
}
+11 -11
View File
@@ -85,7 +85,7 @@ void sub_08034CC4(Entity* this) {
SetTile(0x4022, COORD_TO_TILE(this), this->collisionLayer);
entity = CreateEnemy(MAZAAL_MACRO, 2);
if (entity != NULL) {
this->attachedEntity = entity;
this->child = entity;
entity->parent = this;
CopyPosition(this, entity);
}
@@ -137,8 +137,8 @@ void sub_08034E68(Entity* this) {
ScriptExecutionContext* scriptExecutionContext;
if (this->parent->next == NULL) {
if (this->spriteSettings.b.draw != 0) {
this->spriteSettings.b.draw = 0;
if (this->spriteSettings.draw != 0) {
this->spriteSettings.draw = 0;
sub_08035120(this);
}
if (gScreenTransition.field_0x39 == 0) {
@@ -187,7 +187,7 @@ void sub_08034F58(Entity* this) {
}
void sub_08034F70(Entity* this) {
this->currentHealth = gScreenTransition.field_0x39;
this->health = gScreenTransition.field_0x39;
if (gScreenTransition.field_0x39 >= 0x3d) {
this->type2 = 0;
} else if (gScreenTransition.field_0x39 >= 0x1f) {
@@ -199,38 +199,38 @@ void sub_08034F70(Entity* this) {
void sub_08034FA0(Entity* this) {
if (0 < this->iframes) {
this->attachedEntity->iframes = this->iframes;
this->child->iframes = this->iframes;
sub_08080964(0xc, 1);
}
switch (this->type2) {
case 0:
if (this->currentHealth < 0x3c) {
if (this->health < 0x3c) {
gScreenTransition.field_0x39 = 0x3c;
sub_08035050(this);
return;
}
break;
case 1:
if (this->currentHealth < 0x1e) {
if (this->health < 0x1e) {
gScreenTransition.field_0x39 = 0x1e;
sub_08035050(this);
return;
}
break;
default:
if (this->currentHealth == 0) {
if (this->health == 0) {
sub_0807BA8C(COORD_TO_TILE(this), this->collisionLayer);
}
break;
}
gScreenTransition.field_0x39 = this->currentHealth;
gScreenTransition.field_0x39 = this->health;
}
void sub_08035050(Entity* this) {
Entity* entity;
this->flags = this->flags & 0x7f;
this->currentHealth = 0;
COLLISION_OFF(this);
this->health = 0;
entity = CreateEnemy(VAATI_PROJECTILE, 0);
if (entity != NULL) {
entity->type2 = 1;
+4 -4
View File
@@ -24,8 +24,8 @@ void sub_080455D4(Entity* this) {
void sub_080455E4(Entity* this) {
if ((this != this->parent) && (this->parent != NULL)) {
this->field_0x6c.HALF.LO &= 0x7f;
this->parent->attachedEntity = this->attachedEntity;
this->attachedEntity->parent = this->parent;
this->parent->child = this->child;
this->child->parent = this->parent;
}
sub_0804A7D4(this);
}
@@ -35,7 +35,7 @@ void nullsub_23(Entity* this) {
void sub_08045618(Entity* this) {
this->action = 1;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->speed = 0x80;
this->field_0x3c = this->field_0x3c | 0x10;
sub_0804A720(this);
@@ -53,7 +53,7 @@ void sub_08045654(Entity* this) {
void sub_08045678(Entity* this) {
this->hVelocity = 0x1c000;
this->zVelocity = 0x1c000;
if (this->actionDelay != 0) {
this->actionDelay--;
} else {
+3 -3
View File
@@ -32,8 +32,8 @@ void sub_0804525C(Entity* this) {
Entity* parent = this->parent;
if (this != parent && parent) {
this->field_0x6c.HALF.LO &= 0x7f;
this->parent->attachedEntity = this->attachedEntity;
this->attachedEntity->parent = this->parent;
this->parent->child = this->child;
this->child->parent = this->parent;
if (this->field_0x6c.HALF.HI & 0x40)
ReplaceMonitoredEntity(this, parent);
}
@@ -45,7 +45,7 @@ void nullsub_22(void) {
void sub_080452A4(Entity* this) {
this->action = 1;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->speed = 0x100;
sub_0804A720(this);
InitializeAnimation(this, 6);
+10 -10
View File
@@ -31,17 +31,17 @@ void sub_08022BD4(Entity* this) {
}
void sub_08022BEC(Entity* this) {
if (this->field_0x7a.HALF.LO != this->currentHealth)
if (this->field_0x7a.HALF.LO != this->health)
this->field_0x7a.HALF.HI = 30;
this->field_0x7a.HALF.LO = this->currentHealth;
this->field_0x7a.HALF.LO = this->health;
this->actionDelay = 1;
this->direction = this->knockbackDirection;
this->animationState = ((this->direction + 2) & 0x1c) >> 2;
this->frameIndex = this->animationState;
this->attachedEntity->iframes = this->iframes;
this->child->iframes = this->iframes;
(*(Entity**)&this->field_0x7c)->iframes = this->iframes;
(*(Entity**)&this->field_0x80)->iframes = this->iframes;
sub_0804AA30(this, gUnk_080CBBA0);
@@ -50,25 +50,25 @@ void sub_08022BEC(Entity* this) {
void sub_08022C58(Entity* this) {
Entity *tail0, *tail1, *tail2;
this->flags &= ~0x80;
COLLISION_OFF(this);
if (gEntCount >= 0x45)
return;
tail0 = CreateEnemy(MOLDORM, 1);
this->attachedEntity = tail0;
this->child = tail0;
tail0->spritePriority.b0 = 5;
tail0->parent = this;
CopyPosition(this, tail0);
tail1 = CreateEnemy(MOLDORM, 2);
tail0->attachedEntity = tail1;
tail0->child = tail1;
tail1->spritePriority.b0 = 5;
tail1->parent = this;
CopyPosition(this, tail1);
tail2 = CreateEnemy(MOLDORM, 3);
tail1->attachedEntity = tail2;
tail1->child = tail2;
tail2->spritePriority.b0 = 5;
tail2->parent = this;
CopyPosition(this, tail2);
@@ -77,16 +77,16 @@ 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;
this->child = tail0;
*(Entity**)&this->field_0x7c = tail1;
*(Entity**)&this->field_0x80 = tail2;
this->direction = Random() & 0x1f;
this->animationState = ((this->direction + 2) & 0x1c) >> 2;
this->frameIndex = this->animationState;
this->field_0x7a.HALF.LO = this->currentHealth;
this->field_0x7a.HALF.LO = this->health;
}
void sub_08022D40(Entity* this) {
+55 -55
View File
@@ -51,8 +51,8 @@ NONMATCH("asm/non_matching/moldworm/Moldworm.inc", void Moldworm(Entity* this))
}
}
if (this->parent->field_0x7c.BYTES.byte0 != this->parent->field_0x7c.BYTES.byte1 && this->attachedEntity) {
((u8*)&this->attachedEntity->field_0x78)[(this->parent->field_0x7c.BYTES.byte0 - 1) & 0xf] =
if (this->parent->field_0x7c.BYTES.byte0 != this->parent->field_0x7c.BYTES.byte1 && this->child) {
((u8*)&this->child->field_0x78)[(this->parent->field_0x7c.BYTES.byte0 - 1) & 0xf] =
(((this->x.HALF.HI - prevX + 8) & 0xf) << 4) | ((this->y.HALF.HI - prevY + 8U) & 0xf);
}
}
@@ -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;
@@ -80,11 +80,11 @@ void sub_080230E4(Entity* this) {
}
}
if (this->currentHealth == 0 && this->field_0x7c.BYTES.byte3 == 0 && this->action == 7) {
if (this->health == 0 && this->field_0x7c.BYTES.byte3 == 0 && this->action == 7) {
CopyPosition(this, &gPlayerEntity);
gPlayerEntity.flags = gPlayerEntity.flags | 0x80;
gPlayerEntity.spriteSettings.b.draw = 1;
gPlayerEntity.hVelocity = 0x18000;
gPlayerEntity.spriteSettings.draw = 1;
gPlayerEntity.zVelocity = 0x18000;
gPlayerEntity.direction = 0xff;
gPlayerEntity.iframes = -0x14;
gPlayerState.jumpStatus = 0x41;
@@ -106,32 +106,32 @@ void sub_080231BC(Entity* this) {
if (gEntCount < 0x40) {
Entity* ent;
ent = this->attachedEntity = CreateEnemy(MOLDWORM, 1);
ent = this->child = CreateEnemy(MOLDWORM, 1);
ent->parent = this;
ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 2);
ent = ent->child = CreateEnemy(MOLDWORM, 2);
ent->parent = this;
ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 3);
ent = ent->child = CreateEnemy(MOLDWORM, 3);
ent->parent = this;
ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 4);
ent = ent->child = CreateEnemy(MOLDWORM, 4);
ent->parent = this;
ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 5);
ent = ent->child = CreateEnemy(MOLDWORM, 5);
ent->parent = this;
ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 6);
ent = ent->child = CreateEnemy(MOLDWORM, 6);
ent->parent = this;
ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 7);
ent = ent->child = CreateEnemy(MOLDWORM, 7);
ent->parent = this;
ent->attachedEntity = CreateEnemy(MOLDWORM, 8);
*(Entity**)&ent->attachedEntity->field_0x74 = ent;
ent = ent->attachedEntity;
ent->child = CreateEnemy(MOLDWORM, 8);
*(Entity**)&ent->child->field_0x74 = ent;
ent = ent->child;
ent->parent = this;
ent->attachedEntity = NULL;
ent->child = NULL;
sub_0804A720(this);
this->action = 6;
this->actionDelay = 0x1e;
@@ -167,17 +167,17 @@ void sub_08023288(Entity* this) {
void sub_08023330(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 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;
this->field_0x7a.HALF.HI = 0;
this->field_0x7c.BYTES.byte3 = 0;
sub_08023A88(this, this->animationState);
CopyPosition(this, this->attachedEntity);
CopyPosition(this, this->child);
CreateFx(this, FX_ROCK, 0);
}
}
@@ -196,9 +196,9 @@ 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;
this->attachedEntity->actionDelay = 1;
COLLISION_OFF(this);
this->hitType = 0x85;
this->child->actionDelay = 1;
sub_08023A68(this);
CreateFx(this, FX_ROCK, 0);
return;
@@ -239,7 +239,7 @@ void sub_080234A4(Entity* this) {
GetNextFrame(this);
if (this->field_0x7c.BYTES.byte3) {
this->action = 6;
this->spriteSettings.b.draw = 0;
this->spriteSettings.draw = 0;
this->field_0x78.HWORD = 300;
}
}
@@ -257,9 +257,9 @@ void sub_080234D8(Entity* this) {
void sub_0802351C(Entity* this) {
if (this->actionDelay != 0 && (this->type2 == 1 || gPlayerEntity.frameIndex == 0xff)) {
this->actionDelay = 0;
this->attachedEntity->action = 3;
this->attachedEntity->field_0xf = this->field_0x80.HALF.LO;
InitializeAnimation(this->attachedEntity, this->attachedEntity->animationState + 1);
this->child->action = 3;
this->child->field_0xf = this->field_0x80.HALF.LO;
InitializeAnimation(this->child, this->child->animationState + 1);
InitializeAnimation(this, this->animationState);
}
@@ -299,8 +299,8 @@ 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;
this->spriteSettings.b.draw = 1;
COLLISION_ON(this);
this->spriteSettings.draw = 1;
sub_08023644(this);
}
}
@@ -311,9 +311,9 @@ 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;
this->spriteSettings.b.draw = 0;
this->attachedEntity->actionDelay = 1;
COLLISION_OFF(this);
this->spriteSettings.draw = 0;
this->child->actionDelay = 1;
sub_080239F0(this);
}
@@ -330,9 +330,9 @@ void sub_08023644(Entity* this) {
void sub_080236F8(Entity* parent) {
if (--parent->field_0xf == 0) {
parent->action = 2;
parent->attachedEntity->action = 3;
parent->attachedEntity->field_0xf = parent->parent->field_0x80.HALF.LO;
InitializeAnimation(parent->attachedEntity, parent->attachedEntity->animationState + 1);
parent->child->action = 3;
parent->child->field_0xf = parent->parent->field_0x80.HALF.LO;
InitializeAnimation(parent->child, parent->child->animationState + 1);
InitializeAnimation(parent, parent->animationState);
}
}
@@ -356,15 +356,15 @@ void sub_08023748(Entity* this) {
void sub_0802376C(Entity* this) {
Entity* parent = this->parent;
if (parent->spriteSettings.b.draw == 1 && parent->animIndex < 0x10) {
this->spriteSettings.b.draw = 1;
if (parent->spriteSettings.draw == 1 && parent->animIndex < 0x10) {
this->spriteSettings.draw = 1;
GetNextFrame(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,8 +377,8 @@ 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;
this->spriteSettings.b.draw = 0;
COLLISION_OFF(this);
this->spriteSettings.draw = 0;
parent->field_0x7c.BYTES.byte3 = 1;
sub_080239F0(this);
sub_08023A68(this);
@@ -415,33 +415,33 @@ void sub_08023894(Entity* this) {
void sub_0802390C(Entity* this) {
if (this->bitfield & 0x80) {
Entity* ent = this->attachedEntity;
Entity* ent = this->child;
do {
ent->iframes = this->iframes;
} while (ent = ent->attachedEntity, ent != NULL);
} while (ent = ent->child, ent != NULL);
} else {
Entity* ent = this->attachedEntity;
Entity* ent = this->child;
do {
if (ent->bitfield & 0x80) {
u8 bVar2 = 0xff - ent->currentHealth;
u8 bVar2 = 0xff - ent->health;
if (bVar2 != 0) {
u32 tmp;
ent->currentHealth = 0xff;
ent->health = 0xff;
tmp = (u8)ent->iframes;
if (this->currentHealth >= bVar2) {
this->currentHealth -= bVar2;
if (this->health >= bVar2) {
this->health -= bVar2;
} else {
this->currentHealth = 0;
this->health = 0;
}
ent = this;
do {
ent->iframes = tmp;
} while (ent = ent->attachedEntity, ent != NULL);
} while (ent = ent->child, ent != NULL);
break;
}
}
} while (ent = ent->attachedEntity, ent != NULL);
} while (ent = ent->child, ent != NULL);
}
}
@@ -449,7 +449,7 @@ void sub_08023990(Entity* this, u32 param_2, u32 param_3) {
Entity* ent;
this->action = 3;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->palette.b.b0 = 0x5;
this->palette.b.b4 = 0x5;
this->spritePriority.b0 = 7;
@@ -459,11 +459,11 @@ void sub_08023990(Entity* this, u32 param_2, u32 param_3) {
UpdateSpriteForCollisionLayer(this);
InitializeAnimation(this, 0x16);
ent = this->attachedEntity;
ent = this->child;
do {
sub_080239F0(ent);
CopyPosition(this, ent);
} while (ent = ent->attachedEntity, ent != NULL);
} while (ent = ent->child, ent != NULL);
}
/* TODO: fix struct */
@@ -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);
+8 -8
View File
@@ -71,7 +71,7 @@ void sub_0801EB7C(Entity* this) {
}
void sub_0801EB84(Entity* this) {
this->flags &= 0x7f;
COLLISION_OFF(this);
UpdateAnimationVariableFrames(this, 2);
}
@@ -80,11 +80,11 @@ 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;
this->health = 0;
}
}
@@ -125,7 +125,7 @@ void Octorok_Move(Entity* this) {
void Octorok_ShootNut(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 1) {
if (this->frame & 1) {
Entity* ent = CreateProjectileWithParent(this, 1, 0);
if (ent) {
const s8* off;
@@ -133,13 +133,13 @@ void Octorok_ShootNut(Entity* this) {
off = &gOctorokNutOffset[this->direction / 4];
ent->x.HALF.HI += off[0];
ent->y.HALF.HI += off[1];
ent->height.HALF.HI = -3;
this->frames.all &= 0xfe;
ent->z.HALF.HI = -3;
this->frame &= 0xfe;
EnqueueSFX(0x18d);
}
}
if (this->frames.all & 0x80)
if (this->frame & 0x80)
Octorok_Pause(this);
}
+23 -23
View File
@@ -45,7 +45,7 @@ void Peahat(Entity* this) {
void Peahat_OnTick(Entity* this) {
gPeahatActions[this->action](this);
if (this->field_0x80.HALF.HI)
this->height.HALF.HI = gPeahatFlightHeights[(this->field_0xf++ & 0x30) >> 4];
this->z.HALF.HI = gPeahatFlightHeights[(this->field_0xf++ & 0x30) >> 4];
}
void sub_0801FFDC(Entity* this) {
@@ -54,7 +54,7 @@ void sub_0801FFDC(Entity* this) {
Entity* ent = CreateEnemy(PEAHAT, PeahatForm_Propeller);
if (ent) {
CopyPosition(this, ent);
ent->height.HALF.HI -= 8;
ent->z.HALF.HI -= 8;
}
this->field_0x82.HALF.LO = 0;
this->animationState = PeahatAnimation_SlicedPropeller;
@@ -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,18 +116,18 @@ 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;
this->health = 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)
@@ -241,11 +241,11 @@ void Peahat_Stunned(Entity* this) {
break;
case PeahatAnimation_SlicedPropeller:
sub_08003FC4(this, 0x1c00);
if (this->height.HALF.HI == 0) {
if (this->z.HALF.HI == 0) {
this->action = 7;
this->actionDelay = 150;
this->field_0xf = 10;
this->damageType = 0x71;
this->hitType = 0x71;
}
break;
};
@@ -260,7 +260,7 @@ void Peahat_RepairPropeller(Entity* this) {
return;
this->action = 9;
this->hVelocity = 0x18000;
this->zVelocity = 0x18000;
this->direction = Random() & 0x1f;
sub_0804AA1C(this);
this->animationState = PeahatAnimation_RepairPropeller;
@@ -284,9 +284,9 @@ void Peahat_Recover(Entity* this) {
void Peahat_Hop(Entity* this) {
GetNextFrame(this);
if (--this->actionDelay == 0) {
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->action = 9;
this->hVelocity = 0x18000;
this->zVelocity = 0x18000;
this->animationState = PeahatAnimation_NewPropeller;
InitializeAnimation(this, this->animationState);
} else {
@@ -294,12 +294,12 @@ void Peahat_Hop(Entity* this) {
}
}
if (this->frames.all & 2) {
this->frames.all &= ~2;
if (this->frame & 2) {
this->frame &= ~2;
this->direction = Random() & 0x1f;
}
if (this->frames.all & 1) {
if (this->frame & 1) {
sub_0800442E(this);
} else {
ProcessMovement(this);
@@ -308,14 +308,14 @@ void Peahat_Hop(Entity* this) {
void Peahat_Takeoff(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 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;
InitializeAnimation(this, this->animationState);
} else if (this->frames.all & 1) {
} else if (this->frame & 1) {
sub_0800442E(this);
} else {
sub_08003FC4(this, 0x1c00);
@@ -327,10 +327,10 @@ void PeahatPropeller_Initialize(Entity* this) {
this->action = 1;
this->actionDelay = 240;
this->field_0xf = 40;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->spriteRendering.b3 = 1;
this->spriteOrientation.flipY = 1;
this->spriteSettings.b.shadow = 0;
this->spriteSettings.shadow = 0;
this->speed = 0x20;
this->direction = (Random() & 0x10) + 8;
InitializeAnimation(this, PeahatAnimation_Propeller);
@@ -342,9 +342,9 @@ void PeahatPropeller_Fly(Entity* this) {
DeleteEntity(this);
} else {
if (this->actionDelay < 60)
this->spriteSettings.b.draw ^= 1;
this->spriteSettings.draw ^= 1;
this->height.WORD -= 0xc000;
this->z.WORD -= 0xc000;
sub_0806F69C(this);
if (--this->field_0xf == 0) {
this->field_0xf = 40;
+47 -47
View File
@@ -49,14 +49,14 @@ 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;
if ((this->field_0x82.HALF.HI & 0xf) == 3 && this->action == 6) {
switch (this->field_0x80.HALF.LO) {
case 1:
this->height.HALF.HI = -0x10;
this->z.HALF.HI = -0x10;
this->field_0x82.HALF.LO = 0;
this->field_0x78.HWORD = -0x10;
this->field_0x80.HALF.LO += 1;
@@ -68,7 +68,7 @@ void sub_08023F5C(Entity* this) {
}
}
} else {
this->currentHealth = 0;
this->health = 0;
}
sub_0804AA30(this, gUnk_080CBEC4);
@@ -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;
}
@@ -122,7 +122,7 @@ void nullsub_138(Entity* this) {
}
void sub_0802409C(Entity* this) {
this->currentHealth = 0;
this->health = 0;
InitializeAnimation(this, this->animationState);
CreateDust(this);
}
@@ -142,11 +142,11 @@ void sub_080240B8(Entity* this) {
switch (this->type) {
case 0:
this->field_0x78.HWORD = -0x10;
this->height.HALF.HI = -0x10;
this->z.HALF.HI = -0x10;
break;
case 1:
this->field_0x78.HWORD = -0x30;
this->height.HALF.HI = -0x30;
this->z.HALF.HI = -0x30;
break;
}
@@ -172,7 +172,7 @@ void sub_080240B8(Entity* this) {
this->field_0x82.HALF.HI = 0;
ent = CreateProjectileWithParent(this, 6, this->field_0x82.HALF.HI);
if (ent) {
this->attachedEntity = ent;
this->child = ent;
ent->parent = this;
ent->y.HALF.HI += 0x10;
}
@@ -274,7 +274,7 @@ void sub_080243B8(Entity* this) {
switch (this->field_0x80.HALF.LO) {
case 0:
if (sub_08024C48(this, TRUE)) {
if (this->attachedEntity == NULL || this->attachedEntity->next == NULL) {
if (this->child == NULL || this->child->next == NULL) {
this->field_0x80.HALF.LO = 2;
this->actionDelay = 0x20;
this->speed = 0x80;
@@ -284,7 +284,7 @@ void sub_080243B8(Entity* this) {
this->actionDelay = 0x1e;
this->speed = 0x100;
this->field_0x82.HALF.HI = 0x80;
this->attachedEntity->action = 2;
this->child->action = 2;
} else if (--this->actionDelay) {
if (--this->field_0xf == 0) {
sub_08024A14(this, 2, (this->actionDelay >> 6) + 1);
@@ -354,7 +354,7 @@ void sub_080244E8(Entity* this) {
}
break;
case 1:
if (++this->height.HALF.HI >= -0x10) {
if (++this->z.HALF.HI >= -0x10) {
this->field_0x82.HALF.LO = 0;
this->field_0x78.HWORD = 0xfff0;
if (sub_08024AD8(this)) {
@@ -375,7 +375,7 @@ void sub_080244E8(Entity* this) {
} else {
sub_08024E1C(this);
}
this->direction = GetFacingDirection(this, this->attachedEntity);
this->direction = GetFacingDirection(this, this->child);
sub_08024E00(this, 0);
sub_080249DC(this);
} else if (--this->field_0xf == 0) {
@@ -403,44 +403,44 @@ void sub_080244E8(Entity* this) {
}
break;
case 1:
if (sub_080041A0(this, this->attachedEntity, 6, 6)) {
if (sub_080041A0(this, this->child, 6, 6)) {
Entity* ent;
this->field_0x80.HALF.LO += 1;
this->actionDelay = 0xc;
this->field_0x82.HALF.HI &= ~0x80;
CopyPosition(this->attachedEntity, this);
this->height.HALF.HI -= 0xe;
CopyPosition(this->child, this);
this->z.HALF.HI -= 0xe;
this->field_0x78.HWORD -= 0xe;
ent = CreateProjectileWithParent(this, 6, this->field_0x82.HALF.HI);
if (ent) {
ent->parent = this;
ent->height.HALF.HI += 0xe;
ent->attachedEntity = this->attachedEntity;
CopyPosition(ent, ent->attachedEntity);
this->attachedEntity = ent;
ent->z.HALF.HI += 0xe;
ent->child = this->child;
CopyPosition(ent, ent->child);
this->child = ent;
}
}
break;
case 2:
if (sub_080041A0(this, this->attachedEntity, 6, 6)) {
if (sub_080041A0(this, this->child, 6, 6)) {
Entity* ent;
this->field_0x80.HALF.LO += 1;
this->actionDelay = 0xc;
this->field_0x82.HALF.HI &= ~0x80;
ent = this->attachedEntity;
ent = this->child;
SetTile((u16)ent->field_0x70.HALF.LO, COORD_TO_TILE(ent), ent->collisionLayer);
DeleteEntity(ent);
this->height.HALF.HI -= 0xe;
this->z.HALF.HI -= 0xe;
this->field_0x78.HWORD -= 0xe;
ent = CreateProjectileWithParent(this, 6, this->field_0x82.HALF.HI);
if (ent) {
ent->parent = this;
ent->height.HALF.HI += 0xe;
this->attachedEntity = ent;
ent->z.HALF.HI += 0xe;
this->child = ent;
}
}
break;
@@ -460,14 +460,14 @@ void sub_080244E8(Entity* this) {
}
break;
case 4:
this->height.HALF.HI -= 2;
if (-60 > this->height.HALF.HI) {
this->z.HALF.HI -= 2;
if (-60 > this->z.HALF.HI) {
this->field_0x80.HALF.LO++;
}
break;
case 5:
if (this->height.HALF.HI < -0x30) {
this->height.HALF.HI++;
if (this->z.HALF.HI < -0x30) {
this->z.HALF.HI++;
} else {
if (this->field_0x82.HALF.LO != 0) {
this->field_0x82.HALF.LO = 0;
@@ -511,7 +511,7 @@ void sub_080244E8(Entity* this) {
}
break;
case 7:
if (gPlayerEntity.height.HALF.HI == 0) {
if (gPlayerEntity.z.HALF.HI == 0) {
this->field_0x80.HALF.LO = 0;
this->speed = 0x80;
sub_08024B38(this);
@@ -532,9 +532,9 @@ void sub_08024940(Entity* this) {
}
if (this->field_0x82.HALF.LO == 0) {
this->height.HALF.HI = this->field_0x78.HWORD;
this->z.HALF.HI = this->field_0x78.HWORD;
if (random)
this->height.HALF.HI += 2;
this->z.HALF.HI += 2;
}
if (this->type2 != 0 || CheckIsDungeon()) {
@@ -543,7 +543,7 @@ void sub_08024940(Entity* this) {
sub_080249F4(this);
}
if (this->height.HALF.HI < -0x20) {
if (this->z.HALF.HI < -0x20) {
this->spritePriority.b0 = 0;
} else {
this->spritePriority.b0 = 1;
@@ -579,7 +579,7 @@ void sub_08024A14(Entity* this, u32 param_2, u32 param_3) {
break;
case 1:
if (sub_08024C48(this, FALSE)) {
sub_08004596(this, GetFacingDirection(this, this->attachedEntity));
sub_08004596(this, GetFacingDirection(this, this->child));
unk = TRUE;
}
break;
@@ -614,8 +614,8 @@ bool32 sub_08024AD8(Entity* this) {
u8 unk = FALSE;
if ((this->field_0x82.HALF.HI & 0x3f) == 3) {
if (gPlayerState.hurtBlinkSpeed == 0) {
this->attachedEntity->parent = NULL;
this->attachedEntity = NULL;
this->child->parent = NULL;
this->child = NULL;
this->field_0x82.HALF.HI = 0xc0;
return FALSE;
}
@@ -623,7 +623,7 @@ bool32 sub_08024AD8(Entity* this) {
}
if (sub_08024C48(this, unk) == 0) {
this->attachedEntity = NULL;
this->child = NULL;
this->field_0x82.HALF.HI = 0xc0;
return FALSE;
}
@@ -649,13 +649,13 @@ bool32 sub_08024B38(Entity* this) {
if (gPlayerState.hurtBlinkSpeed != 0) {
if (sub_08024C48(this, 1) && sub_08049F1C(this, gUnk_020000B0, 0xa0)) {
iVar4 = 1;
this->attachedEntity = gUnk_020000B0;
this->child = gUnk_020000B0;
this->field_0x82.HALF.HI |= 3;
this->field_0x82.HALF.HI &= ~0x40;
}
if (iVar4 == 0) {
this->attachedEntity = NULL;
this->child = NULL;
}
return iVar4;
}
@@ -664,9 +664,9 @@ bool32 sub_08024B38(Entity* this) {
ent = FindEntityByID(8, 2, 2);
if (ent) {
do {
if (ent->action != 2 && ent->height.HALF.HI == 0 && sub_08049F1C(this, ent, 0xa0)) {
if (ent->action != 2 && ent->z.HALF.HI == 0 && sub_08049F1C(this, ent, 0xa0)) {
iVar4 = 1;
this->attachedEntity = ent;
this->child = ent;
this->field_0x82.HALF.HI |= 1;
this->field_0x82.HALF.HI &= ~0x40;
break;
@@ -683,7 +683,7 @@ bool32 sub_08024B38(Entity* this) {
do {
if (ent->action == 1 && sub_08049F1C(this, ent, 0xa0)) {
iVar4 = 1;
this->attachedEntity = ent;
this->child = ent;
this->field_0x82.HALF.HI |= 2;
this->field_0x82.HALF.HI &= ~0x40;
break;
@@ -692,7 +692,7 @@ bool32 sub_08024B38(Entity* this) {
}
if (iVar4 == 0) {
this->attachedEntity = NULL;
this->child = NULL;
}
return iVar4;
@@ -840,7 +840,7 @@ void sub_08024F50(Entity* this) {
gPlayerEntity.direction = gPlayerEntity.animationState << 2;
gPlayerEntity.speed = 0;
gPlayerEntity.spritePriority.b1 = this->cutsceneBeh.HALF.HI;
gPlayerEntity.height.HALF.HI = gPlayerEntity.spriteOffsetY;
gPlayerEntity.z.HALF.HI = gPlayerEntity.spriteOffsetY;
gPlayerEntity.spriteOffsetY = 0;
this->flags2 |= 3;
this->field_0x82.HALF.HI = 0xc0;
+19 -19
View File
@@ -66,14 +66,14 @@ 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);
}
this->action = 7;
this->actionDelay = 0x3c;
if (0 < this->hVelocity) {
this->hVelocity = 0;
if (0 < this->zVelocity) {
this->zVelocity = 0;
}
this->iframes = -0xc;
this->knockbackDuration = 0;
@@ -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);
}
@@ -200,7 +200,7 @@ void sub_080252E0(Entity* this) {
this->action = 3;
this->actionDelay = 0x1e;
this->field_0xf = 0;
this->hVelocity = 0x18000;
this->zVelocity = 0x18000;
InitializeAnimation(this, 1);
}
}
@@ -209,11 +209,11 @@ void sub_0802538C(Entity* this) {
if (this->actionDelay) {
this->actionDelay--;
} else {
if (this->frames.all == 0) {
if (this->frame == 0) {
GetNextFrame(this);
} else {
sub_08003FC4(this, 0x2000);
if (this->hVelocity < 0x2000) {
if (this->zVelocity < 0x2000) {
this->action = 4;
InitializeAnimation(this, 2);
}
@@ -239,16 +239,16 @@ void sub_080253D4(Entity* this) {
void sub_0802541C(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
if (this->frame & 0x80) {
this->action = 3;
this->field_0xf = 1;
this->hVelocity = 0x20000;
this->zVelocity = 0x20000;
InitializeAnimation(this, 1);
}
}
void sub_0802544C(Entity* this) {
if (this->frames.all == 0) {
if (this->frame == 0) {
GetNextFrame(this);
} else {
if (--this->actionDelay == 0) {
@@ -272,10 +272,10 @@ void sub_0802547C(Entity* this) {
void sub_080254B4(Entity* this) {
sub_08003FC4(this, 0x2000);
if (this->frames.all & 0x80) {
if (this->height.HALF.HI == 0) {
if (this->frame & 0x80) {
if (this->z.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);
@@ -552,18 +552,18 @@ void sub_08025B18(Entity* this) {
ent->x.HALF.HI += 8;
ent->y.HALF.HI &= -0x10;
ent->y.HALF.HI += 8;
ent->height.HALF.HI = -1;
ent->z.HALF.HI = -1;
}
}
}
void sub_08025BD4(Entity* this) {
if (this->field_0x82.HALF.LO && (this->frames.all & 1) == 0) {
if (this->field_0x82.HALF.LO && (this->frame & 1) == 0) {
Entity* ent = CreateObject(OBJECT_21, 0, 0);
if (ent) {
PositionRelative(this, ent, gUnk_080CC0BA[this->animationState * 2 + 0] * 0x10000,
gUnk_080CC0BA[this->animationState * 2 + 1] * 0x10000);
ent->height.HALF.HI = -10;
ent->z.HALF.HI = -10;
}
}
}
@@ -575,7 +575,7 @@ void sub_08025C2C(Entity* this) {
}
bool32 sub_08025C44(Entity* this) {
if ((this->frames.all & 1) == 0) {
if ((this->frame & 1) == 0) {
return ProcessMovement(this);
} else {
return FALSE;
+6 -6
View File
@@ -20,7 +20,7 @@ void sub_0802223C(Entity* this) {
void sub_08022254(Entity* this) {
Entity* ent;
if (this->currentHealth) {
if (this->health) {
switch (this->bitfield & 0x7f) {
case 4:
case 5:
@@ -50,14 +50,14 @@ void sub_08022254(Entity* this) {
#endif
sub_0804A4E4(this, ent);
this->action = 2;
this->flags &= ~0x80;
this->spriteSettings.b.draw = 0;
COLLISION_OFF(this);
this->spriteSettings.draw = 0;
this->direction = this->knockbackDirection;
this->attachedEntity = ent;
this->child = ent;
}
}
} else {
if (this->damageType != 0x94)
if (this->hitType != 0x94)
InitializeAnimation(this, 2);
}
@@ -97,7 +97,7 @@ void sub_08022390(Entity* this) {
void sub_080223E4(Entity* this) {
Entity* ent;
ent = this->attachedEntity;
ent = this->child;
if (ent) {
ent->bitfield = 0x94;
ent->iframes = 0x10;
+23 -23
View File
@@ -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->health != 0xff) {
this->action = 4;
this->hVelocity = 0x20000;
this->zVelocity = 0x20000;
this->direction = 0xff;
this->currentHealth = 0xff;
this->damageType = 35;
this->health = 0xff;
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,11 +98,11 @@ 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;
this->hVelocity = 0x18000;
this->zVelocity = 0x18000;
this->speed = 0x80;
InitializeAnimation(this, this->animationState + 0x10);
}
@@ -118,14 +118,14 @@ void Rollobite_Initialize(Entity* this) {
void Rollobite_Walk(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x1) {
this->frames.all &= ~0x1;
if (this->frame & 0x1) {
this->frame &= ~0x1;
if (!ProcessMovement(this))
this->actionDelay = 1;
}
if (this->frames.all & 0x10) {
this->frames.all &= ~0x10;
if (this->frame & 0x10) {
this->frame &= ~0x10;
if (--this->actionDelay == 0) {
this->action = 3;
this->actionDelay = 60;
@@ -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);
}
@@ -172,7 +172,7 @@ void Rollobite_Turn(Entity* this) {
void Rollobite_RolledUp(Entity* this) {
u32 unk;
if ((this->frames.all & 0x80) == 0)
if ((this->frame & 0x80) == 0)
GetNextFrame(this);
unk = sub_080044EC(this, 0x2800);
@@ -194,15 +194,15 @@ void Rollobite_RolledUp(Entity* this) {
void Rollobite_Unroll(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
this->flags |= 0x80;
if (this->frame & 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);
} else {
if ((this->frames.all & 1) == 0)
if ((this->frame & 1) == 0)
sub_08078930(this);
}
}
@@ -213,7 +213,7 @@ void Rollobite_LinedUp(Entity* this) {
this->spritePriority.b0 = 7;
}
if (this->frames.all == 0)
if (this->frame == 0)
GetNextFrame(this);
}
@@ -252,17 +252,17 @@ void sub_08020A7C(Entity* this) {
}
bool32 Rollobite_TryToHoleUp(Entity* this) {
if (Rollobite_IsRolledUp(this) && this->height.HALF.HI == 0) {
if (Rollobite_IsRolledUp(this) && this->z.HALF.HI == 0) {
int tile = COORD_TO_TILE(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;
this->y.HALF.HI += 13;
this->hVelocity = 0x20000;
this->zVelocity = 0x20000;
InitializeAnimation(this, this->animationState + 0x14);
SetTile(0x4034, tile, this->collisionLayer);
return TRUE;
+4 -4
View File
@@ -67,8 +67,8 @@ void sub_08031434(Entity* this) {
} else {
this->action = 1;
this->subAction = 0;
this->spriteSettings.b.draw = (this->spriteSettings.b.draw & 0xfc);
this->height.HALF.HI = -0x80;
this->spriteSettings.draw = (this->spriteSettings.draw & 0xfc);
this->z.HALF.HI = -0x80;
this->frameIndex = 0xff;
}
}
@@ -81,7 +81,7 @@ void sub_08031480(Entity* this) {
sub_08031600(this);
this->action = 1;
this->subAction = 1;
this->spriteSettings.b.draw = 3;
this->spriteSettings.draw = 3;
this->spriteRendering.b3 = 1;
this->spriteOrientation.flipY = 1;
SoundReq(SFX_12D);
@@ -90,7 +90,7 @@ void sub_08031480(Entity* this) {
if (sub_08003FC4(this, 0x1800) == 0) {
this->action = 2;
this->field_0xf = 0xf;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
UpdateSpriteForCollisionLayer(this);
EnqueueSFX(0x84);
}
+24 -24
View File
@@ -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) {
@@ -56,7 +56,7 @@ void sub_08029318(Entity* this) {
if (*(u8*)(*(u32*)&this->field_0x4c + 8) == 1) {
if (this->action == 2) {
InitializeAnimation(this, 0);
InitializeAnimation(this->attachedEntity, 4);
InitializeAnimation(this->child, 4);
}
this->action = 4;
this->actionDelay = 0x3c;
@@ -84,7 +84,7 @@ void nullsub_141() {
void sub_080293DC(Entity* this) {
CopyPositionAndSpriteOffset(this->parent, this);
this->y.HALF.HI++;
this->height.HALF.HI--;
this->z.HALF.HI--;
gUnk_080CCC3C[this->action](this);
}
@@ -96,7 +96,7 @@ void sub_0802940C(Entity* this) {
sub_0804A720(this);
ent->parent = this;
ent->type2 = 1;
this->attachedEntity = ent;
this->child = ent;
this->field_0x80.HALF.HI = 0;
this->cutsceneBeh.HALF.LO = 0;
this->field_0x82.HALF.LO = this->palette.b.b0;
@@ -115,18 +115,18 @@ void sub_08029474(Entity* this) {
u32 bVar1;
sub_080296C8(this);
if (this->frames.b.f3) {
if (this->frame & 0x80) {
this->action = 3;
this->actionDelay = 8;
bVar1 = GetFacingDirection(this, &gPlayerEntity);
this->direction = bVar1;
this->animationState = (bVar1 << 0x18) >> 0x1c;
InitializeAnimation(this, this->animationState);
InitializeAnimation(this->attachedEntity, this->animationState + 4);
InitializeAnimation(this->child, this->animationState + 4);
} else {
if (this->frames.all == 1) {
this->frames.all = 0;
this->flags |= 0x80;
if (this->frame == 1) {
this->frame = 0;
COLLISION_ON(this);
}
}
}
@@ -142,9 +142,9 @@ 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);
InitializeAnimation(this->child, 7);
}
}
@@ -189,9 +189,9 @@ void sub_08029610(Entity* this) {
void sub_08029630(Entity* this) {
sub_080296C8(this);
if ((this->frames.b.f3) != 0) {
if (this->frame & 0x80) {
this->field_0x80.HALF.HI = 1;
this->attachedEntity->spriteSettings.b.draw = FALSE;
this->child->spriteSettings.draw = FALSE;
sub_080297F0(this);
}
}
@@ -219,23 +219,23 @@ void sub_0802969C(Entity* this) {
if (bVar1 != this->animationState) {
this->animationState = bVar1;
InitializeAnimation(this, bVar1);
InitializeAnimation(this->attachedEntity, bVar1 + 4);
InitializeAnimation(this->child, bVar1 + 4);
}
}
}
void sub_080296C8(Entity* this) {
GetNextFrame(this);
GetNextFrame(this->attachedEntity);
GetNextFrame(this->child);
}
void sub_080296D8(Entity* this) {
gPlayerState.jumpStatus = 0x41;
gPlayerState.flags &= 0xffffffef;
gPlayerEntity.flags |= 0x80;
gPlayerEntity.hVelocity = 0x18000;
gPlayerEntity.zVelocity = 0x18000;
gPlayerEntity.iframes = 0xa6;
gPlayerEntity.height.HALF.HI = -2;
gPlayerEntity.z.HALF.HI = -2;
gPlayerEntity.direction = gPlayerEntity.animationState << 2;
gPlayerEntity.spritePriority.b1 = this->field_0x80.HALF.LO;
gPlayerEntity.spriteOffsetY = 0;
@@ -252,16 +252,16 @@ 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;
InitializeAnimation(this->attachedEntity, 6);
this->child->spriteSettings.draw = TRUE;
InitializeAnimation(this->child, 6);
CreateDust(this);
}
}
@@ -270,9 +270,9 @@ void sub_080297F0(Entity* this) {
u32 temp;
this->action = 1;
this->actionDelay = 0x78;
this->flags = this->flags | 0x80;
this->spriteSettings.b.draw = TRUE;
this->damageType = 0x8e;
COLLISION_ON(this);
this->spriteSettings.draw = TRUE;
this->hitType = 0x8e;
sub_080AE068(this);
#ifdef EU
this->spriteIndex = 0x142;
+5 -5
View File
@@ -33,7 +33,7 @@ void sub_08044F70(Entity* this) {
}
void sub_08044F88(Entity* this) {
if ((this->currentHealth != 0) && (this->cutsceneBeh.HALF.LO != this->currentHealth)) {
if ((this->health != 0) && (this->cutsceneBeh.HALF.LO != this->health)) {
this->action = 4;
} else {
sub_0804AA30(this, gUnk_080D16A4);
@@ -49,7 +49,7 @@ void nullsub_171() {
void sub_08044FC8(Entity* this) {
this->action = 1;
this->spriteSettings.b.draw = 1;
this->spriteSettings.draw = 1;
this->speed = 128;
sub_0804A720(this);
InitializeAnimation(this, 0);
@@ -59,7 +59,7 @@ void sub_08044FC8(Entity* this) {
void sub_08044FF8(Entity* this) {
this->action = 2;
this->actionDelay = (Random() & 31) + 30;
this->cutsceneBeh.HALF.LO = this->currentHealth;
this->cutsceneBeh.HALF.LO = this->health;
}
void sub_08045018(Entity* this) {
@@ -105,10 +105,10 @@ void sub_080450A8(Entity* this) {
off = gUnk_080D16D4;
for (i = 0; i < count; i++) {
ent = entities[i];
ent->attachedEntity = entities[(i + 1) % count];
ent->child = entities[(i + 1) % count];
ent->parent = entities[(i + count - 1) % count];
ent->type2 = 1;
ent->height.HALF.HI = 0;
ent->z.HALF.HI = 0;
ent->iframes = -0x10;
/* Set MiniSlime offset relative to killed slime. */

Some files were not shown because too many files have changed in this diff Show More