Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document "Normal" Skybox #1955

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions include/z64environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,27 @@ typedef enum WeatherMode {
/* 5 */ WEATHER_MODE_HEAVY_RAIN // scene must define settings for light config 4
} WeatherMode;

typedef enum {
// Clear Sky
SKYBOX_INDEX_CLEAR_SUNRISE,
SKYBOX_INDEX_CLEAR_DAY,
SKYBOX_INDEX_CLEAR_SUNSET,
SKYBOX_INDEX_CLEAR_NIGHT,
// Cloudy Sky
SKYBOX_INDEX_CLOUDY_SUNRISE,
SKYBOX_INDEX_CLOUDY_DAY,
SKYBOX_INDEX_CLOUDY_SUNSET,
SKYBOX_INDEX_CLOUDY_NIGHT,
Comment on lines +73 to +83
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we have a better descriptor than just "index" for this concept in general. Ill take a closer look at this and try to think about it more, but it makes reading all of the code pretty clunky to me.
Dont think "type" works cause this isnt necessarily the skybox type. But looking for something along those lines

// Holy (not implemented correctly)
SKYBOX_INDEX_HOLY0,
SKYBOX_INDEX_HOLY_RESERVED_9,
SKYBOX_INDEX_HOLY_RESERVED_10,
SKYBOX_INDEX_HOLY_RESERVED_11,
// Error checking
SKYBOX_INDEX_INIT = 99, // Magic number used to detect a fault during initialization, value unused.
SKYBOX_INDEX_UNDEFINED = 0xFF
} SkyboxIndex;

