Skip to content

Commit

Permalink
continue decomp of map_object
Browse files Browse the repository at this point in the history
  • Loading branch information
red031000 committed Oct 9, 2024
1 parent 370acbc commit 81fa7ac
Show file tree
Hide file tree
Showing 9 changed files with 199 additions and 238 deletions.
215 changes: 17 additions & 198 deletions arm9/asm/map_object_s.s
Original file line number Diff line number Diff line change
Expand Up @@ -4,197 +4,16 @@
.extern UNK_020F6364
.extern sub_02057EE0
.extern sub_0205815C
.extern MapObjectManager_Get
.extern MapObjectManager_GetObjectCount
.extern MapObjectManager_SetFlagsBits
.extern MapObjectManager_ClearFlagsBits
.extern MapObjectManager_GetFlagsBitsMask
.extern MapObjectManager_GetObjects
.extern MapObjectManager_GetFieldSystem

.text

thumb_func_start sub_020582F8
sub_020582F8: ; 0x020582F8
push {r3-r7, lr}
add r4, r1, #0x0
mov r1, #0x1
add r5, r0, #0x0
add r6, r2, #0x0
add r7, r3, #0x0
bl MapObject_TestFlagsBits
cmp r0, #0x0
bne _02058310
mov r0, #0x0
pop {r3-r7, pc}
_02058310:
add r0, r5, #0x0
bl sub_0205845C
cmp r0, r4
beq _0205831E
mov r0, #0x0
pop {r3-r7, pc}
_0205831E:
add r0, r5, #0x0
add r1, r6, #0x0
add r2, r7, #0x0
bl sub_020582A8
pop {r3-r7, pc}
.balign 4

thumb_func_start sub_0205832C
sub_0205832C: ; 0x0205832C
push {r4, lr}
add r4, r1, #0x0
add r0, r4, #0x0
bl sub_02058EF8
add r0, r4, #0x0
bl MapObject_IsInUse
cmp r0, #0x0
beq _02058346
add r0, r4, #0x0
bl sub_02058348
_02058346:
pop {r4, pc}

thumb_func_start sub_02058348
sub_02058348: ; 0x02058348
push {r4, lr}
add r4, r0, #0x0
bl MapObject_GetManager
bl sub_020587E0
cmp r0, #0x1
bne _0205835E
add r0, r4, #0x0
bl ov05_021F1D8C
_0205835E:
pop {r4, pc}

thumb_func_start MapObjectManager_Get
MapObjectManager_Get: ; 0x02058360
bx lr
.balign 4

