File Select (1 Non-Matching) (#1158)

* Everything below Main OK,
and some small ones at the top

* 3 more short ones

* FileChoose_Main

* SelectModeUpdate/Draw

* SelectMode update functions done

* 2 more small ones

* ConfigModeDraw

* SetWindowVtx

* FileChoose_FadeInMenuElements

* Rest of the Config Mode Update Functions

* Minor cleanup

* FileChoose_UpdateMainMenu

* Make xml for title_static

* Minor correction

* One nasty draw, thanks Synray

Co-Authored-By: Synray <31429825+Synray@users.noreply.github.com>

* import data

* some cleanup

* import OoT docs

* missed some docs

* some progress

* FileSelect_SetWindowContentVtx WIP

* improve FileSelect_SetWindowContentVtx

* match z_file_nameset_NES

* cleanup and docs

* title static

* a few more functions

* even more functions

* small cleanup

* Data Cleanup

* 2 more matches

* z_file_choose_80807940 OK

* cleanup

* fix merge master

* FileSelect_DrawFileInfo wip

* small cleanup

* minor

* fix merge

* match FileSelect_DrawFileInfo

* cleanup

* fix merge

* fix merge

* sram cleanup

* document select mode

* many docs

* more docs

* more cleanup

* small nitpick

* consistency

* more cleanup

* more cleanup

* small

* small typos

* octal bad

* pr review

* noop

* elliptic review

* more review

* non-matching

* oops

* more suggestions

* keyboard formatting

* fix master

* sound

* padding

---------

Co-authored-by: Elliptic Ellipsis <elliptic.ellipsis@gmail.com>
Co-authored-by: Synray <31429825+Synray@users.noreply.github.com>
This commit is contained in:
engineer124
2023-06-05 15:03:02 -04:00
committed by GitHub
co-authored by Elliptic Ellipsis Synray
parent cd53dd317f
commit 8cabbb1a2b
38 changed files with 5951 additions and 792 deletions
+2 -1
View File
@@ -2218,7 +2218,8 @@ s32 SysFlashrom_IsBusy(void);
s32 SysFlashrom_AwaitResult(void);
void SysFlashrom_WriteDataSync(void* addr, u32 pageNum, u32 pageCount);
s32 func_80185F90(u32 param_1);
s32 func_80185F90(u32 arg0);
u32 osFlashGetAddr(u32 pageNum);
OSPiHandle* osFlashReInit(u8 latency, u8 pulse, u8 pageSize, u8 relDuration, u32 start);
void osFlashChange(u32 flashNum);
+23 -23
View File
@@ -273,45 +273,45 @@ typedef struct {
/* 0x00 */ u16 unk_0;
/* 0x02 */ u16 sceneTimeSpeed;
/* 0x04 */ Vec3f sunPos;
/* 0x10 */ u8 unk_10;
/* 0x11 */ u8 unk_11;
/* 0x10 */ u8 skybox1Index;
/* 0x11 */ u8 skybox2Index;
/* 0x12 */ u8 unk_12;
/* 0x13 */ u8 unk_13;
/* 0x13 */ u8 skyboxBlend;
/* 0x14 */ u8 unk_14;
/* 0x15 */ u8 skyboxDisabled;
/* 0x16 */ u8 sunMoonDisabled;
/* 0x17 */ u8 unk_17;
/* 0x18 */ u8 unk_18;
/* 0x19 */ u8 unk_19;
/* 0x1A */ u16 unk_1A;
/* 0x17 */ u8 skyboxConfig;
/* 0x18 */ u8 changeSkyboxNextConfig;
/* 0x19 */ u8 changeSkyboxState;
/* 0x1A */ u16 changeSkyboxTimer;
/* 0x1C */ u16 unk_1C;
/* 0x1E */ u8 unk_1E;
/* 0x1F */ u8 unk_1F;
/* 0x20 */ u8 unk_20;
/* 0x21 */ u8 unk_21;
/* 0x22 */ u16 unk_22;
/* 0x24 */ u16 unk_24;
/* 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 unk_44;
/* 0x48 */ DmaRequest unk_48;
/* 0x68 */ OSMesgQueue unk_68;
/* 0x80 */ OSMesg unk_80;
/* 0x84 */ f32 unk_84;
/* 0x88 */ f32 unk_88;
/* 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 unk_C0;
/* 0xC1 */ u8 unk_C1;
/* 0xC2 */ u8 unk_C2;
/* 0xC0 */ u8 lightBlendEnabled;
/* 0xC1 */ u8 lightSetting;
/* 0xC2 */ u8 prevLightSetting;
/* 0xC3 */ u8 lightSettingOverride;
/* 0xC4 */ LightSettings unk_C4;
/* 0xDA */ u16 unk_DA;
/* 0xDA */ u16 lightBlendRateOverride;
/* 0xDC */ f32 lightBlend;
/* 0xE0 */ u8 unk_E0;
/* 0xE1 */ u8 unk_E1;
+33 -26
View File
@@ -10,6 +10,13 @@ struct GameState;
struct PlayState;
struct FileSelectState;
typedef enum {
/* 0 */ SAVE_AUDIO_STEREO,
/* 1 */ SAVE_AUDIO_MONO,
/* 2 */ SAVE_AUDIO_HEADSET,
/* 3 */ SAVE_AUDIO_SURROUND
} AudioOption;
// TODO: properly name DOWN, RETURN and TOP
typedef enum RespawnMode {
/* 0 */ RESPAWN_MODE_DOWN, // "RESTART_MODE_DOWN"
@@ -157,13 +164,13 @@ typedef enum {
#define PICTO_PHOTO_COMPRESSED_SIZE (PICTO_PHOTO_SIZE * 5 / 8)
typedef struct SramContext {
/* 0x00 */ u8* readBuff;
/* 0x04 */ u8 *saveBuf;
/* 0x00 */ u8* noFlashSaveBuf; // Never allocated memory
/* 0x04 */ u8* saveBuf;
/* 0x08 */ char unk_08[4];
/* 0x0C */ s16 status;
/* 0x10 */ u32 curPage;
/* 0x14 */ u32 numPages;
/* 0x18 */ OSTime unk_18;
/* 0x18 */ OSTime startWriteOsTime;
/* 0x20 */ s16 unk_20;
/* 0x22 */ s16 unk_22;
/* 0x24 */ s16 unk_24;
@@ -226,14 +233,14 @@ typedef struct CycleSceneFlags {
typedef struct SaveOptions {
/* 0x0 */ u16 optionId; // "option_id"
/* 0x2 */ u8 language; // "j_n"
/* 0x3 */ s8 audioSetting; // "s_sound"
/* 0x3 */ u8 audioSetting; // "s_sound"
/* 0x4 */ u8 languageSetting; // "language"
/* 0x5 */ u8 zTargetSetting; // "z_attention", 0: Switch; 1: Hold
} SaveOptions; // size = 0x6
typedef struct SavePlayerData {
/* 0x00 */ char newf[6]; // "newf" Will always be "ZELDA3 for a valid save
/* 0x06 */ u16 deaths; // "savect"
/* 0x06 */ u16 threeDayResetCount; // "savect"
/* 0x08 */ char playerName[8]; // "player_name"
/* 0x10 */ s16 healthCapacity; // "max_life"
/* 0x12 */ s16 health; // "now_life"
@@ -337,11 +344,11 @@ typedef struct SaveContext {
/* 0x3DB4 */ f32 entranceSpeed; // "player_wipe_speedF"
/* 0x3DB8 */ u16 entranceSound; // "player_wipe_door_SE"
/* 0x3DBA */ u8 unk_3DBA; // "player_wipe_item"
/* 0x3DBB */ u8 unk_3DBB; // "next_walk"
/* 0x3DBB */ u8 retainWeatherMode; // "next_walk"
/* 0x3DBC */ s16 dogParams; // OoT leftover. "dog_flag"
/* 0x3DBE */ u8 envHazardTextTriggerFlags; // "guide_status"
/* 0x3DBF */ u8 showTitleCard; // "name_display"
/* 0x3DC0 */ s16 unk_3DC0; // "shield_magic_timer"
/* 0x3DC0 */ s16 nayrusLoveTimer; // remnant of OoT, "shield_magic_timer"
/* 0x3DC2 */ u8 unk_3DC2; // "pad1"
/* 0x3DC8 */ OSTime postmanTimerStopOsTime; // The osTime when the timer stops for the postman minigame. "get_time"
/* 0x3DD0 */ u8 timerStates[TIMER_ID_MAX]; // See the `TimerState` enum. "event_fg"
@@ -374,13 +381,13 @@ typedef struct SaveContext {
/* 0x3F3A */ u16 minigameScore; // "yabusame_total"
/* 0x3F3C */ u16 minigameHiddenScore; // "yabusame_out_ct"
/* 0x3F3E */ u8 unk_3F3E; // "no_save"
/* 0x3F3F */ u8 unk_3F3F; // "flash_flag"
/* 0x3F3F */ u8 flashSaveAvailable; // "flash_flag"
/* 0x3F40 */ SaveOptions options;
/* 0x3F46 */ u16 unk_3F46; // "NottoriBgm"
/* 0x3F46 */ u16 forcedSeqId; // "NottoriBgm"
/* 0x3F48 */ u8 cutsceneTransitionControl; // "fade_go"
/* 0x3F4A */ u16 nextCutsceneIndex; // "next_daytime"
/* 0x3F4C */ u8 cutsceneTrigger; // "doukidemo"
/* 0x3F4D */ u8 unk_3F4D; // "Kenjya_no"
/* 0x3F4D */ u8 chamberCutsceneNum; // remnant of OoT "Kenjya_no"
/* 0x3F4E */ u16 nextDayTime; // "next_zelda_time"
/* 0x3F50 */ u8 transFadeDuration; // "fade_speed"
/* 0x3F51 */ u8 transWipeSpeed; // "wipe_speed" transition related
@@ -1575,28 +1582,28 @@ void Sram_InitDebugSave(void);
void Sram_ResetSaveFromMoonCrash(SramContext* sramCtx);
void Sram_OpenSave(struct FileSelectState* fileSelect, SramContext* sramCtx);
void func_8014546C(SramContext* sramCtx);
void func_801457CC(struct FileSelectState* fileSelect, SramContext* sramCtx);
void func_80146580(struct FileSelectState* fileSelect2, SramContext* sramCtx, s32 fileNum);
void func_80146628(struct FileSelectState* fileSelect2, SramContext* sramCtx);
void func_801457CC(struct GameState* gameState, SramContext* sramCtx);
void Sram_EraseSave(struct FileSelectState* fileSelect2, SramContext* sramCtx, s32 fileNum);
void Sram_CopySave(struct FileSelectState* fileSelect2, SramContext* sramCtx);
void Sram_InitSave(struct FileSelectState* fileSelect2, SramContext* sramCtx);
void func_80146DF8(SramContext* sramCtx);
void Sram_WriteSaveOptionsToBuffer(SramContext* sramCtx);
void Sram_InitSram(struct GameState* gameState, SramContext* sramCtx);
void Sram_Alloc(struct GameState* gameState, SramContext* sramCtx);
void Sram_SaveSpecialEnterClockTown(struct PlayState* play);
void Sram_SaveSpecialNewDay(struct PlayState* play);
void func_80147008(SramContext* sramCtx, u32 curPage, u32 numPages);
void func_80147020(SramContext* sramCtx);
void func_80147068(SramContext* sramCtx);
void func_80147138(SramContext* sramCtx, s32 curPage, s32 numPages);
void func_80147150(SramContext* sramCtx);
void func_80147198(SramContext* sramCtx);
void Sram_SetFlashPagesDefault(SramContext* sramCtx, u32 curPage, u32 numPages);
void Sram_StartWriteToFlashDefault(SramContext* sramCtx);
void Sram_UpdateWriteToFlashDefault(SramContext* sramCtx);
void Sram_SetFlashPagesOwlSave(SramContext* sramCtx, s32 curPage, s32 numPages);
void Sram_StartWriteToFlashOwlSave(SramContext* sramCtx);
void Sram_UpdateWriteToFlashOwlSave(SramContext* sramCtx);
extern s32 D_801C6798[];
extern u32 gSramSlotOffsets[];
extern u8 gAmmoItems[];
extern s32 D_801C67C8[];
extern s32 D_801C67F0[];
extern s32 D_801C6818[];
extern s32 D_801C6840[];
extern s32 D_801C6850[];
extern s32 gFlashSaveStartPages[];
extern s32 gFlashSaveNumPages[];
extern s32 gFlashSpecialSaveNumPages[];
extern s32 gFlashOwlSaveStartPages[];
extern s32 gFlashOwlSaveNumPages[];
#endif
+4 -2
View File
@@ -130,8 +130,8 @@ typedef struct {
/* 0x1 */ u8 data1;
/* 0x2 */ UNK_TYPE1 pad2[2];
/* 0x4 */ u8 skyboxId;
/* 0x5 */ u8 unk5;
/* 0x6 */ u8 unk6;
/* 0x5 */ u8 skyboxConfig;
/* 0x6 */ u8 envLightMode;
} SCmdSkyboxSettings; // size = 0x7
typedef struct {
@@ -719,6 +719,8 @@ typedef enum {
*/
#define ENTRANCE(scene, spawn) ((((ENTR_SCENE_##scene) & 0x7F) << 9) | (((spawn) & 0x1F) << 4))
#define ENTR_LOAD_OPENING -1
/*
* Entrances used in cutscene destination. Includes scene layer that's immediately applied to `nextCutsceneIndex` and removed.
* See `CutsceneScriptEntry.nextEntrance`