1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-08 08:55:17 +00:00

Add names to all typedef'd structs, unions, and enums (#2028)

* Add names to all typedef'd structs, unions, and enums

* wtf vs code

* Use a better regex
This commit is contained in:
cadmic 2024-08-12 00:07:48 -07:00 committed by GitHub
parent 672728455d
commit e6bc4bd8cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
426 changed files with 1417 additions and 1417 deletions

View file

@ -85,7 +85,7 @@ STACK(sFaultStack, 0x600);
StackEntry sFaultThreadInfo;
FaultMgr gFaultMgr;
typedef struct {
typedef struct FaultClientTask {
/* 0x00 */ s32 (*callback)(void*, void*);
/* 0x04 */ void* arg0;
/* 0x08 */ void* arg1;

View file

@ -7,7 +7,7 @@
#include "global.h"
#include "terminal.h"
typedef struct {
typedef struct FaultDrawer {
/* 0x00 */ u16* fb;
/* 0x04 */ u16 w;
/* 0x06 */ u16 h;

View file

@ -1,6 +1,6 @@
#include "global.h"
typedef struct {
typedef struct FlagSetEntry {
/* 0x00 */ u16* value;
/* 0x04 */ const char* name;
} FlagSetEntry; // size = 0x08

View file

@ -1,6 +1,6 @@
#include "global.h"
typedef enum {
typedef enum LetterboxState {
/* 0 */ LETTERBOX_STATE_IDLE,
/* 1 */ LETTERBOX_STATE_GROWING,
/* 2 */ LETTERBOX_STATE_SHRINKING

View file

@ -56,7 +56,7 @@ volatile OSTime D_8016A578;
// Accumulator for `gRDPTimeTotal`
volatile OSTime gRDPTimeAcc;
typedef struct {
typedef struct SpeedMeterTimeEntry {
/* 0x00 */ volatile OSTime* time;
/* 0x04 */ u8 x;
/* 0x05 */ u8 y;
@ -74,7 +74,7 @@ SpeedMeterTimeEntry sSpeedMeterTimeEntryArray[] = {
{ &gGraphUpdatePeriod, 0, 10, GPACK_RGBA5551(255, 0, 255, 1) },
};
typedef struct {
typedef struct SpeedMeterAllocEntry {
/* 0x00 */ s32 maxval;
/* 0x04 */ s32 val;
/* 0x08 */ u16 backColor;

View file

@ -1,28 +1,28 @@
#include "global.h"
typedef struct {
typedef struct F3dzexConst {
/* 0x00 */ u32 value;
/* 0x04 */ const char* name;
} F3dzexConst; // size = 0x8
typedef struct {
typedef struct F3dzexFlag {
/* 0x00 */ u32 value;
/* 0x04 */ const char* setName;
/* 0x08 */ const char* unsetName;
} F3dzexFlag; // size = 0x0C
typedef struct {
typedef struct F3dzexRenderMode {
/* 0x00 */ const char* name;
/* 0x04 */ u32 value;
/* 0x08 */ u32 mask;
} F3dzexRenderMode; // size = 0x0C
typedef struct {
typedef struct F3dzexSetModeMacroValue {
/* 0x00 */ const char* name;
/* 0x04 */ u32 value;
} F3dzexSetModeMacroValue; // size = 0x8
typedef struct {
typedef struct F3dzexSetModeMacro {
/* 0x00 */ const char* name;
/* 0x04 */ u32 shift;
/* 0x08 */ u32 len;
@ -69,7 +69,7 @@ F3dzexFlag sUCodeDisasMtxFlags[] = {
F3DZEX_FLAG(G_MTX_PUSH, G_MTX_NOPUSH),
};
typedef enum {
typedef enum CombinerArg {
COMBINER_A = 1,
COMBINER_B,
COMBINER_C,

View file

@ -235,7 +235,7 @@ void Actor_ProjectPos(PlayState* play, Vec3f* src, Vec3f* xyzDest, f32* cappedIn
*cappedInvWDest = (*cappedInvWDest < 1.0f) ? 1.0f : (1.0f / *cappedInvWDest);
}
typedef struct {
typedef struct NaviColor {
/* 0x00 */ Color_RGBA8 inner;
/* 0x04 */ Color_RGBA8 outer;
} NaviColor; // size = 0x8
@ -1540,7 +1540,7 @@ f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2) {
return actor->xyzDistToPlayerSq;
}
typedef struct {
typedef struct TargetRangeParams {
/* 0x0 */ f32 rangeSq;
/* 0x4 */ f32 leashScale;
} TargetRangeParams; // size = 0x8
@ -3745,7 +3745,7 @@ f32 Rand_CenteredFloat(f32 f) {
return (Rand_ZeroOne() - 0.5f) * f;
}
typedef struct {
typedef struct DoorLockInfo {
/* 0x00 */ f32 chainAngle;
/* 0x04 */ f32 chainLength;
/* 0x08 */ f32 yShift;
@ -3900,7 +3900,7 @@ s32 Npc_UpdateTalking(PlayState* play, Actor* actor, s16* talkState, f32 interac
return false;
}
typedef struct {
typedef struct NpcTrackingRotLimits {
/* 0x00 */ s16 maxHeadYaw;
/* 0x02 */ s16 minHeadPitch;
/* 0x04 */ s16 maxHeadPitch;
@ -3910,7 +3910,7 @@ typedef struct {
/* 0x0C */ u8 rotateYaw;
} NpcTrackingRotLimits; // size = 0x10
typedef struct {
typedef struct NpcTrackingParams {
/* 0x00 */ NpcTrackingRotLimits rotLimits;
// Fields specific to NPC_TRACKING_PLAYER_AUTO_TURN mode
/* 0x10 */ f32 autoTurnDistanceRange; // Max distance to player to enable tracking and auto-turn

View file

@ -1484,7 +1484,7 @@ s32 BgCheck_IsSpotScene(PlayState* play) {
return false;
}
typedef struct {
typedef struct BgCheckSceneMemEntry {
s16 sceneId;
u32 memSize;
} BgCheckSceneMemEntry;
@ -1523,7 +1523,7 @@ void BgCheck_SetSubdivisionDimension(f32 min, s32 subdivAmount, f32* max, f32* s
*max = *subdivLength * subdivAmount + min;
}
typedef struct {
typedef struct BgCheckSceneSubdivisionEntry {
s16 sceneId;
Vec3s subdivAmount;
s32 nodeListMax; // if -1, dynamically compute max nodes

View file

@ -7041,7 +7041,7 @@ s32 Camera_Special5(Camera* camera) {
return true;
}
typedef enum {
typedef enum CamElevatorPlatform {
/* 0 */ CAM_ELEVATOR_PLATFORM_FIRE_TEMPLE_LOWER_FLOOR, // ACTOR_BG_HIDAN_ROCK
/* 1 */ CAM_ELEVATOR_PLATFORM_FIRE_TEMPLE_EAST_TOWER, // ACTOR_BG_HIDAN_FSLIFT
/* 2 */ CAM_ELEVATOR_PLATFORM_FIRE_TEMPLE_WEST_TOWER, // ACTOR_BG_HIDAN_SYOKU

View file

@ -1,18 +1,18 @@
#include "ultra64.h"
#include "global.h"
typedef struct {
typedef struct CameraModeValue {
s16 val;
s16 dataType;
} CameraModeValue;
typedef struct {
typedef struct CameraMode {
s16 funcIdx;
s16 valueCnt;
CameraModeValue* values;
} CameraMode;
typedef struct {
typedef struct CameraSetting {
union {
u32 unk_00;
struct {

View file

@ -1602,12 +1602,12 @@ s32 CollisionCheck_SwordHitAudio(Collider* atCol, ColliderElement* acElem) {
return true;
}
typedef struct {
typedef struct HitInfo {
/* 0x0 */ u8 blood;
/* 0x1 */ u8 effect;
} HitInfo; // size = 0x2
typedef enum {
typedef enum ColChkBloodType {
/* 0 */ BLOOD_NONE,
/* 1 */ BLOOD_BLUE,
/* 2 */ BLOOD_GREEN,
@ -1616,7 +1616,7 @@ typedef enum {
/* 5 */ BLOOD_RED2
} ColChkBloodType;
typedef enum {
typedef enum ColChkHitType {
/* 0 */ HIT_WHITE,
/* 1 */ HIT_DUST,
/* 2 */ HIT_RED,
@ -2687,7 +2687,7 @@ void CollisionCheck_AT(PlayState* play, CollisionCheckContext* colChkCtx) {
CollisionCheck_SetHitEffects(play, colChkCtx);
}
typedef enum {
typedef enum ColChkMassType {
/* 0 */ MASSTYPE_IMMOVABLE,
/* 1 */ MASSTYPE_HEAVY,
/* 2 */ MASSTYPE_NORMAL

View file

@ -1,13 +1,13 @@
#include "global.h"
typedef struct {
typedef struct DebugCamTextBufferEntry {
/* 0x0 */ u8 x;
/* 0x1 */ u8 y;
/* 0x2 */ u8 colorIndex;
/* 0x3 */ char text[21];
} DebugCamTextBufferEntry; // size = 0x18
typedef struct {
typedef struct InputCombo {
/* 0x0 */ u16 hold;
/* 0x2 */ u16 press;
} InputCombo; // size = 0x4

View file

@ -1,7 +1,7 @@
#include "global.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
typedef struct {
typedef struct DebugDispObjectInfo {
/* 0x00 */ s16 drawType; // indicates which draw function to use when displaying the object
/* 0x04 */ void* drawArg; // segment address (display list or texture) passed to the draw function when called
} DebugDispObjectInfo; // size = 0x8

View file

@ -59,7 +59,7 @@ CutsceneHandler sScriptedCutsceneHandlers[] = {
CutsceneHandler_RunScript, // CS_STATE_RUN_UNSTOPPABLE
};
typedef enum {
typedef enum TitleDemoDestination {
/* 0 */ TITLE_DEMO_SPIRIT_TEMPLE,
/* 1 */ TITLE_DEMO_DEATH_MOUNTAIN_CRATER,
/* 2 */ TITLE_DEMO_GANONDORF_HORSE
@ -67,7 +67,7 @@ typedef enum {
u8 sTitleDemoDestination = TITLE_DEMO_SPIRIT_TEMPLE;
typedef struct {
typedef struct EntranceCutscene {
/* 0x00 */ u16 entrance; // entrance index upon which the cutscene should trigger
/* 0x02 */ u8 ageRestriction; // 0 for adult only, 1 for child only, 2 for both ages
/* 0x03 */ u8 flag; // eventChkInf flag bound to the entrance cutscene

View file

@ -106,7 +106,7 @@ void GetItem_DrawScale(PlayState* play, s16 drawId);
void GetItem_DrawBulletBag(PlayState* play, s16 drawId);
void GetItem_DrawWallet(PlayState* play, s16 drawId);
typedef struct {
typedef struct DrawItemTableEntry {
/* 0x00 */ void (*drawFunc)(PlayState*, s16);
/* 0x04 */ Gfx* dlists[8];
} DrawItemTableEntry; // size = 0x24

View file

@ -1,6 +1,6 @@
#include "global.h"
typedef enum {
typedef enum TransitionCircleDirection {
/* 0 */ TRANS_CIRCLE_DIR_IN,
/* 1 */ TRANS_CIRCLE_DIR_OUT
} TransitionCircleDirection;

View file

@ -1,12 +1,12 @@
#include "global.h"
#include "terminal.h"
typedef enum {
typedef enum TransitionFadeDirection {
/* 0 */ TRANS_FADE_DIR_IN,
/* 1 */ TRANS_FADE_DIR_OUT
} TransitionFadeDirection;
typedef enum {
typedef enum TransitionFadeType {
/* 0 */ TRANS_FADE_TYPE_NONE,
/* 1 */ TRANS_FADE_TYPE_ONE_WAY,
/* 2 */ TRANS_FADE_TYPE_FLASH

View file

@ -1,6 +1,6 @@
#include "global.h"
typedef enum {
typedef enum TransitionWipeDirection {
/* 0 */ TRANS_WIPE_DIR_IN,
/* 1 */ TRANS_WIPE_DIR_OUT
} TransitionWipeDirection;

View file

@ -77,7 +77,7 @@ void SkelCurve_SetAnim(SkelCurve* skelCurve, CurveAnimationHeader* animation, f3
skelCurve->animation = animation;
}
typedef enum {
typedef enum SkelCurveVecType {
/* 0 */ SKELCURVE_VEC_TYPE_SCALE,
/* 1 */ SKELCURVE_VEC_TYPE_ROTATION,
/* 2 */ SKELCURVE_VEC_TYPE_POSIITON,

View file

@ -34,7 +34,7 @@ void func_8006D0AC(PlayState* play) {
}
}
typedef struct {
typedef struct HorseSpawn {
/* 0x00 */ s16 sceneId;
/* 0x02 */ Vec3s pos;
/* 0x08 */ s16 angle;
@ -121,7 +121,7 @@ void func_8006D0EC(PlayState* play, Player* player) {
}
}
typedef struct {
typedef struct struct_8011F9B8 {
/* 0x00 */ s16 sceneId;
/* 0x04 */ s32 cutsceneIndex;
/* 0x08 */ Vec3s pos;

View file

@ -9,14 +9,14 @@
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
typedef enum {
typedef enum LightningBoltState {
/* 0x00 */ LIGHTNING_BOLT_START,
/* 0x01 */ LIGHTNING_BOLT_WAIT,
/* 0x02 */ LIGHTNING_BOLT_DRAW,
/* 0xFF */ LIGHTNING_BOLT_INACTIVE = 0xFF
} LightningBoltState;
typedef struct {
typedef struct ZBufValConversionEntry {
/* 0x00 */ s32 mantissaShift; // shift applied to the mantissa of the z buffer value
/* 0x04 */ s32 base; // 15.3 fixed-point base value for the exponent
} ZBufValConversionEntry; // size = 0x8
@ -41,7 +41,7 @@ u16 gTimeSpeed = 0;
u16 sSunScreenDepth = GPACK_ZDZ(G_MAXFBZ, 0);
typedef struct {
typedef struct TimeBasedLightEntry {
/* 0x00 */ u16 startTime;
/* 0x02 */ u16 endTime;
/* 0x04 */ u8 lightSetting;
@ -193,7 +193,7 @@ s16 gLensFlareScale;
f32 gLensFlareColorIntensity;
s16 gLensFlareGlareStrength;
typedef struct {
typedef struct LightningBolt {
/* 0x00 */ u8 state;
/* 0x04 */ Vec3f offset;
/* 0x10 */ Vec3f pos;
@ -1485,7 +1485,7 @@ void Environment_DrawSunLensFlare(PlayState* play, EnvironmentContext* envCtx, V
f32 sLensFlareScales[] = { 23.0f, 12.0f, 7.0f, 5.0f, 3.0f, 10.0f, 6.0f, 2.0f, 3.0f, 1.0f };
typedef enum {
typedef enum LensFlareType {
/* 0 */ LENS_FLARE_CIRCLE0,
/* 1 */ LENS_FLARE_CIRCLE1,
/* 2 */ LENS_FLARE_RING

View file

@ -3,7 +3,7 @@
#define LIGHTS_BUFFER_SIZE 32
typedef struct {
typedef struct LightsBuffer {
/* 0x000 */ s32 numOccupied;
/* 0x004 */ s32 searchIndex;
/* 0x008 */ LightNode buf[LIGHTS_BUFFER_SIZE];

View file

@ -2,7 +2,7 @@
#include "terminal.h"
#include "assets/textures/parameter_static/parameter_static.h"
typedef struct {
typedef struct MapMarkInfo {
/* 0x00 */ void* texture;
/* 0x04 */ u32 imageFormat;
/* 0x08 */ u32 imageSize;
@ -14,7 +14,7 @@ typedef struct {
/* 0x20 */ u32 dtdy;
} MapMarkInfo; // size = 0x24
typedef struct {
typedef struct MapMarkDataOverlay {
/* 0x00 */ void* loadedRamAddr; // original name: "allocp"
/* 0x04 */ RomFile file;
/* 0x0C */ void* vramStart;

View file

@ -4,7 +4,7 @@
#include "assets/textures/do_action_static/do_action_static.h"
#include "assets/textures/icon_item_static/icon_item_static.h"
typedef struct {
typedef struct RestrictionFlags {
/* 0x00 */ u8 sceneId;
/* 0x01 */ u8 flags1;
/* 0x02 */ u8 flags2;

View file

@ -3,7 +3,7 @@
#include "assets/objects/object_link_boy/object_link_boy.h"
#include "assets/objects/object_link_child/object_link_child.h"
typedef struct {
typedef struct BowSlingshotStringData {
/* 0x00 */ Gfx* dList;
/* 0x04 */ Vec3f pos;
} BowSlingshotStringData; // size = 0x10
@ -90,7 +90,7 @@ u8 sActionModelGroups[PLAYER_IA_MAX] = {
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_LENS_OF_TRUTH
};
typedef struct {
typedef struct EnvHazardTextTriggerEntry {
/* 0x0 */ u8 flag;
/* 0x2 */ u16 textId;
} EnvHazardTextTriggerEntry; // size = 0x4

View file

@ -2,7 +2,7 @@
#include "quake.h"
#include "terminal.h"
typedef struct {
typedef struct QuakeRequest {
/* 0x00 */ s16 index;
/* 0x02 */ s16 duration;
/* 0x04 */ Camera* cam;

View file

@ -69,7 +69,7 @@ void Room_DrawNormal(PlayState* play, Room* room, u32 flags) {
CLOSE_DISPS(play->state.gfxCtx, "../z_room.c", 239);
}
typedef enum {
typedef enum RoomCullableDebugMode {
/* 0 */ ROOM_CULL_DEBUG_MODE_OFF,
/* 1 */ ROOM_CULL_DEBUG_MODE_UP_TO_TARGET,
/* 2 */ ROOM_CULL_DEBUG_MODE_ONLY_TARGET

View file

@ -1,7 +1,7 @@
#include "ultra64.h"
#include "global.h"
typedef struct {
typedef struct SsSramContext {
/* 0x00 */ OSPiHandle piHandle;
/* 0x74 */ OSIoMesg ioMesg;
/* 0x8C */ OSMesgQueue msgQueue;

View file

@ -2,7 +2,7 @@
#include "terminal.h"
#include "z64environment.h"
typedef struct {
typedef struct SkyboxFaceParams {
/* 0x000 */ s32 xStart;
/* 0x004 */ s32 yStart;
/* 0x008 */ s32 zStart;