summaryrefslogtreecommitdiff
path: root/src/engine/fox_context.c
diff options
context:
space:
mode:
authorpetrie911 <69443847+petrie911@users.noreply.github.com>2024-05-11 15:53:37 -0500
committerGitHub <noreply@github.com>2024-05-11 17:53:37 -0300
commit0dbbf453f93f9f1b3e3d95fbfd96caf85c85ddf7 (patch)
tree186e6d9c15cf82eaf87609b6ab0227306680c283 /src/engine/fox_context.c
parent5bda92de97922f060c2c7ad032aca686bdd1715c (diff)
More actor docs. starting on event IDs (#238)
* id start * stuff * comp and cam * add errors
Diffstat (limited to 'src/engine/fox_context.c')
-rw-r--r--src/engine/fox_context.c112
1 files changed, 60 insertions, 52 deletions
diff --git a/src/engine/fox_context.c b/src/engine/fox_context.c
index dc11cf2e..3384f5e3 100644
--- a/src/engine/fox_context.c
+++ b/src/engine/fox_context.c
@@ -9,11 +9,11 @@ s32 gSceneSetup;
s32 D_ctx_80177824; // some sort of flag
s32 D_ctx_8017782C; // some sort of flag. all range related?
GameState gGameState;
-s32 gNextGameStateTimer; // next game state timer?
-s32 gVsItemSpawnTimer; // timer for vs item spawn
+s32 gNextGameStateTimer;
+s32 gVsItemSpawnTimer;
OptionState gOptionMenuStatus;
-s32 gPlayState; // pause-related state
-s32 D_ctx_80177868; // some sort of state. pause-related?
+s32 gPlayState;
+s32 D_ctx_80177868; // some sort of state. pause-related? Also used by game over
LevelMode gLevelMode;
DrawMode gDrawMode;
s32 gPlayerNum;
@@ -22,9 +22,9 @@ s32 gTeamShields[6];
s32 gSavedTeamShields[6];
s32 gPrevPlanetSavedTeamShields[6];
s32 gTeamDamage[6];
-u8 gMissionStatus; // next planet path
+u8 gMissionStatus;
f32 gGroundHeight;
-f32 D_ctx_80177950;
+f32 D_ctx_80177950; // Related to camera z-rotations? Only set to -1 in corneria intro, where it does nothing?
f32 gPlayerTurnRate;
f32 gPlayerTurnStickMod;
f32 gCsCamEyeX;
@@ -33,14 +33,14 @@ f32 gCsCamEyeZ;
f32 gCsCamAtX;
f32 gCsCamAtY;
f32 gCsCamAtZ;
-Vec3f gPlayerCamEye;
-Vec3f gPlayerCamAt;
+Vec3f gPlayCamEye;
+Vec3f gPlayCamAt;
bool gExpertMode;
-s32 D_ctx_80177A10[10];
-f32 D_ctx_80177A48[10];
+s32 D_ctx_80177A10[10]; // work buffer
+f32 D_ctx_80177A48[10]; // work buffer
s32 gCsFrameCount;
-u8 D_ctx_80177A98; // some sort of flag. Used in background
-u8 D_ctx_80177AB0;
+u8 gDrawGround; // some sort of flag. Used in background
+u8 gDrawBackdrop;
u8 gAqDrawMode;
s32 gTitleState;
s32 gMainController;
@@ -56,7 +56,7 @@ s32 gPlanetPathStatus[24];
s32 gPlanetPathStatus[22]; // overruns gPrevPlanetTeamShields?
#endif
s32 gPrevPlanetTeamShields[6];
-s32 D_ctx_80177C58[6];
+s32 D_ctx_80177C58[6]; // another saved team shields. maybe this is prev planet?
u8 gOptionSoundMode;
s32 gVolumeSettings[3];
u16 gBgmSeqId;
@@ -83,11 +83,11 @@ s32 gRingPassCount;
Vec3f gFormationInitRot;
Vec3f gFormationInitPos;
UNK_TYPE F_80178020;
-s32 D_ctx_8017812C;
+s32 gGroundClipMode;
LevelId gCurrentLevel;
s32 gLevelPhase;
s32 gBossActive;
-s32 D_ctx_8017828C;
+bool gKillEventActors;
s32 gUseDynaFloor;
s32 gRadioState;
s32 gCurrentRadioPortrait;
@@ -96,9 +96,9 @@ s32 gRadioMouthTimer;
u8 gLeveLClearStatus[30] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
-s32 D_ctx_801782C0;
-s32 D_ctx_801782C8;
-s32 D_ctx_801782D0;
+s32 D_ctx_801782C0; // set to 0, never used
+s32 D_ctx_801782C8; // set to 0, never used
+s32 D_ctx_801782D0; // set to 0, never used
s32 gRadioMsgCharIndex;
UNK_TYPE F_801782E0;
s32 gRadioMsgId;
@@ -150,39 +150,43 @@ UNK_TYPE F_8017840C;
UNK_TYPE P_800D31A0 = 0;
s32 gStarCount;
f32 gStarWarpDistortion;
-f32 D_ctx_80178418;
+f32 gCOComplete2CamRotY;
UNK_TYPE F_8017841C;
f32 gStarfieldX;
f32 gStarfieldY;
f32 gStarfieldRoll;
-f32 D_ctx_8017842C;
-f32 D_ctx_80178430;
+f32 gStarfieldScrollX; // starfield yaw?
+f32 gStarfieldScrollY; // starfield roll?
UNK_TYPE F_80178434;
UNK_TYPE F_80178438;
UNK_TYPE F_8017843C;
-f32 D_ctx_80178440;
-f32 D_ctx_80178444;
-f32 D_ctx_80178448;
-f32 D_ctx_80178450[3]; // x positions of certain actors (teammates?)
-f32 D_ctx_80178460[3]; // y positions of certain actors (teammates?)
-f32 D_ctx_80178470[3]; // z positions of certain actors (teammates?)
+f32 gBossDeathCamAtX; //
+f32 gBossDeathCamAtY;
+f32 gBossDeathCamAtZ;
+f32 gCsTeamTargetsX[3]; // x positions of certain actors (teammates?)
+f32 gCsTeamTargetsY[3]; // y positions of certain actors (teammates?)
+f32 gCsTeamTargetsZ[3]; // z positions of certain actors (teammates?)
f32 gCameraShakeY;
s32 gCameraShake;
-s32 D_ctx_80178484; // set to 10000 but not used
+s32 D_ctx_80178484; // set to 100000 when pausing but not used
bool gLoadLevelObjects;
UNK_TYPE F_8017848C;
UNK_TYPE F_80178490;
-s32 D_ctx_80178494;
-f32 D_ctx_80178498;
-f32 D_ctx_8017849C;
-f32 D_ctx_801784A0;
-s32 D_ctx_801784A4;
+#ifdef AVOID_UB
+s32 D_ctx_80178494 = 0;
+#else
+s32 D_ctx_80178494; // Torpedoes have this set to their unk_5C. Were they shot2s at some point?
+#endif
+f32 gShotHitPosZ;
+f32 gShotHitPosX;
+f32 gShotHitPosY;
+s32 gZOSnakeWaypointCount;
UNK_TYPE F_801784A8;
GroundType gGroundType;
UNK_TYPE F_801784B0;
UNK_TYPE F_801784B4;
-// light source 1
+// light source 1. Used for most things
f32 gLight1xRot; // effective Vec3f
f32 gLight1yRot;
f32 gLight1zRot;
@@ -197,7 +201,7 @@ s32 gLight1y;
s32 gLight1z;
f32 gLight1rotStep;
-// light source 2
+// light source 2. used for Players
f32 gLight2xRot; // effective Vec3f
f32 gLight2yRot;
f32 gLight2zRot;
@@ -209,7 +213,7 @@ s32 gLight2y;
s32 gLight2z;
f32 gLight2rotStep;
-// this section looks like a third light source
+// this section looks like a third light source. May have been for scenery shadows
UNK_TYPE F_801784514;
UNK_TYPE F_801784518;
UNK_TYPE F_80178451C;
@@ -221,16 +225,19 @@ UNK_TYPE F_801784530;
UNK_TYPE F_801784534;
f32 D_ctx_80178538;
-f32 D_ctx_8017853C; // hitbox size modifier. always 0.0f. seems out of place
+f32 D_ctx_8017853C; // hitbox size modifier for player collisions. always 0.0f. seems out of place
s32 gLight2colorStep; // light 2 color step
s32 D_ctx_80178544; // light 3 color step?
-s32 gLight1R; // Color32 light color 1
+
+s32 gLight1R; // Color32 light color 1
s32 gLight1G;
s32 gLight1B;
s32 gAmbientR; // Color32 ambient color
s32 gAmbientG;
s32 gAmbientB;
+
UNK_TYPE F_80178560;
+
s32 gLight2R; // Color32 light color 2
s32 gLight2G;
s32 gLight2B;
@@ -238,16 +245,17 @@ s32 gLight2RTarget; // Color32 light color 2 modifier?
s32 gLight2GTarget;
s32 gLight2BTarget;
-s32 D_ctx_80161A70; // Color32 set but not used, start of bss
+s32 D_ctx_80161A70; // unused Color32, perhaps for third light? start of bss
s32 D_ctx_80161A74;
s32 D_ctx_80161A78;
-s32 D_ctx_80161A7C; // Color32? set but not used
+s32 D_ctx_80161A7C; // unused Color32, perhaps targets for third light?
s32 D_ctx_80161A80;
s32 D_ctx_80161A84;
+
GroundSurface gGroundSurface;
GroundSurface gSavedGroundSurface;
u8 gGoldRingCount[4];
-u8 D_ctx_80161A94[4];
+u8 gSavedGoldRingCount[4];
s32 gHitCount;
s32 gSavedHitCount;
s16 gLifeCount[4];
@@ -282,7 +290,7 @@ s32 gLevelStartStatusScreenTimer;
s32 gLevelClearScreenTimer; // timer for mission accomplished scrren
s32 gBossHealthBar;
s32 D_ctx_80177850; // bonus text related. set to 15 but never read
-s32 D_ctx_80177858[4]; // set to 3 but never used
+s32 D_ctx_80177858[4]; // set to 3 but never used. related to VS mode customization?
PlayerForm gPlayerForms[4];
s32 gHandicap[4];
VsStage gVersusStage;
@@ -321,7 +329,7 @@ u8 gGreatFoxIntact;
u8 gTiStartLandmaster;
u16 gControllerRumbleTimers[4];
u16 gPlayerScores[4];
-s32 D_ctx_80177C50;
+s32 gCircleWipeFrame;
s32 D_ctx_80177C70; // sets camera field of view Y. initialized to 0 and never changed
s32 gTraining360MsgTimer;
s32 gTraining360MsgIndex;
@@ -341,10 +349,10 @@ s32 gLeftWingFlashTimer[4];
s32 gRightWingDebrisTimer[4];
s32 gLeftWingDebrisTimer[4];
s32 gBombCount[4];
-s32 D_ctx_80177DB8[4];
-s32 D_ctx_80177DD0[4][10];
-s32 D_ctx_80177E74;
-s32 D_ctx_80177E7C;
+s32 gVsPoints[4];
+s32 gVsKills[4][10];
+s32 gVsMatchOver;
+s32 gVsMatchStart;
bool gChangeTo360;
Vec3f gTeamArrowsViewPos[10];
f32 D_ctx_80177F20[65]; // Seem to be an early implementation of RadarMark
@@ -358,16 +366,16 @@ u32* gStarFillColors;
UNK_TYPE F_801782A0;
Scenery360* gScenery360;
UNK_TYPE F_801782B0;
-s32 D_ctx_801782B8;
-s32 D_ctx_801782BC;
-PosRot* D_ctx_801782C4;
-f32* D_ctx_801782CC;
+s32 gDrawSmallRocks;
+s32 D_ctx_801782BC; // set to 0, never used
+PosRot* gZOSnakePosRots;
+f32* D_ctx_801782CC; // arrays used for dynamic floor
f32* D_ctx_801782D4;
f32* D_ctx_801782DC;
f32* D_ctx_801782E4;
f32* D_ctx_801782EC;
UNK_TYPE F_801782F4;
-s32 D_ctx_801782FC;
+s32 gDynaFloorTimer; // timer related to dynamic floor
UNK_TYPE F_80178304;
UNK_TYPE F_8017830C;
UNK_TYPE F_80178314;