mirror of
https://github.com/zeldaret/tmc
synced 2026-06-26 10:21:59 -04:00
Merge remote-tracking branch 'upstream/master' into proxy_naming
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
name: lint_pr
|
||||
on: pull_request
|
||||
jobs:
|
||||
clang-format:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: DoozyX/clang-format-lint-action@v0.8
|
||||
with:
|
||||
source: './src ./include'
|
||||
clangFormatVersion: 10
|
||||
-645
@@ -1,645 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
|
||||
thumb_func_start EzloCap
|
||||
EzloCap: @ 0x0806D86C
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
ldrb r0, [r4, #0xc]
|
||||
cmp r0, #0
|
||||
bne _0806D888
|
||||
adds r0, #1
|
||||
strb r0, [r4, #0xc]
|
||||
adds r0, r4, #0
|
||||
movs r1, #2
|
||||
bl sub_0805E3A0
|
||||
adds r0, r4, #0
|
||||
bl sub_0807DD50
|
||||
_0806D888:
|
||||
adds r0, r4, #0
|
||||
movs r1, #0
|
||||
bl sub_0807DDAC
|
||||
adds r0, r4, #0
|
||||
bl sub_0807DDE4
|
||||
adds r0, r4, #0
|
||||
bl UpdateAnimationSingleFrame
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0806D8A0
|
||||
sub_0806D8A0: @ 0x0806D8A0
|
||||
push {r4, r5, lr}
|
||||
adds r4, r0, #0
|
||||
adds r3, r1, #0
|
||||
movs r2, #0
|
||||
movs r0, #8
|
||||
strb r0, [r3, #0x19]
|
||||
ldr r0, [r3, #8]
|
||||
movs r1, #2
|
||||
orrs r0, r1
|
||||
str r0, [r3, #8]
|
||||
str r2, [r3, #0x14]
|
||||
movs r2, #0x10
|
||||
ldrb r0, [r4, #0x18]
|
||||
lsls r0, r0, #0x19
|
||||
cmp r0, #0
|
||||
bge _0806D8C2
|
||||
rsbs r2, r2, #0
|
||||
_0806D8C2:
|
||||
ldr r1, _0806D900 @ =gPlayerEntity
|
||||
movs r5, #0x2e
|
||||
ldrsh r0, [r1, r5]
|
||||
adds r2, r2, r0
|
||||
movs r0, #0x32
|
||||
ldrsh r1, [r1, r0]
|
||||
adds r1, #2
|
||||
strh r2, [r3, #0x1e]
|
||||
strh r1, [r3, #0x22]
|
||||
movs r3, #0x2e
|
||||
ldrsh r0, [r4, r3]
|
||||
subs r2, r2, r0
|
||||
movs r5, #0x32
|
||||
ldrsh r0, [r4, r5]
|
||||
subs r1, r1, r0
|
||||
adds r0, r2, #0
|
||||
bl sub_080045DA
|
||||
strb r0, [r4, #0x15]
|
||||
ldrb r2, [r4, #0x14]
|
||||
movs r1, #0x80
|
||||
ands r1, r2
|
||||
ldr r2, _0806D904 @ =gUnk_08114134
|
||||
lsls r0, r0, #0x18
|
||||
lsrs r0, r0, #0x1c
|
||||
adds r0, r0, r2
|
||||
ldrb r0, [r0]
|
||||
orrs r1, r0
|
||||
strb r1, [r4, #0x14]
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
_0806D900: .4byte gPlayerEntity
|
||||
_0806D904: .4byte gUnk_08114134
|
||||
|
||||
thumb_func_start sub_0806D908
|
||||
sub_0806D908: @ 0x0806D908
|
||||
push {r4, r5, lr}
|
||||
adds r4, r0, #0
|
||||
movs r1, #0x2e
|
||||
ldrsh r0, [r4, r1]
|
||||
movs r2, #0x32
|
||||
ldrsh r1, [r4, r2]
|
||||
ldr r3, _0806D93C @ =gPlayerEntity
|
||||
movs r5, #0x2e
|
||||
ldrsh r2, [r3, r5]
|
||||
movs r5, #0x32
|
||||
ldrsh r3, [r3, r5]
|
||||
bl sub_080045D4
|
||||
strb r0, [r4, #0x15]
|
||||
ldrb r2, [r4, #0x14]
|
||||
movs r1, #0x80
|
||||
ands r1, r2
|
||||
ldr r2, _0806D940 @ =gUnk_08114144
|
||||
lsls r0, r0, #0x18
|
||||
lsrs r0, r0, #0x19
|
||||
adds r0, r0, r2
|
||||
ldrb r0, [r0]
|
||||
orrs r1, r0
|
||||
strb r1, [r4, #0x14]
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
_0806D93C: .4byte gPlayerEntity
|
||||
_0806D940: .4byte gUnk_08114144
|
||||
|
||||
thumb_func_start sub_0806D944
|
||||
sub_0806D944: @ 0x0806D944
|
||||
push {lr}
|
||||
adds r2, r0, #0
|
||||
ldrb r0, [r2, #0x18]
|
||||
movs r3, #0x41
|
||||
rsbs r3, r3, #0
|
||||
ands r3, r0
|
||||
strb r3, [r2, #0x18]
|
||||
ldr r0, _0806D968 @ =gPlayerEntity
|
||||
ldr r1, [r2, #0x2c]
|
||||
ldr r0, [r0, #0x2c]
|
||||
cmp r1, r0
|
||||
bgt _0806D964
|
||||
movs r1, #0x40
|
||||
adds r0, r3, #0
|
||||
orrs r0, r1
|
||||
strb r0, [r2, #0x18]
|
||||
_0806D964:
|
||||
pop {pc}
|
||||
.align 2, 0
|
||||
_0806D968: .4byte gPlayerEntity
|
||||
|
||||
thumb_func_start sub_0806D96C
|
||||
sub_0806D96C: @ 0x0806D96C
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
movs r1, #0x42
|
||||
movs r2, #0
|
||||
bl CreateFx
|
||||
adds r2, r0, #0
|
||||
cmp r2, #0
|
||||
beq _0806D99C
|
||||
adds r3, r2, #0
|
||||
adds r3, #0x29
|
||||
ldrb r1, [r3]
|
||||
movs r0, #8
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r1
|
||||
movs r1, #1
|
||||
orrs r0, r1
|
||||
strb r0, [r3]
|
||||
ldr r3, _0806D9A0 @ =0xFFE80000
|
||||
adds r0, r4, #0
|
||||
adds r1, r2, #0
|
||||
movs r2, #0
|
||||
bl PositionRelative
|
||||
_0806D99C:
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
_0806D9A0: .4byte 0xFFE80000
|
||||
|
||||
thumb_func_start sub_0806D9A4
|
||||
sub_0806D9A4: @ 0x0806D9A4
|
||||
push {lr}
|
||||
ldr r1, _0806D9BC @ =gPlayerEntity
|
||||
ldr r2, [r0, #0x2c]
|
||||
ldr r0, [r1, #0x2c]
|
||||
adds r3, r1, #0
|
||||
cmp r2, r0
|
||||
bgt _0806D9C0
|
||||
ldrb r1, [r3, #0x18]
|
||||
movs r0, #0x41
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r1
|
||||
b _0806D9C6
|
||||
.align 2, 0
|
||||
_0806D9BC: .4byte gPlayerEntity
|
||||
_0806D9C0:
|
||||
ldrb r0, [r3, #0x18]
|
||||
movs r1, #0x40
|
||||
orrs r0, r1
|
||||
_0806D9C6:
|
||||
strb r0, [r3, #0x18]
|
||||
movs r0, #4
|
||||
strb r0, [r3, #0x14]
|
||||
pop {pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start NPC4E
|
||||
NPC4E: @ 0x0806D9D0
|
||||
push {lr}
|
||||
adds r2, r0, #0
|
||||
ldrb r0, [r2, #0xc]
|
||||
cmp r0, #0
|
||||
bne _0806D9F8
|
||||
movs r0, #1
|
||||
strb r0, [r2, #0xc]
|
||||
ldrb r1, [r2, #0x18]
|
||||
subs r0, #5
|
||||
ands r0, r1
|
||||
strb r0, [r2, #0x18]
|
||||
ldr r0, _0806D9F4 @ =gUnk_080FD170
|
||||
str r0, [r2, #0x48]
|
||||
adds r0, r2, #0
|
||||
bl sub_0807DD50
|
||||
b _0806DA00
|
||||
.align 2, 0
|
||||
_0806D9F4: .4byte gUnk_080FD170
|
||||
_0806D9F8:
|
||||
adds r0, r2, #0
|
||||
movs r1, #0
|
||||
bl sub_0807DD94
|
||||
_0806DA00:
|
||||
pop {pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0806DA04
|
||||
sub_0806DA04: @ 0x0806DA04
|
||||
push {lr}
|
||||
ldr r3, [r1, #4]
|
||||
lsls r3, r3, #3
|
||||
ldr r1, _0806DA18 @ =gUnk_0811415C
|
||||
adds r3, r3, r1
|
||||
ldrb r2, [r3, #4]
|
||||
movs r1, #1
|
||||
bl sub_08078850
|
||||
pop {pc}
|
||||
.align 2, 0
|
||||
_0806DA18: .4byte gUnk_0811415C
|
||||
|
||||
thumb_func_start sub_0806DA1C
|
||||
sub_0806DA1C: @ 0x0806DA1C
|
||||
push {lr}
|
||||
ldr r3, _0806DA34 @ =gUnk_081141A4
|
||||
ldr r2, [r1, #4]
|
||||
lsls r0, r2, #2
|
||||
adds r0, r0, r3
|
||||
ldr r0, [r0]
|
||||
ldr r1, _0806DA38 @ =gUnk_081141E4
|
||||
adds r2, r2, r1
|
||||
ldrb r1, [r2]
|
||||
bl sub_0808091C
|
||||
pop {pc}
|
||||
.align 2, 0
|
||||
_0806DA34: .4byte gUnk_081141A4
|
||||
_0806DA38: .4byte gUnk_081141E4
|
||||
|
||||
thumb_func_start sub_0806DA3C
|
||||
sub_0806DA3C: @ 0x0806DA3C
|
||||
push {lr}
|
||||
adds r2, r0, #0
|
||||
ldrb r0, [r2, #0xa]
|
||||
subs r0, #1
|
||||
cmp r0, #0xa
|
||||
bhi _0806DA84
|
||||
lsls r0, r0, #2
|
||||
ldr r1, _0806DA54 @ =_0806DA58
|
||||
adds r0, r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.align 2, 0
|
||||
_0806DA54: .4byte _0806DA58
|
||||
_0806DA58: @ jump table
|
||||
.4byte _0806DA88 @ case 0
|
||||
.4byte _0806DA8C @ case 1
|
||||
.4byte _0806DA90 @ case 2
|
||||
.4byte _0806DA94 @ case 3
|
||||
.4byte _0806DA98 @ case 4
|
||||
.4byte _0806DAA0 @ case 5
|
||||
.4byte _0806DAA0 @ case 6
|
||||
.4byte _0806DAA0 @ case 7
|
||||
.4byte _0806DAA0 @ case 8
|
||||
.4byte _0806DAA0 @ case 9
|
||||
.4byte _0806DA9C @ case 10
|
||||
_0806DA84:
|
||||
movs r0, #0
|
||||
b _0806DAA6
|
||||
_0806DA88:
|
||||
movs r0, #1
|
||||
b _0806DAA6
|
||||
_0806DA8C:
|
||||
movs r0, #2
|
||||
b _0806DAA6
|
||||
_0806DA90:
|
||||
movs r0, #3
|
||||
b _0806DAA6
|
||||
_0806DA94:
|
||||
movs r0, #4
|
||||
b _0806DAA6
|
||||
_0806DA98:
|
||||
movs r0, #5
|
||||
b _0806DAA6
|
||||
_0806DA9C:
|
||||
movs r0, #9
|
||||
b _0806DAA6
|
||||
_0806DAA0:
|
||||
adds r0, r2, #0
|
||||
bl sub_0801E99C
|
||||
_0806DAA6:
|
||||
lsls r0, r0, #0x18
|
||||
lsrs r0, r0, #0x18
|
||||
pop {pc}
|
||||
|
||||
thumb_func_start sub_0806DAAC
|
||||
sub_0806DAAC: @ 0x0806DAAC
|
||||
push {r4, lr}
|
||||
adds r4, r1, #0
|
||||
bl sub_0806DA3C
|
||||
lsls r0, r0, #0x18
|
||||
lsrs r0, r0, #0x18
|
||||
bl CheckKinstoneFused
|
||||
str r0, [r4, #0x14]
|
||||
ldr r2, _0806DACC @ =gUnk_02033280
|
||||
ldrb r1, [r2, #7]
|
||||
movs r0, #1
|
||||
orrs r0, r1
|
||||
strb r0, [r2, #7]
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
_0806DACC: .4byte gUnk_02033280
|
||||
|
||||
thumb_func_start sub_0806DAD0
|
||||
sub_0806DAD0: @ 0x0806DAD0
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
bl sub_0806DA3C
|
||||
adds r1, r0, #0
|
||||
lsls r1, r1, #0x18
|
||||
lsrs r1, r1, #0x18
|
||||
adds r0, r4, #0
|
||||
bl sub_08078790
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0806DAE8
|
||||
sub_0806DAE8: @ 0x0806DAE8
|
||||
push {lr}
|
||||
ldrb r0, [r0, #0xa]
|
||||
subs r0, #1
|
||||
cmp r0, #4
|
||||
bhi _0806DB3A
|
||||
lsls r0, r0, #2
|
||||
ldr r1, _0806DAFC @ =_0806DB00
|
||||
adds r0, r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.align 2, 0
|
||||
_0806DAFC: .4byte _0806DB00
|
||||
_0806DB00: @ jump table
|
||||
.4byte _0806DB14 @ case 0
|
||||
.4byte _0806DB1C @ case 1
|
||||
.4byte _0806DB24 @ case 2
|
||||
.4byte _0806DB2C @ case 3
|
||||
.4byte _0806DB34 @ case 4
|
||||
_0806DB14:
|
||||
movs r0, #0xee
|
||||
bl SetLocalFlag
|
||||
b _0806DB3A
|
||||
_0806DB1C:
|
||||
movs r0, #0xef
|
||||
bl SetLocalFlag
|
||||
b _0806DB3A
|
||||
_0806DB24:
|
||||
movs r0, #0xf0
|
||||
bl SetLocalFlag
|
||||
b _0806DB3A
|
||||
_0806DB2C:
|
||||
movs r0, #0xf1
|
||||
bl SetLocalFlag
|
||||
b _0806DB3A
|
||||
_0806DB34:
|
||||
movs r0, #0xf2
|
||||
bl SetLocalFlag
|
||||
_0806DB3A:
|
||||
movs r0, #0xcd
|
||||
bl SoundReq
|
||||
pop {pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0806DB44
|
||||
sub_0806DB44: @ 0x0806DB44
|
||||
push {r4, lr}
|
||||
adds r4, r1, #0
|
||||
movs r0, #0
|
||||
str r0, [r4, #0x14]
|
||||
movs r0, #0xee
|
||||
bl CheckLocalFlag
|
||||
cmp r0, #0
|
||||
beq _0806DB82
|
||||
movs r0, #0xef
|
||||
bl CheckLocalFlag
|
||||
cmp r0, #0
|
||||
beq _0806DB82
|
||||
movs r0, #0xf0
|
||||
bl CheckLocalFlag
|
||||
cmp r0, #0
|
||||
beq _0806DB82
|
||||
movs r0, #0xf1
|
||||
bl CheckLocalFlag
|
||||
cmp r0, #0
|
||||
beq _0806DB82
|
||||
movs r0, #0xf2
|
||||
bl CheckLocalFlag
|
||||
cmp r0, #0
|
||||
beq _0806DB82
|
||||
movs r0, #1
|
||||
str r0, [r4, #0x14]
|
||||
_0806DB82:
|
||||
pop {r4, pc}
|
||||
|
||||
thumb_func_start sub_0806DB84
|
||||
sub_0806DB84: @ 0x0806DB84
|
||||
push {r4, r5, lr}
|
||||
adds r5, r0, #0
|
||||
ldr r0, _0806DBE4 @ =gUnk_08114154
|
||||
str r0, [r5, #0x48]
|
||||
movs r0, #0x3e
|
||||
movs r1, #4
|
||||
movs r2, #0
|
||||
bl CreateObject
|
||||
adds r4, r0, #0
|
||||
cmp r4, #0
|
||||
beq _0806DBB6
|
||||
ldr r2, _0806DBE8 @ =0xFFF80000
|
||||
adds r0, r5, #0
|
||||
adds r1, r4, #0
|
||||
movs r3, #0
|
||||
bl PositionRelative
|
||||
ldr r1, _0806DBEC @ =gUnk_08016030
|
||||
adds r0, r4, #0
|
||||
bl StartCutscene
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x84
|
||||
str r0, [r1]
|
||||
_0806DBB6:
|
||||
movs r0, #0x3e
|
||||
movs r1, #5
|
||||
movs r2, #0
|
||||
bl CreateObject
|
||||
adds r4, r0, #0
|
||||
cmp r4, #0
|
||||
beq _0806DBE2
|
||||
movs r2, #0x80
|
||||
lsls r2, r2, #0xc
|
||||
adds r0, r5, #0
|
||||
adds r1, r4, #0
|
||||
movs r3, #0
|
||||
bl PositionRelative
|
||||
ldr r1, _0806DBF0 @ =gUnk_0801606C
|
||||
adds r0, r4, #0
|
||||
bl StartCutscene
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x84
|
||||
str r0, [r1]
|
||||
_0806DBE2:
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
_0806DBE4: .4byte gUnk_08114154
|
||||
_0806DBE8: .4byte 0xFFF80000
|
||||
_0806DBEC: .4byte gUnk_08016030
|
||||
_0806DBF0: .4byte gUnk_0801606C
|
||||
|
||||
thumb_func_start sub_0806DBF4
|
||||
sub_0806DBF4: @ 0x0806DBF4
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
cmp r4, #1
|
||||
blo _0806DC36
|
||||
cmp r4, #4
|
||||
bls _0806DC04
|
||||
cmp r4, #6
|
||||
bne _0806DC36
|
||||
_0806DC04:
|
||||
movs r4, #1
|
||||
movs r0, #2
|
||||
bl GetInventoryValue
|
||||
cmp r0, #0
|
||||
beq _0806DC12
|
||||
movs r4, #2
|
||||
_0806DC12:
|
||||
movs r0, #3
|
||||
bl GetInventoryValue
|
||||
cmp r0, #0
|
||||
beq _0806DC1E
|
||||
movs r4, #3
|
||||
_0806DC1E:
|
||||
movs r0, #4
|
||||
bl GetInventoryValue
|
||||
cmp r0, #0
|
||||
beq _0806DC2A
|
||||
movs r4, #4
|
||||
_0806DC2A:
|
||||
movs r0, #6
|
||||
bl GetInventoryValue
|
||||
cmp r0, #0
|
||||
beq _0806DC36
|
||||
movs r4, #6
|
||||
_0806DC36:
|
||||
adds r0, r4, #0
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0806DC3C
|
||||
sub_0806DC3C: @ 0x0806DC3C
|
||||
ldr r2, _0806DC54 @ =gSave
|
||||
adds r1, r2, #0
|
||||
adds r1, #0xb4
|
||||
ldrb r3, [r1]
|
||||
adds r1, r0, #0
|
||||
adds r1, #0x68
|
||||
strb r3, [r1]
|
||||
adds r2, #0xb5
|
||||
ldrb r1, [r2]
|
||||
adds r0, #0x69
|
||||
strb r1, [r0]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_0806DC54: .4byte gSave
|
||||
|
||||
thumb_func_start sub_0806DC58
|
||||
sub_0806DC58: @ 0x0806DC58
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
adds r0, #0x68
|
||||
ldrb r0, [r0]
|
||||
bl sub_0806DBF4
|
||||
movs r1, #0
|
||||
bl ForceEquipItem
|
||||
adds r4, #0x69
|
||||
ldrb r0, [r4]
|
||||
bl sub_0806DBF4
|
||||
movs r1, #1
|
||||
bl ForceEquipItem
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0806DC7C
|
||||
sub_0806DC7C: @ 0x0806DC7C
|
||||
push {r4, lr}
|
||||
ldr r4, _0806DC84 @ =gUnk_081141F4
|
||||
b _0806DC94
|
||||
.align 2, 0
|
||||
_0806DC84: .4byte gUnk_081141F4
|
||||
_0806DC88:
|
||||
ldrh r1, [r4]
|
||||
adds r4, #2
|
||||
ldr r0, _0806DC9C @ =0x00004072
|
||||
movs r2, #1
|
||||
bl SetTileType
|
||||
_0806DC94:
|
||||
ldrh r0, [r4]
|
||||
cmp r0, #0
|
||||
bne _0806DC88
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
_0806DC9C: .4byte 0x00004072
|
||||
|
||||
thumb_func_start sub_0806DCA0
|
||||
sub_0806DCA0: @ 0x0806DCA0
|
||||
push {r4, lr}
|
||||
ldr r4, _0806DCA8 @ =gUnk_081141F4
|
||||
b _0806DCB6
|
||||
.align 2, 0
|
||||
_0806DCA8: .4byte gUnk_081141F4
|
||||
_0806DCAC:
|
||||
ldrh r0, [r4]
|
||||
adds r4, #2
|
||||
movs r1, #1
|
||||
bl sub_0807BA8C
|
||||
_0806DCB6:
|
||||
ldrh r0, [r4]
|
||||
cmp r0, #0
|
||||
bne _0806DCAC
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0806DCC0
|
||||
sub_0806DCC0: @ 0x0806DCC0
|
||||
ldr r0, _0806DCD0 @ =gScreenTransition
|
||||
movs r1, #0xf9
|
||||
lsls r1, r1, #3
|
||||
strh r1, [r0, #0x20]
|
||||
movs r1, #0xf8
|
||||
strh r1, [r0, #0x22]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_0806DCD0: .4byte gScreenTransition
|
||||
|
||||
thumb_func_start NPC4E_Fusion
|
||||
NPC4E_Fusion: @ 0x0806DCD4
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
ldrb r0, [r4, #0xc]
|
||||
cmp r0, #0
|
||||
bne _0806DD40
|
||||
adds r0, #1
|
||||
strb r0, [r4, #0xc]
|
||||
ldrb r0, [r4, #0xa]
|
||||
subs r0, #1
|
||||
cmp r0, #0xa
|
||||
bhi _0806DD40
|
||||
lsls r0, r0, #2
|
||||
ldr r1, _0806DCF4 @ =_0806DCF8
|
||||
adds r0, r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.align 2, 0
|
||||
_0806DCF4: .4byte _0806DCF8
|
||||
_0806DCF8: @ jump table
|
||||
.4byte _0806DD24 @ case 0
|
||||
.4byte _0806DD24 @ case 1
|
||||
.4byte _0806DD24 @ case 2
|
||||
.4byte _0806DD24 @ case 3
|
||||
.4byte _0806DD24 @ case 4
|
||||
.4byte _0806DD2C @ case 5
|
||||
.4byte _0806DD2C @ case 6
|
||||
.4byte _0806DD2C @ case 7
|
||||
.4byte _0806DD2C @ case 8
|
||||
.4byte _0806DD2C @ case 9
|
||||
.4byte _0806DD34 @ case 10
|
||||
_0806DD24:
|
||||
adds r0, r4, #0
|
||||
bl sub_0809623C
|
||||
b _0806DD40
|
||||
_0806DD2C:
|
||||
adds r0, r4, #0
|
||||
bl sub_08096260
|
||||
b _0806DD40
|
||||
_0806DD34:
|
||||
adds r0, r4, #0
|
||||
movs r1, #0
|
||||
bl sub_0806DB84
|
||||
movs r0, #0
|
||||
str r0, [r4, #0x48]
|
||||
_0806DD40:
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
-1041
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,55 @@
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
push {r4, r5, lr}
|
||||
adds r4, r0, #0
|
||||
adds r3, r1, #0
|
||||
movs r2, #0
|
||||
movs r0, #8
|
||||
strb r0, [r3, #0x19]
|
||||
ldr r0, [r3, #8]
|
||||
movs r1, #2
|
||||
orrs r0, r1
|
||||
str r0, [r3, #8]
|
||||
str r2, [r3, #0x14]
|
||||
movs r2, #0x10
|
||||
ldrb r0, [r4, #0x18]
|
||||
lsls r0, r0, #0x19
|
||||
cmp r0, #0
|
||||
bge _0806D8C2
|
||||
rsbs r2, r2, #0
|
||||
_0806D8C2:
|
||||
ldr r1, _0806D900 @ =gPlayerEntity
|
||||
movs r5, #0x2e
|
||||
ldrsh r0, [r1, r5]
|
||||
adds r2, r2, r0
|
||||
movs r0, #0x32
|
||||
ldrsh r1, [r1, r0]
|
||||
adds r1, #2
|
||||
strh r2, [r3, #0x1e]
|
||||
strh r1, [r3, #0x22]
|
||||
movs r3, #0x2e
|
||||
ldrsh r0, [r4, r3]
|
||||
subs r2, r2, r0
|
||||
movs r5, #0x32
|
||||
ldrsh r0, [r4, r5]
|
||||
subs r1, r1, r0
|
||||
adds r0, r2, #0
|
||||
bl sub_080045DA
|
||||
strb r0, [r4, #0x15]
|
||||
ldrb r2, [r4, #0x14]
|
||||
movs r1, #0x80
|
||||
ands r1, r2
|
||||
ldr r2, _0806D904 @ =gUnk_08114134
|
||||
lsls r0, r0, #0x18
|
||||
lsrs r0, r0, #0x1c
|
||||
adds r0, r0, r2
|
||||
ldrb r0, [r0]
|
||||
orrs r1, r0
|
||||
strb r1, [r4, #0x14]
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
_0806D900: .4byte gPlayerEntity
|
||||
_0806D904: .4byte gUnk_08114134
|
||||
.syntax divided
|
||||
@@ -0,0 +1,32 @@
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
push {r4, r5, lr}
|
||||
adds r4, r0, #0
|
||||
movs r1, #0x2e
|
||||
ldrsh r0, [r4, r1]
|
||||
movs r2, #0x32
|
||||
ldrsh r1, [r4, r2]
|
||||
ldr r3, _0806D93C @ =gPlayerEntity
|
||||
movs r5, #0x2e
|
||||
ldrsh r2, [r3, r5]
|
||||
movs r5, #0x32
|
||||
ldrsh r3, [r3, r5]
|
||||
bl sub_080045D4
|
||||
strb r0, [r4, #0x15]
|
||||
ldrb r2, [r4, #0x14]
|
||||
movs r1, #0x80
|
||||
ands r1, r2
|
||||
ldr r2, _0806D940 @ =gUnk_08114144
|
||||
lsls r0, r0, #0x18
|
||||
lsrs r0, r0, #0x19
|
||||
adds r0, r0, r2
|
||||
ldrb r0, [r0]
|
||||
orrs r1, r0
|
||||
strb r1, [r4, #0x14]
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
_0806D93C: .4byte gPlayerEntity
|
||||
_0806D940: .4byte gUnk_08114144
|
||||
.syntax divided
|
||||
@@ -0,0 +1,15 @@
|
||||
.syntax unified
|
||||
.text
|
||||
|
||||
push {lr}
|
||||
ldr r3, [r1, #4]
|
||||
lsls r3, r3, #3
|
||||
ldr r1, _0806DA18 @ =gUnk_0811415C
|
||||
adds r3, r3, r1
|
||||
ldrb r2, [r3, #4]
|
||||
movs r1, #1
|
||||
bl sub_08078850
|
||||
pop {pc}
|
||||
.align 2, 0
|
||||
_0806DA18: .4byte gUnk_0811415C
|
||||
.syntax divided
|
||||
@@ -0,0 +1,95 @@
|
||||
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
adds r0, #0x41
|
||||
ldrb r2, [r0]
|
||||
cmp r2, #0x87
|
||||
bne _080374D4
|
||||
ldrb r0, [r4, #0xc]
|
||||
cmp r0, #6
|
||||
bne _080374BC
|
||||
adds r0, r4, #0
|
||||
bl sub_08037ACC
|
||||
_080374BC:
|
||||
movs r0, #8
|
||||
strb r0, [r4, #0xc]
|
||||
movs r0, #0x3c
|
||||
strb r0, [r4, #0xe]
|
||||
ldrb r1, [r4, #0x10]
|
||||
movs r0, #0x7f
|
||||
ands r0, r1
|
||||
strb r0, [r4, #0x10]
|
||||
adds r0, r4, #0
|
||||
bl sub_08037B48
|
||||
b _08037534
|
||||
_080374D4:
|
||||
ldrb r0, [r4, #0xc]
|
||||
adds r1, r0, #0
|
||||
cmp r1, #6
|
||||
beq _0803752E
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x3f
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #0x27
|
||||
bne _080374F2
|
||||
cmp r2, #0x80
|
||||
bne _080374F2
|
||||
adds r0, r4, #0
|
||||
bl sub_08037A14
|
||||
b _08037534
|
||||
_080374F2:
|
||||
subs r0, r1, #1
|
||||
lsls r0, r0, #0x18
|
||||
lsrs r0, r0, #0x18
|
||||
cmp r0, #1
|
||||
bhi _08037534
|
||||
movs r0, #1
|
||||
strb r0, [r4, #0xc]
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x3e
|
||||
ldrb r0, [r0]
|
||||
movs r1, #0x10
|
||||
eors r0, r1
|
||||
adds r0, #4
|
||||
movs r1, #0x18
|
||||
ands r0, r1
|
||||
strb r0, [r4, #0x15]
|
||||
lsrs r0, r0, #3
|
||||
strb r0, [r4, #0x14]
|
||||
ldrb r1, [r4, #0x14]
|
||||
adds r0, r4, #0
|
||||
bl InitAnimationForceUpdate
|
||||
adds r0, r4, #0
|
||||
bl sub_08037810
|
||||
cmp r0, #0
|
||||
beq _08037534
|
||||
movs r0, #4
|
||||
strb r0, [r4, #0xe]
|
||||
b _08037534
|
||||
_0803752E:
|
||||
adds r0, r4, #0
|
||||
bl sub_08037A58
|
||||
_08037534:
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x43
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #0
|
||||
beq _08037546
|
||||
adds r0, r4, #0
|
||||
movs r1, #0x1c
|
||||
bl sub_0804A9FC
|
||||
_08037546:
|
||||
ldr r1, _08037550 @ =gGibdo
|
||||
adds r0, r4, #0
|
||||
bl sub_0804AA30
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
_08037550: .4byte gGibdo
|
||||
|
||||
|
||||
.syntax divided
|
||||
@@ -0,0 +1,57 @@
|
||||
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
bl sub_080379EC
|
||||
cmp r0, #0
|
||||
bne _0803773A
|
||||
bl ResetPlayer
|
||||
ldr r2, _08037724 @ =gPlayerState
|
||||
ldrb r1, [r2, #0x1a]
|
||||
movs r0, #0x80
|
||||
orrs r1, r0
|
||||
strb r1, [r2, #0x1a]
|
||||
ldrb r1, [r2, #0xa]
|
||||
orrs r0, r1
|
||||
strb r0, [r2, #0xa]
|
||||
ldr r0, _08037728 @ =gPlayerEntity
|
||||
adds r1, r4, #0
|
||||
bl CopyPositionAndSpriteOffset
|
||||
adds r0, r4, #0
|
||||
bl UpdateAnimationSingleFrame
|
||||
adds r2, r4, #0
|
||||
adds r2, #0x5a
|
||||
ldrb r1, [r2]
|
||||
movs r0, #1
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _0803773A
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x7c
|
||||
ldrb r0, [r1]
|
||||
subs r0, #1
|
||||
strb r0, [r1]
|
||||
lsls r0, r0, #0x18
|
||||
cmp r0, #0
|
||||
bne _0803772C
|
||||
adds r0, r4, #0
|
||||
bl sub_08037A58
|
||||
b _0803773A
|
||||
.align 2, 0
|
||||
_08037724: .4byte gPlayerState
|
||||
_08037728: .4byte gPlayerEntity
|
||||
_0803772C:
|
||||
ldrb r0, [r2]
|
||||
movs r1, #1
|
||||
eors r0, r1
|
||||
strb r0, [r2]
|
||||
adds r0, r4, #0
|
||||
bl sub_08037B10
|
||||
_0803773A:
|
||||
pop {r4, pc}
|
||||
|
||||
.syntax divided
|
||||
@@ -0,0 +1,86 @@
|
||||
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
push {r4, r5, r6, lr}
|
||||
adds r5, r0, #0
|
||||
adds r1, r5, #0
|
||||
adds r1, #0x76
|
||||
ldrb r0, [r1]
|
||||
cmp r0, #0
|
||||
bne _080378A8
|
||||
adds r0, r5, #0
|
||||
movs r1, #1
|
||||
bl sub_08049FDC
|
||||
cmp r0, #0
|
||||
beq _080378AC
|
||||
ldr r6, _080378A4 @ =gUnk_020000B0
|
||||
ldr r0, [r6]
|
||||
movs r2, #0x2e
|
||||
ldrsh r1, [r0, r2]
|
||||
movs r3, #0x32
|
||||
ldrsh r2, [r0, r3]
|
||||
adds r0, r5, #0
|
||||
movs r3, #0x40
|
||||
bl sub_0806FCB8
|
||||
cmp r0, #0
|
||||
beq _080378AC
|
||||
ldr r1, [r6]
|
||||
adds r0, r5, #0
|
||||
bl GetFacingDirection
|
||||
ldrb r1, [r5, #0x15]
|
||||
subs r0, r0, r1
|
||||
adds r0, #6
|
||||
movs r1, #0x1f
|
||||
ands r0, r1
|
||||
cmp r0, #0xc
|
||||
bhi _080378AC
|
||||
movs r0, #3
|
||||
strb r0, [r5, #0xc]
|
||||
movs r4, #0x18
|
||||
movs r0, #0x18
|
||||
strb r0, [r5, #0xe]
|
||||
movs r0, #8
|
||||
strb r0, [r5, #0xf]
|
||||
movs r0, #0xc0
|
||||
strh r0, [r5, #0x24]
|
||||
ldr r1, [r6]
|
||||
adds r0, r5, #0
|
||||
bl GetFacingDirection
|
||||
adds r0, #4
|
||||
ands r0, r4
|
||||
strb r0, [r5, #0x15]
|
||||
lsrs r0, r0, #3
|
||||
strb r0, [r5, #0x14]
|
||||
adds r1, r5, #0
|
||||
adds r1, #0x74
|
||||
movs r0, #0x96
|
||||
lsls r0, r0, #1
|
||||
strh r0, [r1]
|
||||
ldr r2, [r6]
|
||||
ldrh r1, [r2, #0x2e]
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x78
|
||||
strh r1, [r0]
|
||||
ldrh r0, [r2, #0x32]
|
||||
adds r3, r5, #0
|
||||
adds r3, #0x7a
|
||||
strh r0, [r3]
|
||||
ldrb r1, [r5, #0x14]
|
||||
adds r0, r5, #0
|
||||
bl InitAnimationForceUpdate
|
||||
movs r0, #1
|
||||
b _080378AE
|
||||
.align 2, 0
|
||||
_080378A4: .4byte gUnk_020000B0
|
||||
_080378A8:
|
||||
subs r0, #1
|
||||
strb r0, [r1]
|
||||
_080378AC:
|
||||
movs r0, #0
|
||||
_080378AE:
|
||||
pop {r4, r5, r6, pc}
|
||||
|
||||
.syntax divided
|
||||
@@ -0,0 +1,39 @@
|
||||
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
push {r4, r5, lr}
|
||||
adds r5, r0, #0
|
||||
movs r4, #0x18
|
||||
movs r0, #0x18
|
||||
strb r0, [r5, #0xe]
|
||||
movs r0, #8
|
||||
strb r0, [r5, #0xf]
|
||||
movs r1, #0x2e
|
||||
ldrsh r0, [r5, r1]
|
||||
movs r2, #0x32
|
||||
ldrsh r1, [r5, r2]
|
||||
adds r2, r5, #0
|
||||
adds r2, #0x78
|
||||
ldrh r2, [r2]
|
||||
adds r3, r5, #0
|
||||
adds r3, #0x7a
|
||||
ldrh r3, [r3]
|
||||
bl sub_080045D4
|
||||
adds r0, #4
|
||||
ands r0, r4
|
||||
strb r0, [r5, #0x15]
|
||||
lsrs r0, r0, #3
|
||||
ldrb r1, [r5, #0x14]
|
||||
cmp r0, r1
|
||||
beq _080379BA
|
||||
strb r0, [r5, #0x14]
|
||||
adds r1, r0, #4
|
||||
adds r0, r5, #0
|
||||
bl InitAnimationForceUpdate
|
||||
_080379BA:
|
||||
pop {r4, r5, pc}
|
||||
|
||||
.syntax divided
|
||||
@@ -0,0 +1,64 @@
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
bl sub_08037ACC
|
||||
movs r0, #7
|
||||
strb r0, [r4, #0xc]
|
||||
adds r2, r4, #0
|
||||
adds r2, #0x29
|
||||
ldrb r1, [r2]
|
||||
subs r0, #0xf
|
||||
ands r0, r1
|
||||
movs r1, #4
|
||||
orrs r0, r1
|
||||
strb r0, [r2]
|
||||
adds r3, r4, #0
|
||||
adds r3, #0x3d
|
||||
movs r0, #0
|
||||
ldrsb r0, [r3, r0]
|
||||
cmp r0, #0
|
||||
bne _08037A84
|
||||
movs r0, #0xec
|
||||
strb r0, [r3]
|
||||
_08037A84:
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x3f
|
||||
movs r0, #0x26
|
||||
strb r0, [r1]
|
||||
adds r2, r4, #0
|
||||
adds r2, #0x3b
|
||||
ldrb r0, [r2]
|
||||
movs r1, #1
|
||||
orrs r0, r1
|
||||
strb r0, [r2]
|
||||
movs r0, #0xf4
|
||||
strb r0, [r3]
|
||||
ldrb r0, [r4, #0x14]
|
||||
lsls r0, r0, #3
|
||||
movs r1, #0x10
|
||||
eors r0, r1
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x3e
|
||||
strb r0, [r1]
|
||||
adds r1, #4
|
||||
movs r0, #8
|
||||
strb r0, [r1]
|
||||
adds r1, #4
|
||||
movs r0, #0xc0
|
||||
lsls r0, r0, #1
|
||||
strh r0, [r1]
|
||||
adds r1, #0x30
|
||||
movs r0, #0x3c
|
||||
strb r0, [r1]
|
||||
ldrb r1, [r4, #0x14]
|
||||
adds r1, #0x10
|
||||
adds r0, r4, #0
|
||||
bl InitAnimationForceUpdate
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
|
||||
.syntax divided
|
||||
@@ -0,0 +1,106 @@
|
||||
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
movs r0, #0x2a
|
||||
movs r1, #3
|
||||
movs r2, #0
|
||||
bl CreateObject
|
||||
adds r3, r0, #0
|
||||
cmp r3, #0
|
||||
beq _08037B88
|
||||
ldrb r0, [r4, #0xe]
|
||||
movs r2, #0
|
||||
strb r0, [r3, #0xb]
|
||||
movs r0, #0x29
|
||||
adds r0, r0, r3
|
||||
mov ip, r0
|
||||
ldrb r1, [r0]
|
||||
movs r0, #8
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r1
|
||||
movs r1, #3
|
||||
orrs r0, r1
|
||||
mov r1, ip
|
||||
strb r0, [r1]
|
||||
adds r0, r3, #0
|
||||
adds r0, #0x62
|
||||
strb r2, [r0]
|
||||
adds r1, r3, #0
|
||||
adds r1, #0x63
|
||||
movs r0, #0xfc
|
||||
strb r0, [r1]
|
||||
str r4, [r3, #0x50]
|
||||
_08037B88:
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x80
|
||||
str r3, [r0]
|
||||
movs r0, #0x2a
|
||||
movs r1, #3
|
||||
movs r2, #0
|
||||
bl CreateObject
|
||||
adds r3, r0, #0
|
||||
cmp r3, #0
|
||||
beq _08037BCA
|
||||
ldrb r0, [r4, #0xe]
|
||||
strb r0, [r3, #0xb]
|
||||
movs r0, #0x29
|
||||
adds r0, r0, r3
|
||||
mov ip, r0
|
||||
ldrb r1, [r0]
|
||||
movs r2, #8
|
||||
rsbs r2, r2, #0
|
||||
adds r0, r2, #0
|
||||
ands r0, r1
|
||||
movs r1, #3
|
||||
orrs r0, r1
|
||||
mov r1, ip
|
||||
strb r0, [r1]
|
||||
adds r1, r3, #0
|
||||
adds r1, #0x62
|
||||
movs r0, #0xfd
|
||||
strb r0, [r1]
|
||||
adds r0, r3, #0
|
||||
adds r0, #0x63
|
||||
strb r2, [r0]
|
||||
str r4, [r3, #0x50]
|
||||
_08037BCA:
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x84
|
||||
str r3, [r0]
|
||||
movs r0, #0x2a
|
||||
movs r1, #3
|
||||
movs r2, #0
|
||||
bl CreateObject
|
||||
adds r3, r0, #0
|
||||
cmp r3, #0
|
||||
beq _08037C06
|
||||
ldrb r0, [r4, #0xe]
|
||||
strb r0, [r3, #0xb]
|
||||
adds r2, r3, #0
|
||||
adds r2, #0x29
|
||||
ldrb r1, [r2]
|
||||
movs r0, #8
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r1
|
||||
movs r1, #3
|
||||
orrs r0, r1
|
||||
strb r0, [r2]
|
||||
adds r1, r3, #0
|
||||
adds r1, #0x62
|
||||
movs r0, #5
|
||||
strb r0, [r1]
|
||||
adds r1, #1
|
||||
movs r0, #0xf5
|
||||
strb r0, [r1]
|
||||
str r4, [r3, #0x50]
|
||||
_08037C06:
|
||||
str r3, [r4, #0x54]
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
|
||||
.syntax divided
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
|
||||
push {lr}
|
||||
adds r3, r0, #0
|
||||
adds r0, #0x80
|
||||
ldr r2, [r0]
|
||||
cmp r2, #0
|
||||
beq _08037C1E
|
||||
movs r0, #0xf
|
||||
strb r0, [r2, #0xe]
|
||||
str r1, [r2, #0x50]
|
||||
_08037C1E:
|
||||
adds r0, r3, #0
|
||||
adds r0, #0x84
|
||||
ldr r2, [r0]
|
||||
cmp r2, #0
|
||||
beq _08037C2E
|
||||
movs r0, #0xf
|
||||
strb r0, [r2, #0xe]
|
||||
str r1, [r2, #0x50]
|
||||
_08037C2E:
|
||||
ldr r2, [r3, #0x54]
|
||||
cmp r2, #0
|
||||
beq _08037C3A
|
||||
movs r0, #0xf
|
||||
strb r0, [r2, #0xe]
|
||||
str r1, [r2, #0x50]
|
||||
_08037C3A:
|
||||
pop {pc}
|
||||
|
||||
.syntax divided
|
||||
@@ -1344,7 +1344,7 @@ gUnk_080CF278:: @ 080CF278
|
||||
gUnk_080CF290:: @ 080CF290
|
||||
.incbin "baserom.gba", 0x0CF290, 0x0000004
|
||||
|
||||
gUnk_080CF294:: @ 080CF294
|
||||
gGibdo:: @ 080CF294
|
||||
.incbin "baserom.gba", 0x0CF294, 0x0000018
|
||||
|
||||
gUnk_080CF2AC:: @ 080CF2AC
|
||||
|
||||
+2
-2
@@ -145,7 +145,7 @@ typedef enum {
|
||||
SFX_VO_MINISH2,
|
||||
SFX_VO_MINISH3,
|
||||
SFX_VO_MINISH4,
|
||||
|
||||
|
||||
SFX_REM_SLEEP = 0xCC,
|
||||
SFX_TASK_COMPLETE,
|
||||
SFX_KEY_APPEAR,
|
||||
@@ -183,7 +183,7 @@ typedef enum {
|
||||
SFX_APPARATE,
|
||||
SFX_F8,
|
||||
SFX_TELEPORTER,
|
||||
|
||||
|
||||
SFX_ITEM_BOMB_EXPLODE = 0xFD,
|
||||
SFX_HIT,
|
||||
|
||||
|
||||
+5
-5
@@ -20,7 +20,7 @@ extern u32 __modsi3(u32, u32);
|
||||
extern void DoFade(u32, u32);
|
||||
extern u32 GetInventoryValue(u32);
|
||||
extern u32 CheckKinstoneFused(u32);
|
||||
extern void ForceEquipItem(u8, u8);
|
||||
extern void ForceEquipItem(u32, u8);
|
||||
extern void LoadRoomEntityList();
|
||||
void CopyPosition(Entity*, Entity*);
|
||||
extern void ResolveEntityOnTop(Entity*, Entity*);
|
||||
@@ -284,10 +284,10 @@ extern void sub_0801E00C();
|
||||
extern void sub_08050038(u32);
|
||||
extern void sub_080500F4(u32);
|
||||
extern void sub_08050110(u32, u32, u32, u32);
|
||||
extern u32 sub_08052734(); //has Dungeon Map?
|
||||
extern u32 sub_08052764(); //has Dungeon Compass?
|
||||
extern u32 sub_0805279C(); //has Dungeon Big Key?
|
||||
extern u32 sub_080527CC(); //num Dungeon small keys?
|
||||
extern u32 sub_08052734(); // has Dungeon Map?
|
||||
extern u32 sub_08052764(); // has Dungeon Compass?
|
||||
extern u32 sub_0805279C(); // has Dungeon Big Key?
|
||||
extern u32 sub_080527CC(); // num Dungeon small keys?
|
||||
extern u32 sub_08053FE0();
|
||||
extern void sub_08078790(Entity*, u32);
|
||||
extern void sub_080788E0(Entity*);
|
||||
|
||||
+6
-5
@@ -167,11 +167,12 @@
|
||||
#define DmaClear16Defvars(dmaNum, dest, size) DmaClearDefvars(dmaNum, dest, size, 16)
|
||||
#define DmaClear32Defvars(dmaNum, dest, size) DmaClearDefvars(dmaNum, dest, size, 32)
|
||||
|
||||
#define DmaWait(DmaNo) \
|
||||
{ \
|
||||
vu32 *(DmaCntp) = (vu32 *)REG_ADDR_DMA##DmaNo; \
|
||||
while (DmaCntp[2] & (DMA_ENABLE << 16)) ; \
|
||||
}
|
||||
#define DmaWait(DmaNo) \
|
||||
{ \
|
||||
vu32*(DmaCntp) = (vu32*)REG_ADDR_DMA##DmaNo; \
|
||||
while (DmaCntp[2] & (DMA_ENABLE << 16)) \
|
||||
; \
|
||||
}
|
||||
|
||||
#define IntrEnable(flags) \
|
||||
{ \
|
||||
|
||||
@@ -11,17 +11,18 @@
|
||||
#define RESET_REGS 0x80
|
||||
#define RESET_ALL 0xFF
|
||||
|
||||
#define SystemCall(x) { asm("svc " #x); }
|
||||
#define SystemCall(x) \
|
||||
{ asm("svc " #x); }
|
||||
|
||||
extern void SoundBiasReset();
|
||||
extern void SoundBiasSet();
|
||||
|
||||
#define Stop() \
|
||||
{ \
|
||||
SoundBiasReset(); \
|
||||
SystemCall(3); \
|
||||
SoundBiasSet(); \
|
||||
}
|
||||
#define Stop() \
|
||||
{ \
|
||||
SoundBiasReset(); \
|
||||
SystemCall(3); \
|
||||
SoundBiasSet(); \
|
||||
}
|
||||
|
||||
void SoftReset(u32 resetFlags);
|
||||
|
||||
|
||||
@@ -193,5 +193,4 @@ extern void sub_0805E0FC();
|
||||
|
||||
void (*const gManagerFunctions[58])();
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -172,7 +172,6 @@ extern void NPC58_Head(Entity*);
|
||||
|
||||
extern u32 UpdateFuseInteraction(Entity*);
|
||||
|
||||
|
||||
void (*const gNPCFunctions[128][3])(Entity*);
|
||||
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
|
||||
typedef enum {
|
||||
SAVE_BUSY = 0,
|
||||
SAVE_OK = 1,
|
||||
SAVE_OK = 1,
|
||||
SAVE_ERROR = -1,
|
||||
} SaveResult;
|
||||
|
||||
|
||||
+2
-2
@@ -31,6 +31,6 @@ extern void StartPlayerScript(u16*);
|
||||
extern void sub_0807DEDC(Entity*, ScriptExecutionContext*, u32, u32);
|
||||
|
||||
extern ScriptExecutionContext* StartCutscene(Entity*, u16*);
|
||||
extern void sub_0807DDAC(Entity*, void(*function)(Entity*, ScriptExecutionContext*));
|
||||
extern void sub_0807DD94(Entity*, void(*function)(Entity*, ScriptExecutionContext*));
|
||||
extern void sub_0807DDAC(Entity*, void (*function)(Entity*, ScriptExecutionContext*));
|
||||
extern void sub_0807DD94(Entity*, void (*function)(Entity*, ScriptExecutionContext*));
|
||||
#endif
|
||||
|
||||
@@ -392,7 +392,7 @@ SECTIONS {
|
||||
asm/mazaalHand.o(.text);
|
||||
asm/octorokBoss.o(.text);
|
||||
asm/flyingPot.o(.text);
|
||||
asm/gibdo.o(.text);
|
||||
src/enemy/gibdo.o(.text);
|
||||
asm/octorokGolden.o(.text);
|
||||
src/enemy/tektiteGolden.o(.text);
|
||||
asm/ropeGolden.o(.text);
|
||||
@@ -627,7 +627,7 @@ SECTIONS {
|
||||
src/npc/mayorHagen.o(.text);
|
||||
src/npc/bigGoron.o(.text);
|
||||
asm/bigGoron.o(.text);
|
||||
asm/ezloCap.o(.text);
|
||||
src/ezloCap.o(.text);
|
||||
asm/npc4E.o(.text);
|
||||
src/npc/clothesRack.o(.text);
|
||||
asm/clothesRack.o(.text);
|
||||
|
||||
@@ -0,0 +1,419 @@
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "sprite.h"
|
||||
#include "functions.h"
|
||||
#include "enemy.h"
|
||||
// Gibudo
|
||||
void sub_08037794();
|
||||
void sub_08037B10();
|
||||
void sub_0803797C();
|
||||
void sub_080379BC();
|
||||
void sub_08037C0C();
|
||||
u32 sub_08037810();
|
||||
void sub_080377B0();
|
||||
u32 sub_080378B0();
|
||||
u32 sub_08037914();
|
||||
u32 sub_080379EC();
|
||||
void sub_08037A58();
|
||||
void sub_08037ACC();
|
||||
void sub_08037B48();
|
||||
void sub_08037A14();
|
||||
|
||||
extern void sub_0804A4E4(Entity*, Entity*);
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
u32 sub_0804A044(Entity*, Entity*, u32);
|
||||
extern void sub_0800449C(Entity*, u32);
|
||||
|
||||
extern void (*const gGibdo[6])(Entity*);
|
||||
extern void (*const gUnk_080CF2AC[9])(Entity*);
|
||||
extern Entity* gUnk_020000B0;
|
||||
|
||||
void Gibdo(Entity* this) {
|
||||
EnemyFunctionHandler(this, gGibdo);
|
||||
SetChildOffset(this, 0, 1, -0x15);
|
||||
}
|
||||
|
||||
void Gibdo_OnTick(Entity* this) {
|
||||
gUnk_080CF2AC[this->action](this);
|
||||
}
|
||||
// Non-matching
|
||||
NONMATCH("asm/non_matching/gibdo/sub_080374A4.inc", void sub_080374A4(Entity* this)) {
|
||||
u8 x;
|
||||
if (this->bitfield == 0x87) {
|
||||
if (this->action == 0x6) {
|
||||
sub_08037ACC(this);
|
||||
}
|
||||
this->action = 0x8;
|
||||
this->actionDelay = 0x3c;
|
||||
this->flags &= 0x7F;
|
||||
sub_08037B48(this);
|
||||
} else {
|
||||
if (this->action != 0x6) {
|
||||
if (this->damageType == 0x27) {
|
||||
if (this->bitfield == 0x80) {
|
||||
sub_08037A14(this);
|
||||
}
|
||||
} else {
|
||||
if ((u8)(this->action - 1) < 2) {
|
||||
this->action = 1;
|
||||
x = DirectionTurnAround(this->field_0x3e);
|
||||
this->direction = x;
|
||||
this->animationState = x >> 3;
|
||||
InitAnimationForceUpdate(this, this->animationState);
|
||||
if (sub_08037810(this) != 0) {
|
||||
this->actionDelay = 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sub_08037A58(this);
|
||||
}
|
||||
}
|
||||
if (this->field_0x43 != 0) {
|
||||
sub_0804A9FC(this, 0x1c);
|
||||
}
|
||||
sub_0804AA30(this, gGibdo);
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void nullsub_162() {
|
||||
}
|
||||
|
||||
void sub_08037558(Entity* this) {
|
||||
sub_0804A720(this);
|
||||
this->animationState = Random() & 0x3;
|
||||
this->field_0x76.HALF.LO = 0;
|
||||
this->field_0x76.HALF.HI = 0;
|
||||
sub_08037794(this);
|
||||
}
|
||||
|
||||
void sub_08037580(Entity* this) {
|
||||
if (sub_08037810(this) == 0) {
|
||||
if (!(--this->field_0x74.HWORD)) {
|
||||
sub_080377B0(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080375A4(Entity* this) {
|
||||
if (sub_080378B0(this) == 0) {
|
||||
if (sub_08037810(this) == 0) {
|
||||
if (!(--this->field_0x74.HWORD)) {
|
||||
sub_08037794(this);
|
||||
} else {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (ProcessMovement(this) == 0) {
|
||||
if (!(--this->field_0xf)) {
|
||||
sub_080379BC(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080375F8(Entity* this) {
|
||||
if (sub_080378B0(this) == 0) {
|
||||
if (!(--this->actionDelay)) {
|
||||
this->action = 4;
|
||||
this->actionDelay = 0x18;
|
||||
InitAnimationForceUpdate(this, this->animationState + 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08037624(Entity* this) {
|
||||
if (sub_080378B0(this) == 0) {
|
||||
if (sub_08037914(this) == 0) {
|
||||
if (!(--this->field_0x74.HWORD)) {
|
||||
sub_08037794(this);
|
||||
} else {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (ProcessMovement(this) == 0) {
|
||||
if (!(--this->field_0xf)) {
|
||||
sub_080379BC(this);
|
||||
}
|
||||
} else {
|
||||
if (!(--this->actionDelay)) {
|
||||
sub_0803797C(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08037690(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->field_0x76.HALF.HI = 0x14;
|
||||
sub_08037794(this);
|
||||
} else {
|
||||
if ((this->frames.all & 1) != 0) {
|
||||
this->damageType = 0x27;
|
||||
ProcessMovement(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Non-matching
|
||||
NONMATCH("asm/non_matching/gibdo/sub_080376D0.inc", void sub_080376D0(Entity* this)) {
|
||||
u8* x;
|
||||
if (sub_080379EC(this) == 0) {
|
||||
ResetPlayer();
|
||||
gPlayerState.field_0x1a[0] = gPlayerState.field_0x1a[0] | 0x80;
|
||||
gPlayerState.field_0xa = gPlayerState.field_0xa | 0x80;
|
||||
CopyPositionAndSpriteOffset(&gPlayerEntity, this);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
x = &this->frames.all;
|
||||
if ((*x & 0x1) != 0) {
|
||||
if (!(--this->field_0x7c.BYTES.byte0)) {
|
||||
sub_08037A58(this);
|
||||
}
|
||||
} else {
|
||||
*x = *x ^ 1;
|
||||
sub_08037B10(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_0803773C(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
sub_08037794(this);
|
||||
}
|
||||
}
|
||||
// Turn into Stalfos
|
||||
void sub_0803775C(Entity* this) {
|
||||
Entity* x;
|
||||
if (!(--this->actionDelay)) {
|
||||
x = CreateEnemy(0x42, 0);
|
||||
if (x != 0) {
|
||||
sub_0804A4E4(this, x);
|
||||
sub_08037C0C(this, x);
|
||||
}
|
||||
DeleteEntity(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08037794(Entity* this) {
|
||||
this->action = 1;
|
||||
this->field_0x74.HWORD = 0x1e;
|
||||
this->damageType = 0x26;
|
||||
InitAnimationForceUpdate(this, this->animationState);
|
||||
}
|
||||
|
||||
void sub_080377B0(Entity* this) {
|
||||
u32 r1;
|
||||
u32 r2;
|
||||
this->action = 2;
|
||||
this->field_0xf = 8;
|
||||
r1 = Random();
|
||||
this->field_0x74.HWORD = (r1 & 0x38) + 0x78;
|
||||
this->nonPlanarMovement = 0x40;
|
||||
r2 = Random();
|
||||
if (!sub_08049FA0(this) && (r2 & 3)) {
|
||||
this->direction = DirectionRoundUp(sub_08049EE4(this));
|
||||
} else {
|
||||
this->direction = DirectionRound(r2);
|
||||
}
|
||||
this->animationState = this->direction / 8;
|
||||
InitAnimationForceUpdate(this, this->animationState + 4);
|
||||
}
|
||||
// Nonmatching
|
||||
NONMATCH("asm/non_matching/gibdo/sub_08037810.inc", u32 sub_08037810(Entity* this)) {
|
||||
u32 x;
|
||||
u32 y;
|
||||
if (this->field_0x76.HALF.LO == 0) {
|
||||
if (sub_08049FDC(this, 1) != 0) {
|
||||
if (sub_0806FCB8(this, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI, 0x40) != 0) {
|
||||
x = GetFacingDirection(this, gUnk_020000B0);
|
||||
if (((x - this->direction + 6) & 0x1f) <= 0xc) {
|
||||
this->action = 3;
|
||||
this->actionDelay = 0x18;
|
||||
this->field_0xf = 0x8;
|
||||
this->nonPlanarMovement = 0xc0;
|
||||
y = DirectionRoundUp(GetFacingDirection(this, gUnk_020000B0));
|
||||
this->direction = y;
|
||||
this->animationState = y / 8;
|
||||
this->field_0x74.HWORD = 300;
|
||||
this->field_0x78.HWORD = gUnk_020000B0->x.HALF.HI;
|
||||
this->field_0x7a.HWORD = gUnk_020000B0->y.HALF.HI;
|
||||
InitAnimationForceUpdate(this, this->animationState);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->field_0x76.HALF.LO--;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
u32 sub_080378B0(Entity* this) {
|
||||
if (this->field_0x76.HALF.HI == 0) {
|
||||
if (sub_08049DF4(1) != 0) {
|
||||
if (sub_0804A044(this, gUnk_020000B0, 0xa) == this->direction)
|
||||
if (sub_0806FCB8(this, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI, 0x18) != 0) {
|
||||
this->action = 5;
|
||||
this->nonPlanarMovement = 0x100;
|
||||
InitAnimationForceUpdate(this, this->animationState + 8);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->field_0x76.HALF.HI--;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 sub_08037914(Entity* this) {
|
||||
if (sub_08049FDC(this, 1) != 0) {
|
||||
if (sub_0806FCB8(gUnk_020000B0, this->field_0x78.HWORD, this->field_0x7a.HWORD, 0x28) == 0) {
|
||||
this->field_0x78.HWORD = gUnk_020000B0->x.HALF_U.HI;
|
||||
this->field_0x7a.HWORD = gUnk_020000B0->y.HALF_U.HI;
|
||||
sub_0803797C(this);
|
||||
return 0;
|
||||
}
|
||||
if (sub_0806FCB8(this, this->field_0x78.HWORD, this->field_0x7a.HWORD, 0x8) == 0) {
|
||||
return 0;
|
||||
}
|
||||
this->field_0x76.HALF.LO = 0x3c;
|
||||
}
|
||||
sub_08037794(this);
|
||||
return 1;
|
||||
}
|
||||
NONMATCH("asm/non_matching/gibdo/sub_0803797C.inc", void sub_0803797C(Entity* this)) {
|
||||
u32 z;
|
||||
u32 m;
|
||||
this->actionDelay = 0x18;
|
||||
this->field_0xf = 0x8;
|
||||
z = sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, this->field_0x78.HWORD, this->field_0x7a.HWORD);
|
||||
m = (z + 4) & 0x18;
|
||||
this->direction = m;
|
||||
m = m / 8;
|
||||
if (m != this->animationState) {
|
||||
this->animationState = m;
|
||||
InitAnimationForceUpdate(this, m + 4);
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_080379BC(Entity* this) {
|
||||
u32 r;
|
||||
this->actionDelay = 0x18;
|
||||
this->field_0xf = 0x8;
|
||||
r = Random();
|
||||
this->animationState = ((this->animationState + (r & 2)) - 1) & 3;
|
||||
this->direction = DirectionFromAnimationState(this->animationState);
|
||||
InitAnimationForceUpdate(this, this->animationState + 4);
|
||||
}
|
||||
|
||||
u32 sub_080379EC(Entity* this) {
|
||||
if (sub_0807953C() != 0) {
|
||||
if (!(--this->actionDelay)) {
|
||||
sub_08037A58(this);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_08037A14(Entity* this) {
|
||||
this->action = 6;
|
||||
this->actionDelay = 0x18;
|
||||
this->spritePriority.b0 = (this->spritePriority.b0 & (this->actionDelay - 0x20));
|
||||
this->spritePriority.b0 |= 3;
|
||||
this->flags2 &= 0xfe;
|
||||
this->field_0x7c.BYTES.byte0 = 5;
|
||||
CopyPosition(this, this->field_0x4c);
|
||||
InitAnimationForceUpdate(this, this->animationState + 0xc);
|
||||
}
|
||||
// Not match
|
||||
// Take Damage maybe?
|
||||
NONMATCH("asm/non_matching/gibdo/sub_08037A58.inc", void sub_08037A58(Entity* this)) {
|
||||
sub_08037ACC(this);
|
||||
this->action = 7;
|
||||
this->spritePriority.b0 = (this->spritePriority.b0 & 0xf8) | 4;
|
||||
if (this->hurtBlinkTime == 0) {
|
||||
this->hurtBlinkTime = 0xec;
|
||||
}
|
||||
this->damageType = 0x26;
|
||||
this->flags2 |= 1;
|
||||
this->hurtBlinkTime = 0xf4;
|
||||
this->field_0x3e = (this->animationState << 3) ^ 0x10;
|
||||
this->field_0x42 = 8;
|
||||
this->field_0x46 = 0x180;
|
||||
this->field_0x76.HALF.LO = 0x3c;
|
||||
InitAnimationForceUpdate(this, this->animationState + 0x10);
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_08037ACC(Entity* this) {
|
||||
gPlayerState.flags.all &= 0xFFFFFEFF;
|
||||
gPlayerEntity.flags |= 0x80;
|
||||
gPlayerEntity.hurtBlinkTime = 0x1e;
|
||||
gPlayerEntity.field_0x3e = DirectionFromAnimationState(this->animationState);
|
||||
gPlayerEntity.field_0x42 = 4;
|
||||
gPlayerEntity.field_0x46 = 0x180;
|
||||
}
|
||||
// Damage player maybe?
|
||||
void sub_08037B10(Entity* this) {
|
||||
u32 h;
|
||||
gPlayerEntity.hurtBlinkTime = 0xc;
|
||||
h = ModHealth(-8);
|
||||
sub_0800449C(&gPlayerEntity, 0x7a);
|
||||
if (h == 0) {
|
||||
sub_08037A58(this);
|
||||
this->field_0x76.HALF.LO = 0xf0;
|
||||
}
|
||||
}
|
||||
NONMATCH("asm/non_matching/gibdo/sub_08037B48.inc", void sub_08037B48(Entity* this)) {
|
||||
Entity* E;
|
||||
E = CreateObject(0x2a, 3, 0);
|
||||
if (E != 0) {
|
||||
E->entityType.parameter = this->actionDelay;
|
||||
E->spritePriority.b0 = (E->spritePriority.b0 & 0xf8) | 3;
|
||||
E->spriteOffsetX = 0;
|
||||
E->spriteOffsetY = 0xfc;
|
||||
E->parent = this;
|
||||
}
|
||||
*(Entity**)&this->field_0x80.HWORD = E;
|
||||
E = CreateObject(0x2a, 3, 0);
|
||||
if (E != 0) {
|
||||
E->entityType.parameter = this->actionDelay;
|
||||
E->spritePriority.b0 = (E->spritePriority.b0 & 0xf8) | 3;
|
||||
E->spriteOffsetX = 0xfd;
|
||||
E->spriteOffsetY = 0xf8;
|
||||
E->parent = this;
|
||||
}
|
||||
*(Entity**)&this->cutsceneBeh.HWORD = E;
|
||||
E = CreateObject(0x2a, 3, 0);
|
||||
if (E != 0) {
|
||||
E->entityType.parameter = this->actionDelay;
|
||||
E->spritePriority.b0 = (E->spritePriority.b0 & 0xf8) | 3;
|
||||
E->spriteOffsetX = 0x5;
|
||||
E->spriteOffsetY = 0xf5;
|
||||
E->parent = this;
|
||||
}
|
||||
this->attachedEntity = E;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
NONMATCH("asm/non_matching/gibdo/sub_08037C0C.inc", void sub_08037C0C(Entity* this, Entity* that)) {
|
||||
if (this->field_0x80.HWORD != 0) {
|
||||
this->actionDelay = 0xf;
|
||||
this->parent = that;
|
||||
}
|
||||
if (this->cutsceneBeh.HWORD != 0) {
|
||||
this->actionDelay = 0xf;
|
||||
this->parent = that;
|
||||
}
|
||||
if (this->attachedEntity != 0) {
|
||||
this->actionDelay = 0xf;
|
||||
this->parent = that;
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
+156
-258
@@ -7,19 +7,19 @@
|
||||
#include "functions.h"
|
||||
#include "fileScreen.h"
|
||||
|
||||
void (* const gUnk_080D1AFC[8])(Entity*);
|
||||
void (* const gUnk_080D1B1C[7])(Entity*);
|
||||
void (* const gUnk_080D1B38[5])(Entity*);
|
||||
void (* const gUnk_080D1B4C[5])(Entity*);
|
||||
void (*const gUnk_080D1AFC[8])(Entity*);
|
||||
void (*const gUnk_080D1B1C[7])(Entity*);
|
||||
void (*const gUnk_080D1B38[5])(Entity*);
|
||||
void (*const gUnk_080D1B4C[5])(Entity*);
|
||||
const u16 gUnk_080D1B60[8];
|
||||
const s16 gUnk_080D1B70[2];//or 3?
|
||||
const s16 gUnk_080D1B70[2]; // or 3?
|
||||
const u16 gUnk_080D1B74[0x10];
|
||||
void (* const gUnk_080D1B94[0xA])(Entity*);
|
||||
void (*const gUnk_080D1B94[0xA])(Entity*);
|
||||
const u16 gUnk_080D1BBC[2];
|
||||
void (* const gUnk_080D1BC0[7])(Entity*);
|
||||
void (* const gUnk_080D1BDC[5])(Entity*);
|
||||
void (*const gUnk_080D1BC0[7])(Entity*);
|
||||
void (*const gUnk_080D1BDC[5])(Entity*);
|
||||
const s16 gUnk_080D1BF0[2];
|
||||
void (* const gUnk_080D1BF4[3])(Entity*);
|
||||
void (*const gUnk_080D1BF4[3])(Entity*);
|
||||
const s8 gUnk_080D1C00[4];
|
||||
const u16 gUnk_080D1C04[0x20];
|
||||
const u8 gUnk_080D1C44[0xC];
|
||||
@@ -27,77 +27,69 @@ const u16 gUnk_080D1C50[8];
|
||||
const u16 gUnk_080D1C60[8];
|
||||
|
||||
void GyorgMale(Entity*);
|
||||
void sub_08046898(Entity*);//action 0
|
||||
void sub_08046910(Entity*);//action 1
|
||||
void sub_08046930(Entity*);//action 1 previousActionFlag 0
|
||||
void sub_0804696C(Entity*);//action 1 previousActionFlag 1
|
||||
void sub_080469CC(Entity*);//action 1 previousActionFlag 2
|
||||
void sub_080469F4(Entity*);//action 1 previousActionFlag 3
|
||||
void sub_08046A30(Entity*);//action 1 previousActionFlag 4
|
||||
void sub_08046A54(Entity*);//action 1 previousActionFlag 5
|
||||
void sub_08046A78(Entity*);//action 1 previousActionFlag 6
|
||||
void sub_08046A9C(Entity*);//action 2
|
||||
void sub_08046AE8(Entity*);//action 2 previousActionFlag 0
|
||||
void sub_08046B18(Entity*);//action 2 previousActionFlag 1
|
||||
void sub_08046B8C(Entity*);//action 2 previousActionFlag 2
|
||||
void sub_08046C04(Entity*);//action 2 previousActionFlag 3
|
||||
void sub_08046C88(Entity*);//action 2 previousActionFlag 4
|
||||
void sub_08046CEC(Entity*);//action 3
|
||||
void sub_08046D44(Entity*);//action 3 previousActionFlag 0
|
||||
void sub_08046D98(Entity*);//action 3 previousActionFlag 1
|
||||
void sub_08046E0C(Entity*);//action 3 previousActionFlag 2
|
||||
void sub_08046E68(Entity*);//action 3 previousActionFlag 3
|
||||
void sub_08046EF4(Entity*);//action 3 previousActionFlag 4
|
||||
void sub_08046F64(Entity*);//action 4
|
||||
void sub_08046FE8(Entity*);//action 4 previousActionFlag 0
|
||||
void sub_0804702C(Entity*);//action 4 previousActionFlag 1
|
||||
void sub_080470B4(Entity*);//action 4 previousActionFlag 2
|
||||
void sub_08047140(Entity*);//action 4 previousActionFlag 3
|
||||
void sub_0804717C(Entity*);//action 4 previousActionFlag 4
|
||||
void sub_080471C8(Entity*);//action 4 previousActionFlag 5
|
||||
void sub_0804723C(Entity*);//action 4 previousActionFlag 6
|
||||
void sub_08047284(Entity*);//action 4 previousActionFlag 7
|
||||
void sub_080472BC(Entity*);//action 4 previousActionFlag 8
|
||||
void sub_08047310(Entity*);//action 4 previousActionFlag 9
|
||||
void sub_0804736C(Entity*);//action 5
|
||||
void sub_080473B8(Entity*);//action 5 previousActionFlag 0
|
||||
void sub_080473F0(Entity*);//action 5 previousActionFlag 1
|
||||
void sub_08047484(Entity*);//action 5 previousActionFlag 2
|
||||
void sub_08047508(Entity*);//action 5 previousActionFlag 3
|
||||
void sub_080475F4(Entity*);//action 5 previousActionFlag 4
|
||||
void sub_0804763C(Entity*);//action 5 previousActionFlag 5
|
||||
void sub_0804772C(Entity*);//action 5 previousActionFlag 6
|
||||
void sub_08047778(Entity*);//action 6
|
||||
void sub_08047798(Entity*);//action 6 previousActionFlag 0
|
||||
void sub_080477F0(Entity*);//action 6 previousActionFlag 1
|
||||
void sub_08047914(Entity*);//action 6 previousActionFlag 2
|
||||
void sub_08047978(Entity*);//action 6 previousActionFlag 3
|
||||
void sub_08047B08(Entity*);//action 6 previousActionFlag 4
|
||||
void sub_08047B84(Entity*);//action 7
|
||||
void sub_08047BA4(Entity*);//action 7 previousActionFlag 0
|
||||
void sub_08047BF0(Entity*);//action 7 previousActionFlag 1, also called elsewhere
|
||||
void sub_08047D24(Entity*);//action 7 previousActionFlag 2
|
||||
void sub_08047D88(Entity*);//
|
||||
void sub_08046898(Entity*); // action 0
|
||||
void sub_08046910(Entity*); // action 1
|
||||
void sub_08046930(Entity*); // action 1 previousActionFlag 0
|
||||
void sub_0804696C(Entity*); // action 1 previousActionFlag 1
|
||||
void sub_080469CC(Entity*); // action 1 previousActionFlag 2
|
||||
void sub_080469F4(Entity*); // action 1 previousActionFlag 3
|
||||
void sub_08046A30(Entity*); // action 1 previousActionFlag 4
|
||||
void sub_08046A54(Entity*); // action 1 previousActionFlag 5
|
||||
void sub_08046A78(Entity*); // action 1 previousActionFlag 6
|
||||
void sub_08046A9C(Entity*); // action 2
|
||||
void sub_08046AE8(Entity*); // action 2 previousActionFlag 0
|
||||
void sub_08046B18(Entity*); // action 2 previousActionFlag 1
|
||||
void sub_08046B8C(Entity*); // action 2 previousActionFlag 2
|
||||
void sub_08046C04(Entity*); // action 2 previousActionFlag 3
|
||||
void sub_08046C88(Entity*); // action 2 previousActionFlag 4
|
||||
void sub_08046CEC(Entity*); // action 3
|
||||
void sub_08046D44(Entity*); // action 3 previousActionFlag 0
|
||||
void sub_08046D98(Entity*); // action 3 previousActionFlag 1
|
||||
void sub_08046E0C(Entity*); // action 3 previousActionFlag 2
|
||||
void sub_08046E68(Entity*); // action 3 previousActionFlag 3
|
||||
void sub_08046EF4(Entity*); // action 3 previousActionFlag 4
|
||||
void sub_08046F64(Entity*); // action 4
|
||||
void sub_08046FE8(Entity*); // action 4 previousActionFlag 0
|
||||
void sub_0804702C(Entity*); // action 4 previousActionFlag 1
|
||||
void sub_080470B4(Entity*); // action 4 previousActionFlag 2
|
||||
void sub_08047140(Entity*); // action 4 previousActionFlag 3
|
||||
void sub_0804717C(Entity*); // action 4 previousActionFlag 4
|
||||
void sub_080471C8(Entity*); // action 4 previousActionFlag 5
|
||||
void sub_0804723C(Entity*); // action 4 previousActionFlag 6
|
||||
void sub_08047284(Entity*); // action 4 previousActionFlag 7
|
||||
void sub_080472BC(Entity*); // action 4 previousActionFlag 8
|
||||
void sub_08047310(Entity*); // action 4 previousActionFlag 9
|
||||
void sub_0804736C(Entity*); // action 5
|
||||
void sub_080473B8(Entity*); // action 5 previousActionFlag 0
|
||||
void sub_080473F0(Entity*); // action 5 previousActionFlag 1
|
||||
void sub_08047484(Entity*); // action 5 previousActionFlag 2
|
||||
void sub_08047508(Entity*); // action 5 previousActionFlag 3
|
||||
void sub_080475F4(Entity*); // action 5 previousActionFlag 4
|
||||
void sub_0804763C(Entity*); // action 5 previousActionFlag 5
|
||||
void sub_0804772C(Entity*); // action 5 previousActionFlag 6
|
||||
void sub_08047778(Entity*); // action 6
|
||||
void sub_08047798(Entity*); // action 6 previousActionFlag 0
|
||||
void sub_080477F0(Entity*); // action 6 previousActionFlag 1
|
||||
void sub_08047914(Entity*); // action 6 previousActionFlag 2
|
||||
void sub_08047978(Entity*); // action 6 previousActionFlag 3
|
||||
void sub_08047B08(Entity*); // action 6 previousActionFlag 4
|
||||
void sub_08047B84(Entity*); // action 7
|
||||
void sub_08047BA4(Entity*); // action 7 previousActionFlag 0
|
||||
void sub_08047BF0(Entity*); // action 7 previousActionFlag 1, also called elsewhere
|
||||
void sub_08047D24(Entity*); // action 7 previousActionFlag 2
|
||||
void sub_08047D88(Entity*); //
|
||||
void sub_08047DF0(Entity*, u32);
|
||||
void sub_08047E48(Entity*);//
|
||||
void sub_08047E58(Entity*);//
|
||||
void sub_08047E48(Entity*); //
|
||||
void sub_08047E58(Entity*); //
|
||||
void sub_08047EA4(Entity*, u32);
|
||||
u32 sub_08047F68(Entity*);//distance this to player?
|
||||
void sub_08048004(Entity*);//
|
||||
void sub_0804813C(Entity*);//
|
||||
u32 sub_08047F68(Entity*); // distance this to player?
|
||||
void sub_08048004(Entity*); //
|
||||
void sub_0804813C(Entity*); //
|
||||
u32 sub_08048158(u32);
|
||||
void sub_08048178(Entity*, u32);
|
||||
|
||||
void (* const gUnk_080D1AFC[8])(Entity*) = {
|
||||
sub_08046898,
|
||||
sub_08046910,
|
||||
sub_08046A9C,
|
||||
sub_08046CEC,
|
||||
sub_08046F64,
|
||||
sub_0804736C,
|
||||
sub_08047778,
|
||||
sub_08047B84
|
||||
};
|
||||
void (*const gUnk_080D1AFC[8])(Entity*) = { sub_08046898, sub_08046910, sub_08046A9C, sub_08046CEC,
|
||||
sub_08046F64, sub_0804736C, sub_08047778, sub_08047B84 };
|
||||
|
||||
void GyorgMale(Entity* this) {
|
||||
if (this->action) {
|
||||
@@ -120,7 +112,8 @@ void GyorgMale(Entity* this) {
|
||||
void sub_08046898(Entity* this) {
|
||||
Entity* tmp = sub_080A7EE0(0x22);
|
||||
u32 tmp2;
|
||||
if (!tmp) return;
|
||||
if (!tmp)
|
||||
return;
|
||||
tmp->entityType.form = 1;
|
||||
tmp->parent = this;
|
||||
this->attachedEntity = tmp;
|
||||
@@ -139,15 +132,8 @@ void sub_08046898(Entity* this) {
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
}
|
||||
|
||||
void (* const gUnk_080D1B1C[7])(Entity*) = {
|
||||
sub_08046930,
|
||||
sub_0804696C,
|
||||
sub_080469CC,
|
||||
sub_080469F4,
|
||||
sub_08046A30,
|
||||
sub_08046A54,
|
||||
sub_08046A78
|
||||
};
|
||||
void (*const gUnk_080D1B1C[7])(Entity*) = { sub_08046930, sub_0804696C, sub_080469CC, sub_080469F4,
|
||||
sub_08046A30, sub_08046A54, sub_08046A78 };
|
||||
|
||||
void sub_08046910(Entity* this) {
|
||||
gUnk_080D1B1C[this->previousActionFlag](this);
|
||||
@@ -161,7 +147,8 @@ void sub_08046930(Entity* this) {
|
||||
this->nonPlanarMovement = 0x280;
|
||||
}
|
||||
sub_08047D88(this);
|
||||
if (this->field_0x7c.BYTES.byte0 == 0) return;
|
||||
if (this->field_0x7c.BYTES.byte0 == 0)
|
||||
return;
|
||||
this->previousActionFlag = 1;
|
||||
this->actionDelay = 1;
|
||||
this->animationState = 0;
|
||||
@@ -206,7 +193,7 @@ void sub_080469F4(Entity* this) {
|
||||
|
||||
void sub_08046A30(Entity* this) {
|
||||
sub_08047D88(this);
|
||||
if (((Entity*) this->otherEntity)->prev->field_0x6c.HWORD & 1) {
|
||||
if (((Entity*)this->otherEntity)->prev->field_0x6c.HWORD & 1) {
|
||||
this->action = 2;
|
||||
this->previousActionFlag = 0;
|
||||
}
|
||||
@@ -221,19 +208,13 @@ void sub_08046A54(Entity* this) {
|
||||
|
||||
void sub_08046A78(Entity* this) {
|
||||
sub_08047D88(this);
|
||||
if (((Entity*) this->otherEntity)->prev->field_0x6c.HWORD & 0x10) {
|
||||
if (((Entity*)this->otherEntity)->prev->field_0x6c.HWORD & 0x10) {
|
||||
this->action = 3;
|
||||
this->previousActionFlag = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void (* const gUnk_080D1B38[5])(Entity*) = {
|
||||
sub_08046AE8,
|
||||
sub_08046B18,
|
||||
sub_08046B8C,
|
||||
sub_08046C04,
|
||||
sub_08046C88
|
||||
};
|
||||
void (*const gUnk_080D1B38[5])(Entity*) = { sub_08046AE8, sub_08046B18, sub_08046B8C, sub_08046C04, sub_08046C88 };
|
||||
|
||||
void sub_08046A9C(Entity* this) {
|
||||
if (this->animIndex == 1) {
|
||||
@@ -252,7 +233,7 @@ void sub_08046A9C(Entity* this) {
|
||||
void sub_08046AE8(Entity* this) {
|
||||
this->previousActionFlag = 1;
|
||||
this->nonPlanarMovement = 0x180;
|
||||
sub_08048178(this, ((Entity*) this->otherEntity)->next->animationState >> 5);
|
||||
sub_08048178(this, ((Entity*)this->otherEntity)->next->animationState >> 5);
|
||||
this->field_0x76.HWORD = this->direction << 8;
|
||||
sub_08047D88(this);
|
||||
}
|
||||
@@ -281,7 +262,8 @@ void sub_08046B8C(Entity* this) {
|
||||
this->field_0x82.HWORD = gRoomControls.roomOriginY + 0x210;
|
||||
sub_08047D88(this);
|
||||
} else {
|
||||
this->direction = sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI);
|
||||
this->direction =
|
||||
sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI);
|
||||
sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8);
|
||||
}
|
||||
}
|
||||
@@ -309,18 +291,13 @@ void sub_08046C88(Entity* this) {
|
||||
sub_08048178(this, sub_08048158(this->field_0x70.HALF_U.LO));
|
||||
sub_08047D88(this);
|
||||
} else {
|
||||
this->direction = sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI);
|
||||
this->direction =
|
||||
sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI);
|
||||
sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8);
|
||||
}
|
||||
}
|
||||
|
||||
void (* const gUnk_080D1B4C[5])(Entity*) = {
|
||||
sub_08046D44,
|
||||
sub_08046D98,
|
||||
sub_08046E0C,
|
||||
sub_08046E68,
|
||||
sub_08046EF4
|
||||
};
|
||||
void (*const gUnk_080D1B4C[5])(Entity*) = { sub_08046D44, sub_08046D98, sub_08046E0C, sub_08046E68, sub_08046EF4 };
|
||||
|
||||
void sub_08046CEC(Entity* this) {
|
||||
if (this->animIndex == 0) {
|
||||
@@ -330,29 +307,20 @@ void sub_08046CEC(Entity* this) {
|
||||
}
|
||||
gUnk_080D1B4C[this->previousActionFlag](this);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (((Entity*) this->otherEntity)->prev->field_0x6c.HWORD & 2) {
|
||||
if (((Entity*)this->otherEntity)->prev->field_0x6c.HWORD & 2) {
|
||||
this->action = 2;
|
||||
this->previousActionFlag = 0;
|
||||
this->animationState = this->nonPlanarMovement;
|
||||
}
|
||||
}
|
||||
|
||||
const u16 gUnk_080D1B60[8] = {
|
||||
0x200,
|
||||
0x184,
|
||||
0x28C,
|
||||
0x210,
|
||||
0x200,
|
||||
0x29C,
|
||||
0x174,
|
||||
0x210
|
||||
};
|
||||
const u16 gUnk_080D1B60[8] = { 0x200, 0x184, 0x28C, 0x210, 0x200, 0x29C, 0x174, 0x210 };
|
||||
|
||||
void sub_08046D44(Entity* this) {
|
||||
const u16 * tmp;
|
||||
const u16* tmp;
|
||||
this->previousActionFlag = 1;
|
||||
this->nonPlanarMovement = 0x200;
|
||||
tmp = gUnk_080D1B60 + (((Entity*) this->otherEntity)->next->animationState >> 5);
|
||||
tmp = gUnk_080D1B60 + (((Entity*)this->otherEntity)->next->animationState >> 5);
|
||||
this->field_0x80.HWORD = tmp[0] + gRoomControls.roomOriginX;
|
||||
this->field_0x82.HWORD = tmp[1] + gRoomControls.roomOriginY;
|
||||
this->field_0x76.HWORD = this->direction << 8;
|
||||
@@ -381,18 +349,16 @@ void sub_08046E0C(Entity* this) {
|
||||
this->field_0x76.HWORD = this->direction << 8;
|
||||
sub_08047D88(this);
|
||||
} else {
|
||||
this->direction = sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI);
|
||||
this->direction =
|
||||
sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI);
|
||||
sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8);
|
||||
}
|
||||
}
|
||||
|
||||
const s16 gUnk_080D1B70[2] = {
|
||||
0x40,
|
||||
-0x40
|
||||
};
|
||||
const s16 gUnk_080D1B70[2] = { 0x40, -0x40 };
|
||||
|
||||
void sub_08046E68(Entity* this) {
|
||||
u32 tmp = ((Entity*) this->otherEntity)->next->animationState ^ 0x80;
|
||||
u32 tmp = ((Entity*)this->otherEntity)->next->animationState ^ 0x80;
|
||||
if (tmp != this->direction) {
|
||||
if (((tmp - this->direction) & 0xFF) > 0x80) {
|
||||
this->field_0x76.HWORD -= 0x100;
|
||||
@@ -411,24 +377,8 @@ void sub_08046E68(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
const u16 gUnk_080D1B74[0x10] = {
|
||||
0x20,
|
||||
0x40,
|
||||
0x60,
|
||||
0x80,
|
||||
0xA0,
|
||||
0xC0,
|
||||
0xE0,
|
||||
0x100,
|
||||
0x100,
|
||||
0xE0,
|
||||
0xC0,
|
||||
0xA0,
|
||||
0x80,
|
||||
0x60,
|
||||
0x40,
|
||||
0x20
|
||||
};
|
||||
const u16 gUnk_080D1B74[0x10] = { 0x20, 0x40, 0x60, 0x80, 0xA0, 0xC0, 0xE0, 0x100,
|
||||
0x100, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20 };
|
||||
|
||||
void sub_08046EF4(Entity* this) {
|
||||
if (--this->actionDelay == 0) {
|
||||
@@ -449,18 +399,8 @@ void sub_08046EF4(Entity* this) {
|
||||
sub_08047E48(this);
|
||||
}
|
||||
|
||||
void (* const gUnk_080D1B94[0xA])(Entity*) = {
|
||||
sub_08046FE8,
|
||||
sub_0804702C,
|
||||
sub_080470B4,
|
||||
sub_08047140,
|
||||
sub_0804717C,
|
||||
sub_080471C8,
|
||||
sub_0804723C,
|
||||
sub_08047284,
|
||||
sub_080472BC,
|
||||
sub_08047310
|
||||
};
|
||||
void (*const gUnk_080D1B94[0xA])(Entity*) = { sub_08046FE8, sub_0804702C, sub_080470B4, sub_08047140, sub_0804717C,
|
||||
sub_080471C8, sub_0804723C, sub_08047284, sub_080472BC, sub_08047310 };
|
||||
|
||||
void sub_08046F64(Entity* this) {
|
||||
if (this->animIndex == 0) {
|
||||
@@ -480,7 +420,7 @@ void sub_08046F64(Entity* this) {
|
||||
UpdateSpriteForCollisionLayer(tmp);
|
||||
}
|
||||
}
|
||||
if (((Entity*) this->otherEntity)->prev->field_0x6c.HWORD & 4) {
|
||||
if (((Entity*)this->otherEntity)->prev->field_0x6c.HWORD & 4) {
|
||||
this->action = 5;
|
||||
this->previousActionFlag = 0;
|
||||
}
|
||||
@@ -512,10 +452,7 @@ void sub_0804702C(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
const u16 gUnk_080D1BBC[2] = {
|
||||
0x1A0,
|
||||
0xE0
|
||||
};
|
||||
const u16 gUnk_080D1BBC[2] = { 0x1A0, 0xE0 };
|
||||
|
||||
void sub_080470B4(Entity* this) {
|
||||
u32 tmp = 0x40;
|
||||
@@ -565,7 +502,8 @@ void sub_080471C8(Entity* this) {
|
||||
this->direction++;
|
||||
}
|
||||
sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8);
|
||||
if (gRoomControls.roomOriginY + 0x190 <= this->y.HALF.HI) return;
|
||||
if (gRoomControls.roomOriginY + 0x190 <= this->y.HALF.HI)
|
||||
return;
|
||||
if (this->field_0x74.HWORD > 0x100) {
|
||||
if (Random() & 1) {
|
||||
this->previousActionFlag = 6;
|
||||
@@ -604,7 +542,8 @@ void sub_080472BC(Entity* this) {
|
||||
this->nonPlanarMovement += 8;
|
||||
}
|
||||
sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8);
|
||||
if (gRoomControls.roomOriginX + 0x2B0 >= this->x.HALF.HI) return;
|
||||
if (gRoomControls.roomOriginX + 0x2B0 >= this->x.HALF.HI)
|
||||
return;
|
||||
this->previousActionFlag = 9;
|
||||
this->field_0x76.HWORD = this->direction << 8;
|
||||
}
|
||||
@@ -615,22 +554,15 @@ void sub_08047310(Entity* this) {
|
||||
}
|
||||
this->field_0x76.HWORD -= 0x1D0;
|
||||
this->direction = this->field_0x76.HWORD >> 8;
|
||||
if ((u8) (this->direction + 0x7F) < 0x40) {
|
||||
if ((u8)(this->direction + 0x7F) < 0x40) {
|
||||
this->direction = 0xC0;
|
||||
this->previousActionFlag = 4;
|
||||
}
|
||||
sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8);
|
||||
}
|
||||
|
||||
void (* const gUnk_080D1BC0[7])(Entity*) = {
|
||||
sub_080473B8,
|
||||
sub_080473F0,
|
||||
sub_08047484,
|
||||
sub_08047508,
|
||||
sub_080475F4,
|
||||
sub_0804763C,
|
||||
sub_0804772C
|
||||
};
|
||||
void (*const gUnk_080D1BC0[7])(Entity*) = { sub_080473B8, sub_080473F0, sub_08047484, sub_08047508,
|
||||
sub_080475F4, sub_0804763C, sub_0804772C };
|
||||
|
||||
void sub_0804736C(Entity* this) {
|
||||
if (this->animIndex == 1) {
|
||||
@@ -766,7 +698,7 @@ void sub_0804763C(Entity* this) {
|
||||
this->direction = this->field_0x76.HWORD >> 8;
|
||||
}
|
||||
} else {
|
||||
s32 tmp = (s16) this->field_0x74.HWORD;
|
||||
s32 tmp = (s16)this->field_0x74.HWORD;
|
||||
if (tmp > 0) {
|
||||
this->field_0x76.HWORD += tmp;
|
||||
this->direction = this->field_0x76.HWORD >> 8;
|
||||
@@ -812,13 +744,7 @@ void sub_0804772C(Entity* this) {
|
||||
sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8);
|
||||
}
|
||||
|
||||
void (* const gUnk_080D1BDC[5])(Entity*) = {
|
||||
sub_08047798,
|
||||
sub_080477F0,
|
||||
sub_08047914,
|
||||
sub_08047978,
|
||||
sub_08047B08
|
||||
};
|
||||
void (*const gUnk_080D1BDC[5])(Entity*) = { sub_08047798, sub_080477F0, sub_08047914, sub_08047978, sub_08047B08 };
|
||||
|
||||
void sub_08047778(Entity* this) {
|
||||
gUnk_080D1BDC[this->previousActionFlag](this);
|
||||
@@ -838,10 +764,7 @@ void sub_08047798(Entity* this) {
|
||||
sub_08047D88(this);
|
||||
}
|
||||
|
||||
const s16 gUnk_080D1BF0[2] = {
|
||||
0x80,
|
||||
-0x80
|
||||
};
|
||||
const s16 gUnk_080D1BF0[2] = { 0x80, -0x80 };
|
||||
|
||||
void sub_080477F0(Entity* this) {
|
||||
if (this->nonPlanarMovement < 0x300) {
|
||||
@@ -865,10 +788,11 @@ void sub_080477F0(Entity* this) {
|
||||
this->previousActionFlag = 2;
|
||||
this->field_0x76.HWORD = this->animationState << 8;
|
||||
this->field_0x74.HWORD = gUnk_080D1BF0[Random() & 1];
|
||||
if (((Entity*) this->otherEntity)->prev->field_0x6c.HWORD & 1) {
|
||||
((Entity*) this->otherEntity)->next->field_0x78.HALF.HI = gRoomControls.roomOriginX + 0x200 > this->x.HALF.HI ? 0x81 : 0x83;
|
||||
if (((Entity*)this->otherEntity)->prev->field_0x6c.HWORD & 1) {
|
||||
((Entity*)this->otherEntity)->next->field_0x78.HALF.HI =
|
||||
gRoomControls.roomOriginX + 0x200 > this->x.HALF.HI ? 0x81 : 0x83;
|
||||
} else {
|
||||
((Entity*) this->otherEntity)->next->field_0x78.HALF.HI = 0x80;
|
||||
((Entity*)this->otherEntity)->next->field_0x78.HALF.HI = 0x80;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -883,7 +807,7 @@ void sub_08047914(Entity* this) {
|
||||
this->previousActionFlag = 3;
|
||||
this->field_0x70.HALF.LO = 0x3C;
|
||||
this->field_0x7c.HALF.HI = ((this->entityType.form * 0xF) << 2) + 0x78;
|
||||
sub_080A1D70(((Entity*) this->otherEntity)->prev, this->animationState);
|
||||
sub_080A1D70(((Entity*)this->otherEntity)->prev, this->animationState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -920,11 +844,13 @@ void sub_08047978(Entity* this) {
|
||||
this->spriteRendering.b3 = 2;
|
||||
this->direction = this->animationState;
|
||||
}
|
||||
if (this->currentHealth != 0) return;
|
||||
if (this->attachedEntity->action != 1) return;
|
||||
if (this->currentHealth != 0)
|
||||
return;
|
||||
if (this->attachedEntity->action != 1)
|
||||
return;
|
||||
this->previousActionFlag = 4;
|
||||
if (this->entityType.form == 0) {
|
||||
if ((((Entity*) this->otherEntity)->next->animationState >> 6) == 1) {
|
||||
if ((((Entity*)this->otherEntity)->next->animationState >> 6) == 1) {
|
||||
this->field_0x80.HWORD = gRoomControls.roomOriginX + 0x1C0;
|
||||
this->field_0x82.HWORD = gRoomControls.roomOriginY + 0x250;
|
||||
} else {
|
||||
@@ -945,7 +871,6 @@ void sub_08047978(Entity* this) {
|
||||
}
|
||||
this->field_0x82.HWORD += gRoomControls.roomOriginY;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void sub_08047B08(Entity* this) {
|
||||
@@ -953,7 +878,8 @@ void sub_08047B08(Entity* this) {
|
||||
this->direction = sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI);
|
||||
this->nonPlanarMovement = 0x200;
|
||||
sub_08047E58(this);
|
||||
if (!sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, 4)) return;
|
||||
if (!sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, 4))
|
||||
return;
|
||||
if (this->entityType.form == 0) {
|
||||
this->action = 7;
|
||||
this->previousActionFlag = 0;
|
||||
@@ -967,11 +893,7 @@ void sub_08047B08(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void (* const gUnk_080D1BF4[3])(Entity*) = {
|
||||
sub_08047BA4,
|
||||
sub_08047BF0,
|
||||
sub_08047D24
|
||||
};
|
||||
void (*const gUnk_080D1BF4[3])(Entity*) = { sub_08047BA4, sub_08047BF0, sub_08047D24 };
|
||||
|
||||
void sub_08047B84(Entity* this) {
|
||||
gUnk_080D1BF4[this->previousActionFlag](this);
|
||||
@@ -991,12 +913,7 @@ void sub_08047BA4(Entity* this) {
|
||||
sub_08047BF0(this);
|
||||
}
|
||||
|
||||
const s8 gUnk_080D1C00[4] = {
|
||||
0x40,
|
||||
-0x40,
|
||||
-0x40,
|
||||
0x40
|
||||
};
|
||||
const s8 gUnk_080D1C00[4] = { 0x40, -0x40, -0x40, 0x40 };
|
||||
|
||||
void sub_08047BF0(Entity* this) {
|
||||
Entity* tmp;
|
||||
@@ -1052,9 +969,9 @@ void sub_08047D24(Entity* this) {
|
||||
this->field_0x7c.HALF_U.HI += 8;
|
||||
if (this->field_0x7c.HALF_U.HI > 0x800) {
|
||||
if (this->entityType.form == 0) {
|
||||
((u32*) this->otherEntity)[2] = 0;
|
||||
((u32*)this->otherEntity)[2] = 0;
|
||||
} else {
|
||||
((u32*) this->otherEntity)[3] = 0;
|
||||
((u32*)this->otherEntity)[3] = 0;
|
||||
}
|
||||
this->otherEntity = 0;
|
||||
DeleteThisEntity();
|
||||
@@ -1074,17 +991,21 @@ void sub_08047D88(Entity* this) {
|
||||
tmp = ((tmp << 1) & 0x7F) | (tmp & 0x80);
|
||||
this->field_0x7c.BYTES.byte0 = tmp;
|
||||
tmp2 = this->spriteRendering.b3;
|
||||
if (tmp2 == 3 && gPlayerState.field_0x14 != 0) return;
|
||||
if (this->animIndex == 1) return;
|
||||
if (!sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x20)) return;
|
||||
if (tmp2 == 3 && gPlayerState.field_0x14 != 0)
|
||||
return;
|
||||
if (this->animIndex == 1)
|
||||
return;
|
||||
if (!sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x20))
|
||||
return;
|
||||
gPlayerState.field_0x14 = 1;
|
||||
if (gPlayerEntity.height.HALF.HI != 0) return;
|
||||
if (gPlayerEntity.height.HALF.HI != 0)
|
||||
return;
|
||||
this->field_0x7c.BYTES.byte0 |= 1;
|
||||
}
|
||||
|
||||
void sub_08047DF0(Entity* this, u32 unk1) {
|
||||
u32 oldX, oldY;
|
||||
sub_08047D88(this);
|
||||
sub_08047D88(this);
|
||||
sub_08047EA4(this, unk1);
|
||||
oldX = this->x.HALF.HI;
|
||||
oldY = this->y.HALF.HI;
|
||||
@@ -1120,7 +1041,8 @@ void sub_08047EA4(Entity* this, u32 unk1) {
|
||||
u32 tmp2, dir;
|
||||
this->field_0x78.HWORD = unk1;
|
||||
tmp = this->field_0x78.HWORD - this->field_0x7a.HWORD;
|
||||
if (tmp + 0x100 < 0x200u) return;
|
||||
if (tmp + 0x100 < 0x200u)
|
||||
return;
|
||||
if (this->field_0x7c.BYTES.byte0 & 1) {
|
||||
tmp2 = sub_08047F68(this) << 8;
|
||||
dir = sub_080045DA(gPlayerEntity.x.HALF.HI - this->x.HALF.HI, gPlayerEntity.y.HALF.HI - this->y.HALF.HI);
|
||||
@@ -1132,24 +1054,17 @@ void sub_08047EA4(Entity* this, u32 unk1) {
|
||||
this->field_0x7a.HWORD = this->field_0x78.HWORD;
|
||||
}
|
||||
|
||||
const u16 gUnk_080D1C04[0x20] = {
|
||||
0, 1, 4, 9,
|
||||
16, 25, 36, 49,
|
||||
64, 81, 100, 121,
|
||||
144, 169, 196, 225,
|
||||
256, 289, 324, 361,
|
||||
400, 441, 484, 529,
|
||||
576, 625, 676, 729,
|
||||
784, 841, 900, 961
|
||||
};
|
||||
const u16 gUnk_080D1C04[0x20] = { 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225,
|
||||
256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961 };
|
||||
|
||||
u32 sub_08047F68(Entity* this) {
|
||||
s32 diffX, diffY;
|
||||
s32 distSquared, approx;
|
||||
diffX = gPlayerEntity.x.HALF.HI - this->x.HALF.HI;
|
||||
diffX = gPlayerEntity.x.HALF.HI - this->x.HALF.HI;
|
||||
diffY = gPlayerEntity.y.HALF.HI - this->y.HALF.HI;
|
||||
distSquared = (diffX * diffX) + (diffY * diffY);
|
||||
if (distSquared == 0x400) return 0x20;
|
||||
if (distSquared == 0x400)
|
||||
return 0x20;
|
||||
if (distSquared < gUnk_080D1C04[0x10]) {
|
||||
approx = 0x8;
|
||||
} else {
|
||||
@@ -1171,7 +1086,7 @@ u32 sub_08047F68(Entity* this) {
|
||||
approx += 1;
|
||||
}
|
||||
if (distSquared < gUnk_080D1C04[approx]) {
|
||||
s32 tmp = gUnk_080D1C04[approx-1];
|
||||
s32 tmp = gUnk_080D1C04[approx - 1];
|
||||
tmp += (gUnk_080D1C04[approx] - tmp) / 2;
|
||||
if (distSquared <= tmp) {
|
||||
approx = approx - 1;
|
||||
@@ -1181,22 +1096,26 @@ u32 sub_08047F68(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08048004(Entity* this) {
|
||||
if (this->action == 0) return;
|
||||
if (this->action == 0)
|
||||
return;
|
||||
if (this->animIndex == 0) {
|
||||
this->flags &= ~0x80;
|
||||
if (gPlayerEntity.height.HALF.HI != 0) return;
|
||||
if (!sub_08079F8C()) return;
|
||||
if (gPlayerEntity.height.HALF.HI != 0)
|
||||
return;
|
||||
if (!sub_08079F8C())
|
||||
return;
|
||||
if (this->field_0x7c.BYTES.byte0 & 1) {
|
||||
u32 b = this->spriteRendering.b3;
|
||||
if (b == 3) {
|
||||
s32 posX = ((gPlayerEntity.x.HALF.HI - gRoomControls.roomOriginX) >> 3);
|
||||
s32 posX = ((gPlayerEntity.x.HALF.HI - gRoomControls.roomOriginX) >> 3);
|
||||
s32 posY = ((gPlayerEntity.y.HALF.HI - gRoomControls.roomOriginY) >> 3);
|
||||
u16 * tmp = (u16*)&gUnk_02019EE0;
|
||||
u16* tmp = (u16*)&gUnk_02019EE0;
|
||||
if (tmp[(posY << 7) + posX]) {
|
||||
if (!(this->field_0x7c.BYTES.byte0 & 2)) {
|
||||
this->field_0x7c.BYTES.byte0 |= 0x80;
|
||||
}
|
||||
if ((this->field_0x7c.BYTES.byte0 & 0x80)) return;
|
||||
if ((this->field_0x7c.BYTES.byte0 & 0x80))
|
||||
return;
|
||||
gPlayerEntity.x.HALF.HI = this->cutsceneBeh.HWORD;
|
||||
gPlayerEntity.y.HALF.HI = this->field_0x86.HWORD;
|
||||
return;
|
||||
@@ -1208,7 +1127,8 @@ void sub_08048004(Entity* this) {
|
||||
if (b != 3) {
|
||||
if (sub_0806FCB8(&gPlayerEntity, this->x.HALF.HI, this->y.HALF.HI, 0x24)) {
|
||||
if (!(this->field_0x7c.BYTES.byte0 & 2)) {
|
||||
u32 tmp = sub_080045DA(gPlayerEntity.x.HALF.HI - this->x.HALF.HI, gPlayerEntity.y.HALF.HI - this->y.HALF.HI);
|
||||
u32 tmp = sub_080045DA(gPlayerEntity.x.HALF.HI - this->x.HALF.HI,
|
||||
gPlayerEntity.y.HALF.HI - this->y.HALF.HI);
|
||||
gPlayerEntity.x.WORD = this->x.WORD + (gSineTable[tmp] * 9216);
|
||||
gPlayerEntity.y.WORD = this->y.WORD - (gSineTable[tmp + 0x40] * 9216);
|
||||
}
|
||||
@@ -1226,41 +1146,19 @@ void sub_0804813C(Entity* this) {
|
||||
sub_080A1ED0(rand & 7, 1, (rand >> 8) & 3);
|
||||
}
|
||||
|
||||
|
||||
const u8 gUnk_080D1C44[0xC] = {
|
||||
0, 2, 6, 0,
|
||||
2, 4, 2, 4,
|
||||
6, 0, 4, 6
|
||||
};
|
||||
const u8 gUnk_080D1C44[0xC] = { 0, 2, 6, 0, 2, 4, 2, 4, 6, 0, 4, 6 };
|
||||
|
||||
u32 sub_08048158(u32 unk1) {
|
||||
return gUnk_080D1C44[(unk1 * 3) + ((signed)Random() % 3)];
|
||||
}
|
||||
|
||||
const u16 gUnk_080D1C50[8] = {
|
||||
0x200,
|
||||
0x180,
|
||||
0x2C0,
|
||||
0x210,
|
||||
0x200,
|
||||
0x2A0,
|
||||
0x140,
|
||||
0x210
|
||||
};
|
||||
const u16 gUnk_080D1C50[8] = { 0x200, 0x180, 0x2C0, 0x210, 0x200, 0x2A0, 0x140, 0x210 };
|
||||
|
||||
const u16 gUnk_080D1C60[8] = {
|
||||
0x200,
|
||||
0x150,
|
||||
0x290,
|
||||
0x210,
|
||||
0x200,
|
||||
0x2D0,
|
||||
0x170,
|
||||
0x210
|
||||
};
|
||||
const u16 gUnk_080D1C60[8] = { 0x200, 0x150, 0x290, 0x210, 0x200, 0x2D0, 0x170, 0x210 };
|
||||
|
||||
void sub_08048178(Entity* this, u32 unk1) {
|
||||
const u16* tmp = ((((Entity*) this->otherEntity)->next->animationState >> 6 & 1) ? gUnk_080D1C60 + unk1: gUnk_080D1C50 + unk1);
|
||||
const u16* tmp =
|
||||
((((Entity*)this->otherEntity)->next->animationState >> 6 & 1) ? gUnk_080D1C60 + unk1 : gUnk_080D1C50 + unk1);
|
||||
this->field_0x80.HWORD = *tmp + gRoomControls.roomOriginX;
|
||||
this->field_0x82.HWORD = *(tmp + 1) + gRoomControls.roomOriginY;
|
||||
}
|
||||
|
||||
+277
@@ -0,0 +1,277 @@
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "flags.h"
|
||||
#include "save.h"
|
||||
#include "script.h"
|
||||
|
||||
extern BoundingBox gUnk_080FD170;
|
||||
|
||||
extern u16* gUnk_08114144;
|
||||
|
||||
extern u32 gUnk_081141A4[];
|
||||
extern u8 gUnk_081141E4[];
|
||||
|
||||
extern BoundingBox gUnk_08114154;
|
||||
extern void gUnk_08016030; // Cutscene data type?
|
||||
extern void gUnk_0801606C; // Cutscene data type?
|
||||
|
||||
extern void gUnk_081141F4; // tiles that are changed?
|
||||
|
||||
extern void sub_0809623C(Entity*);
|
||||
extern void sub_08096260(Entity*);
|
||||
|
||||
void EzloCap(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action += 1;
|
||||
sub_0805E3A0(this, 2);
|
||||
sub_0807DD50(this);
|
||||
}
|
||||
sub_0807DDAC(this, 0);
|
||||
sub_0807DDE4(this);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/ezloCap/sub_0806D8A0.inc", void sub_0806D8A0(Entity* this, u32 param_2)) {
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
NONMATCH("asm/non_matching/ezloCap/sub_0806D908.inc", void sub_0806D908(Entity* this)) {
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_0806D944(Entity* this) {
|
||||
this->spriteSettings.b.flipX = 0;
|
||||
if (this->x.WORD <= gPlayerEntity.x.WORD) {
|
||||
this->spriteSettings.b.flipX = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0806D96C(Entity* this) {
|
||||
Entity* fx = CreateFx(this, 0x42, 0);
|
||||
if (fx != NULL) {
|
||||
fx->spritePriority.b0 = 1;
|
||||
PositionRelative(this, fx, 0, 0xFFE80000);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0806D9A4(Entity* this) {
|
||||
if (this->x.WORD <= gPlayerEntity.x.WORD) {
|
||||
gPlayerEntity.spriteSettings.b.flipX = 0;
|
||||
} else {
|
||||
gPlayerEntity.spriteSettings.b.flipX = 1;
|
||||
}
|
||||
gPlayerEntity.animationState = 4;
|
||||
}
|
||||
|
||||
void NPC4E(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 4;
|
||||
this->boundingBox = &gUnk_080FD170;
|
||||
sub_0807DD50(this);
|
||||
} else {
|
||||
sub_0807DD94(this, 0);
|
||||
}
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/ezloCap/sub_0806DA04.inc", void sub_0806DA04(Entity* this, u32 param_2)) {
|
||||
u8 direction =
|
||||
sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, (int)gPlayerEntity.x.HALF.HI, (int)gPlayerEntity.y.HALF.HI);
|
||||
this->direction = direction;
|
||||
|
||||
this->animationState =
|
||||
(this->animationState & 0x80) |
|
||||
gUnk_08114144[(((direction) << 0x18) >> 0x19)]; // somehow the cast from u8 to u32 of direction is an issue here
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_0806DA1C(Entity* this, u32* param_2) {
|
||||
sub_0808091C((ScreenTransitionData*)(gUnk_081141A4)[param_2[1]], (u32)(gUnk_081141E4[param_2[1]]));
|
||||
}
|
||||
|
||||
// Returns the kingstone id?
|
||||
u8 sub_0806DA3C(Entity* this) {
|
||||
u32 result;
|
||||
|
||||
switch (this->entityType.form) {
|
||||
default:
|
||||
result = 0;
|
||||
break;
|
||||
case 1:
|
||||
result = 1;
|
||||
break;
|
||||
case 2:
|
||||
result = 2;
|
||||
break;
|
||||
case 3:
|
||||
result = 3;
|
||||
break;
|
||||
case 4:
|
||||
result = 4;
|
||||
break;
|
||||
case 5:
|
||||
result = 5;
|
||||
break;
|
||||
case 11:
|
||||
result = 9;
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
result = sub_0801E99C(this);
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// Check whether a kingstone fusion is possible and store the result somewhere in param_2?
|
||||
void sub_0806DAAC(Entity* this, u32 param_2) {
|
||||
u32 uVar1;
|
||||
uVar1 = CheckKinstoneFused(sub_0806DA3C(this));
|
||||
*(u32*)(param_2 + 0x14) = uVar1;
|
||||
gUnk_02033280.unk_07 |= 1;
|
||||
}
|
||||
|
||||
// maybe actually execute the keystone fusion?
|
||||
void sub_0806DAD0(Entity* this) {
|
||||
sub_08078790(this, sub_0806DA3C(this));
|
||||
}
|
||||
|
||||
void sub_0806DAE8(Entity* this) {
|
||||
switch (this->entityType.form - 1) {
|
||||
case 0:
|
||||
SetLocalFlag(0xee);
|
||||
break;
|
||||
case 1:
|
||||
SetLocalFlag(0xef);
|
||||
break;
|
||||
case 2:
|
||||
SetLocalFlag(0xf0);
|
||||
break;
|
||||
case 3:
|
||||
SetLocalFlag(0xf1);
|
||||
break;
|
||||
case 4:
|
||||
SetLocalFlag(0xf2);
|
||||
break;
|
||||
}
|
||||
|
||||
PlaySFX(0xcd);
|
||||
}
|
||||
|
||||
// Unknown param_2 struct
|
||||
void sub_0806DB44(Entity* this, u32* param_2) {
|
||||
param_2[5] = 0;
|
||||
|
||||
if (CheckLocalFlag(0xee) != 0 && CheckLocalFlag(0xef) != 0 && CheckLocalFlag(0xf0) != 0 &&
|
||||
CheckLocalFlag(0xf1) != 0 && CheckLocalFlag(0xf2) != 0) {
|
||||
param_2[5] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0806DB84(
|
||||
Entity* this,
|
||||
u8 unused) { // The unused param just had to be added, so that a mov r1, #0 in NPC4E_Fusion is matching correctly
|
||||
Entity* ent;
|
||||
this->boundingBox = &gUnk_08114154;
|
||||
ent = CreateObject(0x3e, 4, 0);
|
||||
if (ent != NULL) {
|
||||
PositionRelative(this, ent, -0x80000, 0);
|
||||
*(ScriptExecutionContext**)&ent->cutsceneBeh = StartCutscene(ent, &gUnk_08016030);
|
||||
}
|
||||
ent = CreateObject(0x3e, 5, 0);
|
||||
if (ent != NULL) {
|
||||
PositionRelative(this, ent, 0x80000, 0);
|
||||
*(ScriptExecutionContext**)&ent->cutsceneBeh = StartCutscene(ent, &gUnk_0801606C);
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_0806DBF4(u32 param_1) {
|
||||
switch (param_1) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 6:
|
||||
param_1 = 1;
|
||||
if (GetInventoryValue(2) != 0) {
|
||||
param_1 = 2;
|
||||
}
|
||||
if (GetInventoryValue(3) != 0) {
|
||||
param_1 = 3;
|
||||
}
|
||||
if (GetInventoryValue(4) != 0) {
|
||||
param_1 = 4;
|
||||
}
|
||||
if (GetInventoryValue(6) != 0) {
|
||||
param_1 = 6;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return param_1;
|
||||
}
|
||||
|
||||
void sub_0806DC3C(Entity* this) {
|
||||
this->field_0x68.HALF.LO = gSave.stats.itemOnA;
|
||||
this->field_0x68.HALF.HI = gSave.stats.itemOnB;
|
||||
}
|
||||
|
||||
void sub_0806DC58(Entity* this) {
|
||||
ForceEquipItem(sub_0806DBF4(this->field_0x68.HALF.LO), 0);
|
||||
ForceEquipItem(sub_0806DBF4(this->field_0x68.HALF.HI), 1);
|
||||
}
|
||||
|
||||
void sub_0806DC7C() {
|
||||
u16* tiles = &gUnk_081141F4;
|
||||
while (*tiles != 0) {
|
||||
u32 tile = (u32)*tiles;
|
||||
tiles = tiles + 1;
|
||||
SetTileType(0x4072, tile, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0806DCA0() {
|
||||
u16 uVar1;
|
||||
u16* tiles;
|
||||
|
||||
tiles = &gUnk_081141F4;
|
||||
while (*tiles != 0) {
|
||||
u16 tile = *tiles;
|
||||
tiles = tiles + 1;
|
||||
sub_0807BA8C((u32)tile, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0806DCC0() {
|
||||
gScreenTransition.field_0x20 = 0x7c8;
|
||||
gScreenTransition.field_0x22 = 0xf8;
|
||||
}
|
||||
|
||||
void NPC4E_Fusion(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action += 1;
|
||||
switch (this->entityType.form) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
sub_0809623C(this);
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
sub_08096260(this);
|
||||
break;
|
||||
case 11:
|
||||
sub_0806DB84(this, 0);
|
||||
this->boundingBox = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -1146,8 +1146,7 @@ void sub_08051874(void) {
|
||||
gUnk_02019EE0.saveStatus[gUnk_02019EE0.unk7] = temp;
|
||||
switch (temp) {
|
||||
case 1:
|
||||
_DmaCopy(&gSave, &gUnk_02019EE0.saves[gUnk_02019EE0.unk7],
|
||||
sizeof(gUnk_02019EE0.saves[gUnk_02019EE0.unk7]));
|
||||
_DmaCopy(&gSave, &gUnk_02019EE0.saves[gUnk_02019EE0.unk7], sizeof(gUnk_02019EE0.saves[gUnk_02019EE0.unk7]));
|
||||
SetFileSelectState(0);
|
||||
break;
|
||||
case -1:
|
||||
|
||||
+21
-21
@@ -9,42 +9,42 @@ extern u8 gUnk_08003E44;
|
||||
|
||||
void sub_0805FC74(Entity*);
|
||||
|
||||
void Item14(Entity *this) {
|
||||
void Item14(Entity* this) {
|
||||
gUnk_08109AC8[this->action](this);
|
||||
}
|
||||
|
||||
void sub_0805FBE8(Entity* this) {
|
||||
CopyPosition(&gPlayerEntity,this);
|
||||
this->action++;
|
||||
this->spriteSettings.b.draw = TRUE;
|
||||
this->field_0x3c = gPlayerEntity.field_0x3c + 1;
|
||||
this->boundingBox = &gUnk_08109AD0;
|
||||
this->nonPlanarMovement = 0x380;
|
||||
this->animationState = this->animationState & 0x7f;
|
||||
if (this->collisionLayer == 2) {
|
||||
this->entityType.parameter = 1;
|
||||
}
|
||||
this->direction = this->animationState << 2;
|
||||
*(u32 *)&this->field_0x6c = 0x3c;
|
||||
InitializeAnimation(this, (this->animationState >> 1) + 0xc);
|
||||
sub_0801766C(this);
|
||||
sub_0806F69C(this);
|
||||
sub_0805FC74(this);
|
||||
SoundReq(0x13f);
|
||||
CopyPosition(&gPlayerEntity, this);
|
||||
this->action++;
|
||||
this->spriteSettings.b.draw = TRUE;
|
||||
this->field_0x3c = gPlayerEntity.field_0x3c + 1;
|
||||
this->boundingBox = &gUnk_08109AD0;
|
||||
this->nonPlanarMovement = 0x380;
|
||||
this->animationState = this->animationState & 0x7f;
|
||||
if (this->collisionLayer == 2) {
|
||||
this->entityType.parameter = 1;
|
||||
}
|
||||
this->direction = this->animationState << 2;
|
||||
*(u32*)&this->field_0x6c = 0x3c;
|
||||
InitializeAnimation(this, (this->animationState >> 1) + 0xc);
|
||||
sub_0801766C(this);
|
||||
sub_0806F69C(this);
|
||||
sub_0805FC74(this);
|
||||
SoundReq(0x13f);
|
||||
}
|
||||
|
||||
void sub_0805FC74(Entity* this) {
|
||||
int iVar1;
|
||||
|
||||
if (--*(int *)&this->field_0x6c != -1) {
|
||||
if (--*(int*)&this->field_0x6c != -1) {
|
||||
GetNextFrame(this);
|
||||
sub_0806F69C(this);
|
||||
++this->actionDelay;
|
||||
if (this->entityType.parameter == 0) {
|
||||
sub_0800451C(this);
|
||||
}
|
||||
if (!sub_080002F0(COORD_TO_TILE(this),gPlayerEntity.collisionLayer,0x80) &&
|
||||
sub_080040D8(this,&gUnk_08003E44, this->x.HALF.HI, this->y.HALF.HI)) {
|
||||
if (!sub_080002F0(COORD_TO_TILE(this), gPlayerEntity.collisionLayer, 0x80) &&
|
||||
sub_080040D8(this, &gUnk_08003E44, this->x.HALF.HI, this->y.HALF.HI)) {
|
||||
CreateFx(this, 0x19, 0);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
+9
-58
@@ -2,62 +2,13 @@
|
||||
|
||||
// TODO: change all manager arguments to be Entity* and cast to specific type later.
|
||||
void (*const gManagerFunctions[])() = {
|
||||
NULL,
|
||||
Manager1,
|
||||
Manager2,
|
||||
sub_080576C0,
|
||||
sub_08057854,
|
||||
sub_08057AD0,
|
||||
sub_08057CB4,
|
||||
Manager7_Main,
|
||||
sub_08057ED0,
|
||||
sub_080581D8,
|
||||
sub_08058380,
|
||||
sub_080585F0,
|
||||
sub_0805884C,
|
||||
sub_08058DD0,
|
||||
sub_08058E60,
|
||||
sub_08058ECC,
|
||||
sub_08059570,
|
||||
sub_080599B8,
|
||||
sub_080599EC,
|
||||
sub_08059DAC,
|
||||
sub_08059E58,
|
||||
sub_0805A280,
|
||||
sub_0805AB4C,
|
||||
sub_0805AD48,
|
||||
sub_0805ADD8,
|
||||
sub_0805AF60,
|
||||
sub_0805B030,
|
||||
sub_0805B3B4,
|
||||
sub_0805B53C,
|
||||
sub_0805B5C8,
|
||||
Manager1E_Handler,
|
||||
sub_0805B6F4,
|
||||
sub_0805B7A0,
|
||||
sub_0805B820,
|
||||
sub_0805B8EC,
|
||||
sub_0805BC74,
|
||||
sub_0805BF18,
|
||||
sub_0805C61C,
|
||||
sub_0805C6B8,
|
||||
Manager27,
|
||||
Manager28_Entry,
|
||||
sub_0805CB90,
|
||||
sub_0805CFC0,
|
||||
sub_0805D014,
|
||||
sub_0805D174,
|
||||
sub_0805D1FC,
|
||||
sub_0805D250,
|
||||
sub_0805D3C8,
|
||||
Manager30_Main,
|
||||
sub_0805D630,
|
||||
sub_0805D7A4,
|
||||
sub_0805DAE8,
|
||||
sub_0805DB94,
|
||||
sub_0805DC84,
|
||||
sub_0805DDB4,
|
||||
sub_0805DE38,
|
||||
sub_0805E0A8,
|
||||
sub_0805E0FC
|
||||
NULL, Manager1, Manager2, sub_080576C0, sub_08057854, sub_08057AD0, sub_08057CB4,
|
||||
Manager7_Main, sub_08057ED0, sub_080581D8, sub_08058380, sub_080585F0, sub_0805884C, sub_08058DD0,
|
||||
sub_08058E60, sub_08058ECC, sub_08059570, sub_080599B8, sub_080599EC, sub_08059DAC, sub_08059E58,
|
||||
sub_0805A280, sub_0805AB4C, sub_0805AD48, sub_0805ADD8, sub_0805AF60, sub_0805B030, sub_0805B3B4,
|
||||
sub_0805B53C, sub_0805B5C8, Manager1E_Handler, sub_0805B6F4, sub_0805B7A0, sub_0805B820, sub_0805B8EC,
|
||||
sub_0805BC74, sub_0805BF18, sub_0805C61C, sub_0805C6B8, Manager27, Manager28_Entry, sub_0805CB90,
|
||||
sub_0805CFC0, sub_0805D014, sub_0805D174, sub_0805D1FC, sub_0805D250, sub_0805D3C8, Manager30_Main,
|
||||
sub_0805D630, sub_0805D7A4, sub_0805DAE8, sub_0805DB94, sub_0805DC84, sub_0805DDB4, sub_0805DE38,
|
||||
sub_0805E0A8, sub_0805E0FC
|
||||
};
|
||||
|
||||
+4
-10
@@ -6,28 +6,22 @@
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 unk_20[0x14];//unused
|
||||
u8 unk_20[0x14]; // unused
|
||||
u16 radiusX;
|
||||
u16 radiusY;
|
||||
s16 posX;
|
||||
s16 posY;
|
||||
u8 unk_3c[2];//unused
|
||||
u8 unk_3c[2]; // unused
|
||||
u16 playerInRegionFlag;
|
||||
} Manager1E;
|
||||
|
||||
enum Manager1E_State {
|
||||
Init,
|
||||
ObserveRegion
|
||||
};
|
||||
enum Manager1E_State { Init, ObserveRegion };
|
||||
|
||||
void Manager1E_Handler(Manager1E*);
|
||||
void Manager1E_Init(Manager1E*);
|
||||
void Manager1E_ObserveRegion(Manager1E*);
|
||||
|
||||
void (* const Manager1E_ActionFuncs[2])(Manager1E*) = {
|
||||
Manager1E_Init,
|
||||
Manager1E_ObserveRegion
|
||||
};
|
||||
void (*const Manager1E_ActionFuncs[2])(Manager1E*) = { Manager1E_Init, Manager1E_ObserveRegion };
|
||||
|
||||
void Manager1E_Handler(Manager1E* this) {
|
||||
Manager1E_ActionFuncs[this->manager.action](this);
|
||||
|
||||
@@ -17,16 +17,12 @@ void sub_0805C6D0(Manager26*);
|
||||
void sub_0805C7A0(Manager26*);
|
||||
void sub_0805C7C4(Manager26*);
|
||||
|
||||
void (* const gUnk_08108D04[])(Manager26*) = {
|
||||
sub_0805C6D0,
|
||||
sub_0805C7A0,
|
||||
sub_0805C7C4
|
||||
};
|
||||
void (*const gUnk_08108D04[])(Manager26*) = { sub_0805C6D0, sub_0805C7A0, sub_0805C7C4 };
|
||||
|
||||
void sub_0805C7CC(Manager26*);
|
||||
|
||||
void sub_0805C6B8(Manager26* this) {
|
||||
gUnk_08108D04[this->manager.action](this);
|
||||
gUnk_08108D04[this->manager.action](this);
|
||||
}
|
||||
|
||||
void sub_0805C6D0(Manager26* this) {
|
||||
@@ -46,7 +42,7 @@ void sub_0805C6D0(Manager26* this) {
|
||||
obj->actionDelay = tmp->unk_03;
|
||||
obj->x.HALF.HI = gRoomControls.roomOriginX + tmp->unk_04;
|
||||
obj->y.HALF.HI = gRoomControls.roomOriginY + tmp->unk_06;
|
||||
obj->parent = (Entity*) this;
|
||||
obj->parent = (Entity*)this;
|
||||
obj->collisionLayer = 1;
|
||||
obj->field_0x82.HALF.HI = this->manager.unk_0e;
|
||||
obj->field_0x82.HALF.LO = tmp->unk_00;
|
||||
@@ -75,7 +71,7 @@ void sub_0805C7A0(Manager26* this) {
|
||||
}
|
||||
|
||||
void sub_0805C7C4(Manager26* this) {
|
||||
sub_0805C7CC(this);
|
||||
sub_0805C7CC(this);
|
||||
}
|
||||
|
||||
void sub_0805C7CC(Manager26* this) {
|
||||
|
||||
@@ -11,16 +11,9 @@ void sub_0805C894(Entity*);
|
||||
void sub_0805C8B4(Entity*);
|
||||
void sub_0805C908(Entity*);
|
||||
|
||||
void (*const gUnk_08108D10[])(Entity*) = {
|
||||
sub_0805C874,
|
||||
sub_0805C894,
|
||||
sub_0805C8B4,
|
||||
sub_0805C908
|
||||
};
|
||||
void (*const gUnk_08108D10[])(Entity*) = { sub_0805C874, sub_0805C894, sub_0805C8B4, sub_0805C908 };
|
||||
|
||||
const u8 gUnk_08108D20[] = {
|
||||
0x6F, 0x70, 0x71, 0x72, 0x71, 0x70
|
||||
};
|
||||
const u8 gUnk_08108D20[] = { 0x6F, 0x70, 0x71, 0x72, 0x71, 0x70 };
|
||||
|
||||
void Manager27(Entity* this) {
|
||||
|
||||
|
||||
+28
-33
@@ -18,20 +18,11 @@ u32 Manager28_FindMatchingEntities(Manager28*);
|
||||
Entity* Manager28_FindMatchingEntity(EntityData*);
|
||||
void Manager28_RemoveDeletedEntities(Manager28*);
|
||||
|
||||
void (* const Manager28_ActionFuncs[])(Manager28*) = {
|
||||
Manager28_Init,
|
||||
Manager28_Main
|
||||
};
|
||||
void (*const Manager28_ActionFuncs[])(Manager28*) = { Manager28_Init, Manager28_Main };
|
||||
|
||||
enum Manager28_Action {
|
||||
Init = 0,
|
||||
Main = 1
|
||||
};
|
||||
enum Manager28_Action { Init = 0, Main = 1 };
|
||||
|
||||
enum Manager28_InitState {
|
||||
DoInit = 0,
|
||||
DoNotInit = 1
|
||||
};
|
||||
enum Manager28_InitState { DoInit = 0, DoNotInit = 1 };
|
||||
|
||||
void Manager28_Entry(Manager28* this) {
|
||||
Manager28_ActionFuncs[this->manager.action](this);
|
||||
@@ -46,7 +37,7 @@ void Manager28_Init(Manager28* this) {
|
||||
}
|
||||
tmp2 = Manager28_FindMatchingEntities(this);
|
||||
if (tmp2 > 1) {
|
||||
Manager28* tmp3 = (Manager28*) GetEmptyManager();
|
||||
Manager28* tmp3 = (Manager28*)GetEmptyManager();
|
||||
if (tmp3) {
|
||||
tmp3->manager.type = 9;
|
||||
tmp3->manager.subtype = 0x28;
|
||||
@@ -92,20 +83,26 @@ void Manager28_Main(Manager28* this) {
|
||||
|
||||
u32 Manager28_FindMatchingEntities(Manager28* this) {
|
||||
u32 re = 0;
|
||||
EntityData * tmp = GetCurrentRoomProperty(this->manager.unk_0b);
|
||||
if (!tmp) return 0;
|
||||
for (; *((u8*) tmp) != 0xFF && !(tmp->type == 9 && tmp->subtype == 0x28); tmp++) {
|
||||
EntityData* tmp = GetCurrentRoomProperty(this->manager.unk_0b);
|
||||
if (!tmp)
|
||||
return 0;
|
||||
for (; *((u8*)tmp) != 0xFF && !(tmp->type == 9 && tmp->subtype == 0x28); tmp++) {
|
||||
Entity* tmp2;
|
||||
u32 i;
|
||||
if (tmp->type != 3) continue;
|
||||
if (tmp->type != 3)
|
||||
continue;
|
||||
tmp2 = Manager28_FindMatchingEntity(tmp);
|
||||
if (!tmp2) continue;
|
||||
if (!tmp2)
|
||||
continue;
|
||||
for (i = 0; i < re; i++) {
|
||||
if (this->d.enemies[i] == tmp2) break;
|
||||
if (this->d.enemies[i] == tmp2)
|
||||
break;
|
||||
}
|
||||
if (i != re) continue;
|
||||
if (i != re)
|
||||
continue;
|
||||
this->d.enemies[re++] = tmp2;
|
||||
if (re == 8) return 8;
|
||||
if (re == 8)
|
||||
return 8;
|
||||
}
|
||||
return re;
|
||||
}
|
||||
@@ -115,15 +112,12 @@ Entity* Manager28_FindMatchingEntity(EntityData* unk1) {
|
||||
Entity* i;
|
||||
LinkedList* tmp;
|
||||
x = unk1->xPos + gRoomControls.roomOriginX;
|
||||
y = unk1->yPos + gRoomControls.roomOriginY;
|
||||
tmp = &gUnk_03003D90;
|
||||
for (i = tmp->first; (u32) i != (u32) tmp; i = i->next) {
|
||||
if (x == i->x.HALF.HI
|
||||
&& y == i->y.HALF.HI
|
||||
&& unk1->subtype == i->entityType.subtype
|
||||
&& 3 == i->entityType.type
|
||||
&& unk1->form == i->entityType.form) {
|
||||
return i;
|
||||
y = unk1->yPos + gRoomControls.roomOriginY;
|
||||
tmp = &gUnk_03003D90;
|
||||
for (i = tmp->first; (u32)i != (u32)tmp; i = i->next) {
|
||||
if (x == i->x.HALF.HI && y == i->y.HALF.HI && unk1->subtype == i->entityType.subtype &&
|
||||
3 == i->entityType.type && unk1->form == i->entityType.form) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -133,13 +127,14 @@ void Manager28_RemoveDeletedEntities(Manager28* this) {
|
||||
s32 i;
|
||||
for (i = 0; i < this->manager.unk_0e; i++) {
|
||||
if (this->d.enemies[i]->next == 0) {
|
||||
if (this->manager.unk_0e-1 == i) {
|
||||
if (this->manager.unk_0e - 1 == i) {
|
||||
this->d.enemies[i] = 0;
|
||||
} else {
|
||||
this->d.enemies[i] = this->d.enemies[this->manager.unk_0e-1];
|
||||
this->d.enemies[i] = this->d.enemies[this->manager.unk_0e - 1];
|
||||
}
|
||||
this->manager.unk_0e--;
|
||||
}
|
||||
}
|
||||
if (this->manager.unk_0e <= 1) DeleteThisEntity();
|
||||
if (this->manager.unk_0e <= 1)
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
+18
-17
@@ -7,20 +7,20 @@
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 unk_20;//unused
|
||||
u8 unk_21[0x13];//unused
|
||||
u16 unk_34;//unused
|
||||
u16 unk_36;//unused
|
||||
s16 unk_38;//unused
|
||||
s16 unk_3A;//unused
|
||||
u16 unk_3C;//unused
|
||||
u16 unk_3E;//unused
|
||||
u8 unk_20; // unused
|
||||
u8 unk_21[0x13]; // unused
|
||||
u16 unk_34; // unused
|
||||
u16 unk_36; // unused
|
||||
s16 unk_38; // unused
|
||||
s16 unk_3A; // unused
|
||||
u16 unk_3C; // unused
|
||||
u16 unk_3E; // unused
|
||||
} Manager39;
|
||||
|
||||
extern u8 gUnk_02034DF0[0x2F2];
|
||||
|
||||
extern const u16 gUnk_08108DE8[];
|
||||
extern void (* const gUnk_08108E28[])(Manager39*);
|
||||
extern void (*const gUnk_08108E28[])(Manager39*);
|
||||
extern const u8 gUnk_08108E30[0x18];
|
||||
extern const u8 gUnk_08108E48[0x18];
|
||||
extern const u8 gUnk_08108E60[];
|
||||
@@ -31,14 +31,13 @@ extern u32 CheckIsDungeon(void);
|
||||
extern void sub_0805E5B4(void);
|
||||
|
||||
void sub_0805E140(Manager39*);
|
||||
void sub_0805E18C(Manager39*); //unused?
|
||||
void sub_0805E18C(Manager39*); // unused?
|
||||
void sub_0805E1D8(Manager39*);
|
||||
void sub_0805E1F8(u32, u32);
|
||||
|
||||
void sub_0805E0FC(Manager39* this) {
|
||||
gUnk_08108E28[this->manager.action](this);
|
||||
if ((gRoomControls.roomID != this->unk_20)
|
||||
|| (gTextBox.doTextBox & 0x7F)) {
|
||||
if ((gRoomControls.roomID != this->unk_20) || (gTextBox.doTextBox & 0x7F)) {
|
||||
sub_0805E1D8(this);
|
||||
}
|
||||
}
|
||||
@@ -49,12 +48,13 @@ void sub_0805E140(Manager39* this) {
|
||||
this->unk_20 = gRoomControls.roomID;
|
||||
this->manager.unk_0e = 0x78;
|
||||
this->manager.unk_0f = 0x3c;
|
||||
sub_0805E3A0((Entity*) this, 7);
|
||||
sub_0805E3A0((Entity*)this, 7);
|
||||
sub_0805E1F8(gUnk_08108DE8[gArea.locationIndex], CheckIsDungeon());
|
||||
}
|
||||
|
||||
void sub_0805E18C(Manager39* this) {
|
||||
if (gFadeControl.active) return;
|
||||
if (gFadeControl.active)
|
||||
return;
|
||||
if (this->manager.unk_0b) {
|
||||
if (!--this->manager.unk_0f) {
|
||||
this->manager.unk_0b = 0;
|
||||
@@ -80,13 +80,14 @@ void sub_0805E1F8(u32 unk0, u32 unk1) {
|
||||
u8 unk_05;
|
||||
u8 unk_06[3];
|
||||
} PACKED tmp;
|
||||
const u8 * tmp2;
|
||||
const u8* tmp2;
|
||||
MemClear32(&gUnk_02034DF0, 0x80);
|
||||
_DmaCopy(gUnk_08108E60, &tmp, sizeof(tmp));
|
||||
tmp.unk_04 = unk0>>8;
|
||||
tmp.unk_04 = unk0 >> 8;
|
||||
tmp.unk_05 = unk0;
|
||||
tmp2 = gUnk_08108E48;
|
||||
if (!unk1) tmp2 = gUnk_08108E30;
|
||||
if (!unk1)
|
||||
tmp2 = gUnk_08108E30;
|
||||
sub_0805F46C(&tmp, tmp2);
|
||||
gScreen.bg.bg3Control = 1;
|
||||
}
|
||||
|
||||
+37
-69
@@ -9,10 +9,9 @@
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
s32 unk_20;
|
||||
s32 unk_20;
|
||||
union SplitWord unk_24;
|
||||
u32 unk_28;
|
||||
u32 unk_2c;
|
||||
@@ -26,7 +25,7 @@ typedef struct {
|
||||
u16 unk_6;
|
||||
} struct_08108228;
|
||||
|
||||
void (* const gUnk_0810821C[])(ManagerC*);
|
||||
void (*const gUnk_0810821C[])(ManagerC*);
|
||||
const struct_08108228 gUnk_08108228[6];
|
||||
const struct_08108228 gUnk_08108258[6];
|
||||
const struct_08108228 gUnk_08108288[6];
|
||||
@@ -60,11 +59,7 @@ void sub_08058894(ManagerC*);
|
||||
void sub_080588CC(ManagerC*);
|
||||
void nullsub_108(ManagerC*);
|
||||
|
||||
void (* const gUnk_0810821C[])(ManagerC*) = {
|
||||
sub_08058894,
|
||||
sub_080588CC,
|
||||
nullsub_108
|
||||
};
|
||||
void (*const gUnk_0810821C[])(ManagerC*) = { sub_08058894, sub_080588CC, nullsub_108 };
|
||||
|
||||
void sub_0805884C(ManagerC* this) {
|
||||
u32 tmp;
|
||||
@@ -90,9 +85,10 @@ void sub_080588CC(ManagerC* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void nullsub_108(ManagerC* this) {}
|
||||
void nullsub_108(ManagerC* this) {
|
||||
}
|
||||
|
||||
#define ABS_DIFF_GT(a, b, c) (signed) a - b >= 0 ? a - b > c : b - a > c
|
||||
#define ABS_DIFF_GT(a, b, c) (signed)a - b >= 0 ? a - b > c : b - a > c
|
||||
|
||||
void sub_080588F8(ManagerC* this) {
|
||||
if (this->manager.unk_0f == 0) {
|
||||
@@ -126,8 +122,8 @@ void sub_080588F8(ManagerC* this) {
|
||||
this->unk_24.WORD += tmp2;
|
||||
}
|
||||
if (ABS_DIFF_GT(this->unk_2c, this->unk_24.WORD, 0x100000)) {
|
||||
this->unk_2c = this->unk_24.WORD;
|
||||
SoundReq(0x8b);
|
||||
this->unk_2c = this->unk_24.WORD;
|
||||
SoundReq(0x8b);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,50 +136,27 @@ void sub_080588F8(ManagerC* this) {
|
||||
}
|
||||
}
|
||||
|
||||
const struct_08108228 gUnk_08108228[6] = {
|
||||
{0x40, 0x2A, 0x1C, 0x10},
|
||||
{0x3C, 0x24, 0x1C, 0x12},
|
||||
{0x3C, 0x1C, 0x1A, 0x18},
|
||||
{0x38, 0x16, 0x1C, 0x16},
|
||||
{0x34, 0x16, 0x1E, 0x0E},
|
||||
{0x30, 0x16, 0x20, 0x0A}
|
||||
};
|
||||
const struct_08108228 gUnk_08108228[6] = { { 0x40, 0x2A, 0x1C, 0x10 }, { 0x3C, 0x24, 0x1C, 0x12 },
|
||||
{ 0x3C, 0x1C, 0x1A, 0x18 }, { 0x38, 0x16, 0x1C, 0x16 },
|
||||
{ 0x34, 0x16, 0x1E, 0x0E }, { 0x30, 0x16, 0x20, 0x0A } };
|
||||
|
||||
const struct_08108228 gUnk_08108258[6] = {
|
||||
{0x30, 0x88, 0x20, 0x0A},
|
||||
{0x34, 0x7E, 0x1E, 0x12},
|
||||
{0x38, 0x78, 0x1A, 0x16},
|
||||
{0x3A, 0x70, 0x1A, 0x18},
|
||||
{0x3C, 0x64, 0x1E, 0x1E},
|
||||
{0x3E, 0x6A, 0x1C, 0x10}
|
||||
};
|
||||
const struct_08108228 gUnk_08108258[6] = { { 0x30, 0x88, 0x20, 0x0A }, { 0x34, 0x7E, 0x1E, 0x12 },
|
||||
{ 0x38, 0x78, 0x1A, 0x16 }, { 0x3A, 0x70, 0x1A, 0x18 },
|
||||
{ 0x3C, 0x64, 0x1E, 0x1E }, { 0x3E, 0x6A, 0x1C, 0x10 } };
|
||||
|
||||
const struct_08108228 gUnk_08108288[6] = {
|
||||
{0x98, 0x2A, 0x1C, 0x10},
|
||||
{0x98, 0x24, 0x1C, 0x12},
|
||||
{0x9C, 0x1C, 0x1A, 0x18},
|
||||
{0x9C, 0x16, 0x1C, 0x16},
|
||||
{0xA0, 0x16, 0x1E, 0x0E},
|
||||
{0xA0, 0x16, 0x20, 0x0A}
|
||||
};
|
||||
const struct_08108228 gUnk_08108288[6] = { { 0x98, 0x2A, 0x1C, 0x10 }, { 0x98, 0x24, 0x1C, 0x12 },
|
||||
{ 0x9C, 0x1C, 0x1A, 0x18 }, { 0x9C, 0x16, 0x1C, 0x16 },
|
||||
{ 0xA0, 0x16, 0x1E, 0x0E }, { 0xA0, 0x16, 0x20, 0x0A } };
|
||||
|
||||
const struct_08108228 gUnk_081082B8[6] = {
|
||||
{0xA0, 0x88, 0x20, 0x0A},
|
||||
{0x9E, 0x7E, 0x1E, 0x12},
|
||||
{0x9C, 0x78, 0x1A, 0x16},
|
||||
{0x9A, 0x70, 0x1A, 0x18},
|
||||
{0x98, 0x64, 0x1E, 0x1E},
|
||||
{0x98, 0x6A, 0x1C, 0x10}
|
||||
};
|
||||
const struct_08108228 gUnk_081082B8[6] = { { 0xA0, 0x88, 0x20, 0x0A }, { 0x9E, 0x7E, 0x1E, 0x12 },
|
||||
{ 0x9C, 0x78, 0x1A, 0x16 }, { 0x9A, 0x70, 0x1A, 0x18 },
|
||||
{ 0x98, 0x64, 0x1E, 0x1E }, { 0x98, 0x6A, 0x1C, 0x10 } };
|
||||
|
||||
void sub_08058A04(ManagerC* this) {
|
||||
s32 tmp = gPlayerEntity.x.HALF.HI - gRoomControls.roomOriginX;
|
||||
s32 tmp2 = gPlayerEntity.y.HALF.HI - gRoomControls.roomOriginY;
|
||||
if ((this->unk_20 - 0x118 < 0xDu) &&
|
||||
CheckGlobalFlag(LV1TARU_OPEN) &&
|
||||
(tmp - 0x6d < 0x17u) &&
|
||||
(tmp2 - 0x45 < 0x17u) &&
|
||||
(gPlayerEntity.height.HALF.HI == 0)) {
|
||||
if ((this->unk_20 - 0x118 < 0xDu) && CheckGlobalFlag(LV1TARU_OPEN) && (tmp - 0x6d < 0x17u) &&
|
||||
(tmp2 - 0x45 < 0x17u) && (gPlayerEntity.height.HALF.HI == 0)) {
|
||||
gPlayerState.playerAction = 3;
|
||||
gPlayerState.field_0x38 = 0;
|
||||
gPlayerEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x78;
|
||||
@@ -228,12 +201,7 @@ u32 sub_08058B08(ManagerC* this, u32 unk1, u32 unk2, const struct_08108228* unk3
|
||||
}
|
||||
}
|
||||
|
||||
const u16 gUnk_081082E8[0xC] = {
|
||||
0xB8, 0x80, 0x0,
|
||||
0xB8, 0x110, 0x2,
|
||||
0x118, 0x80, 0x2,
|
||||
0x118, 0x110, 0x0
|
||||
};
|
||||
const u16 gUnk_081082E8[0xC] = { 0xB8, 0x80, 0x0, 0xB8, 0x110, 0x2, 0x118, 0x80, 0x2, 0x118, 0x110, 0x0 };
|
||||
|
||||
void sub_08058B5C(ManagerC* this, u32 unk1) {
|
||||
gScreenTransition.transitioningOut = 1;
|
||||
@@ -242,14 +210,14 @@ void sub_08058B5C(ManagerC* this, u32 unk1) {
|
||||
gScreenTransition.areaID = gRoomControls.areaID;
|
||||
gScreenTransition.roomID = 6;
|
||||
gScreenTransition.playerState = unk1 & 1 ? 4 : 0;
|
||||
gScreenTransition.playerStartPos.HALF.x = gUnk_081082E8[unk1*3];
|
||||
gScreenTransition.playerStartPos.HALF.y = gUnk_081082E8[unk1*3+1];
|
||||
gSave.unk7 = gUnk_081082E8[unk1*3+2];
|
||||
gScreenTransition.playerStartPos.HALF.x = gUnk_081082E8[unk1 * 3];
|
||||
gScreenTransition.playerStartPos.HALF.y = gUnk_081082E8[unk1 * 3 + 1];
|
||||
gSave.unk7 = gUnk_081082E8[unk1 * 3 + 2];
|
||||
SoundReq(0x121);
|
||||
}
|
||||
|
||||
void sub_08058BC8(ManagerC* this) {
|
||||
struct BgAffineDstData * tmp = &gUnk_02017AA0[gUnk_03003DE4[0]*0xA0];
|
||||
struct BgAffineDstData* tmp = &gUnk_02017AA0[gUnk_03003DE4[0] * 0xA0];
|
||||
struct BgAffineSrcData tmp2;
|
||||
s32 tmp3;
|
||||
tmp2.texX = 0x10000;
|
||||
@@ -262,25 +230,25 @@ void sub_08058BC8(ManagerC* this) {
|
||||
do {
|
||||
u32 indx = ((tmp3 << 7) / 0xA0) & 0xFF;
|
||||
tmp2.sx = 0x100 + ((gSineTable[indx] * 3) >> 2);
|
||||
tmp2.sy = 0x100 - ((gSineTable[indx * 2] * 2) >> 5);//yes, it makes no sense to multiply first and then shift right, but it's matching this way
|
||||
tmp2.sy =
|
||||
0x100 - ((gSineTable[indx * 2] * 2) >>
|
||||
5); // yes, it makes no sense to multiply first and then shift right, but it's matching this way
|
||||
tmp2.texY = (this->unk_20 + tmp3) << 8;
|
||||
BgAffineSet(&tmp2, tmp, 1);
|
||||
tmp++;
|
||||
} while (++tmp3<0xA0u);
|
||||
tmp = &gUnk_02017BA0[gUnk_03003DE4[0]*0xA0];
|
||||
} while (++tmp3 < 0xA0u);
|
||||
tmp = &gUnk_02017BA0[gUnk_03003DE4[0] * 0xA0];
|
||||
gScreen.controls.bg2dx = tmp->pa;
|
||||
gScreen.controls.bg2dmx = tmp->pb;
|
||||
gScreen.controls.bg2dy = tmp->pc;
|
||||
gScreen.controls.bg2dmy = tmp->pd;
|
||||
gScreen.controls.bg2xPointLeastSig = ((union SplitWord *) &tmp->dx)->HALF.LO;
|
||||
gScreen.controls.bg2xPointMostSig = ((union SplitWord *) &tmp->dx)->HALF.HI;
|
||||
gScreen.controls.bg2yPointLeastSig = ((union SplitWord *) &tmp->dy)->HALF.LO;
|
||||
gScreen.controls.bg2yPointMostSig = ((union SplitWord *) &tmp->dy)->HALF.HI;
|
||||
gScreen.controls.bg2xPointLeastSig = ((union SplitWord*)&tmp->dx)->HALF.LO;
|
||||
gScreen.controls.bg2xPointMostSig = ((union SplitWord*)&tmp->dx)->HALF.HI;
|
||||
gScreen.controls.bg2yPointLeastSig = ((union SplitWord*)&tmp->dy)->HALF.LO;
|
||||
gScreen.controls.bg2yPointMostSig = ((union SplitWord*)&tmp->dy)->HALF.HI;
|
||||
}
|
||||
|
||||
const u16 gUnk_08108300[4] = {
|
||||
0xA4, 0x4C, 0xF4, 0x9C
|
||||
};
|
||||
const u16 gUnk_08108300[4] = { 0xA4, 0x4C, 0xF4, 0x9C };
|
||||
|
||||
void sub_08058CB0(ManagerC* this) {
|
||||
u32 tmp = gPlayerEntity.x.HALF.HI - gRoomControls.roomOriginX;
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ void sub_0805FE48(Entity* this) {
|
||||
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
|
||||
sub_0806F118(this);
|
||||
} else {
|
||||
ExecuteScriptCommandSet(this, *(ScriptExecutionContext **)&this->cutsceneBeh);
|
||||
ExecuteScriptCommandSet(this, *(ScriptExecutionContext**)&this->cutsceneBeh);
|
||||
sub_0805FF2C(this, *(void**)&this->cutsceneBeh);
|
||||
uVar4 = this->field_0x80.HWORD;
|
||||
if (uVar4 < 8) {
|
||||
|
||||
@@ -65,7 +65,7 @@ void sub_080866D8(Entity* this) {
|
||||
UpdateSpriteForCollisionLayer(entity);
|
||||
*((u32*)(&this->field_0x68)) |= mask;
|
||||
if (prop->unk8) {
|
||||
*((ScriptExecutionContext **)(&entity->cutsceneBeh)) = StartCutscene(entity, (u16*)prop->unk8);
|
||||
*((ScriptExecutionContext**)(&entity->cutsceneBeh)) = StartCutscene(entity, (u16*)prop->unk8);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,7 @@ static void sub_0808681C(Entity* this) {
|
||||
}
|
||||
|
||||
if (this->flags & 0x2) {
|
||||
ExecuteScriptCommandSet(this, *(ScriptExecutionContext **)&this->cutsceneBeh);
|
||||
ExecuteScriptCommandSet(this, *(ScriptExecutionContext**)&this->cutsceneBeh);
|
||||
sub_080868EC(this, *(void**)&this->cutsceneBeh);
|
||||
}
|
||||
}
|
||||
@@ -129,7 +129,7 @@ void sub_080868B0(Entity* this) {
|
||||
this->boundingBox = &gUnk_081206AC;
|
||||
this->actionDelay = 8;
|
||||
}
|
||||
ExecuteScriptCommandSet(this, *(ScriptExecutionContext **)&this->cutsceneBeh);
|
||||
ExecuteScriptCommandSet(this, *(ScriptExecutionContext**)&this->cutsceneBeh);
|
||||
sub_080868EC(this, *(void**)&this->cutsceneBeh);
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -487,7 +487,7 @@ void sub_080712F0(Entity* this) {
|
||||
sub_08079458();
|
||||
}
|
||||
|
||||
void sub_08071380(Entity *this) {
|
||||
void sub_08071380(Entity* this) {
|
||||
gPlayerState.field_0xa8 = 0xe;
|
||||
gUnk_0811BA9C[this->previousActionFlag](this);
|
||||
|
||||
@@ -499,7 +499,7 @@ void sub_08071380(Entity *this) {
|
||||
|
||||
if ((gInput.newKeys & 0x102) == 0)
|
||||
return;
|
||||
|
||||
|
||||
if (CheckIsDungeon() || gArea.field_0x17 == 3) {
|
||||
this->previousActionFlag = 7;
|
||||
this->actionDelay = 30;
|
||||
@@ -528,7 +528,7 @@ void sub_08071400(Entity* this) {
|
||||
|
||||
sub_08073904(this);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
|
||||
|
||||
if (gPlayerState.jumpStatus == 0) {
|
||||
gPlayerState.flags.all |= 0x20;
|
||||
this->previousActionFlag = 1;
|
||||
@@ -538,9 +538,9 @@ void sub_08071400(Entity* this) {
|
||||
gPlayerState.field_0x8 = 0x52c;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this->actionDelay = 8;
|
||||
|
||||
|
||||
if (gArea.field_0x17 != 3) {
|
||||
this->spritePriority.b0 = 3;
|
||||
}
|
||||
|
||||
+4
-25
@@ -21,29 +21,8 @@ extern void sub_080A306C();
|
||||
extern void NulledItem();
|
||||
|
||||
void (*const gPlayerItemFunctions[])() = {
|
||||
DeleteEntity,
|
||||
sub_080A7544,
|
||||
sub_0801B188,
|
||||
sub_0801B45C,
|
||||
sub_08018FCC,
|
||||
sub_080A2D74,
|
||||
sub_08054A40,
|
||||
sub_08056330,
|
||||
sub_080ADA30,
|
||||
sub_080704BC,
|
||||
DeleteEntity,
|
||||
DeleteEntity,
|
||||
sub_0801B898,
|
||||
CellOverwriteSet,
|
||||
SwordSpin,
|
||||
SwordBeam,
|
||||
sub_080ACBCC,
|
||||
Item11,
|
||||
sub_080700E8,
|
||||
sub_080ACF14,
|
||||
Item14,
|
||||
sub_080A306C,
|
||||
SwordBeam,
|
||||
NulledItem,
|
||||
CellOverwriteSet
|
||||
DeleteEntity, sub_080A7544, sub_0801B188, sub_0801B45C, sub_08018FCC, sub_080A2D74, sub_08054A40,
|
||||
sub_08056330, sub_080ADA30, sub_080704BC, DeleteEntity, DeleteEntity, sub_0801B898, CellOverwriteSet,
|
||||
SwordSpin, SwordBeam, sub_080ACBCC, Item11, sub_080700E8, sub_080ACF14, Item14,
|
||||
sub_080A306C, SwordBeam, NulledItem, CellOverwriteSet
|
||||
};
|
||||
|
||||
+70
-70
@@ -203,71 +203,71 @@ u32 sub_0807CF88(u32 arg0, u8* arg1) {
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/save/sub_0807D008.inc", u32 sub_0807D008(u32 param_1, SaveFile* saveFile)) {
|
||||
u32 set_0;
|
||||
char auStack32[8];
|
||||
u32 set_0;
|
||||
char auStack32[8];
|
||||
|
||||
struct_0807D1C4* unk_s;
|
||||
u32 t1;
|
||||
u32 t2;
|
||||
u32 ret;
|
||||
u32 temp;
|
||||
struct_0807D1C4* unk_s;
|
||||
u32 t1;
|
||||
u32 t2;
|
||||
u32 ret;
|
||||
u32 temp;
|
||||
|
||||
unk_s = sub_0807D1C4(param_1);
|
||||
t1 = sub_0807D0EC(unk_s->field_0x2, auStack32);
|
||||
if (t1 == 2) {
|
||||
if ((sub_0807D1D8(unk_s->field_0x6, (char*)saveFile, unk_s->field_0x0) == 0) ||
|
||||
(sub_0807D0A0((u16*)auStack32, (u16*)saveFile, (u32)unk_s->field_0x0) == 0)) {
|
||||
t1 = 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
unk_s = sub_0807D1C4(param_1);
|
||||
t1 = sub_0807D0EC(unk_s->field_0x2, auStack32);
|
||||
if (t1 == 2) {
|
||||
if ((sub_0807D1D8(unk_s->field_0x6, (char*)saveFile, unk_s->field_0x0) == 0) ||
|
||||
(sub_0807D0A0((u16*)auStack32, (u16*)saveFile, (u32)unk_s->field_0x0) == 0)) {
|
||||
t1 = 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
t2 = sub_0807D0EC(unk_s->field_0x4, auStack32);
|
||||
if (t2 == 2) {
|
||||
if ((sub_0807D1D8(unk_s->field_0x8, (char*)saveFile, unk_s->field_0x0) != 0) &&
|
||||
(sub_0807D0A0((u16*)auStack32, (u16*)saveFile, (u32)unk_s->field_0x0) != 0)) {
|
||||
return 1;
|
||||
}
|
||||
t2 = 0;
|
||||
}
|
||||
set_0 = 0;
|
||||
CpuSet(&set_0, saveFile, unk_s->field_0x0 >> 2 | CPU_SET_SRC_FIXED | CPU_SET_32BIT);
|
||||
temp = t1 | t2;
|
||||
ret = 0;
|
||||
if (temp == 0) {
|
||||
ret = -1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
t2 = sub_0807D0EC(unk_s->field_0x4, auStack32);
|
||||
if (t2 == 2) {
|
||||
if ((sub_0807D1D8(unk_s->field_0x8, (char*)saveFile, unk_s->field_0x0) != 0) &&
|
||||
(sub_0807D0A0((u16*)auStack32, (u16*)saveFile, (u32)unk_s->field_0x0) != 0)) {
|
||||
return 1;
|
||||
}
|
||||
t2 = 0;
|
||||
}
|
||||
set_0 = 0;
|
||||
CpuSet(&set_0, saveFile, unk_s->field_0x0 >> 2 | CPU_SET_SRC_FIXED | CPU_SET_32BIT);
|
||||
temp = t1 | t2;
|
||||
ret = 0;
|
||||
if (temp == 0) {
|
||||
ret = -1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
NONMATCH("asm/non_matching/save/sub_0807D0A0.inc", u32 sub_0807D0A0(u16* unk_1, u16* unk_2, u32 unk_3)) {
|
||||
u32 r0;
|
||||
u32 r0;
|
||||
|
||||
u32* u32_1 = (u32*)unk_1;
|
||||
u32* u32_1 = (u32*)unk_1;
|
||||
|
||||
u16 u0;
|
||||
u32 u1;
|
||||
u16 u0;
|
||||
u32 u1;
|
||||
|
||||
u0 = sub_0807D1A4(unk_1 + 2, 4);
|
||||
u0 = u0 + sub_0807D1A4(unk_2, unk_3);
|
||||
u0 = sub_0807D1A4(unk_1 + 2, 4);
|
||||
u0 = u0 + sub_0807D1A4(unk_2, unk_3);
|
||||
|
||||
u1 = unk_1[0];
|
||||
if (u1 != u0) {
|
||||
r0 = 0;
|
||||
} else {
|
||||
if (unk_1[1] == (-(u1 << 0x10) >> 0x10)) {
|
||||
if (*(u32_1 + 1) != 'MCZ3') {
|
||||
r0 = 0;
|
||||
} else {
|
||||
r0 = 1;
|
||||
}
|
||||
} else {
|
||||
u1 = unk_1[0];
|
||||
if (u1 != u0) {
|
||||
r0 = 0;
|
||||
} else {
|
||||
if (unk_1[1] == (-(u1 << 0x10) >> 0x10)) {
|
||||
if (*(u32_1 + 1) != 'MCZ3') {
|
||||
r0 = 0;
|
||||
} else {
|
||||
r0 = 1;
|
||||
}
|
||||
} else {
|
||||
r0 = 0;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
u32 sub_0807D0EC(u32 unk_1, const char* unk_2) {
|
||||
@@ -336,33 +336,33 @@ struct_0807D1C4* sub_0807D1C4(u32 unk_1) {
|
||||
|
||||
// these three are basically the same and wrong by basically one instruction in the wrong place
|
||||
NONMATCH("asm/non_matching/save/sub_0807D1D8.inc", u32 sub_0807D1D8(u32 unk_1, const char* unk_2, u32 unk_3)) {
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
NONMATCH("asm/non_matching/save/sub_0807D20C.inc", u32 sub_0807D20C(u32 unk_1, const char* unk_2, u32 unk_3)) {
|
||||
unk_3 >>= 3;
|
||||
unk_1 >>= 3;
|
||||
while (unk_3-- > 0) {
|
||||
if (sub_080B18DC(unk_1, unk_2)) {
|
||||
sub_080B18DC(unk_1, gUnk_0811E4B4);
|
||||
return 0;
|
||||
}
|
||||
unk_1++;
|
||||
unk_2 += 8;
|
||||
unk_3 >>= 3;
|
||||
unk_1 >>= 3;
|
||||
while (unk_3-- > 0) {
|
||||
if (sub_080B18DC(unk_1, unk_2)) {
|
||||
sub_080B18DC(unk_1, gUnk_0811E4B4);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
unk_1++;
|
||||
unk_2 += 8;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
NONMATCH("asm/non_matching/save/sub_0807D24C.inc", u32 sub_0807D24C(u32 unk_1, const char* unk_2, u32 unk_3)) {
|
||||
unk_3 >>= 3;
|
||||
unk_1 >>= 3;
|
||||
while (unk_3-- > 0) {
|
||||
if (sub_080B180C(unk_1, unk_2))
|
||||
return 0;
|
||||
unk_1++;
|
||||
unk_2 += 8;
|
||||
}
|
||||
return 1;
|
||||
unk_3 >>= 3;
|
||||
unk_1 >>= 3;
|
||||
while (unk_3-- > 0) {
|
||||
if (sub_080B180C(unk_1, unk_2))
|
||||
return 0;
|
||||
unk_1++;
|
||||
unk_2 += 8;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ extern u8 gBG3Buffer[];
|
||||
extern void (*const gUnk_08109A30[])();
|
||||
|
||||
void HandleDebugTextScreen() {
|
||||
gUnk_08109A30[gUnk_03001000.funcIndex]();
|
||||
gUnk_08109A30[gUnk_03001000.funcIndex]();
|
||||
}
|
||||
|
||||
void sub_0805FA04(void) {
|
||||
|
||||
+62
-166
@@ -12,7 +12,7 @@ void sub_0807DAF0(Entity*, ScriptExecutionContext*, u16*);
|
||||
void sub_0807DB88(ScriptExecutionContext*, u16*);
|
||||
void sub_0807DE80(Entity*);
|
||||
void sub_0807DF38(void);
|
||||
void nullsub_507 (Entity*, ScriptExecutionContext*);
|
||||
void nullsub_507(Entity*, ScriptExecutionContext*);
|
||||
void sub_0807E004(Entity*, ScriptExecutionContext*);
|
||||
void sub_0807E014(Entity*, ScriptExecutionContext*);
|
||||
void sub_0807E024(Entity*, ScriptExecutionContext*);
|
||||
@@ -71,7 +71,7 @@ void sub_0807E75C(Entity*, ScriptExecutionContext*);
|
||||
void sub_0807E778(Entity*, ScriptExecutionContext*);
|
||||
void sub_0807E788(Entity*, ScriptExecutionContext*);
|
||||
void sub_0807E79C(Entity*, ScriptExecutionContext*);
|
||||
void nullsub_508 (Entity*, ScriptExecutionContext*);
|
||||
void nullsub_508(Entity*, ScriptExecutionContext*);
|
||||
void sub_0807E7B0(Entity*, ScriptExecutionContext*);
|
||||
void sub_0807E7C4(Entity*, ScriptExecutionContext*);
|
||||
void sub_0807E7D8(Entity*, ScriptExecutionContext*);
|
||||
@@ -118,7 +118,7 @@ void sub_0807EBC8(Entity*, ScriptExecutionContext*);
|
||||
void sub_0807EBD8(Entity*, ScriptExecutionContext*);
|
||||
void sub_0807EBF4(Entity*, ScriptExecutionContext*);
|
||||
void sub_0807EC08(Entity*, ScriptExecutionContext*);
|
||||
void nullsub_509 (Entity*, ScriptExecutionContext*);
|
||||
void nullsub_509(Entity*, ScriptExecutionContext*);
|
||||
void sub_0807EC1C(Entity*, ScriptExecutionContext*);
|
||||
void sub_0807EC44(Entity*, ScriptExecutionContext*);
|
||||
void sub_0807EC64(Entity*, ScriptExecutionContext*);
|
||||
@@ -155,146 +155,29 @@ extern void CreateSpeechBubbleExclamationMark(Entity*, u32, u32);
|
||||
extern void CreateSpeechBubbleQuestionMark(Entity*, u32, u32);
|
||||
extern void sub_0801C4A0(u32);
|
||||
|
||||
void (* const gUnk_0811E524[])() = {
|
||||
nullsub_507,
|
||||
sub_0807E004,
|
||||
sub_0807E014,
|
||||
sub_0807E024,
|
||||
sub_0807E050,
|
||||
sub_0807E064,
|
||||
sub_0807E078,
|
||||
sub_0807E0A0,
|
||||
sub_0807E0B8,
|
||||
sub_0807E0CC,
|
||||
sub_0807E0E0,
|
||||
sub_0807E10C,
|
||||
sub_0807E124,
|
||||
sub_0807E148,
|
||||
sub_0807E158,
|
||||
sub_0807E188,
|
||||
void (*const gUnk_0811E524[])() = {
|
||||
nullsub_507, sub_0807E004, sub_0807E014, sub_0807E024, sub_0807E050, sub_0807E064, sub_0807E078, sub_0807E0A0,
|
||||
sub_0807E0B8, sub_0807E0CC, sub_0807E0E0, sub_0807E10C, sub_0807E124, sub_0807E148, sub_0807E158, sub_0807E188,
|
||||
sub_0807E1D8,
|
||||
sub_0807E4AC,//defined out of order
|
||||
sub_0807E200,
|
||||
sub_0807E220,
|
||||
sub_0807E240,
|
||||
sub_0807E260,
|
||||
sub_0807E280,
|
||||
sub_0807E2A8,
|
||||
sub_0807E2E4,
|
||||
sub_0807E30C,
|
||||
sub_0807E390,
|
||||
sub_0807E3BC,
|
||||
sub_0807E3E8,
|
||||
sub_0807E40C,
|
||||
sub_0807E42C,
|
||||
sub_0807E48C,
|
||||
sub_0807E4CC,
|
||||
sub_0807E4EC,
|
||||
sub_0807E514,
|
||||
sub_0807E538,
|
||||
sub_0807E564,
|
||||
sub_0807E584,
|
||||
sub_0807E5A0,
|
||||
sub_0807E5CC,
|
||||
sub_0807E5F8,
|
||||
sub_0807E610,
|
||||
sub_0807E628,
|
||||
sub_0807E634,
|
||||
sub_0807E644,
|
||||
sub_0807E650,
|
||||
sub_0807E65C,
|
||||
sub_0807E668,
|
||||
sub_0807E674,
|
||||
sub_0807E680,
|
||||
sub_0807E690,
|
||||
sub_0807E6AC,
|
||||
sub_0807E6DC,
|
||||
sub_0807E700,
|
||||
sub_0807E72C,
|
||||
sub_0807E75C,
|
||||
sub_0807E778,
|
||||
sub_0807E788,
|
||||
sub_0807E79C,
|
||||
nullsub_508,
|
||||
sub_0807E7B0,
|
||||
sub_0807E7C4,
|
||||
sub_0807E7D8,
|
||||
sub_0807E7EC,
|
||||
sub_0807E800,
|
||||
sub_0807E80C,
|
||||
sub_0807E858,
|
||||
sub_0807E864,
|
||||
sub_0807E878,
|
||||
sub_0807E888,
|
||||
sub_0807E898,
|
||||
sub_0807E8C4,
|
||||
sub_0807E8D4,
|
||||
sub_0807E8E4,
|
||||
sub_0807E8E4,//duplicate
|
||||
sub_0807E8E4,//duplicate
|
||||
sub_0807E8E4,//duplicate
|
||||
sub_0807E908,
|
||||
sub_0807E914,
|
||||
sub_0807E924,
|
||||
sub_0807E930,
|
||||
sub_0807E944,
|
||||
sub_0807E974,
|
||||
sub_0807E9D4,
|
||||
sub_0807E9DC,
|
||||
sub_0807E9E4,
|
||||
sub_0807E9F0,
|
||||
sub_0807EA4C,
|
||||
sub_0807EA88,
|
||||
sub_0807EA94,
|
||||
sub_0807EAB4,
|
||||
sub_0807EAC0,
|
||||
sub_0807EAD0,
|
||||
sub_0807EAF0,
|
||||
sub_0807EB18,
|
||||
sub_0807EB28,
|
||||
sub_0807EB38,
|
||||
sub_0807EB44,
|
||||
sub_0807EB4C,
|
||||
sub_0807EB74,
|
||||
sub_0807EB8C,
|
||||
sub_0807EBA8,
|
||||
sub_0807EBB0,
|
||||
sub_0807EBC0,
|
||||
sub_0807EBC8,
|
||||
sub_0807EBD8,
|
||||
sub_0807EBF4,
|
||||
sub_0807EC08,
|
||||
nullsub_509,
|
||||
sub_0807EC1C,
|
||||
sub_0807EC64,
|
||||
sub_0807EC94,
|
||||
sub_0807ECC4,
|
||||
sub_0807ECF4,
|
||||
sub_0807ED24,
|
||||
sub_0807EDD4,
|
||||
sub_0807EE04,
|
||||
sub_0807EE30,
|
||||
sub_0807EEB4,
|
||||
sub_0807EEF4,
|
||||
sub_0807EF3C,
|
||||
sub_0807EF80,
|
||||
sub_0807EF90,
|
||||
sub_0807EFA0,
|
||||
sub_0807EFAC,
|
||||
sub_0807EFD4,
|
||||
sub_0807EFE4,
|
||||
sub_0807EFF4,
|
||||
sub_0807F004,
|
||||
sub_0807F010,
|
||||
sub_0807F034,
|
||||
sub_0807F050,
|
||||
sub_0807F060,
|
||||
sub_0807F078,
|
||||
sub_0807F088,
|
||||
sub_0807F098,
|
||||
sub_0807F0A4,
|
||||
sub_0807F0B4,
|
||||
sub_0807F0C8
|
||||
sub_0807E4AC, // defined out of order
|
||||
sub_0807E200, sub_0807E220, sub_0807E240, sub_0807E260, sub_0807E280, sub_0807E2A8, sub_0807E2E4, sub_0807E30C,
|
||||
sub_0807E390, sub_0807E3BC, sub_0807E3E8, sub_0807E40C, sub_0807E42C, sub_0807E48C, sub_0807E4CC, sub_0807E4EC,
|
||||
sub_0807E514, sub_0807E538, sub_0807E564, sub_0807E584, sub_0807E5A0, sub_0807E5CC, sub_0807E5F8, sub_0807E610,
|
||||
sub_0807E628, sub_0807E634, sub_0807E644, sub_0807E650, sub_0807E65C, sub_0807E668, sub_0807E674, sub_0807E680,
|
||||
sub_0807E690, sub_0807E6AC, sub_0807E6DC, sub_0807E700, sub_0807E72C, sub_0807E75C, sub_0807E778, sub_0807E788,
|
||||
sub_0807E79C, nullsub_508, sub_0807E7B0, sub_0807E7C4, sub_0807E7D8, sub_0807E7EC, sub_0807E800, sub_0807E80C,
|
||||
sub_0807E858, sub_0807E864, sub_0807E878, sub_0807E888, sub_0807E898, sub_0807E8C4, sub_0807E8D4, sub_0807E8E4,
|
||||
sub_0807E8E4, // duplicate
|
||||
sub_0807E8E4, // duplicate
|
||||
sub_0807E8E4, // duplicate
|
||||
sub_0807E908, sub_0807E914, sub_0807E924, sub_0807E930, sub_0807E944, sub_0807E974, sub_0807E9D4, sub_0807E9DC,
|
||||
sub_0807E9E4, sub_0807E9F0, sub_0807EA4C, sub_0807EA88, sub_0807EA94, sub_0807EAB4, sub_0807EAC0, sub_0807EAD0,
|
||||
sub_0807EAF0, sub_0807EB18, sub_0807EB28, sub_0807EB38, sub_0807EB44, sub_0807EB4C, sub_0807EB74, sub_0807EB8C,
|
||||
sub_0807EBA8, sub_0807EBB0, sub_0807EBC0, sub_0807EBC8, sub_0807EBD8, sub_0807EBF4, sub_0807EC08, nullsub_509,
|
||||
sub_0807EC1C, sub_0807EC64, sub_0807EC94, sub_0807ECC4, sub_0807ECF4, sub_0807ED24, sub_0807EDD4, sub_0807EE04,
|
||||
sub_0807EE30, sub_0807EEB4, sub_0807EEF4, sub_0807EF3C, sub_0807EF80, sub_0807EF90, sub_0807EFA0, sub_0807EFAC,
|
||||
sub_0807EFD4, sub_0807EFE4, sub_0807EFF4, sub_0807F004, sub_0807F010, sub_0807F034, sub_0807F050, sub_0807F060,
|
||||
sub_0807F078, sub_0807F088, sub_0807F098, sub_0807F0A4, sub_0807F0B4, sub_0807F0C8
|
||||
};
|
||||
|
||||
extern const u16 gUnk_08016984;
|
||||
@@ -599,16 +482,18 @@ void sub_0807DF50(void) {
|
||||
}
|
||||
|
||||
void ExecuteScriptCommandSet(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
if (!unk2->unk_00) return;
|
||||
if (!unk2->unk_00)
|
||||
return;
|
||||
if (unk2->unk_10) {
|
||||
unk2->unk_10--;
|
||||
} else {
|
||||
struct_02033280 * tmp2 = &gUnk_02033280;
|
||||
struct_02033280* tmp2 = &gUnk_02033280;
|
||||
tmp2->unk_07 = 0;
|
||||
do {
|
||||
u32 cmd = GetNextScriptCommandHalfword(unk2->unk_00);
|
||||
u16* tmp;
|
||||
if (cmd == 0xFFFF) return;
|
||||
if (cmd == 0xFFFF)
|
||||
return;
|
||||
tmp2->unk_06 = cmd >> 0xA;
|
||||
tmp2->unk_04 = cmd & 0x3FF;
|
||||
tmp = unk2->unk_00;
|
||||
@@ -622,7 +507,8 @@ void ExecuteScriptCommandSet(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
}
|
||||
}
|
||||
|
||||
void nullsub_507(Entity* unk1, ScriptExecutionContext* unk2) {}
|
||||
void nullsub_507(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
}
|
||||
|
||||
void sub_0807E004(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
gUnk_02033280.unk_07 |= 2;
|
||||
@@ -660,7 +546,7 @@ void sub_0807E078(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
}
|
||||
|
||||
void sub_0807E0A0(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
unk2->unk_00 = (u16*) GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00);
|
||||
unk2->unk_00 = (u16*)GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00);
|
||||
gUnk_02033280.unk_06 = 0;
|
||||
}
|
||||
|
||||
@@ -684,11 +570,13 @@ void sub_0807E0E0(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
}
|
||||
|
||||
void sub_0807E10C(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
((void (*)(Entity*, ScriptExecutionContext*)) GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00))(unk1, unk2);
|
||||
((void (*)(Entity*, ScriptExecutionContext*))GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00))(unk1,
|
||||
unk2);
|
||||
}
|
||||
|
||||
void sub_0807E124(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
void (* tmp)(Entity*, ScriptExecutionContext*) = (void (*)(Entity*, ScriptExecutionContext*)) GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00);
|
||||
void (*tmp)(Entity*, ScriptExecutionContext*) =
|
||||
(void (*)(Entity*, ScriptExecutionContext*))GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00);
|
||||
unk2->unk_04 = GetNextScriptCommandWord(unk2->unk_00 + 3);
|
||||
tmp(unk1, unk2);
|
||||
}
|
||||
@@ -701,7 +589,8 @@ void sub_0807E158(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
u32 tmp = GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00);
|
||||
u32 tmp2 = 0;
|
||||
u32 tmp3 = gUnk_02033280.unk_00;
|
||||
if ((tmp3 & tmp) == tmp) tmp2 = 1;
|
||||
if ((tmp3 & tmp) == tmp)
|
||||
tmp2 = 1;
|
||||
unk2->unk_14 = tmp2;
|
||||
gUnk_02033280.unk_00 = tmp3 & ~tmp;
|
||||
gUnk_02033280.unk_07 |= 1;
|
||||
@@ -762,7 +651,7 @@ void sub_0807E280(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
width &= 0xFF;
|
||||
x = unk2->unk_00[1];
|
||||
y = unk2->unk_00[2];
|
||||
unk2->unk_14 = CheckPlayerInRegion(x,y,width, height);
|
||||
unk2->unk_14 = CheckPlayerInRegion(x, y, width, height);
|
||||
gUnk_02033280.unk_07 |= 1;
|
||||
}
|
||||
|
||||
@@ -772,7 +661,7 @@ void sub_0807E2A8(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
height = unk2->unk_00[1] >> 8;
|
||||
x = unk1->x.HALF.HI - gRoomControls.roomOriginX;
|
||||
y = unk1->y.HALF.HI - gRoomControls.roomOriginY;
|
||||
unk2->unk_14 = CheckPlayerInRegion(x,y,width, height);
|
||||
unk2->unk_14 = CheckPlayerInRegion(x, y, width, height);
|
||||
gUnk_02033280.unk_07 |= 1;
|
||||
}
|
||||
|
||||
@@ -787,9 +676,8 @@ void sub_0807E2E4(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
}
|
||||
|
||||
void sub_0807E30C(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
if ((unk2->unk_1A & 0xF) == 0
|
||||
&& (gPlayerState.flags.all & 0x80) == 0
|
||||
&& sub_080041A0(unk1, &gPlayerEntity, 0x28, 0x28)) {
|
||||
if ((unk2->unk_1A & 0xF) == 0 && (gPlayerState.flags.all & 0x80) == 0 &&
|
||||
sub_080041A0(unk1, &gPlayerEntity, 0x28, 0x28)) {
|
||||
unk1->animationState = sub_0806F5B0(GetFacingDirection(unk1, &gPlayerEntity));
|
||||
}
|
||||
unk2->unk_1A++;
|
||||
@@ -994,7 +882,8 @@ void sub_0807E79C(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
sub_080500F4(gUnk_02033280.unk_08);
|
||||
}
|
||||
|
||||
void nullsub_508(Entity* unk1, ScriptExecutionContext* unk2) {}
|
||||
void nullsub_508(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
}
|
||||
|
||||
void sub_0807E7B0(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
DoFade(4, gUnk_02033280.unk_08);
|
||||
@@ -1103,16 +992,19 @@ void sub_0807E944(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
void sub_0807E974(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
switch (unk2->unk_18) {
|
||||
default:
|
||||
if (!--unk2->unk_19) return;
|
||||
if (!--unk2->unk_19)
|
||||
return;
|
||||
break;
|
||||
case 0:
|
||||
if (!unk1->interactType) break;
|
||||
if (!unk1->interactType)
|
||||
break;
|
||||
unk1->interactType = 0;
|
||||
unk2->unk_18++;
|
||||
TextboxNoOverlapFollow(unk2->unk_00[1]);
|
||||
break;
|
||||
case 1:
|
||||
if (gTextBox.doTextBox & 0x7F) break;
|
||||
if (gTextBox.doTextBox & 0x7F)
|
||||
break;
|
||||
unk2->unk_18 = 2;
|
||||
unk2->unk_19 = 0xF;
|
||||
break;
|
||||
@@ -1152,7 +1044,7 @@ void sub_0807E9F0(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
sub_0807919C();
|
||||
gPlayerState.field_0x8b = 1;
|
||||
} else {
|
||||
lbl:
|
||||
lbl:
|
||||
gUnk_02033280.unk_06 = 0;
|
||||
}
|
||||
}
|
||||
@@ -1193,7 +1085,7 @@ void sub_0807EAD0(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
|
||||
void sub_0807EAF0(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
if (gUnk_02033280.unk_06 > unk2->unk_04) {
|
||||
u16 * tmp = unk2->unk_00 + unk2->unk_04;
|
||||
u16* tmp = unk2->unk_00 + unk2->unk_04;
|
||||
TextboxNoOverlapFollow(tmp[1]);
|
||||
} else {
|
||||
TextboxNoOverlapFollow(0);
|
||||
@@ -1217,7 +1109,8 @@ void sub_0807EB44(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
}
|
||||
|
||||
void sub_0807EB4C(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
unk1->animationState = sub_0806F5B0(sub_080045B4(unk1, unk2->unk_00[1] + gRoomControls.roomOriginX, unk2->unk_00[2] + gRoomControls.roomOriginY));
|
||||
unk1->animationState = sub_0806F5B0(
|
||||
sub_080045B4(unk1, unk2->unk_00[1] + gRoomControls.roomOriginX, unk2->unk_00[2] + gRoomControls.roomOriginY));
|
||||
}
|
||||
|
||||
void sub_0807EB74(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
@@ -1259,7 +1152,8 @@ void sub_0807EC08(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
CopyPosition(&gPlayerEntity, unk1);
|
||||
}
|
||||
|
||||
void nullsub_509(Entity* unk1, ScriptExecutionContext* unk2) {}
|
||||
void nullsub_509(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
}
|
||||
|
||||
void sub_0807EC1C(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
if (!unk2->unk_18) {
|
||||
@@ -1332,7 +1226,8 @@ void sub_0807ED24(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
tmp = unk2->unk_00[2];
|
||||
tmp3 = unk1->y.HALF.HI - gRoomControls.roomOriginY;
|
||||
unk2->unk_20.WORD = ((tmp - tmp3) << 0x10) / unk2->unk_12;
|
||||
unk1->animationState = sub_0806F5B0(sub_080045B4(unk1, unk2->unk_00[1] + gRoomControls.roomOriginX, unk2->unk_00[2] + gRoomControls.roomOriginY));
|
||||
unk1->animationState = sub_0806F5B0(sub_080045B4(unk1, unk2->unk_00[1] + gRoomControls.roomOriginX,
|
||||
unk2->unk_00[2] + gRoomControls.roomOriginY));
|
||||
unk2->unk_08 |= 2;
|
||||
} else {
|
||||
if (!--unk2->unk_12) {
|
||||
@@ -1407,11 +1302,12 @@ void sub_0807EEF4(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
void sub_0807EF3C(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
if (!unk2->unk_18) {
|
||||
unk2->unk_18 = 1;
|
||||
unk1->field_0x20 = ((s16) unk2->unk_00[1]) << 8;
|
||||
unk1->field_0x20 = ((s16)unk2->unk_00[1]) << 8;
|
||||
unk2->unk_1C.HALF.LO = unk2->unk_00[2] << 8;
|
||||
sub_08003FC4(unk1, (u16)unk2->unk_1C.HALF.LO);
|
||||
} else {
|
||||
if (!sub_08003FC4(unk1, (u16)unk2->unk_1C.HALF.LO)) return;
|
||||
if (!sub_08003FC4(unk1, (u16)unk2->unk_1C.HALF.LO))
|
||||
return;
|
||||
}
|
||||
gUnk_02033280.unk_06 = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user