mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-03 14:34:32 +00:00
Decompile z_kankyo (#956)
* working * start color switch * progress * progress * progress on bgm func * progress * game over matched (except the rodata meme) * start update * progress * lightning docs done * progress * progress * progress * progress * progress * can compile at least * suns state, progress on kankyo_update * some new names * progress * progress * progress * new functions * cleanup * more matches * another match * now functional * format * better match * hugely improved update * cleanup/review * remove old changes * review2 * review3 * missed one * review4 * change asm filenames * update doorwarp1 * review5 * Kankyo_ -> Environment_ * format * merge master and format functions.h Co-authored-by: Jacob Young <jacobly0@users.noreply.github.com> Co-authored-by: fig <fig02srl@gmail.com> Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
This commit is contained in:
parent
50095d427c
commit
e51f50f0ff
139 changed files with 3478 additions and 6277 deletions
|
@ -871,47 +871,44 @@ 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);
|
||||
// ? func_8006F0D4(?);
|
||||
// ? func_8006F0FC(?);
|
||||
u8 func_8006F140(GlobalContext*, EnvironmentContext*, UNK_TYPE);
|
||||
f32 func_8006F93C(u16, u16, u16);
|
||||
f32 func_8006F9BC(u16 endFrame, u16 startFrame, u16 frames, u16, u16);
|
||||
// ? func_8006FB94(?);
|
||||
void func_8006FC88(u8 skyboxId, EnvironmentContext* envCtx, SkyboxContext* skyboxCtx);
|
||||
void func_80070600(GlobalContext* globalCtx, s32 waterboxProperties);
|
||||
void func_800706A0(GlobalContext* globalCtx);
|
||||
// ? func_80070718(?);
|
||||
void func_80070C24(GlobalContext* globalCtx, EnvironmentContext* envCtx, LightContext* lightCtx, PauseContext* pauseCtx,
|
||||
MessageContext* msgCtx, GameOverContext* gameOverCtx, GraphicsContext* gfxCtx);
|
||||
void func_800730DC(GlobalContext*);
|
||||
void func_80073988(GlobalContext*, EnvironmentContext*, View*, GraphicsContext*, Vec3f, UNK_TYPE);
|
||||
// ? func_80073A5C(?);
|
||||
f32 func_800746DC();
|
||||
void func_80074704(GlobalContext*, View*, GraphicsContext*);
|
||||
void func_80074CE8(GlobalContext* globalCtx, s32 arg1);
|
||||
void func_80074D6C(GlobalContext*);
|
||||
// ? func_80074FF4(?);
|
||||
void func_800750C0(GlobalContext*);
|
||||
void func_800753C4(GlobalContext*, u8);
|
||||
void func_8007542C(GlobalContext*, u8);
|
||||
u16 Environment_GetPixelDepth(s32 x, s32 y);
|
||||
void Environment_GraphCallback(GraphicsContext* gfxCtx, void* param);
|
||||
void Environment_Init(GlobalContext* globalCtx, EnvironmentContext* envCtx, s32 unused);
|
||||
u8 Environment_SmoothStepToU8(u8* pvalue, u8 target, u8 scale, u8 step, u8 minStep);
|
||||
u8 Environment_SmoothStepToS8(s8* pvalue, s8 target, u8 scale, u8 step, u8 minStep);
|
||||
f32 Environment_LerpWeight(u16 max, u16 min, u16 val);
|
||||
f32 Environment_LerpWeightAccelDecel(u16 endFrame, u16 startFrame, u16 curFrame, u16 accelDuration, u16 decelDuration);
|
||||
void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxContext* skyboxCtx);
|
||||
void Environment_EnableUnderwaterLights(GlobalContext* globalCtx, s32 waterLightsIndex);
|
||||
void Environment_DisableUnderwaterLights(GlobalContext* globalCtx);
|
||||
void Environment_Update(GlobalContext* globalCtx, EnvironmentContext* envCtx, LightContext* lightCtx,
|
||||
PauseContext* pauseCtx, MessageContext* msgCtx, GameOverContext* gameOverCtx,
|
||||
GraphicsContext* gfxCtx);
|
||||
void Environment_DrawSunAndMoon(GlobalContext* globalCtx);
|
||||
void Environment_DrawSunLensFlare(GlobalContext* globalCtx, EnvironmentContext* envCtx, View* view,
|
||||
GraphicsContext* gfxCtx, Vec3f pos, s32 unused);
|
||||
void Environment_DrawLensFlare(GlobalContext* globalCtx, EnvironmentContext* envCtx, View* view,
|
||||
GraphicsContext* gfxCtx, Vec3f pos, s32 unused, s16 arg6, f32 arg7, s16 arg8, u8 arg9);
|
||||
void Environment_DrawRain(GlobalContext* globalCtx, View* view, GraphicsContext* gfxCtx);
|
||||
void func_80074CE8(GlobalContext* globalCtx, u32 arg1);
|
||||
void Environment_DrawSkyboxFilters(GlobalContext* globalCtx);
|
||||
void Environment_UpdateLightningStrike(GlobalContext* globalCtx);
|
||||
void Environment_AddLightningBolts(GlobalContext* globalCtx, u8 num);
|
||||
void Environment_DrawLightning(GlobalContext* globalCtx, s32 unused);
|
||||
void func_800758AC(GlobalContext* globalCtx);
|
||||
// ? func_80075B44(?);
|
||||
void func_80075E68(GlobalContext* globalCtx);
|
||||
void Kankyo_InitGameOverLights(GlobalContext* globalCtx);
|
||||
void Kankyo_FadeInGameOverLights(GlobalContext* globalCtx);
|
||||
void Kankyo_FadeOutGameOverLights(GlobalContext* globalCtx);
|
||||
// ? func_800766C4(?);
|
||||
void func_8007672C(GraphicsContext*, u8, u8, u8, u8, UNK_TYPE);
|
||||
void func_80076934(GlobalContext* globalCtx, u8);
|
||||
void func_800773A8(GlobalContext* globalCtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4);
|
||||
s32 func_800775CC();
|
||||
void func_800775D8();
|
||||
s32 func_800775E4();
|
||||
void Environment_DrawCustomLensFlare(GlobalContext* globalCtx);
|
||||
void Environment_InitGameOverLights(GlobalContext* globalCtx);
|
||||
void Environment_FadeInGameOverLights(GlobalContext* globalCtx);
|
||||
void Environment_FadeOutGameOverLights(GlobalContext* globalCtx);
|
||||
void Environment_FillScreen(GraphicsContext* gfxCtx, u8 red, u8 green, u8 blue, u8 alpha, u8 drawFlags);
|
||||
void Environment_DrawSandstorm(GlobalContext* globalCtx, u8 sandstormState);
|
||||
void Environment_AdjustLights(GlobalContext* globalCtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4);
|
||||
s32 Environment_GetBgsDayCount(void);
|
||||
void Environment_ClearBgsDayCount(void);
|
||||
s32 Environment_GetTotalDays(void);
|
||||
void func_800775F0(u16);
|
||||
s32 func_80077600(void);
|
||||
void func_80077624(GlobalContext* globalCtx);
|
||||
void func_80077684(GlobalContext* globalCtx);
|
||||
void func_800776E4(GlobalContext* globalCtx);
|
||||
void Environment_WarpSongLeave(GlobalContext* globalCtx);
|
||||
void Lib_MemSet(u8* dest, size_t size, u8 val);
|
||||
f32 Math_CosS(s16 angle);
|
||||
f32 Math_SinS(s16 angle);
|
||||
|
@ -962,7 +959,7 @@ void Lights_Draw(Lights* lights, GraphicsContext* gfxCtx);
|
|||
void Lights_BindAll(Lights* lights, LightNode* listHead, Vec3f* vec);
|
||||
void LightContext_Init(GlobalContext* globalCtx, LightContext* lightCtx);
|
||||
void LightContext_SetAmbientColor(LightContext* lightCtx, u8 r, u8 g, u8 b);
|
||||
void func_8007A698(LightContext* lightCtx, u8 arg1, u8 arg2, u8 arg3, s16 numLights, s16 arg5);
|
||||
void LightContext_SetFog(LightContext* lightCtx, u8 arg1, u8 arg2, u8 arg3, s16 numLights, s16 arg5);
|
||||
Lights* LightContext_NewLights(LightContext* lightCtx, GraphicsContext* gfxCtx);
|
||||
void LightContext_InitList(GlobalContext* globalCtx, LightContext* lightCtx);
|
||||
void LightContext_DestroyList(GlobalContext* globalCtx, LightContext* lightCtx);
|
||||
|
@ -1128,9 +1125,9 @@ void Quake_Init(void);
|
|||
s16 Quake_Add(Camera* cam, u32 callbackIdx);
|
||||
u32 Quake_RemoveFromIdx(s16 idx);
|
||||
s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData);
|
||||
Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f);
|
||||
Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f);
|
||||
Gfx* Gfx_SetFog2(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f);
|
||||
Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
|
||||
Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
|
||||
Gfx* Gfx_SetFog2(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
|
||||
Gfx* Gfx_CallSetupDL(Gfx* gfx, u32 i);
|
||||
Gfx* func_800937C0(Gfx* gfx);
|
||||
Gfx* func_80093808(Gfx* gfx);
|
||||
|
@ -1392,7 +1389,7 @@ void func_800AD950(struct_80166500* this);
|
|||
void func_800AD958(struct_80166500* this, Gfx** gfxp);
|
||||
void Skybox_Init(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skyboxId);
|
||||
Mtx* SkyboxDraw_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z);
|
||||
void SkyboxDraw_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId, s16 alpha, f32 x, f32 y, f32 z);
|
||||
void SkyboxDraw_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y, f32 z);
|
||||
void SkyboxDraw_Update(SkyboxContext* skyboxCtx);
|
||||
void PlayerCall_InitFuncPtrs(void);
|
||||
void TransitionUnk_InitGraphics(TransitionUnk* this);
|
||||
|
@ -1499,7 +1496,7 @@ void func_800BC490(GlobalContext* globalCtx, s16 point);
|
|||
s32 func_800BC56C(GlobalContext* globalCtx, s16 arg1);
|
||||
void func_800BC590(GlobalContext* globalCtx);
|
||||
void func_800BC5E0(GlobalContext* globalCtx, s32 arg1);
|
||||
Gfx* func_800BC8A0(GlobalContext* globalCtx, Gfx* gfx);
|
||||
Gfx* Gameplay_SetFog(GlobalContext* globalCtx, Gfx* gfx);
|
||||
void Gameplay_Destroy(GameState* thisx);
|
||||
void Gameplay_Init(GameState* thisx);
|
||||
void Gameplay_Main(GameState* thisx);
|
||||
|
@ -2125,8 +2122,6 @@ void func_800F89A0(u8, Vec3f*);
|
|||
void func_800F89E8(Vec3f*);
|
||||
void func_800F9280(u8 seqIdx, u8 seqId, u8 arg2, u16 fadeTimer);
|
||||
void Audio_QueueSeqCmd(u32 bgmID);
|
||||
u16 func_800FA0B4(u8 a0);
|
||||
s32 func_800FA11C(u32, u32);
|
||||
void func_800F8A44(Vec3f* pos, u16 sfxId);
|
||||
void func_800F8BA0(u8, u16);
|
||||
void Audio_StopSfx(u32 sfxId);
|
||||
|
@ -2137,8 +2132,11 @@ void func_800F8F88(void);
|
|||
u8 Audio_IsSfxPlaying(u32 sfxId);
|
||||
void func_800F905C(void);
|
||||
void func_800F9474(u8, u16);
|
||||
void func_800F94FC(u32);
|
||||
void Audio_ProcessSeqCmd(u32);
|
||||
void Audio_ProcessSeqCmds(void);
|
||||
u16 func_800FA0B4(u8 a0);
|
||||
s32 func_800FA11C(u32 arg0, u32 arg1);
|
||||
void func_800FA174(u8);
|
||||
void func_800FA18C(u8, u8);
|
||||
void Audio_SetVolScale(u8 seqIdx, u8 scaleIdx, u8 targetVol, u8 volFadeTimer);
|
||||
|
|
|
@ -38,6 +38,14 @@
|
|||
#define kREG(r) BASE_REG(27, r)
|
||||
#define bREG(r) BASE_REG(28, r)
|
||||
|
||||
#define R_ENV_AMBIENT_COLOR(i) REG(0 + i)
|
||||
#define R_ENV_LIGHT1_COLOR(i) REG(3 + i)
|
||||
#define R_ENV_LIGHT2_COLOR(i) REG(6 + i)
|
||||
#define R_ENV_DISABLE_DBG REG(9)
|
||||
#define R_ENV_FOG_COLOR(i) REG(10 + i)
|
||||
#define R_ENV_FOG_FAR REG(13)
|
||||
#define R_ENV_FOG_NEAR REG(14)
|
||||
#define R_ENV_TIME_INCREMENT REG(15)
|
||||
#define R_RUN_SPEED_LIMIT REG(45)
|
||||
#define R_ENABLE_ARENA_DBG SREG(0)
|
||||
#define R_UPDATE_RATE SREG(30)
|
||||
|
@ -55,7 +63,7 @@
|
|||
#define R_CAM_MIN_PHI2 OREG(35)
|
||||
#define R_AT_LERP_MIN OREG(41)
|
||||
#define R_AT_LERP_SCALE OREG(42)
|
||||
#define R_CAM_YOFFSET_NORM OREG(46)
|
||||
#define R_CAM_YOFFSET_NORM OREG(46)
|
||||
#define R_CAM_FIXED3_FOV PREG(7)
|
||||
#define R_DBG_CAM_UPDATE PREG(80)
|
||||
#define R_DBG_REG_UPDATE PREG(82)
|
||||
|
@ -78,6 +86,8 @@
|
|||
#define R_ITEM_ICON_X(i) ZREG(82 + i)
|
||||
#define R_ITEM_ICON_Y(i) ZREG(86 + i)
|
||||
#define R_ITEM_ICON_DD(i) ZREG(90 + i)
|
||||
#define R_ENV_WIND_DIR(i) CREG(16 + i)
|
||||
#define R_ENV_WIND_SPEED CREG(19)
|
||||
#define R_A_BTN_Y XREG(16)
|
||||
#define R_A_BTN_X XREG(17)
|
||||
#define R_A_ICON_Y XREG(19)
|
||||
|
@ -87,6 +97,8 @@
|
|||
#define R_MAGIC_BAR_X XREG(49)
|
||||
#define R_MAGIC_BAR_LARGE_Y XREG(50)
|
||||
#define R_MAGIC_FILL_X XREG(51)
|
||||
#define R_ENV_LIGHT1_DIR(i) cREG(3 + i)
|
||||
#define R_ENV_LIGHT2_DIR(i) cREG(6 + i)
|
||||
#define R_B_LABEL_DD WREG(0)
|
||||
#define R_OW_MINIMAP_X WREG(29)
|
||||
#define R_OW_MINIMAP_Y WREG(30)
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "z64.h"
|
||||
#include "segment_symbols.h"
|
||||
|
||||
extern Mtx D_01000000;
|
||||
extern Gfx D_06025218[];
|
||||
extern Gfx D_060252D8[];
|
||||
extern Gfx D_06025438[];
|
||||
|
@ -158,27 +159,13 @@ extern s32 gDbgCamEnabled;
|
|||
extern s16 D_8011E0B0;
|
||||
//extern ? D_8011E0D4;
|
||||
extern GameStateOverlay gGameStateOverlayTable[6];
|
||||
//extern ? D_8011FAF0;
|
||||
extern u8 D_8011FB30;
|
||||
extern u8 gWeatherMode;
|
||||
extern u8 D_8011FB34;
|
||||
extern u8 D_8011FB38;
|
||||
extern u8 D_8011FB3C;
|
||||
extern u16 D_8011FB40;
|
||||
//extern ? D_8011FB44;
|
||||
//extern ? D_8011FB48;
|
||||
//extern ? D_8011FC1C;
|
||||
//extern ? D_8011FD3C;
|
||||
//extern ? D_8011FDCC;
|
||||
//extern ? D_8011FDD0;
|
||||
//extern ? D_8011FE00;
|
||||
//extern ? D_8011FE20;
|
||||
//extern ? D_8011FE48;
|
||||
//extern ? D_8011FE70;
|
||||
//extern ? D_8011FE7C;
|
||||
//extern ? D_8011FE88;
|
||||
//extern ? D_8011FE94;
|
||||
//extern ? D_8011FEC4;
|
||||
//extern ? D_8011FED0;
|
||||
extern u8 gSkyboxBlendingEnabled;
|
||||
extern u16 gTimeIncrement;
|
||||
extern struct_8011FC1C D_8011FC1C[][9];
|
||||
extern SkyboxFile gSkyboxFiles[];
|
||||
extern s32 gZeldaArenaLogSeverity;
|
||||
extern MapData gMapDataTable;
|
||||
extern s16 gSpoilingItems[3];
|
||||
|
@ -2948,23 +2935,12 @@ extern u16 D_8015FCC4;
|
|||
//extern ? D_8015FCC6;
|
||||
extern u8 D_8015FCC8;
|
||||
//extern ? D_8015FCCA;
|
||||
extern u8 D_8015FCF0;
|
||||
extern Vec3f D_8015FCF8;
|
||||
extern s16 D_8015FD04;
|
||||
extern u8 gCustomLensFlareOn;
|
||||
extern Vec3f gCustomLensFlarePos;
|
||||
extern s16 D_8015FD06;
|
||||
extern f32 D_8015FD08;
|
||||
extern s16 D_8015FD0C;
|
||||
//extern ? D_8015FD10;
|
||||
extern u8 D_8015FD70;
|
||||
//extern ? D_8015FD7C;
|
||||
//extern ? D_8015FD7E;
|
||||
//extern ? D_8015FD80;
|
||||
//extern ? D_8015FD84;
|
||||
//extern ? D_8015FD88;
|
||||
//extern ? D_8015FD98;
|
||||
//extern ? D_8015FDA0;
|
||||
//extern ? D_8015FDAE;
|
||||
//extern ? D_8015FDB0;
|
||||
extern LightningStrike gLightningStrike;
|
||||
//extern ? D_8015FDF8;
|
||||
extern MapData* gMapData;
|
||||
//extern ? D_80160020;
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "z64audio.h"
|
||||
#include "z64object.h"
|
||||
#include "z64camera.h"
|
||||
#include "z64environment.h"
|
||||
#include "z64cutscene.h"
|
||||
#include "z64collision_check.h"
|
||||
#include "z64scene.h"
|
||||
|
@ -130,16 +131,16 @@ typedef struct GraphicsContext {
|
|||
/* 0x01C4 */ char unk_01C4[0xC0];
|
||||
/* 0x0284 */ OSViMode* viMode;
|
||||
/* 0x0288 */ char unk_0288[0x20]; // Unused, could this be Zelda 2/3 ?
|
||||
/* 0x02A8 */ TwoHeadGfxArena overlay; // "Zelda 4"
|
||||
/* 0x02B8 */ TwoHeadGfxArena polyOpa; // "Zelda 0"
|
||||
/* 0x02C8 */ TwoHeadGfxArena polyXlu; // "Zelda 1"
|
||||
/* 0x02A8 */ TwoHeadGfxArena overlay; // "Zelda 4"
|
||||
/* 0x02B8 */ TwoHeadGfxArena polyOpa; // "Zelda 0"
|
||||
/* 0x02C8 */ TwoHeadGfxArena polyXlu; // "Zelda 1"
|
||||
/* 0x02D8 */ u32 gfxPoolIdx;
|
||||
/* 0x02DC */ u16* curFrameBuffer;
|
||||
/* 0x02E0 */ char unk_2E0[0x04];
|
||||
/* 0x02E4 */ u32 viFeatures;
|
||||
/* 0x02E8 */ s32 fbIdx;
|
||||
/* 0x02EC */ void (*callback)(struct GraphicsContext*, u32);
|
||||
/* 0x02F0 */ u32 callbackParam;
|
||||
/* 0x02EC */ void (*callback)(struct GraphicsContext*, void*);
|
||||
/* 0x02F0 */ void* callbackParam;
|
||||
/* 0x02F4 */ f32 xScale;
|
||||
/* 0x02F8 */ f32 yScale;
|
||||
/* 0x02FC */ char unk_2FC[0x04];
|
||||
|
@ -575,71 +576,7 @@ typedef enum {
|
|||
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 state;
|
||||
} GameOverContext; // size = 0x02
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ char unk_00[0x02];
|
||||
/* 0x02 */ u16 unk_02;
|
||||
/* 0x04 */ Vec3f unk_04;
|
||||
/* 0x10 */ u8 unk_10;
|
||||
/* 0x11 */ u8 unk_11;
|
||||
/* 0x12 */ char unk_12[0x1];
|
||||
/* 0x13 */ u8 unk_13;
|
||||
/* 0x14 */ char unk_14[0x01];
|
||||
/* 0x15 */ u8 skyDisabled;
|
||||
/* 0x16 */ u8 sunMoonDisabled;
|
||||
/* 0x17 */ u8 gloomySky;
|
||||
/* 0x18 */ u8 unk_18;
|
||||
/* 0x19 */ u8 unk_19;
|
||||
/* 0x1A */ u16 unk_1A;
|
||||
/* 0x1C */ char unk_1C[0x02];
|
||||
/* 0x1E */ u8 unk_1E;
|
||||
/* 0x1F */ u8 unk_1F;
|
||||
/* 0x20 */ u8 unk_20;
|
||||
/* 0x21 */ u8 unk_21;
|
||||
/* 0x22 */ u16 unk_22;
|
||||
/* 0x24 */ u16 unk_24;
|
||||
/* 0x26 */ char unk_26[0x04];
|
||||
/* 0x2A */ s8 unk_2A;
|
||||
/* 0x2B */ s8 unk_2B;
|
||||
/* 0x2C */ s8 unk_2C;
|
||||
/* 0x2D */ char unk_2D[0x5E];
|
||||
/* 0x8C */ s16 unk_8C[3][3];
|
||||
/* 0x9E */ s16 unk_9E;
|
||||
/* 0xA0 */ s16 unk_A0;
|
||||
/* 0xA2 */ char unk_A2[0x06];
|
||||
/* 0xA8 */ s16 unk_A8;
|
||||
/* 0xAA */ s16 unk_AA;
|
||||
/* 0xAC */ s16 unk_AC;
|
||||
/* 0xB0 */ f32 unk_B0;
|
||||
/* 0xB4 */ u8 numLightSettings;
|
||||
/* 0xB8 */ UNK_PTR lightSettingsList;
|
||||
/* 0xBC */ u8 unk_BC;
|
||||
/* 0xBD */ u8 unk_BD;
|
||||
/* 0xBE */ u8 unk_BE;
|
||||
/* 0xBF */ u8 unk_BF;
|
||||
/* 0xC0 */ char unk_C0[0x0F];
|
||||
/* 0xCF */ u8 unk_CF[3];
|
||||
/* 0xD2 */ s16 unk_D2;
|
||||
/* 0xD4 */ char unk_D4[0x02];
|
||||
/* 0xD6 */ u16 unk_D6;
|
||||
/* 0xD8 */ f32 unk_D8;
|
||||
/* 0xDC */ u8 unk_DC;
|
||||
/* 0xDD */ u8 gloomySkyEvent;
|
||||
/* 0xDE */ u8 unk_DE;
|
||||
/* 0xDF */ u8 lightning;
|
||||
/* 0xE0 */ u8 unk_E0;
|
||||
/* 0xE1 */ u8 unk_E1;
|
||||
/* 0xE2 */ u8 unk_E2[4];
|
||||
/* 0xE6 */ u8 unk_E6;
|
||||
/* 0xE7 */ u8 unk_E7;
|
||||
/* 0xE8 */ u8 unk_E8;
|
||||
/* 0xE9 */ u8 unk_E9;
|
||||
/* 0xEA */ u8 unk_EA[4];
|
||||
/* 0xEE */ u8 unk_EE[4];
|
||||
/* 0xF2 */ u8 unk_F2[4];
|
||||
/* 0xF6 */ char unk_F6[0x06];
|
||||
} EnvironmentContext; // size = 0xFC
|
||||
} GameOverContext; // size = 0x2
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 id;
|
||||
|
@ -1837,4 +1774,16 @@ typedef struct {
|
|||
/* 0x04 */ const char* name;
|
||||
} FlagSetEntry; // size = 0x08
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ RomFile file;
|
||||
/* 0x08 */ RomFile pallete;
|
||||
} SkyboxFile; // size = 0x10
|
||||
|
||||
#define ROM_FILE(name) \
|
||||
{ (u32) _##name##SegmentRomStart, (u32)_##name##SegmentRomEnd }
|
||||
#define ROM_FILE_EMPTY(name) \
|
||||
{ (u32) _##name##SegmentRomStart, (u32)_##name##SegmentRomStart }
|
||||
#define ROM_FILE_UNSET \
|
||||
{ 0 }
|
||||
|
||||
#endif
|
||||
|
|
129
include/z64environment.h
Normal file
129
include/z64environment.h
Normal file
|
@ -0,0 +1,129 @@
|
|||
#ifndef _Z64ENVIRONMENT_H_
|
||||
#define _Z64ENVIRONMENT_H_
|
||||
|
||||
#include "z64math.h"
|
||||
#include "z64light.h"
|
||||
#include "z64dma.h"
|
||||
|
||||
#define FILL_SCREEN_OPA (1 << 0)
|
||||
#define FILL_SCREEN_XLU (1 << 1)
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ LIGHTNING_MODE_OFF, // no lightning
|
||||
/* 1 */ LIGHTNING_MODE_ON, // request ligtning strikes at random intervals
|
||||
/* 2 */ LIGHTNING_MODE_LAST // request one lightning strike before turning off
|
||||
} LightningMode;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ LIGHTNING_STRIKE_WAIT, // wait between lightning strikes. request bolts when timer hits 0
|
||||
/* 1 */ LIGHTNING_STRIKE_START, // fade in the flash. note: bolts are requested in the previous state
|
||||
/* 2 */ LIGHTNING_STRIKE_END // fade out the flash and go back to wait
|
||||
} LightningStrikeState;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ SKYBOX_DMA_INACTIVE,
|
||||
/* 1 */ SKYBOX_DMA_FILE1_START,
|
||||
/* 2 */ SKYBOX_DMA_FILE1_DONE,
|
||||
/* 3 */ SKYBOX_DMA_PAL1_START,
|
||||
/* 11 */ SKYBOX_DMA_FILE2_START = 11,
|
||||
/* 12 */ SKYBOX_DMA_FILE2_DONE,
|
||||
/* 13 */ SKYBOX_DMA_PAL2_START
|
||||
} SkyboxDmaState;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 state;
|
||||
/* 0x01 */ u8 flashRed;
|
||||
/* 0x02 */ u8 flashGreen;
|
||||
/* 0x03 */ u8 flashBlue;
|
||||
/* 0x04 */ u8 flashAlphaTarget;
|
||||
/* 0x08 */ f32 delayTimer;
|
||||
} LightningStrike; // size = 0xC
|
||||
|
||||
// describes what skybox files and blending modes to use depending on time of day
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 startTime;
|
||||
/* 0x02 */ u16 endTime;
|
||||
/* 0x04 */ u8 blend; // if true, blend between.. skyboxes? palletes?
|
||||
/* 0x05 */ u8 skybox1Index; // whats the difference between _pal and non _pal files?
|
||||
/* 0x06 */ u8 skybox2Index;
|
||||
} struct_8011FC1C; // size = 0x8
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 ambientColor[3];
|
||||
/* 0x03 */ s8 light1Dir[3];
|
||||
/* 0x06 */ u8 light1Color[3];
|
||||
/* 0x09 */ s8 light2Dir[3];
|
||||
/* 0x0C */ u8 light2Color[3];
|
||||
/* 0x0F */ u8 fogColor[3];
|
||||
/* 0x12 */ s16 fogNear;
|
||||
/* 0x14 */ s16 fogFar;
|
||||
} EnvLightSettings; // size = 0x16
|
||||
|
||||
// 1.0: 801D8EC4
|
||||
// dbg: 80222A44
|
||||
typedef struct {
|
||||
/* 0x00 */ char unk_00[0x02];
|
||||
/* 0x02 */ u16 timeIncrement; // how many units of time that pass every update
|
||||
/* 0x04 */ Vec3f sunPos; // moon position can be found by negating the sun position
|
||||
/* 0x10 */ u8 skybox1Index;
|
||||
/* 0x11 */ u8 skybox2Index;
|
||||
/* 0x12 */ char unk_12[0x01];
|
||||
/* 0x13 */ u8 skyboxBlend;
|
||||
/* 0x14 */ char unk_14[0x01];
|
||||
/* 0x15 */ u8 skyboxDisabled;
|
||||
/* 0x16 */ u8 sunMoonDisabled;
|
||||
/* 0x17 */ u8 unk_17; // currentWeatherMode for skybox? (prev called gloomySky)
|
||||
/* 0x18 */ u8 unk_18; // nextWeatherMode for skybox?
|
||||
/* 0x19 */ u8 unk_19;
|
||||
/* 0x1A */ u16 unk_1A;
|
||||
/* 0x1C */ char unk_1C[0x02];
|
||||
/* 0x1E */ u8 indoors; // when set, day time has no effect on lighting
|
||||
/* 0x1F */ u8 unk_1F; // outdoor light index
|
||||
/* 0x20 */ u8 unk_20; // prev outdoor light index?
|
||||
/* 0x21 */ u8 unk_21;
|
||||
/* 0x22 */ u16 unk_22;
|
||||
/* 0x24 */ u16 unk_24;
|
||||
/* 0x26 */ char unk_26[0x02];
|
||||
/* 0x28 */ LightInfo dirLight1; // used for sunlight outdoors
|
||||
/* 0x36 */ LightInfo dirLight2; // used for moonlight outdoors
|
||||
/* 0x44 */ s8 skyboxDmaState;
|
||||
/* 0x48 */ DmaRequest dmaRequest;
|
||||
/* 0x68 */ OSMesgQueue loadQueue;
|
||||
/* 0x80 */ OSMesg loadMsg;
|
||||
/* 0x84 */ f32 unk_84;
|
||||
/* 0x88 */ f32 unk_88;
|
||||
/* 0x8C */ s16 adjAmbientColor[3];
|
||||
/* 0x92 */ s16 adjLight1Color[3];
|
||||
/* 0x98 */ s16 adjFogColor[3];
|
||||
/* 0x9E */ s16 adjFogNear;
|
||||
/* 0xA0 */ s16 adjFogFar;
|
||||
/* 0xA2 */ char unk_A2[0x06];
|
||||
/* 0xA8 */ Vec3s windDirection;
|
||||
/* 0xB0 */ f32 windSpeed;
|
||||
/* 0xB4 */ u8 numLightSettings;
|
||||
/* 0xB8 */ EnvLightSettings* lightSettingsList; // list of light settings from the scene file
|
||||
/* 0xBC */ u8 blendIndoorLights; // when true, blend between indoor light settings when switching
|
||||
/* 0xBD */ u8 unk_BD; // indoor light index
|
||||
/* 0xBE */ u8 unk_BE; // prev indoor light index?
|
||||
/* 0xBF */ u8 unk_BF;
|
||||
/* 0xC0 */ EnvLightSettings lightSettings;
|
||||
/* 0xD6 */ u16 unk_D6;
|
||||
/* 0xD8 */ f32 unk_D8; // indoor light blend weight?
|
||||
/* 0xDC */ u8 unk_DC;
|
||||
/* 0xDD */ u8 gloomySkyMode;
|
||||
/* 0xDE */ u8 unk_DE; // gloomy sky state
|
||||
/* 0xDF */ u8 lightningMode;
|
||||
/* 0xE0 */ u8 unk_E0; // env sounds state
|
||||
/* 0xE1 */ u8 fillScreen;
|
||||
/* 0xE2 */ u8 screenFillColor[4];
|
||||
/* 0xE6 */ u8 sandstormState;
|
||||
/* 0xE7 */ u8 sandstormPrimA;
|
||||
/* 0xE8 */ u8 sandstormEnvA;
|
||||
/* 0xE9 */ u8 customSkyboxFilter;
|
||||
/* 0xEA */ u8 skyboxFilterColor[4];
|
||||
/* 0xEE */ u8 unk_EE[4];
|
||||
/* 0xF2 */ u8 unk_F2[4];
|
||||
/* 0xF6 */ char unk_F6[0x06];
|
||||
} EnvironmentContext; // size = 0xFC
|
||||
|
||||
#endif
|
|
@ -45,12 +45,10 @@ typedef struct LightNode {
|
|||
|
||||
typedef struct {
|
||||
/* 0x0 */ LightNode* listHead;
|
||||
/* 0x4 */ Color_RGB8 ambient;
|
||||
/* 0x7 */ u8 unk_07;
|
||||
/* 0x8 */ u8 unk_08;
|
||||
/* 0x9 */ u8 unk_09;
|
||||
/* 0xA */ s16 unk_0A;
|
||||
/* 0xC */ s16 unk_0C;
|
||||
/* 0x4 */ u8 ambientColor[3];
|
||||
/* 0x7 */ u8 fogColor[3];
|
||||
/* 0xA */ s16 fogNear; // how close until fog starts taking effect. range 0 - 1000
|
||||
/* 0xC */ s16 fogFar; // how far until fog starts to saturate. range 0 - 1000
|
||||
} LightContext; // size = 0x10
|
||||
|
||||
typedef enum {
|
||||
|
|
|
@ -76,7 +76,9 @@ typedef struct {
|
|||
/* 0x06 */ s16 yaw; // azimuthal angle
|
||||
} VecSph; // size = 0x08
|
||||
|
||||
#define F32_LERP(v0,v1,t) ((1.0f - (t)) * (v0) + (t) * (v1))
|
||||
#define LERP(x, y, scale) (((y) - (x)) * (scale) + (x))
|
||||
#define LERP32(x, y, scale) ((s32)(((y) - (x)) * (scale)) + (x))
|
||||
#define F32_LERP(v0,v1,t) ((v0) * (1.0f - (t)) + (v1) * (t))
|
||||
#define F32_LERPIMP(v0, v1, t) (v0 + ((v1 - v0) * t))
|
||||
#define F32_LERPIMPINV(v0, v1, t) ((v0) + (((v1) - (v0)) / (t)))
|
||||
#define BINANG_LERPIMP(v0, v1, t) ((v0) + (s16)(BINANG_SUB((v1), (v0)) * (t)))
|
||||
|
|
|
@ -66,8 +66,8 @@ typedef struct {
|
|||
/* 0x0008 */ s32 cutsceneIndex;
|
||||
/* 0x000C */ u16 dayTime; // "zelda_time"
|
||||
/* 0x0010 */ s32 nightFlag;
|
||||
/* 0x0014 */ s32 numDays;
|
||||
/* 0x0018 */ s32 unk_18; // increments with numDays, gets reset by goron for bgs and one other use
|
||||
/* 0x0014 */ s32 totalDays;
|
||||
/* 0x0018 */ s32 bgsDayCount; // increments with totalDays, can be cleared with `Environment_ClearBgsDayCount`
|
||||
/* 0x001C */ char newf[6]; // string "ZELDAZ". start of `info` substruct, originally called "information"
|
||||
/* 0x0022 */ u16 deaths;
|
||||
/* 0x0024 */ char playerName[8];
|
||||
|
@ -166,12 +166,12 @@ typedef struct {
|
|||
/* 0x1416 */ u16 nextDayTime; // "next_zelda_time"
|
||||
/* 0x1418 */ u8 fadeDuration;
|
||||
/* 0x1419 */ u8 unk_1419; // transition related
|
||||
/* 0x141A */ u16 environmentTime;
|
||||
/* 0x141A */ u16 skyboxTime;
|
||||
/* 0x141C */ u8 dogIsLost;
|
||||
/* 0x141D */ u8 nextTransition;
|
||||
/* 0x141E */ char unk_141E[0x0002];
|
||||
/* 0x1420 */ s16 worldMapArea;
|
||||
/* 0x1422 */ s16 unk_1422; // day time related
|
||||
/* 0x1422 */ s16 sunsSongState; // controls the effects of suns song
|
||||
/* 0x1424 */ s16 healthAccumulator;
|
||||
} SaveContext; // size = 0x1428
|
||||
|
||||
|
@ -205,4 +205,11 @@ typedef enum {
|
|||
/* 0x06 */ HS_DAMPE_RACE
|
||||
} HighScores;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ SUNSSONG_INACTIVE,
|
||||
/* 1 */ SUNSSONG_START, // the suns ocarina effect signals that the song has finished playing
|
||||
/* 2 */ SUNSSONG_SPEED_TIME, // suns was played where time passes, speed up the advancement of time
|
||||
/* 3 */ SUNSSONG_SPECIAL // time does not advance, but signals the song was played. used for freezing redeads
|
||||
} SunsSongState;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -57,9 +57,9 @@ typedef struct {
|
|||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x02 */ char pad[2];
|
||||
/* 0x04 */ s8 unk_04;
|
||||
/* 0x05 */ s8 unk_05;
|
||||
/* 0x06 */ s8 unk_06;
|
||||
/* 0x04 */ u8 x;
|
||||
/* 0x05 */ u8 y;
|
||||
/* 0x06 */ u8 z;
|
||||
/* 0x07 */ u8 unk_07;
|
||||
} SCmdWindSettings;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue