ScrCmd_GetOverworldEventPosition

This commit is contained in:
Akashi Akira
2023-05-09 17:06:42 +01:00
parent 1d54293894
commit 9e2159e941
5 changed files with 19 additions and 46 deletions

View File

@@ -14,48 +14,6 @@ UNK_021C5A0C: ; 0x021C5A0C
.text
thumb_func_start ScrCmd_Unk006A
ScrCmd_Unk006A: ; 0x0203B5B8
push {r4-r6, lr}
add r4, r0, #0x0
add r1, r4, #0x0
add r1, #0x80
ldr r5, [r1, #0x0]
bl ScriptReadHalfword
add r1, r0, #0x0
add r0, r4, #0x0
add r0, #0x80
ldr r0, [r0, #0x0]
bl VarGet
add r1, r0, #0x0
ldr r0, [r5, #0x34]
bl FUN_02058060
add r5, r0, #0x0
add r0, r4, #0x0
bl ScriptReadHalfword
add r1, r0, #0x0
add r0, r4, #0x0
add r0, #0x80
ldr r0, [r0, #0x0]
bl GetVarPointer
add r6, r0, #0x0
add r0, r4, #0x0
bl ScriptReadHalfword
add r4, #0x80
add r1, r0, #0x0
ldr r0, [r4, #0x0]
bl GetVarPointer
add r4, r0, #0x0
add r0, r5, #0x0
bl FUN_02058B2C
strh r0, [r6, #0x0]
add r0, r5, #0x0
bl FUN_02058B4C
strh r0, [r4, #0x0]
mov r0, #0x0
pop {r4-r6, pc}
.balign 4
thumb_func_start ScrCmd_Unk01BD
ScrCmd_Unk01BD: ; 0x0203B618
push {r3-r5, lr}

View File

@@ -255,7 +255,7 @@ gScriptCmdTable: ; 0x020F355C
.word ScrCmd_ReleaseCamera
.word ScrCmd_FacePlayer
.word ScrCmd_GetPlayerPosition
.word ScrCmd_Unk006A
.word ScrCmd_GetOverworldEventPosition
.word ScrCmd_Unk006B
.word ScrCmd_Unk006C
.word ScrCmd_Unk006D

View File

@@ -2800,7 +2800,7 @@
.extern ScrCmd_ReleaseCamera
.extern ScrCmd_FacePlayer
.extern ScrCmd_GetPlayerPosition
.extern ScrCmd_Unk006A
.extern ScrCmd_GetOverworldEventPosition
.extern ScrCmd_Unk01BD
.extern ScrCmd_Unk006B
.extern ScrCmd_Unk006C

View File

@@ -55,7 +55,7 @@ extern u32 FUN_0205AEA4(struct Vecx32 *param0, const void *ptr);
extern u32 FUN_02058B2C(struct Vecx32 *param0);
extern u32 FUN_02058B4C(struct Vecx32 *param0);
extern struct Vecx32 *FUN_020580B4(u32 param0, u32 param1);
extern struct Vecx32 *FUN_02058060(u32 param0, u32 param1);
extern struct Vecx32 *FUN_02058060(u32 param0, u32 eventId);
extern BOOL FUN_0205AEF0(u32 param0);
extern void FUN_0205AEFC(u32 param0);
extern void FUN_02058780(u32 param0);
@@ -1673,7 +1673,7 @@ THUMB_FUNC BOOL ScrCmd_FacePlayer(struct ScriptContext *ctx) //0068
return FALSE;
}
THUMB_FUNC BOOL ScrCmd_GetPlayerPosition(struct ScriptContext *ctx)
THUMB_FUNC BOOL ScrCmd_GetPlayerPosition(struct ScriptContext *ctx) //0069
{
struct FieldSystem *fieldSystem = ctx->fieldSystem;
@@ -1685,3 +1685,17 @@ THUMB_FUNC BOOL ScrCmd_GetPlayerPosition(struct ScriptContext *ctx)
return FALSE;
}
THUMB_FUNC BOOL ScrCmd_GetOverworldEventPosition(struct ScriptContext *ctx) //006A
{
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u32 eventId = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
struct Vecx32 *position = FUN_02058060(fieldSystem->unk34, eventId);
u16 *xVar = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
u16 *yVar = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
*xVar = FUN_02058B2C(position);
*yVar = FUN_02058B4C(position);
return FALSE;
}

View File

@@ -127,6 +127,7 @@ BOOL ScrCmd_LockCamera(struct ScriptContext *ctx);
BOOL ScrCmd_ReleaseCamera(struct ScriptContext *ctx);
BOOL ScrCmd_FacePlayer(struct ScriptContext *ctx);
BOOL ScrCmd_GetPlayerPosition(struct ScriptContext *ctx);
BOOL ScrCmd_GetOverworldEventPosition(struct ScriptContext *ctx);
// scrcmd_mart.c
BOOL ScrCmd_NormalMart(struct ScriptContext * ctx);