Map Select: Docs and Cleanup (#962)

* Add Map Select Docs

* cleanup

* brackets

* Another typo
This commit is contained in:
engineer124 2022-07-23 15:30:19 -04:00 committed by GitHub
parent f3f147cc3d
commit 6472f68323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 572 additions and 420 deletions

View File

@ -916,7 +916,7 @@ extern u8 kanfontOrdering[92];
// extern UNK_TYPE1 D_801BDBA0;
// extern UNK_TYPE1 D_801BDBA4;
// extern UNK_TYPE1 D_801BDBA8;
extern u8 D_801BDBB0;
extern u8 gWeatherMode;
// extern UNK_TYPE1 D_801BDBB4;
// extern UNK_TYPE1 D_801BDBB8;
// extern UNK_TYPE1 D_801BDBBC;

View File

@ -247,7 +247,7 @@ typedef struct SaveContext {
/* 0x3F4E */ u16 nextDayTime; // "next_zelda_time"
/* 0x3F50 */ u8 transFadeDuration; // "fade_speed"
/* 0x3F51 */ u8 transWipeSpeed; // "wipe_speed" transition related
/* 0x3F52 */ u16 environmentTime; // "kankyo_time"
/* 0x3F52 */ u16 skyboxTime; // "kankyo_time"
/* 0x3F54 */ u8 dogIsLost; // "dog_event_flag"
/* 0x3F55 */ u8 nextTransitionType; // "next_wipe"
/* 0x3F56 */ s16 worldMapArea; // "area_type"

View File

@ -67,7 +67,7 @@ GameStateOverlay* Graph_GetNextGameState(GameState* gameState) {
if (gameStateInit == (GameStateFunc)TitleSetup_Init) {
return &gGameStateOverlayTable[0];
}
if (gameStateInit == (GameStateFunc)Select_Init) {
if (gameStateInit == (GameStateFunc)MapSelect_Init) {
return &gGameStateOverlayTable[1];
}
if (gameStateInit == (GameStateFunc)Title_Init) {

View File

@ -1191,7 +1191,7 @@ void BgCheck_GetSubdivisionMinBounds(CollisionContext* colCtx, Vec3f* pos, s32*
/**
* Get positive bias subdivision indices
* increments indicies if `pos` is within BGCHECK_SUBDIV_OVERLAP units of the postive subdivision boundary
* increments indices if `pos` is within BGCHECK_SUBDIV_OVERLAP units of the positive subdivision boundary
* `sx`, `sy`, `sz` returns the subdivision x, y, z indices
*/
void BgCheck_GetSubdivisionMaxBounds(CollisionContext* colCtx, Vec3f* pos, s32* sx, s32* sy, s32* sz) {

View File

@ -13,7 +13,7 @@ void SaveContext_Init(void) {
gSaveContext.cutsceneTrigger = 0;
gSaveContext.unk_3F4D = 0;
gSaveContext.nextDayTime = 0xFFFF;
gSaveContext.environmentTime = 0;
gSaveContext.skyboxTime = 0;
gSaveContext.dogIsLost = true;
gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT;
gSaveContext.unk_3F26 = 50;

View File

@ -554,7 +554,7 @@ void Cutscene_Command_SetTime(PlayState* play, CutsceneContext* csCtx, CsCmdDayT
nextTime = hourAsMinutes + minutes;
gSaveContext.save.time = nextTime;
gSaveContext.environmentTime = nextTime;
gSaveContext.skyboxTime = nextTime;
}
}

View File

@ -15,7 +15,7 @@
GameStateOverlay gGameStateOverlayTable[] = {
GAMESTATE_OVERLAY_INTERNAL(TitleSetup_Init, TitleSetup_Destroy, sizeof(GameState)),
GAMESTATE_OVERLAY(select, Select_Init, Select_Destroy, sizeof(SelectContext)),
GAMESTATE_OVERLAY(select, MapSelect_Init, MapSelect_Destroy, sizeof(MapSelectState)),
GAMESTATE_OVERLAY(title, Title_Init, Title_Destroy, sizeof(TitleContext)),
GAMESTATE_OVERLAY_INTERNAL(Play_Init, Play_Fini, sizeof(PlayState)),
GAMESTATE_OVERLAY(opening, Opening_Init, Opening_Destroy, sizeof(OpeningContext)),

View File

@ -376,7 +376,7 @@ void Scene_HeaderCmdSkyboxDisables(PlayState* play, SceneCmd* cmd) {
// SceneTableEntry Header Command 0x10: Time Settings
void Scene_HeaderCmdTimeSettings(PlayState* play, SceneCmd* cmd) {
if (cmd->timeSettings.hour != 0xFF && cmd->timeSettings.min != 0xFF) {
gSaveContext.environmentTime = gSaveContext.save.time =
gSaveContext.skyboxTime = gSaveContext.save.time =
(u16)(((cmd->timeSettings.hour + (cmd->timeSettings.min / 60.0f)) * 60.0f) / 0.021972656f);
}
@ -398,20 +398,17 @@ void Scene_HeaderCmdTimeSettings(PlayState* play, SceneCmd* cmd) {
play->envCtx.unk_8 = (Math_CosS(((void)0, gSaveContext.save.time) - 0x8000) * 120.0f) * 25.0f;
play->envCtx.unk_C = (Math_CosS(((void)0, gSaveContext.save.time) - 0x8000) * 20.0f) * 25.0f;
if (play->envCtx.timeIncrement == 0 && gSaveContext.save.cutscene < 0xFFF0) {
gSaveContext.environmentTime = gSaveContext.save.time;
if ((play->envCtx.timeIncrement == 0) && (gSaveContext.save.cutscene < 0xFFF0)) {
gSaveContext.skyboxTime = gSaveContext.save.time;
if (gSaveContext.environmentTime >= CLOCK_TIME(4, 0) && gSaveContext.environmentTime < CLOCK_TIME(6, 30)) {
gSaveContext.environmentTime = CLOCK_TIME(5, 0);
} else if (gSaveContext.environmentTime >= CLOCK_TIME(6, 30) &&
gSaveContext.environmentTime < CLOCK_TIME(8, 0)) {
gSaveContext.environmentTime = CLOCK_TIME(8, 0);
} else if (gSaveContext.environmentTime >= CLOCK_TIME(16, 0) &&
gSaveContext.environmentTime < CLOCK_TIME(17, 0)) {
gSaveContext.environmentTime = CLOCK_TIME(17, 0);
} else if (gSaveContext.environmentTime >= CLOCK_TIME(18, 0) &&
gSaveContext.environmentTime < CLOCK_TIME(19, 0)) {
gSaveContext.environmentTime = CLOCK_TIME(19, 0);
if ((gSaveContext.skyboxTime >= CLOCK_TIME(4, 0)) && (gSaveContext.skyboxTime < CLOCK_TIME(6, 30))) {
gSaveContext.skyboxTime = CLOCK_TIME(5, 0);
} else if ((gSaveContext.skyboxTime >= CLOCK_TIME(6, 30)) && (gSaveContext.skyboxTime < CLOCK_TIME(8, 0))) {
gSaveContext.skyboxTime = CLOCK_TIME(8, 0);
} else if ((gSaveContext.skyboxTime >= CLOCK_TIME(16, 0)) && (gSaveContext.skyboxTime < CLOCK_TIME(17, 0))) {
gSaveContext.skyboxTime = CLOCK_TIME(17, 0);
} else if ((gSaveContext.skyboxTime >= CLOCK_TIME(18, 0)) && (gSaveContext.skyboxTime < CLOCK_TIME(19, 0))) {
gSaveContext.skyboxTime = CLOCK_TIME(19, 0);
}
}
}

View File

@ -520,7 +520,7 @@ void func_80A430C8(EnTest4* this, PlayState* play) {
(gSaveContext.save.time < CLOCK_TIME(17, 30)) && (play->envCtx.unk_F2[2] == 0)) {
// rain?
D_801BDBB0 = 1;
gWeatherMode = 1;
func_800FD78C(play);
play->envCtx.unk_E3 = 1;
play->envCtx.unk_F2[0] = 0x3C;
@ -535,7 +535,7 @@ void func_80A430C8(EnTest4* this, PlayState* play) {
}
}
if (D_801BDBB0 == 1) {
if (gWeatherMode == 1) {
this->state = TEST4_STATE_1;
}
}
@ -544,11 +544,11 @@ void func_80A431C8(EnTest4* this, PlayState* play) {
if (((gSaveContext.save.time >= CLOCK_TIME(17, 30)) && (gSaveContext.save.time < CLOCK_TIME(23, 0)) &&
(play->envCtx.unk_F2[0] != 0)) ||
(play->envCtx.unk_F2[2] != 0)) {
D_801BDBB0 = 0;
gWeatherMode = 0;
play->envCtx.unk_E3 = 2;
}
if (D_801BDBB0 == 0) {
if (gWeatherMode == 0) {
this->state = TEST4_STATE_0;
}
}

View File

@ -125,8 +125,8 @@ u8 func_80966608(EnWeatherTag* this, PlayState* play, UNK_TYPE a3, UNK_TYPE a4,
if (!(play->envCtx.unk_1E == 0) || ((play->envCtx.unk_1F != 1) && (play->envCtx.unk_21 == 0))) {
D_801BDBB8 = 0;
if (D_801BDBB0 != weatherMode) {
D_801BDBB0 = weatherMode;
if (gWeatherMode != weatherMode) {
gWeatherMode = weatherMode;
play->envCtx.unk_21 = 1;
play->envCtx.unk_1F = new1F;
play->envCtx.unk_20 = new20;
@ -153,7 +153,7 @@ u8 func_80966758(EnWeatherTag* this, PlayState* play, UNK_TYPE a3, UNK_TYPE a4,
if (!(play->envCtx.unk_1E == 0) || ((play->envCtx.unk_1F != 1) && (play->envCtx.unk_21 == 0))) {
D_801BDBB8 = 0;
D_801BDBB0 = 0;
gWeatherMode = 0;
play->envCtx.unk_21 = 1;
play->envCtx.unk_1F = new1F;
play->envCtx.unk_20 = new20;
@ -230,7 +230,7 @@ void EnWeatherTag_Die(EnWeatherTag* this, PlayState* play) {
// poisoned swamp: placed behind the water fall from ikana
// this tag stops spawning after STT cleared?
void func_80966B08(EnWeatherTag* this, PlayState* play) {
if (func_80966608(this, play, 0, 0, play->envCtx.unk_1F, 5, 100, 2) || D_801BDBB0 == 2) {
if (func_80966608(this, play, 0, 0, play->envCtx.unk_1F, 5, 100, 2) || (gWeatherMode == 2)) {
play->skyboxId = 3;
EnWeatherTag_SetupAction(this, func_80966D20);
} else if (D_801F4E74 <= 0.01f) {
@ -298,7 +298,7 @@ void func_80966D20(EnWeatherTag* this, PlayState* play) {
EnWeatherTag_SetupAction(this, func_80966B08);
}
if (D_801BDBB0 != 2) {
if (gWeatherMode != 2) {
EnWeatherTag_SetupAction(this, func_80966B08);
}
}
@ -452,7 +452,7 @@ void func_809674C8(EnWeatherTag* this, PlayState* play) {
if ((gSaveContext.save.time >= CLOCK_TIME(7, 0)) && (gSaveContext.save.time < CLOCK_TIME(17, 30)) &&
(play->envCtx.unk_F2[2] == 0)) {
D_801BDBB0 = 1;
gWeatherMode = 1;
func_800FD78C(play);
play->envCtx.unk_F2[4] = 0x20;
EnWeatherTag_SetupAction(this, func_80967608);
@ -471,7 +471,7 @@ void func_809674C8(EnWeatherTag* this, PlayState* play) {
// WEATHERTAG_TYPE_LOCALDAY2RAIN 2
void func_80967608(EnWeatherTag* this, PlayState* play) {
if ((WEATHER_TAG_RANGE100(this) + 10.0f) < Actor_XZDistanceBetweenActors(&GET_PLAYER(play)->actor, &this->actor)) {
D_801BDBB0 = 0;
gWeatherMode = 0;
EnWeatherTag_SetupAction(this, func_809674C8);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -3,12 +3,9 @@
#include "global.h"
struct SelectContext;
struct MapSelectState;
void Select_Init(GameState* thisx);
void Select_Destroy(GameState* thisx);
typedef void (*Select_LoadFunc)(struct SelectContext*, u32, s32);
typedef void (*Select_LoadFunc)(struct MapSelectState*, u32, s32);
typedef struct {
/* 0x00 */ char* name;
@ -16,7 +13,7 @@ typedef struct {
/* 0x08 */ s32 entranceIndex;
} SceneSelectEntry; // size = 0xC
typedef struct SelectContext {
typedef struct MapSelectState {
/* 0x000 */ GameState state;
/* 0x0A8 */ View view;
/* 0x210 */ s32 count;
@ -36,6 +33,9 @@ typedef struct SelectContext {
/* 0x270 */ s32 lockDown;
/* 0x274 */ s32 unk_274; // unused
/* 0x278 */ UNK_TYPE1 unk_278[0x08];
} SelectContext; // size = 0x280
} MapSelectState; // size = 0x280
void MapSelect_Init(GameState* thisx);
void MapSelect_Destroy(GameState* thisx);
#endif

View File

@ -4089,19 +4089,19 @@
0x8080066C:("Title_Main",),
0x8080071C:("Title_Destroy",),
0x8080074C:("Title_Init",),
0x80800910:("Select_LoadTitle",),
0x80800930:("Select_LoadGame",),
0x80800A44:("Select_UpdateMenu",),
0x808013B8:("Select_PrintMenu",),
0x80801594:("Select_PrintLoadingMessage",),
0x80801620:("Select_PrintAgeSetting",),
0x808016E8:("Select_PrintCutsceneSetting",),
0x8080194C:("Select_DrawMenu",),
0x808019FC:("Select_DrawLoadingScreen",),
0x80801A64:("Select_Draw",),
0x80801AFC:("Select_Main",),
0x80801B28:("Select_Destroy",),
0x80801B4C:("Select_Init",),
0x80800910:("MapSelect_LoadTitle",),
0x80800930:("MapSelect_LoadGame",),
0x80800A44:("MapSelect_UpdateMenu",),
0x808013B8:("MapSelect_PrintMenu",),
0x80801594:("MapSelect_PrintLoadingMessage",),
0x80801620:("MapSelect_PrintAgeSetting",),
0x808016E8:("MapSelect_PrintCutsceneSetting",),
0x8080194C:("MapSelect_DrawMenu",),
0x808019FC:("MapSelect_DrawLoadingScreen",),
0x80801A64:("MapSelect_Draw",),
0x80801AFC:("MapSelect_Main",),
0x80801B28:("MapSelect_Destroy",),
0x80801B4C:("MapSelect_Init",),
0x80803DF0:("Opening_SetupForTitleCutscene",),
0x80803EA0:("func_80803EA0",),
0x80803EC0:("Opening_Main",),

View File

@ -970,7 +970,7 @@
0x801BDBA0:("D_801BDBA0","UNK_TYPE1","",0x1),
0x801BDBA4:("D_801BDBA4","UNK_TYPE1","",0x1),
0x801BDBA8:("D_801BDBA8","UNK_TYPE1","",0x1),
0x801BDBB0:("D_801BDBB0","u8","",0x1),
0x801BDBB0:("gWeatherMode","u8","",0x1),
0x801BDBB4:("D_801BDBB4","UNK_TYPE1","",0x1),
0x801BDBB8:("D_801BDBB8","UNK_TYPE1","",0x1),
0x801BDBBC:("D_801BDBBC","UNK_TYPE1","",0x1),

View File

@ -627,6 +627,7 @@ wordReplace = {
"gSaveContext.playerForm": "gSaveContext.save.playerForm",
"gSaveContext.day": "gSaveContext.save.day",
"gSaveContext.isNight": "gSaveContext.save.isNight",
"gSaveContext.environmentTime": "gSaveContext.skyboxTime",
"gSaveContext.naviTimer": "gSaveContext.save.playerData.tatlTimer",
"gSaveContext.tatlTimer": "gSaveContext.save.playerData.tatlTimer",
"gSaveContext.rupees": "gSaveContext.save.playerData.rupees",