typedef enum ChangeSkyboxState {
/* 0 */ CHANGE_SKYBOX_INACTIVE,
/* 1 */ CHANGE_SKYBOX_REQUESTED,
Expand Down
4 changes: 4 additions & 0 deletions include/z64skybox.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ typedef struct SkyboxFile {

extern SkyboxFile gNormalSkyFiles[];

// Tests if the skybox palette for the given skybox is assigned to color index 0-127.
// If false, it is assigned to color index 128-255 instead.
#define IS_NORMAL_SKYBOX_IMAGE_COLOR_INDEX_0(skyboxIndex) ((skyboxIndex & 1) ^ ((skyboxIndex & 4) >> 2))

void Skybox_Init(struct GameState* state, SkyboxContext* skyboxCtx, s16 skyboxId);
Mtx* Skybox_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z);
void Skybox_Draw(SkyboxContext* skyboxCtx, struct GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y,
Expand Down
3 changes: 2 additions & 1 deletion src/buffers/gfxbuffers.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "z64.h"
#include "alignment.h"
#include "gfx.h"

ALIGNED(16) u64 gGfxSPTaskOutputBuffer[0x3000];

Expand Down
2 changes: 1 addition & 1 deletion src/code/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extern struct IrqMgr gIrqMgr;
#include "n64dd.h"
#endif

#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
#pragma increment_block_number "gc-eu:192 gc-eu-mq:160 gc-jp:192 gc-jp-ce:160 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
"ntsc-1.2:160"

extern u8 _buffersSegmentEnd[];
Expand Down
133 changes: 79 additions & 54 deletions src/code/z_kankyo.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma increment_block_number "gc-eu:0 gc-eu-mq:128 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:0"
#include "global.h"
#include "ultra64.h"
#include "terminal.h"
Expand All @@ -7,7 +8,7 @@
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"

#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:0"
#pragma increment_block_number "gc-eu:0 gc-eu-mq:128 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:0"

typedef enum LightningBoltState {
/* 0x00 */ LIGHTNING_BOLT_START,
Expand Down Expand Up @@ -98,86 +99,106 @@ TimeBasedLightEntry sTimeBasedLightConfigs[][7] = {

TimeBasedSkyboxEntry gTimeBasedSkyboxConfigs[][9] = {
{
{ CLOCK_TIME(0, 0), CLOCK_TIME(4, 0) + 1, false, 3, 3 },
{ CLOCK_TIME(4, 0) + 1, CLOCK_TIME(5, 0) + 1, true, 3, 0 },
{ CLOCK_TIME(5, 0) + 1, CLOCK_TIME(6, 0), false, 0, 0 },
{ CLOCK_TIME(6, 0), CLOCK_TIME(8, 0) + 1, true, 0, 1 },
{ CLOCK_TIME(8, 0) + 1, CLOCK_TIME(16, 0), false, 1, 1 },
{ CLOCK_TIME(16, 0), CLOCK_TIME(17, 0) + 1, true, 1, 2 },
{ CLOCK_TIME(17, 0) + 1, CLOCK_TIME(18, 0) + 1, false, 2, 2 },
{ CLOCK_TIME(18, 0) + 1, CLOCK_TIME(19, 0) + 1, true, 2, 3 },
{ CLOCK_TIME(19, 0) + 1, CLOCK_TIME(24, 0) - 1, false, 3, 3 },
{ CLOCK_TIME(0, 0), CLOCK_TIME(4, 0) + 1, false, SKYBOX_INDEX_CLEAR_NIGHT, SKYBOX_INDEX_CLEAR_NIGHT },
{ CLOCK_TIME(4, 0) + 1, CLOCK_TIME(5, 0) + 1, true, SKYBOX_INDEX_CLEAR_NIGHT, SKYBOX_INDEX_CLEAR_SUNRISE },
{ CLOCK_TIME(5, 0) + 1, CLOCK_TIME(6, 0), false, SKYBOX_INDEX_CLEAR_SUNRISE, SKYBOX_INDEX_CLEAR_SUNRISE },
{ CLOCK_TIME(6, 0), CLOCK_TIME(8, 0) + 1, true, SKYBOX_INDEX_CLEAR_SUNRISE, SKYBOX_INDEX_CLEAR_DAY },
{ CLOCK_TIME(8, 0) + 1, CLOCK_TIME(16, 0), false, SKYBOX_INDEX_CLEAR_DAY, SKYBOX_INDEX_CLEAR_DAY },
{ CLOCK_TIME(16, 0), CLOCK_TIME(17, 0) + 1, true, SKYBOX_INDEX_CLEAR_DAY, SKYBOX_INDEX_CLEAR_SUNSET },
{ CLOCK_TIME(17, 0) + 1, CLOCK_TIME(18, 0) + 1, false, SKYBOX_INDEX_CLEAR_SUNSET, SKYBOX_INDEX_CLEAR_SUNSET },
{ CLOCK_TIME(18, 0) + 1, CLOCK_TIME(19, 0) + 1, true, SKYBOX_INDEX_CLEAR_SUNSET, SKYBOX_INDEX_CLEAR_NIGHT },
{ CLOCK_TIME(19, 0) + 1, CLOCK_TIME(24, 0) - 1, false, SKYBOX_INDEX_CLEAR_NIGHT, SKYBOX_INDEX_CLEAR_NIGHT },
},
{
{ CLOCK_TIME(0, 0), CLOCK_TIME(4, 0) + 1, false, 7, 7 },
{ CLOCK_TIME(4, 0) + 1, CLOCK_TIME(5, 0) + 1, true, 7, 4 },
{ CLOCK_TIME(5, 0) + 1, CLOCK_TIME(6, 0), false, 4, 4 },
{ CLOCK_TIME(6, 0), CLOCK_TIME(8, 0) + 1, true, 4, 5 },
{ CLOCK_TIME(8, 0) + 1, CLOCK_TIME(16, 0), false, 5, 5 },
{ CLOCK_TIME(16, 0), CLOCK_TIME(17, 0) + 1, true, 5, 6 },
{ CLOCK_TIME(17, 0) + 1, CLOCK_TIME(18, 0) + 1, false, 6, 6 },
{ CLOCK_TIME(18, 0) + 1, CLOCK_TIME(19, 0) + 1, true, 6, 7 },
{ CLOCK_TIME(19, 0) + 1, CLOCK_TIME(24, 0) - 1, false, 7, 7 },
{ CLOCK_TIME(0, 0), CLOCK_TIME(4, 0) + 1, false, SKYBOX_INDEX_CLOUDY_NIGHT, SKYBOX_INDEX_CLOUDY_NIGHT },
{ CLOCK_TIME(4, 0) + 1, CLOCK_TIME(5, 0) + 1, true, SKYBOX_INDEX_CLOUDY_NIGHT, SKYBOX_INDEX_CLOUDY_SUNRISE },
{ CLOCK_TIME(5, 0) + 1, CLOCK_TIME(6, 0), false, SKYBOX_INDEX_CLOUDY_SUNRISE, SKYBOX_INDEX_CLOUDY_SUNRISE },
{ CLOCK_TIME(6, 0), CLOCK_TIME(8, 0) + 1, true, SKYBOX_INDEX_CLOUDY_SUNRISE, SKYBOX_INDEX_CLOUDY_DAY },
{ CLOCK_TIME(8, 0) + 1, CLOCK_TIME(16, 0), false, SKYBOX_INDEX_CLOUDY_DAY, SKYBOX_INDEX_CLOUDY_DAY },
{ CLOCK_TIME(16, 0), CLOCK_TIME(17, 0) + 1, true, SKYBOX_INDEX_CLOUDY_DAY, SKYBOX_INDEX_CLOUDY_SUNSET },
{ CLOCK_TIME(17, 0) + 1, CLOCK_TIME(18, 0) + 1, false, SKYBOX_INDEX_CLOUDY_SUNSET, SKYBOX_INDEX_CLOUDY_SUNSET },
{ CLOCK_TIME(18, 0) + 1, CLOCK_TIME(19, 0) + 1, true, SKYBOX_INDEX_CLOUDY_SUNSET, SKYBOX_INDEX_CLOUDY_NIGHT },
{ CLOCK_TIME(19, 0) + 1, CLOCK_TIME(24, 0) - 1, false, SKYBOX_INDEX_CLOUDY_NIGHT, SKYBOX_INDEX_CLOUDY_NIGHT },
},
{
{ CLOCK_TIME(0, 0), CLOCK_TIME(2, 0) + 1, false, 3, 3 },
{ CLOCK_TIME(2, 0) + 1, CLOCK_TIME(4, 0) + 1, true, 3, 0 },
{ CLOCK_TIME(4, 0) + 1, CLOCK_TIME(8, 0) + 1, false, 0, 0 },
{ CLOCK_TIME(8, 0) + 1, CLOCK_TIME(10, 0), true, 0, 1 },
{ CLOCK_TIME(10, 0), CLOCK_TIME(14, 0) + 1, false, 1, 1 },
{ CLOCK_TIME(14, 0) + 1, CLOCK_TIME(16, 0), true, 1, 2 },
{ CLOCK_TIME(16, 0), CLOCK_TIME(20, 0) + 1, false, 2, 2 },
{ CLOCK_TIME(20, 0) + 1, CLOCK_TIME(22, 0), true, 2, 3 },
{ CLOCK_TIME(22, 0), CLOCK_TIME(24, 0) - 1, false, 3, 3 },
{ CLOCK_TIME(0, 0), CLOCK_TIME(2, 0) + 1, false, SKYBOX_INDEX_CLEAR_NIGHT, SKYBOX_INDEX_CLEAR_NIGHT },
{ CLOCK_TIME(2, 0) + 1, CLOCK_TIME(4, 0) + 1, true, SKYBOX_INDEX_CLEAR_NIGHT, SKYBOX_INDEX_CLEAR_SUNRISE },
{ CLOCK_TIME(4, 0) + 1, CLOCK_TIME(8, 0) + 1, false, SKYBOX_INDEX_CLEAR_SUNRISE, SKYBOX_INDEX_CLEAR_SUNRISE },
{ CLOCK_TIME(8, 0) + 1, CLOCK_TIME(10, 0), true, SKYBOX_INDEX_CLEAR_SUNRISE, SKYBOX_INDEX_CLEAR_DAY },
{ CLOCK_TIME(10, 0), CLOCK_TIME(14, 0) + 1, false, SKYBOX_INDEX_CLEAR_DAY, SKYBOX_INDEX_CLEAR_DAY },
{ CLOCK_TIME(14, 0) + 1, CLOCK_TIME(16, 0), true, SKYBOX_INDEX_CLEAR_DAY, SKYBOX_INDEX_CLEAR_SUNSET },
{ CLOCK_TIME(16, 0), CLOCK_TIME(20, 0) + 1, false, SKYBOX_INDEX_CLEAR_SUNSET, SKYBOX_INDEX_CLEAR_SUNSET },
{ CLOCK_TIME(20, 0) + 1, CLOCK_TIME(22, 0), true, SKYBOX_INDEX_CLEAR_SUNSET, SKYBOX_INDEX_CLEAR_NIGHT },
{ CLOCK_TIME(22, 0), CLOCK_TIME(24, 0) - 1, false, SKYBOX_INDEX_CLEAR_NIGHT, SKYBOX_INDEX_CLEAR_NIGHT },
},
{
{ CLOCK_TIME(0, 0), CLOCK_TIME(5, 0) + 1, false, 11, 11 },
{ CLOCK_TIME(5, 0) + 1, CLOCK_TIME(6, 0), true, 11, 8 },
{ CLOCK_TIME(6, 0), CLOCK_TIME(7, 0), false, 8, 8 },
{ CLOCK_TIME(7, 0), CLOCK_TIME(8, 0) + 1, true, 8, 9 },
{ CLOCK_TIME(8, 0) + 1, CLOCK_TIME(16, 0), false, 9, 9 },
{ CLOCK_TIME(16, 0), CLOCK_TIME(17, 0) + 1, true, 9, 10 },
{ CLOCK_TIME(17, 0) + 1, CLOCK_TIME(18, 0) + 1, false, 10, 10 },
{ CLOCK_TIME(18, 0) + 1, CLOCK_TIME(19, 0) + 1, true, 10, 11 },
{ CLOCK_TIME(19, 0) + 1, CLOCK_TIME(24, 0) - 1, false, 11, 11 },
{ CLOCK_TIME(0, 0), CLOCK_TIME(5, 0) + 1, false, SKYBOX_INDEX_HOLY_RESERVED_11, SKYBOX_INDEX_HOLY_RESERVED_11 },
{ CLOCK_TIME(5, 0) + 1, CLOCK_TIME(6, 0), true, SKYBOX_INDEX_HOLY_RESERVED_11, SKYBOX_INDEX_HOLY0 },
{ CLOCK_TIME(6, 0), CLOCK_TIME(7, 0), false, SKYBOX_INDEX_HOLY0, SKYBOX_INDEX_HOLY0 },
{ CLOCK_TIME(7, 0), CLOCK_TIME(8, 0) + 1, true, SKYBOX_INDEX_HOLY0, SKYBOX_INDEX_HOLY_RESERVED_9 },
{ CLOCK_TIME(8, 0) + 1, CLOCK_TIME(16, 0), false, SKYBOX_INDEX_HOLY_RESERVED_9, SKYBOX_INDEX_HOLY_RESERVED_9 },
{ CLOCK_TIME(16, 0), CLOCK_TIME(17, 0) + 1, true, SKYBOX_INDEX_HOLY_RESERVED_9, SKYBOX_INDEX_HOLY_RESERVED_10 },
{ CLOCK_TIME(17, 0) + 1, CLOCK_TIME(18, 0) + 1, false, SKYBOX_INDEX_HOLY_RESERVED_10,
SKYBOX_INDEX_HOLY_RESERVED_10 },
{ CLOCK_TIME(18, 0) + 1, CLOCK_TIME(19, 0) + 1, true, SKYBOX_INDEX_HOLY_RESERVED_10,
SKYBOX_INDEX_HOLY_RESERVED_11 },
{ CLOCK_TIME(19, 0) + 1, CLOCK_TIME(24, 0) - 1, false, SKYBOX_INDEX_HOLY_RESERVED_11,
SKYBOX_INDEX_HOLY_RESERVED_11 },
},
};

/**
* File data for the "normal" skybox used in the overworld.
*
* Up to two different skyboxes can loaded at once for the purpose of blending. Skyboxes can only
* transition either to the next step in the day night cycle (e.g clear day to clear sunset),
* or the opposing weather condition in the same step of the day/night cycle (e.g. cloudy night to clear night).
*
* The skybox image data is color indexed, capped to a maximum 128 colors to allow the palette data for two different
* skyboxes to fit in one 256 color tlut. This means the image data for the skyboxes is required to alternate between
* starting at color index 0 and color index 128.
*
* IS_NORMAL_SKYBOX_IMAGE_COLOR_INDEX_0 depends on the order of this table to determine where to write palette data.
*/
SkyboxFile gNormalSkyFiles[] = {
// Clear Sky
{
ROM_FILE(vr_fine0_static),
ROM_FILE(vr_fine0_static), // color index start 128
ROM_FILE(vr_fine0_pal_static),
},
{
ROM_FILE(vr_fine1_static),
ROM_FILE(vr_fine1_static), // color index start 0
ROM_FILE(vr_fine1_pal_static),
},
{
ROM_FILE(vr_fine2_static),
ROM_FILE(vr_fine2_static), // color index start 128
ROM_FILE(vr_fine2_pal_static),
},
{
ROM_FILE(vr_fine3_static),
ROM_FILE(vr_fine3_static), // color index start 0
ROM_FILE(vr_fine3_pal_static),
},
// Cloudy Sky
{
ROM_FILE(vr_cloud0_static),
ROM_FILE(vr_cloud0_static), // color index start 0
ROM_FILE(vr_cloud0_pal_static),
},
{
ROM_FILE(vr_cloud1_static),
ROM_FILE(vr_cloud1_static), // color index start 128
ROM_FILE(vr_cloud1_pal_static),
},
{
ROM_FILE(vr_cloud2_static),
ROM_FILE(vr_cloud2_static), // color index start 0
ROM_FILE(vr_cloud2_pal_static),
},
{
ROM_FILE(vr_cloud3_static),
ROM_FILE(vr_cloud3_static), // color index start 128
ROM_FILE(vr_cloud3_pal_static),
},
// Holy Sky (Unused)
// Will appear incorrectly due to IS_NORMAL_SKYBOX_IMAGE_COLOR_INDEX_0 putting the palette at color index 128
{
ROM_FILE(vr_holy0_static),
ROM_FILE(vr_holy0_static), // color index start 0
ROM_FILE(vr_holy0_pal_static),
},
};
Expand Down Expand Up @@ -212,7 +233,7 @@ s16 sLightningFlashAlpha;
s16 sSunDepthTestX;
s16 sSunDepthTestY;

#pragma increment_block_number "gc-eu:240 gc-eu-mq:240 gc-jp:216 gc-jp-ce:216 gc-jp-mq:216 gc-us:216 gc-us-mq:216" \
#pragma increment_block_number "gc-eu:240 gc-eu-mq:128 gc-jp:216 gc-jp-ce:214 gc-jp-mq:216 gc-us:216 gc-us-mq:216" \
"ntsc-1.2:224"

LightNode* sNGameOverLightNode;
Expand Down Expand Up @@ -277,8 +298,8 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused)
Lights_DirectionalSetInfo(&envCtx->dirLight2, 80, 80, 80, 80, 80, 80);
LightContext_InsertLight(play, &play->lightCtx, &envCtx->dirLight2);

envCtx->skybox1Index = 99;
envCtx->skybox2Index = 99;
envCtx->skybox1Index = SKYBOX_INDEX_INIT;
envCtx->skybox2Index = SKYBOX_INDEX_INIT;

envCtx->changeSkyboxState = CHANGE_SKYBOX_INACTIVE;
envCtx->changeSkyboxTimer = 0;
Expand Down Expand Up @@ -646,8 +667,8 @@ void Environment_UpdateStorm(EnvironmentContext* envCtx, u8 unused) {
void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxContext* skyboxCtx) {
u32 size;
u8 i;
u8 newSkybox1Index = 0xFF;
u8 newSkybox2Index = 0xFF;
u8 newSkybox1Index = SKYBOX_INDEX_UNDEFINED;
u8 newSkybox2Index = SKYBOX_INDEX_UNDEFINED;
u8 skyboxBlend = 0;

if (skyboxId == SKYBOX_CUTSCENE_MAP) {
Expand Down Expand Up @@ -717,7 +738,7 @@ void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxCon
}

#if OOT_DEBUG
if (newSkybox1Index == 0xFF) {
if (newSkybox1Index == SKYBOX_INDEX_UNDEFINED) {
PRINTF(VT_COL(RED, WHITE) T("\n環境VRデータ取得失敗! ささきまでご報告を!",
"\nEnvironment VR data acquisition failed! Report to Sasaki!") VT_RST);
}
Expand Down Expand Up @@ -748,7 +769,8 @@ void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxCon
if (envCtx->skyboxDmaState == SKYBOX_DMA_TEXTURE1_DONE) {
envCtx->skyboxDmaState = SKYBOX_DMA_TLUT1_START;

if ((newSkybox1Index & 1) ^ ((newSkybox1Index & 4) >> 2)) {
if (IS_NORMAL_SKYBOX_IMAGE_COLOR_INDEX_0(newSkybox1Index)) {
// Reserve palette color index 0-127
size = gNormalSkyFiles[newSkybox1Index].palette.vromEnd -
gNormalSkyFiles[newSkybox1Index].palette.vromStart;

Expand All @@ -757,6 +779,7 @@ void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxCon
gNormalSkyFiles[newSkybox1Index].palette.vromStart, size, 0, &envCtx->loadQueue, NULL,
"../z_kankyo.c", 1307);
} else {
// Reserve palette color index 128-255
size = gNormalSkyFiles[newSkybox1Index].palette.vromEnd -
gNormalSkyFiles[newSkybox1Index].palette.vromStart;
osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1);
Expand All @@ -769,7 +792,8 @@ void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxCon
if (envCtx->skyboxDmaState == SKYBOX_DMA_TEXTURE2_DONE) {
envCtx->skyboxDmaState = SKYBOX_DMA_TLUT2_START;

if ((newSkybox2Index & 1) ^ ((newSkybox2Index & 4) >> 2)) {
if (IS_NORMAL_SKYBOX_IMAGE_COLOR_INDEX_0(newSkybox2Index)) {
// Reserve palette color index 0-127
size = gNormalSkyFiles[newSkybox2Index].palette.vromEnd -
gNormalSkyFiles[newSkybox2Index].palette.vromStart;

Expand All @@ -778,6 +802,7 @@ void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxCon
gNormalSkyFiles[newSkybox2Index].palette.vromStart, size, 0, &envCtx->loadQueue, NULL,
"../z_kankyo.c", 1342);
} else {
// Reserve palette color index 128-255
size = gNormalSkyFiles[newSkybox2Index].palette.vromEnd -
gNormalSkyFiles[newSkybox2Index].palette.vromStart;
osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1);
Expand Down
2 changes: 1 addition & 1 deletion src/code/z_vr_box.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
DMA_REQUEST_SYNC(skyboxCtx->staticSegments[1], gNormalSkyFiles[skybox2Index].file.vromStart, size,
"../z_vr_box.c", 1064);

if ((skybox1Index & 1) ^ ((skybox1Index & 4) >> 2)) {
if (IS_NORMAL_SKYBOX_IMAGE_COLOR_INDEX_0(skybox1Index)) {
size = gNormalSkyFiles[skybox1Index].palette.vromEnd - gNormalSkyFiles[skybox1Index].palette.vromStart;

skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size * 2, "../z_vr_box.c", 1072);
Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_Fishing/z_fishing.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "cic6105.h"
#endif

#pragma increment_block_number "gc-eu:125 gc-eu-mq:125 gc-jp:127 gc-jp-ce:127 gc-jp-mq:127 gc-us:127 gc-us-mq:127"
#pragma increment_block_number "gc-eu:125 gc-eu-mq:122 gc-jp:127 gc-jp-ce:124 gc-jp-mq:127 gc-us:127 gc-us-mq:127"

#define FLAGS ACTOR_FLAG_4

Expand Down
4 changes: 2 additions & 2 deletions src/overlays/gamestates/ovl_file_choose/z_file_choose.c
Original file line number Diff line number Diff line change
Expand Up @@ -1908,8 +1908,8 @@ void FileSelect_InitContext(GameState* thisx) {
envCtx->changeLightEnabled = false;
envCtx->changeLightTimer = 0;
envCtx->skyboxDmaState = SKYBOX_DMA_INACTIVE;
envCtx->skybox1Index = 99;
envCtx->skybox2Index = 99;
envCtx->skybox1Index = SKYBOX_INDEX_INIT;
envCtx->skybox2Index = SKYBOX_INDEX_INIT;
envCtx->lightConfig = 0;
envCtx->changeLightNextConfig = 0;
envCtx->lightSetting = 0;
Expand Down