1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 14:34:32 +00:00

Global Context And General Cleanup (#863)

* door context

* renames

* done

* fix unintended change

* all nb gone

* more nb gone

* merge fishing

* fix size commentX

* door changes suggested by dragorn

* fix accidental semicolon

* another

* change all texture pointers to void*

* error fix and format

* Update src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c

Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl>

* fix ostime

* correct mistake in SkyboxContext

* probably fix nonmatching

* Update include/z64.h

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

* roman's suggestions, fix incorrect type definition in z64scene.h

* typo in struct

* make typedef use u8 array

* forgot one

* pull in master and format.sh

Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
Zelllll 2021-08-15 18:15:58 -05:00 committed by GitHub
parent 1890e751b9
commit 7551dc2b71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
105 changed files with 496 additions and 508 deletions

View file

@ -867,7 +867,7 @@ void KaleidoSetup_Update(GlobalContext* globalCtx);
void KaleidoSetup_Init(GlobalContext* globalCtx);
void KaleidoSetup_Destroy(GlobalContext* globalCtx);
void func_8006EE50(Font* font, s16 arg1, s16 arg2);
void Font_LoadChar(u32 offset, u8 character, u16 codePointIndex);
void Font_LoadChar(Font* font, u8 character, u16 codePointIndex);
void Font_LoadMessageBoxEndIcon(Font* font, u16 icon);
void Font_LoadOrderedFont(Font* font);
s32 func_8006F0A0(s32 arg0);
@ -1197,7 +1197,7 @@ s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId);
s32 Object_IsLoaded(ObjectContext* objectCtx, s32 bankIndex);
void func_800981B8(ObjectContext* objectCtx);
s32 Scene_ExecuteCommands(GlobalContext* globalCtx, SceneCmd* sceneCmd);
void func_80098CBC(GlobalContext* globalCtx, u8* nbTransitionActors);
void TransitionActor_InitContext(GameState* state, TransitionActorContext* transiActorCtx);
void func_800994A0(GlobalContext* globalCtx);
void Scene_Draw(GlobalContext* globalCtx);
void SkelAnime_DrawLod(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,

View file

@ -213,7 +213,7 @@ extern s16 gLinkObjectIds[2];
extern u32 gObjectTableSize;
extern RomFile gObjectTable[OBJECT_ID_MAX];
extern EntranceInfo gEntranceTable[1556];
extern Scene gSceneTable[SCENE_ID_MAX];
extern SceneTableEntry gSceneTable[SCENE_ID_MAX];
//extern ? D_8012A4A0;
extern u16 gSramSlotOffsets[];
//extern ? D_8012A690;

View file

@ -327,7 +327,8 @@ typedef struct {
/* 0x13C */ void* roomVtx;
/* 0x140 */ s16 unk_140;
/* 0x144 */ Vec3f rot;
} SkyboxContext; // size = 0x150
/* 0x150 */ char unk_150[0x10];
} SkyboxContext; // size = 0x160
typedef enum {
MESSAGE_ICON_TRIANGLE,
@ -335,7 +336,7 @@ typedef enum {
MESSAGE_ICON_ARROW
} MessageBoxIcon;
#define FONT_CHAR_TEX_SIZE 128 // 16x16 I4 texture
#define FONT_CHAR_TEX_SIZE ((16 * 16) / 2) // 16x16 I4 texture
typedef struct {
/* 0x0000 */ u32 msgOffset;
@ -611,7 +612,7 @@ typedef struct {
/* 0xAA */ s16 unk_AA;
/* 0xAC */ s16 unk_AC;
/* 0xB0 */ f32 unk_B0;
/* 0xB4 */ u8 nbLightSettings;
/* 0xB4 */ u8 numLightSettings;
/* 0xB8 */ UNK_PTR lightSettingsList;
/* 0xBC */ u8 unk_BC;
/* 0xBD */ u8 unk_BD;
@ -757,7 +758,8 @@ typedef struct {
/* 0x38 */ DmaRequest dmaRequest;
/* 0x58 */ OSMesgQueue loadQueue;
/* 0x70 */ OSMesg loadMsg;
} RoomContext; // size = 0x74
/* 0x74 */ s16 unk_74[2];
} RoomContext; // size = 0x78
typedef struct {
/* 0x000 */ s16 colATCount;
@ -941,6 +943,11 @@ typedef struct {
/* 0x03 */ u8 byte3;
} ElfMessage; // size = 0x4
typedef struct {
/* 0x00 */ u8 numActors;
/* 0x04 */ TransitionActorEntry* list;
} TransitionActorContext;
// Global Context (dbg ram start: 80212020)
typedef struct GlobalContext {
/* 0x00000 */ GameState state;
@ -963,7 +970,6 @@ typedef struct GlobalContext {
/* 0x01DB4 */ SoundSource soundSources[16];
/* 0x01F74 */ SramContext sramCtx;
/* 0x01F78 */ SkyboxContext skyboxCtx;
/* 0x020C8 */ char unk_20C8[0x10];
/* 0x020D8 */ MessageContext msgCtx; // "message"
/* 0x104F0 */ InterfaceContext interfaceCtx; // "parameter"
/* 0x10760 */ PauseContext pauseCtx;
@ -972,9 +978,7 @@ typedef struct GlobalContext {
/* 0x10B20 */ AnimationContext animationCtx;
/* 0x117A4 */ ObjectContext objectCtx;
/* 0x11CBC */ RoomContext roomCtx;
/* 0x11D30 */ s16 unk_11D30[2];
/* 0x11D34 */ u8 nbTransitionActors;
/* 0x11D38 */ TransitionActorEntry* transitionActorList;
/* 0x11D34 */ TransitionActorContext transiActorCtx;
/* 0x11D3C */ void (*playerInit)(Player* player, struct GlobalContext* globalCtx, FlexSkeletonHeader* skelHeader);
/* 0x11D40 */ void (*playerUpdate)(Player* player, struct GlobalContext* globalCtx, Input* input);
/* 0x11D44 */ s32 (*isPlayerDroppingFish)(struct GlobalContext* globalCtx);
@ -991,8 +995,8 @@ typedef struct GlobalContext {
/* 0x11DE8 */ u8 linkAgeOnLoad;
/* 0x11DE9 */ u8 unk_11DE9;
/* 0x11DEA */ u8 curSpawn;
/* 0x11DEB */ u8 nbSetupActors;
/* 0x11DEC */ u8 nbRooms;
/* 0x11DEB */ u8 numSetupActors;
/* 0x11DEC */ u8 numRooms;
/* 0x11DF0 */ RomFile* roomList;
/* 0x11DF4 */ ActorEntry* linkActorEntry;
/* 0x11DF8 */ ActorEntry* setupActorList;
@ -1022,7 +1026,7 @@ typedef struct GlobalContext {
/* 0x1241C */ TransitionFade transitionFade;
/* 0x12428 */ char unk_12428[0x3];
/* 0x1242B */ u8 unk_1242B;
/* 0x1242C */ Scene* loadedScene;
/* 0x1242C */ SceneTableEntry* loadedScene;
/* 0x12430 */ char unk_12430[0xE8];
} GlobalContext; // size = 0x12518
@ -1041,7 +1045,6 @@ typedef struct {
/* 0x001E0 */ SramContext sramCtx;
/* 0x001E4 */ char unk_1E4[0x4];
/* 0x001E8 */ SkyboxContext skyboxCtx;
/* 0x00338 */ char unk_338[0x10];
/* 0x00348 */ MessageContext msgCtx;
/* 0x0E760 */ char kanfont[0xE188];
/* 0x1C8E8 */ EnvironmentContext envCtx;

View file

@ -53,7 +53,7 @@ typedef struct {
/* 0x14 */ ActorInit* initInfo;
/* 0x18 */ char* name;
/* 0x1C */ u16 allocType;
/* 0x1E */ s8 nbLoaded; // original name: "clients"
/* 0x1E */ s8 numLoaded; // original name: "clients"
} ActorOverlay; // size = 0x20
typedef struct {

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

View file

@ -15,7 +15,7 @@ typedef struct {
/* 0x11 */ u8 config;
/* 0x12 */ u8 unk_12;
/* 0x13 */ u8 unk_13;
} Scene; // size = 0x14
} SceneTableEntry; // size = 0x14
typedef struct {
/* 0x00 */ u8 code;
@ -258,17 +258,16 @@ 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;
/* 0x00 */ u8 ambientColor[3];
/* 0x03 */ s8 diffuseDir1[3];
/* 0x06 */ u8 diffuseColor1[3];
/* 0x09 */ s8 diffuseDir2[3];
/* 0x0C */ u8 diffuseColor2[3];
/* 0x0F */ u8 fogColor[3];
/* 0x12 */ u16 fogNear;
/* 0x14 */ u16 fogFar;
} LightSettings; // size = 0x16
typedef struct {
/* 0x00 */ u8 count; // number of points in the path
@ -493,8 +492,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(numActors, list) \
{ SCENE_CMD_ID_TRANSI_ACTOR_LIST, numActors, CMD_PTR(list) }
#define SCENE_CMD_ENV_LIGHT_SETTINGS(numLightSettings, lightSettingsList) \
{ SCENE_CMD_ID_ENV_LIGHT_SETTINGS, numLightSettings, CMD_PTR(lightSettingsList) }