address review comments

This commit is contained in:
red031000 2025-08-31 01:03:28 +01:00
parent dbd00e4608
commit bff82d2bca
No known key found for this signature in database
GPG Key ID: D27E50C050AE0CE1
20 changed files with 183 additions and 180 deletions

View File

@ -1036,11 +1036,11 @@ _0204C9B4:
add r2, r4, #0x0
bl sub_020554EC
ldr r0, [r5, #0x38]
bl PlayerAvatar_GetPositionVectorConst
bl PlayerAvatar_GetPositionVector
ldr r1, [r5, #0x20]
bl Camera_SetLookAtTargetAndRecalcPos
ldr r0, [r5, #0x38]
bl PlayerAvatar_GetPositionVectorConst
bl PlayerAvatar_GetPositionVector
ldr r1, [r5, #0x20]
bl Camera_SetFixedTarget
add sp, #0x10
@ -1102,11 +1102,11 @@ _0204CA48:
add r2, r4, #0x0
bl sub_020554EC
ldr r0, [r5, #0x38]
bl PlayerAvatar_GetPositionVectorConst
bl PlayerAvatar_GetPositionVector
ldr r1, [r5, #0x20]
bl Camera_SetLookAtTargetAndRecalcPos
ldr r0, [r5, #0x38]
bl PlayerAvatar_GetPositionVectorConst
bl PlayerAvatar_GetPositionVector
ldr r1, [r5, #0x20]
bl Camera_SetFixedTarget
add sp, #0x10

View File

@ -2515,16 +2515,16 @@ sub_02056C0C: ; 0x02056C0C
add r5, r1, #0x0
str r2, [sp, #0x4]
add r0, r5, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r7, r0, #0x0
ldr r0, [sp, #0x4]
bl sub_02059BF4
str r0, [sp, #0x14]
add r0, r5, #0x0
bl MapObject_GetCurrentY
bl MapObject_GetYCoord
str r0, [sp, #0x8]
add r0, r5, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
str r0, [sp, #0xc]
ldr r0, [sp, #0x4]
bl sub_02059C00
@ -2613,13 +2613,13 @@ sub_02056CCC: ; 0x02056CCC
bl MapObject_GetFieldSystem
str r0, [sp, #0x0]
add r0, r5, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r6, r0, #0x0
add r0, r4, #0x0
bl sub_02059BF4
add r7, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r5, r0, #0x0
add r0, r4, #0x0
bl sub_02059C00
@ -2682,10 +2682,10 @@ sub_02056D58: ; 0x02056D58
bl MapObject_GetFieldSystem
add r7, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r6, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
str r0, [sp, #0x0]
ldr r2, [sp, #0x0]
add r0, r7, #0x0
@ -2766,13 +2766,13 @@ sub_02056E04: ; 0x02056E04
bl MapObject_GetFieldSystem
str r0, [sp, #0x0]
add r0, r4, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_02059BF4
add r7, r0, #0x0
add r0, r4, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r4, r0, #0x0
add r0, r5, #0x0
bl sub_02059C00
@ -2816,13 +2816,13 @@ sub_02056E6C: ; 0x02056E6C
bl MapObject_GetFieldSystem
str r0, [sp, #0x0]
add r0, r5, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r6, r0, #0x0
add r0, r4, #0x0
bl sub_02059BF4
add r7, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
str r0, [sp, #0x4]
add r0, r4, #0x0
bl sub_02059C00
@ -2860,13 +2860,13 @@ sub_02056EC8: ; 0x02056EC8
bl MapObject_GetFieldSystem
str r0, [sp, #0x4]
add r0, r5, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r6, r0, #0x0
add r0, r4, #0x0
bl sub_02059BF4
add r7, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
str r0, [sp, #0x8]
add r0, r4, #0x0
bl sub_02059C00
@ -2948,13 +2948,13 @@ sub_02056F78: ; 0x02056F78
bl MapObject_GetFieldSystem
str r0, [sp, #0x0]
add r0, r5, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r6, r0, #0x0
add r0, r4, #0x0
bl sub_02059BF4
add r7, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
str r0, [sp, #0x4]
add r0, r4, #0x0
bl sub_02059C00

View File

@ -2160,13 +2160,13 @@ sub_020596D8: ; 0x020596D8
cmp r0, #0x1
bne _02059708
add r0, r5, #0x0
bl MapObject_GetPreviousX
bl MapObject_GetPreviousXCoord
add r4, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetPreviousY
bl MapObject_GetPreviousYCoord
add r6, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetPreviousZ
bl MapObject_GetPreviousZCoord
add r3, r0, #0x0
add r0, r5, #0x0
add r1, r4, #0x0
@ -2185,13 +2185,13 @@ sub_0205970C: ; 0x0205970C
cmp r0, #0x1
bne _0205973C
add r0, r5, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r4, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetCurrentY
bl MapObject_GetYCoord
add r6, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
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 MapObject_GetPreviousX
bl MapObject_GetPreviousXCoord
add r4, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetPreviousY
bl MapObject_GetPreviousYCoord
add r6, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetPreviousZ
bl MapObject_GetPreviousZCoord
add r3, r0, #0x0
add r0, r5, #0x0
add r1, r4, #0x0
@ -2235,13 +2235,13 @@ sub_02059774: ; 0x02059774
cmp r0, #0x1
bne _020597A4
add r0, r5, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r4, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetCurrentY
bl MapObject_GetYCoord
add r6, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r3, r0, #0x0
add r0, r5, #0x0
add r1, r4, #0x0
@ -2445,16 +2445,16 @@ sub_02059918: ; 0x02059918
sub sp, #0xc
add r4, r1, #0x0
add r5, r0, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r6, r0, #0x0
add r0, r4, #0x0
bl sub_02059BF4
add r7, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetCurrentY
bl MapObject_GetYCoord
str r0, [sp, #0x4]
add r0, r5, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
str r0, [sp, #0x8]
add r0, r4, #0x0
bl sub_02059C00
@ -2501,16 +2501,16 @@ _0205997C:
cmp r0, #0x0
bne _020599F4
ldr r0, [sp, #0x8]
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r7, r0, #0x0
ldr r0, [sp, #0x8]
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
cmp r7, r5
bne _020599C8
cmp r0, r6
bne _020599C8
ldr r0, [sp, #0x8]
bl MapObject_GetCurrentY
bl MapObject_GetYCoord
sub r0, r0, r4
bpl _020599BE
neg r0, r0
@ -2522,16 +2522,16 @@ _020599BE:
pop {r4-r7, pc}
_020599C8:
ldr r0, [sp, #0x8]
bl MapObject_GetPreviousX
bl MapObject_GetPreviousXCoord
add r7, r0, #0x0
ldr r0, [sp, #0x8]
bl MapObject_GetPreviousZ
bl MapObject_GetPreviousZCoord
cmp r7, r5
bne _020599F4
cmp r0, r6
bne _020599F4
ldr r0, [sp, #0x8]
bl MapObject_GetCurrentY
bl MapObject_GetYCoord
sub r0, r0, r4
bpl _020599EA
neg r0, r0
@ -2839,17 +2839,17 @@ sub_02059C0C: ; 0x02059C0C
push {r3-r5, lr}
add r5, r0, #0x0
add r4, r1, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r1, r0, #0x0
add r0, r5, #0x0
bl MapObject_SetPreviousX
add r0, r5, #0x0
bl MapObject_GetCurrentY
bl MapObject_GetYCoord
add r1, r0, #0x0
add r0, r5, #0x0
bl MapObject_SetPreviousY
add r0, r5, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r1, r0, #0x0
add r0, r5, #0x0
bl MapObject_SetPreviousZ
@ -2872,17 +2872,17 @@ sub_02059C0C: ; 0x02059C0C
sub_02059C60: ; 0x02059C60
push {r4, lr}
add r4, r0, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r1, r0, #0x0
add r0, r4, #0x0
bl MapObject_SetPreviousX
add r0, r4, #0x0
bl MapObject_GetCurrentY
bl MapObject_GetYCoord
add r1, r0, #0x0
add r0, r4, #0x0
bl MapObject_SetPreviousY
add r0, r4, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r1, r0, #0x0
add r0, r4, #0x0
bl MapObject_SetPreviousZ
@ -2894,13 +2894,13 @@ sub_02059C90: ; 0x02059C90
push {r3-r7, lr}
add r5, r1, #0x0
add r4, r0, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r6, r0, #0x0
add r0, r5, #0x0
bl sub_02059BF4
add r7, r0, #0x0
add r0, r4, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
str r0, [sp, #0x0]
add r0, r5, #0x0
bl sub_02059C00
@ -3005,7 +3005,7 @@ _02059D4E:
add r0, r5, #0x0
bl MapObject_SetPositionVector
add r0, r5, #0x0
bl MapObject_GetCurrentY
bl MapObject_GetYCoord
add r1, r0, #0x0
add r0, r5, #0x0
bl MapObject_SetPreviousY
@ -3037,10 +3037,10 @@ _02059DAC:
sub_02059DB4: ; 0x02059DB4
push {r3-r7, lr}
add r5, r0, #0x0
bl MapObject_GetPreviousX
bl MapObject_GetPreviousXCoord
add r4, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetPreviousZ
bl MapObject_GetPreviousZCoord
add r6, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetFieldSystem
@ -3052,10 +3052,10 @@ sub_02059DB4: ; 0x02059DB4
add r0, r5, #0x0
bl sub_02058728
add r0, r5, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r4, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r2, r0, #0x0
add r0, r7, #0x0
add r1, r4, #0x0

View File

@ -493,13 +493,13 @@ sub_0205A270: ; 0x0205A270
add r1, sp, #0x0
bl sub_0205A174
add r0, r5, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r4, r0, #0x0
add r0, r6, #0x0
bl sub_02059BF4
add r4, r4, r0
add r0, r5, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r5, r0, #0x0
add r0, r6, #0x0
bl sub_02059C00
@ -1061,10 +1061,10 @@ sub_0205A67C: ; 0x0205A67C
bl MapObject_GetInitialZ
add r7, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
str r0, [sp, #0x0]
add r0, r5, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
ldr r1, [sp, #0x0]
cmp r6, r1
bne _0205A6DA
@ -1461,7 +1461,7 @@ sub_0205A940: ; 0x0205A940
bl MapObject_GetInitialX
add r6, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
cmp r6, r0
bne _0205A98C
mov r0, #0x2
@ -1473,7 +1473,7 @@ _0205A974:
bl MapObject_GetInitialZ
add r6, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
cmp r6, r0
bne _0205A98C
mov r0, #0x2
@ -1492,10 +1492,10 @@ _0205A98C:
bl MapObject_GetInitialZ
add r7, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
str r0, [sp, #0x0]
add r0, r5, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
ldr r1, [sp, #0x0]
cmp r6, r1
bne _0205A9C0
@ -1746,10 +1746,10 @@ _0205AB8E:
bl MapObject_GetParam
str r0, [sp, #0x0]
add r0, r5, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r6, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r3, r0, #0x0
ldr r0, [sp, #0x0]
ldr r5, [sp, #0x0]
@ -1817,10 +1817,10 @@ _0205AC22:
mvn r7, r7
ldr r0, [sp, #0x0]
add r6, r7, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
str r0, [sp, #0x8]
ldr r0, [sp, #0x0]
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
str r0, [sp, #0x4]
ldr r0, [sp, #0x0]
bl MapObject_GetFieldSystem

View File

@ -113,20 +113,20 @@ _0205BF74: .word UNK_020F7178
sub_0205BF78: ; 0x0205BF78
push {r3-r5, lr}
add r4, r0, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r5, r0, #0x0
add r0, r4, #0x0
bl MapObject_GetPreviousX
bl MapObject_GetPreviousXCoord
cmp r5, r0
beq _0205BF90
mov r0, #0x1
pop {r3-r5, pc}
_0205BF90:
add r0, r4, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r5, r0, #0x0
add r0, r4, #0x0
bl MapObject_GetPreviousZ
bl MapObject_GetPreviousZCoord
cmp r5, r0
beq _0205BFA6
mov r0, #0x1
@ -140,20 +140,20 @@ _0205BFA6:
sub_0205BFAC: ; 0x0205BFAC
push {r3-r5, lr}
add r4, r0, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r5, r0, #0x0
add r0, r4, #0x0
bl MapObject_GetPreviousX
bl MapObject_GetPreviousXCoord
cmp r5, r0
beq _0205BFC4
mov r0, #0x0
pop {r3-r5, pc}
_0205BFC4:
add r0, r4, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r5, r0, #0x0
add r0, r4, #0x0
bl MapObject_GetPreviousZ
bl MapObject_GetPreviousZCoord
cmp r5, r0
bne _0205BFDA
mov r0, #0x1

View File

@ -402,11 +402,11 @@ sub_0205C888: ; 0x0205C888
add r5, r1, #0x0
add r6, r2, #0x0
add r4, r3, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
cmp r0, r6
bne _0205C8AE
add r0, r7, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
cmp r4, r0
bge _0205C8AE
sub r1, r0, r5
@ -426,11 +426,11 @@ sub_0205C8B4: ; 0x0205C8B4
add r5, r1, #0x0
add r6, r2, #0x0
add r4, r3, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
cmp r0, r6
bne _0205C8DA
add r0, r7, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
cmp r4, r0
ble _0205C8DA
add r1, r0, r5
@ -450,11 +450,11 @@ sub_0205C8E0: ; 0x0205C8E0
add r5, r1, #0x0
add r4, r2, #0x0
add r6, r3, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
cmp r0, r6
bne _0205C906
add r0, r7, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
cmp r4, r0
bge _0205C906
sub r1, r0, r5
@ -474,11 +474,11 @@ sub_0205C90C: ; 0x0205C90C
add r5, r1, #0x0
add r4, r2, #0x0
add r6, r3, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
cmp r0, r6
bne _0205C932
add r0, r7, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
cmp r4, r0
ble _0205C932
add r1, r0, r5
@ -504,13 +504,13 @@ sub_0205C938: ; 0x0205C938
mov r0, #0x1
pop {r3-r7, pc}
_0205C94C:
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r4, r0, #0x0
ldr r0, [sp, #0x4]
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r7, r0, #0x0
ldr r0, [sp, #0x4]
bl MapObject_GetCurrentY
bl MapObject_GetYCoord
str r0, [sp, #0xc]
add r0, r5, #0x0
bl sub_02059BF4
@ -1024,16 +1024,16 @@ sub_0205CCEC: ; 0x0205CCEC
ldr r0, [r5, #0x28]
bl PlayerAvatar_GetMapObject
add r4, r0, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r6, r0, #0x0
add r0, r4, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r7, r0, #0x0
ldr r0, [r5, #0x24]
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
str r0, [sp, #0x0]
ldr r0, [r5, #0x24]
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r3, r0, #0x0
ldr r2, [sp, #0x0]
add r0, r6, #0x0

View File

@ -88,7 +88,7 @@ sub_0205DD80: ; 0x0205DD80
strb r1, [r0, #0x3]
ldr r0, [sp, #0xc]
ldr r0, [r0, #0x38]
bl PlayerAvatar_GetPositionVectorConst
bl PlayerAvatar_GetPositionVector
str r0, [sp, #0x1c]
ldr r0, [sp, #0x18]
mov r5, #0x0

View File

@ -257,10 +257,10 @@ sub_0205E698: ; 0x0205E698
bl FieldSystem_GetPlayerAvatar
add r4, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
str r0, [sp, #0x0]
add r0, r5, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r7, r0, #0x0
add r0, r4, #0x0
bl PlayerAvatar_GetPreviousXCoord
@ -541,10 +541,10 @@ sub_0205E8D0: ; 0x0205E8D0
add r4, r2, #0x0
strb r0, [r5, #0x1]
add r0, r4, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
strh r0, [r5, #0x2]
add r0, r4, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
strh r0, [r5, #0x4]
mov r0, #0xff
strh r0, [r5, #0x6]
@ -557,16 +557,16 @@ sub_0205E8F4: ; 0x0205E8F4
push {r3-r7, lr}
add r6, r0, #0x0
ldr r5, [r1, #0x8]
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r4, r0, #0x0
add r0, r6, #0x0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r6, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetPreviousX
bl MapObject_GetPreviousXCoord
add r7, r0, #0x0
add r0, r5, #0x0
bl MapObject_GetPreviousZ
bl MapObject_GetPreviousZCoord
cmp r4, r7
bne _0205E91E
cmp r6, r0
@ -596,22 +596,22 @@ sub_0205E940: ; 0x0205E940
sub sp, #0xc
str r0, [sp, #0x0]
add r5, r1, #0x0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r4, r0, #0x0
ldr r0, [sp, #0x0]
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r6, r0, #0x0
ldr r0, [r5, #0x8]
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
str r0, [sp, #0x8]
ldr r0, [r5, #0x8]
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r7, r0, #0x0
ldr r0, [r5, #0x8]
bl MapObject_GetPreviousX
bl MapObject_GetPreviousXCoord
str r0, [sp, #0x4]
ldr r0, [r5, #0x8]
bl MapObject_GetPreviousZ
bl MapObject_GetPreviousZCoord
add r3, r0, #0x0
ldr r0, [sp, #0x8]
cmp r4, r0

View File

@ -3906,7 +3906,7 @@
.extern PlayerAvatar_GetPreviousXCoord
.extern PlayerAvatar_GetPreviousZCoord
.extern PlayerAvatar_CopyPositionVector
.extern PlayerAvatar_GetPositionVectorConst
.extern PlayerAvatar_GetPositionVector
.extern PlayerAvatar_SetUnk10
.extern PlayerAvatar_GetUnk10
.extern PlayerAvatar_SetUnk14
@ -4116,19 +4116,19 @@
.extern MapObject_GetInitialX
.extern MapObject_GetInitialY
.extern MapObject_GetInitialZ
.extern MapObject_GetPreviousX
.extern MapObject_GetPreviousXCoord
.extern MapObject_SetPreviousX
.extern MapObject_GetPreviousY
.extern MapObject_GetPreviousYCoord
.extern MapObject_SetPreviousY
.extern MapObject_GetPreviousZ
.extern MapObject_GetPreviousZCoord
.extern MapObject_SetPreviousZ
.extern MapObject_GetCurrentX
.extern MapObject_GetXCoord
.extern MapObject_SetCurrentX
.extern MapObject_AddCurrentX
.extern MapObject_GetCurrentY
.extern MapObject_GetYCoord
.extern MapObject_SetCurrentY
.extern MapObject_AddCurrentY
.extern MapObject_GetCurrentZ
.extern MapObject_GetZCoord
.extern MapObject_SetCurrentZ
.extern MapObject_AddCurrentZ
.extern MapObject_CopyPositionVector

View File

@ -1077,7 +1077,7 @@ _021D7DF6:
ldr r0, [r4, #0x34]
bl sub_02058774
ldr r0, [r4, #0x38]
bl PlayerAvatar_GetPositionVectorConst
bl PlayerAvatar_GetPositionVector
ldr r1, [r4, #0x24]
bl ov05_021EF5E0
add r0, r4, #0
@ -1109,7 +1109,7 @@ ov05_021D7E4C: ; 0x021D7E4C
bl sub_02034E10
add r5, r0, #0
ldr r0, [r4, #0x38]
bl PlayerAvatar_GetPositionVectorConst
bl PlayerAvatar_GetPositionVector
add r1, r4, #0
add r2, r5, #0
mov r3, #1

View File

@ -319,10 +319,10 @@ _021E15CA: ; jump table
.short _021E15DC - _021E15CA - 2 ; case 8
_021E15DC:
add r0, r4, #0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r7, r0, #0
add r0, r4, #0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
ldr r1, [sp, #0x14]
cmp r7, r1
blt _021E161A

View File

@ -1647,14 +1647,14 @@ ov05_021E6CC4: ; 0x021E6CC4
sub sp, #0x18
add r5, r0, #0
ldr r0, [r5, #0x3c]
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r4, r0, #0
mov r0, #0
bl sub_02059BF4
lsl r0, r0, #1
add r4, r4, r0
ldr r0, [r5, #0x3c]
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r6, r0, #0
mov r0, #0
bl sub_02059C00
@ -1878,14 +1878,14 @@ ov05_021E6E90: ; 0x021E6E90
sub sp, #0x18
add r5, r0, #0
ldr r0, [r5, #0x3c]
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r4, r0, #0
mov r0, #1
bl sub_02059BF4
lsl r0, r0, #1
add r4, r4, r0
ldr r0, [r5, #0x3c]
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r6, r0, #0
mov r0, #1
bl sub_02059C00

View File

@ -173,13 +173,13 @@ _021EDCAE:
str r0, [r5, #0x20]
_021EDCB8:
add r0, r6, #0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r4, r0, #0
ldr r0, [r5, #4]
bl sub_02059BF4
add r7, r0, #0
add r0, r6, #0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
str r0, [sp, #8]
ldr r0, [r5, #4]
bl sub_02059C00

View File

@ -1127,11 +1127,11 @@ ov06_02239F04: ; 0x02239F04
bl GF_AssertFail
_02239F18:
add r0, r5, #0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
lsl r0, r0, #0x10
lsr r6, r0, #0x10
add r0, r5, #0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
lsl r0, r0, #0x10
lsr r5, r0, #0x10
mov r0, #4
@ -33893,10 +33893,10 @@ ov06_02249E9C: ; 0x02249E9C
sub sp, #0x34
add r5, r0, #0
add r4, r1, #0
bl MapObject_GetPreviousX
bl MapObject_GetPreviousXCoord
str r0, [sp, #0xc]
add r0, r5, #0
bl MapObject_GetPreviousZ
bl MapObject_GetPreviousZCoord
str r0, [sp, #0x10]
add r0, r5, #0
bl MapObject_GetPositionVectorYCoord
@ -36382,7 +36382,7 @@ ov06_0224B124: ; 0x0224B124
add r0, r2, r0
str r0, [sp, #0x18]
add r0, r5, #0
bl MapObject_GetPreviousY
bl MapObject_GetPreviousYCoord
lsl r1, r0, #0xf
mov r0, #2
lsl r0, r0, #0xe
@ -36588,7 +36588,7 @@ ov06_0224B2C4: ; 0x0224B2C4
add r0, r1, r0
str r0, [sp, #0x18]
add r0, r5, #0
bl MapObject_GetPreviousY
bl MapObject_GetPreviousYCoord
lsl r1, r0, #0xf
mov r0, #2
lsl r0, r0, #0xe
@ -36887,13 +36887,13 @@ ov06_0224B568: ; 0x0224B568
bl ov05_021E4C24
add r4, r0, #0
add r0, r5, #0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
str r0, [sp, #8]
add r0, r5, #0
bl MapObject_GetCurrentY
bl MapObject_GetYCoord
str r0, [sp, #0xc]
add r0, r5, #0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
str r0, [sp, #0x10]
add r0, r4, #0
str r4, [sp, #0x18]
@ -37092,10 +37092,10 @@ _0224B710:
pop {r3, r4, r5, r6, r7, pc}
_0224B72A:
add r0, r6, #0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r7, r0, #0
add r0, r6, #0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
ldr r1, [r4, #0x18]
cmp r1, r7
bne _0224B744
@ -37731,10 +37731,10 @@ ov06_0224BBEC: ; 0x0224BBEC
str r5, [sp, #0x20]
bl MapObject_CopyPositionVector
add r0, r5, #0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r6, r0, #0
add r0, r5, #0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r1, r0, #0
add r0, r6, #0
add r2, sp, #8
@ -37925,13 +37925,13 @@ ov06_0224BD90: ; 0x0224BD90
bl ov05_021E4C24
add r4, r0, #0
add r0, r5, #0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
str r0, [sp, #8]
add r0, r5, #0
bl MapObject_GetCurrentY
bl MapObject_GetYCoord
str r0, [sp, #0xc]
add r0, r5, #0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
str r0, [sp, #0x10]
add r0, r4, #0
str r4, [sp, #0x18]
@ -38121,10 +38121,10 @@ _0224BF2A:
str r0, [r4]
_0224BF40:
add r0, r6, #0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r7, r0, #0
add r0, r6, #0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
ldr r1, [r4, #0x18]
cmp r1, r7
bne _0224BF5A
@ -38252,13 +38252,13 @@ ov06_0224C038: ; 0x0224C038
bl ov05_021E4C24
add r4, r0, #0
add r0, r5, #0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
str r0, [sp, #8]
add r0, r5, #0
bl MapObject_GetCurrentY
bl MapObject_GetYCoord
str r0, [sp, #0xc]
add r0, r5, #0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
str r0, [sp, #0x10]
add r0, r4, #0
str r4, [sp, #0x18]
@ -38454,10 +38454,10 @@ _0224C1DE:
str r0, [r4]
_0224C1F4:
add r0, r6, #0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r7, r0, #0
add r0, r6, #0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
ldr r1, [r4, #0x18]
cmp r1, r7
bne _0224C20E
@ -40118,10 +40118,10 @@ ov06_0224CECC: ; 0x0224CECC
bl ov05_021E4C20
add r7, r0, #0
add r0, r5, #0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
str r0, [sp, #8]
add r0, r5, #0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r1, r0, #0
ldr r0, [sp, #8]
add r2, sp, #0x20
@ -40663,10 +40663,10 @@ ov06_0224D2E0: ; 0x0224D2E0
str r5, [sp, #0x20]
bl MapObject_CopyPositionVector
add r0, r5, #0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r6, r0, #0
add r0, r5, #0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r1, r0, #0
add r0, r6, #0
add r2, sp, #8
@ -43303,10 +43303,10 @@ ov06_0224E858: ; 0x0224E858
add r1, sp, #0
bl MapObject_CopyPositionVector
add r0, r6, #0
bl MapObject_GetCurrentX
bl MapObject_GetXCoord
add r5, r0, #0
add r0, r6, #0
bl MapObject_GetCurrentZ
bl MapObject_GetZCoord
add r4, r0, #0
add r0, r6, #0
bl MapObject_GetFacingDirection

View File

@ -423,9 +423,9 @@ static void SavedMapObject_InitFromLocalMapObject(FieldSystem *fieldSystem, Loca
savedObject->initialX = MapObject_GetInitialX(localObject);
savedObject->initialY = MapObject_GetInitialY(localObject);
savedObject->initialZ = MapObject_GetInitialZ(localObject);
savedObject->currentX = MapObject_GetCurrentX(localObject);
savedObject->currentY = MapObject_GetCurrentY(localObject);
savedObject->currentZ = MapObject_GetCurrentZ(localObject);
savedObject->currentX = MapObject_GetXCoord(localObject);
savedObject->currentY = MapObject_GetYCoord(localObject);
savedObject->currentZ = MapObject_GetZCoord(localObject);
VecFx32 coords;
sub_02059E60(savedObject->currentX, savedObject->currentZ, &coords); // some kind of x y vec copy with convertion between int and fx32
@ -496,13 +496,13 @@ static void MapObject_ConvertXZToPositionVec(LocalMapObject *object) {
VecFx32 position;
MapObject_CopyPositionVector(object, &position);
u32 x = MapObject_GetCurrentX(object);
u32 x = MapObject_GetXCoord(object);
position.x = x * FX32_CONST(16) + FX32_CONST(8);
MapObject_SetPreviousX(object, x);
MapObject_SetPreviousY(object, MapObject_GetCurrentY(object));
MapObject_SetPreviousY(object, MapObject_GetYCoord(object));
u32 z = MapObject_GetCurrentZ(object);
u32 z = MapObject_GetZCoord(object);
position.z = z * FX32_CONST(16) + FX32_CONST(8);
MapObject_SetPreviousZ(object, z);
@ -1618,7 +1618,7 @@ static void MapObject_SetInitialZ(LocalMapObject *object, u32 initialY) {
object->initialZ = initialY;
}
u32 MapObject_GetPreviousX(LocalMapObject *object) {
u32 MapObject_GetPreviousXCoord(LocalMapObject *object) {
return object->previousX;
}
@ -1626,7 +1626,7 @@ void MapObject_SetPreviousX(LocalMapObject *object, u32 previousX) {
object->previousX = previousX;
}
u32 MapObject_GetPreviousY(LocalMapObject *object) {
u32 MapObject_GetPreviousYCoord(LocalMapObject *object) {
return object->previousY;
}
@ -1634,7 +1634,7 @@ void MapObject_SetPreviousY(LocalMapObject *object, u32 previousY) {
object->previousY = previousY;
}
u32 MapObject_GetPreviousZ(LocalMapObject *object) {
u32 MapObject_GetPreviousZCoord(LocalMapObject *object) {
return object->previousZ;
}
@ -1642,7 +1642,7 @@ void MapObject_SetPreviousZ(LocalMapObject *object, u32 previousZ) {
object->previousZ = previousZ;
}
u32 MapObject_GetCurrentX(LocalMapObject *object) {
u32 MapObject_GetXCoord(LocalMapObject *object) {
return object->currentX;
}
@ -1654,7 +1654,7 @@ void MapObject_AddCurrentX(LocalMapObject *object, u32 currentX) {
object->currentX += currentX;
}
s32 MapObject_GetCurrentY(LocalMapObject *object) {
s32 MapObject_GetYCoord(LocalMapObject *object) {
return object->currentY;
}
@ -1666,7 +1666,7 @@ void MapObject_AddCurrentY(LocalMapObject *object, s32 currentY) {
object->currentY += currentY;
}
u32 MapObject_GetCurrentZ(LocalMapObject *object) {
u32 MapObject_GetZCoord(LocalMapObject *object) {
return object->currentZ;
}
@ -1932,7 +1932,7 @@ LocalMapObject *MapObjectManager_GetFirstObjectWithXAndZ(MapObjectManager *manag
do {
if (MapObject_GetFlagsBitsMask(objects, MAPOBJECTFLAG_ACTIVE) != 0) {
if (x == MapObject_GetCurrentX(objects) && z == MapObject_GetCurrentZ(objects)) {
if (x == MapObject_GetXCoord(objects) && z == MapObject_GetZCoord(objects)) {
return objects;
}
}

View File

@ -5,6 +5,7 @@
#include "constants/sprites.h"
#include "map_object.h"
#include "scrcmd.h"
static PlayerAvatar *PlayerAvatar_Create(void);
static void PlayerAvatar_Setup(PlayerAvatar *avatar, s32 state, u32 gender, PlayerSaveData *playerSaveData);
@ -88,7 +89,7 @@ static void PlayerAvatar_Setup(PlayerAvatar *avatar, s32 state, u32 gender, Play
PlayerAvatar_ClearUnk20ClearFlag2(avatar);
PlayerAvatar_SetUnk24(avatar, -1);
PlayerAvatar_SetUnk28(avatar, -1);
PlayerAvatar_SetUnk8(avatar, 255);
PlayerAvatar_SetUnk8(avatar, 255); // obj_player?
PlayerAvatar_SetFlag1(avatar, TRUE);
PlayerAvatar_SetFlag4(avatar, TRUE);
}
@ -96,7 +97,7 @@ static void PlayerAvatar_Setup(PlayerAvatar *avatar, s32 state, u32 gender, Play
static void PlayerAvatar_CreateMapObjectWithParams(PlayerAvatar *avatar, MapObjectManager *manager, u32 sprite, u32 direction, u32 x, u32 z) {
LocalMapObject *mapObject = MapObject_Create(manager, x, z, direction, sprite, 1, 1);
GF_ASSERT(mapObject != NULL);
MapObject_SetID(mapObject, 255);
MapObject_SetID(mapObject, obj_player);
MapObject_SetType(mapObject, 0);
MapObject_SetEventFlag(mapObject, 0);
MapObject_SetScriptID(mapObject, 0);
@ -141,26 +142,26 @@ u32 PlayerAvatar_GetNextFacingDirection(PlayerAvatar *avatar) {
}
u32 PlayerAvatar_GetXCoord(PlayerAvatar *avatar) {
return MapObject_GetCurrentX(PlayerAvatar_GetMapObject(avatar));
return MapObject_GetXCoord(PlayerAvatar_GetMapObject(avatar));
}
u32 PlayerAvatar_GetZCoord(PlayerAvatar *avatar) {
return MapObject_GetCurrentZ(PlayerAvatar_GetMapObject(avatar));
return MapObject_GetZCoord(PlayerAvatar_GetMapObject(avatar));
}
u32 PlayerAvatar_GetPreviousXCoord(PlayerAvatar *avatar) {
return MapObject_GetPreviousX(PlayerAvatar_GetMapObject(avatar));
return MapObject_GetPreviousXCoord(PlayerAvatar_GetMapObject(avatar));
}
u32 PlayerAvatar_GetPreviousZCoord(PlayerAvatar *avatar) {
return MapObject_GetPreviousZ(PlayerAvatar_GetMapObject(avatar));
return MapObject_GetPreviousZCoord(PlayerAvatar_GetMapObject(avatar));
}
void PlayerAvatar_CopyPositionVector(PlayerAvatar *avatar, VecFx32 *vector) {
MapObject_CopyPositionVector(PlayerAvatar_GetMapObject(avatar), vector);
}
VecFx32 *PlayerAvatar_GetPositionVectorConst(PlayerAvatar *avatar) {
VecFx32 *PlayerAvatar_GetPositionVector(PlayerAvatar *avatar) {
return MapObject_GetPositionVector(PlayerAvatar_GetMapObjectConst(avatar));
}

View File

@ -1532,8 +1532,8 @@ BOOL ScrCmd_Unk02A1(ScriptContext *ctx) { // 02A1
GF_ASSERT(event);
u16 *unk4 = AllocFromHeap(HEAP_ID_4, 0x100);
u16 xVal = (u16)MapObject_GetCurrentX(event);
u16 zVal = (u16)MapObject_GetCurrentZ(event);
u16 xVal = (u16)MapObject_GetXCoord(event);
u16 zVal = (u16)MapObject_GetZCoord(event);
u32 pos = 0;
@ -1805,8 +1805,8 @@ BOOL ScrCmd_GetEventPosition(ScriptContext *ctx) { // 006A
u16 *x = ScriptGetVarPointer(ctx);
u16 *z = ScriptGetVarPointer(ctx);
*x = (u16)MapObject_GetCurrentX(event);
*z = (u16)MapObject_GetCurrentZ(event);
*x = (u16)MapObject_GetXCoord(event);
*z = (u16)MapObject_GetZCoord(event);
return FALSE;
}

View File

@ -330,19 +330,19 @@ 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);
u32 MapObject_GetPreviousXCoord(LocalMapObject *object);
void MapObject_SetPreviousX(LocalMapObject *object, u32 previousX);
u32 MapObject_GetPreviousY(LocalMapObject *object);
u32 MapObject_GetPreviousYCoord(LocalMapObject *object);
void MapObject_SetPreviousY(LocalMapObject *object, u32 previousY);
u32 MapObject_GetPreviousZ(LocalMapObject *object);
u32 MapObject_GetPreviousZCoord(LocalMapObject *object);
void MapObject_SetPreviousZ(LocalMapObject *object, u32 previousZ);
u32 MapObject_GetCurrentX(LocalMapObject *object);
u32 MapObject_GetXCoord(LocalMapObject *object);
void MapObject_SetCurrentX(LocalMapObject *object, u32 currentX);
void MapObject_AddCurrentX(LocalMapObject *object, u32 currentX);
s32 MapObject_GetCurrentY(LocalMapObject *object);
s32 MapObject_GetYCoord(LocalMapObject *object);
void MapObject_SetCurrentY(LocalMapObject *object, s32 currentY);
void MapObject_AddCurrentY(LocalMapObject *object, s32 currentY);
u32 MapObject_GetCurrentZ(LocalMapObject *object);
u32 MapObject_GetZCoord(LocalMapObject *object);
void MapObject_SetCurrentZ(LocalMapObject *object, u32 currentZ);
void MapObject_AddCurrentZ(LocalMapObject *object, u32 currentZ);
void MapObject_CopyPositionVector(LocalMapObject *object, VecFx32 *positionVector);

View File

@ -56,7 +56,7 @@ u32 PlayerAvatar_GetZCoord(PlayerAvatar *avatar);
u32 PlayerAvatar_GetPreviousXCoord(PlayerAvatar *avatar);
u32 PlayerAvatar_GetPreviousZCoord(PlayerAvatar *avatar);
void PlayerAvatar_CopyPositionVector(PlayerAvatar *avatar, VecFx32 *vector);
VecFx32 *PlayerAvatar_GetPositionVectorConst(PlayerAvatar *avatar);
VecFx32 *PlayerAvatar_GetPositionVector(PlayerAvatar *avatar);
void PlayerAvatar_SetUnk10(PlayerAvatar *avatar, u32 param1);
u32 PlayerAvatar_GetUnk10(PlayerAvatar *avatar);
void PlayerAvatar_SetUnk14(PlayerAvatar *avatar, u32 param1);

View File

@ -6,6 +6,8 @@
#include "script.h"
#include "unk_0200CA44.h"
#define obj_player 255
extern u16 FieldSystem_VarGet(FieldSystem *fieldSystem, u16);
extern u16 *GetVarPointer(FieldSystem *fieldSystem, u16);
extern SaveData *FieldSystem_GetSaveData(FieldSystem *fieldSystem);