Finish labelling some structures

This commit is contained in:
Fexty12573 2024-06-04 21:07:05 +02:00
parent eae13c3639
commit ac0237b044
10 changed files with 75 additions and 73 deletions

View File

@ -0,0 +1,9 @@
#ifndef POKEPLATINUM_MAP_OBJECT_ANIM_CMD_H
#define POKEPLATINUM_MAP_OBJECT_ANIM_CMD_H
typedef struct MapObjectAnimCmd {
u16 unk_00;
u16 unk_02;
} MapObjectAnimCmd;
#endif // POKEPLATINUM_MAP_OBJECT_ANIM_CMD_H

View File

@ -1,9 +0,0 @@
#ifndef POKEPLATINUM_STRUCT_OV5_021F8E3C_H
#define POKEPLATINUM_STRUCT_OV5_021F8E3C_H
typedef struct {
u16 unk_00;
u16 unk_02;
} UnkStruct_ov5_021F8E3C;
#endif // POKEPLATINUM_STRUCT_OV5_021F8E3C_H

View File

@ -3,7 +3,7 @@
#include "struct_decls/sys_task.h"
#include "struct_decls/struct_02061AB4_decl.h"
#include "overlay005/struct_ov5_021F8E3C.h"
#include "overlay005/map_object_anim_cmd.h"
int LocalMapObj_IsAnimationSet(const MapObject * param0);
void LocalMapObj_SetAnimationCode(MapObject * param0, int param1);
@ -11,7 +11,7 @@ void sub_02065668(MapObject * param0, int param1);
int LocalMapObj_CheckAnimationFinished(const MapObject * param0);
int sub_020656AC(MapObject * param0);
void sub_020656DC(MapObject * param0);
SysTask * MapObject_StartAnimation(MapObject * param0, const UnkStruct_ov5_021F8E3C * param1);
SysTask * MapObject_StartAnimation(MapObject * param0, const MapObjectAnimCmd * param1);
int MapObject_HasAnimationEnded(SysTask * param0);
void MapObject_FinishAnimation(SysTask * param0);
int sub_02065838(int param0, int param1);

View File

