mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
+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"
|
||||
|
||||
@@ -476,8 +476,6 @@ beginseg
|
||||
include "build/src/code/z_kaleido_setup.o"
|
||||
include "build/src/code/z_kanfont.o"
|
||||
include "build/src/code/z_kankyo.o"
|
||||
include "build/data/code/z_kankyo.data.o"
|
||||
include "build/data/code/z_kankyo.bss.o"
|
||||
include "build/src/code/z_lib.o"
|
||||
include "build/src/code/z_lifemeter.o"
|
||||
include "build/src/code/z_lights.o"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "z64.h"
|
||||
#include "regs.h"
|
||||
#include "functions.h"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "z64.h"
|
||||
#include "regs.h"
|
||||
#include "functions.h"
|
||||
|
||||
@@ -12,7 +12,7 @@ void SaveContext_Init(void) {
|
||||
gSaveContext.nextCutsceneIndex = 0xFFEF;
|
||||
gSaveContext.cutsceneTrigger = 0;
|
||||
gSaveContext.chamberCutsceneNum = 0;
|
||||
gSaveContext.nextDayTime = 0xFFFF;
|
||||
gSaveContext.nextDayTime = NEXT_TIME_NONE;
|
||||
gSaveContext.skyboxTime = 0;
|
||||
gSaveContext.dogIsLost = true;
|
||||
gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT;
|
||||
|
||||
+25
-18
@@ -1,6 +1,4 @@
|
||||
#include "PR/ultratypes.h"
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "prevent_bss_reordering2.h"
|
||||
|
||||
// Variables are put before most headers as a hacky way to bypass bss reordering
|
||||
struct CutsceneCamera;
|
||||
@@ -13,6 +11,15 @@ static s16 sBssPad;
|
||||
u8 gDisablePlayerCsModeStartPos;
|
||||
s16 gDungeonBossWarpSceneId;
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "prevent_bss_reordering2.h"
|
||||
// clang-format off
|
||||
// Partial structs taken from "prevent_bss_reordering.h"
|
||||
struct Dummy200 { int x; };
|
||||
struct Dummy201 { int x; };
|
||||
struct Dummy202 { int x; };
|
||||
// clang-format on
|
||||
|
||||
#include "global.h"
|
||||
#include "z64quake.h"
|
||||
#include "z64rumble.h"
|
||||
@@ -154,8 +161,8 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) {
|
||||
switch (cmd->type) {
|
||||
case CS_MISC_RAIN:
|
||||
if (isFirstFrame) {
|
||||
func_800FD78C(play);
|
||||
play->envCtx.unk_F2[0] = 60;
|
||||
Environment_PlayStormNatureAmbience(play);
|
||||
play->envCtx.precipitation[PRECIP_RAIN_MAX] = 60;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -163,19 +170,19 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) {
|
||||
if (isFirstFrame) {
|
||||
Audio_SetAmbienceChannelIO(AMBIENCE_CHANNEL_LIGHTNING, CHANNEL_IO_PORT_0, 0);
|
||||
Environment_AddLightningBolts(play, 3);
|
||||
D_801F4E68 = 1;
|
||||
gLightningStrike.state = LIGHTNING_STRIKE_START;
|
||||
}
|
||||
break;
|
||||
|
||||
case CS_MISC_LIFT_FOG:
|
||||
if (play->envCtx.lightSettings.zFar < 12800) {
|
||||
play->envCtx.lightSettings.zFar += 35;
|
||||
if (play->envCtx.adjLightSettings.zFar < 12800) {
|
||||
play->envCtx.adjLightSettings.zFar += 35;
|
||||
}
|
||||
break;
|
||||
|
||||
case CS_MISC_CLOUDY_SKY:
|
||||
if (isFirstFrame) {
|
||||
play->envCtx.changeSkyboxState = 1;
|
||||
play->envCtx.changeSkyboxState = CHANGE_SKYBOX_REQUESTED;
|
||||
play->envCtx.skyboxConfig = 1;
|
||||
play->envCtx.changeSkyboxNextConfig = 0;
|
||||
play->envCtx.changeSkyboxTimer = 60;
|
||||
@@ -238,16 +245,16 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) {
|
||||
|
||||
case CS_MISC_RED_PULSATING_LIGHTS:
|
||||
if (play->state.frames & 8) {
|
||||
if (play->envCtx.lightSettings.ambientColor[0] < 40) {
|
||||
play->envCtx.lightSettings.ambientColor[0] += 2;
|
||||
play->envCtx.lightSettings.diffuseColor1[1] -= 3;
|
||||
play->envCtx.lightSettings.diffuseColor1[2] -= 3;
|
||||
if (play->envCtx.adjLightSettings.ambientColor[0] < 40) {
|
||||
play->envCtx.adjLightSettings.ambientColor[0] += 2;
|
||||
play->envCtx.adjLightSettings.light1Color[1] -= 3;
|
||||
play->envCtx.adjLightSettings.light1Color[2] -= 3;
|
||||
}
|
||||
} else {
|
||||
if (play->envCtx.lightSettings.ambientColor[0] > 2) {
|
||||
play->envCtx.lightSettings.ambientColor[0] -= 2;
|
||||
play->envCtx.lightSettings.diffuseColor1[1] += 3;
|
||||
play->envCtx.lightSettings.diffuseColor1[2] += 3;
|
||||
if (play->envCtx.adjLightSettings.ambientColor[0] > 2) {
|
||||
play->envCtx.adjLightSettings.ambientColor[0] -= 2;
|
||||
play->envCtx.adjLightSettings.light1Color[1] += 3;
|
||||
play->envCtx.adjLightSettings.light1Color[2] += 3;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -262,7 +269,7 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) {
|
||||
|
||||
case CS_MISC_SANDSTORM_FILL:
|
||||
if (isFirstFrame) {
|
||||
play->envCtx.sandstormState = 1;
|
||||
play->envCtx.sandstormState = SANDSTORM_FILL;
|
||||
}
|
||||
Audio_PlaySfx_2(NA_SE_EV_SAND_STORM - SFX_FLAG);
|
||||
break;
|
||||
@@ -409,7 +416,7 @@ void CutsceneCmd_SetLightSetting(PlayState* play, CutsceneContext* csCtx, CsCmdL
|
||||
play->envCtx.lightSettingOverride = cmd->settingPlusOne - 1;
|
||||
play->envCtx.lightBlend = 1.0f;
|
||||
} else {
|
||||
play->envCtx.lightSettingOverride = 0xFF;
|
||||
play->envCtx.lightSettingOverride = LIGHT_SETTING_OVERRIDE_NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ void GameOver_FadeLights(PlayState* play) {
|
||||
|
||||
if ((gameOverCtx->state >= GAMEOVER_DEATH_WAIT_GROUND && gameOverCtx->state < GAMEOVER_REVIVE_START) ||
|
||||
(gameOverCtx->state >= GAMEOVER_REVIVE_RUMBLE && gameOverCtx->state < GAMEOVER_REVIVE_FADE_OUT)) {
|
||||
Kankyo_FadeInGameOverLights(play);
|
||||
Environment_FadeInGameOverLights(play);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ void GameOver_Update(PlayState* play) {
|
||||
gSaveContext.nextHudVisibility = HUD_VISIBILITY_IDLE;
|
||||
gSaveContext.hudVisibility = HUD_VISIBILITY_IDLE;
|
||||
gSaveContext.hudVisibilityTimer = 0;
|
||||
Kankyo_InitGameOverLights(play);
|
||||
Environment_InitGameOverLights(play);
|
||||
sGameOverTimer = 20;
|
||||
Rumble_Request(0.0f, 126, 124, 63);
|
||||
gameOverCtx->state = GAMEOVER_DEATH_WAIT_GROUND;
|
||||
@@ -92,7 +92,7 @@ void GameOver_Update(PlayState* play) {
|
||||
case GAMEOVER_REVIVE_START:
|
||||
gameOverCtx->state++; // GAMEOVER_REVIVE_RUMBLE
|
||||
sGameOverTimer = 0;
|
||||
Kankyo_InitGameOverLights(play);
|
||||
Environment_InitGameOverLights(play);
|
||||
ShrinkWindow_Letterbox_SetSizeTarget(32);
|
||||
break;
|
||||
|
||||
@@ -119,7 +119,7 @@ void GameOver_Update(PlayState* play) {
|
||||
break;
|
||||
|
||||
case GAMEOVER_REVIVE_FADE_OUT:
|
||||
Kankyo_FadeOutGameOverLights(play);
|
||||
Environment_FadeOutGameOverLights(play);
|
||||
sGameOverTimer--;
|
||||
if (sGameOverTimer == 0) {
|
||||
gameOverCtx->state = GAMEOVER_INACTIVE;
|
||||
|
||||
+892
-63
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -663,7 +663,7 @@ void Lib_Vec3f_TranslateAndRotateY(Vec3f* translation, s16 rotAngle, Vec3f* src,
|
||||
dst->z = translation->z + (src->z * cos - src->x * sin);
|
||||
}
|
||||
|
||||
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) {
|
||||
f32 aF;
|
||||
|
||||
aF = a->r;
|
||||
|
||||
+7
-7
@@ -257,15 +257,15 @@ void LightContext_Init(PlayState* play, LightContext* lightCtx) {
|
||||
}
|
||||
|
||||
void LightContext_SetAmbientColor(LightContext* lightCtx, u8 r, u8 g, u8 b) {
|
||||
lightCtx->ambient.r = r;
|
||||
lightCtx->ambient.g = g;
|
||||
lightCtx->ambient.b = b;
|
||||
lightCtx->ambientColor[0] = r;
|
||||
lightCtx->ambientColor[1] = g;
|
||||
lightCtx->ambientColor[2] = b;
|
||||
}
|
||||
|
||||
void LightContext_SetFog(LightContext* lightCtx, u8 r, u8 g, u8 b, s16 near, s16 far) {
|
||||
lightCtx->fogColor.r = r;
|
||||
lightCtx->fogColor.g = g;
|
||||
lightCtx->fogColor.b = b;
|
||||
lightCtx->fogColor[0] = r;
|
||||
lightCtx->fogColor[1] = g;
|
||||
lightCtx->fogColor[2] = b;
|
||||
lightCtx->fogNear = near;
|
||||
lightCtx->zFar = far;
|
||||
}
|
||||
@@ -274,7 +274,7 @@ void LightContext_SetFog(LightContext* lightCtx, u8 r, u8 g, u8 b, s16 near, s16
|
||||
* Allocate a new Lights group and initilize the ambient color with that provided by LightContext
|
||||
*/
|
||||
Lights* LightContext_NewLights(LightContext* lightCtx, GraphicsContext* gfxCtx) {
|
||||
return Lights_New(gfxCtx, lightCtx->ambient.r, lightCtx->ambient.g, lightCtx->ambient.b);
|
||||
return Lights_New(gfxCtx, lightCtx->ambientColor[0], lightCtx->ambientColor[1], lightCtx->ambientColor[2]);
|
||||
}
|
||||
|
||||
void LightContext_InitList(PlayState* play, LightContext* lightCtx) {
|
||||
|
||||
@@ -5432,7 +5432,7 @@ void Interface_StartMoonCrash(PlayState* play) {
|
||||
}
|
||||
|
||||
gSaveContext.save.day = 4;
|
||||
gSaveContext.save.daysElapsed = 4;
|
||||
gSaveContext.save.eventDayCount = 4;
|
||||
gSaveContext.save.time = CLOCK_TIME(6, 0) + 10;
|
||||
play->nextEntrance = ENTRANCE(TERMINA_FIELD, 12);
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
|
||||
+25
-25
@@ -1,3 +1,4 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "z64.h"
|
||||
#include "regs.h"
|
||||
#include "functions.h"
|
||||
@@ -360,8 +361,8 @@ void Play_ClearTransition(PlayState* this) {
|
||||
Gfx* Play_SetFog(PlayState* this, Gfx* gfx) {
|
||||
s32 fogFar = this->lightCtx.zFar * (5.0f / 64.0f);
|
||||
|
||||
return Gfx_SetFogWithSync(gfx, this->lightCtx.fogColor.r, this->lightCtx.fogColor.g, this->lightCtx.fogColor.b, 0,
|
||||
this->lightCtx.fogNear, ((fogFar <= 1000) ? 1000 : fogFar));
|
||||
return Gfx_SetFogWithSync(gfx, this->lightCtx.fogColor[0], this->lightCtx.fogColor[1], this->lightCtx.fogColor[2],
|
||||
0, this->lightCtx.fogNear, ((fogFar <= 1000) ? 1000 : fogFar));
|
||||
}
|
||||
|
||||
void Play_Destroy(GameState* thisx) {
|
||||
@@ -524,7 +525,7 @@ void Play_UpdateWaterCamera(PlayState* this, Camera* camera) {
|
||||
}
|
||||
|
||||
func_801A3EC0(0x20);
|
||||
func_800F6834(this, lightIndex);
|
||||
Environment_EnableUnderwaterLights(this, lightIndex);
|
||||
|
||||
if ((sQuakeIndex == -1) || (Quake_GetTimeLeft(sQuakeIndex) == 10)) {
|
||||
s16 quakeIndex = Quake_Request(camera, QUAKE_TYPE_5);
|
||||
@@ -553,7 +554,7 @@ void Play_UpdateWaterCamera(PlayState* this, Camera* camera) {
|
||||
if (sQuakeIndex != 0) {
|
||||
Quake_RemoveRequest(sQuakeIndex);
|
||||
}
|
||||
func_800F694C(this);
|
||||
Environment_DisableUnderwaterLights(this);
|
||||
func_801A3EC0(0);
|
||||
}
|
||||
}
|
||||
@@ -585,20 +586,20 @@ void Play_UpdateTransition(PlayState* this) {
|
||||
!CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) ||
|
||||
((this->nextEntrance == ENTRANCE(ROAD_TO_IKANA, 1)) &&
|
||||
!CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE))) &&
|
||||
(!func_800FE590(this) || (Entrance_GetSceneId(this->nextEntrance + sceneLayer) < 0) ||
|
||||
(!Environment_IsFinalHours(this) || (Entrance_GetSceneId(this->nextEntrance + sceneLayer) < 0) ||
|
||||
(AudioSeq_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) != NA_BGM_FINAL_HOURS))) {
|
||||
func_801A4058(20);
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.ambienceId = AMBIENCE_ID_DISABLED;
|
||||
}
|
||||
|
||||
if (func_800FD768()) {
|
||||
if (Environment_IsForcedSequenceDisabled()) {
|
||||
func_801A4058(20);
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.ambienceId = AMBIENCE_ID_DISABLED;
|
||||
}
|
||||
|
||||
if (func_800FE590(this) && (Entrance_GetSceneId(this->nextEntrance + sceneLayer) >= 0) &&
|
||||
if (Environment_IsFinalHours(this) && (Entrance_GetSceneId(this->nextEntrance + sceneLayer) >= 0) &&
|
||||
(AudioSeq_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) == NA_BGM_FINAL_HOURS)) {
|
||||
func_801A41C8(20);
|
||||
}
|
||||
@@ -824,10 +825,10 @@ void Play_UpdateTransition(PlayState* this) {
|
||||
|
||||
case TRANS_MODE_SANDSTORM_INIT:
|
||||
if (this->transitionTrigger != TRANS_TRIGGER_END) {
|
||||
this->envCtx.sandstormState = 1;
|
||||
this->envCtx.sandstormState = SANDSTORM_FILL;
|
||||
this->transitionMode = TRANS_MODE_SANDSTORM;
|
||||
} else {
|
||||
this->envCtx.sandstormState = 2;
|
||||
this->envCtx.sandstormState = SANDSTORM_UNFILL;
|
||||
this->envCtx.sandstormPrimA = 255;
|
||||
this->envCtx.sandstormEnvA = 255;
|
||||
this->transitionMode = TRANS_MODE_SANDSTORM;
|
||||
@@ -856,7 +857,7 @@ void Play_UpdateTransition(PlayState* this) {
|
||||
|
||||
case TRANS_MODE_SANDSTORM_END_INIT:
|
||||
if (this->transitionTrigger == TRANS_TRIGGER_END) {
|
||||
this->envCtx.sandstormState = 4;
|
||||
this->envCtx.sandstormState = SANDSTORM_DISSIPATE;
|
||||
this->envCtx.sandstormPrimA = 255;
|
||||
this->envCtx.sandstormEnvA = 255;
|
||||
|
||||
@@ -1144,8 +1145,8 @@ void Play_DrawMain(PlayState* this) {
|
||||
if (this->skyboxCtx.skyboxShouldDraw || (this->roomCtx.curRoom.roomShape->base.type == ROOM_SHAPE_TYPE_IMAGE)) {
|
||||
func_8012CF0C(gfxCtx, false, true, 0, 0, 0);
|
||||
} else {
|
||||
func_8012CF0C(gfxCtx, true, true, this->lightCtx.fogColor.r, this->lightCtx.fogColor.g,
|
||||
this->lightCtx.fogColor.b);
|
||||
func_8012CF0C(gfxCtx, true, true, this->lightCtx.fogColor[0], this->lightCtx.fogColor[1],
|
||||
this->lightCtx.fogColor[2]);
|
||||
}
|
||||
} else {
|
||||
func_8012CF0C(gfxCtx, false, false, 0, 0, 0);
|
||||
@@ -1292,7 +1293,7 @@ void Play_DrawMain(PlayState* this) {
|
||||
}
|
||||
}
|
||||
|
||||
func_800FE390(this);
|
||||
Environment_Draw(this);
|
||||
}
|
||||
|
||||
sp268 = LightContext_NewLights(&this->lightCtx, gfxCtx);
|
||||
@@ -1324,8 +1325,7 @@ void Play_DrawMain(PlayState* this) {
|
||||
}
|
||||
}
|
||||
|
||||
// envCtx.precipitation[PRECIP_RAIN_CUR]
|
||||
if (this->envCtx.unk_F2[1] != 0) {
|
||||
if (this->envCtx.precipitation[PRECIP_RAIN_CUR] != 0) {
|
||||
Environment_DrawRain(this, &this->view, gfxCtx);
|
||||
}
|
||||
}
|
||||
@@ -1339,7 +1339,7 @@ void Play_DrawMain(PlayState* this) {
|
||||
}
|
||||
|
||||
if (1) {
|
||||
if (!this->envCtx.sunMoonDisabled) {
|
||||
if (!this->envCtx.sunDisabled) {
|
||||
sp25C.x = this->view.eye.x + this->envCtx.sunPos.x;
|
||||
sp25C.y = this->view.eye.y + this->envCtx.sunPos.y;
|
||||
sp25C.z = this->view.eye.z + this->envCtx.sunPos.z;
|
||||
@@ -1367,7 +1367,7 @@ void Play_DrawMain(PlayState* this) {
|
||||
}
|
||||
|
||||
if (1) {
|
||||
if (this->envCtx.sandstormState != 0) {
|
||||
if (this->envCtx.sandstormState != SANDSTORM_OFF) {
|
||||
Environment_DrawSandstorm(this, this->envCtx.sandstormState);
|
||||
}
|
||||
}
|
||||
@@ -1440,7 +1440,7 @@ SkipPostWorldDraw:
|
||||
}
|
||||
|
||||
if (!sp25B) {
|
||||
func_800FE3E0(this);
|
||||
Environment_DrawSkyboxStars(this);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(gfxCtx);
|
||||
@@ -2217,7 +2217,7 @@ void Play_Init(GameState* thisx) {
|
||||
gSaveContext.save.cutsceneIndex = 0;
|
||||
}
|
||||
|
||||
if (gSaveContext.nextDayTime != 0xFFFF) {
|
||||
if (gSaveContext.nextDayTime != NEXT_TIME_NONE) {
|
||||
gSaveContext.save.time = gSaveContext.nextDayTime;
|
||||
gSaveContext.skyboxTime = gSaveContext.nextDayTime;
|
||||
}
|
||||
@@ -2250,14 +2250,14 @@ void Play_Init(GameState* thisx) {
|
||||
KaleidoScopeCall_Init(this);
|
||||
Interface_Init(this);
|
||||
|
||||
if (gSaveContext.nextDayTime != 0xFFFF) {
|
||||
if (gSaveContext.nextDayTime == 0x8000) {
|
||||
if (gSaveContext.nextDayTime != NEXT_TIME_NONE) {
|
||||
if (gSaveContext.nextDayTime == NEXT_TIME_DAY) {
|
||||
gSaveContext.save.day++;
|
||||
gSaveContext.save.daysElapsed++;
|
||||
gSaveContext.save.eventDayCount++;
|
||||
gSaveContext.dogIsLost = true;
|
||||
gSaveContext.nextDayTime = -2;
|
||||
gSaveContext.nextDayTime = NEXT_TIME_DAY_SET;
|
||||
} else {
|
||||
gSaveContext.nextDayTime = -3;
|
||||
gSaveContext.nextDayTime = NEXT_TIME_NIGHT_SET;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2348,7 +2348,7 @@ void Play_Init(GameState* thisx) {
|
||||
|
||||
CutsceneManager_StoreCamera(&this->mainCamera);
|
||||
Interface_SetSceneRestrictions(this);
|
||||
func_800FB758(this);
|
||||
Environment_PlaySceneSequence(this);
|
||||
gSaveContext.seqId = this->sequenceCtx.seqId;
|
||||
gSaveContext.ambienceId = this->sequenceCtx.ambienceId;
|
||||
AnimationContext_Update(this, &this->animationCtx);
|
||||
|
||||
+4
-4
@@ -581,12 +581,12 @@ s32 Room_HandleLoadCallbacks(PlayState* play, RoomContext* roomCtx) {
|
||||
Actor_SpawnTransitionActors(play, &play->actorCtx);
|
||||
|
||||
if (((play->sceneId != SCENE_IKANA) || (roomCtx->curRoom.num != 1)) && (play->sceneId != SCENE_IKNINSIDE)) {
|
||||
play->envCtx.lightSettingOverride = 0xFF;
|
||||
play->envCtx.unk_E0 = 0;
|
||||
play->envCtx.lightSettingOverride = LIGHT_SETTING_OVERRIDE_NONE;
|
||||
play->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_NONE;
|
||||
}
|
||||
func_800FEAB0();
|
||||
if (!func_800FE4B8(play)) {
|
||||
func_800FD858(play);
|
||||
if (Environment_GetStormState(play) == STORM_STATE_OFF) {
|
||||
Environment_StopStormNatureAmbience(play);
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user