diff --git a/arm9/arm9.lsf b/arm9/arm9.lsf index c24b46a34..ec9bddc58 100644 --- a/arm9/arm9.lsf +++ b/arm9/arm9.lsf @@ -216,7 +216,6 @@ Static arm9 Object unk_02055068.o Object unk_020557F4.o Object map_object.o - Object map_object_s.o Object unk_02058EE8.o Object unk_02059F04.o Object unk_0205AD98.o diff --git a/arm9/asm/map_object_s.s b/arm9/asm/map_object_s.s deleted file mode 100644 index 7bd294462..000000000 --- a/arm9/asm/map_object_s.s +++ /dev/null @@ -1,2161 +0,0 @@ - .include "asm/macros.inc" - .include "global.inc" - - .extern UNK_020F6364 - .extern sub_02057EE0 - .extern sub_0205815C - - .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] - bx lr - - thumb_func_start sub_020583F4 -sub_020583F4: ; 0x020583F4 - push {r4, lr} - add r4, r0, #0x0 - ldr r0, [r4, #0x14] - cmp r0, #0x0 - bne _02058402 - bl GF_AssertFail -_02058402: - ldr r0, [r4, #0x14] - pop {r4, pc} - .balign 4 - - thumb_func_start MapObject_SetFlagsWord -MapObject_SetFlagsWord: ; 0x02058408 - str r1, [r0, #0x0] - bx lr - - thumb_func_start MapObject_GetFlagsWord -MapObject_GetFlagsWord: ; 0x0205840C - ldr r0, [r0, #0x0] - bx lr - - thumb_func_start MapObject_SetFlagsBits -MapObject_SetFlagsBits: ; 0x02058410 - ldr r2, [r0, #0x0] - orr r1, r2 - str r1, [r0, #0x0] - bx lr - - thumb_func_start MapObject_ClearFlagsBits -MapObject_ClearFlagsBits: ; 0x02058418 - ldr r2, [r0, #0x0] - mvn r1, r1 - and r1, r2 - str r1, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start MapObject_GetFlagsBits -MapObject_GetFlagsBits: ; 0x02058424 - ldr r0, [r0, #0x0] - and r0, r1 - bx lr - .balign 4 - - thumb_func_start MapObject_TestFlagsBits -MapObject_TestFlagsBits: ; 0x0205842C - ldr r0, [r0, #0x0] - tst r0, r1 - beq _02058436 - mov r0, #0x1 - bx lr -_02058436: - mov r0, #0x0 - bx lr - .balign 4 - - thumb_func_start MapObject_SetFlags2Word -MapObject_SetFlags2Word: ; 0x0205843C - str r1, [r0, #0x4] - bx lr - - thumb_func_start MapObject_GetFlags2Word -MapObject_GetFlags2Word: ; 0x02058440 - ldr r0, [r0, #0x4] - bx lr - - thumb_func_start MapObject_SetID -MapObject_SetID: ; 0x02058444 - str r1, [r0, #0x8] - bx lr - - thumb_func_start MapObject_GetID -MapObject_GetID: ; 0x02058448 - ldr r0, [r0, #0x8] - bx lr - - thumb_func_start sub_0205844C -sub_0205844C: ; 0x0205844C - str r1, [r0, #0xc] - bx lr - - thumb_func_start sub_02058450 -sub_02058450: ; 0x02058450 - ldr r0, [r0, #0xc] - bx lr - - thumb_func_start MapObject_SetSpriteID -MapObject_SetSpriteID: ; 0x02058454 - str r1, [r0, #0x10] - bx lr - - thumb_func_start MapObject_GetSpriteID -MapObject_GetSpriteID: ; 0x02058458 - ldr r0, [r0, #0x10] - bx lr - - thumb_func_start sub_0205845C -sub_0205845C: ; 0x0205845C - push {r3-r5, lr} - add r5, r0, #0x0 - bl MapObject_GetSpriteID - add r4, r0, #0x0 - bl sub_0205C334 - cmp r0, #0x1 - bne _02058476 - add r0, r5, #0x0 - bl sub_0205C340 - add r4, r0, #0x0 -_02058476: - add r0, r4, #0x0 - pop {r3-r5, pc} - .balign 4 - - thumb_func_start MapObject_SetMovement -MapObject_SetMovement: ; 0x0205847C - str r1, [r0, #0x14] - bx lr - - thumb_func_start MapObject_GetMovement -MapObject_GetMovement: ; 0x02058480 - ldr r0, [r0, #0x14] - bx lr - - thumb_func_start MapObject_SetType -MapObject_SetType: ; 0x02058484 - str r1, [r0, #0x18] - bx lr - - thumb_func_start MapObject_GetType -MapObject_GetType: ; 0x02058488 - ldr r0, [r0, #0x18] - bx lr - - thumb_func_start MapObject_SetFlagID -MapObject_SetFlagID: ; 0x0205848C - str r1, [r0, #0x1c] - bx lr - - thumb_func_start MapObject_GetFlagID -MapObject_GetFlagID: ; 0x02058490 - ldr r0, [r0, #0x1c] - bx lr - - thumb_func_start MapObject_SetScriptID -MapObject_SetScriptID: ; 0x02058494 - str r1, [r0, #0x20] - bx lr - - thumb_func_start MapObject_GetScriptID -MapObject_GetScriptID: ; 0x02058498 - ldr r0, [r0, #0x20] - bx lr - - thumb_func_start MapObject_SetInitialFacingDirection -MapObject_SetInitialFacingDirection: ; 0x0205849C - str r1, [r0, #0x24] - bx lr - - thumb_func_start MapObject_GetInitialFacingDirection -MapObject_GetInitialFacingDirection: ; 0x020584A0 - ldr r0, [r0, #0x24] - bx lr - - thumb_func_start MapObject_SetFacingDirectionDirect -MapObject_SetFacingDirectionDirect: ; 0x020584A4 - ldr r2, [r0, #0x28] - str r2, [r0, #0x30] - str r1, [r0, #0x28] - bx lr - - thumb_func_start sub_020584AC -sub_020584AC: ; 0x020584AC - push {r3-r5, lr} - add r4, r1, #0x0 - mov r1, #0x80 - add r5, r0, #0x0 - bl MapObject_GetFlagsBits - cmp r0, #0x0 - bne _020584C2 - ldr r0, [r5, #0x28] - str r0, [r5, #0x30] - str r4, [r5, #0x28] -_020584C2: - pop {r3-r5, pc} - - thumb_func_start MapObject_GetFacingDirection -MapObject_GetFacingDirection: ; 0x020584C4 - ldr r0, [r0, #0x28] - bx lr - - thumb_func_start sub_020584C8 -sub_020584C8: ; 0x020584C8 - ldr r0, [r0, #0x30] - bx lr - - thumb_func_start MapObject_SetNextFacingDirection -MapObject_SetNextFacingDirection: ; 0x020584CC - ldr r2, [r0, #0x2c] - str r2, [r0, #0x34] - str r1, [r0, #0x2c] - bx lr - - thumb_func_start MapObject_GetNextFacingDirection -MapObject_GetNextFacingDirection: ; 0x020584D4 - ldr r0, [r0, #0x2c] - bx lr - - thumb_func_start sub_020584D8 -sub_020584D8: ; 0x020584D8 - push {r3-r5, lr} - add r5, r0, #0x0 - add r4, r1, #0x0 - bl sub_020584AC - add r0, r5, #0x0 - add r1, r4, #0x0 - bl MapObject_SetNextFacingDirection - pop {r3-r5, pc} - - thumb_func_start MapObject_SetParam -MapObject_SetParam: ; 0x020584EC - push {r3, lr} - cmp r2, #0x0 - beq _020584FC - cmp r2, #0x1 - beq _02058500 - cmp r2, #0x2 - beq _02058504 - b _02058508 -_020584FC: - str r1, [r0, #0x38] - pop {r3, pc} -_02058500: - str r1, [r0, #0x3c] - pop {r3, pc} -_02058504: - str r1, [r0, #0x40] - pop {r3, pc} -_02058508: - bl GF_AssertFail - pop {r3, pc} - .balign 4 - - thumb_func_start MapObject_GetParam -MapObject_GetParam: ; 0x02058510 - push {r3, lr} - cmp r1, #0x0 - beq _02058520 - cmp r1, #0x1 - beq _02058524 - cmp r1, #0x2 - beq _02058528 - b _0205852C -_02058520: - ldr r0, [r0, #0x38] - pop {r3, pc} -_02058524: - ldr r0, [r0, #0x3c] - pop {r3, pc} -_02058528: - ldr r0, [r0, #0x40] - pop {r3, pc} -_0205852C: - bl GF_AssertFail - mov r0, #0x0 - pop {r3, pc} - - thumb_func_start MapObject_SetXRange -MapObject_SetXRange: ; 0x02058534 - str r1, [r0, #0x44] - bx lr - - thumb_func_start MapObject_GetXRange -MapObject_GetXRange: ; 0x02058538 - ldr r0, [r0, #0x44] - bx lr - - thumb_func_start MapObject_SetYRange -MapObject_SetYRange: ; 0x0205853C - str r1, [r0, #0x48] - bx lr - - thumb_func_start MapObject_GetYRange -MapObject_GetYRange: ; 0x02058540 - ldr r0, [r0, #0x48] - bx lr - - thumb_func_start sub_02058544 -sub_02058544: ; 0x02058544 - add r0, #0xa0 - str r1, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_0205854C -sub_0205854C: ; 0x0205854C - add r0, #0xa0 - ldr r0, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_02058554 -sub_02058554: ; 0x02058554 - add r0, #0xb0 - str r1, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_0205855C -sub_0205855C: ; 0x0205855C - add r0, #0xb0 - ldr r0, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_02058564 -sub_02058564: ; 0x02058564 - push {r3, lr} - bl sub_0205855C - bl sub_0200CAB4 - pop {r3, pc} - - thumb_func_start MapObject_SetManager -MapObject_SetManager: ; 0x02058570 - add r0, #0xb4 - str r1, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start MapObject_GetManager -MapObject_GetManager: ; 0x02058578 - add r0, #0xb4 - ldr r0, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_02058580 -sub_02058580: ; 0x02058580 - ldr r3, _02058588 ; =MapObjectManager_Get - add r0, #0xb4 - ldr r0, [r0, #0x0] - bx r3 - .balign 4 -_02058588: .word MapObjectManager_Get - - thumb_func_start sub_0205858C -sub_0205858C: ; 0x0205858C - push {r3-r5, lr} - add r5, r1, #0x0 - add r4, r0, #0x0 - cmp r5, #0x10 - ble _0205859A - bl GF_AssertFail -_0205859A: - add r0, r4, #0x0 - bl sub_020585B0 - mov r1, #0x0 - add r2, r5, #0x0 - add r4, r0, #0x0 - bl memset - add r0, r4, #0x0 - pop {r3-r5, pc} - .balign 4 - - thumb_func_start sub_020585B0 -sub_020585B0: ; 0x020585B0 - add r0, #0xd8 - bx lr - - thumb_func_start sub_020585B4 -sub_020585B4: ; 0x020585B4 - push {r3-r5, lr} - add r5, r1, #0x0 - add r4, r0, #0x0 - cmp r5, #0x10 - ble _020585C2 - bl GF_AssertFail -_020585C2: - add r0, r4, #0x0 - bl sub_020585D8 - mov r1, #0x0 - add r2, r5, #0x0 - add r4, r0, #0x0 - bl memset - add r0, r4, #0x0 - pop {r3-r5, pc} - .balign 4 - - thumb_func_start sub_020585D8 -sub_020585D8: ; 0x020585D8 - add r0, #0xe8 - bx lr - - thumb_func_start sub_020585DC -sub_020585DC: ; 0x020585DC - push {r3-r5, lr} - add r5, r1, #0x0 - add r4, r0, #0x0 - cmp r5, #0x10 - ble _020585EA - bl GF_AssertFail -_020585EA: - add r0, r4, #0x0 - bl sub_02058600 - mov r1, #0x0 - add r2, r5, #0x0 - add r4, r0, #0x0 - bl memset - add r0, r4, #0x0 - pop {r3-r5, pc} - .balign 4 - - thumb_func_start sub_02058600 -sub_02058600: ; 0x02058600 - add r0, #0xf8 - bx lr - - thumb_func_start sub_02058604 -sub_02058604: ; 0x02058604 - push {r3-r5, lr} - add r5, r1, #0x0 - add r4, r0, #0x0 - cmp r5, #0x20 - ble _02058612 - bl GF_AssertFail -_02058612: - add r0, r4, #0x0 - bl sub_02058628 - mov r1, #0x0 - add r2, r5, #0x0 - add r4, r0, #0x0 - bl memset - add r0, r4, #0x0 - pop {r3-r5, pc} - .balign 4 - - thumb_func_start sub_02058628 -sub_02058628: ; 0x02058628 - mov r1, #0x42 - lsl r1, r1, #0x2 - add r0, r0, r1 - bx lr - - thumb_func_start sub_02058630 -sub_02058630: ; 0x02058630 - add r0, #0xb8 - str r1, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_02058638 -sub_02058638: ; 0x02058638 - push {r3, lr} - add r1, r0, #0x0 - add r1, #0xb8 - ldr r1, [r1, #0x0] - blx r1 - pop {r3, pc} - - thumb_func_start sub_02058644 -sub_02058644: ; 0x02058644 - add r0, #0xbc - str r1, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_0205864C -sub_0205864C: ; 0x0205864C - push {r3, lr} - add r1, r0, #0x0 - add r1, #0xbc - ldr r1, [r1, #0x0] - blx r1 - pop {r3, pc} - - thumb_func_start sub_02058658 -sub_02058658: ; 0x02058658 - add r0, #0xc0 - str r1, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_02058660 -sub_02058660: ; 0x02058660 - push {r3, lr} - add r1, r0, #0x0 - add r1, #0xc0 - ldr r1, [r1, #0x0] - blx r1 - pop {r3, pc} - - thumb_func_start sub_0205866C -sub_0205866C: ; 0x0205866C - push {r4, lr} - add r4, r0, #0x0 - bl MapObject_GetMovement - bl sub_02058D14 - add r1, r0, #0x0 - ldr r1, [r1, #0x10] - add r0, r4, #0x0 - blx r1 - pop {r4, pc} - .balign 4 - - thumb_func_start sub_02058684 -sub_02058684: ; 0x02058684 - add r0, #0xc4 - str r1, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_0205868C -sub_0205868C: ; 0x0205868C - push {r3, lr} - add r1, r0, #0x0 - add r1, #0xc4 - ldr r1, [r1, #0x0] - blx r1 - pop {r3, pc} - - thumb_func_start sub_02058698 -sub_02058698: ; 0x02058698 - add r0, #0xc8 - str r1, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_020586A0 -sub_020586A0: ; 0x020586A0 - push {r3, lr} - add r1, r0, #0x0 - add r1, #0xc8 - ldr r1, [r1, #0x0] - blx r1 - pop {r3, pc} - - thumb_func_start sub_020586AC -sub_020586AC: ; 0x020586AC - add r0, #0xcc - str r1, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_020586B4 -sub_020586B4: ; 0x020586B4 - push {r3, lr} - add r1, r0, #0x0 - add r1, #0xcc - ldr r1, [r1, #0x0] - blx r1 - pop {r3, pc} - - thumb_func_start sub_020586C0 -sub_020586C0: ; 0x020586C0 - add r0, #0xd0 - str r1, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_020586C8 -sub_020586C8: ; 0x020586C8 - push {r3, lr} - add r1, r0, #0x0 - add r1, #0xd0 - ldr r1, [r1, #0x0] - blx r1 - pop {r3, pc} - - thumb_func_start sub_020586D4 -sub_020586D4: ; 0x020586D4 - add r0, #0xd4 - str r1, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_020586DC -sub_020586DC: ; 0x020586DC - push {r3, lr} - add r1, r0, #0x0 - add r1, #0xd4 - ldr r1, [r1, #0x0] - blx r1 - pop {r3, pc} - - thumb_func_start sub_020586E8 -sub_020586E8: ; 0x020586E8 - add r0, #0xa4 - str r1, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_020586F0 -sub_020586F0: ; 0x020586F0 - add r0, #0xa4 - ldr r0, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_020586F8 -sub_020586F8: ; 0x020586F8 - add r0, #0xa8 - str r1, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_02058700 -sub_02058700: ; 0x02058700 - add r1, r0, #0x0 - add r1, #0xa8 - ldr r1, [r1, #0x0] - add r0, #0xa8 - add r1, r1, #0x1 - str r1, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_02058710 -sub_02058710: ; 0x02058710 - add r0, #0xa8 - ldr r0, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_02058718 -sub_02058718: ; 0x02058718 - add r0, #0xac - strh r1, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_02058720 -sub_02058720: ; 0x02058720 - add r0, #0xac - ldrh r0, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_02058728 -sub_02058728: ; 0x02058728 - add r0, #0xae - strh r1, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start sub_02058730 -sub_02058730: ; 0x02058730 - add r0, #0xae - ldrh r0, [r0, #0x0] - bx lr - .balign 4 - - thumb_func_start MapObject_GetFieldSystem -MapObject_GetFieldSystem: ; 0x02058738 - push {r3, lr} - bl sub_02058580 - bl MapObjectManager_GetFieldSystemPtr - pop {r3, pc} - - thumb_func_start sub_02058744 -sub_02058744: ; 0x02058744 - push {r3, lr} - bl MapObject_GetManager - bl MapObjectManager_GetPriority - pop {r3, pc} - - thumb_func_start sub_02058750 -sub_02058750: ; 0x02058750 - push {r4, lr} - add r4, r0, #0x0 - bl MapObject_CheckFlag25 - cmp r0, #0x1 - beq _02058760 - bl GF_AssertFail -_02058760: - add r0, r4, #0x0 - bl MapObject_GetFlagID - pop {r4, pc} - - thumb_func_start sub_02058768 -sub_02058768: ; 0x02058768 - ldr r3, _02058770 ; =sub_0205837C - mov r1, #0x6 - bx r3 - nop -_02058770: .word sub_0205837C - - thumb_func_start sub_02058774 -sub_02058774: ; 0x02058774 - ldr r3, _0205877C ; =sub_02058384 - mov r1, #0x6 - bx r3 - nop -_0205877C: .word sub_02058384 - - thumb_func_start MapObjectManager_PauseAllMovement -MapObjectManager_PauseAllMovement: ; 0x02058780 - push {r4-r6, lr} - add r5, r0, #0x0 - bl MapObjectManager_GetObjectCount - add r4, r0, #0x0 - add r0, r5, #0x0 - bl MapObjectManager_GetObjects - mov r6, #0x4a - add r5, r0, #0x0 - lsl r6, r6, #0x2 -_02058796: - add r0, r5, #0x0 - bl MapObject_IsInUse - cmp r0, #0x0 - beq _020587A6 - add r0, r5, #0x0 - bl sub_02058908 -_020587A6: - add r5, r5, r6 - sub r4, r4, #0x1 - bne _02058796 - pop {r4-r6, pc} - .balign 4 - - thumb_func_start MapObjectManager_UnpauseAllMovement -MapObjectManager_UnpauseAllMovement: ; 0x020587B0 - push {r4-r6, lr} - add r5, r0, #0x0 - bl MapObjectManager_GetObjectCount - add r4, r0, #0x0 - add r0, r5, #0x0 - bl MapObjectManager_GetObjects - mov r6, #0x4a - add r5, r0, #0x0 - lsl r6, r6, #0x2 -_020587C6: - add r0, r5, #0x0 - bl MapObject_IsInUse - cmp r0, #0x0 - beq _020587D6 - add r0, r5, #0x0 - bl sub_02058914 -_020587D6: - add r5, r5, r6 - sub r4, r4, #0x1 - bne _020587C6 - pop {r4-r6, pc} - .balign 4 - - thumb_func_start sub_020587E0 -sub_020587E0: ; 0x020587E0 - push {r3, lr} - mov r1, #0x1 - bl sub_02058390 - cmp r0, #0x0 - beq _020587F0 - mov r0, #0x1 - pop {r3, pc} -_020587F0: - mov r0, #0x0 - pop {r3, pc} - - thumb_func_start sub_020587F4 -sub_020587F4: ; 0x020587F4 - push {r4, lr} - add r4, r1, #0x0 - bl MapObject_GetManager - add r1, r4, #0x0 - bl sub_02058390 - pop {r4, pc} - - thumb_func_start sub_02058804 -sub_02058804: ; 0x02058804 - push {r3, lr} - cmp r1, #0x0 - bne _02058812 - mov r1, #0x8 - bl sub_0205837C - pop {r3, pc} -_02058812: - mov r1, #0x8 - bl sub_02058384 - pop {r3, pc} - .balign 4 - - thumb_func_start sub_0205881C -sub_0205881C: ; 0x0205881C - push {r3, lr} - mov r1, #0x8 - bl sub_02058390 - cmp r0, #0x0 - bne _0205882C - mov r0, #0x1 - pop {r3, pc} -_0205882C: - mov r0, #0x0 - pop {r3, pc} - - thumb_func_start MapObject_IsInUse -MapObject_IsInUse: ; 0x02058830 - ldr r3, _02058838 ; =MapObject_TestFlagsBits - mov r1, #0x1 - bx r3 - nop -_02058838: .word MapObject_TestFlagsBits - - thumb_func_start sub_0205883C -sub_0205883C: ; 0x0205883C - ldr r3, _02058844 ; =MapObject_SetFlagsBits - mov r1, #0x2 - bx r3 - nop -_02058844: .word MapObject_SetFlagsBits - - thumb_func_start sub_02058848 -sub_02058848: ; 0x02058848 - ldr r3, _02058850 ; =MapObject_ClearFlagsBits - mov r1, #0x2 - bx r3 - nop -_02058850: .word MapObject_ClearFlagsBits - - thumb_func_start sub_02058854 -sub_02058854: ; 0x02058854 - ldr r3, _0205885C ; =MapObject_TestFlagsBits - mov r1, #0x2 - bx r3 - nop -_0205885C: .word MapObject_TestFlagsBits - - thumb_func_start sub_02058860 -sub_02058860: ; 0x02058860 - ldr r3, _02058868 ; =MapObject_SetFlagsBits - mov r1, #0x4 - bx r3 - nop -_02058868: .word MapObject_SetFlagsBits - - thumb_func_start sub_0205886C -sub_0205886C: ; 0x0205886C - ldr r3, _02058874 ; =MapObject_ClearFlagsBits - mov r1, #0x8 - bx r3 - nop -_02058874: .word MapObject_ClearFlagsBits - - thumb_func_start MapObject_SetFlag14 -MapObject_SetFlag14: ; 0x02058878 - ldr r3, _02058880 ; =MapObject_SetFlagsBits - mov r1, #0x1 - lsl r1, r1, #0xe - bx r3 - .balign 4 -_02058880: .word MapObject_SetFlagsBits - - thumb_func_start MapObject_CheckFlag14 -MapObject_CheckFlag14: ; 0x02058884 - ldr r3, _0205888C ; =MapObject_TestFlagsBits - mov r1, #0x1 - lsl r1, r1, #0xe - bx r3 - .balign 4 -_0205888C: .word MapObject_TestFlagsBits - - thumb_func_start sub_02058890 -sub_02058890: ; 0x02058890 - ldr r3, _02058898 ; =MapObject_TestFlagsBits - mov r1, #0x2 - lsl r1, r1, #0x8 - bx r3 - .balign 4 -_02058898: .word MapObject_TestFlagsBits - - thumb_func_start MapObject_SetVisible -MapObject_SetVisible: ; 0x0205889C - push {r3, lr} - cmp r1, #0x1 - bne _020588AC - mov r1, #0x2 - lsl r1, r1, #0x8 - bl MapObject_SetFlagsBits - pop {r3, pc} -_020588AC: - mov r1, #0x2 - lsl r1, r1, #0x8 - bl MapObject_ClearFlagsBits - pop {r3, pc} - .balign 4 - - thumb_func_start sub_020588B8 -sub_020588B8: ; 0x020588B8 - push {r3, lr} - cmp r1, #0x1 - bne _020588C8 - mov r1, #0x1 - lsl r1, r1, #0x12 - bl MapObject_ClearFlagsBits - pop {r3, pc} -_020588C8: - mov r1, #0x1 - lsl r1, r1, #0x12 - bl MapObject_SetFlagsBits - pop {r3, pc} - .balign 4 - - thumb_func_start sub_020588D4 -sub_020588D4: ; 0x020588D4 - push {r3, lr} - mov r1, #0x2 - lsl r1, r1, #0x12 - bl MapObject_TestFlagsBits - cmp r0, #0x1 - beq _020588E6 - mov r0, #0x1 - pop {r3, pc} -_020588E6: - mov r0, #0x0 - pop {r3, pc} - .balign 4 - - thumb_func_start sub_020588EC -sub_020588EC: ; 0x020588EC - push {r3, lr} - cmp r1, #0x1 - bne _020588FC - mov r1, #0x2 - lsl r1, r1, #0x12 - bl MapObject_SetFlagsBits - pop {r3, pc} -_020588FC: - mov r1, #0x2 - lsl r1, r1, #0x12 - bl MapObject_ClearFlagsBits - pop {r3, pc} - .balign 4 - - thumb_func_start sub_02058908 -sub_02058908: ; 0x02058908 - ldr r3, _02058910 ; =MapObject_SetFlagsBits - mov r1, #0x40 - bx r3 - nop -_02058910: .word MapObject_SetFlagsBits - - thumb_func_start sub_02058914 -sub_02058914: ; 0x02058914 - ldr r3, _0205891C ; =MapObject_ClearFlagsBits - mov r1, #0x40 - bx r3 - nop -_0205891C: .word MapObject_ClearFlagsBits - - thumb_func_start sub_02058920 -sub_02058920: ; 0x02058920 - push {r3, lr} - mov r1, #0x40 - bl MapObject_TestFlagsBits - cmp r0, #0x1 - bne _02058930 - mov r0, #0x1 - pop {r3, pc} -_02058930: - mov r0, #0x0 - pop {r3, pc} - - thumb_func_start sub_02058934 -sub_02058934: ; 0x02058934 - push {r4, lr} - add r4, r0, #0x0 - bl MapObject_GetManager - bl sub_020587E0 - cmp r0, #0x0 - bne _02058948 - mov r0, #0x0 - pop {r4, pc} -_02058948: - mov r1, #0x1 - add r0, r4, #0x0 - lsl r1, r1, #0xe - bl MapObject_GetFlagsBits - cmp r0, #0x0 - beq _0205895A - mov r0, #0x1 - pop {r4, pc} -_0205895A: - mov r0, #0x0 - pop {r4, pc} - .balign 4 - - thumb_func_start sub_02058960 -sub_02058960: ; 0x02058960 - push {r3, lr} - cmp r1, #0x1 - bne _02058970 - mov r1, #0x2 - lsl r1, r1, #0x16 - bl MapObject_SetFlagsBits - pop {r3, pc} -_02058970: - mov r1, #0x2 - lsl r1, r1, #0x16 - bl MapObject_ClearFlagsBits - pop {r3, pc} - .balign 4 - - thumb_func_start sub_0205897C -sub_0205897C: ; 0x0205897C - push {r3, lr} - mov r1, #0x2 - lsl r1, r1, #0x16 - bl MapObject_GetFlagsBits - cmp r0, #0x0 - beq _0205898E - mov r0, #0x1 - pop {r3, pc} -_0205898E: - mov r0, #0x0 - pop {r3, pc} - .balign 4 - - thumb_func_start sub_02058994 -sub_02058994: ; 0x02058994 - push {r3, lr} - cmp r1, #0x1 - bne _020589A4 - mov r1, #0x1 - lsl r1, r1, #0xa - bl MapObject_SetFlagsBits - pop {r3, pc} -_020589A4: - mov r1, #0x1 - lsl r1, r1, #0xa - bl MapObject_ClearFlagsBits - pop {r3, pc} - .balign 4 - - thumb_func_start MapObject_SetFlag25 -MapObject_SetFlag25: ; 0x020589B0 - push {r3, lr} - cmp r1, #0x1 - bne _020589C0 - mov r1, #0x2 - lsl r1, r1, #0x18 - bl MapObject_SetFlagsBits - pop {r3, pc} -_020589C0: - mov r1, #0x2 - lsl r1, r1, #0x18 - bl MapObject_ClearFlagsBits - pop {r3, pc} - .balign 4 - - thumb_func_start MapObject_CheckFlag25 -MapObject_CheckFlag25: ; 0x020589CC - push {r3, lr} - mov r1, #0x2 - lsl r1, r1, #0x18 - bl MapObject_GetFlagsBits - cmp r0, #0x0 - beq _020589DE - mov r0, #0x1 - pop {r3, pc} -_020589DE: - mov r0, #0x0 - pop {r3, pc} - .balign 4 - - thumb_func_start sub_020589E4 -sub_020589E4: ; 0x020589E4 - push {r3, lr} - cmp r1, #0x1 - bne _020589F4 - mov r1, #0x1 - lsl r1, r1, #0x1a - bl MapObject_SetFlagsBits - pop {r3, pc} -_020589F4: - mov r1, #0x1 - lsl r1, r1, #0x1a - bl MapObject_ClearFlagsBits - pop {r3, pc} - .balign 4 - - thumb_func_start sub_02058A00 -sub_02058A00: ; 0x02058A00 - push {r3, lr} - mov r1, #0x1 - lsl r1, r1, #0x1a - bl MapObject_GetFlagsBits - cmp r0, #0x0 - beq _02058A12 - mov r0, #0x1 - pop {r3, pc} -_02058A12: - mov r0, #0x0 - pop {r3, pc} - .balign 4 - - thumb_func_start sub_02058A18 -sub_02058A18: ; 0x02058A18 - push {r3, lr} - cmp r1, #0x1 - bne _02058A28 - mov r1, #0x2 - lsl r1, r1, #0x1a - bl MapObject_SetFlagsBits - pop {r3, pc} -_02058A28: - mov r1, #0x2 - lsl r1, r1, #0x1a - bl MapObject_ClearFlagsBits - pop {r3, pc} - .balign 4 - - thumb_func_start sub_02058A34 -sub_02058A34: ; 0x02058A34 - push {r3, lr} - mov r1, #0x2 - lsl r1, r1, #0x1a - bl MapObject_GetFlagsBits - cmp r0, #0x0 - beq _02058A46 - mov r0, #0x1 - pop {r3, pc} -_02058A46: - mov r0, #0x0 - pop {r3, pc} - .balign 4 - - thumb_func_start sub_02058A4C -sub_02058A4C: ; 0x02058A4C - push {r3, lr} - cmp r1, #0x1 - bne _02058A5C - mov r1, #0x1 - lsl r1, r1, #0x1c - bl MapObject_SetFlagsBits - pop {r3, pc} -_02058A5C: - mov r1, #0x1 - lsl r1, r1, #0x1c - bl MapObject_ClearFlagsBits - pop {r3, pc} - .balign 4 - - thumb_func_start sub_02058A68 -sub_02058A68: ; 0x02058A68 - push {r3, lr} - mov r1, #0x1 - lsl r1, r1, #0x1c - bl MapObject_GetFlagsBits - cmp r0, #0x0 - beq _02058A7A - mov r0, #0x1 - pop {r3, pc} -_02058A7A: - mov r0, #0x0 - pop {r3, pc} - .balign 4 - - thumb_func_start sub_02058A80 -sub_02058A80: ; 0x02058A80 - push {r3, lr} - cmp r1, #0x1 - bne _02058A90 - mov r1, #0x1 - lsl r1, r1, #0x18 - bl MapObject_SetFlagsBits - pop {r3, pc} -_02058A90: - mov r1, #0x1 - lsl r1, r1, #0x18 - bl MapObject_ClearFlagsBits - pop {r3, pc} - .balign 4 - - thumb_func_start sub_02058A9C -sub_02058A9C: ; 0x02058A9C - push {r3, lr} - mov r1, #0x1 - lsl r1, r1, #0x18 - bl MapObject_GetFlagsBits - cmp r0, #0x0 - beq _02058AAE - mov r0, #0x1 - pop {r3, pc} -_02058AAE: - mov r0, #0x0 - pop {r3, pc} - .balign 4 - - thumb_func_start sub_02058AB4 -sub_02058AB4: ; 0x02058AB4 - push {r3, lr} - mov r1, #0x10 - bl MapObject_GetFlagsBits - cmp r0, #0x0 - beq _02058AC4 - mov r0, #0x1 - pop {r3, pc} -_02058AC4: - mov r0, #0x0 - pop {r3, pc} - - thumb_func_start sub_02058AC8 -sub_02058AC8: ; 0x02058AC8 - push {r3, lr} - cmp r1, #0x1 - bne _02058AD8 - mov r1, #0x2 - lsl r1, r1, #0x1c - bl MapObject_SetFlagsBits - pop {r3, pc} -_02058AD8: - mov r1, #0x2 - lsl r1, r1, #0x1c - bl MapObject_ClearFlagsBits - pop {r3, pc} - .balign 4 - - thumb_func_start MapObject_CheckFlag29 -MapObject_CheckFlag29: ; 0x02058AE4 - push {r3, lr} - mov r1, #0x2 - lsl r1, r1, #0x1c - bl MapObject_GetFlagsBits - cmp r0, #0x0 - beq _02058AF6 - mov r0, #0x1 - pop {r3, pc} -_02058AF6: - mov r0, #0x0 - pop {r3, pc} - .balign 4 - - thumb_func_start MapObject_GetInitialX -MapObject_GetInitialX: ; 0x02058AFC - ldr r0, [r0, #0x4c] - bx lr - - thumb_func_start MapObject_SetInitialX -MapObject_SetInitialX: ; 0x02058B00 - str r1, [r0, #0x4c] - bx lr - - thumb_func_start MapObject_GetInitialHeight -MapObject_GetInitialHeight: ; 0x02058B04 - ldr r0, [r0, #0x50] - bx lr - - thumb_func_start MapObject_SetInitialHeight -MapObject_SetInitialHeight: ; 0x02058B08 - str r1, [r0, #0x50] - bx lr - - thumb_func_start MapObject_GetInitialY -MapObject_GetInitialY: ; 0x02058B0C - ldr r0, [r0, #0x54] - bx lr - - thumb_func_start MapObject_SetInitialY -MapObject_SetInitialY: ; 0x02058B10 - str r1, [r0, #0x54] - bx lr - - thumb_func_start sub_02058B14 -sub_02058B14: ; 0x02058B14 - ldr r0, [r0, #0x58] - bx lr - - thumb_func_start MapObject_SetPreviousX -MapObject_SetPreviousX: ; 0x02058B18 - str r1, [r0, #0x58] - bx lr - - thumb_func_start sub_02058B1C -sub_02058B1C: ; 0x02058B1C - ldr r0, [r0, #0x5c] - bx lr - - thumb_func_start MapObject_SetPreviousHeight -MapObject_SetPreviousHeight: ; 0x02058B20 - str r1, [r0, #0x5c] - bx lr - - thumb_func_start sub_02058B24 -sub_02058B24: ; 0x02058B24 - ldr r0, [r0, #0x60] - bx lr - - thumb_func_start MapObject_SetPreviousY -MapObject_SetPreviousY: ; 0x02058B28 - str r1, [r0, #0x60] - bx lr - - thumb_func_start MapObject_GetCurrentX -MapObject_GetCurrentX: ; 0x02058B2C - ldr r0, [r0, #0x64] - bx lr - - thumb_func_start MapObject_SetCurrentX -MapObject_SetCurrentX: ; 0x02058B30 - str r1, [r0, #0x64] - bx lr - - thumb_func_start sub_02058B34 -sub_02058B34: ; 0x02058B34 - ldr r2, [r0, #0x64] - add r1, r2, r1 - str r1, [r0, #0x64] - bx lr - - thumb_func_start MapObject_GetCurrentHeight -MapObject_GetCurrentHeight: ; 0x02058B3C - ldr r0, [r0, #0x68] - bx lr - - thumb_func_start MapObject_SetCurrentHeight -MapObject_SetCurrentHeight: ; 0x02058B40 - str r1, [r0, #0x68] - bx lr - - thumb_func_start sub_02058B44 -sub_02058B44: ; 0x02058B44 - ldr r2, [r0, #0x68] - add r1, r2, r1 - str r1, [r0, #0x68] - bx lr - - thumb_func_start MapObject_GetCurrentY -MapObject_GetCurrentY: ; 0x02058B4C - ldr r0, [r0, #0x6c] - bx lr - - thumb_func_start MapObject_SetCurrentY -MapObject_SetCurrentY: ; 0x02058B50 - str r1, [r0, #0x6c] - bx lr - - thumb_func_start sub_02058B54 -sub_02058B54: ; 0x02058B54 - ldr r2, [r0, #0x6c] - add r1, r2, r1 - str r1, [r0, #0x6c] - bx lr - - thumb_func_start MapObject_GetPositionVec -MapObject_GetPositionVec: ; 0x02058B5C - add r2, r0, #0x0 - add r2, #0x70 - add r3, r1, #0x0 - ldmia r2!, {r0-r1} - stmia r3!, {r0-r1} - ldr r0, [r2, #0x0] - str r0, [r3, #0x0] - bx lr - - thumb_func_start MapObject_SetPositionVec -MapObject_SetPositionVec: ; 0x02058B6C - add r3, r1, #0x0 - add r2, r0, #0x0 - ldmia r3!, {r0-r1} - add r2, #0x70 - stmia r2!, {r0-r1} - ldr r0, [r3, #0x0] - str r0, [r2, #0x0] - bx lr - - thumb_func_start sub_02058B7C -sub_02058B7C: ; 0x02058B7C - add r0, #0x70 - bx lr - - thumb_func_start MapObject_GetPosVecYCoord -MapObject_GetPosVecYCoord: ; 0x02058B80 - ldr r0, [r0, #0x74] - bx lr - - thumb_func_start sub_02058B84 -sub_02058B84: ; 0x02058B84 - add r2, r0, #0x0 - add r2, #0x7c - add r3, r1, #0x0 - ldmia r2!, {r0-r1} - stmia r3!, {r0-r1} - ldr r0, [r2, #0x0] - str r0, [r3, #0x0] - bx lr - - thumb_func_start sub_02058B94 -sub_02058B94: ; 0x02058B94 - add r3, r1, #0x0 - add r2, r0, #0x0 - ldmia r3!, {r0-r1} - add r2, #0x7c - stmia r2!, {r0-r1} - ldr r0, [r3, #0x0] - str r0, [r2, #0x0] - bx lr - - thumb_func_start sub_02058BA4 -sub_02058BA4: ; 0x02058BA4 - add r2, r0, #0x0 - add r2, #0x88 - add r3, r1, #0x0 - ldmia r2!, {r0-r1} - stmia r3!, {r0-r1} - ldr r0, [r2, #0x0] - str r0, [r3, #0x0] - bx lr - - thumb_func_start sub_02058BB4 -sub_02058BB4: ; 0x02058BB4 - add r3, r1, #0x0 - add r2, r0, #0x0 - ldmia r3!, {r0-r1} - add r2, #0x88 - stmia r2!, {r0-r1} - ldr r0, [r3, #0x0] - str r0, [r2, #0x0] - bx lr - - thumb_func_start sub_02058BC4 -sub_02058BC4: ; 0x02058BC4 - add r2, r0, #0x0 - add r2, #0x94 - add r3, r1, #0x0 - ldmia r2!, {r0-r1} - stmia r3!, {r0-r1} - ldr r0, [r2, #0x0] - str r0, [r3, #0x0] - bx lr - - thumb_func_start sub_02058BD4 -sub_02058BD4: ; 0x02058BD4 - add r3, r1, #0x0 - add r2, r0, #0x0 - ldmia r3!, {r0-r1} - add r2, #0x94 - stmia r2!, {r0-r1} - ldr r0, [r3, #0x0] - str r0, [r2, #0x0] - bx lr - - thumb_func_start sub_02058BE4 -sub_02058BE4: ; 0x02058BE4 - push {r3, lr} - bl MapObject_GetPosVecYCoord - asr r1, r0, #0x3 - asr r0, r1, #0xb - lsr r0, r0, #0x14 - add r0, r1, r0 - asr r0, r0, #0xc - pop {r3, pc} - .balign 4 - - thumb_func_start ObjectEvent_SetId -ObjectEvent_SetId: ; 0x02058BF8 - strh r1, [r0, #0x0] - bx lr - - thumb_func_start ObjectEvent_GetID -ObjectEvent_GetID: ; 0x02058BFC - ldrh r0, [r0, #0x0] - bx lr - - thumb_func_start ObjectEvent_SetSprite -ObjectEvent_SetSprite: ; 0x02058C00 - strh r1, [r0, #0x2] - bx lr - - thumb_func_start ObjectEvent_GetSpriteID -ObjectEvent_GetSpriteID: ; 0x02058C04 - ldrh r0, [r0, #0x2] - bx lr - - thumb_func_start ObjectEvent_SetMovement -ObjectEvent_SetMovement: ; 0x02058C08 - strh r1, [r0, #0x4] - bx lr - - thumb_func_start ObjectEvent_GetMovement -ObjectEvent_GetMovement: ; 0x02058C0C - ldrh r0, [r0, #0x4] - bx lr - - thumb_func_start ObjectEvent_SetType -ObjectEvent_SetType: ; 0x02058C10 - strh r1, [r0, #0x6] - bx lr - - thumb_func_start ObjectEvent_GetType -ObjectEvent_GetType: ; 0x02058C14 - ldrh r0, [r0, #0x6] - bx lr - - thumb_func_start ObjectEvent_SetFlagId -ObjectEvent_SetFlagId: ; 0x02058C18 - strh r1, [r0, #0x8] - bx lr - - thumb_func_start ObjectEvent_GetFlagID -ObjectEvent_GetFlagID: ; 0x02058C1C - ldrh r0, [r0, #0x8] - bx lr - - thumb_func_start ObjectEvent_SetScript -ObjectEvent_SetScript: ; 0x02058C20 - strh r1, [r0, #0xa] - bx lr - - thumb_func_start ObjectEvent_GetScriptID -ObjectEvent_GetScriptID: ; 0x02058C24 - ldrh r0, [r0, #0xa] - bx lr - - thumb_func_start ObjectEvent_SetFacing -ObjectEvent_SetFacing: ; 0x02058C28 - strh r1, [r0, #0xc] - bx lr - - thumb_func_start ObjectEvent_GetInitialFacingDirection -ObjectEvent_GetInitialFacingDirection: ; 0x02058C2C - mov r1, #0xc - ldrsh r0, [r0, r1] - bx lr - .balign 4 - - thumb_func_start ObjectEvent_SetParam -ObjectEvent_SetParam: ; 0x02058C34 - push {r3, lr} - cmp r2, #0x0 - beq _02058C44 - cmp r2, #0x1 - beq _02058C48 - cmp r2, #0x2 - beq _02058C4C - b _02058C50 -_02058C44: - strh r1, [r0, #0xe] - pop {r3, pc} -_02058C48: - strh r1, [r0, #0x10] - pop {r3, pc} -_02058C4C: - strh r1, [r0, #0x12] - pop {r3, pc} -_02058C50: - bl GF_AssertFail - pop {r3, pc} - .balign 4 - - thumb_func_start ObjectEvent_GetParam -ObjectEvent_GetParam: ; 0x02058C58 - push {r3, lr} - cmp r1, #0x0 - beq _02058C68 - cmp r1, #0x1 - beq _02058C6C - cmp r1, #0x2 - beq _02058C70 - b _02058C74 -_02058C68: - ldrh r0, [r0, #0xe] - pop {r3, pc} -_02058C6C: - ldrh r0, [r0, #0x10] - pop {r3, pc} -_02058C70: - ldrh r0, [r0, #0x12] - pop {r3, pc} -_02058C74: - bl GF_AssertFail - mov r0, #0x0 - pop {r3, pc} - - thumb_func_start ObjectEvent_SetXRange -ObjectEvent_SetXRange: ; 0x02058C7C - strh r1, [r0, #0x14] - bx lr - - thumb_func_start ObjectEvent_GetXRange -ObjectEvent_GetXRange: ; 0x02058C80 - mov r1, #0x14 - ldrsh r0, [r0, r1] - bx lr - .balign 4 - - thumb_func_start ObjectEvent_SetYRange -ObjectEvent_SetYRange: ; 0x02058C88 - strh r1, [r0, #0x16] - bx lr - - thumb_func_start ObjectEvent_GetYRange -ObjectEvent_GetYRange: ; 0x02058C8C - mov r1, #0x16 - ldrsh r0, [r0, r1] - bx lr - .balign 4 - - thumb_func_start ObjectEvent_SetXCoord -ObjectEvent_SetXCoord: ; 0x02058C94 - strh r1, [r0, #0x18] - bx lr - - thumb_func_start ObjectEvent_GetXCoord -ObjectEvent_GetXCoord: ; 0x02058C98 - ldrh r0, [r0, #0x18] - bx lr - - thumb_func_start ObjectEvent_SetHeight -ObjectEvent_SetHeight: ; 0x02058C9C - str r1, [r0, #0x1c] - bx lr - - thumb_func_start ObjectEvent_GetHeight -ObjectEvent_GetHeight: ; 0x02058CA0 - ldr r0, [r0, #0x1c] - bx lr - - thumb_func_start ObjectEvent_SetYCoord -ObjectEvent_SetYCoord: ; 0x02058CA4 - strh r1, [r0, #0x1a] - bx lr - - thumb_func_start ObjectEvent_GetYCoord -ObjectEvent_GetYCoord: ; 0x02058CA8 - ldrh r0, [r0, #0x1a] - bx lr - - thumb_func_start ObjectEvent_GetById -ObjectEvent_GetById: ; 0x02058CAC - push {r3-r7, lr} - add r6, r0, #0x0 - add r7, r1, #0x0 - str r2, [sp, #0x0] - mov r4, #0x0 - add r5, r2, #0x0 -_02058CB8: - add r0, r5, #0x0 - bl ObjectEvent_ScriptIDIsUnset - cmp r0, #0x0 - bne _02058CD4 - add r0, r5, #0x0 - bl ObjectEvent_GetID - cmp r6, r0 - bne _02058CD4 - ldr r0, [sp, #0x0] - lsl r1, r4, #0x5 - add r0, r0, r1 - pop {r3-r7, pc} -_02058CD4: - add r4, r4, #0x1 - add r5, #0x20 - cmp r4, r7 - blt _02058CB8 - mov r0, #0x0 - pop {r3-r7, pc} - - thumb_func_start ObjectEvent_ScriptIDIsUnset -ObjectEvent_ScriptIDIsUnset: ; 0x02058CE0 - push {r3, lr} - bl ObjectEvent_GetScriptID - lsl r0, r0, #0x10 - lsr r1, r0, #0x10 - ldr r0, _02058CF8 ; =0x0000FFFF - cmp r1, r0 - bne _02058CF4 - mov r0, #0x1 - pop {r3, pc} -_02058CF4: - mov r0, #0x0 - pop {r3, pc} - .balign 4 -_02058CF8: .word 0x0000FFFF - - thumb_func_start ObjectEvent_GetFlagID_AssertScriptIDIsUnset -ObjectEvent_GetFlagID_AssertScriptIDIsUnset: ; 0x02058CFC - push {r4, lr} - add r4, r0, #0x0 - bl ObjectEvent_ScriptIDIsUnset - cmp r0, #0x1 - beq _02058D0C - bl GF_AssertFail -_02058D0C: - add r0, r4, #0x0 - bl ObjectEvent_GetFlagID - pop {r4, pc} - - thumb_func_start sub_02058D14 -sub_02058D14: ; 0x02058D14 - push {r4, lr} - add r4, r0, #0x0 - cmp r4, #0x37 - blo _02058D20 - bl GF_AssertFail -_02058D20: - ldr r0, _02058D28 ; =UNK_020F6364 - lsl r1, r4, #0x2 - ldr r0, [r0, r1] - pop {r4, pc} - .balign 4 -_02058D28: .word UNK_020F6364 - - thumb_func_start sub_02058D2C -sub_02058D2C: ; 0x02058D2C - ldr r0, [r0, #0x4] - bx lr - - thumb_func_start sub_02058D30 -sub_02058D30: ; 0x02058D30 - ldr r0, [r0, #0x8] - bx lr - - thumb_func_start sub_02058D34 -sub_02058D34: ; 0x02058D34 - ldr r0, [r0, #0xc] - bx lr - - thumb_func_start sub_02058D38 -sub_02058D38: ; 0x02058D38 - ldr r0, [r0, #0x0] - bx lr - - thumb_func_start sub_02058D3C -sub_02058D3C: ; 0x02058D3C - ldr r0, [r0, #0x4] - bx lr - - thumb_func_start sub_02058D40 -sub_02058D40: ; 0x02058D40 - ldr r0, [r0, #0x8] - bx lr - - thumb_func_start sub_02058D44 -sub_02058D44: ; 0x02058D44 - ldr r0, [r0, #0xc] - bx lr - - thumb_func_start sub_02058D48 -sub_02058D48: ; 0x02058D48 - ldr r0, [r0, #0x10] - bx lr - - thumb_func_start sub_02058D4C -sub_02058D4C: ; 0x02058D4C - push {r3, lr} - ldr r3, _02058D6C ; =ov05_021F9494 - ldr r1, _02058D70 ; =0x0000FFFF -_02058D52: - ldr r2, [r3, #0x0] - cmp r2, r0 - bne _02058D5C - ldr r0, [r3, #0x4] - pop {r3, pc} -_02058D5C: - add r3, #0x8 - ldr r2, [r3, #0x0] - cmp r2, r1 - bne _02058D52 - bl GF_AssertFail - mov r0, #0x0 - pop {r3, pc} - .balign 4 -_02058D6C: .word ov05_021F9494 -_02058D70: .word 0x0000FFFF - - thumb_func_start sub_02058D74 -sub_02058D74: ; 0x02058D74 - push {r3-r7, lr} - add r5, r0, #0x0 - add r6, r1, #0x0 - add r7, r2, #0x0 - bl MapObjectManager_GetObjectCount - add r4, r0, #0x0 - add r0, r5, #0x0 - bl MapObjectManager_GetObjects - add r5, r0, #0x0 -_02058D8A: - add r0, r5, #0x0 - mov r1, #0x1 - bl MapObject_GetFlagsBits - cmp r0, #0x0 - beq _02058DAE - add r0, r5, #0x0 - bl MapObject_GetCurrentX - cmp r6, r0 - bne _02058DAE - add r0, r5, #0x0 - bl MapObject_GetCurrentY - cmp r7, r0 - bne _02058DAE - add r0, r5, #0x0 - pop {r3-r7, pc} -_02058DAE: - mov r0, #0x4a - lsl r0, r0, #0x2 - add r5, r5, r0 - sub r4, r4, #0x1 - bne _02058D8A - mov r0, #0x0 - pop {r3-r7, pc} - - thumb_func_start sub_02058DBC -sub_02058DBC: ; 0x02058DBC - push {r4-r6, lr} - add r4, r1, #0x0 - ldr r1, [r4, #0x0] - add r6, r2, #0x0 - asr r2, r1, #0x4 - asr r1, r2, #0xb - lsr r1, r1, #0x14 - add r1, r2, r1 - asr r1, r1, #0xc - add r5, r0, #0x0 - bl MapObject_SetCurrentX - ldr r1, [r4, #0x4] - add r0, r5, #0x0 - asr r2, r1, #0x3 - asr r1, r2, #0xb - lsr r1, r1, #0x14 - add r1, r2, r1 - asr r1, r1, #0xc - bl MapObject_SetCurrentHeight - ldr r1, [r4, #0x8] - add r0, r5, #0x0 - asr r2, r1, #0x4 - asr r1, r2, #0xb - lsr r1, r1, #0x14 - add r1, r2, r1 - asr r1, r1, #0xc - bl MapObject_SetCurrentY - add r0, r5, #0x0 - add r1, r4, #0x0 - bl MapObject_SetPositionVec - add r0, r5, #0x0 - bl sub_02059C60 - add r0, r5, #0x0 - add r1, r6, #0x0 - bl MapObject_SetFacingDirectionDirect - add r0, r5, #0x0 - bl MapObject_ClearHeldMovement - add r0, r5, #0x0 - mov r1, #0x4 - bl MapObject_SetFlagsBits - add r0, r5, #0x0 - mov r1, #0xa - bl MapObject_ClearFlagsBits - pop {r4-r6, pc} - .balign 4 - - thumb_func_start sub_02058E28 -sub_02058E28: ; 0x02058E28 - push {r3-r6, lr} - sub sp, #0xc - add r4, r2, #0x0 - mov r2, #0x2 - add r6, r3, #0x0 - lsl r3, r1, #0x10 - lsl r2, r2, #0xe - add r2, r3, r2 - add r5, r0, #0x0 - str r2, [sp, #0x0] - bl MapObject_SetCurrentX - lsl r0, r4, #0xf - str r0, [sp, #0x4] - add r0, r5, #0x0 - add r1, r4, #0x0 - bl MapObject_SetCurrentHeight - mov r0, #0x2 - lsl r1, r6, #0x10 - lsl r0, r0, #0xe - add r0, r1, r0 - str r0, [sp, #0x8] - add r0, r5, #0x0 - add r1, r6, #0x0 - bl MapObject_SetCurrentY - add r0, r5, #0x0 - add r1, sp, #0x0 - bl MapObject_SetPositionVec - add r0, r5, #0x0 - bl sub_02059C60 - ldr r1, [sp, #0x20] - add r0, r5, #0x0 - bl MapObject_SetFacingDirectionDirect - add r0, r5, #0x0 - mov r1, #0x4 - bl MapObject_SetFlagsBits - add r0, r5, #0x0 - mov r1, #0xa - bl MapObject_ClearFlagsBits - add r0, r5, #0x0 - bl MapObject_ClearHeldMovement - add sp, #0xc - pop {r3-r6, pc} - .balign 4 - - thumb_func_start sub_02058E90 -sub_02058E90: ; 0x02058E90 - push {r3-r5, lr} - add r5, r0, #0x0 - add r4, r1, #0x0 - bl sub_02058660 - add r0, r5, #0x0 - add r1, r4, #0x0 - bl MapObject_SetMovement - add r0, r5, #0x0 - bl sub_02057EE0 - add r0, r5, #0x0 - bl sub_02058EE8 - pop {r3-r5, pc} - - thumb_func_start sub_02058EB0 -sub_02058EB0: ; 0x02058EB0 - push {r4, lr} - add r4, r0, #0x0 - bl MapObject_SetID - add r0, r4, #0x0 - bl sub_02058860 - add r0, r4, #0x0 - bl sub_0205815C - pop {r4, pc} - .balign 4 - - thumb_func_start sub_02058EC8 -sub_02058EC8: ; 0x02058EC8 - bx lr - .balign 4 - - thumb_func_start sub_02058ECC -sub_02058ECC: ; 0x02058ECC - bx lr - .balign 4 - - thumb_func_start sub_02058ED0 -sub_02058ED0: ; 0x02058ED0 - bx lr - .balign 4 - - thumb_func_start sub_02058ED4 -sub_02058ED4: ; 0x02058ED4 - bx lr - .balign 4 - - thumb_func_start sub_02058ED8 -sub_02058ED8: ; 0x02058ED8 - bx lr - .balign 4 - - thumb_func_start sub_02058EDC -sub_02058EDC: ; 0x02058EDC - bx lr - .balign 4 - - thumb_func_start sub_02058EE0 -sub_02058EE0: ; 0x02058EE0 - bx lr - .balign 4 - - thumb_func_start sub_02058EE4 -sub_02058EE4: ; 0x02058EE4 - bx lr - .balign 4 diff --git a/arm9/asm/unk_0200E1D0_s.s b/arm9/asm/unk_0200E1D0_s.s index 131f949d7..1c02a5b29 100644 --- a/arm9/asm/unk_0200E1D0_s.s +++ b/arm9/asm/unk_0200E1D0_s.s @@ -764,7 +764,7 @@ sub_0200E71C: ; 0x0200E71C ldr r3, [r4, #0xc] bl sub_0200E628 add r0, r5, #0x0 - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0x0 bl FreeToHeap pop {r3-r5, pc} @@ -778,7 +778,7 @@ sub_0200E73C: ; 0x0200E73C ldr r1, [r4, #0x4] bl sub_0200E6A0 add r0, r5, #0x0 - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0x0 bl FreeToHeap pop {r3-r5, pc} @@ -834,7 +834,7 @@ sub_0200E794: ; 0x0200E794 mov r1, #0x0 bl sub_0200E440 add r0, r4, #0x0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} thumb_func_start sub_0200E7A8 diff --git a/arm9/asm/unk_0200E850.s b/arm9/asm/unk_0200E850.s index bd826bd7f..7d9d45822 100644 --- a/arm9/asm/unk_0200E850.s +++ b/arm9/asm/unk_0200E850.s @@ -2097,7 +2097,7 @@ _0200F60C: blt _0200F60C _0200F624: ldr r0, [sp, #0x0] - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3-r7, pc} thumb_func_start sub_0200F62C @@ -2295,7 +2295,7 @@ _0200F78E: cmp r4, #0x2 blt _0200F78E ldr r0, [sp, #0x0] - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3-r7, pc} .balign 4 diff --git a/arm9/asm/unk_0201137C.s b/arm9/asm/unk_0201137C.s index 881ce51c1..e506c0a14 100644 --- a/arm9/asm/unk_0201137C.s +++ b/arm9/asm/unk_0201137C.s @@ -328,7 +328,7 @@ sub_020116CC: ; 0x020116CC ldmia r1!, {r0-r1} bl sub_02011480 add r0, r4, #0x0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} .balign 4 @@ -343,7 +343,7 @@ sub_020116E0: ; 0x020116E0 ldr r3, [r3, #0xc] bl sub_020114AC add r0, r4, #0x0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} .balign 4 @@ -357,7 +357,7 @@ sub_020116FC: ; 0x020116FC ldr r2, [r2, #0x8] bl sub_02011534 add r0, r4, #0x0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} thumb_func_start sub_02011714 @@ -380,7 +380,7 @@ sub_02011714: ; 0x02011714 ldrsh r3, [r3, r5] bl sub_02011574 add r0, r4, #0x0 - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0x8 pop {r3-r5, pc} .balign 4 diff --git a/arm9/asm/unk_02012944.s b/arm9/asm/unk_02012944.s index b84b0ffe4..ef34065fd 100644 --- a/arm9/asm/unk_02012944.s +++ b/arm9/asm/unk_02012944.s @@ -218,7 +218,7 @@ _02012ACE: ldr r0, [r4, r0] cmp r0, #0x0 beq _02012AF4 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _02012AF8 ; =0x00000604 mov r1, #0x0 str r1, [r4, r0] diff --git a/arm9/asm/unk_02012CC8.s b/arm9/asm/unk_02012CC8.s index c73af9841..84c021288 100644 --- a/arm9/asm/unk_02012CC8.s +++ b/arm9/asm/unk_02012CC8.s @@ -861,7 +861,7 @@ sub_02013268: ; 0x02013268 add r0, r1, #0x0 bl sub_02013228 add r0, r4, #0x0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} .balign 4 diff --git a/arm9/asm/unk_02014590.s b/arm9/asm/unk_02014590.s index e324eec85..5c51882f9 100644 --- a/arm9/asm/unk_02014590.s +++ b/arm9/asm/unk_02014590.s @@ -744,7 +744,7 @@ sub_02014AD4: ; 0x02014AD4 lsr r1, r1, #0x18 bl BG_LoadCharTilesData add r0, r5, #0x0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x8] bl FreeToHeap add r0, r4, #0x0 @@ -780,7 +780,7 @@ _02014B34: bl GXS_LoadBGPltt _02014B44: add r0, r5, #0x0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x4] bl FreeToHeap add r0, r4, #0x0 diff --git a/arm9/asm/unk_02014BF4.s b/arm9/asm/unk_02014BF4.s index 422ea7312..23e6c5b4d 100644 --- a/arm9/asm/unk_02014BF4.s +++ b/arm9/asm/unk_02014BF4.s @@ -304,7 +304,7 @@ sub_02014D9C: ; 0x02014D9C ldr r0, [r0, #0x4] cmp r0, #0x0 beq _02014DD6 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r1, [r5, #0x0] mov r0, #0x0 add r1, r1, r4 @@ -346,7 +346,7 @@ _02014DF0: mov r0, #0x0 str r0, [r4, #0x10] add r0, r5, #0x0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0x0 str r0, [r4, #0x4] ldr r0, [r4, #0x8] diff --git a/arm9/asm/unk_02033B68.s b/arm9/asm/unk_02033B68.s index 68334683d..5c0423952 100644 --- a/arm9/asm/unk_02033B68.s +++ b/arm9/asm/unk_02033B68.s @@ -261,7 +261,7 @@ sub_02033CD4: ; 0x02033CD4 push {r4, lr} add r4, r0, #0x0 ldr r0, [r4, #0x18] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0x7 ldr r2, _02033D00 ; =0x40000200 lsl r0, r0, #0x18 diff --git a/arm9/asm/unk_02036FA4.s b/arm9/asm/unk_02036FA4.s index fa0e6ce33..3f7d121de 100644 --- a/arm9/asm/unk_02036FA4.s +++ b/arm9/asm/unk_02036FA4.s @@ -60,10 +60,10 @@ sub_02037000: ; 0x02037000 push {r3-r5, lr} add r5, r1, #0x0 bl PlayerAvatar_GetMapObject - bl sub_02058BE4 + bl MapObject_GetPositionVectorYCoordUInt add r4, r0, #0x0 add r0, r5, #0x0 - bl sub_02058BE4 + bl MapObject_GetPositionVectorYCoordUInt cmp r4, r0 bne _0203701C mov r0, #0x1 diff --git a/arm9/asm/unk_02037024.s b/arm9/asm/unk_02037024.s index 9aba10c86..19f57eb2e 100644 --- a/arm9/asm/unk_02037024.s +++ b/arm9/asm/unk_02037024.s @@ -56,7 +56,7 @@ _0203707E: ldr r0, [r5, #0x34] ldr r1, [sp, #0x4] ldr r2, [sp, #0x0] - bl sub_02058D74 + bl MapObjectManager_GetFirstObjectWithXAndZ str r0, [r6, #0x0] add sp, #0x8 pop {r4-r6, pc} @@ -71,7 +71,7 @@ sub_02037090: ; 0x02037090 ldr r0, [r4, #0x0] cmp r0, #0x0 beq _020370B8 - bl sub_020588D4 + bl MapObject_CheckFlag19Disabled cmp r0, #0x1 bne _020370B8 ldr r0, [r5, #0x38] diff --git a/arm9/asm/unk_0204B34C.s b/arm9/asm/unk_0204B34C.s index 8e49197a7..383177c8b 100644 --- a/arm9/asm/unk_0204B34C.s +++ b/arm9/asm/unk_0204B34C.s @@ -222,7 +222,7 @@ _0204B4B6: cmp r0, #0x1 bne _0204B4E8 ldr r0, [sp, #0x0] - bl sub_02058B7C + bl MapObject_GetPositionVector add r1, r0, #0x0 add r0, r5, #0x0 bl sub_0204B450 @@ -546,7 +546,7 @@ _0204B758: ldr r0, [r7, #0x34] add r1, r6, #0x0 add r2, r4, #0x0 - bl sub_02058D74 + bl MapObjectManager_GetFirstObjectWithXAndZ cmp r0, #0x0 beq _0204B76A mov r0, #0x1 @@ -579,7 +579,7 @@ _0204B794: ldr r0, [r5, #0x34] add r1, r4, #0x0 sub r2, r2, #0x1 - bl sub_02058D74 + bl MapObjectManager_GetFirstObjectWithXAndZ pop {r4-r6, pc} thumb_func_start sub_0204B7A0 @@ -609,7 +609,7 @@ _0204B7CC: ldr r0, [r5, #0x34] add r1, r7, #0x0 add r2, r4, #0x0 - bl sub_02058D74 + bl MapObjectManager_GetFirstObjectWithXAndZ pop {r3-r7, pc} thumb_func_start sub_0204B7D8 @@ -684,7 +684,7 @@ _0204B848: bl Field_PlayerAvatar_ApplyTransitionFlags ldr r0, [r5, #0x38] bl PlayerAvatar_GetMapObject - bl sub_02058914 + bl MapObject_UnpauseMovement mov r0, #0x1 str r0, [r4, #0x0] b _0204B98E @@ -824,7 +824,7 @@ _0204B972: bl sub_02055304 ldr r0, [r5, #0x38] bl PlayerAvatar_GetMapObject - bl sub_02058908 + bl MapObject_PauseMovement add r0, r4, #0x0 bl FreeToHeap mov r0, #0x1 diff --git a/arm9/asm/unk_0204CB20.s b/arm9/asm/unk_0204CB20.s index aec497b45..1f62ce053 100644 --- a/arm9/asm/unk_0204CB20.s +++ b/arm9/asm/unk_0204CB20.s @@ -316,7 +316,7 @@ _0204CD2C: ldr r0, _0204CD70 ; =UNK_021C5A68 ldr r0, [r0, #0x0] ldr r0, [r0, #0x50] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _0204CD70 ; =UNK_021C5A68 ldr r0, [r0, #0x0] ldr r0, [r0, #0x4] @@ -541,7 +541,7 @@ sub_0204CEF8: ; 0x0204CEF8 ldr r0, _0204CF20 ; =UNK_021C5A68 ldr r0, [r0, #0x0] ldr r0, [r0, #0x50] - bl sub_0200CAB4 + bl SysTask_Destroy _0204CF16: ldr r0, _0204CF20 ; =UNK_021C5A68 mov r1, #0x0 @@ -5029,7 +5029,7 @@ sub_0204F124: ; 0x0204F124 add r0, r5, #0x0 bl FreeToHeap add r0, r6, #0x0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3-r7, pc} _0204F14A: ldr r0, [r5, #0x0] @@ -5050,7 +5050,7 @@ _0204F156: add r0, r5, #0x0 bl FreeToHeap add r0, r6, #0x0 - bl sub_0200CAB4 + bl SysTask_Destroy _0204F172: pop {r3-r7, pc} .balign 4 @@ -5970,14 +5970,14 @@ _0204F89E: bl MapObject_SetCurrentX ldr r0, [sp, #0xc] add r1, r7, #0x0 - bl MapObject_SetCurrentY + bl MapObject_SetCurrentZ ldr r0, [sp, #0x4] ldr r1, [sp, #0x8] str r0, [sp, #0x0] ldr r0, [sp, #0xc] mov r2, #0x0 add r3, r7, #0x0 - bl sub_02058E28 + bl MapObject_SetPositionFromXYZAndDirection _0204F8F8: add r6, r6, #0x1 add r4, r4, #0x4 diff --git a/arm9/asm/unk_0204FBA8.s b/arm9/asm/unk_0204FBA8.s index 9edacfdb8..d2d2d6b1f 100644 --- a/arm9/asm/unk_0204FBA8.s +++ b/arm9/asm/unk_0204FBA8.s @@ -105,7 +105,7 @@ sub_0204FC10: ; 0x0204FC10 cmp r0, #0x0 beq _0204FC56 ldr r0, [r0, #0x38] - bl sub_0200CAB4 + bl SysTask_Destroy mov r4, #0x0 ldr r6, _0204FC58 ; =UNK_021C5A6C add r5, r4, #0x0 @@ -657,7 +657,7 @@ sub_0205006C: ; 0x0205006C ldr r2, [r1, #0x0] cmp r2, #0x0 bne _0205007C - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, pc} _0205007C: ldr r1, [r2, #0x34] diff --git a/arm9/asm/unk_020520AC.s b/arm9/asm/unk_020520AC.s index c6fe8361f..61d618d33 100644 --- a/arm9/asm/unk_020520AC.s +++ b/arm9/asm/unk_020520AC.s @@ -421,7 +421,7 @@ sub_02052308: ; 0x02052308 str r1, [sp, #0x0] cmp r1, #0x0 bne _02052316 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3-r7, pc} _02052316: mov r7, #0x11 @@ -621,7 +621,7 @@ sub_020524A0: ; 0x020524A0 add r4, r0, #0x0 beq _020524B8 ldr r0, [r4, #0xc] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0x0 bl FreeToHeap mov r0, #0x1f diff --git a/arm9/asm/unk_02052EE8.s b/arm9/asm/unk_02052EE8.s index af3a2fba9..0cce0c148 100644 --- a/arm9/asm/unk_02052EE8.s +++ b/arm9/asm/unk_02052EE8.s @@ -108,7 +108,7 @@ sub_02052FA4: ; 0x02052FA4 push {r4, lr} add r4, r0, #0x0 ldr r0, [r4, #0x4] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _02052FC4 ; =0x000004DC ldr r0, [r4, r0] bl sub_0205362C @@ -478,7 +478,7 @@ _02053272: bl sub_0205AE50 add r0, r5, #0x0 mov r1, #0x0 - bl sub_020588EC + bl MapObject_SetFlag19 ldrb r0, [r4, #0xc] cmp r0, #0x1 bne _020532A8 @@ -537,7 +537,7 @@ _020532DA: bl MapObject_SetVisible add r0, r5, #0x0 mov r1, #0x0 - bl sub_020588B8 + bl MapObject_ClearFlag18 b _0205330A _02053306: mov r0, #0x0 @@ -633,10 +633,10 @@ sub_0205339C: ; 0x0205339C bl MapObject_GetInitialX add r7, r0, #0x0 add r0, r4, #0x0 - bl MapObject_GetInitialHeight + bl MapObject_GetInitialY str r0, [sp, #0xc] add r0, r4, #0x0 - bl MapObject_GetInitialY + bl MapObject_GetInitialZ add r6, r0, #0x0 ldr r0, [sp, #0x4] cmp r7, r0 @@ -659,7 +659,7 @@ _020533CC: add r0, r4, #0x0 add r1, r7, #0x0 add r3, r6, #0x0 - bl sub_02058E28 + bl MapObject_SetPositionFromXYZAndDirection add r0, r4, #0x0 mov r1, #0x1 bl MapObject_SetFacingDirectionDirect @@ -671,7 +671,7 @@ _020533CC: bl MapObject_SetVisible add r0, r4, #0x0 mov r1, #0x1 - bl sub_020588B8 + bl MapObject_ClearFlag18 mov r1, #0x1 strb r1, [r5, #0x1] ldrb r0, [r5, #0x2] @@ -709,7 +709,7 @@ sub_02053444: ; 0x02053444 bl sub_0205ADDC add r0, r5, #0x0 mov r1, #0x1 - bl sub_020588EC + bl MapObject_SetFlag19 add r0, r5, #0x0 mov r1, #0x0 bl sub_02058E90 @@ -768,10 +768,10 @@ _020534BC: bl MapObject_SetVisible add r0, r4, #0x0 mov r1, #0x0 - bl sub_020588B8 + bl MapObject_ClearFlag18 add r0, r4, #0x0 mov r1, #0x1 - bl sub_020588EC + bl MapObject_SetFlag19 add r5, r5, #0x1 cmp r5, r6 blt _020534AC @@ -827,7 +827,7 @@ _02053524: bl MapObject_SetVisible add r0, r4, #0x0 mov r1, #0x1 - bl sub_020588B8 + bl MapObject_ClearFlag18 mov r0, #0x1 strb r0, [r5, #0x1] ldrb r0, [r5, #0x2] diff --git a/arm9/asm/unk_02053750.s b/arm9/asm/unk_02053750.s index f7226f6aa..d737c5b2f 100644 --- a/arm9/asm/unk_02053750.s +++ b/arm9/asm/unk_02053750.s @@ -96,7 +96,7 @@ _02053786: ldr r0, [r4, #0x0] ldr r0, [r0, #0x38] bl PlayerAvatar_GetMapObject - bl sub_02058914 + bl MapObject_UnpauseMovement ldr r0, [r4, #0x0] mov r1, #0x0 ldr r0, [r0, #0x38] diff --git a/arm9/asm/unk_02055068.s b/arm9/asm/unk_02055068.s index 33ed11e9f..36b7c4fdf 100644 --- a/arm9/asm/unk_02055068.s +++ b/arm9/asm/unk_02055068.s @@ -67,7 +67,7 @@ sub_020550A4: ; 0x020550A4 bl MapObject_ClearFlagsBits add r0, r4, #0x0 mov r1, #0x1 - bl sub_02058AC8 + bl MapObject_SetFlag29 add r0, r5, #0x0 add r1, r4, #0x0 bl sub_0205539C @@ -218,7 +218,7 @@ _02055228: bl MapObject_SetType add r0, r5, #0x0 mov r1, #0x0 - bl MapObject_SetFlagID + bl MapObject_SetEventFlag add r0, r5, #0x0 mov r1, #0x0 bl MapObject_SetScriptID @@ -252,7 +252,7 @@ _02055228: bl MapObject_ClearFlagsBits add r0, r5, #0x0 mov r1, #0x1 - bl sub_02058AC8 + bl MapObject_SetFlag29 add r0, r4, #0x0 add r1, r5, #0x0 bl sub_0205539C @@ -319,7 +319,7 @@ sub_02055304: ; 0x02055304 add r4, r1, #0x0 bl PlayerAvatar_GetMapObject add r1, r4, #0x0 - bl sub_020584AC + bl MapObject_SetFacingDirection pop {r4, pc} thumb_func_start sub_02055314 @@ -340,21 +340,21 @@ GetPlayerXCoord: ; 0x02055320 GetPlayerYCoord: ; 0x0205532C push {r3, lr} bl PlayerAvatar_GetMapObject - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ pop {r3, pc} thumb_func_start sub_02055338 sub_02055338: ; 0x02055338 push {r3, lr} bl PlayerAvatar_GetMapObject - bl sub_02058B14 + bl MapObject_GetPreviousX pop {r3, pc} thumb_func_start sub_02055344 sub_02055344: ; 0x02055344 push {r3, lr} bl PlayerAvatar_GetMapObject - bl sub_02058B24 + bl MapObject_GetPreviousZ pop {r3, pc} thumb_func_start sub_02055350 @@ -363,14 +363,14 @@ sub_02055350: ; 0x02055350 add r4, r1, #0x0 bl PlayerAvatar_GetMapObject add r1, r4, #0x0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector pop {r4, pc} thumb_func_start sub_02055360 sub_02055360: ; 0x02055360 push {r3, lr} bl sub_020553A4 - bl sub_02058B7C + bl MapObject_GetPositionVector pop {r3, pc} thumb_func_start sub_0205536C @@ -699,7 +699,7 @@ sub_020554EC: ; 0x020554EC bl PlayerAvatar_GetMapObject add r1, r4, #0x0 add r2, r6, #0x0 - bl sub_02058DBC + bl LocalMapObject_SetPositionFromVectorAndDirection add r0, r5, #0x0 mov r1, #0x0 bl sub_0205536C @@ -721,7 +721,7 @@ sub_02055514: ; 0x02055514 mov r2, #0x0 add r3, r7, #0x0 str r4, [sp, #0x0] - bl sub_02058E28 + bl MapObject_SetPositionFromXYZAndDirection add r0, r5, #0x0 mov r1, #0x0 bl sub_0205536C @@ -738,11 +738,11 @@ sub_02055540: ; 0x02055540 bl PlayerAvatar_GetMapObject add r4, r0, #0x0 add r1, sp, #0x0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r4, #0x0 add r1, sp, #0x0 str r5, [sp, #0x4] - bl MapObject_SetPositionVec + bl MapObject_SetPositionVector add sp, #0xc pop {r4-r5, pc} @@ -754,11 +754,11 @@ PlayerAvatar_ToggleAutomaticHeightUpdating: ; 0x02055560 cmp r4, #0x1 bne _02055574 mov r1, #0x0 - bl sub_02058960 + bl MapObject_SetIgnoreHeights pop {r4, pc} _02055574: mov r1, #0x1 - bl sub_02058960 + bl MapObject_SetIgnoreHeights pop {r4, pc} thumb_func_start sub_0205557C @@ -770,13 +770,13 @@ sub_0205557C: ; 0x0205557C cmp r5, #0x1 bne _02055598 mov r1, #0x0 - bl sub_02058960 + bl MapObject_SetIgnoreHeights add r0, r4, #0x0 bl sub_02059D1C pop {r3-r5, pc} _02055598: mov r1, #0x1 - bl sub_02058960 + bl MapObject_SetIgnoreHeights pop {r3-r5, pc} thumb_func_start PlayerAvatar_GetSpriteByStateAndGender diff --git a/arm9/asm/unk_020557F4.s b/arm9/asm/unk_020557F4.s index b51ea9c63..4d110d6d3 100644 --- a/arm9/asm/unk_020557F4.s +++ b/arm9/asm/unk_020557F4.s @@ -122,7 +122,7 @@ _020558B8: pop {r4-r6, pc} _020558C4: add r0, r6, #0x0 - bl sub_020586F0 + bl MapObject_GetMovementCommand bl sub_020570F0 cmp r0, #0x1 bne _020558FA @@ -194,7 +194,7 @@ sub_02055928: ; 0x02055928 add r0, r4, #0x0 bl PlayerAvatar_GetMapObject mov r1, #0x0 - bl sub_02058A18 + bl MapObject_SetFlag27 _02055964: pop {r4, pc} .balign 4 @@ -213,7 +213,7 @@ sub_02055968: ; 0x02055968 lsl r0, r0, #0x18 lsr r5, r0, #0x18 add r0, r4, #0x0 - bl sub_020586F0 + bl MapObject_GetMovementCommand bl sub_0205B020 add r1, r0, #0x0 mov r0, #0x0 @@ -264,7 +264,7 @@ _020559D8: bl PlaySE _020559F8: add r0, r4, #0x0 - bl sub_020586F0 + bl MapObject_GetMovementCommand bl sub_020570F0 cmp r0, #0x0 bne _02055A20 @@ -329,7 +329,7 @@ _02055A76: pop {r3-r7, pc} _02055A8E: add r0, r7, #0x0 - bl sub_020586F0 + bl MapObject_GetMovementCommand bl sub_020570F0 cmp r0, #0x1 beq _02055B10 @@ -447,7 +447,7 @@ _02055B60: pop {r3-r5, pc} _02055B74: add r0, r4, #0x0 - bl sub_020586F0 + bl MapObject_GetMovementCommand bl sub_020570F0 cmp r0, #0x1 bne _02055B86 @@ -472,7 +472,7 @@ sub_02055B8C: ; 0x02055B8C bl PlayerAvatar_GetMapObject add r4, r0, #0x0 add r1, r5, #0x0 - bl sub_020584AC + bl MapObject_SetFacingDirection add r0, r4, #0x0 mov r1, #0x0 bl sub_02058544 @@ -1013,7 +1013,7 @@ sub_02056040: ; 0x02056040 add r6, r0, #0x0 add r0, r4, #0x0 add r1, sp, #0xc - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r4, sp, #0xc add r3, sp, #0x0 ldmia r4!, {r0-r1} @@ -2521,17 +2521,17 @@ sub_02056C0C: ; 0x02056C0C bl sub_02059BF4 str r0, [sp, #0x14] add r0, r5, #0x0 - bl MapObject_GetCurrentHeight + bl MapObject_GetCurrentY str r0, [sp, #0x8] add r0, r5, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ str r0, [sp, #0xc] ldr r0, [sp, #0x4] bl sub_02059C00 str r0, [sp, #0x10] add r0, r5, #0x0 add r1, sp, #0x1c - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector ldr r1, [sp, #0x14] ldr r6, [sp, #0xc] ldr r3, [sp, #0x10] @@ -2619,7 +2619,7 @@ sub_02056CCC: ; 0x02056CCC bl sub_02059BF4 add r7, r0, #0x0 add r0, r5, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r5, r0, #0x0 add r0, r4, #0x0 bl sub_02059C00 @@ -2685,7 +2685,7 @@ sub_02056D58: ; 0x02056D58 bl MapObject_GetCurrentX add r6, r0, #0x0 add r0, r5, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ str r0, [sp, #0x0] ldr r2, [sp, #0x0] add r0, r7, #0x0 @@ -2772,7 +2772,7 @@ sub_02056E04: ; 0x02056E04 bl sub_02059BF4 add r7, r0, #0x0 add r0, r4, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r4, r0, #0x0 add r0, r5, #0x0 bl sub_02059C00 @@ -2822,7 +2822,7 @@ sub_02056E6C: ; 0x02056E6C bl sub_02059BF4 add r7, r0, #0x0 add r0, r5, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ str r0, [sp, #0x4] add r0, r4, #0x0 bl sub_02059C00 @@ -2866,7 +2866,7 @@ sub_02056EC8: ; 0x02056EC8 bl sub_02059BF4 add r7, r0, #0x0 add r0, r5, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ str r0, [sp, #0x8] add r0, r4, #0x0 bl sub_02059C00 @@ -2954,7 +2954,7 @@ sub_02056F78: ; 0x02056F78 bl sub_02059BF4 add r7, r0, #0x0 add r0, r5, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ str r0, [sp, #0x4] add r0, r4, #0x0 bl sub_02059C00 @@ -3123,7 +3123,7 @@ sub_020570C4: ; 0x020570C4 pop {r4, pc} _020570D8: add r0, r4, #0x0 - bl sub_020586F0 + bl MapObject_GetMovementCommand bl sub_020570F0 cmp r0, #0x1 bne _020570EA diff --git a/arm9/asm/unk_02058EE8.s b/arm9/asm/unk_02058EE8.s index ae3c02aa5..6226e0f5e 100644 --- a/arm9/asm/unk_02058EE8.s +++ b/arm9/asm/unk_02058EE8.s @@ -1212,7 +1212,7 @@ sub_02058EF8: ; 0x02058EF8 bl sub_02058FD0 add r0, r4, #0x0 mov r1, #0x10 - bl MapObject_GetFlagsBits + bl MapObject_GetFlagsBitsMask cmp r0, #0x0 beq _02058F2C add r0, r4, #0x0 @@ -1220,7 +1220,7 @@ sub_02058EF8: ; 0x02058EF8 b _02058F50 _02058F2C: add r0, r4, #0x0 - bl sub_02058920 + bl MapObject_CheckMovementPaused cmp r0, #0x0 bne _02058F50 add r0, r4, #0x0 @@ -1246,7 +1246,7 @@ _02058F5C: sub_02058F60: ; 0x02058F60 push {r4, lr} add r4, r0, #0x0 - bl sub_02058854 + bl MapObject_CheckSingleMovement cmp r0, #0x1 bne _02058F70 mov r0, #0x1 @@ -1255,7 +1255,7 @@ _02058F70: mov r1, #0x6 add r0, r4, #0x0 lsl r1, r1, #0xa - bl MapObject_GetFlagsBits + bl MapObject_GetFlagsBitsMask cmp r0, #0x0 bne _02058F82 mov r0, #0x1 @@ -1277,7 +1277,7 @@ sub_02058F94: ; 0x02058F94 mov r1, #0x1 lsl r1, r1, #0xc add r4, r0, #0x0 - bl MapObject_GetFlagsBits + bl MapObject_GetFlagsBitsMask cmp r0, #0x0 beq _02058FAA add r0, r4, #0x0 @@ -1291,7 +1291,7 @@ sub_02058FAC: ; 0x02058FAC mov r1, #0x2 lsl r1, r1, #0xa add r4, r0, #0x0 - bl MapObject_GetFlagsBits + bl MapObject_GetFlagsBitsMask cmp r0, #0x0 beq _02058FCC add r0, r4, #0x0 @@ -1299,7 +1299,7 @@ sub_02058FAC: ; 0x02058FAC cmp r0, #0x1 bne _02058FCC add r0, r4, #0x0 - bl sub_02058860 + bl MapObject_SetFlag2 _02058FCC: pop {r4, pc} .balign 4 @@ -1309,7 +1309,7 @@ sub_02058FD0: ; 0x02058FD0 push {r4, lr} mov r1, #0x4 add r4, r0, #0x0 - bl MapObject_GetFlagsBits + bl MapObject_GetFlagsBitsMask cmp r0, #0x0 beq _02058FE4 add r0, r4, #0x0 @@ -1328,7 +1328,7 @@ sub_02058FF4: ; 0x02058FF4 mov r1, #0x1 lsl r1, r1, #0x10 add r4, r0, #0x0 - bl MapObject_GetFlagsBits + bl MapObject_GetFlagsBitsMask cmp r0, #0x0 beq _0205900C add r0, r4, #0x0 @@ -1337,7 +1337,7 @@ sub_02058FF4: ; 0x02058FF4 _0205900C: add r0, r4, #0x0 mov r1, #0x4 - bl MapObject_GetFlagsBits + bl MapObject_GetFlagsBitsMask cmp r0, #0x0 beq _0205901E add r0, r4, #0x0 @@ -1356,7 +1356,7 @@ sub_0205902C: ; 0x0205902C mov r1, #0x2 lsl r1, r1, #0x10 add r4, r0, #0x0 - bl MapObject_GetFlagsBits + bl MapObject_GetFlagsBitsMask cmp r0, #0x0 beq _02059044 add r0, r4, #0x0 @@ -1365,7 +1365,7 @@ sub_0205902C: ; 0x0205902C _02059044: add r0, r4, #0x0 mov r1, #0x8 - bl MapObject_GetFlagsBits + bl MapObject_GetFlagsBitsMask cmp r0, #0x0 beq _02059056 add r0, r4, #0x0 @@ -1689,7 +1689,7 @@ sub_0205931C: ; 0x0205931C sub sp, #0x48 add r4, r0, #0x0 add r5, r1, #0x0 - bl sub_02058A34 + bl MapObject_CheckFlag27 cmp r0, #0x0 bne _020593F4 add r0, r5, #0x0 @@ -1897,7 +1897,7 @@ sub_020594C0: ; 0x020594C0 cmp r0, #0x1 bne _020594EA add r0, r4, #0x0 - bl sub_02058A00 + bl MapObject_CheckFlag26 cmp r0, #0x0 bne _020594F2 add r0, r4, #0x0 @@ -1905,22 +1905,22 @@ sub_020594C0: ; 0x020594C0 bl ov06_0224B9E0 add r0, r4, #0x0 mov r1, #0x1 - bl sub_020589E4 + bl MapObject_SetFlag26 pop {r4, pc} _020594EA: add r0, r4, #0x0 mov r1, #0x0 - bl sub_020589E4 + bl MapObject_SetFlag26 _020594F2: pop {r4, pc} thumb_func_start sub_020594F4 sub_020594F4: ; 0x020594F4 - ldr r3, _020594FC ; =sub_020589E4 + ldr r3, _020594FC ; =MapObject_SetFlag26 mov r1, #0x0 bx r3 nop -_020594FC: .word sub_020589E4 +_020594FC: .word MapObject_SetFlag26 thumb_func_start sub_02059500 sub_02059500: ; 0x02059500 @@ -1986,7 +1986,7 @@ _02059584: mov r1, #0x2 add r0, r5, #0x0 lsl r1, r1, #0xe - bl MapObject_GetFlagsBits + bl MapObject_GetFlagsBitsMask cmp r0, #0x0 bne _020595A2 add r0, r5, #0x0 @@ -2160,13 +2160,13 @@ sub_020596D8: ; 0x020596D8 cmp r0, #0x1 bne _02059708 add r0, r5, #0x0 - bl sub_02058B14 + bl MapObject_GetPreviousX add r4, r0, #0x0 add r0, r5, #0x0 - bl sub_02058B1C + bl MapObject_GetPreviousY add r6, r0, #0x0 add r0, r5, #0x0 - bl sub_02058B24 + bl MapObject_GetPreviousZ add r3, r0, #0x0 add r0, r5, #0x0 add r1, r4, #0x0 @@ -2188,10 +2188,10 @@ sub_0205970C: ; 0x0205970C bl MapObject_GetCurrentX add r4, r0, #0x0 add r0, r5, #0x0 - bl MapObject_GetCurrentHeight + bl MapObject_GetCurrentY add r6, r0, #0x0 add r0, r5, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r3, r0, #0x0 add r0, r5, #0x0 add r1, r4, #0x0 @@ -2210,13 +2210,13 @@ sub_02059740: ; 0x02059740 cmp r0, #0x1 bne _02059770 add r0, r5, #0x0 - bl sub_02058B14 + bl MapObject_GetPreviousX add r4, r0, #0x0 add r0, r5, #0x0 - bl sub_02058B1C + bl MapObject_GetPreviousY add r6, r0, #0x0 add r0, r5, #0x0 - bl sub_02058B24 + bl MapObject_GetPreviousZ add r3, r0, #0x0 add r0, r5, #0x0 add r1, r4, #0x0 @@ -2238,10 +2238,10 @@ sub_02059774: ; 0x02059774 bl MapObject_GetCurrentX add r4, r0, #0x0 add r0, r5, #0x0 - bl MapObject_GetCurrentHeight + bl MapObject_GetCurrentY add r6, r0, #0x0 add r0, r5, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r3, r0, #0x0 add r0, r5, #0x0 add r1, r4, #0x0 @@ -2265,7 +2265,7 @@ sub_020597A8: ; 0x020597A8 lsl r0, r0, #0x18 lsr r4, r0, #0x18 add r0, r5, #0x0 - bl sub_02058A9C + bl MapObject_CheckFlag24 cmp r0, #0x0 bne _02059802 add r0, r4, #0x0 @@ -2279,7 +2279,7 @@ sub_020597A8: ; 0x020597A8 _020597DE: add r0, r5, #0x0 mov r1, #0x1 - bl sub_02058A80 + bl MapObject_SetFlag24 add r0, r4, #0x0 bl sub_02054AF0 cmp r0, #0x1 @@ -2303,7 +2303,7 @@ sub_02059804: ; 0x02059804 lsl r1, r1, #0x14 lsr r1, r1, #0x1e beq _02059834 - bl sub_02058A9C + bl MapObject_CheckFlag24 cmp r0, #0x0 beq _02059834 add r0, r4, #0x0 @@ -2316,7 +2316,7 @@ sub_02059804: ; 0x02059804 bne _02059834 add r0, r4, #0x0 mov r1, #0x0 - bl sub_02058A80 + bl MapObject_SetFlag24 _02059834: pop {r4, pc} .balign 4 @@ -2332,11 +2332,11 @@ sub_02059838: ; 0x02059838 bne _02059852 add r0, r5, #0x0 mov r1, #0x1 - bl sub_02058A4C + bl MapObject_SetFlag28 pop {r3-r5, pc} _02059852: add r0, r5, #0x0 - bl sub_02058A68 + bl MapObject_CheckFlag28 cmp r0, #0x1 bne _0205986E add r0, r4, #0x0 @@ -2345,7 +2345,7 @@ _02059852: bne _0205986E add r0, r5, #0x0 mov r1, #0x0 - bl sub_02058A4C + bl MapObject_SetFlag28 _0205986E: pop {r3-r5, pc} @@ -2427,7 +2427,7 @@ sub_020598F0: ; 0x020598F0 add r5, r0, #0x0 add r7, r2, #0x0 add r4, r3, #0x0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector ldr r0, [sp, #0x28] str r4, [sp, #0x0] str r0, [sp, #0x4] @@ -2451,10 +2451,10 @@ sub_02059918: ; 0x02059918 bl sub_02059BF4 add r7, r0, #0x0 add r0, r5, #0x0 - bl MapObject_GetCurrentHeight + bl MapObject_GetCurrentY str r0, [sp, #0x4] add r0, r5, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ str r0, [sp, #0x8] add r0, r4, #0x0 bl sub_02059C00 @@ -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 @@ -2491,26 +2491,26 @@ _0205997C: cmp r0, r1 beq _020599F4 mov r1, #0x1 - bl MapObject_GetFlagsBits + bl MapObject_GetFlagsBitsMask cmp r0, #0x0 beq _020599F4 mov r1, #0x1 ldr r0, [sp, #0x8] lsl r1, r1, #0x12 - bl MapObject_GetFlagsBits + bl MapObject_GetFlagsBitsMask cmp r0, #0x0 bne _020599F4 ldr r0, [sp, #0x8] bl MapObject_GetCurrentX add r7, r0, #0x0 ldr r0, [sp, #0x8] - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ cmp r7, r5 bne _020599C8 cmp r0, r6 bne _020599C8 ldr r0, [sp, #0x8] - bl MapObject_GetCurrentHeight + bl MapObject_GetCurrentY sub r0, r0, r4 bpl _020599BE neg r0, r0 @@ -2522,16 +2522,16 @@ _020599BE: pop {r4-r7, pc} _020599C8: ldr r0, [sp, #0x8] - bl sub_02058B14 + bl MapObject_GetPreviousX add r7, r0, #0x0 ldr r0, [sp, #0x8] - bl sub_02058B24 + bl MapObject_GetPreviousZ cmp r7, r5 bne _020599F4 cmp r0, r6 bne _020599F4 ldr r0, [sp, #0x8] - bl MapObject_GetCurrentHeight + bl MapObject_GetCurrentY sub r0, r0, r4 bpl _020599EA neg r0, r0 @@ -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] @@ -2577,7 +2577,7 @@ _02059A30: pop {r3-r7, pc} _02059A34: add r0, r6, #0x0 - bl MapObject_GetInitialY + bl MapObject_GetInitialZ add r5, r0, #0x0 add r0, r6, #0x0 bl MapObject_GetYRange @@ -2661,7 +2661,7 @@ sub_02059AC4: ; 0x02059AC4 cmp r0, #0x0 beq _02059AE4 add r0, r5, #0x0 - bl sub_02058A68 + bl MapObject_CheckFlag28 cmp r0, #0x0 bne _02059AF4 mov r0, #0x1 @@ -2689,7 +2689,7 @@ sub_02059AF8: ; 0x02059AF8 cmp r0, #0x0 beq _02059B18 add r0, r5, #0x0 - bl sub_02058A68 + bl MapObject_CheckFlag28 cmp r0, #0x0 bne _02059B28 mov r0, #0x1 @@ -2717,7 +2717,7 @@ sub_02059B2C: ; 0x02059B2C cmp r0, #0x0 beq _02059B4C add r0, r5, #0x0 - bl sub_02058A68 + bl MapObject_CheckFlag28 cmp r0, #0x0 bne _02059B5C mov r0, #0x1 @@ -2745,7 +2745,7 @@ sub_02059B60: ; 0x02059B60 cmp r0, #0x0 beq _02059B80 add r0, r5, #0x0 - bl sub_02058A68 + bl MapObject_CheckFlag28 cmp r0, #0x0 bne _02059B90 mov r0, #0x1 @@ -2766,7 +2766,7 @@ _02059B90: sub_02059B94: ; 0x02059B94 push {r4, lr} add r4, r1, #0x0 - bl sub_02058A68 + bl MapObject_CheckFlag28 cmp r0, #0x1 bne _02059BB0 lsl r0, r4, #0x18 @@ -2784,7 +2784,7 @@ _02059BB0: sub_02059BB4: ; 0x02059BB4 push {r4, lr} add r4, r1, #0x0 - bl sub_02058A68 + bl MapObject_CheckFlag28 cmp r0, #0x1 bne _02059BD0 lsl r0, r4, #0x18 @@ -2802,7 +2802,7 @@ _02059BD0: sub_02059BD4: ; 0x02059BD4 push {r4, lr} add r4, r1, #0x0 - bl sub_02058A68 + bl MapObject_CheckFlag28 cmp r0, #0x1 bne _02059BF0 lsl r0, r4, #0x18 @@ -2844,28 +2844,28 @@ sub_02059C0C: ; 0x02059C0C add r0, r5, #0x0 bl MapObject_SetPreviousX add r0, r5, #0x0 - bl MapObject_GetCurrentHeight + bl MapObject_GetCurrentY add r1, r0, #0x0 add r0, r5, #0x0 - bl MapObject_SetPreviousHeight + bl MapObject_SetPreviousY add r0, r5, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r1, r0, #0x0 add r0, r5, #0x0 - bl MapObject_SetPreviousY + bl MapObject_SetPreviousZ add r0, r4, #0x0 bl sub_02059BF4 add r1, r0, #0x0 add r0, r5, #0x0 - bl sub_02058B34 + bl MapObject_AddCurrentX add r0, r5, #0x0 mov r1, #0x0 - bl sub_02058B44 + bl MapObject_AddCurrentY add r0, r4, #0x0 bl sub_02059C00 add r1, r0, #0x0 add r0, r5, #0x0 - bl sub_02058B54 + bl MapObject_AddCurrentZ pop {r3-r5, pc} thumb_func_start sub_02059C60 @@ -2877,15 +2877,15 @@ sub_02059C60: ; 0x02059C60 add r0, r4, #0x0 bl MapObject_SetPreviousX add r0, r4, #0x0 - bl MapObject_GetCurrentHeight + bl MapObject_GetCurrentY add r1, r0, #0x0 add r0, r4, #0x0 - bl MapObject_SetPreviousHeight + bl MapObject_SetPreviousY add r0, r4, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r1, r0, #0x0 add r0, r4, #0x0 - bl MapObject_SetPreviousY + bl MapObject_SetPreviousZ pop {r4, pc} .balign 4 @@ -2900,7 +2900,7 @@ sub_02059C90: ; 0x02059C90 bl sub_02059BF4 add r7, r0, #0x0 add r0, r4, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ str r0, [sp, #0x0] add r0, r5, #0x0 bl sub_02059C00 @@ -2922,7 +2922,7 @@ sub_02059CC8: ; 0x02059CC8 add r1, sp, #0x0 add r6, r0, #0x0 add r4, r2, #0x0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector cmp r5, #0x3 bhi _02059D0E add r0, r5, r5 @@ -2958,7 +2958,7 @@ _02059D08: _02059D0E: add r0, r6, #0x0 add r1, sp, #0x0 - bl MapObject_SetPositionVec + bl MapObject_SetPositionVector add sp, #0xc pop {r3-r6, pc} .balign 4 @@ -2969,7 +2969,7 @@ sub_02059D1C: ; 0x02059D1C sub sp, #0x18 add r1, sp, #0xc add r5, r0, #0x0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r3, sp, #0xc ldmia r3!, {r0-r1} add r2, sp, #0x0 @@ -2977,7 +2977,7 @@ sub_02059D1C: ; 0x02059D1C ldr r0, [r3, #0x0] str r0, [r2, #0x0] add r0, r5, #0x0 - bl sub_0205897C + bl MapObject_CheckIgnoreHeights cmp r0, #0x1 bne _02059D4E mov r1, #0x1 @@ -3003,12 +3003,12 @@ _02059D4E: add r1, sp, #0xc str r0, [sp, #0x10] add r0, r5, #0x0 - bl MapObject_SetPositionVec + bl MapObject_SetPositionVector add r0, r5, #0x0 - bl MapObject_GetCurrentHeight + bl MapObject_GetCurrentY add r1, r0, #0x0 add r0, r5, #0x0 - bl MapObject_SetPreviousHeight + bl MapObject_SetPreviousY ldr r1, [sp, #0x10] add r0, r5, #0x0 asr r2, r1, #0x3 @@ -3016,7 +3016,7 @@ _02059D4E: lsr r1, r1, #0x14 add r1, r2, r1 asr r1, r1, #0xc - bl MapObject_SetCurrentHeight + bl MapObject_SetCurrentY mov r1, #0x1 add r0, r5, #0x0 lsl r1, r1, #0xc @@ -3037,10 +3037,10 @@ _02059DAC: sub_02059DB4: ; 0x02059DB4 push {r3-r7, lr} add r5, r0, #0x0 - bl sub_02058B14 + bl MapObject_GetPreviousX add r4, r0, #0x0 add r0, r5, #0x0 - bl sub_02058B24 + bl MapObject_GetPreviousZ add r6, r0, #0x0 add r0, r5, #0x0 bl MapObject_GetFieldSystem @@ -3055,7 +3055,7 @@ sub_02059DB4: ; 0x02059DB4 bl MapObject_GetCurrentX add r4, r0, #0x0 add r0, r5, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r2, r0, #0x0 add r0, r7, #0x0 add r1, r4, #0x0 diff --git a/arm9/asm/unk_02059F04.s b/arm9/asm/unk_02059F04.s index 6b062ad5c..674b2befc 100644 --- a/arm9/asm/unk_02059F04.s +++ b/arm9/asm/unk_02059F04.s @@ -34,7 +34,7 @@ sub_02059F04: ; 0x02059F04 str r6, [r4, #0x4] bl sub_02058544 add r0, r5, #0x0 - bl sub_02058848 + bl MapObject_ClearSingleMovement pop {r4-r6, pc} .balign 4 _02059F30: .word UNK_020F693C @@ -144,7 +144,7 @@ sub_02059FB8: ; 0x02059FB8 cmp r1, r2 beq _02059FE0 add r0, r5, #0x0 - bl sub_020584AC + bl MapObject_SetFacingDirection b _0205A010 _02059FE0: ldrh r0, [r4, #0x0] @@ -167,7 +167,7 @@ _02059FE0: bl sub_0205AAD4 add r1, r0, #0x0 add r0, r5, #0x0 - bl sub_020584AC + bl MapObject_SetFacingDirection _0205A010: add r0, r5, #0x0 bl sub_02059C60 @@ -226,7 +226,7 @@ sub_0205A050: ; 0x0205A050 mov r1, #0x0 bl sub_02058544 add r0, r5, #0x0 - bl sub_02058848 + bl MapObject_ClearSingleMovement pop {r3-r7, pc} .balign 4 @@ -254,9 +254,9 @@ _0205A096: ; jump table (using 16-bit offset) .short _0205A15A - _0205A096 - 2; case 4 _0205A0A0: add r0, r5, #0x0 - bl sub_02058848 + bl MapObject_ClearSingleMovement add r0, r5, #0x0 - bl sub_0205886C + bl MapObject_ClearFlag3 add r0, r5, #0x0 bl MapObject_GetFacingDirection mov r1, #0x0 @@ -303,7 +303,7 @@ _0205A0FE: add r6, r0, #0x0 add r0, r5, #0x0 add r1, r6, #0x0 - bl sub_020584D8 + bl MapObject_SetOrQueueFacing ldr r0, [r4, #0x4] cmp r0, #0x1 bne _0205A12A @@ -332,7 +332,7 @@ _0205A13C: add r0, r5, #0x0 bl sub_0205AE0C add r0, r5, #0x0 - bl sub_0205883C + bl MapObject_SetSingleMovement mov r0, #0x0 ldrsh r0, [r4, r0] add r0, r0, #0x1 @@ -343,7 +343,7 @@ _0205A15A: cmp r0, #0x0 beq _0205A16E add r0, r5, #0x0 - bl sub_02058848 + bl MapObject_ClearSingleMovement mov r0, #0x0 strh r0, [r4, #0x0] _0205A16E: @@ -360,7 +360,7 @@ sub_0205A174: ; 0x0205A174 bl MapObject_GetInitialX add r6, r0, #0x0 ldr r0, [sp, #0x0] - bl MapObject_GetInitialY + bl MapObject_GetInitialZ add r5, r0, #0x0 ldr r0, [sp, #0x0] bl MapObject_GetXRange @@ -499,7 +499,7 @@ sub_0205A270: ; 0x0205A270 bl sub_02059BF4 add r4, r4, r0 add r0, r5, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r5, r0, #0x0 add r0, r6, #0x0 bl sub_02059C00 @@ -542,7 +542,7 @@ sub_0205A2C8: ; 0x0205A2C8 mov r1, #0x0 bl sub_02058544 add r0, r5, #0x0 - bl sub_02058848 + bl MapObject_ClearSingleMovement add r0, r5, #0x0 bl sub_02059C60 pop {r3-r5, pc} @@ -561,7 +561,7 @@ sub_0205A2EC: ; 0x0205A2EC _0205A300: ldr r1, [r4, #0x0] add r0, r5, #0x0 - bl sub_020584AC + bl MapObject_SetFacingDirection ldr r0, [r4, #0x4] add r0, r0, #0x1 str r0, [r4, #0x4] @@ -611,7 +611,7 @@ sub_0205A340: ; 0x0205A340 mov r1, #0x0 bl sub_02058544 add r0, r5, #0x0 - bl sub_02058848 + bl MapObject_ClearSingleMovement add r0, r5, #0x0 bl sub_02059C60 pop {r3-r5, pc} @@ -799,7 +799,7 @@ _0205A4A6: lsl r1, r4, #0x2 ldr r1, [r5, r1] add r0, r7, #0x0 - bl sub_020584AC + bl MapObject_SetFacingDirection mov r0, #0x0 strb r0, [r6, #0x2] mov r0, #0x1 @@ -956,7 +956,7 @@ _0205A5C2: lsl r1, r4, #0x2 ldr r1, [r5, r1] add r0, r7, #0x0 - bl sub_020584AC + bl MapObject_SetFacingDirection add r0, r7, #0x0 bl MapObject_GetFacingDirection add r4, r0, #0x0 @@ -1039,7 +1039,7 @@ _0205A65A: bne _0205A674 add r0, r5, #0x0 add r1, r6, #0x0 - bl sub_020584AC + bl MapObject_SetFacingDirection _0205A674: mov r0, #0x1 strh r0, [r4, #0x0] @@ -1058,13 +1058,13 @@ sub_0205A67C: ; 0x0205A67C bl MapObject_GetInitialX add r6, r0, #0x0 add r0, r5, #0x0 - bl MapObject_GetInitialY + bl MapObject_GetInitialZ add r7, r0, #0x0 add r0, r5, #0x0 bl MapObject_GetCurrentX str r0, [sp, #0x0] add r0, r5, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ ldr r1, [sp, #0x0] cmp r6, r1 bne _0205A6DA @@ -1083,7 +1083,7 @@ sub_0205A67C: ; 0x0205A67C bne _0205A6D6 add r0, r5, #0x0 add r1, r6, #0x0 - bl sub_020584AC + bl MapObject_SetFacingDirection _0205A6D6: mov r0, #0x0 strh r0, [r4, #0x2] @@ -1125,7 +1125,7 @@ _0205A70C: bl sub_0205AD0C _0205A72C: add r0, r5, #0x0 - bl sub_0205883C + bl MapObject_SetSingleMovement mov r0, #0x2 strh r0, [r4, #0x0] mov r0, #0x1 @@ -1141,7 +1141,7 @@ sub_0205A73C: ; 0x0205A73C cmp r0, #0x1 bne _0205A766 add r0, r5, #0x0 - bl sub_02058848 + bl MapObject_ClearSingleMovement add r0, r5, #0x0 bl sub_0205ACE0 cmp r0, #0x1 @@ -1470,10 +1470,10 @@ sub_0205A940: ; 0x0205A940 strh r0, [r4, #0x2] b _0205A98C _0205A974: - bl MapObject_GetInitialY + bl MapObject_GetInitialZ add r6, r0, #0x0 add r0, r5, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ cmp r6, r0 bne _0205A98C mov r0, #0x2 @@ -1489,13 +1489,13 @@ _0205A98C: bl MapObject_GetInitialX add r6, r0, #0x0 add r0, r5, #0x0 - bl MapObject_GetInitialY + bl MapObject_GetInitialZ add r7, r0, #0x0 add r0, r5, #0x0 bl MapObject_GetCurrentX str r0, [sp, #0x0] add r0, r5, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ ldr r1, [sp, #0x0] cmp r6, r1 bne _0205A9C0 @@ -1520,7 +1520,7 @@ _0205A9C0: bne _0205A9EA add r0, r5, #0x0 add r1, r6, #0x0 - bl sub_020584AC + bl MapObject_SetFacingDirection _0205A9EA: add r0, r5, #0x0 add r1, r6, #0x0 @@ -1544,7 +1544,7 @@ _0205A9EA: bne _0205AA20 add r0, r5, #0x0 add r1, r6, #0x0 - bl sub_020584AC + bl MapObject_SetFacingDirection _0205AA20: add r0, r5, #0x0 add r1, r6, #0x0 @@ -1570,7 +1570,7 @@ _0205AA30: bl sub_0205AD0C _0205AA52: add r0, r5, #0x0 - bl sub_0205883C + bl MapObject_SetSingleMovement mov r0, #0x1 strh r0, [r4, #0x0] pop {r3-r7, pc} @@ -1585,7 +1585,7 @@ sub_0205AA60: ; 0x0205AA60 cmp r0, #0x1 bne _0205AA8C add r0, r5, #0x0 - bl sub_02058848 + bl MapObject_ClearSingleMovement add r0, r5, #0x0 bl sub_0205ACE0 cmp r0, #0x1 @@ -1725,10 +1725,10 @@ _0205AB68: _0205AB72: add r0, r6, #0x0 bl PlayerAvatar_GetMapObject - bl sub_02058BE4 + bl MapObject_GetPositionVectorYCoordUInt add r4, r0, #0x0 add r0, r5, #0x0 - bl sub_02058BE4 + bl MapObject_GetPositionVectorYCoordUInt cmp r4, r0 beq _0205AB8E mov r0, #0x0 @@ -1749,7 +1749,7 @@ _0205AB8E: bl MapObject_GetCurrentX add r6, r0, #0x0 add r0, r5, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r3, r0, #0x0 ldr r0, [sp, #0x0] ldr r5, [sp, #0x0] @@ -1820,7 +1820,7 @@ _0205AC22: bl MapObject_GetCurrentX str r0, [sp, #0x8] ldr r0, [sp, #0x0] - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ str r0, [sp, #0x4] ldr r0, [sp, #0x0] bl MapObject_GetFieldSystem @@ -1984,7 +1984,7 @@ _0205AD3E: ldr r4, [r1, r0] add r0, r7, #0x0 mov r1, #0x80 - bl MapObject_GetFlagsBits + bl MapObject_GetFlagsBitsMask cmp r0, #0x0 beq _0205AD6C mov r0, #0x1 @@ -1995,7 +1995,7 @@ _0205AD6E: strb r0, [r5, #0x2] add r0, r7, #0x0 add r1, r4, #0x0 - bl sub_020584AC + bl MapObject_SetFacingDirection add r0, r7, #0x0 mov r1, #0x80 bl MapObject_SetFlagsBits diff --git a/arm9/asm/unk_0205AD98.s b/arm9/asm/unk_0205AD98.s index 275cea08a..21f098ac0 100644 --- a/arm9/asm/unk_0205AD98.s +++ b/arm9/asm/unk_0205AD98.s @@ -58,10 +58,10 @@ sub_0205ADDC: ; 0x0205ADDC _0205ADEA: add r0, r5, #0x0 add r1, r4, #0x0 - bl sub_020586E8 + bl MapObject_SetMovementCommand add r0, r5, #0x0 mov r1, #0x0 - bl sub_020586F8 + bl MapObject_SetMovementStep add r0, r5, #0x0 mov r1, #0x10 bl MapObject_SetFlagsBits @@ -74,10 +74,10 @@ _0205ADEA: sub_0205AE0C: ; 0x0205AE0C push {r4, lr} add r4, r0, #0x0 - bl sub_020586E8 + bl MapObject_SetMovementCommand add r0, r4, #0x0 mov r1, #0x0 - bl sub_020586F8 + bl MapObject_SetMovementStep add r0, r4, #0x0 mov r1, #0x20 bl MapObject_ClearFlagsBits @@ -144,10 +144,10 @@ MapObject_ClearHeldMovement: ; 0x0205AE80 bl MapObject_SetFlagsBits add r0, r4, #0x0 mov r1, #0xff - bl sub_020586E8 + bl MapObject_SetMovementCommand add r0, r4, #0x0 mov r1, #0x0 - bl sub_020586F8 + bl MapObject_SetMovementStep pop {r4, pc} thumb_func_start sub_0205AEA4 @@ -214,7 +214,7 @@ _0205AF14: add r1, r4, #0x0 bl FreeToHeapExplicit add r0, r5, #0x0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3-r5, pc} .balign 4 @@ -408,12 +408,12 @@ sub_0205B058: ; 0x0205B058 add r5, r0, #0x0 _0205B05C: add r0, r5, #0x0 - bl sub_020586F0 + bl MapObject_GetMovementCommand add r4, r0, #0x0 cmp r4, #0xff beq _0205B07C add r0, r5, #0x0 - bl sub_02058710 + bl MapObject_GetMovementStep add r2, r0, #0x0 add r0, r5, #0x0 add r1, r4, #0x0 @@ -442,10 +442,10 @@ _0205B098: bl MapObject_ClearFlagsBits add r0, r4, #0x0 mov r1, #0xff - bl sub_020586E8 + bl MapObject_SetMovementCommand add r0, r4, #0x0 mov r1, #0x0 - bl sub_020586F8 + bl MapObject_SetMovementStep mov r0, #0x1 pop {r4, pc} @@ -474,14 +474,14 @@ sub_0205B0C8: ; 0x0205B0C8 sub_0205B0D4: ; 0x0205B0D4 push {r4, lr} add r4, r0, #0x0 - bl sub_020584AC + bl MapObject_SetFacingDirection add r0, r4, #0x0 mov r1, #0x0 bl sub_02058544 add r0, r4, #0x0 bl sub_02059C60 add r0, r4, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep pop {r4, pc} .balign 4 @@ -537,7 +537,7 @@ sub_0205B124: ; 0x0205B124 bl sub_02059C0C add r0, r5, #0x0 add r1, r4, #0x0 - bl sub_020584D8 + bl MapObject_SetOrQueueFacing add r1, sp, #0x8 ldrh r1, [r1, #0x10] add r0, r5, #0x0 @@ -546,7 +546,7 @@ sub_0205B124: ; 0x0205B124 mov r1, #0x4 bl MapObject_SetFlagsBits add r0, r5, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep pop {r3-r7, pc} .balign 4 @@ -583,7 +583,7 @@ _0205B198: mov r1, #0x0 bl sub_02058544 add r0, r5, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x1 pop {r3-r5, pc} .balign 4 @@ -950,14 +950,14 @@ sub_0205B408: ; 0x0205B408 strh r1, [r0, #0x2] add r0, r5, #0x0 add r1, r7, #0x0 - bl sub_020584AC + bl MapObject_SetFacingDirection add r0, r5, #0x0 add r1, r4, #0x0 bl sub_02058544 add r0, r5, #0x0 bl sub_02059C60 add r0, r5, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep pop {r3-r7, pc} thumb_func_start sub_0205B43C @@ -982,7 +982,7 @@ _0205B456: mov r1, #0x0 bl sub_02058544 add r0, r4, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x1 pop {r4, pc} @@ -1221,13 +1221,13 @@ _0205B5EA: bl MapObject_SetFlagsBits add r0, r5, #0x0 add r1, r4, #0x0 - bl sub_020584D8 + bl MapObject_SetOrQueueFacing add r1, sp, #0x8 ldrh r1, [r1, #0x10] add r0, r5, #0x0 bl sub_02058544 add r0, r5, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep ldr r0, _0205B618 ; =0x0000060B bl PlaySE pop {r3-r7, pc} @@ -1302,7 +1302,7 @@ _0205B680: str r1, [sp, #0x14] add r0, r5, #0x0 add r1, sp, #0xc - bl sub_02058B94 + bl MapObject_SetFacingVector mov r0, #0xd ldrsb r1, [r4, r0] sub r1, r1, #0x1 @@ -1320,7 +1320,7 @@ _0205B6B8: str r0, [r1, #0x4] str r0, [r1, #0x8] add r0, r5, #0x0 - bl sub_02058B94 + bl MapObject_SetFacingVector ldr r1, _0205B6FC ; =0x00020028 add r0, r5, #0x0 bl MapObject_SetFlagsBits @@ -1332,7 +1332,7 @@ _0205B6B8: mov r1, #0x0 bl sub_02058544 add r0, r5, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep ldr r0, _0205B700 ; =0x00000647 bl PlaySE mov r0, #0x1 @@ -1724,7 +1724,7 @@ sub_0205B99C: ; 0x0205B99C bl sub_020585DC str r4, [r0, #0x0] add r0, r5, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep pop {r3-r5, pc} .balign 4 @@ -1742,7 +1742,7 @@ sub_0205B9B4: ; 0x0205B9B4 pop {r4, pc} _0205B9CA: add r0, r4, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x1 pop {r4, pc} @@ -1815,7 +1815,7 @@ sub_0205BA28: ; 0x0205BA28 mov r1, #0x0 bl sub_02058544 add r0, r4, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x1 pop {r4, pc} .balign 4 @@ -1839,7 +1839,7 @@ sub_0205BA4C: ; 0x0205BA4C ldr r0, [r4, #0x0] str r0, [sp, #0x4] add r0, r5, #0x0 - bl sub_02058B94 + bl MapObject_SetFacingVector ldr r1, [r4, #0x0] asr r0, r1, #0xe lsr r0, r0, #0x11 @@ -1852,7 +1852,7 @@ sub_0205BA4C: ; 0x0205BA4C pop {r4-r5, pc} _0205BA88: add r0, r5, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x1 add sp, #0xc pop {r4-r5, pc} @@ -1872,7 +1872,7 @@ sub_0205BA94: ; 0x0205BA94 mov r1, #0x0 bl sub_02058544 add r0, r4, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x1 pop {r4, pc} nop @@ -1901,7 +1901,7 @@ _0205BADA: ldr r0, [r4, #0x0] str r0, [sp, #0x4] add r0, r5, #0x0 - bl sub_02058B94 + bl MapObject_SetFacingVector ldr r0, [r4, #0x0] cmp r0, #0x0 ble _0205BAFA @@ -1910,7 +1910,7 @@ _0205BADA: pop {r4-r5, pc} _0205BAFA: add r0, r5, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x1 add sp, #0xc pop {r4-r5, pc} @@ -1924,7 +1924,7 @@ sub_0205BB08: ; 0x0205BB08 lsl r1, r1, #0x8 bl MapObject_SetFlagsBits add r0, r4, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x1 pop {r4, pc} .balign 4 @@ -1937,7 +1937,7 @@ sub_0205BB20: ; 0x0205BB20 lsl r1, r1, #0x8 bl MapObject_ClearFlagsBits add r0, r4, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x1 pop {r4, pc} .balign 4 @@ -1949,7 +1949,7 @@ sub_0205BB38: ; 0x0205BB38 mov r1, #0x80 bl MapObject_SetFlagsBits add r0, r4, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x1 pop {r4, pc} @@ -1960,7 +1960,7 @@ sub_0205BB4C: ; 0x0205BB4C mov r1, #0x80 bl MapObject_ClearFlagsBits add r0, r4, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x1 pop {r4, pc} @@ -1972,7 +1972,7 @@ sub_0205BB60: ; 0x0205BB60 lsl r1, r1, #0x8 bl MapObject_SetFlagsBits add r0, r4, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x1 pop {r4, pc} .balign 4 @@ -1985,7 +1985,7 @@ sub_0205BB78: ; 0x0205BB78 lsl r1, r1, #0x8 bl MapObject_ClearFlagsBits add r0, r4, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x1 pop {r4, pc} .balign 4 @@ -2005,7 +2005,7 @@ sub_0205BB90: ; 0x0205BB90 bl ov05_021E7AC0 str r0, [r4, #0x4] add r0, r5, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep pop {r4-r6, pc} thumb_func_start sub_0205BBB4 @@ -2021,7 +2021,7 @@ sub_0205BBB4: ; 0x0205BBB4 ldr r0, [r4, #0x4] bl sub_02064520 add r0, r5, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x1 pop {r3-r5, pc} _0205BBD8: @@ -2061,7 +2061,7 @@ sub_0205BBF4: ; 0x0205BBF4 bl sub_02059C0C add r0, r5, #0x0 add r1, r4, #0x0 - bl sub_020584D8 + bl MapObject_SetOrQueueFacing add r0, r5, #0x0 add r1, r6, #0x0 bl sub_02058544 @@ -2069,7 +2069,7 @@ sub_0205BBF4: ; 0x0205BBF4 mov r1, #0x4 bl MapObject_SetFlagsBits add r0, r5, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep pop {r3-r7, pc} .balign 4 @@ -2113,7 +2113,7 @@ _0205BC6E: mov r1, #0x0 bl sub_02058544 add r0, r5, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x1 pop {r4-r6, pc} @@ -2292,7 +2292,7 @@ sub_0205BD9C: ; 0x0205BD9C mov r1, #0x9 bl sub_02058544 add r0, r4, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x0 pop {r4, pc} @@ -2308,12 +2308,12 @@ sub_0205BDB8: ; 0x0205BDB8 blt _0205BDE0 add r0, r4, #0x0 mov r1, #0x1 - bl sub_020584AC + bl MapObject_SetFacingDirection add r0, r4, #0x0 mov r1, #0x0 bl sub_02058544 add r0, r4, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep _0205BDE0: mov r0, #0x0 pop {r4, pc} @@ -2337,7 +2337,7 @@ _0205BDFE: str r0, [r1, #0x4] str r0, [r1, #0x8] add r0, r4, #0x0 - bl sub_02058B94 + bl MapObject_SetFacingVector add r0, r4, #0x0 bl ov06_0224D2E0 ldr r1, _0205BE34 ; =0x00010004 @@ -2348,7 +2348,7 @@ _0205BDFE: lsl r1, r1, #0x14 bl MapObject_ClearFlagsBits add r0, r4, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x0 add sp, #0xc pop {r3-r4, pc} @@ -2374,7 +2374,7 @@ sub_0205BE38: ; 0x0205BE38 ldr r0, [r2, r0] str r0, [sp, #0x4] add r0, r5, #0x0 - bl sub_02058B94 + bl MapObject_SetFacingVector ldr r0, [r4, #0x0] add r0, r0, #0x2 str r0, [r4, #0x0] @@ -2388,14 +2388,14 @@ _0205BE70: str r0, [sp, #0x4] add r0, r5, #0x0 add r1, sp, #0x0 - bl sub_02058B94 + bl MapObject_SetFacingVector ldr r1, _0205BE9C ; =0x00020028 add r0, r5, #0x0 bl MapObject_SetFlagsBits add r0, r5, #0x0 bl sub_0205EB2C add r0, r5, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x1 add sp, #0xc pop {r4-r5, pc} @@ -2413,7 +2413,7 @@ sub_0205BEA0: ; 0x0205BEA0 mov r1, #0x0 bl sub_02058544 add r0, r4, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x0 pop {r4, pc} @@ -2427,7 +2427,7 @@ sub_0205BEBC: ; 0x0205BEBC mov r1, #0x1 bl sub_02058544 add r0, r4, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x0 pop {r4, pc} @@ -2445,6 +2445,6 @@ sub_0205BED8: ; 0x0205BED8 pop {r4, pc} _0205BEEE: add r0, r4, #0x0 - bl sub_02058700 + bl MapObject_IncrementMovementStep mov r0, #0x1 pop {r4, pc} diff --git a/arm9/asm/unk_0205BEF8.s b/arm9/asm/unk_0205BEF8.s index 1f239a742..256272714 100644 --- a/arm9/asm/unk_0205BEF8.s +++ b/arm9/asm/unk_0205BEF8.s @@ -116,17 +116,17 @@ sub_0205BF78: ; 0x0205BF78 bl MapObject_GetCurrentX add r5, r0, #0x0 add r0, r4, #0x0 - bl sub_02058B14 + bl MapObject_GetPreviousX cmp r5, r0 beq _0205BF90 mov r0, #0x1 pop {r3-r5, pc} _0205BF90: add r0, r4, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r5, r0, #0x0 add r0, r4, #0x0 - bl sub_02058B24 + bl MapObject_GetPreviousZ cmp r5, r0 beq _0205BFA6 mov r0, #0x1 @@ -143,17 +143,17 @@ sub_0205BFAC: ; 0x0205BFAC bl MapObject_GetCurrentX add r5, r0, #0x0 add r0, r4, #0x0 - bl sub_02058B14 + bl MapObject_GetPreviousX cmp r5, r0 beq _0205BFC4 mov r0, #0x0 pop {r3-r5, pc} _0205BFC4: add r0, r4, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r5, r0, #0x0 add r0, r4, #0x0 - bl sub_02058B24 + bl MapObject_GetPreviousZ cmp r5, r0 bne _0205BFDA mov r0, #0x1 @@ -243,7 +243,7 @@ _0205C05C: strb r0, [r4, #0x0] _0205C062: add r0, r5, #0x0 - bl sub_02058854 + bl MapObject_CheckSingleMovement cmp r0, #0x1 beq _0205C07C ldrb r0, [r4, #0x0] @@ -367,7 +367,7 @@ _0205C148: mov r1, #0x4 ldrsb r1, [r4, r1] add r0, r5, #0x0 - bl sub_020584AC + bl MapObject_SetFacingDirection ldrb r0, [r4, #0x1] add r0, r0, #0x1 strb r0, [r4, #0x1] @@ -458,7 +458,7 @@ _0205C1F0: strb r0, [r4, #0x0] _0205C1F6: add r0, r5, #0x0 - bl sub_02058854 + bl MapObject_CheckSingleMovement cmp r0, #0x1 beq _0205C210 ldrb r0, [r4, #0x0] @@ -613,7 +613,7 @@ _0205C314: mov r1, #0x4 ldrsb r1, [r4, r1] add r0, r7, #0x0 - bl sub_020584AC + bl MapObject_SetFacingDirection ldrb r0, [r4, #0x1] add r0, r0, #0x1 strb r0, [r4, #0x1] diff --git a/arm9/asm/unk_0205C598.s b/arm9/asm/unk_0205C598.s index 4893eddd7..9342a6489 100644 --- a/arm9/asm/unk_0205C598.s +++ b/arm9/asm/unk_0205C598.s @@ -406,7 +406,7 @@ sub_0205C888: ; 0x0205C888 cmp r0, r6 bne _0205C8AE add r0, r7, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ cmp r4, r0 bge _0205C8AE sub r1, r0, r5 @@ -430,7 +430,7 @@ sub_0205C8B4: ; 0x0205C8B4 cmp r0, r6 bne _0205C8DA add r0, r7, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ cmp r4, r0 ble _0205C8DA add r1, r0, r5 @@ -450,7 +450,7 @@ sub_0205C8E0: ; 0x0205C8E0 add r5, r1, #0x0 add r4, r2, #0x0 add r6, r3, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ cmp r0, r6 bne _0205C906 add r0, r7, #0x0 @@ -474,7 +474,7 @@ sub_0205C90C: ; 0x0205C90C add r5, r1, #0x0 add r4, r2, #0x0 add r6, r3, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ cmp r0, r6 bne _0205C932 add r0, r7, #0x0 @@ -507,10 +507,10 @@ _0205C94C: bl MapObject_GetCurrentX add r4, r0, #0x0 ldr r0, [sp, #0x4] - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r7, r0, #0x0 ldr r0, [sp, #0x4] - bl MapObject_GetCurrentHeight + bl MapObject_GetCurrentY str r0, [sp, #0xc] add r0, r5, #0x0 bl sub_02059BF4 @@ -725,7 +725,7 @@ sub_0205CAE0: ; 0x0205CAE0 mov r0, #0x4 bl FreeToHeapExplicit add r0, r4, #0x0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} thumb_func_start sub_0205CAF8 @@ -751,11 +751,11 @@ sub_0205CB14: ; 0x0205CB14 add r5, r0, #0x0 ldr r4, [r5, #0x24] add r0, r4, #0x0 - bl sub_02058854 + bl MapObject_CheckSingleMovement cmp r0, #0x1 bne _0205CB2A add r0, r4, #0x0 - bl sub_02058914 + bl MapObject_UnpauseMovement _0205CB2A: mov r0, #0x1 str r0, [r5, #0x0] @@ -767,7 +767,7 @@ sub_0205CB30: ; 0x0205CB30 add r4, r0, #0x0 ldr r5, [r4, #0x24] add r0, r5, #0x0 - bl sub_02058854 + bl MapObject_CheckSingleMovement cmp r0, #0x1 bne _0205CB44 mov r0, #0x0 @@ -1027,13 +1027,13 @@ sub_0205CCEC: ; 0x0205CCEC bl MapObject_GetCurrentX add r6, r0, #0x0 add r0, r4, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r7, r0, #0x0 ldr r0, [r5, #0x24] bl MapObject_GetCurrentX str r0, [sp, #0x0] ldr r0, [r5, #0x24] - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r3, r0, #0x0 ldr r2, [sp, #0x0] add r0, r6, #0x0 diff --git a/arm9/asm/unk_0205CE48.s b/arm9/asm/unk_0205CE48.s index 01037cd48..9b3987079 100644 --- a/arm9/asm/unk_0205CE48.s +++ b/arm9/asm/unk_0205CE48.s @@ -583,7 +583,7 @@ _0205D296: bne _0205D2D6 ldr r0, [r4, #0x38] bl PlayerAvatar_GetMapObject - bl sub_02058914 + bl MapObject_UnpauseMovement ldr r0, [r4, #0x38] mov r1, #0x1 bl Field_PlayerAvatar_OrrTransitionFlags @@ -613,7 +613,7 @@ _0205D2D6: bl FieldSystem_PlayOrFadeToNewMusicId ldr r0, [r4, #0x38] bl PlayerAvatar_GetMapObject - bl sub_02058914 + bl MapObject_UnpauseMovement ldr r0, [r4, #0x38] mov r1, #0x2 bl Field_PlayerAvatar_OrrTransitionFlags @@ -1358,7 +1358,7 @@ _0205D86E: _0205D898: ldr r0, [r4, #0x14] bl PlayerAvatar_GetMapObject - bl sub_02058A68 + bl MapObject_CheckFlag28 cmp r0, #0x1 bne _0205D8AC mov r0, #0x0 diff --git a/arm9/asm/unk_0205E4EC.s b/arm9/asm/unk_0205E4EC.s index ffc5f7715..30a47e4c8 100644 --- a/arm9/asm/unk_0205E4EC.s +++ b/arm9/asm/unk_0205E4EC.s @@ -38,10 +38,10 @@ sub_0205E4EC: ; 0x0205E4EC mov r1, #0x0 bl sub_02058544 add r0, r4, #0x0 - bl sub_02058848 + bl MapObject_ClearSingleMovement add r0, r4, #0x0 mov r1, #0x0 - bl sub_020588B8 + bl MapObject_ClearFlag18 pop {r4, pc} .balign 4 @@ -58,7 +58,7 @@ sub_0205E518: ; 0x0205E518 beq _0205E548 add r0, r5, #0x0 mov r1, #0x0 - bl sub_020588B8 + bl MapObject_ClearFlag18 ldr r6, _0205E54C ; =UNK_020F7388 _0205E538: ldrb r2, [r4, #0x0] @@ -84,9 +84,9 @@ sub_0205E554: ; 0x0205E554 push {r3-r5, lr} add r5, r0, #0x0 add r4, r1, #0x0 - bl sub_02058848 + bl MapObject_ClearSingleMovement add r0, r5, #0x0 - bl sub_0205886C + bl MapObject_ClearFlag3 add r0, r5, #0x0 add r1, r4, #0x0 bl sub_0205E608 @@ -100,7 +100,7 @@ sub_0205E554: ; 0x0205E554 cmp r0, #0x1 bne _0205E592 add r0, r5, #0x0 - bl sub_0205883C + bl MapObject_SetSingleMovement ldrb r0, [r4, #0x0] add r0, r0, #0x1 strb r0, [r4, #0x0] @@ -120,7 +120,7 @@ sub_0205E598: ; 0x0205E598 cmp r0, #0x1 bne _0205E5B0 add r0, r5, #0x0 - bl sub_02058848 + bl MapObject_ClearSingleMovement mov r0, #0x0 strb r0, [r4, #0x0] _0205E5B0: @@ -260,7 +260,7 @@ sub_0205E698: ; 0x0205E698 bl MapObject_GetCurrentX str r0, [sp, #0x0] add r0, r5, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r7, r0, #0x0 add r0, r4, #0x0 bl sub_02055338 @@ -309,7 +309,7 @@ sub_0205E700: ; 0x0205E700 mov r1, #0x0 bl sub_02058544 add r0, r5, #0x0 - bl sub_02058848 + bl MapObject_ClearSingleMovement mov r0, #0x0 strb r0, [r4, #0x1] pop {r3-r5, pc} @@ -358,9 +358,9 @@ sub_0205E768: ; 0x0205E768 push {r3-r5, lr} add r5, r0, #0x0 add r4, r1, #0x0 - bl sub_02058848 + bl MapObject_ClearSingleMovement add r0, r5, #0x0 - bl sub_0205886C + bl MapObject_ClearFlag3 add r0, r5, #0x0 add r1, r4, #0x0 bl sub_0205E8F4 @@ -372,7 +372,7 @@ sub_0205E768: ; 0x0205E768 cmp r0, #0x1 bne _0205E7A0 add r0, r5, #0x0 - bl sub_0205883C + bl MapObject_SetSingleMovement ldrb r0, [r4, #0x0] add r0, r0, #0x1 strb r0, [r4, #0x0] @@ -394,7 +394,7 @@ sub_0205E7A4: ; 0x0205E7A4 pop {r3-r5, pc} _0205E7B6: add r0, r5, #0x0 - bl sub_02058848 + bl MapObject_ClearSingleMovement mov r0, #0x0 strb r0, [r4, #0x0] pop {r3-r5, pc} @@ -410,7 +410,7 @@ sub_0205E7C4: ; 0x0205E7C4 bl MapObject_GetType str r0, [sp, #0x0] add r0, r4, #0x0 - bl sub_02058450 + bl MapObject_GetMapID add r6, r0, #0x0 add r0, r4, #0x0 bl sub_0205C9E8 @@ -448,7 +448,7 @@ _0205E81E: ldr r0, [sp, #0x4] cmp r4, r0 beq _0205E83C - bl sub_02058450 + bl MapObject_GetMapID cmp r6, r0 bne _0205E83C ldr r0, [sp, #0x4] @@ -483,7 +483,7 @@ sub_0205E854: ; 0x0205E854 mov r0, #0x0 str r0, [sp, #0x8] add r0, r5, #0x0 - bl sub_02058450 + bl MapObject_GetMapID add r7, r0, #0x0 add r0, r5, #0x0 bl sub_0205C9E8 @@ -499,7 +499,7 @@ _0205E886: ldr r0, [sp, #0x4] cmp r5, r0 beq _0205E8B6 - bl sub_02058450 + bl MapObject_GetMapID cmp r7, r0 bne _0205E8B6 ldr r0, [sp, #0x4] @@ -544,7 +544,7 @@ sub_0205E8D0: ; 0x0205E8D0 bl MapObject_GetCurrentX strh r0, [r5, #0x2] add r0, r4, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ strh r0, [r5, #0x4] mov r0, #0xff strh r0, [r5, #0x6] @@ -560,26 +560,26 @@ sub_0205E8F4: ; 0x0205E8F4 bl MapObject_GetCurrentX add r4, r0, #0x0 add r0, r6, #0x0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r6, r0, #0x0 add r0, r5, #0x0 - bl sub_02058B14 + bl MapObject_GetPreviousX add r7, r0, #0x0 add r0, r5, #0x0 - bl sub_02058B24 + bl MapObject_GetPreviousZ cmp r4, r7 bne _0205E91E cmp r6, r0 beq _0205E93A _0205E91E: add r0, r5, #0x0 - bl sub_02058854 + bl MapObject_CheckSingleMovement cmp r0, #0x1 beq _0205E936 mov r1, #0x61 add r0, r5, #0x0 lsl r1, r1, #0x6 - bl MapObject_GetFlagsBits + bl MapObject_GetFlagsBitsMask cmp r0, #0x0 bne _0205E93A _0205E936: @@ -599,19 +599,19 @@ sub_0205E940: ; 0x0205E940 bl MapObject_GetCurrentX add r4, r0, #0x0 ldr r0, [sp, #0x0] - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r6, r0, #0x0 ldr r0, [r5, #0x8] bl MapObject_GetCurrentX str r0, [sp, #0x8] ldr r0, [r5, #0x8] - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r7, r0, #0x0 ldr r0, [r5, #0x8] - bl sub_02058B14 + bl MapObject_GetPreviousX str r0, [sp, #0x4] ldr r0, [r5, #0x8] - bl sub_02058B24 + bl MapObject_GetPreviousZ add r3, r0, #0x0 ldr r0, [sp, #0x8] cmp r4, r0 @@ -666,7 +666,7 @@ sub_0205E9C8: ; 0x0205E9C8 mov r1, #0x0 bl sub_02058544 add r0, r4, #0x0 - bl sub_02058848 + bl MapObject_ClearSingleMovement mov r1, #0x1 add r0, r4, #0x0 lsl r1, r1, #0x14 @@ -680,7 +680,7 @@ sub_0205E9C8: ; 0x0205E9C8 add r1, r2, #0x0 str r0, [r3, #0x0] add r0, r4, #0x0 - bl sub_02058B94 + bl MapObject_SetFacingVector add sp, #0xc pop {r4-r5, pc} nop @@ -771,7 +771,7 @@ sub_0205EA74: ; 0x0205EA74 add r1, r2, #0x0 str r0, [r3, #0x0] add r0, r4, #0x0 - bl sub_02058B94 + bl MapObject_SetFacingVector _0205EAA6: add sp, #0xc pop {r4-r5, pc} @@ -793,9 +793,9 @@ sub_0205EAB0: ; 0x0205EAB0 bl sub_0205EB14 _0205EACA: add r0, r5, #0x0 - bl sub_02058848 + bl MapObject_ClearSingleMovement add r0, r5, #0x0 - bl sub_0205886C + bl MapObject_ClearFlag3 ldrb r0, [r4, #0x0] add r0, r0, #0x1 strb r0, [r4, #0x0] diff --git a/arm9/asm/unk_020643C0.s b/arm9/asm/unk_020643C0.s index d49ca537f..61e06c2df 100644 --- a/arm9/asm/unk_020643C0.s +++ b/arm9/asm/unk_020643C0.s @@ -122,7 +122,7 @@ _020644AE: cmp r0, #0x0 bne _020644D2 add r0, r4, #0x0 - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r5, #0x0 bl sub_02064640 add sp, #0xc @@ -191,7 +191,7 @@ _0206452A: bl sub_02064764 cmp r0, #0x0 beq _02064550 - bl sub_0200CAB4 + bl SysTask_Destroy _02064550: add r0, r4, #0x0 bl sub_02064640 diff --git a/arm9/asm/unk_020653EC.s b/arm9/asm/unk_020653EC.s index 8d9f249d7..615f4491c 100644 --- a/arm9/asm/unk_020653EC.s +++ b/arm9/asm/unk_020653EC.s @@ -98,7 +98,7 @@ sub_02065474: ; 0x02065474 push {r4, lr} add r4, r0, #0x0 ldr r0, [r4, #0x8] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x4] mov r1, #0x1 str r1, [r0, #0x0] diff --git a/arm9/asm/unk_0206BF90.s b/arm9/asm/unk_0206BF90.s index 04a23cb1c..b3e08dd4d 100644 --- a/arm9/asm/unk_0206BF90.s +++ b/arm9/asm/unk_0206BF90.s @@ -907,7 +907,7 @@ _0206C5CC: add r0, r5, #0x0 bl FreeToHeap ldr r0, [sp, #0x0] - bl sub_0200CAB4 + bl SysTask_Destroy _0206C5D8: add sp, #0x8 pop {r3-r7, pc} @@ -964,7 +964,7 @@ _0206C63E: add r0, r5, #0x0 bl FreeToHeap ldr r0, [sp, #0x0] - bl sub_0200CAB4 + bl SysTask_Destroy _0206C64A: pop {r3-r7, pc} diff --git a/arm9/asm/unk_0206C700.s b/arm9/asm/unk_0206C700.s index c23af95eb..3e68fc398 100644 --- a/arm9/asm/unk_0206C700.s +++ b/arm9/asm/unk_0206C700.s @@ -265,7 +265,7 @@ sub_0206C8EC: ; 0x0206C8EC cmp r0, #0x0 beq _0206C918 add r0, r4, #0x0 - bl sub_0200CAB4 + bl SysTask_Destroy _0206C918: pop {r3-r5, pc} .balign 4 diff --git a/arm9/asm/unk_02080C38.s b/arm9/asm/unk_02080C38.s index 4a2a5a851..bc8aab091 100644 --- a/arm9/asm/unk_02080C38.s +++ b/arm9/asm/unk_02080C38.s @@ -2315,7 +2315,7 @@ _02081D86: add r0, #0x5a strb r2, [r4, r0] ldr r0, [sp, #0x0] - bl sub_0200CAB4 + bl SysTask_Destroy _02081DBC: add sp, #0x10 pop {r3-r7, pc} @@ -2625,7 +2625,7 @@ _02082000: str r2, [r4, r1] sub r1, #0xa strb r2, [r4, r1] - bl sub_0200CAB4 + bl SysTask_Destroy _02082010: pop {r4, pc} nop @@ -3418,7 +3418,7 @@ _02082580: mov r1, #0x0 str r1, [r5, r0] add r0, r6, #0x0 - bl sub_0200CAB4 + bl SysTask_Destroy _02082594: add sp, #0x4 pop {r3-r6, pc} diff --git a/arm9/global.inc b/arm9/global.inc index 68f289676..fb743e3d7 100644 --- a/arm9/global.inc +++ b/arm9/global.inc @@ -685,7 +685,7 @@ .extern sub_0200CA60 .extern sub_0200CA7C .extern sub_0200CA98 -.extern sub_0200CAB4 +.extern SysTask_Destroy .extern sub_0200CABC .extern sub_0200CAFC .extern LoadUserFrameGfx1 @@ -4002,45 +4002,45 @@ .extern MapObjectManager_GetFirstActiveObjectByID .extern MapObjectManager_GetFirstActiveObjectWithMovement .extern MapObjectManager_GetNextObjectWithFlagFromIndex -.extern sub_0205829C +.extern MapObject_GetPriorityPlusValue .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 sub_020583F0 -.extern sub_020583F4 +.extern MapObjectManager_GetObjects2 +.extern MapObjectArray_NextObject +.extern MapObjectManager_SetMapModelNarc +.extern MapObjectManager_GetMapModelNarc .extern MapObject_SetFlagsBits .extern MapObject_ClearFlagsBits -.extern MapObject_GetFlagsBits +.extern MapObject_GetFlagsBitsMask .extern MapObject_TestFlagsBits .extern MapObject_SetID .extern MapObject_GetID -.extern sub_02058450 +.extern MapObject_GetMapID .extern MapObject_SetSpriteID .extern MapObject_GetSpriteID .extern sub_0205845C .extern MapObject_GetMovement .extern MapObject_SetType .extern MapObject_GetType -.extern MapObject_SetFlagID +.extern MapObject_SetEventFlag .extern MapObject_SetScriptID .extern MapObject_GetScriptID .extern MapObject_GetInitialFacingDirection .extern MapObject_SetFacingDirectionDirect -.extern sub_020584AC +.extern MapObject_SetFacingDirection .extern MapObject_GetFacingDirection -.extern sub_020584C8 +.extern MapObject_GetPreviousFacingDirection .extern MapObject_SetNextFacingDirection .extern MapObject_GetNextFacingDirection -.extern sub_020584D8 +.extern MapObject_SetOrQueueFacing .extern MapObject_SetParam .extern MapObject_GetParam .extern MapObject_SetXRange @@ -4062,17 +4062,17 @@ .extern sub_0205864C .extern sub_020586A0 .extern sub_020586DC -.extern sub_020586E8 -.extern sub_020586F0 -.extern sub_020586F8 -.extern sub_02058700 -.extern sub_02058710 +.extern MapObject_SetMovementCommand +.extern MapObject_GetMovementCommand +.extern MapObject_SetMovementStep +.extern MapObject_IncrementMovementStep +.extern MapObject_GetMovementStep .extern sub_02058718 .extern sub_02058720 .extern sub_02058728 .extern sub_02058730 .extern MapObject_GetFieldSystem -.extern sub_02058744 +.extern MapObject_GetPriority .extern sub_02058750 .extern sub_02058768 .extern sub_02058774 @@ -4082,69 +4082,69 @@ .extern sub_020587F4 .extern sub_02058804 .extern sub_0205881C -.extern MapObject_IsInUse -.extern sub_0205883C -.extern sub_02058848 -.extern sub_02058854 -.extern sub_02058860 -.extern sub_0205886C +.extern MapObject_CheckActive +.extern MapObject_SetSingleMovement +.extern MapObject_ClearSingleMovement +.extern MapObject_CheckSingleMovement +.extern MapObject_SetFlag2 +.extern MapObject_ClearFlag3 .extern MapObject_CheckFlag14 -.extern sub_02058890 +.extern MapObject_CheckVisible .extern MapObject_SetVisible -.extern sub_020588B8 -.extern sub_020588D4 -.extern sub_020588EC -.extern sub_02058908 -.extern sub_02058914 -.extern sub_02058920 +.extern MapObject_ClearFlag18 +.extern MapObject_CheckFlag19Disabled +.extern MapObject_SetFlag19 +.extern MapObject_PauseMovement +.extern MapObject_UnpauseMovement +.extern MapObject_CheckMovementPaused .extern sub_02058934 -.extern sub_02058960 -.extern sub_0205897C -.extern sub_02058994 +.extern MapObject_SetIgnoreHeights +.extern MapObject_CheckIgnoreHeights +.extern MapObject_SetKeep .extern MapObject_CheckFlag25 -.extern sub_020589E4 -.extern sub_02058A00 -.extern sub_02058A18 -.extern sub_02058A34 -.extern sub_02058A4C -.extern sub_02058A68 -.extern sub_02058A80 -.extern sub_02058A9C -.extern sub_02058AB4 -.extern sub_02058AC8 +.extern MapObject_SetFlag26 +.extern MapObject_CheckFlag26 +.extern MapObject_SetFlag27 +.extern MapObject_CheckFlag27 +.extern MapObject_SetFlag28 +.extern MapObject_CheckFlag28 +.extern MapObject_SetFlag24 +.extern MapObject_CheckFlag24 +.extern MapObject_CheckFlag4 +.extern MapObject_SetFlag29 .extern MapObject_CheckFlag29 .extern MapObject_GetInitialX -.extern MapObject_GetInitialHeight .extern MapObject_GetInitialY -.extern sub_02058B14 +.extern MapObject_GetInitialZ +.extern MapObject_GetPreviousX .extern MapObject_SetPreviousX -.extern sub_02058B1C -.extern MapObject_SetPreviousHeight -.extern sub_02058B24 +.extern MapObject_GetPreviousY .extern MapObject_SetPreviousY +.extern MapObject_GetPreviousZ +.extern MapObject_SetPreviousZ .extern MapObject_GetCurrentX .extern MapObject_SetCurrentX -.extern sub_02058B34 -.extern MapObject_GetCurrentHeight -.extern MapObject_SetCurrentHeight -.extern sub_02058B44 +.extern MapObject_AddCurrentX .extern MapObject_GetCurrentY .extern MapObject_SetCurrentY -.extern sub_02058B54 -.extern MapObject_GetPositionVec -.extern MapObject_SetPositionVec -.extern sub_02058B7C -.extern MapObject_GetPosVecYCoord -.extern sub_02058B84 -.extern sub_02058B94 +.extern MapObject_AddCurrentY +.extern MapObject_GetCurrentZ +.extern MapObject_SetCurrentZ +.extern MapObject_AddCurrentZ +.extern MapObject_CopyPositionVector +.extern MapObject_SetPositionVector +.extern MapObject_GetPositionVector +.extern MapObject_GetPositionVectorYCoord +.extern MapObject_CopyFacingVector +.extern MapObject_SetFacingVector .extern sub_02058BA4 .extern sub_02058BB4 .extern sub_02058BC4 .extern sub_02058BD4 -.extern sub_02058BE4 -.extern sub_02058D74 -.extern sub_02058DBC -.extern sub_02058E28 +.extern MapObject_GetPositionVectorYCoordUInt +.extern MapObjectManager_GetFirstObjectWithXAndZ +.extern LocalMapObject_SetPositionFromVectorAndDirection +.extern MapObject_SetPositionFromXYZAndDirection .extern sub_02058E90 .extern sub_02058EB0 .extern sub_02058EC8 diff --git a/arm9/overlays/05/asm/ov05_021D7F4C.s b/arm9/overlays/05/asm/ov05_021D7F4C.s index 0781ef608..84f7ce6ae 100644 --- a/arm9/overlays/05/asm/ov05_021D7F4C.s +++ b/arm9/overlays/05/asm/ov05_021D7F4C.s @@ -208,9 +208,9 @@ _021D80BE: bl FreeToHeap _021D80CC: ldr r0, [r4, #4] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #8] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 add r1, r4, #0 mov r2, #0x14 diff --git a/arm9/overlays/05/asm/ov05_021DC0B8.s b/arm9/overlays/05/asm/ov05_021DC0B8.s index e30564dfe..c081f1fef 100644 --- a/arm9/overlays/05/asm/ov05_021DC0B8.s +++ b/arm9/overlays/05/asm/ov05_021DC0B8.s @@ -43,7 +43,7 @@ ov05_021DC0F8: ; 0x021DC0F8 ldr r0, [r4, #0x14] cmp r0, #0 beq _021DC106 - bl sub_0200CAB4 + bl SysTask_Destroy _021DC106: add r0, r4, #0 bl ov05_021DC594 @@ -251,7 +251,7 @@ _021DC286: str r1, [r4, #0xc] mov r1, #0 str r1, [r4, #0x14] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r1, [r4, #0x10] cmp r1, #0x17 beq _021DC2A2 @@ -351,7 +351,7 @@ _021DC344: mov r1, #6 str r1, [r4, #0xc] str r2, [r4, #0x14] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r1, [r4, #0x10] cmp r1, #0x17 beq _021DC366 @@ -561,7 +561,7 @@ _021DC4B4: add r0, r6, #0 add r0, #0xf8 ldr r0, [r0] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 add r6, #0xf8 str r0, [r6] @@ -1368,7 +1368,7 @@ _021DCAD2: ldr r0, [r4, #0x1c] cmp r0, #0 beq _021DCAFA - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x1c] _021DCAFA: @@ -1402,7 +1402,7 @@ _021DCB2C: ldr r0, [r4, #0x1c] cmp r0, #0 beq _021DCB4C - bl sub_0200CAB4 + bl SysTask_Destroy b _021DCB4C _021DCB3E: cmp r0, #3 @@ -1410,7 +1410,7 @@ _021DCB3E: ldr r1, [r4, #0xc] ldr r0, _021DCB68 ; =0x00000F48 ldr r0, [r1, r0] - bl sub_0200CAB4 + bl SysTask_Destroy _021DCB4C: ldr r1, [r4, #0xc] mov r0, #4 @@ -1472,7 +1472,7 @@ _021DCBBC: ldr r1, [r4, #0xc] ldr r0, _021DCBDC ; =0x00000F48 ldr r0, [r1, r0] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #2 str r0, [r4, #0x14] _021DCBD0: @@ -1629,7 +1629,7 @@ _021DCCE6: str r0, [r4, #0x18] str r0, [r4, #0x1c] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021DCD00: pop {r3, r4, r5, pc} .balign 4, 0 @@ -10401,7 +10401,7 @@ ov05_021E117C: ; 0x021E117C ldr r0, [r4, #0x18] bl ov05_021F4648 ldr r0, [r4, #0x24] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x1c] bl sub_02012974 ldr r0, [r4, #0x20] @@ -10541,7 +10541,7 @@ ov05_021E12A4: ; 0x021E12A4 add r0, r1, #0 bl ov05_021E117C add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} .balign 4, 0 @@ -10630,7 +10630,7 @@ _021E132A: bl ov05_021F4624 str r0, [r4, #0x18] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, r6, r7, pc} nop _021E1364: .word 0x0400004A diff --git a/arm9/overlays/05/asm/ov05_021E1374.s b/arm9/overlays/05/asm/ov05_021E1374.s index efb1bf65e..3637c3b1e 100644 --- a/arm9/overlays/05/asm/ov05_021E1374.s +++ b/arm9/overlays/05/asm/ov05_021E1374.s @@ -322,7 +322,7 @@ _021E15DC: bl MapObject_GetCurrentX add r7, r0, #0 add r0, r4, #0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ ldr r1, [sp, #0x14] cmp r7, r1 blt _021E161A @@ -530,7 +530,7 @@ _021E1770: ldr r0, [r4, #4] bl sub_0205AEFC ldr r0, [r4] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #4 add r1, r4, #0 bl FreeToHeapExplicit @@ -872,17 +872,17 @@ _021E19F0: bl MapObjectManager_GetFirstActiveObjectByID add r4, r0, #0 beq _021E1A16 - bl sub_02058854 + bl MapObject_CheckSingleMovement cmp r0, #1 bne _021E1A10 add r0, r4, #0 - bl sub_02058914 + bl MapObject_UnpauseMovement mov r0, #1 str r0, [sp] b _021E1A16 _021E1A10: add r0, r4, #0 - bl sub_02058908 + bl MapObject_PauseMovement _021E1A16: add r5, r5, #1 cmp r5, r7 diff --git a/arm9/overlays/05/asm/ov05_021E1AD8.s b/arm9/overlays/05/asm/ov05_021E1AD8.s index 90c594472..fb6bd63e0 100644 --- a/arm9/overlays/05/asm/ov05_021E1AD8.s +++ b/arm9/overlays/05/asm/ov05_021E1AD8.s @@ -568,7 +568,7 @@ _021E1EFC: bl DestroyMsgData _021E1F22: ldr r0, [r6, #4] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r6, #0 bl FreeToHeap pop {r4, r5, r6, pc} @@ -1165,7 +1165,7 @@ _021E2398: bl DestroyMsgData _021E23BE: ldr r0, [r6, #4] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r6, #0 bl FreeToHeap pop {r4, r5, r6, pc} @@ -1434,7 +1434,7 @@ _021E25D0: bl DestroyMsgData _021E25F6: ldr r0, [r6, #4] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r6, #0 bl FreeToHeap _021E2602: diff --git a/arm9/overlays/05/asm/ov05_021E2E88.s b/arm9/overlays/05/asm/ov05_021E2E88.s index 29e659623..c97fd46cb 100644 --- a/arm9/overlays/05/asm/ov05_021E2E88.s +++ b/arm9/overlays/05/asm/ov05_021E2E88.s @@ -580,7 +580,7 @@ ov05_021E32F0: ; 0x021E32F0 ldr r0, [r4, #8] cmp r0, #0 beq _021E32FE - bl sub_0200CAB4 + bl SysTask_Destroy _021E32FE: add r0, r4, #0 add r0, #0x20 diff --git a/arm9/overlays/05/asm/ov05_021E3444.s b/arm9/overlays/05/asm/ov05_021E3444.s index f5d772b16..0b7adc827 100644 --- a/arm9/overlays/05/asm/ov05_021E3444.s +++ b/arm9/overlays/05/asm/ov05_021E3444.s @@ -178,7 +178,7 @@ _021E3580: mov r1, #1 str r1, [r2] _021E3590: - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap add sp, #4 @@ -430,7 +430,7 @@ ov05_021E3754: ; 0x021E3754 ldr r1, [r1] bl ov05_021E370C add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} thumb_func_start ov05_021E3768 @@ -571,7 +571,7 @@ ov05_021E3858: ; 0x021E3858 bl ov05_021F4624 str r0, [r4, #0x24] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} nop _021E3880: .word ov05_021E38B8 @@ -696,7 +696,7 @@ ov05_021E3920: ; 0x021E3920 mov r0, #0 str r0, [r4, #0x24] ldr r0, [r4, #0x28] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x28] pop {r4, pc} @@ -896,7 +896,7 @@ ov05_021E3ADC: ; 0x021E3ADC bl ov05_021F4624 str r0, [r4, #0x3c] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} nop _021E3B04: .word ov05_021E3B0C @@ -1021,7 +1021,7 @@ ov05_021E3BA4: ; 0x021E3BA4 mov r0, #0 str r0, [r4, #0x3c] ldr r0, [r4, #0x40] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x40] pop {r4, pc} @@ -1147,7 +1147,7 @@ ov05_021E3C14: ; 0x021E3C14 mov r1, #0 bl GfGfx_EngineATogglePlanes add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0x64 pop {r3, r4, r5, r6, pc} nop @@ -1216,7 +1216,7 @@ ov05_021E3D70: ; 0x021E3D70 lsr r1, r1, #0x18 bl Bg_SetTextDimAndAffineParams add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0xc pop {r3, r4, pc} .balign 4, 0 @@ -2676,7 +2676,7 @@ ov05_021E4884: ; 0x021E4884 add r4, #0xe0 str r0, [r4] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} nop _021E48B8: .word ov05_021E48EC @@ -2760,7 +2760,7 @@ ov05_021E4918: ; 0x021E4918 add r0, r4, #0 add r0, #0xe0 ldr r0, [r0] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 add r4, #0xe0 str r0, [r4] @@ -2948,7 +2948,7 @@ _021E4A8C: orr r2, r3 strh r2, [r1, #4] _021E4AA8: - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} nop _021E4AB0: .word 0x04000040 @@ -2962,7 +2962,7 @@ ov05_021E4AB8: ; 0x021E4AB8 ldr r1, [r1] bl GXx_SetMasterBrightness_ add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} .balign 4, 0 _021E4ACC: .word 0x0400006C diff --git a/arm9/overlays/05/asm/ov05_021E4AE4.s b/arm9/overlays/05/asm/ov05_021E4AE4.s index 7e6b30772..2de5c00a1 100644 --- a/arm9/overlays/05/asm/ov05_021E4AE4.s +++ b/arm9/overlays/05/asm/ov05_021E4AE4.s @@ -939,7 +939,7 @@ ov05_021E5158: ; 0x021E5158 mov r0, #1 str r0, [r4] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .balign 4, 0 @@ -957,7 +957,7 @@ ov05_021E5174: ; 0x021E5174 add r0, r4, #0 bl ov05_021E4C00 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021E5194: pop {r3, r4, r5, pc} .balign 4, 0 @@ -1027,7 +1027,7 @@ ov05_021E5208: ; 0x021E5208 ldr r1, [r4, #0xc] bl sub_0201B3A8 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} thumb_func_start ov05_021E5224 diff --git a/arm9/overlays/05/asm/ov05_021E55BC.s b/arm9/overlays/05/asm/ov05_021E55BC.s index 7641b6d3f..8642808e1 100644 --- a/arm9/overlays/05/asm/ov05_021E55BC.s +++ b/arm9/overlays/05/asm/ov05_021E55BC.s @@ -67,7 +67,7 @@ ov05_021E5614: ; 0x021E5614 add r0, r5, #0 add r1, sp, #8 str r5, [sp, #0x1c] - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, sp, #0x14 str r0, [sp] mov r0, #0xff @@ -100,14 +100,14 @@ ov05_021E5650: ; 0x021E5650 bl MapObject_GetID str r0, [r4, #8] ldr r0, [r4, #0x38] - bl sub_02058450 + bl MapObject_GetMapID str r0, [r4, #0xc] mov r0, #6 lsl r0, r0, #0xc str r0, [r4, #0x28] ldr r0, [r4, #0x38] add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 add r1, sp, #0 bl sub_0206476C @@ -147,7 +147,7 @@ _021E56B8: _021E56C8: add r0, r6, #0 add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector mov r0, #0xa ldr r1, [sp, #8] lsl r0, r0, #0xc diff --git a/arm9/overlays/05/asm/ov05_021E577C.s b/arm9/overlays/05/asm/ov05_021E577C.s index a2d5c02a8..11da65c2e 100644 --- a/arm9/overlays/05/asm/ov05_021E577C.s +++ b/arm9/overlays/05/asm/ov05_021E577C.s @@ -67,7 +67,7 @@ ov05_021E57D4: ; 0x021E57D4 add r0, r5, #0 add r1, sp, #8 str r5, [sp, #0x1c] - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, sp, #0x14 str r0, [sp] mov r0, #0xff @@ -100,14 +100,14 @@ ov05_021E5810: ; 0x021E5810 bl MapObject_GetID str r0, [r4, #8] ldr r0, [r4, #0x38] - bl sub_02058450 + bl MapObject_GetMapID str r0, [r4, #0xc] mov r0, #6 lsl r0, r0, #0xc str r0, [r4, #0x28] ldr r0, [r4, #0x38] add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 add r1, sp, #0 bl sub_0206476C @@ -138,7 +138,7 @@ ov05_021E585C: ; 0x021E585C _021E5878: add r0, r5, #0 add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector mov r0, #0xa ldr r1, [sp, #8] lsl r0, r0, #0xc diff --git a/arm9/overlays/05/asm/ov05_021E5918.s b/arm9/overlays/05/asm/ov05_021E5918.s index fbd11cce7..9b55c75e6 100644 --- a/arm9/overlays/05/asm/ov05_021E5918.s +++ b/arm9/overlays/05/asm/ov05_021E5918.s @@ -67,7 +67,7 @@ ov05_021E5970: ; 0x021E5970 add r0, r5, #0 add r1, sp, #8 str r5, [sp, #0x1c] - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, sp, #0x14 str r0, [sp] mov r0, #0xff @@ -100,14 +100,14 @@ ov05_021E59AC: ; 0x021E59AC bl MapObject_GetID str r0, [r4, #8] ldr r0, [r4, #0x3c] - bl sub_02058450 + bl MapObject_GetMapID str r0, [r4, #0xc] mov r0, #6 lsl r0, r0, #0xc str r0, [r4, #0x28] ldr r0, [r4, #0x3c] add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 add r1, sp, #0 bl sub_0206476C @@ -141,7 +141,7 @@ _021E5A0E: _021E5A16: ldr r0, [r1, #0x3c] add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector mov r0, #0xa ldr r1, [sp, #8] lsl r0, r0, #0xc diff --git a/arm9/overlays/05/asm/ov05_021E5E10.s b/arm9/overlays/05/asm/ov05_021E5E10.s index afaa6c90e..d6200650a 100644 --- a/arm9/overlays/05/asm/ov05_021E5E10.s +++ b/arm9/overlays/05/asm/ov05_021E5E10.s @@ -80,7 +80,7 @@ ov05_021E5E8C: ; 0x021E5E8C str r0, [sp, #0xc] add r0, r4, #0 add r1, sp, #0x10 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r4, #0 bl MapObject_GetFacingDirection cmp r0, #3 @@ -126,7 +126,7 @@ _021E5EEA: _021E5EF4: add r0, r4, #0 mov r1, #2 - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #8 str r1, [sp] str r0, [sp, #4] diff --git a/arm9/overlays/05/asm/ov05_021E5FD8.s b/arm9/overlays/05/asm/ov05_021E5FD8.s index 0bab026e5..d305fbb78 100644 --- a/arm9/overlays/05/asm/ov05_021E5FD8.s +++ b/arm9/overlays/05/asm/ov05_021E5FD8.s @@ -580,7 +580,7 @@ ov05_021E643C: ; 0x021E643C bne _021E647A _021E646C: add r0, r6, #0 - bl sub_02058A68 + bl MapObject_CheckFlag28 cmp r0, #1 bne _021E647A mov r0, #0 @@ -1104,7 +1104,7 @@ _021E68AC: add r0, r7, #0 mov r1, #1 mov r6, #0x30 - bl sub_02058A18 + bl MapObject_SetFlag27 _021E68B6: add r0, r5, #0 add r1, r6, #0 @@ -1654,7 +1654,7 @@ ov05_021E6CC4: ; 0x021E6CC4 lsl r0, r0, #1 add r4, r4, r0 ldr r0, [r5, #0x3c] - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r6, r0, #0 mov r0, #0 bl sub_02059C00 @@ -1680,7 +1680,7 @@ ov05_021E6CC4: ; 0x021E6CC4 str r6, [r5, #0x14] ldr r0, [r5, #0x3c] add r1, sp, #0xc - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector ldr r1, [sp, #0x14] ldr r0, [r5, #0x30] cmp r1, r0 @@ -1737,7 +1737,7 @@ ov05_021E6D80: ; 0x021E6D80 add r4, r0, #0 ldr r0, [r4, #0x3c] add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector ldr r1, [sp, #4] ldr r0, [r4, #0x20] add r1, r1, r0 @@ -1749,7 +1749,7 @@ ov05_021E6D80: ; 0x021E6D80 _021E6D9E: ldr r0, [r4, #0x3c] add r1, sp, #0 - bl MapObject_SetPositionVec + bl MapObject_SetPositionVector ldr r0, [r4, #8] add r0, r0, #1 str r0, [r4, #8] @@ -1772,7 +1772,7 @@ ov05_021E6DC0: ; 0x021E6DC0 add r4, r0, #0 ldr r0, [r4, #0x3c] add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector ldr r1, [sp, #4] ldr r0, [r4, #0x20] add r1, r1, r0 @@ -1793,7 +1793,7 @@ _021E6DDE: _021E6DEE: ldr r0, [r4, #0x3c] add r1, sp, #0 - bl MapObject_SetPositionVec + bl MapObject_SetPositionVector ldr r0, [r4, #8] add r0, r0, #1 str r0, [r4, #8] @@ -1820,10 +1820,10 @@ _021E6E1E: bl MapObject_SetCurrentX ldr r0, [r4, #0x3c] ldr r1, [r4, #0x10] - bl MapObject_SetCurrentHeight + bl MapObject_SetCurrentY ldr r0, [r4, #0x3c] ldr r1, [r4, #0x14] - bl MapObject_SetCurrentY + bl MapObject_SetCurrentZ ldr r0, [r4, #0x3c] bl sub_02059C60 ldr r0, [r4, #0x50] @@ -1885,7 +1885,7 @@ ov05_021E6E90: ; 0x021E6E90 lsl r0, r0, #1 add r4, r4, r0 ldr r0, [r5, #0x3c] - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r6, r0, #0 mov r0, #1 bl sub_02059C00 @@ -1913,7 +1913,7 @@ ov05_021E6E90: ; 0x021E6E90 str r6, [r5, #0x14] ldr r0, [r5, #0x3c] add r1, sp, #0xc - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector ldr r1, [sp, #0x14] ldr r0, [r5, #0x30] cmp r1, r0 @@ -1970,7 +1970,7 @@ ov05_021E6F50: ; 0x021E6F50 add r4, r0, #0 ldr r0, [r4, #0x3c] add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector ldr r1, [sp, #8] ldr r0, [r4, #0x24] add r1, r1, r0 @@ -1988,7 +1988,7 @@ _021E6F70: _021E6F78: ldr r0, [r4, #0x3c] add r1, sp, #0 - bl MapObject_SetPositionVec + bl MapObject_SetPositionVector ldr r0, [r4, #8] add r0, r0, #1 str r0, [r4, #8] @@ -2012,7 +2012,7 @@ ov05_021E6F9C: ; 0x021E6F9C add r4, r0, #0 ldr r0, [r4, #0x3c] add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector ldr r1, [sp, #4] ldr r0, [r4, #0x20] add r1, r1, r0 @@ -2039,7 +2039,7 @@ _021E6FCC: _021E6FD4: ldr r0, [r4, #0x3c] add r1, sp, #0 - bl MapObject_SetPositionVec + bl MapObject_SetPositionVector ldr r0, [r4, #8] add r0, r0, #1 str r0, [r4, #8] @@ -2066,10 +2066,10 @@ _021E7004: bl MapObject_SetCurrentX ldr r0, [r4, #0x3c] ldr r1, [r4, #0x10] - bl MapObject_SetCurrentHeight + bl MapObject_SetCurrentY ldr r0, [r4, #0x3c] ldr r1, [r4, #0x14] - bl MapObject_SetCurrentY + bl MapObject_SetCurrentZ ldr r0, [r4, #0x3c] bl sub_02059C60 ldr r0, [r4, #0x50] @@ -2262,7 +2262,7 @@ _021E7198: str r5, [r4, #0xc] ldr r0, [sp] str r7, [r4, #4] - bl sub_02058914 + bl MapObject_UnpauseMovement add r0, r5, #0 mov r1, #0x80 bl Field_PlayerAvatar_OrrTransitionFlags @@ -2300,7 +2300,7 @@ ov05_021E71E8: ; 0x021E71E8 add r0, r6, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021E7216: pop {r4, r5, r6, pc} @@ -2384,7 +2384,7 @@ ov05_021E727C: ; 0x021E727C ldr r2, [sp] add r1, r6, r7 add r2, r2, r5 - bl sub_02058D74 + bl MapObjectManager_GetFirstObjectWithXAndZ pop {r3, r4, r5, r6, r7, pc} .balign 4, 0 diff --git a/arm9/overlays/05/asm/ov05_021E7504.s b/arm9/overlays/05/asm/ov05_021E7504.s index 55439355e..c15757d9d 100644 --- a/arm9/overlays/05/asm/ov05_021E7504.s +++ b/arm9/overlays/05/asm/ov05_021E7504.s @@ -132,7 +132,7 @@ _021E75EA: add r0, r5, #0 bl FreeToHeap add r0, r7, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021E7606: add sp, #0x24 pop {r4, r5, r6, r7, pc} @@ -161,7 +161,7 @@ ov05_021E7618: ; 0x021E7618 add sp, #0x20 pop {r3, r4, r5, r6, r7, pc} _021E763C: - bl sub_02058914 + bl MapObject_UnpauseMovement add r0, r4, #0 add r1, sp, #0x14 bl sub_02058BA4 @@ -271,7 +271,7 @@ _021E771C: add r0, r5, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021E7740: add sp, #0x20 pop {r3, r4, r5, r6, r7, pc} diff --git a/arm9/overlays/05/asm/ov05_021E779C.s b/arm9/overlays/05/asm/ov05_021E779C.s index d1dcf7835..baa7f059b 100644 --- a/arm9/overlays/05/asm/ov05_021E779C.s +++ b/arm9/overlays/05/asm/ov05_021E779C.s @@ -464,9 +464,9 @@ ov05_021E7AC0: ; 0x021E7AC0 add r0, r5, #0 add r1, sp, #8 str r5, [sp, #0x20] - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 - bl sub_02058744 + bl MapObject_GetPriority add r1, r0, #1 add r0, sp, #0x14 str r0, [sp] @@ -499,7 +499,7 @@ ov05_021E7B08: ; 0x021E7B08 bl MapObject_GetID str r0, [r4, #8] ldr r0, [r4, #0x3c] - bl sub_02058450 + bl MapObject_GetMapID str r0, [r4, #0xc] mov r0, #6 lsl r0, r0, #0xc diff --git a/arm9/overlays/05/asm/ov05_021E8648.s b/arm9/overlays/05/asm/ov05_021E8648.s index 73a3f1dd6..3fb8ece94 100644 --- a/arm9/overlays/05/asm/ov05_021E8648.s +++ b/arm9/overlays/05/asm/ov05_021E8648.s @@ -197,7 +197,7 @@ _021E87B2: mov r0, #1 str r0, [r4, #0x30] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} thumb_func_start ov05_021E87C8 diff --git a/arm9/overlays/05/asm/ov05_021E88E8.s b/arm9/overlays/05/asm/ov05_021E88E8.s index 1e8ff9ab2..3c4df4a74 100644 --- a/arm9/overlays/05/asm/ov05_021E88E8.s +++ b/arm9/overlays/05/asm/ov05_021E88E8.s @@ -733,7 +733,7 @@ ov05_021E8EA8: ; 0x021E8EA8 push {r4, lr} add r4, r0, #0 ldr r0, [r4, #4] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4] bl sub_02012AC4 ldr r0, [r4] diff --git a/arm9/overlays/05/asm/ov05_021ED9C0.s b/arm9/overlays/05/asm/ov05_021ED9C0.s index 26e71df87..91568a89e 100644 --- a/arm9/overlays/05/asm/ov05_021ED9C0.s +++ b/arm9/overlays/05/asm/ov05_021ED9C0.s @@ -96,7 +96,7 @@ ov05_021EDA48: ; 0x021EDA48 add r0, r5, #0 mov r1, #2 str r5, [sp, #0x20] - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #0x14 str r1, [sp] str r0, [sp, #4] @@ -133,7 +133,7 @@ ov05_021EDA98: ; 0x021EDA98 bl MapObject_GetID str r0, [r4, #4] ldr r0, [r4, #0x1c] - bl sub_02058450 + bl MapObject_GetMapID str r0, [r4, #8] add r0, r5, #0 add r1, sp, #0 @@ -192,10 +192,10 @@ ov05_021EDB10: ; 0x021EDB10 _021EDB32: add r0, r4, #0 add r1, sp, #0xc - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r4, #0 add r1, sp, #0 - bl sub_02058B84 + bl MapObject_CopyFacingVector ldr r1, [sp, #0xc] ldr r0, [sp] add r0, r1, r0 diff --git a/arm9/overlays/05/asm/ov05_021EDB70.s b/arm9/overlays/05/asm/ov05_021EDB70.s index b7ac8bfbc..678b2167c 100644 --- a/arm9/overlays/05/asm/ov05_021EDB70.s +++ b/arm9/overlays/05/asm/ov05_021EDB70.s @@ -74,7 +74,7 @@ ov05_021EDBC8: ; 0x021EDBC8 add r0, r4, #0 mov r1, #2 str r5, [sp, #0x1c] - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #0x14 str r1, [sp] str r0, [sp, #4] @@ -110,7 +110,7 @@ ov05_021EDC14: ; 0x021EDC14 bl MapObject_GetID str r0, [r5, #0x14] add r0, r4, #0 - bl sub_02058450 + bl MapObject_GetMapID str r0, [r5, #0x18] mov r0, #1 pop {r3, r4, r5, pc} @@ -179,7 +179,7 @@ _021EDCB8: bl sub_02059BF4 add r7, r0, #0 add r0, r6, #0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ str r0, [sp, #8] ldr r0, [r5, #4] bl sub_02059C00 @@ -191,7 +191,7 @@ _021EDCB8: bl sub_02059E60 add r0, r6, #0 add r1, sp, #0x18 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector ldr r0, [sp, #0x1c] add r1, sp, #0xc str r0, [sp, #0x10] diff --git a/arm9/overlays/05/asm/ov05_021EDE34.s b/arm9/overlays/05/asm/ov05_021EDE34.s index e6417731d..9ab1b01a6 100644 --- a/arm9/overlays/05/asm/ov05_021EDE34.s +++ b/arm9/overlays/05/asm/ov05_021EDE34.s @@ -3712,7 +3712,7 @@ _021EF9EC: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021EF9FE: pop {r4, r5, r6, pc} diff --git a/arm9/overlays/05/asm/ov05_021F0514.s b/arm9/overlays/05/asm/ov05_021F0514.s index 5ea6d2056..4566a2a32 100644 --- a/arm9/overlays/05/asm/ov05_021F0514.s +++ b/arm9/overlays/05/asm/ov05_021F0514.s @@ -1043,7 +1043,7 @@ ov05_021F0D18: ; 0x021F0D18 bl ov05_021F2060 add r0, r4, #0 add r1, sp, #0 - bl sub_02058B94 + bl MapObject_SetFacingVector add sp, #0xc pop {r3, r4, pc} .balign 4, 0 @@ -2251,7 +2251,7 @@ _021F16B8: _021F16BE: add r0, r5, #0 add r1, sp, #0 - bl sub_02058B94 + bl MapObject_SetFacingVector add sp, #0xc pop {r4, r5, pc} nop diff --git a/arm9/overlays/05/asm/ov05_021F1CB8.s b/arm9/overlays/05/asm/ov05_021F1CB8.s index 3443ded90..eb47dcf34 100644 --- a/arm9/overlays/05/asm/ov05_021F1CB8.s +++ b/arm9/overlays/05/asm/ov05_021F1CB8.s @@ -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 @@ -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 @@ -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} @@ -88,14 +88,14 @@ ov05_021F1D68: ; 0x021F1D68 bl NARC_New add r1, r0, #0 add r0, r4, #0 - bl sub_020583F0 + bl MapObjectManager_SetMapModelNarc pop {r4, pc} .balign 4, 0 thumb_func_start ov05_021F1D80 ov05_021F1D80: ; 0x021F1D80 push {r3, lr} - bl sub_020583F4 + bl MapObjectManager_GetMapModelNarc bl NARC_Delete pop {r3, pc} @@ -105,21 +105,21 @@ 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 add r0, r4, #0 lsl r1, r1, #0xe - bl MapObject_GetFlagsBits + bl MapObject_GetFlagsBitsMask cmp r0, #0 beq _021F1DC6 add r0, r4, #0 - bl sub_02058920 + bl MapObject_CheckMovementPaused cmp r0, #0 beq _021F1DC0 add r0, r4, #0 - bl sub_02058AB4 + bl MapObject_CheckFlag4 cmp r0, #0 beq _021F1DC6 _021F1DC0: @@ -162,11 +162,11 @@ _021F1DF8: .word 0x0000FFFF ov05_021F1DFC: ; 0x021F1DFC push {r4, lr} add r4, r0, #0 - bl sub_02058920 + bl MapObject_CheckMovementPaused cmp r0, #1 bne _021F1E16 add r0, r4, #0 - bl sub_02058AB4 + bl MapObject_CheckFlag4 cmp r0, #0 bne _021F1E16 mov r0, #1 @@ -175,7 +175,7 @@ _021F1E16: mov r1, #1 add r0, r4, #0 lsl r1, r1, #8 - bl MapObject_GetFlagsBits + bl MapObject_GetFlagsBitsMask cmp r0, #0 beq _021F1E28 mov r0, #1 @@ -189,7 +189,7 @@ ov05_021F1E2C: ; 0x021F1E2C push {r4, r5, r6, lr} add r4, r1, #0 add r5, r2, #0 - bl sub_020583F4 + bl MapObjectManager_GetMapModelNarc add r1, r4, #0 add r6, r0, #0 bl NARC_GetMemberSize @@ -219,10 +219,10 @@ ov05_021F1E64: ; 0x021F1E64 add r4, r1, #0 add r5, r0, #0 add r1, sp, #0x24 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 add r1, sp, #0x18 - bl sub_02058B84 + bl MapObject_CopyFacingVector add r0, r5, #0 add r1, sp, #0xc bl sub_02058BA4 @@ -261,7 +261,7 @@ ov05_021F1E64: ; 0x021F1E64 ov05_021F1EC0: ; 0x021F1EC0 push {r4, lr} add r4, r0, #0 - bl sub_020584AC + bl MapObject_SetFacingDirection add r0, r4, #0 bl MapObject_CheckFlag14 cmp r0, #1 diff --git a/arm9/overlays/05/asm/ov05_021F1F04.s b/arm9/overlays/05/asm/ov05_021F1F04.s index 6dfb22dd7..234eee981 100644 --- a/arm9/overlays/05/asm/ov05_021F1F04.s +++ b/arm9/overlays/05/asm/ov05_021F1F04.s @@ -474,13 +474,13 @@ 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] cmp r0, r6 beq _021F22CE - bl MapObject_IsInUse + bl MapObject_CheckActive cmp r0, #1 bne _021F22CE ldr r0, [sp] @@ -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 @@ -625,7 +625,7 @@ _021F23D0: mov r0, #0x41 lsl r0, r0, #2 ldr r0, [r5, r0] - bl sub_020583F4 + bl MapObjectManager_GetMapModelNarc add r2, r0, #0 mov r0, #0 str r0, [sp] @@ -2044,7 +2044,7 @@ ov05_021F2E28: ; 0x021F2E28 push {r3, lr} mov r1, #1 lsl r1, r1, #0x16 - bl MapObject_GetFlagsBits + bl MapObject_GetFlagsBitsMask cmp r0, #0 beq _021F2E3A mov r0, #1 @@ -2902,13 +2902,13 @@ ov05_021F3458: ; 0x021F3458 mov r0, #1 strh r0, [r4, #6] ldr r0, [r4, #0x18] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x1c] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x20] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x24] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap mov r0, #1 @@ -3104,12 +3104,12 @@ _021F35EC: ldr r0, [r5, #0x24] bl sub_0201F8F0 add r0, r7, #0 - bl sub_02058A9C + bl MapObject_CheckFlag24 cmp r0, #1 bne _021F367A add r0, r7, #0 mov r1, #2 - bl sub_0205829C + bl MapObject_GetPriorityPlusValue str r0, [sp, #0xc] add r0, r7, #0 mov r1, #1 @@ -3124,7 +3124,7 @@ _021F35EC: _021F3658: add r0, r7, #0 add r1, sp, #0x1c - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r7, #0 bl ov05_021E4C24 ldr r1, [sp, #0xc] @@ -3188,7 +3188,7 @@ ov05_021F36D8: ; 0x021F36D8 pop {r4, r5, r6, pc} _021F36EC: add r0, r4, #0 - bl MapObject_IsInUse + bl MapObject_CheckActive cmp r0, #0 beq _021F3700 add r0, r4, #0 @@ -3212,7 +3212,7 @@ _021F370A: add r0, r5, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, r5, r6, pc} _021F3730: add r0, r4, #0 @@ -3245,7 +3245,7 @@ _021F3758: add r0, r5, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021F377C: pop {r4, r5, r6, pc} .balign 4, 0 diff --git a/arm9/overlays/05/asm/ov05_021F3FE0.s b/arm9/overlays/05/asm/ov05_021F3FE0.s index 5d1c4224d..7a0223a4d 100644 --- a/arm9/overlays/05/asm/ov05_021F3FE0.s +++ b/arm9/overlays/05/asm/ov05_021F3FE0.s @@ -410,7 +410,7 @@ _021F42EA: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} _021F4302: cmp r0, #1 diff --git a/arm9/overlays/05/asm/ov05_021F46C8.s b/arm9/overlays/05/asm/ov05_021F46C8.s index 8f4b29c00..4b342ee55 100644 --- a/arm9/overlays/05/asm/ov05_021F46C8.s +++ b/arm9/overlays/05/asm/ov05_021F46C8.s @@ -332,21 +332,21 @@ ov05_021F491C: ; 0x021F491C str r1, [r4, r0] add r0, #8 ldr r0, [r4, r0] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0xc7 mov r1, #0 lsl r0, r0, #2 str r1, [r4, r0] add r0, r0, #4 ldr r0, [r4, r0] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0x32 mov r1, #0 lsl r0, r0, #4 str r1, [r4, r0] add r0, r0, #4 ldr r0, [r4, r0] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0xc9 mov r1, #0 lsl r0, r0, #2 diff --git a/arm9/overlays/05/asm/ov05_021F5268.s b/arm9/overlays/05/asm/ov05_021F5268.s index 32be24a80..24ad9abfb 100644 --- a/arm9/overlays/05/asm/ov05_021F5268.s +++ b/arm9/overlays/05/asm/ov05_021F5268.s @@ -47,7 +47,7 @@ ov05_021F52AC: ; 0x021F52AC ldr r1, [r4, #0xc] bl sub_0201B3A8 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} thumb_func_start ov05_021F52C8 diff --git a/arm9/overlays/05/asm/ov05_021F5C44.s b/arm9/overlays/05/asm/ov05_021F5C44.s index f1fd12f9a..341c86e2f 100644 --- a/arm9/overlays/05/asm/ov05_021F5C44.s +++ b/arm9/overlays/05/asm/ov05_021F5C44.s @@ -154,7 +154,7 @@ ov05_021F5D68: ; 0x021F5D68 bl sub_0201B6C8 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} thumb_func_start ov05_021F5D7C @@ -188,7 +188,7 @@ ov05_021F5DA8: ; 0x021F5DA8 add r5, r0, #0 bl ov05_021F60C4 add r0, r4, #0 - bl sub_02058914 + bl MapObject_UnpauseMovement mov r0, #1 str r0, [r5, #0xc] pop {r3, r4, r5, pc} diff --git a/arm9/overlays/05/asm/ov05_021F61F4.s b/arm9/overlays/05/asm/ov05_021F61F4.s index cba02bbdd..0c8caf572 100644 --- a/arm9/overlays/05/asm/ov05_021F61F4.s +++ b/arm9/overlays/05/asm/ov05_021F61F4.s @@ -48,7 +48,7 @@ ov05_021F6240: ; 0x021F6240 bl sub_0201B6C8 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} thumb_func_start ov05_021F6254 diff --git a/arm9/overlays/05/src/ov05_021E72FC.c b/arm9/overlays/05/src/ov05_021E72FC.c index 19a46c295..9a693335c 100644 --- a/arm9/overlays/05/src/ov05_021E72FC.c +++ b/arm9/overlays/05/src/ov05_021E72FC.c @@ -9,18 +9,15 @@ #include "unk_020051F4.h" extern LocalMapObject *PlayerAvatar_GetMapObject(u32 param0); -extern u32 sub_02058720(LocalMapObject *object); extern BOOL sub_02054B30(u8 param0); extern BOOL sub_02054B3C(u8 param0); extern BOOL sub_02054B48(u8 param0); extern BOOL sub_02054B54(u8 param0); -extern void MapObject_SetFlagsBits(LocalMapObject *object, u32 bits); extern BOOL sub_02057254(u32 param0); extern u32 sub_0205AFDC(u32 param0, u32 param1); extern void sub_02057260(u32 param0, u32 param1); extern void sub_02055304(u32 param0, u32 param1); extern BOOL sub_02056B74(u32 param0, LocalMapObject *object, u32 param2); -extern void MapObject_ClearFlagsBits(LocalMapObject *object, u32 bits); BOOL ov05_021E72FC(FieldSystem *fieldSystem, u32 param1) { u8 res = (u8)sub_02058720(PlayerAvatar_GetMapObject(param1)); diff --git a/arm9/overlays/06/asm/overlay_06.s b/arm9/overlays/06/asm/overlay_06.s index 0a821dbd5..dd3fcbcff 100644 --- a/arm9/overlays/06/asm/overlay_06.s +++ b/arm9/overlays/06/asm/overlay_06.s @@ -215,7 +215,7 @@ ov06_0223981C: ; 0x0223981C ldr r0, [r0, #8] bl ov06_02239790 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 @@ -233,7 +233,7 @@ ov06_02239840: ; 0x02239840 ldr r0, [r0, #8] bl ov06_0223986C add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} thumb_func_start ov06_02239864 @@ -300,7 +300,7 @@ ov06_022398BC: ; 0x022398BC add r3, r1, #0 bl ov05_021E8698 add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} .align 2, 0 @@ -1131,7 +1131,7 @@ _02239F18: lsl r0, r0, #0x10 lsr r6, r0, #0x10 add r0, r5, #0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ lsl r0, r0, #0x10 lsr r5, r0, #0x10 mov r0, #4 @@ -2137,7 +2137,7 @@ ov06_0223A660: ; 0x0223A660 ldr r0, [r4, #0x20] cmp r0, #0 beq _0223A672 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x20] _0223A672: @@ -2159,7 +2159,7 @@ ov06_0223A67C: ; 0x0223A67C ldr r0, [r5, #0x20] cmp r0, #0 beq _0223A69A - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r5, #0x20] _0223A69A: @@ -2239,7 +2239,7 @@ _0223A720: pop {r4, pc} _0223A736: ldr r0, [r4, #0x20] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x20] ldr r0, [r4, #0x1c] @@ -2520,7 +2520,7 @@ _0223A936: mov r2, #1 sub r1, r3, #4 str r2, [r4, r1] - bl sub_0200CAB4 + bl SysTask_Destroy _0223A940: add sp, #8 pop {r4, pc} @@ -2583,7 +2583,7 @@ _0223A9AC: mov r2, #5 sub r1, r1, #4 str r2, [r4, r1] - bl sub_0200CAB4 + bl SysTask_Destroy _0223A9B6: pop {r4, pc} @@ -3000,7 +3000,7 @@ ov06_0223ACD8: ; 0x0223ACD8 bl ov06_0223ADB4 ldr r0, [r4, #8] add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector mov r0, #1 ldr r1, [sp, #8] lsl r0, r0, #0x10 @@ -4674,7 +4674,7 @@ ov06_0223B8EC: ; 0x0223B8EC ldr r0, [r0, #0x34] bl MapObjectManager_GetFirstActiveObjectByID add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector ldr r1, [sp] ldr r2, [sp, #4] ldr r3, [sp, #8] @@ -13617,7 +13617,7 @@ ov06_02240164: ; 0x02240164 add r0, #0x88 str r1, [r0] add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02240192: pop {r4, pc} .align 2, 0 @@ -13885,7 +13885,7 @@ _022403D0: cmp r5, #0 beq _022403DA add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _022403DA: pop {r3, r4, r5, pc} .align 2, 0 @@ -14079,7 +14079,7 @@ _02240574: add r0, r4, #0 bl ov06_02240724 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0x44 pop {r3, r4, r5, r6, pc} _0224058E: @@ -14178,7 +14178,7 @@ ov06_0224062C: ; 0x0224062C tst r0, r1 beq _0224065E add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy bl ov06_0223F8B4 ldr r0, _02240660 ; =0x02252420 mov r1, #1 @@ -14236,7 +14236,7 @@ ov06_022406A8: ; 0x022406A8 add r0, r4, #0 bl ov06_0223F270 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _022406CE: pop {r3, r4, r5, pc} .align 2, 0 @@ -14275,7 +14275,7 @@ ov06_022406EC: ; 0x022406EC add r0, r4, #0 bl ov06_0223F270 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02240718: pop {r3, r4, r5, pc} nop @@ -23508,7 +23508,7 @@ _02244F78: mov r3, #1 add r2, r2, #4 str r3, [r1, r2] - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, pc} thumb_func_start ov06_02244F84 @@ -26557,7 +26557,7 @@ ov06_022466AC: ; 0x022466AC bl sub_0201B6C8 bl ov06_022466E0 add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} thumb_func_start ov06_022466C0 @@ -27502,7 +27502,7 @@ ov06_02246D8C: ; 0x02246D8C ldr r0, [r4, r0] cmp r0, #0 beq _02246DA6 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0x85 mov r1, #0 lsl r0, r0, #2 @@ -27642,7 +27642,7 @@ _02246E94: lsl r0, r0, #2 str r1, [r6, r0] ldr r0, [sp] - bl sub_0200CAB4 + bl SysTask_Destroy _02246EA2: pop {r3, r4, r5, r6, r7, pc} @@ -27696,7 +27696,7 @@ ov06_02246EDC: ; 0x02246EDC lsl r0, r0, #2 str r1, [r4, r0] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02246F0A: pop {r3, r4, r5, pc} @@ -28683,7 +28683,7 @@ _022476B6: mov r0, #0x86 lsl r0, r0, #2 ldr r0, [r4, r0] - bl sub_0200CAB4 + bl SysTask_Destroy mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -30413,7 +30413,7 @@ ov06_022483EC: ; 0x022483EC bl sub_0201B6C8 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} thumb_func_start ov06_02248400 @@ -30715,7 +30715,7 @@ ov06_02248654: ; 0x02248654 ldr r0, [r0, #0x38] bl PlayerAvatar_GetMapObject add r5, r0, #0 - bl sub_02058914 + bl MapObject_UnpauseMovement add r0, r5, #0 add r1, r4, #0 bl MapObject_SetVisible @@ -32387,11 +32387,11 @@ _0224930C: .word ov06_02249388 thumb_func_start ov06_02249310 ov06_02249310: ; 0x02249310 - ldr r3, _02249318 ; =sub_0200CAB4 + ldr r3, _02249318 ; =SysTask_Destroy ldr r0, [r0, #0x24] bx r3 nop -_02249318: .word sub_0200CAB4 +_02249318: .word SysTask_Destroy thumb_func_start ov06_0224931C ov06_0224931C: ; 0x0224931C @@ -32663,10 +32663,10 @@ ov06_02249508: ; 0x02249508 add r0, r5, #0 add r1, sp, #8 str r5, [sp, #0x1c] - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 mov r1, #2 - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #0x14 str r1, [sp] str r0, [sp, #4] @@ -32710,7 +32710,7 @@ ov06_0224954C: ; 0x0224954C bl sub_02058750 b _02249592 _0224958E: - bl sub_02058450 + bl MapObject_GetMapID _02249592: str r0, [r4, #8] mov r0, #1 @@ -32764,7 +32764,7 @@ _022495D6: _022495EE: add r0, r6, #0 add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 add r1, sp, #0 bl sub_0206476C @@ -32838,10 +32838,10 @@ ov06_02249668: ; 0x02249668 add r0, r5, #0 add r1, sp, #8 str r5, [sp, #0x1c] - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 mov r1, #2 - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #0x14 str r1, [sp] str r0, [sp, #4] @@ -32888,7 +32888,7 @@ _022496D0: _022496E8: add r0, r6, #0 add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 add r1, sp, #0 bl sub_0206476C @@ -33039,10 +33039,10 @@ ov06_022497E8: ; 0x022497E8 add r0, r5, #0 add r1, sp, #0x18 str r5, [sp, #0x14] - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 mov r1, #2 - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #8 str r1, [sp] str r0, [sp, #4] @@ -33077,7 +33077,7 @@ ov06_02249834: ; 0x02249834 bl MapObject_GetID str r0, [r4] ldr r0, [r4, #0x20] - bl sub_02058450 + bl MapObject_GetMapID str r0, [r4, #4] ldr r0, [r4, #0x20] bl MapObject_GetSpriteID @@ -33148,7 +33148,7 @@ _022498DE: cmp r0, #0 beq _022498FC add r0, r6, #0 - bl sub_02058A9C + bl MapObject_CheckFlag24 cmp r0, #0 bne _02249906 _022498FC: @@ -33224,7 +33224,7 @@ _02249976: cmp r0, #0 beq _02249994 add r0, r4, #0 - bl sub_02058A9C + bl MapObject_CheckFlag24 cmp r0, #0 bne _0224999E _02249994: @@ -33237,7 +33237,7 @@ _0224999E: cmp r0, #0 beq _022499FA add r0, r4, #0 - bl sub_02058890 + bl MapObject_CheckVisible cmp r0, #1 ldr r0, [r5, #0x24] bne _022499B8 @@ -33289,13 +33289,13 @@ ov06_02249A00: ; 0x02249A00 str r1, [sp, #4] ldr r0, [sp] add r1, r4, #0 - bl sub_02058B84 + bl MapObject_CopyFacingVector ldr r0, [r4, #8] add r1, r4, #0 neg r6, r0 ldr r0, [sp] ldr r7, [r4] - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector ldr r0, [r5, #0x14] add r1, r4, #0 bl sub_02059E9C @@ -33893,23 +33893,23 @@ ov06_02249E9C: ; 0x02249E9C sub sp, #0x34 add r5, r0, #0 add r4, r1, #0 - bl sub_02058B14 + bl MapObject_GetPreviousX str r0, [sp, #0xc] add r0, r5, #0 - bl sub_02058B24 + bl MapObject_GetPreviousZ str r0, [sp, #0x10] add r0, r5, #0 - bl MapObject_GetPosVecYCoord + bl MapObject_GetPositionVectorYCoord add r6, r0, #0 add r0, r5, #0 bl MapObject_GetFacingDirection str r0, [sp, #0x14] add r0, r5, #0 - bl sub_020584C8 + bl MapObject_GetPreviousFacingDirection str r0, [sp, #0x18] add r0, r5, #0 mov r1, #2 - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r7, r0, #0 add r0, r5, #0 bl ov05_021E4C24 @@ -34281,7 +34281,7 @@ _0224A160: mov r1, #2 str r4, [sp, #0x6c] str r5, [sp, #0xc4] - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #0x68 str r1, [sp] str r0, [sp, #4] @@ -34320,7 +34320,7 @@ _0224A1AC: bl sub_02058750 b _0224A1D2 _0224A1CE: - bl sub_02058450 + bl MapObject_GetMapID _0224A1D2: str r0, [r4, #8] mov r0, #1 @@ -34351,10 +34351,10 @@ ov06_0224A1DC: ; 0x0224A1DC _0224A1FE: add r0, r5, #0 add r1, sp, #0xc - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 add r1, sp, #0 - bl sub_02058B84 + bl MapObject_CopyFacingVector ldr r1, [sp, #0xc] ldr r0, [sp] ldr r2, [sp, #0x14] @@ -34506,9 +34506,9 @@ ov06_0224A310: ; 0x0224A310 add r0, r5, #0 add r1, sp, #8 str r5, [sp, #0x1c] - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 - bl sub_02058744 + bl MapObject_GetPriority add r1, r0, #1 add r0, sp, #0x14 str r0, [sp] @@ -34539,7 +34539,7 @@ ov06_0224A354: ; 0x0224A354 bl MapObject_GetID str r0, [r4] ldr r0, [r4, #0x18] - bl sub_02058450 + bl MapObject_GetMapID str r0, [r4, #4] mov r0, #1 pop {r4, pc} @@ -34595,7 +34595,7 @@ _0224A3D0: str r0, [r5, #0xc] add r0, r4, #0 add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r6, #0 add r1, sp, #0 bl sub_0206476C @@ -34994,7 +34994,7 @@ ov06_0224A6B8: ; 0x0224A6B8 mov r1, #2 str r4, [sp, #0x14] str r5, [sp, #0x1c] - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #0x14 str r1, [sp] str r0, [sp, #4] @@ -35068,15 +35068,15 @@ ov06_0224A710: ; 0x0224A710 bl MapObject_GetID str r0, [r5, #4] ldr r0, [r5, #0x18] - bl sub_02058450 + bl MapObject_GetMapID str r0, [r5, #8] ldr r5, [r5, #0x18] add r1, sp, #0xc add r0, r5, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 add r1, sp, #0 - bl sub_02058B84 + bl MapObject_CopyFacingVector ldr r1, [sp, #0xc] ldr r0, [sp] add r0, r1, r0 @@ -35158,10 +35158,10 @@ _0224A828: bne _0224A86C add r0, r6, #0 add r1, sp, #0xc - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r6, #0 add r1, sp, #0 - bl sub_02058B84 + bl MapObject_CopyFacingVector ldr r1, [sp, #0xc] ldr r0, [sp] add r0, r1, r0 @@ -35265,7 +35265,7 @@ ov06_0224A8D4: ; 0x0224A8D4 mov r1, #2 str r4, [sp, #0x14] str r5, [sp, #0x1c] - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #0x14 str r1, [sp] str r0, [sp, #4] @@ -35295,7 +35295,7 @@ ov06_0224A918: ; 0x0224A918 bl MapObject_GetID str r0, [r4, #4] ldr r0, [r4, #0x14] - bl sub_02058450 + bl MapObject_GetMapID str r0, [r4, #8] mov r0, #1 pop {r4, pc} @@ -35326,10 +35326,10 @@ ov06_0224A948: ; 0x0224A948 _0224A96A: add r0, r5, #0 add r1, sp, #0xc - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 add r1, sp, #0 - bl sub_02058B84 + bl MapObject_CopyFacingVector ldr r1, [sp, #0xc] ldr r0, [sp] add r0, r1, r0 @@ -35455,7 +35455,7 @@ ov06_0224AA40: ; 0x0224AA40 mov r1, #2 str r4, [sp, #0x14] str r5, [sp, #0x1c] - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #0x14 str r1, [sp] str r0, [sp, #4] @@ -35485,7 +35485,7 @@ ov06_0224AA84: ; 0x0224AA84 bl MapObject_GetID str r0, [r4, #4] ldr r0, [r4, #0x14] - bl sub_02058450 + bl MapObject_GetMapID str r0, [r4, #8] mov r0, #1 pop {r4, pc} @@ -35516,10 +35516,10 @@ ov06_0224AAB4: ; 0x0224AAB4 _0224AAD6: add r0, r5, #0 add r1, sp, #0xc - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 add r1, sp, #0 - bl sub_02058B84 + bl MapObject_CopyFacingVector ldr r1, [sp, #0xc] ldr r0, [sp] add r0, r1, r0 @@ -35670,14 +35670,14 @@ _0224ABF6: add r1, sp, #0x14 str r0, [r2] add r0, r5, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 add r1, sp, #8 bl sub_02058BB4 _0224AC12: add r0, r5, #0 mov r1, #2 - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #0x20 str r1, [sp] str r0, [sp, #4] @@ -35711,7 +35711,7 @@ ov06_0224AC38: ; 0x0224AC38 bl MapObject_GetID str r0, [r5, #0xc] add r0, r4, #0 - bl sub_02058450 + bl MapObject_GetMapID str r0, [r5, #0x10] ldr r0, [r7] str r0, [r5, #8] @@ -35814,7 +35814,7 @@ _0224AD06: bl sub_02058BB4 add r0, r4, #0 add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector mov r0, #1 ldr r1, [r5, #0x1c] lsl r0, r0, #0xc @@ -36005,7 +36005,7 @@ ov06_0224AE78: ; 0x0224AE78 ldr r0, [r4, #0xc] cmp r0, #0 beq _0224AE8C - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0xc] str r0, [r4, #8] @@ -36060,7 +36060,7 @@ ov06_0224AEC0: ; 0x0224AEC0 mov r0, #1 str r0, [r4, #8] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 @@ -36108,11 +36108,11 @@ ov06_0224AEE8: ; 0x0224AEE8 _0224AF3E: add r0, r5, #0 add r1, sp, #0xc - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector _0224AF46: add r0, r5, #0 mov r1, #2 - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #0x18 str r1, [sp] str r0, [sp, #4] @@ -36192,7 +36192,7 @@ ov06_0224AFC4: ; 0x0224AFC4 bl sub_02058BB4 add r0, r4, #0 add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 add r1, sp, #0 bl sub_0206476C @@ -36382,7 +36382,7 @@ ov06_0224B124: ; 0x0224B124 add r0, r2, r0 str r0, [sp, #0x18] add r0, r5, #0 - bl sub_02058B1C + bl MapObject_GetPreviousY lsl r1, r0, #0xf mov r0, #2 lsl r0, r0, #0xe @@ -36390,7 +36390,7 @@ ov06_0224B124: ; 0x0224B124 str r0, [sp, #0x14] add r0, r5, #0 mov r1, #2 - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #8 str r1, [sp] str r0, [sp, #4] @@ -36588,7 +36588,7 @@ ov06_0224B2C4: ; 0x0224B2C4 add r0, r1, r0 str r0, [sp, #0x18] add r0, r5, #0 - bl sub_02058B1C + bl MapObject_GetPreviousY lsl r1, r0, #0xf mov r0, #2 lsl r0, r0, #0xe @@ -36596,7 +36596,7 @@ ov06_0224B2C4: ; 0x0224B2C4 str r0, [sp, #0x14] add r0, r5, #0 mov r1, #2 - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #8 str r1, [sp] str r0, [sp, #4] @@ -36890,10 +36890,10 @@ ov06_0224B568: ; 0x0224B568 bl MapObject_GetCurrentX str r0, [sp, #8] add r0, r5, #0 - bl MapObject_GetCurrentHeight + bl MapObject_GetCurrentY str r0, [sp, #0xc] add r0, r5, #0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ str r0, [sp, #0x10] add r0, r4, #0 str r4, [sp, #0x18] @@ -36906,10 +36906,10 @@ ov06_0224B568: ; 0x0224B568 add r0, r5, #0 add r1, sp, #0x24 str r5, [sp, #0x20] - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 mov r1, #2 - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #8 str r1, [sp] str r0, [sp, #4] @@ -36948,7 +36948,7 @@ ov06_0224B5D0: ; 0x0224B5D0 bl MapObject_GetID str r0, [r4, #8] ldr r0, [r4, #0x30] - bl sub_02058450 + bl MapObject_GetMapID str r0, [r4, #0xc] ldr r0, [r4, #0x18] lsl r0, r0, #0x10 @@ -36957,7 +36957,7 @@ ov06_0224B5D0: ; 0x0224B5D0 lsl r0, r0, #0x10 str r0, [sp, #8] ldr r0, [r4, #0x30] - bl MapObject_GetPosVecYCoord + bl MapObject_GetPositionVectorYCoord str r0, [sp, #4] ldr r0, [r4, #0x24] add r1, sp, #0 @@ -37095,7 +37095,7 @@ _0224B72A: bl MapObject_GetCurrentX add r7, r0, #0 add r0, r6, #0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ ldr r1, [r4, #0x18] cmp r1, r7 bne _0224B744 @@ -37479,7 +37479,7 @@ ov06_0224B9E0: ; 0x0224B9E0 add r0, r5, #0 mov r1, #2 str r5, [sp, #0x20] - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #0x14 str r1, [sp] str r0, [sp, #4] @@ -37519,7 +37519,7 @@ ov06_0224BA30: ; 0x0224BA30 bl MapObject_GetID str r0, [r4, #8] ldr r0, [r4, #0x20] - bl sub_02058450 + bl MapObject_GetMapID str r0, [r4, #0xc] add r0, r5, #0 add r1, sp, #0 @@ -37565,7 +37565,7 @@ _0224BAB4: cmp r6, #1 bne _0224BAD2 add r0, r7, #0 - bl sub_02058A00 + bl MapObject_CheckFlag26 cmp r0, #0 bne _0224BAD2 add r0, r5, #0 @@ -37621,7 +37621,7 @@ ov06_0224BB0C: ; 0x0224BB0C _0224BB30: add r0, r6, #0 add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector mov r0, #2 ldr r1, [sp, #8] lsl r0, r0, #0xe @@ -37729,19 +37729,19 @@ ov06_0224BBEC: ; 0x0224BBEC add r0, r5, #0 add r1, sp, #8 str r5, [sp, #0x20] - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 bl MapObject_GetCurrentX add r6, r0, #0 add r0, r5, #0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r1, r0, #0 add r0, r6, #0 add r2, sp, #8 bl sub_02059E60 add r0, r5, #0 mov r1, #2 - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #0x14 str r1, [sp] str r0, [sp, #4] @@ -37773,7 +37773,7 @@ ov06_0224BC50: ; 0x0224BC50 bl MapObject_GetID str r0, [r4, #4] ldr r0, [r4, #0x1c] - bl sub_02058450 + bl MapObject_GetMapID str r0, [r4, #8] add r0, r5, #0 add r1, sp, #0 @@ -37928,10 +37928,10 @@ ov06_0224BD90: ; 0x0224BD90 bl MapObject_GetCurrentX str r0, [sp, #8] add r0, r5, #0 - bl MapObject_GetCurrentHeight + bl MapObject_GetCurrentY str r0, [sp, #0xc] add r0, r5, #0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ str r0, [sp, #0x10] add r0, r4, #0 str r4, [sp, #0x18] @@ -37944,10 +37944,10 @@ ov06_0224BD90: ; 0x0224BD90 add r0, r5, #0 add r1, sp, #0x24 str r5, [sp, #0x20] - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 mov r1, #2 - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #8 str r1, [sp] str r0, [sp, #4] @@ -37986,7 +37986,7 @@ ov06_0224BDF8: ; 0x0224BDF8 bl MapObject_GetID str r0, [r4, #8] ldr r0, [r4, #0x30] - bl sub_02058450 + bl MapObject_GetMapID str r0, [r4, #0xc] ldr r0, [r4, #0x18] lsl r0, r0, #0x10 @@ -37995,7 +37995,7 @@ ov06_0224BDF8: ; 0x0224BDF8 lsl r0, r0, #0x10 str r0, [sp, #8] ldr r0, [r4, #0x30] - bl MapObject_GetPosVecYCoord + bl MapObject_GetPositionVectorYCoord str r0, [sp, #4] ldr r0, [r4, #0x24] add r1, sp, #0 @@ -38124,7 +38124,7 @@ _0224BF40: bl MapObject_GetCurrentX add r7, r0, #0 add r0, r6, #0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ ldr r1, [r4, #0x18] cmp r1, r7 bne _0224BF5A @@ -38255,10 +38255,10 @@ ov06_0224C038: ; 0x0224C038 bl MapObject_GetCurrentX str r0, [sp, #8] add r0, r5, #0 - bl MapObject_GetCurrentHeight + bl MapObject_GetCurrentY str r0, [sp, #0xc] add r0, r5, #0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ str r0, [sp, #0x10] add r0, r4, #0 str r4, [sp, #0x18] @@ -38271,10 +38271,10 @@ ov06_0224C038: ; 0x0224C038 add r0, r5, #0 add r1, sp, #0x24 str r5, [sp, #0x20] - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 mov r1, #2 - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #8 str r1, [sp] str r0, [sp, #4] @@ -38313,7 +38313,7 @@ ov06_0224C0A0: ; 0x0224C0A0 bl MapObject_GetID str r0, [r4, #8] ldr r0, [r4, #0x30] - bl sub_02058450 + bl MapObject_GetMapID str r0, [r4, #0xc] ldr r0, [r4, #0x18] lsl r0, r0, #0x10 @@ -38322,7 +38322,7 @@ ov06_0224C0A0: ; 0x0224C0A0 lsl r0, r0, #0x10 str r0, [sp, #8] ldr r0, [r4, #0x30] - bl MapObject_GetPosVecYCoord + bl MapObject_GetPositionVectorYCoord str r0, [sp, #4] ldr r0, [r4, #0x24] add r1, sp, #0 @@ -38457,7 +38457,7 @@ _0224C1F4: bl MapObject_GetCurrentX add r7, r0, #0 add r0, r6, #0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ ldr r1, [r4, #0x18] cmp r1, r7 bne _0224C20E @@ -40121,7 +40121,7 @@ ov06_0224CECC: ; 0x0224CECC bl MapObject_GetCurrentX str r0, [sp, #8] add r0, r5, #0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r1, r0, #0 ldr r0, [sp, #8] add r2, sp, #0x20 @@ -40141,7 +40141,7 @@ ov06_0224CECC: ; 0x0224CECC str r0, [sp, #0x1c] add r0, r5, #0 mov r1, #2 - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #0xc str r1, [sp] str r0, [sp, #4] @@ -40174,7 +40174,7 @@ ov06_0224CF3C: ; 0x0224CF3C bl MapObject_GetID str r0, [r5, #8] add r0, r4, #0 - bl sub_02058450 + bl MapObject_GetMapID str r0, [r5, #0xc] mov r0, #1 pop {r3, r4, r5, pc} @@ -40661,19 +40661,19 @@ ov06_0224D2E0: ; 0x0224D2E0 add r0, r5, #0 add r1, sp, #8 str r5, [sp, #0x20] - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r5, #0 bl MapObject_GetCurrentX add r6, r0, #0 add r0, r5, #0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r1, r0, #0 add r0, r6, #0 add r2, sp, #8 bl sub_02059E60 add r0, r5, #0 mov r1, #2 - bl sub_0205829C + bl MapObject_GetPriorityPlusValue add r1, sp, #0x14 str r1, [sp] str r0, [sp, #4] @@ -40705,7 +40705,7 @@ ov06_0224D344: ; 0x0224D344 bl MapObject_GetID str r0, [r4, #4] ldr r0, [r4, #0x1c] - bl sub_02058450 + bl MapObject_GetMapID str r0, [r4, #8] add r0, r5, #0 add r1, sp, #0 @@ -43301,12 +43301,12 @@ ov06_0224E858: ; 0x0224E858 bl MapObjectManager_GetFirstActiveObjectByID add r6, r0, #0 add r1, sp, #0 - bl MapObject_GetPositionVec + bl MapObject_CopyPositionVector add r0, r6, #0 bl MapObject_GetCurrentX add r5, r0, #0 add r0, r6, #0 - bl MapObject_GetCurrentY + bl MapObject_GetCurrentZ add r4, r0, #0 add r0, r6, #0 bl MapObject_GetFacingDirection @@ -44491,7 +44491,7 @@ _0224F102: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0224F120: pop {r3, r4, r5, pc} nop diff --git a/arm9/overlays/08/asm/overlay_08.s b/arm9/overlays/08/asm/overlay_08.s index 744398f01..7b588f50d 100644 --- a/arm9/overlays/08/asm/overlay_08.s +++ b/arm9/overlays/08/asm/overlay_08.s @@ -147,7 +147,7 @@ _02211F4E: bl GF_AssertFail _02211F52: add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} .align 2, 0 @@ -1042,7 +1042,7 @@ _022125A2: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _022125AE: pop {r3, r4, r5, pc} .align 2, 0 @@ -3074,7 +3074,7 @@ ov08_02213454: ; 0x02213454 cmp r0, #0 beq _0221349E ldr r0, [r0, #0xc] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0x5e lsl r0, r0, #2 ldr r0, [r4, r0] @@ -3093,7 +3093,7 @@ _02213480: cmp r0, #0 beq _0221349E ldr r0, [r0, #0xc] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, r5] bl FreeToHeap mov r0, #0 @@ -3767,7 +3767,7 @@ ov08_022139FC: ; 0x022139FC ldr r2, [r1, #0xc] cmp r2, #0 bne _02213A0A - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, pc} _02213A0A: mov r0, #0x4e @@ -5184,7 +5184,7 @@ ov08_022144C0: ; 0x022144C0 add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} _022144DA: mov r3, #4 @@ -5474,7 +5474,7 @@ ov08_022146E4: ; 0x022146E4 add r0, r5, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #8 pop {r3, r4, r5, r6, r7, pc} _02214712: @@ -5729,7 +5729,7 @@ ov08_022148E0: ; 0x022148E0 add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0221490A: pop {r3, r4, r5, pc} .align 2, 0 @@ -13993,7 +13993,7 @@ ov08_0221868C: ; 0x0221868C mov r0, #1 str r0, [r4, #0x24] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} _022186A8: mov r0, #0 @@ -14127,12 +14127,12 @@ _0221878A: ldr r0, [r4, #4] cmp r0, #0 beq _02218794 - bl sub_0200CAB4 + bl SysTask_Destroy _02218794: ldr r0, [r4] cmp r0, #0 beq _0221879E - bl sub_0200CAB4 + bl SysTask_Destroy _0221879E: bl sub_020129C8 pop {r4, pc} @@ -14620,7 +14620,7 @@ ov08_02218B08: ; 0x02218B08 bl GF_AssertFail _02218B12: ldr r0, [r4, #4] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap pop {r4, pc} @@ -14913,7 +14913,7 @@ _02218D24: strb r0, [r4] pop {r4, pc} _02218D2A: - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap pop {r4, pc} @@ -45389,7 +45389,7 @@ _02228504: ldr r0, [r4] bl NARC_Delete ldr r0, [sp] - bl sub_0200CAB4 + bl SysTask_Destroy _02228520: add sp, #0x24 pop {r4, r5, r6, r7, pc} @@ -45523,7 +45523,7 @@ _02228606: add r6, #0x88 str r0, [r6] ldr r0, [sp] - bl sub_0200CAB4 + bl SysTask_Destroy _02228616: pop {r3, r4, r5, r6, r7, pc} @@ -45554,7 +45554,7 @@ ov08_02228620: ; 0x02228620 mov r1, #1 bl sub_02013440 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap pop {r3, r4, r5, pc} @@ -48245,7 +48245,7 @@ _02229A36: add r0, r4, #0 add r0, #0xcc ldr r0, [r0] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap pop {r4, pc} @@ -49216,7 +49216,7 @@ _0222A176: ldr r0, [r1, #0x18] cmp r0, #0 beq _0222A194 - bl sub_0200CAB4 + bl SysTask_Destroy _0222A194: add r4, r4, #1 add r5, r5, #4 @@ -49293,7 +49293,7 @@ ov08_0222A208: ; 0x0222A208 ldr r0, [r4, #0x10] bl ov08_02215B40 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0222A228: pop {r3, r4, r5, pc} .align 2, 0 diff --git a/arm9/overlays/11/asm/ov11_0222D5C0_1.s b/arm9/overlays/11/asm/ov11_0222D5C0_1.s index e8518e5ec..ea6240c24 100644 --- a/arm9/overlays/11/asm/ov11_0222D5C0_1.s +++ b/arm9/overlays/11/asm/ov11_0222D5C0_1.s @@ -1373,9 +1373,9 @@ _0222E1AC: mov r0, #2 bl sub_02002CF8 ldr r0, [r4, #0x1c] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x20] - bl sub_0200CAB4 + bl SysTask_Destroy bl sub_0201CD04 ldr r0, [r4] bl ov11_0222EFD4 @@ -3372,7 +3372,7 @@ ov11_0222F254: ; 0x0222F254 cmp r0, #0 bne _0222F27C add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0222F27C: pop {r3, r4, r5, pc} nop diff --git a/arm9/overlays/11/asm/ov11_02232264.s b/arm9/overlays/11/asm/ov11_02232264.s index 2143760b3..da51549af 100644 --- a/arm9/overlays/11/asm/ov11_02232264.s +++ b/arm9/overlays/11/asm/ov11_02232264.s @@ -18298,7 +18298,7 @@ _0223B298: add r0, r4, #0 bl FreeToHeap ldr r0, [sp, #0x14] - bl sub_0200CAB4 + bl SysTask_Destroy _0223B2AE: add sp, #0xd4 pop {r4, r5, r6, r7, pc} @@ -19727,7 +19727,7 @@ _0223BEBE: add r0, r4, #0 bl FreeToHeap ldr r0, [sp, #0x10] - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0x158 pop {r3, r4, r5, r6, r7, pc} _0223BED8: @@ -19808,7 +19808,7 @@ _0223BF5E: add r0, r4, #0 bl FreeToHeap ldr r0, [sp, #0x10] - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0x158 pop {r3, r4, r5, r6, r7, pc} _0223BF8E: @@ -19839,7 +19839,7 @@ _0223BFB2: add r0, r4, #0 bl FreeToHeap ldr r0, [sp, #0x10] - bl sub_0200CAB4 + bl SysTask_Destroy _0223BFD0: add sp, #0x158 pop {r3, r4, r5, r6, r7, pc} diff --git a/arm9/overlays/11/asm/ov11_0224D550.s b/arm9/overlays/11/asm/ov11_0224D550.s index 30d366595..b19331607 100644 --- a/arm9/overlays/11/asm/ov11_0224D550.s +++ b/arm9/overlays/11/asm/ov11_0224D550.s @@ -3697,7 +3697,7 @@ _0224F2C2: add r0, r4, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0224F2D8: add sp, #0x6c pop {r3, r4, r5, r6, pc} @@ -4288,7 +4288,7 @@ _0224F7A2: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0224F7C0: add sp, #0x9c pop {r4, r5, pc} @@ -4984,7 +4984,7 @@ _0224FD68: add r0, r4, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0224FD86: add sp, #0x1c4 pop {r3, r4, r5, r6, pc} @@ -5277,7 +5277,7 @@ _0224FFC0: add r0, r4, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0224FFDE: add sp, #0x138 pop {r4, r5, r6, pc} @@ -5337,7 +5337,7 @@ _02250048: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0225005E: pop {r3, r4, r5, pc} @@ -5661,7 +5661,7 @@ _022502CA: add r0, r4, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #4 pop {r3, r4, r5, r6, pc} _022502E4: @@ -6340,7 +6340,7 @@ _02250874: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0225088A: add sp, #0xd0 pop {r3, r4, r5, r6, r7, pc} @@ -6414,7 +6414,7 @@ _02250906: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0225092A: pop {r3, r4, r5, pc} @@ -6479,7 +6479,7 @@ _0225099A: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _022509B0: pop {r3, r4, r5, pc} .align 2, 0 @@ -6542,7 +6542,7 @@ _02250A0A: mov r0, #0 str r0, [r4, #0x10] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02250A26: pop {r3, r4, r5, pc} @@ -6576,7 +6576,7 @@ _02250A48: mov r0, #0 str r0, [r4, #0x10] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 mov r1, #0 bl ov11_022572AC @@ -7162,7 +7162,7 @@ _02250F14: add r0, r4, #0 bl FreeToHeap ldr r0, [sp] - bl sub_0200CAB4 + bl SysTask_Destroy _02250F3E: add sp, #0x4c pop {r4, r5, r6, r7, pc} @@ -7187,7 +7187,7 @@ ov11_02250F44: ; 0x02250F44 add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} thumb_func_start ov11_02250F74 @@ -7202,7 +7202,7 @@ ov11_02250F74: ; 0x02250F74 add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 @@ -7255,7 +7255,7 @@ _02250FF2: add r0, r4, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, r5, r6, pc} nop _0225100C: .word ov11_0225E830 @@ -7277,7 +7277,7 @@ ov11_02251014: ; 0x02251014 add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} thumb_func_start ov11_0225103C @@ -7459,7 +7459,7 @@ _0225118E: add r0, r4, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _022511B6: add sp, #0x3c pop {r4, r5, r6, r7, pc} @@ -7558,7 +7558,7 @@ _0225126C: add r0, r6, #0 bl FreeToHeap ldr r0, [sp, #8] - bl sub_0200CAB4 + bl SysTask_Destroy _0225128C: add sp, #0x20 pop {r3, r4, r5, r6, r7, pc} @@ -7577,7 +7577,7 @@ ov11_02251294: ; 0x02251294 add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 @@ -7752,7 +7752,7 @@ _022513F8: add r0, r4, #0 bl FreeToHeap ldr r0, [sp] - bl sub_0200CAB4 + bl SysTask_Destroy _02251418: add sp, #0x2c pop {r4, r5, r6, r7, pc} @@ -7787,7 +7787,7 @@ _02251442: add r0, r5, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, r5, r6, pc} thumb_func_start ov11_02251464 @@ -7802,7 +7802,7 @@ ov11_02251464: ; 0x02251464 add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 @@ -8541,7 +8541,7 @@ _02251A08: add r0, r4, #0 bl FreeToHeap add r0, r7, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0x1fc add sp, #0x14 pop {r3, r4, r5, r6, r7, pc} @@ -9287,7 +9287,7 @@ ov11_02252018: ; 0x02252018 add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #4 pop {r3, r4, r5, r6, pc} .align 2, 0 @@ -9313,7 +9313,7 @@ ov11_02252070: ; 0x02252070 add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 @@ -9766,7 +9766,7 @@ _02252444: add r0, r4, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02252468: add sp, #0x24 pop {r4, r5, r6, r7, pc} @@ -9854,7 +9854,7 @@ _022524FE: add r0, r5, #0 bl FreeToHeap ldr r0, [sp] - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0xc pop {r4, r5, r6, r7, pc} .align 2, 0 @@ -9871,7 +9871,7 @@ ov11_02252524: ; 0x02252524 add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 @@ -10094,7 +10094,7 @@ _022526E0: add r0, r4, #0 bl FreeToHeap add r0, r7, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0225270A: add sp, #0x2c pop {r4, r5, r6, r7, pc} @@ -10113,7 +10113,7 @@ ov11_02252714: ; 0x02252714 add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 @@ -10129,7 +10129,7 @@ ov11_02252734: ; 0x02252734 add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 @@ -10408,7 +10408,7 @@ _02252974: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0x1fc add sp, #0x14 pop {r3, r4, r5, pc} @@ -10475,7 +10475,7 @@ _022529FA: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} thumb_func_start ov11_02252A1C @@ -10518,7 +10518,7 @@ _02252A52: mov r0, #0 str r0, [r4, #0x10] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02252A6C: pop {r3, r4, r5, pc} .align 2, 0 @@ -10615,7 +10615,7 @@ _02252B0E: mov r0, #0 str r0, [r4, #0x10] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02252B28: pop {r3, r4, r5, pc} nop @@ -10933,7 +10933,7 @@ _02252D8C: add r0, r4, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02252DAA: add sp, #0x110 pop {r4, r5, r6, pc} @@ -11006,7 +11006,7 @@ _02252E30: add r0, r5, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02252E46: add sp, #0xc pop {r4, r5, r6, r7, pc} @@ -11189,7 +11189,7 @@ _02252F98: add r0, r4, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02252FB6: add sp, #0x110 pop {r4, r5, r6, pc} @@ -11227,7 +11227,7 @@ _02252FE4: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02253000: pop {r3, r4, r5, pc} nop @@ -11260,7 +11260,7 @@ _0225302A: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0225304A: pop {r3, r4, r5, pc} @@ -11303,7 +11303,7 @@ _02253074: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0225309E: pop {r3, r4, r5, pc} @@ -11572,7 +11572,7 @@ _022532C8: add r0, r4, #0 bl FreeToHeap ldr r0, [sp, #0xc] - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0x18 pop {r3, r4, r5, r6, r7, pc} _022532E4: @@ -11835,7 +11835,7 @@ _02253508: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02253524: add sp, #0xc pop {r3, r4, r5, r6, pc} @@ -11897,7 +11897,7 @@ _02253582: add r0, r5, #0 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02253598: pop {r3, r4, r5, pc} .align 2, 0 @@ -11991,7 +11991,7 @@ _02253636: add r0, r5, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0225364C: add sp, #0xc pop {r4, r5, r6, r7, pc} @@ -12059,7 +12059,7 @@ _022536BA: add r0, r5, #0 bl FreeToHeap add r0, r7, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _022536D0: pop {r3, r4, r5, r6, r7, pc} .align 2, 0 @@ -12098,7 +12098,7 @@ _02253706: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 @@ -12143,7 +12143,7 @@ _0225374E: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 diff --git a/arm9/overlays/11/asm/ov11_0225464C.s b/arm9/overlays/11/asm/ov11_0225464C.s index 9b31fa6a0..aa4842948 100644 --- a/arm9/overlays/11/asm/ov11_0225464C.s +++ b/arm9/overlays/11/asm/ov11_0225464C.s @@ -44,7 +44,7 @@ ov11_0225468C: ; 0x0225468C ldr r0, [r4, r0] cmp r0, #0 beq _022546B2 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0x66 mov r2, #0 lsl r0, r0, #2 diff --git a/arm9/overlays/11/asm/ov11_02256C08.s b/arm9/overlays/11/asm/ov11_02256C08.s index 432acb651..1b3bd358f 100644 --- a/arm9/overlays/11/asm/ov11_02256C08.s +++ b/arm9/overlays/11/asm/ov11_02256C08.s @@ -400,7 +400,7 @@ ov11_02256F0C: ; 0x02256F0C ldr r0, [r4, #0x50] cmp r0, #0 beq _02256F1E - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x50] _02256F1E: @@ -1162,7 +1162,7 @@ _022574D0: orr r0, r1 strb r0, [r5] add r0, r7, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _022574E8: pop {r3, r4, r5, r6, r7, pc} nop @@ -2747,7 +2747,7 @@ _0225814A: add r0, r4, #0 bl FreeToHeap add r0, r7, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #8 pop {r3, r4, r5, r6, r7, pc} .align 2, 0 @@ -2794,7 +2794,7 @@ ov11_022581B0: ; 0x022581B0 ldr r0, [r4, #0x50] cmp r0, #0 beq _022581C2 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x50] _022581C2: diff --git a/arm9/overlays/11/asm/ov11_02258428.s b/arm9/overlays/11/asm/ov11_02258428.s index d29b99ecb..5cbe59add 100644 --- a/arm9/overlays/11/asm/ov11_02258428.s +++ b/arm9/overlays/11/asm/ov11_02258428.s @@ -279,7 +279,7 @@ ov11_02258658: ; 0x02258658 bl sub_020117BC ldr r0, _022586B8 ; =0x000006AC ldr r0, [r6, r0] - bl sub_0200CAB4 + bl SysTask_Destroy mov r4, #0 add r5, r6, #0 _02258680: @@ -298,7 +298,7 @@ _02258680: ldr r0, [r6, #0x60] bl FreeToHeap ldr r0, [r6, #0x64] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r6, #0 bl FreeToHeap pop {r4, r5, r6, pc} @@ -866,7 +866,7 @@ _02258B70: cmp r4, #6 blt _02258B70 ldr r0, [r6, #4] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r3, _02258BD4 ; =0x00004FA6 mov r0, #0 str r0, [r6, #4] @@ -1629,7 +1629,7 @@ _0225910E: and r0, r1 str r0, [r2] ldr r0, [sp] - bl sub_0200CAB4 + bl SysTask_Destroy _0225915A: pop {r3, r4, r5, r6, r7, pc} .align 2, 0 @@ -3616,7 +3616,7 @@ _0225A24E: ldr r0, [r5, r0] cmp r0, #0 beq _0225A25E - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _0225A26C ; =0x00000634 str r7, [r5, r0] _0225A25E: @@ -5089,7 +5089,7 @@ ov11_0225ADB0: ; 0x0225ADB0 ldr r0, [r4, #8] cmp r0, #0 beq _0225ADCE - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0x6b lsl r0, r0, #4 mov r1, #0 @@ -5990,7 +5990,7 @@ _0225B4AA: mov r2, #0 strb r2, [r1, r0] ldr r0, [r5, #4] - bl sub_0200CAB4 + bl SysTask_Destroy bl sub_02015F1C ldr r2, _0225B530 ; =0x04001000 ldr r0, _0225B534 ; =0xFFFF1FFF @@ -6036,7 +6036,7 @@ _0225B4D6: add r0, r5, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0225B526: pop {r4, r5, r6, pc} .align 2, 0 @@ -6317,7 +6317,7 @@ _0225B740: cmp r4, #4 blt _0225B740 ldr r0, [sp] - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, r6, r7, pc} .align 2, 0 _0225B760: .word 0x0000069F @@ -6330,7 +6330,7 @@ ov11_0225B76C: ; 0x0225B76C add r4, r0, #0 bl ov11_0225AC60 add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} thumb_func_start ov11_0225B77C diff --git a/arm9/overlays/11/asm/ov11_0225C91C.s b/arm9/overlays/11/asm/ov11_0225C91C.s index 20705bad9..98a89877c 100644 --- a/arm9/overlays/11/asm/ov11_0225C91C.s +++ b/arm9/overlays/11/asm/ov11_0225C91C.s @@ -420,7 +420,7 @@ _0225CC3A: add sp, #4 pop {r3, r4, pc} _0225CC52: - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #4] add sp, #4 @@ -585,7 +585,7 @@ _0225CD78: _0225CD8E: bl ov11_02231678 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #4] add sp, #8 @@ -986,7 +986,7 @@ _0225D0A6: ldr r0, [r0] bl sub_02020208 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #4] _0225D0BA: @@ -1103,7 +1103,7 @@ _0225D17A: add sp, #4 pop {r3, r4, pc} _0225D192: - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #4] add sp, #4 @@ -1295,7 +1295,7 @@ _0225D2FA: ldr r0, [r0] bl sub_0200C63C add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #4] pop {r3, r4, r5, pc} @@ -1345,7 +1345,7 @@ _0225D35C: ldr r0, [r0] bl sub_0200C63C add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #4] _0225D370: diff --git a/arm9/overlays/11/asm/ov11_0225D3EC.s b/arm9/overlays/11/asm/ov11_0225D3EC.s index 7c406bbce..d5ae62bb3 100644 --- a/arm9/overlays/11/asm/ov11_0225D3EC.s +++ b/arm9/overlays/11/asm/ov11_0225D3EC.s @@ -154,7 +154,7 @@ _0225D510: cmp r4, #5 blt _0225D510 ldr r0, [r6, #0x14] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r6, #0 bl FreeToHeap pop {r4, r5, r6, pc} diff --git a/arm9/overlays/11/asm/ov11_0225D6A4.s b/arm9/overlays/11/asm/ov11_0225D6A4.s index e7944eb04..55ba7950f 100644 --- a/arm9/overlays/11/asm/ov11_0225D6A4.s +++ b/arm9/overlays/11/asm/ov11_0225D6A4.s @@ -142,7 +142,7 @@ ov11_0225D7B8: ; 0x0225D7B8 ldr r0, [r4] bl sub_0200C3DC ldr r0, [r4, #4] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap pop {r4, pc} diff --git a/arm9/overlays/12/asm/overlay_12.s b/arm9/overlays/12/asm/overlay_12.s index a63925b22..50a148498 100644 --- a/arm9/overlays/12/asm/overlay_12.s +++ b/arm9/overlays/12/asm/overlay_12.s @@ -510,7 +510,7 @@ ov12_0222D9B0: ; 0x0222D9B0 ldr r0, [r4, #0x30] bl FreeToHeap ldr r0, [r4, #4] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #8] bl ov12_02231378 bl sub_0201CD04 @@ -3675,7 +3675,7 @@ _0222F3AE: ldr r0, [r4, #0x30] bl FreeToHeap ldr r0, [r4, #4] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #8] bl ov12_02231378 bl sub_0201CD04 @@ -5519,7 +5519,7 @@ _02230296: ldr r0, [r4, #0x74] bl FreeToHeap ldr r0, [r4, #4] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x10] bl ov12_02231378 bl sub_0201CD04 @@ -8181,7 +8181,7 @@ _02231864: cmp r4, #6 blt _02231864 ldr r0, [r6, #0x18] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r6, #0x18] pop {r4, r5, r6, pc} @@ -8244,7 +8244,7 @@ ov12_022318DC: ; 0x022318DC bl GF_AssertFail _022318EA: ldr r0, [r4] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap pop {r4, pc} @@ -10013,7 +10013,7 @@ ov12_02232684: ; 0x02232684 ldr r0, [r4, #0x10] cmp r0, #0 beq _022326A2 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0xb9 lsl r0, r0, #2 mov r1, #0 @@ -10540,7 +10540,7 @@ ov12_02232A98: ; 0x02232A98 ldr r0, [r4, #0x14] cmp r0, #0 beq _02232AB6 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0xc1 lsl r0, r0, #2 mov r1, #0 @@ -11748,7 +11748,7 @@ ov12_0223336C: ; 0x0223336C lsl r0, r0, #2 str r1, [r4, r0] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 @@ -11788,7 +11788,7 @@ _022333E0: cmp r4, #4 blt _022333C0 ldr r0, [sp] - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, r6, r7, pc} .align 2, 0 _022333F0: .word ov12_02245074 @@ -12084,7 +12084,7 @@ ov12_0223361C: ; 0x0223361C bl GF_AssertFail _0223362A: ldr r0, [r4, #4] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap pop {r4, pc} @@ -13096,7 +13096,7 @@ _02233E0A: add r0, r2, #0 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} _02233E1E: ldrb r0, [r2, #8] @@ -13204,7 +13204,7 @@ _02233ED8: add r0, r2, #0 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} thumb_func_start ov12_02233EEC @@ -13662,7 +13662,7 @@ _0223428A: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223429E: pop {r3, r4, r5, pc} .align 2, 0 @@ -14074,7 +14074,7 @@ _022345AC: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} _022345D0: mov r1, #2 @@ -14588,7 +14588,7 @@ _022349B8: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _022349CE: pop {r3, r4, r5, pc} .align 2, 0 @@ -14663,7 +14663,7 @@ _02234A3C: cmp r2, #0 strh r3, [r1] ble _02234A58 - bl sub_0200CAB4 + bl SysTask_Destroy _02234A58: pop {r3, r4, r5, pc} nop @@ -15932,7 +15932,7 @@ _02235452: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02235464: add sp, #0x10 pop {r3, r4, r5, pc} @@ -16330,7 +16330,7 @@ _02235778: add r0, r5, #0 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0x10 pop {r3, r4, r5, r6, r7, pc} .align 2, 0 @@ -16368,7 +16368,7 @@ ov12_022357E4: ; 0x022357E4 push {r4, lr} add r4, r0, #0 ldr r0, [r4, #4] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap pop {r4, pc} @@ -16697,7 +16697,7 @@ _02235A5E: add r0, r5, #0 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02235A80: add sp, #8 pop {r3, r4, r5, r6, r7, pc} @@ -17339,7 +17339,7 @@ _02235EDA: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02235EF8: add sp, #8 pop {r3, r4, r5, pc} @@ -17505,7 +17505,7 @@ _0223601A: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02236038: add sp, #8 pop {r3, r4, r5, pc} @@ -17733,7 +17733,7 @@ _022361DA: add r0, r4, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _022361FE: pop {r4, r5, r6, pc} .align 2, 0 @@ -17908,7 +17908,7 @@ _02236342: add r0, r5, #0 bl FreeToHeap add r0, r7, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, r6, r7, pc} nop _02236364: .word 0x000005B6 @@ -18137,7 +18137,7 @@ _02236502: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02236520: add sp, #8 pop {r3, r4, r5, pc} @@ -18835,7 +18835,7 @@ _02236A70: add r0, r4, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02236A8E: add sp, #0x114 pop {r4, r5, r6, r7, pc} @@ -19136,7 +19136,7 @@ _02236CB4: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02236CE4: add sp, #0xc pop {r4, r5, pc} @@ -19341,7 +19341,7 @@ _02236E48: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02236E66: pop {r3, r4, r5, pc} @@ -19692,7 +19692,7 @@ _022370D4: add r0, r4, #0 bl FreeToHeap ldr r0, [sp, #4] - bl sub_0200CAB4 + bl SysTask_Destroy _022370F2: add sp, #8 pop {r3, r4, r5, r6, r7, pc} @@ -19888,7 +19888,7 @@ _0223724C: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223726A: pop {r3, r4, r5, pc} @@ -20414,7 +20414,7 @@ _02237624: add r0, r4, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02237648: add sp, #8 pop {r4, r5, r6, pc} @@ -20611,7 +20611,7 @@ _022377A0: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _022377BE: pop {r3, r4, r5, pc} @@ -20994,7 +20994,7 @@ _02237A6A: add r0, r4, #0 bl FreeToHeap ldr r0, [sp, #4] - bl sub_0200CAB4 + bl SysTask_Destroy _02237A88: add sp, #8 pop {r3, r4, r5, r6, r7, pc} @@ -21264,7 +21264,7 @@ _02237C6E: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02237C8C: pop {r3, r4, r5, pc} .align 2, 0 @@ -21395,7 +21395,7 @@ _02237D70: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02237D8E: add sp, #8 pop {r3, r4, r5, pc} @@ -21571,7 +21571,7 @@ _02237EC2: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02237EE4: add sp, #8 pop {r3, r4, r5, r6, r7, pc} @@ -21764,7 +21764,7 @@ _02238040: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02238058: pop {r3, r4, r5, pc} .align 2, 0 @@ -25375,7 +25375,7 @@ _022399EE: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02239A08: pop {r4, r5, r6, pc} nop @@ -25959,7 +25959,7 @@ _02239E6E: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02239E86: pop {r3, r4, r5, pc} .align 2, 0 @@ -26100,7 +26100,7 @@ _02239F8E: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} thumb_func_start ov12_02239FA8 @@ -26457,7 +26457,7 @@ _0223A248: add r0, r5, #0 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223A260: add sp, #8 pop {r3, r4, r5, r6, r7, pc} @@ -26603,7 +26603,7 @@ _0223A348: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} nop _0223A384: .word 0x00000F24 @@ -26830,7 +26830,7 @@ _0223A516: ldr r0, [sp] bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223A530: add sp, #0xc pop {r4, r5, r6, r7, pc} @@ -27080,7 +27080,7 @@ _0223A6F2: ldr r0, [sp] bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223A70C: add sp, #0xc pop {r4, r5, r6, r7, pc} @@ -27209,7 +27209,7 @@ _0223A7F8: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 @@ -27339,7 +27339,7 @@ _0223A8F8: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} thumb_func_start ov12_0223A918 @@ -27532,7 +27532,7 @@ _0223AA8A: add r0, r5, #0 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223AAA2: add sp, #0x10 pop {r3, r4, r5, pc} @@ -27615,7 +27615,7 @@ _0223AB2C: _0223AB44: mov r1, #1 strb r1, [r4, #0x15] - bl sub_0200CAB4 + bl SysTask_Destroy _0223AB4C: pop {r4, pc} nop @@ -27684,7 +27684,7 @@ _0223ABC0: mov r0, #1 strb r0, [r4, #9] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223ABD0: add sp, #0x28 pop {r3, r4, r5, pc} @@ -27829,7 +27829,7 @@ _0223ACE8: mov r0, #1 strb r0, [r4, #0xd] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223ACF2: add sp, #0xc pop {r3, r4, r5, r6, pc} @@ -28002,7 +28002,7 @@ _0223AE32: mov r0, #1 strb r0, [r4, #0xd] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223AE42: pop {r3, r4, r5, pc} @@ -28154,7 +28154,7 @@ _0223AF58: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223AF70: pop {r3, r4, r5, pc} .align 2, 0 @@ -28324,7 +28324,7 @@ _0223B0A8: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223B0C0: add sp, #8 pop {r3, r4, r5, pc} @@ -28658,7 +28658,7 @@ _0223B316: ldr r0, [sp] bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223B340: add sp, #0xc pop {r4, r5, r6, r7, pc} @@ -28739,7 +28739,7 @@ ov12_0223B3C8: ; 0x0223B3C8 add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223B3F0: pop {r3, r4, r5, pc} nop @@ -30103,7 +30103,7 @@ ov12_0223BE94: ; 0x0223BE94 ldr r0, [r4, #0xc] cmp r0, #0 beq _0223BEB0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r1, #0 str r1, [r4, #0xc] add r4, #0x98 @@ -30489,7 +30489,7 @@ _0223C182: cmp r4, #4 blt _0223C162 ldr r0, [sp] - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, r6, r7, pc} nop _0223C194: .word ov12_02246094 @@ -30523,7 +30523,7 @@ ov12_0223C19C: ; 0x0223C19C strh r0, [r4] _0223C1CE: add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} nop _0223C1D8: .word 0x0000FFFF @@ -30538,7 +30538,7 @@ ov12_0223C1DC: ; 0x0223C1DC mov r0, #0 str r0, [r4] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} thumb_func_start ov12_0223C1F4 @@ -31444,7 +31444,7 @@ _0223C8B6: ldr r0, [r6, #8] cmp r0, #0 beq _0223C8CE - bl sub_0200CAB4 + bl SysTask_Destroy _0223C8CE: add r0, r6, #0 mov r1, #0 @@ -31597,7 +31597,7 @@ _0223C9FA: mov r0, #0 str r0, [r4, #8] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223CA16: add sp, #8 pop {r3, r4, r5, pc} @@ -31614,7 +31614,7 @@ _0223CA26: ldr r0, [r5, r7] cmp r0, #0 beq _0223CA34 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _0223CA40 ; =0x000009A8 str r6, [r5, r0] _0223CA34: @@ -31736,11 +31736,11 @@ _0223CB14: .word 0x00009CAE ov12_0223CB18: ; 0x0223CB18 mov r1, #2 lsl r1, r1, #8 - ldr r3, _0223CB24 ; =sub_0200CAB4 + ldr r3, _0223CB24 ; =SysTask_Destroy ldr r0, [r0, r1] bx r3 nop -_0223CB24: .word sub_0200CAB4 +_0223CB24: .word SysTask_Destroy thumb_func_start ov12_0223CB28 ov12_0223CB28: ; 0x0223CB28 @@ -31914,7 +31914,7 @@ _0223CC7C: mov r0, #2 lsl r0, r0, #8 ldr r0, [r5, r0] - bl sub_0200CAB4 + bl SysTask_Destroy str r6, [r5, r7] add r4, r4, #1 add r5, #0x18 @@ -32302,7 +32302,7 @@ _0223CF8A: ldr r0, [r4, #4] bl sub_0200C3DC add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #4] str r0, [r4] @@ -33089,7 +33089,7 @@ ov12_0223D578: ; 0x0223D578 push {r4, lr} add r4, r0, #0 ldr r0, [r4, #8] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #8] pop {r4, pc} @@ -34057,7 +34057,7 @@ _0223DCCA: ldr r0, [r5, r7] cmp r0, #0 beq _0223DCD8 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _0223DCE4 ; =0x00001070 str r6, [r5, r0] _0223DCD8: @@ -34933,7 +34933,7 @@ ov12_0223E38C: ; 0x0223E38C lsl r0, r0, #4 ldr r0, [r4, r0] ldr r0, [r0] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0x21 lsl r0, r0, #4 ldr r0, [r4, r0] @@ -35318,7 +35318,7 @@ _0223E686: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 @@ -35394,7 +35394,7 @@ _0223E720: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} thumb_func_start ov12_0223E734 @@ -35595,7 +35595,7 @@ ov12_0223E898: ; 0x0223E898 ldr r0, [r4, r0] cmp r0, #0 beq _0223E8B2 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0x82 mov r1, #0 lsl r0, r0, #2 @@ -36034,7 +36034,7 @@ ov12_0223EC28: ; 0x0223EC28 str r3, [sp] bl G2x_SetBlendAlpha_ add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #4 pop {r3, r4, pc} nop @@ -36326,7 +36326,7 @@ _0223EE5E: add r0, r5, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223EE6A: add sp, #8 pop {r4, r5, r6, pc} @@ -36626,7 +36626,7 @@ _0223F076: ldr r0, [sp] bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223F090: add sp, #0xc pop {r4, r5, r6, r7, pc} @@ -36883,7 +36883,7 @@ _0223F266: ldr r0, [sp] bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223F280: add sp, #0xc pop {r4, r5, r6, r7, pc} @@ -37029,7 +37029,7 @@ _0223F388: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223F3A0: pop {r3, r4, r5, pc} nop @@ -37261,7 +37261,7 @@ ov12_0223F558: ; 0x0223F558 push {r4, lr} add r4, r0, #0 ldr r0, [r4] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap pop {r4, pc} @@ -37890,7 +37890,7 @@ _0223FA4C: add r0, r4, #0 bl FreeToHeap ldr r0, [sp, #0x18] - bl sub_0200CAB4 + bl SysTask_Destroy _0223FA66: add sp, #0x44 pop {r4, r5, r6, r7, pc} @@ -38674,7 +38674,7 @@ _02240002: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0224001A: add sp, #0x18 pop {r3, r4, r5, r6, r7, pc} @@ -38946,7 +38946,7 @@ _0224025E: mov r1, #1 add r5, #0x2b strb r1, [r5] - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0xc pop {r4, r5, r6, r7, pc} .align 2, 0 @@ -39058,7 +39058,7 @@ _02240330: add r0, r5, #0 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} nop _0224034C: .word 0x00001130 @@ -39216,7 +39216,7 @@ _0224044E: add r0, r5, #0 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02240484: pop {r3, r4, r5, r6, r7, pc} nop @@ -39373,7 +39373,7 @@ _022405A4: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _022405BC: pop {r3, r4, r5, pc} .align 2, 0 @@ -39599,7 +39599,7 @@ _0224074E: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02240766: pop {r3, r4, r5, pc} .align 2, 0 @@ -41554,9 +41554,9 @@ _022415D4: ldr r0, [r4, #0x30] bl FreeToHeap ldr r0, [r4, #4] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #8] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0xc] bl ov12_02231378 bl sub_0201CD04 @@ -44256,7 +44256,7 @@ _02242BF0: mov r0, #0x4d lsl r0, r0, #2 ldr r0, [r6, r0] - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, r6, r7, pc} .align 2, 0 _02242C14: .word 0x000080EA @@ -44385,7 +44385,7 @@ ov12_02242CF8: ; 0x02242CF8 add r0, r1, #0 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} _02242D14: add r0, r0, #1 @@ -44526,7 +44526,7 @@ _02242E2C: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} _02242E48: ldr r2, [r4, #0x1c] @@ -45152,7 +45152,7 @@ _02243322: add r0, r1, #0 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} nop _02243338: .word 0x00000851 @@ -45226,7 +45226,7 @@ _022433B2: add r0, r1, #0 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} nop _022433C8: .word 0x00000851 @@ -45335,7 +45335,7 @@ _0224348E: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 @@ -45391,7 +45391,7 @@ _022434F0: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} nop _02243510: .word 0xFFFFD800 @@ -46424,7 +46424,7 @@ _02243C96: ldr r0, [sp] bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02243CB0: add sp, #0xc pop {r4, r5, r6, r7, pc} @@ -46674,7 +46674,7 @@ _02243E72: ldr r0, [sp] bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02243E8C: add sp, #0xc pop {r4, r5, r6, r7, pc} @@ -46860,7 +46860,7 @@ _02243FDE: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02243FF6: pop {r3, r4, r5, pc} @@ -47080,7 +47080,7 @@ _0224419A: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _022441B2: add sp, #0xc pop {r4, r5, r6, r7, pc} @@ -47218,7 +47218,7 @@ _022442A6: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _022442BE: pop {r3, r4, r5, pc} @@ -47403,7 +47403,7 @@ _02244414: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0224442C: add sp, #0xc pop {r4, r5, pc} @@ -47653,7 +47653,7 @@ _022445E8: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02244600: pop {r3, r4, r5, r6, r7, pc} nop @@ -47776,7 +47776,7 @@ _022446E8: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02244700: pop {r3, r4, r5, pc} nop @@ -47972,7 +47972,7 @@ _02244874: cmp r4, #5 blt _02244874 ldr r0, [r6, #0x14] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r6, #0 bl FreeToHeap pop {r4, r5, r6, pc} diff --git a/arm9/overlays/14/asm/overlay_14.s b/arm9/overlays/14/asm/overlay_14.s index 6a4775e74..35e0cc8e8 100644 --- a/arm9/overlays/14/asm/overlay_14.s +++ b/arm9/overlays/14/asm/overlay_14.s @@ -5441,7 +5441,7 @@ _021DA152: mov r1, #1 strb r1, [r0] ldr r0, [sp] - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0x18 pop {r3, r4, r5, r6, r7, pc} nop @@ -10785,9 +10785,9 @@ ov14_021DCA38: ; 0x021DCA38 add r1, r0, #0 bl Main_SetVBlankIntrCB ldr r0, [r4] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #4] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _021DCB08 ; =0x0000B3AC ldr r0, [r4, r0] bl ov14_021E50EC @@ -10975,7 +10975,7 @@ ov14_021DCBD8: ; 0x021DCBD8 lsl r0, r0, #2 add r0, r4, r0 ldr r0, [r0, #8] - bl sub_0200CAB4 + bl SysTask_Destroy ldrh r0, [r5, #4] mov r1, #0 lsl r0, r0, #2 @@ -14042,7 +14042,7 @@ _021DE3C2: bl ov14_021DC424 strb r0, [r4] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #1 add r4, #0x9c str r0, [r4] @@ -14124,7 +14124,7 @@ _021DE45C: add r1, r5, r1 bl ov14_021DEC7C add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021DE47E: pop {r4, r5, r6, pc} .align 2, 0 @@ -14558,7 +14558,7 @@ _021DE7CA: add r0, r4, #0 bl ov14_021DDF30 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 _021DE7DC: .word 0x00005860 @@ -14637,7 +14637,7 @@ _021DE868: add r4, #0xa3 strb r1, [r4] str r1, [r3, #0xc] - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #4 pop {r3, r4, pc} .align 2, 0 @@ -16531,7 +16531,7 @@ _021DF712: bl sub_02020130 _021DF720: add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0xc pop {r4, r5, pc} nop @@ -16697,7 +16697,7 @@ _021DF862: add r0, #0xa strb r1, [r4, r0] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0xc pop {r3, r4, r5, r6, pc} .align 2, 0 @@ -16863,7 +16863,7 @@ _021DF9A6: add r0, #0xa strb r1, [r4, r0] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0xc pop {r3, r4, r5, r6, pc} .align 2, 0 @@ -17100,7 +17100,7 @@ _021DFB90: add r0, r4, #0 bl ov14_021DDF30 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0xc pop {r3, r4, r5, r6, pc} .align 2, 0 @@ -17281,7 +17281,7 @@ _021DFCF8: mov r1, #0 strb r1, [r4, r0] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021DFD14: add sp, #0x18 pop {r4, r5, r6, pc} @@ -17413,7 +17413,7 @@ _021DFDFE: mov r1, #0 strb r1, [r4, r0] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0xc pop {r3, r4, r5, r6, pc} nop @@ -17783,7 +17783,7 @@ _021E00C4: mov r1, #0 strb r1, [r4, r0] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021E00E4: pop {r3, r4, r5, pc} nop @@ -17867,7 +17867,7 @@ _021E0164: mov r1, #0 strb r1, [r4, r0] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021E0184: pop {r3, r4, r5, pc} nop @@ -17948,7 +17948,7 @@ _021E0200: mov r1, #0 strb r1, [r4, r0] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021E0220: pop {r3, r4, r5, pc} nop @@ -19845,7 +19845,7 @@ ov14_021E10F4: ; 0x021E10F4 bl sub_0201B6C8 bl FreeToHeap ldr r0, [r4, #0x4c] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x4c] _021E1110: @@ -22395,7 +22395,7 @@ ov14_021E24BC: ; 0x021E24BC add r0, r1, #0 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} .align 2, 0 @@ -22829,7 +22829,7 @@ _021E280A: add r0, r4, #0 bl ov14_021DDF30 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 _021E2838: .word ov14_021E27BC @@ -22959,7 +22959,7 @@ _021E28EC: add r0, r4, #0 bl ov14_021DDF30 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0x10 pop {r3, r4, r5, pc} .align 2, 0 @@ -23278,7 +23278,7 @@ _021E2B72: mov r0, #0 str r0, [r5, #0x2c] add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021E2BA8: pop {r4, r5, r6, pc} nop @@ -23389,7 +23389,7 @@ _021E2C46: mov r0, #0 str r0, [r5, #0x2c] add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021E2C76: add sp, #0x10 pop {r4, r5, r6, pc} @@ -23546,7 +23546,7 @@ _021E2D7C: mov r1, #0 str r1, [r0, #0x2c] ldr r0, [sp] - bl sub_0200CAB4 + bl SysTask_Destroy _021E2DA0: add sp, #8 pop {r3, r4, r5, r6, r7, pc} @@ -23730,7 +23730,7 @@ _021E2ED8: mov r0, #0 str r0, [r5, #0x2c] add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021E2EFA: add sp, #0xc pop {r3, r4, r5, r6, pc} @@ -24860,7 +24860,7 @@ ov14_021E3798: ; 0x021E3798 push {r4, lr} add r4, r0, #0 ldr r0, [r4, #0x14] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x14] pop {r4, pc} @@ -26011,7 +26011,7 @@ _021E4022: sub r1, r1, #1 strb r1, [r4, r0] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} nop _021E4034: .word 0x000001CB @@ -27782,7 +27782,7 @@ _021E4D68: sub r0, r0, #1 str r0, [r1, #0x34] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r1, #0 add r0, r4, #0 add r2, r1, #0 @@ -29634,7 +29634,7 @@ ov14_021E5C04: ; 0x021E5C04 ldr r0, [r0, r1] cmp r0, #0 beq _021E5C18 - bl sub_0200CAB4 + bl SysTask_Destroy _021E5C18: ldr r6, [sp] mov r0, #0 diff --git a/arm9/overlays/15/asm/overlay_15.s b/arm9/overlays/15/asm/overlay_15.s index 0d1cdd7a3..ca9f60e0a 100644 --- a/arm9/overlays/15/asm/overlay_15.s +++ b/arm9/overlays/15/asm/overlay_15.s @@ -2654,16 +2654,16 @@ _021D889A: ldr r0, [r5, #8] cmp r0, #0 beq _021D88A4 - bl sub_0200CAB4 + bl SysTask_Destroy _021D88A4: add r4, r4, #1 add r5, r5, #4 cmp r4, #4 blt _021D889A ldr r0, [r6] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r6, #4] - bl sub_0200CAB4 + bl SysTask_Destroy bl DeinitOamData ldr r0, [r6, #0x24] bl sub_0201FD58 @@ -2801,7 +2801,7 @@ ov15_021D8998: ; 0x021D8998 lsl r0, r0, #2 add r0, r1, r0 ldr r0, [r0, #8] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x10] ldr r1, [r4] lsl r0, r0, #2 @@ -8241,7 +8241,7 @@ _021DB4CC: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021DB4E0: add sp, #0x1c pop {r3, r4, r5, r6, pc} @@ -8382,7 +8382,7 @@ _021DB5E0: cmp r0, #0 bne _021DB5FA ldr r0, [r4, #0x1c] - bl sub_0200CAB4 + bl SysTask_Destroy ldrh r0, [r4, #0x1a] add r0, r0, #1 strh r0, [r4, #0x1a] @@ -8469,7 +8469,7 @@ ov15_021DB678: ; 0x021DB678 cmp r0, #0 bne _021DB69C ldr r0, [r4, #0x1c] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x18] add r0, r0, #1 str r0, [r4, #0x18] @@ -8558,7 +8558,7 @@ ov15_021DB71C: ; 0x021DB71C cmp r0, #0 bne _021DB740 ldr r0, [r4, #0x1c] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x18] add r0, r0, #1 str r0, [r4, #0x18] diff --git a/arm9/overlays/16/asm/overlay_16.s b/arm9/overlays/16/asm/overlay_16.s index 075926fd2..9b58c9dbf 100644 --- a/arm9/overlays/16/asm/overlay_16.s +++ b/arm9/overlays/16/asm/overlay_16.s @@ -4322,11 +4322,11 @@ _021D95E0: .word ov16_021D95F4 ov16_021D95E4: ; 0x021D95E4 mov r1, #0x9d lsl r1, r1, #2 - ldr r3, _021D95F0 ; =sub_0200CAB4 + ldr r3, _021D95F0 ; =SysTask_Destroy ldr r0, [r0, r1] bx r3 nop -_021D95F0: .word sub_0200CAB4 +_021D95F0: .word SysTask_Destroy thumb_func_end ov16_021D95E4 thumb_func_start ov16_021D95F4 @@ -4549,7 +4549,7 @@ ov16_021D9780: ; 0x021D9780 mov r0, #0x9e lsl r0, r0, #2 ldr r0, [r4, r0] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0x9e mov r1, #0 lsl r0, r0, #2 @@ -48063,7 +48063,7 @@ _021ED8CA: cmp r1, #0 bne _021ED8DA ldr r0, [r0, #0x3c] - bl sub_0200CAB4 + bl SysTask_Destroy _021ED8DA: ldr r0, [r4, #8] bl FreeToHeap @@ -49222,7 +49222,7 @@ _021EE234: bl ov16_021EE254 pop {r4, pc} _021EE23E: - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x30] mov r1, #1 str r1, [r0] @@ -49474,7 +49474,7 @@ _021EE3FC: cmp r4, #1 bne _021EE424 add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r5, #0x20] mov r1, #1 str r1, [r0] @@ -49676,7 +49676,7 @@ _021EE586: ldr r0, [r4] bl sub_02020044 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x1c] mov r1, #1 str r1, [r0] @@ -51018,7 +51018,7 @@ ov16_021EEF68: ; 0x021EEF68 mov r0, #7 lsl r0, r0, #6 ldr r0, [r4, r0] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap pop {r4, pc} diff --git a/arm9/overlays/17/asm/overlay_17.s b/arm9/overlays/17/asm/overlay_17.s index b90cfe8e9..a2ba7b2e1 100644 --- a/arm9/overlays/17/asm/overlay_17.s +++ b/arm9/overlays/17/asm/overlay_17.s @@ -10280,7 +10280,7 @@ ov17_021DC11C: ; 0x021DC11C lsr r1, r1, #0x18 bl BG_LoadCharTilesData add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #8] bl FreeToHeap add r0, r4, #0 @@ -10317,7 +10317,7 @@ _021DC17C: bl GXS_LoadBGPltt _021DC18C: add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #4] bl FreeToHeap add r0, r4, #0 @@ -12439,12 +12439,12 @@ ov17_021DD178: ; 0x021DD178 add r4, r1, #0 cmp r0, #0 beq _021DD188 - bl sub_0200CAB4 + bl SysTask_Destroy _021DD188: ldr r0, [r5, #0x28] cmp r0, #0 beq _021DD192 - bl sub_0200CAB4 + bl SysTask_Destroy _021DD192: add r0, r5, #0 add r1, r4, #0 diff --git a/arm9/overlays/18/asm/overlay_18.s b/arm9/overlays/18/asm/overlay_18.s index 5569eb874..858104bdd 100644 --- a/arm9/overlays/18/asm/overlay_18.s +++ b/arm9/overlays/18/asm/overlay_18.s @@ -240,7 +240,7 @@ ov18_02239858: ; 0x02239858 ldr r0, [r1, r0] cmp r0, #0 beq _02239896 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _022398A8 ; =0x02251380 mov r2, #0 ldr r1, [r0] @@ -1144,7 +1144,7 @@ _02239F12: add r0, #0x98 str r3, [r1, r0] add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} nop _02239F2C: .word ov18_02251380 @@ -1267,7 +1267,7 @@ _0223A010: bl ov18_0223D638 bl ov18_0224DD94 add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy bl ov18_0223E6A0 ldr r0, _0223A044 ; =0x02251380 mov r2, #0 @@ -2528,7 +2528,7 @@ _0223AA5C: add r0, r4, #0 bl FreeToHeap add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #1 bl ov18_02247970 add sp, #0xc @@ -6381,7 +6381,7 @@ ov18_0223C848: ; 0x0223C848 ldr r0, [r1, r0] cmp r0, #0 beq _0223C876 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _0223C878 ; =0x02251380 ldr r1, [r0] ldr r0, _0223C880 ; =0x00000884 @@ -7879,7 +7879,7 @@ ov18_0223D370: ; 0x0223D370 ldr r0, [r1, r0] cmp r0, #0 beq _0223D3A2 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _0223D3A4 ; =0x02251384 ldr r1, [r0] ldr r0, _0223D3A8 ; =0x000004C4 @@ -8161,7 +8161,7 @@ _0223D5BC: ldr r0, _0223D634 ; =0x02251388 ldr r0, [r0] ldr r0, [r0, #0x14] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _0223D634 ; =0x02251388 ldr r1, [r0] mov r0, #0x46 @@ -10806,7 +10806,7 @@ _0223E9EC: ldr r0, [r1, r0] cmp r0, #0 beq _0223EA12 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _0223EA3C ; =0x022513A0 mov r2, #0 ldr r1, [r0, #4] @@ -10916,7 +10916,7 @@ _0223EAD0: ldr r0, [r1, r0] cmp r0, #0 beq _0223EAE2 - bl sub_0200CAB4 + bl SysTask_Destroy _0223EAE2: ldr r0, _0223EB04 ; =0x022513A0 ldr r1, [r0, #4] @@ -14015,7 +14015,7 @@ _022401D2: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r2, _02240204 ; =0x022513A0 mov r0, #0xa3 ldr r3, [r2, #4] @@ -14131,7 +14131,7 @@ ov18_022402A0: ; 0x022402A0 mov r0, #0xa3 lsl r0, r0, #2 ldr r0, [r1, r0] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r2, _022402EC ; =0x022513A0 mov r0, #0xa3 ldr r3, [r2, #4] @@ -14401,7 +14401,7 @@ _022404A4: mov r0, #0xa3 lsl r0, r0, #2 ldr r0, [r1, r0] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap ldr r1, _022404EC ; =0x022513A0 @@ -15369,7 +15369,7 @@ ov18_02240C14: ; 0x02240C14 mov r0, #0xa5 lsl r0, r0, #2 ldr r0, [r1, r0] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _02240C6C ; =0x022513A0 ldr r1, [r0, #4] mov r0, #0xa6 @@ -15605,7 +15605,7 @@ ov18_02240DC8: ; 0x02240DC8 mov r0, #0xa3 lsl r0, r0, #2 ldr r0, [r1, r0] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _02240E24 ; =0x022513A0 ldr r1, [r0, #4] mov r0, #0xa7 @@ -15702,7 +15702,7 @@ _02240EA4: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r1, _02240EE4 ; =0x022513A0 mov r0, #0xa3 ldr r2, [r1, #4] @@ -15779,7 +15779,7 @@ ov18_02240F34: ; 0x02240F34 mov r0, #0xa3 lsl r0, r0, #2 ldr r0, [r1, r0] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap ldr r1, _02240F80 ; =0x022513A0 @@ -15843,7 +15843,7 @@ _02240FB4: mov r0, #0xa3 lsl r0, r0, #2 ldr r0, [r1, r0] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap ldr r1, _02241000 ; =0x022513A0 @@ -16086,7 +16086,7 @@ _022411B0: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r1, _02241278 ; =0x022513A0 mov r0, #0xa3 ldr r2, [r1, #4] @@ -16760,7 +16760,7 @@ _022416D6: mov r0, #0xa3 lsl r0, r0, #2 ldr r0, [r1, r0] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _02241730 ; =0x022513A0 ldr r1, [r0, #4] mov r0, #0xa7 @@ -18696,7 +18696,7 @@ _02242604: mov r0, #0xa3 lsl r0, r0, #2 ldr r0, [r1, r0] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _02242658 ; =0x022513A0 ldr r1, [r0, #4] mov r0, #0xa7 @@ -20259,7 +20259,7 @@ _02243268: mov r0, #0xa3 lsl r0, r0, #2 ldr r0, [r1, r0] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap ldr r1, _022432AC ; =0x022513A0 @@ -21006,7 +21006,7 @@ _02243840: mov r0, #0xa3 lsl r0, r0, #2 ldr r0, [r1, r0] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap ldr r1, _0224388C ; =0x022513A0 @@ -21270,7 +21270,7 @@ _02243A44: mov r0, #0xa3 lsl r0, r0, #2 ldr r0, [r1, r0] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap ldr r1, _02243A88 ; =0x022513A0 @@ -21709,7 +21709,7 @@ _02243DCA: ldr r0, [r0, #0x44] bl sub_0201FD58 ldr r0, [sp] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r7, #0 bl FreeToHeap ldr r0, _02243E10 ; =0x022513A0 @@ -21796,7 +21796,7 @@ ov18_02243E8C: ; 0x02243E8C ldr r1, [r1, #4] cmp r1, #0 bne _02243EA6 - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap pop {r4, r5, r6, pc} @@ -21822,7 +21822,7 @@ _02243EBE: add r1, r2, r1 str r0, [r1, #0x20] add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap add r0, r5, #0 @@ -21989,7 +21989,7 @@ _02243FFA: ldr r0, [r0, #0x20] cmp r0, #0 beq _0224401A - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #4] ldr r0, [r0, r5] bl FreeToHeap @@ -24330,7 +24330,7 @@ ov18_022451BC: ; 0x022451BC ldr r0, [r0, #4] cmp r0, #0 beq _022451D8 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _022451E4 ; =0x022513EC mov r1, #0 ldr r0, [r0] @@ -24422,7 +24422,7 @@ ov18_02245270: ; 0x02245270 ldr r0, [r0, #4] cmp r0, #0 beq _02245288 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _022452A0 ; =0x022513EC mov r1, #0 ldr r0, [r0] @@ -25131,7 +25131,7 @@ ov18_022457D4: ; 0x022457D4 bl sub_020021EC _022457E6: add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap bl ov18_0223E6A0 @@ -25161,7 +25161,7 @@ _0224580A: add r1, sp, #0 bl sub_020311D0 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap bl ov18_0223E6A0 @@ -27433,7 +27433,7 @@ _02246A60: add r1, sp, #0x10 bl sub_020311D0 ldr r0, [sp, #4] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap bl ov18_0223E6A0 @@ -27460,7 +27460,7 @@ _02246A80: mov r2, #0 bl ov05_021E5B30 ldr r0, [sp, #4] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap bl ov18_0223E6A0 @@ -27648,7 +27648,7 @@ ov18_02246C10: ; 0x02246C10 bl sub_020021EC _02246C28: add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap bl ov18_0223E6A0 @@ -28541,7 +28541,7 @@ ov18_02247324: ; 0x02247324 add r0, r1, #0 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} .align 2, 0 thumb_func_end ov18_02247324 @@ -28637,7 +28637,7 @@ _022473F6: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy bl ov18_0223E6A0 _02247406: add sp, #0xc @@ -29642,7 +29642,7 @@ _02247B9A: bl FreeToHeap bl sub_0204F7FC add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _02247BB4 ; =0x022513F0 mov r1, #0 str r1, [r0, #4] @@ -31112,7 +31112,7 @@ _02248760: bl FreeToHeap bl sub_0204F7FC add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _02248780 ; =0x022513F0 mov r1, #0 str r1, [r0] @@ -35310,7 +35310,7 @@ _0224A8FE: bl sub_0204F7FC _0224A90C: add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, r5, r6, pc} thumb_func_end ov18_0224A8AC @@ -35952,7 +35952,7 @@ _0224AE52: ldr r0, [r5, #4] cmp r0, #0 beq _0224AE5C - bl sub_0200CAB4 + bl SysTask_Destroy _0224AE5C: add r0, r5, #0 bl FreeToHeap @@ -37391,7 +37391,7 @@ _0224B9B4: bl ov18_0223D658 bl ov18_0224DD94 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap pop {r3, r4, r5, pc} @@ -37931,7 +37931,7 @@ _0224BE68: bl FreeToHeap bl ov18_0223E6A0 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0224BE78: pop {r3, r4, r5, pc} nop @@ -37953,7 +37953,7 @@ _0224BE96: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} thumb_func_end ov18_0224BE84 @@ -40302,7 +40302,7 @@ _0224D1A0: bl ov18_0224CA34 bl ov18_0223E6A0 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy bl sub_0204F7FC _0224D1CE: add sp, #8 @@ -40407,7 +40407,7 @@ _0224D2AE: ldr r0, [r0, #0x34] bl MapObjectManager_GetFirstActiveObjectByID ldr r1, [sp] - bl sub_020584AC + bl MapObject_SetFacingDirection _0224D2CE: add r4, r4, #1 add r5, #0x20 @@ -40752,7 +40752,7 @@ _0224D596: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _0224D5B0 ; =0x022513FC mov r2, #0 ldr r1, [r0] @@ -41748,7 +41748,7 @@ _0224DD76: ldr r0, [r5, #0x20] cmp r0, #0 beq _0224DD88 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r5, #0x20] _0224DD88: diff --git a/arm9/overlays/20/asm/ov20_02252440.s b/arm9/overlays/20/asm/ov20_02252440.s index 4a1905fa5..c5ecf537b 100644 --- a/arm9/overlays/20/asm/ov20_02252440.s +++ b/arm9/overlays/20/asm/ov20_02252440.s @@ -193,7 +193,7 @@ ov20_0225257C: ; 0x0225257C push {r4, lr} add r4, r0, #0 ldr r0, [r4, #0x38] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl ov20_02252A08 add r0, r4, #0 @@ -236,7 +236,7 @@ _022525C6: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #7 bl DestroyHeap mov r0, #8 diff --git a/arm9/overlays/20/asm/ov20_02252C5C.s b/arm9/overlays/20/asm/ov20_02252C5C.s index 1a9ce0677..6a2580dd0 100644 --- a/arm9/overlays/20/asm/ov20_02252C5C.s +++ b/arm9/overlays/20/asm/ov20_02252C5C.s @@ -254,7 +254,7 @@ _02252E44: ldr r0, [r4, r0] cmp r0, #0 beq _02252E52 - bl sub_0200CAB4 + bl SysTask_Destroy _02252E52: add r0, r4, #0 bl FreeToHeap diff --git a/arm9/overlays/20/asm/ov20_022536F4.s b/arm9/overlays/20/asm/ov20_022536F4.s index b51d11283..740ba1ad0 100644 --- a/arm9/overlays/20/asm/ov20_022536F4.s +++ b/arm9/overlays/20/asm/ov20_022536F4.s @@ -249,7 +249,7 @@ ov20_02253888: ; 0x02253888 ldr r1, [r4] bl ov20_02253754 ldr r0, [r4, #0x14] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap pop {r4, pc} diff --git a/arm9/overlays/21/src/ov21_02254854.c b/arm9/overlays/21/src/ov21_02254854.c index 29b1dec3a..1e68b7efa 100644 --- a/arm9/overlays/21/src/ov21_02254854.c +++ b/arm9/overlays/21/src/ov21_02254854.c @@ -82,7 +82,7 @@ void ov21_02254930(SysTask *task, UnkStruct02254854 *param1) { return; } ov21_02254918(param1); - sub_0200CAB4((s32)task); + SysTask_Destroy(task); ov20_022529A0(param1->Unk28); } diff --git a/arm9/overlays/22/asm/overlay_22.s b/arm9/overlays/22/asm/overlay_22.s index aa16e762a..ea4d379c0 100644 --- a/arm9/overlays/22/asm/overlay_22.s +++ b/arm9/overlays/22/asm/overlay_22.s @@ -193,7 +193,7 @@ _0225499E: add r0, r4, #0 bl ov22_0225492C add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x64] bl ov20_022529A0 _022549D2: @@ -1801,7 +1801,7 @@ _022555CC: add r0, r4, #0 add r0, #0x84 ldr r0, [r0] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 add r4, #0x84 str r0, [r4] diff --git a/arm9/overlays/23/asm/overlay_23.s b/arm9/overlays/23/asm/overlay_23.s index 93bdf8316..17435cfb2 100644 --- a/arm9/overlays/23/asm/overlay_23.s +++ b/arm9/overlays/23/asm/overlay_23.s @@ -168,7 +168,7 @@ _02254964: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x10] bl ov20_022529A0 _0225499E: diff --git a/arm9/overlays/24/include/overlay_24.h b/arm9/overlays/24/include/overlay_24.h index 15b237328..e992c7f85 100644 --- a/arm9/overlays/24/include/overlay_24.h +++ b/arm9/overlays/24/include/overlay_24.h @@ -1,6 +1,11 @@ #ifndef POKEDIAMOND_OVERLAY_24_H #define POKEDIAMOND_OVERLAY_24_H +#include "global.h" + +#include "bg_window.h" +#include "unk_0200CA44.h" + typedef enum { TOUCH_TYPE_ERASE = 0, TOUCH_TYPE_DRAW = 1, @@ -46,7 +51,7 @@ typedef struct MemoPadAppHandler { BOOL ov24_02254854(MemoPadAppHandler **appHandlerOut, s32 arg1, s32 arg2, s32 arg3); BOOL ov24_0225489C(MemoPadAppHandler *appHandler, u32 arg1, u32 arg2, u32 arg3); void ov24_022548F4(MemoPadAppHandler *appHandler); -void ov24_02254918(void *arg0, MemoPadAppHandler *appHandler); +void ov24_02254918(SysTask *sysTask, MemoPadAppHandler *appHandler); void ov24_02254960(s32 arg0, s32 arg1, s32 arg2, MemoPadAppHandler *appHandler); void ov24_02254990(MemoPadAppHandler *appHandler); void ov24_02254998(MemoPadAppHandler *appHandler, u8 arg1); diff --git a/arm9/overlays/24/src/ov24_02254840.c b/arm9/overlays/24/src/ov24_02254840.c index c554bbbac..0c09d13ac 100644 --- a/arm9/overlays/24/src/ov24_02254840.c +++ b/arm9/overlays/24/src/ov24_02254840.c @@ -59,7 +59,7 @@ void ov24_022548F4(MemoPadAppHandler *appHandler) { FreeToHeap(appHandler); } -void ov24_02254918(void *arg0, MemoPadAppHandler *appHandler) { +void ov24_02254918(SysTask *sysTask, MemoPadAppHandler *appHandler) { static BOOL (*const ov24_02255100[3])(MemoPadAppHandler *) = { ov24_022549AC, ov24_022549F8, ov24_02254C64 }; @@ -67,7 +67,7 @@ void ov24_02254918(void *arg0, MemoPadAppHandler *appHandler) { ov20_02252C14(appHandler->unk16F8, appHandler->unk16FC); if (ov24_02255100[appHandler->unk0](appHandler)) { ov24_022548F4(appHandler); - sub_0200CAB4((s32)arg0); + SysTask_Destroy(sysTask); ov20_022529A0(appHandler->unk16F8); } } diff --git a/arm9/overlays/25/asm/overlay_25.s b/arm9/overlays/25/asm/overlay_25.s index 93ee2449f..58d7921c9 100644 --- a/arm9/overlays/25/asm/overlay_25.s +++ b/arm9/overlays/25/asm/overlay_25.s @@ -138,7 +138,7 @@ ov25_02254930: ; 0x02254930 add r0, r4, #0 bl ov25_02254918 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x28] bl ov20_022529A0 _02254966: @@ -352,7 +352,7 @@ ov25_02254AC4: ; 0x02254AC4 ldr r0, [r4, #0x30] cmp r0, #0 beq _02254AD8 - bl sub_0200CAB4 + bl SysTask_Destroy _02254AD8: add r0, r4, #0 bl FreeToHeap diff --git a/arm9/overlays/26/asm/ov26_02254854.s b/arm9/overlays/26/asm/ov26_02254854.s index 3245e108e..b5cb293d8 100644 --- a/arm9/overlays/26/asm/ov26_02254854.s +++ b/arm9/overlays/26/asm/ov26_02254854.s @@ -293,7 +293,7 @@ ov26_02254A4C: ; 0x02254A4C add r0, r4, #0 bl ov26_02254A04 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0x1f lsl r0, r0, #4 ldr r0, [r4, r0] diff --git a/arm9/overlays/27/asm/overlay_27.s b/arm9/overlays/27/asm/overlay_27.s index 102a3b056..c99b57e2f 100644 --- a/arm9/overlays/27/asm/overlay_27.s +++ b/arm9/overlays/27/asm/overlay_27.s @@ -107,7 +107,7 @@ ov27_022548F8: ; 0x022548F8 add r0, r4, #0 bl ov27_022548E4 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x78] bl ov20_022529A0 _02254924: @@ -446,7 +446,7 @@ ov27_02254B88: ; 0x02254B88 ldr r0, [r0] cmp r0, #0 beq _02254BB0 - bl sub_0200CAB4 + bl SysTask_Destroy _02254BB0: add r0, r4, #0 bl FreeToHeap diff --git a/arm9/overlays/28/asm/overlay_28.s b/arm9/overlays/28/asm/overlay_28.s index d327061f2..42de736a3 100644 --- a/arm9/overlays/28/asm/overlay_28.s +++ b/arm9/overlays/28/asm/overlay_28.s @@ -213,7 +213,7 @@ ov28_022549C0: ; 0x022549C0 add r0, r4, #0 bl ov28_022549AC add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x60] bl ov20_022529A0 _022549EC: @@ -477,7 +477,7 @@ _02254B9A: ldr r0, [r0] cmp r0, #0 beq _02254BC0 - bl sub_0200CAB4 + bl SysTask_Destroy _02254BC0: add r0, r5, #0 bl FreeToHeap diff --git a/arm9/overlays/29/asm/overlay_29.s b/arm9/overlays/29/asm/overlay_29.s index fd56387c1..e9632513f 100644 --- a/arm9/overlays/29/asm/overlay_29.s +++ b/arm9/overlays/29/asm/overlay_29.s @@ -98,7 +98,7 @@ ov29_022548E0: ; 0x022548E0 add r0, r4, #0 bl ov29_022548C4 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x4c] bl ov20_022529A0 _0225490C: diff --git a/arm9/overlays/30/asm/overlay_30.s b/arm9/overlays/30/asm/overlay_30.s index 38ed73a93..faa40398f 100644 --- a/arm9/overlays/30/asm/overlay_30.s +++ b/arm9/overlays/30/asm/overlay_30.s @@ -142,7 +142,7 @@ ov30_02254930: ; 0x02254930 add r0, r4, #0 bl ov30_0225490C add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x14] bl ov20_022529A0 _02254966: diff --git a/arm9/overlays/31/asm/overlay_31.s b/arm9/overlays/31/asm/overlay_31.s index a31085acd..9580e15ea 100644 --- a/arm9/overlays/31/asm/overlay_31.s +++ b/arm9/overlays/31/asm/overlay_31.s @@ -129,7 +129,7 @@ ov31_02254918: ; 0x02254918 add r0, r4, #0 bl ov31_02254900 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x10] bl ov20_022529A0 _0225494E: diff --git a/arm9/overlays/32/asm/overlay_32.s b/arm9/overlays/32/asm/overlay_32.s index 94e580cba..a7cd9e937 100644 --- a/arm9/overlays/32/asm/overlay_32.s +++ b/arm9/overlays/32/asm/overlay_32.s @@ -136,7 +136,7 @@ ov32_02254920: ; 0x02254920 add r0, r4, #0 bl ov32_02254900 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0xc] bl ov20_022529A0 _02254956: diff --git a/arm9/overlays/33/asm/ov33_02254854.s b/arm9/overlays/33/asm/ov33_02254854.s index 7789cfa1a..a497013d5 100644 --- a/arm9/overlays/33/asm/ov33_02254854.s +++ b/arm9/overlays/33/asm/ov33_02254854.s @@ -92,7 +92,7 @@ ov33_022548D4: ; 0x022548D4 add r0, r4, #0 bl ov33_022548C0 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0xc] bl ov20_022529A0 _02254900: diff --git a/arm9/overlays/34/asm/overlay_34.s b/arm9/overlays/34/asm/overlay_34.s index 68ff3593b..0f2589d57 100644 --- a/arm9/overlays/34/asm/overlay_34.s +++ b/arm9/overlays/34/asm/overlay_34.s @@ -127,7 +127,7 @@ ov34_0225490C: ; 0x0225490C add r0, r4, #0 bl ov34_022548E8 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x28] bl ov20_022529A0 _02254942: diff --git a/arm9/overlays/35/asm/overlay_35.s b/arm9/overlays/35/asm/overlay_35.s index f4a3e1e74..8d9608da8 100644 --- a/arm9/overlays/35/asm/overlay_35.s +++ b/arm9/overlays/35/asm/overlay_35.s @@ -103,7 +103,7 @@ ov35_022548F0: ; 0x022548F0 add r0, r4, #0 bl ov35_022548DC add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x2c] bl ov20_022529A0 _0225491C: @@ -408,7 +408,7 @@ ov35_02254B38: ; 0x02254B38 add r0, r4, #0 add r0, #0x8c ldr r0, [r0] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap _02254B52: diff --git a/arm9/overlays/36/asm/overlay_36.s b/arm9/overlays/36/asm/overlay_36.s index d6c1fcf1f..687bc6fc7 100644 --- a/arm9/overlays/36/asm/overlay_36.s +++ b/arm9/overlays/36/asm/overlay_36.s @@ -139,7 +139,7 @@ ov36_02254938: ; 0x02254938 add r0, r4, #0 bl ov36_02254914 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _02254978 ; =0x00005B80 ldr r0, [r4, r0] bl ov20_022529A0 diff --git a/arm9/overlays/37/asm/overlay_37.s b/arm9/overlays/37/asm/overlay_37.s index 565d59686..8ca6cc369 100644 --- a/arm9/overlays/37/asm/overlay_37.s +++ b/arm9/overlays/37/asm/overlay_37.s @@ -113,7 +113,7 @@ ov37_02254900: ; 0x02254900 add r0, r4, #0 bl ov37_022548E0 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x10] bl ov20_022529A0 _0225492C: diff --git a/arm9/overlays/38/asm/overlay_38.s b/arm9/overlays/38/asm/overlay_38.s index 0ead006ca..ddad2b17f 100644 --- a/arm9/overlays/38/asm/overlay_38.s +++ b/arm9/overlays/38/asm/overlay_38.s @@ -153,7 +153,7 @@ ov38_0225494C: ; 0x0225494C add r0, r4, #0 bl ov38_02254928 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x18] bl ov20_022529A0 _02254982: diff --git a/arm9/overlays/39/asm/overlay_39.s b/arm9/overlays/39/asm/overlay_39.s index a17fb49b3..e0ddc7748 100644 --- a/arm9/overlays/39/asm/overlay_39.s +++ b/arm9/overlays/39/asm/overlay_39.s @@ -190,7 +190,7 @@ ov39_02254998: ; 0x02254998 add r0, r4, #0 bl ov39_02254974 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x3c] bl ov20_022529A0 _022549CE: diff --git a/arm9/overlays/40/asm/overlay_40.s b/arm9/overlays/40/asm/overlay_40.s index 8b939e886..e14eefdc2 100644 --- a/arm9/overlays/40/asm/overlay_40.s +++ b/arm9/overlays/40/asm/overlay_40.s @@ -189,7 +189,7 @@ ov40_02254998: ; 0x02254998 add r0, r4, #0 bl ov40_02254978 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0xc] bl ov20_022529A0 _022549CE: diff --git a/arm9/overlays/41/asm/overlay_41.s b/arm9/overlays/41/asm/overlay_41.s index eff687522..848a8c9a1 100644 --- a/arm9/overlays/41/asm/overlay_41.s +++ b/arm9/overlays/41/asm/overlay_41.s @@ -335,7 +335,7 @@ _02254AAE: add r0, r4, #0 bl ov41_02254A38 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0xc] bl ov20_022529A0 _02254AD0: diff --git a/arm9/overlays/42/asm/overlay_42.s b/arm9/overlays/42/asm/overlay_42.s index 02cde9a1e..f2b6d36d3 100644 --- a/arm9/overlays/42/asm/overlay_42.s +++ b/arm9/overlays/42/asm/overlay_42.s @@ -236,7 +236,7 @@ ov42_02254A04: ; 0x02254A04 add r0, r4, #0 bl ov42_022549CC add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x5c] bl ov20_022529A0 _02254A30: @@ -836,7 +836,7 @@ ov42_02254E7C: ; 0x02254E7C push {r3, r4, r5, r6, r7, lr} add r5, r0, #0 ldr r0, [r5, #0x70] - bl sub_0200CAB4 + bl SysTask_Destroy mov r6, #0 add r4, r5, #0 add r7, r6, #0 diff --git a/arm9/overlays/43/asm/overlay_43.s b/arm9/overlays/43/asm/overlay_43.s index 4cda63682..df4105c53 100644 --- a/arm9/overlays/43/asm/overlay_43.s +++ b/arm9/overlays/43/asm/overlay_43.s @@ -140,7 +140,7 @@ ov43_0225493C: ; 0x0225493C add r0, r4, #0 bl ov43_02254928 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add r4, #0xac ldr r0, [r4] bl ov20_022529A0 @@ -1032,7 +1032,7 @@ ov43_02255000: ; 0x02255000 ldr r0, [r5, r0] cmp r0, #0 beq _0225501A - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0x53 mov r1, #0 lsl r0, r0, #2 diff --git a/arm9/overlays/44/asm/ov44_02254854.s b/arm9/overlays/44/asm/ov44_02254854.s index b7ea5e54d..ba449374d 100644 --- a/arm9/overlays/44/asm/ov44_02254854.s +++ b/arm9/overlays/44/asm/ov44_02254854.s @@ -102,7 +102,7 @@ ov44_022548EC: ; 0x022548EC add r0, r4, #0 bl ov44_022548D8 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0xc] bl ov20_022529A0 _02254918: diff --git a/arm9/overlays/45/asm/overlay_45.s b/arm9/overlays/45/asm/overlay_45.s index f7b84478f..a40e49f4f 100644 --- a/arm9/overlays/45/asm/overlay_45.s +++ b/arm9/overlays/45/asm/overlay_45.s @@ -240,7 +240,7 @@ ov45_022549EC: ; 0x022549EC add r0, r4, #0 bl ov45_022549C0 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add r4, #0x94 ldr r0, [r4] bl ov20_022529A0 diff --git a/arm9/overlays/46/asm/ov46_02254854.s b/arm9/overlays/46/asm/ov46_02254854.s index 641e30332..8a73ae5a7 100644 --- a/arm9/overlays/46/asm/ov46_02254854.s +++ b/arm9/overlays/46/asm/ov46_02254854.s @@ -92,7 +92,7 @@ ov46_022548D4: ; 0x022548D4 add r0, r4, #0 bl ov46_022548C0 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0xc] bl ov20_022529A0 _02254900: diff --git a/arm9/overlays/47/asm/overlay_47.s b/arm9/overlays/47/asm/overlay_47.s index ce06dd9f4..d676f35a1 100644 --- a/arm9/overlays/47/asm/overlay_47.s +++ b/arm9/overlays/47/asm/overlay_47.s @@ -101,7 +101,7 @@ ov47_022548E0: ; 0x022548E0 add r0, r4, #0 bl ov47_022548CC add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x18] bl ov20_022529A0 _02254914: diff --git a/arm9/overlays/48/asm/overlay_48.s b/arm9/overlays/48/asm/overlay_48.s index 07b948220..70d6fa8f2 100644 --- a/arm9/overlays/48/asm/overlay_48.s +++ b/arm9/overlays/48/asm/overlay_48.s @@ -152,7 +152,7 @@ ov48_02254950: ; 0x02254950 add r0, r4, #0 bl ov48_02254938 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x30] bl ov20_022529A0 _02254986: diff --git a/arm9/overlays/49/asm/overlay_49.s b/arm9/overlays/49/asm/overlay_49.s index 7d142c2ae..953cca613 100644 --- a/arm9/overlays/49/asm/overlay_49.s +++ b/arm9/overlays/49/asm/overlay_49.s @@ -142,7 +142,7 @@ ov49_02254938: ; 0x02254938 add r0, r4, #0 bl ov49_02254920 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0x6c] bl ov20_022529A0 _0225496E: diff --git a/arm9/overlays/50/asm/ov50_02254854.s b/arm9/overlays/50/asm/ov50_02254854.s index 1977611f0..3fa283585 100644 --- a/arm9/overlays/50/asm/ov50_02254854.s +++ b/arm9/overlays/50/asm/ov50_02254854.s @@ -93,7 +93,7 @@ ov50_022548D4: ; 0x022548D4 add r0, r4, #0 bl ov50_022548C0 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, [r4, #0xc] bl ov20_022529A0 _02254900: diff --git a/arm9/overlays/54/asm/overlay_54.s b/arm9/overlays/54/asm/overlay_54.s index 88a44f3cd..65ba53309 100644 --- a/arm9/overlays/54/asm/overlay_54.s +++ b/arm9/overlays/54/asm/overlay_54.s @@ -279,7 +279,7 @@ ov54_021D7740: ; 0x021D7740 bl OverlayManager_GetData add r6, r0, #0 ldr r0, [r6, #0x20] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0x6b lsl r0, r0, #2 ldr r0, [r6, r0] diff --git a/arm9/overlays/61/asm/overlay_61.s b/arm9/overlays/61/asm/overlay_61.s index 89e44afee..5a38ecc1d 100644 --- a/arm9/overlays/61/asm/overlay_61.s +++ b/arm9/overlays/61/asm/overlay_61.s @@ -760,7 +760,7 @@ ov61_021D7AA8: ; 0x021D7AA8 ldr r2, [r4, #0x30] cmp r2, #0 bne _021D7ABC - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #8 pop {r4, pc} _021D7ABC: diff --git a/arm9/overlays/62/asm/overlay_62.s b/arm9/overlays/62/asm/overlay_62.s index 97f0ef383..12f139403 100644 --- a/arm9/overlays/62/asm/overlay_62.s +++ b/arm9/overlays/62/asm/overlay_62.s @@ -1571,7 +1571,7 @@ _0222E160: add r0, r7, #0 bl FreeToHeap ldr r0, [sp] - bl sub_0200CAB4 + bl SysTask_Destroy _0222E17C: add sp, #8 pop {r3, r4, r5, r6, r7, pc} @@ -5225,7 +5225,7 @@ _0222FDFC: mov r1, #0 bl sub_0200C61C add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap pop {r3, r4, r5, pc} diff --git a/arm9/overlays/63/asm/ov63_021D8890.s b/arm9/overlays/63/asm/ov63_021D8890.s index 44e15c547..f0fc80aed 100644 --- a/arm9/overlays/63/asm/ov63_021D8890.s +++ b/arm9/overlays/63/asm/ov63_021D8890.s @@ -1230,7 +1230,7 @@ _021D9286: bl GF_AssertFail _021D9296: ldr r0, [r4, #0x28] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x28] _021D92A0: @@ -1258,7 +1258,7 @@ _021D92C0: ldrb r1, [r4, #6] cmp r1, #0x10 blo _021D92D2 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x10] mov r0, #1 @@ -1305,7 +1305,7 @@ _021D931C: ldrb r1, [r4, #6] cmp r1, #0 bne _021D9332 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x10] mov r1, #1 @@ -1354,7 +1354,7 @@ _021D937C: ldrb r1, [r4, #6] cmp r1, #0x10 blo _021D938E - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x10] mov r0, #1 @@ -1393,7 +1393,7 @@ _021D93C4: ldrb r1, [r4, #6] cmp r1, #0x10 blo _021D93D6 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x10] mov r0, #1 diff --git a/arm9/overlays/63/asm/ov63_021DAE5C.s b/arm9/overlays/63/asm/ov63_021DAE5C.s index 5ad562a75..4223cdbae 100644 --- a/arm9/overlays/63/asm/ov63_021DAE5C.s +++ b/arm9/overlays/63/asm/ov63_021DAE5C.s @@ -142,7 +142,7 @@ _021DAF5A: ldr r0, [r0, #8] cmp r0, #0 beq _021DAF68 - bl sub_0200CAB4 + bl SysTask_Destroy _021DAF68: ldr r0, [r5] add r6, r6, #1 @@ -189,7 +189,7 @@ _021DAFAA: ldr r0, [r0, r6] cmp r0, #0 beq _021DAFB8 - bl sub_0200CAB4 + bl SysTask_Destroy _021DAFB8: add r0, r4, #1 lsl r0, r0, #0x18 @@ -207,7 +207,7 @@ _021DAFCA: ldr r0, [r0, r6] cmp r0, #0 beq _021DAFDA - bl sub_0200CAB4 + bl SysTask_Destroy _021DAFDA: add r0, r4, #1 lsl r0, r0, #0x18 @@ -633,7 +633,7 @@ ov63_021DB2F8: ; 0x021DB2F8 cmp r1, r0 blo _021DB330 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #8] _021DB330: @@ -671,7 +671,7 @@ ov63_021DB334: ; 0x021DB334 cmp r0, #0x50 blo _021DB388 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r1, #0 str r1, [r4, #8] strb r1, [r4] @@ -768,7 +768,7 @@ ov63_021DB424: ; 0x021DB424 ldrb r1, [r4, #1] cmp r1, #8 blo _021DB44C - bl sub_0200CAB4 + bl SysTask_Destroy mov r1, #0 str r1, [r4, #8] strb r1, [r4] diff --git a/arm9/overlays/64/asm/overlay_64.s b/arm9/overlays/64/asm/overlay_64.s index 6192633f4..892ae5910 100644 --- a/arm9/overlays/64/asm/overlay_64.s +++ b/arm9/overlays/64/asm/overlay_64.s @@ -2586,7 +2586,7 @@ ov64_021D88C4: ; 0x021D88C4 cmp r4, #1 bne _021D8924 add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r5, #0x40] mov r0, #1 @@ -2881,7 +2881,7 @@ ov64_021D8B44: ; 0x021D8B44 ldr r0, [r4, #0x28] cmp r0, #0 beq _021D8B56 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x28] _021D8B56: @@ -3121,7 +3121,7 @@ ov64_021D8CC8: ; 0x021D8CC8 bge _021D8D26 _021D8D1C: add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r5, #0x54] _021D8D26: @@ -3360,7 +3360,7 @@ ov64_021D8E68: ; 0x021D8E68 bge _021D8EE8 _021D8EDE: add r0, r7, #0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r5, #0x3c] _021D8EE8: diff --git a/arm9/overlays/65/asm/overlay_65.s b/arm9/overlays/65/asm/overlay_65.s index f3ca462cc..2eb727e4c 100644 --- a/arm9/overlays/65/asm/overlay_65.s +++ b/arm9/overlays/65/asm/overlay_65.s @@ -3623,7 +3623,7 @@ ov65_021D9130: ; 0x021D9130 push {r4, lr} add r4, r0, #0 ldr r0, [r4, #0x18] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r1, [r4, #0x14] mov r2, #0x1c ldr r0, [r1, #4] diff --git a/arm9/overlays/66/asm/overlay_66.s b/arm9/overlays/66/asm/overlay_66.s index 113e11373..a4096f0aa 100644 --- a/arm9/overlays/66/asm/overlay_66.s +++ b/arm9/overlays/66/asm/overlay_66.s @@ -3239,7 +3239,7 @@ ov66_021D8E34: ; 0x021D8E34 ldr r0, [r0] cmp r0, #0 beq _021D8E46 - bl sub_0200CAB4 + bl SysTask_Destroy _021D8E46: add r0, r6, #0 add r0, #0xa4 @@ -3464,7 +3464,7 @@ _021D8FF2: sub r0, r0, #2 strb r0, [r4, #0x14] add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0x43 mov r1, #0 lsl r0, r0, #2 @@ -3567,7 +3567,7 @@ _021D90C4: sub r0, r0, #2 strb r0, [r4, #0x14] add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0x43 mov r1, #0 lsl r0, r0, #2 diff --git a/arm9/overlays/69/asm/overlay_69.s b/arm9/overlays/69/asm/overlay_69.s index dfe1e395d..5ee578f33 100644 --- a/arm9/overlays/69/asm/overlay_69.s +++ b/arm9/overlays/69/asm/overlay_69.s @@ -185,7 +185,7 @@ _0222D762: add r4, r0, #0 ldr r0, _0222D7D8 ; =0x00001B34 ldr r0, [r4, r0] - bl sub_0200CAB4 + bl SysTask_Destroy ldr r0, _0222D7DC ; =0x00001B3C ldr r0, [r4, r0] bl ov69_0222F360 @@ -1465,7 +1465,7 @@ ov69_0222E1E4: ; 0x0222E1E4 ldr r0, [r1] bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} thumb_func_start ov69_0222E1FC @@ -1571,7 +1571,7 @@ ov69_0222E2A4: ; 0x0222E2A4 add r0, r4, #0 bl ov69_0222E204 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0222E2D6: pop {r3, r4, r5, pc} @@ -1648,7 +1648,7 @@ ov69_0222E348: ; 0x0222E348 add r0, r4, #0 bl ov69_0222E204 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0222E37A: pop {r3, r4, r5, pc} @@ -1699,7 +1699,7 @@ _0222E3AA: add r0, r4, #0 bl ov69_0222E204 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0222E3D8: pop {r3, r4, r5, pc} nop @@ -1759,7 +1759,7 @@ _0222E412: add r0, r4, #0 bl ov69_0222E204 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0222E44C: pop {r4, r5, r6, pc} nop @@ -1820,7 +1820,7 @@ _0222E488: add r0, r5, #0 bl ov69_0222E204 add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0222E4C2: pop {r4, r5, r6, pc} .align 2, 0 @@ -1881,7 +1881,7 @@ _0222E4FC: add r0, r5, #0 bl ov69_0222E204 add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0222E536: pop {r4, r5, r6, pc} .align 2, 0 @@ -2222,7 +2222,7 @@ _0222E7F6: add r0, r4, #0 bl ov69_0222E204 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} thumb_func_start ov69_0222E804 @@ -2530,7 +2530,7 @@ _0222EA76: add r0, r4, #0 bl ov69_0222E204 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0222EA82: pop {r3, r4, r5, pc} @@ -2626,7 +2626,7 @@ _0222EB2C: add r0, r4, #0 bl ov69_0222E204 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0222EB48: pop {r3, r4, r5, pc} .align 2, 0 @@ -2931,7 +2931,7 @@ _0222EDA4: add r0, r5, #0 bl ov69_0222E204 ldr r0, [sp] - bl sub_0200CAB4 + bl SysTask_Destroy _0222EDC6: add sp, #0xc pop {r4, r5, r6, r7, pc} @@ -3010,7 +3010,7 @@ _0222EE60: ldr r2, [r1, #4] sub r2, r2, #1 str r2, [r1, #4] - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} nop _0222EE70: .word ov69_0222F940 @@ -3040,7 +3040,7 @@ _0222EEA2: ldr r2, [r1, #4] sub r2, r2, #1 str r2, [r1, #4] - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, pc} .align 2, 0 _0222EEB0: .word ov69_0222F940 @@ -3324,7 +3324,7 @@ _0222F0EC: ldr r2, [r1, #4] sub r2, r2, #1 str r2, [r1, #4] - bl sub_0200CAB4 + bl SysTask_Destroy add sp, #0xc pop {r4, r5, r6, r7, pc} .align 2, 0 @@ -3626,7 +3626,7 @@ ov69_0222F360: ; 0x0222F360 bl sub_0201B6C8 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0222F374: pop {r4, pc} .align 2, 0 diff --git a/arm9/overlays/73/asm/overlay_73.s b/arm9/overlays/73/asm/overlay_73.s index d7df1743c..943abe760 100644 --- a/arm9/overlays/73/asm/overlay_73.s +++ b/arm9/overlays/73/asm/overlay_73.s @@ -3589,7 +3589,7 @@ ov73_021D91BC: ; 0x021D91BC mov r0, #0x6b lsl r0, r0, #2 ldr r0, [r4, r0] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r4, #0 bl FreeToHeap pop {r4, pc} @@ -6072,7 +6072,7 @@ ov73_021DA408: ; 0x021DA408 mov r1, #0 bl GfGfx_EngineATogglePlanes add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x2c] _021DA432: @@ -6155,7 +6155,7 @@ ov73_021DA4AC: ; 0x021DA4AC mov r1, #0 bl GfGfx_EngineATogglePlanes ldr r0, [r4, #0x2c] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x2c] _021DA4D0: diff --git a/arm9/overlays/81/asm/overlay_81.s b/arm9/overlays/81/asm/overlay_81.s index e1f19f2bd..5bce93c2b 100644 --- a/arm9/overlays/81/asm/overlay_81.s +++ b/arm9/overlays/81/asm/overlay_81.s @@ -221,7 +221,7 @@ ov81_02238004: ; 0x02238004 mov r0, #0x51 lsl r0, r0, #2 ldr r0, [r4, r0] - bl sub_0200CAB4 + bl SysTask_Destroy bl sub_02033ED0 ldr r0, [r4, #0xc] bl MessageFormat_Delete @@ -490,7 +490,7 @@ _02238224: add r0, r6, #0 add r0, #0xc0 ldr r0, [r0] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r6, #0 bl FreeToHeap _02238246: @@ -595,7 +595,7 @@ _02238308: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02238328: pop {r3, r4, r5, pc} nop @@ -735,7 +735,7 @@ ov81_0223840C: ; 0x0223840C bl sub_0201B6C8 bl FreeToHeap ldr r0, [r6, r4] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r6, r4] add r0, r5, #0 @@ -912,7 +912,7 @@ _02238560: add r0, r4, #0 bl ov81_02238898 add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} _0223857C: ldr r1, [r4, #0x10] @@ -2978,7 +2978,7 @@ ov81_0223951C: ; 0x0223951C bl sub_0201B6C8 bl ov81_02238898 ldr r0, [r4, #0x64] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x64] _02239538: @@ -3091,7 +3091,7 @@ ov81_022395E8: ; 0x022395E8 bl sub_0201B6C8 bl FreeToHeap ldr r0, [r4, #0x68] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x68] _02239604: @@ -3288,7 +3288,7 @@ ov81_02239754: ; 0x02239754 ldr r0, [r5, r0] cmp r0, #0 beq _02239782 - bl sub_0200CAB4 + bl SysTask_Destroy _02239782: mov r0, #0x59 lsl r0, r0, #2 @@ -4291,7 +4291,7 @@ ov81_02239F58: ; 0x02239F58 orr r0, r1 strh r0, [r2] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _02239FAC: pop {r3, r4, r5, pc} nop @@ -4469,7 +4469,7 @@ ov81_0223A0EC: ; 0x0223A0EC mov r1, #0 str r1, [r0] add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223A102: pop {r4, pc} thumb_func_end ov81_0223A0EC @@ -4617,7 +4617,7 @@ ov81_0223A1FC: ; 0x0223A1FC add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223A226: pop {r3, r4, r5, pc} thumb_func_end ov81_0223A1FC @@ -4684,7 +4684,7 @@ _0223A292: add r0, r4, #0 bl FreeToHeap add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 thumb_func_end ov81_0223A270 @@ -6085,7 +6085,7 @@ ov81_0223AD88: ; 0x0223AD88 ldr r0, [r4, #4] cmp r0, #0 beq _0223AD9A - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #4] _0223AD9A: @@ -6458,7 +6458,7 @@ _0223B072: ble _0223B084 mov r1, #0 str r1, [r4, #4] - bl sub_0200CAB4 + bl SysTask_Destroy _0223B084: add sp, #4 pop {r3, r4, pc} @@ -6507,7 +6507,7 @@ ov81_0223B090: ; 0x0223B090 orr r0, r1 strh r0, [r2] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223B0DC: add sp, #8 pop {r3, r4, r5, pc} @@ -6714,7 +6714,7 @@ _0223B24A: mov r0, #1 str r0, [r4, #0x20] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} .align 2, 0 thumb_func_end ov81_0223B21C @@ -7604,7 +7604,7 @@ ov81_0223B9A8: ; 0x0223B9A8 ldr r0, [r4, #4] cmp r0, #0 beq _0223B9BA - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #4] _0223B9BA: @@ -7975,7 +7975,7 @@ _0223BC8A: ble _0223BC9C mov r1, #0 str r1, [r4, #4] - bl sub_0200CAB4 + bl SysTask_Destroy _0223BC9C: pop {r4, pc} .align 2, 0 @@ -8866,7 +8866,7 @@ ov81_0223C3B0: ; 0x0223C3B0 str r2, [r1] bl ov81_02238898 add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223C3CA: pop {r4, pc} thumb_func_end ov81_0223C3B0 @@ -8958,7 +8958,7 @@ ov81_0223C460: ; 0x0223C460 str r2, [r1] bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223C47A: pop {r4, pc} thumb_func_end ov81_0223C460 @@ -9053,7 +9053,7 @@ ov81_0223C514: ; 0x0223C514 str r2, [r1] bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223C52E: pop {r4, pc} thumb_func_end ov81_0223C514 @@ -10030,7 +10030,7 @@ ov81_0223CD08: ; 0x0223CD08 bl sub_0201B6C8 bl ov81_02238898 ldr r0, [r4, #0x68] - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x68] _0223CD24: @@ -10140,7 +10140,7 @@ ov81_0223CDE0: ; 0x0223CDE0 str r2, [r1] bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _0223CDFA: pop {r4, pc} thumb_func_end ov81_0223CDE0 diff --git a/arm9/overlays/83/asm/overlay_83.s b/arm9/overlays/83/asm/overlay_83.s index 25474deae..1ad6d27aa 100644 --- a/arm9/overlays/83/asm/overlay_83.s +++ b/arm9/overlays/83/asm/overlay_83.s @@ -4347,7 +4347,7 @@ ov83_0222F89C: ; 0x0222F89C ldr r2, [r1] cmp r2, #0 bne _0222F8AC - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, pc} _0222F8AC: ldr r1, [r2, #0x20] @@ -9853,7 +9853,7 @@ _022324B4: ldr r0, [r4, r0] cmp r0, #0 beq _022324C0 - bl sub_0200CAB4 + bl SysTask_Destroy _022324C0: mov r0, #3 mov r1, #0 diff --git a/arm9/overlays/84/asm/overlay_84_thumb1.s b/arm9/overlays/84/asm/overlay_84_thumb1.s index b58b21848..25e230385 100644 --- a/arm9/overlays/84/asm/overlay_84_thumb1.s +++ b/arm9/overlays/84/asm/overlay_84_thumb1.s @@ -229,7 +229,7 @@ _021D76CA: add r6, r0, #0 ldr r0, _021D7744 ; =0x00001230 ldr r0, [r5, r0] - bl sub_0200CAB4 + bl SysTask_Destroy add r0, r6, #0 bl OS_RestoreInterrupts mov r0, #0 diff --git a/arm9/overlays/84/asm/overlay_84_thumb2.s b/arm9/overlays/84/asm/overlay_84_thumb2.s index 91a7b1675..93e4f4774 100644 --- a/arm9/overlays/84/asm/overlay_84_thumb2.s +++ b/arm9/overlays/84/asm/overlay_84_thumb2.s @@ -62,7 +62,7 @@ _021D81AA: mov r0, #0 str r0, [r5, #4] add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021D81C2: pop {r4, r5, r6, pc} @@ -621,7 +621,7 @@ ov84_021D85B8: ; 0x021D85B8 ldr r0, [r4, #0x34] cmp r0, #0 beq _021D85C6 - bl sub_0200CAB4 + bl SysTask_Destroy _021D85C6: ldr r0, [r4, #0x30] bl String_Delete @@ -2027,7 +2027,7 @@ _021D906A: mov r0, #0x15 lsl r0, r0, #4 ldr r0, [r5, r0] - bl sub_0200CAB4 + bl SysTask_Destroy _021D9082: add r4, r4, #1 add r5, r5, #4 @@ -2038,7 +2038,7 @@ _021D9082: ldr r0, [r6, r0] cmp r0, #0 beq _021D9098 - bl sub_0200CAB4 + bl SysTask_Destroy _021D9098: ldr r0, [r6, #8] cmp r0, #0 @@ -4465,7 +4465,7 @@ ov84_021DA390: ; 0x021DA390 ldr r0, [r0] cmp r0, #0 beq _021DA39E - bl sub_0200CAB4 + bl SysTask_Destroy _021DA39E: pop {r3, pc} thumb_func_end ov84_021DA390 @@ -4698,7 +4698,7 @@ _021DA552: str r0, [r4] pop {r3, r4, r5, r6, pc} _021DA564: - bl sub_0200CAB4 + bl SysTask_Destroy mov r0, #0 str r0, [r4, #0x7c] _021DA56C: @@ -4762,7 +4762,7 @@ ov84_021DA5D8: ; 0x021DA5D8 bl sub_0201B6C8 bl FreeToHeap add r0, r4, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021DA5EC: pop {r4, pc} .align 2, 0 diff --git a/arm9/overlays/85/asm/overlay_85.s b/arm9/overlays/85/asm/overlay_85.s index 529a85819..f8c6f20aa 100644 --- a/arm9/overlays/85/asm/overlay_85.s +++ b/arm9/overlays/85/asm/overlay_85.s @@ -1370,12 +1370,12 @@ _021D8040: .word ov85_021D8054 thumb_func_start ov85_021D8044 ov85_021D8044: ; 0x021D8044 ldr r1, _021D804C ; =0x00000434 - ldr r3, _021D8050 ; =sub_0200CAB4 + ldr r3, _021D8050 ; =SysTask_Destroy ldr r0, [r0, r1] bx r3 .align 2, 0 _021D804C: .word 0x00000434 -_021D8050: .word sub_0200CAB4 +_021D8050: .word SysTask_Destroy thumb_func_end ov85_021D8044 thumb_func_start ov85_021D8054 @@ -3939,7 +3939,7 @@ _021D9322: add r0, r5, #0 add r0, #0xd0 ldr r0, [r0] - bl sub_0200CAB4 + bl SysTask_Destroy add r4, r4, #1 add r5, #0x24 cmp r4, #3 @@ -7513,11 +7513,11 @@ _021DAD40: .word ov85_021DAD70 ov85_021DAD44: ; 0x021DAD44 mov r1, #0x13 lsl r1, r1, #4 - ldr r3, _021DAD50 ; =sub_0200CAB4 + ldr r3, _021DAD50 ; =SysTask_Destroy ldr r0, [r0, r1] bx r3 nop -_021DAD50: .word sub_0200CAB4 +_021DAD50: .word SysTask_Destroy thumb_func_end ov85_021DAD44 thumb_func_start ov85_021DAD54 @@ -7747,11 +7747,11 @@ _021DAEE0: .word ov85_021DAF80 ov85_021DAEE4: ; 0x021DAEE4 mov r1, #0x16 lsl r1, r1, #4 - ldr r3, _021DAEF0 ; =sub_0200CAB4 + ldr r3, _021DAEF0 ; =SysTask_Destroy ldr r0, [r0, r1] bx r3 nop -_021DAEF0: .word sub_0200CAB4 +_021DAEF0: .word SysTask_Destroy thumb_func_end ov85_021DAEE4 thumb_func_start ov85_021DAEF4 @@ -9569,7 +9569,7 @@ _021DBBDA: add r0, r5, #0 bl FreeToHeap add r0, r7, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021DBBE6: pop {r3, r4, r5, r6, r7, pc} thumb_func_end ov85_021DBB88 @@ -9620,7 +9620,7 @@ _021DBC3A: add r0, r5, #0 bl FreeToHeap add r0, r7, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021DBC46: pop {r3, r4, r5, r6, r7, pc} thumb_func_end ov85_021DBBE8 @@ -9643,7 +9643,7 @@ ov85_021DBC48: ; 0x021DBC48 add r0, r5, #0 bl FreeToHeap add r0, r7, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, r6, r7, pc} _021DBC70: ldr r3, [r5, #8] @@ -9716,7 +9716,7 @@ _021DBCD8: add r0, r5, #0 bl FreeToHeap add r0, r7, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021DBCFE: pop {r3, r4, r5, r6, r7, pc} thumb_func_end ov85_021DBC48 @@ -11682,7 +11682,7 @@ ov85_021DCB18: ; 0x021DCB18 mov r0, #1 str r0, [r5, #0xc] add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, r5, r6, pc} thumb_func_end ov85_021DCB18 @@ -11703,7 +11703,7 @@ ov85_021DCB44: ; 0x021DCB44 mov r0, #2 str r0, [r4, #0xc] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021DCB68: pop {r3, r4, r5, pc} .align 2, 0 @@ -11938,7 +11938,7 @@ ov85_021DCCFC: ; 0x021DCCFC mov r0, #1 str r0, [r5, #0xc] add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, r5, r6, pc} thumb_func_end ov85_021DCCFC @@ -11959,7 +11959,7 @@ ov85_021DCD28: ; 0x021DCD28 mov r0, #2 str r0, [r4, #0xc] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021DCD4C: pop {r3, r4, r5, pc} .align 2, 0 @@ -12048,7 +12048,7 @@ ov85_021DCDD8: ; 0x021DCDD8 mov r0, #1 str r0, [r5, #0x10] add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, r5, r6, pc} thumb_func_end ov85_021DCDD8 @@ -12069,7 +12069,7 @@ ov85_021DCE04: ; 0x021DCE04 mov r0, #2 str r0, [r4, #0x10] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021DCE28: pop {r3, r4, r5, pc} .align 2, 0 @@ -12891,7 +12891,7 @@ ov85_021DD46C: ; 0x021DD46C mov r0, #1 str r0, [r5, #0x10] add r0, r6, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r4, r5, r6, pc} thumb_func_end ov85_021DD46C @@ -12914,7 +12914,7 @@ ov85_021DD498: ; 0x021DD498 mov r0, #2 str r0, [r4, #0x10] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021DD4C0: pop {r3, r4, r5, pc} .align 2, 0 @@ -15058,7 +15058,7 @@ ov85_021DE4A8: ; 0x021DE4A8 mov r0, #1 str r0, [r4, #8] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy pop {r3, r4, r5, pc} thumb_func_end ov85_021DE4A8 @@ -15079,7 +15079,7 @@ ov85_021DE4C8: ; 0x021DE4C8 mov r0, #2 str r0, [r4, #8] add r0, r5, #0 - bl sub_0200CAB4 + bl SysTask_Destroy _021DE4EC: pop {r3, r4, r5, pc} .align 2, 0 diff --git a/arm9/src/encounter.c b/arm9/src/encounter.c index cfeda407a..8abac57f8 100644 --- a/arm9/src/encounter.c +++ b/arm9/src/encounter.c @@ -8,6 +8,7 @@ #include "blackout.h" #include "field_system.h" #include "igt.h" +#include "map_object.h" #include "save_vars_flags.h" #include "task.h" #include "unk_020040F4.h" @@ -24,8 +25,6 @@ extern void BattleSetup_Delete(BattleSetup *setup); extern BOOL IsBattleResultWin(u32 winFlag); extern void sub_02047F38(BattleSetup *setup, FieldSystem *fieldSystem); extern void sub_02061080(FieldSystem *fieldSystem, u32 param1, u32 winFlag); -extern void MapObjectManager_PauseAllMovement(MapObjectManager *mapObjectManager); -extern void MapObjectManager_UnpauseAllMovement(MapObjectManager *mapObjectManager); extern void sub_0202E25C(SaveData *saveData, s32 param1); extern void sub_02047FA4(BattleSetup *setup, FieldSystem *fieldSystem); extern BattleSetup *ov06_02244558(u32 param0, FieldSystem *fieldSystem); diff --git a/arm9/src/map_object.c b/arm9/src/map_object.c index d01246c2c..3997251df 100644 --- a/arm9/src/map_object.c +++ b/arm9/src/map_object.c @@ -6,7 +6,9 @@ #include "field_system.h" #include "heap.h" -#include "unk_0200CA44.h" + +extern UnkLMOCallbackStruct *UNK_020F6364[55]; +extern UnkLMOCallbackStruct3 ov05_021F9494[210]; static MapObjectManager *MapObjectManager_New(u32 objectCount); static LocalMapObject *MapObject_CreateFromObjectEvent(MapObjectManager *manager, ObjectEvent *objectEvent, u32 mapNo); @@ -14,19 +16,19 @@ static void SavedMapObject_InitFromLocalMapObject(FieldSystem *fieldSystem, Loca static void LocalMapObject_InitFromSavedMapObject(LocalMapObject *localObject, SavedMapObject *savedObject); static void sub_02057AEC(MapObjectManager *manager, LocalMapObject *object); static void sub_02057B34(LocalMapObject *object); -static void MapObject_ConvertXYToPositionVec(LocalMapObject *object); +static void MapObject_ConvertXZToPositionVec(LocalMapObject *object); static void MapObject_CreateFromInitArgs(MapObjectInitArgs *args); static LocalMapObject *MapObjectManager_GetFirstInactiveObject(MapObjectManager *manager); static LocalMapObject *sub_02057C98(MapObjectManager *manager, u32 id, u32 mapNo); static void sub_02057CF0(MapObjectManager *manager, LocalMapObject *object); static void MapObject_InitFromObjectEvent(LocalMapObject *object, ObjectEvent *objectEvent, FieldSystem *fieldSystem); -static void MapObject_SetPositionVecFromObjectEvent(LocalMapObject *object, ObjectEvent *objectEvent); +static void MapObject_SetPositionVectorFromObjectEvent(LocalMapObject *object, ObjectEvent *objectEvent); static void sub_02057E90(LocalMapObject *object, MapObjectManager *manager); /*static*/ void sub_02057EE0(LocalMapObject *object); -/*static*/ void sub_02057F18(LocalMapObject *object); +static void sub_02057F18(LocalMapObject *object); static void MapObject_Clear(LocalMapObject *object); -static u32 sub_02057F90(LocalMapObject *object, u32 flagId, u32 objectEventCount, ObjectEvent *objectEvents); -static LocalMapObject *MapObjectManager_GetFirstObjectWithID(MapObjectManager *manager, u32 objectId, u32 flagId); +static u32 sub_02057F90(LocalMapObject *object, u32 mapId, u32 objectEventCount, ObjectEvent *objectEvents); +static LocalMapObject *MapObjectManager_GetFirstObjectWithIDAndMap(MapObjectManager *manager, u32 objectId, u32 mapId); static void sub_02058148(LocalMapObject *object); /*static*/ void sub_0205815C(LocalMapObject *object); static void MapObject_NoOp(LocalMapObject *object); @@ -37,172 +39,115 @@ static void sub_020581B4(LocalMapObject *object); static BOOL MapObject_ScriptIDIsFFFF(LocalMapObject *object); static void sub_02058214(LocalMapObject *object, ObjectEvent *objectEvent, u32 mapNo); static void sub_02058258(LocalMapObject *object, u32 mapNo, ObjectEvent *objectEvent); +static void sub_0205832C(SysTask *task, LocalMapObject *object); +static void sub_02058348(LocalMapObject *object); +static MapObjectManager *MapObjectManager_Get(MapObjectManager *manager); +static void MapObjectManager_SetObjectCount(MapObjectManager *manager, u32 count); +static void sub_0205836C(MapObjectManager *manager); +static void sub_02058374(MapObjectManager *manager); +static void MapObjectManager_SetPriority(MapObjectManager *manager, u32 priority); +static void MapObjectManager_SetObjects(MapObjectManager *manager, LocalMapObject *objects); +static LocalMapObject *MapObjectManager_GetObjects3(MapObjectManager *manager); +static void MapObjectManager_SetFieldSystem(MapObjectManager *manager, FieldSystem *fieldSystem); +static FieldSystem *MapObjectManager_GetFieldSystem(MapObjectManager *manager); +static void MapObject_SetFlags(LocalMapObject *object, u32 flags); +static u32 MapObject_GetFlags(LocalMapObject *object); +static void MapObject_SetFlags2(LocalMapObject *object, u32 flags); +static u32 MapObject_GetFlags2(LocalMapObject *object); +static void MapObject_SetMapID(LocalMapObject *object, u32 mapId); +/*static*/ void MapObject_SetMovement(LocalMapObject *object, u32 movement); +static u32 MapObject_GetEventFlag(LocalMapObject *object); +static void MapObject_SetInitialFacingDirection(LocalMapObject *object, u32 initialFacing); +static void sub_02058554(LocalMapObject *object, SysTask *sysTask); +static SysTask *sub_0205855C(LocalMapObject *object); +static void sub_02058564(LocalMapObject *object); +static void MapObject_SetManager(LocalMapObject *object, MapObjectManager *manager); +static MapObjectManager *MapObject_GetManagerFromManager(LocalMapObject *object); +static void sub_02058630(LocalMapObject *object, LocalMapObject_UnkCallback callback); +static void sub_02058644(LocalMapObject *object, LocalMapObject_UnkCallback callback); +static void sub_02058658(LocalMapObject *object, LocalMapObject_UnkCallback callback); +/*static*/ void sub_02058660(LocalMapObject *object); +static void sub_0205866C(LocalMapObject *object); +static void sub_02058684(LocalMapObject *object, LocalMapObject_UnkCallback callback); +static void sub_0205868C(LocalMapObject *object); +static void sub_02058698(LocalMapObject *object, LocalMapObject_UnkCallback callback); +static void sub_020586AC(LocalMapObject *object, LocalMapObject_UnkCallback callback); +static void sub_020586B4(LocalMapObject *object); +static void sub_020586C0(LocalMapObject *object, LocalMapObject_UnkCallback callback); +static void sub_020586C8(LocalMapObject *object); +static void sub_020586D4(LocalMapObject *object, LocalMapObject_UnkCallback callback); +static void MapObject_SetFlag14(LocalMapObject *object); +static void MapObject_SetFlag25(LocalMapObject *object, BOOL set); +static void MapObject_SetInitialX(LocalMapObject *object, u32 initialX); +static void MapObject_SetInitialY(LocalMapObject *object, u32 initialY); +static void MapObject_SetInitialZ(LocalMapObject *object, u32 initialZ); +static void ObjectEvent_SetID(ObjectEvent *objectEvent, u16 id); +static u16 ObjectEvent_GetID(ObjectEvent *objectEvent); +static void ObjectEvent_SetSpriteID(ObjectEvent *objectEvent, u32 spriteId); +static u16 ObjectEvent_GetSpriteID(ObjectEvent *objectEvent); +static void ObjectEvent_SetMovement(ObjectEvent *objectEvent, u32 movement); +static u16 ObjectEvent_GetMovement(ObjectEvent *objectEvent); +static void ObjectEvent_SetType(ObjectEvent *objectEvent, u16 type); +static u16 ObjectEvent_GetType(ObjectEvent *objectEvent); +static void ObjectEvent_SetEventFlag(ObjectEvent *objectEvent, u16 eventFlag); +static u16 ObjectEvent_GetEventFlag(ObjectEvent *objectEvent); +static void ObjectEvent_SetScriptID(ObjectEvent *objectEvent, u16 scriptId); +static u16 ObjectEvent_GetScriptID(ObjectEvent *objectEvent); +static void ObjectEvent_SetFacingDirection(ObjectEvent *objectEvent, u32 facingDirection); +static s16 ObjectEvent_GetFacingDirection(ObjectEvent *objectEvent); +static void ObjectEvent_SetParam(ObjectEvent *objectEvent, s32 value, u32 param); +static u16 ObjectEvent_GetParam(ObjectEvent *objectEvent, u32 param); +static void ObjectEvent_SetXRange(ObjectEvent *objectEvent, s16 xRange); +static s16 ObjectEvent_GetXRange(ObjectEvent *objectEvent); +static void ObjectEvent_SetYRange(ObjectEvent *objectEvent, s16 yRange); +static s16 ObjectEvent_GetYRange(ObjectEvent *objectEvent); +static void ObjectEvent_SetXCoord(ObjectEvent *objectEvent, u32 x); +static u16 ObjectEvent_GetXCoord(ObjectEvent *template); +static void ObjectEvent_SetYCoord(ObjectEvent *objectEvent, u32 y); +static u32 ObjectEvent_GetYCoord(ObjectEvent *objectEvent); +static void ObjectEvent_SetZCoord(ObjectEvent *objectEvent, u32 z); +static u16 ObjectEvent_GetZCoord(ObjectEvent *objectEvent); +static ObjectEvent *ObjectEvent_GetByID(u16 id, s32 objectEventCount, ObjectEvent *objectEvents); +static BOOL ObjectEvent_ScriptIDIsUnset(ObjectEvent *objectEvent); +static u16 ObjectEvent_GetEventFlag_AssertScriptIDIsUnset(ObjectEvent *template); +static UnkLMOCallbackStruct *sub_02058D14(u32 movement); +static LocalMapObject_UnkCallback sub_02058D2C(UnkLMOCallbackStruct *callbackStruct); +static LocalMapObject_UnkCallback sub_02058D30(UnkLMOCallbackStruct *callbackStruct); +static LocalMapObject_UnkCallback sub_02058D34(UnkLMOCallbackStruct *callbackStruct); +static LocalMapObject_UnkCallback sub_02058D38(UnkLMOCallbackStruct2 *callbackStruct); +static LocalMapObject_UnkCallback sub_02058D3C(UnkLMOCallbackStruct2 *callbackStruct); +static LocalMapObject_UnkCallback sub_02058D40(UnkLMOCallbackStruct2 *callbackStruct); +static LocalMapObject_UnkCallback sub_02058D44(UnkLMOCallbackStruct2 *callbackStruct); +static LocalMapObject_UnkCallback sub_02058D48(UnkLMOCallbackStruct2 *callbackStruct); +static UnkLMOCallbackStruct2 *sub_02058D4C(u32 spriteId); -extern void MapObjectManager_SetFieldSystemPtr(MapObjectManager *manager, FieldSystem *fieldSystem); -extern void MapObjectManager_SetObjectCount(MapObjectManager *manager, u32 objectCount); -extern void MapObjectManager_SetPriority(MapObjectManager *manager, u32 priority); -extern LocalMapObject *MapObjectManager_GetObjects(MapObjectManager *manager); -extern u32 MapObjectManager_GetObjectCount(MapObjectManager *manager); -extern BOOL MapObject_IsInUse(LocalMapObject *object); extern void ov05_021F2AF4(MapObjectManager *manager, void *param0); -extern void *sub_020583A0(MapObjectManager *manager); -extern u32 sub_02058450(LocalMapObject *object); -extern BOOL MapObject_TestFlagsBits(LocalMapObject *object, MapObjectFlagBits flags); -extern void MapObjectManager_SetObjects(MapObjectManager *manager, LocalMapObject *objects); -extern u32 ObjectEvent_GetID(ObjectEvent *objectEvent); extern BOOL ObjectEvent_ScriptIDIsUnset(ObjectEvent *objectEvent); -extern u16 ObjectEvent_GetFlagID_AssertScriptIDIsUnset(ObjectEvent *objectEvent); -extern FieldSystem *MapObjectManager_GetFieldSystemPtr(MapObjectManager *manager); extern void sub_02057E90(LocalMapObject *object, MapObjectManager *manager); -extern void sub_0205844C(LocalMapObject *object, u32 mapNo); -extern void MapObject_SetFlagsBits(LocalMapObject *object, MapObjectFlagBits bits); -extern MapObjectManager *MapObjectManager_Get(MapObjectManager *manager); -extern void sub_0205836C(MapObjectManager *manager); -extern void ObjectEvent_SetId(ObjectEvent *objectEvent, u32 id); -extern void ObjectEvent_SetSprite(ObjectEvent *objectEvent, u32 sprite); -extern void ObjectEvent_SetMovement(ObjectEvent *objectEvent, u32 movement); -extern void ObjectEvent_SetType(ObjectEvent *objectEvent, u32 type); -extern void ObjectEvent_SetFlagId(ObjectEvent *objectEvent, u32 flagId); -extern void ObjectEvent_SetScript(ObjectEvent *objectEvent, u32 script); -extern void ObjectEvent_SetFacing(ObjectEvent *objectEvent, u32 direction); -extern void ObjectEvent_SetParam(ObjectEvent *objectEvent, u32 value, u32 param); -extern void ObjectEvent_SetXRange(ObjectEvent *objectEvent, u32 xRange); -extern void ObjectEvent_SetYRange(ObjectEvent *objectEvent, u32 yRange); -extern void ObjectEvent_SetXCoord(ObjectEvent *objectEvent, u32 xCoord); -extern void ObjectEvent_SetYCoord(ObjectEvent *objectEvent, u32 yCoord); -extern void ObjectEvent_SetHeight(ObjectEvent *objectEvent, u32 height); -extern u32 ObjectEvent_GetFlagID(ObjectEvent *objectEvent); -extern ObjectEvent *ObjectEvent_GetById(u32 id, u32 objectEventCount, ObjectEvent *events); extern u8 FieldSystem_FlagCheck(FieldSystem *fieldSystem, u16 flag); -extern void MapObject_SetSpriteID(LocalMapObject *object, u32 sprite); -extern void MapObject_ClearFlagsBits(LocalMapObject *object, MapObjectFlagBits bits); -extern BOOL sub_02058934(LocalMapObject *object); -extern MapObjectManager *MapObject_GetManager(LocalMapObject *object); -extern BOOL sub_020587E0(MapObjectManager *manager); -extern void sub_020586B4(LocalMapObject *object); -extern void sub_02058660(LocalMapObject *object); -extern void sub_02058564(LocalMapObject *object); -extern MapObjectManager *sub_02058580(LocalMapObject *object); -extern void sub_02058374(MapObjectManager *manager); -extern u32 MapObject_GetFlagID(LocalMapObject *object); -extern FieldSystem *MapObject_GetFieldSystem(LocalMapObject *object); +extern MapObjectManager *MapObject_GetManagerFromManager(LocalMapObject *object); extern void FieldSystem_FlagSet(FieldSystem *fieldSystem, u16 flag); extern void sub_02058ED8(LocalMapObject *object); extern void sub_02058EDC(LocalMapObject *object); extern void sub_02058EE0(LocalMapObject *object); extern void sub_02058EE4(LocalMapObject *object); -extern u32 MapObject_GetFlagsBits(LocalMapObject *object, MapObjectFlagBits bits); -extern void sub_02058684(LocalMapObject *object, LocalMapObject_UnkCallback callback); -extern void sub_02058698(LocalMapObject *object, LocalMapObject_UnkCallback callback); -extern void sub_020586AC(LocalMapObject *object, LocalMapObject_UnkCallback callback); -extern void sub_020586C0(LocalMapObject *object, LocalMapObject_UnkCallback callback); -extern void sub_020586D4(LocalMapObject *object, LocalMapObject_UnkCallback callback); -extern void sub_020586C8(LocalMapObject *object); -extern BOOL MapObject_CheckFlag14(LocalMapObject *object); -extern void sub_020586DC(LocalMapObject *object); extern void sub_02057AEC(MapObjectManager *manager, LocalMapObject *object); -extern u32 MapObject_GetFlagsWord(LocalMapObject *object); -extern u32 MapObject_GetFlags2Word(LocalMapObject *object); -extern u32 MapObject_GetID(LocalMapObject *object); -extern u32 MapObject_GetSpriteID(LocalMapObject *object); -extern u32 MapObject_GetMovement(LocalMapObject *object); -extern u32 MapObject_GetType(LocalMapObject *object); -extern u32 MapObject_GetScriptID(LocalMapObject *object); -extern u32 MapObject_GetInitialFacingDirection(LocalMapObject *object); -extern u32 MapObject_GetFacingDirection(LocalMapObject *object); -extern u32 MapObject_GetNextFacingDirection(LocalMapObject *object); -extern u32 MapObject_GetParam(LocalMapObject *object, u32 param); -extern u32 MapObject_GetXRange(LocalMapObject *object); -extern u32 MapObject_GetYRange(LocalMapObject *object); -extern u32 MapObject_GetInitialX(LocalMapObject *object); -extern u32 MapObject_GetInitialHeight(LocalMapObject *object); -extern u32 MapObject_GetInitialY(LocalMapObject *object); -extern u32 MapObject_GetCurrentX(LocalMapObject *object); -extern u32 MapObject_GetCurrentHeight(LocalMapObject *object); -extern u32 MapObject_GetCurrentY(LocalMapObject *object); extern void sub_02059E60(s32 x, s32 y, VecFx32 *vector); -extern u32 MapObject_GetPosVecYCoord(LocalMapObject *object); -extern u32 MapObject_CheckFlag29(LocalMapObject *object); -extern u8 *sub_020585B0(LocalMapObject *object); -extern u8 *sub_020585D8(LocalMapObject *object); extern BOOL sub_02059EC8(FieldSystem *fieldSystem, VecFx32 *vector, BOOL flag); -extern void MapObject_SetFlagsWord(LocalMapObject *object, u32 flags); -extern void MapObject_SetFlags2Word(LocalMapObject *object, u32 flags2); -extern void MapObject_SetID(LocalMapObject *object, u32 objectId); -extern void sub_0205844C(LocalMapObject *object, u32 param1); -extern void MapObject_SetMovement(LocalMapObject *object, u32 movement); -extern void MapObject_SetType(LocalMapObject *object, u32 type); -extern void MapObject_SetFlagID(LocalMapObject *object, u32 flagId); -extern void MapObject_SetScriptID(LocalMapObject *object, u32 script); -extern void MapObject_SetInitialFacingDirection(LocalMapObject *object, u32 initialDirection); -extern void MapObject_SetFacingDirectionDirect(LocalMapObject *object, u32 direction); -extern void MapObject_SetNextFacingDirection(LocalMapObject *object, u32 nextDirection); -extern void MapObject_SetParam(LocalMapObject *object, u32 value, u32 param); -extern void MapObject_SetXRange(LocalMapObject *object, u32 xRange); -extern void MapObject_SetYRange(LocalMapObject *object, u32 yRange); -extern void MapObject_SetInitialX(LocalMapObject *object, u32 initialX); -extern void MapObject_SetInitialHeight(LocalMapObject *object, u32 initialHeight); -extern void MapObject_SetInitialY(LocalMapObject *object, u32 initialY); -extern void MapObject_SetCurrentX(LocalMapObject *object, u32 currentX); -extern void MapObject_SetCurrentHeight(LocalMapObject *object, u32 currentHeight); -extern void MapObject_SetCurrentY(LocalMapObject *object, u32 currentY); -extern void MapObject_SetPositionVec(LocalMapObject *object, VecFx32 *coords); -extern void MapObject_SetManager(LocalMapObject *object, MapObjectManager *manager); extern void MapObject_ClearHeldMovement(LocalMapObject *object); -extern void sub_0205866C(LocalMapObject *object); -extern void MapObject_GetPositionVec(LocalMapObject *object, VecFx32 *position); -extern void MapObject_SetPreviousX(LocalMapObject *object, u32 previousX); -extern void MapObject_SetPreviousHeight(LocalMapObject *object, u32 previousHeight); -extern void MapObject_SetPreviousY(LocalMapObject *object, u32 previousY); -extern void MapObject_CreateFromInitArgs(MapObjectInitArgs *args); -extern BOOL MapObject_CheckFlag25(LocalMapObject *object); -extern u32 sub_02058750(LocalMapObject *object); -extern void sub_0205832C(SysTask *task, LocalMapObject *object); -extern u32 MapObjectManager_GetPriority(MapObjectManager *manager); -extern void sub_02058554(LocalMapObject *object, SysTask *task); -extern u16 ObjectEvent_GetSpriteID(ObjectEvent *objectEvent); -extern u16 ObjectEvent_GetMovement(ObjectEvent *objectEvent); -extern u16 ObjectEvent_GetType(ObjectEvent *objectEvent); -extern u16 ObjectEvent_GetScriptID(ObjectEvent *objectEvent); -extern u16 ObjectEvent_GetInitialFacingDirection(ObjectEvent *objectEvent); -extern u32 ObjectEvent_GetParam(ObjectEvent *objectEvent, u32 param); -extern u32 ObjectEvent_GetXRange(ObjectEvent *objectEvent); -extern u32 ObjectEvent_GetYRange(ObjectEvent *objectEvent); -extern u16 ObjectEvent_GetXCoord(ObjectEvent *objectEvent); -extern u16 ObjectEvent_GetYCoord(ObjectEvent *objectEvent); -extern u32 ObjectEvent_GetHeight(ObjectEvent *objectEvent); -extern void MapObject_SetFlag25(LocalMapObject *object, BOOL flag); -extern UnkLMOCallbackStruct *sub_02058D14(u32 movement); -extern LocalMapObject_UnkCallback sub_02058D2C(UnkLMOCallbackStruct *callbackStruct); -extern void sub_02058630(LocalMapObject *object, LocalMapObject_UnkCallback callback); -extern LocalMapObject_UnkCallback sub_02058D30(UnkLMOCallbackStruct *callbackStruct); -extern void sub_02058644(LocalMapObject *object, LocalMapObject_UnkCallback callback); -extern LocalMapObject_UnkCallback sub_02058D34(UnkLMOCallbackStruct *callbackStruct); -extern void sub_02058658(LocalMapObject *object, LocalMapObject_UnkCallback callback); -extern UnkLMOCallbackStruct2 *sub_02058D4C(u32 spriteId); -extern LocalMapObject_UnkCallback sub_02058D38(UnkLMOCallbackStruct2 *callbackStruct); -extern void sub_02058684(LocalMapObject *object, LocalMapObject_UnkCallback callback); -extern LocalMapObject_UnkCallback sub_02058D3C(UnkLMOCallbackStruct2 *callbackStruct); -extern void sub_02058698(LocalMapObject *object, LocalMapObject_UnkCallback callback); -extern LocalMapObject_UnkCallback sub_02058D40(UnkLMOCallbackStruct2 *callbackStruct); -extern void sub_020586AC(LocalMapObject *object, LocalMapObject_UnkCallback callback); -extern LocalMapObject_UnkCallback sub_02058D44(UnkLMOCallbackStruct2 *callbackStruct); -extern void sub_020586C0(LocalMapObject *object, LocalMapObject_UnkCallback callback); -extern LocalMapObject_UnkCallback sub_02058D48(UnkLMOCallbackStruct2 *callbackStruct); -extern void sub_020586D4(LocalMapObject *object, LocalMapObject_UnkCallback callback); -extern const LocalMapObject *MapObjectManager_GetConstObjects(MapObjectManager *manager); extern u16 FieldSystem_VarGetObjectEventGraphicsId(FieldSystem *fieldSystem, u16 spriteId); extern u32 sub_02059D1C(LocalMapObject *object); extern void sub_02058EE8(LocalMapObject *object); -extern void sub_02058544(LocalMapObject *object, u32 param1); extern void ov05_021F2E0C(LocalMapObject *object, BOOL set); -extern void sub_0205868C(LocalMapObject *object); -extern void MapObject_SetFlag14(LocalMapObject *object); -extern void *sub_02058744(LocalMapObject *object); +extern void sub_02058EF8(LocalMapObject *object); +extern void ov05_021F1D8C(LocalMapObject *object); +extern BOOL sub_0205C334(void); +extern u32 sub_0205C340(LocalMapObject *object); +extern void sub_02059C60(LocalMapObject *object); MapObjectManager *MapObjectManager_Init(FieldSystem *fieldSystem, u32 objectCount, u32 priority) { MapObjectManager *ret = MapObjectManager_New(objectCount); - MapObjectManager_SetFieldSystemPtr(ret, fieldSystem); + MapObjectManager_SetFieldSystem(ret, fieldSystem); MapObjectManager_SetObjectCount(ret, objectCount); MapObjectManager_SetPriority(ret, priority); @@ -214,15 +159,15 @@ void MapObjectManager_Delete(MapObjectManager *manager) { FreeToHeapExplicit(HEAP_ID_FIELD, manager); } -void sub_020573C8(MapObjectManager *manager, u32 unused, u32 flagId, u32 objectCount, ObjectEvent *objectEvents) { +void sub_020573C8(MapObjectManager *manager, u32 unused, u32 mapId, u32 objectCount, ObjectEvent *objectEvents) { u32 count = MapObjectManager_GetObjectCount(manager); LocalMapObject *objects = MapObjectManager_GetObjects(manager); for (; count != 0; count--) { - if (MapObject_IsInUse(objects) == TRUE) { - switch (sub_02057F90(objects, flagId, objectCount, objectEvents)) { + if (MapObject_CheckActive(objects) == TRUE) { + switch (sub_02057F90(objects, mapId, objectCount, objectEvents)) { case 0: - if (sub_02058450(objects) != flagId && !MapObject_TestFlagsBits(objects, MAPOBJECTFLAG_UNK10)) { + if (MapObject_GetMapID(objects) != mapId && !MapObject_TestFlagsBits(objects, MAPOBJECTFLAG_KEEP)) { MapObject_Remove(objects); } break; @@ -264,7 +209,7 @@ static LocalMapObject *MapObject_CreateFromObjectEvent(MapObjectManager *manager return ret; } } else { - ret = MapObjectManager_GetFirstObjectWithID(manager, objectId, ObjectEvent_GetFlagID_AssertScriptIDIsUnset(objectEvent)); + ret = MapObjectManager_GetFirstObjectWithIDAndMap(manager, objectId, ObjectEvent_GetEventFlag_AssertScriptIDIsUnset(objectEvent)); if (ret != NULL) { sub_02058258(ret, mapNo, objectEvent); return ret; @@ -276,9 +221,9 @@ static LocalMapObject *MapObject_CreateFromObjectEvent(MapObjectManager *manager return ret; } - MapObject_InitFromObjectEvent(ret, objectEvent, MapObjectManager_GetFieldSystemPtr(manager)); + MapObject_InitFromObjectEvent(ret, objectEvent, MapObjectManager_GetFieldSystem(manager)); sub_02057E90(ret, manager); - sub_0205844C(ret, mapNo); + MapObject_SetMapID(ret, mapNo); sub_020581A4(ret); sub_020581B4(ret); MapObject_SetFlagsBits(ret, MAPOBJECTFLAG_UNK2); @@ -289,32 +234,33 @@ static LocalMapObject *MapObject_CreateFromObjectEvent(MapObjectManager *manager LocalMapObject *MapObject_Create(MapObjectManager *manager, u32 x, u32 y, u32 direction, u32 sprite, u32 movement, u32 mapNo) { ObjectEvent objectEvent; - ObjectEvent_SetId(&objectEvent, 0); - ObjectEvent_SetSprite(&objectEvent, sprite); + ObjectEvent_SetID(&objectEvent, 0); + ObjectEvent_SetSpriteID(&objectEvent, sprite); ObjectEvent_SetMovement(&objectEvent, movement); ObjectEvent_SetType(&objectEvent, 0); - ObjectEvent_SetFlagId(&objectEvent, 0); - ObjectEvent_SetScript(&objectEvent, 0); - ObjectEvent_SetFacing(&objectEvent, direction); + ObjectEvent_SetEventFlag(&objectEvent, 0); + ObjectEvent_SetScriptID(&objectEvent, 0); + ObjectEvent_SetFacingDirection(&objectEvent, direction); ObjectEvent_SetParam(&objectEvent, 0, 0); ObjectEvent_SetParam(&objectEvent, 0, 1); ObjectEvent_SetParam(&objectEvent, 0, 2); ObjectEvent_SetXRange(&objectEvent, 0); ObjectEvent_SetYRange(&objectEvent, 0); ObjectEvent_SetXCoord(&objectEvent, x); - ObjectEvent_SetYCoord(&objectEvent, y); - ObjectEvent_SetHeight(&objectEvent, 0); + ObjectEvent_SetZCoord(&objectEvent, y); + ObjectEvent_SetYCoord(&objectEvent, 0); return MapObject_CreateFromObjectEvent(manager, &objectEvent, mapNo); } LocalMapObject *MapObject_CreateFromObjectEventWithId(MapObjectManager *manager, u16 id, u32 objectEventCount, u32 mapNo, const ObjectEvent *events) { LocalMapObject *ret = NULL; - ObjectEvent *objectEvent = ObjectEvent_GetById(id, objectEventCount, (ObjectEvent *)events); + ObjectEvent *objectEvent = ObjectEvent_GetByID(id, objectEventCount, (ObjectEvent *)events); if (objectEvent != NULL) { - u32 flagId = ObjectEvent_GetFlagID(objectEvent); - FieldSystem *fieldSystem = MapObjectManager_GetFieldSystemPtr(manager); - if (FieldSystem_FlagCheck(fieldSystem, (u16)flagId) == FALSE) { + // casts and typing required to match + u32 eventFlag = ObjectEvent_GetEventFlag(objectEvent); + FieldSystem *fieldSystem = MapObjectManager_GetFieldSystem(manager); + if (FieldSystem_FlagCheck(fieldSystem, (u16)eventFlag) == FALSE) { ret = MapObject_CreateFromObjectEvent(manager, objectEvent, mapNo); } } @@ -342,20 +288,20 @@ void MapObject_Remove(LocalMapObject *object) { } sub_02058660(object); sub_02058564(object); - sub_02058374(sub_02058580(object)); + sub_02058374(MapObject_GetManagerFromManager(object)); MapObject_Clear(object); } void MapObject_Delete(LocalMapObject *object) { - u32 flagId = MapObject_GetFlagID(object); + u32 eventFlag = MapObject_GetEventFlag(object); FieldSystem *fieldSystem = MapObject_GetFieldSystem(object); - FieldSystem_FlagSet(fieldSystem, flagId); + FieldSystem_FlagSet(fieldSystem, eventFlag); MapObject_Remove(object); } void sub_020576A8(LocalMapObject *object) { if (sub_020587E0(MapObject_GetManager(object)) == TRUE) { - if (MapObject_GetFlagsBits(object, MAPOBJECTFLAG_UNK14) != 0) { + if (MapObject_GetFlagsBitsMask(object, MAPOBJECTFLAG_UNK14) != 0) { sub_020586B4(object); } MapObject_ClearFlagsBits(object, MAPOBJECTFLAG_UNK14); @@ -374,7 +320,7 @@ void MapObjectManager_RemoveAllActiveObjects(MapObjectManager *manager) { LocalMapObject *objects = MapObjectManager_GetObjects(manager); do { // BUG: does not check for if count is zero, and will always execute at least once - if (MapObject_GetFlagsBits(objects, MAPOBJECTFLAG_ACTIVE) != 0) { + if (MapObject_GetFlagsBitsMask(objects, MAPOBJECTFLAG_ACTIVE) != 0) { MapObject_Remove(objects); } @@ -391,7 +337,7 @@ void sub_02057750(MapObjectManager *manager) { LocalMapObject *objects = MapObjectManager_GetObjects(manager); do { - if (MapObject_GetFlagsBits(objects, MAPOBJECTFLAG_ACTIVE) != 0 && MapObject_GetFlagsBits(objects, MAPOBJECTFLAG_UNK14) != 0) { + if (MapObject_GetFlagsBitsMask(objects, MAPOBJECTFLAG_ACTIVE) != 0 && MapObject_GetFlagsBitsMask(objects, MAPOBJECTFLAG_UNK14) != 0) { sub_020586C8(objects); MapObject_NoOp(objects); } @@ -409,7 +355,7 @@ void sub_020577A8(MapObjectManager *manager) { LocalMapObject *objects = MapObjectManager_GetObjects(manager); do { - if (MapObject_IsInUse(objects) == TRUE) { + if (MapObject_CheckActive(objects) == TRUE) { if (MapObject_CheckFlag14(objects) == TRUE) { sub_020586DC(objects); } else { @@ -457,14 +403,14 @@ void MapObjectManager_RestoreFromSave(MapObjectManager *manager, SavedMapObject } static void SavedMapObject_InitFromLocalMapObject(FieldSystem *fieldSystem, LocalMapObject *localObject, SavedMapObject *savedObject) { - savedObject->flags = MapObject_GetFlagsWord(localObject); - savedObject->flags2 = MapObject_GetFlags2Word(localObject); + savedObject->flags = MapObject_GetFlags(localObject); + savedObject->flags2 = MapObject_GetFlags2(localObject); savedObject->objId = MapObject_GetID(localObject); - savedObject->unk10 = sub_02058450(localObject); + savedObject->mapId = MapObject_GetMapID(localObject); savedObject->spriteId = MapObject_GetSpriteID(localObject); savedObject->movement = MapObject_GetMovement(localObject); savedObject->type = MapObject_GetType(localObject); - savedObject->flagId = MapObject_GetFlagID(localObject); + savedObject->eventFlag = MapObject_GetEventFlag(localObject); savedObject->script = MapObject_GetScriptID(localObject); savedObject->initialFacing = MapObject_GetInitialFacingDirection(localObject); savedObject->currentFacing = MapObject_GetFacingDirection(localObject); @@ -475,18 +421,18 @@ static void SavedMapObject_InitFromLocalMapObject(FieldSystem *fieldSystem, Loca savedObject->xRange = MapObject_GetXRange(localObject); savedObject->yRange = MapObject_GetYRange(localObject); savedObject->initialX = MapObject_GetInitialX(localObject); - savedObject->initialHeight = MapObject_GetInitialHeight(localObject); savedObject->initialY = MapObject_GetInitialY(localObject); + savedObject->initialZ = MapObject_GetInitialZ(localObject); savedObject->currentX = MapObject_GetCurrentX(localObject); - savedObject->currentHeight = MapObject_GetCurrentHeight(localObject); savedObject->currentY = MapObject_GetCurrentY(localObject); + savedObject->currentZ = MapObject_GetCurrentZ(localObject); VecFx32 coords; - sub_02059E60(savedObject->currentX, savedObject->currentY, &coords); // some kind of x y vec copy with convertion between int and fx32 - coords.y = MapObject_GetPosVecYCoord(localObject); + sub_02059E60(savedObject->currentX, savedObject->currentZ, &coords); // some kind of x y vec copy with convertion between int and fx32 + coords.y = MapObject_GetPositionVectorYCoord(localObject); if (!sub_02059EC8(fieldSystem, &coords, MapObject_CheckFlag29(localObject))) { - savedObject->vecY = MapObject_GetPosVecYCoord(localObject); + savedObject->vecY = MapObject_GetPositionVectorYCoord(localObject); } else { savedObject->vecY = coords.y; } @@ -496,14 +442,14 @@ static void SavedMapObject_InitFromLocalMapObject(FieldSystem *fieldSystem, Loca } static void LocalMapObject_InitFromSavedMapObject(LocalMapObject *localObject, SavedMapObject *savedObject) { - MapObject_SetFlagsWord(localObject, savedObject->flags); - MapObject_SetFlags2Word(localObject, savedObject->flags2); + MapObject_SetFlags(localObject, savedObject->flags); + MapObject_SetFlags2(localObject, savedObject->flags2); MapObject_SetID(localObject, savedObject->objId); - sub_0205844C(localObject, savedObject->unk10); + MapObject_SetMapID(localObject, savedObject->mapId); MapObject_SetSpriteID(localObject, savedObject->spriteId); MapObject_SetMovement(localObject, savedObject->movement); MapObject_SetType(localObject, savedObject->type); - MapObject_SetFlagID(localObject, savedObject->flagId); + MapObject_SetEventFlag(localObject, savedObject->eventFlag); MapObject_SetScriptID(localObject, savedObject->script); MapObject_SetInitialFacingDirection(localObject, savedObject->initialFacing); MapObject_SetFacingDirectionDirect(localObject, savedObject->currentFacing); @@ -514,15 +460,15 @@ static void LocalMapObject_InitFromSavedMapObject(LocalMapObject *localObject, S MapObject_SetXRange(localObject, savedObject->xRange); MapObject_SetYRange(localObject, savedObject->yRange); MapObject_SetInitialX(localObject, savedObject->initialX); - MapObject_SetInitialHeight(localObject, savedObject->initialHeight); MapObject_SetInitialY(localObject, savedObject->initialY); + MapObject_SetInitialZ(localObject, savedObject->initialZ); MapObject_SetCurrentX(localObject, savedObject->currentX); - MapObject_SetCurrentHeight(localObject, savedObject->currentHeight); MapObject_SetCurrentY(localObject, savedObject->currentY); + MapObject_SetCurrentZ(localObject, savedObject->currentZ); VecFx32 coords = {}; coords.y = savedObject->vecY; - MapObject_SetPositionVec(localObject, &coords); + MapObject_SetPositionVector(localObject, &coords); memcpy(sub_020585B0(localObject), savedObject->unk30, 16); memcpy(sub_020585D8(localObject), savedObject->unk40, 16); @@ -530,7 +476,7 @@ static void LocalMapObject_InitFromSavedMapObject(LocalMapObject *localObject, S static void sub_02057AEC(MapObjectManager *manager, LocalMapObject *object) { sub_02057B34(object); - MapObject_ConvertXYToPositionVec(object); + MapObject_ConvertXZToPositionVec(object); MapObject_SetManager(object, manager); sub_02057EE0(object); MapObject_ClearHeldMovement(object); @@ -546,21 +492,21 @@ static void sub_02057B34(LocalMapObject *object) { sub_0205815C(object); } -static void MapObject_ConvertXYToPositionVec(LocalMapObject *object) { +static void MapObject_ConvertXZToPositionVec(LocalMapObject *object) { VecFx32 position; - MapObject_GetPositionVec(object, &position); + MapObject_CopyPositionVector(object, &position); u32 x = MapObject_GetCurrentX(object); position.x = x * FX32_CONST(16) + FX32_CONST(8); MapObject_SetPreviousX(object, x); - MapObject_SetPreviousHeight(object, MapObject_GetCurrentHeight(object)); + MapObject_SetPreviousY(object, MapObject_GetCurrentY(object)); - u32 y = MapObject_GetCurrentY(object); - position.z = y * FX32_CONST(16) + FX32_CONST(8); - MapObject_SetPreviousY(object, y); + u32 z = MapObject_GetCurrentZ(object); + position.z = z * FX32_CONST(16) + FX32_CONST(8); + MapObject_SetPreviousZ(object, z); - MapObject_SetPositionVec(object, &position); + MapObject_SetPositionVector(object, &position); } void MapObject_CreateFromMultipleObjectEvents(MapObjectManager *manager, u32 mapNo, u32 objectEventCount, ObjectEvent *objectEvents) { @@ -582,11 +528,11 @@ void MapObject_CreateFromMultipleObjectEvents(MapObjectManager *manager, u32 map } static void MapObject_CreateFromInitArgs(MapObjectInitArgs *args) { - FieldSystem *fieldSystem = MapObjectManager_GetFieldSystemPtr(args->manager); + FieldSystem *fieldSystem = MapObjectManager_GetFieldSystem(args->manager); ObjectEvent *objectEvents = args->objectEvents; - do { // must be do while due to initial check - GF_ASSERT((ObjectEvent_ScriptIDIsUnset(objectEvents) != TRUE && FieldSystem_FlagCheck(fieldSystem, objectEvents->flag) != FALSE) || MapObject_CreateFromObjectEvent(args->manager, objectEvents, args->mapNo) != NULL); // this is dumb, but is required to match + do { // must be do while due to initial check + GF_ASSERT((ObjectEvent_ScriptIDIsUnset(objectEvents) != TRUE && FieldSystem_FlagCheck(fieldSystem, objectEvents->eventFlag) != FALSE) || MapObject_CreateFromObjectEvent(args->manager, objectEvents, args->mapNo) != NULL); // this is dumb, but is required to match objectEvents++; args->index++; @@ -602,7 +548,7 @@ static LocalMapObject *MapObjectManager_GetFirstInactiveObject(MapObjectManager LocalMapObject *objects = MapObjectManager_GetObjects(manager); do { - if (MapObject_GetFlagsBits(objects, MAPOBJECTFLAG_ACTIVE) == 0) { + if (MapObject_GetFlagsBitsMask(objects, MAPOBJECTFLAG_ACTIVE) == 0) { return objects; } @@ -644,19 +590,19 @@ static void MapObject_InitFromObjectEvent(LocalMapObject *object, ObjectEvent *o MapObject_SetSpriteID(object, FieldSystem_ResolveObjectSpriteID(fieldSystem, ObjectEvent_GetSpriteID(objectEvent))); MapObject_SetMovement(object, ObjectEvent_GetMovement(objectEvent)); MapObject_SetType(object, ObjectEvent_GetType(objectEvent)); - MapObject_SetFlagID(object, ObjectEvent_GetFlagID(objectEvent)); + MapObject_SetEventFlag(object, ObjectEvent_GetEventFlag(objectEvent)); MapObject_SetScriptID(object, ObjectEvent_GetScriptID(objectEvent)); - MapObject_SetInitialFacingDirection(object, ObjectEvent_GetInitialFacingDirection(objectEvent)); + MapObject_SetInitialFacingDirection(object, ObjectEvent_GetFacingDirection(objectEvent)); MapObject_SetParam(object, ObjectEvent_GetParam(objectEvent, 0), 0); MapObject_SetParam(object, ObjectEvent_GetParam(objectEvent, 1), 1); MapObject_SetParam(object, ObjectEvent_GetParam(objectEvent, 2), 2); MapObject_SetXRange(object, ObjectEvent_GetXRange(objectEvent)); MapObject_SetYRange(object, ObjectEvent_GetYRange(objectEvent)); - MapObject_SetPositionVecFromObjectEvent(object, objectEvent); + MapObject_SetPositionVectorFromObjectEvent(object, objectEvent); } -static void MapObject_SetPositionVecFromObjectEvent(LocalMapObject *object, ObjectEvent *objectEvent) { +static void MapObject_SetPositionVectorFromObjectEvent(LocalMapObject *object, ObjectEvent *objectEvent) { VecFx32 coords; u16 x = ObjectEvent_GetXCoord(objectEvent); @@ -665,19 +611,19 @@ static void MapObject_SetPositionVecFromObjectEvent(LocalMapObject *object, Obje MapObject_SetPreviousX(object, x); MapObject_SetCurrentX(object, x); - coords.y = ObjectEvent_GetHeight(objectEvent); - u32 height = (coords.y >> 3) / FX32_ONE; - MapObject_SetInitialHeight(object, height); - MapObject_SetPreviousHeight(object, height); - MapObject_SetCurrentHeight(object, height); - - u16 y = ObjectEvent_GetYCoord(objectEvent); - coords.z = y * FX32_CONST(16) + FX32_CONST(8); + coords.y = ObjectEvent_GetYCoord(objectEvent); + u32 y = (coords.y >> 3) / FX32_ONE; MapObject_SetInitialY(object, y); MapObject_SetPreviousY(object, y); MapObject_SetCurrentY(object, y); - MapObject_SetPositionVec(object, &coords); + u16 z = ObjectEvent_GetZCoord(objectEvent); + coords.z = z * FX32_CONST(16) + FX32_CONST(8); + MapObject_SetInitialZ(object, z); + MapObject_SetPreviousZ(object, z); + MapObject_SetCurrentZ(object, z); + + MapObject_SetPositionVector(object, &coords); } static void sub_02057E90(LocalMapObject *object, MapObjectManager *manager) { // setup facing and flags? also sets manager? @@ -700,7 +646,7 @@ static void sub_02057E90(LocalMapObject *object, MapObjectManager *manager) { // extern const UnkLMOCallbackStruct2 ov05_021F9080; -/*static*/ void sub_02057F18(LocalMapObject *object) { +static void sub_02057F18(LocalMapObject *object) { u32 spriteId = MapObject_GetSpriteID(object); UnkLMOCallbackStruct2 *unk = (spriteId == SPRITE_CAMERA_FOCUS) ? (UnkLMOCallbackStruct2 *)&ov05_021F9080 : sub_02058D4C(spriteId); @@ -715,22 +661,25 @@ static void MapObject_Clear(LocalMapObject *object) { memset(object, 0, sizeof(LocalMapObject)); } -static u32 sub_02057F90(LocalMapObject *object, u32 flagId, u32 objectEventCount, ObjectEvent *objectEvents) { +static u32 sub_02057F90(LocalMapObject *object, u32 mapId, u32 objectEventCount, ObjectEvent *objectEvents) { for (; objectEventCount != 0; objectEventCount--, objectEvents++) { if (ObjectEvent_GetID(objectEvents) != MapObject_GetID(object)) { continue; } if (ObjectEvent_ScriptIDIsUnset(objectEvents) == TRUE) { - u16 flagIdUnset = ObjectEvent_GetFlagID_AssertScriptIDIsUnset(objectEvents); + u16 eventFlag = ObjectEvent_GetEventFlag_AssertScriptIDIsUnset(objectEvents); if (MapObject_CheckFlag25(object) == TRUE) { // this and the one below cannot be combined as it doesn't match - if (sub_02058750(object) == flagIdUnset) { + if (sub_02058750(object) == eventFlag) { return 1; } - } else if (sub_02058450(object) == flagIdUnset) { + // I'm assume that sometimes the ObjectEvent flags equals the mapId to signify that + // this is a map-wide event etc. + } else if (MapObject_GetMapID(object) == eventFlag) { return 2; } - } else if (MapObject_CheckFlag25(object) == TRUE && sub_02058750(object) == flagId) { + // this is indeed a weird comparsion, but I checked, it's correct + } else if (MapObject_CheckFlag25(object) == TRUE && sub_02058750(object) == mapId) { return 2; } } @@ -738,14 +687,12 @@ static u32 sub_02057F90(LocalMapObject *object, u32 flagId, u32 objectEventCount return 0; } -// TODO: this also gets based on the second param, which is currently labelled as flagId, but is not -// see the note attached to sub_02058450 -static LocalMapObject *MapObjectManager_GetFirstObjectWithID(MapObjectManager *manager, u32 objectId, u32 flagId) { +static LocalMapObject *MapObjectManager_GetFirstObjectWithIDAndMap(MapObjectManager *manager, u32 objectId, u32 mapId) { s32 index = 0; LocalMapObject *object; while (MapObjectManager_GetNextObjectWithFlagFromIndex(manager, &object, &index, MAPOBJECTFLAG_ACTIVE) == TRUE) { - if (MapObject_GetID(object) == objectId && sub_02058450(object) == flagId) { + if (MapObject_GetID(object) == objectId && MapObject_GetMapID(object) == mapId) { return object; } } @@ -757,7 +704,7 @@ LocalMapObject *MapObjectManager_GetFirstActiveObjectByID(MapObjectManager *mana GF_ASSERT(manager != NULL); s32 count = MapObjectManager_GetObjectCount(manager); - LocalMapObject *objects = (LocalMapObject *)MapObjectManager_GetConstObjects(manager); + LocalMapObject *objects = MapObjectManager_GetObjects3(manager); do { if (MapObject_TestFlagsBits(objects, MAPOBJECTFLAG_ACTIVE) == TRUE && MapObject_CheckFlag25(objects) == FALSE && MapObject_GetID(objects) == id) { return objects; @@ -772,7 +719,7 @@ LocalMapObject *MapObjectManager_GetFirstActiveObjectByID(MapObjectManager *mana LocalMapObject *MapObjectManager_GetFirstActiveObjectWithMovement(MapObjectManager *manager, u32 movement) { s32 count = MapObjectManager_GetObjectCount(manager); - LocalMapObject *objects = (LocalMapObject *)MapObjectManager_GetConstObjects(manager); + LocalMapObject *objects = MapObjectManager_GetObjects3(manager); do { if (MapObject_TestFlagsBits(objects, MAPOBJECTFLAG_ACTIVE) == TRUE && MapObject_GetMovement(objects) == movement) { @@ -792,12 +739,12 @@ BOOL MapObjectManager_GetNextObjectWithFlagFromIndex(MapObjectManager *manager, return FALSE; } - LocalMapObject *objects = (LocalMapObject *)MapObjectManager_GetConstObjects(manager); + LocalMapObject *objects = MapObjectManager_GetObjects3(manager); LocalMapObject *object = objects + *index; do { (*index)++; - if (flag == (MapObjectFlagBits)MapObject_GetFlagsBits(object, flag)) { + if (flag == (MapObjectFlagBits)MapObject_GetFlagsBitsMask(object, flag)) { *objectDest = object; return TRUE; } @@ -831,7 +778,7 @@ static u32 FieldSystem_ResolveObjectSpriteID(FieldSystem *fieldSystem, s32 sprit } static void sub_0205818C(LocalMapObject *object) { - if (MapObject_GetFlagsBits(object, MAPOBJECTFLAG_UNK12) != 0) { + if (MapObject_GetFlagsBitsMask(object, MAPOBJECTFLAG_UNK12) != 0) { sub_02059D1C(object); } } @@ -865,9 +812,9 @@ static void sub_02058214(LocalMapObject *object, ObjectEvent *objectEvent, u32 m GF_ASSERT(MapObject_CheckFlag25(object) == TRUE); MapObject_SetFlag25(object, FALSE); - sub_0205844C(object, mapNo); + MapObject_SetMapID(object, mapNo); MapObject_SetScriptID(object, ObjectEvent_GetScriptID(objectEvent)); - MapObject_SetFlagID(object, ObjectEvent_GetFlagID(objectEvent)); + MapObject_SetEventFlag(object, ObjectEvent_GetEventFlag(objectEvent)); } static void sub_02058258(LocalMapObject *object, u32 mapNo, ObjectEvent *objectEvent) { @@ -875,32 +822,1190 @@ static void sub_02058258(LocalMapObject *object, u32 mapNo, ObjectEvent *objectE MapObject_SetFlag25(object, TRUE); MapObject_SetScriptID(object, ObjectEvent_GetScriptID(objectEvent)); - MapObject_SetFlagID(object, ObjectEvent_GetFlagID_AssertScriptIDIsUnset(objectEvent)); - sub_0205844C(object, mapNo); + MapObject_SetEventFlag(object, ObjectEvent_GetEventFlag_AssertScriptIDIsUnset(objectEvent)); + MapObject_SetMapID(object, mapNo); } -u32 sub_0205829C(LocalMapObject *object, u32 param1) { - return (u32)(sub_02058744(object) + param1); +u32 MapObject_GetPriorityPlusValue(LocalMapObject *object, u32 value) { + return (u32)((void *)MapObject_GetPriority(object) + value); // MUST be cast to void * to match } -BOOL sub_020582A8(LocalMapObject *object, u32 mapId, u32 flagId) { +BOOL sub_020582A8(LocalMapObject *object, u32 objectId, u32 mapId) { if (!MapObject_TestFlagsBits(object, MAPOBJECTFLAG_ACTIVE)) { return FALSE; } - if (MapObject_GetID(object) != mapId) { + if (MapObject_GetID(object) != objectId) { return FALSE; } - if (sub_02058450(object) != flagId) { + if (MapObject_GetMapID(object) != mapId) { if (!MapObject_CheckFlag25(object)) { return FALSE; } - if (sub_02058750(object) != flagId) { + if (sub_02058750(object) != mapId) { return FALSE; } } return TRUE; } + +BOOL sub_020582F8(LocalMapObject *object, u32 spriteId, u32 objectId, u32 mapId) { + if (!MapObject_TestFlagsBits(object, MAPOBJECTFLAG_ACTIVE)) { + return FALSE; + } + + u32 objectSpriteId = sub_0205845C(object); + if (objectSpriteId != spriteId) { + return FALSE; + } + + return sub_020582A8(object, objectId, mapId); +} + +static void sub_0205832C(SysTask *task, LocalMapObject *object) { + sub_02058EF8(object); + if (MapObject_CheckActive(object)) { + sub_02058348(object); + } +} + +static void sub_02058348(LocalMapObject *object) { + if (sub_020587E0(MapObject_GetManager(object)) == TRUE) { + ov05_021F1D8C(object); + } +} + +// Likely a scrubbed debug func, but WTF is GF smoking? +static MapObjectManager *MapObjectManager_Get(MapObjectManager *manager) { + return manager; +} + +static void MapObjectManager_SetObjectCount(MapObjectManager *manager, u32 count) { + manager->objectCount = count; +} + +u32 MapObjectManager_GetObjectCount(MapObjectManager *manager) { + return manager->objectCount; +} + +static void sub_0205836C(MapObjectManager *manager) { + manager->unk8++; +} + +static void sub_02058374(MapObjectManager *manager) { + manager->unk8--; +} + +void MapObjectManager_SetFlagsBits(MapObjectManager *manager, MapObjectManagerFlagBits bits) { + manager->flags |= bits; +} + +void MapObjectManager_ClearFlagsBits(MapObjectManager *manager, MapObjectManagerFlagBits bits) { + manager->flags &= ~bits; +} + +u32 MapObjectManager_GetFlagsBitsMask(MapObjectManager *manager, MapObjectManagerFlagBits bits) { + return manager->flags & bits; +} + +static void MapObjectManager_SetPriority(MapObjectManager *manager, u32 priority) { + manager->priority = priority; +} + +u32 MapObjectManager_GetPriority(MapObjectManager *manager) { + return manager->priority; +} + +// type of unk18 is unknown, it's a u32 in MapObjectManager, but unsure what it's supposed to be +// leaving return as a void * to reflect this +void *sub_020583A0(MapObjectManager *manager) { + return &manager->unk18; +} + +void sub_020583A4(MapObjectManager *manager, u32 param1) { + manager->unk120 = param1; +} + +u32 sub_020583AC(MapObjectManager *manager) { + return manager->unk120; +} + +static void MapObjectManager_SetObjects(MapObjectManager *manager, LocalMapObject *objects) { + manager->objects = objects; +} + +// the 2 here is bad, however this is *exactly* the same as the lower GetObjects +LocalMapObject *MapObjectManager_GetObjects2(MapObjectManager *manager) { + return manager->objects; +} + +// same as above +static LocalMapObject *MapObjectManager_GetObjects3(MapObjectManager *manager) { + return manager->objects; +} + +// this one is the original because it's used the most +LocalMapObject *MapObjectManager_GetObjects(MapObjectManager *manager) { + return manager->objects; +} + +void MapObjectArray_NextObject(LocalMapObject **objects) { + (*objects)++; +} + +static void MapObjectManager_SetFieldSystem(MapObjectManager *manager, FieldSystem *fieldSystem) { + manager->fieldSystem = fieldSystem; +} + +static FieldSystem *MapObjectManager_GetFieldSystem(MapObjectManager *manager) { + return manager->fieldSystem; +} + +void MapObjectManager_SetMapModelNarc(MapObjectManager *manager, NARC *mapModelNarc) { + manager->mapModelNarc = mapModelNarc; +} + +NARC *MapObjectManager_GetMapModelNarc(MapObjectManager *manager) { + GF_ASSERT(manager->mapModelNarc != NULL); + return manager->mapModelNarc; +} + +static void MapObject_SetFlags(LocalMapObject *object, u32 flags) { + object->flags = flags; +} + +static u32 MapObject_GetFlags(LocalMapObject *object) { + return object->flags; +} + +void MapObject_SetFlagsBits(LocalMapObject *object, MapObjectFlagBits bits) { + object->flags |= bits; +} + +void MapObject_ClearFlagsBits(LocalMapObject *object, MapObjectFlagBits bits) { + object->flags &= ~bits; +} + +u32 MapObject_GetFlagsBitsMask(LocalMapObject *object, MapObjectFlagBits bits) { + return object->flags & bits; +} + +BOOL MapObject_TestFlagsBits(LocalMapObject *object, MapObjectFlagBits bits) { + return (object->flags & bits) != 0; +} + +static void MapObject_SetFlags2(LocalMapObject *object, u32 flags) { + object->flags2 = flags; +} + +static u32 MapObject_GetFlags2(LocalMapObject *object) { + return object->flags2; +} + +void MapObject_SetID(LocalMapObject *object, u32 id) { + object->id = id; +} + +u32 MapObject_GetID(LocalMapObject *object) { + return object->id; +} + +static void MapObject_SetMapID(LocalMapObject *object, u32 mapId) { + object->mapId = mapId; +} + +u32 MapObject_GetMapID(LocalMapObject *object) { + return object->mapId; +} + +void MapObject_SetSpriteID(LocalMapObject *object, u32 spriteId) { + object->spriteId = spriteId; +} + +u32 MapObject_GetSpriteID(LocalMapObject *object) { + return object->spriteId; +} + +u32 sub_0205845C(LocalMapObject *object) { + u32 spriteId = MapObject_GetSpriteID(object); + if (sub_0205C334() == TRUE) { + return sub_0205C340(object); + } + return spriteId; +} + +/*static*/ void MapObject_SetMovement(LocalMapObject *object, u32 movement) { + object->movement = movement; +} + +u32 MapObject_GetMovement(LocalMapObject *object) { + return object->movement; +} + +void MapObject_SetType(LocalMapObject *object, u32 type) { + object->type = type; +} + +u32 MapObject_GetType(LocalMapObject *object) { + return object->type; +} + +void MapObject_SetEventFlag(LocalMapObject *object, u32 eventFlag) { + object->eventFlag = eventFlag; +} + +static u32 MapObject_GetEventFlag(LocalMapObject *object) { + return object->eventFlag; +} + +void MapObject_SetScriptID(LocalMapObject *object, u32 scriptId) { + object->scriptId = scriptId; +} + +u32 MapObject_GetScriptID(LocalMapObject *object) { + return object->scriptId; +} + +static void MapObject_SetInitialFacingDirection(LocalMapObject *object, u32 initialFacing) { + object->initialFacing = initialFacing; +} + +u32 MapObject_GetInitialFacingDirection(LocalMapObject *object) { + return object->initialFacing; +} + +void MapObject_SetFacingDirectionDirect(LocalMapObject *object, u32 direction) { + object->previousFacing = object->currentFacing; + object->currentFacing = direction; +} + +void MapObject_SetFacingDirection(LocalMapObject *object, u32 direction) { + if (MapObject_GetFlagsBitsMask(object, MAPOBJECTFLAG_UNK7) == 0) { + object->previousFacing = object->currentFacing; + object->currentFacing = direction; + } +} + +u32 MapObject_GetFacingDirection(LocalMapObject *object) { + return object->currentFacing; +} + +u32 MapObject_GetPreviousFacingDirection(LocalMapObject *object) { + return object->previousFacing; +} + +void MapObject_SetNextFacingDirection(LocalMapObject *object, u32 direction) { + object->nextFacingBackup = object->nextFacing; + object->nextFacing = direction; +} + +u32 MapObject_GetNextFacingDirection(LocalMapObject *object) { + return object->nextFacing; +} + +void MapObject_SetOrQueueFacing(LocalMapObject *object, u32 direction) { + MapObject_SetFacingDirection(object, direction); + MapObject_SetNextFacingDirection(object, direction); +} + +void MapObject_SetParam(LocalMapObject *object, s32 value, u32 param) { + switch (param) { + case 0: + object->param[0] = value; + return; + case 1: + object->param[1] = value; + return; + case 2: + object->param[2] = value; + return; + default: + GF_ASSERT(FALSE); + return; + } +} + +s32 MapObject_GetParam(LocalMapObject *object, u32 param) { + switch (param) { + case 0: + return object->param[0]; + case 1: + return object->param[1]; + case 2: + return object->param[2]; + default: + GF_ASSERT(FALSE); + return 0; + } +} + +void MapObject_SetXRange(LocalMapObject *object, s32 xRange) { + object->xRange = xRange; +} + +s32 MapObject_GetXRange(LocalMapObject *object) { + return object->xRange; +} + +void MapObject_SetYRange(LocalMapObject *object, s32 yRange) { + object->yRange = yRange; +} + +s32 MapObject_GetYRange(LocalMapObject *object) { + return object->yRange; +} + +void sub_02058544(LocalMapObject *object, u32 param1) { + object->unkA0 = param1; +} + +u32 sub_0205854C(LocalMapObject *object) { + return object->unkA0; +} + +static void sub_02058554(LocalMapObject *object, SysTask *sysTask) { + object->unkB0 = sysTask; +} + +static SysTask *sub_0205855C(LocalMapObject *object) { + return object->unkB0; +} + +static void sub_02058564(LocalMapObject *object) { + SysTask_Destroy(sub_0205855C(object)); +} + +static void MapObject_SetManager(LocalMapObject *object, MapObjectManager *manager) { + object->manager = manager; +} + +MapObjectManager *MapObject_GetManager(LocalMapObject *object) { + return object->manager; +} + +static MapObjectManager *MapObject_GetManagerFromManager(LocalMapObject *object) { + return MapObjectManager_Get(object->manager); +} + +u8 *sub_0205858C(LocalMapObject *object, s32 size) { + GF_ASSERT(size <= 16); + + u8 *ret = sub_020585B0(object); + memset(ret, 0, size); + return ret; +} + +u8 *sub_020585B0(LocalMapObject *object) { + return object->unkD8; +} + +u8 *sub_020585B4(LocalMapObject *object, s32 size) { + GF_ASSERT(size <= 16); + + u8 *ret = sub_020585D8(object); + memset(ret, 0, size); + return ret; +} + +u8 *sub_020585D8(LocalMapObject *object) { + return object->unkE8; +} + +u8 *sub_020585DC(LocalMapObject *object, s32 size) { + GF_ASSERT(size <= 16); + + u8 *ret = sub_02058600(object); + memset(ret, 0, size); + return ret; +} + +u8 *sub_02058600(LocalMapObject *object) { + return object->unkF8; +} + +u8 *sub_02058604(LocalMapObject *object, s32 size) { + GF_ASSERT(size <= 32); + + u8 *ret = sub_02058628(object); + memset(ret, 0, size); + return ret; +} + +u8 *sub_02058628(LocalMapObject *object) { + return object->unk108; +} + +static void sub_02058630(LocalMapObject *object, LocalMapObject_UnkCallback callback) { + object->unkB8 = callback; +} + +void sub_02058638(LocalMapObject *object) { + object->unkB8(object); +} + +static void sub_02058644(LocalMapObject *object, LocalMapObject_UnkCallback callback) { + object->unkBC = callback; +} + +void sub_0205864C(LocalMapObject *object) { + object->unkBC(object); +} + +static void sub_02058658(LocalMapObject *object, LocalMapObject_UnkCallback callback) { + object->unkC0 = callback; +} + +/*static*/ void sub_02058660(LocalMapObject *object) { + object->unkC0(object); +} + +static void sub_0205866C(LocalMapObject *object) { + UnkLMOCallbackStruct *unk = sub_02058D14(MapObject_GetMovement(object)); + unk->unk10(object); +} + +static void sub_02058684(LocalMapObject *object, LocalMapObject_UnkCallback callback) { + object->unkC4 = callback; +} + +static void sub_0205868C(LocalMapObject *object) { + object->unkC4(object); +} + +static void sub_02058698(LocalMapObject *object, LocalMapObject_UnkCallback callback) { + object->unkC8 = callback; +} + +void sub_020586A0(LocalMapObject *object) { + object->unkC8(object); +} + +static void sub_020586AC(LocalMapObject *object, LocalMapObject_UnkCallback callback) { + object->unkCC = callback; +} + +static void sub_020586B4(LocalMapObject *object) { + object->unkCC(object); +} + +static void sub_020586C0(LocalMapObject *object, LocalMapObject_UnkCallback callback) { + object->unkD0 = callback; +} + +static void sub_020586C8(LocalMapObject *object) { + object->unkD0(object); +} + +static void sub_020586D4(LocalMapObject *object, LocalMapObject_UnkCallback callback) { + object->unkD4 = callback; +} + +void sub_020586DC(LocalMapObject *object) { + object->unkD4(object); +} + +void MapObject_SetMovementCommand(LocalMapObject *object, u32 command) { + object->movementCmd = command; +} + +u32 MapObject_GetMovementCommand(LocalMapObject *object) { + return object->movementCmd; +} + +void MapObject_SetMovementStep(LocalMapObject *object, u32 step) { + object->movementStep = step; +} + +void MapObject_IncrementMovementStep(LocalMapObject *object) { + object->movementStep++; +} + +u32 MapObject_GetMovementStep(LocalMapObject *object) { + return object->movementStep; +} + +void sub_02058718(LocalMapObject *object, u16 param1) { + object->unkAC = param1; +} + +u16 sub_02058720(LocalMapObject *object) { + return object->unkAC; +} + +void sub_02058728(LocalMapObject *object, u16 param1) { + object->unkAE = param1; +} + +u16 sub_02058730(LocalMapObject *object) { + return object->unkAE; +} + +FieldSystem *MapObject_GetFieldSystem(LocalMapObject *object) { + return MapObjectManager_GetFieldSystem(MapObject_GetManagerFromManager(object)); +} + +u32 MapObject_GetPriority(LocalMapObject *object) { + return MapObjectManager_GetPriority(MapObject_GetManager(object)); +} + +u32 sub_02058750(LocalMapObject *object) { + GF_ASSERT(MapObject_CheckFlag25(object) == TRUE); + return MapObject_GetEventFlag(object); +} + +void sub_02058768(MapObjectManager *manager) { + MapObjectManager_SetFlagsBits(manager, (MapObjectManagerFlagBits)(MAPOBJECTMANAGERFLAG_UNK2 | MAPOBJECTMANAGERFLAG_UNK1)); +} + +void sub_02058774(MapObjectManager *manager) { + MapObjectManager_ClearFlagsBits(manager, (MapObjectManagerFlagBits)(MAPOBJECTMANAGERFLAG_UNK2 | MAPOBJECTMANAGERFLAG_UNK1)); +} + +void MapObjectManager_PauseAllMovement(MapObjectManager *manager) { + u32 count = MapObjectManager_GetObjectCount(manager); + LocalMapObject *objects = MapObjectManager_GetObjects(manager); + do { + if (MapObject_CheckActive(objects)) { + MapObject_PauseMovement(objects); + } + + objects++; + count--; + } while (count > 0); +} + +void MapObjectManager_UnpauseAllMovement(MapObjectManager *manager) { + u32 count = MapObjectManager_GetObjectCount(manager); + LocalMapObject *objects = MapObjectManager_GetObjects(manager); + do { + if (MapObject_CheckActive(objects)) { + MapObject_UnpauseMovement(objects); + } + + objects++; + count--; + } while (count > 0); +} + +BOOL sub_020587E0(MapObjectManager *manager) { + return MapObjectManager_GetFlagsBitsMask(manager, MAPOBJECTMANAGERFLAG_UNK0) != 0; +} + +u32 sub_020587F4(LocalMapObject *object, MapObjectManagerFlagBits bits) { + return MapObjectManager_GetFlagsBitsMask(MapObject_GetManager(object), bits); +} + +void sub_02058804(MapObjectManager *manager, BOOL clear) { + if (clear == FALSE) { + MapObjectManager_SetFlagsBits(manager, MAPOBJECTMANAGERFLAG_UNK3); + } else { + MapObjectManager_ClearFlagsBits(manager, MAPOBJECTMANAGERFLAG_UNK3); + } +} + +BOOL sub_0205881C(MapObjectManager *manager) { + return MapObjectManager_GetFlagsBitsMask(manager, MAPOBJECTMANAGERFLAG_UNK3) == 0; +} + +BOOL MapObject_CheckActive(LocalMapObject *object) { + return MapObject_TestFlagsBits(object, MAPOBJECTFLAG_ACTIVE); +} + +void MapObject_SetSingleMovement(LocalMapObject *object) { + MapObject_SetFlagsBits(object, MAPOBJECTFLAG_SINGLE_MOVEMENT); +} + +void MapObject_ClearSingleMovement(LocalMapObject *object) { + MapObject_ClearFlagsBits(object, MAPOBJECTFLAG_SINGLE_MOVEMENT); +} + +BOOL MapObject_CheckSingleMovement(LocalMapObject *object) { + return MapObject_TestFlagsBits(object, MAPOBJECTFLAG_SINGLE_MOVEMENT); +} + +void MapObject_SetFlag2(LocalMapObject *object) { + MapObject_SetFlagsBits(object, MAPOBJECTFLAG_UNK2); +} + +void MapObject_ClearFlag3(LocalMapObject *object) { + MapObject_ClearFlagsBits(object, MAPOBJECTFLAG_UNK3); +} + +static void MapObject_SetFlag14(LocalMapObject *object) { + MapObject_SetFlagsBits(object, MAPOBJECTFLAG_UNK14); +} + +BOOL MapObject_CheckFlag14(LocalMapObject *object) { + return MapObject_TestFlagsBits(object, MAPOBJECTFLAG_UNK14); +} + +BOOL MapObject_CheckVisible(LocalMapObject *object) { + return MapObject_TestFlagsBits(object, MAPOBJECTFLAG_VISIBLE); +} + +void MapObject_SetVisible(LocalMapObject *object, BOOL set) { + if (set == TRUE) { + MapObject_SetFlagsBits(object, MAPOBJECTFLAG_VISIBLE); + } else { + MapObject_ClearFlagsBits(object, MAPOBJECTFLAG_VISIBLE); + } +} + +void MapObject_ClearFlag18(LocalMapObject *object, BOOL clear) { + if (clear == TRUE) { + MapObject_ClearFlagsBits(object, MAPOBJECTFLAG_UNK18); + } else { + MapObject_SetFlagsBits(object, MAPOBJECTFLAG_UNK18); + } +} + +BOOL MapObject_CheckFlag19Disabled(LocalMapObject *object) { + return MapObject_TestFlagsBits(object, MAPOBJECTFLAG_UNK19) != TRUE; +} + +void MapObject_SetFlag19(LocalMapObject *object, BOOL set) { + if (set == TRUE) { + MapObject_SetFlagsBits(object, MAPOBJECTFLAG_UNK19); + } else { + MapObject_ClearFlagsBits(object, MAPOBJECTFLAG_UNK19); + } +} + +void MapObject_PauseMovement(LocalMapObject *object) { + MapObject_SetFlagsBits(object, MAPOBJECTFLAG_MOVEMENT_PAUSED); +} + +void MapObject_UnpauseMovement(LocalMapObject *object) { + MapObject_ClearFlagsBits(object, MAPOBJECTFLAG_MOVEMENT_PAUSED); +} + +BOOL MapObject_CheckMovementPaused(LocalMapObject *object) { + return MapObject_TestFlagsBits(object, MAPOBJECTFLAG_MOVEMENT_PAUSED) == TRUE; +} + +BOOL sub_02058934(LocalMapObject *object) { + if (!sub_020587E0(MapObject_GetManager(object))) { + return FALSE; + } + + if (MapObject_GetFlagsBitsMask(object, MAPOBJECTFLAG_UNK14) != 0) { + return TRUE; + } + + return FALSE; +} + +void MapObject_SetIgnoreHeights(LocalMapObject *object, BOOL set) { + if (set == TRUE) { + MapObject_SetFlagsBits(object, MAPOBJECTFLAG_IGNORE_HEIGHTS); + } else { + MapObject_ClearFlagsBits(object, MAPOBJECTFLAG_IGNORE_HEIGHTS); + } +} + +BOOL MapObject_CheckIgnoreHeights(LocalMapObject *object) { + return MapObject_GetFlagsBitsMask(object, MAPOBJECTFLAG_IGNORE_HEIGHTS) != 0; +} + +void MapObject_SetKeep(LocalMapObject *object, BOOL set) { + if (set == TRUE) { + MapObject_SetFlagsBits(object, MAPOBJECTFLAG_KEEP); + } else { + MapObject_ClearFlagsBits(object, MAPOBJECTFLAG_KEEP); + } +} + +static void MapObject_SetFlag25(LocalMapObject *object, BOOL set) { + if (set == TRUE) { + MapObject_SetFlagsBits(object, MAPOBJECTFLAG_UNK25); + } else { + MapObject_ClearFlagsBits(object, MAPOBJECTFLAG_UNK25); + } +} + +BOOL MapObject_CheckFlag25(LocalMapObject *object) { + return MapObject_GetFlagsBitsMask(object, MAPOBJECTFLAG_UNK25) != 0; +} + +void MapObject_SetFlag26(LocalMapObject *object, BOOL set) { + if (set == TRUE) { + MapObject_SetFlagsBits(object, MAPOBJECTFLAG_UNK26); + } else { + MapObject_ClearFlagsBits(object, MAPOBJECTFLAG_UNK26); + } +} + +BOOL MapObject_CheckFlag26(LocalMapObject *object) { + return MapObject_GetFlagsBitsMask(object, MAPOBJECTFLAG_UNK26) != 0; +} + +void MapObject_SetFlag27(LocalMapObject *object, BOOL set) { + if (set == TRUE) { + MapObject_SetFlagsBits(object, MAPOBJECTFLAG_UNK27); + } else { + MapObject_ClearFlagsBits(object, MAPOBJECTFLAG_UNK27); + } +} + +BOOL MapObject_CheckFlag27(LocalMapObject *object) { + return MapObject_GetFlagsBitsMask(object, MAPOBJECTFLAG_UNK27) != 0; +} + +void MapObject_SetFlag28(LocalMapObject *object, BOOL set) { + if (set == TRUE) { + MapObject_SetFlagsBits(object, MAPOBJECTFLAG_UNK28); + } else { + MapObject_ClearFlagsBits(object, MAPOBJECTFLAG_UNK28); + } +} + +BOOL MapObject_CheckFlag28(LocalMapObject *object) { + return MapObject_GetFlagsBitsMask(object, MAPOBJECTFLAG_UNK28) != 0; +} + +void MapObject_SetFlag24(LocalMapObject *object, BOOL set) { + if (set == TRUE) { + MapObject_SetFlagsBits(object, MAPOBJECTFLAG_UNK24); + } else { + MapObject_ClearFlagsBits(object, MAPOBJECTFLAG_UNK24); + } +} + +BOOL MapObject_CheckFlag24(LocalMapObject *object) { + return MapObject_GetFlagsBitsMask(object, MAPOBJECTFLAG_UNK24) != 0; +} + +BOOL MapObject_CheckFlag4(LocalMapObject *object) { + return MapObject_GetFlagsBitsMask(object, MAPOBJECTFLAG_UNK4) != 0; +} + +void MapObject_SetFlag29(LocalMapObject *object, BOOL set) { + if (set == TRUE) { + MapObject_SetFlagsBits(object, MAPOBJECTFLAG_UNK29); + } else { + MapObject_ClearFlagsBits(object, MAPOBJECTFLAG_UNK29); + } +} + +BOOL MapObject_CheckFlag29(LocalMapObject *object) { + return MapObject_GetFlagsBitsMask(object, MAPOBJECTFLAG_UNK29) != 0; +} + +u32 MapObject_GetInitialX(LocalMapObject *object) { + return object->initialX; +} + +static void MapObject_SetInitialX(LocalMapObject *object, u32 initialX) { + object->initialX = initialX; +} + +u32 MapObject_GetInitialY(LocalMapObject *object) { + return object->initialY; +} + +static void MapObject_SetInitialY(LocalMapObject *object, u32 initialY) { + object->initialY = initialY; +} + +u32 MapObject_GetInitialZ(LocalMapObject *object) { + return object->initialZ; +} + +static void MapObject_SetInitialZ(LocalMapObject *object, u32 initialY) { + object->initialZ = initialY; +} + +u32 MapObject_GetPreviousX(LocalMapObject *object) { + return object->previousX; +} + +void MapObject_SetPreviousX(LocalMapObject *object, u32 previousX) { + object->previousX = previousX; +} + +u32 MapObject_GetPreviousY(LocalMapObject *object) { + return object->previousY; +} + +void MapObject_SetPreviousY(LocalMapObject *object, u32 previousY) { + object->previousY = previousY; +} + +u32 MapObject_GetPreviousZ(LocalMapObject *object) { + return object->previousZ; +} + +void MapObject_SetPreviousZ(LocalMapObject *object, u32 previousZ) { + object->previousZ = previousZ; +} + +u32 MapObject_GetCurrentX(LocalMapObject *object) { + return object->currentX; +} + +void MapObject_SetCurrentX(LocalMapObject *object, u32 currentX) { + object->currentX = currentX; +} + +void MapObject_AddCurrentX(LocalMapObject *object, u32 currentX) { + object->currentX += currentX; +} + +s32 MapObject_GetCurrentY(LocalMapObject *object) { + return object->currentY; +} + +void MapObject_SetCurrentY(LocalMapObject *object, s32 currentY) { + object->currentY = currentY; +} + +void MapObject_AddCurrentY(LocalMapObject *object, s32 currentY) { + object->currentY += currentY; +} + +u32 MapObject_GetCurrentZ(LocalMapObject *object) { + return object->currentZ; +} + +void MapObject_SetCurrentZ(LocalMapObject *object, u32 currentZ) { + object->currentZ = currentZ; +} + +void MapObject_AddCurrentZ(LocalMapObject *object, u32 currentZ) { + object->currentZ += currentZ; +} + +void MapObject_CopyPositionVector(LocalMapObject *object, VecFx32 *positionVector) { + *positionVector = object->positionVector; +} + +void MapObject_SetPositionVector(LocalMapObject *object, VecFx32 *positionVector) { + object->positionVector = *positionVector; +} + +VecFx32 *MapObject_GetPositionVector(LocalMapObject *object) { + return &object->positionVector; +} + +fx32 MapObject_GetPositionVectorYCoord(LocalMapObject *object) { + return object->positionVector.y; +} + +void MapObject_CopyFacingVector(LocalMapObject *object, VecFx32 *facingVector) { + *facingVector = object->facingVector; +} + +void MapObject_SetFacingVector(LocalMapObject *object, VecFx32 *facingVector) { + object->facingVector = *facingVector; +} + +void sub_02058BA4(LocalMapObject *object, VecFx32 *vector) { + *vector = object->unk88; +} + +void sub_02058BB4(LocalMapObject *object, VecFx32 *vector) { + object->unk88 = *vector; +} + +void sub_02058BC4(LocalMapObject *object, VecFx32 *vector) { + *vector = object->unk94; +} + +void sub_02058BD4(LocalMapObject *object, VecFx32 *vector) { + object->unk94 = *vector; +} + +u32 MapObject_GetPositionVectorYCoordUInt(LocalMapObject *object) { + fx32 y = MapObject_GetPositionVectorYCoord(object); + return (y >> 3) / FX32_ONE; +} + +static void ObjectEvent_SetID(ObjectEvent *objectEvent, u16 id) { + objectEvent->id = id; +} + +static u16 ObjectEvent_GetID(ObjectEvent *objectEvent) { + return objectEvent->id; +} + +static void ObjectEvent_SetSpriteID(ObjectEvent *objectEvent, u32 spriteId) { + objectEvent->spriteId = spriteId; +} + +static u16 ObjectEvent_GetSpriteID(ObjectEvent *objectEvent) { + return objectEvent->spriteId; +} + +static void ObjectEvent_SetMovement(ObjectEvent *objectEvent, u32 movement) { + objectEvent->movement = movement; +} + +static u16 ObjectEvent_GetMovement(ObjectEvent *objectEvent) { + return objectEvent->movement; +} + +static void ObjectEvent_SetType(ObjectEvent *objectEvent, u16 type) { + objectEvent->type = type; +} + +static u16 ObjectEvent_GetType(ObjectEvent *objectEvent) { + return objectEvent->type; +} + +static void ObjectEvent_SetEventFlag(ObjectEvent *objectEvent, u16 eventFlag) { + objectEvent->eventFlag = eventFlag; +} + +static u16 ObjectEvent_GetEventFlag(ObjectEvent *objectEvent) { + return objectEvent->eventFlag; +} + +static void ObjectEvent_SetScriptID(ObjectEvent *objectEvent, u16 scriptId) { + objectEvent->scriptId = scriptId; +} + +static u16 ObjectEvent_GetScriptID(ObjectEvent *objectEvent) { + return objectEvent->scriptId; +} + +static void ObjectEvent_SetFacingDirection(ObjectEvent *objectEvent, u32 facingDirection) { + objectEvent->facingDirection = facingDirection; +} + +static s16 ObjectEvent_GetFacingDirection(ObjectEvent *objectEvent) { + return objectEvent->facingDirection; +} + +static void ObjectEvent_SetParam(ObjectEvent *objectEvent, s32 value, u32 param) { + switch (param) { + case 0: + objectEvent->param[0] = value; + return; + case 1: + objectEvent->param[1] = value; + return; + case 2: + objectEvent->param[2] = value; + return; + default: + GF_ASSERT(FALSE); + return; + } +} + +static u16 ObjectEvent_GetParam(ObjectEvent *objectEvent, u32 param) { + switch (param) { + case 0: + return objectEvent->param[0]; + case 1: + return objectEvent->param[1]; + case 2: + return objectEvent->param[2]; + default: + GF_ASSERT(FALSE); + return 0; + } +} + +static void ObjectEvent_SetXRange(ObjectEvent *objectEvent, s16 xRange) { + objectEvent->xRange = xRange; +} + +static s16 ObjectEvent_GetXRange(ObjectEvent *objectEvent) { + return objectEvent->xRange; +} + +static void ObjectEvent_SetYRange(ObjectEvent *objectEvent, s16 yRange) { + objectEvent->yRange = yRange; +} + +static s16 ObjectEvent_GetYRange(ObjectEvent *objectEvent) { + return objectEvent->yRange; +} + +static void ObjectEvent_SetXCoord(ObjectEvent *objectEvent, u32 x) { + objectEvent->x = x; +} + +static u16 ObjectEvent_GetXCoord(ObjectEvent *objectEvent) { + return objectEvent->x; +} + +static void ObjectEvent_SetYCoord(ObjectEvent *objectEvent, u32 y) { + objectEvent->y = y; +} + +static u32 ObjectEvent_GetYCoord(ObjectEvent *objectEvent) { + return objectEvent->y; +} + +static void ObjectEvent_SetZCoord(ObjectEvent *objectEvent, u32 z) { + objectEvent->z = z; +} + +static u16 ObjectEvent_GetZCoord(ObjectEvent *objectEvent) { + return objectEvent->z; +} + +static ObjectEvent *ObjectEvent_GetByID(u16 id, s32 objectEventCount, ObjectEvent *objectEvents) { + s32 i = 0; + ObjectEvent *objectEvent = objectEvents; + do { + if (!ObjectEvent_ScriptIDIsUnset(objectEvent) && id == ObjectEvent_GetID(objectEvent)) { + return objectEvents + i; + } + + i++; + objectEvent++; + } while (i < objectEventCount); + + return NULL; +} + +static BOOL ObjectEvent_ScriptIDIsUnset(ObjectEvent *objectEvent) { + // casts required to match + u16 script = (u16)(u32)ObjectEvent_GetScriptID(objectEvent); + return script == 0xFFFF; +} + +static u16 ObjectEvent_GetEventFlag_AssertScriptIDIsUnset(ObjectEvent *template) { + GF_ASSERT(ObjectEvent_ScriptIDIsUnset(template) == TRUE); + return ObjectEvent_GetEventFlag(template); +} + +static UnkLMOCallbackStruct *sub_02058D14(u32 movement) { + GF_ASSERT(movement < NELEMS(UNK_020F6364)); + return UNK_020F6364[movement]; +} + +static LocalMapObject_UnkCallback sub_02058D2C(UnkLMOCallbackStruct *callbackStruct) { + return callbackStruct->unk4; +} + +static LocalMapObject_UnkCallback sub_02058D30(UnkLMOCallbackStruct *callbackStruct) { + return callbackStruct->unk8; +} + +static LocalMapObject_UnkCallback sub_02058D34(UnkLMOCallbackStruct *callbackStruct) { + return callbackStruct->unkC; +} + +static LocalMapObject_UnkCallback sub_02058D38(UnkLMOCallbackStruct2 *callbackStruct) { + return callbackStruct->unk0; +} + +static LocalMapObject_UnkCallback sub_02058D3C(UnkLMOCallbackStruct2 *callbackStruct) { + return callbackStruct->unk4; +} + +static LocalMapObject_UnkCallback sub_02058D40(UnkLMOCallbackStruct2 *callbackStruct) { + return callbackStruct->unk8; +} + +static LocalMapObject_UnkCallback sub_02058D44(UnkLMOCallbackStruct2 *callbackStruct) { + return callbackStruct->unkC; +} + +static LocalMapObject_UnkCallback sub_02058D48(UnkLMOCallbackStruct2 *callbackStruct) { + return callbackStruct->unk10; +} + +static UnkLMOCallbackStruct2 *sub_02058D4C(u32 spriteId) { + UnkLMOCallbackStruct3 *array = ov05_021F9494; + do { + if (array[0].spriteId == spriteId) { + return array[0].callbackStruct; + } + array++; + } while (array[0].spriteId != 0xFFFF); + + GF_ASSERT(FALSE); + return NULL; +} + +LocalMapObject *MapObjectManager_GetFirstObjectWithXAndZ(MapObjectManager *manager, u32 x, u32 z) { + u32 count = MapObjectManager_GetObjectCount(manager); + LocalMapObject *objects = MapObjectManager_GetObjects(manager); + + do { + if (MapObject_GetFlagsBitsMask(objects, MAPOBJECTFLAG_ACTIVE) != 0) { + if (x == MapObject_GetCurrentX(objects) && z == MapObject_GetCurrentZ(objects)) { + return objects; + } + } + + objects++; + count--; + } while (count > 0); + + return NULL; +} + +void LocalMapObject_SetPositionFromVectorAndDirection(LocalMapObject *object, VecFx32 *positionVector, u32 direction) { + MapObject_SetCurrentX(object, (positionVector->x >> 4) / FX32_ONE); + MapObject_SetCurrentY(object, (positionVector->y >> 3) / FX32_ONE); + MapObject_SetCurrentZ(object, (positionVector->z >> 4) / FX32_ONE); + MapObject_SetPositionVector(object, positionVector); + sub_02059C60(object); + MapObject_SetFacingDirectionDirect(object, direction); + MapObject_ClearHeldMovement(object); + MapObject_SetFlagsBits(object, MAPOBJECTFLAG_UNK2); + MapObject_ClearFlagsBits(object, (MapObjectFlagBits)(MAPOBJECTFLAG_UNK3 | MAPOBJECTFLAG_SINGLE_MOVEMENT)); +} + +void MapObject_SetPositionFromXYZAndDirection(LocalMapObject *object, u32 x, u32 y, u32 z, u32 direction) { + VecFx32 positionVector; + positionVector.x = x * (16 * FX32_ONE) + (8 * FX32_ONE); + MapObject_SetCurrentX(object, x); + positionVector.y = y * (8 * FX32_ONE); + MapObject_SetCurrentY(object, y); + positionVector.z = z * (16 * FX32_ONE) + (8 * FX32_ONE); + MapObject_SetCurrentZ(object, z); + + MapObject_SetPositionVector(object, &positionVector); + sub_02059C60(object); + MapObject_SetFacingDirectionDirect(object, direction); + MapObject_SetFlagsBits(object, MAPOBJECTFLAG_UNK2); + MapObject_ClearFlagsBits(object, (MapObjectFlagBits)(MAPOBJECTFLAG_UNK3 | MAPOBJECTFLAG_SINGLE_MOVEMENT)); + MapObject_ClearHeldMovement(object); +} + +void sub_02058E90(LocalMapObject *object, u32 movement) { + sub_02058660(object); + MapObject_SetMovement(object, movement); + sub_02057EE0(object); + sub_02058EE8(object); +} + +void sub_02058EB0(LocalMapObject *object, u32 id) { + MapObject_SetID(object, id); + MapObject_SetFlag2(object); + sub_0205815C(object); +} + +void sub_02058EC8(LocalMapObject *object) { +} + +void sub_02058ECC(LocalMapObject *object) { +} + +void sub_02058ED0(LocalMapObject *object) { +} + +void sub_02058ED4(LocalMapObject *object) { +} + +void sub_02058ED8(LocalMapObject *object) { +} + +void sub_02058EDC(LocalMapObject *object) { +} + +void sub_02058EE0(LocalMapObject *object) { +} + +void sub_02058EE4(LocalMapObject *object) { +} diff --git a/arm9/src/palette.c b/arm9/src/palette.c index 5ac4e1e0f..60b7e6682 100644 --- a/arm9/src/palette.c +++ b/arm9/src/palette.c @@ -258,7 +258,7 @@ void sub_02003464(SysTask *task, struct PaletteData *param1) { param1->unk11a_0 = 0; param1->activeFadePalettes = 0; param1->unk11a_e = 0; - sub_0200CAB4((s32)task); + SysTask_Destroy(task); return; } @@ -269,7 +269,7 @@ void sub_02003464(SysTask *task, struct PaletteData *param1) { if (param1->activeFadePalettes == 0) { param1->unk11a_e = 0; - sub_0200CAB4((s32)task); + SysTask_Destroy(task); } } } diff --git a/arm9/src/render_window.c b/arm9/src/render_window.c index f1c273416..e89cc292a 100644 --- a/arm9/src/render_window.c +++ b/arm9/src/render_window.c @@ -552,7 +552,7 @@ WaitingIcon *WaitingIcon_New(struct Window *window, u32 param1) { waitingIcon->unk487 = 0; waitingIcon->unk488 = 0; - sub_0200CA60(sub_0200DB7C, waitingIcon, 0); + sub_0200CA60((SysTaskFunc)sub_0200DB7C, waitingIcon, 0); sub_0200D980(waitingIcon, 1); return waitingIcon; @@ -584,14 +584,14 @@ void sub_0200D980(WaitingIcon *waitingIcon, u32 param1) { } } -void sub_0200DB7C(u32 param0, void *param1) { +void sub_0200DB7C(SysTask *sysTask, void *param1) { WaitingIcon *waitingIcon = (WaitingIcon *)param1; // todo: see if this matches using a param if (waitingIcon->unk488 != 0) { if (waitingIcon->unk488 == 1) { sub_0200D980(waitingIcon, 2); } - sub_0200CAB4((s32)param0); + SysTask_Destroy(sysTask); return; } @@ -603,18 +603,18 @@ void sub_0200DB7C(u32 param0, void *param1) { } } -void sub_0200DBE8(u32 param0, void *param1) { +void sub_0200DBE8(SysTask *sysTask, void *param1) { FreeToHeap(param1); - sub_0200CAB4((s32)param0); + SysTask_Destroy(sysTask); } void sub_0200DBFC(WaitingIcon *waitingIcon) { - sub_0200CA98(sub_0200DBE8, waitingIcon, 0); + sub_0200CA98((SysTaskFunc)sub_0200DBE8, waitingIcon, 0); waitingIcon->unk488 = 1; } void sub_0200DC24(WaitingIcon *waitingIcon) { - sub_0200CA98(sub_0200DBE8, waitingIcon, 0); + sub_0200CA98((SysTaskFunc)sub_0200DBE8, waitingIcon, 0); waitingIcon->unk488 = 2; } @@ -651,7 +651,7 @@ void sub_0200DCF8(SysTask *task, void *param1) { ClearFramed10x10Square(unk); sub_0200C3DC(unk->unk164); ov05_021D99F8(unk); - sub_0200621C((s32)task); + sub_0200621C(task); return; case 2: unk->pokepicManager.unk00 = 3; diff --git a/arm9/src/scrcmd.c b/arm9/src/scrcmd.c index f44c832be..9b3db7e3f 100644 --- a/arm9/src/scrcmd.c +++ b/arm9/src/scrcmd.c @@ -54,7 +54,6 @@ extern void *FieldSysGetAttrAddr(FieldSystem *fieldSystem, enum ScriptEnvField id); extern ScriptContext *CreateScriptContext(FieldSystem *fieldSystem, u16 id); -extern u32 MapObject_GetID(LocalMapObject *lastInteracted); extern void FieldSystem_FlagSet(FieldSystem *fieldSystem, u16 flag); extern void FlagClear(FieldSystem *fieldSystem, u16 flag); extern u8 FieldSystem_FlagCheck(FieldSystem *fieldSystem, u16 flag); @@ -67,11 +66,9 @@ extern void ov05_021E2C58(ScriptContext *ctx, u16 typ, u16 id, u16 word1, s16 wo extern MessageFormat *ov06_02244210(SaveData *sav, u16 poke, u16 sex, u8 flag, u8 *unk); extern void ov05_021E2CBC(ScriptContext *ctx, MessageFormat *messageFormat, u8 param2, u32 param3); extern void ov05_021E2BB8(void *param0, ScriptContext *ctx); -extern u32 MapObject_GetType(LocalMapObject *lastInteracted); extern BOOL sub_02030F40(void); extern void sub_02055304(PlayerAvatar *playerAvatar, u32 param1); extern void sub_02039460(FieldSystem *arg); -extern u32 MapObject_GetParam(LocalMapObject *event, u32 param1); extern void ov05_021E8128(u32 param0, u8 type, u16 map); extern void ov05_021E8130(u32 param0, u32 param1); extern void ov05_021E8158(FieldSystem *fieldSystem); @@ -92,35 +89,21 @@ extern void ov05_021E26CC(u32 param0, u8 param1); extern void ov05_021E2B80(u32 param0, u8 param1); extern void ov05_021E2B9C(u32 param0, u8 param1); extern u32 sub_0205AEA4(LocalMapObject *event, const void *ptr); -extern u32 MapObject_GetCurrentX(LocalMapObject *event); -extern u32 MapObject_GetCurrentY(LocalMapObject *event); extern BOOL sub_0205AEF0(u32 param0); extern void sub_0205AEFC(u32 param0); -extern void MapObjectManager_PauseAllMovement(MapObjectManager *mapObjectManager); extern LocalMapObject *PlayerAvatar_GetMapObject(PlayerAvatar *playerAvatar); extern u32 sub_0205AE28(LocalMapObject *event); -extern void sub_02058908(LocalMapObject *event); -extern u32 sub_02058854(LocalMapObject *event); extern LocalMapObject *sub_0205E7C4(LocalMapObject *event); -extern void sub_02058914(LocalMapObject *event); -extern void MapObjectManager_UnpauseAllMovement(MapObjectManager *mapObjectManager); extern u32 sub_02034B64(FieldSystem *fieldSystem); extern const ObjectEvent *sub_02034B6C(FieldSystem *fieldSystem); extern u32 sub_02059D1C(LocalMapObject *target); -extern LocalMapObject *MapObject_SetVisible(LocalMapObject *target, BOOL visible); -extern LocalMapObject *sub_020588B8(LocalMapObject *target, u32 param1); -extern VecFx32 *sub_02058B7C(LocalMapObject *target); +extern VecFx32 *MapObject_GetPositionVector(LocalMapObject *target); extern void ov05_021EF5E0(VecFx32 *target, u32 param1); extern u32 PlayerAvatar_GetFacingDirection(PlayerAvatar *playerAvatar); extern u32 sub_02059E74(u32 direction); extern void ov05_021F1EC0(LocalMapObject *event, u32 param1); extern u16 GetPlayerXCoord(PlayerAvatar *playerAvatar); extern u16 GetPlayerYCoord(PlayerAvatar *playerAvatar); -extern void sub_02058BB4(LocalMapObject *event, VecFx32 *param1); -extern void sub_02058994(LocalMapObject *event, u8 value); -extern void sub_02058E90(LocalMapObject *event, u16 movement); -extern u16 MapObject_GetMovement(LocalMapObject *event); -extern void sub_02058EB0(LocalMapObject *event, u32 param1); extern u16 sub_02029E0C(SealCase *sealCase); extern u16 SealCase_CountSealOccurrenceAnywhere(SealCase *sealCase, u16 sealId); extern void sub_02029D44(SealCase *sealCase, u16 sealId, s16 amount); @@ -257,7 +240,6 @@ extern void sub_02050048(void); extern void sub_0204FF5C(FieldSystem *fieldSystem); extern void sub_0204F6DC(u16 param0); extern void SetEventDefaultXYPos(FieldSystem *fieldSystem, u16 objectId, u16 x, u16 y); -extern void sub_02058E28(LocalMapObject *object, u16 x, u16 z, u16 y, u16 direction); extern void SetEventDefaultDirection(FieldSystem *fieldSystem, u16 objectId, u16 direction); extern void SetWarpXYPos(FieldSystem *fieldSystem, u16 warpId, u16 x, u16 y); extern void SetBgEventXYPos(FieldSystem *fieldSystem, u16 bgEventId, u16 x, u16 y); @@ -1560,7 +1542,7 @@ BOOL ScrCmd_Unk02A1(ScriptContext *ctx) { // 02A1 u16 *unk4 = AllocFromHeap(HEAP_ID_4, 0x100); u16 xVal = (u16)MapObject_GetCurrentX(event); - u16 yVal = (u16)MapObject_GetCurrentY(event); + u16 zVal = (u16)MapObject_GetCurrentZ(event); u32 pos = 0; @@ -1574,13 +1556,13 @@ BOOL ScrCmd_Unk02A1(ScriptContext *ctx) { // 02A1 unk4[1] = (u16)(xVal - unk1); } - if (yVal < unk2) { + if (zVal < unk2) { unk4[pos * 2] = 12; - unk4[pos * 2 + 1] = (u16)(unk2 - yVal); + unk4[pos * 2 + 1] = (u16)(unk2 - zVal); pos++; - } else if (yVal > unk2) { + } else if (zVal > unk2) { unk4[pos * 2] = 13; - unk4[pos * 2 + 1] = (u16)(yVal - unk2); + unk4[pos * 2 + 1] = (u16)(zVal - unk2); pos++; } @@ -1638,7 +1620,7 @@ void sub_0203B1A8(SysTask *task, UnkStruct_0203B174 *param1) { } sub_0205AEFC(param1->Unk04); - sub_0200CAB4((s32)param1->sysTask); + SysTask_Destroy(param1->sysTask); if (param1->Unk08 != NULL) { FreeToHeap(param1->Unk08); @@ -1671,27 +1653,27 @@ static BOOL sub_0203B218(ScriptContext *ctx) { LocalMapObject *playerAvatar = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (UNK_021C5A0C[0] & 1) { if (sub_0205AE28(playerAvatar) == 1) { - sub_02058908(playerAvatar); + MapObject_PauseMovement(playerAvatar); UNK_021C5A0C[0] &= 0xfe; } } if (UNK_021C5A0C[0] & 4) { - if (sub_02058854(*lastInteracted) == 0) { - sub_02058908(*lastInteracted); + if (MapObject_CheckSingleMovement(*lastInteracted) == 0) { + MapObject_PauseMovement(*lastInteracted); UNK_021C5A0C[0] &= 0xfb; } } if (UNK_021C5A0C[0] & 2) { LocalMapObject *unk1 = MapObjectManager_GetFirstActiveObjectWithMovement(fieldSystem->mapObjectManager, 48); - if (sub_02058854(unk1) == 0) { - sub_02058908(unk1); + if (MapObject_CheckSingleMovement(unk1) == 0) { + MapObject_PauseMovement(unk1); UNK_021C5A0C[0] &= 0xfd; } } if (UNK_021C5A0C[0] & 8) { LocalMapObject *modifiedevent = sub_0205E7C4(*lastInteracted); - if (sub_02058854(modifiedevent) == 0) { - sub_02058908(modifiedevent); + if (MapObject_CheckSingleMovement(modifiedevent) == 0) { + MapObject_PauseMovement(modifiedevent); UNK_021C5A0C[0] &= 0xf7; } } @@ -1714,25 +1696,25 @@ BOOL ScrCmd_LockAllEvents2(ScriptContext *ctx) { // 02B4 MapObjectManager_PauseAllMovement(mapObjectManager); if (sub_0205AE28(playerAvatar) == 0) { UNK_021C5A0C[0] |= 1; - sub_02058914(playerAvatar); + MapObject_UnpauseMovement(playerAvatar); } - if (sub_02058854(*lastInteracted) != 0) { + if (MapObject_CheckSingleMovement(*lastInteracted) != 0) { UNK_021C5A0C[0] |= 4; - sub_02058914(*lastInteracted); + MapObject_UnpauseMovement(*lastInteracted); } if (unk1 != NULL) { SaveVarsFlags *state = Save_VarsFlags_Get(fieldSystem->saveData); if (Save_VarsFlags_CheckHaveFollower(state) == TRUE) { - if (sub_02058854(unk1) != 0) { + if (MapObject_CheckSingleMovement(unk1) != 0) { UNK_021C5A0C[0] |= 2; - sub_02058914(unk1); + MapObject_UnpauseMovement(unk1); } } } if (unk2 != NULL) { - if (sub_02058854(unk2) != 0) { + if (MapObject_CheckSingleMovement(unk2) != 0) { UNK_021C5A0C[0] |= 8; - sub_02058914(unk2); + MapObject_UnpauseMovement(unk2); } } SetupNativeScript(ctx, sub_0203B218); @@ -1747,14 +1729,14 @@ BOOL ScrCmd_ReleaseAllEvents(ScriptContext *ctx) { // 0061 BOOL ScrCmd_LockEvent(ScriptContext *ctx) { // 0062 FieldSystem *fieldSystem = ctx->fieldSystem; u16 eventId = ScriptReadHalfword(ctx); - sub_02058908(MapObjectManager_GetFirstActiveObjectByID(fieldSystem->mapObjectManager, eventId)); + MapObject_PauseMovement(MapObjectManager_GetFirstActiveObjectByID(fieldSystem->mapObjectManager, eventId)); return FALSE; } BOOL ScrCmd_ReleaseEvent(ScriptContext *ctx) { // 0063 FieldSystem *fieldSystem = ctx->fieldSystem; u16 eventId = ScriptReadHalfword(ctx); - sub_02058914(MapObjectManager_GetFirstActiveObjectByID(fieldSystem->mapObjectManager, eventId)); + MapObject_UnpauseMovement(MapObjectManager_GetFirstActiveObjectByID(fieldSystem->mapObjectManager, eventId)); return FALSE; } @@ -1783,8 +1765,8 @@ BOOL ScrCmd_LockCamera(ScriptContext *ctx) { // 0066 *targetPtr = MapObject_Create(ctx->fieldSystem->mapObjectManager, x, y, 0, 0x2000, 0, ctx->fieldSystem->location->mapId); sub_02059D1C(*targetPtr); MapObject_SetVisible(*targetPtr, TRUE); - sub_020588B8(*targetPtr, 0); - VecFx32 *position = sub_02058B7C(*targetPtr); + MapObject_ClearFlag18(*targetPtr, FALSE); + VecFx32 *position = MapObject_GetPositionVector(*targetPtr); ov05_021EF5E0(position, ctx->fieldSystem->unk24); Camera_SetFixedTarget(position, ctx->fieldSystem->camera); return FALSE; @@ -1793,7 +1775,7 @@ BOOL ScrCmd_LockCamera(ScriptContext *ctx) { // 0066 BOOL ScrCmd_ReleaseCamera(ScriptContext *ctx) { // 0067 LocalMapObject **targetPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_CAMERA_TARGET); MapObject_Remove(*targetPtr); - VecFx32 *position = sub_02058B7C(MapObjectManager_GetFirstActiveObjectByID(ctx->fieldSystem->mapObjectManager, 0xff)); + VecFx32 *position = MapObject_GetPositionVector(MapObjectManager_GetFirstActiveObjectByID(ctx->fieldSystem->mapObjectManager, 0xff)); ov05_021EF5E0(position, ctx->fieldSystem->unk24); Camera_SetFixedTarget(position, ctx->fieldSystem->camera); return FALSE; @@ -1830,10 +1812,10 @@ BOOL ScrCmd_GetEventPosition(ScriptContext *ctx) { // 006A LocalMapObject *event = MapObjectManager_GetFirstActiveObjectByID(fieldSystem->mapObjectManager, eventId); u16 *x = ScriptGetVarPointer(ctx); - u16 *y = ScriptGetVarPointer(ctx); + u16 *z = ScriptGetVarPointer(ctx); *x = (u16)MapObject_GetCurrentX(event); - *y = (u16)MapObject_GetCurrentY(event); + *z = (u16)MapObject_GetCurrentZ(event); return FALSE; } @@ -1862,7 +1844,7 @@ BOOL ScrCmd_Unk006B(ScriptContext *ctx) { // 006B - todo: CheckPersonPosition? BOOL ScrCmd_KeepEvent(ScriptContext *ctx) { // 006C u16 eventId = ScriptGetVar(ctx); LocalMapObject *event = MapObjectManager_GetFirstActiveObjectByID(ctx->fieldSystem->mapObjectManager, eventId); - sub_02058994(event, ScriptReadByte(ctx)); + MapObject_SetKeep(event, (BOOL)ScriptReadByte(ctx)); return FALSE; } @@ -3269,7 +3251,7 @@ BOOL ScrCmd_SetEventPosition(ScriptContext *ctx) { // 0187 u16 y = ScriptGetVar(ctx); u16 direction = ScriptGetVar(ctx); LocalMapObject *object = MapObjectManager_GetFirstActiveObjectByID(ctx->fieldSystem->mapObjectManager, eventId); - sub_02058E28(object, x, z, y, direction); + MapObject_SetPositionFromXYZAndDirection(object, x, z, y, direction); sub_02059D1C(object); return FALSE; } @@ -4748,10 +4730,10 @@ BOOL ScrCmd_Unk02B5(ScriptContext *ctx) { // 02B5 BOOL ScrCmd_Unk02B6(ScriptContext *ctx) { // 02B6 u16 objectId = ScriptGetVar(ctx); - u8 unk0 = ScriptReadByte(ctx); + BOOL clear = (BOOL)ScriptReadByte(ctx); LocalMapObject *object = MapObjectManager_GetFirstActiveObjectByID(ctx->fieldSystem->mapObjectManager, objectId); GF_ASSERT(object != NULL); - sub_020588B8(object, unk0); + MapObject_ClearFlag18(object, clear); return FALSE; } diff --git a/arm9/src/text.c b/arm9/src/text.c index 937035934..5074afa50 100644 --- a/arm9/src/text.c +++ b/arm9/src/text.c @@ -16,7 +16,7 @@ const struct FontInfo *gFonts = NULL; u16 sFontHalfRowLookupTable[0x100]; -BOOL UNK_021C5714[8]; +SysTask *UNK_021C5714[8]; u16 UNK_021C570E; u16 UNK_021C5710; u16 UNK_021C5712; @@ -30,15 +30,15 @@ void SetFontsPointer(const struct FontInfo *fonts) { gFonts = fonts; } -u8 sub_0201BCC8(void (*func)(u32, void *), void *printer, u32 param2) { - u32 *r4 = UNK_021C5714; +u8 sub_0201BCC8(SysTaskFunc func, void *printer, u32 param2) { + SysTask **r4 = UNK_021C5714; s32 i; for (i = 0; i < 8; i++, r4++) { - if (r4[0] != 0) { + if (r4[0] != NULL) { continue; } UNK_021C5714[i] = sub_0200CA7C(func, printer, param2); - if (UNK_021C5714[i] != 0) { + if (UNK_021C5714[i] != NULL) { break; } i = 8; @@ -49,11 +49,11 @@ u8 sub_0201BCC8(void (*func)(u32, void *), void *printer, u32 param2) { void sub_0201BCFC(u8 textPrinterNumber) { GF_ASSERT(textPrinterNumber < 8); - GF_ASSERT(UNK_021C5714[textPrinterNumber] != 0); + GF_ASSERT(UNK_021C5714[textPrinterNumber] != NULL); if (textPrinterNumber >= 8) { return; } - if (UNK_021C5714[textPrinterNumber] == 0) { + if (UNK_021C5714[textPrinterNumber] == NULL) { return; } struct TextPrinter *printer = sub_0201B6C8(); @@ -61,17 +61,17 @@ void sub_0201BCFC(u8 textPrinterNumber) { sub_0201C238(printer); FreeToHeap((void *)printer); } - sub_0200CAB4(UNK_021C5714[textPrinterNumber]); - UNK_021C5714[textPrinterNumber] = 0; + SysTask_Destroy(UNK_021C5714[textPrinterNumber]); + UNK_021C5714[textPrinterNumber] = NULL; } BOOL sub_0201BD44(u8 textPrinterNumber) { - return UNK_021C5714[textPrinterNumber] ? TRUE : FALSE; + return UNK_021C5714[textPrinterNumber] != NULL ? TRUE : FALSE; } void ResetAllTextPrinters(void) { for (s32 i = 0; i < 8; i++) { - UNK_021C5714[i] = 0; + UNK_021C5714[i] = NULL; } } @@ -175,7 +175,7 @@ u16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u32 speed, u8 (* if (speed != 0xff && speed != 0) { printer->textSpeedBottom--; printer->textSpeedTop = 1; - printer->minLetterSpacing = sub_0201BCC8((void (*)(u32, void *))RunTextPrinter, printer, 1); + printer->minLetterSpacing = sub_0201BCC8((SysTaskFunc)RunTextPrinter, printer, 1); return printer->minLetterSpacing; } else { u32 j = 0; @@ -196,8 +196,8 @@ u16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u32 speed, u8 (* } } -void RunTextPrinter(u32 param0, struct TextPrinter *printer) { -#pragma unused(param0) +void RunTextPrinter(SysTask *sysTask, struct TextPrinter *printer) { +#pragma unused(sysTask) if (UNK_021C570C == 0) { if (printer->Unk29 == 0) { printer->Unk2A = 0; diff --git a/arm9/src/unk_020051F4.c b/arm9/src/unk_020051F4.c index 2f20b4753..4dae2779c 100644 --- a/arm9/src/unk_020051F4.c +++ b/arm9/src/unk_020051F4.c @@ -17,7 +17,7 @@ extern void NNS_SndPlayerStopSeqBySeqNo(u32, u32); extern void NNS_SndPlayerStopSeqAll(u32); extern void NNS_SndPlayerStopSeq(u32 *, u32); extern void NNS_SndPlayerSetTrackPan(u32 *, u32, u32); -extern void *sub_0201B6C8(u32 *); +extern void *sub_0201B6C8(SysTask *); u32 sub_020051F4(u16 param0) { int playerNo = sub_02004018(sub_020048D0(param0)); @@ -537,10 +537,10 @@ void sub_02005B2C(SysTask *task, s32 *param1) { } void sub_02005BA0() { - u32 **r4 = sub_02003D38(34); + SysTask **r4 = sub_02003D38(34); if (*r4 != NULL) { void *r5 = sub_0201B6C8(*r4); - sub_0200CAB4((s32)(*r4)); + SysTask_Destroy(*r4); FreeToHeap(r5); } diff --git a/arm9/src/unk_020061E8.c b/arm9/src/unk_020061E8.c index 195e19df1..c34ab912b 100644 --- a/arm9/src/unk_020061E8.c +++ b/arm9/src/unk_020061E8.c @@ -21,10 +21,10 @@ SysTask *sub_020061E8(SysTaskFunc func, u32 r1, u32 r2, HeapID heapId) { return SysTask_CreateOnMainQueue(func, r4, r2); } -void sub_0200621C(s32 r4) { - struct TextPrinter *r0 = sub_0201B6C8(); - if (r0 != NULL) { - FreeToHeap(r0); +void sub_0200621C(SysTask *sysTask) { + struct TextPrinter *textPrinter = sub_0201B6C8(); + if (textPrinter != NULL) { + FreeToHeap(textPrinter); } - sub_0200CAB4(r4); + SysTask_Destroy(sysTask); } diff --git a/arm9/src/unk_0200CA44.c b/arm9/src/unk_0200CA44.c index ca7159dab..dd21c35cd 100644 --- a/arm9/src/unk_0200CA44.c +++ b/arm9/src/unk_0200CA44.c @@ -5,25 +5,24 @@ #include "main.h" extern SysTask *sub_0201B60C(void *queue, SysTaskFunc func, void *data, u32 priority); -extern void sub_0201B6A0(s32); +extern void sub_0201B6A0(SysTask *sysTask); SysTask *SysTask_CreateOnMainQueue(SysTaskFunc func, void *data, u32 priority) { return sub_0201B60C(gSystem.unk18, func, data, priority); } -BOOL sub_0200CA60(void (*r0)(u32, void *), void *r1, u32 r2) { - return (BOOL)sub_0201B60C(gSystem.unk1C, (SysTaskFunc)r0, r1, r2); // TODO: this is wrong +SysTask *sub_0200CA60(SysTaskFunc func, void *data, u32 priority) { + return sub_0201B60C(gSystem.unk1C, func, data, priority); } -BOOL sub_0200CA7C(void (*r0)(u32, void *), void *r1, u32 r2) { - return (BOOL)sub_0201B60C(gSystem.unk24, (SysTaskFunc)r0, r1, r2); +SysTask *sub_0200CA7C(SysTaskFunc func, void *data, u32 priority) { + return sub_0201B60C(gSystem.unk24, func, data, priority); } -BOOL sub_0200CA98(void (*r0)(u32, void *), void *r1, u32 r2) { - return (BOOL)sub_0201B60C(gSystem.unk20, (SysTaskFunc)r0, r1, r2); +SysTask *sub_0200CA98(SysTaskFunc func, void *data, u32 priority) { + return sub_0201B60C(gSystem.unk20, func, data, priority); } -void sub_0200CAB4(s32 unk1) // todo: SysTask -{ - sub_0201B6A0(unk1); +void SysTask_Destroy(SysTask *sysTask) { + sub_0201B6A0(sysTask); } diff --git a/arm9/src/unk_0202F150.c b/arm9/src/unk_0202F150.c index bbf6542b5..421e39831 100644 --- a/arm9/src/unk_0202F150.c +++ b/arm9/src/unk_0202F150.c @@ -2,6 +2,7 @@ #include "global.h" +#include "unk_0200CA44.h" #include "unk_0202E29C.h" #include "unk_02031480.h" #include "unk_02031734.h" @@ -13,13 +14,11 @@ vu8 UNK_02105D59 = 4; vu8 UNK_02105D58 = 4; extern void sub_0202D7D8(u8 *param0, u32 param1, struct UnkStruct0202F150_sub1 *param2); -extern u32 sub_0200CA60(void (*param0)(), u32 param1, u32 param2); extern void sub_0202D394(struct UnkStruct0202F150_sub1 *param0, u8 *param1, u32 param2); extern void sub_0202D804(u8 *param0); extern void sub_0202D330(void (*param0)(int)); extern void ov04_021D83C0(); extern void sub_0202DBA4(); -extern void sub_0200CAB4(u32 param0); extern void sub_0202D824(u8 *param0); extern u32 ov04_021D78FC(void *param0, u32 param1); extern u32 sub_0202CBD4(); @@ -99,9 +98,9 @@ u32 sub_0202F150(u32 param0, u32 param1) { sub_020312BC(UNK_021C59F8->unk5F8); if (r4 == 0) { - u32 res2 = sub_0200CA60(sub_0202FB20, 0, 0); + SysTask *sysTask = sub_0200CA60((SysTaskFunc)sub_0202FB20, 0, 0); - UNK_021C59F8->unk548 = res2; + UNK_021C59F8->unk548 = sysTask; } UNK_021C59F8->unk687 = 0; @@ -410,7 +409,7 @@ void sub_0202FA5C() { sub_0202DBA4(); UNK_021C59F4 = 0; - sub_0200CAB4(UNK_021C59F8->unk548); + SysTask_Destroy(UNK_021C59F8->unk548); UNK_021C59F8->unk548 = 0; FreeToHeap(UNK_021C59F8->unk45C); FreeToHeap(UNK_021C59F8->unk460); @@ -427,7 +426,7 @@ u32 sub_0202FB18(u32 param0) { return sub_0202E9E8(param0); } -void sub_0202FB20() { +void sub_0202FB20(SysTask *sysTask, void *param1) { if (UNK_021C59F4 != 0) { sub_0203050C(); if ((sub_02031190() == 0 && sub_02030E7C(0) != 0) || sub_02031280() != 0) { diff --git a/arm9/src/unk_0206015C.c b/arm9/src/unk_0206015C.c index cde54cc7a..cf0779793 100644 --- a/arm9/src/unk_0206015C.c +++ b/arm9/src/unk_0206015C.c @@ -6,6 +6,7 @@ #include "heap.h" #include "main.h" +#include "map_object.h" #include "save_vars_flags.h" #include "unk_020051F4.h" #include "unk_0204AF24.h" @@ -30,7 +31,6 @@ extern u32 ov06_022451F0(u32); extern void sub_02049160(struct TaskManager *taskManager, u32); extern void sub_0204C1B4(struct TaskManager *taskManager, u32, u32, u32, u32, u32, u32, u32); extern LocalMapObject *PlayerAvatar_GetMapObject(struct PlayerAvatar *playerAvatar); -extern LocalMapObject *MapObject_SetVisible(LocalMapObject *target, BOOL visible); extern void sub_0205F1C4(struct SaveVarsFlags *); extern void sub_0205F1D4(struct SaveVarsFlags *); extern void sub_0206367C(struct FieldSystem *, u32); diff --git a/include/field_system.h b/include/field_system.h index c0faa1bb7..d180a55ea 100644 --- a/include/field_system.h +++ b/include/field_system.h @@ -6,6 +6,7 @@ #include "bg_window.h" #include "camera.h" #include "field_player_avatar.h" +#include "field_types_def.h" #include "save.h" #include "task.h" @@ -22,10 +23,6 @@ typedef struct UnkFieldStruct04 { u32 unk0C; } UnkFieldStruct04; -typedef struct MapObjectManager { // must be in this func, cause otheriwse build will fail - u8 padding[0x12C]; -} MapObjectManager; // todo: fill out - typedef struct UnkStruct_020464D4 { u16 unk0[4]; u8 padding[0x108]; diff --git a/include/field_types_def.h b/include/field_types_def.h new file mode 100644 index 000000000..ce8944082 --- /dev/null +++ b/include/field_types_def.h @@ -0,0 +1,8 @@ +#ifndef POKEDIAMOND_FIELD_TYPES_DEF_H +#define POKEDIAMOND_FIELD_TYPES_DEF_H + +typedef struct LocalMapObject LocalMapObject; +typedef struct MapObjectManager MapObjectManager; +typedef struct ObjectEvent ObjectEvent; + +#endif // POKEDIAMOND_FIELD_TYPES_DEF_H diff --git a/include/map_object.h b/include/map_object.h index e5e38d121..e2a510a37 100644 --- a/include/map_object.h +++ b/include/map_object.h @@ -4,7 +4,12 @@ #include "global.h" #include "field_system.h" +#include "field_types_def.h" +#include "filesystem.h" #include "heap.h" +#include "unk_0200CA44.h" + +typedef void (*LocalMapObject_UnkCallback)(LocalMapObject *object); typedef struct SavedMapObject { u32 flags; @@ -16,36 +21,105 @@ typedef struct SavedMapObject { s8 initialFacing; s8 currentFacing; s8 nextFacing; - u16 unk10; + u16 mapId; u16 spriteId; u16 type; - u16 flagId; + u16 eventFlag; u16 script; s16 param[3]; s16 initialX; - s16 initialHeight; s16 initialY; + s16 initialZ; s16 currentX; - s16 currentHeight; s16 currentY; + s16 currentZ; fx32 vecY; u8 unk30[16]; u8 unk40[16]; } SavedMapObject; -typedef struct LocalMapObject { - u8 padding[0x128]; // todo verify size -} LocalMapObject; +struct MapObjectManager { + u32 flags; + u32 objectCount; + u32 unk8; + u32 priority; + u8 padding[0x4]; + NARC *mapModelNarc; + u32 unk18; + u8 padding2[0x104]; + u32 unk120; + LocalMapObject *objects; + FieldSystem *fieldSystem; +}; -typedef struct ObjectEvent { - u8 padding[0x8]; - u16 flag; - u8 padding2[0x16]; - // todo fill out - // todo this should be in map_events_internal.h -} ObjectEvent; +struct LocalMapObject { + u32 flags; + u32 flags2; + u32 id; + u32 mapId; + u32 spriteId; + u32 movement; + u32 type; + u32 eventFlag; + u32 scriptId; + u32 initialFacing; + u32 currentFacing; + u32 nextFacing; + u32 previousFacing; + u32 nextFacingBackup; + s32 param[3]; + s32 xRange; + s32 yRange; + u32 initialX; + u32 initialY; + u32 initialZ; + u32 previousX; + u32 previousY; + u32 previousZ; + u32 currentX; + s32 currentY; + u32 currentZ; + VecFx32 positionVector; + VecFx32 facingVector; + VecFx32 unk88; + VecFx32 unk94; + u32 unkA0; + u32 movementCmd; + u32 movementStep; + u16 unkAC; + u16 unkAE; + SysTask *unkB0; + MapObjectManager *manager; + LocalMapObject_UnkCallback unkB8; + LocalMapObject_UnkCallback unkBC; + LocalMapObject_UnkCallback unkC0; + LocalMapObject_UnkCallback unkC4; + LocalMapObject_UnkCallback unkC8; + LocalMapObject_UnkCallback unkCC; + LocalMapObject_UnkCallback unkD0; + LocalMapObject_UnkCallback unkD4; + u8 unkD8[0x10]; + u8 unkE8[0x10]; + u8 unkF8[0x10]; + u8 unk108[0x20]; +}; -typedef void (*LocalMapObject_UnkCallback)(LocalMapObject *object); +struct ObjectEvent { + u16 id; + u16 spriteId; + u16 movement; + u16 type; + u16 eventFlag; + u16 scriptId; + s16 facingDirection; + u16 param[3]; + s16 xRange; + s16 yRange; + u16 x; + u16 z; + s32 y; + // todo this should be in map_events_internal.h +}; typedef enum MapObjectFlagBits { MAPOBJECTFLAG_ACTIVE = (1 << 0), @@ -58,7 +132,7 @@ typedef enum MapObjectFlagBits { MAPOBJECTFLAG_UNK7 = (1 << 7), MAPOBJECTFLAG_UNK8 = (1 << 8), MAPOBJECTFLAG_VISIBLE = (1 << 9), - MAPOBJECTFLAG_UNK10 = (1 << 10), + MAPOBJECTFLAG_KEEP = (1 << 10), MAPOBJECTFLAG_UNK11 = (1 << 11), MAPOBJECTFLAG_UNK12 = (1 << 12), MAPOBJECTFLAG_UNK13 = (1 << 13), @@ -82,6 +156,15 @@ typedef enum MapObjectFlagBits { MAPOBJECTFLAG_UNK31 = (1 << 31), } MapObjectFlagBits; +// this may be the same as above, I don't know +typedef enum MapObjectManagerFlagBits { + MAPOBJECTMANAGERFLAG_NONE = 0, + MAPOBJECTMANAGERFLAG_UNK0 = (1 << 0), + MAPOBJECTMANAGERFLAG_UNK1 = (1 << 1), + MAPOBJECTMANAGERFLAG_UNK2 = (1 << 2), + MAPOBJECTMANAGERFLAG_UNK3 = (1 << 3), +} MapObjectManagerFlagBits; + #define MAP_OBJECT_GFX_ID_INVALID 0xFFFF typedef struct MapObjectInitArgs { @@ -108,9 +191,14 @@ typedef struct UnkLMOCallbackStruct2 { LocalMapObject_UnkCallback unk10; } UnkLMOCallbackStruct2; +typedef struct UnkLMOCallbackStruct3 { + u32 spriteId; + UnkLMOCallbackStruct2 *callbackStruct; +} UnkLMOCallbackStruct3; + MapObjectManager *MapObjectManager_Init(FieldSystem *fieldSystem, u32 objectCount, u32 priority); void MapObjectManager_Delete(MapObjectManager *manager); -void sub_020573C8(MapObjectManager *manager, u32 unused, u32 flagId, u32 objectCount, ObjectEvent *objectEvents); +void sub_020573C8(MapObjectManager *manager, u32 unused, u32 mapId, u32 objectCount, ObjectEvent *objectEvents); LocalMapObject *MapObject_Create(MapObjectManager *manager, u32 x, u32 y, u32 direction, u32 sprite, u32 movement, u32 mapNo); LocalMapObject *MapObject_CreateFromObjectEventWithId(MapObjectManager *manager, u16 id, u32 objectEventCount, u32 mapNo, const ObjectEvent *events); void sub_02057614(LocalMapObject *object, u32 sprite); @@ -127,7 +215,159 @@ void MapObject_CreateFromMultipleObjectEvents(MapObjectManager *manager, u32 map LocalMapObject *MapObjectManager_GetFirstActiveObjectByID(MapObjectManager *manager, u32 id); LocalMapObject *MapObjectManager_GetFirstActiveObjectWithMovement(MapObjectManager *manager, u32 movement); BOOL MapObjectManager_GetNextObjectWithFlagFromIndex(MapObjectManager *manager, LocalMapObject **objectDest, s32 *index, MapObjectFlagBits flag); -u32 sub_0205829C(LocalMapObject *object, u32 param1); -BOOL sub_020582A8(LocalMapObject *object, u32 mapId, u32 flagId); +u32 MapObject_GetPriorityPlusValue(LocalMapObject *object, u32 value); +BOOL sub_020582A8(LocalMapObject *object, u32 objectId, u32 mapId); +BOOL sub_020582F8(LocalMapObject *object, u32 spriteId, u32 objectId, u32 mapId); +u32 MapObjectManager_GetObjectCount(MapObjectManager *manager); +void MapObjectManager_SetFlagsBits(MapObjectManager *manager, MapObjectManagerFlagBits bits); +void MapObjectManager_ClearFlagsBits(MapObjectManager *manager, MapObjectManagerFlagBits bits); +u32 MapObjectManager_GetFlagsBitsMask(MapObjectManager *manager, MapObjectManagerFlagBits bits); +u32 MapObjectManager_GetPriority(MapObjectManager *manager); +void *sub_020583A0(MapObjectManager *manager); +void sub_020583A4(MapObjectManager *manager, u32 param1); +u32 sub_020583AC(MapObjectManager *manager); +LocalMapObject *MapObjectManager_GetObjects2(MapObjectManager *manager); +LocalMapObject *MapObjectManager_GetObjects(MapObjectManager *manager); +void MapObjectArray_NextObject(LocalMapObject **objects); +void MapObjectManager_SetMapModelNarc(MapObjectManager *manager, NARC *mapModelNarc); +NARC *MapObjectManager_GetMapModelNarc(MapObjectManager *manager); +void MapObject_SetFlagsBits(LocalMapObject *object, MapObjectFlagBits bits); +void MapObject_ClearFlagsBits(LocalMapObject *object, MapObjectFlagBits bits); +u32 MapObject_GetFlagsBitsMask(LocalMapObject *object, MapObjectFlagBits bits); +BOOL MapObject_TestFlagsBits(LocalMapObject *object, MapObjectFlagBits bits); +void MapObject_SetID(LocalMapObject *object, u32 id); +u32 MapObject_GetID(LocalMapObject *object); +u32 MapObject_GetMapID(LocalMapObject *object); +void MapObject_SetSpriteID(LocalMapObject *object, u32 spriteId); +u32 MapObject_GetSpriteID(LocalMapObject *object); +u32 sub_0205845C(LocalMapObject *object); +u32 MapObject_GetMovement(LocalMapObject *object); +void MapObject_SetType(LocalMapObject *object, u32 type); +u32 MapObject_GetType(LocalMapObject *object); +void MapObject_SetEventFlag(LocalMapObject *object, u32 eventFlag); +void MapObject_SetScriptID(LocalMapObject *object, u32 scriptId); +u32 MapObject_GetScriptID(LocalMapObject *object); +u32 MapObject_GetInitialFacingDirection(LocalMapObject *object); +void MapObject_SetFacingDirectionDirect(LocalMapObject *object, u32 direction); +void MapObject_SetFacingDirection(LocalMapObject *object, u32 direction); +u32 MapObject_GetFacingDirection(LocalMapObject *object); +u32 MapObject_GetPreviousFacingDirection(LocalMapObject *object); +void MapObject_SetNextFacingDirection(LocalMapObject *object, u32 direction); +u32 MapObject_GetNextFacingDirection(LocalMapObject *object); +void MapObject_SetOrQueueFacing(LocalMapObject *object, u32 direction); +void MapObject_SetParam(LocalMapObject *object, s32 value, u32 param); +s32 MapObject_GetParam(LocalMapObject *object, u32 param); +void MapObject_SetXRange(LocalMapObject *object, s32 xRange); +s32 MapObject_GetXRange(LocalMapObject *object); +void MapObject_SetYRange(LocalMapObject *object, s32 yRange); +s32 MapObject_GetYRange(LocalMapObject *object); +void sub_02058544(LocalMapObject *object, u32 param1); +u32 sub_0205854C(LocalMapObject *object); +MapObjectManager *MapObject_GetManager(LocalMapObject *object); +u8 *sub_0205858C(LocalMapObject *object, s32 size); +u8 *sub_020585B0(LocalMapObject *object); +u8 *sub_020585B4(LocalMapObject *object, s32 size); +u8 *sub_020585D8(LocalMapObject *object); +u8 *sub_020585DC(LocalMapObject *object, s32 size); +u8 *sub_02058600(LocalMapObject *object); +u8 *sub_02058604(LocalMapObject *object, s32 size); +u8 *sub_02058628(LocalMapObject *object); +void sub_02058638(LocalMapObject *object); +void sub_0205864C(LocalMapObject *object); +void sub_020586A0(LocalMapObject *object); +void sub_020586DC(LocalMapObject *object); +void MapObject_SetMovementCommand(LocalMapObject *object, u32 command); +u32 MapObject_GetMovementCommand(LocalMapObject *object); +void MapObject_SetMovementStep(LocalMapObject *object, u32 step); +void MapObject_IncrementMovementStep(LocalMapObject *object); +u32 MapObject_GetMovementStep(LocalMapObject *object); +void sub_02058718(LocalMapObject *object, u16 param1); +u16 sub_02058720(LocalMapObject *object); +void sub_02058728(LocalMapObject *object, u16 param1); +u16 sub_02058730(LocalMapObject *object); +FieldSystem *MapObject_GetFieldSystem(LocalMapObject *object); +u32 MapObject_GetPriority(LocalMapObject *object); +u32 sub_02058750(LocalMapObject *object); +void sub_02058768(MapObjectManager *manager); +void sub_02058774(MapObjectManager *manager); +void MapObjectManager_PauseAllMovement(MapObjectManager *manager); +void MapObjectManager_UnpauseAllMovement(MapObjectManager *manager); +BOOL sub_020587E0(MapObjectManager *manager); +u32 sub_020587F4(LocalMapObject *object, MapObjectManagerFlagBits bits); +void sub_02058804(MapObjectManager *manager, BOOL clear); +BOOL sub_0205881C(MapObjectManager *manager); +BOOL MapObject_CheckActive(LocalMapObject *object); +void MapObject_SetSingleMovement(LocalMapObject *object); +void MapObject_ClearSingleMovement(LocalMapObject *object); +BOOL MapObject_CheckSingleMovement(LocalMapObject *object); +void MapObject_SetFlag2(LocalMapObject *object); +void MapObject_ClearFlag3(LocalMapObject *object); +BOOL MapObject_CheckFlag14(LocalMapObject *object); +BOOL MapObject_CheckVisible(LocalMapObject *object); +void MapObject_SetVisible(LocalMapObject *object, BOOL set); +void MapObject_ClearFlag18(LocalMapObject *object, BOOL clear); +BOOL MapObject_CheckFlag19Disabled(LocalMapObject *object); +void MapObject_SetFlag19(LocalMapObject *object, BOOL set); +void MapObject_PauseMovement(LocalMapObject *object); +void MapObject_UnpauseMovement(LocalMapObject *object); +BOOL MapObject_CheckMovementPaused(LocalMapObject *object); +BOOL sub_02058934(LocalMapObject *object); +void MapObject_SetIgnoreHeights(LocalMapObject *object, BOOL set); +BOOL MapObject_CheckIgnoreHeights(LocalMapObject *object); +void MapObject_SetKeep(LocalMapObject *object, BOOL set); +BOOL MapObject_CheckFlag25(LocalMapObject *object); +void MapObject_SetFlag26(LocalMapObject *object, BOOL set); +BOOL MapObject_CheckFlag26(LocalMapObject *object); +void MapObject_SetFlag27(LocalMapObject *object, BOOL set); +BOOL MapObject_CheckFlag27(LocalMapObject *object); +void MapObject_SetFlag28(LocalMapObject *object, BOOL set); +BOOL MapObject_CheckFlag28(LocalMapObject *object); +void MapObject_SetFlag24(LocalMapObject *object, BOOL set); +BOOL MapObject_CheckFlag24(LocalMapObject *object); +BOOL MapObject_CheckFlag4(LocalMapObject *object); +void MapObject_SetFlag29(LocalMapObject *object, BOOL set); +BOOL MapObject_CheckFlag29(LocalMapObject *object); +u32 MapObject_GetInitialX(LocalMapObject *object); +u32 MapObject_GetInitialY(LocalMapObject *object); +u32 MapObject_GetInitialZ(LocalMapObject *object); +u32 MapObject_GetPreviousX(LocalMapObject *object); +void MapObject_SetPreviousX(LocalMapObject *object, u32 previousX); +u32 MapObject_GetPreviousY(LocalMapObject *object); +void MapObject_SetPreviousY(LocalMapObject *object, u32 previousY); +u32 MapObject_GetPreviousZ(LocalMapObject *object); +void MapObject_SetPreviousZ(LocalMapObject *object, u32 previousZ); +u32 MapObject_GetCurrentX(LocalMapObject *object); +void MapObject_SetCurrentX(LocalMapObject *object, u32 currentX); +void MapObject_AddCurrentX(LocalMapObject *object, u32 currentX); +s32 MapObject_GetCurrentY(LocalMapObject *object); +void MapObject_SetCurrentY(LocalMapObject *object, s32 currentY); +void MapObject_AddCurrentY(LocalMapObject *object, s32 currentY); +u32 MapObject_GetCurrentZ(LocalMapObject *object); +void MapObject_SetCurrentZ(LocalMapObject *object, u32 currentZ); +void MapObject_AddCurrentZ(LocalMapObject *object, u32 currentZ); +void MapObject_CopyPositionVector(LocalMapObject *object, VecFx32 *positionVector); +void MapObject_SetPositionVector(LocalMapObject *object, VecFx32 *positionVector); +VecFx32 *MapObject_GetPositionVector(LocalMapObject *object); +fx32 MapObject_GetPositionVectorYCoord(LocalMapObject *object); +void MapObject_CopyFacingVector(LocalMapObject *object, VecFx32 *facingVector); +void MapObject_SetFacingVector(LocalMapObject *object, VecFx32 *facingVector); +void sub_02058BA4(LocalMapObject *object, VecFx32 *vector); +void sub_02058BB4(LocalMapObject *object, VecFx32 *vector); +void sub_02058BC4(LocalMapObject *object, VecFx32 *vector); +void sub_02058BD4(LocalMapObject *object, VecFx32 *vector); +u32 MapObject_GetPositionVectorYCoordUInt(LocalMapObject *object); +LocalMapObject *MapObjectManager_GetFirstObjectWithXAndZ(MapObjectManager *manager, u32 x, u32 z); +void LocalMapObject_SetPositionFromVectorAndDirection(LocalMapObject *object, VecFx32 *positionVector, u32 direction); +void MapObject_SetPositionFromXYZAndDirection(LocalMapObject *object, u32 x, u32 y, u32 z, u32 direction); +void sub_02058E90(LocalMapObject *object, u32 movement); +void sub_02058EB0(LocalMapObject *object, u32 id); +void sub_02058EC8(LocalMapObject *object); +void sub_02058ECC(LocalMapObject *object); +void sub_02058ED0(LocalMapObject *object); +void sub_02058ED4(LocalMapObject *object); +void sub_02058ED8(LocalMapObject *object); +void sub_02058EDC(LocalMapObject *object); +void sub_02058EE0(LocalMapObject *object); +void sub_02058EE4(LocalMapObject *object); #endif // POKEDIAMOND_MAP_OBJECT_H diff --git a/include/render_window.h b/include/render_window.h index a77c15383..a89009078 100644 --- a/include/render_window.h +++ b/include/render_window.h @@ -99,8 +99,8 @@ void DrawFrameAndWindow3(struct Window *window, BOOL copy_to_vram, u16 fillValue void ClearFrameAndWindow3(struct Window *window, u8 param1, BOOL copy_to_vram); WaitingIcon *WaitingIcon_New(struct Window *window, u32 param1); // todo param1 -> u16 tileNum? void sub_0200D980(WaitingIcon *waitingIcon, u32 param1); -void sub_0200DB7C(u32 param0, void *param1); -void sub_0200DBE8(u32 param0, void *param1); +void sub_0200DB7C(SysTask *sysTask, void *param1); +void sub_0200DBE8(SysTask *sysTask, void *param1); void sub_0200DBFC(WaitingIcon *waitingIcon); void sub_0200DC24(WaitingIcon *waitingIcon); PokepicManager *DrawPokemonPicFromSpecies(struct BgConfig *bg_config, u8 bg_id, u8 param2, u8 param3, u8 param4, u16 numTiles, u16 species, u8 gender, HeapID heapId); diff --git a/include/text.h b/include/text.h index 0a982cbdc..212ba070d 100644 --- a/include/text.h +++ b/include/text.h @@ -4,6 +4,7 @@ #include "global.h" #include "bg_window.h" +#include "unk_0200CA44.h" #define MAKE_TEXT_COLOR(fg, sh, bg) ((((fg) & 0xFF) << 16) | (((sh) & 0xFF) << 8) | (((bg) & 0xFF) << 0)) @@ -66,7 +67,7 @@ struct FontInfo { }; void SetFontsPointer(const struct FontInfo *fonts); -u8 sub_0201BCC8(void (*func)(u32, void *), void *printer, u32 param2); +u8 sub_0201BCC8(SysTaskFunc func, void *printer, u32 param2); void sub_0201BCFC(u8 textPrinterNumber); BOOL sub_0201BD44(u8 textPrinterNumber); void ResetAllTextPrinters(void); @@ -76,7 +77,7 @@ u16 AddTextPrinterParameterized(struct Window *window, u8 fontId, struct String u16 AddTextPrinterParameterized2(struct Window *window, u8 fontId, struct String *str, u32 x, u32 y, u32 speed, u32 colors, u8 (*callback)(struct TextPrinterTemplate *, u16)); u16 AddTextPrinterParameterized3(struct Window *window, u32 fontId, struct String *str, u32 x, u32 y, u32 speed, u32 colors, u32 letterSpacing, u32 lineSpacing, u8 (*callback)(struct TextPrinterTemplate *, u16)); u16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16)); -void RunTextPrinter(u32 param0, struct TextPrinter *printer); +void RunTextPrinter(SysTask *sysTask, struct TextPrinter *printer); u32 RenderFont(struct TextPrinter *printer); void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor); void DecompressGlyphTile(const u16 *src, u16 *dst); diff --git a/include/unk_020061E8.h b/include/unk_020061E8.h index 9eda6b2c0..5f0cc2fcd 100644 --- a/include/unk_020061E8.h +++ b/include/unk_020061E8.h @@ -7,6 +7,6 @@ #include "unk_0200CA44.h" SysTask *sub_020061E8(SysTaskFunc func, u32 r1, u32 r2, HeapID heapId); -void sub_0200621C(s32 r0); +void sub_0200621C(SysTask *sysTask); #endif // POKEDIAMOND_UNK_020061E8_H diff --git a/include/unk_0200CA44.h b/include/unk_0200CA44.h index c887e244c..1a59e027e 100644 --- a/include/unk_0200CA44.h +++ b/include/unk_0200CA44.h @@ -3,7 +3,7 @@ // TODO: sys_task_api.h -#include "text.h" +#include "global.h" typedef struct SysTask SysTask; @@ -14,9 +14,9 @@ struct SysTask { // todo move to sys_task.h }; SysTask *SysTask_CreateOnMainQueue(SysTaskFunc func, void *data, u32 priority); -BOOL sub_0200CA60(void (*r0)(u32, void *), void *r1, u32 r2); -BOOL sub_0200CA7C(void (*r0)(u32, void *), void *r1, u32 r2); -BOOL sub_0200CA98(void (*r0)(u32, void *), void *r1, u32 r2); -void sub_0200CAB4(s32 unk1); +SysTask *sub_0200CA60(SysTaskFunc func, void *data, u32 priority); +SysTask *sub_0200CA7C(SysTaskFunc func, void *data, u32 priority); +SysTask *sub_0200CA98(SysTaskFunc func, void *data, u32 priority); +void SysTask_Destroy(SysTask *sysTask); #endif // POKEDIAMOND_UNK_0200CA44_H diff --git a/include/unk_0202F150.h b/include/unk_0202F150.h index 844aab8db..1f009a1c1 100644 --- a/include/unk_0202F150.h +++ b/include/unk_0202F150.h @@ -7,6 +7,7 @@ #include "RTC_api.h" #include "heap.h" #include "main.h" +#include "unk_0200CA44.h" #include "unk_0202D858.h" #include "unk_02031480.h" @@ -38,7 +39,7 @@ struct UnkStruct0202F150 { struct UnkStruct0202F150_sub1 unk47C[8]; struct UnkStruct0202F150_sub1 unk4DC; struct UnkStruct0202F150_sub1 unk4E8[8]; - u32 unk548; + SysTask *unk548; u8 unk54C[32]; u8 unk56C[32]; struct UnkStruct0202F150_sub2 unk58C[8]; @@ -101,7 +102,7 @@ u8 sub_0202FA28(); u32 sub_0202FA48(); void sub_0202FA5C(); u32 sub_0202FB18(u32 param0); -void sub_0202FB20(); +void sub_0202FB20(SysTask *sysTask, void *param1); void sub_0202FB58(); BOOL sub_0202FB80(); void sub_0202FC60();