Document field_task.c

This commit is contained in:
Rachel 2024-11-02 11:32:33 -07:00
parent b83538a1c5
commit f252defec9
79 changed files with 954 additions and 967 deletions

View File

@ -3,7 +3,7 @@
exec 1>&2
# Run clang-format on staged files; abort the commit if any files are changed
if ! git clang-format ; then
if ! git clang-format --extensions .c,.h,.cpp,.hpp ; then
echo "linting made changes to source files; aborting commit"
exit 1
fi

View File

@ -139,7 +139,7 @@
.long \arg1-.-4
.endm
.macro ScrCmd_018 arg0, arg1
.macro ScrCmd_Unused018 arg0, arg1
.short 24
.byte \arg0
.long \arg1-.-4

View File

@ -18,6 +18,8 @@ enum HeapId {
HEAP_ID_DISTORTION_WORLD_WARP = 30,
HEAP_ID_FIELD_TASK = 32,
HEAP_ID_OPTIONS_MENU = 38,
HEAP_ID_CHOOSE_STARTER_APP = 47,
@ -28,10 +30,11 @@ enum HeapId {
};
enum HeapSize {
HEAP_SIZE_POKETCH_MAIN = 0xc000,
HEAP_SIZE_POKETCH_APP = 0xc000,
HEAP_SIZE_POKETCH_MAIN = 0xC000,
HEAP_SIZE_POKETCH_APP = 0xC000,
HEAP_SIZE_FIELDMAP = 0x1C000,
HEAP_SIZE_FIELD_TASK = 0x4000,
HEAP_SIZE_CHOOSE_STARTER_APP = 0x40000,
HEAP_SIZE_LIBRARY_TV = 0x40000,

View File

@ -8,10 +8,10 @@
#include "overlay_manager.h"
#include "savedata.h"
void FieldSystem_StartFieldMap(FieldSystem *fieldSystem);
void FieldSystem_StartFieldMapInner(FieldSystem *fieldSystem);
void FieldSystem_FlagNotRunningFieldMap(FieldSystem *fieldSystem);
BOOL FieldSystem_HasParentProcess(FieldSystem *fieldSystem);
BOOL FieldSystem_IsRunningFieldMap(FieldSystem *fieldSystem);
BOOL FieldSystem_IsRunningFieldMapInner(FieldSystem *fieldSystem);
BOOL FieldSystem_HasChildProcess(FieldSystem *fieldSystem);
void FieldSystem_StartChildProcess(FieldSystem *fieldSystem, const OverlayManagerTemplate *overlayTemplate, void *overlayArgs);
void FieldSystem_PauseProcessing(void);

View File

@ -7,31 +7,31 @@
typedef struct FieldTask FieldTask;
typedef BOOL (*FieldTaskFunc)(FieldTask *);
typedef BOOL (*FieldTaskFunc)(FieldTask *); // Return TRUE on completion; return FALSE while still running.
struct FieldTask {
FieldTask *unk_00;
FieldTaskFunc unk_04;
int unk_08;
void *unk_0C;
int unk_10;
void *unk_14;
FieldSystem *fieldSystem;
u32 *unk_1C;
FieldTask *prev;
FieldTaskFunc func;
int state;
void *env;
int dummy10;
void *dummy14;
FieldSystem *fieldSys;
int *dummy1C;
};
FieldTask *FieldTask_Set(FieldSystem *fieldSystem, FieldTaskFunc param1, void *param2);
void FieldTask_Change(FieldTask *param0, FieldTaskFunc param1, void *param2);
FieldTask *FieldTask_Start(FieldTask *param0, FieldTaskFunc param1, void *param2);
BOOL sub_02050958(FieldSystem *fieldSystem);
BOOL sub_020509A4(FieldSystem *fieldSystem);
BOOL sub_020509B4(FieldSystem *fieldSystem);
void sub_020509D4(FieldSystem *fieldSystem);
BOOL sub_020509DC(FieldSystem *fieldSystem);
void sub_02050A38(FieldTask *param0, const OverlayManagerTemplate *param1, void *param2);
FieldSystem *TaskManager_FieldSystem(FieldTask *param0);
void *TaskManager_Environment(FieldTask *param0);
int *FieldTask_GetState(FieldTask *param0);
u32 sub_02050A6C(FieldTask *param0);
FieldTask *FieldSystem_CreateTask(FieldSystem *fieldSys, FieldTaskFunc taskFunc, void *taskEnv);
void FieldTask_InitJump(FieldTask *task, FieldTaskFunc taskFunc, void *taskEnv);
FieldTask *FieldTask_InitCall(FieldTask *task, FieldTaskFunc taskFunc, void *taskEnv);
BOOL FieldTask_Run(FieldSystem *fieldSys);
BOOL FieldSystem_IsRunningTask(FieldSystem *fieldSys);
BOOL FieldSystem_IsRunningApplication(FieldSystem *fieldSys);
void FieldSystem_StartFieldMap(FieldSystem *fieldSys);
BOOL FieldSystem_IsRunningFieldMap(FieldSystem *fieldSys);
void FieldTask_RunApplication(FieldTask *task, const OverlayManagerTemplate *overlayTemplate, void *overlayArgs);
FieldSystem *FieldTask_GetFieldSystem(FieldTask *task);
void *FieldTask_GetEnv(FieldTask *task);
int *FieldTask_GetState(FieldTask *task);
u32 FieldTask_GetDummy1CVal(FieldTask *task);
#endif // POKEPLATINUM_FIELD_TASK_H

View File

@ -446,7 +446,7 @@ static void FieldSystem_SetLocationToUnionRoomExit(FieldSystem *fieldSystem)
static BOOL FieldTask_LoadNewGameSpawn(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
int *state = FieldTask_GetState(taskMan);
switch (*state) {
@ -472,12 +472,12 @@ void FieldSystem_SetLoadNewGameSpawnTask(FieldSystem *fieldSystem)
{
fieldSystem->mapLoadType = MAP_LOAD_TYPE_OVERWORLD;
FieldSystem_InitNewGameState(fieldSystem);
FieldTask_Set(fieldSystem, FieldTask_LoadNewGameSpawn, NULL);
FieldSystem_CreateTask(fieldSystem, FieldTask_LoadNewGameSpawn, NULL);
}
static BOOL FieldTask_LoadSavedGameMap(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
VarsFlags *varsFlags = SaveData_GetVarsFlags(fieldSystem->saveData);
int *state = FieldTask_GetState(taskMan);
@ -523,7 +523,7 @@ static BOOL FieldTask_LoadSavedGameMap(FieldTask *taskMan)
case 3:
return TRUE;
case 4:
if (!(sub_020509B4(fieldSystem))) {
if (!(FieldSystem_IsRunningApplication(fieldSystem))) {
(*state) = 1;
}
break;
@ -535,13 +535,13 @@ static BOOL FieldTask_LoadSavedGameMap(FieldTask *taskMan)
void FieldSystem_SetLoadSavedGameMapTask(FieldSystem *fieldSystem)
{
fieldSystem->mapLoadType = MAP_LOAD_TYPE_OVERWORLD;
FieldTask_Set(fieldSystem, FieldTask_LoadSavedGameMap, NULL);
FieldSystem_CreateTask(fieldSystem, FieldTask_LoadSavedGameMap, NULL);
}
static BOOL FieldTask_LoadMapFromError(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
MapChangeFromErrorData *errorData = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeFromErrorData *errorData = FieldTask_GetEnv(taskMan);
VarsFlags *varsFlags = SaveData_GetVarsFlags(fieldSystem->saveData);
int *state = FieldTask_GetState(taskMan);
@ -606,13 +606,13 @@ void FieldSystem_StartLoadMapFromErrorTask(FieldSystem *fieldSystem)
Location_Set(&errorData->location, 466, -1, 8, 14, 0);
fieldSystem->mapLoadType = MAP_LOAD_TYPE_UNION;
FieldTask_Set(fieldSystem, FieldTask_LoadMapFromError, errorData);
FieldSystem_CreateTask(fieldSystem, FieldTask_LoadMapFromError, errorData);
}
static BOOL FieldTask_ChangeMap(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
MapChangeData *mapChangeData = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeData *mapChangeData = FieldTask_GetEnv(taskMan);
Location *location = &mapChangeData->nextLocation;
switch (mapChangeData->state) {
@ -650,13 +650,13 @@ void FieldSystem_StartChangeMapTask(FieldTask *taskMan, const Location *nextLoca
mapChangeData->state = 0;
mapChangeData->nextLocation = *nextLocation;
FieldTask_Start(taskMan, FieldTask_ChangeMap, mapChangeData);
FieldTask_InitCall(taskMan, FieldTask_ChangeMap, mapChangeData);
}
static BOOL FieldTask_ChangeMapSub(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
MapChangeSubData *mapChangeSub = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeSubData *mapChangeSub = FieldTask_GetEnv(taskMan);
switch (mapChangeSub->state) {
case 0:
@ -682,7 +682,7 @@ static BOOL FieldTask_ChangeMapSub(FieldTask *taskMan)
void FieldTask_ChangeMapByLocation(FieldTask *taskMan, const Location *nextLocation)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeSubData *mapChangeSub = Heap_AllocFromHeapAtEnd(11, sizeof(MapChangeSubData));
if (FieldSystem_HasParentProcess(fieldSystem)) {
@ -693,7 +693,7 @@ void FieldTask_ChangeMapByLocation(FieldTask *taskMan, const Location *nextLocat
mapChangeSub->state = 0;
mapChangeSub->nextLocation = *nextLocation;
FieldTask_Start(taskMan, FieldTask_ChangeMapSub, mapChangeSub);
FieldTask_InitCall(taskMan, FieldTask_ChangeMapSub, mapChangeSub);
}
void FieldTask_ChangeMapToLocation(FieldTask *taskMan, int param1, int param2, int param3, int param4, int param5)
@ -706,8 +706,8 @@ void FieldTask_ChangeMapToLocation(FieldTask *taskMan, int param1, int param2, i
static BOOL FieldTask_ChangeMapFull(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
MapChangeSubData *mapChangeSub = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeSubData *mapChangeSub = FieldTask_GetEnv(taskMan);
Location *nextLocation = &mapChangeSub->nextLocation;
switch (mapChangeSub->state) {
@ -744,7 +744,7 @@ void FieldTask_StartMapChangeFull(FieldTask *taskMan, int mapId, int param2, int
mapChangeSub->state = 0;
Location_Set(&mapChangeSub->nextLocation, mapId, param2, x, z, dir);
FieldTask_Start(taskMan, FieldTask_ChangeMapFull, mapChangeSub);
FieldTask_InitCall(taskMan, FieldTask_ChangeMapFull, mapChangeSub);
}
void FieldTask_StartMapChangeFly(FieldSystem *fieldSystem, int param1, int param2, int param3, int param4, int param5)
@ -759,7 +759,7 @@ void FieldTask_StartMapChangeFly(FieldSystem *fieldSystem, int param1, int param
mapChangeData->task = NULL;
mapChangeData->location = location;
FieldTask_Set(fieldSystem, FieldTask_MapChangeFly, mapChangeData);
FieldSystem_CreateTask(fieldSystem, FieldTask_MapChangeFly, mapChangeData);
}
void FieldTask_ChangeMapChangeFly(FieldTask *taskMan, int param1, int param2, int param3, int param4, int param5)
@ -774,13 +774,13 @@ void FieldTask_ChangeMapChangeFly(FieldTask *taskMan, int param1, int param2, in
mapChangeData->task = NULL;
mapChangeData->location = location;
FieldTask_Change(taskMan, FieldTask_MapChangeFly, mapChangeData);
FieldTask_InitJump(taskMan, FieldTask_MapChangeFly, mapChangeData);
}
static BOOL FieldTask_MapChangeFly(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
MapChangeFlyData *mapChangeData = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeFlyData *mapChangeData = FieldTask_GetEnv(taskMan);
Location *location = &mapChangeData->location;
switch (mapChangeData->state) {
@ -814,7 +814,7 @@ static BOOL FieldTask_MapChangeFly(FieldTask *taskMan)
static void FieldTask_FinishFly(FieldTask *taskMan)
{
FieldTask_Start(taskMan, FieldTask_FinishFieldMapFly, NULL);
FieldTask_InitCall(taskMan, FieldTask_FinishFieldMapFly, NULL);
}
static BOOL FieldTask_FinishFieldMapFly(FieldTask *taskMan)
@ -835,14 +835,14 @@ static BOOL FieldTask_FinishFieldMapFly(FieldTask *taskMan)
static void FieldTask_StartFadeInFly(FieldTask *taskMan)
{
MapChangeFlyData *mapChangeData = TaskManager_Environment(taskMan);
FieldTask_Start(taskMan, FieldTask_StartFadeInFlySub, mapChangeData);
MapChangeFlyData *mapChangeData = FieldTask_GetEnv(taskMan);
FieldTask_InitCall(taskMan, FieldTask_StartFadeInFlySub, mapChangeData);
}
static BOOL FieldTask_StartFadeInFlySub(FieldTask *taskMan)
{
int *state = FieldTask_GetState(taskMan);
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
switch (*state) {
case 0:
@ -863,8 +863,8 @@ static BOOL FieldTask_StartFadeInFlySub(FieldTask *taskMan)
static void FieldTask_FadeInFly(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
MapChangeFlyData *mapChangeData = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeFlyData *mapChangeData = FieldTask_GetEnv(taskMan);
if (!FieldSystem_HasParentProcess(fieldSystem)) {
GF_ASSERT(FALSE);
@ -872,12 +872,12 @@ static void FieldTask_FadeInFly(FieldTask *taskMan)
}
mapChangeData->task = FieldTask_InitFlyLandingTask(fieldSystem, PlayerAvatar_Gender(fieldSystem->playerAvatar));
FieldTask_Start(taskMan, FieldTask_WaitFadeInFly, mapChangeData);
FieldTask_InitCall(taskMan, FieldTask_WaitFadeInFly, mapChangeData);
}
static BOOL FieldTask_WaitFadeInFly(FieldTask *taskMan)
{
MapChangeFlyData *mapChangeData = TaskManager_Environment(taskMan);
MapChangeFlyData *mapChangeData = FieldTask_GetEnv(taskMan);
if (ov6_02245CF0(mapChangeData->task) == 1) {
ov6_02245CFC(mapChangeData->task);
@ -896,13 +896,13 @@ void FieldTask_ChangeMapChangeByDig(FieldTask *taskMan, const Location *location
mapChangeData->task = NULL;
mapChangeData->location = *location;
FieldTask_Change(taskMan, FieldTask_MapChangeByDig, mapChangeData);
FieldTask_InitJump(taskMan, FieldTask_MapChangeByDig, mapChangeData);
}
static BOOL FieldTask_MapChangeByDig(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
MapChangeDigData *mapChangeData = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeDigData *mapChangeData = FieldTask_GetEnv(taskMan);
Location *location = &mapChangeData->location;
switch (mapChangeData->state) {
@ -944,7 +944,7 @@ static BOOL FieldTask_MapChangeByDig(FieldTask *taskMan)
static void FieldTask_StartFinishFieldMapDig(FieldTask *taskMan)
{
FieldTask_Start(taskMan, FieldTask_FinishFieldMapDig, NULL);
FieldTask_InitCall(taskMan, FieldTask_FinishFieldMapDig, NULL);
}
static BOOL FieldTask_FinishFieldMapDig(FieldTask *taskMan)
@ -965,15 +965,15 @@ static BOOL FieldTask_FinishFieldMapDig(FieldTask *taskMan)
static void FieldTask_StartFadeInDig(FieldTask *taskMan)
{
MapChangeDigData *mapChangeData = TaskManager_Environment(taskMan);
FieldTask_Start(taskMan, FieldTask_FadeInDig, mapChangeData);
MapChangeDigData *mapChangeData = FieldTask_GetEnv(taskMan);
FieldTask_InitCall(taskMan, FieldTask_FadeInDig, mapChangeData);
}
static BOOL FieldTask_FadeInDig(FieldTask *taskMan)
{
int *state = FieldTask_GetState(taskMan);
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
MapChangeDigData *mapChangeData = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeDigData *mapChangeData = FieldTask_GetEnv(taskMan);
switch (*state) {
case 0:
@ -994,8 +994,8 @@ static BOOL FieldTask_FadeInDig(FieldTask *taskMan)
static void sub_02053E5C(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
MapChangeDigData *mapChangeData = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeDigData *mapChangeData = FieldTask_GetEnv(taskMan);
if (!FieldSystem_HasParentProcess(fieldSystem)) {
GF_ASSERT(FALSE);
@ -1003,13 +1003,13 @@ static void sub_02053E5C(FieldTask *taskMan)
}
void *v2 = ov6_022472C8(fieldSystem, 4, mapChangeData->unk_04);
FieldTask_Start(taskMan, ov6_022472E8, v2);
FieldTask_InitCall(taskMan, ov6_022472E8, v2);
}
static BOOL FieldTask_MapChangeWarp(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
MapChangeWarpData *mapChangeWarpData = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeWarpData *mapChangeWarpData = FieldTask_GetEnv(taskMan);
Location *nextLocation = &mapChangeWarpData->nextLocation;
switch (mapChangeWarpData->state) {
@ -1064,7 +1064,7 @@ void FieldSystem_StartMapChangeWarpTask(FieldSystem *fieldSystem, int param1, in
Location_Set(&nextLocation, param1, param2, 0, 0, PlayerAvatar_GetDir(fieldSystem->playerAvatar));
mapChangeWarpData->nextLocation = nextLocation;
FieldTask_Set(fieldSystem, FieldTask_MapChangeWarp, mapChangeWarpData);
FieldSystem_CreateTask(fieldSystem, FieldTask_MapChangeWarp, mapChangeWarpData);
}
void *sub_02053FAC(FieldSystem *fieldSystem)
@ -1126,13 +1126,13 @@ void FieldTask_SetUndergroundMapChange(FieldSystem *fieldSystem)
return;
}
FieldTask_Set(fieldSystem, FieldMapChange_GetMapChangeUndergroundTask(fieldSystem), mapChangeUndergroundData);
FieldSystem_CreateTask(fieldSystem, FieldMapChange_GetMapChangeUndergroundTask(fieldSystem), mapChangeUndergroundData);
}
BOOL FieldTask_MapChangeToUnderground(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
MapChangeUndergroundData *mapChangeUndergroundData = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeUndergroundData *mapChangeUndergroundData = FieldTask_GetEnv(taskMan);
switch (mapChangeUndergroundData->state) {
case 0:
@ -1250,8 +1250,8 @@ BOOL FieldTask_MapChangeToUnderground(FieldTask *taskMan)
BOOL FieldTask_MapChangeFromUnderground(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
MapChangeUndergroundData *mapChangeUndergroundData = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeUndergroundData *mapChangeUndergroundData = FieldTask_GetEnv(taskMan);
int v2 = 0;
switch (mapChangeUndergroundData->state) {
@ -1323,8 +1323,8 @@ FieldTaskFunc FieldMapChange_GetMapChangeUndergroundTask(const FieldSystem *fiel
static BOOL sub_0205444C(FieldTask *taskMan, int param1)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
MapChangeUndergroundData *mapChangeUndergroundData = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeUndergroundData *mapChangeUndergroundData = FieldTask_GetEnv(taskMan);
BOOL ret = 0;
switch (mapChangeUndergroundData->unk_04) {
@ -1346,8 +1346,8 @@ static BOOL sub_0205444C(FieldTask *taskMan, int param1)
static BOOL sub_02054494(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
MapChangeSubData *mapChangeSub = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeSubData *mapChangeSub = FieldTask_GetEnv(taskMan);
switch (mapChangeSub->state) {
case 0:
@ -1370,7 +1370,7 @@ static BOOL sub_02054494(FieldTask *taskMan)
void sub_020544F0(FieldTask *taskMan, const Location *nextLocation)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeSubData *mapChangeData = Heap_AllocFromHeapAtEnd(11, sizeof(MapChangeSubData));
if (FieldSystem_HasParentProcess(fieldSystem)) {
@ -1381,13 +1381,13 @@ void sub_020544F0(FieldTask *taskMan, const Location *nextLocation)
mapChangeData->state = 0;
mapChangeData->nextLocation = *nextLocation;
FieldTask_Start(taskMan, sub_02054494, mapChangeData);
FieldTask_InitCall(taskMan, sub_02054494, mapChangeData);
}
static BOOL sub_02054538(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
MapChangeUnionData *mapChangeData = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeUnionData *mapChangeData = FieldTask_GetEnv(taskMan);
int *state = FieldTask_GetState(taskMan);
Location *v3 = &mapChangeData->location;
@ -1440,14 +1440,14 @@ void sub_020545EC(FieldSystem *fieldSystem)
sub_0205C2E0(fieldSystem->unk_80);
fieldSystem->mapLoadType = MAP_LOAD_TYPE_OVERWORLD;
FieldTask_Set(fieldSystem, sub_02054538, mapChangeData);
FieldSystem_CreateTask(fieldSystem, sub_02054538, mapChangeData);
fieldSystem->unk_7C = NULL;
}
static BOOL sub_02054648(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
MapChangeUnionData *mapChangeData = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeUnionData *mapChangeData = FieldTask_GetEnv(taskMan);
int *state = FieldTask_GetState(taskMan);
Location *v3 = &mapChangeData->location;
@ -1494,7 +1494,7 @@ static BOOL sub_02054648(FieldTask *taskMan)
void sub_02054708(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
Location *location = FieldOverworldState_GetSpecialLocation(SaveData_GetFieldOverworldState(fieldSystem->saveData));
MapChangeUnionData *mapChangeData = Heap_AllocFromHeapAtEnd(11, sizeof(MapChangeUnionData));
@ -1507,13 +1507,13 @@ void sub_02054708(FieldTask *taskMan)
fieldSystem->unk_80 = sub_0205C22C(fieldSystem->unk_7C);
fieldSystem->mapLoadType = MAP_LOAD_TYPE_UNION;
FieldTask_Start(taskMan, sub_02054648, mapChangeData);
FieldTask_InitCall(taskMan, sub_02054648, mapChangeData);
}
static BOOL FieldTask_ChangeMapColosseum(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
MapChangeData *mapChangeData = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
MapChangeData *mapChangeData = FieldTask_GetEnv(taskMan);
Location *location = &mapChangeData->nextLocation;
switch (mapChangeData->state) {
@ -1547,7 +1547,7 @@ static BOOL FieldTask_ChangeMapColosseum(FieldTask *taskMan)
void sub_02054800(FieldTask *taskMan, int mapId, int param2, int x, int z, int param5)
{
Location nextLocation;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
Location *location = FieldOverworldState_GetSpecialLocation(SaveData_GetFieldOverworldState(fieldSystem->saveData));
Location_SetToPlayerLocation(location, fieldSystem);
@ -1561,12 +1561,12 @@ void sub_02054800(FieldTask *taskMan, int mapId, int param2, int x, int z, int p
mapChangeData->state = 0;
mapChangeData->nextLocation = nextLocation;
FieldTask_Start(taskMan, FieldTask_ChangeMapColosseum, mapChangeData);
FieldTask_InitCall(taskMan, FieldTask_ChangeMapColosseum, mapChangeData);
}
void sub_02054864(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
Location *location = FieldOverworldState_GetSpecialLocation(SaveData_GetFieldOverworldState(fieldSystem->saveData));
fieldSystem->mapLoadType = MAP_LOAD_TYPE_OVERWORLD;

View File

@ -285,7 +285,7 @@ void FieldMenu_Init(FieldSystem *fieldSystem)
sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetDir(fieldSystem->playerAvatar));
}
FieldTask_Set(fieldSystem, sub_0203AC44, menu);
FieldSystem_CreateTask(fieldSystem, sub_0203AC44, menu);
}
void sub_0203AA78(FieldSystem *fieldSystem)
@ -299,7 +299,7 @@ void sub_0203AA78(FieldSystem *fieldSystem)
sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetDir(fieldSystem->playerAvatar));
}
FieldTask_Set(fieldSystem, sub_0203AC44, menu);
FieldSystem_CreateTask(fieldSystem, sub_0203AC44, menu);
}
void sub_0203AABC(FieldSystem *fieldSystem)
@ -313,7 +313,7 @@ void sub_0203AABC(FieldSystem *fieldSystem)
sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetDir(fieldSystem->playerAvatar));
}
FieldTask_Set(fieldSystem, sub_0203AC44, menu);
FieldSystem_CreateTask(fieldSystem, sub_0203AC44, menu);
}
void sub_0203AB00(FieldSystem *fieldSystem)
@ -340,7 +340,7 @@ void sub_0203AB00(FieldSystem *fieldSystem)
menu->unk_224 = sub_0203ABD0(fieldSystem);
}
FieldTask_Change(fieldSystem->taskManager, sub_0203AC44, menu);
FieldTask_InitJump(fieldSystem->taskManager, sub_0203AC44, menu);
}
static FieldMenu *FieldMenu_Alloc(void)
@ -413,8 +413,8 @@ static BOOL sub_0203AC44(FieldTask *taskMan)
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
switch (menu->state) {
case FIELD_MENU_STATE_INIT:
@ -449,7 +449,7 @@ static BOOL sub_0203AC44(FieldTask *taskMan)
FieldMenu_Evolve(taskMan);
break;
case FIELD_MENU_STATE_12:
if (sub_020509DC(fieldSystem)) {
if (FieldSystem_IsRunningFieldMap(fieldSystem)) {
MapObjectMan_PauseAllMovement(fieldSystem->mapObjMan);
sub_0203ADFC(taskMan);
sub_0203B094(taskMan);
@ -458,7 +458,7 @@ static BOOL sub_0203AC44(FieldTask *taskMan)
}
break;
case FIELD_MENU_STATE_8:
if (sub_020509DC(fieldSystem)) {
if (FieldSystem_IsRunningFieldMap(fieldSystem)) {
ov5_021D1744(1);
menu->state = FIELD_MENU_STATE_9;
}
@ -472,7 +472,7 @@ static BOOL sub_0203AC44(FieldTask *taskMan)
}
break;
case FIELD_MENU_STATE_10:
if (sub_020509DC(fieldSystem)) {
if (FieldSystem_IsRunningFieldMap(fieldSystem)) {
MapObjectMan_PauseAllMovement(fieldSystem->mapObjMan);
ov5_021D1744(1);
menu->state = FIELD_MENU_STATE_11;
@ -480,7 +480,7 @@ static BOOL sub_0203AC44(FieldTask *taskMan)
break;
case FIELD_MENU_STATE_11:
if (IsScreenTransitionDone()) {
FieldTask_Change(taskMan, menu->unk_22C, menu->unk_25C);
FieldTask_InitJump(taskMan, menu->unk_22C, menu->unk_25C);
Heap_FreeToHeap(menu);
}
break;
@ -521,8 +521,8 @@ static void sub_0203ADFC(FieldTask *taskMan)
MenuTemplate v3;
u32 v4, v5;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
v5 = FieldMenu_MakeList(menu, menu->unk_30);
Window_Add(fieldSystem->bgConfig, &menu->unk_00, 3, 20, 1, 11, v5 * 3, 12, ((((1024 - (18 + 12) - 9 - (32 * 8)) - (18 + 12 + 24)) - (27 * 4)) - (11 * 22)));
@ -655,8 +655,8 @@ static void sub_0203B094(FieldTask *taskMan)
Strbuf *v5;
u8 v6;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
if (sub_0206AE5C(SaveData_GetVarsFlags(fieldSystem->saveData)) == 1) {
v6 = 0;
@ -711,8 +711,8 @@ static void sub_0203B200(FieldTask *taskMan)
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
if ((sub_0206AE5C(SaveData_GetVarsFlags(fieldSystem->saveData)) == 0) && (sub_0206AE8C(SaveData_GetVarsFlags(fieldSystem->saveData)) == 0)) {
return;
@ -728,8 +728,8 @@ static BOOL FieldMenu_Select(FieldTask *taskMan)
FieldMenu *menu;
u16 v2;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
v2 = Menu_GetCursorPos(menu->unk_20);
menu->unk_2C = Menu_ProcessInputWithSound(menu->unk_20, 1504);
@ -891,8 +891,8 @@ static void FieldMenu_ApplicationStart(FieldTask *taskMan)
return;
}
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
FieldMenu_Close(menu);
Window_Remove(&menu->unk_00);
@ -907,10 +907,10 @@ static void FieldMenu_ApplicationRun(FieldTask *taskMan)
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
return;
}
@ -927,7 +927,7 @@ static BOOL FieldMenu_SelectPokedex(FieldTask *taskMan)
{
FieldMenu *menu;
menu = TaskManager_Environment(taskMan);
menu = FieldTask_GetEnv(taskMan);
ov5_021D1744(0);
@ -946,8 +946,8 @@ static BOOL FieldMenu_Pokedex(FieldTask *taskMan)
TrainerInfo *v4;
VarsFlags *v5;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
v2 = Heap_AllocFromHeap(11, sizeof(UnkStruct_ov21_021D0D80));
v3 = SaveData_Pokedex(fieldSystem->saveData);
v4 = SaveData_GetTrainerInfo(fieldSystem->saveData);
@ -975,10 +975,10 @@ static BOOL FieldMenu_PokedexEnd(FieldTask *taskMan)
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
if (menu->unk_25C != NULL) {
Heap_FreeToHeapExplicit(11, menu->unk_25C);
@ -993,7 +993,7 @@ static BOOL FieldMenu_SelectPokemon(FieldTask *taskMan)
{
FieldMenu *menu;
menu = TaskManager_Environment(taskMan);
menu = FieldTask_GetEnv(taskMan);
ov5_021D1744(0);
@ -1008,8 +1008,8 @@ static BOOL sub_0203B78C(FieldTask *taskMan)
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
menu->unk_25C = sub_0203D390(fieldSystem, &menu->unk_24C, 0);
menu->unk_22C = sub_0203B7C0;
@ -1023,8 +1023,8 @@ BOOL sub_0203B7C0(FieldTask *taskMan)
FieldMenu *menu;
PartyManagementData *partyMan;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
partyMan = (PartyManagementData *)Heap_AllocFromHeap(11, sizeof(PartyManagementData));
memcpy(partyMan, menu->unk_25C, sizeof(PartyManagementData));
@ -1223,7 +1223,7 @@ BOOL sub_0203B7C0(FieldTask *taskMan)
menu->unk_25C = sub_0203D20C(fieldSystem, &menu->unk_230);
sub_0203B674(menu, sub_0203BC5C);
} else {
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
menu->state = FIELD_MENU_STATE_12;
}
}
@ -1237,7 +1237,7 @@ static BOOL FieldMenu_SelectBag(FieldTask *taskMan)
{
FieldMenu *menu;
menu = TaskManager_Environment(taskMan);
menu = FieldTask_GetEnv(taskMan);
ov5_021D1744(0);
@ -1249,8 +1249,8 @@ static BOOL FieldMenu_SelectBag(FieldTask *taskMan)
static BOOL FieldMenu_Bag(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldMenu *menu = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
FieldMenu *menu = FieldTask_GetEnv(taskMan);
menu->unk_25C = sub_0203D20C(fieldSystem, &menu->unk_230);
sub_0207CB70(menu->unk_25C, 0);
@ -1267,8 +1267,8 @@ static BOOL sub_0203BC5C(FieldTask *taskMan)
FieldMenu *menu;
UnkStruct_0207CB08 *v2;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
v2 = sub_0207CB08(11);
memcpy(v2, menu->unk_25C, sub_0207CB20());
@ -1360,7 +1360,7 @@ static BOOL sub_0203BC5C(FieldTask *taskMan)
} break;
case 5:
default:
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
menu->state = FIELD_MENU_STATE_12;
}
@ -1373,7 +1373,7 @@ static BOOL FieldMenu_SelectTrainerCard(FieldTask *taskMan)
{
FieldMenu *menu;
menu = TaskManager_Environment(taskMan);
menu = FieldTask_GetEnv(taskMan);
ov5_021D1744(0);
@ -1388,8 +1388,8 @@ static BOOL FieldMenu_TrainerCard(FieldTask *taskMan)
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
menu->unk_25C = sub_02071F04(11);
@ -1405,12 +1405,12 @@ static BOOL sub_0203BF00(FieldTask *taskMan)
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
sub_020721D4(fieldSystem, (TrainerCard *)menu->unk_25C);
sub_02071F20((TrainerCard *)menu->unk_25C);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
menu->state = FIELD_MENU_STATE_12;
@ -1419,7 +1419,7 @@ static BOOL sub_0203BF00(FieldTask *taskMan)
static BOOL FieldMenu_SelectSave(FieldTask *taskMan)
{
FieldMenu *menu = TaskManager_Environment(taskMan);
FieldMenu *menu = FieldTask_GetEnv(taskMan);
FieldMenu_Close(menu);
Window_EraseStandardFrame(&menu->unk_00, 1);
@ -1434,14 +1434,14 @@ static BOOL FieldMenu_SelectSave(FieldTask *taskMan)
static void FieldMenu_Save(FieldTask *taskMan)
{
FieldMenu *menu = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldMenu *menu = FieldTask_GetEnv(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
SaveMenu *saveMenu;
if (SaveData_OverwriteCheck(fieldSystem->saveData)) {
ScriptManager_Start(taskMan, 2034, NULL, NULL);
} else {
menu->unk_25C = Heap_AllocFromHeap(32, sizeof(SaveMenu));
menu->unk_25C = Heap_AllocFromHeap(HEAP_ID_FIELD_TASK, sizeof(SaveMenu));
saveMenu = menu->unk_25C;
saveMenu->unk_04 = 0;
@ -1453,8 +1453,8 @@ static void FieldMenu_Save(FieldTask *taskMan)
static void FieldMenu_SaveWait(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldMenu *menu = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
FieldMenu *menu = FieldTask_GetEnv(taskMan);
SaveMenu *saveMenu = menu->unk_25C;
if (SaveData_OverwriteCheck(fieldSystem->saveData)) {
@ -1474,7 +1474,7 @@ static BOOL FieldMenu_SelectOptions(FieldTask *taskMan)
{
FieldMenu *menu;
menu = TaskManager_Environment(taskMan);
menu = FieldTask_GetEnv(taskMan);
ov5_021D1744(0);
@ -1489,8 +1489,8 @@ static BOOL FieldMenu_Options(FieldTask *taskMan)
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
menu->unk_25C = FieldSystem_OpenOptionsMenu(fieldSystem);
menu->unk_22C = sub_0203C050;
@ -1503,11 +1503,11 @@ static BOOL sub_0203C050(FieldTask *taskMan)
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
Heap_FreeToHeap(menu->unk_25C);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
menu->state = FIELD_MENU_STATE_12;
@ -1518,7 +1518,7 @@ static BOOL FieldMenu_SelectChat(FieldTask *taskMan)
{
FieldMenu *menu;
menu = TaskManager_Environment(taskMan);
menu = FieldTask_GetEnv(taskMan);
ov5_021D1744(0);
@ -1534,8 +1534,8 @@ static BOOL sub_0203C0A0(FieldTask *taskMan)
FieldMenu *menu;
Sentence v2;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
menu->unk_25C = sub_0209747C(2, 0, fieldSystem->saveData, 11);
@ -1554,8 +1554,8 @@ static BOOL sub_0203C0F8(FieldTask *taskMan)
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
if (sub_02097528(menu->unk_25C) == 0) {
sub_02097540(menu->unk_25C, &sentence);
@ -1571,7 +1571,7 @@ static BOOL sub_0203C0F8(FieldTask *taskMan)
}
sub_020974EC((UnkStruct_0209747C *)menu->unk_25C);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
sub_0205C2B0(fieldSystem->unk_80);
return 0;
@ -1582,8 +1582,8 @@ static BOOL FieldMenu_SelectRetire(FieldTask *taskMan)
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
FieldMenu_Close(menu);
Window_EraseStandardFrame(&menu->unk_00, 1);
@ -1607,8 +1607,8 @@ static BOOL sub_0203C1C8(FieldTask *taskMan)
FieldMenu *menu;
PokemonSummary *v2;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
v2 = Heap_AllocFromHeap(11, sizeof(PokemonSummary));
memcpy(v2, menu->unk_25C, sizeof(PokemonSummary));
@ -1668,8 +1668,8 @@ static void sub_0203C2D8(FieldTask *taskMan, u16 param1)
u8 v3;
u8 v4, v5, v6;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
menu->unk_25C = sub_020972FC(11);
v2 = SaveData_GetBag(fieldSystem->saveData);
@ -1698,8 +1698,8 @@ static BOOL sub_0203C390(FieldTask *taskMan)
FieldMenu *menu;
u8 v2, v3;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
sub_02097390(menu->unk_25C, &v2, &v3);
sub_0207D9C8(fieldSystem->unk_98, 4, v3, v2);
@ -1716,8 +1716,8 @@ BOOL sub_0203C3F4(FieldTask *taskMan)
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
Heap_FreeToHeapExplicit(11, menu->unk_25C);
menu->unk_25C = sub_0203D20C(fieldSystem, &menu->unk_230);
@ -1733,8 +1733,8 @@ BOOL sub_0203C434(FieldTask *taskMan)
UnkStruct_0203D8AC *v2;
u32 v3;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
v3 = *((u32 *)menu->unk_260);
Heap_FreeToHeapExplicit(11, menu->unk_260);
@ -1756,7 +1756,7 @@ BOOL sub_0203C434(FieldTask *taskMan)
Journal_SaveData(fieldSystem->journal, v6, 1);
Heap_FreeToHeapExplicit(11, menu->unk_25C);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
menu->unk_22C = sub_02070680;
menu->unk_25C = v5;
@ -1771,8 +1771,8 @@ BOOL sub_0203C50C(FieldTask *taskMan)
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
menu->unk_25C = sub_0203D20C(fieldSystem, &menu->unk_230);
sub_0203B674(menu, sub_0203BC5C);
@ -1799,8 +1799,8 @@ BOOL sub_0203C558(FieldTask *taskMan)
FieldMenu *menu;
UnkStruct_0203C540 *v2;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
v2 = menu->unk_260;
switch (v2->unk_03) {
@ -1871,8 +1871,8 @@ BOOL sub_0203C710(FieldTask *taskMan)
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
sub_02098AF0(menu->unk_25C);
@ -1887,8 +1887,8 @@ BOOL sub_0203C750(FieldTask *taskMan)
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
menu->unk_25C = sub_0203D20C(fieldSystem, &menu->unk_230);
sub_0203B674(menu, sub_0203BC5C);
@ -1901,8 +1901,8 @@ BOOL sub_0203C784(FieldTask *taskMan)
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
menu->unk_25C = sub_0203D20C(fieldSystem, &menu->unk_230);
sub_0203B674(menu, sub_0203BC5C);
@ -1919,8 +1919,8 @@ static void FieldMenu_EvolveInit(FieldTask *taskMan)
Pokemon *v4;
UnkStruct_0207AE68 *v5;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
v2 = menu->unk_25C;
sub_0200569C();
@ -1953,8 +1953,8 @@ static void FieldMenu_Evolve(FieldTask *taskMan)
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
menu = FieldTask_GetEnv(taskMan);
if (sub_0207B0D0(menu->unk_25C) == 1) {
sub_0207B0E0(menu->unk_25C);

View File

@ -105,7 +105,7 @@ const OverlayManagerTemplate gFieldSystemContinueTemplate = {
.overlayID = FS_OVERLAY_ID_NONE,
};
void FieldSystem_StartFieldMap(FieldSystem *fieldSystem)
void FieldSystem_StartFieldMapInner(FieldSystem *fieldSystem)
{
GF_ASSERT(fieldSystem->processManager->child == NULL);
GF_ASSERT(fieldSystem->processManager->parent == NULL);
@ -126,7 +126,7 @@ BOOL FieldSystem_HasParentProcess(FieldSystem *fieldSystem)
return fieldSystem->processManager->parent != NULL;
}
BOOL FieldSystem_IsRunningFieldMap(FieldSystem *fieldSystem)
BOOL FieldSystem_IsRunningFieldMapInner(FieldSystem *fieldSystem)
{
return fieldSystem->processManager->parent != NULL && fieldSystem->runningFieldMap;
}
@ -146,7 +146,7 @@ void FieldSystem_StartChildProcess(FieldSystem *fieldSystem, const OverlayManage
static FieldSystem *InitFieldSystem(OverlayManager *ovyManager)
{
Heap_Create(HEAP_ID_APPLICATION, HEAP_ID_FIELDMAP, HEAP_SIZE_FIELDMAP);
Heap_Create(HEAP_ID_APPLICATION, 32, 0x4000);
Heap_Create(HEAP_ID_APPLICATION, HEAP_ID_FIELD_TASK, HEAP_SIZE_FIELD_TASK);
Heap_Create(HEAP_ID_SYSTEM, 91, 0x300);
FieldSystem *fieldSystem = OverlayManager_NewData(ovyManager, sizeof(FieldSystem), HEAP_ID_FIELDMAP);
@ -204,7 +204,7 @@ static void ExecuteAndCleanupIfDone(OverlayManager **ovyManagerPtr)
static BOOL HandleInputsEventsAndProcesses(FieldSystem *fieldSystem)
{
HandleFieldInput(fieldSystem);
if (sub_02050958(fieldSystem) == TRUE && fieldSystem->unk_04 != NULL) {
if (FieldTask_Run(fieldSystem) == TRUE && fieldSystem->unk_04 != NULL) {
ov5_021EA714(fieldSystem, POKETCH_EVENT_SLEEP, 0);
}
@ -232,7 +232,7 @@ static BOOL HandleInputsEventsAndProcesses(FieldSystem *fieldSystem)
static void HandleFieldInput(FieldSystem *fieldSystem)
{
BOOL processInput = FALSE;
if (!fieldSystem->processManager->pause && fieldSystem->runningFieldMap && sub_020509A4(fieldSystem) == FALSE) {
if (!fieldSystem->processManager->pause && fieldSystem->runningFieldMap && FieldSystem_IsRunningTask(fieldSystem) == FALSE) {
processInput = TRUE;
}

View File

@ -8,171 +8,159 @@
#include "field_system.h"
#include "heap.h"
typedef struct {
int unk_00;
const OverlayManagerTemplate *unk_04;
void *unk_08;
} UnkStruct_020509F0;
typedef struct FieldTaskEnv {
int state;
const OverlayManagerTemplate *overlayTemplate;
void *overlayArgs;
} FieldTaskEnv;
static FieldTask *sub_020508D4(FieldSystem *fieldSystem, FieldTaskFunc param1, void *param2)
static FieldTask *CreateTaskManager(FieldSystem *fieldSys, FieldTaskFunc taskFunc, void *taskEnv)
{
FieldTask *v0;
FieldTask *task = Heap_AllocFromHeapAtEnd(HEAP_ID_FIELD_TASK, sizeof(FieldTask));
task->prev = NULL;
task->func = taskFunc;
task->state = 0;
task->env = taskEnv;
task->dummy10 = 0;
task->dummy14 = NULL;
task->fieldSys = fieldSys;
task->dummy1C = Heap_AllocFromHeapAtEnd(HEAP_ID_FIELD_TASK, sizeof(u32));
v0 = Heap_AllocFromHeapAtEnd(32, sizeof(FieldTask));
v0->unk_00 = NULL;
v0->unk_04 = param1;
v0->unk_08 = 0;
v0->unk_0C = param2;
v0->unk_10 = 0;
v0->unk_14 = NULL;
v0->fieldSystem = fieldSystem;
v0->unk_1C = Heap_AllocFromHeapAtEnd(32, sizeof(u32));
return v0;
return task;
}
FieldTask *FieldTask_Set(FieldSystem *fieldSystem, FieldTaskFunc param1, void *param2)
FieldTask *FieldSystem_CreateTask(FieldSystem *fieldSys, FieldTaskFunc taskFunc, void *taskEnv)
{
FieldTask *v0;
GF_ASSERT(fieldSys->taskManager == NULL);
GF_ASSERT(fieldSystem->taskManager == NULL);
FieldTask *task = CreateTaskManager(fieldSys, taskFunc, taskEnv);
fieldSys->taskManager = task;
v0 = sub_020508D4(fieldSystem, param1, param2);
fieldSystem->taskManager = v0;
return v0;
return task;
}
void FieldTask_Change(FieldTask *param0, FieldTaskFunc param1, void *param2)
void FieldTask_InitJump(FieldTask *task, FieldTaskFunc taskFunc, void *taskEnv)
{
param0->unk_04 = param1;
param0->unk_08 = 0;
param0->unk_0C = param2;
task->func = taskFunc;
task->state = 0;
task->env = taskEnv;
if ((param0->unk_14 != 0) || (param0->unk_14 != NULL)) {
Heap_FreeToHeap(param0->unk_14);
param0->unk_10 = 0;
param0->unk_14 = NULL;
if (task->dummy14 != 0 || task->dummy14 != NULL) { // Double-comparison required to match
Heap_FreeToHeap(task->dummy14);
task->dummy10 = 0;
task->dummy14 = NULL;
}
}
FieldTask *FieldTask_Start(FieldTask *param0, FieldTaskFunc param1, void *param2)
FieldTask *FieldTask_InitCall(FieldTask *task, FieldTaskFunc taskFunc, void *taskEnv)
{
FieldTask *v0;
FieldTask *next = CreateTaskManager(task->fieldSys, taskFunc, taskEnv);
next->prev = task;
task->fieldSys->taskManager = next;
v0 = sub_020508D4(param0->fieldSystem, param1, param2);
v0->unk_00 = param0;
param0->fieldSystem->taskManager = v0;
return v0;
return next;
}
BOOL sub_02050958(FieldSystem *fieldSystem)
BOOL FieldTask_Run(FieldSystem *fieldSys)
{
if (fieldSystem->taskManager == NULL) {
return 0;
if (fieldSys->taskManager == NULL) {
return FALSE;
}
while (fieldSystem->taskManager->unk_04(fieldSystem->taskManager) == 1) {
FieldTask *v0;
// Run invocations through the call-stack until it is empty.
while (fieldSys->taskManager->func(fieldSys->taskManager) == TRUE) {
FieldTask *prev = fieldSys->taskManager->prev;
v0 = fieldSystem->taskManager->unk_00;
if (fieldSystem->taskManager->unk_14) {
Heap_FreeToHeap(fieldSystem->taskManager->unk_14);
if (fieldSys->taskManager->dummy14) {
Heap_FreeToHeap(fieldSys->taskManager->dummy14);
}
Heap_FreeToHeap(fieldSystem->taskManager->unk_1C);
Heap_FreeToHeap(fieldSystem->taskManager);
Heap_FreeToHeap(fieldSys->taskManager->dummy1C);
Heap_FreeToHeap(fieldSys->taskManager);
fieldSystem->taskManager = v0;
if (v0 == NULL) {
return 1;
fieldSys->taskManager = prev;
if (prev == NULL) {
return TRUE;
}
}
return 0;
return FALSE;
}
BOOL sub_020509A4(FieldSystem *fieldSystem)
BOOL FieldSystem_IsRunningTask(FieldSystem *fieldSys)
{
return fieldSystem->taskManager != NULL;
return fieldSys->taskManager != NULL;
}
BOOL sub_020509B4(FieldSystem *fieldSystem)
BOOL FieldSystem_IsRunningApplication(FieldSystem *fieldSys)
{
if (FieldSystem_HasParentProcess(fieldSystem) || FieldSystem_HasChildProcess(fieldSystem)) {
return 1;
return FieldSystem_HasParentProcess(fieldSys) || FieldSystem_HasChildProcess(fieldSys);
}
void FieldSystem_StartFieldMap(FieldSystem *fieldSys)
{
FieldSystem_StartFieldMapInner(fieldSys);
}
BOOL FieldSystem_IsRunningFieldMap(FieldSystem *fieldSys)
{
// Explicit conditional-branch required to match.
if (FieldSystem_IsRunningFieldMapInner(fieldSys)) {
return TRUE;
} else {
return 0;
return FALSE;
}
}
void sub_020509D4(FieldSystem *fieldSystem)
static BOOL RunChildApplication(FieldTask *task)
{
FieldSystem_StartFieldMap(fieldSystem);
}
FieldSystem *fieldSys = FieldTask_GetFieldSystem(task);
FieldTaskEnv *env = FieldTask_GetEnv(task);
BOOL sub_020509DC(FieldSystem *fieldSystem)
{
if (FieldSystem_IsRunningFieldMap(fieldSystem)) {
return 1;
} else {
return 0;
}
}
static BOOL sub_020509F0(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_020509F0 *v1 = TaskManager_Environment(param0);
switch (v1->unk_00) {
switch (env->state) {
case 0:
FieldSystem_StartChildProcess(fieldSystem, v1->unk_04, v1->unk_08);
v1->unk_00++;
FieldSystem_StartChildProcess(fieldSys, env->overlayTemplate, env->overlayArgs);
env->state++;
break;
case 1:
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSys)) {
break;
}
Heap_FreeToHeap(v1);
return 1;
Heap_FreeToHeap(env);
return TRUE;
}
return 0;
return FALSE;
}
void sub_02050A38(FieldTask *param0, const OverlayManagerTemplate *param1, void *param2)
void FieldTask_RunApplication(FieldTask *task, const OverlayManagerTemplate *overlayTemplate, void *overlayArgs)
{
UnkStruct_020509F0 *v0 = Heap_AllocFromHeapAtEnd(32, sizeof(UnkStruct_020509F0));
FieldTaskEnv *env = Heap_AllocFromHeapAtEnd(HEAP_ID_FIELD_TASK, sizeof(FieldTaskEnv));
env->state = 0;
env->overlayTemplate = overlayTemplate;
env->overlayArgs = overlayArgs;
v0->unk_00 = 0;
v0->unk_04 = param1;
v0->unk_08 = param2;
FieldTask_Start(param0, sub_020509F0, v0);
FieldTask_InitCall(task, RunChildApplication, env);
}
FieldSystem *TaskManager_FieldSystem(FieldTask *param0)
FieldSystem *FieldTask_GetFieldSystem(FieldTask *task)
{
return param0->fieldSystem;
return task->fieldSys;
}
void *TaskManager_Environment(FieldTask *param0)
void *FieldTask_GetEnv(FieldTask *task)
{
return param0->unk_0C;
return task->env;
}
int *FieldTask_GetState(FieldTask *param0)
int *FieldTask_GetState(FieldTask *task)
{
return &param0->unk_08;
return &task->state;
}
u32 sub_02050A6C(FieldTask *param0)
u32 FieldTask_GetDummy1CVal(FieldTask *task)
{
return *param0->unk_1C;
return *task->dummy1C;
}

View File

@ -497,7 +497,7 @@ void ov5_021D12D0(FieldSystem *fieldSystem, u32 param1)
static void ov5_021D134C(FieldSystem *fieldSystem, u8 param1)
{
if (sub_020509A4(fieldSystem) == 0) {
if (FieldSystem_IsRunningTask(fieldSystem) == 0) {
sub_020559DC(fieldSystem);
}

View File

@ -74,7 +74,7 @@ static void ov5_021D1B24(SysTask *param0, void *param1)
{
UnkStruct_ov5_021D1BEC *v0 = param1;
if (FieldSystem_IsRunningFieldMap(v0->unk_00->fieldSystem)) {
if (FieldSystem_IsRunningFieldMapInner(v0->unk_00->fieldSystem)) {
if (v0->unk_0C->unk_10) {
v0->unk_0C->unk_10(v0, v0->unk_00->fieldSystem, v0->unk_10);
}
@ -85,7 +85,7 @@ static void ov5_021D1B48(SysTask *param0, void *param1)
{
UnkStruct_ov5_021D1BEC *v0 = param1;
if (FieldSystem_IsRunningFieldMap(v0->unk_00->fieldSystem)) {
if (FieldSystem_IsRunningFieldMapInner(v0->unk_00->fieldSystem)) {
if (v0->unk_0C->unk_14) {
v0->unk_0C->unk_14(v0, v0->unk_00->fieldSystem, v0->unk_10);
}

View File

@ -689,8 +689,8 @@ BOOL ov5_021D4A24(FieldSystem *fieldSystem, UnkStruct_ov5_021D432C *param1, cons
static BOOL ov5_021D4BC8(FieldTask *param0)
{
BOOL v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
u8 *v2 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
u8 *v2 = FieldTask_GetEnv(param0);
v0 = ov5_021D42F0(fieldSystem->unk_54, *v2);
@ -813,7 +813,7 @@ void ov5_021D4D48(FieldSystem *fieldSystem, const u8 param1)
u8 *v0 = Heap_AllocFromHeapAtEnd(4, sizeof(u8));
*v0 = param1;
FieldTask_Start(fieldSystem->taskManager, ov5_021D4BC8, v0);
FieldTask_InitCall(fieldSystem->taskManager, ov5_021D4BC8, v0);
}
void ov5_021D4D68(FieldSystem *fieldSystem, const u8 param1)
@ -865,8 +865,8 @@ UnkStruct_ov5_021D4E00 *ov5_021D4E00(void)
BOOL ov5_021D4E10(FieldTask *param0)
{
MapObject *v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov5_021D4E00 *v2 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov5_021D4E00 *v2 = FieldTask_GetEnv(param0);
switch (v2->unk_00) {
case 0:
@ -922,8 +922,8 @@ BOOL ov5_021D4E10(FieldTask *param0)
BOOL ov5_021D4F14(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov5_021D4E00 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov5_021D4E00 *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_00) {
case 0: {
@ -959,8 +959,8 @@ BOOL ov5_021D4F14(FieldTask *param0)
BOOL ov5_021D4FA0(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov5_021D4E00 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov5_021D4E00 *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_00) {
case 0: {
@ -991,8 +991,8 @@ BOOL ov5_021D4FA0(FieldTask *param0)
BOOL ov5_021D5020(FieldTask *param0)
{
MapObject *v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov5_021D4E00 *v2 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov5_021D4E00 *v2 = FieldTask_GetEnv(param0);
switch (v2->unk_00) {
case 0: {
@ -1070,8 +1070,8 @@ BOOL ov5_021D5020(FieldTask *param0)
BOOL ov5_021D5150(FieldTask *param0)
{
MapObject *v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov5_021D4E00 *v2 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov5_021D4E00 *v2 = FieldTask_GetEnv(param0);
switch (v2->unk_00) {
case 0: {

View File

@ -24,8 +24,8 @@ typedef struct {
static BOOL ov5_021DDAE4(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov5_021DDBC8 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov5_021DDBC8 *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_00) {
case 0:
@ -69,5 +69,5 @@ void ov5_021DDBC8(FieldTask *param0)
UnkStruct_ov5_021DDBC8 *v0 = Heap_AllocFromHeapAtEnd(11, sizeof(UnkStruct_ov5_021DDBC8));
v0->unk_00 = 0;
FieldTask_Start(param0, ov5_021DDAE4, v0);
FieldTask_InitCall(param0, ov5_021DDAE4, v0);
}

View File

@ -508,13 +508,13 @@ static void ov5_021DFF88(int param0, FieldSystem *fieldSystem, PlayerAvatar *pla
v0->unk_10 = param3;
v0->playerAvatar = playerAvatar;
FieldTask_Set(fieldSystem, ov5_021DFFBC, v0);
FieldSystem_CreateTask(fieldSystem, ov5_021DFFBC, v0);
GameRecords_IncrementRecordValue(SaveData_GetGameRecordsPtr(fieldSystem->saveData), RECORD_UNK_055);
}
static BOOL ov5_021DFFBC(FieldTask *param0)
{
UnkStruct_ov5_021DFF88 *v0 = TaskManager_Environment(param0);
UnkStruct_ov5_021DFF88 *v0 = FieldTask_GetEnv(param0);
MapObject *v1 = Player_MapObject(v0->playerAvatar);
MapObject *v2 = v0->unk_10;
@ -587,13 +587,13 @@ static void ov5_021E00B0(FieldSystem *fieldSystem, int param1, const UnkStruct_o
v0->unk_24 = Player_MapObject(v0->playerAvatar);
v0->unk_0C = *param2;
FieldTask_Start(fieldSystem->taskManager, ov5_021E0160, v0);
FieldTask_InitCall(fieldSystem->taskManager, ov5_021E0160, v0);
}
void ov5_021E00EC(FieldTask *taskMan, int param1, int param2)
{
UnkStruct_ov5_021E1050 v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
Pokemon *v2 = ov5_021E1140(fieldSystem, param2);
ov5_021E1028(fieldSystem, v2, &v0);
@ -619,7 +619,7 @@ int ov5_021E0118(PlayerAvatar *playerAvatar, u32 param1, u32 param2)
static BOOL ov5_021E0160(FieldTask *taskMan)
{
UnkStruct_ov5_021E00B0 *v0 = TaskManager_Environment(taskMan);
UnkStruct_ov5_021E00B0 *v0 = FieldTask_GetEnv(taskMan);
switch (v0->unk_00) {
case 0:
@ -745,12 +745,12 @@ static void ov5_021E0390(int param0, FieldSystem *fieldSystem, PlayerAvatar *par
v0->unk_10 = Player_MapObject(param2);
v0->unk_14 = sub_0205EC04(param2);
FieldTask_Set(fieldSystem, ov5_021E03C8, v0);
FieldSystem_CreateTask(fieldSystem, ov5_021E03C8, v0);
}
static BOOL ov5_021E03C8(FieldTask *param0)
{
UnkStruct_ov5_021E0390 *v0 = TaskManager_Environment(param0);
UnkStruct_ov5_021E0390 *v0 = FieldTask_GetEnv(param0);
switch (v0->unk_00) {
case 0:
@ -842,13 +842,13 @@ static void ov5_021E0534(FieldSystem *fieldSystem, PlayerAvatar *playerAvatar)
v0->fieldSystem = fieldSystem;
v0->playerAvatar = playerAvatar;
FieldTask_Set(fieldSystem, ov5_021E0560, v0);
FieldSystem_CreateTask(fieldSystem, ov5_021E0560, v0);
GameRecords_IncrementRecordValue(SaveData_GetGameRecordsPtr(fieldSystem->saveData), RECORD_UNK_056);
}
static BOOL ov5_021E0560(FieldTask *param0)
{
UnkStruct_ov5_021E0534 *v0 = TaskManager_Environment(param0);
UnkStruct_ov5_021E0534 *v0 = FieldTask_GetEnv(param0);
MapObject *v1 = Player_MapObject(v0->playerAvatar);
switch (v0->unk_00) {
@ -886,7 +886,7 @@ static BOOL ov5_021E0560(FieldTask *param0)
u8 v7 = sub_02062BE8(v1);
if (sub_0205DD0C(v7) == 1) {
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
BattleParams *v9;
if (ov6_022413E4(fieldSystem, &v9) == 1) {
@ -968,13 +968,13 @@ static void ov5_021E06F8(FieldSystem *fieldSystem, int param1, const UnkStruct_o
v0->unk_14 = Player_MapObject(v0->playerAvatar);
v0->unk_1C = *param2;
FieldTask_Start(fieldSystem->taskManager, ov5_021E07A0, v0);
FieldTask_InitCall(fieldSystem->taskManager, ov5_021E07A0, v0);
}
void ov5_021E0734(FieldTask *param0, int param1, int param2)
{
UnkStruct_ov5_021E1050 v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
Pokemon *v2 = ov5_021E1140(fieldSystem, param2);
ov5_021E1028(fieldSystem, v2, &v0);
@ -1004,7 +1004,7 @@ int ov5_021E0760(u32 param0, int param1)
static BOOL ov5_021E07A0(FieldTask *param0)
{
int v0;
UnkStruct_ov5_021F9B54 *v1 = TaskManager_Environment(param0);
UnkStruct_ov5_021F9B54 *v1 = FieldTask_GetEnv(param0);
do {
v0 = Unk_ov5_021F9B54[v1->unk_00](v1);
@ -1154,27 +1154,27 @@ static UnkStruct_ov5_021F9B10 *ov5_021E0948(FieldSystem *fieldSystem, int param1
void ov5_021E097C(FieldSystem *fieldSystem, int param1)
{
UnkStruct_ov5_021F9B10 *v0 = ov5_021E0948(fieldSystem, param1, NULL);
FieldTask_Set(fieldSystem, ov5_021E09D4, v0);
FieldSystem_CreateTask(fieldSystem, ov5_021E09D4, v0);
}
void ov5_021E0998(FieldTask *param0, int param1, int param2)
{
UnkStruct_ov5_021E1050 v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
Pokemon *v2 = ov5_021E1140(fieldSystem, param2);
ov5_021E1028(fieldSystem, v2, &v0);
{
UnkStruct_ov5_021F9B10 *v3 = ov5_021E0948(fieldSystem, param1, &v0);
FieldTask_Start(param0, ov5_021E09D4, v3);
FieldTask_InitCall(param0, ov5_021E09D4, v3);
}
}
static BOOL ov5_021E09D4(FieldTask *param0)
{
int v0;
UnkStruct_ov5_021F9B10 *v1 = TaskManager_Environment(param0);
UnkStruct_ov5_021F9B10 *v1 = FieldTask_GetEnv(param0);
do {
if (v1->unk_04 == 0) {
@ -1507,7 +1507,7 @@ static const MapObjectAnimCmd Unk_ov5_021F9C00[] = {
void ov5_021E0DD4(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
ov5_021E0DE0(fieldSystem);
}
@ -1520,12 +1520,12 @@ static void ov5_021E0DE0(FieldSystem *fieldSystem)
v0->unk_08 = Player_MapObject(v0->playerAvatar);
v0->unk_10 = PlayerAvatar_Gender(v0->playerAvatar);
FieldTask_Start(fieldSystem->taskManager, ov5_021E0E10, v0);
FieldTask_InitCall(fieldSystem->taskManager, ov5_021E0E10, v0);
}
static BOOL ov5_021E0E10(FieldTask *param0)
{
UnkStruct_ov5_021E0DE0 *v0 = TaskManager_Environment(param0);
UnkStruct_ov5_021E0DE0 *v0 = FieldTask_GetEnv(param0);
switch (v0->unk_0C) {
case 0:

View File

@ -62,7 +62,7 @@ static void ov5_021E11B0(FieldSystem *fieldSystem, PlayerAvatar *playerAvatar, i
v0->unk_00 = param2;
Sound_PlayEffect(1624);
FieldTask_Set(fieldSystem, ov5_021E120C, v0);
FieldSystem_CreateTask(fieldSystem, ov5_021E120C, v0);
}
static int ov5_021E11E0(int param0)
@ -83,7 +83,7 @@ static int ov5_021E11E0(int param0)
static BOOL ov5_021E120C(FieldTask *param0)
{
UnkStruct_ov5_021E11B0 *v0 = TaskManager_Environment(param0);
UnkStruct_ov5_021E11B0 *v0 = FieldTask_GetEnv(param0);
MapObject *v1 = Player_MapObject(v0->playerAvatar);
u8 v2 = sub_02062BE8(v1);

View File

@ -372,8 +372,8 @@ static BOOL ov5_021EAD38(UnkStruct_ov5_021EAE78 *param0)
static BOOL ov5_021EADB4(FieldTask *param0)
{
UnkStruct_ov5_021EAE78 *v0 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov5_021EAE78 *v0 = FieldTask_GetEnv(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
switch (v0->unk_48) {
case 0:
@ -475,9 +475,9 @@ void ov5_021EAF50(FieldSystem *fieldSystem)
v0->unk_48 = 0;
if (v1 == NULL) {
FieldTask_Set(fieldSystem, ov5_021EADB4, v0);
FieldSystem_CreateTask(fieldSystem, ov5_021EADB4, v0);
} else {
FieldTask_Start(v1, ov5_021EADB4, v0);
FieldTask_InitCall(v1, ov5_021EADB4, v0);
}
}

View File

@ -431,8 +431,8 @@ u32 ov5_021F0484(void)
BOOL ov5_021F0488(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov5_021F0468 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov5_021F0468 *v1 = FieldTask_GetEnv(param0);
BOOL v2;
switch (v1->unk_0C) {

View File

@ -96,8 +96,8 @@ void *ov5_021F08CC(FieldSystem *fieldSystem, u32 param1, int param2)
BOOL ov5_021F08F8(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_ov5_021F08CC *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_ov5_021F08CC *v1 = FieldTask_GetEnv(taskMan);
switch (v1->unk_00) {
case 0:

View File

@ -22,8 +22,8 @@ typedef struct {
BOOL ov5_021F101C(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_020711C8 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_020711C8 *v1 = FieldTask_GetEnv(param0);
int *v2 = FieldTask_GetState(param0);
UnkStruct_ov5_021F101C *v3 = v1->unk_04;
@ -53,7 +53,7 @@ BOOL ov5_021F101C(FieldTask *param0)
}
break;
case 4:
FieldTask_Start(param0, ov5_021F0488, v3->unk_04);
FieldTask_InitCall(param0, ov5_021F0488, v3->unk_04);
(*v2)++;
break;
case 5:

View File

@ -376,7 +376,7 @@ static const MapObjectAnimCmd sVsSeekerAnimSingleExclamationMark[] = {
void VsSeeker_Start(FieldTask *taskMan, StringTemplate *template, u16 *outResult)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
VsSeekerSystem *vsSeeker = Heap_AllocFromHeap(4, sizeof(VsSeekerSystem));
if (vsSeeker == NULL) {
@ -391,7 +391,7 @@ void VsSeeker_Start(FieldTask *taskMan, StringTemplate *template, u16 *outResult
vsSeeker->result = outResult;
vsSeeker->template = template;
FieldTask_Start(taskMan, VsSeeker_ExecuteTask, vsSeeker);
FieldTask_InitCall(taskMan, VsSeeker_ExecuteTask, vsSeeker);
return;
}
@ -399,7 +399,7 @@ static BOOL VsSeeker_ExecuteTask(FieldTask *taskMan)
{
s32 missingBattery, numDigits;
enum VsSeekerUsability usability;
VsSeekerSystem *vsSeeker = TaskManager_Environment(taskMan);
VsSeekerSystem *vsSeeker = FieldTask_GetEnv(taskMan);
switch (vsSeeker->state) {
case VS_SEEKER_STATE_WAIT_FOR_NPCS:

View File

@ -500,8 +500,8 @@ static void ov6_0223E318(FieldSystem *fieldSystem, u32 param1, BOOL param2)
static BOOL ov6_0223E33C(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_ov6_0223E33C *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_ov6_0223E33C *v1 = FieldTask_GetEnv(taskMan);
switch (v1->unk_0C) {
case 0:
@ -522,14 +522,14 @@ static BOOL ov6_0223E33C(FieldTask *taskMan)
void ov6_0223E384(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_ov6_0223E33C *v1 = Heap_AllocFromHeap(4, sizeof(UnkStruct_ov6_0223E33C));
memset(v1, 0, sizeof(UnkStruct_ov6_0223E33C));
v1->unk_00 = ov6_0223FDE4(4);
ov6_0223FE1C(v1->unk_00, (FX32_CONST(2.0f)), 0, 1, 16, fieldSystem->camera);
FieldTask_Start(taskMan, ov6_0223E33C, v1);
FieldTask_InitCall(taskMan, ov6_0223E33C, v1);
}
static void ov6_0223E3D8(UnkStruct_ov6_0223E33C *param0)
@ -550,8 +550,8 @@ static void ov6_0223E3D8(UnkStruct_ov6_0223E33C *param0)
static BOOL ov6_0223E408(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov6_0223E33C *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov6_0223E33C *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_0C) {
case 0:
@ -609,7 +609,7 @@ static BOOL ov6_0223E408(FieldTask *param0)
void ov6_0223E4EC(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov6_0223E33C *v1 = Heap_AllocFromHeap(4, sizeof(UnkStruct_ov6_0223E33C));
memset(v1, 0, sizeof(UnkStruct_ov6_0223E33C));
@ -618,7 +618,7 @@ void ov6_0223E4EC(FieldTask *param0)
ov6_0223FE1C(v1->unk_00, (FX32_CONST(4.0f)), 0, 1, 24, fieldSystem->camera);
v1->unk_08 = ov6_0223FFF4(v1->unk_00);
FieldTask_Start(param0, ov6_0223E408, v1);
FieldTask_InitCall(param0, ov6_0223E408, v1);
}
static void ov6_0223E548(UnkStruct_ov5_021D1BEC *param0, FieldSystem *fieldSystem, void *param2)

View File

@ -175,7 +175,7 @@ void ov6_02242B58(FieldSystem *fieldSystem, const u16 param1, const u16 param2)
v2->unk_00 = ov6_02242E60;
}
FieldTask_Start(fieldSystem->taskManager, ov6_02242C5C, v2);
FieldTask_InitCall(fieldSystem->taskManager, ov6_02242C5C, v2);
}
u32 ov6_02242C3C(FieldSystem *fieldSystem, const u16 param1)
@ -195,8 +195,8 @@ u32 ov6_02242C3C(FieldSystem *fieldSystem, const u16 param1)
static BOOL ov6_02242C5C(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_ov6_02242B58 *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_ov6_02242B58 *v1 = FieldTask_GetEnv(taskMan);
switch (v1->unk_05) {
case 0:

View File

@ -62,7 +62,7 @@ void ov6_02246C24(FieldSystem *fieldSystem, const u8 param1)
v4->unk_00.z += v5.z;
}
FieldTask_Start(fieldSystem->taskManager, ov6_02246C9C, v4);
FieldTask_InitCall(fieldSystem->taskManager, ov6_02246C9C, v4);
} else {
GF_ASSERT(FALSE);
}
@ -70,8 +70,8 @@ void ov6_02246C24(FieldSystem *fieldSystem, const u8 param1)
static BOOL ov6_02246C9C(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov6_02246C24 *v1 = (UnkStruct_ov6_02246C24 *)TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov6_02246C24 *v1 = (UnkStruct_ov6_02246C24 *)FieldTask_GetEnv(param0);
switch (v1->unk_0F) {
case 0: {

View File

@ -36,7 +36,7 @@ void ov6_02246F00(FieldSystem *fieldSystem, const u8 param1, const u8 param2)
v1->unk_01 = param1;
v1->unk_02 = 0;
FieldTask_Start(fieldSystem->taskManager, ov6_02246F40, v1);
FieldTask_InitCall(fieldSystem->taskManager, ov6_02246F40, v1);
} else {
GF_ASSERT(FALSE);
}
@ -44,8 +44,8 @@ void ov6_02246F00(FieldSystem *fieldSystem, const u8 param1, const u8 param2)
static BOOL ov6_02246F40(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov6_02246F00 *v1 = (UnkStruct_ov6_02246F00 *)TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov6_02246F00 *v1 = (UnkStruct_ov6_02246F00 *)FieldTask_GetEnv(param0);
switch (v1->unk_02) {
case 0: {

View File

@ -62,8 +62,8 @@ void *ov6_02247100(FieldSystem *fieldSystem, u32 param1)
BOOL ov6_02247120(FieldTask *taskMan)
{
int v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_ov6_02247100 *v2 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_ov6_02247100 *v2 = FieldTask_GetEnv(taskMan);
do {
v0 = Unk_ov6_022495CC[v2->unk_00](taskMan, fieldSystem, v2);
@ -182,8 +182,8 @@ void *ov6_022472C8(FieldSystem *fieldSystem, u32 param1, int param2)
BOOL ov6_022472E8(FieldTask *taskMan)
{
int v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_ov6_02247100 *v2 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_ov6_02247100 *v2 = FieldTask_GetEnv(taskMan);
do {
v0 = Unk_ov6_022495BC[v2->unk_00](taskMan, fieldSystem, v2);
@ -302,8 +302,8 @@ void *ov6_02247488(FieldSystem *fieldSystem, Pokemon *param1, u32 param2)
BOOL ov6_022474AC(FieldTask *taskMan)
{
int v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_ov6_02247100 *v2 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_ov6_02247100 *v2 = FieldTask_GetEnv(taskMan);
do {
v0 = Unk_ov6_022495F0[v2->unk_00](taskMan, fieldSystem, v2);
@ -361,8 +361,8 @@ void *ov6_02247530(FieldSystem *fieldSystem, Pokemon *param1, u32 param2)
BOOL ov6_02247554(FieldTask *taskMan)
{
int v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_ov6_02247100 *v2 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_ov6_02247100 *v2 = FieldTask_GetEnv(taskMan);
do {
v0 = Unk_ov6_022495F0[v2->unk_00](taskMan, fieldSystem, v2);

View File

@ -95,13 +95,13 @@ void ov6_02247A0C(FieldTask *param0)
v0 = Heap_AllocFromHeapAtEnd(11, sizeof(UnkStruct_ov6_02247A0C));
MI_CpuClear8(v0, sizeof(UnkStruct_ov6_02247A0C));
FieldTask_Start(param0, ov6_02247A34, v0);
FieldTask_InitCall(param0, ov6_02247A34, v0);
}
static BOOL ov6_02247A34(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov6_02247A0C *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov6_02247A0C *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_04) {
case 0:

View File

@ -60,7 +60,7 @@ void ov6_02247D30(FieldSystem *fieldSystem, const u8 param1)
v4->unk_00.z += v5.z;
}
FieldTask_Start(fieldSystem->taskManager, ov6_02247DAC, v4);
FieldTask_InitCall(fieldSystem->taskManager, ov6_02247DAC, v4);
} else {
GF_ASSERT(FALSE);
}
@ -68,8 +68,8 @@ void ov6_02247D30(FieldSystem *fieldSystem, const u8 param1)
static BOOL ov6_02247DAC(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov6_02247D30 *v1 = (UnkStruct_ov6_02247D30 *)TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov6_02247D30 *v1 = (UnkStruct_ov6_02247D30 *)FieldTask_GetEnv(param0);
switch (v1->unk_0F) {
case 0: {

View File

@ -33,14 +33,14 @@ void ov6_02247F5C(FieldSystem *fieldSystem)
void ov6_02247FBC(FieldSystem *fieldSystem)
{
FieldTask_Start(fieldSystem->taskManager, ov6_02247FD0, NULL);
FieldTask_InitCall(fieldSystem->taskManager, ov6_02247FD0, NULL);
}
static BOOL ov6_02247FD0(FieldTask *param0)
{
int *v0;
UnkStruct_ov5_021D3CE4 *v1;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
v0 = FieldTask_GetState(param0);

View File

@ -451,8 +451,8 @@ static BOOL ov7_0224BBC4(UnkStruct_ov7_0224B4E8 *param0)
static BOOL ov7_0224BC74(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov7_0224B4E8 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov7_0224B4E8 *v1 = FieldTask_GetEnv(param0);
int v2;
switch (v1->unk_7C) {
@ -570,9 +570,9 @@ static UnkStruct_ov7_0224B4E8 *ov7_0224BE10(FieldSystem *fieldSystem)
void ov7_0224BE7C(FieldTask *param0, u16 *param1)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov7_0224B4E8 *v1 = ov7_0224BE10(fieldSystem);
v1->unk_70 = param1;
FieldTask_Start(param0, ov7_0224BC74, v1);
FieldTask_InitCall(param0, ov7_0224BC74, v1);
}

View File

@ -208,7 +208,7 @@ void ov7_0224CDA4(FieldTask *param0, FieldSystem *fieldSystem, u16 *param2, u8 p
}
ov7_0224CD28(v0, param2);
FieldTask_Start(param0, ov7_0224CEAC, v0);
FieldTask_InitCall(param0, ov7_0224CEAC, v0);
}
static u8 ov7_0224CE90(FieldSystem *fieldSystem)
@ -227,8 +227,8 @@ BOOL ov7_0224CEAC(FieldTask *param0)
FieldSystem *fieldSystem;
UnkStruct_ov7_0224D008 *v1;
fieldSystem = TaskManager_FieldSystem(param0);
v1 = TaskManager_Environment(param0);
fieldSystem = FieldTask_GetFieldSystem(param0);
v1 = FieldTask_GetEnv(param0);
switch (v1->unk_297) {
case 0:
@ -1530,8 +1530,8 @@ static void ov7_0224EC38(FieldTask *param0)
return;
}
fieldSystem = TaskManager_FieldSystem(param0);
v1 = TaskManager_Environment(param0);
fieldSystem = FieldTask_GetFieldSystem(param0);
v1 = FieldTask_GetEnv(param0);
ov7_0224D21C(v1);
@ -1545,7 +1545,7 @@ static void ov7_0224EC38(FieldTask *param0)
}
sub_0203D1E4(fieldSystem, v1->unk_04);
FieldTask_Change(param0, sub_0209AC14, v1);
FieldTask_InitJump(param0, sub_0209AC14, v1);
v1->unk_297 = 16;
}

View File

@ -366,13 +366,13 @@ void ov8_0224997C(FieldSystem *fieldSystem)
v6->unk_00 = 0;
if (v4 == 239) {
FieldTask_Start(fieldSystem->taskManager, ov8_02249CD8, v6);
FieldTask_InitCall(fieldSystem->taskManager, ov8_02249CD8, v6);
v8->unk_00 = 2;
} else if (v4 == 240) {
FieldTask_Start(fieldSystem->taskManager, ov8_02249B74, v6);
FieldTask_InitCall(fieldSystem->taskManager, ov8_02249B74, v6);
v8->unk_00 = 1;
} else if (v4 == 241) {
FieldTask_Start(fieldSystem->taskManager, ov8_02249A94, v6);
FieldTask_InitCall(fieldSystem->taskManager, ov8_02249A94, v6);
v8->unk_00 = 0;
} else {
GF_ASSERT(FALSE);
@ -410,8 +410,8 @@ BOOL ov8_02249A40(FieldSystem *fieldSystem, const int param1, const int param2,
static BOOL ov8_02249A94(FieldTask *taskMan)
{
UnkStruct_ov5_021E1890 *v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_ov8_0224997C *v2 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_ov8_0224997C *v2 = FieldTask_GetEnv(taskMan);
switch (v2->unk_00) {
case 0:
@ -462,8 +462,8 @@ static BOOL ov8_02249A94(FieldTask *taskMan)
static BOOL ov8_02249B74(FieldTask *taskMan)
{
UnkStruct_ov5_021E1890 *v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_ov8_0224997C *v2 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_ov8_0224997C *v2 = FieldTask_GetEnv(taskMan);
switch (v2->unk_00) {
case 0:
@ -549,8 +549,8 @@ static BOOL ov8_02249B74(FieldTask *taskMan)
static BOOL ov8_02249CD8(FieldTask *taskMan)
{
UnkStruct_ov5_021E1890 *v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_ov8_0224997C *v2 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_ov8_0224997C *v2 = FieldTask_GetEnv(taskMan);
switch (v2->unk_00) {
case 0:
@ -761,10 +761,10 @@ void ov8_02249FB8(FieldSystem *fieldSystem)
PlayerAvatar_PosVectorOut(fieldSystem->playerAvatar, &v1);
if (v1.y == (FX32_ONE * 16 * 0)) {
FieldTask_Start(fieldSystem->taskManager, ov8_0224A018, v0);
FieldTask_InitCall(fieldSystem->taskManager, ov8_0224A018, v0);
v3->unk_00 = 1;
} else {
FieldTask_Start(fieldSystem->taskManager, ov8_0224A0E8, v0);
FieldTask_InitCall(fieldSystem->taskManager, ov8_0224A0E8, v0);
v3->unk_00 = 0;
}
}
@ -773,8 +773,8 @@ void ov8_02249FB8(FieldSystem *fieldSystem)
static BOOL ov8_0224A018(FieldTask *taskMan)
{
UnkStruct_ov5_021E1890 *v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_ov8_0224997C *v2 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_ov8_0224997C *v2 = FieldTask_GetEnv(taskMan);
switch (v2->unk_00) {
case 0:
@ -819,8 +819,8 @@ static BOOL ov8_0224A018(FieldTask *taskMan)
static BOOL ov8_0224A0E8(FieldTask *taskMan)
{
UnkStruct_ov5_021E1890 *v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_ov8_0224997C *v2 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_ov8_0224997C *v2 = FieldTask_GetEnv(taskMan);
switch (v2->unk_00) {
case 0:
@ -1266,7 +1266,7 @@ static void ov8_0224A254(UnkStruct_ov8_0224A1E4 *param0, const u8 param1)
param0->unk_40[param1] = Unk_ov8_0224CB68[param1].unk_07;
}
FieldTask_Set(param0->fieldSystem, ov8_0224A620, v2);
FieldSystem_CreateTask(param0->fieldSystem, ov8_0224A620, v2);
} else if (v0 == 294) {
if (v1) {
param0->unk_F0 = 2;
@ -1278,7 +1278,7 @@ static void ov8_0224A254(UnkStruct_ov8_0224A1E4 *param0, const u8 param1)
param0->unk_40[param1] = Unk_ov8_0224CB68[param1].unk_07;
}
FieldTask_Set(param0->fieldSystem, ov8_0224A770, v2);
FieldSystem_CreateTask(param0->fieldSystem, ov8_0224A770, v2);
} else {
if (v1) {
param0->unk_F0 = 1;
@ -1291,7 +1291,7 @@ static void ov8_0224A254(UnkStruct_ov8_0224A1E4 *param0, const u8 param1)
param0->unk_40[param1] = Unk_ov8_0224CB68[param1].unk_07;
}
FieldTask_Set(param0->fieldSystem, ov8_0224A4FC, v2);
FieldSystem_CreateTask(param0->fieldSystem, ov8_0224A4FC, v2);
}
}
@ -1333,8 +1333,8 @@ static void ov8_0224A434(UnkStruct_ov8_0224A1E4 *param0, const fx32 param1)
static BOOL ov8_0224A4FC(FieldTask *taskMan)
{
UnkStruct_ov5_021E1890 *v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_ov8_0224997C *v2 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_ov8_0224997C *v2 = FieldTask_GetEnv(taskMan);
UnkStruct_ov8_0224A1E4 *v3;
v3 = (UnkStruct_ov8_0224A1E4 *)fieldSystem->unk_04->unk_24;
@ -1400,8 +1400,8 @@ static BOOL ov8_0224A620(FieldTask *taskMan)
{
UnkStruct_ov5_021E1890 *v0;
MapObject *v1;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_ov8_0224997C *v3 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_ov8_0224997C *v3 = FieldTask_GetEnv(taskMan);
UnkStruct_ov8_0224A1E4 *v4;
v4 = (UnkStruct_ov8_0224A1E4 *)fieldSystem->unk_04->unk_24;
@ -1482,8 +1482,8 @@ static BOOL ov8_0224A770(FieldTask *taskMan)
{
UnkStruct_ov5_021E1890 *v0;
MapObject *v1;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_ov8_0224997C *v3 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_ov8_0224997C *v3 = FieldTask_GetEnv(taskMan);
UnkStruct_ov8_0224A1E4 *v4;
v4 = (UnkStruct_ov8_0224A1E4 *)fieldSystem->unk_04->unk_24;
@ -2206,15 +2206,15 @@ void ov8_0224AD34(FieldSystem *fieldSystem, const u8 param1)
v1->unk_13 = v4;
Sound_PlayEffect(1599);
FieldTask_Start(fieldSystem->taskManager, ov8_0224ADE8, v0);
FieldTask_InitCall(fieldSystem->taskManager, ov8_0224ADE8, v0);
}
}
static BOOL ov8_0224ADE8(FieldTask *param0)
{
UnkStruct_ov5_021E1890 *v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov8_0224997C *v2 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov8_0224997C *v2 = FieldTask_GetEnv(param0);
UnkStruct_ov8_0224ABD4 *v3;
v3 = (UnkStruct_ov8_0224ABD4 *)fieldSystem->unk_04->unk_24;
@ -2714,8 +2714,8 @@ static BOOL ov8_0224B370(UnkStruct_ov8_0224AF00 *param0, const fx32 param1, cons
static BOOL ov8_0224B3D4(FieldTask *param0)
{
BOOL v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov8_0224B67C *v2 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov8_0224B67C *v2 = FieldTask_GetEnv(param0);
UnkStruct_02071BD0 *v3 = v2->unk_14;
UnkStruct_ov8_0224AF00 *v4 = v2->unk_18;
@ -2905,7 +2905,7 @@ BOOL ov8_0224B67C(FieldSystem *fieldSystem, Window *param1, MessageLoader *param
v2->unk_14 = v1;
v2->unk_18 = v3;
FieldTask_Start(fieldSystem->taskManager, ov8_0224B3D4, v2);
FieldTask_InitCall(fieldSystem->taskManager, ov8_0224B3D4, v2);
}
return 1;
@ -3215,8 +3215,8 @@ static u32 ov8_0224BAA0(UnkStruct_ov8_0224B8D0 *param0, int param1, int param2,
static BOOL ov8_0224BAF4(FieldTask *taskMan)
{
MapObject *v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_ov8_0224C098 *v2 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_ov8_0224C098 *v2 = FieldTask_GetEnv(taskMan);
UnkStruct_ov8_0224B8D0 *v3 = v2->unk_3C;
v0 = Player_MapObject(fieldSystem->playerAvatar);
@ -3246,7 +3246,7 @@ static BOOL ov8_0224BB78(FieldTask *taskMan)
int v0;
UnkStruct_ov8_0224C098 *v1;
v1 = TaskManager_Environment(taskMan);
v1 = FieldTask_GetEnv(taskMan);
do {
v0 = Unk_ov8_0224C818[v1->unk_00](v1);
@ -3510,13 +3510,13 @@ static UnkStruct_ov8_0224C098 *ov8_0224BED8(UnkStruct_ov8_0224B8D0 *param0, UnkS
static void ov8_0224BF0C(FieldSystem *fieldSystem, UnkStruct_ov8_0224B8D0 *param1, UnkStruct_ov8_0224BCA8 *param2, int param3)
{
UnkStruct_ov8_0224C098 *v0 = ov8_0224BED8(param1, param2, param3);
FieldTask_Set(fieldSystem, ov8_0224BAF4, v0);
FieldSystem_CreateTask(fieldSystem, ov8_0224BAF4, v0);
}
static void ov8_0224BF2C(FieldSystem *fieldSystem, UnkStruct_ov8_0224B8D0 *param1, UnkStruct_ov8_0224BCA8 *param2, int param3)
{
UnkStruct_ov8_0224C098 *v0 = ov8_0224BED8(param1, param2, param3);
FieldTask_Set(fieldSystem, ov8_0224BB78, v0);
FieldSystem_CreateTask(fieldSystem, ov8_0224BB78, v0);
}
BOOL ov8_0224BF4C(FieldSystem *fieldSystem)

View File

@ -2342,13 +2342,13 @@ static void ov9_0224AA34(UnkStruct_ov9_02249B04 *param0, const UnkStruct_ov9_022
v0->unk_28.z = -v0->unk_28.z;
}
FieldTask_Set(param0->fieldSystem, ov9_0224AAD4, param0);
FieldSystem_CreateTask(param0->fieldSystem, ov9_0224AAD4, param0);
}
static BOOL ov9_0224AAD4(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov9_02249B04 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov9_02249B04 *v1 = FieldTask_GetEnv(param0);
UnkStruct_ov9_0224AC58 *v2 = ov9_0224A598(v1);
PlayerAvatar *playerAvatar = fieldSystem->playerAvatar;
MapObject *v4 = Player_MapObject(playerAvatar);
@ -4908,13 +4908,13 @@ static void ov9_0224D078(UnkStruct_ov9_02249B04 *param0, UnkStruct_ov9_0224E0DC
v0 = ov9_0224A578(param0, sizeof(UnkStruct_ov9_0224D078));
v0->unk_64 = param1;
FieldTask_Set(param0->fieldSystem, ov9_0224D098, param0);
FieldSystem_CreateTask(param0->fieldSystem, ov9_0224D098, param0);
}
static BOOL ov9_0224D098(FieldTask *param0)
{
int v0;
UnkStruct_ov9_02249B04 *v1 = TaskManager_Environment(param0);
UnkStruct_ov9_02249B04 *v1 = FieldTask_GetEnv(param0);
UnkStruct_ov9_0224D078 *v2 = ov9_0224A598(v1);
do {
@ -6275,7 +6275,7 @@ static BOOL ov9_0224E434(UnkStruct_ov9_02249B04 *param0, int param1, int param2,
static void ov9_0224E498(UnkStruct_ov9_02249B04 *param0, const UnkStruct_ov9_02251438 *param1)
{
ov9_0224E350(param0, param1);
FieldTask_Set(param0->fieldSystem, ov9_0224E4BC, param0);
FieldSystem_CreateTask(param0->fieldSystem, ov9_0224E4BC, param0);
}
static void ov9_0224E4B0(UnkStruct_ov9_02249B04 *param0, const UnkStruct_ov9_02252044 *param1)
@ -6285,7 +6285,7 @@ static void ov9_0224E4B0(UnkStruct_ov9_02249B04 *param0, const UnkStruct_ov9_022
static BOOL ov9_0224E4BC(FieldTask *param0)
{
UnkStruct_ov9_02249B04 *v0 = TaskManager_Environment(param0);
UnkStruct_ov9_02249B04 *v0 = FieldTask_GetEnv(param0);
if (ov9_0224E3A0(v0, param0) == 1) {
return 1;

View File

@ -1567,12 +1567,12 @@ static void ov23_0223F118(SysTask *param0, void *param1)
if (IsScreenTransitionDone()) {
sub_02039794();
ov23_0223F020(v0);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
(v0->unk_00)++;
}
break;
case 20:
if (sub_020509DC(fieldSystem)) {
if (FieldSystem_IsRunningFieldMap(fieldSystem)) {
fieldSystem->unk_6C = ov23_02249404(fieldSystem);
sub_02039734();
sub_020594FC();

View File

@ -1523,8 +1523,8 @@ static void ov23_0224C6E8(void)
static BOOL ov23_0224C708(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov23_0224BA48 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov23_0224BA48 *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_10) {
case 0:
@ -1544,16 +1544,16 @@ static BOOL ov23_0224C708(FieldTask *param0)
static BOOL ov23_0224C74C(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov23_0224BA48 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov23_0224BA48 *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_10) {
case 0:
FieldSystem_StartFieldMap(fieldSystem);
FieldSystem_StartFieldMapInner(fieldSystem);
(v1->unk_10)++;
break;
case 1:
if (sub_020509DC(fieldSystem)) {
if (FieldSystem_IsRunningFieldMap(fieldSystem)) {
v1->unk_10 = 0;
return 1;
}
@ -1565,8 +1565,8 @@ static BOOL ov23_0224C74C(FieldTask *param0)
static BOOL ov23_0224C790(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov23_0224BA48 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov23_0224BA48 *v1 = FieldTask_GetEnv(param0);
Location v2;
int v3 = 0, v4 = 0;
@ -1735,7 +1735,7 @@ static void ov23_0224CAF0(FieldSystem *fieldSystem, int param1, int param2, int
if (v0) {
v0->unk_2D = param5;
FieldTask_Set(fieldSystem, ov23_0224C790, v0);
FieldSystem_CreateTask(fieldSystem, ov23_0224C790, v0);
}
}

View File

@ -605,8 +605,8 @@ static void ov23_02251A84(BOOL param0, FieldSystem *fieldSystem)
static BOOL ov23_02251ACC(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov23_02251ACC *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov23_02251ACC *v1 = FieldTask_GetEnv(param0);
Location v2;
u32 v3;
BOOL v4 = 0;
@ -787,7 +787,7 @@ static void ov23_02251C04(SysTask *param0, void *param1)
MI_CpuClear8(v2, sizeof(UnkStruct_ov23_02251ACC));
v2->unk_00 = 0;
v2->unk_04 = 0;
FieldTask_Set(v0->fieldSystem, ov23_02251ACC, v2);
FieldSystem_CreateTask(v0->fieldSystem, ov23_02251ACC, v2);
}
ov23_02251BB4(param0, v0);

View File

@ -206,8 +206,8 @@ static void ov23_02254AA4(const int param0, UnkStruct_ov23_02256098 *param1)
static BOOL ov23_02254AD4(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov23_02256098 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov23_02256098 *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_00) {
case 0:
@ -232,19 +232,19 @@ static BOOL ov23_02254AD4(FieldTask *param0)
}
break;
case 3:
FieldTask_Start(param0, ov23_02254C84, v1);
FieldTask_InitCall(param0, ov23_02254C84, v1);
break;
case 4:
FieldTask_Start(param0, ov23_02254DF8, v1);
FieldTask_InitCall(param0, ov23_02254DF8, v1);
break;
case 5:
FieldTask_Start(param0, ov23_02255100, v1);
FieldTask_InitCall(param0, ov23_02255100, v1);
break;
case 6:
FieldTask_Start(param0, ov23_02255580, v1);
FieldTask_InitCall(param0, ov23_02255580, v1);
break;
case 7:
FieldTask_Start(param0, ov23_02255850, v1);
FieldTask_InitCall(param0, ov23_02255850, v1);
break;
case 8:
if (Text_IsPrinterActive(v1->unk_08) == 0) {
@ -276,8 +276,8 @@ static BOOL ov23_02254AD4(FieldTask *param0)
static BOOL ov23_02254C84(FieldTask *param0)
{
BOOL v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov23_02256098 *v2 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov23_02256098 *v2 = FieldTask_GetEnv(param0);
v0 = ov23_02254318(v2->unk_504);
@ -345,7 +345,7 @@ void ov23_02254D98(FieldSystem *fieldSystem, FieldTask *param1)
v0->unk_50C = ov5_021D1B6C(fieldSystem->unk_04->unk_04, &Unk_ov23_02256B88);
v0->unk_4FC = ov5_021D1C2C(v0->unk_50C);
FieldTask_Start(param1, ov23_02254AD4, v0);
FieldTask_InitCall(param1, ov23_02254AD4, v0);
}
static BOOL ov23_02254DF8(FieldTask *param0)
@ -354,8 +354,8 @@ static BOOL ov23_02254DF8(FieldTask *param0)
UnkStruct_ov5_021E1890 *v2;
BOOL v3;
BOOL v4;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov23_02256098 *v6 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov23_02256098 *v6 = FieldTask_GetEnv(param0);
switch (v6->unk_04) {
case 0: {
@ -532,8 +532,8 @@ static BOOL ov23_02255100(FieldTask *param0)
fx32 v2, v3;
BOOL v4;
BOOL v5;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov23_02256098 *v7 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov23_02256098 *v7 = FieldTask_GetEnv(param0);
switch (v7->unk_04) {
case 0:
@ -769,8 +769,8 @@ static BOOL ov23_02255580(FieldTask *param0)
fx32 v2, v3;
BOOL v4;
BOOL v5;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov23_02256098 *v7 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov23_02256098 *v7 = FieldTask_GetEnv(param0);
switch (v7->unk_04) {
case 0:
@ -921,8 +921,8 @@ static BOOL ov23_02255850(FieldTask *param0)
UnkStruct_ov5_021E1890 *v2;
BOOL v3;
BOOL v4;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_ov23_02256098 *v6 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov23_02256098 *v6 = FieldTask_GetEnv(param0);
switch (v6->unk_04) {
case 0:

View File

@ -716,7 +716,7 @@ BOOL PoketchSystem_GetDisplayTappedCoords(u32 *x, u32 *y)
BOOL ov25_0225450C(const PoketchSystem *poketchSys)
{
return sub_020509A4(poketchSys->fieldSystem);
return FieldSystem_IsRunningTask(poketchSys->fieldSystem);
}
void ov25_02254518(const PoketchSystem *poketchSys, PoketchButtonManager *buttonManager)

View File

@ -703,7 +703,7 @@ static void ov56_02256D04(UnkStruct_ov56_02256468 *param0)
{
int v0 = 0xffffffff;
if (!sub_020509A4(param0->fieldSystem)) {
if (!FieldSystem_IsRunningTask(param0->fieldSystem)) {
int v1;
v1 = ov56_02256A68(param0);
@ -880,7 +880,7 @@ static void ov56_02257098(UnkStruct_ov56_02256468 *param0)
TrainerInfo *v5;
Sentence v6;
if (sub_020509A4(param0->fieldSystem)) {
if (FieldSystem_IsRunningTask(param0->fieldSystem)) {
return;
}

View File

@ -417,8 +417,8 @@ static BOOL CheckPatchContinueChain(const u8 patchRing, const int battleResult)
BOOL RefreshRadarChain(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
int *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
int *v1 = FieldTask_GetEnv(taskMan);
switch (*v1) {
case 0:

View File

@ -260,7 +260,7 @@ static BOOL ScrCmd_ReturnCommonScript(ScriptContext *ctx);
static BOOL ScrCmd_GoTo(ScriptContext *ctx);
static MapObject *sub_02040ED4(FieldSystem *fieldSystem, int param1);
static BOOL ScrCmd_017(ScriptContext *ctx);
static BOOL ScrCmd_018(ScriptContext *ctx);
static BOOL ScrCmd_Unused018(ScriptContext *ctx);
static BOOL ScrCmd_019(ScriptContext *ctx);
static BOOL ScrCmd_Call(ScriptContext *ctx);
static BOOL ScrCmd_Return(ScriptContext *ctx);
@ -787,7 +787,7 @@ const ScrCmdFunc Unk_020EAC58[] = {
ScrCmd_ReturnCommonScript,
ScrCmd_GoTo,
ScrCmd_017,
ScrCmd_018,
ScrCmd_Unused018,
ScrCmd_019,
ScrCmd_Call,
ScrCmd_Return,
@ -1896,21 +1896,17 @@ static BOOL ScrCmd_017(ScriptContext *ctx)
return 0;
}
static BOOL ScrCmd_018(ScriptContext *ctx)
static BOOL ScrCmd_Unused018(ScriptContext *ctx)
{
u8 v0;
s32 v1;
u32 v2;
u32 taskVal = FieldTask_GetDummy1CVal(ctx->taskManager);
u8 val = ScriptContext_ReadByte(ctx);
s32 offset = (s32)ScriptContext_ReadWord(ctx);
v2 = sub_02050A6C(ctx->taskManager);
v0 = ScriptContext_ReadByte(ctx);
v1 = (s32)ScriptContext_ReadWord(ctx);
if (v2 == v0) {
ScriptContext_Jump(ctx, (u8 *)(ctx->scriptPtr + v1));
if (taskVal == val) {
ScriptContext_Jump(ctx, (u8 *)(ctx->scriptPtr + offset));
}
return 0;
return FALSE;
}
static BOOL ScrCmd_019(ScriptContext *ctx)
@ -3859,7 +3855,7 @@ BOOL sub_02041CC8(ScriptContext *ctx)
v0 = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, 19);
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
return 0;
}
@ -3879,7 +3875,7 @@ static BOOL sub_02041CF4(ScriptContext *ctx)
v0 = FieldSystem_GetScriptMemberPtr(fieldSystem, 19);
v2 = *v0;
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
return 0;
}
@ -3916,7 +3912,7 @@ BOOL sub_02041D60(ScriptContext *ctx)
{
FieldSystem *fieldSystem = ctx->fieldSystem;
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
return 0;
}
@ -5561,7 +5557,7 @@ static BOOL ScrCmd_GetPlayerGender(ScriptContext *ctx)
static BOOL ScrCmd_HealParty(ScriptContext *ctx)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(ctx->taskManager);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(ctx->taskManager);
HealAllPokemonInParty(Party_GetFromSavedata(fieldSystem->saveData));
return FALSE;
@ -7796,7 +7792,7 @@ static BOOL ScrCmd_2C4(ScriptContext *ctx)
v2->unk_10 = ctx->fieldSystem->unk_98;
v2->unk_20 = ctx->fieldSystem->unk_BC;
sub_02050A38(ctx->taskManager, &Unk_020F8BE0, v2);
FieldTask_RunApplication(ctx->taskManager, &Unk_020F8BE0, v2);
ScriptContext_Pause(ctx, sub_02041CC8);
return 1;

View File

@ -47,12 +47,12 @@ void ScriptManager_Set(FieldSystem *fieldSystem, u16 scriptID, MapObject *object
ScriptManager *scriptManager = ScriptManager_New();
sub_0203EA68(fieldSystem, scriptManager, scriptID, object, NULL);
FieldTask_Set(fieldSystem, FieldTask_RunScript, scriptManager);
FieldSystem_CreateTask(fieldSystem, FieldTask_RunScript, scriptManager);
}
void ScriptManager_SetApproachingTrainer(FieldSystem *fieldSystem, MapObject *object, int sightRange, int direction, int scriptID, int trainerID, int trainerType, int approachNum)
{
ScriptManager *scriptManager = TaskManager_Environment(fieldSystem->taskManager);
ScriptManager *scriptManager = FieldTask_GetEnv(fieldSystem->taskManager);
ApproachingTrainer *trainer = &scriptManager->trainers[approachNum];
trainer->sightRange = sightRange;
@ -65,20 +65,20 @@ void ScriptManager_SetApproachingTrainer(FieldSystem *fieldSystem, MapObject *ob
void ScriptManager_Start(FieldTask *taskManager, u16 scriptID, MapObject *object, void *saveType)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskManager);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskManager);
ScriptManager *scriptManager = ScriptManager_New();
sub_0203EA68(fieldSystem, scriptManager, scriptID, object, saveType);
FieldTask_Start(taskManager, FieldTask_RunScript, scriptManager);
FieldTask_InitCall(taskManager, FieldTask_RunScript, scriptManager);
}
void ScriptManager_Change(FieldTask *taskManager, u16 scriptID, MapObject *object)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskManager);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskManager);
ScriptManager *scriptManager = ScriptManager_New();
sub_0203EA68(fieldSystem, scriptManager, scriptID, object, NULL);
FieldTask_Change(taskManager, FieldTask_RunScript, scriptManager);
FieldTask_InitJump(taskManager, FieldTask_RunScript, scriptManager);
}
static BOOL FieldTask_RunScript(FieldTask *taskManager)
@ -86,8 +86,8 @@ static BOOL FieldTask_RunScript(FieldTask *taskManager)
int i;
FieldSysFunc scriptFunction;
ScriptContext *ctx = NULL;
ScriptManager *scriptManager = TaskManager_Environment(taskManager);
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskManager);
ScriptManager *scriptManager = FieldTask_GetEnv(taskManager);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskManager);
switch (scriptManager->state) {
case 0:
@ -434,7 +434,7 @@ void *ScriptManager_GetMemberPtr(ScriptManager *scriptManager, u32 member)
void *FieldSystem_GetScriptMemberPtr(FieldSystem *fieldSystem, u32 member)
{
ScriptManager *script = TaskManager_Environment(fieldSystem->taskManager);
ScriptManager *script = FieldTask_GetEnv(fieldSystem->taskManager);
GF_ASSERT(script->magic == SCRIPT_MANAGER_MAGIC_NUMBER);
@ -443,7 +443,7 @@ void *FieldSystem_GetScriptMemberPtr(FieldSystem *fieldSystem, u32 member)
void sub_0203F0C0(FieldSystem *fieldSystem)
{
ScriptManager *scriptManager = TaskManager_Environment(fieldSystem->taskManager);
ScriptManager *scriptManager = FieldTask_GetEnv(fieldSystem->taskManager);
if (sub_0203A9C8(fieldSystem) == 1) {
scriptManager->function = sub_0203AB00;

View File

@ -459,8 +459,8 @@ static BOOL sub_0203D444(FieldTask *param0)
UnkStruct_0203D444 *v1;
int *v2;
fieldSystem = TaskManager_FieldSystem(param0);
v1 = TaskManager_Environment(param0);
fieldSystem = FieldTask_GetFieldSystem(param0);
v1 = FieldTask_GetEnv(param0);
v2 = FieldTask_GetState(param0);
switch (*v2) {
@ -469,7 +469,7 @@ static BOOL sub_0203D444(FieldTask *param0)
*v2 = 1;
break;
case 1:
if (!sub_020509B4(fieldSystem)) {
if (!FieldSystem_IsRunningApplication(fieldSystem)) {
switch (v1->unk_04->unk_22) {
case 7:
sub_0205BAAC(2);
@ -491,7 +491,7 @@ static BOOL sub_0203D444(FieldTask *param0)
*v2 = 3;
break;
case 3:
if (!sub_020509B4(fieldSystem)) {
if (!FieldSystem_IsRunningApplication(fieldSystem)) {
Heap_FreeToHeap(v1->unk_08);
*v2 = 0;
}
@ -508,7 +508,7 @@ void *sub_0203D50C(FieldTask *taskMan, int param1)
{
UnkStruct_0203D444 *v0;
PartyManagementData *v1;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
v0 = Heap_AllocFromHeap(param1, sizeof(UnkStruct_0203D444));
v0->unk_00 = param1;
@ -519,7 +519,7 @@ void *sub_0203D50C(FieldTask *taskMan, int param1)
v1->unk_14 = NULL;
v0->unk_04 = v1;
FieldTask_Start(taskMan, sub_0203D444, v0);
FieldTask_InitCall(taskMan, sub_0203D444, v0);
return v1;
}
@ -658,8 +658,8 @@ void sub_0203D754(FieldSystem *fieldSystem, UnkStruct_02042434 *param1)
static BOOL sub_0203D764(FieldTask *taskMan)
{
int *v0 = FieldTask_GetState(taskMan);
UnkStruct_0203D764 *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_0203D764 *v1 = FieldTask_GetEnv(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
switch (*v0) {
case 0:
@ -667,7 +667,7 @@ static BOOL sub_0203D764(FieldTask *taskMan)
(*v0)++;
break;
case 1:
if (!sub_020509B4(fieldSystem)) {
if (!FieldSystem_IsRunningApplication(fieldSystem)) {
(*v0)++;
}
break;
@ -700,9 +700,9 @@ static BOOL sub_0203D764(FieldTask *taskMan)
void sub_0203D80C(FieldTask *taskMan, u16 *param1, u16 *param2, u16 *param3)
{
UnkStruct_0203D764 *v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
v0 = Heap_AllocFromHeap(32, sizeof(UnkStruct_0203D764));
v0 = Heap_AllocFromHeap(HEAP_ID_FIELD_TASK, sizeof(UnkStruct_0203D764));
v0->unk_00 = param1;
v0->unk_04 = param2;
v0->unk_08 = param3;
@ -715,7 +715,7 @@ void sub_0203D80C(FieldTask *taskMan, u16 *param1, u16 *param2, u16 *param3)
sub_020974F8(v0->unk_0C, *param2, *param3);
}
FieldTask_Start(taskMan, sub_0203D764, v0);
FieldTask_InitCall(taskMan, sub_0203D764, v0);
}
void sub_0203D874(FieldSystem *fieldSystem, UnkStruct_0209747C *param1)
@ -887,8 +887,8 @@ static UnkStruct_0203DA00 *sub_0203DA00(int param0, SaveData *param1, int param2
static BOOL sub_0203DA64(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0203DA64 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0203DA64 *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_00) {
case 0:
@ -896,7 +896,7 @@ static BOOL sub_0203DA64(FieldTask *param0)
v1->unk_00++;
break;
case 1:
if (sub_020509B4(fieldSystem) == 0) {
if (FieldSystem_IsRunningApplication(fieldSystem) == 0) {
if (v1->unk_08 == 1) {
*v1->unk_04 = 1;
} else {
@ -918,13 +918,13 @@ void sub_0203DAC0(FieldTask *param0, u16 *param1, SaveData *param2, u16 param3,
{
UnkStruct_0203DA64 *v0;
v0 = Heap_AllocFromHeap(32, sizeof(UnkStruct_0203DA64));
v0 = Heap_AllocFromHeap(HEAP_ID_FIELD_TASK, sizeof(UnkStruct_0203DA64));
memset(v0, 0, sizeof(UnkStruct_0203DA64));
v0->unk_0C = sub_0203DA00(32, param2, param3, &v0->unk_08, param4);
v0->unk_04 = param1;
FieldTask_Start(param0, sub_0203DA64, v0);
FieldTask_InitCall(param0, sub_0203DA64, v0);
}
BOOL sub_0203DB10(FieldSystem *fieldSystem, void *param1)
@ -985,9 +985,9 @@ static void sub_0203DB38(UnkStruct_ov88_0223C370 *param0, FieldSystem *fieldSyst
param0->unk_10 = fieldSystem->saveData;
param0->unk_1C = fieldSystem->journal;
param0->records = SaveData_GetGameRecordsPtr(fieldSystem->saveData);
param0->unk_38 = Heap_AllocFromHeap(32, TrainerInfo_Size());
param0->unk_3C = Heap_AllocFromHeap(32, Pokemon_GetStructSize());
param0->unk_40 = Heap_AllocFromHeap(32, Pokemon_GetStructSize());
param0->unk_38 = Heap_AllocFromHeap(HEAP_ID_FIELD_TASK, TrainerInfo_Size());
param0->unk_3C = Heap_AllocFromHeap(HEAP_ID_FIELD_TASK, Pokemon_GetStructSize());
param0->unk_40 = Heap_AllocFromHeap(HEAP_ID_FIELD_TASK, Pokemon_GetStructSize());
param0->fieldSystem = fieldSystem;
param0->unk_34 = 0;
}
@ -1013,8 +1013,8 @@ static void sub_0203DBC0(UnkStruct_ov88_0223C370 *param0)
BOOL sub_0203DBF0(FieldTask *param0)
{
int v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0203DBF0 *v2 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0203DBF0 *v2 = FieldTask_GetEnv(param0);
switch (v2->unk_00) {
case 0:
@ -1028,7 +1028,7 @@ BOOL sub_0203DBF0(FieldTask *param0)
sub_0203DB38(&(v2->unk_04), fieldSystem);
v2->unk_00++;
case 2:
sub_02050A38(param0, &Unk_02100AA4, &v2->unk_04);
FieldTask_RunApplication(param0, &Unk_02100AA4, &v2->unk_04);
v2->unk_00++;
break;
case 3:
@ -1066,7 +1066,7 @@ BOOL sub_0203DBF0(FieldTask *param0)
v2->unk_48.unk_0C = 3;
}
sub_02050A38(param0, &Unk_020EA268, &v2->unk_48);
FieldTask_RunApplication(param0, &Unk_020EA268, &v2->unk_48);
v2->unk_00 = 5;
break;
case 5: {
@ -1110,10 +1110,10 @@ BOOL sub_0203DBF0(FieldTask *param0)
void sub_0203DDDC(FieldTask *param0)
{
UnkStruct_0203DBF0 *v0 = Heap_AllocFromHeap(32, sizeof(UnkStruct_0203DBF0));
UnkStruct_0203DBF0 *v0 = Heap_AllocFromHeap(HEAP_ID_FIELD_TASK, sizeof(UnkStruct_0203DBF0));
v0->unk_00 = 0;
FieldTask_Start(param0, sub_0203DBF0, v0);
FieldTask_InitCall(param0, sub_0203DBF0, v0);
}
const OverlayManagerTemplate Unk_020EA258 = {
@ -1132,7 +1132,7 @@ const OverlayManagerTemplate Unk_020EA248 = {
void sub_0203DDFC(FieldSystem *fieldSystem)
{
UnkStruct_0203DDFC *v0 = Heap_AllocFromHeap(32, sizeof(UnkStruct_0203DDFC));
UnkStruct_0203DDFC *v0 = Heap_AllocFromHeap(HEAP_ID_FIELD_TASK, sizeof(UnkStruct_0203DDFC));
v0->unk_00 = fieldSystem->unk_80;
v0->unk_04 = fieldSystem->journal;
@ -1176,8 +1176,8 @@ void sub_0203DE88(FieldSystem *fieldSystem, SaveData *param1)
static BOOL sub_0203DE98(FieldTask *param0)
{
int v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0203DE98 *v2 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0203DE98 *v2 = FieldTask_GetEnv(param0);
switch (v2->unk_00) {
case 0:
@ -1185,7 +1185,7 @@ static BOOL sub_0203DE98(FieldTask *param0)
v2->unk_00++;
break;
case 1:
sub_02050A38(param0, &Unk_020F2DAC, v2->unk_0C);
FieldTask_RunApplication(param0, &Unk_020F2DAC, v2->unk_0C);
v2->unk_00++;
break;
case 2:
@ -1226,8 +1226,8 @@ static BOOL sub_0203DE98(FieldTask *param0)
static void sub_0203DF68(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0203DE98 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0203DE98 *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_0C->unk_00) {
case 0: {
@ -1257,7 +1257,7 @@ static void sub_0203DF68(FieldTask *param0)
void sub_0203DFE8(FieldTask *param0, int param1, int param2, int param3, int param4, const u16 *param5, u16 *param6)
{
Pokemon *v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0203DE98 *v2 = Heap_AllocFromHeapAtEnd(11, sizeof(UnkStruct_0203DE98));
v2->unk_00 = 0;
@ -1286,7 +1286,7 @@ void sub_0203DFE8(FieldTask *param0, int param1, int param2, int param3, int par
break;
}
FieldTask_Start(param0, sub_0203DE98, v2);
FieldTask_InitCall(param0, sub_0203DE98, v2);
}
void sub_0203E09C(FieldSystem *fieldSystem, TrainerCard *param1)
@ -1550,9 +1550,9 @@ BOOL sub_0203E348(FieldSystem *fieldSystem, UnkStruct_0203E348 *param1)
static BOOL sub_0203E35C(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
VarsFlags *v1 = SaveData_GetVarsFlags(fieldSystem->saveData);
UnkStruct_0203E35C *v2 = TaskManager_Environment(param0);
UnkStruct_0203E35C *v2 = FieldTask_GetEnv(param0);
int *v3 = FieldTask_GetState(param0);
int v4;
@ -1562,7 +1562,7 @@ static BOOL sub_0203E35C(FieldTask *param0)
(*v3)++;
break;
case 1:
if (sub_020509B4(fieldSystem) == 0) {
if (FieldSystem_IsRunningApplication(fieldSystem) == 0) {
u16 *v5 = SaveData_GetCoins(fieldSystem->saveData);
s64 v6 = GetTimestamp();
@ -1586,9 +1586,9 @@ static BOOL sub_0203E35C(FieldTask *param0)
void sub_0203E414(FieldTask *param0, int param1)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
Options *v1 = SaveData_Options(fieldSystem->saveData);
UnkStruct_0203E35C *v2 = Heap_AllocFromHeap(32, sizeof(UnkStruct_0203E35C));
UnkStruct_0203E35C *v2 = Heap_AllocFromHeap(HEAP_ID_FIELD_TASK, sizeof(UnkStruct_0203E35C));
v2->unk_0C.unk_00 = &v2->unk_00;
v2->unk_00 = Coins_GetValue(SaveData_GetCoins(fieldSystem->saveData));
@ -1599,7 +1599,7 @@ void sub_0203E414(FieldTask *param0, int param1)
v2->unk_0C.unk_04 = sub_0203E484(fieldSystem->saveData, param1);
GameRecords_IncrementTrainerScore(SaveData_GetGameRecordsPtr(fieldSystem->saveData), TRAINER_SCORE_EVENT_UNK_05);
FieldTask_Start(param0, sub_0203E35C, v2);
FieldTask_InitCall(param0, sub_0203E35C, v2);
}
static u8 sub_0203E484(SaveData *param0, u8 param1)
@ -1643,7 +1643,7 @@ static u8 sub_0203E484(SaveData *param0, u8 param1)
static BOOL sub_0203E4F8(FieldTask *param0)
{
UnkStruct_ov7_0224BEFC *v0 = TaskManager_Environment(param0);
UnkStruct_ov7_0224BEFC *v0 = FieldTask_GetEnv(param0);
if (ov7_0224BF2C(v0) == 1) {
ov7_0224BEFC(v0);
@ -1655,10 +1655,10 @@ static BOOL sub_0203E4F8(FieldTask *param0)
void sub_0203E518(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_ov7_0224BEFC *v1 = ov7_0224BE9C(4, fieldSystem->saveData, fieldSystem->bgConfig);
FieldTask_Start(param0, sub_0203E4F8, v1);
FieldTask_InitCall(param0, sub_0203E4F8, v1);
}
void *sub_0203E53C(FieldSystem *fieldSystem, int param1, int param2)

View File

@ -117,7 +117,7 @@ BOOL ScrCmd_224(ScriptContext *param0)
u16 *v3;
v0 = Party_GetPokemonBySlotIndex(Party_GetFromSavedata(param0->fieldSystem->saveData), v1);
v3 = Heap_AllocFromHeap(32, (1 + 1) * 2);
v3 = Heap_AllocFromHeap(HEAP_ID_FIELD_TASK, (1 + 1) * 2);
*(v3 + 0) = v2;
*(v3 + 1) = 0xffff;

View File

@ -248,13 +248,13 @@ void sub_0204F3D0(FieldTask *param0, u16 param1, u16 *param2)
CommFieldCmd_Init(v0);
FieldTask_Start(param0, sub_0204F414, v0);
FieldTask_InitCall(param0, sub_0204F414, v0);
return;
}
static BOOL sub_0204F414(FieldTask *param0)
{
UnkStruct_0204F3D0 *v0 = TaskManager_Environment(param0);
UnkStruct_0204F3D0 *v0 = FieldTask_GetEnv(param0);
switch (v0->unk_00) {
case 0:
@ -288,21 +288,21 @@ static BOOL sub_0204F414(FieldTask *param0)
void sub_0204F470(FieldTask *param0, void **param1, u8 param2)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0204F470 *v1 = Heap_AllocFromHeap(11, sizeof(UnkStruct_0204F470));
MI_CpuClear8(v1, sizeof(UnkStruct_0204F470));
v1->unk_04 = param2;
v1->unk_08 = param1;
FieldTask_Start(fieldSystem->taskManager, sub_0204F4A4, v1);
FieldTask_InitCall(fieldSystem->taskManager, sub_0204F4A4, v1);
return;
}
static BOOL sub_0204F4A4(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0204F470 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0204F470 *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_00) {
case UnkEnum_0204F13C_1:
@ -374,7 +374,7 @@ static int sub_0204F5D8(UnkStruct_0204F470 *param0, FieldSystem *fieldSystem)
int v0;
PartyManagementData *v1;
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
return UnkEnum_0204F13C_2;
}
@ -446,7 +446,7 @@ static int sub_0204F6B0(UnkStruct_0204F470 *param0, FieldSystem *fieldSystem)
{
PokemonSummary *v0;
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
return UnkEnum_0204F13C_4;
}

View File

@ -172,14 +172,14 @@ static void sub_0204FCF8(FieldTask *param0, u16 param1, u16 param2, u16 *param3)
v0->unk_0C = param3;
CommFieldCmd_Init(v0);
FieldTask_Start(param0, sub_0204FD38, v0);
FieldTask_InitCall(param0, sub_0204FD38, v0);
return;
}
static BOOL sub_0204FD38(FieldTask *param0)
{
UnkStruct_0204FCF8 *v0 = TaskManager_Environment(param0);
UnkStruct_0204FCF8 *v0 = FieldTask_GetEnv(param0);
switch (v0->unk_00) {
case 0:
@ -212,7 +212,7 @@ static BOOL sub_0204FD38(FieldTask *param0)
static void sub_0204FDB4(FieldTask *param0, void **param1, u8 param2)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0204FE50 *v1 = Heap_AllocFromHeap(11, sizeof(UnkStruct_0204FE50));
MI_CpuClear8(v1, sizeof(UnkStruct_0204FE50));
@ -220,14 +220,14 @@ static void sub_0204FDB4(FieldTask *param0, void **param1, u8 param2)
v1->unk_04 = param2;
v1->unk_0C = param1;
FieldTask_Start(fieldSystem->taskManager, sub_0204FDE8, v1);
FieldTask_InitCall(fieldSystem->taskManager, sub_0204FDE8, v1);
return;
}
static BOOL sub_0204FDE8(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0204FE50 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0204FE50 *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_00) {
case 0:
@ -292,7 +292,7 @@ static int sub_0204FF1C(UnkStruct_0204FE50 *param0, FieldSystem *fieldSystem)
int v0;
PartyManagementData *v1;
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
return 1;
}
@ -351,7 +351,7 @@ static int sub_0204FFF4(UnkStruct_0204FE50 *param0, FieldSystem *fieldSystem)
{
PokemonSummary *v0;
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
return 3;
}

View File

@ -164,12 +164,12 @@ void sub_02050224(FieldTask *param0, u16 param1, u16 param2, u16 *param3)
v0->unk_0C = param3;
CommFieldCmd_Init(v0);
FieldTask_Start(param0, sub_02050264, v0);
FieldTask_InitCall(param0, sub_02050264, v0);
}
static BOOL sub_02050264(FieldTask *param0)
{
UnkStruct_02050224 *v0 = TaskManager_Environment(param0);
UnkStruct_02050224 *v0 = FieldTask_GetEnv(param0);
switch (v0->unk_00) {
case 0:
@ -202,7 +202,7 @@ static BOOL sub_02050264(FieldTask *param0)
void sub_020502E0(FieldTask *param0, void **param1, u8 param2)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0205037C *v1 = Heap_AllocFromHeap(11, sizeof(UnkStruct_0205037C));
MI_CpuClear8(v1, sizeof(UnkStruct_0205037C));
@ -210,14 +210,14 @@ void sub_020502E0(FieldTask *param0, void **param1, u8 param2)
v1->unk_04 = param2;
v1->unk_0C = param1;
FieldTask_Start(fieldSystem->taskManager, sub_02050314, v1);
FieldTask_InitCall(fieldSystem->taskManager, sub_02050314, v1);
return;
}
static BOOL sub_02050314(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0205037C *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0205037C *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_00) {
case 0:
@ -280,7 +280,7 @@ static int sub_02050448(UnkStruct_0205037C *param0, FieldSystem *fieldSystem)
int v0;
PartyManagementData *v1;
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
return 1;
}
@ -339,7 +339,7 @@ static int sub_02050520(UnkStruct_0205037C *param0, FieldSystem *fieldSystem)
{
PokemonSummary *v0;
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
return 3;
}

View File

@ -44,13 +44,13 @@ void sub_02050568(FieldSystem *fieldSystem)
UnkStruct_02050568 *v0 = Heap_AllocFromHeapAtEnd(11, sizeof(UnkStruct_02050568));
memset(v0, 0, sizeof(UnkStruct_02050568));
FieldTask_Start(fieldSystem->taskManager, sub_020505A0, v0);
FieldTask_InitCall(fieldSystem->taskManager, sub_020505A0, v0);
}
static BOOL sub_020505A0(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_02050568 *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_02050568 *v1 = FieldTask_GetEnv(taskMan);
VarsFlags *v2 = SaveData_GetVarsFlags(fieldSystem->saveData);
switch (v1->unk_08) {

View File

@ -76,8 +76,8 @@ static BOOL sub_02051074(FieldTask *taskMan);
static BOOL sub_02050A74(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
BattleParams *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
BattleParams *v1 = FieldTask_GetEnv(taskMan);
int *v2 = FieldTask_GetState(taskMan);
switch (*v2) {
@ -86,7 +86,7 @@ static BOOL sub_02050A74(FieldTask *taskMan)
(*v2)++;
break;
case 1:
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
break;
}
@ -98,7 +98,7 @@ static BOOL sub_02050A74(FieldTask *taskMan)
void sub_02050ABC(FieldTask *taskMan, BattleParams *param1)
{
FieldTask_Start(taskMan, sub_02050A74, param1);
FieldTask_InitCall(taskMan, sub_02050A74, param1);
}
static UnkStruct_02050ACC *sub_02050ACC(BattleParams *param0, int param1, int param2, int *param3)
@ -152,8 +152,8 @@ static BOOL sub_02050B30(FieldTask *taskMan)
UnkStruct_02050ACC *v1;
int *v2;
fieldSystem = TaskManager_FieldSystem(taskMan);
v1 = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
v1 = FieldTask_GetEnv(taskMan);
v2 = FieldTask_GetState(taskMan);
switch (*v2) {
@ -213,7 +213,7 @@ static void sub_02050C4C(FieldTask *taskMan, BattleParams *param1, int param2, i
UnkStruct_02050ACC *v0;
v0 = sub_02050ACC(param1, param2, param3, param4);
FieldTask_Start(taskMan, sub_02050B30, v0);
FieldTask_InitCall(taskMan, sub_02050B30, v0);
}
static void sub_02050C6C(int param0, FieldSystem *fieldSystem)
@ -236,8 +236,8 @@ static BOOL sub_02050CA8(FieldTask *taskMan)
UnkStruct_02050ACC *v1;
int *v2;
fieldSystem = TaskManager_FieldSystem(taskMan);
v1 = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
v1 = FieldTask_GetEnv(taskMan);
v2 = FieldTask_GetState(taskMan);
switch (*v2) {
@ -281,8 +281,8 @@ static BOOL sub_02050D4C(FieldTask *taskMan)
UnkStruct_02050ACC *v1;
int *v2;
fieldSystem = TaskManager_FieldSystem(taskMan);
v1 = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
v1 = FieldTask_GetEnv(taskMan);
v2 = FieldTask_GetState(taskMan);
switch (*v2) {
@ -343,12 +343,12 @@ void sub_02050E10(FieldSystem *fieldSystem, BattleParams *param1)
UnkStruct_02050ACC *v0;
v0 = sub_02050ACC(param1, EncEffects_CutInEffect(param1), EncEffects_BGM(param1), NULL);
FieldTask_Set(fieldSystem, sub_02051074, v0);
FieldSystem_CreateTask(fieldSystem, sub_02051074, v0);
} else {
UnkStruct_02050DD4 *v1;
v1 = sub_02050DD4(param1, EncEffects_CutInEffect(param1), EncEffects_BGM(param1), NULL);
FieldTask_Set(fieldSystem, sub_02050EE0, v1);
FieldSystem_CreateTask(fieldSystem, sub_02050EE0, v1);
}
}
@ -358,12 +358,12 @@ void sub_02050E78(FieldSystem *fieldSystem, FieldTask *param1, BattleParams *par
UnkStruct_02050ACC *v0;
v0 = sub_02050ACC(param2, EncEffects_CutInEffect(param2), EncEffects_BGM(param2), NULL);
FieldTask_Change(param1, sub_02051074, v0);
FieldTask_InitJump(param1, sub_02051074, v0);
} else {
UnkStruct_02050DD4 *v1;
v1 = sub_02050DD4(param2, EncEffects_CutInEffect(param2), EncEffects_BGM(param2), NULL);
FieldTask_Change(param1, sub_02050EE0, v1);
FieldTask_InitJump(param1, sub_02050EE0, v1);
}
}
@ -372,8 +372,8 @@ static BOOL sub_02050EE0(FieldTask *taskMan)
FieldSystem *fieldSystem;
UnkStruct_02050DD4 *v1;
fieldSystem = TaskManager_FieldSystem(taskMan);
v1 = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
v1 = FieldTask_GetEnv(taskMan);
switch (v1->unk_00) {
case 0:
@ -397,7 +397,7 @@ static BOOL sub_02050EE0(FieldTask *taskMan)
if (BattleParams_PlayerWon(v1->unk_10->unk_14) == 0) {
sub_02050DFC(v1);
RadarChain_Clear(fieldSystem->chain);
FieldTask_Change(taskMan, sub_02052B2C, NULL);
FieldTask_InitJump(taskMan, sub_02052B2C, NULL);
return 0;
}
@ -453,8 +453,8 @@ static BOOL sub_02051074(FieldTask *taskMan)
int *v2;
u16 *v3;
fieldSystem = TaskManager_FieldSystem(taskMan);
v1 = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
v1 = FieldTask_GetEnv(taskMan);
v2 = FieldTask_GetState(taskMan);
v3 = sub_0203A784(SaveData_GetFieldOverworldState(fieldSystem->saveData));
@ -537,7 +537,7 @@ void sub_0205120C(FieldTask *taskMan, int *param1)
BattleParams *v1;
FieldSystem *fieldSystem;
fieldSystem = TaskManager_FieldSystem(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
RadarChain_Clear(fieldSystem->chain);
v1 = sub_02051D8C(11, (0x0 | 0x0));
@ -558,7 +558,7 @@ void sub_02051270(FieldTask *taskMan, u16 param1, u8 param2, int *param3, BOOL p
BattleParams *v1;
FieldSystem *fieldSystem;
fieldSystem = TaskManager_FieldSystem(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
RadarChain_Clear(fieldSystem->chain);
v1 = sub_02051D8C(11, (0x0 | 0x0));
@ -582,7 +582,7 @@ void sub_020512E4(FieldTask *taskMan, u16 param1, u8 param2, int *param3, BOOL p
Pokemon *v3;
int v4;
fieldSystem = TaskManager_FieldSystem(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
RadarChain_Clear(fieldSystem->chain);
v1 = sub_02051D8C(11, (0x0 | 0x0));
@ -609,8 +609,8 @@ static BOOL sub_0205136C(FieldTask *taskMan)
UnkStruct_02050ACC *v1;
int *v2;
fieldSystem = TaskManager_FieldSystem(taskMan);
v1 = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
v1 = FieldTask_GetEnv(taskMan);
v2 = FieldTask_GetState(taskMan);
switch (*v2) {
@ -663,7 +663,7 @@ void sub_02051450(FieldSystem *fieldSystem, BattleParams *param1)
UnkStruct_02050ACC *v0;
v0 = sub_02050ACC(param1, EncEffects_CutInEffect(param1), EncEffects_BGM(param1), NULL);
FieldTask_Set(fieldSystem, sub_0205136C, v0);
FieldSystem_CreateTask(fieldSystem, sub_0205136C, v0);
}
void sub_02051480(FieldTask *taskMan, int param1, int param2, int *param3)
@ -672,7 +672,7 @@ void sub_02051480(FieldTask *taskMan, int param1, int param2, int *param3)
BattleParams *v1;
FieldSystem *fieldSystem;
fieldSystem = TaskManager_FieldSystem(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
v1 = sub_02051D8C(11, 0x1);
sub_02052314(v1, fieldSystem);
@ -689,8 +689,8 @@ void sub_02051480(FieldTask *taskMan, int param1, int param2, int *param3)
static BOOL sub_020514E8(FieldTask *taskMan)
{
UnkStruct_02050ACC *v0 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_02050ACC *v0 = FieldTask_GetEnv(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
int *v2 = FieldTask_GetState(taskMan);
switch (*v2) {
@ -732,12 +732,12 @@ void sub_02051590(FieldTask *taskMan)
{
UnkStruct_02050ACC *v0;
BattleParams *v1;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
v1 = sub_02051F4C(11, fieldSystem);
v0 = sub_02050ACC(v1, EncEffects_CutInEffect(v1), EncEffects_BGM(v1), NULL);
FieldTask_Start(taskMan, sub_020514E8, v0);
FieldTask_InitCall(taskMan, sub_020514E8, v0);
}
void sub_020515CC(FieldTask *taskMan, int param1, int param2, int param3, int param4, int *param5)
@ -747,7 +747,7 @@ void sub_020515CC(FieldTask *taskMan, int param1, int param2, int param3, int pa
BattleParams *v2;
FieldSystem *fieldSystem;
fieldSystem = TaskManager_FieldSystem(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
if ((param2 != 0) && (param1 != param2)) {
if (param3 == 0) {
@ -780,7 +780,7 @@ void sub_020515CC(FieldTask *taskMan, int param1, int param2, int param3, int pa
void sub_0205167C(FieldTask *taskMan, const u8 *param1, int param2)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_02050ACC *v1;
BattleParams *v2;
@ -788,7 +788,7 @@ void sub_0205167C(FieldTask *taskMan, const u8 *param1, int param2)
sub_020526CC(v2, fieldSystem, param1);
v1 = sub_02050ACC(v2, EncEffects_CutInEffect(v2), EncEffects_BGM(v2), NULL);
FieldTask_Start(taskMan, sub_02050CA8, v1);
FieldTask_InitCall(taskMan, sub_02050CA8, v1);
}
static int sub_020516C8(const BattleRegulation *param0, int param1)
@ -814,7 +814,7 @@ static int sub_020516C8(const BattleRegulation *param0, int param1)
void sub_020516F4(FieldTask *taskMan, int param1, int param2, int param3)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_02050ACC *v1;
BattleParams *v2;
int v3;
@ -848,18 +848,18 @@ void sub_020516F4(FieldTask *taskMan, int param1, int param2, int param3)
v1 = sub_02050ACC(v2, EncEffects_CutInEffect(v2), EncEffects_BGM(v2), NULL);
v1->unk_0C = param1;
FieldTask_Start(taskMan, sub_02050D4C, v1);
FieldTask_InitCall(taskMan, sub_02050D4C, v1);
}
static BOOL sub_02051790(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_02050ACC *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_02050ACC *v1 = FieldTask_GetEnv(taskMan);
int *v2 = FieldTask_GetState(taskMan);
switch (*v2) {
case 0:
FieldTask_Start(taskMan, sub_02050CA8, v1);
FieldTask_InitCall(taskMan, sub_02050CA8, v1);
(*v2)++;
break;
case 1:
@ -888,7 +888,7 @@ void sub_020517E8(FieldSystem *fieldSystem, const u8 *param1, int param2)
v1->unk_18A = sub_020516C8(fieldSystem->unk_B0, param2);
v0 = sub_02050ACC(v1, EncEffects_CutInEffect(v1), EncEffects_BGM(v1), NULL);
FieldTask_Set(fieldSystem, sub_02051790, v0);
FieldSystem_CreateTask(fieldSystem, sub_02051790, v0);
}
void sub_0205184C(FieldSystem *fieldSystem, const Party *param1, int param2)
@ -905,7 +905,7 @@ void sub_0205184C(FieldSystem *fieldSystem, const Party *param1, int param2)
v1->unk_18A = sub_020516C8(fieldSystem->unk_B0, param2);
v0 = sub_02050ACC(v1, EncEffects_CutInEffect(v1), EncEffects_BGM(v1), NULL);
FieldTask_Set(fieldSystem, sub_02051790, v0);
FieldSystem_CreateTask(fieldSystem, sub_02051790, v0);
}
static void sub_020518B0(FieldSystem *fieldSystem, BattleParams *param1)
@ -1007,7 +1007,7 @@ void sub_02051ABC(FieldTask *taskMan, u16 param1, u8 param2, int *param3, BOOL p
BattleParams *v1;
FieldSystem *fieldSystem;
fieldSystem = TaskManager_FieldSystem(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
RadarChain_Clear(fieldSystem->chain);
v1 = sub_02051D8C(11, (0x0 | 0x0));

View File

@ -132,14 +132,14 @@ static void sub_02052914(FieldSystem *fieldSystem, FieldTask *param1)
}
Window_CopyToVRAM(&v0->unk_0C);
FieldTask_Start(param1, sub_020529C4, v0);
FieldTask_InitCall(param1, sub_020529C4, v0);
return;
}
static BOOL sub_020529C4(FieldTask *param0)
{
UnkStruct_02052AA4 *v0 = TaskManager_Environment(param0);
UnkStruct_02052AA4 *v0 = FieldTask_GetEnv(param0);
switch (v0->unk_00) {
case 0:
@ -204,7 +204,7 @@ BOOL sub_02052B2C(FieldTask *param0)
FieldSystem *fieldSystem;
int *v1;
fieldSystem = TaskManager_FieldSystem(param0);
fieldSystem = FieldTask_GetFieldSystem(param0);
v1 = FieldTask_GetState(param0);
switch (*v1) {
@ -267,5 +267,5 @@ BOOL sub_02052B2C(FieldTask *param0)
void sub_02052C5C(FieldTask *param0)
{
FieldTask_Start(param0, sub_02052B2C, NULL);
FieldTask_InitCall(param0, sub_02052B2C, NULL);
}

View File

@ -87,8 +87,8 @@ static BOOL sub_02052CBC(FieldTask *param0)
{
Location *v0;
VarsFlags *v1;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0205300C *v3 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0205300C *v3 = FieldTask_GetEnv(param0);
int *v4 = FieldTask_GetState(param0);
UnkStruct_0203E234 *v5 = &v3->unk_04;
@ -98,7 +98,7 @@ static BOOL sub_02052CBC(FieldTask *param0)
(*v4)++;
break;
case 1:
if (!sub_020509B4(fieldSystem)) {
if (!FieldSystem_IsRunningApplication(fieldSystem)) {
Heap_Create(3, 4, 0x20000);
sub_02052F28(fieldSystem, v3);
StartScreenTransition(3, 1, 1, 0x0, 8, 1, 32);
@ -157,7 +157,7 @@ static BOOL sub_02052CBC(FieldTask *param0)
}
break;
case 9:
if (!sub_020509B4(fieldSystem)) {
if (!FieldSystem_IsRunningApplication(fieldSystem)) {
Heap_FreeToHeap(v3);
Heap_Destroy(4);
OS_ResetSystem(0);
@ -179,8 +179,8 @@ void sub_02052E58(FieldTask *param0)
GameRecords *v6;
Party *v7;
fieldSystem = TaskManager_FieldSystem(param0);
v5 = Heap_AllocFromHeap(32, sizeof(UnkStruct_0205300C));
fieldSystem = FieldTask_GetFieldSystem(param0);
v5 = Heap_AllocFromHeap(HEAP_ID_FIELD_TASK, sizeof(UnkStruct_0205300C));
v3 = SaveData_GetVarsFlags(fieldSystem->saveData);
v4 = SaveData_GetTrainerInfo(fieldSystem->saveData);
v1 = FieldOverworldState_GetSpecialLocation(SaveData_GetFieldOverworldState(fieldSystem->saveData));
@ -210,7 +210,7 @@ void sub_02052E58(FieldTask *param0)
v6 = SaveData_GetGameRecordsPtr(fieldSystem->saveData);
GameRecords_IncrementRecordValue(v6, RECORD_UNK_073);
FieldTask_Start(param0, sub_02052CBC, v5);
FieldTask_InitCall(param0, sub_02052CBC, v5);
}
static void sub_02052F28(FieldSystem *fieldSystem, UnkStruct_0205300C *param1)

View File

@ -22,8 +22,8 @@ static BOOL sub_0205578C(FieldTask *param0)
FieldSystem *fieldSystem;
UnkStruct_0205578C *v1;
fieldSystem = TaskManager_FieldSystem(param0);
v1 = TaskManager_Environment(param0);
fieldSystem = FieldTask_GetFieldSystem(param0);
v1 = FieldTask_GetEnv(param0);
switch (v1->unk_00) {
case 0:
@ -51,5 +51,5 @@ void sub_020557DC(FieldTask *param0, int param1, int param2)
v0->unk_08 = param1;
v0->unk_0C = param2;
FieldTask_Start(param0, sub_0205578C, v0);
FieldTask_InitCall(param0, sub_0205578C, v0);
}

View File

@ -12,7 +12,7 @@
static BOOL sub_02055808(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
if (!FieldSystem_HasParentProcess(fieldSystem)) {
return 1;
@ -23,7 +23,7 @@ static BOOL sub_02055808(FieldTask *param0)
void FieldTask_FinishFieldMap(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
if (!FieldSystem_HasParentProcess(fieldSystem)) {
GF_ASSERT(FALSE);
@ -31,14 +31,14 @@ void FieldTask_FinishFieldMap(FieldTask *param0)
}
FieldSystem_FlagNotRunningFieldMap(fieldSystem);
FieldTask_Start(param0, sub_02055808, NULL);
FieldTask_InitCall(param0, sub_02055808, NULL);
}
static BOOL sub_02055850(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
if (sub_020509DC(fieldSystem)) {
if (FieldSystem_IsRunningFieldMap(fieldSystem)) {
return 1;
}
@ -47,15 +47,15 @@ static BOOL sub_02055850(FieldTask *param0)
void FieldTask_StartFieldMap(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
if (FieldSystem_HasParentProcess(fieldSystem)) {
GF_ASSERT(FALSE);
return;
}
sub_020509D4(fieldSystem);
FieldTask_Start(param0, sub_02055850, NULL);
FieldSystem_StartFieldMap(fieldSystem);
FieldTask_InitCall(param0, sub_02055850, NULL);
}
static BOOL sub_02055898(FieldTask *param0)
@ -69,7 +69,7 @@ static BOOL sub_02055898(FieldTask *param0)
void sub_020558AC(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
if (!FieldSystem_HasParentProcess(fieldSystem)) {
GF_ASSERT(FALSE);
@ -78,13 +78,13 @@ void sub_020558AC(FieldTask *param0)
{
StartScreenTransition(0, 0, 0, 0x0, 6, 1, 4);
FieldTask_Start(param0, sub_02055898, NULL);
FieldTask_InitCall(param0, sub_02055898, NULL);
}
}
void sub_020558F0(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
if (!FieldSystem_HasParentProcess(fieldSystem)) {
GF_ASSERT(FALSE);
@ -93,7 +93,7 @@ void sub_020558F0(FieldTask *param0)
{
StartScreenTransition(0, 1, 1, 0x0, 6, 1, 4);
FieldTask_Start(param0, sub_02055898, NULL);
FieldTask_InitCall(param0, sub_02055898, NULL);
}
}
@ -119,13 +119,13 @@ static BOOL sub_02055934(FieldTask *param0)
void FieldTask_FinishFadeOut(FieldTask *param0)
{
FieldTask_Start(param0, sub_02055934, NULL);
FieldTask_InitCall(param0, sub_02055934, NULL);
}
static BOOL sub_02055984(FieldTask *param0)
{
int *v0 = FieldTask_GetState(param0);
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
switch (*v0) {
case 0:
@ -146,5 +146,5 @@ static BOOL sub_02055984(FieldTask *param0)
void FieldTask_StartFadeIn(FieldTask *param0)
{
FieldTask_Start(param0, sub_02055984, NULL);
FieldTask_InitCall(param0, sub_02055984, NULL);
}

View File

@ -383,8 +383,8 @@ static void sub_0205610C(FieldSystem *fieldSystem, UnkStruct_020562AC *param1, c
static BOOL sub_02056124(FieldTask *taskMan)
{
FieldSystem *v0 = TaskManager_FieldSystem(taskMan);
UnkStruct_020562AC *v1 = TaskManager_Environment(taskMan);
FieldSystem *v0 = FieldTask_GetFieldSystem(taskMan);
UnkStruct_020562AC *v1 = FieldTask_GetEnv(taskMan);
switch (v1->unk_00) {
case 0:
@ -465,13 +465,13 @@ void sub_020562AC(FieldSystem *fieldSystem)
{
UnkStruct_020562AC *v0;
v0 = Heap_AllocFromHeap(32, sizeof(UnkStruct_020562AC));
v0 = Heap_AllocFromHeap(HEAP_ID_FIELD_TASK, sizeof(UnkStruct_020562AC));
v0->unk_00 = 0;
v0->unk_0C = NULL;
v0->unk_04 = PlayerAvatar_GetDir(fieldSystem->playerAvatar);
FieldTask_Start(fieldSystem->taskManager, sub_02056124, v0);
FieldTask_InitCall(fieldSystem->taskManager, sub_02056124, v0);
}
void sub_020562D8(FieldSystem *fieldSystem)

View File

@ -111,13 +111,13 @@ void sub_02056B30(FieldTask *taskMan, int param1, int param2, int param3, u16 pa
v0->unk_1C = param7;
v0->unk_00 = 0;
FieldTask_Start(taskMan, sub_02056B70, v0);
FieldTask_InitCall(taskMan, sub_02056B70, v0);
}
static BOOL sub_02056B70(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_02056B30 *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_02056B30 *v1 = FieldTask_GetEnv(taskMan);
switch (v1->unk_00) {
case 0:
@ -147,7 +147,7 @@ void sub_02056BDC(FieldSystem *fieldSystem, const int param1, const int param2,
v0->unk_20 = param6;
FieldTask_Set(fieldSystem, sub_02056CFC, v0);
FieldSystem_CreateTask(fieldSystem, sub_02056CFC, v0);
}
void sub_02056C18(FieldSystem *fieldSystem, const int param1, const int param2, const int param3, const int param4, const int param5)
@ -198,20 +198,20 @@ void sub_02056C18(FieldSystem *fieldSystem, const int param1, const int param2,
v2->unk_20 = v1;
FieldTask_Set(fieldSystem, sub_02056CFC, v2);
FieldSystem_CreateTask(fieldSystem, sub_02056CFC, v2);
}
static BOOL sub_02056CFC(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_02056BDC *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_02056BDC *v1 = FieldTask_GetEnv(taskMan);
Location *v2 = &v1->unk_08;
switch (v1->unk_00) {
case 0:
v1->unk_04 = 0;
Sound_TryFadeInBGM(fieldSystem, v2->mapId);
FieldTask_Start(taskMan, Unk_020EC560[v1->unk_20], v1);
FieldTask_InitCall(taskMan, Unk_020EC560[v1->unk_20], v1);
(v1->unk_00)++;
break;
case 1:
@ -242,7 +242,7 @@ static BOOL sub_02056CFC(FieldTask *taskMan)
FieldSystem_RequestLocationName(fieldSystem);
v1->unk_04 = 0;
FieldTask_Start(taskMan, Unk_020EC544[v1->unk_20], v1);
FieldTask_InitCall(taskMan, Unk_020EC544[v1->unk_20], v1);
(v1->unk_00)++;
break;
case 6:
@ -255,8 +255,8 @@ static BOOL sub_02056CFC(FieldTask *taskMan)
static BOOL sub_02056DE4(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_02056BDC *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_02056BDC *v1 = FieldTask_GetEnv(taskMan);
switch (v1->unk_04) {
case 0:
@ -274,8 +274,8 @@ static BOOL sub_02056DE4(FieldTask *taskMan)
static BOOL sub_02056E20(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_02056BDC *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_02056BDC *v1 = FieldTask_GetEnv(taskMan);
UnkStruct_ov5_021D432C *v2;
switch (v1->unk_04) {
@ -306,8 +306,8 @@ static BOOL sub_02056E20(FieldTask *taskMan)
static BOOL sub_02056EA4(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_02056BDC *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_02056BDC *v1 = FieldTask_GetEnv(taskMan);
UnkStruct_ov5_021D432C *v2;
switch (v1->unk_04) {
@ -334,8 +334,8 @@ static BOOL sub_02056EA4(FieldTask *taskMan)
static BOOL sub_02056F1C(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_02056BDC *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_02056BDC *v1 = FieldTask_GetEnv(taskMan);
MapObject *v2;
switch (v1->unk_04) {
@ -379,8 +379,8 @@ static BOOL sub_02056F1C(FieldTask *taskMan)
static BOOL sub_02056FC0(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_02056BDC *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_02056BDC *v1 = FieldTask_GetEnv(taskMan);
MapObject *v2 = Player_MapObject(fieldSystem->playerAvatar);
switch (v1->unk_04) {
@ -388,7 +388,7 @@ static BOOL sub_02056FC0(FieldTask *taskMan)
UnkStruct_ov5_021D4E00 *v3;
v3 = ov5_021D4E00();
FieldTask_Start(taskMan, ov5_021D4FA0, v3);
FieldTask_InitCall(taskMan, ov5_021D4FA0, v3);
v1->unk_04++;
} break;
case 1:
@ -400,8 +400,8 @@ static BOOL sub_02056FC0(FieldTask *taskMan)
static BOOL sub_02057008(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_02056BDC *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_02056BDC *v1 = FieldTask_GetEnv(taskMan);
MapObject *v2 = Player_MapObject(fieldSystem->playerAvatar);
switch (v1->unk_04) {
@ -409,7 +409,7 @@ static BOOL sub_02057008(FieldTask *taskMan)
UnkStruct_ov5_021D4E00 *v3;
v3 = ov5_021D4E00();
FieldTask_Start(taskMan, ov5_021D4F14, v3);
FieldTask_InitCall(taskMan, ov5_021D4F14, v3);
v1->unk_04++;
} break;
case 1:
@ -422,8 +422,8 @@ static BOOL sub_02057008(FieldTask *taskMan)
static BOOL sub_02057050(FieldTask *taskMan)
{
MapObject *mapObj;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_02056BDC *v2 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_02056BDC *v2 = FieldTask_GetEnv(taskMan);
UnkStruct_ov5_021D432C *v3;
switch (v2->unk_04) {
@ -440,7 +440,7 @@ static BOOL sub_02057050(FieldTask *taskMan)
UnkStruct_ov5_021D4E00 *v6;
v6 = ov5_021D4E00();
FieldTask_Start(taskMan, ov5_021D5020, v6);
FieldTask_InitCall(taskMan, ov5_021D5020, v6);
(v2->unk_04) = 3;
}
} break;
@ -473,8 +473,8 @@ static BOOL sub_02057050(FieldTask *taskMan)
static BOOL sub_0205711C(FieldTask *taskMan)
{
MapObject *mapObj;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_02056BDC *v2 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_02056BDC *v2 = FieldTask_GetEnv(taskMan);
UnkStruct_ov5_021D432C *v3;
switch (v2->unk_04) {
@ -487,12 +487,12 @@ static BOOL sub_0205711C(FieldTask *taskMan)
if (sub_0205DAEC(v4)) {
MapObject_SetHidden(v5, 1);
v2->unk_04 = 1;
FieldTask_Change(taskMan, sub_02057050, v2);
FieldTask_InitJump(taskMan, sub_02057050, v2);
} else {
UnkStruct_ov5_021D4E00 *v6;
v6 = ov5_021D4E00();
FieldTask_Start(taskMan, ov5_021D5150, v6);
FieldTask_InitCall(taskMan, ov5_021D5150, v6);
(v2->unk_04)++;
}
} break;
@ -505,8 +505,8 @@ static BOOL sub_0205711C(FieldTask *taskMan)
static BOOL sub_020571A0(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_02056BDC *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_02056BDC *v1 = FieldTask_GetEnv(taskMan);
UnkStruct_ov5_021D432C *v2;
switch (v1->unk_04) {
@ -533,8 +533,8 @@ static BOOL sub_020571A0(FieldTask *taskMan)
static BOOL sub_02057218(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_02056BDC *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_02056BDC *v1 = FieldTask_GetEnv(taskMan);
MapObject *v2;
switch (v1->unk_04) {
@ -583,8 +583,8 @@ static BOOL sub_02057218(FieldTask *taskMan)
static BOOL sub_020572B8(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_02056BDC *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_02056BDC *v1 = FieldTask_GetEnv(taskMan);
MapObject *v2 = Player_MapObject(fieldSystem->playerAvatar);
switch (v1->unk_04) {
@ -592,7 +592,7 @@ static BOOL sub_020572B8(FieldTask *taskMan)
UnkStruct_ov5_021D4E00 *v3;
v3 = ov5_021D4E00();
FieldTask_Start(taskMan, ov5_021D4E10, v3);
FieldTask_InitCall(taskMan, ov5_021D4E10, v3);
v1->unk_04++;
} break;
case 1:

View File

@ -35,20 +35,20 @@ void sub_0205749C(FieldTask *param0, BOOL param1)
memset(v0, 0, sizeof(UnkStruct_0205749C));
v0->unk_02 = param1;
FieldTask_Start(param0, sub_020574CC, v0);
FieldTask_InitCall(param0, sub_020574CC, v0);
}
static BOOL sub_020574CC(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0205749C *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0205749C *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_00) {
case 0: {
v1->unk_04.unk_04 = fieldSystem->saveData;
v1->unk_04.unk_08 = v1->unk_02;
v1->unk_04.unk_00 = &fieldSystem->unk_C4;
sub_02050A38(param0, &Unk_020ED4CC, &v1->unk_04);
FieldTask_RunApplication(param0, &Unk_020ED4CC, &v1->unk_04);
v1->unk_00++;
} break;
case 1:

View File

@ -185,7 +185,7 @@ static BOOL sub_0205A258(UnkStruct_0205A0D8 *param0, FieldSystem *fieldSystem)
{
int v0;
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
return 0;
}
@ -214,7 +214,7 @@ static BOOL sub_0205A2B0(UnkStruct_0205A0D8 *param0, FieldSystem *fieldSystem)
{
PokemonSummary *v0;
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
return 0;
}
@ -227,7 +227,7 @@ static BOOL sub_0205A2B0(UnkStruct_0205A0D8 *param0, FieldSystem *fieldSystem)
static BOOL sub_0205A2DC(UnkStruct_0205A0D8 *param0)
{
if (sub_020509DC(param0->fieldSystem)) {
if (FieldSystem_IsRunningFieldMap(param0->fieldSystem)) {
ov5_021D1744(1);
CommPlayerMan_Restart();
return 1;
@ -253,8 +253,8 @@ static BOOL sub_0205A2FC(void)
static BOOL sub_0205A324(FieldTask *param0)
{
UnkStruct_0205A0D8 *v0 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0205A0D8 *v0 = FieldTask_GetEnv(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
switch (v0->unk_34) {
case 0:
@ -385,7 +385,7 @@ static BOOL sub_0205A324(FieldTask *param0)
}
break;
case 19:
sub_020509D4(v0->fieldSystem);
FieldSystem_StartFieldMap(v0->fieldSystem);
if (v0->unk_88 != 3) {
v0->unk_43 = 5;
@ -403,7 +403,7 @@ static BOOL sub_0205A324(FieldTask *param0)
}
break;
case 20:
sub_020509D4(v0->fieldSystem);
FieldSystem_StartFieldMap(v0->fieldSystem);
if (v0->unk_88 != 3) {
v0->unk_34 = 22;
@ -557,7 +557,7 @@ static BOOL sub_0205A324(FieldTask *param0)
break;
case 34:
if (sub_0205A2B0(v0, v0->fieldSystem)) {
sub_020509D4(v0->fieldSystem);
FieldSystem_StartFieldMap(v0->fieldSystem);
v0->unk_34 = 35;
}
break;
@ -709,7 +709,7 @@ void sub_0205AB10(FieldSystem *fieldSystem, UnkFuncPtr_0205AB10 *param1)
break;
}
FieldTask_Set(fieldSystem, sub_0205A324, v0);
FieldSystem_CreateTask(fieldSystem, sub_0205A324, v0);
}
static void sub_0205AC28(UnkStruct_0205A0D8 *param0)
@ -737,7 +737,7 @@ static void sub_0205AC28(UnkStruct_0205A0D8 *param0)
static UnkStruct_0205A0D8 *sub_0205AC74(FieldSystem *fieldSystem)
{
return TaskManager_Environment(fieldSystem->taskManager);
return FieldTask_GetEnv(fieldSystem->taskManager);
}
static void sub_0205AC80(UnkStruct_0205A0D8 *param0, BOOL param1)
@ -1005,8 +1005,8 @@ void sub_0205B110(int param0, int param1, void *param2, void *param3)
static BOOL sub_0205B140(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0205B2D4 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0205B2D4 *v1 = FieldTask_GetEnv(param0);
TrainerCard *v2 = (TrainerCard *)sub_02059EBC(v1->unk_24, NULL, 0);
switch (v1->unk_28) {
@ -1049,16 +1049,16 @@ static BOOL sub_0205B140(FieldTask *param0)
v1->unk_28++;
break;
case 4:
if (!sub_020509B4(fieldSystem)) {
if (!FieldSystem_IsRunningApplication(fieldSystem)) {
v1->unk_28++;
}
break;
case 5:
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
v1->unk_28++;
break;
case 6:
if (!sub_020509DC(fieldSystem)) {
if (!FieldSystem_IsRunningFieldMap(fieldSystem)) {
ov5_021D1744(1);
CommPlayerMan_Restart();
v1->unk_28++;
@ -1093,7 +1093,7 @@ void sub_0205B2D4(FieldSystem *fieldSystem)
v4->unk_24 = v0;
v4->unk_28 = 0;
FieldTask_Set(fieldSystem, sub_0205B140, v4);
FieldSystem_CreateTask(fieldSystem, sub_0205B140, v4);
FieldSystem_PauseProcessing();
break;
}

View File

@ -355,7 +355,7 @@ static void sub_0205B634(UnkStruct_0205B43C *param0)
static void sub_0205B694(UnkStruct_0205B43C *param0)
{
if (!sub_020509A4(param0->fieldSystem)) {
if (!FieldSystem_IsRunningTask(param0->fieldSystem)) {
sub_02036AC4();
sub_0205C160(param0);
sub_0205BEA8(0);

View File

@ -111,7 +111,7 @@ static void sub_0205C304(SysTask *task, void *param1)
UnkStruct_0205C22C *v0 = (UnkStruct_0205C22C *)param1;
UnkStruct_0205B43C *v1 = v0->unk_00;
if (!sub_020509A4(v0->fieldSystem)) {
if (!FieldSystem_IsRunningTask(v0->fieldSystem)) {
v0->playerAvatar = v0->fieldSystem->playerAvatar;
sub_0205C44C(v0, v1, v0->fieldSystem->mapObjMan, v0->unk_474);
sub_0205C51C(v0, v0->fieldSystem->mapObjMan);

View File

@ -290,8 +290,8 @@ BOOL HasAllLegendaryTitansInParty(SaveData *param0)
static BOOL sub_0205E268(FieldTask *param0)
{
VecFx32 v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0205E268 *v2 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0205E268 *v2 = FieldTask_GetEnv(param0);
v0.x = FX32_CONST(8);
v0.z = FX32_CONST(8);
@ -320,7 +320,7 @@ static BOOL sub_0205E268(FieldTask *param0)
void sub_0205E318(FieldTask *param0, MapObject *param1, u16 param2, u16 param3, u16 param4, u16 param5)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0205E268 *v1 = Heap_AllocFromHeapAtEnd(11, sizeof(UnkStruct_0205E268));
MI_CpuClear8(v1, sizeof(UnkStruct_0205E268));
@ -331,13 +331,13 @@ void sub_0205E318(FieldTask *param0, MapObject *param1, u16 param2, u16 param3,
v1->unk_10 = param3;
v1->unk_00 = param1;
FieldTask_Start(fieldSystem->taskManager, sub_0205E268, v1);
FieldTask_InitCall(fieldSystem->taskManager, sub_0205E268, v1);
}
static BOOL sub_0205E3AC(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0205E3AC *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0205E3AC *v1 = FieldTask_GetEnv(param0);
MapObject_SetHidden(v1->unk_00, v1->unk_09);
@ -356,7 +356,7 @@ static BOOL sub_0205E3AC(FieldTask *param0)
void sub_0205E3F4(FieldTask *param0, MapObject *param1, u16 param2, u16 param3)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0205E3AC *v1 = Heap_AllocFromHeapAtEnd(11, sizeof(UnkStruct_0205E3AC));
MI_CpuClear8(v1, sizeof(UnkStruct_0205E3AC));
@ -366,7 +366,7 @@ void sub_0205E3F4(FieldTask *param0, MapObject *param1, u16 param2, u16 param3)
v1->unk_00 = param1;
v1->unk_09 = 0;
FieldTask_Start(fieldSystem->taskManager, sub_0205E3AC, v1);
FieldTask_InitCall(fieldSystem->taskManager, sub_0205E3AC, v1);
}
int sub_0205E430(u8 param0, u8 param1)

View File

@ -267,7 +267,7 @@ static UnkStruct_0206851C *sub_0206851C(u32 param0, u16 param1, u16 param2, u16
{
UnkStruct_0206851C *v0;
v0 = Heap_AllocFromHeap(32, sizeof(UnkStruct_0206851C));
v0 = Heap_AllocFromHeap(HEAP_ID_FIELD_TASK, sizeof(UnkStruct_0206851C));
v0->unk_00 = param0;
v0->unk_04 = param1;
@ -283,10 +283,10 @@ static void sub_02068540(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldSystem *fieldSystem;
FieldMenu *v1;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
v1->unk_22C = sub_020685AC;
v1->unk_25C = sub_0206851C(param2, param0->unk_04, 0, 0, 0);
@ -296,13 +296,13 @@ static void sub_02068540(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
static void sub_02068584(UnkStruct_02068870 *param0, u32 param1)
{
void *v0 = sub_0206851C(param1, param0->unk_28, 0, 0, 0);
FieldTask_Set(param0->fieldSystem, sub_020685AC, v0);
FieldSystem_CreateTask(param0->fieldSystem, sub_020685AC, v0);
}
static BOOL sub_020685AC(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_0206851C *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_0206851C *v1 = FieldTask_GetEnv(taskMan);
int *v2 = FieldTask_GetState(taskMan);
MapObject *v3;
@ -332,8 +332,8 @@ static void sub_02068630(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldMenu *v1;
PartyManagementData *v2;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
v2 = Heap_AllocFromHeap(11, sizeof(PartyManagementData));
memset(v2, 0, sizeof(PartyManagementData));
@ -360,8 +360,8 @@ static void sub_020686C8(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldSystem *fieldSystem;
FieldMenu *v1;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
v1->unk_25C = sub_0203D8AC(fieldSystem);
sub_0203B674(v1, sub_0203C3F4);
@ -383,10 +383,10 @@ static void sub_02068710(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldSystem *fieldSystem;
FieldMenu *v1;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
v1->unk_22C = FieldTask_MapChangeToUnderground;
v1->unk_25C = sub_02053FAC(fieldSystem);
@ -400,7 +400,7 @@ static BOOL sub_02068750(UnkStruct_02068870 *param0)
void *v0 = sub_02053FAC(param0->fieldSystem);
MapObjectMan_PauseAllMovement(param0->fieldSystem->mapObjMan);
FieldTask_Set(param0->fieldSystem, FieldTask_MapChangeToUnderground, v0);
FieldSystem_CreateTask(param0->fieldSystem, FieldTask_MapChangeToUnderground, v0);
param0->fieldSystem->unk_90 = 0;
return 0;
@ -455,10 +455,10 @@ static void sub_0206883C(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldSystem *fieldSystem;
FieldMenu *v1;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
v1->unk_22C = sub_02068884;
v1->unk_25C = NULL;
@ -467,7 +467,7 @@ static void sub_0206883C(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
static BOOL sub_02068870(UnkStruct_02068870 *param0)
{
FieldTask_Set(param0->fieldSystem, sub_02068884, NULL);
FieldSystem_CreateTask(param0->fieldSystem, sub_02068884, NULL);
return 0;
}
@ -476,7 +476,7 @@ static BOOL sub_02068884(FieldTask *param0)
FieldSystem *fieldSystem;
int *v1;
fieldSystem = TaskManager_FieldSystem(param0);
fieldSystem = FieldTask_GetFieldSystem(param0);
v1 = FieldTask_GetState(param0);
switch (*v1) {
@ -560,8 +560,8 @@ static void sub_020689EC(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldSystem *fieldSystem;
FieldMenu *v1;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
sub_0203D30C(fieldSystem, NULL);
sub_0203B674(v1, sub_0203C50C);
@ -585,8 +585,8 @@ static void sub_02068A34(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldMenu *v1;
PartyManagementData *v2;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
v2 = Heap_AllocFromHeap(11, sizeof(PartyManagementData));
memset(v2, 0, sizeof(PartyManagementData));
@ -614,8 +614,8 @@ static void sub_02068ACC(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldMenu *v1;
UnkStruct_02097728 *v2;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
v2 = sub_0203D94C(fieldSystem, 3, Item_MailNumber(param0->unk_04), 11);
v1->unk_260 = sub_0203C540(param0->unk_04, 3, 0);
@ -635,8 +635,8 @@ static void sub_02068B1C(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldMenu *v1;
MapObject *v2;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
if (param1->unk_10 & 0x1) {
sub_02068540(param0, param1, 2801);
@ -660,8 +660,8 @@ static void sub_02068B5C(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldMenu *v1;
UnkStruct_0203D9B8 *v2;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
v2 = sub_0203D9B8(fieldSystem, 11);
v1->unk_25C = v2;
@ -684,8 +684,8 @@ static void sub_02068BA8(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldSystem *fieldSystem;
FieldMenu *v1;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
sub_0203DE78(fieldSystem, fieldSystem->saveData);
v1->unk_25C = NULL;
@ -710,12 +710,12 @@ static void sub_02068BF8(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldMenu *v1;
int *v2;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
v2 = Heap_AllocFromHeapAtEnd(11, sizeof(int));
(*v2) = 0;
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
v1->unk_22C = RefreshRadarChain;
v1->unk_25C = v2;
@ -727,7 +727,7 @@ static BOOL sub_02068C38(UnkStruct_02068870 *param0)
int *v0 = Heap_AllocFromHeapAtEnd(11, sizeof(int));
*v0 = 0;
FieldTask_Set(param0->fieldSystem, RefreshRadarChain, v0);
FieldSystem_CreateTask(param0->fieldSystem, RefreshRadarChain, v0);
return 0;
}
@ -794,10 +794,10 @@ static void sub_02068CF0(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
UnkStruct_ov5_021F0468 *v2;
int v3;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
v3 = ov5_021F0484();
v2 = Heap_AllocFromHeapAtEnd(11, v3);
@ -836,10 +836,10 @@ static void sub_02068D80(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldSystem *fieldSystem;
FieldMenu *v1;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
v1->unk_22C = ov5_021F08F8;
v1->unk_25C = ov5_021F08CC(fieldSystem, 11, 0);
@ -850,7 +850,7 @@ static BOOL sub_02068DBC(UnkStruct_02068870 *param0)
{
void *v0 = ov5_021F08CC(param0->fieldSystem, 4, 0);
FieldTask_Set(param0->fieldSystem, ov5_021F08F8, v0);
FieldSystem_CreateTask(param0->fieldSystem, ov5_021F08F8, v0);
return 0;
}
@ -859,10 +859,10 @@ static void sub_02068DDC(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldSystem *fieldSystem;
FieldMenu *v1;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
v1->unk_22C = ov5_021F08F8;
v1->unk_25C = ov5_021F08CC(fieldSystem, 11, 1);
@ -873,7 +873,7 @@ static BOOL sub_02068E18(UnkStruct_02068870 *param0)
{
void *v0 = ov5_021F08CC(param0->fieldSystem, 4, 1);
FieldTask_Set(param0->fieldSystem, ov5_021F08F8, v0);
FieldSystem_CreateTask(param0->fieldSystem, ov5_021F08F8, v0);
return 0;
}
@ -882,10 +882,10 @@ static void sub_02068E38(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldSystem *fieldSystem;
FieldMenu *v1;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
v1->unk_22C = ov5_021F08F8;
v1->unk_25C = ov5_021F08CC(fieldSystem, 11, 2);
@ -896,7 +896,7 @@ static BOOL sub_02068E74(UnkStruct_02068870 *param0)
{
void *v0 = ov5_021F08CC(param0->fieldSystem, 4, 2);
FieldTask_Set(param0->fieldSystem, ov5_021F08F8, v0);
FieldSystem_CreateTask(param0->fieldSystem, ov5_021F08F8, v0);
return 0;
}
@ -933,7 +933,7 @@ static BOOL sub_02068EFC(UnkStruct_02068870 *param0)
v0->unk_10 = Strbuf_Init(128, 11);
sub_0207CC10(param0->fieldSystem->saveData, v0->unk_10, Bag_GetRegisteredItem(SaveData_GetBag(param0->fieldSystem->saveData)), 11);
FieldTask_Set(param0->fieldSystem, sub_02068F48, v0);
FieldSystem_CreateTask(param0->fieldSystem, sub_02068F48, v0);
return 0;
}
@ -943,8 +943,8 @@ static BOOL sub_02068F48(FieldTask *param0)
FieldSystem *fieldSystem;
UnkStruct_02068EFC *v1;
fieldSystem = TaskManager_FieldSystem(param0);
v1 = TaskManager_Environment(param0);
fieldSystem = FieldTask_GetFieldSystem(param0);
v1 = FieldTask_GetEnv(param0);
switch (v1->unk_16) {
case 0:
@ -985,8 +985,8 @@ static void sub_02068FEC(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldMenu *v1;
PartyManagementData *v2;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
v2 = Heap_AllocFromHeap(11, sizeof(PartyManagementData));
memset(v2, 0, sizeof(PartyManagementData));
@ -1012,10 +1012,10 @@ static void sub_02069080(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
menu = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
menu = FieldTask_GetEnv(param0->unk_00);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
menu->unk_22C = sub_020690F0;
menu->unk_25C = NULL;
@ -1039,10 +1039,10 @@ static u32 sub_020690C4(const UnkStruct_020684D0 *param0)
static BOOL sub_020690F0(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
void *v1 = ov6_02247100(fieldSystem, 11);
FieldTask_Change(param0, ov6_02247120, v1);
FieldTask_InitJump(param0, ov6_02247120, v1);
return 0;
}
@ -1085,8 +1085,8 @@ static void sub_02069188(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldSystem *fieldSystem;
FieldMenu *v1;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
sub_0203DE88(fieldSystem, fieldSystem->saveData);
v1->unk_25C = NULL;
@ -1113,8 +1113,8 @@ static void sub_020691E0(UnkStruct_02068630 *param0, const UnkStruct_020684D0 *p
FieldMenu *v1;
PartyManagementData *v2;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
v1->unk_25C = sub_0203E598(fieldSystem, 11, 466);
@ -1195,7 +1195,7 @@ static void sub_020692E4(UnkStruct_02068870 *param0, u32 param1)
v0->unk_10 = Strbuf_Init(128, 11);
sub_0207CD34(SaveData_GetTrainerInfo(param0->fieldSystem->saveData), v0->unk_10, param0->unk_28, param1, 11);
FieldTask_Set(param0->fieldSystem, sub_02068F48, v0);
FieldSystem_CreateTask(param0->fieldSystem, sub_02068F48, v0);
}
static BOOL sub_0206932C(FieldTask *taskMan)
@ -1203,8 +1203,8 @@ static BOOL sub_0206932C(FieldTask *taskMan)
FieldSystem *fieldSystem;
UnkStruct_02068870 *v1;
fieldSystem = TaskManager_FieldSystem(taskMan);
v1 = TaskManager_Environment(taskMan);
fieldSystem = FieldTask_GetFieldSystem(taskMan);
v1 = FieldTask_GetEnv(taskMan);
switch (v1->unk_2A) {
case 0:
@ -1219,7 +1219,7 @@ static BOOL sub_0206932C(FieldTask *taskMan)
}
break;
case 2:
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
break;
}
@ -1231,11 +1231,11 @@ static BOOL sub_0206932C(FieldTask *taskMan)
}
}
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
v1->unk_2A = 3;
break;
case 3:
if (sub_020509DC(fieldSystem)) {
if (FieldSystem_IsRunningFieldMap(fieldSystem)) {
MapObjectMan_PauseAllMovement(fieldSystem->mapObjMan);
ov5_021D1744(1);
v1->unk_2A = 4;
@ -1256,5 +1256,5 @@ static BOOL sub_0206932C(FieldTask *taskMan)
static void sub_020693F8(UnkStruct_02068870 *param0, UnkFuncPtr_02068870 param1)
{
param0->unk_20 = param1;
FieldTask_Set(param0->fieldSystem, sub_0206932C, param0);
FieldSystem_CreateTask(param0->fieldSystem, sub_0206932C, param0);
}

View File

@ -101,7 +101,7 @@ static int sub_0206BA84(UnkStruct_0206B9D8 *param0, FieldSystem *fieldSystem)
int v0;
PartyManagementData *v1;
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
return 1;
}
@ -161,7 +161,7 @@ static int sub_0206BB6C(UnkStruct_0206B9D8 *param0, FieldSystem *fieldSystem)
{
PokemonSummary *v0;
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
return 3;
}
@ -175,8 +175,8 @@ static int sub_0206BB6C(UnkStruct_0206B9D8 *param0, FieldSystem *fieldSystem)
static BOOL sub_0206BB94(FieldTask *param0)
{
FieldSystem *v0 = TaskManager_FieldSystem(param0);
UnkStruct_0206B9D8 *v1 = TaskManager_Environment(param0);
FieldSystem *v0 = FieldTask_GetFieldSystem(param0);
UnkStruct_0206B9D8 *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_04) {
case 0:
@ -201,7 +201,7 @@ static BOOL sub_0206BB94(FieldTask *param0)
void sub_0206BBFC(FieldTask *param0, void **param1, u8 param2, u8 param3, u8 param4, u8 param5, u8 param6, u8 param7)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0206B9D8 *v1 = Heap_AllocFromHeap(11, sizeof(UnkStruct_0206B9D8));
MI_CpuClear8(v1, sizeof(UnkStruct_0206B9D8));
@ -214,7 +214,7 @@ void sub_0206BBFC(FieldTask *param0, void **param1, u8 param2, u8 param3, u8 par
v1->unk_0D = param7;
v1->unk_14 = param1;
FieldTask_Start(fieldSystem->taskManager, sub_0206BB94, v1);
FieldTask_InitCall(fieldSystem->taskManager, sub_0206BB94, v1);
}
static int sub_0206BC48(UnkStruct_0206BC48 *param0, FieldSystem *fieldSystem)
@ -235,7 +235,7 @@ static int sub_0206BC70(UnkStruct_0206BC48 *param0, FieldSystem *fieldSystem)
u8 v0;
UnkStruct_0206BC70 *v1;
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
return 1;
}
@ -248,8 +248,8 @@ static int sub_0206BC70(UnkStruct_0206BC48 *param0, FieldSystem *fieldSystem)
static BOOL sub_0206BC94(FieldTask *param0)
{
u16 *v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0206BC48 *v2 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0206BC48 *v2 = FieldTask_GetEnv(param0);
switch (v2->unk_04) {
case 0:
@ -270,7 +270,7 @@ static BOOL sub_0206BC94(FieldTask *param0)
void sub_0206BCE4(FieldTask *param0, u16 param1, u16 param2, u16 param3)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0206BC48 *v1 = Heap_AllocFromHeap(11, sizeof(UnkStruct_0206BC48));
MI_CpuClear8(v1, sizeof(UnkStruct_0206BC48));
@ -279,15 +279,15 @@ void sub_0206BCE4(FieldTask *param0, u16 param1, u16 param2, u16 param3)
v1->unk_14 = param3;
v1->unk_10 = param2;
FieldTask_Start(fieldSystem->taskManager, sub_0206BC94, v1);
FieldTask_InitCall(fieldSystem->taskManager, sub_0206BC94, v1);
}
static BOOL sub_0206BD1C(FieldTask *param0)
{
u16 *v0;
const void *v1;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0206BD88 *v3 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0206BD88 *v3 = FieldTask_GetEnv(param0);
v1 = sub_0203664C(1 - CommSys_CurNetId());
@ -314,7 +314,7 @@ static BOOL sub_0206BD1C(FieldTask *param0)
void sub_0206BD88(FieldTask *param0, u16 param1, u16 param2)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0206BD88 *v1 = Heap_AllocFromHeap(11, sizeof(UnkStruct_0206BD88));
MI_CpuClear8(v1, sizeof(UnkStruct_0206BD88));
@ -322,7 +322,7 @@ void sub_0206BD88(FieldTask *param0, u16 param1, u16 param2)
v1->unk_00 = param1;
v1->unk_02 = param2;
FieldTask_Start(fieldSystem->taskManager, sub_0206BD1C, v1);
FieldTask_InitCall(fieldSystem->taskManager, sub_0206BD1C, v1);
}
u16 sub_0206BDBC(SaveData *param0)

View File

@ -46,13 +46,13 @@ void sub_0206C0E8(FieldSystem *fieldSystem)
v0->unk_0C = 0;
v0->unk_0D = 0;
FieldTask_Start(fieldSystem->taskManager, sub_0206C120, v0);
FieldTask_InitCall(fieldSystem->taskManager, sub_0206C120, v0);
}
static BOOL sub_0206C120(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_0206C0E8 *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_0206C0E8 *v1 = FieldTask_GetEnv(taskMan);
switch (v1->unk_0C) {
case 0:

View File

@ -30,8 +30,8 @@ static void sub_0206C660(FieldTask *param0);
void sub_0206C660(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0206C660 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0206C660 *v1 = FieldTask_GetEnv(param0);
{
FS_EXTERN_OVERLAY(overlay95);
@ -43,14 +43,14 @@ void sub_0206C660(FieldTask *param0)
FS_OVERLAY_ID(overlay95),
};
sub_02050A38(param0, &v2, &v1->unk_0C);
FieldTask_RunApplication(param0, &v2, &v1->unk_0C);
}
}
static BOOL sub_0206C680(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0206C660 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0206C660 *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_04) {
case 0:
@ -100,5 +100,5 @@ void sub_0206C740(FieldTask *param0, UnkStruct_ov6_02246204 *param1, int param2,
v0->unk_24 = Pokemon_New(param3);
v0->unk_28 = Pokemon_New(param3);
FieldTask_Start(param0, sub_0206C680, v0);
FieldTask_InitCall(param0, sub_0206C680, v0);
}

View File

@ -126,7 +126,7 @@ void sub_0206C784(FieldSystem *fieldSystem, const u8 param1, const u8 param2, co
v0->unk_00 = 2;
}
FieldTask_Start(fieldSystem->taskManager, sub_0206C964, v0);
FieldTask_InitCall(fieldSystem->taskManager, sub_0206C964, v0);
}
static void sub_0206C8D4(FieldSystem *fieldSystem, const u8 param1, UnkStruct_ov5_021D5894 *param2)
@ -138,13 +138,13 @@ static void sub_0206C8D4(FieldSystem *fieldSystem, const u8 param1, UnkStruct_ov
v0->unk_04 = param2;
v0->unk_00 = param1;
FieldTask_Start(fieldSystem->taskManager, sub_0206C8F8, v0);
FieldTask_InitCall(fieldSystem->taskManager, sub_0206C8F8, v0);
}
static BOOL sub_0206C8F8(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_0206C8D4 *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_0206C8D4 *v1 = FieldTask_GetEnv(taskMan);
int *v2 = FieldTask_GetState(taskMan);
switch (*v2) {
@ -156,7 +156,7 @@ static BOOL sub_0206C8F8(FieldTask *taskMan)
}
break;
case 1:
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
return 0;
}
break;
@ -171,8 +171,8 @@ static BOOL sub_0206C8F8(FieldTask *taskMan)
static BOOL sub_0206C964(FieldTask *taskMan)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_0206CAD0 *v1 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_0206CAD0 *v1 = FieldTask_GetEnv(taskMan);
switch (v1->unk_00) {
case 0:

View File

@ -842,8 +842,8 @@ static void sub_02070288(UnkStruct_0206F7F8 *param0)
static BOOL sub_020702D0(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0206F314 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0206F314 *v1 = FieldTask_GetEnv(param0);
UnkStruct_0206F7F8 *v2 = v1->unk_08;
switch (v1->unk_00) {
@ -904,12 +904,12 @@ static BOOL sub_020702D0(FieldTask *param0)
void sub_020703FC(FieldTask *param0, u16 param1)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0206F314 *v1 = Heap_AllocFromHeap(11, sizeof(UnkStruct_0206F314));
v1->unk_00 = 0;
v1->unk_04 = param1;
v1->unk_08 = NULL;
FieldTask_Start(fieldSystem->taskManager, sub_020702D0, v1);
FieldTask_InitCall(fieldSystem->taskManager, sub_020702D0, v1);
}

View File

@ -42,8 +42,8 @@ void *sub_0207064C(u32 param0, FieldSystem *fieldSystem, Pokemon *param2, u16 pa
BOOL sub_02070680(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0207064C *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0207064C *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_04) {
case 0:

View File

@ -241,7 +241,7 @@ static void sub_02070838(FieldSystem *fieldSystem, UnkStruct_02070950 *param1)
static UnkStruct_0207086C *sub_0207086C(const UnkStruct_020709CC *param0, const UnkStruct_02070950 *param1)
{
UnkStruct_0207086C *v0 = Heap_AllocFromHeap(32, sizeof(UnkStruct_0207086C));
UnkStruct_0207086C *v0 = Heap_AllocFromHeap(HEAP_ID_FIELD_TASK, sizeof(UnkStruct_0207086C));
v0->unk_00 = 0x19740205;
v0->unk_04 = param1->unk_08;
@ -278,10 +278,10 @@ static void sub_020708E0(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
FieldMenu *menu;
UnkStruct_0207086C *v1;
menu = TaskManager_Environment(param0->unk_00);
menu = FieldTask_GetEnv(param0->unk_00);
v1 = sub_0207086C(param0, param1);
sub_020509D4(param1->fieldSystem);
FieldSystem_StartFieldMap(param1->fieldSystem);
menu->unk_22C = sub_02070914;
menu->unk_25C = v1;
@ -290,8 +290,8 @@ static void sub_020708E0(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
static BOOL sub_02070914(FieldTask *taskMan)
{
UnkStruct_0207086C *v0 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_0207086C *v0 = FieldTask_GetEnv(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
ScriptManager_Change(taskMan, 10008, v0->unk_04);
FieldSystem_SetScriptParameters(fieldSystem, v0->unk_08.unk_04, 0, 0, 0);
@ -330,8 +330,8 @@ static void sub_020709CC(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
menu = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
menu = FieldTask_GetEnv(param0->unk_00);
u32 *v2 = (u32 *)Heap_AllocFromHeap(11, 4);
*v2 = param0->unk_04;
@ -374,10 +374,10 @@ static void sub_02070A80(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
FieldMenu *menu;
UnkStruct_0207086C *v1;
menu = TaskManager_Environment(param0->unk_00);
menu = FieldTask_GetEnv(param0->unk_00);
v1 = sub_0207086C(param0, param1);
sub_020509D4(param1->fieldSystem);
FieldSystem_StartFieldMap(param1->fieldSystem);
menu->unk_22C = sub_02070AB4;
menu->unk_25C = v1;
@ -386,8 +386,8 @@ static void sub_02070A80(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
static BOOL sub_02070AB4(FieldTask *taskMan)
{
UnkStruct_0207086C *v0 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_0207086C *v0 = FieldTask_GetEnv(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
ScriptManager_Change(taskMan, 10012, NULL);
FieldSystem_SetScriptParameters(fieldSystem, v0->unk_08.unk_04, 0, 0, 0);
@ -418,10 +418,10 @@ static void sub_02070B28(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
FieldMenu *menu;
UnkStruct_0207086C *v1;
menu = TaskManager_Environment(param0->unk_00);
menu = FieldTask_GetEnv(param0->unk_00);
v1 = sub_0207086C(param0, param1);
sub_020509D4(param1->fieldSystem);
FieldSystem_StartFieldMap(param1->fieldSystem);
menu->unk_22C = sub_02070B5C;
menu->unk_25C = v1;
@ -430,8 +430,8 @@ static void sub_02070B28(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
static BOOL sub_02070B5C(FieldTask *param0)
{
UnkStruct_0207086C *v0 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0207086C *v0 = FieldTask_GetEnv(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
ScriptManager_Change(param0, 10010, v0->unk_04);
FieldSystem_SetScriptParameters(fieldSystem, v0->unk_08.unk_04, 0, 0, 0);
@ -462,10 +462,10 @@ static void sub_02070BD0(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
FieldMenu *menu;
UnkStruct_0207086C *v1;
menu = TaskManager_Environment(param0->unk_00);
menu = FieldTask_GetEnv(param0->unk_00);
v1 = sub_0207086C(param0, param1);
sub_020509D4(param1->fieldSystem);
FieldSystem_StartFieldMap(param1->fieldSystem);
menu->unk_22C = sub_02070C04;
menu->unk_25C = v1;
@ -474,8 +474,8 @@ static void sub_02070BD0(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
static BOOL sub_02070C04(FieldTask *taskMan)
{
UnkStruct_0207086C *v0 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_0207086C *v0 = FieldTask_GetEnv(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
ScriptManager_Change(taskMan, 10014, NULL);
FieldSystem_SetScriptParameters(fieldSystem, v0->unk_08.unk_04, 0, 0, 0);
@ -510,10 +510,10 @@ static void sub_02070C88(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
FieldMenu *menu;
UnkStruct_0207086C *v1;
menu = TaskManager_Environment(param0->unk_00);
menu = FieldTask_GetEnv(param0->unk_00);
v1 = sub_0207086C(param0, param1);
sub_020509D4(param1->fieldSystem);
FieldSystem_StartFieldMap(param1->fieldSystem);
menu->unk_22C = sub_02070CBC;
menu->unk_25C = v1;
@ -522,8 +522,8 @@ static void sub_02070C88(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
static BOOL sub_02070CBC(FieldTask *taskMan)
{
UnkStruct_0207086C *v0 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_0207086C *v0 = FieldTask_GetEnv(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
ScriptManager_Change(taskMan, 10009, v0->unk_04);
FieldSystem_SetScriptParameters(fieldSystem, v0->unk_08.unk_04, 0, 0, 0);
@ -554,10 +554,10 @@ static void sub_02070D30(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
FieldMenu *menu;
UnkStruct_0207086C *v1;
menu = TaskManager_Environment(param0->unk_00);
menu = FieldTask_GetEnv(param0->unk_00);
v1 = sub_0207086C(param0, param1);
sub_020509D4(param1->fieldSystem);
FieldSystem_StartFieldMap(param1->fieldSystem);
menu->unk_22C = sub_02070D64;
menu->unk_25C = v1;
@ -566,8 +566,8 @@ static void sub_02070D30(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
static BOOL sub_02070D64(FieldTask *param0)
{
UnkStruct_0207086C *v0 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0207086C *v0 = FieldTask_GetEnv(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
ScriptManager_Change(param0, 10013, NULL);
FieldSystem_SetScriptParameters(fieldSystem, v0->unk_08.unk_04, 0, 0, 0);
@ -602,10 +602,10 @@ static void sub_02070DEC(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
FieldMenu *menu;
UnkStruct_0207086C *v1;
menu = TaskManager_Environment(param0->unk_00);
menu = FieldTask_GetEnv(param0->unk_00);
v1 = sub_0207086C(param0, param1);
sub_020509D4(param1->fieldSystem);
FieldSystem_StartFieldMap(param1->fieldSystem);
menu->unk_22C = sub_02070E20;
menu->unk_25C = v1;
@ -614,8 +614,8 @@ static void sub_02070DEC(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
static BOOL sub_02070E20(FieldTask *taskMan)
{
UnkStruct_0207086C *v0 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_0207086C *v0 = FieldTask_GetEnv(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
ScriptManager_Change(taskMan, 10011, NULL);
FieldSystem_SetScriptParameters(fieldSystem, v0->unk_08.unk_04, 0, 0, 0);
@ -642,10 +642,10 @@ static void sub_02070E7C(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
FieldMenu *menu;
UnkStruct_0207086C *v1;
menu = TaskManager_Environment(param0->unk_00);
menu = FieldTask_GetEnv(param0->unk_00);
v1 = sub_0207086C(param0, param1);
sub_020509D4(param1->fieldSystem);
FieldSystem_StartFieldMap(param1->fieldSystem);
menu->unk_22C = sub_02070EB0;
menu->unk_25C = v1;
@ -654,8 +654,8 @@ static void sub_02070E7C(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
static BOOL sub_02070EB0(FieldTask *taskMan)
{
UnkStruct_0207086C *v0 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_0207086C *v0 = FieldTask_GetEnv(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
ScriptManager_Change(taskMan, 10015, NULL);
FieldSystem_SetScriptParameters(fieldSystem, v0->unk_08.unk_04, 0, 0, 0);
@ -690,10 +690,10 @@ static void sub_02070F54(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
FieldSystem *fieldSystem;
FieldMenu *menu;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
menu = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
menu = FieldTask_GetEnv(param0->unk_00);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
UnkStruct_020711C8 *v2;
@ -706,12 +706,12 @@ static void sub_02070F54(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
static BOOL sub_02070F94(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_020711C8 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_020711C8 *v1 = FieldTask_GetEnv(param0);
void *v2 = ov6_02247530(fieldSystem, v1->unk_00, 4);
Heap_FreeToHeap(v1);
FieldTask_Change(param0, ov6_02247554, v2);
FieldTask_InitJump(param0, ov6_02247554, v2);
return 0;
}
@ -738,10 +738,10 @@ static void sub_02071010(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
FieldSystem *fieldSystem;
FieldMenu *v1;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
{
UnkStruct_020711C8 *v2;
@ -756,8 +756,8 @@ static void sub_02071010(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
static BOOL sub_02071050(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_020711C8 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_020711C8 *v1 = FieldTask_GetEnv(param0);
void *v2 = ov6_02247488(fieldSystem, v1->unk_00, 11);
{
@ -766,7 +766,7 @@ static BOOL sub_02071050(FieldTask *param0)
}
Heap_FreeToHeap(v1);
FieldTask_Change(param0, ov6_022474AC, v2);
FieldTask_InitJump(param0, ov6_022474AC, v2);
return 0;
}
@ -792,11 +792,11 @@ static void sub_020710D4(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
int v3;
void *v4;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
v1 = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
v1 = FieldTask_GetEnv(param0->unk_00);
v2 = sub_020711C8(11, param0->unk_04, fieldSystem->saveData);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
v1->unk_22C = ov5_021F101C;
v1->unk_25C = v2;
@ -821,11 +821,11 @@ static void sub_02071150(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
FieldMenu *menu;
UnkStruct_0207086C *v2;
fieldSystem = TaskManager_FieldSystem(param0->unk_00);
menu = TaskManager_Environment(param0->unk_00);
fieldSystem = FieldTask_GetFieldSystem(param0->unk_00);
menu = FieldTask_GetEnv(param0->unk_00);
v2 = sub_0207086C(param0, param1);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
menu->unk_22C = sub_0207118C;
menu->unk_25C = v2;
@ -834,8 +834,8 @@ static void sub_02071150(UnkStruct_020709CC *param0, const UnkStruct_02070950 *p
static BOOL sub_0207118C(FieldTask *taskMan)
{
UnkStruct_0207086C *v0 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_0207086C *v0 = FieldTask_GetEnv(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
ScriptManager_Change(taskMan, 8900, NULL);
FieldSystem_SetScriptParameters(fieldSystem, v0->unk_08.unk_04, 0, 0, 0);

View File

@ -305,11 +305,11 @@ void sub_0207183C(FieldSystem *fieldSystem)
if (v1->unk_00 == 0) {
v2->unk_04 = Unk_020F03F4[v1->unk_02].unk_00[1];
FieldTask_Start(fieldSystem->taskManager, sub_020718D8, v2);
FieldTask_InitCall(fieldSystem->taskManager, sub_020718D8, v2);
v1->unk_00 = 1;
} else {
v2->unk_04 = Unk_020F03F4[v1->unk_02].unk_00[0];
FieldTask_Start(fieldSystem->taskManager, sub_020719D8, v2);
FieldTask_InitCall(fieldSystem->taskManager, sub_020719D8, v2);
v1->unk_00 = 0;
}
}
@ -318,8 +318,8 @@ void sub_0207183C(FieldSystem *fieldSystem)
static BOOL sub_020718D8(FieldTask *taskMan)
{
UnkStruct_ov5_021E1890 *v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_020718D8 *v2 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_020718D8 *v2 = FieldTask_GetEnv(taskMan);
switch (v2->unk_00) {
case 0:
@ -379,8 +379,8 @@ static BOOL sub_020718D8(FieldTask *taskMan)
static BOOL sub_020719D8(FieldTask *taskMan)
{
UnkStruct_ov5_021E1890 *v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(taskMan);
UnkStruct_020718D8 *v2 = TaskManager_Environment(taskMan);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
UnkStruct_020718D8 *v2 = FieldTask_GetEnv(taskMan);
switch (v2->unk_00) {
case 0:

View File

@ -281,13 +281,13 @@ void sub_02072204(FieldSystem *fieldSystem)
v0->unk_00 = 0;
v0->unk_04 = (TrainerCard *)sub_0205C17C(fieldSystem->unk_7C);
FieldTask_Start(fieldSystem->taskManager, sub_02072230, v0);
FieldTask_InitCall(fieldSystem->taskManager, sub_02072230, v0);
}
static BOOL sub_02072230(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_02072204 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_02072204 *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_00) {
case 0:
@ -303,7 +303,7 @@ static BOOL sub_02072230(FieldTask *param0)
v1->unk_00 = 11;
break;
case 11:
if (!sub_020509B4(fieldSystem)) {
if (!FieldSystem_IsRunningApplication(fieldSystem)) {
sub_0205C1F0(fieldSystem->unk_7C);
Heap_FreeToHeap(v1);
return 1;

View File

@ -1162,11 +1162,11 @@ static int sub_02073480(UnkStruct_02072334 *param0)
{
switch (param0->unk_12) {
case 0:
sub_020509D4(param0->fieldSystem);
FieldSystem_StartFieldMap(param0->fieldSystem);
param0->unk_12++;
break;
case 1:
if (!sub_020509DC(param0->fieldSystem)) {
if (!FieldSystem_IsRunningFieldMap(param0->fieldSystem)) {
break;
}
@ -1226,7 +1226,7 @@ static int sub_02073524(UnkStruct_02072334 *param0, int param1)
param0->unk_12++;
break;
case 1:
if (sub_020509B4(param0->fieldSystem)) {
if (FieldSystem_IsRunningApplication(param0->fieldSystem)) {
break;
}
@ -1252,7 +1252,7 @@ static int sub_020735E8(UnkStruct_02072334 *param0)
param0->unk_12++;
break;
case 1:
if (sub_020509B4(param0->fieldSystem)) {
if (FieldSystem_IsRunningApplication(param0->fieldSystem)) {
break;
}
@ -1275,8 +1275,8 @@ static int sub_020735E8(UnkStruct_02072334 *param0)
static BOOL sub_02073694(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_020736D8 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_020736D8 *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_04) {
case 0:
@ -1297,11 +1297,11 @@ static BOOL sub_02073694(FieldTask *param0)
void sub_020736D8(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_020736D8 *v1 = Heap_AllocFromHeapAtEnd(11, sizeof(UnkStruct_020736D8));
v1->unk_00 = 0;
v1->unk_04 = 0;
FieldTask_Start(fieldSystem->taskManager, sub_02073694, v1);
FieldTask_InitCall(fieldSystem->taskManager, sub_02073694, v1);
}

View File

@ -87,8 +87,8 @@ static const u8 Unk_020F1B64[4] = {
static BOOL sub_0207DA28(FieldTask *param0)
{
int v0;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0207DE40 *v2 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0207DE40 *v2 = FieldTask_GetEnv(param0);
switch (v2->unk_04) {
case 0:
@ -104,7 +104,7 @@ static BOOL sub_0207DA28(FieldTask *param0)
}
break;
case 2:
sub_02050A38(param0, &Unk_020F1B98, v2->unk_00);
FieldTask_RunApplication(param0, &Unk_020F1B98, v2->unk_00);
v2->unk_04++;
break;
case 3:
@ -205,7 +205,7 @@ static BOOL sub_0207DA28(FieldTask *param0)
v2->unk_04++;
break;
case 13:
if (!sub_020509B4(fieldSystem)) {
if (!FieldSystem_IsRunningApplication(fieldSystem)) {
v2->unk_04 = sub_0207DE40(v2);
}
break;
@ -214,7 +214,7 @@ static BOOL sub_0207DA28(FieldTask *param0)
v2->unk_04++;
break;
case 15:
if (!sub_020509B4(fieldSystem)) {
if (!FieldSystem_IsRunningApplication(fieldSystem)) {
Heap_FreeToHeap(v2->unk_10);
v2->unk_04 = 2;
}
@ -225,7 +225,7 @@ static BOOL sub_0207DA28(FieldTask *param0)
v2->unk_04++;
break;
case 17:
if (!sub_020509B4(fieldSystem)) {
if (!FieldSystem_IsRunningApplication(fieldSystem)) {
Heap_FreeToHeap(v2->unk_10);
v2->unk_04 = 2;
}
@ -235,7 +235,7 @@ static BOOL sub_0207DA28(FieldTask *param0)
v2->unk_04++;
break;
case 19:
if (!sub_020509B4(fieldSystem)) {
if (!FieldSystem_IsRunningApplication(fieldSystem)) {
v2->unk_04 = sub_0207DE40(v2);
}
break;
@ -245,7 +245,7 @@ static BOOL sub_0207DA28(FieldTask *param0)
v2->unk_04++;
break;
case 21:
if (!sub_020509B4(fieldSystem)) {
if (!FieldSystem_IsRunningApplication(fieldSystem)) {
v2->unk_04 = 2;
sub_0207DED8(v2->unk_10);
}
@ -255,7 +255,7 @@ static BOOL sub_0207DA28(FieldTask *param0)
v2->unk_04++;
break;
case 23:
if (!sub_020509B4(fieldSystem)) {
if (!FieldSystem_IsRunningApplication(fieldSystem)) {
v2->unk_04 = sub_0207DE40(v2);
}
break;
@ -265,7 +265,7 @@ static BOOL sub_0207DA28(FieldTask *param0)
v2->unk_04++;
break;
case 25:
if (!sub_020509B4(fieldSystem)) {
if (!FieldSystem_IsRunningApplication(fieldSystem)) {
v2->unk_04 = 2;
sub_0207DF2C(v2->unk_10);
}
@ -275,7 +275,7 @@ static BOOL sub_0207DA28(FieldTask *param0)
v2->unk_04++;
break;
case 27:
if (!sub_020509B4(fieldSystem)) {
if (!FieldSystem_IsRunningApplication(fieldSystem)) {
v2->unk_04 = sub_0207DE40(v2);
}
break;
@ -285,7 +285,7 @@ static BOOL sub_0207DA28(FieldTask *param0)
v2->unk_04++;
break;
case 29:
if (!sub_020509B4(fieldSystem)) {
if (!FieldSystem_IsRunningApplication(fieldSystem)) {
v2->unk_04 = 2;
sub_0207DF88(v2->unk_10);
}
@ -312,7 +312,7 @@ void sub_0207DDC0(FieldTask *param0)
UnkStruct_0207DE40 *v0 = sub_0207DD94();
v0->unk_00->unk_04 = 2;
FieldTask_Start(param0, sub_0207DA28, v0);
FieldTask_InitCall(param0, sub_0207DA28, v0);
}
void sub_0207DDE0(FieldTask *param0, u16 *param1)
@ -322,7 +322,7 @@ void sub_0207DDE0(FieldTask *param0, u16 *param1)
v0->unk_00->unk_04 = 1;
v0->unk_08 = param1;
FieldTask_Start(param0, sub_0207DA28, v0);
FieldTask_InitCall(param0, sub_0207DA28, v0);
}
static void sub_0207DE04(UnkStruct_0207DE40 *param0, FieldSystem *fieldSystem, u32 param2, u32 param3)

View File

@ -160,18 +160,18 @@ void sub_020933F8(FieldTask *param0, UnkStruct_02095C48 *param1)
case 0:
case 1:
case 2:
FieldTask_Start(param0, sub_02093448, v0);
FieldTask_InitCall(param0, sub_02093448, v0);
break;
default:
FieldTask_Start(param0, sub_020935EC, v0);
FieldTask_InitCall(param0, sub_020935EC, v0);
break;
}
}
static BOOL sub_02093448(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_020933F8 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_020933F8 *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_04) {
case 0:
@ -201,7 +201,7 @@ static BOOL sub_02093448(FieldTask *param0)
break;
case 4:
sub_02093BBC(v1->unk_00);
sub_02050A38(param0, &Unk_020F55FC, v1->unk_00->unk_199C);
FieldTask_RunApplication(param0, &Unk_020F55FC, v1->unk_00->unk_199C);
v1->unk_04++;
break;
case 5:
@ -220,25 +220,25 @@ static BOOL sub_02093448(FieldTask *param0)
}
break;
case 7:
sub_02050A38(param0, &Unk_020F55EC, v1->unk_00);
FieldTask_RunApplication(param0, &Unk_020F55EC, v1->unk_00);
v1->unk_04++;
break;
case 8:
if ((v1->unk_00->unk_00.unk_111 == 1) || (v1->unk_00->unk_00.unk_111 == 2)) {
sub_02050A38(param0, &Unk_020F561C, v1->unk_00);
FieldTask_RunApplication(param0, &Unk_020F561C, v1->unk_00);
}
v1->unk_04++;
break;
case 9:
if ((v1->unk_00->unk_00.unk_111 == 0) || (v1->unk_00->unk_00.unk_111 == 2)) {
sub_02050A38(param0, &Unk_020F560C, v1->unk_00);
FieldTask_RunApplication(param0, &Unk_020F560C, v1->unk_00);
}
v1->unk_04++;
break;
case 10:
sub_02050A38(param0, &Unk_020F55DC, v1->unk_00);
FieldTask_RunApplication(param0, &Unk_020F55DC, v1->unk_00);
v1->unk_04++;
break;
case 11:
@ -260,8 +260,8 @@ static BOOL sub_02093448(FieldTask *param0)
static BOOL sub_020935EC(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_020933F8 *v1 = TaskManager_Environment(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_020933F8 *v1 = FieldTask_GetEnv(param0);
switch (v1->unk_04) {
case 0:
@ -273,7 +273,7 @@ static BOOL sub_020935EC(FieldTask *param0)
case 3:
case 4:
sub_02093BBC(v1->unk_00);
sub_02050A38(param0, &Unk_020F55FC, v1->unk_00->unk_199C);
FieldTask_RunApplication(param0, &Unk_020F55FC, v1->unk_00->unk_199C);
break;
}
@ -296,7 +296,7 @@ static BOOL sub_020935EC(FieldTask *param0)
switch (v1->unk_00->unk_00.unk_111) {
case 3:
case 4:
sub_02050A38(param0, &Unk_020F55EC, v1->unk_00);
FieldTask_RunApplication(param0, &Unk_020F55EC, v1->unk_00);
break;
}
@ -307,7 +307,7 @@ static BOOL sub_020935EC(FieldTask *param0)
case 5:
case 6:
sub_02095338(v1->unk_00);
sub_02050A38(param0, &Unk_020F561C, v1->unk_00);
FieldTask_RunApplication(param0, &Unk_020F561C, v1->unk_00);
break;
}
@ -317,7 +317,7 @@ static BOOL sub_020935EC(FieldTask *param0)
switch (v1->unk_00->unk_00.unk_111) {
case 7:
case 8:
sub_02050A38(param0, &Unk_020F560C, v1->unk_00);
FieldTask_RunApplication(param0, &Unk_020F560C, v1->unk_00);
break;
}

View File

@ -310,9 +310,9 @@ void sub_02097F30(UnkStruct_02097F18 *param0, u8 param1)
static BOOL sub_02097F38(FieldTask *param0)
{
UnkStruct_02097F38 *v0 = TaskManager_Environment(param0);
UnkStruct_02097F38 *v0 = FieldTask_GetEnv(param0);
UnkStruct_02097F18 *v1 = v0->unk_08;
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
switch (v0->unk_14) {
case 0:
@ -340,7 +340,7 @@ static BOOL sub_02097F38(FieldTask *param0)
v0->unk_14 = 1;
break;
case 1:
sub_02050A38(param0, &Unk_020F64C0, v1);
FieldTask_RunApplication(param0, &Unk_020F64C0, v1);
v0->unk_14 = 2;
break;
case 2: {
@ -371,7 +371,7 @@ static BOOL sub_02097F38(FieldTask *param0)
v6->unk_20 = 15;
v6->unk_0C = v1->unk_24;
sub_02050A38(param0, &Unk_020F1E88, v6);
FieldTask_RunApplication(param0, &Unk_020F1E88, v6);
v0->unk_14 = 4;
} break;
case 4: {
@ -429,7 +429,7 @@ void sub_020980DC(FieldTask *param0, SaveData *param1)
v0->unk_0C = Heap_AllocFromHeap(11, sizeof(PartyManagementData));
memset(v0->unk_0C, 0, sizeof(PartyManagementData));
FieldTask_Start(param0, sub_02097F38, v0);
FieldTask_InitCall(param0, sub_02097F38, v0);
}
typedef struct {

View File

@ -196,7 +196,7 @@ static int sub_02098388(OverlayManager *param0, int *param1)
static BOOL sub_0209843C(FieldTask *param0)
{
UnkStruct_0209843C *v0 = TaskManager_Environment(param0);
UnkStruct_0209843C *v0 = FieldTask_GetEnv(param0);
switch (v0->unk_00) {
case 0:
@ -205,11 +205,11 @@ static BOOL sub_0209843C(FieldTask *param0)
v0->unk_00++;
break;
case 1:
sub_02050A38(param0, &Unk_020F67FC, v0);
FieldTask_RunApplication(param0, &Unk_020F67FC, v0);
v0->unk_00++;
break;
case 2: {
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
{
Pokemon *v2 = v0->unk_0C.unk_00;
@ -235,7 +235,7 @@ static BOOL sub_0209843C(FieldTask *param0)
}
} break;
case 3: {
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
int v9;
v9 = Pokemon_GetValue(v0->unk_0C.unk_00, MON_DATA_SPECIES, 0);
@ -243,7 +243,7 @@ static BOOL sub_0209843C(FieldTask *param0)
v0->unk_08 = sub_0208712C(11, 1, v9, 10, SaveData_Options(FieldSystem_GetSaveData(fieldSystem)));
v0->unk_08->unk_10 = Pokemon_GetValue(v0->unk_0C.unk_00, MON_DATA_GENDER, NULL);
v0->unk_08->unk_08 = Pokemon_GetValue(v0->unk_0C.unk_00, MON_DATA_FORM, NULL);
sub_02050A38(param0, &Unk_020F2DAC, v0->unk_08);
FieldTask_RunApplication(param0, &Unk_020F2DAC, v0->unk_08);
v0->unk_00++;
} break;
case 4:
@ -251,7 +251,7 @@ static BOOL sub_0209843C(FieldTask *param0)
Pokemon_SetValue(v0->unk_0C.unk_00, MON_DATA_NICKNAME_STRBUF_AND_FLAG, v0->unk_08->unk_18);
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
GameRecords *v11 = SaveData_GetGameRecordsPtr(FieldSystem_GetSaveData(fieldSystem));
GameRecords_IncrementRecordValue(v11, RECORD_UNK_049);
@ -284,5 +284,5 @@ void sub_020985AC(FieldTask *param0, void *param1)
v1 = (UnkStruct_0203E2FC *)param1;
v0->unk_0C = *v1;
FieldTask_Start(param0, sub_0209843C, v0);
FieldTask_InitCall(param0, sub_0209843C, v0);
}

View File

@ -35,7 +35,7 @@ void sub_020985E4(FieldTask *param0, SaveData *param1)
v0->unk_00 = 0;
v0->unk_04 = v1;
FieldTask_Start(param0, sub_0209862C, v0);
FieldTask_InitCall(param0, sub_0209862C, v0);
}
BOOL sub_0209862C(FieldTask *param0)
@ -43,8 +43,8 @@ BOOL sub_0209862C(FieldTask *param0)
FieldSystem *fieldSystem;
UnkStruct_0209862C *v1;
fieldSystem = TaskManager_FieldSystem(param0);
v1 = TaskManager_Environment(param0);
fieldSystem = FieldTask_GetFieldSystem(param0);
v1 = FieldTask_GetEnv(param0);
switch (v1->unk_00) {
case 0:
@ -68,13 +68,13 @@ BOOL sub_0209862C(FieldTask *param0)
}
break;
case 2:
if (sub_020509B4(fieldSystem) == 0) {
sub_020509D4(fieldSystem);
if (FieldSystem_IsRunningApplication(fieldSystem) == 0) {
FieldSystem_StartFieldMap(fieldSystem);
v1->unk_00++;
}
break;
case 3:
if (sub_020509DC(fieldSystem) == 0) {
if (FieldSystem_IsRunningFieldMap(fieldSystem) == 0) {
v1->unk_00++;
}
break;

View File

@ -20,8 +20,8 @@ BOOL sub_0209AC14(FieldTask *param0)
FieldSystem *fieldSystem;
UnkStruct_ov7_0224D008 *v1;
fieldSystem = TaskManager_FieldSystem(param0);
v1 = TaskManager_Environment(param0);
fieldSystem = FieldTask_GetFieldSystem(param0);
v1 = FieldTask_GetEnv(param0);
switch (v1->unk_297) {
case 16:
@ -37,14 +37,14 @@ BOOL sub_0209AC14(FieldTask *param0)
static u8 sub_0209AC50(FieldSystem *fieldSystem, UnkStruct_ov7_0224D008 *param1)
{
if (sub_020509B4(fieldSystem)) {
if (FieldSystem_IsRunningApplication(fieldSystem)) {
return 16;
}
param1->unk_2A8 = sub_0207CBAC(param1->unk_04);
Heap_FreeToHeap(param1->unk_04);
sub_020509D4(fieldSystem);
FieldSystem_StartFieldMap(fieldSystem);
return 17;
}
@ -54,12 +54,12 @@ static void sub_0209AC80(FieldTask *param0)
FieldSystem *fieldSystem;
UnkStruct_ov7_0224D008 *v1;
fieldSystem = TaskManager_FieldSystem(param0);
v1 = TaskManager_Environment(param0);
fieldSystem = FieldTask_GetFieldSystem(param0);
v1 = FieldTask_GetEnv(param0);
if (sub_020509DC(fieldSystem)) {
if (FieldSystem_IsRunningFieldMap(fieldSystem)) {
ov5_021D1744(1);
FieldTask_Change(param0, ov7_0224CEAC, v1);
FieldTask_InitJump(param0, ov7_0224CEAC, v1);
v1->unk_297 = 18;
}
}

View File

@ -62,8 +62,8 @@ static int sub_0209B288(UnkStruct_0209AD84 *param0);
void sub_0209ACF4(FieldTask *param0)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0209AD84 *v1 = Heap_AllocFromHeap(32, sizeof(UnkStruct_0209AD84));
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0209AD84 *v1 = Heap_AllocFromHeap(HEAP_ID_FIELD_TASK, sizeof(UnkStruct_0209AD84));
v1->fieldSystem = fieldSystem;
v1->unk_04 = Strbuf_Init(400, 32);
@ -80,7 +80,7 @@ void sub_0209ACF4(FieldTask *param0)
v1->unk_54 = 0;
FieldTask_Start(param0, sub_0209AE14, v1);
FieldTask_InitCall(param0, sub_0209AE14, v1);
}
static void sub_0209AD84(UnkStruct_0209AD84 *param0)
@ -115,7 +115,7 @@ static void sub_0209ADBC(UnkStruct_0209AD84 *param0)
static BOOL sub_0209AE14(FieldTask *param0)
{
UnkStruct_0209AD84 *v0 = TaskManager_Environment(param0);
UnkStruct_0209AD84 *v0 = FieldTask_GetEnv(param0);
switch (v0->unk_54) {
case 0:
@ -177,13 +177,13 @@ static BOOL sub_0209AE14(FieldTask *param0)
}
break;
case 6:
if (sub_020509B4(v0->fieldSystem) == 0) {
sub_020509D4(v0->fieldSystem);
if (FieldSystem_IsRunningApplication(v0->fieldSystem) == 0) {
FieldSystem_StartFieldMap(v0->fieldSystem);
v0->unk_54 = 7;
}
break;
case 7:
if (sub_020509DC(v0->fieldSystem)) {
if (FieldSystem_IsRunningFieldMap(v0->fieldSystem)) {
ov5_021D1744(1);
v0->unk_54 = 8;
}

View File

@ -34,8 +34,8 @@ static BOOL sub_0209B3C4(FieldTask *param0);
void sub_0209B344(FieldTask *param0, u16 *param1)
{
FieldSystem *fieldSystem = TaskManager_FieldSystem(param0);
UnkStruct_0209B3AC *v1 = Heap_AllocFromHeap(32, sizeof(UnkStruct_0209B3AC));
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
UnkStruct_0209B3AC *v1 = Heap_AllocFromHeap(HEAP_ID_FIELD_TASK, sizeof(UnkStruct_0209B3AC));
v1->fieldSystem = fieldSystem;
v1->unk_04 = StringTemplate_Default(32);
@ -48,7 +48,7 @@ void sub_0209B344(FieldTask *param0, u16 *param1)
sub_02097520(v1->unk_10);
v1->unk_18 = 0;
FieldTask_Start(param0, sub_0209B3C4, v1);
FieldTask_InitCall(param0, sub_0209B3C4, v1);
return;
}
@ -62,7 +62,7 @@ static void sub_0209B3AC(UnkStruct_0209B3AC *param0)
static BOOL sub_0209B3C4(FieldTask *param0)
{
UnkStruct_0209B3AC *v0 = TaskManager_Environment(param0);
UnkStruct_0209B3AC *v0 = FieldTask_GetEnv(param0);
switch (v0->unk_18) {
case 0:
@ -72,13 +72,13 @@ static BOOL sub_0209B3C4(FieldTask *param0)
v0->unk_18 = 1;
break;
case 1:
if (sub_020509B4(v0->fieldSystem) == 0) {
sub_020509D4(v0->fieldSystem);
if (FieldSystem_IsRunningApplication(v0->fieldSystem) == 0) {
FieldSystem_StartFieldMap(v0->fieldSystem);
v0->unk_18 = 2;
}
break;
case 2:
if (sub_020509DC(v0->fieldSystem)) {
if (FieldSystem_IsRunningFieldMap(v0->fieldSystem)) {
ov5_021D1744(1);
v0->unk_18 = 3;
}

View File

@ -104,7 +104,7 @@ static BOOL sub_0209C25C(UnkStruct_0209C1EC *param0)
static BOOL sub_0209C280(UnkStruct_0209C1EC *param0)
{
if (sub_020509B4(param0->fieldSystem) == 0) {
if (FieldSystem_IsRunningApplication(param0->fieldSystem) == 0) {
if (sub_0209C1E8(param0->unk_28) == 0) {
param0->unk_00 = 5;
} else {
@ -121,7 +121,7 @@ static BOOL sub_0209C280(UnkStruct_0209C1EC *param0)
static BOOL sub_0209C2C0(UnkStruct_0209C1EC *param0)
{
if (sub_020509B4(param0->fieldSystem) == 0) {
if (FieldSystem_IsRunningApplication(param0->fieldSystem) == 0) {
int v0 = param0->unk_30->unk_22;
Heap_FreeToHeap(param0->unk_30);
@ -145,7 +145,7 @@ static BOOL sub_0209C2C0(UnkStruct_0209C1EC *param0)
static BOOL sub_0209C324(UnkStruct_0209C1EC *param0)
{
if (sub_020509B4(param0->fieldSystem) == 0) {
if (FieldSystem_IsRunningApplication(param0->fieldSystem) == 0) {
Heap_FreeToHeap(param0->unk_34);
param0->unk_30 = sub_0203D644(param0->fieldSystem, param0->unk_04);
param0->unk_00 = 2;
@ -156,7 +156,7 @@ static BOOL sub_0209C324(UnkStruct_0209C1EC *param0)
static BOOL sub_0209C34C(UnkStruct_0209C1EC *param0)
{
if (sub_020509B4(param0->fieldSystem) == 0) {
if (FieldSystem_IsRunningApplication(param0->fieldSystem) == 0) {
param0->unk_00 = 5;
}