Decompile movement

This commit is contained in:
octorock
2022-02-06 13:41:48 +01:00
parent b9876fd30f
commit 75c57e3124
38 changed files with 1722 additions and 174 deletions
+12 -12
View File
@@ -154,23 +154,23 @@ sub_080197A0: @ 0x080197A0
thumb_func_start SetBGDefaults
SetBGDefaults: @ 0x080197AC
ldr r0, _080197C4 @ =gUnk_02025EB0
ldr r0, _080197C4 @ =gMapBottom
ldr r1, _080197C8 @ =gBGAffSettings
str r1, [r0]
ldr r2, _080197CC @ =gUnk_080B77C0
ldrh r0, [r2]
strh r0, [r1]
ldr r0, _080197D0 @ =gUnk_0200B650
ldr r0, _080197D0 @ =gMapTop
subs r1, #0xc
str r1, [r0]
ldrh r0, [r2, #2]
strh r0, [r1]
bx lr
.align 2, 0
_080197C4: .4byte gUnk_02025EB0
_080197C4: .4byte gMapBottom
_080197C8: .4byte gScreen + 0x20
_080197CC: .4byte gUnk_080B77C0
_080197D0: .4byte gUnk_0200B650
_080197D0: .4byte gMapTop
thumb_func_start sub_080197D4
sub_080197D4: @ 0x080197D4
@@ -1061,7 +1061,7 @@ _08019E54:
lsls r1, r7, #1
cmp r0, #3
bne _08019E84
ldr r0, _08019E7C @ =gUnk_0200B650
ldr r0, _08019E7C @ =gMapTop
adds r0, #4
adds r2, r1, r0
ldrh r0, [r2]
@@ -1075,7 +1075,7 @@ _08019E54:
mov sb, r5
b _08019E98
.align 2, 0
_08019E7C: .4byte gUnk_0200B650
_08019E7C: .4byte gMapTop
_08019E80: .4byte 0x0000400C
_08019E84:
mov r0, r8
@@ -2741,7 +2741,7 @@ sub_0801AB08: @ 0x0801AB08
sub sp, #8
adds r5, r0, #0
mov r8, r1
ldr r0, _0801AB4C @ =gUnk_02025EB0
ldr r0, _0801AB4C @ =gMapBottom
movs r1, #2
cmp r8, r0
bne _0801AB22
@@ -2770,7 +2770,7 @@ _0801AB40:
lsls r0, r0, #2
b _0801AB64
.align 2, 0
_0801AB4C: .4byte gUnk_02025EB0
_0801AB4C: .4byte gMapBottom
_0801AB50: .4byte 0x00003004
_0801AB54: .4byte 0x00003FFF
_0801AB58:
@@ -3228,14 +3228,14 @@ _0801AEB6:
ands r0, r1
cmp r0, #0
bne _0801AF0C
ldr r1, _0801AEFC @ =gUnk_02025EB0
ldr r1, _0801AEFC @ =gMapBottom
ldr r0, [r1]
cmp r0, #0
beq _0801AED0
ldr r0, _0801AF00 @ =gUnk_02019EE0
bl sub_0801AB08
_0801AED0:
ldr r1, _0801AF04 @ =gUnk_0200B650
ldr r1, _0801AF04 @ =gMapTop
ldr r0, [r1]
cmp r0, #0
beq _0801AF10
@@ -3250,9 +3250,9 @@ _0801AEEC: .4byte 0x0600F000
_0801AEF0: .4byte gUnk_03004030
_0801AEF4: .4byte 0x0000088C
_0801AEF8: .4byte 0x00000888
_0801AEFC: .4byte gUnk_02025EB0
_0801AEFC: .4byte gMapBottom
_0801AF00: .4byte gUnk_02019EE0
_0801AF04: .4byte gUnk_0200B650
_0801AF04: .4byte gMapTop
_0801AF08: .4byte gMapDataTopSpecial
_0801AF0C:
bl sub_0807C4F8
+4 -4
View File
@@ -261,9 +261,9 @@ sub_08053758: @ 0x08053758
strb r4, [r1, #0x10]
ldr r0, _080537E0 @ =gUnk_02032EC0
strb r3, [r0, #6]
ldr r0, _080537E4 @ =gUnk_02025EB0
ldr r0, _080537E4 @ =gMapBottom
str r2, [r0]
ldr r0, _080537E8 @ =gUnk_0200B650
ldr r0, _080537E8 @ =gMapTop
str r2, [r0]
ldr r0, _080537EC @ =gRoomControls
str r2, [r0, #0x30]
@@ -311,8 +311,8 @@ sub_08053758: @ 0x08053758
.align 2, 0
_080537DC: .4byte gMenu
_080537E0: .4byte gUnk_02032EC0
_080537E4: .4byte gUnk_02025EB0
_080537E8: .4byte gUnk_0200B650
_080537E4: .4byte gMapBottom
_080537E8: .4byte gMapTop
_080537EC: .4byte gRoomControls
_080537F0: .4byte gScreen
_080537F4: .4byte 0x00002244
+2 -2
View File
@@ -5741,7 +5741,7 @@ SetTileType: @ 0x0807B314
ands r0, r1
cmp r0, #0
beq _0807B36C
ldr r0, _0807B3B4 @ =gUnk_02025EB0
ldr r0, _0807B3B4 @ =gMapBottom
ldr r1, _0807B3AC @ =0x00002004
adds r0, r0, r1
adds r0, r4, r0
@@ -5778,7 +5778,7 @@ _0807B3A4: .4byte 0x00006004
_0807B3A8: .4byte gUnk_080B3E80
_0807B3AC: .4byte 0x00002004
_0807B3B0: .4byte gRoomControls
_0807B3B4: .4byte gUnk_02025EB0
_0807B3B4: .4byte gMapBottom
_0807B3B8: .4byte 0x0000B004
_0807B3BC: .4byte gUnk_080B37A0
_0807B3C0: .4byte gUnk_02019EE0
+14 -14
View File
@@ -967,7 +967,7 @@ LoadRoomGfx: @ 0x0807C0DC
ldr r0, [r0]
ldr r0, [r0, #0xc]
bl sub_080197D4
ldr r2, _0807C170 @ =gUnk_02025EB0
ldr r2, _0807C170 @ =gMapBottom
ldrh r1, [r2, #4]
ldr r0, _0807C174 @ =0x0000FFFF
cmp r1, r0
@@ -994,7 +994,7 @@ _0807C160: .4byte gUnk_02019EE0
_0807C164: .4byte gMapDataTopSpecial
_0807C168: .4byte gArea
_0807C16C: .4byte 0x0000085C
_0807C170: .4byte gUnk_02025EB0
_0807C170: .4byte gMapBottom
_0807C174: .4byte 0x0000FFFF
_0807C178:
adds r0, r2, #4
@@ -1129,10 +1129,10 @@ _0807C280:
bl sub_0807C460
_0807C2A0:
bl sub_0807BC84
ldr r4, _0807C2D4 @ =gUnk_02025EB0
ldr r4, _0807C2D4 @ =gMapBottom
adds r0, r4, #0
bl sub_08080B60
ldr r5, _0807C2D8 @ =gUnk_0200B650
ldr r5, _0807C2D8 @ =gMapTop
adds r0, r5, #0
bl sub_08080B60
mov r3, sb
@@ -1148,8 +1148,8 @@ _0807C2A0:
.align 2, 0
_0807C2CC: .4byte gUnk_02027EB4
_0807C2D0: .4byte gUnk_0200D654
_0807C2D4: .4byte gUnk_02025EB0
_0807C2D8: .4byte gUnk_0200B650
_0807C2D4: .4byte gMapBottom
_0807C2D8: .4byte gMapTop
_0807C2DC: .4byte gUnk_02019EE0
_0807C2E0: .4byte gMapDataTopSpecial
_0807C2E4:
@@ -1233,7 +1233,7 @@ _0807C358: @ jump table
.4byte _0807C400 @ case 23
.4byte _0807C3E4 @ case 24
_0807C3BC:
ldr r0, _0807C3D8 @ =gUnk_02025EB0
ldr r0, _0807C3D8 @ =gMapBottom
ldr r2, [r0]
cmp r2, #0
beq _0807C3CC
@@ -1249,11 +1249,11 @@ _0807C3CC:
strh r0, [r2]
b _0807C444
.align 2, 0
_0807C3D8: .4byte gUnk_02025EB0
_0807C3D8: .4byte gMapBottom
_0807C3DC: .4byte gScreen
_0807C3E0: .4byte 0x0000FDFF
_0807C3E4:
ldr r0, _0807C3F8 @ =gUnk_0200B650
ldr r0, _0807C3F8 @ =gMapTop
ldr r1, [r0]
cmp r1, #0
beq _0807C3F2
@@ -1264,10 +1264,10 @@ _0807C3F2:
bl sub_0807C5B0
b _0807C444
.align 2, 0
_0807C3F8: .4byte gUnk_0200B650
_0807C3F8: .4byte gMapTop
_0807C3FC: .4byte gUnk_080B77C0
_0807C400:
ldr r0, _0807C44C @ =gUnk_02025EB0
ldr r0, _0807C44C @ =gMapBottom
ldr r1, [r0]
cmp r1, #0
beq _0807C40E
@@ -1275,7 +1275,7 @@ _0807C400:
ldrh r0, [r0]
strh r0, [r1]
_0807C40E:
ldr r0, _0807C454 @ =gUnk_0200B650
ldr r0, _0807C454 @ =gMapTop
ldr r1, [r0]
cmp r1, #0
beq _0807C41C
@@ -1309,9 +1309,9 @@ _0807C444:
mov sb, r4
pop {r4, r5, r6, r7, pc}
.align 2, 0
_0807C44C: .4byte gUnk_02025EB0
_0807C44C: .4byte gMapBottom
_0807C450: .4byte gUnk_080B77C0
_0807C454: .4byte gUnk_0200B650
_0807C454: .4byte gMapTop
_0807C458: .4byte gScreen
_0807C45C: .4byte gArea
+8 -8
View File
@@ -206,7 +206,7 @@ sub_08080BC4: @ 0x08080BC4
adds r0, r0, r2
ldr r1, _08080C44 @ =gUnk_080169A4
adds r2, r0, r1
ldr r4, _08080C48 @ =gUnk_02025EB0
ldr r4, _08080C48 @ =gMapBottom
ldr r1, [r4]
cmp r1, #0
beq _08080C16
@@ -220,7 +220,7 @@ sub_08080BC4: @ 0x08080BC4
adds r0, r0, r6
strh r0, [r1, #4]
_08080C16:
ldr r4, _08080C4C @ =gUnk_0200B650
ldr r4, _08080C4C @ =gMapTop
ldr r1, [r4]
cmp r1, #0
beq _08080C30
@@ -245,10 +245,10 @@ _08080C30:
.align 2, 0
_08080C40: .4byte gRoomControls
_08080C44: .4byte gUnk_080169A4
_08080C48: .4byte gUnk_02025EB0
_08080C4C: .4byte gUnk_0200B650
_08080C48: .4byte gMapBottom
_08080C4C: .4byte gMapTop
_08080C50:
ldr r0, _08080C78 @ =gUnk_02025EB0
ldr r0, _08080C78 @ =gMapBottom
ldr r1, [r0]
cmp r1, #0
beq _08080C5E
@@ -256,7 +256,7 @@ _08080C50:
ldr r0, [r0]
strh r6, [r0, #4]
_08080C5E:
ldr r0, _08080C7C @ =gUnk_0200B650
ldr r0, _08080C7C @ =gMapTop
ldr r1, [r0]
cmp r1, #0
beq _08080C6C
@@ -272,8 +272,8 @@ _08080C6C:
_08080C76:
pop {r4, r5, r6, pc}
.align 2, 0
_08080C78: .4byte gUnk_02025EB0
_08080C7C: .4byte gUnk_0200B650
_08080C78: .4byte gMapBottom
_08080C7C: .4byte gMapTop
thumb_func_start sub_08080C80
sub_08080C80: @ 0x08080C80
+288
View File
@@ -0,0 +1,288 @@
.syntax unified
push {r4, r5, r6, r7, lr}
mov r7, sl
mov r6, sb
mov r5, r8
push {r5, r6, r7}
sub sp, #0x18
str r0, [sp]
str r1, [sp, #4]
adds r4, r2, #0
adds r0, #0x38
ldrb r0, [r0]
bl GetLayerByIndex
ldr r1, _080AE624 @ =0x00002004
adds r5, r0, r1
ldr r2, [sp]
ldr r2, [r2, #0x48]
str r2, [sp, #8]
ldr r0, [sp]
movs r2, #0x2e
ldrsh r1, [r0, r2]
ldr r2, [sp, #8]
movs r0, #0
ldrsb r0, [r2, r0]
adds r1, r1, r0
str r1, [sp, #0xc]
ldr r0, [sp]
movs r2, #0x32
ldrsh r1, [r0, r2]
ldr r2, [sp, #8]
movs r0, #1
ldrsb r0, [r2, r0]
adds r1, r1, r0
mov sl, r1
ldrb r0, [r2, #2]
mov sb, r0
ldrb r1, [r2, #3]
mov r8, r1
movs r0, #0xf
ldr r2, [sp, #4]
ands r0, r2
cmp r0, #0
beq _080AE65C
cmp r2, #0xf
bhi _080AE628
ldr r7, [sp, #0xc]
add r7, sb
adds r0, r5, #0
adds r1, r7, #0
mov r2, sl
adds r3, r4, #0
bl sub_080AE4CC
adds r6, r0, #0
lsls r6, r6, #1
mov r2, sl
add r2, r8
adds r0, r5, #0
adds r1, r7, #0
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #1
mov r0, sl
mov r1, r8
subs r2, r0, r1
adds r0, r5, #0
adds r1, r7, #0
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #6
b _080AE6D2
.align 2, 0
_080AE624: .4byte 0x00002004
_080AE628:
ldr r2, [sp, #0xc]
mov r0, sb
subs r7, r2, r0
adds r0, r5, #0
adds r1, r7, #0
mov r2, sl
adds r3, r4, #0
bl sub_080AE4CC
adds r6, r0, #0
lsls r6, r6, #1
mov r2, sl
add r2, r8
adds r0, r5, #0
adds r1, r7, #0
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #1
mov r1, sl
mov r0, r8
subs r2, r1, r0
adds r0, r5, #0
adds r1, r7, #0
b _080AE6C8
_080AE65C:
ldr r7, [sp, #0xc]
add r7, sb
adds r0, r5, #0
adds r1, r7, #0
mov r2, sl
adds r3, r4, #0
bl sub_080AE4CC
adds r6, r0, #0
lsls r6, r6, #1
mov r1, sl
add r1, r8
str r1, [sp, #0x10]
adds r0, r5, #0
adds r1, r7, #0
ldr r2, [sp, #0x10]
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #1
mov r2, sl
mov r0, r8
subs r2, r2, r0
mov r8, r2
adds r0, r5, #0
adds r1, r7, #0
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #2
ldr r1, [sp, #0xc]
mov r2, sb
subs r7, r1, r2
adds r0, r5, #0
adds r1, r7, #0
mov r2, sl
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #1
adds r0, r5, #0
adds r1, r7, #0
ldr r2, [sp, #0x10]
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #1
adds r0, r5, #0
adds r1, r7, #0
mov r2, r8
_080AE6C8:
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #2
_080AE6D2:
ldr r0, [sp, #8]
ldrb r0, [r0, #4]
mov sb, r0
ldr r1, [sp, #8]
ldrb r1, [r1, #5]
mov r8, r1
ldr r2, [sp, #4]
subs r2, #8
str r2, [sp, #4]
movs r0, #0xf
ands r0, r2
cmp r0, #0
beq _080AE760
cmp r2, #0xf
bhi _080AE72C
mov r7, sl
add r7, r8
adds r0, r5, #0
ldr r1, [sp, #0xc]
adds r2, r7, #0
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #1
ldr r1, [sp, #0xc]
add r1, sb
adds r0, r5, #0
adds r2, r7, #0
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #1
ldr r0, [sp, #0xc]
mov r2, sb
subs r1, r0, r2
adds r0, r5, #0
adds r2, r7, #0
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #5
b _080AE7D6
_080AE72C:
mov r0, sl
mov r1, r8
subs r7, r0, r1
lsls r6, r6, #4
adds r0, r5, #0
ldr r1, [sp, #0xc]
adds r2, r7, #0
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #1
ldr r1, [sp, #0xc]
add r1, sb
adds r0, r5, #0
adds r2, r7, #0
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #1
ldr r2, [sp, #0xc]
mov r0, sb
subs r1, r2, r0
adds r0, r5, #0
b _080AE7CA
_080AE760:
mov r7, sl
add r7, r8
adds r0, r5, #0
ldr r1, [sp, #0xc]
adds r2, r7, #0
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #1
ldr r1, [sp, #0xc]
add r1, sb
str r1, [sp, #0x14]
adds r0, r5, #0
adds r2, r7, #0
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #1
ldr r2, [sp, #0xc]
mov r0, sb
subs r2, r2, r0
mov sb, r2
adds r0, r5, #0
mov r1, sb
adds r2, r7, #0
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #2
mov r1, sl
mov r2, r8
subs r7, r1, r2
adds r0, r5, #0
ldr r1, [sp, #0xc]
adds r2, r7, #0
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #1
adds r0, r5, #0
ldr r1, [sp, #0x14]
adds r2, r7, #0
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #1
adds r0, r5, #0
mov r1, sb
_080AE7CA:
adds r2, r7, #0
adds r3, r4, #0
bl sub_080AE4CC
orrs r6, r0
lsls r6, r6, #1
_080AE7D6:
ldr r0, [sp]
strh r6, [r0, #0x2a]
add sp, #0x18
pop {r3, r4, r5}
mov r8, r3
mov sb, r4
mov sl, r5
pop {r4, r5, r6, r7, pc}
.align 2, 0
.syntax divided
+129
View File
@@ -0,0 +1,129 @@
.syntax unified
push {r4, r5, r6, r7, lr}
mov r7, sb
mov r6, r8
push {r6, r7}
adds r4, r0, #0
adds r5, r1, #0
mov r8, r2
mov sb, r3
movs r7, #0
movs r6, #0
ldrh r0, [r4, #0x2a]
movs r1, #0xe
ands r1, r0
mov ip, r1
movs r2, #0xe0
lsls r2, r2, #8
ands r2, r0
adds r3, r2, #0
cmp r1, #0
beq _080AE904
cmp r2, #0
bne _080AE99E
_080AE904:
orrs r1, r2
cmp r1, #0
bne _080AE928
ldr r1, _080AE924 @ =gSineTable
mov r0, r8
adds r0, #0x40
lsls r0, r0, #1
adds r0, r0, r1
movs r2, #0
ldrsh r0, [r0, r2]
adds r7, r0, #0
muls r7, r5, r7
ldr r0, [r4, #0x30]
subs r0, r0, r7
str r0, [r4, #0x30]
b _080AE98A
.align 2, 0
_080AE924: .4byte gSineTable
_080AE928:
mov r2, ip
cmp r2, #2
bne _080AE942
lsls r7, r5, #8
ldr r0, [r4, #0x2c]
adds r0, r0, r7
str r0, [r4, #0x2c]
adds r0, r4, #0
movs r1, #4
mov r2, sb
bl sub_080AE58C
b _080AE95C
_080AE942:
movs r0, #0x80
lsls r0, r0, #7
cmp r3, r0
bne _080AE95C
lsls r7, r5, #8
ldr r0, [r4, #0x30]
subs r0, r0, r7
str r0, [r4, #0x30]
adds r0, r4, #0
movs r1, #4
mov r2, sb
bl sub_080AE58C
_080AE95C:
ldrh r2, [r4, #0x2a]
movs r0, #0xe
ands r0, r2
cmp r0, #0
bne _080AE97E
ldr r1, _080AE9B4 @ =gSineTable
mov r0, r8
adds r0, #0x40
lsls r0, r0, #1
adds r0, r0, r1
movs r1, #0
ldrsh r0, [r0, r1]
adds r6, r0, #0
muls r6, r5, r6
ldr r0, [r4, #0x30]
subs r0, r0, r6
str r0, [r4, #0x30]
_080AE97E:
movs r0, #0xe0
lsls r0, r0, #8
ands r0, r2
cmp r0, #0
bne _080AE99E
ldr r1, _080AE9B4 @ =gSineTable
_080AE98A:
mov r2, r8
lsls r0, r2, #1
adds r0, r0, r1
movs r1, #0
ldrsh r0, [r0, r1]
adds r6, r0, #0
muls r6, r5, r6
ldr r0, [r4, #0x2c]
adds r0, r0, r6
str r0, [r4, #0x2c]
_080AE99E:
ldr r2, _080AE9B8 @ =0x00003333
adds r0, r7, r2
ldr r1, _080AE9BC @ =0x00006665
cmp r0, r1
bhi _080AE9C0
ldr r2, _080AE9B8 @ =0x00003333
adds r0, r6, r2
cmp r0, r1
bhi _080AE9C0
movs r0, #0
b _080AE9C2
.align 2, 0
_080AE9B4: .4byte gSineTable
_080AE9B8: .4byte 0x00003333
_080AE9BC: .4byte 0x00006665
_080AE9C0:
movs r0, #1
_080AE9C2:
pop {r3, r4}
mov r8, r3
mov sb, r4
pop {r4, r5, r6, r7, pc}
.align 2, 0
.syntax divided
+129
View File
@@ -0,0 +1,129 @@
.syntax unified
push {r4, r5, r6, r7, lr}
mov r7, sb
mov r6, r8
push {r6, r7}
adds r4, r0, #0
adds r5, r1, #0
mov r8, r2
mov sb, r3
movs r7, #0
movs r6, #0
ldrh r0, [r4, #0x2a]
movs r1, #0xe0
ands r1, r0
mov ip, r1
movs r2, #0xe0
lsls r2, r2, #8
ands r2, r0
adds r3, r2, #0
cmp r1, #0
beq _080AEAEC
cmp r2, #0
bne _080AEB86
_080AEAEC:
orrs r1, r2
cmp r1, #0
bne _080AEB10
ldr r1, _080AEB0C @ =gSineTable
mov r0, r8
adds r0, #0x40
lsls r0, r0, #1
adds r0, r0, r1
movs r2, #0
ldrsh r0, [r0, r2]
adds r7, r0, #0
muls r7, r5, r7
ldr r0, [r4, #0x30]
subs r0, r0, r7
str r0, [r4, #0x30]
b _080AEB72
.align 2, 0
_080AEB0C: .4byte gSineTable
_080AEB10:
mov r2, ip
cmp r2, #0x20
bne _080AEB2A
lsls r7, r5, #8
ldr r0, [r4, #0x2c]
adds r0, r0, r7
str r0, [r4, #0x2c]
adds r0, r4, #0
movs r1, #0xc
mov r2, sb
bl sub_080AE58C
b _080AEB44
_080AEB2A:
movs r0, #0x80
lsls r0, r0, #6
cmp r3, r0
bne _080AEB44
lsls r7, r5, #8
ldr r0, [r4, #0x30]
adds r0, r0, r7
str r0, [r4, #0x30]
adds r0, r4, #0
movs r1, #0xc
mov r2, sb
bl sub_080AE58C
_080AEB44:
ldrh r2, [r4, #0x2a]
movs r0, #0xe0
ands r0, r2
cmp r0, #0
bne _080AEB66
ldr r1, _080AEB9C @ =gSineTable
mov r0, r8
adds r0, #0x40
lsls r0, r0, #1
adds r0, r0, r1
movs r1, #0
ldrsh r0, [r0, r1]
adds r6, r0, #0
muls r6, r5, r6
ldr r0, [r4, #0x30]
subs r0, r0, r6
str r0, [r4, #0x30]
_080AEB66:
movs r0, #0xe0
lsls r0, r0, #8
ands r0, r2
cmp r0, #0
bne _080AEB86
ldr r1, _080AEB9C @ =gSineTable
_080AEB72:
mov r2, r8
lsls r0, r2, #1
adds r0, r0, r1
movs r1, #0
ldrsh r0, [r0, r1]
adds r6, r0, #0
muls r6, r5, r6
ldr r0, [r4, #0x2c]
adds r0, r0, r6
str r0, [r4, #0x2c]
_080AEB86:
ldr r2, _080AEBA0 @ =0x00003333
adds r0, r7, r2
ldr r1, _080AEBA4 @ =0x00006665
cmp r0, r1
bhi _080AEBA8
ldr r2, _080AEBA0 @ =0x00003333
adds r0, r6, r2
cmp r0, r1
bhi _080AEBA8
movs r0, #0
b _080AEBAA
.align 2, 0
_080AEB9C: .4byte gSineTable
_080AEBA0: .4byte 0x00003333
_080AEBA4: .4byte 0x00006665
_080AEBA8:
movs r0, #1
_080AEBAA:
pop {r3, r4}
mov r8, r3
mov sb, r4
pop {r4, r5, r6, r7, pc}
.align 2, 0
.syntax divided
+129
View File
@@ -0,0 +1,129 @@
.syntax unified
push {r4, r5, r6, r7, lr}
mov r7, sb
mov r6, r8
push {r6, r7}
adds r4, r0, #0
adds r5, r1, #0
mov r8, r2
mov sb, r3
movs r7, #0
movs r6, #0
ldrh r0, [r4, #0x2a]
movs r1, #0xe0
ands r1, r0
mov ip, r1
movs r2, #0xe0
lsls r2, r2, #4
ands r2, r0
adds r3, r2, #0
cmp r1, #0
beq _080AECD8
cmp r2, #0
bne _080AED72
_080AECD8:
orrs r1, r2
cmp r1, #0
bne _080AECFC
ldr r1, _080AECF8 @ =gSineTable
mov r0, r8
adds r0, #0x40
lsls r0, r0, #1
adds r0, r0, r1
movs r2, #0
ldrsh r0, [r0, r2]
adds r7, r0, #0
muls r7, r5, r7
ldr r0, [r4, #0x30]
subs r0, r0, r7
str r0, [r4, #0x30]
b _080AED5E
.align 2, 0
_080AECF8: .4byte gSineTable
_080AECFC:
mov r2, ip
cmp r2, #0x40
bne _080AED16
lsls r7, r5, #8
ldr r0, [r4, #0x2c]
subs r0, r0, r7
str r0, [r4, #0x2c]
adds r0, r4, #0
movs r1, #0x14
mov r2, sb
bl sub_080AE58C
b _080AED30
_080AED16:
movs r0, #0x80
lsls r0, r0, #2
cmp r3, r0
bne _080AED30
lsls r7, r5, #8
ldr r0, [r4, #0x30]
adds r0, r0, r7
str r0, [r4, #0x30]
adds r0, r4, #0
movs r1, #0x14
mov r2, sb
bl sub_080AE58C
_080AED30:
ldrh r2, [r4, #0x2a]
movs r0, #0xe0
ands r0, r2
cmp r0, #0
bne _080AED52
ldr r1, _080AED88 @ =gSineTable
mov r0, r8
adds r0, #0x40
lsls r0, r0, #1
adds r0, r0, r1
movs r1, #0
ldrsh r0, [r0, r1]
adds r6, r0, #0
muls r6, r5, r6
ldr r0, [r4, #0x30]
subs r0, r0, r6
str r0, [r4, #0x30]
_080AED52:
movs r0, #0xe0
lsls r0, r0, #4
ands r0, r2
cmp r0, #0
bne _080AED72
ldr r1, _080AED88 @ =gSineTable
_080AED5E:
mov r2, r8
lsls r0, r2, #1
adds r0, r0, r1
movs r1, #0
ldrsh r0, [r0, r1]
adds r6, r0, #0
muls r6, r5, r6
ldr r0, [r4, #0x2c]
adds r0, r0, r6
str r0, [r4, #0x2c]
_080AED72:
ldr r2, _080AED8C @ =0x00003333
adds r0, r7, r2
ldr r1, _080AED90 @ =0x00006665
cmp r0, r1
bhi _080AED94
ldr r2, _080AED8C @ =0x00003333
adds r0, r6, r2
cmp r0, r1
bhi _080AED94
movs r0, #0
b _080AED96
.align 2, 0
_080AED88: .4byte gSineTable
_080AED8C: .4byte 0x00003333
_080AED90: .4byte 0x00006665
_080AED94:
movs r0, #1
_080AED96:
pop {r3, r4}
mov r8, r3
mov sb, r4
pop {r4, r5, r6, r7, pc}
.align 2, 0
.syntax divided
+129
View File
@@ -0,0 +1,129 @@
.syntax unified
push {r4, r5, r6, r7, lr}
mov r7, sb
mov r6, r8
push {r6, r7}
adds r4, r0, #0
adds r5, r1, #0
mov r8, r2
mov sb, r3
movs r7, #0
movs r6, #0
ldrh r0, [r4, #0x2a]
movs r1, #0xe
ands r1, r0
mov ip, r1
movs r2, #0xe0
lsls r2, r2, #4
ands r2, r0
adds r3, r2, #0
cmp r1, #0
beq _080AEEC0
cmp r2, #0
bne _080AEF5A
_080AEEC0:
orrs r1, r2
cmp r1, #0
bne _080AEEE4
ldr r1, _080AEEE0 @ =gSineTable
mov r0, r8
adds r0, #0x40
lsls r0, r0, #1
adds r0, r0, r1
movs r2, #0
ldrsh r0, [r0, r2]
adds r7, r0, #0
muls r7, r5, r7
ldr r0, [r4, #0x30]
subs r0, r0, r7
str r0, [r4, #0x30]
b _080AEF46
.align 2, 0
_080AEEE0: .4byte gSineTable
_080AEEE4:
mov r2, ip
cmp r2, #4
bne _080AEEFE
lsls r7, r5, #8
ldr r0, [r4, #0x2c]
subs r0, r0, r7
str r0, [r4, #0x2c]
adds r0, r4, #0
movs r1, #0x1c
mov r2, sb
bl sub_080AE58C
b _080AEF18
_080AEEFE:
movs r0, #0x80
lsls r0, r0, #3
cmp r3, r0
bne _080AEF18
lsls r7, r5, #8
ldr r0, [r4, #0x30]
subs r0, r0, r7
str r0, [r4, #0x30]
adds r0, r4, #0
movs r1, #0x1c
mov r2, sb
bl sub_080AE58C
_080AEF18:
ldrh r2, [r4, #0x2a]
movs r0, #0xe
ands r0, r2
cmp r0, #0
bne _080AEF3A
ldr r1, _080AEF70 @ =gSineTable
mov r0, r8
adds r0, #0x40
lsls r0, r0, #1
adds r0, r0, r1
movs r1, #0
ldrsh r0, [r0, r1]
adds r6, r0, #0
muls r6, r5, r6
ldr r0, [r4, #0x30]
subs r0, r0, r6
str r0, [r4, #0x30]
_080AEF3A:
movs r0, #0xe0
lsls r0, r0, #4
ands r0, r2
cmp r0, #0
bne _080AEF5A
ldr r1, _080AEF70 @ =gSineTable
_080AEF46:
mov r2, r8
lsls r0, r2, #1
adds r0, r0, r1
movs r1, #0
ldrsh r0, [r0, r1]
adds r6, r0, #0
muls r6, r5, r6
ldr r0, [r4, #0x2c]
adds r0, r0, r6
str r0, [r4, #0x2c]
_080AEF5A:
ldr r2, _080AEF74 @ =0x00003333
adds r0, r7, r2
ldr r1, _080AEF78 @ =0x00006665
cmp r0, r1
bhi _080AEF7C
ldr r2, _080AEF74 @ =0x00003333
adds r0, r6, r2
cmp r0, r1
bhi _080AEF7C
movs r0, #0
b _080AEF7E
.align 2, 0
_080AEF70: .4byte gSineTable
_080AEF74: .4byte 0x00003333
_080AEF78: .4byte 0x00006665
_080AEF7C:
movs r0, #1
_080AEF7E:
pop {r3, r4}
mov r8, r3
mov sb, r4
pop {r4, r5, r6, r7, pc}
.align 2, 0
.syntax divided
+8 -8
View File
@@ -4893,10 +4893,10 @@ Subtask_FadeIn: @ 0x080A7250
ldr r0, _080A731C @ =gCurrentRoomProperties
ldr r0, [r0]
str r0, [r1, #0x10]
ldr r0, _080A7320 @ =gUnk_02025EB0
ldr r0, _080A7320 @ =gMapBottom
ldr r0, [r0]
str r0, [r1, #0x14]
ldr r0, _080A7324 @ =gUnk_0200B650
ldr r0, _080A7324 @ =gMapTop
ldr r0, [r0]
str r0, [r1, #0x18]
movs r0, #1
@@ -4918,8 +4918,8 @@ _080A7310: .4byte gActiveScriptInfo
_080A7314: .4byte gRoomTransition
_080A7318: .4byte gPlayerState
_080A731C: .4byte gCurrentRoomProperties
_080A7320: .4byte gUnk_02025EB0
_080A7324: .4byte gUnk_0200B650
_080A7320: .4byte gMapBottom
_080A7324: .4byte gMapTop
thumb_func_start Subtask_Init
Subtask_Init: @ 0x080A7328
@@ -4991,10 +4991,10 @@ _080A73B4:
ldrb r1, [r5, #0xc]
adds r0, #0x8b
strb r1, [r0]
ldr r1, _080A7478 @ =gUnk_02025EB0
ldr r1, _080A7478 @ =gMapBottom
ldr r0, [r5, #0x14]
str r0, [r1]
ldr r1, _080A747C @ =gUnk_0200B650
ldr r1, _080A747C @ =gMapTop
ldr r0, [r5, #0x18]
str r0, [r1]
movs r1, #0xea
@@ -5061,8 +5061,8 @@ _080A7468: .4byte gFadeControl
_080A746C: .4byte gCurrentRoomProperties
_080A7470: .4byte gUnk_02032EC0
_080A7474: .4byte gPlayerState
_080A7478: .4byte gUnk_02025EB0
_080A747C: .4byte gUnk_0200B650
_080A7478: .4byte gMapBottom
_080A747C: .4byte gMapTop
_080A7480: .4byte gActiveScriptInfo
_080A7484: .4byte gUnk_03000420
_080A7488: .4byte gPaletteList
+4 -4
View File
@@ -88,7 +88,7 @@ UpdateScrollVram: @ 0x08000108
beq _08000136
add r4, pc, #0x20
ldr r4, [r4, r1]
ldr r0, _080001EC @ =gUnk_02025EB0
ldr r0, _080001EC @ =gMapBottom
ldr r0, [r0]
cmp r0, #0
beq _08000126
@@ -96,7 +96,7 @@ UpdateScrollVram: @ 0x08000108
ldr r1, _080001F4 @ =gUnk_02021F70
bl _call_via_r4
_08000126:
ldr r0, _080001F8 @ =gUnk_0200B650
ldr r0, _080001F8 @ =gMapTop
ldr r0, [r0]
cmp r0, #0
beq _08000136
@@ -196,10 +196,10 @@ GetTileIndex: @ 0x080001DA
bx lr
.align 2, 0
_080001E8: .4byte gUpdateVisibleTiles
_080001EC: .4byte gUnk_02025EB0
_080001EC: .4byte gMapBottom
_080001F0: .4byte gUnk_02019EE0
_080001F4: .4byte gUnk_02021F70
_080001F8: .4byte gUnk_0200B650
_080001F8: .4byte gMapTop
_080001FC: .4byte gMapDataTopSpecial
_08000200: .4byte gUnk_020344F0
_08000204: .4byte gUnk_08000248
+3 -1
View File
@@ -10,6 +10,7 @@
#include "room.h"
#include "structures.h"
#include "script.h"
#include "map.h"
// Identified - to be sorted into header files
extern void SetDirtTile(u32);
@@ -174,6 +175,7 @@ extern void sub_0806FCF4(Entity*, s32, s32, s32);
extern u32 sub_080041DC(Entity*, u32, u32);
extern void sub_080AE58C(Entity*, u32, u32);
extern u32 sub_0800132C(Entity*, Entity*);
extern bool32 sub_080AE4CC(Entity*, u32, u32, u32);
extern void sub_08008796(Entity*, u32, u32, u32);
extern bool32 sub_080AE4CC(u8*, s32, s32, s32);
extern LayerStruct* GetLayerByIndex(u32);
#endif
+20
View File
@@ -0,0 +1,20 @@
#ifndef MAP_H
#define MAP_H
#include "global.h"
typedef struct {
u16* bgControlPtr; // Points to the BgSettings.control field for the bg belonging to this layer?
u16 _4[0x1000]; // tilemap data? <-- gMapDataTop / gMapDataBottom
u8 _2004[0x1000]; // more tilemap data? <-- gUnk_0200D654 / gUnk_02027EB4
u8 _3004[0x1000]; // more tilemap data? <-- gUnk_0200E654 / gUnk_02028EB4
u8 _4004[0x1000]; // gMetatileTypesTop, gMetatileTypesBottom
s16 _5004[0x500]; // gUnk_02011654,gUnk_0202BEB4
// Maybe even include here gMetatilesTop, gUnk_02016654 ?
// gMetatilesBottom, gUnk_02030EB4
} LayerStruct;
extern LayerStruct gMapTop;
extern LayerStruct gMapBottom;
#endif // MAP_H
+4 -4
View File
@@ -48,7 +48,7 @@ SECTIONS {
. = 0x0000B240; gUnk_0200B240 = .;
. = 0x0000B640; gUnk_0200B640 = .;
. = 0x0000B644; gUsedPalettes = .;
. = 0x0000B650; gUnk_0200B650 = .;
. = 0x0000B650; gMapTop = .;
. = 0x0000B654; gMapDataTop = .;
. = 0x0000D654; gUnk_0200D654 = .;
. = 0x0000E654; gUnk_0200E654 = .;
@@ -96,7 +96,7 @@ SECTIONS {
. = 0x00024490; gGFXSlots = .;
. = 0x00024494; gUnk_02024494 = .;
. = 0x000246B0; gUnk_020246B0 = .;
. = 0x00025EB0; gUnk_02025EB0 = .;
. = 0x00025EB0; gMapBottom = .;
. = 0x00025EB4; gMapDataBottom = .;
. = 0x00027EB4; gUnk_02027EB4 = .;
. = 0x00028EB4; gUnk_02028EB4 = .;
@@ -904,7 +904,7 @@ SECTIONS {
src/affine.o(.text);
src/playerItem/playerItemGustJar.o(.text);
asm/vram.o(.text);
asm/movement.o(.text);
src/movement.o(.text);
/* library functions */
asm/lib/m4a_asm.o(.text);
src/gba/m4a.o(.text);
@@ -1680,7 +1680,7 @@ SECTIONS {
src/projectile.o(.rodata);
data/const/playerItem/playerItemGustJar.o(.rodata);
data/gfx/fixed_type_gfx.o(.rodata);
data/data_08132B30.o(.rodata);
data/const/movement.o(.rodata);
data/map/exit_lists.o(.rodata);
data/gfx_0813AA54.o(.rodata);
data/gfx/sprite_gfx.o(.rodata);
+3 -10
View File
@@ -35,13 +35,6 @@ static_assert(sizeof(struct_gUnk_020000C0) == 0x40);
extern struct_gUnk_020000C0 gUnk_020000C0[0x30];
extern u32 gSpritePtrs[];
typedef struct {
u32 _0;
u16 _4[0x1000];
u8 _2004[0x2000];
} struct_02025EB0;
extern struct_02025EB0 gUnk_02025EB0;
extern u16 gExtraFrameOffsets[];
extern s8 gUnk_08126EE4[];
extern const u16 gUnk_080046A4[];
@@ -233,16 +226,16 @@ u32 sub_0806F798(Entity* ent) {
}
u32 sub_0806F7D0(Entity* ent) {
return gUnk_02025EB0._2004[sub_0806F730(ent)];
return gMapBottom._2004[sub_0806F730(ent)];
}
u32 sub_0806F7EC(Entity* ent) {
return gUnk_02025EB0._4[sub_0806F730(ent)];
return gMapBottom._4[sub_0806F730(ent)];
}
u32 sub_0806F804(u32 x, u32 y) {
u32 idx = ((x >> 4) & 0x3F) + 4 * (y & 0x3F0);
return gUnk_02025EB0._4[idx];
return gMapBottom._4[idx];
}
u32 sub_0806F824(Entity* a, Entity* b, s32 x, s32 y) {
+6 -6
View File
@@ -11,8 +11,8 @@
extern u32 sub_0804A024(Entity*, u32, u32);
extern Entity gUnk_0200D654;
extern Entity gUnk_02027EB4;
extern u8 gUnk_0200D654[];
extern u8 gUnk_02027EB4[];
void sub_0802C18C(Entity*);
void sub_0802C218(Entity*);
@@ -316,13 +316,13 @@ bool32 sub_0802C06C(Entity* this) {
u32 xdiff = gUnk_080CD45C[(this->direction >> 2) + 0];
u32 ydiff = gUnk_080CD45C[(this->direction >> 2) + 1];
Entity* ent = this->collisionLayer == 2 ? &gUnk_0200D654 : &gUnk_02027EB4;
u8* layer = this->collisionLayer == 2 ? gUnk_0200D654 : gUnk_02027EB4;
u32 i;
for (i = 0; i < 8; i++) {
x += xdiff;
y += ydiff;
if (sub_080AE4CC(ent, x, y, 0))
if (sub_080AE4CC(layer, x, y, 0))
return FALSE;
}
@@ -339,10 +339,10 @@ bool32 sub_0802C0E8(Entity* this) {
s32 x = this->x.HALF.HI + this->hitbox->offset_x + ptr[0] * 6;
s32 y = this->y.HALF.HI + this->hitbox->offset_y + ptr[1] * 6;
Entity* ent = this->collisionLayer == 2 ? &gUnk_0200D654 : &gUnk_02027EB4;
u8* layer = this->collisionLayer == 2 ? gUnk_0200D654 : gUnk_02027EB4;
u32 ret = FALSE;
if (!sub_0806FC24(TILE(x, y), 9)) {
if (sub_080AE4CC(ent, x, y, 0)) {
if (sub_080AE4CC(layer, x, y, 0)) {
ret = 1;
} else {
ret = 0;
+3 -4
View File
@@ -8,7 +8,6 @@ extern void (*const gUnk_080012C8[])(Entity*);
const s8 gUnk_080CF490[];
const u8 gUnk_080CF498[];
extern u16* GetLayerByIndex(u32);
extern s32 sub_080012DC(Entity*);
extern u32 sub_0804A044(Entity*, Entity*, u32);
@@ -108,16 +107,16 @@ void sub_08037D54(Entity* this) {
void sub_08037E14(Entity* this) {
u32 dir;
u16* pLayer;
u8* layer;
const s8* ptr;
s32 x, y;
this->actionDelay = 0x8;
dir = (GetFacingDirection(this, &gPlayerEntity) + 4) & 0x18;
pLayer = GetLayerByIndex(this->collisionLayer) + 0x1002;
layer = (u8*)GetLayerByIndex(this->collisionLayer)->_2004;
ptr = gUnk_080CF498 + (dir >> 2);
x = this->x.HALF.HI + *ptr;
y = this->y.HALF.HI + *(ptr + 1);
if (sub_080AE4CC((Entity*)pLayer, x, y, 0)) {
if (sub_080AE4CC(layer, x, y, 0)) {
this->direction = Random() & 0x18;
} else {
this->direction = dir;
+4 -4
View File
@@ -11,8 +11,8 @@
extern u32 sub_0804A024(Entity*, u32, u32);
extern bool32 sub_080AF038(Entity*);
extern Entity gUnk_02027EB4;
extern Entity gUnk_0200D654;
extern u8 gUnk_02027EB4[];
extern u8 gUnk_0200D654[];
void sub_0802BB10(Entity*);
bool32 sub_0802BB2C(Entity*, u32);
@@ -99,9 +99,9 @@ void sub_0802BB10(Entity* this) {
}
bool32 sub_0802BB2C(Entity* this, u32 param_2) {
Entity* ent = this->collisionLayer == 2 ? &gUnk_0200D654 : &gUnk_02027EB4;
u8* layer = this->collisionLayer == 2 ? gUnk_0200D654 : gUnk_02027EB4;
const s8* ptr = &gUnk_080CD3DC[param_2 >> 2];
return sub_080AE4CC(ent, this->x.HALF.HI + ptr[0], this->y.HALF.HI + ptr[1], 0);
return sub_080AE4CC(layer, this->x.HALF.HI + ptr[0], this->y.HALF.HI + ptr[1], 0);
}
// clang-format off
+4 -6
View File
@@ -13,8 +13,6 @@
extern u8 gUnk_03003DE0;
extern u8 gUnk_03000C30;
extern u16* gUnk_02025EB0;
extern u16* gUnk_0200B650;
extern u8 gUpdateVisibleTiles;
extern u8 gUnk_03003DF0[];
extern Entity gUnk_03003BE0;
@@ -205,11 +203,11 @@ void WaitForNextFrame(void) {
if (gUpdateVisibleTiles) {
gUpdateVisibleTiles = 0;
if (gUnk_02025EB0 != NULL)
if (gMapBottom.bgControlPtr != NULL)
// sizeof(BGBuffer) = 0x800, what are we omitting?
DmaCopy32(3, &gBG1Buffer, VRAM + (*gUnk_02025EB0 & 0x1f00) * 8, 0x5C0);
if (gUnk_0200B650 != NULL)
DmaCopy32(3, &gBG2Buffer, VRAM + (*gUnk_0200B650 & 0x1f00) * 8, 0x5C0);
DmaCopy32(3, &gBG1Buffer, VRAM + (*gMapBottom.bgControlPtr & 0x1f00) * 8, 0x5C0);
if (gMapTop.bgControlPtr != NULL)
DmaCopy32(3, &gBG2Buffer, VRAM + (*gMapTop.bgControlPtr & 0x1f00) * 8, 0x5C0);
}
FadeVBlank();
}
+3 -4
View File
@@ -23,7 +23,6 @@ const u8 gUnk_08108390[6] = {
0x0F, 0x1E, 0x2D, 0x3C, 0x01, 0x01,
};
extern void* gUnk_0200B650;
extern u16 gUnk_020176E0[];
extern u8 gUnk_02017700[];
@@ -37,7 +36,7 @@ void Manager10_Main(Manager10* this) {
if (sub_0805986C()) {
this->unk_20 = 1;
this->unk_22 = 2;
gUnk_0200B650 = 0;
gMapTop.bgControlPtr = 0;
} else {
this->unk_20 = 0x1F;
this->unk_22 = 5;
@@ -104,7 +103,7 @@ void sub_080596E0(Manager10* this) {
this->unk_21 = 1;
this->unk_22 = 3;
this->manager.unk_0e = gUnk_08108390[3];
gUnk_0200B650 = 0;
gMapTop.bgControlPtr = 0;
}
} else {
if (this->unk_21 == 0 && this->unk_22 != 5) {
@@ -141,7 +140,7 @@ void sub_080596E0(Manager10* this) {
LoadResourceAsync(gBG3Buffer, 0x600e800, 0x800);
break;
case 5:
gUnk_0200B650 = &gScreen.bg1.control;
gMapTop.bgControlPtr = &gScreen.bg1.control;
gScreen.lcd.displayControl |= 0x200;
break;
}
+1 -3
View File
@@ -16,8 +16,6 @@ extern void sub_0805754C(Manager2*);
extern u8 gMapDataTopSpecial[];
extern u32 gUnk_0200B650;
void Manager2_Main(Manager2* this) {
if (this->manager.action == 0) {
this->manager.action = 1;
@@ -52,7 +50,7 @@ void sub_0805754C(Manager2* this) {
void sub_080575C8(u32 param) {
s32 bgOffset;
gUnk_0200B650 = 0;
gMapTop.bgControlPtr = 0;
REG_DISPCNT = 0;
LoadGfxGroup(param);
gRoomVars.unk_10[0] = param;
+3 -5
View File
@@ -24,8 +24,6 @@ bool32 sub_0805CF80(Manager29* this);
void sub_0805CBD0(Manager29* this);
void sub_0805CC3C(Manager29* this);
extern u16* GetLayerByIndex(u32);
void Manager29_Main(Manager29* this) {
if (this->manager.action == 0) {
sub_0805CBD0(this);
@@ -40,15 +38,15 @@ void Manager29_Main(Manager29* this) {
}
void sub_0805CBD0(Manager29* this) {
u16* puVar2;
LayerStruct* puVar2;
this->manager.action = 1;
this->unk_38 = (this->unk_38 >> 4 & 0x3fU) | (((this->unk_3a << 0x10) >> 0x14 & 0x3fU) << 6);
this->unk_3a = (this->unk_3c >> 4 & 0x3f) | (((this->unk_36 + this->unk_37 * 0x100) >> 4 & 0x3fU) << 6);
this->unk_3c = GetTileType(this->unk_38, this->unk_34);
puVar2 = GetLayerByIndex(this->unk_34);
this->unk_28 = puVar2 + 0x2802;
this->unk_2c = puVar2 + 2 + (s16)this->unk_3a;
this->unk_28 = puVar2->_5004;
this->unk_2c = &puVar2->_4[(s16)this->unk_3a];
}
void sub_0805CC3C(Manager29* this) {
+1 -3
View File
@@ -102,11 +102,9 @@ void sub_08058084(u16* unk1, u16* unk2) {
}
}
extern u32 gUnk_0200B650;
void sub_080580B0(u32 unk1) {
s32 tmp;
gUnk_0200B650 = 0;
gMapTop.bgControlPtr = 0;
REG_DISPCNT = 0;
LoadGfxGroup(unk1);
gRoomVars.unk_10[0] = unk1;
+1 -3
View File
@@ -83,10 +83,8 @@ void sub_080582F8(u8* unk, u8* unk2) {
}
}
extern u32 gUnk_0200B650;
void sub_08058324(u32 unk) {
gUnk_0200B650 = 0;
gMapTop.bgControlPtr = 0;
LoadPaletteGroup(unk + 0x86);
LoadGfxGroup(unk + 0x36);
sub_080582D0();
+1 -3
View File
@@ -34,8 +34,6 @@ typedef struct {
extern void (*const gUnk_08108308[])(ManagerD*);
extern u16* GetLayerByIndex(u32);
void ManagerD_Main(ManagerD* this) {
gUnk_08108308[this->manager.action](this);
}
@@ -47,7 +45,7 @@ void sub_08058DE8(ManagerD* this) {
DeleteThisEntity();
} else {
this->manager.action = 1;
puVar2 = GetLayerByIndex(this->field_0x3a);
puVar2 = (u16*)GetLayerByIndex(this->field_0x3a);
puVar3 = (this->field_0x38 + 2) + puVar2;
this->field_0x30 = puVar3;
this->field_0x28 = *puVar3;
+753
View File
@@ -0,0 +1,753 @@
#include "global.h"
#include "entity.h"
#include "room.h"
#include "area.h"
#include "game.h"
#include "asm.h"
#include "item.h"
#include "coord.h"
#include "coord.h"
/** Collisions. */
typedef enum {
COL_NONE = 0x0,
COL_NORTH_WEST = 0x2,
COL_NORTH_EAST = 0x4,
COL_NORTH_FULL = 0x6,
COL_NORTH_ANY = 0xe,
COL_SOUTH_WEST = 0x20,
COL_SOUTH_EAST = 0x40,
COL_SOUTH_FULL = 0x60,
COL_SOUTH_ANY = 0xe0,
COL_WEST_SOUTH = 0x200,
COL_WEST_NORTH = 0x400,
COL_WEST_FULL = 0x600,
COL_WEST_ANY = 0xe00,
COL_EAST_SOUTH = 0x2000,
COL_EAST_NORTH = 0x4000,
COL_EAST_FULL = 0x6000,
COL_EAST_ANY = 0xe000,
} Collisions;
extern u8* GetLayerByIndex(u32);
extern u8 gExitList_RoyalValley_ForestMaze[];
extern u8 gUnk_08135190[];
extern u8 gUnk_08134FBC[];
extern u8 gUnk_08135048[];
extern u8 gUnk_0813A76C[];
extern const u16 gUnk_08133918[];
extern const u16 gUnk_08133938[];
extern const u16 gUnk_08133958[];
extern const u16 gUnk_08133978[];
extern const u16 gUnk_08133998[];
extern const u16 gUnk_081339B8[];
extern const u16 gUnk_081339D8[];
extern const u16 gUnk_081339F8[];
extern u32 (*const gUnk_08133A18[])(u32, u32);
extern const u8 gUnk_08133A40[];
extern const u8 gUnk_08133A5A[];
extern const u8 gUnk_08133A67[];
extern u32 (*const gUnk_08133F48[])(Entity*, u32, u32, u32);
u32 sub_080AE4CC(u8*, s32, s32, s32);
void sub_080AE58C(Entity*, u32, u32);
u32 sub_080AE7E8(Entity*, u32, s32, s32);
bool32 sub_080AF0C8(Entity*);
u32 sub_080AE3E4(void) {
return 0;
}
u32 sub_080AE3E8(void) {
return 1;
}
u32 sub_080AE3EC(u32 param_1, u32 param_2) {
return gUnk_08133918[param_2 & 0xf] >> (param_1 & 0xf) & 1;
}
u32 sub_080AE408(u32 param_1, u32 param_2) {
return gUnk_08133938[param_2 & 0xf] >> (param_1 & 0xf) & 1;
}
u32 sub_080AE424(u32 param_1, u32 param_2) {
return gUnk_08133958[param_2 & 0xf] >> (param_1 & 0xf) & 1;
}
u32 sub_080AE440(u32 param_1, u32 param_2) {
return gUnk_08133978[param_2 & 0xf] >> (param_1 & 0xf) & 1;
}
u32 sub_080AE45C(u32 param_1, u32 param_2) {
return gUnk_08133998[param_2 & 0xf] >> (param_1 & 0xf) & 1;
}
u32 sub_080AE478(u32 param_1, u32 param_2) {
return gUnk_081339B8[param_2 & 0xf] >> (param_1 & 0xf) & 1;
}
u32 sub_080AE494(u32 param_1, u32 param_2) {
return gUnk_081339D8[param_2 & 0xf] >> (param_1 & 0xf) & 1;
}
u32 sub_080AE4B0(u32 param_1, u32 param_2) {
return gUnk_081339F8[param_2 & 0xf] >> (param_1 & 0xf) & 1;
}
bool32 sub_080AE4CC(u8* layer, s32 param_2, s32 param_3, s32 param_4) {
u32 tmp = layer[TILE(param_2, param_3)];
if (tmp == 0) {
if (param_4 == 4) {
return TRUE;
} else {
return FALSE;
}
} else {
if (tmp <= 0xf) {
if (gUnk_08133A40[param_4 * 2 + ((tmp + 1) >> 4)] == 0) {
return FALSE;
}
if (gUnk_08133A40[param_4 * 2 + ((tmp + 1) >> 4)] == 1) {
return TRUE;
}
if ((param_3 & 8) == 0) {
tmp = (u32)(layer[TILE(param_2, param_3)]);
tmp >>= 2;
}
if ((param_2 & 8) == 0) {
tmp >>= 1;
}
return tmp & 1;
} else {
if (tmp == 0xff) {
return gUnk_08133A18[gUnk_08133A5A[param_4]](param_2, param_3);
} else {
if (tmp > 0x6f) {
return TRUE;
}
return gUnk_08133A18[gUnk_08133A67[param_4 * 0x60 + tmp - 0x10]](param_2, param_3);
}
}
}
return FALSE;
}
NONMATCH("asm/non_matching/movement/sub_080AE58C.inc", void sub_080AE58C(Entity* this, u32 param_2, u32 param_3)) {
u8* layer;
u32 uVar2;
s32 iVar3;
u32 uVar4;
u32 uVar5;
u32 uVar6;
u32 uVar7;
s32 iVar8;
s32 iVar9;
u32 uVar10;
u32 uVar11;
Hitbox* pHVar12;
s32 iVar13;
u16 uVar14;
s32 iVar15;
layer = GetLayerByIndex(this->collisionLayer);
layer += 0x2004;
iVar8 = this->hitbox->offset_x + this->x.HALF.HI;
iVar9 = this->hitbox->offset_y + this->y.HALF.HI;
uVar2 = this->hitbox->unk2[0];
uVar10 = this->hitbox->unk2[1];
if ((param_2 & 0xf) != 0) {
if (0xf >= param_2) {
iVar15 = iVar8 + uVar2;
iVar3 = sub_080AE4CC(layer, iVar15, iVar9, param_3);
uVar2 = sub_080AE4CC(layer, iVar15, iVar9 + uVar10, param_3);
uVar10 = sub_080AE4CC(layer, iVar15, iVar9 - uVar10, param_3);
uVar2 = ((iVar3 << 1 | uVar2) << 1 | uVar10) << 6;
} else {
iVar15 = iVar8 - uVar2;
iVar3 = sub_080AE4CC(layer, iVar15, iVar9, param_3);
uVar2 = sub_080AE4CC(layer, iVar15, iVar9 + uVar10, param_3);
uVar2 = iVar3 << 1 | uVar2;
iVar13 = iVar9 - uVar10;
uVar10 = sub_080AE4CC(layer, iVar15, iVar13, param_3);
uVar2 = (uVar2 << 1 | uVar10) << 2;
}
} else {
iVar15 = iVar8 + uVar2;
iVar3 = sub_080AE4CC(layer, iVar15, iVar9, param_3);
uVar11 = sub_080AE4CC(layer, iVar15, iVar9 + uVar10, param_3);
iVar13 = iVar9 - uVar10;
uVar4 = sub_080AE4CC(layer, iVar15, iVar13, param_3);
iVar15 = iVar8 - uVar2;
uVar5 = sub_080AE4CC(layer, iVar15, iVar9, param_3);
uVar2 = sub_080AE4CC(layer, iVar15, iVar9 + uVar10, param_3);
uVar2 = (((iVar3 << 1 | uVar11) << 1 | uVar4) << 2 | uVar5) << 1 | uVar2;
uVar10 = sub_080AE4CC(layer, iVar15, iVar13, param_3);
uVar2 = (uVar2 << 1 | uVar10) << 2;
}
uVar10 = this->hitbox->unk2[2];
uVar11 = this->hitbox->unk2[3];
if (((param_2 - 8) & 0xf) == 0) {
iVar15 = iVar9 + uVar11;
uVar4 = sub_080AE4CC(layer, iVar8, iVar15, param_3);
uVar5 = sub_080AE4CC(layer, iVar8 + uVar10, iVar15, param_3);
iVar3 = iVar8 - uVar10;
uVar6 = sub_080AE4CC(layer, iVar3, iVar15, param_3);
iVar9 -= uVar11;
uVar7 = sub_080AE4CC(layer, iVar8, iVar9, param_3);
uVar11 = sub_080AE4CC(layer, iVar8 + uVar10, iVar9, param_3);
uVar11 = ((((uVar2 | uVar4) << 1 | uVar5) << 1 | uVar6) << 2 | uVar7) << 1 | uVar11;
uVar2 = sub_080AE4CC(layer, iVar3, iVar9, param_3);
this->collisions = ((uVar11 << 1 | uVar2) << 1);
} else {
if (param_2 - 8 < 0x10) {
iVar9 += uVar11;
uVar11 = sub_080AE4CC(layer, iVar8, iVar9, param_3);
uVar4 = sub_080AE4CC(layer, iVar8 + uVar10, iVar9, param_3);
uVar10 = sub_080AE4CC(layer, iVar8 - uVar10, iVar9, param_3);
this->collisions = ((((uVar2 | uVar11) << 1 | uVar4) << 1 | uVar10) << 5);
} else {
iVar9 -= uVar11;
uVar4 = sub_080AE4CC(layer, iVar8, iVar9, param_3);
uVar11 = sub_080AE4CC(layer, iVar8 + uVar10, iVar9, param_3);
uVar11 = (uVar2 << 4 | uVar4) << 1 | uVar11;
iVar3 = iVar8 - uVar10;
uVar2 = sub_080AE4CC(layer, iVar3, iVar9, param_3);
this->collisions = ((uVar11 << 1 | uVar2) << 1);
}
}
}
END_NONMATCH
u32 sub_080AE7E8(Entity* param_1, u32 param_2, s32 param_3, s32 param_4) {
return gUnk_08133F48[param_3](param_1, param_2, param_3 << 3, param_4);
}
bool32 sub_080AE800(Entity* this, s32 radius, s32 angle, u32 param_4) {
s32 tmpX = 0;
s32 tmpY = 0;
if ((this->collisions & COL_NORTH_ANY) != COL_NONE) {
if ((this->collisions & COL_NORTH_ANY) == COL_NORTH_WEST) {
if ((this->collisions & COL_EAST_ANY) == COL_NONE) {
tmpX = radius * 0x100;
this->x.WORD += tmpX;
sub_080AE58C(this, 4, param_4);
if ((this->collisions & COL_NORTH_ANY) == COL_NONE) {
tmpY = gSineTable[0x40] * radius;
tmpX = radius * 0x100;
this->y.WORD -= tmpY;
}
}
} else {
if ((this->collisions & COL_NORTH_ANY) == COL_NORTH_EAST) {
if ((this->collisions & COL_WEST_ANY) == COL_NONE) {
tmpX = radius * 0x100;
this->x.WORD += radius * -0x100;
sub_080AE58C(this, 0x1c, param_4);
if ((this->collisions & COL_NORTH_ANY) == COL_NONE) {
tmpY = gSineTable[0x40] * radius;
tmpX = radius * 0x100;
this->y.WORD -= tmpY;
}
}
}
}
} else {
tmpX = gSineTable[0x40] * radius;
this->y.WORD -= tmpX;
}
if ((tmpX + 0x3333U < 0x6666) && (tmpY + 0x3333U < 0x6666)) {
return FALSE;
} else {
return TRUE;
}
}
NONMATCH("asm/non_matching/movement/sub_080AE8D8.inc",
bool32 sub_080AE8D8(Entity* this, s32 radius, s32 angle, u32 param_4)) {
s32 moveA = 0;
s32 moveB = 0;
if (((this->collisions & COL_NORTH_ANY) == COL_NONE) || ((this->collisions & COL_EAST_ANY) == COL_NONE)) {
if ((this->collisions & (COL_NORTH_ANY | COL_EAST_ANY)) == COL_NONE) {
moveA = radius * gSineTable[angle + 0x40];
this->y.WORD -= moveA;
moveB = radius * gSineTable[angle];
this->x.WORD += moveB;
} else {
if ((this->collisions & COL_NORTH_ANY) == COL_NORTH_WEST) {
moveA = radius * 0x100;
this->x.WORD += moveA;
sub_080AE58C(this, 4, param_4);
} else {
if ((this->collisions & COL_EAST_ANY) == COL_EAST_NORTH) {
moveA = radius * 0x100;
this->y.WORD -= moveA;
sub_080AE58C(this, 4, param_4);
}
}
if ((this->collisions & COL_NORTH_ANY) == COL_NONE) {
moveB = gSineTable[angle + 0x40] * radius;
this->y.WORD -= moveB;
}
if ((this->collisions & COL_EAST_ANY) == COL_NONE) {
moveB = gSineTable[angle] * radius;
this->x.WORD += moveB;
}
}
}
if (((moveA >= -0x3333) && (moveA < 0x3333)) && ((moveB >= -0x3333) && (moveB < 0x3333))) {
return FALSE;
} else {
return TRUE;
}
}
END_NONMATCH
bool32 sub_080AE9CC(Entity* this, s32 radius, s32 angle, u32 param_4) {
s32 moveA = 0;
s32 moveB = 0;
if ((this->collisions & COL_EAST_ANY) != COL_NONE) {
if ((this->collisions & COL_EAST_ANY) == COL_EAST_SOUTH) {
if ((this->collisions & COL_SOUTH_ANY) == COL_NONE) {
moveA = radius * 0x100;
this->y.WORD += moveA;
sub_080AE58C(this, 0xc, param_4);
if ((this->collisions & COL_EAST_ANY) == COL_NONE) {
moveB = gSineTable[angle] * radius;
this->x.WORD += moveB;
}
}
} else {
if ((this->collisions & COL_EAST_ANY) == COL_EAST_NORTH) {
if ((this->collisions & COL_NORTH_ANY) == COL_NONE) {
moveA = radius * 0x100;
this->y.WORD = this->y.WORD -= moveA;
sub_080AE58C(this, 4, param_4);
if ((this->collisions & COL_EAST_ANY) == COL_NONE) {
moveB = gSineTable[angle] * radius;
this->x.WORD += moveB;
}
}
}
}
} else {
moveA = gSineTable[angle] * radius;
this->x.WORD += moveA;
}
if (((moveA >= -0x3333) && (moveA < 0x3333)) && ((moveB >= -0x3333) && (moveB < 0x3333))) {
return FALSE;
} else {
return TRUE;
}
}
NONMATCH("asm/non_matching/movement/sub_080AEAC0.inc",
bool32 sub_080AEAC0(Entity* this, s32 radius, s32 angle, u32 param_4)) {
s32 moveA = 0;
s32 moveB = 0;
if (((this->collisions & COL_SOUTH_ANY) == COL_NONE) || ((this->collisions & COL_EAST_ANY) == COL_NONE)) {
if ((this->collisions & (COL_SOUTH_ANY | COL_EAST_ANY)) == COL_NONE) {
moveA = gSineTable[angle + 0x40] * radius;
this->y.WORD -= moveA;
moveB = gSineTable[angle] * radius;
this->x.WORD += moveB;
} else {
if ((this->collisions & COL_SOUTH_ANY) == COL_SOUTH_WEST) {
moveA = radius * 0x100;
this->x.WORD += moveA;
sub_080AE58C(this, 0xc, param_4);
} else if ((this->collisions & COL_EAST_ANY) == COL_EAST_SOUTH) {
moveA = radius * 0x100;
this->y.WORD += moveA;
sub_080AE58C(this, 0xc, param_4);
}
if ((this->collisions & COL_SOUTH_ANY) == COL_NONE) {
moveB = gSineTable[angle + 0x40] * radius;
this->y.WORD -= moveB;
}
if ((this->collisions & COL_EAST_ANY) == COL_NONE) {
moveB = gSineTable[angle] * radius;
this->x.WORD += moveB;
}
}
}
if (((moveA >= -0x3333) && (moveA < 0x3333)) && ((moveB >= -0x3333) && (moveB < 0x3333))) {
return FALSE;
} else {
return TRUE;
}
}
END_NONMATCH
bool32 sub_080AEBB4(Entity* this, s32 radius, s32 angle, u32 param_4) {
s32 moveA = 0;
s32 moveB = 0;
if ((this->collisions & COL_SOUTH_ANY) != COL_NONE) {
if ((this->collisions & COL_SOUTH_ANY) == COL_SOUTH_WEST) {
if ((this->collisions & COL_EAST_ANY) == COL_NONE) {
moveA = radius * 0x100;
this->x.WORD += moveA;
sub_080AE58C(this, 0xc, param_4);
if ((this->collisions & COL_SOUTH_ANY) == COL_NONE) {
moveB = gSineTable[angle + 0x40] * radius;
this->y.WORD -= moveB;
}
}
} else {
if ((this->collisions & COL_SOUTH_ANY) == COL_SOUTH_EAST) {
if ((this->collisions & COL_WEST_ANY) == COL_NONE) {
moveA = radius * 0x100;
this->x.WORD -= moveA;
sub_080AE58C(this, 0x14, param_4);
if ((this->collisions & COL_SOUTH_ANY) == COL_NONE) {
moveB = gSineTable[angle + 0x40] * radius;
this->y.WORD -= moveB;
}
}
}
}
} else {
moveA = gSineTable[angle + 0x40] * radius;
this->y.WORD -= moveA;
}
if (((moveA >= -0x3333) && (moveA < 0x3333)) && ((moveB >= -0x3333) && (moveB < 0x3333))) {
return FALSE;
} else {
return TRUE;
}
}
NONMATCH("asm/non_matching/movement/sub_080AECAC.inc",
bool32 sub_080AECAC(Entity* this, s32 radius, s32 angle, u32 param_4)) {
s32 moveA = 0;
s32 moveB = 0;
if (((this->collisions & COL_SOUTH_ANY) == COL_NONE) || ((this->collisions & COL_WEST_ANY) == COL_NONE)) {
if ((this->collisions & (COL_SOUTH_ANY | COL_WEST_ANY)) == COL_NONE) {
moveB = gSineTable[angle + 0x40] * radius;
this->y.WORD -= moveB;
moveA = gSineTable[angle] * radius;
this->x.WORD += moveA;
} else {
if ((this->collisions & COL_SOUTH_ANY) == COL_SOUTH_EAST) {
moveB = radius * 0x100;
this->x.WORD -= moveB;
sub_080AE58C(this, 0x14, param_4);
} else {
if ((this->collisions & COL_WEST_ANY) == COL_WEST_SOUTH) {
moveB = radius * 0x100;
this->y.WORD += moveB;
sub_080AE58C(this, 0x14, param_4);
}
}
if ((this->collisions & COL_SOUTH_ANY) == COL_NONE) {
moveA = gSineTable[angle + 0x40] * radius;
this->y.WORD -= moveA;
}
if ((this->collisions & COL_WEST_ANY) == COL_NONE) {
moveA = gSineTable[angle] * radius;
this->x.WORD += moveA;
}
}
}
if (((moveA >= -0x3333) && (moveA < 0x3333)) && ((moveB >= -0x3333) && (moveB < 0x3333))) {
return FALSE;
} else {
return TRUE;
}
}
END_NONMATCH
bool32 sub_080AEDA0(Entity* this, s32 radius, s32 angle, u32 param_4) {
s32 moveA = 0;
s32 moveB = 0;
if ((this->collisions & COL_WEST_ANY) != COL_NONE) {
if ((this->collisions & COL_WEST_ANY) == COL_WEST_SOUTH) {
if ((this->collisions & COL_SOUTH_ANY) == COL_NONE) {
moveA = radius * 0x100;
this->y.WORD += moveA;
sub_080AE58C(this, 0x1c, param_4);
if ((this->collisions & COL_WEST_ANY) == COL_NONE) {
moveB = gSineTable[angle] * radius;
this->x.WORD += moveB;
}
}
} else {
if ((this->collisions & COL_WEST_ANY) == COL_WEST_NORTH) {
if ((this->collisions & COL_NORTH_ANY) == COL_NONE) {
moveA = radius * 0x100;
this->y.WORD = this->y.WORD + radius * -0x100;
sub_080AE58C(this, 0x1c, param_4);
if ((this->collisions & COL_WEST_ANY) == COL_NONE) {
moveB = gSineTable[angle] * radius;
this->x.WORD += moveB;
}
}
}
}
} else {
moveA = gSineTable[angle] * radius;
this->x.WORD += moveA;
}
if (((moveA >= -0x3333) && (moveA < 0x3333)) && ((moveB >= -0x3333) && (moveB < 0x3333))) {
return FALSE;
} else {
return TRUE;
}
}
NONMATCH("asm/non_matching/movement/sub_080AEE94.inc",
bool32 sub_080AEE94(Entity* this, s32 radius, s32 angle, u32 param_4)) {
s32 moveA = 0;
s32 moveB = 0;
u32 colNorthAny = (this->collisions & COL_NORTH_ANY);
u32 colWestAny = (this->collisions & COL_WEST_ANY);
if ((colNorthAny == COL_NONE) || (colWestAny == COL_NONE)) {
if ((colNorthAny | colWestAny) == COL_NONE) {
moveA = gSineTable[angle + 0x40] * radius;
this->y.WORD -= moveA;
moveB = gSineTable[angle] * radius;
this->x.WORD += moveB;
} else {
if (colNorthAny == COL_NORTH_EAST) {
moveA = radius * 0x100;
this->x.WORD -= moveA;
sub_080AE58C(this, 0x1c, param_4);
} else {
if (colWestAny == COL_WEST_NORTH) {
moveA = radius * 0x100;
this->y.WORD -= moveA;
sub_080AE58C(this, 0x1c, param_4);
}
}
if ((this->collisions & COL_NORTH_ANY) == COL_NONE) {
moveB = gSineTable[angle + 0x40] * radius;
this->y.WORD -= moveB;
}
if ((this->collisions & COL_WEST_ANY) == COL_NONE) {
moveB = gSineTable[angle] * radius;
this->x.WORD += moveB;
}
}
}
if (((moveA >= -0x3333) && (moveA < 0x3333)) && ((moveB >= -0x3333) && (moveB < 0x3333))) {
return FALSE;
} else {
return TRUE;
}
}
END_NONMATCH
u32 ProcessMovement(Entity* this) {
u32 result;
if ((this->direction & 0x80) == 0) {
sub_080AE58C(this, this->direction, 0);
result = sub_080AE7E8(this, this->speed, this->direction, 0);
} else {
result = 0;
}
return result;
}
u32 sub_080AEFB4(Entity* this) {
u32 result;
if ((this->direction & 0x80) == 0) {
sub_080AE58C(this, this->direction, 1);
result = sub_080AE7E8(this, this->speed, this->direction, 1);
} else {
result = 0;
}
return result;
}
u32 sub_080AEFE0(Entity* this) {
u32 result;
if ((this->direction & 0x80) == 0) {
sub_080AE58C(this, this->direction, 2);
result = sub_080AE7E8(this, this->speed, this->direction, 2);
} else {
result = 0;
}
return result;
}
u32 sub_080AF00C(Entity* this) {
u32 result;
if ((this->direction & 0x80) == 0) {
sub_080AE58C(this, this->direction, 10);
result = sub_080AE7E8(this, this->speed, this->direction, 10);
} else {
result = 0;
}
return result;
}
u32 sub_080AF038(Entity* this) {
u32 result;
if ((this->direction & 0x80) == 0) {
sub_080AE58C(this, (u32)this->direction, 0xc);
result = sub_080AE7E8(this, (s32)this->speed, this->direction, 0xc);
} else {
result = 0;
}
return result;
}
u32 sub_080AF064(Entity* this, u32 param_2, u32 param_3) {
u32 result;
if ((param_2 & 0x80) == 0) {
sub_080AE58C(this, param_2, 0);
result = sub_080AE7E8(this, param_3, param_2, 0);
} else {
result = 0;
}
return result;
}
u32 sub_080AF090(Entity* this) {
u32 result;
if (((this->direction & 0x80) == 0) && (sub_080AF0C8(this) == 0)) {
sub_080AE58C(this, (u32)this->direction, 3);
result = sub_080AE7E8(this, (s32)this->speed, this->direction, 3);
} else {
result = 0;
}
return result;
}
bool32 sub_080AF0C8(Entity* this) {
u32 tileType = GetTileTypeByEntity(this);
switch (tileType) {
case 0x87:
if (((this->direction + 7) & 0x1f) < 0x10) {
this->collisions = COL_NORTH_ANY;
return TRUE;
}
break;
case 0x8a:
if (((this->direction - 1) & 0x1f) < 0x10) {
this->collisions = COL_EAST_ANY;
return TRUE;
}
break;
case 0x88:
if (((this->direction - 9) & 0x1f) < 0x10) {
this->collisions = COL_SOUTH_ANY;
return TRUE;
}
break;
case 0x89:
if (((this->direction - 0x11) & 0x1f) < 0x10) {
this->collisions = COL_WEST_ANY;
return TRUE;
}
break;
}
return FALSE;
}
u32 sub_080AF134(Entity* this) {
u32 result;
if ((this->direction & 0x80) == 0) {
sub_080AE58C(this, this->direction, 4);
result = sub_080AE7E8(this, this->speed, this->direction, 4);
} else {
result = 0;
}
return result;
}
u32 sub_080AF160(Entity* this) {
u32 result;
if ((this->direction & 0x80) == 0) {
sub_080AE58C(this, this->direction, 5);
result = sub_080AE7E8(this, this->speed, this->direction, 5);
} else {
result = 0;
}
return result;
}
void sub_080AF18C(Entity* this) {
this->knockbackDuration--;
sub_080AE58C(this, this->knockbackDirection, 2);
sub_080AE7E8(this, this->field_0x46, this->knockbackDirection, 2);
}
void sub_080AF1BC(Entity* this) {
this->knockbackDuration--;
sub_080AE58C(this, this->knockbackDirection, 1);
sub_080AE7E8(this, this->field_0x46, this->knockbackDirection, 1);
}
u32 sub_080AF1EC(Entity* this) {
u32 result;
if ((this->direction & 0x80) == 0) {
sub_080AE58C(this, this->direction, 6);
result = sub_080AE7E8(this, this->speed, this->direction, 6);
} else {
result = 0;
}
return result;
}
u32 sub_080AF218(Entity* this, u32 param_2, u32 param_3) {
u32 result;
if ((param_2 & 0x80) == 0) {
sub_080AE58C(this, param_2, 6);
result = sub_080AE7E8(this, param_3, param_2, 6);
} else {
result = 0;
}
return result;
}
void sub_080AF244(Entity* param_1, u32 param_2, u32 param_3) {
sub_080AE7E8(param_1, param_2, param_3, 2);
}
void sub_080AF250(s32 param_1) {
gArea.pCurrentRoomInfo = GetCurrentRoomInfo();
if (param_1 != 0) {
(gArea.pCurrentRoomInfo)->exits = gUnk_08135190;
} else {
(gArea.pCurrentRoomInfo)->exits = gExitList_RoyalValley_ForestMaze;
}
}
void sub_080AF284(void) {
if (CheckPlayerInRegion(0x78, gRoomControls.height - 0x50, 0x78, 0x50)) {
gArea.pCurrentRoomInfo = GetCurrentRoomInfo();
(gArea.pCurrentRoomInfo)->exits = gUnk_08135048;
} else {
if (GetInventoryValue(ITEM_FOURSWORD) == 0) {
return;
}
gArea.pCurrentRoomInfo = GetCurrentRoomInfo();
(gArea.pCurrentRoomInfo)->exits = gUnk_08134FBC;
}
}
void sub_080AF2E4(void) {
if (GetInventoryValue(ITEM_FOURSWORD)) {
gArea.pCurrentRoomInfo = GetCurrentRoomInfo();
(gArea.pCurrentRoomInfo)->exits = gUnk_0813A76C;
}
}
+1 -2
View File
@@ -25,7 +25,6 @@ void sub_0806D138(unk_0806D138param_1* param_1, unk_0806D138param_2* param_2);
extern void InitBiggoronTimer(void);
extern u32 gUnk_0200B650;
void sub_0806D110(void);
void sub_0806D164(Entity* this);
@@ -88,7 +87,7 @@ Entity* sub_0806D00C(Entity* this) {
ASM_FUNC("asm/non_matching/bigGoron/sub_0806D02C.inc", void sub_0806D02C(Entity* this))
void sub_0806D0B0(Entity* this) {
gUnk_0200B650 = 0;
gMapTop.bgControlPtr = 0;
LoadGfxGroup(0x30);
sub_0806D110();
MemClear(&gMapDataTopSpecial, 0x2000);
+38 -38
View File
@@ -39,8 +39,8 @@ void sub_08060E94(Entity*);
u32 PointInsideRadius(s32, s32, s32);
extern Entity gUnk_0200D654;
extern Entity gUnk_02027EB4;
extern u8 gUnk_0200D654[];
extern u8 gUnk_02027EB4[];
extern u32 sub_080AF1EC(Entity*);
u32 sub_080611D4(Entity*);
@@ -64,13 +64,13 @@ bool32 sub_08061978(Entity*, s32, s32, s32);
bool32 sub_08061810(Entity*, s32, s32, s32);
bool32 sub_08061900(Entity*, s32, s32, s32);
bool32 sub_08061A74(Entity*, s32, s32, s32);
bool32 sub_08061A74(u8*, s32, s32, s32);
bool32 sub_08061A1C(Entity*, s32, s32, s32);
bool32 sub_08061A1C(u8*, s32, s32, s32);
bool32 sub_080619F0(Entity*, s32, s32, s32);
bool32 sub_080619F0(u8*, s32, s32, s32);
bool32 sub_08061A48(Entity*, s32, s32, s32);
bool32 sub_08061A48(u8*, s32, s32, s32);
extern void (*const gUnk_0810AC70[])(Entity*);
@@ -635,9 +635,9 @@ void sub_08061464(Entity* this, u32 param_a, u32 param_b) {
bool32 sub_08061630(Entity* this, s32 x, s32 y, s32 param) {
u32 param_y = y;
Entity* entity = (this->collisionLayer == 2) ? &gUnk_0200D654 : &gUnk_02027EB4;
while (!sub_080AE4CC(entity, x, y, 6)) {
if (sub_08061A74(entity, x, y, param)) {
u8* layer = (this->collisionLayer == 2) ? gUnk_0200D654 : gUnk_02027EB4;
while (!sub_080AE4CC(layer, x, y, 6)) {
if (sub_08061A74(layer, x, y, param)) {
((UnkHeap*)this->myHeap)->unk_7 = x;
((UnkHeap*)this->myHeap)->unk_8 = param_y;
((UnkHeap*)this->myHeap)->unk_0 |= 8;
@@ -652,9 +652,9 @@ bool32 sub_08061630(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_080616A8(Entity* this, s32 x, s32 y, s32 param) {
u32 param_y = y;
Entity* entity = (this->collisionLayer == 2) ? &gUnk_0200D654 : &gUnk_02027EB4;
while (!sub_080AE4CC(entity, x, y, 6)) {
if (sub_08061A1C(entity, x, y, param)) {
u8* layer = (this->collisionLayer == 2) ? gUnk_0200D654 : gUnk_02027EB4;
while (!sub_080AE4CC(layer, x, y, 6)) {
if (sub_08061A1C(layer, x, y, param)) {
((UnkHeap*)this->myHeap)->unk_7 = x;
((UnkHeap*)this->myHeap)->unk_8 = param_y;
((UnkHeap*)this->myHeap)->unk_0 |= 8;
@@ -669,9 +669,9 @@ bool32 sub_080616A8(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_08061720(Entity* this, s32 x, s32 y, s32 param) {
u32 param_x = x;
Entity* entity = (this->collisionLayer == 2) ? &gUnk_0200D654 : &gUnk_02027EB4;
while (!sub_080AE4CC(entity, x, y, 6)) {
if (sub_080619F0(entity, x, y, param)) {
u8* layer = (this->collisionLayer == 2) ? gUnk_0200D654 : gUnk_02027EB4;
while (!sub_080AE4CC(layer, x, y, 6)) {
if (sub_080619F0(layer, x, y, param)) {
((UnkHeap*)this->myHeap)->unk_7 = param_x;
((UnkHeap*)this->myHeap)->unk_8 = y;
((UnkHeap*)this->myHeap)->unk_0 |= 8;
@@ -686,9 +686,9 @@ bool32 sub_08061720(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_08061798(Entity* this, s32 x, s32 y, s32 param) {
u32 param_x = x;
Entity* entity = (this->collisionLayer == 2) ? &gUnk_0200D654 : &gUnk_02027EB4;
while (!sub_080AE4CC(entity, x, y, 6)) {
if (sub_08061A48(entity, x, y, param)) {
u8* layer = (this->collisionLayer == 2) ? gUnk_0200D654 : gUnk_02027EB4;
while (!sub_080AE4CC(layer, x, y, 6)) {
if (sub_08061A48(layer, x, y, param)) {
((UnkHeap*)this->myHeap)->unk_7 = param_x;
((UnkHeap*)this->myHeap)->unk_8 = y;
((UnkHeap*)this->myHeap)->unk_0 |= 8;
@@ -703,9 +703,9 @@ bool32 sub_08061798(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_08061810(Entity* this, s32 x, s32 y, s32 param) {
u32 param_y = y;
Entity* entity = (this->collisionLayer == 2) ? &gUnk_0200D654 : &gUnk_02027EB4;
while (!sub_080AE4CC(entity, x, y, 6)) {
if (sub_08061A74(entity, x, y, param)) {
u8* layer = (this->collisionLayer == 2) ? gUnk_0200D654 : gUnk_02027EB4;
while (!sub_080AE4CC(layer, x, y, 6)) {
if (sub_08061A74(layer, x, y, param)) {
((UnkHeap*)this->myHeap)->unk_7 = x;
((UnkHeap*)this->myHeap)->unk_8 = param_y;
((UnkHeap*)this->myHeap)->unk_0 |= 8;
@@ -720,9 +720,9 @@ bool32 sub_08061810(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_08061888(Entity* this, s32 x, s32 y, s32 param) {
u32 param_y = y;
Entity* entity = (this->collisionLayer == 2) ? &gUnk_0200D654 : &gUnk_02027EB4;
while (!sub_080AE4CC(entity, x, y, 6)) {
if (sub_08061A1C(entity, x, y, param)) {
u8* layer = (this->collisionLayer == 2) ? gUnk_0200D654 : gUnk_02027EB4;
while (!sub_080AE4CC(layer, x, y, 6)) {
if (sub_08061A1C(layer, x, y, param)) {
((UnkHeap*)this->myHeap)->unk_7 = x;
((UnkHeap*)this->myHeap)->unk_8 = param_y;
((UnkHeap*)this->myHeap)->unk_0 |= 8;
@@ -737,9 +737,9 @@ bool32 sub_08061888(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_08061900(Entity* this, s32 x, s32 y, s32 param) {
u32 param_x = x;
Entity* entity = (this->collisionLayer == 2) ? &gUnk_0200D654 : &gUnk_02027EB4;
while (!sub_080AE4CC(entity, x, y, 6)) {
if (sub_080619F0(entity, x, y, param)) {
u8* layer = (this->collisionLayer == 2) ? gUnk_0200D654 : gUnk_02027EB4;
while (!sub_080AE4CC(layer, x, y, 6)) {
if (sub_080619F0(layer, x, y, param)) {
((UnkHeap*)this->myHeap)->unk_7 = param_x;
((UnkHeap*)this->myHeap)->unk_8 = y;
((UnkHeap*)this->myHeap)->unk_0 |= 8;
@@ -754,9 +754,9 @@ bool32 sub_08061900(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_08061978(Entity* this, s32 x, s32 y, s32 param) {
u32 param_x = x;
Entity* entity = (this->collisionLayer == 2) ? &gUnk_0200D654 : &gUnk_02027EB4;
while (!sub_080AE4CC(entity, x, y, 6)) {
if (sub_08061A48(entity, x, y, param)) {
u8* layer = (this->collisionLayer == 2) ? gUnk_0200D654 : gUnk_02027EB4;
while (!sub_080AE4CC(layer, x, y, 6)) {
if (sub_08061A48(layer, x, y, param)) {
((UnkHeap*)this->myHeap)->unk_7 = param_x;
((UnkHeap*)this->myHeap)->unk_8 = y;
((UnkHeap*)this->myHeap)->unk_0 |= 8;
@@ -769,9 +769,9 @@ bool32 sub_08061978(Entity* this, s32 x, s32 y, s32 param) {
return FALSE;
}
bool32 sub_080619F0(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_080619F0(u8* layer, s32 x, s32 y, s32 param) {
while (param <= y) {
if (sub_080AE4CC(this, x, y, 6) != 0) {
if (sub_080AE4CC(layer, x, y, 6) != 0) {
return FALSE;
}
y -= 8;
@@ -779,9 +779,9 @@ bool32 sub_080619F0(Entity* this, s32 x, s32 y, s32 param) {
return TRUE;
}
bool32 sub_08061A1C(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_08061A1C(u8* layer, s32 x, s32 y, s32 param) {
while (param >= x) {
if (sub_080AE4CC(this, x, y, 6) != 0) {
if (sub_080AE4CC(layer, x, y, 6) != 0) {
return FALSE;
}
x += 8;
@@ -789,9 +789,9 @@ bool32 sub_08061A1C(Entity* this, s32 x, s32 y, s32 param) {
return TRUE;
}
bool32 sub_08061A48(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_08061A48(u8* layer, s32 x, s32 y, s32 param) {
while (param >= y) {
if (sub_080AE4CC(this, x, y, 6) != 0) {
if (sub_080AE4CC(layer, x, y, 6) != 0) {
return FALSE;
}
y += 8;
@@ -799,9 +799,9 @@ bool32 sub_08061A48(Entity* this, s32 x, s32 y, s32 param) {
return TRUE;
}
bool32 sub_08061A74(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_08061A74(u8* layer, s32 x, s32 y, s32 param) {
while (param <= x) {
if (sub_080AE4CC(this, x, y, 6) != 0) {
if (sub_080AE4CC(layer, x, y, 6) != 0) {
return FALSE;
}
x -= 8;
+1 -2
View File
@@ -190,7 +190,6 @@ u32 sub_08081F00(u32*, u32*);
extern u16 gMapDataTopSpecial[0x2000];
extern u16* GetLayerByIndex(u32);
extern u16 gUnk_02019EE0[];
NONMATCH("asm/non_matching/button/sub_08081E6C.inc", void sub_08081E6C(Entity* this)) {
u32 r4;
@@ -201,7 +200,7 @@ NONMATCH("asm/non_matching/button/sub_08081E6C.inc", void sub_08081E6C(Entity* t
u32 tile = GetTileType(r6, r5);
if (tile < 0x4000)
return;
r1 = GetLayerByIndex(r5);
r1 = (u16*)GetLayerByIndex(r5);
r4 = (this->type == 0 ? 0x7a : 0x78);
tmp = r1 + 0x3802;
r1 += 0x3002 + r4;
+7 -7
View File
@@ -2,27 +2,27 @@
#include "entity.h"
#include "functions.h"
extern void* gUnk_02027EB4;
extern void* gUnk_0200D654;
extern u8 gUnk_02027EB4[];
extern u8 gUnk_0200D654[];
void ObjectB2(Entity* this) {
void* pEVar3;
u8* layer;
if (this->action == 0) {
this->action = 1;
this->actionDelay = 0x10;
this->direction = this->type << 3;
if (this->collisionLayer == 2) {
pEVar3 = &gUnk_0200D654;
layer = gUnk_0200D654;
} else {
pEVar3 = &gUnk_02027EB4;
layer = gUnk_02027EB4;
}
this->child = pEVar3;
this->child = (Entity*)layer;
InitializeAnimation(this, this->type);
}
this->speed = this->parent->speed;
LinearMoveUpdate(this);
if (sub_080AE4CC(this->child, this->x.HALF.HI, this->y.HALF.HI, 9) != 0) {
if (sub_080AE4CC((u8*)this->child, this->x.HALF.HI, this->y.HALF.HI, 9) != 0) {
DeleteThisEntity();
}
if (this->speed < 0x41) {
-1
View File
@@ -20,7 +20,6 @@ typedef struct {
/*0x86*/ u16 unk_86;
} PushableStatueEntity;
extern u8* GetLayerByIndex(u32);
extern const Hitbox gUnk_080FD1F4;
extern const s16 gUnk_080B4488[];
extern const s16 gUnk_080B4468[];
-1
View File
@@ -6,7 +6,6 @@
#include "flags.h"
#include "functions.h"
extern u32* GetLayerByIndex(u32);
extern void sub_08085394(Entity*);
extern void sub_0808543C(Entity*);
extern u32 sub_080854A8(Entity*);
+2 -2
View File
@@ -5,7 +5,7 @@
#include "projectile.h"
extern u32 sub_080644C8(Entity*);
extern Entity gUnk_02027EB4;
extern u8 gUnk_02027EB4[];
extern const Hitbox gUnk_080FD1E4;
extern const u8 gUnk_081299C8[];
@@ -62,7 +62,7 @@ void GuardLineOfSight(Entity* this) {
DeleteThisEntity();
}
LinearMoveUpdate(this);
if (sub_080AE4CC(&gUnk_02027EB4, this->x.HALF.HI, this->y.HALF.HI, 2) != 0) {
if (sub_080AE4CC(gUnk_02027EB4, this->x.HALF.HI, this->y.HALF.HI, 2) != 0) {
DeleteThisEntity();
}
}
+2 -5
View File
@@ -6,7 +6,6 @@
extern void (*const Winder_Actions[])(Entity*);
extern s16 gUnk_080B4488[];
extern u8* GetLayerByIndex(u32);
static const u8 gUnk_0812A6BC[];
static const u16 gUnk_0812A6C4[];
@@ -87,14 +86,12 @@ void sub_080AB9DC(Entity* this) {
bool32 sub_080AB9FC(Entity* this, u32 dir) {
u32 val;
u8* layer = GetLayerByIndex(this->collisionLayer);
LayerStruct* layer = GetLayerByIndex(this->collisionLayer);
u32 tmp;
val = (((this->x.HALF.HI - gRoomControls.origin_x) >> 4) & 0x3f) |
((((this->y.HALF.HI - gRoomControls.origin_y) >> 4) & 0x3f) << 6);
val += gUnk_080B4488[dir >> 3];
layer += 0x2004;
layer += val;
tmp = *layer;
tmp = layer->_2004[val];
if (tmp <= 0x1f) {
return 0;
}
+1 -3
View File
@@ -2536,12 +2536,10 @@ u32 sub_unk3_CaveOfFlamesBoss_Main(void) {
extern EntityData gUnk_additional_a_CaveOfFlamesBoss_Main;
extern u32 gUnk_0200B650;
void sub_StateChange_CaveOfFlamesBoss_Main(void) {
if (CheckGlobalFlag(LV2_CLEAR)) {
gUnk_0200B650 = 0;
gMapTop.bgControlPtr = 0;
gScreen.lcd.displayControl &= ~DISPCNT_BG1_ON;
sub_0807AABC(&gPlayerEntity);
LoadRoomEntityList(&gUnk_additional_a_CaveOfFlamesBoss_Main);
+4 -5
View File
@@ -3,11 +3,10 @@
#include "structures.h"
#include "functions.h"
#include "game.h"
#include "map.h"
extern void sub_08080BC4(void);
extern u32 gUnk_0200B650;
extern u32 gUnk_02025EB0;
extern u8 gUpdateVisibleTiles;
void sub_080808D8(void) {
@@ -43,11 +42,11 @@ void sub_08080930(void) {
SetInitializationPriority();
}
u32* GetLayerByIndex(u32 param_1) {
LayerStruct* GetLayerByIndex(u32 param_1) {
if (param_1 == 2) {
return &gUnk_0200B650;
return &gMapTop;
} else {
return &gUnk_02025EB0;
return &gMapBottom;
}
}