@ -15,7 +15,7 @@
#include "overlay101/struct_ov101_021D5D90_decl.h"
#include "field/field_system.h"
#include "overlay005/struct_ov5_021F8E3C.h"
#include "overlay005/map_object_anim_cmd.h"
#include "overlay006/battle_params.h"
#include "unk_02005474.h"
@ -1451,7 +1451,7 @@ static int(*const Unk_ov5_021F9AFC[])(UnkStruct_ov5_021F9B10 *) = {
ov5_021E0D40
};
static const UnkStruct_ov5_021F8E3C Unk_ov5_021F9B9C[] = {
static const MapObjectAnimCmd Unk_ov5_021F9B9C[] = {
{0x1, 0x1},
{0x3C, 0x2},
{0x2, 0x1},
@ -1479,7 +1479,7 @@ static const UnkStruct_ov5_021F8E3C Unk_ov5_021F9B9C[] = {
{0xfe, 0x0}
};
static const UnkStruct_ov5_021F8E3C Unk_ov5_021F9C00[] = {
static const MapObjectAnimCmd Unk_ov5_021F9C00[] = {
{0x1, 0x1},
{0x2, 0x1},
{0x0, 0x1},

View File

@ -7,7 +7,7 @@
#include "struct_decls/struct_02061AB4_decl.h"
#include "field/field_system.h"
#include "overlay005/struct_ov5_021F8E3C.h"
#include "overlay005/map_object_anim_cmd.h"
#include "unk_02005474.h"
#include "string_template.h"
@ -33,9 +33,11 @@
#define VS_SEEKER_SEARCH_RADIUS_DOWN 6
#define VS_SEEKER_MAX_BATTERY 100
#define VS_SEEKER_REMATCH_CHANCE 50
#define VS_SEEKER_REMATCH_DATA_DUMMY 0xFFFF
#define VS_SEEKER_REMATCH_DATA_END 0x0
typedef enum VsSeekerUsability {
VS_SEEKER_USABILITY_NO_BATTERY,
VS_SEEKER_USABILITY_NO_TRAINERS,
@ -61,14 +63,14 @@ typedef enum VsSeeker2v2TrainerSearchMode {
} VsSeeker2v2TrainerSearchMode;
typedef struct {
u16 unk_00[6];
} RematchData;
u16 trainerIDs[6];
} VsSeekerRematchData;
typedef struct {
VsSeekerState state;
FieldSystem *fieldSystem;
VarsFlags *events;
const RematchData *rematchData;
const VsSeekerRematchData *rematchData;
MapObject *trainers[64];
u16 numVisibleTrainers;
u16 numActiveAnimations;
@ -78,7 +80,7 @@ typedef struct {
} VsSeekerSystem;
typedef struct {
SysTask *unk_00;
SysTask *trackingTask;
SysTask *animationTask;
VsSeekerSystem *vsSeeker;
} VsSeekerAnimationTask;
@ -91,7 +93,7 @@ static BOOL TaskManager_ExecuteVsSeeker(TaskManager *taskMan);
static VsSeekerUsability VsSeekerSystem_CheckUsability(VsSeekerSystem *param0);
static void VsSeekerSystem_SetState(VsSeekerSystem *param0, u32 param1);
static void VsSeekerSystem_CollectViableNpcs(VsSeekerSystem *param0);
static void VsSeekerSystem_StartAnimation(VsSeekerSystem *param0, MapObject *param1, const UnkStruct_ov5_021F8E3C *param2);
static void VsSeekerSystem_StartAnimation(VsSeekerSystem *param0, MapObject *param1, const MapObjectAnimCmd *param2);
static void VsSeekerSystem_StartAnimationTask(VsSeekerSystem *param0, SysTask *param1);
static void VsSeeker_TrackAnimation(SysTask *param0, void *param1);
static s32 VsSeekerSystem_GetNumActiveAnimations(VsSeekerSystem *vsSeeker);
@ -109,7 +111,7 @@ void ov5_021DBED4(FieldSystem *fieldSystem, MapObject *param1);
static BOOL VsSeeker_WaitForNpcsToPause(FieldSystem *fieldSystem);
static MapObject *VsSeeker_GetSecondDoubleBattleTrainer(FieldSystem *fieldSystem, MapObject *trainer, VsSeeker2v2TrainerSearchMode mode);
const RematchData Unk_ov5_021F8E48[] = {
const VsSeekerRematchData gVsSeekerRematchData[] = {
{ 0xE, 0xE, 0x0, 0x0, 0x0, 0x0 },
{ 0x15, 0x273, 0x274, 0xffff, 0x275, 0x0 },
{ 0x2C, 0x2C, 0x0, 0x0, 0x0, 0x0 },
@ -352,13 +354,13 @@ const RematchData Unk_ov5_021F8E48[] = {
{ 0x25D, 0xffff, 0xffff, 0xffff, 0xffff, 0x30A }
};
static const UnkStruct_ov5_021F8E3C Unk_ov5_021F8E3C[] = {
static const MapObjectAnimCmd Unk_ov5_021F8E3C[] = {
{0x1, 0x1},
{0x67, 0x1},
{0xfe, 0x0}
};
static const UnkStruct_ov5_021F8E3C Unk_ov5_021F8E34[] = {
static const MapObjectAnimCmd Unk_ov5_021F8E34[] = {
{0x4B, 0x1},
{0xfe, 0x0}
};
@ -607,7 +609,7 @@ static void ov5_021DBC08 (FieldSystem *fieldSystem)
return;
}
static void VsSeekerSystem_StartAnimation(VsSeekerSystem *vsSeeker, MapObject *mapObj, const UnkStruct_ov5_021F8E3C *animCmdList)
static void VsSeekerSystem_StartAnimation(VsSeekerSystem *vsSeeker, MapObject *mapObj, const MapObjectAnimCmd *animCmdList)
{
SysTask *animTask = MapObject_StartAnimation(mapObj, animCmdList);
vsSeeker->numActiveAnimations++;
@ -629,7 +631,7 @@ static void VsSeekerSystem_StartAnimationTask(VsSeekerSystem *vsSeeker, SysTask
vssAnimTask->vsSeeker = vsSeeker;
vssAnimTask->animationTask = animTask;
vssAnimTask->unk_00 = SysTask_Start(VsSeeker_TrackAnimation, vssAnimTask, 0);
vssAnimTask->trackingTask = SysTask_Start(VsSeeker_TrackAnimation, vssAnimTask, 0);
return;
}
@ -646,7 +648,7 @@ static void VsSeeker_TrackAnimation(SysTask *task, void *param)
vssAnimTask->vsSeeker->numActiveAnimations--;
MapObject_FinishAnimation(vssAnimTask->animationTask);
SysTask_Done(vssAnimTask->unk_00);
SysTask_Done(vssAnimTask->trackingTask);
Heap_FreeToHeapExplicit(4, param);
}
@ -727,10 +729,10 @@ u16 ov5_021DBD98 (FieldSystem *fieldSystem, MapObject *param1, u16 param2)
static u16 ov5_021DBDDC (FieldSystem *fieldSystem, u16 param1)
{
int v0, v1;
const RematchData *v2 = Unk_ov5_021F8E48;
const VsSeekerRematchData *v2 = gVsSeekerRematchData;
for (v0 = 0; v0 < (NELEMS(Unk_ov5_021F8E48)); v0++) {
if (v2[v0].unk_00[0] != param1) {
for (v0 = 0; v0 < (NELEMS(gVsSeekerRematchData)); v0++) {
if (v2[v0].trainerIDs[0] != param1) {
continue;
}
@ -743,15 +745,15 @@ static u16 ov5_021DBDDC (FieldSystem *fieldSystem, u16 param1)
static u16 ov5_021DBDFC (FieldSystem *fieldSystem, u16 param1)
{
int v0, v1;
const RematchData *v2 = Unk_ov5_021F8E48;
const VsSeekerRematchData *v2 = gVsSeekerRematchData;
for (v1 = 1; v1 < 6; v1++) {
if (v2[param1].unk_00[v1] == 0) {
if (v2[param1].trainerIDs[v1] == 0) {
return v1 - 1;
}
if (v2[param1].unk_00[v1] != 0xffff) {
if (Script_HasBeatenTrainer(fieldSystem, v2[param1].unk_00[v1]) == 0) {
if (v2[param1].trainerIDs[v1] != 0xffff) {
if (Script_HasBeatenTrainer(fieldSystem, v2[param1].trainerIDs[v1]) == 0) {
return v1;
}
}
@ -781,10 +783,10 @@ static u16 ov5_021DBE48 (FieldSystem *fieldSystem, u16 param1, u16 param2)
static u16 ov5_021DBE70 (u16 param0, u16 param1)
{
u16 v0;
const RematchData *v1 = Unk_ov5_021F8E48;
const VsSeekerRematchData *v1 = gVsSeekerRematchData;
for (v0 = (param1 - 1); v0 > 0; v0--) {
if (v1[param0].unk_00[v0] != 0xffff) {
if (v1[param0].trainerIDs[v0] != 0xffff) {
return v0;
}
}
@ -794,9 +796,9 @@ static u16 ov5_021DBE70 (u16 param0, u16 param1)
static u16 ov5_021DBEA4 (u16 param0, u16 param1)
{
const RematchData *v0 = Unk_ov5_021F8E48;
const VsSeekerRematchData *v0 = gVsSeekerRematchData;
return v0[param0].unk_00[param1];
return v0[param0].trainerIDs[param1];
}
static BOOL VsSeeker_IsTrainerDoingRematchAnimation(MapObject *param0)

View File

@ -9,7 +9,7 @@
#include "field/field_system.h"
#include "struct_defs/struct_02049FA8.h"
#include "overlay005/struct_ov5_021F8E3C.h"
#include "overlay005/map_object_anim_cmd.h"
#include "unk_02005474.h"
#include "unk_0200F174.h"
@ -44,9 +44,9 @@ int(*const Unk_ov6_022495CC[])(TaskManager *, FieldSystem *, UnkStruct_ov6_02247
int(*const Unk_ov6_022495BC[])(TaskManager *, FieldSystem *, UnkStruct_ov6_02247100 *);
int(*const Unk_ov6_022495F0[])(TaskManager *, FieldSystem *, UnkStruct_ov6_02247100 *);
const UnkStruct_ov5_021F8E3C Unk_ov6_02249608[];
const UnkStruct_ov5_021F8E3C Unk_ov6_022495DC[];
const UnkStruct_ov5_021F8E3C Unk_ov6_0224966C[];
const MapObjectAnimCmd Unk_ov6_02249608[];
const MapObjectAnimCmd Unk_ov6_022495DC[];
const MapObjectAnimCmd Unk_ov6_0224966C[];
void * ov6_02247100 (FieldSystem * fieldSystem, u32 param1)
{
@ -384,7 +384,7 @@ static void * ov6_02247590 (u32 param0, u32 param1)
return v0;
}
static const UnkStruct_ov5_021F8E3C Unk_ov6_02249608[] = {
static const MapObjectAnimCmd Unk_ov6_02249608[] = {
{0x1, 0x1},
{0x3C, 0x2},
{0x2, 0x1},
@ -412,7 +412,7 @@ static const UnkStruct_ov5_021F8E3C Unk_ov6_02249608[] = {
{0xfe, 0x0}
};
static const UnkStruct_ov5_021F8E3C Unk_ov6_022495DC[] = {
static const MapObjectAnimCmd Unk_ov6_022495DC[] = {
{0x0, 0x1},
{0x3, 0x1},
{0x1, 0x1},
@ -420,7 +420,7 @@ static const UnkStruct_ov5_021F8E3C Unk_ov6_022495DC[] = {
{0xfe, 0x0}
};
static const UnkStruct_ov5_021F8E3C Unk_ov6_0224966C[] = {
static const MapObjectAnimCmd Unk_ov6_0224966C[] = {
{0x1, 0x1},
{0x2, 0x1},
{0x0, 0x1},

View File

@ -34,7 +34,7 @@
#include "struct_defs/struct_02073974.h"
#include "struct_defs/struct_02073B50.h"
#include "overlay005/struct_ov5_021ED0A4.h"
#include "overlay005/struct_ov5_021F8E3C.h"
#include "overlay005/map_object_anim_cmd.h"
#include "overlay005/struct_ov5_02201C58.h"
#include "overlay009/struct_ov9_02249FF4.h"
#include "overlay019/struct_ov19_021DA864.h"
@ -5297,24 +5297,24 @@ static int ov9_0224D5E8 (UnkStruct_ov9_02249B04 * param0, UnkStruct_ov9_0224D078
return 0;
}
static const UnkStruct_ov5_021F8E3C Unk_ov9_02251378[] = {
static const MapObjectAnimCmd Unk_ov9_02251378[] = {
{0xf, 0x2},
{0xC, 0x4},
{0xfe, 0x0}
};
static const UnkStruct_ov5_021F8E3C Unk_ov9_0225136C[] = {
static const MapObjectAnimCmd Unk_ov9_0225136C[] = {
{0xf, 0x1},
{0xC, 0x4},
{0xfe, 0x0}
};
static const UnkStruct_ov5_021F8E3C Unk_ov9_02251350[] = {
static const MapObjectAnimCmd Unk_ov9_02251350[] = {
{0xC, 0x4},
{0xfe, 0x0}
};
static const UnkStruct_ov5_021F8E3C * const Unk_ov9_02251384[3] = {
static const MapObjectAnimCmd * const Unk_ov9_02251384[3] = {
Unk_ov9_02251378,
Unk_ov9_0225136C,
Unk_ov9_02251350
@ -5324,7 +5324,7 @@ static int ov9_0224D69C (UnkStruct_ov9_02249B04 * param0, UnkStruct_ov9_0224D078
{
int v0;
MapObject * v1;
const UnkStruct_ov5_021F8E3C * v2;
const MapObjectAnimCmd * v2;
v1 = MapObjMan_LocalMapObjByIndex(param0->fieldSystem->mapObjMan, (0x80 + 6));
GF_ASSERT(v1 != NULL);
@ -9060,7 +9060,7 @@ static const UnkFuncPtr_ov9_02253BE4 Unk_ov9_02251CC0[6] = {
ov9_02250A90
};
static const UnkStruct_ov5_021F8E3C Unk_ov9_02251E74[] = {
static const MapObjectAnimCmd Unk_ov9_02251E74[] = {
{0x42, 0x1},
{0x7, 0x1},
{0x7, 0x1},
@ -9152,7 +9152,7 @@ static const UnkFuncPtr_ov9_02253BE4 Unk_ov9_02251408[4] = {
ov9_02250BAC
};
static const UnkStruct_ov5_021F8E3C Unk_ov9_02252D80[] = {
static const MapObjectAnimCmd Unk_ov9_02252D80[] = {
{0x42, 0x1},
{0xf, 0x2},
{0x10, 0x2},
@ -9173,7 +9173,7 @@ static const UnkStruct_ov5_021F8E3C Unk_ov9_02252D80[] = {
{0xfe, 0x0}
};
static const UnkStruct_ov5_021F8E3C Unk_ov9_02252DC8[] = {
static const MapObjectAnimCmd Unk_ov9_02252DC8[] = {
{0x42, 0x1},
{0xf, 0x2},
{0x10, 0x1},
@ -9195,7 +9195,7 @@ static const UnkStruct_ov5_021F8E3C Unk_ov9_02252DC8[] = {
{0xfe, 0x0}
};
static const UnkStruct_ov5_021F8E3C Unk_ov9_02252E14[] = {
static const MapObjectAnimCmd Unk_ov9_02252E14[] = {
{0x42, 0x1},
{0x3f, 0x2},
{0x2, 0x1},
@ -9218,7 +9218,7 @@ static const UnkStruct_ov5_021F8E3C Unk_ov9_02252E14[] = {
{0xfe, 0x0}
};
static const UnkStruct_ov5_021F8E3C Unk_ov9_02252E64[] = {
static const MapObjectAnimCmd Unk_ov9_02252E64[] = {
{0x42, 0x1},
{0x3f, 0x2},
{0x2, 0x1},
@ -9269,7 +9269,7 @@ static int ov9_02250C48 (UnkStruct_ov9_02249B04 * param0, TaskManager * param1,
if ((((v0->unk_04.y) >> 4) / FX32_ONE) >= 9) {
int v2, v3, v4;
const UnkStruct_ov5_021F8E3C * v5, * v6;
const MapObjectAnimCmd * v5, * v6;
ov9_02250F44(param0, &v2, &v3, &v4);

View File

@ -58,7 +58,7 @@
#include "struct_defs/struct_02098C44.h"
#include "struct_defs/pokemon_summary.h"
#include "overlay005/struct_ov5_021DD42C.h"
#include "overlay005/struct_ov5_021F8E3C.h"
#include "overlay005/map_object_anim_cmd.h"
#include "overlay061/struct_ov61_0222C884.h"
#include "overlay090/struct_ov90_021D0D80.h"
#include "overlay098/struct_ov98_02247168.h"
@ -239,7 +239,7 @@
typedef struct {
SysTask * unk_00;
SysTask * unk_04;
UnkStruct_ov5_021F8E3C * unk_08;
MapObjectAnimCmd * unk_08;
FieldSystem * fieldSystem;
} UnkStruct_02040F28;
@ -749,7 +749,7 @@ static BOOL ScrCmd_323(ScriptContext * ctx);
static BOOL ScrCmd_328(ScriptContext * ctx);
static BOOL ScrCmd_32B(ScriptContext * ctx);
static BOOL sub_02040F0C(ScriptContext * ctx);
static void sub_02040F28(FieldSystem * fieldSystem, SysTask * param1, UnkStruct_ov5_021F8E3C * param2);
static void sub_02040F28(FieldSystem * fieldSystem, SysTask * param1, MapObjectAnimCmd * param2);
static void sub_02040F5C(SysTask * param0, void * param1);
static u32 sub_0204676C(SaveData * param0);
@ -2978,7 +2978,7 @@ static BOOL ScrCmd_ApplyMovement (ScriptContext * ctx)
return FALSE;
}
SysTask * v1 = MapObject_StartAnimation(object, (UnkStruct_ov5_021F8E3C *)(ctx->scriptPtr + movementOffset));
SysTask * v1 = MapObject_StartAnimation(object, (MapObjectAnimCmd *)(ctx->scriptPtr + movementOffset));
u8 * v2 = sub_0203F098(ctx->fieldSystem, 4);
(*v2)++;
sub_02040F28(ctx->fieldSystem, v1, NULL);
@ -2996,7 +2996,7 @@ static BOOL ScrCmd_2A1 (ScriptContext * ctx)
u16 v6 = ScriptContext_GetVar(ctx);
u16 v7 = ScriptContext_GetVar(ctx);
u16 v8, v9;
UnkStruct_ov5_021F8E3C * v10;
MapObjectAnimCmd * v10;
int v11;
v4 = sub_02040ED4(ctx->fieldSystem, v5);
@ -3005,7 +3005,7 @@ static BOOL ScrCmd_2A1 (ScriptContext * ctx)
GF_ASSERT(FALSE);
}
v10 = Heap_AllocFromHeap(4, sizeof(UnkStruct_ov5_021F8E3C) * 64);
v10 = Heap_AllocFromHeap(4, sizeof(MapObjectAnimCmd) * 64);
v8 = MapObject_GetXPos(v4);
v9 = MapObject_GetZPos(v4);
v11 = 0;
@ -3077,7 +3077,7 @@ static BOOL sub_02040F0C (ScriptContext * ctx)
return 0;
}
static void sub_02040F28 (FieldSystem * fieldSystem, SysTask * param1, UnkStruct_ov5_021F8E3C * param2)
static void sub_02040F28 (FieldSystem * fieldSystem, SysTask * param1, MapObjectAnimCmd * param2)
{
UnkStruct_02040F28 * v0 = NULL;

View File

@ -13,7 +13,7 @@
#include "struct_defs/struct_02027BF4.h"
#include "field/field_system.h"
#include "field/field_system_sub2_t.h"
#include "overlay005/struct_ov5_021F8E3C.h"
#include "overlay005/map_object_anim_cmd.h"
#include "heap.h"
#include "unk_0201C970.h"
@ -291,12 +291,12 @@ u32 sub_02055FC8 (const FieldSystem * fieldSystem, const MapObject * param1)
return v0;
}
static const UnkStruct_ov5_021F8E3C Unk_020EC51C[] = {
static const MapObjectAnimCmd Unk_020EC51C[] = {
{0xA, 0x1},
{0xfe, 0x0}
};
static const UnkStruct_ov5_021F8E3C Unk_020EC524[] = {
static const MapObjectAnimCmd Unk_020EC524[] = {
{0xB, 0x1},
{0xfe, 0x0}
};
@ -378,7 +378,7 @@ static void sub_020560F8 (FieldSystem * fieldSystem, UnkStruct_020562AC * param1
}
}
static void sub_0205610C (FieldSystem * fieldSystem, UnkStruct_020562AC * param1, const UnkStruct_ov5_021F8E3C * param2)
static void sub_0205610C (FieldSystem * fieldSystem, UnkStruct_020562AC * param1, const MapObjectAnimCmd * param2)
{
MapObject * v0 = Player_MapObject(fieldSystem->playerAvatar);
param1->unk_0C = MapObject_StartAnimation(v0, param2);

View File

@ -9,7 +9,7 @@
#include "constdata/const_020EE31C.h"
#include "overlay005/struct_ov5_021F8E3C.h"
#include "overlay005/map_object_anim_cmd.h"
#include "unk_02005474.h"
#include "unk_0200D9E8.h"
@ -28,7 +28,7 @@ typedef struct {
int unk_04;
int unk_08;
MapObject * unk_0C;
const UnkStruct_ov5_021F8E3C * unk_10;
const MapObjectAnimCmd * unk_10;
} UnkStruct_020EEE54;
typedef struct {
@ -190,7 +190,7 @@ void sub_020656DC (MapObject * mapObj)
sub_02062BC0(mapObj, 0);
}
SysTask * MapObject_StartAnimation (MapObject * mapObj, const UnkStruct_ov5_021F8E3C * param1)
SysTask * MapObject_StartAnimation (MapObject * mapObj, const MapObjectAnimCmd * param1)
{
SysTask * v0;
UnkStruct_020EEE54 * v1;
@ -266,7 +266,7 @@ static int sub_020657B0 (UnkStruct_020EEE54 * param0)
static int sub_020657CC (UnkStruct_020EEE54 * param0)
{
const UnkStruct_ov5_021F8E3C * v0;
const MapObjectAnimCmd * v0;
v0 = param0->unk_10;
LocalMapObj_SetAnimationCode(param0->unk_0C, v0->unk_00);
@ -288,7 +288,7 @@ static int sub_020657E4 (UnkStruct_020EEE54 * param0)
static int sub_02065800 (UnkStruct_020EEE54 * param0)
{
const UnkStruct_ov5_021F8E3C * v0;
const MapObjectAnimCmd * v0;
v0 = param0->unk_10;
param0->unk_08++;