thumb_func_start MapObjectManager_SetObjectCount
MapObjectManager_SetObjectCount: ; 0x02058364
str r1, [r0, #0x4]
bx lr

thumb_func_start MapObjectManager_GetObjectCount
MapObjectManager_GetObjectCount: ; 0x02058368
ldr r0, [r0, #0x4]
bx lr

thumb_func_start sub_0205836C
sub_0205836C: ; 0x0205836C
ldr r1, [r0, #0x8]
add r1, r1, #0x1
str r1, [r0, #0x8]
bx lr

thumb_func_start sub_02058374
sub_02058374: ; 0x02058374
ldr r1, [r0, #0x8]
sub r1, r1, #0x1
str r1, [r0, #0x8]
bx lr

thumb_func_start sub_0205837C
sub_0205837C: ; 0x0205837C
ldr r2, [r0, #0x0]
orr r1, r2
str r1, [r0, #0x0]
bx lr

thumb_func_start sub_02058384
sub_02058384: ; 0x02058384
ldr r2, [r0, #0x0]
mvn r1, r1
and r1, r2
str r1, [r0, #0x0]
bx lr
.balign 4

thumb_func_start sub_02058390
sub_02058390: ; 0x02058390
ldr r0, [r0, #0x0]
and r0, r1
bx lr
.balign 4

thumb_func_start MapObjectManager_SetPriority
MapObjectManager_SetPriority: ; 0x02058398
str r1, [r0, #0xc]
bx lr

thumb_func_start MapObjectManager_GetPriority
MapObjectManager_GetPriority: ; 0x0205839C
ldr r0, [r0, #0xc]
bx lr

thumb_func_start sub_020583A0
sub_020583A0: ; 0x020583A0
add r0, #0x18
bx lr

thumb_func_start sub_020583A4
sub_020583A4: ; 0x020583A4
mov r2, #0x12
lsl r2, r2, #0x4
str r1, [r0, r2]
bx lr

thumb_func_start sub_020583AC
sub_020583AC: ; 0x020583AC
mov r1, #0x12
lsl r1, r1, #0x4
ldr r0, [r0, r1]
bx lr

thumb_func_start MapObjectManager_SetObjects
MapObjectManager_SetObjects: ; 0x020583B4
mov r2, #0x49
lsl r2, r2, #0x2
str r1, [r0, r2]
bx lr

thumb_func_start sub_020583BC
sub_020583BC: ; 0x020583BC
mov r1, #0x49
lsl r1, r1, #0x2
ldr r0, [r0, r1]
bx lr

thumb_func_start MapObjectManager_GetConstObjects
MapObjectManager_GetConstObjects: ; 0x020583C4
mov r1, #0x49
lsl r1, r1, #0x2
ldr r0, [r0, r1]
bx lr

thumb_func_start MapObjectManager_GetObjects
MapObjectManager_GetObjects: ; 0x020583CC
mov r1, #0x49
lsl r1, r1, #0x2
ldr r0, [r0, r1]
bx lr

thumb_func_start sub_020583D4
sub_020583D4: ; 0x020583D4
mov r1, #0x4a
ldr r2, [r0, #0x0]
lsl r1, r1, #0x2
add r1, r2, r1
str r1, [r0, #0x0]
bx lr

thumb_func_start MapObjectManager_SetFieldSystemPtr
MapObjectManager_SetFieldSystemPtr: ; 0x020583E0
mov r2, #0x4a
lsl r2, r2, #0x2
str r1, [r0, r2]
bx lr

thumb_func_start MapObjectManager_GetFieldSystemPtr
MapObjectManager_GetFieldSystemPtr: ; 0x020583E8
mov r1, #0x4a
lsl r1, r1, #0x2
ldr r0, [r0, r1]
bx lr

thumb_func_start sub_020583F0
sub_020583F0: ; 0x020583F0
str r1, [r0, #0x14]
Expand Down Expand Up @@ -856,7 +675,7 @@ sub_02058730: ; 0x02058730
MapObject_GetFieldSystem: ; 0x02058738
push {r3, lr}
bl sub_02058580
bl MapObjectManager_GetFieldSystemPtr
bl MapObjectManager_GetFieldSystem
pop {r3, pc}

thumb_func_start sub_02058744
Expand All @@ -881,19 +700,19 @@ _02058760:

thumb_func_start sub_02058768
sub_02058768: ; 0x02058768
ldr r3, _02058770 ; =sub_0205837C
ldr r3, _02058770 ; =MapObjectManager_SetFlagsBits
mov r1, #0x6
bx r3
nop
_02058770: .word sub_0205837C
_02058770: .word MapObjectManager_SetFlagsBits

thumb_func_start sub_02058774
sub_02058774: ; 0x02058774
ldr r3, _0205877C ; =sub_02058384
ldr r3, _0205877C ; =MapObjectManager_ClearFlagsBits
mov r1, #0x6
bx r3
nop
_0205877C: .word sub_02058384
_0205877C: .word MapObjectManager_ClearFlagsBits

thumb_func_start MapObjectManager_PauseAllMovement
MapObjectManager_PauseAllMovement: ; 0x02058780
Expand Down Expand Up @@ -949,7 +768,7 @@ _020587D6:
sub_020587E0: ; 0x020587E0
push {r3, lr}
mov r1, #0x1
bl sub_02058390
bl MapObjectManager_GetFlagsBitsMask
cmp r0, #0x0
beq _020587F0
mov r0, #0x1
Expand All @@ -964,7 +783,7 @@ sub_020587F4: ; 0x020587F4
add r4, r1, #0x0
bl MapObject_GetManager
add r1, r4, #0x0
bl sub_02058390
bl MapObjectManager_GetFlagsBitsMask
pop {r4, pc}

thumb_func_start sub_02058804
Expand All @@ -973,19 +792,19 @@ sub_02058804: ; 0x02058804
cmp r1, #0x0
bne _02058812
mov r1, #0x8
bl sub_0205837C
bl MapObjectManager_SetFlagsBits
pop {r3, pc}
_02058812:
mov r1, #0x8
bl sub_02058384
bl MapObjectManager_ClearFlagsBits
pop {r3, pc}
.balign 4

thumb_func_start sub_0205881C
sub_0205881C: ; 0x0205881C
push {r3, lr}
mov r1, #0x8
bl sub_02058390
bl MapObjectManager_GetFlagsBitsMask
cmp r0, #0x0
bne _0205882C
mov r0, #0x1
Expand Down
4 changes: 2 additions & 2 deletions arm9/asm/unk_02058EE8.s
Original file line number Diff line number Diff line change
Expand Up @@ -2480,7 +2480,7 @@ sub_0205995C: ; 0x0205995C
add r6, r3, #0x0
bl MapObject_GetManager
add r7, r0, #0x0
bl sub_020583BC
bl MapObjectManager_GetObjects2
str r0, [sp, #0x8]
add r0, r7, #0x0
bl MapObjectManager_GetObjectCount
Expand Down Expand Up @@ -2543,7 +2543,7 @@ _020599EA:
pop {r4-r7, pc}
_020599F4:
add r0, sp, #0x8
bl sub_020583D4
bl MapObjectArray_NextObject
ldr r0, [sp, #0x4]
sub r0, r0, #0x1
str r0, [sp, #0x4]
Expand Down
10 changes: 5 additions & 5 deletions arm9/global.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4006,15 +4006,15 @@
.extern sub_020582A8
.extern sub_020582F8
.extern MapObjectManager_GetObjectCount
.extern sub_0205837C
.extern sub_02058384
.extern sub_02058390
.extern MapObjectManager_SetFlagsBits
.extern MapObjectManager_ClearFlagsBits
.extern MapObjectManager_GetFlagsBitsMask
.extern MapObjectManager_GetPriority
.extern sub_020583A0
.extern sub_020583A4
.extern sub_020583AC
.extern sub_020583BC
.extern sub_020583D4
.extern MapObjectManager_GetObjects2
.extern MapObjectArray_NextObject
.extern sub_020583F0
.extern sub_020583F4
.extern MapObject_SetFlagsBits
Expand Down
8 changes: 4 additions & 4 deletions arm9/overlays/05/asm/ov05_021F1CB8.s
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ov05_021F1CB8: ; 0x021F1CB8
add r5, r0, #0
add r6, r2, #0
add r7, r3, #0
bl sub_02058390
bl MapObjectManager_GetFlagsBitsMask
cmp r0, #0
beq _021F1CD2
bl GF_AssertFail
Expand Down Expand Up @@ -48,7 +48,7 @@ _021F1CD2:
bl ov05_021F3810
add r0, r5, #0
mov r1, #1
bl sub_0205837C
bl MapObjectManager_SetFlagsBits
add sp, #0x14
pop {r4, r5, r6, r7, pc}
.balign 4, 0
Expand All @@ -74,7 +74,7 @@ _021F1D3C:
bl sub_020583A4
add r0, r4, #0
mov r1, #1
bl sub_02058384
bl MapObjectManager_ClearFlagsBits
add r0, r4, #0
bl ov05_021F1D80
pop {r4, pc}
Expand Down Expand Up @@ -105,7 +105,7 @@ ov05_021F1D8C: ; 0x021F1D8C
add r4, r0, #0
bl MapObject_GetManager
mov r1, #4
bl sub_02058390
bl MapObjectManager_GetFlagsBitsMask
cmp r0, #0
bne _021F1DC6
mov r1, #1
Expand Down
4 changes: 2 additions & 2 deletions arm9/overlays/05/asm/ov05_021F1F04.s
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ ov05_021F2284: ; 0x021F2284
bl MapObjectManager_GetObjectCount
add r4, r0, #0
add r0, r5, #0
bl sub_020583BC
bl MapObjectManager_GetObjects2
str r0, [sp]
_021F229A:
ldr r0, [sp]
Expand Down Expand Up @@ -502,7 +502,7 @@ _021F22C0:
pop {r3, r4, r5, r6, r7, pc}
_021F22CE:
add r0, sp, #0
bl sub_020583D4
bl MapObjectArray_NextObject
sub r4, r4, #1
bne _021F229A
mov r0, #0
Expand Down
Loading

0 comments on commit 81fa7ac

Please sign in to comment.