Document most of global context (#198)

* doesn't build for some reason..?

* some formatting fixes

* windows calculator is trash

* fix!

* fix2

* most of global context documented

* interfacectx

* hopefully fix interface

* document restrictions

* envCtx done

* revert accidental change

* fix

* pause ctx done

* fixxxxxxxxxxxxxxx

* remove unintended zapd change

* fix..?

* format files

* Update include/z64.h

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>

* ocarinstaff

* Update include/z64.h

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>

* Update include/z64.h

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>

* suggestions

* fix mistake in pausectx

* typo

* door context

* renames

* all nb removed

* Update include/z64.h

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update include/functions.h

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* fix kanfont, new docs

* format files, merge master

* fix typo in linker script

* extract asm properly

* door context rename

* fixes in door context

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
Zelllll
2021-07-05 21:14:27 -04:00
committed by GitHub
co-authored by Tharo engineer124
parent 0e51bf35a1
commit 6db3fc7b32
65 changed files with 870 additions and 739 deletions
+33 -33
View File
@@ -1741,13 +1741,13 @@ void func_800F4A10(GlobalContext* globalCtx);
void func_800F4C0C(GlobalContext* globalCtx);
void func_800F4E20(GlobalContext* globalCtx);
void func_800F4F28(GlobalContext* globalCtx);
void Kanfont_Nop800F4F40(GlobalContext* globalCtx, UNK_TYPE4 param_2, UNK_TYPE4 param_3);
void Kanfont_LoadAsciiChar(GlobalContext* globalCtx, u8 character, s32 iParm3);
void Kanfont_LoadMessageBoxEnd(Font* font, u16 type);
void Kanfont_LoadOrderedFont(Font* font);
void Font_LoadChar(GlobalContext* globalCtx, u16 codePointIndex, s32 offset);
void Font_LoadCharNES(GlobalContext* globalCtx, u8 codePointIndex, s32 offset);
void Font_LoadMessageBoxEndIcon(Font* font, u16 icon);
void Font_LoadOrderedFont(Font* font);
// void func_800F5090(void);
// void func_800F50D4(void);
void Kankyo_Init(GlobalContext* globalCtx, KankyoContext* envCtx);
void Kankyo_Init(GlobalContext* globalCtx, EnvironmentContext* envCtx);
u32 func_800F5954(u8* param_1, u32 param_2, u32 param_3, u8 param_4, u8 param_5);
// void func_800F5A8C(void);
// void func_800F5B10(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5);
@@ -1757,16 +1757,16 @@ u32 func_800F5954(u8* param_1, u32 param_2, u32 param_3, u8 param_4, u8 param_5)
// void func_800F6A04(void);
// void func_800F6A40(void);
// void func_800F6AB8(void);
void func_800F6B44(GlobalContext* globalCtx, KankyoContext* envCtx, s32 iParm3, s32 iParm4, s16* param_5);
void func_800F6B44(GlobalContext* globalCtx, EnvironmentContext* envCtx, s32 iParm3, s32 iParm4, s16* param_5);
// void func_800F6CEC(void);
// void func_800F6EA4(void);
// UNK_TYPE4 Kankyo_IsSceneUpsideDown(GlobalContext* globalCtx);
void func_800F6FF8(GlobalContext* globalCtx, KankyoContext* envCtx, LightContext* lightCtx);
void func_800F6FF8(GlobalContext* globalCtx, EnvironmentContext* envCtx, LightContext* lightCtx);
// void func_800F8554(void);
// void func_800F88C4(void);
// void func_800F8970(void);
// void func_800F8A9C(void);
// void func_800F8CD4(GlobalContext* globalCtx, KankyoContext* envCtx, LightContext* lightCtx, s32 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_800F8CD4(GlobalContext* globalCtx, EnvironmentContext* envCtx, LightContext* lightCtx, s32 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_800F8D84(void);
// void func_800F9728(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
// void func_800F9824(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE2 param_10, UNK_TYPE1 param_11);
@@ -2472,7 +2472,7 @@ void Scene_HeaderCmdObjectList(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdLightList(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdPathList(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdTransiActorList(GlobalContext* globalCtx, SceneCmd* cmd);
void Transition_Init(GameState* gamestate, TransitionContext* transitionCtx);
void Door_InitContext(GameState* gamestate, DoorContext* doorCtx);
void Scene_HeaderCmdEnvLightSettings(GlobalContext* globalCtx, SceneCmd* cmd);
s32 Scene_LoadAreaTextures(GlobalContext* globalCtx, s32 fileIndex);
void Scene_HeaderCmdSkyboxSettings(GlobalContext* globalCtx, SceneCmd* cmd);
@@ -3086,31 +3086,31 @@ void Play_Init(GlobalContext* globalCtx);
void func_8016F5A8(GlobalContext* globalCtx, s8* pcParm2, Input* iParm3);
// void func_8016FC78(void);
// void func_8016FC98(void);
void PreRender_SetValuesSave(PreRenderContext* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg);
void PreRender_Init(PreRenderContext* this);
void PreRender_SetValues(PreRenderContext* this, u32 width, u32 height, void* fbuf, void* zbuf);
void PreRender_Destroy(PreRenderContext* this);
void func_8016FDB8(PreRenderContext* this, Gfx** gfxp, void* buf, void* bufSave, u32 arg4);
void func_8016FF70(PreRenderContext* this, Gfx** gfxp, void* buf, void* bufSave);
void func_8016FF90(PreRenderContext* this, Gfx** gfxp, void* buf, void* bufSave, s32 envR, s32 envG, s32 envB, s32 envA);
void func_80170200(PreRenderContext* this, Gfx** gfxp, void* buf, void* bufSave);
void func_8017023C(PreRenderContext* this, Gfx** gfxp, void* buf, void* bufSave);
void func_8017057C(PreRenderContext* this, Gfx** gfxp);
void func_801705B4(PreRenderContext* this, Gfx** gfxp);
void func_801705EC(PreRenderContext* this, Gfx** gfxp);
void func_80170730(PreRenderContext* this, Gfx** gfxp);
void func_80170774(PreRenderContext* this, Gfx** gfxp);
void func_80170798(PreRenderContext* this, Gfx** gfxp);
void func_80170AE0(PreRenderContext* this, Gfx** gfxp, s32 alpha);
void func_80170B28(PreRenderContext* this, Gfx** gfxp);
void PreRender_AntiAliasAlgorithm(PreRenderContext* this, s32 x, s32 y);
void PreRender_ApplyAntiAliasingFilter(PreRenderContext* this);
void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg);
void PreRender_Init(PreRender* this);
void PreRender_SetValues(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf);
void PreRender_Destroy(PreRender* this);
void func_8016FDB8(PreRender* this, Gfx** gfxp, void* buf, void* bufSave, u32 arg4);
void func_8016FF70(PreRender* this, Gfx** gfxp, void* buf, void* bufSave);
void func_8016FF90(PreRender* this, Gfx** gfxp, void* buf, void* bufSave, s32 envR, s32 envG, s32 envB, s32 envA);
void func_80170200(PreRender* this, Gfx** gfxp, void* buf, void* bufSave);
void func_8017023C(PreRender* this, Gfx** gfxp, void* buf, void* bufSave);
void func_8017057C(PreRender* this, Gfx** gfxp);
void func_801705B4(PreRender* this, Gfx** gfxp);
void func_801705EC(PreRender* this, Gfx** gfxp);
void func_80170730(PreRender* this, Gfx** gfxp);
void func_80170774(PreRender* this, Gfx** gfxp);
void func_80170798(PreRender* this, Gfx** gfxp);
void func_80170AE0(PreRender* this, Gfx** gfxp, s32 alpha);
void func_80170B28(PreRender* this, Gfx** gfxp);
void PreRender_AntiAliasAlgorithm(PreRender* this, s32 x, s32 y);
void PreRender_ApplyAntiAliasingFilter(PreRender* this);
u32 func_801716C4(u8* arg0, u8* arg1, u8* arg2);
void func_801717F8(PreRenderContext* this);
void PreRender_ApplyFilters(PreRenderContext* this);
void PreRender_ApplyFiltersSlowlyInit(PreRenderContext* this);
void PreRender_ApplyFiltersSlowlyDestroy(PreRenderContext* this);
void func_801720C4(PreRenderContext* this);
void func_801717F8(PreRender* this);
void PreRender_ApplyFilters(PreRender* this);
void PreRender_ApplyFiltersSlowlyInit(PreRender* this);
void PreRender_ApplyFiltersSlowlyDestroy(PreRender* this);
void func_801720C4(PreRender* this);
void func_801720FC(PreRenderParams* params, Gfx** gfxp);
void func_80172758(Gfx** gfxp, void* timg, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tt, u16 arg8, f32 x, f32 y, f32 xScale, f32 yScale, u32 flags);
void THGA_Ct(TwoHeadGfxArena* thga, Gfx* start, u32 size);
+450 -347
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -103,7 +103,7 @@ typedef struct {
/* 0x14 */ ActorInit* initInfo;
/* 0x18 */ char* name;
/* 0x1C */ u16 allocType; // bit 0: don't allocate memory, use actorContext->0x250? bit 1: Always keep loaded?
/* 0x1E */ s8 nbLoaded; // original name: "clients"
/* 0x1E */ s8 numLoaded; // original name: "clients"
/* 0x1F */ UNK_TYPE1 pad1F[0x1];
} ActorOverlay; // size = 0x20
+3 -3
View File
@@ -81,13 +81,13 @@ typedef struct {
typedef struct {
/* 0x00 */ Vec3s minBounds; // minimum coordinates of poly bounding box
/* 0x06 */ Vec3s maxBounds; // maximum coordinates of poly bounding box
/* 0x0C */ u16 nbVertices;
/* 0x0C */ u16 numVertices;
/* 0x10 */ Vec3s* vtxList;
/* 0x14 */ u16 nbPolygons;
/* 0x14 */ u16 numPolygons;
/* 0x18 */ CollisionPoly* polyList;
/* 0x1C */ SurfaceType* surfaceTypeList;
/* 0x20 */ CamData* cameraDataList;
/* 0x24 */ u16 nbWaterBoxes;
/* 0x24 */ u16 numWaterBoxes;
/* 0x28 */ WaterBox* waterBoxes;
} CollisionHeader; // original name: BGDataInfo
+21
View File
@@ -4,6 +4,27 @@
#include <ultra64.h>
#include <unk.h>
typedef struct {
/* 0x00 */ s8 continueFlag;
/* 0x01 */ s8 cameraRoll;
/* 0x02 */ u16 nextPointFrame;
/* 0x04 */ f32 viewAngle; // in degrees
/* 0x08 */ Vec3s pos;
} CutsceneCameraPoint; // size = 0x10
typedef struct {
/* 0x00 */ Vec3f at;
/* 0x0C */ Vec3f eye;
/* 0x18 */ s16 roll;
/* 0x1A */ s16 fov;
} CutsceneCameraAngle; // size = 0x1C
typedef struct {
/* 0x0 */ CutsceneCameraPoint* atPoints;
/* 0x4 */ CutsceneCameraPoint* eyePoints;
/* 0x8 */ s16 relativeToPlayer;
} CutsceneCameraMove; // size = 0xC
typedef struct {
/* 0x00 */ u16 unk0; // action; // "dousa"
/* 0x02 */ u16 startFrame;
+20
View File
@@ -5,6 +5,26 @@
#include <PR/gbi.h>
#include <color.h>
typedef struct {
/* 0x00 */ u8 ambientColor[3];
/* 0x03 */ s8 diffuseDir1[3];
/* 0x06 */ u8 diffuseColor1[3];
/* 0x09 */ s8 diffusePos2[3];
/* 0x0C */ u8 diffuseColor[3];
/* 0x0F */ u8 fogColor[3];
/* 0x12 */ u16 fogNear;
/* 0x14 */ u16 fogFar;
} LightSettings; // size = 0x16
typedef struct {
/* 0x00 */ s16 ambientColor[3];
/* 0x06 */ s16 diffuseColor1[3];
/* 0x0C */ s16 diffuseColor2[3];
/* 0x12 */ s16 fogColor[3];
/* 0x18 */ s16 fogNear;
/* 0x1A */ s16 fogFar;
} LightSettings2; // size = 0x1C
typedef struct {
/* 0x0 */ s16 x;
/* 0x2 */ s16 y;
+6 -17
View File
@@ -299,9 +299,9 @@ typedef struct {
} TransitionActorEntry; // size = 0x10
typedef struct {
/* 0x00 */ u8 nbTransitionActors;
/* 0x00 */ u8 numTransitionActors;
/* 0x04 */ TransitionActorEntry* transitionActorList;
} TransitionContext;
} DoorContext;
typedef struct {
/* 0x0 */ s16 id;
@@ -468,17 +468,6 @@ typedef struct {
u32 dListEnd;
} MeshHeader2;
typedef struct {
u8 ambientClrR, ambientClrG, ambientClrB;
u8 diffuseClrA_R, diffuseClrA_G, diffuseClrA_B;
u8 diffuseDirA_X, diffuseDirA_Y, diffuseDirA_Z;
u8 diffuseClrB_R, diffuseClrB_G, diffuseClrB_B;
u8 diffuseDirB_X, diffuseDirB_Y, diffuseDirB_Z;
u8 fogClrR, fogClrG, fogClrB;
u16 unk;
u16 drawDistance;
} LightSettings;
typedef struct {
/* 0x00 */ u8 count; // number of points in the path
/* 0x01 */ s8 unk1;
@@ -664,7 +653,7 @@ typedef enum {
/* 0x70 */ SCENE_ALLEY
} SceneID;
// Scene draw configs
// SceneTableEntry draw configs
typedef enum {
/* 0 */ SCENE_DRAW_CFG_DEFAULT,
/* 1 */ SCENE_DRAW_CFG_MAT_ANIM,
@@ -676,7 +665,7 @@ typedef enum {
/* 7 */ SCENE_DRAW_CFG_MAT_ANIM_MANUAL_STEP
} SceneDrawConfigIds;
// Scene commands
// SceneTableEntry commands
typedef enum {
/* 0x00 */ SCENE_CMD_ID_SPAWN_LIST,
/* 0x01 */ SCENE_CMD_ID_ACTOR_LIST,
@@ -759,8 +748,8 @@ typedef enum {
#define SCENE_CMD_PATH_LIST(pathList) \
{ SCENE_CMD_ID_PATH_LIST, 0, CMD_PTR(pathList) }
#define SCENE_CMD_TRANSITION_ACTOR_LIST(numTransitionActors, transitionActorList) \
{ SCENE_CMD_ID_TRANSI_ACTOR_LIST, numTransitionActors, CMD_PTR(transitionActorList) }
#define SCENE_CMD_TRANSITION_ACTOR_LIST(numTransitionActors, actorList) \
{ SCENE_CMD_ID_TRANSI_ACTOR_LIST, numTransitionActors, CMD_PTR(actorList) }
#define SCENE_CMD_ENV_LIGHT_SETTINGS(numLightSettings, lightSettingsList) \
{ SCENE_CMD_ID_ENV_LIGHT_SETTINGS, numLightSettings, CMD_PTR(lightSettingsList) }