diff --git a/include/z64environment.h b/include/z64environment.h index 79d34bbff56..3e711b07c31 100644 --- a/include/z64environment.h +++ b/include/z64environment.h @@ -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, +// 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, diff --git a/include/z64skybox.h b/include/z64skybox.h index e0ebcf0c030..4f174f16723 100644 --- a/include/z64skybox.h +++ b/include/z64skybox.h @@ -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, diff --git a/src/buffers/gfxbuffers.c b/src/buffers/gfxbuffers.c index fa466bc8290..64f935119a2 100644 --- a/src/buffers/gfxbuffers.c +++ b/src/buffers/gfxbuffers.c @@ -1,4 +1,5 @@ -#include "z64.h" +#include "alignment.h" +#include "gfx.h" ALIGNED(16) u64 gGfxSPTaskOutputBuffer[0x3000]; diff --git a/src/code/main.c b/src/code/main.c index 456f03f5d0a..d1b7cc82053 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -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[]; diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index 13b07c761f1..f83cd013a47 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -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" @@ -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, @@ -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), }, }; @@ -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; @@ -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; @@ -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) { @@ -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); } @@ -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; @@ -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); @@ -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; @@ -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); diff --git a/src/code/z_vr_box.c b/src/code/z_vr_box.c index d2aac8c1f3b..c03f09ec697 100644 --- a/src/code/z_vr_box.c +++ b/src/code/z_vr_box.c @@ -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); diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index 3860420ff44..a1328e138b9 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -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 diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index ac727a2970c..83de8f420d7 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -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;