Decomped GetMapTile_2

This commit is contained in:
AnonymousRandomPerson
2022-02-20 21:59:07 -05:00
parent 96372eb336
commit 60a19d681c
41 changed files with 456 additions and 487 deletions

View File

@@ -4953,7 +4953,7 @@ sub_803F7BC:
ldrsh r0, [r5, r1]
movs r2, 0x2
ldrsh r1, [r5, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
ldrb r1, [r0, 0x9]
ldr r2, _0803F808
adds r0, r4, r2

View File

@@ -232,7 +232,7 @@ _080402FC:
_08040302:
mov r0, r8
adds r1, r3, 0
bl GetMapTileAtPosition
bl GetMapTile_1
mov r9, r0
ldrh r0, [r0]
movs r5, 0x3
@@ -553,7 +553,7 @@ _0804056C:
adds r1, r3, 0
adds r1, 0x1
mov r0, r8
bl GetMapTileAtPosition
bl GetMapTile_1
ldrh r1, [r0]
movs r0, 0x3
ands r0, r1
@@ -567,7 +567,7 @@ _0804058A:
adds r1, r5, 0
subs r1, 0x1
mov r0, r8
bl GetMapTileAtPosition
bl GetMapTile_1
ldrh r1, [r0]
movs r0, 0x3
ands r0, r1
@@ -583,7 +583,7 @@ _080405AA:
mov r0, r8
adds r0, 0x1
ldr r1, [sp]
bl GetMapTileAtPosition
bl GetMapTile_1
ldrh r1, [r0]
movs r0, 0x3
ands r0, r1
@@ -598,7 +598,7 @@ _080405CA:
ble _080405E8
subs r0, 0x1
ldr r1, [sp]
bl GetMapTileAtPosition
bl GetMapTile_1
ldrh r1, [r0]
movs r0, 0x3
ands r0, r1
@@ -2523,7 +2523,7 @@ sub_80414C0:
cmp r0, 0x9C
bne _080414DC
adds r0, r5, 0
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
bl IsTileGround
lsls r0, 24
cmp r0, 0
@@ -2533,7 +2533,7 @@ _080414DC:
cmp r0, 0x8
bne _080414F6
adds r0, r5, 0
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
ldrh r1, [r0]
movs r0, 0x3
ands r0, r1

View File

@@ -2410,7 +2410,7 @@ _08043E6A:
_08043E6E:
adds r0, r5, 0
adds r1, r6, 0
bl GetMapEntity
bl GetMapTile_2
ldr r4, [r0, 0x14]
adds r0, r4, 0
bl EntityExists

View File

@@ -4,7 +4,7 @@
.syntax unified
.text
thumb_func_start sub_8044CC8
sub_8044CC8:
push {lr}
@@ -33,7 +33,7 @@ _08044CEC:
ldrsh r0, [r2, r1]
movs r3, 0x6
ldrsh r1, [r2, r3]
bl GetMapTileAtPosition
bl GetMapTile_1
ldr r0, [r0, 0x14]
bl GetItemData
b _08044D34

View File

@@ -792,7 +792,7 @@ sub_8045708:
ldrsh r0, [r1, r2]
movs r3, 0x2
ldrsh r1, [r1, r3]
bl GetMapEntity
bl GetMapTile_2
ldrh r1, [r0]
movs r0, 0x3
ands r0, r1

View File

@@ -426,7 +426,7 @@ _08045CEE:
_08045CF6:
adds r0, r5, 0
adds r1, r6, 0
bl GetMapTileAtPosition
bl GetMapTile_1
adds r2, r0, 0
ldrh r0, [r2]
movs r3, 0x80
@@ -542,7 +542,7 @@ sub_8045DB4:
ldrsh r0, [r1, r2]
movs r3, 0x2
ldrsh r1, [r1, r3]
bl GetMapTileAtPosition
bl GetMapTile_1
ldr r4, [r0, 0x14]
cmp r4, 0
bne _08045DE8
@@ -958,7 +958,7 @@ _08046110:
ldrsh r0, [r5, r1]
movs r2, 0x2
ldrsh r1, [r5, r2]
bl GetMapEntity
bl GetMapTile_2
str r4, [r0, 0x14]
ldrh r1, [r0]
movs r0, 0x20
@@ -1044,7 +1044,7 @@ sub_80461C8:
ldrsh r0, [r2, r1]
movs r3, 0x2
ldrsh r1, [r2, r3]
bl GetMapEntity
bl GetMapTile_2
adds r6, r0, 0
ldr r5, [r6, 0x14]
cmp r5, 0
@@ -1187,7 +1187,7 @@ _080462E4:
ldrsh r0, [r4, r1]
movs r2, 0x6
ldrsh r1, [r4, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
ldrh r0, [r0]
movs r1, 0x3
ands r1, r0
@@ -1492,7 +1492,7 @@ sub_804652C:
ldrsh r0, [r5, r1]
movs r2, 0x6
ldrsh r1, [r5, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r4, r0, 0
ldr r0, [r4, 0x14]
movs r3, 0
@@ -1559,7 +1559,7 @@ _080465A8:
movs r2, 0
ldrsh r0, [r0, r2]
asrs r1, 16
bl GetMapTileAtPosition
bl GetMapTile_1
adds r4, r0, 0
ldrh r1, [r4]
movs r6, 0x3
@@ -1630,7 +1630,7 @@ _08046644:
ldrsh r0, [r0, r3]
movs r2, 0x2
ldrsh r1, [r4, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
ldrh r0, [r0]
movs r1, 0x3
ands r1, r0
@@ -1999,7 +1999,7 @@ _08046904:
lsls r0, r4, 16
asrs r0, 16
asrs r1, r4, 16
bl GetMapTileAtPosition
bl GetMapTile_1
adds r2, r0, 0
ldrh r1, [r2]
movs r0, 0x3

View File

@@ -4,7 +4,7 @@
.syntax unified
.text
thumb_func_start sub_8046CE4
sub_8046CE4:
push {r4,r5,lr}
@@ -715,7 +715,7 @@ _08047228:
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTileAtPosition
bl GetMapTile_1
adds r5, r0, 0
ldrh r1, [r5]
movs r0, 0x3
@@ -747,7 +747,7 @@ _0804727A:
ldrsh r1, [r1, r3]
adds r1, r2
str r2, [sp, 0x234]
bl GetMapTileAtPosition
bl GetMapTile_1
ldrh r1, [r0]
movs r0, 0x3
ands r0, r1
@@ -868,7 +868,7 @@ _0804737A:
ldrsh r0, [r7, r4]
movs r2, 0x6
ldrsh r1, [r7, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r5, r0, 0
ldrh r1, [r5]
movs r0, 0x3
@@ -1424,7 +1424,7 @@ _080477D0:
ldrsh r0, [r3, r1]
movs r2, 0x2
ldrsh r1, [r3, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r4, r0, 0
ldr r0, [r4, 0x10]
cmp r0, 0

File diff suppressed because it is too large Load Diff

View File

@@ -2668,7 +2668,7 @@ _080538DA:
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTileAtPosition
bl GetMapTile_1
ldr r0, [r0, 0x10]
str r0, [sp, 0x38]
bl EntityExists
@@ -7995,7 +7995,7 @@ _08056780:
movs r2, 0
ldrsh r0, [r6, r2]
asrs r1, 16
bl GetMapTileAtPosition
bl GetMapTile_1
adds r2, r0, 0
ldrh r1, [r2]
movs r0, 0x3
@@ -8307,7 +8307,7 @@ _08056A0E:
ldrsh r0, [r7, r2]
movs r6, 0x2
ldrsh r1, [r7, r6]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r6, r0, 0
ldrh r1, [r6]
movs r0, 0x3

View File

@@ -909,7 +909,7 @@ sub_8057788:
movs r0, 0
mov r9, r0
adds r0, r4, 0
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
adds r5, r0, 0
bl IsTileGround
lsls r0, 24

View File

@@ -4061,7 +4061,7 @@ DiveMoveAction:
adds r5, r2, 0
mov r8, r3
movs r6, 0
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
bl IsTileGround
lsls r0, 24
cmp r0, 0
@@ -6328,7 +6328,7 @@ _0805A94C:
add r4, sp, 0x18
movs r2, 0x2
ldrsh r1, [r4, r2]
bl GetMapEntity
bl GetMapTile_2
ldr r5, [r0, 0x10]
cmp r5, 0
beq _0805AA4C
@@ -9264,7 +9264,7 @@ TrapbustOrbAction:
movs r0, 0
str r0, [sp, 0x10]
adds r0, r1, 0
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
adds r4, r0, 0
bl IsBossBattle
lsls r0, 24
@@ -9344,7 +9344,7 @@ _0805BFE0:
_0805BFF0:
adds r0, r6, 0
adds r1, r5, 0
bl GetMapEntity
bl GetMapTile_2
ldr r4, [r0, 0x14]
cmp r4, 0
beq _0805C028
@@ -9770,7 +9770,7 @@ _0805C2DC:
ldrsh r0, [r0, r1]
movs r2, 0x2
ldrsh r1, [r4, r2]
bl GetMapEntity
bl GetMapTile_2
adds r2, r0, 0
ldrh r1, [r2]
movs r0, 0x3

View File

@@ -4,7 +4,7 @@
.syntax unified
.text
thumb_func_start CanUseOnTargetWithStatusChecker
CanUseOnTargetWithStatusChecker:
push {r4-r7,lr}
@@ -2837,7 +2837,7 @@ _0805E76A:
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTileAtPosition
bl GetMapTile_1
adds r4, r0, 0
ldr r0, [r4, 0x10]
cmp r0, 0
@@ -2982,7 +2982,7 @@ sub_805E874:
ldrsh r2, [r2, r3]
str r2, [sp, 0x1C]
adds r1, r2, 0
bl GetMapTileAtPosition
bl GetMapTile_1
adds r5, r0, 0
ldr r1, _0805E910
ldr r2, [sp, 0x18]
@@ -3023,7 +3023,7 @@ sub_805E874:
bne _0805E918
adds r0, r7, 0
adds r1, r6, 0
bl GetMapTileAtPosition
bl GetMapTile_1
ldrb r0, [r0, 0x9]
cmp r0, 0xFF
beq _0805E922
@@ -3061,7 +3061,7 @@ _0805E92E:
ldrsh r1, [r1, r3]
ldr r2, [sp, 0x1C]
adds r1, r2, r1
bl GetMapTileAtPosition
bl GetMapTile_1
adds r1, r0, 0
ldr r0, [r1, 0x10]
cmp r0, 0
@@ -3128,7 +3128,7 @@ _0805E9BC:
_0805E9C8:
adds r0, r7, 0
adds r1, r6, 0
bl GetMapTileAtPosition
bl GetMapTile_1
adds r5, r0, 0
ldr r0, [r5, 0x14]
cmp r0, 0
@@ -3485,7 +3485,7 @@ sub_805EC4C:
lsls r0, r2, 16
asrs r0, 16
asrs r1, r2, 16
bl GetMapTileAtPosition
bl GetMapTile_1
ldr r0, [r0, 0x10]
mov r8, r0
cmp r0, 0
@@ -3719,7 +3719,7 @@ _0805EE42:
b _0805EF52
_0805EE4E:
adds r0, r5, 0
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
adds r4, r0, 0
adds r0, r5, 0
movs r1, 0xD
@@ -4818,7 +4818,7 @@ _0805F742:
movs r3, 0x6
ldrsh r1, [r0, r3]
adds r0, r2, 0
bl GetMapTileAtPosition
bl GetMapTile_1
ldr r4, [r0, 0x14]
cmp r4, 0
bne _0805F75C
@@ -6609,7 +6609,7 @@ _0806063C:
ldrsh r0, [r1, r2]
movs r3, 0x6
ldrsh r1, [r1, r3]
bl GetMapTileAtPosition
bl GetMapTile_1
ldr r0, [r0, 0x14]
bl GetItemData
adds r7, r0, 0
@@ -7231,7 +7231,7 @@ _08060B3C:
ldrsh r0, [r1, r2]
movs r3, 0x6
ldrsh r1, [r1, r3]
bl GetMapTileAtPosition
bl GetMapTile_1
ldr r0, [r0, 0x14]
cmp r0, 0
bne _08060B68
@@ -14514,7 +14514,7 @@ sub_806455C:
ldrsh r0, [r4, r1]
movs r2, 0x2
ldrsh r1, [r4, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r4, r0, 0
ldr r0, _080645D0
ldr r2, [r0]
@@ -14658,7 +14658,7 @@ _08064640:
ldrsh r0, [r3, r1]
movs r2, 0x2
ldrsh r1, [r3, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
ldr r4, [r0, 0x14]
cmp r4, 0
bne _080646B8
@@ -19433,7 +19433,7 @@ _08066D68:
ldrsh r0, [r4, r1]
movs r2, 0x6
ldrsh r1, [r4, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r2, r0, 0
ldrh r1, [r2]
movs r0, 0x80
@@ -19582,7 +19582,7 @@ _08066EA8:
ldrsh r0, [r2, r3]
movs r3, 0x6
ldrsh r1, [r2, r3]
bl GetMapTileAtPosition
bl GetMapTile_1
ldr r0, [r0, 0x14]
cmp r0, 0
beq _08066ECC
@@ -19708,7 +19708,7 @@ sub_8066FA4:
ldrsh r0, [r7, r1]
movs r2, 0x6
ldrsh r1, [r7, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
mov r10, r0
adds r0, r7, 0
movs r1, 0
@@ -23721,7 +23721,7 @@ sub_8068F80:
cmp r5, 0
beq _08068FCC
adds r0, r5, 0
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
ldrh r0, [r0]
lsrs r0, 5
movs r1, 0x1
@@ -23759,7 +23759,7 @@ sub_8068FE0:
asrs r1, 16
mov r9, r1
ldr r7, [r0, 0x70]
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
adds r4, r0, 0
ldr r0, [sp, 0x74]
cmp r0, 0
@@ -24352,7 +24352,7 @@ sub_80694C0:
mov r9, r3
adds r0, r7, 0
mov r1, r8
bl GetMapEntity
bl GetMapTile_2
mov r10, r0
ldr r5, [r4, 0x70]
adds r6, r5, 0
@@ -24399,7 +24399,7 @@ _08069522:
blt _08069552
adds r1, r0, 0
adds r0, r2, 0
bl GetMapEntity
bl GetMapTile_2
adds r1, r0, 0
ldr r0, [r1, 0x10]
cmp r0, r4
@@ -24546,7 +24546,7 @@ _08069622:
_08069648:
adds r0, r6, 0
adds r1, r7, 0
bl GetMapTileAtPosition
bl GetMapTile_1
ldrb r1, [r0, 0x9]
adds r0, r4, 0
adds r0, 0x25
@@ -24587,7 +24587,7 @@ _0806967C:
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTileAtPosition
bl GetMapTile_1
ldr r0, [r0, 0x10]
_0806969E:
pop {r4,r5}
@@ -24624,7 +24624,7 @@ sub_80696A8:
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTileAtPosition
bl GetMapTile_1
ldr r1, [r0, 0x10]
cmp r1, 0
beq _080696F4
@@ -24679,7 +24679,7 @@ sub_80696FC:
movs r2, 0
ldrsh r0, [r0, r2]
asrs r1, 16
bl GetMapTileAtPosition
bl GetMapTile_1
adds r5, r0, 0
adds r0, r4, 0
mov r1, sp
@@ -24745,7 +24745,7 @@ sub_806977C:
movs r2, 0
ldrsh r0, [r0, r2]
asrs r1, 16
bl GetMapTileAtPosition
bl GetMapTile_1
mov r6, sp
adds r0, r4, 0
mov r1, sp
@@ -24777,7 +24777,7 @@ sub_806977C:
ldrsh r0, [r0, r1]
movs r2, 0x2
ldrsh r1, [r6, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r5, r0, 0
adds r0, r4, 0
mov r1, sp

View File

@@ -4,7 +4,7 @@
.syntax unified
.text
thumb_func_start sub_8069E0C
sub_8069E0C:
push {r4-r7,lr}
@@ -850,7 +850,7 @@ _0806A488:
movs r2, 0x6
ldrsh r1, [r6, r2]
adds r1, r7
bl GetMapEntity
bl GetMapTile_2
adds r4, r0, 0
ldr r0, [r4, 0x10]
cmp r0, 0
@@ -1029,7 +1029,7 @@ sub_806A5B8:
b _0806A6D2
_0806A5CE:
adds r0, r6, 0
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
ldrh r0, [r0]
movs r1, 0x3
ands r1, r0
@@ -2565,7 +2565,7 @@ sub_806B168:
adds r1, r4
movs r2, 0
ldrsh r1, [r1, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
ldrb r0, [r0, 0x9]
str r0, [sp, 0x2C]
movs r3, 0
@@ -2764,7 +2764,7 @@ _0806B2D2:
ldrsh r1, [r1, r4]
adds r1, r6, r1
str r3, [sp, 0x38]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r1, r0, 0
ldrb r0, [r1, 0x9]
ldr r3, [sp, 0x38]
@@ -2831,7 +2831,7 @@ _0806B366:
movs r3, 0
ldrsh r1, [r1, r3]
adds r1, r6, r1
bl GetMapTileAtPosition
bl GetMapTile_1
adds r1, r0, 0
mov r4, r8
movs r2, 0xE
@@ -2987,7 +2987,7 @@ _0806B4AE:
asrs r0, r5, 16
asrs r4, 16
adds r1, r4, 0
bl GetMapTileAtPosition
bl GetMapTile_1
ldrb r0, [r0, 0x9]
str r0, [sp, 0x20]
movs r2, 0
@@ -3050,7 +3050,7 @@ _0806B51C:
mov r5, r10
adds r1, r5
str r2, [sp, 0x2C]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r1, r0, 0
ldrb r0, [r1, 0x9]
ldr r2, [sp, 0x2C]
@@ -3116,7 +3116,7 @@ _0806B5A8:
mov r5, r10
adds r1, r5
str r2, [sp, 0x2C]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r1, r0, 0
movs r3, 0xE
ldrsh r0, [r6, r3]
@@ -3166,7 +3166,7 @@ _0806B606:
ldrsh r0, [r2, r1]
movs r3, 0x2
ldrsh r1, [r5, r3]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r1, r0, 0
movs r3, 0xE
ldrsh r0, [r6, r3]
@@ -3324,7 +3324,7 @@ _0806B740:
_0806B748:
adds r0, r5, 0
adds r1, r7, 0
bl GetMapTileAtPosition
bl GetMapTile_1
ldrh r1, [r0, 0x4]
movs r0, 0x8
ands r0, r1
@@ -3426,7 +3426,7 @@ sub_806B7F8:
ldrsh r0, [r6, r1]
movs r2, 0xE
ldrsh r1, [r6, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r1, r0, 0
movs r3, 0
ldrsh r0, [r6, r3]
@@ -3572,7 +3572,7 @@ _0806B930:
_0806B932:
mov r0, r9
mov r1, r10
bl GetMapTileAtPosition
bl GetMapTile_1
adds r1, r0, 0
adds r0, r4, 0
bl sub_807034C

View File

@@ -142,7 +142,7 @@ _0806CF94: .4byte 0x000135cc
sub_806CF98:
push {r4-r7,lr}
adds r4, r0, 0
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
ldrh r0, [r0]
movs r5, 0x3
ands r5, r0
@@ -1123,7 +1123,7 @@ _0806D760:
cmp r0, 0
beq _0806D796
adds r0, r7, 0
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
mov r8, r0
movs r0, 0x14
movs r1, 0x18

View File

@@ -4,7 +4,7 @@
.syntax unified
.text
thumb_func_start sub_807034C
sub_807034C:
push {r4,lr}
@@ -67,7 +67,7 @@ sub_80703A0:
ldrsh r0, [r4, r1]
movs r2, 0x2
ldrsh r1, [r4, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r5, r0, 0
movs r1, 0
ldrsh r0, [r4, r1]
@@ -203,7 +203,7 @@ sub_807049C:
ldrsh r0, [r4, r1]
movs r2, 0x2
ldrsh r1, [r4, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r5, r0, 0
movs r1, 0
ldrsh r0, [r4, r1]
@@ -309,7 +309,7 @@ sub_8070564:
ldrsh r0, [r4, r1]
movs r2, 0x2
ldrsh r1, [r4, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r5, r0, 0
movs r1, 0
ldrsh r0, [r4, r1]
@@ -387,7 +387,7 @@ sub_80705F0:
ldrsh r0, [r4, r1]
movs r2, 0x2
ldrsh r1, [r4, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r5, r0, 0
movs r1, 0
ldrsh r0, [r4, r1]
@@ -480,7 +480,7 @@ sub_80706A4:
ldrsh r0, [r4, r1]
movs r2, 0x2
ldrsh r1, [r4, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r5, r0, 0
movs r1, 0
ldrsh r0, [r4, r1]

View File

@@ -4,7 +4,7 @@
.syntax unified
.text
thumb_func_start sub_8070E3C
sub_8070E3C:
push {r4-r7,lr}
@@ -30,7 +30,7 @@ sub_8070E3C:
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTileAtPosition
bl GetMapTile_1
adds r2, r0, 0
ldrh r1, [r2]
movs r0, 0x10
@@ -89,7 +89,7 @@ _08070EDC:
ldrsh r0, [r6, r1]
movs r2, 0x2
ldrsh r1, [r6, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r2, r0, 0
adds r1, r2, 0
adds r1, 0xA
@@ -133,7 +133,7 @@ sub_8070F14:
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTileAtPosition
bl GetMapTile_1
adds r2, r0, 0
ldrh r1, [r2]
movs r0, 0x10
@@ -147,7 +147,7 @@ sub_8070F14:
ldrsh r0, [r4, r1]
movs r2, 0x6
ldrsh r1, [r4, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r2, r0, 0
ldr r1, _08070F74
movs r0, 0x7
@@ -195,7 +195,7 @@ sub_8070F80:
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTileAtPosition
bl GetMapTile_1
adds r2, r0, 0
ldrh r1, [r2]
movs r0, 0x10
@@ -254,7 +254,7 @@ _08071020:
ldrsh r0, [r4, r1]
movs r2, 0x6
ldrsh r1, [r4, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r2, r0, 0
adds r1, r2, 0
adds r1, 0xA
@@ -304,7 +304,7 @@ sub_8071058:
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTileAtPosition
bl GetMapTile_1
adds r4, r0, 0
ldrh r1, [r4]
movs r0, 0x10
@@ -368,7 +368,7 @@ _08071100:
ldrsh r0, [r5, r1]
movs r2, 0x6
ldrsh r1, [r5, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r4, r0, 0
adds r1, r4, 0
adds r1, 0xA
@@ -422,7 +422,7 @@ _08071152:
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTileAtPosition
bl GetMapTile_1
adds r2, r0, 0
ldrh r1, [r2]
movs r0, 0x10
@@ -481,7 +481,7 @@ _080711DC:
ldrsh r0, [r4, r1]
movs r2, 0x6
ldrsh r1, [r4, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r2, r0, 0
adds r1, r2, 0
adds r1, 0xA
@@ -537,7 +537,7 @@ CanMoveForward:
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTileAtPosition
bl GetMapTile_1
adds r5, r0, 0
ldrh r1, [r5]
movs r0, 0x10
@@ -661,7 +661,7 @@ _08071348:
ldrsh r0, [r4, r1]
movs r2, 0x6
ldrsh r1, [r4, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r0, 0xA
adds r0, r6
ldr r2, _08071374
@@ -781,7 +781,7 @@ _08071432:
ldrsh r0, [r4, r1]
movs r2, 0x6
ldrsh r1, [r4, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r0, 0xA
adds r0, r5
ldrb r0, [r0]

View File

@@ -189,7 +189,7 @@ _08071C08:
ldrsh r0, [r4, r1]
movs r2, 0x6
ldrsh r1, [r4, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
ldrh r0, [r0]
movs r2, 0x80
lsls r2, 1
@@ -2247,7 +2247,7 @@ _08072C0C:
movs r3, 0x6
ldrsh r2, [r7, r3]
adds r1, r2
bl GetMapTileAtPosition
bl GetMapTile_1
adds r1, r0, 0
ldr r0, _08072C80
bl sub_807034C

View File

@@ -39,7 +39,7 @@ sub_8073D14:
sub sp, 0xB0
adds r6, r0, 0
ldr r4, [r6, 0x70]
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
ldr r5, [r0, 0x14]
cmp r5, 0
bne _08073D30
@@ -3242,7 +3242,7 @@ sub_8075708:
cmp r0, 0
beq _0807580C
adds r0, r4, 0
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
adds r5, r0, 0
adds r0, r4, 0
movs r1, 0xD

View File

@@ -860,7 +860,7 @@ _08076292:
_08076298: .4byte gUnknown_80FCE84
_0807629C:
adds r0, r5, 0
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
ldrh r1, [r0]
movs r0, 0x3
ands r0, r1
@@ -966,7 +966,7 @@ _08076362:
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTileAtPosition
bl GetMapTile_1
ldr r4, [r0, 0x10]
adds r0, r4, 0
bl EntityExists
@@ -1198,7 +1198,7 @@ _08076544:
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTileAtPosition
bl GetMapTile_1
ldr r4, [r0, 0x10]
adds r0, r4, 0
bl EntityExists
@@ -1421,7 +1421,7 @@ _08076714:
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTileAtPosition
bl GetMapTile_1
ldr r4, [r0, 0x10]
adds r0, r4, 0
bl EntityExists
@@ -1542,7 +1542,7 @@ _08076814:
_0807682C: .4byte gUnknown_80FCE00
_08076830:
adds r0, r5, 0
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
ldrh r1, [r0]
movs r0, 0x3
ands r0, r1
@@ -3545,7 +3545,7 @@ _08077874:
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTileAtPosition
bl GetMapTile_1
ldr r4, [r0, 0x10]
adds r0, r4, 0
bl EntityExists
@@ -9836,7 +9836,7 @@ sub_807AB38:
_0807AB54:
adds r0, r2, 0
str r2, [sp, 0x1A4]
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
ldrh r1, [r0]
movs r0, 0x40
ands r0, r1
@@ -9898,7 +9898,7 @@ _0807ABC6:
adds r0, r4, 0
adds r1, r6, 0
str r2, [sp, 0x1A4]
bl GetMapEntity
bl GetMapTile_2
adds r1, r0, 0
ldr r0, [r1, 0x10]
ldr r2, [sp, 0x1A4]
@@ -9988,7 +9988,7 @@ _0807AC72:
adds r0, r4, 0
adds r1, r6, 0
str r2, [sp, 0x1A4]
bl GetMapEntity
bl GetMapTile_2
adds r1, r0, 0
ldr r0, [r1, 0x10]
ldr r2, [sp, 0x1A4]
@@ -10300,7 +10300,7 @@ CanTakeItem:
cmp r0, 0
bne _0807AF50
adds r0, r4, 0
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
adds r6, r0, 0
ldr r4, [r6, 0x14]
cmp r4, 0
@@ -10658,7 +10658,7 @@ _0807B17C:
ldrsh r0, [r2, r3]
movs r3, 0x6
ldrsh r1, [r2, r3]
bl GetMapTileAtPosition
bl GetMapTile_1
ldrb r1, [r0, 0x9]
cmp r1, 0xFF
bne _0807B1C4
@@ -10712,7 +10712,7 @@ _0807B1FA:
_0807B200:
adds r0, r4, 0
adds r1, r5, 0
bl GetMapEntity
bl GetMapTile_2
ldr r0, [r0, 0x14]
cmp r0, 0
beq _0807B216
@@ -11372,7 +11372,7 @@ _0807B6FE:
ldrsh r0, [r7, r4]
movs r2, 0x6
ldrsh r1, [r7, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
ldrh r1, [r0]
movs r0, 0x8
ands r0, r1
@@ -11400,7 +11400,7 @@ _0807B71E:
lsls r0, r5, 16
asrs r0, 16
asrs r1, r5, 16
bl GetMapTileAtPosition
bl GetMapTile_1
ldrb r0, [r0, 0x9]
cmp r0, r10
beq _0807B758
@@ -11848,7 +11848,7 @@ _0807BAA2:
ldrsh r0, [r6, r1]
movs r2, 0x6
ldrsh r1, [r6, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
ldrh r1, [r0]
movs r0, 0x8
ands r0, r1
@@ -11878,7 +11878,7 @@ _0807BAC4:
adds r5, r2, r0
mov r0, r8
adds r1, r5, 0
bl GetMapTileAtPosition
bl GetMapTile_1
ldrb r0, [r0, 0x9]
cmp r0, 0xFF
bne _0807BB04

View File

@@ -584,7 +584,7 @@ _0807C8BE:
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTileAtPosition
bl GetMapTile_1
ldr r5, [r0, 0x10]
cmp r5, 0
beq _0807C948

View File

@@ -4,7 +4,7 @@
.syntax unified
.text
thumb_func_start sub_807CD9C
sub_807CD9C:
push {r4-r7,lr}
@@ -167,7 +167,7 @@ _0807CED8:
ldrsh r0, [r7, r1]
ldr r1, [sp, 0x18]
asrs r1, 16
bl GetMapTileAtPosition
bl GetMapTile_1
adds r5, r0, 0
ldr r0, [r5, 0x10]
cmp r0, 0
@@ -902,7 +902,7 @@ _0807D4DC: .4byte gUnknown_80FD320
thumb_func_start sub_807D4E0
sub_807D4E0:
push {r4,lr}
bl GetMapTileAtPosition
bl GetMapTile_1
ldr r4, [r0, 0x14]
cmp r4, 0
beq _0807D506
@@ -990,7 +990,7 @@ _0807D580:
ldrsh r0, [r5, r1]
movs r2, 0x6
ldrsh r1, [r5, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
ldrh r1, [r0]
movs r2, 0x3
adds r0, r2, 0
@@ -1190,7 +1190,7 @@ _0807D6DA:
lsls r0, r6, 16
asrs r0, 16
asrs r1, r6, 16
bl GetMapTileAtPosition
bl GetMapTile_1
adds r2, r0, 0
ldrh r1, [r2]
movs r3, 0x3
@@ -1631,7 +1631,7 @@ _0807DA8C:
bgt _0807DB00
adds r0, r5, 0
adds r1, r4, 0
bl GetMapTileAtPosition
bl GetMapTile_1
adds r1, r0, 0
ldr r0, [r1, 0x10]
cmp r0, 0
@@ -1752,7 +1752,7 @@ _0807DBB6:
_0807DBB8:
adds r0, r4, 0
adds r1, r5, 0
bl GetMapEntity
bl GetMapTile_2
adds r2, r0, 0
ldrh r1, [r2]
movs r0, 0x3
@@ -1892,7 +1892,7 @@ _0807DCD8:
movs r6, 0
adds r0, r5, 0
adds r1, r4, 0
bl GetMapEntity
bl GetMapTile_2
adds r2, r0, 0
ldrh r1, [r2]
ldr r3, _0807DD6C
@@ -2015,7 +2015,7 @@ _0807DDC8:
_0807DDCA:
adds r0, r5, 0
adds r1, r4, 0
bl GetMapEntity
bl GetMapTile_2
adds r2, r0, 0
ldrh r1, [r2]
movs r3, 0x80
@@ -2062,7 +2062,7 @@ _0807DE1A:
beq _0807DE30
adds r0, r5, 0
adds r1, r4, 0
bl GetMapEntity
bl GetMapTile_2
ldrh r2, [r0]
movs r1, 0x40
orrs r1, r2
@@ -2095,7 +2095,7 @@ _0807DE46:
ldrsh r0, [r4, r1]
movs r2, 0x6
ldrsh r1, [r4, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
ldrb r1, [r0, 0x9]
adds r0, r4, 0
adds r0, 0x25
@@ -2323,7 +2323,7 @@ _0807E014:
bgt _0807E112
cmp r1, 0x1F
bgt _0807E112
bl GetMapEntity
bl GetMapTile_2
mov r8, r0
ldr r0, [sp, 0x18]
movs r2, 0
@@ -3815,7 +3815,7 @@ _0807EC46:
ldrb r0, [r0]
str r0, [sp, 0x8]
adds r0, r7, 0
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
ldrh r0, [r0]
lsrs r0, 5
mov r10, r0
@@ -4062,7 +4062,7 @@ _0807EE22:
ldrsh r0, [r6, r2]
asrs r1, 16
str r3, [sp, 0x18]
bl GetMapTileAtPosition
bl GetMapTile_1
ldrb r0, [r0, 0x9]
ldr r3, [sp, 0x18]
cmp r0, 0xFF
@@ -4238,7 +4238,7 @@ sub_807EF84:
cmp r4, 0
beq _0807EFE2
bl GetLeaderEntity
bl GetMapEntityForDungeonEntity
bl GetMapTileForDungeonEntity_2
ldrh r1, [r0]
movs r0, 0x20
ands r0, r1
@@ -4363,7 +4363,7 @@ _0807F09A:
str r0, [sp, 0x4]
adds r0, r6, 0
adds r1, r5, 0
bl GetMapTileAtPosition
bl GetMapTile_1
adds r4, r0, 0
ldrh r1, [r4]
movs r0, 0x20
@@ -4555,7 +4555,7 @@ _0807F23C:
_0807F240:
adds r0, r6, 0
adds r1, r5, 0
bl GetMapTileAtPosition
bl GetMapTile_1
adds r4, r0, 0
ldrh r1, [r4]
movs r0, 0x20
@@ -4699,7 +4699,7 @@ _0807F360:
_0807F364:
adds r0, r6, 0
adds r1, r5, 0
bl GetMapTileAtPosition
bl GetMapTile_1
adds r4, r0, 0
ldr r0, [r4, 0x14]
cmp r0, 0
@@ -5300,7 +5300,7 @@ _0807F7FC:
adds r4, r2, 0
movs r3, 0x2
ldrsh r1, [r4, r3]
bl GetMapTileAtPosition
bl GetMapTile_1
ldr r6, [r0, 0x10]
adds r0, r6, 0
bl EntityExists
@@ -5538,7 +5538,7 @@ _0807FA1E:
_0807FA22:
adds r0, r5, 0
adds r1, r6, 0
bl GetMapEntity
bl GetMapTile_2
adds r4, r0, 0
ldrh r1, [r4, 0x4]
movs r0, 0x4
@@ -5651,7 +5651,7 @@ _0807FAF8:
movs r6, 0
adds r0, r5, 0
mov r1, r8
bl GetMapTileAtPosition
bl GetMapTile_1
adds r4, r0, 0
ldr r0, [r4, 0x14]
cmp r0, 0
@@ -5850,7 +5850,7 @@ CanLayTrap:
movs r3, 0x2
ldrsh r1, [r0, r3]
adds r0, r2, 0
bl GetMapEntity
bl GetMapTile_2
adds r2, r0, 0
ldrh r1, [r2]
movs r0, 0x80
@@ -5904,7 +5904,7 @@ sub_807FCD4:
ldrsh r0, [r7, r1]
movs r2, 0x2
ldrsh r1, [r7, r2]
bl GetMapEntity
bl GetMapTile_2
adds r6, r0, 0
cmp r5, 0x13
bls _0807FD12
@@ -6058,7 +6058,7 @@ sub_807FE04:
ldrsh r0, [r2, r1]
movs r3, 0x2
ldrsh r1, [r2, r3]
bl GetMapEntity
bl GetMapTile_2
adds r4, r0, 0
ldr r0, [r4, 0x14]
cmp r0, 0
@@ -6094,7 +6094,7 @@ sub_807FE44:
ldrsh r0, [r2, r1]
movs r3, 0x2
ldrsh r1, [r2, r3]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r4, r0, 0
ldr r0, [r4, 0x14]
cmp r0, 0
@@ -6152,7 +6152,7 @@ sub_807FE9C:
ldrsh r0, [r1, r2]
movs r3, 0x2
ldrsh r1, [r1, r3]
bl GetMapEntity
bl GetMapTile_2
str r0, [sp, 0x4]
ldr r0, [r0, 0x14]
mov r10, r0
@@ -7449,7 +7449,7 @@ _080808E2:
ldrsh r0, [r5, r2]
movs r3, 0x2
ldrsh r1, [r5, r3]
bl GetMapTileAtPosition
bl GetMapTile_1
ldrb r1, [r0, 0x9]
cmp r1, 0xFF
bne _0808090A
@@ -7502,7 +7502,7 @@ _0808093E:
_0808094A:
adds r0, r6, 0
adds r1, r7, 0
bl GetMapTileAtPosition
bl GetMapTile_1
adds r4, r0, 0
ldr r0, [r4, 0x14]
adds r2, r6, 0x1
@@ -10300,7 +10300,7 @@ _080820FC:
mov r3, sp
movs r2, 0x6
ldrsh r1, [r3, r2]
bl GetMapEntity
bl GetMapTile_2
adds r4, r0, 0
ldrb r0, [r7]
mov r3, r9
@@ -11074,7 +11074,7 @@ _08082856:
add r3, sp
movs r2, 0
ldrsh r1, [r3, r2]
bl GetMapEntity
bl GetMapTile_2
ldr r1, [r4]
str r1, [r7, 0x8]
ldr r1, [r4]
@@ -11487,7 +11487,7 @@ _08082B46:
ldrsh r0, [r5, r1]
movs r2, 0x6
ldrsh r1, [r5, r2]
bl GetMapEntity
bl GetMapTile_2
ldrb r1, [r0, 0x9]
adds r0, r5, 0
adds r0, 0x25

View File

@@ -4,7 +4,7 @@
.syntax unified
.text
thumb_func_start InSameRoom_3
InSameRoom_3:
push {r4-r6,lr}
@@ -14,7 +14,7 @@ InSameRoom_3:
ldrsh r0, [r4, r1]
movs r2, 0x2
ldrsh r1, [r4, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
ldrb r2, [r0, 0x9]
cmp r2, 0xFF
beq _08083394
@@ -107,7 +107,7 @@ sub_80833E8:
ldrsh r0, [r5, r1]
movs r2, 0x2
ldrsh r1, [r5, r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r1, r0, 0
ldr r0, _08083438
ldr r3, [r0]
@@ -253,7 +253,7 @@ _080834F8:
adds r0, r5, 0
adds r1, r4, 0
str r3, [sp]
bl GetMapTileAtPosition
bl GetMapTile_1
ldrh r1, [r0]
movs r0, 0x3
ands r0, r1
@@ -292,7 +292,7 @@ _0808353E:
adds r0, r5, 0
adds r1, r4, 0
str r3, [sp]
bl GetMapTileAtPosition
bl GetMapTile_1
ldrh r1, [r0]
movs r0, 0x3
ands r0, r1
@@ -618,7 +618,7 @@ _0808379C:
ldr r2, _0808380C
add r2, sp
str r3, [r2]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r2, r0, 0
ldr r0, _08083810
ldr r1, _0808380C
@@ -730,7 +730,7 @@ _0808386A:
adds r0, r5, 0
adds r1, r4, 0
str r3, [sp]
bl GetMapTileAtPosition
bl GetMapTile_1
adds r1, r0, 0
ldrh r2, [r1]
movs r7, 0x80

View File

@@ -218,7 +218,7 @@ _080853EE:
lsls r0, r4, 16
asrs r0, 16
asrs r1, r4, 16
bl GetMapTileAtPosition
bl GetMapTile_1
adds r1, r0, 0
mov r0, r8
bl sub_807034C

View File

@@ -157,7 +157,7 @@ _0808B6D2:
movs r2, 0
ldrsh r0, [r7, r2]
asrs r1, 16
bl GetMapEntity
bl GetMapTile_2
ldrh r1, [r0]
movs r0, 0x3
ands r0, r1
@@ -241,7 +241,7 @@ _0808B77E:
movs r2, 0
ldrsh r0, [r7, r2]
asrs r1, 16
bl GetMapEntity
bl GetMapTile_2
ldrh r1, [r0]
movs r0, 0x3
ands r0, r1
@@ -391,7 +391,7 @@ _0808B8F4:
movs r2, 0
ldrsh r0, [r7, r2]
asrs r1, 16
bl GetMapEntity
bl GetMapTile_2
ldrh r1, [r0]
movs r0, 0x3
ands r0, r1

View File

@@ -71,7 +71,7 @@ struct DungeonGlobalData
/* 0xE277 */ u8 mudSportTurnsLeft;
/* 0xE278 */ u8 waterSportTurnsLeft;
u8 fillE279[0xE8C0 - 0xE279];
/* 0xE8C0 */ struct MapTile* mapEntityPointers[DUNGEON_MAX_SIZE_Y][DUNGEON_MAX_SIZE_X];
/* 0xE8C0 */ struct MapTile* mapTilePointers[DUNGEON_MAX_SIZE_Y][DUNGEON_MAX_SIZE_X];
u8 fill104C0[0x104C4 - 0x104C0];
/* 0x104C4 */ struct MapRoom roomData[MAX_ROOM_COUNT];
u8 fill10764[0x10844 - 0x10764];

View File

@@ -3,7 +3,14 @@
#include "map.h"
struct unkStruct_202F190
{
struct MapTile* unk0[6];
};
// 0x4954C
struct MapTile* GetMapTileAtPosition(s32 x, s32 y);
struct MapTile* GetMapTile_1(s32 x, s32 y);
// 0x49590
struct MapTile* GetMapTile_2(s32 x, s32 y);
#endif

View File

@@ -15,6 +15,6 @@ u32 GetEntityType(struct DungeonEntity *entity);
struct DungeonEntityData *GetTrapData(struct DungeonEntity *entity);
// 0x45108
struct ItemSlot *GetItemData(struct DungeonEntity *entity);
struct MapTile *GetMapEntityForDungeonEntity(struct DungeonEntity *entity);
struct MapTile *GetMapTileForDungeonEntity_2(struct DungeonEntity *entity);
#endif

View File

@@ -200,7 +200,7 @@ SECTIONS {
asm/code_8048480.o(.text);
src/dungeon_ai_item_weight.o(.text);
src/dungeon_map_access.o(.text);
asm/code_8049590.o(.text);
asm/code_80495E4.o(.text);
src/code_80521D0.o(.text);
asm/code_80521D0.o(.text);
src/charge_move.o(.text);

View File

@@ -3,6 +3,7 @@
#include "code_80521D0.h"
#include "dungeon_entity.h"
#include "dungeon_global_data.h"
#include "dungeon_map_access.h"
#include "file_system.h"
#include "play_time.h"
@@ -26,8 +27,6 @@ extern void sub_8040A84();
extern const char *gUnknown_80FD040; // It became brighter on the floor
extern struct MapTile *GetMapEntity(u32, u32);
// Luminous Orb???
void HandleLuminousOrbAction(struct DungeonEntity *param_1)
{
@@ -41,7 +40,7 @@ void HandleLuminousOrbAction(struct DungeonEntity *param_1)
{
for(XCoord = 0; XCoord < DUNGEON_MAX_SIZE_X; XCoord++)
{
mapTile = GetMapEntity(XCoord, YCoord);
mapTile = GetMapTile_2(XCoord, YCoord);
mapTile->unk4 = mapTile->unk4 | 1;
}
}

View File

@@ -3,6 +3,7 @@
#include "constants/friend_area.h"
#include "dungeon_global_data.h"
#include "dungeon_entity.h"
#include "dungeon_map_access.h"
#include "dungeon_random.h"
#include "dungeon_util.h"
#include "friend_area.h"
@@ -138,7 +139,6 @@ extern void sub_8049ED4();
extern void sub_8040A84();
extern void sub_8086A54(struct DungeonEntity *);
extern struct MapTile *GetMapEntity(u32, u32);
extern void sub_806BFC0(struct DungeonEntityData *, u32);
void sub_808BBA8(struct DungeonEntity *param_1)
@@ -207,7 +207,7 @@ void sub_808BCE4(void)
{
struct MapTile *puVar1;
puVar1 = GetMapEntity(gDungeonGlobalData->unkE23C, gDungeonGlobalData->unkE23E);
puVar1 = GetMapTile_2(gDungeonGlobalData->unkE23C, gDungeonGlobalData->unkE23E);
puVar1->tileType &= ~(TILE_TYPE_FLOOR | TILE_TYPE_LIQUID);
puVar1->tileType |= TILE_TYPE_MAP_EDGE;
puVar1->tileType &= ~TILE_TYPE_STAIRS;
@@ -221,7 +221,7 @@ void sub_808BD38(void)
{
struct MapTile *puVar1;
puVar1 = GetMapEntity(gDungeonGlobalData->unkE23C, gDungeonGlobalData->unkE23E);
puVar1 = GetMapTile_2(gDungeonGlobalData->unkE23C, gDungeonGlobalData->unkE23E);
puVar1->tileType &= ~(TILE_TYPE_FLOOR | TILE_TYPE_LIQUID);
puVar1->tileType |= TILE_TYPE_FLOOR;
puVar1->tileType &= ~TILE_TYPE_MAP_EDGE;

View File

@@ -3318,7 +3318,7 @@ void sub_808B1CC(u8 r0)
"\tldrsh r0, [r0, r2]\n"
"\tmovs r3, 0x2\n"
"\tldrsh r1, [r5, r3]\n"
"\tbl GetMapEntity\n"
"\tbl GetMapTile_2\n"
"\tldrh r2, [r0]\n"
"\tmovs r3, 0x80\n"
"\tlsls r3, 2\n"

View File

@@ -377,7 +377,7 @@ s32 FindMoveTarget(struct MoveTargetResults *moveTargetResults, struct DungeonEn
{
// Double assignment to fix a regswap.
s16 rangeTargetingFlags = rangeTargetingFlags2 = targetingFlags & 0xF0;
struct MapTile *adjacentTile = GetMapTileAtPosition(pokemon->posWorld.x + gAdjacentTileOffsets[i].x,
struct MapTile *adjacentTile = GetMapTile_1(pokemon->posWorld.x + gAdjacentTileOffsets[i].x,
pokemon->posWorld.y + gAdjacentTileOffsets[i].y);
struct DungeonEntity *adjacentPokemon = adjacentTile->pokemon;
if (adjacentPokemon != NULL && GetEntityType(adjacentPokemon) == ENTITY_POKEMON)
@@ -411,7 +411,7 @@ s32 FindMoveTarget(struct MoveTargetResults *moveTargetResults, struct DungeonEn
{
for (i = 0; i < NUM_DIRECTIONS; i++)
{
struct MapTile *targetTile = GetMapTileAtPosition(pokemon->posWorld.x + gAdjacentTileOffsets[i].x,
struct MapTile *targetTile = GetMapTile_1(pokemon->posWorld.x + gAdjacentTileOffsets[i].x,
pokemon->posWorld.y + gAdjacentTileOffsets[i].y);
if (CanAttackInFront(pokemon, i))
{
@@ -425,7 +425,7 @@ s32 FindMoveTarget(struct MoveTargetResults *moveTargetResults, struct DungeonEn
continue;
}
}
targetTile = GetMapTileAtPosition(pokemon->posWorld.x + gAdjacentTileOffsets[i].x * 2,
targetTile = GetMapTile_1(pokemon->posWorld.x + gAdjacentTileOffsets[i].x * 2,
pokemon->posWorld.y + gAdjacentTileOffsets[i].y * 2);
targetPokemon = targetTile->pokemon;
if (targetPokemon != NULL && GetEntityType(targetPokemon) == ENTITY_POKEMON)

View File

@@ -57,7 +57,7 @@ bool8 IsTargetStraightAhead(struct DungeonEntity *pokemon, struct DungeonEntity
break;
}
while (0); // Extra label needed to swap branch locations in ASM.
mapTile = GetMapTileAtPosition(currentPosX, currentPosY);
mapTile = GetMapTile_1(currentPosX, currentPosY);
if (!(mapTile->tileType & (TILE_TYPE_FLOOR | TILE_TYPE_LIQUID)))
{
break;

View File

@@ -448,7 +448,7 @@ bool8 CanTargetAdjacentPokemon(struct DungeonEntity *pokemon)
s32 facingDir;
for (facingDir = 0; facingDir < NUM_DIRECTIONS; facingDir++)
{
struct MapTile *mapTile = GetMapTileAtPosition(pokemon->posWorld.x + gAdjacentTileOffsets[facingDir].x, pokemon->posWorld.y + gAdjacentTileOffsets[facingDir].y);
struct MapTile *mapTile = GetMapTile_1(pokemon->posWorld.x + gAdjacentTileOffsets[facingDir].x, pokemon->posWorld.y + gAdjacentTileOffsets[facingDir].y);
struct DungeonEntity *adjacentPokemon = mapTile->pokemon;
if (adjacentPokemon != NULL && GetEntityType(adjacentPokemon) != ENTITY_NONE &&
CanTarget(pokemon, adjacentPokemon, FALSE, TRUE) == TARGET_CAPABILITY_CAN_TARGET)

View File

@@ -158,7 +158,7 @@ void DecideUseItem(struct DungeonEntity *pokemon)
else if (toolboxIndex == 0)
{
// This seems unused. toolboxIndex can never be 0.
struct MapTile *mapTile = GetMapTileAtPosition(pokemon->posWorld.x, pokemon->posWorld.y);
struct MapTile *mapTile = GetMapTile_1(pokemon->posWorld.x, pokemon->posWorld.y);
struct DungeonEntity *mapObject = mapTile->mapObject;
if (mapObject != null)
{

View File

@@ -49,7 +49,7 @@ u32 sub_8075818(struct DungeonEntity *entity)
entityData = entity->entityData;
if(EntityExists(entity))
{
tile = GetMapEntityForDungeonEntity(entity);
tile = GetMapTileForDungeonEntity_2(entity);
if(HasIQSkill(entity, IQ_SKILL_SUPER_MOBILE))
if(!(tile->tileType & (TILE_TYPE_FLOOR | TILE_TYPE_LIQUID)))
return 1;
@@ -136,7 +136,7 @@ void sub_8075900(struct DungeonEntity *pokemon, u8 r1)
{
if(!gDungeonGlobalData->monsterHouseActive)
{
if((GetMapEntityForDungeonEntity(pokemon)->tileType & TILE_TYPE_MONSTER_HOUSE))
if((GetMapTileForDungeonEntity_2(pokemon)->tileType & TILE_TYPE_MONSTER_HOUSE))
{
// It's a monster house!
SendMessage(GetLeaderEntity(), gPtrItsaMonsterHouseMessage);

View File

@@ -89,7 +89,7 @@ bool8 CannotAttack(struct DungeonEntity *pokemon, bool8 skipSleep)
bool8 CanMoveInDirection(struct DungeonEntity *pokemon, u32 facingDir)
{
u8 crossableTerrain = GetCrossableTerrain(pokemon->entityData->entityID);
struct MapTile *currentMapTile = GetMapTileAtPosition(pokemon->posWorld.x + gAdjacentTileOffsets[facingDir].x,
struct MapTile *currentMapTile = GetMapTile_1(pokemon->posWorld.x + gAdjacentTileOffsets[facingDir].x,
pokemon->posWorld.y + gAdjacentTileOffsets[facingDir].y);
if (currentMapTile->tileType & TILE_TYPE_MAP_EDGE || currentMapTile->pokemon != NULL)
{
@@ -118,7 +118,7 @@ bool8 CanMoveInDirection(struct DungeonEntity *pokemon, u32 facingDir)
}
}
}
currentMapTile = GetMapTileAtPosition(pokemon->posWorld.x, pokemon->posWorld.y);
currentMapTile = GetMapTile_1(pokemon->posWorld.x, pokemon->posWorld.y);
if (!(currentMapTile->canMoveAdjacent[crossableTerrain] & gDirectionBitMasks[facingDir & DIRECTION_MASK]))
{
return FALSE;

View File

@@ -3,13 +3,25 @@
#include "dungeon_global_data.h"
extern struct MapTile *gUnknown_203B430;
extern struct unkStruct_202F190 gUnknown_202F190;
extern struct unkStruct_202F190 *gUnknown_203B430;
struct MapTile* GetMapTileAtPosition(s32 x, s32 y)
struct MapTile* GetMapTile_1(s32 x, s32 y)
{
if (x >= 0 && y >= 0 && x < DUNGEON_MAX_SIZE_X && y < DUNGEON_MAX_SIZE_Y)
{
return gDungeonGlobalData->mapEntityPointers[y][x];
return gDungeonGlobalData->mapTilePointers[y][x];
}
return gUnknown_203B430;
return (struct MapTile*) gUnknown_203B430->unk0;
}
struct MapTile* GetMapTile_2(s32 x, s32 y)
{
if (x < 0 || y < 0 || x >= DUNGEON_MAX_SIZE_X || y >= DUNGEON_MAX_SIZE_Y)
{
struct MapTile* tile = (struct MapTile*) gUnknown_202F190.unk0;
gUnknown_202F190 = *gUnknown_203B430;
return tile;
}
return gDungeonGlobalData->mapTilePointers[y][x];
}

View File

@@ -14,7 +14,7 @@ bool8 InSameRoom_2(struct Position *pos1, struct Position *pos2)
{
visibility = 2;
}
tile1 = GetMapTileAtPosition(pos1->x, pos1->y);
tile1 = GetMapTile_1(pos1->x, pos1->y);
pos1RoomIndex = tile1->roomIndex;
if (pos1RoomIndex == CORRIDOR_ROOM_INDEX)
{

View File

@@ -14,8 +14,6 @@ const struct Position gAdjacentTileOffsets[] = {
{-1, 1}
};
extern struct MapTile* GetMapEntity(s16, s16);
bool8 EntityExists(struct DungeonEntity *entity)
{
if (!entity)
@@ -55,12 +53,12 @@ struct DungeonEntityData* sub_8045110(struct DungeonEntity *entity)
return entity->entityData;
}
struct MapTile* GetMapTileForDungeonEntity(struct DungeonEntity *entity)
struct MapTile* GetMapTileForDungeonEntity_1(struct DungeonEntity *entity)
{
return GetMapTileAtPosition(entity->posWorld.x, entity->posWorld.y);
return GetMapTile_1(entity->posWorld.x, entity->posWorld.y);
}
struct MapTile* GetMapEntityForDungeonEntity(struct DungeonEntity *entity)
struct MapTile* GetMapTileForDungeonEntity_2(struct DungeonEntity *entity)
{
return GetMapEntity(entity->posWorld.x, entity->posWorld.y);
return GetMapTile_2(entity->posWorld.x, entity->posWorld.y);
}

View File

@@ -348,14 +348,14 @@ bool8 CanUseOnSelfWithStatusChecker(struct DungeonEntity *pokemon, struct Pokemo
}
break;
case MOVE_DIVE:
if (IsTileGround(GetMapEntityForDungeonEntity(pokemon)))
if (IsTileGround(GetMapTileForDungeonEntity_2(pokemon)))
{
return FALSE;
}
break;
case MOVE_DIG:
{
struct MapTile *tile = GetMapEntityForDungeonEntity(pokemon);
struct MapTile *tile = GetMapTileForDungeonEntity_2(pokemon);
if (!IsTileGround(tile) || (tile->tileType & (TILE_TYPE_FLOOR | TILE_TYPE_LIQUID)) != TILE_TYPE_FLOOR)
{
return FALSE;
@@ -364,7 +364,7 @@ bool8 CanUseOnSelfWithStatusChecker(struct DungeonEntity *pokemon, struct Pokemo
}
case MOVE_TRAP_BUSTER:
{
struct DungeonEntity *mapObject = GetMapEntityForDungeonEntity(pokemon)->mapObject;
struct DungeonEntity *mapObject = GetMapTileForDungeonEntity_2(pokemon)->mapObject;
if (mapObject == NULL || GetEntityType(mapObject) != ENTITY_TRAP)
{
return FALSE;