mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
z_kankyo pt 1 (#1377)
* z64environment.h * remove todo * Cleanup * data + bss + 2 functions * Bring over simple functions * Remove lerp comment * code functions csv * Remove docs changes * ZBufValToFixedPoint * Remove leading 0's * SEGMENT macros * eventDayCount * format * z64bombers_notebook.h * fix merge * Comments --------- Co-authored-by: angie <angheloalf95@gmail.com>
This commit is contained in:
+1
-84
@@ -527,89 +527,6 @@ void Font_LoadChar(PlayState* play, u16 codePointIndex, s32 offset);
|
||||
void Font_LoadCharNES(PlayState* play, u8 codePointIndex, s32 offset);
|
||||
void Font_LoadMessageBoxEndIcon(Font* font, u16 icon);
|
||||
void Font_LoadOrderedFont(Font* font);
|
||||
// void func_800F5090(void);
|
||||
s32 Environment_ZBufValToFixedPoint(s32 zBufferVal);
|
||||
void Environment_Init(PlayState* play, EnvironmentContext* envCtx, s32 arg2);
|
||||
u32 func_800F5954(u8* param_1, u32 param_2, u32 param_3, u8 param_4, u8 param_5);
|
||||
f32 Environment_LerpWeight(u16 max, u16 min, u16 val);
|
||||
// void func_800F5B10(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5);
|
||||
void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxContext* skyboxCtx);
|
||||
void func_800F6834(PlayState* play, s32 waterLightsIndex);
|
||||
void func_800F694C(PlayState* play);
|
||||
// void func_800F6A04(void);
|
||||
// void func_800F6A40(void);
|
||||
// void func_800F6AB8(void);
|
||||
void func_800F6B44(PlayState* play, EnvironmentContext* envCtx, s32 iParm3, s32 iParm4, s16* param_5);
|
||||
// void func_800F6CEC(void);
|
||||
// void func_800F6EA4(void);
|
||||
// UNK_TYPE4 Kankyo_IsSceneUpsideDown(PlayState* play);
|
||||
void func_800F6FF8(PlayState* play, EnvironmentContext* envCtx, LightContext* lightCtx);
|
||||
// void func_800F8554(void);
|
||||
// void func_800F88C4(void);
|
||||
// void func_800F8970(void);
|
||||
// void func_800F8A9C(void);
|
||||
void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContext* lightCtx,
|
||||
PauseContext* pauseCtx, MessageContext* msgCtx, GameOverContext* gameOverCtx,
|
||||
GraphicsContext* gfxCtx);
|
||||
// void func_800F8D84(void);
|
||||
void Environment_DrawSunLensFlare(PlayState* play, EnvironmentContext* envCtx, View* view, GraphicsContext* gfxCtx, Vec3f pos);
|
||||
void func_800F9824(PlayState* play, EnvironmentContext* envCtx, View* view, GraphicsContext* gfxCtx, Vec3f vec, f32 arg5, f32 arg6, s8 arg7, s8 arg8);
|
||||
// void func_800FA39C(void);
|
||||
// void func_800FA3C4(void);
|
||||
void Environment_DrawRain(PlayState* play, View* view, GraphicsContext* gfxCtx);
|
||||
void func_800FAAB4(PlayState* play, u8 arg1);
|
||||
// void func_800FAC20(void);
|
||||
// void func_800FAF74(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE1 param_5);
|
||||
// void func_800FB010(void);
|
||||
void Environment_AddLightningBolts(PlayState* play, u8 num);
|
||||
// void func_800FB388(void);
|
||||
void func_800FB758(PlayState* play);
|
||||
// void func_800FB9B4(void);
|
||||
void Environment_DrawCustomLensFlare(PlayState* play);
|
||||
void Kankyo_InitGameOverLights(PlayState* play);
|
||||
void Kankyo_FadeInGameOverLights(PlayState* play);
|
||||
void Kankyo_FadeOutGameOverLights(PlayState* play);
|
||||
// void func_800FC3DC(void);
|
||||
void Environment_FillScreen(GraphicsContext* gfxCtx, u8 red, u8 green, u8 blue, u8 alpha, u8 drawFlags);
|
||||
void Environment_DrawSandstorm(PlayState* play, u8 sandstormState);
|
||||
s32 func_800FD2B4(PlayState* play, f32 arg1, f32 arg2, f32 arg3, f32 arg4);
|
||||
void func_800FD538(Color_RGB8* param_1, Color_RGB8* param_2, f32 param_3, Vec3s* param_4);
|
||||
void Environment_LerpAmbientColor(PlayState* play, Color_RGB8* to, f32 lerp);
|
||||
void Environment_LerpDiffuseColor(PlayState* play, Color_RGB8* to, f32 lerp);
|
||||
void Environment_LerpFogColor(PlayState* play, Color_RGB8* to, f32 lerp);
|
||||
void Environment_LerpFog(PlayState* play, s16 fogNearTarget, s16 zFarTarget, f32 lerp);
|
||||
// u32 get_days_elapsed(void);
|
||||
// void reset_days_elapsed(void);
|
||||
// u32 get_current_day(void);
|
||||
void func_800FD750(u16 seqId);
|
||||
s32 func_800FD768(void);
|
||||
void func_800FD78C(PlayState* play);
|
||||
void func_800FD858(PlayState* play);
|
||||
void func_800FD928(s32 param_1);
|
||||
// void func_800FD980(void);
|
||||
// void func_800FDAF8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
|
||||
// void func_800FDC94(void);
|
||||
void func_800FE390(PlayState* play);
|
||||
void func_800FE3E0(PlayState* play);
|
||||
void Environment_StopTime(void);
|
||||
void Environment_StartTime(void);
|
||||
u8 Environment_IsTimeStopped(void);
|
||||
u32 func_800FE4B8(PlayState* play);
|
||||
s32 func_800FE590(PlayState* play);
|
||||
// void func_800FE5D0(void);
|
||||
// UNK_TYPE4 func_800FE610(void);
|
||||
u32 func_800FE620(PlayState* play);
|
||||
void func_800FE658(f32 arg0);
|
||||
// UNK_TYPE4 func_800FE6F8(UNK_TYPE4 param_1, s16 param_2, s16 param_3);
|
||||
// void func_800FE778(void);
|
||||
// void func_800FE788(void);
|
||||
// void func_800FE798(void);
|
||||
void func_800FE7A8(Color_RGBA8* inColor, Color_RGBA8* outColor);
|
||||
s32 func_800FE9B4(PlayState* play);
|
||||
void func_800FEA50(PlayState* play);
|
||||
void func_800FEAB0(void);
|
||||
// void func_800FEAC0(void);
|
||||
void func_800FEAF4(EnvironmentContext* envCtx);
|
||||
|
||||
void* Lib_MemCpy(void* dest, void* src, size_t size);
|
||||
void* Lib_MemSet(void* buffer, s32 value, size_t size);
|
||||
@@ -620,7 +537,7 @@ void Lib_PlaySfx(u16 sfxId);
|
||||
void Lib_PlaySfx_2(u16 sfxId);
|
||||
void Lib_PlaySfx_AtPos(Vec3f* pos, u16 sfxId);
|
||||
void Lib_Vec3f_TranslateAndRotateY(Vec3f* translation, s16 rotAngle, Vec3f* src, Vec3f* dst);
|
||||
void Lib_LerpRGB(Color_RGB8* a, Color_RGB8* b, f32 t, Color_RGB8* dst);
|
||||
void Color_RGB8_Lerp(Color_RGB8* a, Color_RGB8* b, f32 t, Color_RGB8* dst);
|
||||
void Lib_Nop801004FC(void);
|
||||
void* Lib_SegmentedToVirtual(void* ptr);
|
||||
void* Lib_SegmentedToVirtualNull(void* ptr);
|
||||
|
||||
+2
-2
@@ -146,8 +146,8 @@ typedef struct GraphicsContext {
|
||||
/* 0x2D8 */ char unk_2D8[0x2];
|
||||
/* 0x2DA */ u8 updateViMode;
|
||||
/* 0x2DB */ u8 framebufferIndex;
|
||||
/* 0x2DC */ void (*callback)(struct GraphicsContext*, u32);
|
||||
/* 0x2E0 */ u32 callbackArg;
|
||||
/* 0x2DC */ void (*callback)(struct GraphicsContext*, void*);
|
||||
/* 0x2E0 */ void* callbackArg;
|
||||
/* 0x2E4 */ f32 xScale;
|
||||
/* 0x2E8 */ f32 yScale;
|
||||
/* 0x2EC */ GfxMasterList* masterList;
|
||||
|
||||
@@ -32,6 +32,11 @@
|
||||
#define SEGMENT_BSS_END(segment) (_ ## segment ## SegmentBssEnd)
|
||||
#define SEGMENT_BSS_SIZE(segment) ((uintptr_t)SEGMENT_BSS_END(segment) - (uintptr_t)SEGMENT_BSS_START(segment))
|
||||
|
||||
#define ROM_FILE(name) \
|
||||
{ (uintptr_t)SEGMENT_ROM_START(name), (uintptr_t)SEGMENT_ROM_END(name) }
|
||||
#define ROM_FILE_UNSET \
|
||||
{ 0 }
|
||||
|
||||
DECLARE_SEGMENT(boot)
|
||||
DECLARE_ROM_SEGMENT(boot)
|
||||
|
||||
|
||||
@@ -99,36 +99,6 @@ extern BgSpecialSceneMaxObjects sCustomDynapolyMem[];
|
||||
// extern UNK_TYPE4 D_801BDAF8;
|
||||
|
||||
extern u8 kanfontOrdering[92];
|
||||
// extern UNK_TYPE4 D_801BDB90;
|
||||
// extern UNK_TYPE4 D_801BDB94;
|
||||
// extern UNK_TYPE4 D_801BDB98;
|
||||
// extern UNK_TYPE2 D_801BDB9C;
|
||||
// extern UNK_TYPE1 D_801BDBA0;
|
||||
// extern UNK_TYPE1 D_801BDBA4;
|
||||
// extern UNK_TYPE1 D_801BDBA8;
|
||||
extern u8 gWeatherMode;
|
||||
// extern UNK_TYPE1 D_801BDBB4;
|
||||
// extern UNK_TYPE1 D_801BDBB8;
|
||||
// extern UNK_TYPE1 D_801BDBBC;
|
||||
// extern UNK_TYPE1 D_801BDBC0;
|
||||
// extern UNK_TYPE1 D_801BDBC4;
|
||||
extern u8 D_801BDBC8;
|
||||
// extern UNK_TYPE1 D_801BDBCC;
|
||||
// extern UNK_TYPE1 D_801BDCF4;
|
||||
// extern UNK_TYPE1 D_801BE38E;
|
||||
// extern UNK_TYPE1 D_801BE38F;
|
||||
// extern UNK_TYPE1 D_801BE390;
|
||||
// extern UNK_TYPE1 D_801BE4D4;
|
||||
// extern UNK_TYPE1 D_801BE4F4;
|
||||
// extern UNK_TYPE1 D_801BE534;
|
||||
// extern UNK_TYPE1 D_801BE6D4;
|
||||
// extern UNK_TYPE1 D_801BE874;
|
||||
// extern UNK_TYPE4 D_801BE894;
|
||||
// extern UNK_TYPE4 D_801BE8BC;
|
||||
// extern UNK_TYPE4 D_801BE8E4;
|
||||
// extern UNK_TYPE1 D_801BE90C;
|
||||
// extern UNK_TYPE1 D_801BE92C;
|
||||
// extern UNK_TYPE1 D_801BE944;
|
||||
// extern actor_init_var_func sInitChainHandlers[11];
|
||||
// extern UNK_TYPE4 D_801BEAD4;
|
||||
// extern UNK_TYPE4 D_801BEAD8;
|
||||
@@ -1683,43 +1653,6 @@ extern TriNorm D_801EF638;
|
||||
extern SaveContext gSaveContext;
|
||||
|
||||
// extern UNK_TYPE1 D_801F4E20;
|
||||
extern u8 D_801F4E30;
|
||||
// extern UNK_TYPE1 D_801F4E31;
|
||||
extern s8 D_801F4E32;
|
||||
extern Vec3f D_801F4E38;
|
||||
extern f32 D_801F4E44;
|
||||
extern f32 D_801F4E48;
|
||||
extern s16 D_801F4E4C;
|
||||
extern s8 D_801F4E4E;
|
||||
extern Vec3f D_801F4E50;
|
||||
extern f32 D_801F4E5C;
|
||||
extern f32 D_801F4E60;
|
||||
extern s16 D_801F4E64;
|
||||
extern u8 D_801F4E68;
|
||||
extern f32 D_801F4E70;
|
||||
// extern UNK_TYPE1 D_801F4E74;
|
||||
extern u16 D_801F4E78;
|
||||
extern s16 D_801F4E7A;
|
||||
// extern UNK_TYPE1 D_801F4E80;
|
||||
// extern UNK_TYPE1 D_801F4EE0;
|
||||
// extern UNK_TYPE1 D_801F4EE8;
|
||||
// extern UNK_TYPE1 D_801F4EF8;
|
||||
// extern UNK_TYPE1 D_801F4F00;
|
||||
// extern UNK_TYPE1 D_801F4F10;
|
||||
// extern UNK_TYPE1 D_801F4F14;
|
||||
// extern UNK_TYPE1 D_801F4F18;
|
||||
// extern UNK_TYPE1 D_801F4F1C;
|
||||
// extern UNK_TYPE1 D_801F4F20;
|
||||
// extern UNK_TYPE1 D_801F4F24;
|
||||
// extern UNK_TYPE1 D_801F4F28;
|
||||
// extern UNK_TYPE1 D_801F4F2C;
|
||||
// extern UNK_TYPE1 D_801F4F2E;
|
||||
// extern UNK_TYPE1 D_801F4F30;
|
||||
// extern UNK_TYPE1 D_801F4F31;
|
||||
// extern UNK_TYPE1 D_801F4F32;
|
||||
// extern UNK_TYPE1 D_801F4F33;
|
||||
// extern UNK_TYPE1 D_801F4F34;
|
||||
// extern UNK_TYPE1 D_801F4F38;
|
||||
// extern UNK_TYPE1 sBeatingHeartsDDPrim;
|
||||
// extern UNK_TYPE1 sBeatingHeartsDDEnv;
|
||||
// extern UNK_TYPE1 sHeartsDDPrim;
|
||||
|
||||
+4
-63
@@ -40,6 +40,7 @@
|
||||
#include "z64dma.h"
|
||||
#include "z64eff_footmark.h"
|
||||
#include "z64effect.h"
|
||||
#include "z64environment.h"
|
||||
#include "z64frameadvance.h"
|
||||
#include "z64game_over.h"
|
||||
#include "z64game.h"
|
||||
@@ -60,11 +61,13 @@
|
||||
#include "z64skybox.h"
|
||||
#include "z64sound_source.h"
|
||||
#include "z64subs.h"
|
||||
#include "z64rumble.h"
|
||||
#include "z64transition.h"
|
||||
#include "z64view.h"
|
||||
#include "regs.h"
|
||||
|
||||
typedef struct {
|
||||
|
||||
typedef struct PauseContext {
|
||||
/* 0x000 */ View view;
|
||||
/* 0x168 */ u8* iconItemSegment;
|
||||
/* 0x16C */ u8* iconItem24Segment;
|
||||
@@ -163,68 +166,6 @@ typedef enum {
|
||||
/* 0x02 */ KALEID_OVL_MAX
|
||||
} KaleidoMgrOverlayType;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 unk_0;
|
||||
/* 0x02 */ u16 sceneTimeSpeed;
|
||||
/* 0x04 */ Vec3f sunPos;
|
||||
/* 0x10 */ u8 skybox1Index;
|
||||
/* 0x11 */ u8 skybox2Index;
|
||||
/* 0x12 */ u8 unk_12;
|
||||
/* 0x13 */ u8 skyboxBlend;
|
||||
/* 0x14 */ u8 unk_14;
|
||||
/* 0x15 */ u8 skyboxDisabled;
|
||||
/* 0x16 */ u8 sunMoonDisabled;
|
||||
/* 0x17 */ u8 skyboxConfig;
|
||||
/* 0x18 */ u8 changeSkyboxNextConfig;
|
||||
/* 0x19 */ u8 changeSkyboxState;
|
||||
/* 0x1A */ u16 changeSkyboxTimer;
|
||||
/* 0x1C */ u16 unk_1C;
|
||||
/* 0x1E */ u8 lightMode;
|
||||
/* 0x1F */ u8 lightConfig;
|
||||
/* 0x20 */ u8 changeLightNextConfig;
|
||||
/* 0x21 */ u8 changeLightEnabled;
|
||||
/* 0x22 */ u16 changeLightTimer;
|
||||
/* 0x24 */ u16 changeDuration;
|
||||
/* 0x26 */ u8 unk_26;
|
||||
/* 0x28 */ LightInfo dirLight1; // sun 1
|
||||
/* 0x36 */ LightInfo unk_36; // sun 2
|
||||
/* 0x44 */ s8 skyboxDmaState;
|
||||
/* 0x48 */ DmaRequest dmaRequest;
|
||||
/* 0x68 */ OSMesgQueue loadQueue;
|
||||
/* 0x80 */ OSMesg loadMsg;
|
||||
/* 0x84 */ f32 glareAlpha;
|
||||
/* 0x88 */ f32 lensFlareAlphaScale;
|
||||
/* 0x8C */ EnvLightSettings lightSettings;
|
||||
/* 0xA8 */ f32 unk_A8;
|
||||
/* 0xAC */ Vec3s windDir;
|
||||
/* 0xB4 */ f32 windSpeed;
|
||||
/* 0xB8 */ u8 numLightSettings;
|
||||
/* 0xBC */ LightSettings* lightSettingsList;
|
||||
/* 0xC0 */ u8 lightBlendEnabled;
|
||||
/* 0xC1 */ u8 lightSetting;
|
||||
/* 0xC2 */ u8 prevLightSetting;
|
||||
/* 0xC3 */ u8 lightSettingOverride;
|
||||
/* 0xC4 */ LightSettings unk_C4;
|
||||
/* 0xDA */ u16 lightBlendRateOverride;
|
||||
/* 0xDC */ f32 lightBlend;
|
||||
/* 0xE0 */ u8 unk_E0;
|
||||
/* 0xE1 */ u8 unk_E1;
|
||||
/* 0xE2 */ s8 unk_E2;
|
||||
/* 0xE3 */ u8 unk_E3; // modified by unused func in EnWeatherTag
|
||||
/* 0xE4 */ u8 unk_E4;
|
||||
/* 0xE5 */ u8 fillScreen;
|
||||
/* 0xE6 */ u8 screenFillColor[4];
|
||||
/* 0xEA */ u8 sandstormState;
|
||||
/* 0xEB */ u8 sandstormPrimA;
|
||||
/* 0xEC */ u8 sandstormEnvA;
|
||||
/* 0xED */ u8 unk_ED;
|
||||
/* 0xEE */ u8 unk_EE[4];
|
||||
/* 0xF2 */ u8 unk_F2[8]; // [3] is used by both DemoKankyo and ObjectKankyo effect count
|
||||
/* 0xFA */ u8 unk_FA[4];
|
||||
} EnvironmentContext; // size = 0x100
|
||||
|
||||
struct PlayState;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 seqId;
|
||||
/* 0x1 */ u8 ambienceId;
|
||||
|
||||
@@ -0,0 +1,327 @@
|
||||
#ifndef Z64ENVIRONMENT_H
|
||||
#define Z64ENVIRONMENT_H
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
#include "PR/os_message.h"
|
||||
#include "z64math.h"
|
||||
#include "z64dma.h"
|
||||
#include "unk.h"
|
||||
|
||||
struct GameOverContext;
|
||||
struct GraphicsContext;
|
||||
struct LightContext;
|
||||
struct MessageContext;
|
||||
struct PauseContext;
|
||||
struct PlayState;
|
||||
struct SkyboxContext;
|
||||
struct View;
|
||||
|
||||
#define FILL_SCREEN_OPA (1 << 0)
|
||||
#define FILL_SCREEN_XLU (1 << 1)
|
||||
|
||||
#define NEXT_TIME_NONE 0xFFFF
|
||||
#define NEXT_TIME_DAY CLOCK_TIME(12, 0)
|
||||
#define NEXT_TIME_NIGHT CLOCK_TIME(0, 0)
|
||||
#define NEXT_TIME_DAY_SET 0xFFFE
|
||||
#define NEXT_TIME_NIGHT_SET 0xFFFD
|
||||
|
||||
#define LIGHT_SETTING_MAX 31
|
||||
#define LIGHT_SETTING_OVERRIDE_NONE 0xFF
|
||||
|
||||
// This mode disables the updating of lights in both light modes.
|
||||
// With this mode enabled, the only way lights can change is via the adjustment arrays.
|
||||
// This mode is not used in the original game.
|
||||
#define LIGHT_SETTING_OVERRIDE_FULL_CONTROL 0xFE
|
||||
|
||||
#define LIGHT_BLENDRATE_OVERRIDE_NONE 0xFFFF
|
||||
#define LIGHT_BLEND_OVERRIDE_NONE 0
|
||||
#define LIGHT_BLEND_OVERRIDE_ON 1
|
||||
|
||||
// This mode disables the light system's automatic blending between
|
||||
// light settings for `LIGHT_MODE_SETTINGS` (or using a light setting override).
|
||||
// This is a bit of a hack used only by bosses in the original game.
|
||||
#define LIGHT_BLEND_OVERRIDE_FULL_CONTROL 2
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ LIGHT_MODE_TIME, // environment lights use `lightConfig` and change based on time of day
|
||||
/* 1 */ LIGHT_MODE_SETTINGS // environment lights use `lightSetting`
|
||||
} LightMode;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ LIGHTNING_OFF, // no lightning
|
||||
/* 1 */ LIGHTNING_ON, // request ligtning strikes at random intervals
|
||||
/* 2 */ LIGHTNING_LAST // request one lightning strike before turning off
|
||||
} LightningState;
|
||||
|
||||
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 */ WEATHER_MODE_CLEAR,
|
||||
/* 1 */ WEATHER_MODE_1, // rain?
|
||||
/* 2 */ WEATHER_MODE_2,
|
||||
/* 3 */ WEATHER_MODE_SNOW
|
||||
} WeatherMode;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ CHANGE_SKYBOX_INACTIVE,
|
||||
/* 1 */ CHANGE_SKYBOX_REQUESTED,
|
||||
/* 2 */ CHANGE_SKYBOX_WAIT,
|
||||
/* 3 */ CHANGE_SKYBOX_ACTIVE
|
||||
} ChangeSkyboxState;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ SKYBOX_DMA_INACTIVE,
|
||||
/* 1 */ SKYBOX_DMA_TEXTURE1_START,
|
||||
/* 11 */ SKYBOX_DMA_TEXTURE2_START = 11
|
||||
} SkyboxDmaState;
|
||||
|
||||
//! @TODO: Verify from OoT (may not be the same)
|
||||
typedef enum {
|
||||
/* 0 */ PRECIP_RAIN_MAX, // max number of raindrops that can draw; uses this or SOS_MAX, whichever is larger
|
||||
/* 1 */ PRECIP_RAIN_CUR, // current number of rain drops being drawn on screen
|
||||
/* 2 */ PRECIP_SNOW_CUR, // current number of snowflakes being drawn on screen
|
||||
/* 3 */ PRECIP_SNOW_MAX, // max number of snowflakes that can draw
|
||||
/* 4 */ PRECIP_SOS_MAX, // max number of rain drops requested from song of storms specifically
|
||||
/* 5 */ PRECIP_MAX
|
||||
} PrecipitationData;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ STORM_REQUEST_NONE,
|
||||
/* 1 */ STORM_REQUEST_START,
|
||||
/* 2 */ STORM_REQUEST_STOP
|
||||
} StormRequest;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ STORM_STATE_OFF,
|
||||
/* 1 */ STORM_STATE_ON
|
||||
} StormState;
|
||||
|
||||
typedef enum {
|
||||
/* 0x00 */ TIMESEQ_DAY_BGM,
|
||||
/* 0x01 */ TIMESEQ_FADE_DAY_BGM,
|
||||
/* 0x02 */ TIMESEQ_NIGHT_BEGIN_SFX,
|
||||
/* 0x03 */ TIMESEQ_EARLY_NIGHT_CRITTERS,
|
||||
/* 0x04 */ TIMESEQ_NIGHT_DELAY,
|
||||
/* 0x05 */ TIMESEQ_NIGHT_CRITTERS,
|
||||
/* 0x06 */ TIMESEQ_DAY_BEGIN_SFX,
|
||||
/* 0x07 */ TIMESEQ_MORNING_CRITTERS,
|
||||
/* 0x08 */ TIMESEQ_DAY_DELAY,
|
||||
/* 0xFE */ TIMESEQ_REQUEST = 0xFE,
|
||||
/* 0xFF */ TIMESEQ_DISABLED
|
||||
} TimeBasedSeqState;
|
||||
|
||||
#define SCENESEQ_DEFAULT 0
|
||||
#define SCENESEQ_MORNING 0xFE
|
||||
|
||||
typedef enum {
|
||||
/* 0x0 */ SANDSTORM_OFF,
|
||||
/* 0x1 */ SANDSTORM_FILL,
|
||||
/* 0x2 */ SANDSTORM_UNFILL,
|
||||
/* 0x3 */ SANDSTORM_ACTIVE,
|
||||
/* 0x4 */ SANDSTORM_DISSIPATE,
|
||||
/* 0x5 */ SANDSTORM_5,
|
||||
/* 0x6 */ SANDSTORM_6,
|
||||
/* 0x7 */ SANDSTORM_7,
|
||||
/* 0x8 */ SANDSTORM_8,
|
||||
/* 0x9 */ SANDSTORM_9,
|
||||
/* 0xA */ SANDSTORM_A,
|
||||
/* 0xB */ SANDSTORM_B,
|
||||
/* 0xC */ SANDSTORM_C,
|
||||
/* 0xD */ SANDSTORM_D
|
||||
} SandstormState;
|
||||
|
||||
typedef struct LightningStrike {
|
||||
/* 0x00 */ u8 state;
|
||||
/* 0x01 */ u8 flashRed;
|
||||
/* 0x02 */ u8 flashGreen;
|
||||
/* 0x03 */ u8 flashBlue;
|
||||
/* 0x04 */ u8 flashAlphaTarget;
|
||||
/* 0x08 */ f32 delayTimer;
|
||||
} LightningStrike; // size = 0xC
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u16 startTime;
|
||||
/* 0x2 */ u16 endTime;
|
||||
/* 0x4 */ u8 skybox1Index;
|
||||
/* 0x5 */ u8 skybox2Index;
|
||||
/* 0x6 */ u8 color1Index;
|
||||
/* 0x7 */ u8 color2Index;
|
||||
} TimeBasedSkyboxEntry; // size = 0x8
|
||||
|
||||
#define ENV_FOGNEAR_MAX 996
|
||||
#define ENV_ZFAR_MAX 15000
|
||||
|
||||
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; // ranges from 0-1000 (0: starts immediately, 1000: no fog), but is clamped to ENV_FOGNEAR_MAX
|
||||
/* 0x14 */ s16 zFar; // Max depth (render distance) of the view as a whole. fogFar will always match zFar
|
||||
} CurrentEnvLightSettings; // size = 0x16
|
||||
|
||||
// `EnvLightSettings` is very similar to `CurrentEnvLightSettings` with one key difference.
|
||||
// The light settings data in the scene packs blend rate information with the fog near value.
|
||||
// The blendRate determines how fast the current light settings fade to the next one
|
||||
// (under LIGHT_MODE_SETTINGS, otherwise unused).
|
||||
|
||||
// Get blend rate from `EnvLightSettings.blendRateAndFogNear` in 0-255 range
|
||||
#define ENV_LIGHT_SETTINGS_BLEND_RATE_U8(blendRateAndFogNear) (((blendRateAndFogNear) >> 10) * 4)
|
||||
#define ENV_LIGHT_SETTINGS_FOG_NEAR(blendRateAndFogNear) ((blendRateAndFogNear) & 0x3FF)
|
||||
|
||||
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 blendRateAndFogNear;
|
||||
/* 0x14 */ s16 zFar;
|
||||
} EnvLightSettings; // size = 0x16
|
||||
|
||||
// ZAPD compatibility typedefs
|
||||
// TODO: Remove when ZAPD adds support for them
|
||||
typedef CurrentEnvLightSettings LightSettings;
|
||||
|
||||
typedef struct EnvironmentContext {
|
||||
/* 0x00 */ u16 unk_0;
|
||||
/* 0x02 */ u16 sceneTimeSpeed;
|
||||
/* 0x04 */ Vec3f sunPos;
|
||||
/* 0x10 */ u8 skybox1Index;
|
||||
/* 0x11 */ u8 skybox2Index;
|
||||
/* 0x12 */ u8 unk_12;
|
||||
/* 0x13 */ u8 skyboxBlend;
|
||||
/* 0x14 */ u8 unk_14;
|
||||
/* 0x15 */ u8 skyboxDisabled;
|
||||
/* 0x16 */ u8 sunDisabled;
|
||||
/* 0x17 */ u8 skyboxConfig;
|
||||
/* 0x18 */ u8 changeSkyboxNextConfig;
|
||||
/* 0x19 */ u8 changeSkyboxState;
|
||||
/* 0x1A */ u16 changeSkyboxTimer;
|
||||
/* 0x1C */ u16 unk_1C;
|
||||
/* 0x1E */ u8 lightMode;
|
||||
/* 0x1F */ u8 lightConfig;
|
||||
/* 0x20 */ u8 changeLightNextConfig;
|
||||
/* 0x21 */ u8 changeLightEnabled;
|
||||
/* 0x22 */ u16 changeLightTimer;
|
||||
/* 0x24 */ u16 changeDuration;
|
||||
/* 0x26 */ u8 unk_26;
|
||||
/* 0x28 */ LightInfo dirLight1; // sun 1
|
||||
/* 0x36 */ LightInfo dirLight2; // sun 2
|
||||
/* 0x44 */ s8 skyboxDmaState;
|
||||
/* 0x48 */ DmaRequest dmaRequest;
|
||||
/* 0x68 */ OSMesgQueue loadQueue;
|
||||
/* 0x80 */ OSMesg loadMsg[1];
|
||||
/* 0x84 */ f32 glareAlpha;
|
||||
/* 0x88 */ f32 lensFlareAlphaScale;
|
||||
/* 0x8C */ AdjLightSettings adjLightSettings;
|
||||
/* 0xA8 */ f32 unk_A8;
|
||||
/* 0xAC */ Vec3s windDirection;
|
||||
/* 0xB4 */ f32 windSpeed;
|
||||
/* 0xB8 */ u8 numLightSettings;
|
||||
/* 0xBC */ EnvLightSettings* lightSettingsList; // list of light settings from the scene file
|
||||
/* 0xC0 */ u8 lightBlendEnabled; // only used with `LIGHT_MODE_SETTINGS` or on override
|
||||
/* 0xC1 */ u8 lightSetting; // only used with `LIGHT_MODE_SETTINGS` or on override
|
||||
/* 0xC2 */ u8 prevLightSetting;
|
||||
/* 0xC3 */ u8 lightSettingOverride;
|
||||
/* 0xC4 */ CurrentEnvLightSettings lightSettings; // settings for the currently "live" lights
|
||||
/* 0xDA */ u16 lightBlendRateOverride;
|
||||
/* 0xDC */ f32 lightBlend;
|
||||
/* 0xE0 */ u8 lightBlendOverride;
|
||||
/* 0xE1 */ u8 stormRequest;
|
||||
/* 0xE2 */ u8 stormState;
|
||||
/* 0xE3 */ u8 lightningState; // modified by unused func in EnWeatherTag
|
||||
/* 0xE4 */ u8 timeSeqState;
|
||||
/* 0xE5 */ u8 fillScreen;
|
||||
/* 0xE6 */ u8 screenFillColor[4];
|
||||
/* 0xEA */ u8 sandstormState;
|
||||
/* 0xEB */ u8 sandstormPrimA;
|
||||
/* 0xEC */ u8 sandstormEnvA;
|
||||
/* 0xED */ u8 customSkyboxFilter;
|
||||
/* 0xEE */ u8 skyboxFilterColor[4];
|
||||
/* 0xF2 */ u8 precipitation[PRECIP_MAX];
|
||||
/* 0xF7 */ UNK_TYPE1 unk_FA[9];
|
||||
} EnvironmentContext; // size = 0x100
|
||||
|
||||
s32 Environment_ZBufValToFixedPoint(s32 zBufferVal);
|
||||
void Environment_Init(struct PlayState* play2, EnvironmentContext* envCtx, s32 arg2);
|
||||
u8 Environment_SmoothStepToU8(u8* pvalue, u8 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, struct SkyboxContext* skyboxCtx);
|
||||
void Environment_EnableUnderwaterLights(struct PlayState* play, s32 waterLightsIndex);
|
||||
void Environment_DisableUnderwaterLights(struct PlayState* play);
|
||||
void Environment_Update(struct PlayState* play, EnvironmentContext* envCtx, struct LightContext* lightCtx,
|
||||
struct PauseContext* pauseCtx, struct MessageContext* msgCtx, struct GameOverContext* gameOverCtx,
|
||||
struct GraphicsContext* gfxCtx);
|
||||
void Environment_DrawSunLensFlare(struct PlayState* play, EnvironmentContext* envCtx, struct View* view, struct GraphicsContext* gfxCtx, Vec3f vec);
|
||||
void Environment_DrawLensFlare(struct PlayState* play, EnvironmentContext* envCtx, struct View* view, struct GraphicsContext* gfxCtx, Vec3f pos, f32 scale, f32 colorIntensity, s16 glareStrength, u8 isSun);
|
||||
void Environment_DrawRain(struct PlayState* play, struct View* view, struct GraphicsContext* gfxCtx);
|
||||
void Environment_ChangeLightSetting(struct PlayState* play, u8 lightSetting);
|
||||
void Environment_AddLightningBolts(struct PlayState* play, u8 num);
|
||||
void Environment_PlaySceneSequence(struct PlayState* play);
|
||||
void Environment_DrawCustomLensFlare(struct PlayState* play);
|
||||
void Environment_InitGameOverLights(struct PlayState* play);
|
||||
void Environment_FadeInGameOverLights(struct PlayState* play);
|
||||
void Environment_FadeOutGameOverLights(struct PlayState* play);
|
||||
void Environment_FillScreen(struct GraphicsContext* gfxCtx, u8 red, u8 green, u8 blue, u8 alpha, u8 drawFlags);
|
||||
void Environment_DrawSandstorm(struct PlayState* play, u8 sandstormState);
|
||||
s32 Environment_AdjustLights(struct PlayState* play, f32 arg1, f32 arg2, f32 arg3, f32 arg4);
|
||||
void Environment_LerpAmbientColor(struct PlayState* play, Color_RGB8* to, f32 lerp);
|
||||
void Environment_LerpDiffuseColor(struct PlayState* play, Color_RGB8* to, f32 lerp);
|
||||
void Environment_LerpFogColor(struct PlayState* play, Color_RGB8* to, f32 lerp);
|
||||
void Environment_LerpFog(struct PlayState* play, s16 fogNearTarget, s16 fogFarTarget, f32 lerp);
|
||||
void Environment_ForcePlaySequence(u16 seqId);
|
||||
s32 Environment_IsForcedSequenceDisabled(void);
|
||||
void Environment_PlayStormNatureAmbience(struct PlayState* play);
|
||||
void Environment_StopStormNatureAmbience(struct PlayState* play);
|
||||
void Environment_Draw(struct PlayState* play);
|
||||
void Environment_DrawSkyboxStars(struct PlayState* play);
|
||||
void Environment_StopTime(void);
|
||||
void Environment_StartTime(void);
|
||||
u8 Environment_IsTimeStopped(void);
|
||||
u32 Environment_GetStormState(struct PlayState* play);
|
||||
u8 Environment_IsFinalHours(struct PlayState* play);
|
||||
u16 Environment_GetTimeSpeed(struct PlayState* play);
|
||||
void Environment_SetTimeJump(f32 minutes);
|
||||
u8 func_800FE6F8(struct PlayState* play, s16 timeAdvanceScaling, s16 nextTimeLimit);
|
||||
void Environment_LerpSandstormColors(Color_RGBA8* colorSrc, Color_RGBA8* colorDst);
|
||||
u8 func_800FE9B4(struct PlayState* play);
|
||||
void func_800FEA50(struct PlayState* play);
|
||||
void func_800FEAB0(void);
|
||||
void func_800FEAF4(EnvironmentContext* envCtx);
|
||||
|
||||
// Data
|
||||
extern u8 gWeatherMode;
|
||||
extern u8 gLightConfigAfterUnderwater;
|
||||
extern u8 gInterruptSongOfStorms;
|
||||
extern u8 gSceneSeqState;
|
||||
|
||||
// Bss
|
||||
extern u8 D_801F4E30;
|
||||
|
||||
extern u8 gCustomLensFlare1On;
|
||||
extern Vec3f gCustomLensFlare1Pos;
|
||||
extern f32 D_801F4E44;
|
||||
extern f32 D_801F4E48;
|
||||
extern s16 D_801F4E4C;
|
||||
|
||||
extern u8 gCustomLensFlare2On;
|
||||
extern Vec3f gCustomLensFlare2Pos;
|
||||
extern f32 D_801F4E5C;
|
||||
extern f32 D_801F4E60;
|
||||
extern s16 D_801F4E64;
|
||||
|
||||
extern struct LightningStrike gLightningStrike;
|
||||
extern f32 D_801F4E74;
|
||||
extern u16 D_801F4E78;
|
||||
extern u16 gSkyboxNumStars;
|
||||
|
||||
#endif
|
||||
+5
-17
@@ -8,26 +8,14 @@
|
||||
|
||||
struct PlayState;
|
||||
|
||||
|
||||
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 */ s16 fogNear;
|
||||
/* 0x14 */ s16 zFar;
|
||||
} LightSettings; // size = 0x16
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 ambientColor[3];
|
||||
/* 0x06 */ s16 diffuseColor1[3];
|
||||
/* 0x0C */ s16 diffuseColor2[3];
|
||||
/* 0x06 */ s16 light1Color[3];
|
||||
/* 0x0C */ s16 light2Color[3];
|
||||
/* 0x12 */ s16 fogColor[3];
|
||||
/* 0x18 */ s16 fogNear;
|
||||
/* 0x1A */ s16 zFar;
|
||||
} EnvLightSettings; // size = 0x1C
|
||||
} AdjLightSettings; // size = 0x1C
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ s16 x;
|
||||
@@ -77,8 +65,8 @@ typedef struct LightsBuffer {
|
||||
|
||||
typedef struct LightContext {
|
||||
/* 0x0 */ LightNode* listHead;
|
||||
/* 0x4 */ Color_RGB8 ambient;
|
||||
/* 0x7 */ Color_RGB8 fogColor;
|
||||
/* 0x4 */ u8 ambientColor[3];
|
||||
/* 0x7 */ u8 fogColor[3];
|
||||
/* 0xA */ s16 fogNear; // how close until fog starts taking effect. range 0 - 996
|
||||
/* 0xC */ s16 zFar; // draw distance. range 0 - 12800
|
||||
} LightContext; // size = 0x10
|
||||
|
||||
+1
-1
@@ -327,7 +327,7 @@ typedef struct Save {
|
||||
/* 0x10 */ s32 isNight; // "asahiru_fg"
|
||||
/* 0x14 */ s32 timeSpeedOffset; // "change_zelda_time"
|
||||
/* 0x18 */ s32 day; // "totalday"
|
||||
/* 0x1C */ s32 daysElapsed; // "eventday"
|
||||
/* 0x1C */ s32 eventDayCount; // "eventday"
|
||||
/* 0x20 */ u8 playerForm; // "player_character"
|
||||
/* 0x21 */ u8 snowheadCleared; // "spring_flag"
|
||||
/* 0x22 */ u8 hasTatl; // "bell_flag"
|
||||
|
||||
Reference in New Issue
Block a user