Merge pull request #487 from red031000/master

ScrCmd_GetPlayerPosition
This commit is contained in:
Akira Akashi
2023-05-10 15:17:19 +01:00
committed by GitHub
6 changed files with 170 additions and 403 deletions

View File

@@ -14,377 +14,6 @@ UNK_021C5A0C: ; 0x021C5A0C
.text
thumb_func_start ScrCmd_Unk0069
ScrCmd_Unk0069: ; 0x0203B574
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 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
ldr r0, [r5, #0x38]
bl GetPlayerXCoord
strh r0, [r6, #0x0]
ldr r0, [r5, #0x38]
bl GetPlayerYCoord
strh r0, [r4, #0x0]
mov r0, #0x0
pop {r4-r6, pc}
.balign 4
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}
add r5, r0, #0x0
bl ScriptReadHalfword
add r1, r0, #0x0
add r0, r5, #0x0
add r0, #0x80
ldr r0, [r0, #0x0]
bl GetVarPointer
add r5, #0x80
add r4, r0, #0x0
ldr r0, [r5, #0x0]
ldr r0, [r0, #0x38]
bl PlayerAvatar_GetFacingDirection
strh r0, [r4, #0x0]
mov r0, #0x0
pop {r3-r5, pc}
.balign 4
thumb_func_start ScrCmd_Unk006B
ScrCmd_Unk006B: ; 0x0203B640
push {r4-r7, lr}
sub sp, #0xc
add r5, r0, #0x0
bl ScriptReadHalfword
add r1, r0, #0x0
add r0, r5, #0x0
add r0, #0x80
ldr r0, [r0, #0x0]
bl VarGet
add r7, r0, #0x0
add r0, r5, #0x0
bl ScriptReadHalfword
add r1, r0, #0x0
add r0, r5, #0x0
add r0, #0x80
ldr r0, [r0, #0x0]
bl VarGet
add r6, r0, #0x0
add r0, r5, #0x0
bl ScriptReadHalfword
add r1, r0, #0x0
add r0, r5, #0x0
add r0, #0x80
ldr r0, [r0, #0x0]
bl VarGet
add r4, r0, #0x0
cmp r7, #0x0
beq _0203B696
lsl r0, r7, #0xc
bl _fflt
add r1, r0, #0x0
mov r0, #0x3f
lsl r0, r0, #0x18
bl _fadd
b _0203B6A4
_0203B696:
lsl r0, r7, #0xc
bl _fflt
mov r1, #0x3f
lsl r1, r1, #0x18
bl _fsub
_0203B6A4:
bl _ffix
str r0, [sp, #0x0]
cmp r6, #0x0
beq _0203B6C0
lsl r0, r6, #0xc
bl _fflt
add r1, r0, #0x0
mov r0, #0x3f
lsl r0, r0, #0x18
bl _fadd
b _0203B6CE
_0203B6C0:
lsl r0, r6, #0xc
bl _fflt
mov r1, #0x3f
lsl r1, r1, #0x18
bl _fsub
_0203B6CE:
bl _ffix
str r0, [sp, #0x4]
cmp r4, #0x0
beq _0203B6EA
lsl r0, r4, #0xc
bl _fflt
add r1, r0, #0x0
mov r0, #0x3f
lsl r0, r0, #0x18
bl _fadd
b _0203B6F8
_0203B6EA:
lsl r0, r4, #0xc
bl _fflt
mov r1, #0x3f
lsl r1, r1, #0x18
bl _fsub
_0203B6F8:
bl _ffix
str r0, [sp, #0x8]
add r0, r5, #0x0
add r0, #0x80
ldr r0, [r0, #0x0]
ldr r0, [r0, #0x38]
bl FUN_020553A0
add r1, sp, #0x0
bl FUN_02058BB4
add r5, #0x80
ldr r1, [r5, #0x0]
add r0, sp, #0x0
ldr r1, [r1, #0x20]
bl Camera_OffsetLookAtPosAndTarget
mov r0, #0x0
add sp, #0xc
pop {r4-r7, pc}
.balign 4
thumb_func_start ScrCmd_Unk006C
ScrCmd_Unk006C: ; 0x0203B724
push {r4, lr}
add r4, r0, #0x0
bl ScriptReadHalfword
add r1, r0, #0x0
add r0, r4, #0x0
add r0, #0x80
ldr r0, [r0, #0x0]
bl VarGet
add r1, r0, #0x0
add r0, r4, #0x0
add r0, #0x80
ldr r0, [r0, #0x0]
ldr r0, [r0, #0x34]
bl FUN_02058060
ldr r2, [r4, #0x8]
add r1, r2, #0x1
str r1, [r4, #0x8]
ldrb r1, [r2, #0x0]
bl FUN_02058994
mov r0, #0x0
pop {r4, pc}
.balign 4
thumb_func_start ScrCmd_Unk006D
ScrCmd_Unk006D: ; 0x0203B758
push {r3-r5, lr}
add r4, r0, #0x0
bl ScriptReadHalfword
add r1, r0, #0x0
add r0, r4, #0x0
add r0, #0x80
ldr r0, [r0, #0x0]
bl VarGet
add r1, r0, #0x0
add r0, r4, #0x0
add r0, #0x80
ldr r0, [r0, #0x0]
ldr r0, [r0, #0x34]
bl FUN_02058060
add r5, r0, #0x0
add r0, r4, #0x0
bl ScriptReadHalfword
add r1, r0, #0x0
add r0, r5, #0x0
bl FUN_02058E90
mov r0, #0x0
pop {r3-r5, pc}
.balign 4
thumb_func_start ScrCmd_Unk02AD
ScrCmd_Unk02AD: ; 0x0203B790
push {r3-r5, lr}
add r5, r0, #0x0
bl ScriptReadHalfword
add r1, r0, #0x0
add r0, r5, #0x0
add r0, #0x80
ldr r0, [r0, #0x0]
bl GetVarPointer
add r4, r0, #0x0
mov r0, #0x0
strh r0, [r4, #0x0]
add r0, r5, #0x0
bl ScriptReadHalfword
add r1, r0, #0x0
add r0, r5, #0x0
add r0, #0x80
ldr r0, [r0, #0x0]
bl VarGet
add r5, #0x80
add r1, r0, #0x0
ldr r0, [r5, #0x0]
ldr r0, [r0, #0x34]
bl FUN_02058060
cmp r0, #0x0
beq _0203B7D2
bl FUN_02058480
strh r0, [r4, #0x0]
_0203B7D2:
mov r0, #0x0
pop {r3-r5, pc}
.balign 4
thumb_func_start ScrCmd_Unk006E
ScrCmd_Unk006E: ; 0x0203B7D8
push {r3, lr}
add r0, #0x80
ldr r0, [r0, #0x0]
mov r1, #0x30
ldr r0, [r0, #0x34]
bl FUN_020580B4
mov r1, #0xfe
bl FUN_02058EB0
mov r0, #0x0
pop {r3, pc}
thumb_func_start ScrCmd_Unk02AB
ScrCmd_Unk02AB: ; 0x0203B7F0
push {r3-r5, lr}
add r5, r0, #0x0
bl ScriptReadHalfword
add r1, r0, #0x0
add r0, r5, #0x0
add r0, #0x80
ldr r0, [r0, #0x0]
bl GetVarPointer
add r5, #0x80
add r4, r0, #0x0
ldr r0, [r5, #0x0]
ldr r0, [r0, #0xc]
bl Sav2_SealCase_get
bl FUN_02029E0C
strh r0, [r4, #0x0]
mov r0, #0x0
pop {r3-r5, pc}
.balign 4
thumb_func_start ScrCmd_Unk0093
ScrCmd_Unk0093: ; 0x0203B81C
push {r4-r6, lr}
add r5, r0, #0x0
bl ScriptReadHalfword
add r1, r0, #0x0
add r0, r5, #0x0
add r0, #0x80
ldr r0, [r0, #0x0]
bl VarGet
add r6, r0, #0x0
add r0, r5, #0x0
bl ScriptReadHalfword
add r1, r0, #0x0
add r0, r5, #0x0
add r0, #0x80
ldr r0, [r0, #0x0]
bl GetVarPointer
add r5, #0x80
add r4, r0, #0x0
ldr r0, [r5, #0x0]
ldr r0, [r0, #0xc]
bl Sav2_SealCase_get
add r1, r6, #0x0
bl FUN_02029E2C
strh r0, [r4, #0x0]
mov r0, #0x0
pop {r4-r6, pc}
thumb_func_start ScrCmd_Unk0094
ScrCmd_Unk0094: ; 0x0203B85C
push {r4-r6, lr}
add r5, r0, #0x0
bl ScriptReadHalfword
add r1, r0, #0x0
add r0, r5, #0x0
add r0, #0x80
ldr r0, [r0, #0x0]
bl VarGet
add r6, r0, #0x0
add r0, r5, #0x0
bl ScriptReadHalfword
add r1, r0, #0x0
add r0, r5, #0x0
add r0, #0x80
ldr r0, [r0, #0x0]
bl VarGet
add r5, #0x80
add r4, r0, #0x0
ldr r0, [r5, #0x0]
ldr r0, [r0, #0xc]
bl Sav2_SealCase_get
lsl r2, r4, #0x10
add r1, r6, #0x0
asr r2, r2, #0x10
bl FUN_02029D44
mov r0, #0x0
pop {r4-r6, pc}
.balign 4
thumb_func_start ScrCmd_Unk0095
ScrCmd_Unk0095: ; 0x0203B8A0
push {r4-r6, lr}

View File

@@ -254,12 +254,12 @@ gScriptCmdTable: ; 0x020F355C
.word ScrCmd_LockCamera
.word ScrCmd_ReleaseCamera
.word ScrCmd_FacePlayer
.word ScrCmd_Unk0069
.word ScrCmd_Unk006A
.word ScrCmd_GetPlayerPosition
.word ScrCmd_GetOverworldEventPosition
.word ScrCmd_Unk006B
.word ScrCmd_Unk006C
.word ScrCmd_Unk006D
.word ScrCmd_Unk006E
.word ScrCmd_KeepOverworldEvent
.word ScrCmd_SetOverworldEventMovement
.word ScrCmd_OverworldEventStopFollowing
.word ScrCmd_GiveMoney
.word ScrCmd_TakeMoneyImmediate
.word ScrCmd_HasEnoughMoneyImmediate
@@ -296,8 +296,8 @@ gScriptCmdTable: ; 0x020F355C
.word ScrCmd_TakeUndergroundSphere
.word ScrCmd_HasSpaceForSphere
.word ScrCmd_GetSphereCount
.word ScrCmd_Unk0093
.word ScrCmd_Unk0094
.word ScrCmd_GetSealCountFromId
.word ScrCmd_GiveSeals
.word ScrCmd_Unk0095
.word ScrCmd_GiveMon
.word ScrCmd_GiveEgg
@@ -594,7 +594,7 @@ gScriptCmdTable: ; 0x020F355C
.word ScrCmd_AddPartyMonFriendship
.word ScrCmd_SubtractPartyMonFriendship
.word ScrCmd_Unk01BC
.word ScrCmd_Unk01BD
.word ScrCmd_GetPlayerDirection
.word ScrCmd_Unk01BE
.word ScrCmd_Unk01BF
.word ScrCmd_CheckPartyForSpecies
@@ -834,7 +834,7 @@ gScriptCmdTable: ; 0x020F355C
.word ScrCmd_Unk02AA
.word ScrCmd_Unk02AB
.word ScrCmd_Unk02AC
.word ScrCmd_Unk02AD
.word ScrCmd_GetOverworldEventMovement
.word ScrCmd_Unk02AE
.word ScrCmd_Unk02AF
.word ScrCmd_Unk02B0

View File

@@ -2799,17 +2799,17 @@
.extern ScrCmd_LockCamera
.extern ScrCmd_ReleaseCamera
.extern ScrCmd_FacePlayer
.extern ScrCmd_Unk0069
.extern ScrCmd_Unk006A
.extern ScrCmd_Unk01BD
.extern ScrCmd_GetPlayerPosition
.extern ScrCmd_GetOverworldEventPosition
.extern ScrCmd_GetPlayerDirection
.extern ScrCmd_Unk006B
.extern ScrCmd_Unk006C
.extern ScrCmd_Unk006D
.extern ScrCmd_Unk02AD
.extern ScrCmd_Unk006E
.extern ScrCmd_KeepOverworldEvent
.extern ScrCmd_SetOverworldEventMovement
.extern ScrCmd_GetOverworldEventMovement
.extern ScrCmd_OverworldEventStopFollowing
.extern ScrCmd_Unk02AB
.extern ScrCmd_Unk0093
.extern ScrCmd_Unk0094
.extern ScrCmd_GetSealCountFromId
.extern ScrCmd_GiveSeals
.extern ScrCmd_Unk0095
.extern ScrCmd_Unk0191
.extern ScrCmd_Unk02A5

View File

@@ -6,6 +6,7 @@
#include "options.h"
#include "player_data.h"
#include "render_window.h"
#include "seal.h"
#include "task.h"
#include "text.h"
#include "text_02054590.h"
@@ -55,7 +56,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);
@@ -80,6 +81,16 @@ extern void FUN_02057654(struct Vecx32 *target);
extern u32 PlayerAvatar_GetFacingDirection(struct PlayerAvatar *playerAvatar);
extern u32 FUN_02059E74(u32 direction);
extern void MOD05_021F1EC0(struct Vecx32 *param0, u32 param1);
extern u16 GetPlayerXCoord(struct PlayerAvatar *playerAvatar);
extern u16 GetPlayerYCoord(struct PlayerAvatar *playerAvatar);
extern void FUN_02058BB4(struct Vecx32 *param0, struct Vecx32 *param1);
extern void FUN_02058994(struct Vecx32 *vector, u8 value);
extern void FUN_02058E90(struct Vecx32 *vector, u16 movement);
extern u16 FUN_02058480(struct Vecx32 *vector);
extern void FUN_02058EB0(struct Vecx32 *vector, u32 param1);
extern u16 FUN_02029E0C(struct SealCase *sealCase);
extern u16 FUN_02029E2C(struct SealCase *sealCase, u16 sealId);
extern void FUN_02029D44(struct SealCase *sealCase, u16 sealId, s16 amount);
extern u8 UNK_021C5A0C[4];
@@ -100,7 +111,7 @@ static BOOL FUN_0203AA0C(struct ScriptContext *ctx);
static BOOL FUN_0203AB00(struct ScriptContext *ctx);
static BOOL FUN_0203AD2C(struct ScriptContext *ctx);
static BOOL FUN_0203AD78(struct ScriptContext *ctx);
static struct Vecx32 *FUN_0203B120(struct FieldSystem *fieldSystem, u16 param1);
static struct Vecx32 *FUN_0203B120(struct FieldSystem *fieldSystem, u16 eventId);
static BOOL FUN_0203B158(struct ScriptContext *ctx);
static void FUN_0203B174(struct FieldSystem *fieldSystem, u32 param1, void *param2);
static void FUN_0203B1A8(u32 param0, UnkStruct_0203B174 *param1);
@@ -1404,20 +1415,20 @@ THUMB_FUNC BOOL ScrCmd_Unk02A1(struct ScriptContext *ctx) //02A1
return FALSE;
}
THUMB_FUNC static struct Vecx32 *FUN_0203B120(struct FieldSystem *arg, u16 param1)
THUMB_FUNC static struct Vecx32 *FUN_0203B120(struct FieldSystem *fieldSystem, u16 eventId)
{
if (param1 == 242)
if (eventId == 242)
{
return FUN_020580B4(arg->unk34, 48);
return FUN_020580B4(fieldSystem->unk34, 48);
}
else if (param1 == 241)
else if (eventId == 241)
{
struct Vecx32 **res = (struct Vecx32 **)FUN_02039438(arg, 11);
struct Vecx32 **res = (struct Vecx32 **)FUN_02039438(fieldSystem, 11);
return *res;
}
else
{
return FUN_02058060(arg->unk34, param1);
return FUN_02058060(fieldSystem->unk34, eventId);
}
}
@@ -1433,7 +1444,7 @@ THUMB_FUNC static BOOL FUN_0203B158(struct ScriptContext *ctx)
return *unk == 0 ? TRUE : FALSE;
}
THUMB_FUNC static void FUN_0203B174(struct FieldSystem *arg, u32 param1, void *param2)
THUMB_FUNC static void FUN_0203B174(struct FieldSystem *fieldSystem, u32 param1, void *param2)
{
UnkStruct_0203B174 *unkStruct = (UnkStruct_0203B174 *)AllocFromHeap(4, sizeof(UnkStruct_0203B174));
if (unkStruct == NULL)
@@ -1441,7 +1452,7 @@ THUMB_FUNC static void FUN_0203B174(struct FieldSystem *arg, u32 param1, void *p
GF_AssertFail();
return;
}
unkStruct->fieldSystem = arg;
unkStruct->fieldSystem = fieldSystem;
unkStruct->Unk04 = param1;
unkStruct->Unk08 = param2;
unkStruct->Unk00 = FUN_0200CA44((void (*)(u32, void *))FUN_0203B1A8, unkStruct, 0);
@@ -1670,3 +1681,119 @@ THUMB_FUNC BOOL ScrCmd_FacePlayer(struct ScriptContext *ctx) //0068
MOD05_021F1EC0(*unk1, unk0);
return FALSE;
}
THUMB_FUNC BOOL ScrCmd_GetPlayerPosition(struct ScriptContext *ctx) //0069
{
struct FieldSystem *fieldSystem = ctx->fieldSystem;
u16 *xVar = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
u16 *yVar = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
*xVar = GetPlayerXCoord(fieldSystem->playerAvatar);
*yVar = GetPlayerYCoord(fieldSystem->playerAvatar);
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;
}
THUMB_FUNC BOOL ScrCmd_GetPlayerDirection(struct ScriptContext *ctx) //01BD
{
u16 *directionVar = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
*directionVar = (u16)PlayerAvatar_GetFacingDirection(ctx->fieldSystem->playerAvatar);
return FALSE;
}
THUMB_FUNC BOOL ScrCmd_Unk006B(struct ScriptContext *ctx) //006B - todo: CheckPersonPosition?
{
u16 x = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
u16 y = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
u16 z = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
struct Vecx32 vector;
vector.x = FX32_CONST(x);
vector.y = FX32_CONST(y);
vector.z = FX32_CONST(z);
FUN_02058BB4(FUN_020553A0(ctx->fieldSystem->playerAvatar), &vector);
Camera_OffsetLookAtPosAndTarget(&vector, ctx->fieldSystem->cameraWork);
return FALSE;
}
THUMB_FUNC BOOL ScrCmd_KeepOverworldEvent(struct ScriptContext *ctx) //006C
{
u16 eventId = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
struct Vecx32 *vector = FUN_02058060(ctx->fieldSystem->unk34, eventId);
FUN_02058994(vector, ScriptReadByte(ctx));
return FALSE;
}
THUMB_FUNC BOOL ScrCmd_SetOverworldEventMovement(struct ScriptContext *ctx) //006D
{
u16 eventId = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
struct Vecx32 *vector = FUN_02058060(ctx->fieldSystem->unk34, eventId);
u16 movement = ScriptReadHalfword(ctx);
FUN_02058E90(vector, movement);
return FALSE;
}
THUMB_FUNC BOOL ScrCmd_GetOverworldEventMovement(struct ScriptContext *ctx) //02AD
{
u16 *variable = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
*variable = 0;
u16 eventId = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
struct Vecx32 *vector = FUN_02058060(ctx->fieldSystem->unk34, eventId);
if (vector != NULL)
{
*variable = FUN_02058480(vector);
}
return FALSE;
}
THUMB_FUNC BOOL ScrCmd_OverworldEventStopFollowing(struct ScriptContext *ctx) //006E
{
struct Vecx32 *vector = FUN_020580B4(ctx->fieldSystem->unk34, 0x30);
FUN_02058EB0(vector, 0xFE);
return FALSE;
}
THUMB_FUNC BOOL ScrCmd_Unk02AB(struct ScriptContext *ctx) //02AB
{
u16 *unk0 = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
struct SealCase *sealCase = Sav2_SealCase_get(ctx->fieldSystem->saveBlock2);
*unk0 = FUN_02029E0C(sealCase);
return FALSE;
}
THUMB_FUNC BOOL ScrCmd_GetSealCountFromId(struct ScriptContext *ctx) //0093
{
u16 sealId = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
u16 *variable = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
struct SealCase *sealCase = Sav2_SealCase_get(ctx->fieldSystem->saveBlock2);
*variable = FUN_02029E2C(sealCase, sealId);
return FALSE;
}
THUMB_FUNC BOOL ScrCmd_GiveSeals(struct ScriptContext *ctx) //0094
{
u16 sealId = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
u32 amount = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
struct SealCase *sealCase = Sav2_SealCase_get(ctx->fieldSystem->saveBlock2);
FUN_02029D44(sealCase, sealId, (s16)amount);
return FALSE;
}

View File

@@ -60,11 +60,11 @@ typedef s64 fx64c;
#define FX_FX16_TO_F32(x) ((f32)((x) / (f32)(1 << FX16_SHIFT)))
#define FX_F32_TO_FX16(x) ((fx16)(((x) > 0) ? \
(fx16)((x) * (1 << FX16_INT_SHIFT) + 0.5f ) : \
(fx16)((x) * (1 << FX16_INT_SHIFT) - 0.5f )))
((x) * (1 << FX16_INT_SHIFT) + 0.5f ) : \
((x) * (1 << FX16_INT_SHIFT) - 0.5f )))
#define FX_F32_TO_FX32(x) ((fx32)(((x) > 0) ? \
(fx32)((x) * (1 << FX32_INT_SHIFT) + 0.5f ) : \
(fx32)((x) * (1 << FX32_INT_SHIFT) - 0.5f )))
((x) * (1 << FX32_INT_SHIFT) + 0.5f ) : \
((x) * (1 << FX32_INT_SHIFT) - 0.5f )))
#define FX16_CONST(x) FX_F32_TO_FX16(x)
#define FX32_CONST(x) FX_F32_TO_FX32(x)

View File

@@ -126,6 +126,17 @@ BOOL ScrCmd_RemoveOverworldEvent(struct ScriptContext *ctx);
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);
BOOL ScrCmd_GetPlayerDirection(struct ScriptContext *ctx);
BOOL ScrCmd_Unk006B(struct ScriptContext *ctx);
BOOL ScrCmd_KeepOverworldEvent(struct ScriptContext *ctx);
BOOL ScrCmd_SetOverworldEventMovement(struct ScriptContext *ctx);
BOOL ScrCmd_GetOverworldEventMovement(struct ScriptContext *ctx);
BOOL ScrCmd_OverworldEventStopFollowing(struct ScriptContext *ctx);
BOOL ScrCmd_Unk02AB(struct ScriptContext *ctx);
BOOL ScrCmd_GetSealCountFromId(struct ScriptContext *ctx);
BOOL ScrCmd_GiveSeals(struct ScriptContext *ctx);
// scrcmd_mart.c
BOOL ScrCmd_NormalMart(struct ScriptContext * ctx);