mirror of
https://github.com/pret/pokediamond.git
synced 2026-09-29 11:56:39 -05:00
backport ScriptGetVar and ScriptGetVarPointer from HG
This commit is contained in:
@@ -57,7 +57,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 eventId);
|
||||
extern struct Vecx32 *FUN_02058060(u32 param0, u16 eventId);
|
||||
extern BOOL FUN_0205AEF0(u32 param0);
|
||||
extern void FUN_0205AEFC(u32 param0);
|
||||
extern void FUN_02058780(u32 param0);
|
||||
@@ -162,8 +162,7 @@ THUMB_FUNC static BOOL RunPauseTimer(struct ScriptContext *ctx)
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_DebugWatch(struct ScriptContext *ctx) //01F9
|
||||
{
|
||||
u16 wk = ScriptReadHalfword(ctx);
|
||||
VarGet(ctx->fieldSystem, wk);
|
||||
ScriptGetVar(ctx);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -284,7 +283,7 @@ THUMB_FUNC BOOL ScrCmd_CompareAddrToAddr(struct ScriptContext *ctx) //0010
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_CompareVarToValue(struct ScriptContext *ctx) //0011
|
||||
{
|
||||
u16 a = *GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 a = *ScriptGetVarPointer(ctx);
|
||||
u16 b = ScriptReadHalfword(ctx);
|
||||
ctx->comparisonResult = (u8)Compare(a, b);
|
||||
return FALSE;
|
||||
@@ -292,8 +291,8 @@ THUMB_FUNC BOOL ScrCmd_CompareVarToValue(struct ScriptContext *ctx) //0011
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_CompareVarToVar(struct ScriptContext *ctx) //0012
|
||||
{
|
||||
u16 *a = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *b = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *a = ScriptGetVarPointer(ctx);
|
||||
u16 *b = ScriptGetVarPointer(ctx);
|
||||
ctx->comparisonResult = (u8)Compare(*a, *b);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -454,8 +453,8 @@ THUMB_FUNC BOOL ScrCmd_CheckFlag(struct ScriptContext *ctx) //0020
|
||||
THUMB_FUNC BOOL ScrCmd_CheckFlagVar(struct ScriptContext *ctx) //0021
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16 *wk1 = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *wk2 = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *wk1 = ScriptGetVarPointer(ctx);
|
||||
u16 *wk2 = ScriptGetVarPointer(ctx);
|
||||
*wk2 = FlagCheck(fieldSystem, *wk1);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -463,7 +462,7 @@ THUMB_FUNC BOOL ScrCmd_CheckFlagVar(struct ScriptContext *ctx) //0021
|
||||
THUMB_FUNC BOOL ScrCmd_SetFlagVar(struct ScriptContext *ctx) //0022
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16 *wk = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *wk = ScriptGetVarPointer(ctx);
|
||||
FlagSet(fieldSystem, *wk);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -471,7 +470,7 @@ THUMB_FUNC BOOL ScrCmd_SetFlagVar(struct ScriptContext *ctx) //0022
|
||||
THUMB_FUNC BOOL ScrCmd_SetTrainerFlag(struct ScriptContext *ctx) //0023
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16 flag = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 flag = ScriptGetVar(ctx);
|
||||
TrainerFlagSet(fieldSystem, flag);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -479,7 +478,7 @@ THUMB_FUNC BOOL ScrCmd_SetTrainerFlag(struct ScriptContext *ctx) //0023
|
||||
THUMB_FUNC BOOL ScrCmd_ClearTrainerFlag(struct ScriptContext *ctx) //0024
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16 flag = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 flag = ScriptGetVar(ctx);
|
||||
TrainerFlagClear(fieldSystem, flag);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -487,46 +486,46 @@ THUMB_FUNC BOOL ScrCmd_ClearTrainerFlag(struct ScriptContext *ctx) //0024
|
||||
THUMB_FUNC BOOL ScrCmd_CheckTrainerFlag(struct ScriptContext *ctx) //0025
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16 flag = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 flag = ScriptGetVar(ctx);
|
||||
ctx->comparisonResult = TrainerFlagCheck(fieldSystem, flag);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_AddVar(struct ScriptContext *ctx) //0026
|
||||
{
|
||||
u16 *wk1 = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 wk2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *wk1 = ScriptGetVarPointer(ctx);
|
||||
u16 wk2 = ScriptGetVar(ctx);
|
||||
*wk1 = (u16)(*wk1 + wk2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_SubVar(struct ScriptContext *ctx) //0027
|
||||
{
|
||||
u16 *wk1 = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 wk2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *wk1 = ScriptGetVarPointer(ctx);
|
||||
u16 wk2 = ScriptGetVar(ctx);
|
||||
*wk1 = (u16)(*wk1 - wk2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_SetVar(struct ScriptContext *ctx) //0028
|
||||
{
|
||||
u16 *wk = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *wk = ScriptGetVarPointer(ctx);
|
||||
*wk = ScriptReadHalfword(ctx);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_CopyVar(struct ScriptContext *ctx) //0029
|
||||
{
|
||||
u16 *wk1 = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *wk2 = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *wk1 = ScriptGetVarPointer(ctx);
|
||||
u16 *wk2 = ScriptGetVarPointer(ctx);
|
||||
*wk1 = *wk2;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_SetOrCopyVar(struct ScriptContext *ctx) //002A - todo: better name
|
||||
{
|
||||
u16 *wk1 = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 wk2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *wk1 = ScriptGetVarPointer(ctx);
|
||||
u16 wk2 = ScriptGetVar(ctx);
|
||||
*wk1 = wk2;
|
||||
return FALSE;
|
||||
}
|
||||
@@ -540,8 +539,8 @@ THUMB_FUNC BOOL ScrCmd_Message(struct ScriptContext *ctx) //002B - todo: Message
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_MessageFrom(struct ScriptContext *ctx) //01FA - todo: MessageAllFromNarc?
|
||||
{
|
||||
u16 arc = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 msg = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 arc = ScriptGetVar(ctx);
|
||||
u16 msg = ScriptGetVar(ctx);
|
||||
struct MsgData *msgData = NewMsgDataFromNarc(1, NARC_MSGDATA_MSG, arc, 32);
|
||||
MOD05_ShowMessageInField(ctx, msgData, msg);
|
||||
DestroyMsgData(msgData);
|
||||
@@ -550,8 +549,8 @@ THUMB_FUNC BOOL ScrCmd_MessageFrom(struct ScriptContext *ctx) //01FA - todo: Mes
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_MessageFrom2(struct ScriptContext *ctx) //01FB - todo: MessageFromNarc?
|
||||
{
|
||||
u16 arc = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 msg = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 arc = ScriptGetVar(ctx);
|
||||
u16 msg = ScriptGetVar(ctx);
|
||||
struct MsgData *msgData = NewMsgDataFromNarc(1, NARC_MSGDATA_MSG, arc, 32);
|
||||
MOD05_021E2BD0(ctx, msgData, msg, 1, NULL);
|
||||
DestroyMsgData(msgData);
|
||||
@@ -610,7 +609,7 @@ THUMB_FUNC BOOL ScrCmd_Unk01FF(struct ScriptContext *ctx) //01FF
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u8 msg = ScriptReadByte(ctx);
|
||||
u16 poke = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 poke = ScriptGetVar(ctx);
|
||||
u16 sex = ScriptReadHalfword(ctx);
|
||||
u8 flag = ScriptReadByte(ctx);
|
||||
u8 unk = 0;
|
||||
@@ -653,7 +652,7 @@ THUMB_FUNC /*static*/ BOOL FUN_0203A2F0(struct ScriptContext *ctx)
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_Unk002D(struct ScriptContext *ctx) //002D - todo: MessageFromVar? MessageFlex?
|
||||
{
|
||||
u16 msg = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 msg = ScriptGetVar(ctx);
|
||||
MOD05_021E2BD0(ctx, ctx->msgData, (u8)msg, 1, NULL);
|
||||
SetupNativeScript(ctx, FUN_0203A2F0);
|
||||
return TRUE;
|
||||
@@ -662,7 +661,7 @@ THUMB_FUNC BOOL ScrCmd_Unk002D(struct ScriptContext *ctx) //002D - todo: Message
|
||||
THUMB_FUNC BOOL ScrCmd_Unk02C0(struct ScriptContext *ctx) //02C0
|
||||
{
|
||||
struct UnkStruct_0203A288 myLocalStruct;
|
||||
u16 msg = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 msg = ScriptGetVar(ctx);
|
||||
|
||||
MOD05_021E2BB8(&myLocalStruct, ctx);
|
||||
myLocalStruct.unk1 = 1;
|
||||
@@ -675,7 +674,7 @@ THUMB_FUNC BOOL ScrCmd_Unk02C0(struct ScriptContext *ctx) //02C0
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_Unk002E(struct ScriptContext *ctx) //002E - todo: MessageWait? MessageNoSkip?
|
||||
{
|
||||
u16 msg = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 msg = ScriptGetVar(ctx);
|
||||
MOD05_021E2BD0(ctx, ctx->msgData, (u8)msg, 0, NULL);
|
||||
SetupNativeScript(ctx, FUN_0203A2F0);
|
||||
return TRUE;
|
||||
@@ -729,7 +728,7 @@ THUMB_FUNC static BOOL FUN_0203A46C(struct ScriptContext *ctx)
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_WaitButtonABTime(struct ScriptContext *ctx) //0190
|
||||
{
|
||||
ctx->data[0] = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
ctx->data[0] = ScriptGetVar(ctx);
|
||||
SetupNativeScript(ctx, FUN_0203A4AC);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1212,8 +1211,8 @@ THUMB_FUNC BOOL ScrCmd_Unk029D(struct ScriptContext *ctx) //029D
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u32 *unk = FUN_02039438(fieldSystem, 0);
|
||||
u16 unk2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk3 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk2 = ScriptGetVar(ctx);
|
||||
u16 unk3 = ScriptGetVar(ctx);
|
||||
MOD05_021E1C4C(*unk, unk2, unk3);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1311,9 +1310,9 @@ THUMB_FUNC BOOL ScrCmd_Unk0045(struct ScriptContext *ctx) //0045
|
||||
THUMB_FUNC BOOL ScrCmd_Unk0046(struct ScriptContext *ctx) //0046 - todo: AddListOption?
|
||||
{
|
||||
u32 *unk = FUN_02039438(ctx->fieldSystem, 0);
|
||||
u16 unk2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk3 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk4 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk2 = ScriptGetVar(ctx);
|
||||
u16 unk3 = ScriptGetVar(ctx);
|
||||
u16 unk4 = ScriptGetVar(ctx);
|
||||
MOD05_021E1F58(*unk, (u8)unk2, (u8)unk3, (u8)unk4);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1350,7 +1349,7 @@ THUMB_FUNC BOOL ScrCmd_Unk02D0(struct ScriptContext *ctx) //02D0
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_Unk005E(struct ScriptContext *ctx) //005E - todo: ApplyMovement?
|
||||
{
|
||||
u16 unk = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk = ScriptGetVar(ctx);
|
||||
u32 unk2 = ScriptReadWord(ctx);
|
||||
|
||||
struct Vecx32 *unk3 = FUN_0203B120(ctx->fieldSystem, unk);
|
||||
@@ -1367,9 +1366,9 @@ THUMB_FUNC BOOL ScrCmd_Unk005E(struct ScriptContext *ctx) //005E - todo: ApplyMo
|
||||
THUMB_FUNC BOOL ScrCmd_Unk02A1(struct ScriptContext *ctx) //02A1
|
||||
{
|
||||
struct Vecx32 *unk3; //has to be defined first to match
|
||||
u16 unk0 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk0 = ScriptGetVar(ctx);
|
||||
u16 unk1 = ScriptGetVar(ctx);
|
||||
u16 unk2 = ScriptGetVar(ctx);
|
||||
|
||||
unk3 = FUN_0203B120(ctx->fieldSystem, unk0);
|
||||
|
||||
@@ -1627,11 +1626,10 @@ THUMB_FUNC BOOL ScrCmd_ReleaseEvent(struct ScriptContext *ctx) //0063
|
||||
THUMB_FUNC BOOL ScrCmd_AddOverworldEvent(struct ScriptContext *ctx) //0064
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16 eventId = ScriptReadHalfword(ctx);
|
||||
u16 eventVar = VarGet(ctx->fieldSystem, eventId);
|
||||
u16 eventId = ScriptGetVar(ctx);
|
||||
u32 unk0 = FUN_02034B64(fieldSystem);
|
||||
u32 unk1 = FUN_02034B6C(fieldSystem);
|
||||
u32 res = FUN_020575D4(fieldSystem->unk34, eventVar, unk0, *fieldSystem->mapId, unk1);
|
||||
u32 res = FUN_020575D4(fieldSystem->unk34, eventId, unk0, *fieldSystem->mapId, unk1);
|
||||
|
||||
GF_ASSERT(res);
|
||||
return FALSE;
|
||||
@@ -1640,16 +1638,15 @@ THUMB_FUNC BOOL ScrCmd_AddOverworldEvent(struct ScriptContext *ctx) //0064
|
||||
THUMB_FUNC BOOL ScrCmd_RemoveOverworldEvent(struct ScriptContext *ctx) //0065
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16 eventId = ScriptReadHalfword(ctx);
|
||||
u16 eventVar = VarGet(ctx->fieldSystem, eventId);
|
||||
FUN_02057688(FUN_02058060(fieldSystem->unk34, eventVar));
|
||||
u16 eventId = ScriptGetVar(ctx);
|
||||
FUN_02057688(FUN_02058060(fieldSystem->unk34, eventId));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_LockCamera(struct ScriptContext *ctx) //0066
|
||||
{
|
||||
u16 x = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 y = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 x = ScriptGetVar(ctx);
|
||||
u16 y = ScriptGetVar(ctx);
|
||||
struct Vecx32 **targetPtr = FUN_02039438(ctx->fieldSystem, 0xb);
|
||||
*targetPtr = FUN_0205753C(ctx->fieldSystem->unk34, x, y, 0, 0x2000, 0, *ctx->fieldSystem->mapId);
|
||||
FUN_02059D1C(*targetPtr);
|
||||
@@ -1690,8 +1687,8 @@ 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));
|
||||
u16 *xVar = ScriptGetVarPointer(ctx);
|
||||
u16 *yVar = ScriptGetVarPointer(ctx);
|
||||
|
||||
*xVar = GetPlayerXCoord(fieldSystem->playerAvatar);
|
||||
*yVar = GetPlayerYCoord(fieldSystem->playerAvatar);
|
||||
@@ -1702,11 +1699,11 @@ THUMB_FUNC BOOL ScrCmd_GetPlayerPosition(struct ScriptContext *ctx) //0069
|
||||
THUMB_FUNC BOOL ScrCmd_GetOverworldEventPosition(struct ScriptContext *ctx) //006A
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u32 eventId = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 eventId = ScriptGetVar(ctx);
|
||||
struct Vecx32 *position = FUN_02058060(fieldSystem->unk34, eventId);
|
||||
|
||||
u16 *xVar = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *yVar = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *xVar = ScriptGetVarPointer(ctx);
|
||||
u16 *yVar = ScriptGetVarPointer(ctx);
|
||||
|
||||
*xVar = FUN_02058B2C(position);
|
||||
*yVar = FUN_02058B4C(position);
|
||||
@@ -1715,7 +1712,7 @@ THUMB_FUNC BOOL ScrCmd_GetOverworldEventPosition(struct ScriptContext *ctx) //00
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GetPlayerDirection(struct ScriptContext *ctx) //01BD
|
||||
{
|
||||
u16 *directionVar = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *directionVar = ScriptGetVarPointer(ctx);
|
||||
|
||||
*directionVar = (u16)PlayerAvatar_GetFacingDirection(ctx->fieldSystem->playerAvatar);
|
||||
return FALSE;
|
||||
@@ -1723,9 +1720,9 @@ THUMB_FUNC BOOL ScrCmd_GetPlayerDirection(struct ScriptContext *ctx) //01BD
|
||||
|
||||
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));
|
||||
u16 x = ScriptGetVar(ctx);
|
||||
u16 y = ScriptGetVar(ctx);
|
||||
u16 z = ScriptGetVar(ctx);
|
||||
|
||||
struct Vecx32 vector;
|
||||
vector.x = FX32_CONST(x);
|
||||
@@ -1739,7 +1736,7 @@ THUMB_FUNC BOOL ScrCmd_Unk006B(struct ScriptContext *ctx) //006B - todo: CheckPe
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_KeepOverworldEvent(struct ScriptContext *ctx) //006C
|
||||
{
|
||||
u16 eventId = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 eventId = ScriptGetVar(ctx);
|
||||
struct Vecx32 *vector = FUN_02058060(ctx->fieldSystem->unk34, eventId);
|
||||
FUN_02058994(vector, ScriptReadByte(ctx));
|
||||
return FALSE;
|
||||
@@ -1747,7 +1744,7 @@ THUMB_FUNC BOOL ScrCmd_KeepOverworldEvent(struct ScriptContext *ctx) //006C
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_SetOverworldEventMovement(struct ScriptContext *ctx) //006D
|
||||
{
|
||||
u16 eventId = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 eventId = ScriptGetVar(ctx);
|
||||
struct Vecx32 *vector = FUN_02058060(ctx->fieldSystem->unk34, eventId);
|
||||
u16 movement = ScriptReadHalfword(ctx);
|
||||
FUN_02058E90(vector, movement);
|
||||
@@ -1756,9 +1753,9 @@ THUMB_FUNC BOOL ScrCmd_SetOverworldEventMovement(struct ScriptContext *ctx) //00
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GetOverworldEventMovement(struct ScriptContext *ctx) //02AD
|
||||
{
|
||||
u16 *variable = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *variable = ScriptGetVarPointer(ctx);
|
||||
*variable = 0;
|
||||
u16 eventId = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 eventId = ScriptGetVar(ctx);
|
||||
|
||||
struct Vecx32 *vector = FUN_02058060(ctx->fieldSystem->unk34, eventId);
|
||||
if (vector != NULL)
|
||||
@@ -1777,16 +1774,16 @@ THUMB_FUNC BOOL ScrCmd_OverworldEventStopFollowing(struct ScriptContext *ctx) //
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_Unk02AB(struct ScriptContext *ctx) //02AB
|
||||
{
|
||||
u16 *unk0 = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *variable = ScriptGetVarPointer(ctx);
|
||||
struct SealCase *sealCase = Sav2_SealCase_get(ctx->fieldSystem->saveBlock2);
|
||||
*unk0 = FUN_02029E0C(sealCase);
|
||||
*variable = 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));
|
||||
u16 sealId = ScriptGetVar(ctx);
|
||||
u16 *variable = ScriptGetVarPointer(ctx);
|
||||
struct SealCase *sealCase = Sav2_SealCase_get(ctx->fieldSystem->saveBlock2);
|
||||
*variable = FUN_02029E2C(sealCase, sealId);
|
||||
return FALSE;
|
||||
@@ -1794,8 +1791,8 @@ THUMB_FUNC BOOL ScrCmd_GetSealCountFromId(struct ScriptContext *ctx) //0093
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GiveSeals(struct ScriptContext *ctx) //0094
|
||||
{
|
||||
u16 sealId = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u32 amount = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 sealId = ScriptGetVar(ctx);
|
||||
u16 amount = ScriptGetVar(ctx);
|
||||
|
||||
struct SealCase *sealCase = Sav2_SealCase_get(ctx->fieldSystem->saveBlock2);
|
||||
FUN_02029D44(sealCase, sealId, (s16)amount);
|
||||
@@ -1804,11 +1801,11 @@ THUMB_FUNC BOOL ScrCmd_GiveSeals(struct ScriptContext *ctx) //0094
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GetPokemonForme(struct ScriptContext *ctx) //0095
|
||||
{
|
||||
u16 partyPosition = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *var = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 partyPosition = ScriptGetVar(ctx);
|
||||
u16 *variable = ScriptGetVarPointer(ctx);
|
||||
|
||||
struct PlayerParty *party = SavArray_PlayerParty_get(ctx->fieldSystem->saveBlock2);
|
||||
*var = GetMonUnownLetter(GetPartyMonByIndex(party, partyPosition));
|
||||
*variable = GetMonUnownLetter(GetPartyMonByIndex(party, partyPosition));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ extern void FUN_0208089C(struct Pokemon* pokemon, struct PlayerData* player, u32
|
||||
THUMB_FUNC BOOL ScrCmd_Unk0253(struct ScriptContext* ctx) //0253
|
||||
{
|
||||
struct ScriptState* state = SavArray_Flags_get(ctx->fieldSystem->saveBlock2);
|
||||
u16 unk = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk = ScriptGetVar(ctx);
|
||||
|
||||
if (unk == 0)
|
||||
{
|
||||
@@ -46,7 +46,7 @@ THUMB_FUNC BOOL ScrCmd_Unk0254(struct ScriptContext* ctx) //0254
|
||||
{
|
||||
void* unk = FUN_02022528(ctx->fieldSystem->saveBlock2);
|
||||
struct Pokemon* pokemon = AllocMonZeroed(32);
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
u16 eggs = FUN_0202C000(unk);
|
||||
if (eggs == 6) {
|
||||
@@ -87,7 +87,7 @@ THUMB_FUNC BOOL ScrCmd_Unk0255(struct ScriptContext* ctx) //0255
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_Unk0256(struct ScriptContext* ctx) //0256
|
||||
{
|
||||
u16 unk = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
|
||||
switch (unk)
|
||||
|
||||
@@ -13,7 +13,7 @@ extern BOOL FUN_0203BC04(struct ScriptContext* ctx);
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_Unk01C6(struct ScriptContext* ctx) //01C6 - todo: MoveInfo?
|
||||
{
|
||||
u16 unk = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk = ScriptGetVar(ctx);
|
||||
struct UnkStruct_02037CF0** unk_ret_ptr = FUN_02039438(ctx->fieldSystem, 19);
|
||||
*unk_ret_ptr = FUN_02037CF0(32, ctx->fieldSystem, (u8)unk);
|
||||
|
||||
@@ -26,7 +26,7 @@ THUMB_FUNC BOOL ScrCmd_Unk01C7(struct ScriptContext* ctx) //01C7 - todo: StoreMo
|
||||
struct UnkStruct_02037CF0** unk_ptr;
|
||||
u16* ret_ptr;
|
||||
|
||||
ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
ret_ptr = ScriptGetVarPointer(ctx);
|
||||
unk_ptr = FUN_02039438(ctx->fieldSystem, 19);
|
||||
GF_ASSERT(*unk_ptr != NULL);
|
||||
|
||||
@@ -49,8 +49,8 @@ THUMB_FUNC BOOL ScrCmd_Unk021E(struct ScriptContext* ctx) //021E
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_Unk021F(struct ScriptContext* ctx) //021F
|
||||
{
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 mon_idx = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(ctx->fieldSystem->saveBlock2);
|
||||
struct Pokemon* pokemon = GetPartyMonByIndex(party, mon_idx);
|
||||
void* unk_ptr = GetEligibleLevelUpMoves(pokemon, 32);
|
||||
@@ -89,7 +89,7 @@ THUMB_FUNC BOOL ScrCmd_Unk0220(struct ScriptContext* ctx) //0220
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_Unk0221(struct ScriptContext* ctx) //0221 - todo: RememberMove?
|
||||
{
|
||||
u16 mon_idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_idx = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(ctx->fieldSystem->saveBlock2);
|
||||
struct Pokemon* pokemon = GetPartyMonByIndex(party, mon_idx);
|
||||
void* unk_ptr = GetEligibleLevelUpMoves(pokemon, 32);
|
||||
@@ -100,8 +100,8 @@ THUMB_FUNC BOOL ScrCmd_Unk0221(struct ScriptContext* ctx) //0221 - todo: Remembe
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_Unk0224(struct ScriptContext* ctx) //0224 - todo: TeachMove?
|
||||
{
|
||||
u16 mon_idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_idx = ScriptGetVar(ctx);
|
||||
u16 unk2 = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(ctx->fieldSystem->saveBlock2);
|
||||
struct Pokemon* pokemon = GetPartyMonByIndex(party, mon_idx);
|
||||
|
||||
@@ -125,7 +125,7 @@ THUMB_FUNC BOOL ScrCmd_Unk0223(struct ScriptContext* ctx) //0223 - todo: Remembe
|
||||
struct UnkStruct_02037CF0* unk_sub;
|
||||
u16* ret_ptr;
|
||||
|
||||
ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
ret_ptr = ScriptGetVarPointer(ctx);
|
||||
unk = FUN_02039438(ctx->fieldSystem, 19);
|
||||
unk_sub = *unk;
|
||||
|
||||
@@ -150,7 +150,7 @@ THUMB_FUNC BOOL ScrCmd_Unk0225(struct ScriptContext* ctx) //0225 - todo: TeachMo
|
||||
struct UnkStruct_02037CF0* unk_sub;
|
||||
u16* ret_ptr;
|
||||
|
||||
ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
ret_ptr = ScriptGetVarPointer(ctx);
|
||||
unk = FUN_02039438(ctx->fieldSystem, 19);
|
||||
unk_sub = *unk;
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ THUMB_FUNC BOOL ScrCmd_ClearAmitySquareSteps(struct ScriptContext* ctx) //0215
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_CheckAmitySquareSteps(struct ScriptContext* ctx) //0216
|
||||
{
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
struct ScriptState* state = SavArray_Flags_get(ctx->fieldSystem->saveBlock2);
|
||||
|
||||
*ret_ptr = FUN_0205F55C(state);
|
||||
@@ -118,8 +118,8 @@ THUMB_FUNC BOOL ScrCmd_CheckAmitySquareSteps(struct ScriptContext* ctx) //0216
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GetAmitySquareAccessory(struct ScriptContext* ctx) //0217
|
||||
{
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 species = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 species = ScriptGetVar(ctx);
|
||||
u16 rand = (u16)(LCRandom() % 100);
|
||||
|
||||
u32 j;
|
||||
|
||||
@@ -16,7 +16,7 @@ extern void FUN_0204B4FC(struct FieldSystem*, void*);
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GetBerryTreeGrowth(struct ScriptContext* ctx) //017D
|
||||
{
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
void** unk = FUN_02039438(ctx->fieldSystem, 10);
|
||||
|
||||
*ret_ptr = FUN_0204B5FC(ctx->fieldSystem, *unk);
|
||||
@@ -27,7 +27,7 @@ THUMB_FUNC BOOL ScrCmd_GetBerryTreeGrowth(struct ScriptContext* ctx) //017D
|
||||
THUMB_FUNC BOOL ScrCmd_GetBerryTreeType(struct ScriptContext* ctx) //017E
|
||||
{
|
||||
void** unk = FUN_02039438(ctx->fieldSystem, 10);
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
*ret_ptr = FUN_0204B63C(ctx->fieldSystem, *unk);
|
||||
|
||||
@@ -37,7 +37,7 @@ THUMB_FUNC BOOL ScrCmd_GetBerryTreeType(struct ScriptContext* ctx) //017E
|
||||
THUMB_FUNC BOOL ScrCmd_GetBerryTreeMulch(struct ScriptContext* ctx) //017F
|
||||
{
|
||||
void** unk = FUN_02039438(ctx->fieldSystem, 10);
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
*ret_ptr = FUN_0204B660(ctx->fieldSystem, *unk);
|
||||
|
||||
@@ -47,7 +47,7 @@ THUMB_FUNC BOOL ScrCmd_GetBerryTreeMulch(struct ScriptContext* ctx) //017F
|
||||
THUMB_FUNC BOOL ScrCmd_GetBerryTreeWater(struct ScriptContext* ctx) //0180
|
||||
{
|
||||
void** unk = FUN_02039438(ctx->fieldSystem, 10);
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
*ret_ptr = FUN_0204B684(ctx->fieldSystem, *unk);
|
||||
|
||||
@@ -57,7 +57,7 @@ THUMB_FUNC BOOL ScrCmd_GetBerryTreeWater(struct ScriptContext* ctx) //0180
|
||||
THUMB_FUNC BOOL ScrCmd_GetBerryTreeAmount(struct ScriptContext* ctx) //0181
|
||||
{
|
||||
void** unk = FUN_02039438(ctx->fieldSystem, 10);
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
*ret_ptr = FUN_0204B6A4(ctx->fieldSystem, *unk);
|
||||
|
||||
@@ -67,7 +67,7 @@ THUMB_FUNC BOOL ScrCmd_GetBerryTreeAmount(struct ScriptContext* ctx) //0181
|
||||
THUMB_FUNC BOOL ScrCmd_SetBerryTreeMulch(struct ScriptContext* ctx) //0182
|
||||
{
|
||||
void** unk = FUN_02039438(ctx->fieldSystem, 10);
|
||||
u16 unk2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk2 = ScriptGetVar(ctx);
|
||||
|
||||
FUN_0204B57C(ctx->fieldSystem, *unk, unk2);
|
||||
|
||||
@@ -78,7 +78,7 @@ THUMB_FUNC BOOL ScrCmd_SetBerryTreeType(struct ScriptContext* ctx) //0183
|
||||
{
|
||||
void** unk = FUN_02039438(ctx->fieldSystem, 10);
|
||||
struct GameStats* unk2 = Sav2_GameStats_get(ctx->fieldSystem->saveBlock2);
|
||||
u16 unk3 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk3 = ScriptGetVar(ctx);
|
||||
|
||||
FUN_0204B5A8(ctx->fieldSystem, *unk, unk3);
|
||||
GameStats_Inc(unk2, 3);
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
extern void * FUN_02039438(struct FieldSystem* arg, u8 idx);
|
||||
|
||||
extern u32 MOD05_021E2950(struct FieldSystem* arg, u8, u8);
|
||||
extern MOD05_021E29B4();
|
||||
extern MOD05_021E29C8();
|
||||
extern void MOD05_021E29B4(u16 *unk);
|
||||
extern void MOD05_021E29C8(struct FieldSystem *arg, u16 *unk);
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_ShowCoinBox(struct ScriptContext * ctx) //0075
|
||||
{
|
||||
struct FieldSystem* sav_ptr = ctx->fieldSystem;
|
||||
u32 unk1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u32 unk2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u32 unk1 = ScriptGetVar(ctx);
|
||||
u32 unk2 = ScriptGetVar(ctx);
|
||||
u16 ** unk_ret_ptr = FUN_02039438(sav_ptr, 0x26);
|
||||
|
||||
u32 unk3 = MOD05_021E2950(ctx->fieldSystem, (u8)unk1, (u8)unk2);
|
||||
@@ -39,7 +39,7 @@ THUMB_FUNC BOOL ScrCmd_UpdateCoinBox(struct ScriptContext * ctx) //0077
|
||||
THUMB_FUNC BOOL ScrCmd_GetCoins(struct ScriptContext * ctx) //0078 - todo: CheckCoins instead?
|
||||
{
|
||||
u16 * coins_ptr = Sav2_PlayerData_GetCoinsAddr(ctx->fieldSystem->saveBlock2);
|
||||
u16 * ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 * ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
*ret_ptr = CheckCoins(coins_ptr);
|
||||
|
||||
@@ -49,7 +49,7 @@ THUMB_FUNC BOOL ScrCmd_GetCoins(struct ScriptContext * ctx) //0078 - todo: Check
|
||||
THUMB_FUNC BOOL ScrCmd_GiveCoins(struct ScriptContext * ctx) //0079
|
||||
{
|
||||
u16 * coins_ptr = Sav2_PlayerData_GetCoinsAddr(ctx->fieldSystem->saveBlock2);
|
||||
u16 amount = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 amount = ScriptGetVar(ctx);
|
||||
|
||||
GiveCoins(coins_ptr, amount);
|
||||
|
||||
@@ -59,7 +59,7 @@ THUMB_FUNC BOOL ScrCmd_GiveCoins(struct ScriptContext * ctx) //0079
|
||||
THUMB_FUNC BOOL ScrCmd_TakeCoinsImmediate(struct ScriptContext * ctx) //0080 - todo: TakeCoins instead?
|
||||
{
|
||||
u16 * coins_ptr = Sav2_PlayerData_GetCoinsAddr(ctx->fieldSystem->saveBlock2);
|
||||
u16 amount = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 amount = ScriptGetVar(ctx);
|
||||
|
||||
TakeCoins(coins_ptr, amount);
|
||||
|
||||
@@ -69,7 +69,7 @@ THUMB_FUNC BOOL ScrCmd_TakeCoinsImmediate(struct ScriptContext * ctx) //0080 - t
|
||||
THUMB_FUNC BOOL ScrCmd_TakeCoinsAddress(struct ScriptContext * ctx) //02A8 - todo: TakeCoinsVar instead?
|
||||
{
|
||||
u16 * coins_ptr = Sav2_PlayerData_GetCoinsAddr(ctx->fieldSystem->saveBlock2);
|
||||
u16 * amount = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 * amount = ScriptGetVarPointer(ctx);
|
||||
|
||||
TakeCoins(coins_ptr, *amount);
|
||||
|
||||
@@ -83,7 +83,7 @@ THUMB_FUNC BOOL ScrCmd_HasEnoughCoinsImmediate(struct ScriptContext * ctx) //027
|
||||
// Created, but discarded.
|
||||
struct PlayerData * player = Sav2_PlayerData_GetProfileAddr(sav2);
|
||||
u16 * coins_ptr = Sav2_PlayerData_GetCoinsAddr(fieldSystem->saveBlock2);
|
||||
u16 * ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 * ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
u32 amount = ScriptReadWord(ctx);
|
||||
u16 coins = CheckCoins(coins_ptr);
|
||||
@@ -107,9 +107,9 @@ THUMB_FUNC BOOL ScrCmd_HasEnoughCoinsAddress(struct ScriptContext * ctx) //02A9
|
||||
// Created, but discarded
|
||||
struct PlayerData * player = Sav2_PlayerData_GetProfileAddr(sav2);
|
||||
u16 * coins_ptr = Sav2_PlayerData_GetCoinsAddr(fieldSystem->saveBlock2);
|
||||
u16 * ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 * ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
u16 amount = *(u16*)GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 amount = *ScriptGetVarPointer(ctx);
|
||||
u16 coins = CheckCoins(coins_ptr);
|
||||
|
||||
if (coins < amount)
|
||||
@@ -127,8 +127,8 @@ THUMB_FUNC BOOL ScrCmd_HasEnoughCoinsAddress(struct ScriptContext * ctx) //02A9
|
||||
THUMB_FUNC BOOL ScrCmd_CanGiveCoins(struct ScriptContext * ctx) //0276
|
||||
{
|
||||
u16 * coins_ptr = Sav2_PlayerData_GetCoinsAddr(ctx->fieldSystem->saveBlock2);
|
||||
u16 * ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 amount = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 * ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 amount = ScriptGetVar(ctx);
|
||||
|
||||
*ret_ptr = (u16)CanGiveCoins(coins_ptr, amount);
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ THUMB_FUNC BOOL ScrCmd_GetDaycareStatus(struct ScriptContext* ctx) //016E
|
||||
{
|
||||
struct FieldSystem* fieldSystem = ctx->fieldSystem;
|
||||
struct SaveBlock2* sav2 = fieldSystem->saveBlock2;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
struct DayCare* daycare = SavArray_get(sav2, 8);
|
||||
|
||||
*ret_ptr = MOD05_021ED5EC(daycare);
|
||||
@@ -66,8 +66,8 @@ THUMB_FUNC BOOL ScrCmd_Unk01A4(struct ScriptContext* ctx) //01A4
|
||||
struct FieldSystem* fieldSystem = ctx->fieldSystem;
|
||||
struct ScrStrBufs** mgr = FUN_02039438(fieldSystem, 15);
|
||||
struct SaveBlock2* sav2 = fieldSystem->saveBlock2;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 idx = ScriptGetVar(ctx);
|
||||
struct DayCare* daycare = SavArray_get(sav2, 8);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
|
||||
@@ -81,8 +81,8 @@ THUMB_FUNC BOOL ScrCmd_Unk01AA(struct ScriptContext* ctx) //01AA
|
||||
struct FieldSystem* fieldSystem = ctx->fieldSystem;
|
||||
struct ScrStrBufs** mgr = FUN_02039438(fieldSystem, 15);
|
||||
struct SaveBlock2* sav2 = fieldSystem->saveBlock2;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 idx = ScriptGetVar(ctx);
|
||||
struct DayCare* daycare = SavArray_get(sav2, 8);
|
||||
|
||||
*ret_ptr = MOD05_021EC854(daycare, (u8)idx, *mgr);
|
||||
@@ -94,8 +94,8 @@ THUMB_FUNC BOOL ScrCmd_GetDaycareLevel(struct ScriptContext* ctx) //01AE
|
||||
{
|
||||
struct SaveBlock2* sav2 = ctx->fieldSystem->saveBlock2;
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 idx = ScriptGetVar(ctx);
|
||||
struct DayCare* daycare = SavArray_get(sav2, 8);
|
||||
|
||||
*ret_ptr = MOD05_021EC864(daycare, idx, *mgr);
|
||||
@@ -108,8 +108,8 @@ THUMB_FUNC BOOL ScrCmd_Unk01AF(struct ScriptContext* ctx) //01AF
|
||||
struct FieldSystem* fieldSystem = ctx->fieldSystem;
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u16 unused = ScriptReadHalfword(ctx);
|
||||
u16 idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 idx = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
|
||||
*ret_ptr = MOD05_021ED5C4(party, idx, *mgr);
|
||||
@@ -121,7 +121,7 @@ THUMB_FUNC BOOL ScrCmd_Unk01B0(struct ScriptContext* ctx) //01B0
|
||||
{
|
||||
struct FieldSystem* fieldSystem = ctx->fieldSystem;
|
||||
struct SaveBlock2* sav2 = fieldSystem->saveBlock2;
|
||||
u16 idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 idx = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
struct DayCare* daycare = SavArray_get(sav2, 8);
|
||||
|
||||
@@ -134,10 +134,10 @@ THUMB_FUNC BOOL ScrCmd_Unk01BC(struct ScriptContext* ctx) //01BC
|
||||
{
|
||||
struct SaveBlock2* sav2 = ctx->fieldSystem->saveBlock2;
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u16 idx1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 idx2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 idx3 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 idx4 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 idx1 = ScriptGetVar(ctx);
|
||||
u16 idx2 = ScriptGetVar(ctx);
|
||||
u16 idx3 = ScriptGetVar(ctx);
|
||||
u16 idx4 = ScriptGetVar(ctx);
|
||||
struct DayCare* daycare = Sav2_DayCare_get(sav2);
|
||||
|
||||
MOD05_021ED52C(daycare, (u8)idx1, (u8)idx2, (u8)idx3, (u8)idx4, *mgr);
|
||||
@@ -148,7 +148,7 @@ THUMB_FUNC BOOL ScrCmd_Unk01BC(struct ScriptContext* ctx) //01BC
|
||||
THUMB_FUNC BOOL ScrCmd_Unk01BE(struct ScriptContext* ctx) //01BE
|
||||
{
|
||||
struct SaveBlock2* sav2 = ctx->fieldSystem->saveBlock2;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
struct DayCare* daycare = SavArray_get(sav2, 8);
|
||||
|
||||
*ret_ptr = (u16)MOD05_021ED644(daycare);
|
||||
@@ -159,7 +159,7 @@ THUMB_FUNC BOOL ScrCmd_Unk01BE(struct ScriptContext* ctx) //01BE
|
||||
THUMB_FUNC BOOL ScrCmd_Unk01BF(struct ScriptContext* ctx) //01BF - todo: SaveEggPID?
|
||||
{
|
||||
struct SaveBlock2* sav2 = ctx->fieldSystem->saveBlock2;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
struct DayCare* daycare = SavArray_get(sav2, 8);
|
||||
|
||||
*ret_ptr = (u16)Sav2_DayCare_GetEggPID(daycare);
|
||||
@@ -169,7 +169,7 @@ THUMB_FUNC BOOL ScrCmd_Unk01BF(struct ScriptContext* ctx) //01BF - todo: SaveEgg
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_Unk01A5(struct ScriptContext* ctx) //01A5
|
||||
{
|
||||
u16* unused = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* unused = ScriptGetVarPointer(ctx);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -187,6 +187,6 @@ THUMB_FUNC BOOL ScrCmd_Unk01A7(struct ScriptContext* ctx) //01A7
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_Unk01AD(struct ScriptContext* ctx) //01AD
|
||||
{
|
||||
u16* unused = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* unused = ScriptGetVarPointer(ctx);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ const u8 UNK_020F457F[8] = {
|
||||
THUMB_FUNC BOOL ScrCmd_HasSinnohDex(struct ScriptContext* ctx) //0157
|
||||
{
|
||||
struct Pokedex* pokedex = Sav2_Pokedex_get(ctx->fieldSystem->saveBlock2);
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
*ret_ptr = (u16)Pokedex_GetSinnohDexFlag(pokedex);
|
||||
|
||||
@@ -49,7 +49,7 @@ THUMB_FUNC BOOL ScrCmd_GiveSinnohDex(struct ScriptContext* ctx) //0158
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_HasRunningShoes(struct ScriptContext* ctx) //0159
|
||||
{
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
void* unk_sav_ptr = FUN_02034E30(ctx->fieldSystem->saveBlock2);
|
||||
void* unk = FUN_02034E20(unk_sav_ptr);
|
||||
|
||||
@@ -70,8 +70,8 @@ THUMB_FUNC BOOL ScrCmd_GiveRunningShoes(struct ScriptContext* ctx) //015A
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_HasBadge(struct ScriptContext* ctx) //015B
|
||||
{
|
||||
u16 badge_no = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 badge_no = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
GF_ASSERT(badge_no < 8);
|
||||
struct PlayerData* player = Sav2_PlayerData_GetProfileAddr(ctx->fieldSystem->saveBlock2);
|
||||
|
||||
@@ -82,7 +82,7 @@ THUMB_FUNC BOOL ScrCmd_HasBadge(struct ScriptContext* ctx) //015B
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GiveBadge(struct ScriptContext* ctx) //015C
|
||||
{
|
||||
u16 badge_no = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 badge_no = ScriptGetVar(ctx);
|
||||
GF_ASSERT(badge_no < 8);
|
||||
struct PlayerData* player = Sav2_PlayerData_GetProfileAddr(ctx->fieldSystem->saveBlock2);
|
||||
|
||||
@@ -93,7 +93,7 @@ THUMB_FUNC BOOL ScrCmd_GiveBadge(struct ScriptContext* ctx) //015C
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_HasBag(struct ScriptContext* ctx) //015E
|
||||
{
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
struct ScriptState* state = SavArray_Flags_get(ctx->fieldSystem->saveBlock2);
|
||||
|
||||
*ret_ptr = (u16)FUN_0205ECE0(state);
|
||||
@@ -103,7 +103,7 @@ THUMB_FUNC BOOL ScrCmd_HasBag(struct ScriptContext* ctx) //015E
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GetTotalEarnedBadges(struct ScriptContext* ctx) //015D - todo: CountBadges?
|
||||
{
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
u16 i;
|
||||
u16 badges;
|
||||
@@ -132,7 +132,7 @@ THUMB_FUNC BOOL ScrCmd_GiveBag(struct ScriptContext* ctx) //015F
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_Unk0160(struct ScriptContext* ctx) //0160 - todo: HasPartner? CheckPartner?
|
||||
{
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
struct ScriptState* state = SavArray_Flags_get(ctx->fieldSystem->saveBlock2);
|
||||
|
||||
*ret_ptr = (u16)FUN_0205ED3C(state);
|
||||
@@ -160,7 +160,7 @@ THUMB_FUNC BOOL ScrCmd_Unk0162(struct ScriptContext* ctx) //0162 - todo: RemoveP
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_Unk0163(struct ScriptContext* ctx) //0163 - todo: GetSteps? CheckSteps? GetStepFlag? CheckStepFlag?
|
||||
{
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
struct ScriptState* state = SavArray_Flags_get(ctx->fieldSystem->saveBlock2);
|
||||
|
||||
*ret_ptr = (u16)FUN_0205ED6C(state);
|
||||
@@ -188,7 +188,7 @@ THUMB_FUNC BOOL ScrCmd_Unk0165(struct ScriptContext* ctx) //0165 - todo: ClearSt
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_CheckGameCompleted(struct ScriptContext* ctx) //0166
|
||||
{
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
struct ScriptState* state = SavArray_Flags_get(ctx->fieldSystem->saveBlock2);
|
||||
|
||||
*ret_ptr = (u16)FUN_0205ED0C(state);
|
||||
@@ -220,7 +220,7 @@ THUMB_FUNC BOOL ScrCmd_GetSetStrength(struct ScriptContext* ctx) //01CF - todo:
|
||||
FUN_0205F264(state, 0);
|
||||
break;
|
||||
case 2: //get whether strength is on or off
|
||||
ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
ret_ptr = ScriptGetVarPointer(ctx);
|
||||
*ret_ptr = (u16)FUN_0205F264(state, 2);
|
||||
break;
|
||||
default:
|
||||
@@ -246,7 +246,7 @@ THUMB_FUNC BOOL ScrCmd_GetSetFlash(struct ScriptContext* ctx) //01D0 - todo Flas
|
||||
FUN_0205F284(state);
|
||||
break;
|
||||
case 2: //get whether flash is on or off
|
||||
ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
ret_ptr = ScriptGetVarPointer(ctx);
|
||||
*ret_ptr = (u16)FUN_0205F294(state);
|
||||
break;
|
||||
default:
|
||||
@@ -272,7 +272,7 @@ THUMB_FUNC BOOL ScrCmd_GetSetDefog(struct ScriptContext* ctx) //01D1 - todo: Def
|
||||
FUN_0205F2B4(state);
|
||||
break;
|
||||
case 2: //get whether defog is on or off
|
||||
ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
ret_ptr = ScriptGetVarPointer(ctx);
|
||||
*ret_ptr = (u16)FUN_0205F2C4(state);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -15,7 +15,7 @@ THUMB_FUNC BOOL ScrCmd_CountFossils(struct ScriptContext * ctx) //01F1
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
|
||||
u16 *ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
u8 i;
|
||||
u16 total;
|
||||
@@ -30,8 +30,8 @@ THUMB_FUNC BOOL ScrCmd_CountFossils(struct ScriptContext * ctx) //01F1
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GetFossilPokemon(struct ScriptContext * ctx) //01F4
|
||||
{
|
||||
u16 *ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 fossilId = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 fossilId = ScriptGetVar(ctx);
|
||||
|
||||
*ret_ptr = 0;
|
||||
|
||||
@@ -50,9 +50,9 @@ THUMB_FUNC BOOL ScrCmd_GetFossilPokemon(struct ScriptContext * ctx) //01F4
|
||||
THUMB_FUNC BOOL ScrCmd_GetFossilMinimumAmount(struct ScriptContext * ctx) //01F5
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16 * ret_ptr1 = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 * ret_ptr2 = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 needed_amount = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 * ret_ptr1 = ScriptGetVarPointer(ctx);
|
||||
u16 * ret_ptr2 = ScriptGetVarPointer(ctx);
|
||||
u16 needed_amount = ScriptGetVar(ctx);
|
||||
|
||||
*ret_ptr1 = 0;
|
||||
*ret_ptr2 = 0;
|
||||
|
||||
@@ -7,9 +7,9 @@ THUMB_FUNC BOOL ScrCmd_GiveItem(struct ScriptContext* ctx) //007B
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
|
||||
u16 item_id = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 quantity = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* item_was_added = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 item_id = ScriptGetVar(ctx);
|
||||
u16 quantity = ScriptGetVar(ctx);
|
||||
u16* item_was_added = ScriptGetVarPointer(ctx);
|
||||
struct Bag* bag = Sav2_Bag_get(fieldSystem->saveBlock2);
|
||||
|
||||
*item_was_added = (u16)Bag_AddItem(bag, item_id, quantity, 4);
|
||||
@@ -21,9 +21,9 @@ THUMB_FUNC BOOL ScrCmd_TakeItem(struct ScriptContext* ctx) //007C
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
|
||||
u16 item_id = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 quantity = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* item_was_taken = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 item_id = ScriptGetVar(ctx);
|
||||
u16 quantity = ScriptGetVar(ctx);
|
||||
u16* item_was_taken = ScriptGetVarPointer(ctx);
|
||||
struct Bag* bag = Sav2_Bag_get(fieldSystem->saveBlock2);
|
||||
|
||||
*item_was_taken = (u16)Bag_TakeItem(bag, item_id, quantity, 4);
|
||||
@@ -35,9 +35,9 @@ THUMB_FUNC BOOL ScrCmd_HasSpaceForItem(struct ScriptContext* ctx) //007D
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
|
||||
u16 item_id = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 quantity = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* has_space = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 item_id = ScriptGetVar(ctx);
|
||||
u16 quantity = ScriptGetVar(ctx);
|
||||
u16* has_space = ScriptGetVarPointer(ctx);
|
||||
struct Bag* bag = Sav2_Bag_get(fieldSystem->saveBlock2);
|
||||
|
||||
*has_space = (u16)Bag_HasSpaceForItem(bag, item_id, quantity, 4);
|
||||
@@ -49,9 +49,9 @@ THUMB_FUNC BOOL ScrCmd_HasItem(struct ScriptContext* ctx) //007E
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
|
||||
u16 item_id = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 quantity = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* has_item = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 item_id = ScriptGetVar(ctx);
|
||||
u16 quantity = ScriptGetVar(ctx);
|
||||
u16* has_item = ScriptGetVarPointer(ctx);
|
||||
struct Bag* bag = Sav2_Bag_get(fieldSystem->saveBlock2);
|
||||
|
||||
*has_item = (u16)Bag_HasItem(bag, item_id, quantity, 11);
|
||||
@@ -63,8 +63,8 @@ THUMB_FUNC BOOL ScrCmd_ItemIdIsTMOrHM(struct ScriptContext* ctx) //007F
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
|
||||
u16 item_id = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* is_tm_or_hm = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 item_id = ScriptGetVar(ctx);
|
||||
u16* is_tm_or_hm = ScriptGetVarPointer(ctx);
|
||||
|
||||
*is_tm_or_hm = (u16)FUN_02054CB0(item_id);
|
||||
|
||||
@@ -75,8 +75,8 @@ THUMB_FUNC BOOL ScrCmd_GetItemPocketId(struct ScriptContext* ctx) //0080
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
|
||||
u16 item_id = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* pocket = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 item_id = ScriptGetVar(ctx);
|
||||
u16* pocket = ScriptGetVarPointer(ctx);
|
||||
|
||||
*pocket = (u16)GetItemAttr(item_id, ITEMATTR_POCKET, 11);
|
||||
|
||||
|
||||
@@ -346,7 +346,7 @@ const u16 *sSealsMartPointers[] = {
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_NormalMart(struct ScriptContext * ctx) //0147 - todo: Pokemart?
|
||||
{
|
||||
u16 whichMart = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 whichMart = ScriptGetVar(ctx);
|
||||
s32 param;
|
||||
u16 martItems[64];
|
||||
u8 martIdx = 0;
|
||||
@@ -400,7 +400,7 @@ THUMB_FUNC BOOL ScrCmd_NormalMart(struct ScriptContext * ctx) //0147 - todo: Pok
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_SpecialMart(struct ScriptContext * ctx) //0148
|
||||
{
|
||||
u16 whichMart = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 whichMart = ScriptGetVar(ctx);
|
||||
u32 sp0;
|
||||
|
||||
// Fakematch?
|
||||
@@ -415,7 +415,7 @@ THUMB_FUNC BOOL ScrCmd_SpecialMart(struct ScriptContext * ctx) //0148
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GoodsMart(struct ScriptContext * ctx) //0149
|
||||
{
|
||||
u16 whichMart = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 whichMart = ScriptGetVar(ctx);
|
||||
u32 sp0;
|
||||
|
||||
if (whichMart <= 1)
|
||||
@@ -429,7 +429,7 @@ THUMB_FUNC BOOL ScrCmd_GoodsMart(struct ScriptContext * ctx) //0149
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_SealsMart(struct ScriptContext * ctx) //014A
|
||||
{
|
||||
u16 whichMart = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 whichMart = ScriptGetVar(ctx);
|
||||
|
||||
MOD06_0223D3D0(ctx->taskManager, ctx->fieldSystem, sSealsMartPointers[whichMart], MART_SEALS, 0);
|
||||
return TRUE;
|
||||
|
||||
@@ -34,8 +34,8 @@ THUMB_FUNC BOOL ScrCmd_TakeMoneyAddress(struct ScriptContext * ctx) //01A3 - tod
|
||||
struct SaveBlock2 * sav2 = ScriptEnvironment_GetSav2Ptr(ctx->fieldSystem);
|
||||
struct PlayerData * player = Sav2_PlayerData_GetProfileAddr(sav2);
|
||||
|
||||
u32 amount = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
PlayerProfile_SubMoney(player, amount);
|
||||
u16 amount = ScriptGetVar(ctx);
|
||||
PlayerProfile_SubMoney(player, (u32)amount);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -44,7 +44,7 @@ THUMB_FUNC BOOL ScrCmd_HasEnoughMoneyImmediate(struct ScriptContext * ctx) //007
|
||||
{
|
||||
struct SaveBlock2 * sav2 = ScriptEnvironment_GetSav2Ptr(ctx->fieldSystem);
|
||||
struct PlayerData * player = Sav2_PlayerData_GetProfileAddr(sav2);
|
||||
u16 * ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 * ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
u32 amount = ScriptReadWord(ctx);
|
||||
u32 money = PlayerProfile_GetMoney(player);
|
||||
@@ -65,9 +65,9 @@ THUMB_FUNC BOOL ScrCmd_HasEnoughMoneyAddress(struct ScriptContext * ctx) //01AB
|
||||
{
|
||||
struct SaveBlock2 * sav2 = ScriptEnvironment_GetSav2Ptr(ctx->fieldSystem);
|
||||
struct PlayerData * player = Sav2_PlayerData_GetProfileAddr(sav2);
|
||||
u16 * ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 * ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
u32 amount = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 amount = ScriptGetVar(ctx);
|
||||
u32 money = PlayerProfile_GetMoney(player);
|
||||
|
||||
if (money < amount)
|
||||
@@ -85,8 +85,8 @@ THUMB_FUNC BOOL ScrCmd_HasEnoughMoneyAddress(struct ScriptContext * ctx) //01AB
|
||||
THUMB_FUNC BOOL ScrCmd_ShowMoneyBox(struct ScriptContext * ctx) //0072
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u32 unk1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u32 unk2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk1 = ScriptGetVar(ctx);
|
||||
u16 unk2 = ScriptGetVar(ctx);
|
||||
u32 *unk_ret_ptr = FUN_02039438(fieldSystem, 0x27);
|
||||
|
||||
*unk_ret_ptr = MOD05_021E27E8(ctx->fieldSystem, (u8)unk1, (u8)unk2);
|
||||
|
||||
@@ -59,7 +59,7 @@ THUMB_FUNC BOOL ScrCmd_GetPokemonName(struct ScriptContext* ctx) //00D0 - todo:
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
struct ScrStrBufs** mgr = FUN_02039438(fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 mon_idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_idx = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
struct Pokemon* mon = GetPartyMonByIndex(party, mon_idx);
|
||||
|
||||
@@ -73,7 +73,7 @@ THUMB_FUNC BOOL ScrCmd_GetItemName(struct ScriptContext* ctx) //00D1 - todo: Buf
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
struct ScrStrBufs** mgr = FUN_02039438(fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 item = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 item = ScriptGetVar(ctx);
|
||||
|
||||
BufferItemName(*mgr, idx, item);
|
||||
|
||||
@@ -85,7 +85,7 @@ THUMB_FUNC BOOL ScrCmd_GetPocketName(struct ScriptContext* ctx) //00D2 - todo: B
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
struct ScrStrBufs** mgr = FUN_02039438(fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 pocket = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 pocket = ScriptGetVar(ctx);
|
||||
|
||||
BufferPocketName(*mgr, idx, pocket);
|
||||
|
||||
@@ -97,7 +97,7 @@ THUMB_FUNC BOOL ScrCmd_GetTMHMMoveName(struct ScriptContext* ctx) //00D3 - todo:
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
struct ScrStrBufs** mgr = FUN_02039438(fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 tmhm = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 tmhm = ScriptGetVar(ctx);
|
||||
u16 move = TMHMGetMove(tmhm);
|
||||
|
||||
BufferMoveName(*mgr, idx, move);
|
||||
@@ -110,7 +110,7 @@ THUMB_FUNC BOOL ScrCmd_GetMoveName(struct ScriptContext* ctx) //00D4 - todo: Buf
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
struct ScrStrBufs** mgr = FUN_02039438(fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 move = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 move = ScriptGetVar(ctx);
|
||||
|
||||
BufferMoveName(*mgr, idx, move);
|
||||
|
||||
@@ -121,7 +121,7 @@ THUMB_FUNC BOOL ScrCmd_Unk00D5(struct ScriptContext* ctx) //00D5 - todo: BufferN
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 unk = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk = ScriptGetVar(ctx);
|
||||
u32 digits = FUN_02054C14(unk);
|
||||
|
||||
BufferIntegerAsString(*mgr, idx, unk, digits, 1, TRUE);
|
||||
@@ -133,7 +133,7 @@ THUMB_FUNC BOOL ScrCmd_Unk0280(struct ScriptContext* ctx) //0280 - todo: BufferN
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 unk = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk = ScriptGetVar(ctx);
|
||||
u8 unk2 = ScriptReadByte(ctx);
|
||||
u8 digits = ScriptReadByte(ctx);
|
||||
if (unk2 == 0)
|
||||
@@ -151,7 +151,7 @@ THUMB_FUNC BOOL ScrCmd_GetPokemonNickname(struct ScriptContext* ctx) //00D6 - to
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
struct ScrStrBufs** mgr = FUN_02039438(fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 mon_idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_idx = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
struct Pokemon* pokemon = GetPartyMonByIndex(party, mon_idx);
|
||||
|
||||
@@ -166,7 +166,7 @@ THUMB_FUNC BOOL ScrCmd_Unk0251(struct ScriptContext* ctx) //0251 - todo: BufferB
|
||||
struct PCStorage* pc = GetStoragePCPointer(fieldSystem->saveBlock2);
|
||||
struct ScrStrBufs** mgr = FUN_02039438(fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 box_mon_idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 box_mon_idx = ScriptGetVar(ctx);
|
||||
s32 box_no = box_mon_idx / 30;
|
||||
s32 slot_no = box_mon_idx % 30;
|
||||
struct BoxPokemon* box_mon = PCStorage_GetMonByIndexPair(pc, box_no, slot_no);
|
||||
@@ -180,7 +180,7 @@ THUMB_FUNC BOOL ScrCmd_GetPoketchAppName(struct ScriptContext* ctx) //00D7 - tod
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 app = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 app = ScriptGetVar(ctx);
|
||||
|
||||
BufferPoketchAppName(*mgr, idx, app);
|
||||
|
||||
@@ -191,7 +191,7 @@ THUMB_FUNC BOOL ScrCmd_GetTrainerClassName(struct ScriptContext* ctx) //00D8 - t
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 trainer_class = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 trainer_class = ScriptGetVar(ctx);
|
||||
|
||||
BufferTrainerClassName(*mgr, idx, trainer_class);
|
||||
|
||||
@@ -218,7 +218,7 @@ THUMB_FUNC BOOL ScrCmd_Unk00DA(struct ScriptContext* ctx) //00DA - todo: BufferP
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 msg_no = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 msg_no = ScriptGetVar(ctx);
|
||||
u16 unk1 = ScriptReadHalfword(ctx);
|
||||
u8 unk2 = ScriptReadByte(ctx);
|
||||
struct String* str = FUN_02040AE4(msg_no, 4);
|
||||
@@ -284,7 +284,7 @@ THUMB_FUNC BOOL ScrCmd_GetDecorationName(struct ScriptContext* ctx) //00DF - tod
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 decoration = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 decoration = ScriptGetVar(ctx);
|
||||
|
||||
BufferDecorationName(*mgr, idx, decoration);
|
||||
|
||||
@@ -295,7 +295,7 @@ THUMB_FUNC BOOL ScrCmd_GetUndergroundTrapName(struct ScriptContext* ctx) //00E0
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 underground_trap = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 underground_trap = ScriptGetVar(ctx);
|
||||
|
||||
BufferUndergroundTrapName(*mgr, idx, underground_trap);
|
||||
|
||||
@@ -306,7 +306,7 @@ THUMB_FUNC BOOL ScrCmd_GetUndergroundItemName(struct ScriptContext* ctx) //00E1
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 underground_item = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 underground_item = ScriptGetVar(ctx);
|
||||
|
||||
BufferUndergroundItemName(*mgr, idx, underground_item);
|
||||
|
||||
@@ -318,7 +318,7 @@ THUMB_FUNC BOOL ScrCmd_GetMapName(struct ScriptContext* ctx) //00E2 - todo: Buff
|
||||
struct String* str = String_ctor(22, 4);
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 map_no = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 map_no = ScriptGetVar(ctx);
|
||||
|
||||
FUN_02064E60(map_no, 4, str);
|
||||
BufferString(*mgr, idx, str, 0, 1, 2);
|
||||
@@ -331,8 +331,8 @@ THUMB_FUNC BOOL ScrCmd_GetBerryName(struct ScriptContext* ctx) //017B - todo: Bu
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 berry = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 berry = ScriptGetVar(ctx);
|
||||
u16 unk = ScriptGetVar(ctx);
|
||||
struct String* nut_name = GetNutName((u16)(berry - FIRST_BERRY_IDX), 32);
|
||||
|
||||
BufferString(*mgr, idx, nut_name, 0, unk < 2, 2);
|
||||
@@ -345,7 +345,7 @@ THUMB_FUNC BOOL ScrCmd_GetNatureName(struct ScriptContext* ctx) //017C - todo: B
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 nature = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 nature = ScriptGetVar(ctx);
|
||||
|
||||
BufferNatureName(*mgr, idx, nature);
|
||||
|
||||
@@ -356,7 +356,7 @@ THUMB_FUNC BOOL ScrCmd_GetFashionName(struct ScriptContext* ctx) //0261 - todo:
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 fashion = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 fashion = ScriptGetVar(ctx);
|
||||
|
||||
BufferFashionName(*mgr, idx, fashion);
|
||||
|
||||
@@ -383,8 +383,8 @@ THUMB_FUNC BOOL ScrCmd_GetPokemonMoveName(struct ScriptContext* ctx) //01CB - to
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
struct ScrStrBufs** mgr = FUN_02039438(fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 mon_idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_move_idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_idx = ScriptGetVar(ctx);
|
||||
u16 mon_move_idx = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
struct Pokemon* pokemon = GetPartyMonByIndex(party, mon_idx);
|
||||
u16 move = (u16)GetMonData(pokemon, MON_DATA_MOVE1 + mon_move_idx, NULL);
|
||||
@@ -398,7 +398,7 @@ THUMB_FUNC BOOL ScrCmd_GetRibbonName(struct ScriptContext* ctx) //0232 - todo: B
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u8 unk = (u8)VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u8 unk = (u8)ScriptGetVar(ctx);
|
||||
u16 ribbon = (u16)FUN_0207FC5C(unk, 3);
|
||||
|
||||
BufferRibbonNameOrDesc(*mgr, idx, ribbon);
|
||||
@@ -410,7 +410,7 @@ THUMB_FUNC BOOL ScrCmd_GetSealName(struct ScriptContext* ctx) //02B3 - todo: Buf
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 seal = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 seal = ScriptGetVar(ctx);
|
||||
|
||||
BufferSealName(*mgr, idx, (u16)(seal - 1));
|
||||
|
||||
@@ -421,7 +421,7 @@ THUMB_FUNC BOOL ScrCmd_GetItemNameWithIndefArticle(struct ScriptContext* ctx) //
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 item = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 item = ScriptGetVar(ctx);
|
||||
|
||||
BufferItemNameWithIndefArticle(*mgr, idx, item);
|
||||
|
||||
@@ -432,7 +432,7 @@ THUMB_FUNC BOOL ScrCmd_GetItemNamePlural(struct ScriptContext* ctx) //02C5 - tod
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 item = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 item = ScriptGetVar(ctx);
|
||||
|
||||
BufferItemNamePlural(*mgr, idx, item);
|
||||
|
||||
@@ -443,7 +443,7 @@ THUMB_FUNC BOOL ScrCmd_GetDecorationNameWithArticle(struct ScriptContext* ctx) /
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 decoration = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 decoration = ScriptGetVar(ctx);
|
||||
|
||||
BufferDecorationNameWithArticle(*mgr, idx, decoration);
|
||||
|
||||
@@ -454,7 +454,7 @@ THUMB_FUNC BOOL ScrCmd_GetUndergroundTrapNameWithArticle(struct ScriptContext* c
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 underground_trap = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 underground_trap = ScriptGetVar(ctx);
|
||||
|
||||
BufferUndergroundTrapNameWithArticle(*mgr, idx, underground_trap);
|
||||
|
||||
@@ -465,7 +465,7 @@ THUMB_FUNC BOOL ScrCmd_GetUndergroundItemNameWithArticle(struct ScriptContext* c
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 underground_item = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 underground_item = ScriptGetVar(ctx);
|
||||
|
||||
BufferUndergroundItemNameWithArticle(*mgr, idx, underground_item);
|
||||
|
||||
@@ -476,7 +476,7 @@ THUMB_FUNC BOOL ScrCmd_Unk02C9(struct ScriptContext* ctx) //02C9 - todo: BufferI
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 species = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 species = ScriptGetVar(ctx);
|
||||
u16 unused1 = ScriptReadHalfword(ctx);
|
||||
u8 unused2 = ScriptReadByte(ctx);
|
||||
|
||||
@@ -501,7 +501,7 @@ THUMB_FUNC BOOL ScrCmd_GetFashionNameWithArticle(struct ScriptContext* ctx) //02
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 fashion = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 fashion = ScriptGetVar(ctx);
|
||||
|
||||
BufferFashionNameWithArticle(*mgr, idx, fashion);
|
||||
|
||||
@@ -512,7 +512,7 @@ THUMB_FUNC BOOL ScrCmd_Unk02CC(struct ScriptContext* ctx) //02CC - todo: BufferI
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 trainer_class = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 trainer_class = ScriptGetVar(ctx);
|
||||
|
||||
BufferTrainerClassNameWithArticle(*mgr, idx, trainer_class);
|
||||
|
||||
@@ -523,7 +523,7 @@ THUMB_FUNC BOOL ScrCmd_GetSealNamePlural(struct ScriptContext* ctx) //02CD - tod
|
||||
{
|
||||
struct ScrStrBufs** mgr = FUN_02039438(ctx->fieldSystem, 15);
|
||||
u8 idx = ScriptReadByte(ctx);
|
||||
u16 seal = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 seal = ScriptGetVar(ctx);
|
||||
|
||||
BufferSealNamePlural(*mgr, idx, (u16)(seal - 1));
|
||||
|
||||
|
||||
@@ -17,10 +17,10 @@ THUMB_FUNC BOOL ScrCmd_GiveMon(struct ScriptContext* ctx) //0096 - todo: GivePok
|
||||
{
|
||||
u32 mapSec = MapHeader_GetMapSec(*(ctx->fieldSystem->mapId));
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16 species = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 level = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 item = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 * varPtr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 species = ScriptGetVar(ctx);
|
||||
u16 level = ScriptGetVar(ctx);
|
||||
u16 item = ScriptGetVar(ctx);
|
||||
u16 * varPtr = ScriptGetVarPointer(ctx);
|
||||
struct PlayerParty * party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
*varPtr = (u16)GiveMon(11, fieldSystem->saveBlock2, species, (u8)level, item, mapSec, 12);
|
||||
return FALSE;
|
||||
@@ -32,7 +32,7 @@ THUMB_FUNC BOOL ScrCmd_GetPartyMonSpecies(struct ScriptContext* ctx) //0198 - to
|
||||
u16* ret_ptr;
|
||||
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* mon_slot = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* mon_slot = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx)); //for some reason this is *required* for matching, cannot use ScriptGetVarPointer here
|
||||
ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
struct Pokemon* party_mon = GetPartyMonByIndex(party, *mon_slot);
|
||||
@@ -57,8 +57,8 @@ THUMB_FUNC BOOL ScrCmd_CheckPartyMonOTID(struct ScriptContext* ctx) //0199 - tod
|
||||
struct SaveBlock2* sav2 = ScriptEnvironment_GetSav2Ptr(fieldSystem);
|
||||
struct PlayerData* player = Sav2_PlayerData_GetProfileAddr(sav2);
|
||||
|
||||
u16* mon_slot = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* mon_slot = ScriptGetVarPointer(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
struct Pokemon* party_mon = GetPartyMonByIndex(party, *mon_slot);
|
||||
@@ -81,8 +81,8 @@ THUMB_FUNC BOOL ScrCmd_GiveEgg(struct ScriptContext* ctx) //0097
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
struct PlayerData* player = Sav2_PlayerData_GetProfileAddr(fieldSystem->saveBlock2);
|
||||
u16 species = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 species = ScriptGetVar(ctx);
|
||||
u16 unk = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
u8 party_count = (u8)GetPartyCount(party);
|
||||
|
||||
@@ -103,9 +103,9 @@ THUMB_FUNC BOOL ScrCmd_GiveEgg(struct ScriptContext* ctx) //0097
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_SetPartyMonMove(struct ScriptContext* ctx) //0098 - todo: ReplacePartyPokemonMove?
|
||||
{
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 move_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 move = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
u16 move_slot = ScriptGetVar(ctx);
|
||||
u16 move = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(ctx->fieldSystem->saveBlock2);
|
||||
|
||||
PartyMonSetMoveInSlot(party, mon_slot, move_slot, move);
|
||||
@@ -116,9 +116,9 @@ THUMB_FUNC BOOL ScrCmd_SetPartyMonMove(struct ScriptContext* ctx) //0098 - todo:
|
||||
THUMB_FUNC BOOL ScrCmd_PartyMonHasMove(struct ScriptContext* ctx) //0099
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 required_move = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 required_move = ScriptGetVar(ctx);
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
|
||||
|
||||
@@ -144,8 +144,8 @@ THUMB_FUNC BOOL ScrCmd_PartyMonHasMove(struct ScriptContext* ctx) //0099
|
||||
THUMB_FUNC BOOL ScrCmd_FindPartyMonWithMove(struct ScriptContext* ctx) //009A - todo: CheckMoveInParty?
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 required_move = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 required_move = ScriptGetVar(ctx);
|
||||
u8 party_count = (u8)GetPartyCount(SavArray_PlayerParty_get(fieldSystem->saveBlock2));
|
||||
|
||||
u8 i;
|
||||
@@ -173,8 +173,8 @@ THUMB_FUNC BOOL ScrCmd_FindPartyMonWithMove(struct ScriptContext* ctx) //009A -
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_SurvivePsn(struct ScriptContext* ctx) //01F7
|
||||
{
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(ctx->fieldSystem->saveBlock2);
|
||||
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
|
||||
|
||||
@@ -188,8 +188,8 @@ THUMB_FUNC BOOL ScrCmd_CountPartyMonsAtOrBelowLevel(struct ScriptContext* ctx) /
|
||||
u8 i;
|
||||
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 highest_level = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 highest_level = ScriptGetVar(ctx);
|
||||
party_count = (u8)GetPartyCount(SavArray_PlayerParty_get(fieldSystem->saveBlock2));
|
||||
|
||||
u8 mons;
|
||||
@@ -216,8 +216,8 @@ THUMB_FUNC BOOL ScrCmd_CountPartyMonsAtOrBelowLevel(struct ScriptContext* ctx) /
|
||||
THUMB_FUNC BOOL ScrCmd_GetPartyMonLevel(struct ScriptContext* ctx) //0278
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
|
||||
|
||||
@@ -235,8 +235,8 @@ THUMB_FUNC BOOL ScrCmd_GetPartyMonLevel(struct ScriptContext* ctx) //0278
|
||||
THUMB_FUNC BOOL ScrCmd_GetPartyMonNature(struct ScriptContext* ctx) //0212
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
u8 party_count = (u8)GetPartyCount(SavArray_PlayerParty_get(fieldSystem->saveBlock2));
|
||||
|
||||
if (mon_slot >= party_count)
|
||||
@@ -262,8 +262,8 @@ THUMB_FUNC BOOL ScrCmd_GetPartyMonNature(struct ScriptContext* ctx) //0212
|
||||
THUMB_FUNC BOOL ScrCmd_FindPartyMonWithNature(struct ScriptContext* ctx) //0213 - todo: CheckNatureInParty
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 required_nature = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 required_nature = ScriptGetVar(ctx);
|
||||
u8 party_count = (u8)GetPartyCount(SavArray_PlayerParty_get(fieldSystem->saveBlock2));
|
||||
|
||||
u8 i;
|
||||
@@ -290,8 +290,8 @@ THUMB_FUNC BOOL ScrCmd_FindPartyMonWithNature(struct ScriptContext* ctx) //0213
|
||||
THUMB_FUNC BOOL ScrCmd_GetPartyMonFriendship(struct ScriptContext* ctx) //01B9
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
|
||||
|
||||
@@ -302,8 +302,8 @@ THUMB_FUNC BOOL ScrCmd_GetPartyMonFriendship(struct ScriptContext* ctx) //01B9
|
||||
THUMB_FUNC BOOL ScrCmd_AddPartyMonFriendship(struct ScriptContext* ctx) //01BA
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16 friendship_to_add = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 friendship_to_add = ScriptGetVar(ctx);
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
u16 map_sec = MapHeader_GetMapSec(*ctx->fieldSystem->mapId);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
|
||||
@@ -346,8 +346,8 @@ THUMB_FUNC BOOL ScrCmd_AddPartyMonFriendship(struct ScriptContext* ctx) //01BA
|
||||
THUMB_FUNC BOOL ScrCmd_SubtractPartyMonFriendship(struct ScriptContext* ctx) //01BB
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16 friendship_to_deplete = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 friendship_to_deplete = ScriptGetVar(ctx);
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
|
||||
|
||||
@@ -368,9 +368,9 @@ THUMB_FUNC BOOL ScrCmd_SubtractPartyMonFriendship(struct ScriptContext* ctx) //0
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GetPartyMonContestCondition(struct ScriptContext* ctx) //0281
|
||||
{
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 contest_condition_id = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
u16 contest_condition_id = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(ctx->fieldSystem->saveBlock2);
|
||||
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
|
||||
|
||||
@@ -380,7 +380,7 @@ THUMB_FUNC BOOL ScrCmd_GetPartyMonContestCondition(struct ScriptContext* ctx) //
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GetLeadingPartyMonSlot(struct ScriptContext* ctx) //0247
|
||||
{
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
*ret_ptr = FUN_02054DEC(ctx->fieldSystem->saveBlock2);
|
||||
return FALSE;
|
||||
@@ -389,9 +389,9 @@ THUMB_FUNC BOOL ScrCmd_GetLeadingPartyMonSlot(struct ScriptContext* ctx) //0247
|
||||
THUMB_FUNC BOOL ScrCmd_GetPartyMonTypes(struct ScriptContext* ctx) //0248
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* type1 = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* type2 = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* type1 = ScriptGetVarPointer(ctx);
|
||||
u16* type2 = ScriptGetVarPointer(ctx);
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
|
||||
|
||||
@@ -403,7 +403,7 @@ THUMB_FUNC BOOL ScrCmd_GetPartyMonTypes(struct ScriptContext* ctx) //0248
|
||||
THUMB_FUNC BOOL ScrCmd_CountPartyMons(struct ScriptContext* ctx) //0177
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
|
||||
*ret_ptr = (u16)GetPartyCount(party);
|
||||
@@ -416,7 +416,7 @@ THUMB_FUNC BOOL ScrCmd_CountPartyMons_OmitEggs(struct ScriptContext* ctx) //019A
|
||||
s32 i;
|
||||
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
s32 party_count = GetPartyCount(SavArray_PlayerParty_get(fieldSystem->saveBlock2));
|
||||
|
||||
for (i = 0, non_egg_mons = 0; i < party_count; i++)
|
||||
@@ -442,8 +442,8 @@ THUMB_FUNC BOOL ScrCmd_CountAvailablePartyMons_IgnoreSlot(struct ScriptContext*
|
||||
s32 party_count;
|
||||
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
slot_to_ignore = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
slot_to_ignore = ScriptGetVar(ctx);
|
||||
party_count = GetPartyCount(SavArray_PlayerParty_get(fieldSystem->saveBlock2));
|
||||
|
||||
u32 available_mons;
|
||||
@@ -477,7 +477,7 @@ THUMB_FUNC BOOL ScrCmd_CountAvailablePartyAndPCMons(struct ScriptContext* ctx) /
|
||||
struct PCStorage* pc;
|
||||
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
pc = GetStoragePCPointer(fieldSystem->saveBlock2);
|
||||
party_count = GetPartyCount(SavArray_PlayerParty_get(fieldSystem->saveBlock2));
|
||||
|
||||
@@ -509,7 +509,7 @@ THUMB_FUNC BOOL ScrCmd_GetPartyEggCount(struct ScriptContext* ctx) //019D
|
||||
u32 eggs_in_party;
|
||||
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
party_count = GetPartyCount(SavArray_PlayerParty_get(fieldSystem->saveBlock2));
|
||||
|
||||
s32 i;
|
||||
@@ -535,7 +535,7 @@ THUMB_FUNC BOOL ScrCmd_CheckPartyForPokerus(struct ScriptContext* ctx) //0119
|
||||
u16 i;
|
||||
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
party_count = (u16)GetPartyCount(SavArray_PlayerParty_get(fieldSystem->saveBlock2));
|
||||
|
||||
for (i = 0, *ret_ptr = 0; i < party_count; i++)
|
||||
@@ -556,8 +556,8 @@ THUMB_FUNC BOOL ScrCmd_CheckPartyForPokerus(struct ScriptContext* ctx) //0119
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GetPartyMonGender(struct ScriptContext* ctx) //011A
|
||||
{
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(ctx->fieldSystem->saveBlock2);
|
||||
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
|
||||
|
||||
@@ -571,8 +571,8 @@ THUMB_FUNC BOOL ScrCmd_CountPartyMonMoves(struct ScriptContext* ctx) //01C8
|
||||
u8 moves;
|
||||
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
party_mon = GetPartyMonByIndex(party, mon_slot);
|
||||
|
||||
@@ -616,8 +616,8 @@ THUMB_FUNC BOOL ScrCmd_CountPartyMonMoves(struct ScriptContext* ctx) //01C8
|
||||
THUMB_FUNC BOOL ScrCmd_ForgetPartyMonMove(struct ScriptContext* ctx) //01C9
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 move_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
u16 move_slot = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
|
||||
|
||||
@@ -629,9 +629,9 @@ THUMB_FUNC BOOL ScrCmd_ForgetPartyMonMove(struct ScriptContext* ctx) //01C9
|
||||
THUMB_FUNC BOOL ScrCmd_GetPartyMonMove(struct ScriptContext* ctx) //01CA
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 move_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
u16 move_slot = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
|
||||
|
||||
@@ -642,8 +642,8 @@ THUMB_FUNC BOOL ScrCmd_GetPartyMonMove(struct ScriptContext* ctx) //01CA
|
||||
THUMB_FUNC BOOL ScrCmd_GetPartyMonHeldItem(struct ScriptContext* ctx) //01EE
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
|
||||
|
||||
@@ -654,7 +654,7 @@ THUMB_FUNC BOOL ScrCmd_GetPartyMonHeldItem(struct ScriptContext* ctx) //01EE
|
||||
THUMB_FUNC BOOL ScrCmd_ResetPartyMonHeldItem(struct ScriptContext* ctx) //01F0
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(fieldSystem->saveBlock2);
|
||||
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
|
||||
|
||||
@@ -667,8 +667,8 @@ THUMB_FUNC BOOL ScrCmd_ResetPartyMonHeldItem(struct ScriptContext* ctx) //01F0
|
||||
THUMB_FUNC BOOL ScrCmd_CheckPartyForSpecies(struct ScriptContext* ctx) //01C0
|
||||
{
|
||||
struct FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 species = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 species = ScriptGetVar(ctx);
|
||||
u8 party_count = (u8)GetPartyCount(SavArray_PlayerParty_get(fieldSystem->saveBlock2));
|
||||
|
||||
u8 i;
|
||||
@@ -694,8 +694,8 @@ THUMB_FUNC BOOL ScrCmd_CheckPartyForSpecies(struct ScriptContext* ctx) //01C0
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_CountPartyMonRibbons(struct ScriptContext* ctx) //022E
|
||||
{
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(ctx->fieldSystem->saveBlock2);
|
||||
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
|
||||
|
||||
@@ -720,7 +720,7 @@ THUMB_FUNC BOOL ScrCmd_CountTotalPartyRibbons(struct ScriptContext* ctx) //022F
|
||||
u16 ribbon_idx;
|
||||
u16 ribbons;
|
||||
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 party_count = (u16)GetPartyCount(SavArray_PlayerParty_get(ctx->fieldSystem->saveBlock2));
|
||||
party = SavArray_PlayerParty_get(ctx->fieldSystem->saveBlock2);
|
||||
|
||||
@@ -753,9 +753,9 @@ THUMB_FUNC BOOL ScrCmd_CountTotalPartyRibbons(struct ScriptContext* ctx) //022F
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_PartyMonHasRibbon(struct ScriptContext* ctx) //0230
|
||||
{
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 ribbon_idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
u16 ribbon_idx = ScriptGetVar(ctx);
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(ctx->fieldSystem->saveBlock2);
|
||||
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
|
||||
|
||||
@@ -765,8 +765,8 @@ THUMB_FUNC BOOL ScrCmd_PartyMonHasRibbon(struct ScriptContext* ctx) //0230
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GivePartyMonRibbon(struct ScriptContext* ctx) //0231
|
||||
{
|
||||
u16 mon_slot = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 ribbon_idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 mon_slot = ScriptGetVar(ctx);
|
||||
u16 ribbon_idx = ScriptGetVar(ctx);
|
||||
u8 mon_has_ribbon = TRUE;
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(ctx->fieldSystem->saveBlock2);
|
||||
struct Pokemon* party_mon = GetPartyMonByIndex(party, mon_slot);
|
||||
@@ -780,7 +780,7 @@ THUMB_FUNC BOOL ScrCmd_CheckPartyForBadEgg(struct ScriptContext* ctx) //02B7
|
||||
{
|
||||
u16 ribbon_idx;
|
||||
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
u16 party_count = (u16)GetPartyCount(SavArray_PlayerParty_get(ctx->fieldSystem->saveBlock2));
|
||||
struct PlayerParty* party = SavArray_PlayerParty_get(ctx->fieldSystem->saveBlock2);
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@ const u16 gGameCornerPrizes[19][2] = {
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GetPrizeItemIdAndCost(struct ScriptContext* ctx) //02A6
|
||||
{
|
||||
u16 idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* prize_item_id = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* prize_cost_in_coins = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 idx = ScriptGetVar(ctx);
|
||||
u16* prize_item_id = ScriptGetVarPointer(ctx);
|
||||
u16* prize_cost_in_coins = ScriptGetVarPointer(ctx);
|
||||
|
||||
*prize_item_id = gGameCornerPrizes[idx][0];
|
||||
*prize_cost_in_coins = gGameCornerPrizes[idx][1];
|
||||
|
||||
@@ -24,7 +24,7 @@ extern BOOL FUN_02005670(void);
|
||||
THUMB_FUNC BOOL ScrCmd_Unk02AE(struct ScriptContext *ctx) //02AE
|
||||
{
|
||||
u16 unk0 = ScriptReadHalfword(ctx);
|
||||
u16 *unk1 = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 *unk1 = ScriptGetVarPointer(ctx);
|
||||
|
||||
*unk1 = FUN_02005410(unk0);
|
||||
|
||||
@@ -116,21 +116,21 @@ THUMB_FUNC BOOL ScrCmd_Unk0058(struct ScriptContext* ctx) //0058
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_PlayFanfare(struct ScriptContext* ctx) //0049
|
||||
{
|
||||
u16 sound = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 sound = ScriptGetVar(ctx);
|
||||
PlaySE(sound);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_StopFanfare(struct ScriptContext* ctx) //004A
|
||||
{
|
||||
u16 unk = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk = ScriptGetVar(ctx);
|
||||
FUN_020054F0(unk, 0);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_PlayFanfareWait(struct ScriptContext* ctx) //004B
|
||||
{
|
||||
u16 unk = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk = ScriptGetVar(ctx);
|
||||
|
||||
ctx->data[0] = unk;
|
||||
SetupNativeScript(ctx, FUN_02041540);
|
||||
@@ -148,8 +148,8 @@ THUMB_FUNC BOOL FUN_02041540(struct ScriptContext* ctx)
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_PlayCry(struct ScriptContext* ctx) //004C
|
||||
{
|
||||
u16 unk0 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk0 = ScriptGetVar(ctx);
|
||||
u16 unused = ScriptGetVar(ctx);
|
||||
FUN_02005578(unk0);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -195,7 +195,7 @@ THUMB_FUNC BOOL FUN_020415CC(struct ScriptContext* ctx)
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_CheckChatotCry(struct ScriptContext* ctx) //0059
|
||||
{
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
struct SaveChatotSoundClip* chatotSoundClip = Sav2_Chatot_get(ctx->fieldSystem->saveBlock2);
|
||||
if (Chatot_checkCry(chatotSoundClip) == 1)
|
||||
@@ -212,7 +212,7 @@ THUMB_FUNC BOOL ScrCmd_CheckChatotCry(struct ScriptContext* ctx) //0059
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_StartChatotRecord(struct ScriptContext* ctx) //005A
|
||||
{
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
if (Chatot_startRecording() == 0)
|
||||
{
|
||||
@@ -250,8 +250,8 @@ THUMB_FUNC BOOL ScrCmd_Unk005D(struct ScriptContext* ctx) //005D - todo: LoadSpe
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_SetVolume(struct ScriptContext* ctx) //0283
|
||||
{
|
||||
u16 unk1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk1 = ScriptGetVar(ctx);
|
||||
u16 unk2 = ScriptGetVar(ctx);
|
||||
|
||||
FUN_0200488C(unk1, unk2);
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@ extern BOOL FUN_020260C4(void*, u16, u16);
|
||||
THUMB_FUNC BOOL ScrCmd_GiveSecretBaseDecoration(struct ScriptContext* ctx) //0083
|
||||
{
|
||||
struct SaveBlock2* sav2 = ctx->fieldSystem->saveBlock2;
|
||||
u16 unk1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk1 = ScriptGetVar(ctx);
|
||||
u16 unused = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
void* unk2 = FUN_02026CC4(sav2);
|
||||
|
||||
*ret_ptr = (u16)FUN_02025D6C(unk2, unk1);
|
||||
@@ -23,9 +23,9 @@ THUMB_FUNC BOOL ScrCmd_GiveSecretBaseDecoration(struct ScriptContext* ctx) //008
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_TakeSecretBaseDecoration(struct ScriptContext* ctx) //0084
|
||||
{
|
||||
u16 unused1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused1 = ScriptGetVar(ctx);
|
||||
u16 unused2 = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -33,9 +33,9 @@ THUMB_FUNC BOOL ScrCmd_TakeSecretBaseDecoration(struct ScriptContext* ctx) //008
|
||||
THUMB_FUNC BOOL ScrCmd_HasSpaceForDecoration(struct ScriptContext* ctx) //0085
|
||||
{
|
||||
struct SaveBlock2* sav2 = ctx->fieldSystem->saveBlock2;
|
||||
u16 unk1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk1 = ScriptGetVar(ctx);
|
||||
u16 unused = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
void* unk2 = FUN_02026CC4(sav2);
|
||||
|
||||
*ret_ptr = (u16)FUN_02025D94(unk2, unk1);
|
||||
@@ -45,9 +45,9 @@ THUMB_FUNC BOOL ScrCmd_HasSpaceForDecoration(struct ScriptContext* ctx) //0085
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GetDecorationCount(struct ScriptContext* ctx) //0086 - somewhat unsure on name, was originally CheckGoods
|
||||
{
|
||||
u16 unused1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused1 = ScriptGetVar(ctx);
|
||||
u16 unused2 = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -55,9 +55,9 @@ THUMB_FUNC BOOL ScrCmd_GetDecorationCount(struct ScriptContext* ctx) //0086 - so
|
||||
THUMB_FUNC BOOL ScrCmd_GiveUndergroundTrap(struct ScriptContext* ctx) //0087
|
||||
{
|
||||
struct SaveBlock2* sav2 = ctx->fieldSystem->saveBlock2;
|
||||
u16 unk1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk1 = ScriptGetVar(ctx);
|
||||
u16 unused = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
void* unk2 = FUN_02026CC4(sav2);
|
||||
|
||||
*ret_ptr = (u16)FUN_02026298(unk2, unk1);
|
||||
@@ -67,27 +67,27 @@ THUMB_FUNC BOOL ScrCmd_GiveUndergroundTrap(struct ScriptContext* ctx) //0087
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_TakeUndergroundTrap(struct ScriptContext* ctx) //0088
|
||||
{
|
||||
u16 unused1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused1 = ScriptGetVar(ctx);
|
||||
u16 unused2 = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_HasSpaceForTrap(struct ScriptContext* ctx) //0089
|
||||
{
|
||||
u16 unused1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused1 = ScriptGetVar(ctx);
|
||||
u16 unused2 = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GetTrapCount(struct ScriptContext* ctx) //008A
|
||||
{
|
||||
u16 unused1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused1 = ScriptGetVar(ctx);
|
||||
u16 unused2 = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -95,9 +95,9 @@ THUMB_FUNC BOOL ScrCmd_GetTrapCount(struct ScriptContext* ctx) //008A
|
||||
THUMB_FUNC BOOL ScrCmd_GiveTreasure(struct ScriptContext* ctx) //008B
|
||||
{
|
||||
struct SaveBlock2* sav2 = ctx->fieldSystem->saveBlock2;
|
||||
u16 unused1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused1 = ScriptGetVar(ctx);
|
||||
u16 unused2 = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
void* unused3 = FUN_02026CC4(sav2);
|
||||
|
||||
return FALSE;
|
||||
@@ -105,27 +105,27 @@ THUMB_FUNC BOOL ScrCmd_GiveTreasure(struct ScriptContext* ctx) //008B
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_TakeTreasure(struct ScriptContext* ctx) //008C
|
||||
{
|
||||
u16 unused1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused1 = ScriptGetVar(ctx);
|
||||
u16 unused2 = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_HasSpaceForTreasure(struct ScriptContext* ctx) //008D
|
||||
{
|
||||
u16 unused1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused1 = ScriptGetVar(ctx);
|
||||
u16 unused2 = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GetTreasureCount(struct ScriptContext* ctx) //008E
|
||||
{
|
||||
u16 unused1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused1 = ScriptGetVar(ctx);
|
||||
u16 unused2 = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -133,9 +133,9 @@ THUMB_FUNC BOOL ScrCmd_GetTreasureCount(struct ScriptContext* ctx) //008E
|
||||
THUMB_FUNC BOOL ScrCmd_GiveUndergroundSphere(struct ScriptContext* ctx) //008F
|
||||
{
|
||||
struct SaveBlock2* sav2 = ctx->fieldSystem->saveBlock2;
|
||||
u16 unk1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk1 = ScriptGetVar(ctx);
|
||||
u16 unk2 = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
void* unk3 = FUN_02026CC4(sav2);
|
||||
|
||||
*ret_ptr = (u16)FUN_020260C4(unk3, unk1, unk2);
|
||||
@@ -145,27 +145,27 @@ THUMB_FUNC BOOL ScrCmd_GiveUndergroundSphere(struct ScriptContext* ctx) //008F
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_TakeUndergroundSphere(struct ScriptContext* ctx) //0090
|
||||
{
|
||||
u16 unused1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused1 = ScriptGetVar(ctx);
|
||||
u16 unused2 = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_HasSpaceForSphere(struct ScriptContext* ctx) //0091
|
||||
{
|
||||
u16 unused1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused1 = ScriptGetVar(ctx);
|
||||
u16 unused2 = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
THUMB_FUNC BOOL ScrCmd_GetSphereCount(struct ScriptContext* ctx) //0092
|
||||
{
|
||||
u16 unused1 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused2 = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unused1 = ScriptGetVar(ctx);
|
||||
u16 unused2 = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -18,42 +18,42 @@ THUMB_FUNC BOOL ScrCmd_UnionGroup(struct ScriptContext* ctx) //021D
|
||||
switch (option)
|
||||
{
|
||||
case 0: { //check if group ID exists
|
||||
u16 unk_var = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk_var = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
*ret_ptr = (u16)FUN_02028828(unk_sav_ptr, unk_var);
|
||||
return FALSE;
|
||||
}
|
||||
case 1: { //check if group ID is accessible
|
||||
u16 unk_var = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk_var = ScriptGetVar(ctx);
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
*ret_ptr = (u16)FUN_02028840(unk_sav_ptr, unk_var);
|
||||
return FALSE;
|
||||
}
|
||||
case 2: { //writes group ID to string buffer
|
||||
u16 unk_var = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk_var = ScriptGetVar(ctx);
|
||||
u16 idx = ScriptGetVar(ctx);
|
||||
|
||||
BufferEasyChatWord(*mgr, sav2, unk_var, idx, 0);
|
||||
break;
|
||||
}
|
||||
case 3: { //writes group leader name to string buffer
|
||||
u16 unk_var = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 unk_var = ScriptGetVar(ctx);
|
||||
u16 idx = ScriptGetVar(ctx);
|
||||
|
||||
BufferEasyChatWord(*mgr, sav2, unk_var, idx, 1);
|
||||
break;
|
||||
}
|
||||
case 4: { //opens keyboard, 2 if group id exists, 1 if cancel, 0 otherwise
|
||||
u16* unk_str_ptr = FUN_020287A8(unk_sav_ptr, 0, 0);
|
||||
u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16* ret_ptr = ScriptGetVarPointer(ctx);
|
||||
|
||||
FUN_020385CC(ctx->taskManager, 5, 0, 7, 0, unk_str_ptr, ret_ptr);
|
||||
return TRUE;
|
||||
}
|
||||
case 5: { //enter in group id (whatever this means, needs more investigation)
|
||||
u16 src_idx = VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
u16 src_idx = ScriptGetVar(ctx);
|
||||
BOOL unk_bool = FUN_02028828(unk_sav_ptr, 1);
|
||||
|
||||
FUN_02028700(unk_sav_ptr, src_idx, 1);
|
||||
|
||||
@@ -8,6 +8,17 @@ extern u16 VarGet(struct FieldSystem *fieldSystem, u16);
|
||||
extern u16* GetVarPointer(struct FieldSystem *fieldSystem, u16);
|
||||
extern struct SaveBlock2* ScriptEnvironment_GetSav2Ptr(struct FieldSystem *fieldSystem);
|
||||
|
||||
static inline u16 ScriptGetVar(struct ScriptContext* ctx)
|
||||
{
|
||||
return VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
}
|
||||
|
||||
static inline u16 *ScriptGetVarPointer(struct ScriptContext* ctx)
|
||||
{
|
||||
return GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx));
|
||||
}
|
||||
|
||||
|
||||
struct UnkStruct_0203A288 {
|
||||
u8 unk0;
|
||||
u8 unk1;
|
||||
|
||||
Reference in New Issue
Block a user