diff --git a/include/console_logo_state.h b/include/console_logo_state.h new file mode 100644 index 000000000..c23e7f1b1 --- /dev/null +++ b/include/console_logo_state.h @@ -0,0 +1,28 @@ +#ifndef CONSOLE_LOGO_STATE_H +#define CONSOLE_LOGO_STATE_H + +#include "ultra64.h" +#include "z64game.h" +#include "z64view.h" +#include "z64sram.h" + +typedef struct ConsoleLogoState { + /* 0x0000 */ GameState state; + /* 0x00A4 */ u8* staticSegment; + /* 0x00A8 */ View view; + /* 0x01D0 */ SramContext sramCtx; + /* 0x01D4 */ s16 timer; // not used in mq dbg (some sort of timer that doesn't seem to affect anything) + /* 0x01D6 */ s16 coverAlpha; + /* 0x01D8 */ s16 addAlpha; + /* 0x01DA */ s16 visibleDuration; + /* 0x01DC */ s16 ult; + /* 0x01DE */ s16 uls; + /* 0x01E0 */ u8 unk_1E0; + /* 0x01E1 */ u8 exit; + /* 0x01E2 */ char unk_1E2[0x06]; +} ConsoleLogoState; // size = 0x1E8 + +void ConsoleLogo_Init(GameState* thisx); +void ConsoleLogo_Destroy(GameState* thisx); + +#endif diff --git a/include/file_select_state.h b/include/file_select_state.h new file mode 100644 index 000000000..9a2df3f08 --- /dev/null +++ b/include/file_select_state.h @@ -0,0 +1,97 @@ +#ifndef FILE_SELECT_STATE_H +#define FILE_SELECT_STATE_H + +#include "ultra64.h" +#include "z64game.h" +#include "z64view.h" +#include "z64sram.h" +#include "z64skybox.h" +#include "z64message.h" +#include "z64environment.h" + +typedef struct FileSelectState { + /* 0x00000 */ GameState state; + /* 0x000A4 */ Vtx* windowVtx; + /* 0x000A8 */ u8* staticSegment; + /* 0x000AC */ u8* parameterSegment; +#if OOT_PAL + /* 0x000B0 */ u8* objectMagSegment; +#endif + /* 0x000B8 */ View view; + /* 0x001E0 */ SramContext sramCtx; + /* 0x001E4 */ char unk_1E4[0x4]; + /* 0x001E8 */ SkyboxContext skyboxCtx; + /* 0x00348 */ MessageContext msgCtx; + /* 0x0E760 */ Font font; + /* 0x1C8E8 */ EnvironmentContext envCtx; + /* 0x1C9E4 */ char unk_1C9E4[0x4]; + /* 0x1C9E8 */ Vtx* windowContentVtx; + /* 0x1C9EC */ Vtx* keyboardVtx; + /* 0x1C9F0 */ Vtx* nameEntryVtx; + /* 0x1C9F4 */ u8 n64ddFlag; + /* 0x1C9F6 */ u16 deaths[3]; + /* 0x1C9FC */ u8 fileNames[3][8]; + /* 0x1CA14 */ u16 healthCapacities[3]; + /* 0x1CA1C */ u32 questItems[3]; + /* 0x1CA28 */ s16 n64ddFlags[3]; + /* 0x1CA2E */ s8 defense[3]; +#if OOT_PAL + /* 0x1CA32 */ u16 health[3]; +#endif + /* 0x1CA38 */ s16 buttonIndex; + /* 0x1CA3A */ s16 confirmButtonIndex; // 0: yes, 1: quit + /* 0x1CA3C */ s16 menuMode; + /* 0x1CA3E */ s16 configMode; + /* 0x1CA40 */ s16 prevConfigMode; + /* 0x1CA42 */ s16 nextConfigMode; + /* 0x1CA44 */ s16 selectMode; + /* 0x1CA46 */ s16 selectedFileIndex; + /* 0x1CA48 */ char unk_1CA48[0x2]; + /* 0x1CA4A */ s16 fileNamesY[3]; + /* 0x1CA50 */ s16 actionTimer; + /* 0x1CA52 */ s16 buttonYOffsets[6]; + /* 0x1CA5E */ s16 copyDestFileIndex; + /* 0x1CA60 */ s16 warningLabel; + /* 0x1CA62 */ s16 warningButtonIndex; + /* 0x1CA64 */ s16 titleLabel; + /* 0x1CA66 */ s16 nextTitleLabel; + /* 0x1CA68 */ s16 windowColor[3]; + /* 0x1CA6E */ s16 titleAlpha[2]; + /* 0x1CA72 */ s16 windowAlpha; + /* 0x1CA74 */ s16 fileButtonAlpha[3]; + /* 0x1CA7A */ s16 nameBoxAlpha[3]; + /* 0x1CA80 */ s16 nameAlpha[3]; + /* 0x1CA86 */ s16 connectorAlpha[3]; + /* 0x1CA8C */ s16 fileInfoAlpha[3]; + /* 0x1CA92 */ s16 actionButtonAlpha[4]; // also contains the alphas for the confirm buttons + /* 0x1CA9A */ s16 optionButtonAlpha; + /* 0x1CA9C */ s16 nameEntryBoxAlpha; + /* 0x1CA9E */ s16 controlsAlpha; + /* 0x1CAA0 */ s16 emptyFileTextAlpha; + /* 0x1CAA2 */ s16 highlightColor[4]; + /* 0x1CAAA */ s16 highlightPulseDir; // 0 fade out, 1 fade in + /* 0x1CAAC */ s16 unk_1CAAC; // initialized but never used + /* 0x1CAAE */ s16 confirmButtonTexIndices[2]; + /* 0x1CAB2 */ s16 inputTimerX; + /* 0x1CAB4 */ s16 inputTimerY; + /* 0x1CAB6 */ s16 stickXDir; + /* 0x1CAB8 */ s16 stickYDir; + /* 0x1CABA */ s16 stickAdjX; + /* 0x1CABC */ s16 stickAdjY; + /* 0x1CABE */ s16 nameEntryBoxPosX; + /* 0x1CAC0 */ s16 windowPosX; + /* 0x1CAC4 */ f32 windowRot; + /* 0x1CAC8 */ s16 kbdButton; // only for buttons, not characters + /* 0x1CACA */ s16 charPage; // 0: hiragana, 1: katakana, 2: alphabet + /* 0x1CACC */ s16 charBgAlpha; // square shape the letter sits in + /* 0x1CACE */ s16 charIndex; // 0 - 64, top left to bottom right + /* 0x1CAD0 */ s16 kbdX; // (0, 0) is top left character + /* 0x1CAD2 */ s16 kbdY; + /* 0x1CAD4 */ s16 newFileNameCharCount; + /* 0x1CAD6 */ s16 unk_1CAD6[5]; +} FileSelectState; // size = 0x1CAE0 + +void FileSelect_Init(GameState* thisx); +void FileSelect_Destroy(GameState* thisx); + +#endif diff --git a/include/functions.h b/include/functions.h index 3ec423d55..73fc29867 100644 --- a/include/functions.h +++ b/include/functions.h @@ -36,25 +36,8 @@ void* MemCpy(void* dest, const void* src, s32 len); void MapMark_Init(PlayState* play); void MapMark_ClearPointers(PlayState* play); void MapMark_Draw(PlayState* play); -void PreNmiBuff_Init(PreNmiBuff* this); -void PreNmiBuff_SetReset(PreNmiBuff* this); -u32 PreNmiBuff_IsResetting(PreNmiBuff* this); void Sched_FlushTaskQueue(void); -void PreNMI_Init(GameState* thisx); - -void Sample_Destroy(GameState* thisx); -void Sample_Init(GameState* thisx); - -void ViMode_LogPrint(OSViMode* osViMode); -void ViMode_Configure(ViMode* viMode, s32 type, s32 tvType, s32 loRes, s32 antialiasOff, s32 modeN, s32 fb16Bit, - s32 width, s32 height, s32 leftAdjust, s32 rightAdjust, s32 upperAdjust, s32 lowerAdjust); -void ViMode_Save(ViMode* viMode); -void ViMode_Load(ViMode* viMode); -void ViMode_Init(ViMode* viMode); -void ViMode_Destroy(ViMode* viMode); -void ViMode_ConfigureFeatures(ViMode* viMode, s32 viFeatures); -void ViMode_Update(ViMode* viMode, Input* input); void PlayerCall_InitFuncPtrs(void); void TransitionTile_Destroy(TransitionTile* this); TransitionTile* TransitionTile_Init(TransitionTile* this, s32 cols, s32 rows); @@ -138,48 +121,13 @@ void func_800D3210(void); void RcpUtils_PrintRegisterStatus(void); void RcpUtils_Reset(void); -void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd); -void Overlay_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlRelocs, void* vramStart); -size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd, void* allocatedRamAddr); -// ? func_800FC800(?); -// ? func_800FC83C(?); -// ? func_800FCAB4(?); + void SystemHeap_Init(void* start, u32 size); f32 absf(f32); void Regs_InitData(PlayState* play); -void Setup_Init(GameState* thisx); -void Setup_Destroy(GameState* thisx); -void ConsoleLogo_Init(GameState* thisx); -void ConsoleLogo_Destroy(GameState* thisx); - -// ENABLE_MAP_SELECT -void MapSelect_Init(GameState* thisx); -void MapSelect_Destroy(GameState* thisx); - -void DebugOpening_Init(GameState* thisx); -void DebugOpening_Destroy(GameState* thisx); - -void TitleSetup_Init(GameState* thisx); -void TitleSetup_Destroy(GameState* thisx); -void FileSelect_Init(GameState* thisx); -void FileSelect_Destroy(GameState* thisx); - -#if ENABLE_MOTION_BLUR -void Play_DrawMotionBlur(PlayState* this); -void Play_InitMotionBlur(PlayState* this); -void Play_DestroyMotionBlur(void); -void Play_SetMotionBlurPriorityAlpha(u32 alpha); -void Play_EnableMotionBlurPriority(u32 alpha); -void Play_DisableMotionBlurPriority(void); -#endif - -void Play_SetMotionBlurAlpha(u32 alpha); -void Play_EnableMotionBlur(u32 alpha); -void Play_DisableMotionBlur(void); - #if ENABLE_F3DEX3 void OcclusionPlane_Draw_Phase(PlayState* play, OcclusionPlanePhase phase); void OcclusionPlane_Draw_PostCamUpdate(PlayState* play); diff --git a/include/libu64/overlay.h b/include/libu64/overlay.h new file mode 100644 index 000000000..258dfba77 --- /dev/null +++ b/include/libu64/overlay.h @@ -0,0 +1,40 @@ +#ifndef LIBU64_OVERLAY_H +#define LIBU64_OVERLAY_H + +#include "ultra64.h" + +/* Relocation entry field getters */ +#define RELOC_SECTION(reloc) ((reloc) >> 30) +#define RELOC_OFFSET(reloc) ((reloc) & 0xFFFFFF) +#define RELOC_TYPE_MASK(reloc) ((reloc) & 0x3F000000) +#define RELOC_TYPE_SHIFT 24 + +/* MIPS Relocation Types, matches the MIPS ELF spec */ +#define R_MIPS_32 2 +#define R_MIPS_26 4 +#define R_MIPS_HI16 5 +#define R_MIPS_LO16 6 + +/* Reloc section id, must fit in 2 bits otherwise the relocation format must be modified */ +typedef enum RelocSectionId { + /* 0 */ RELOC_SECTION_NULL, + /* 1 */ RELOC_SECTION_TEXT, + /* 2 */ RELOC_SECTION_DATA, + /* 3 */ RELOC_SECTION_RODATA, + /* 4 */ RELOC_SECTION_MAX +} RelocSectionId; + +typedef struct OverlayRelocationSection { + /* 0x00 */ u32 textSize; + /* 0x04 */ u32 dataSize; + /* 0x08 */ u32 rodataSize; + /* 0x0C */ u32 bssSize; + /* 0x10 */ u32 nRelocations; + /* 0x14 */ u32 relocations[1]; // size is nRelocations +} OverlayRelocationSection; // size >= 0x18 + +void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd); +void Overlay_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlRelocs, void* vramStart); +size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd, void* allocatedRamAddr); + +#endif diff --git a/include/map_select_state.h b/include/map_select_state.h new file mode 100644 index 000000000..496a8e8b3 --- /dev/null +++ b/include/map_select_state.h @@ -0,0 +1,54 @@ +#ifndef MAP_SELECT_STATE_H +#define MAP_SELECT_STATE_H + +#include "ultra64.h" +#include "z64game.h" +#include "z64view.h" + +struct MapSelectState; + +typedef struct MapSelectEntry { + /* 0x00 */ char* name; + /* 0x04 */ void (*loadFunc)(struct MapSelectState*, s32); + /* 0x08 */ s32 entranceIndex; +} MapSelectEntry; // size = 0xC + +typedef struct MapSelectState { + /* 0x0000 */ GameState state; + /* 0x00A8 */ View view; + /* 0x01D0 */ s32 sceneTotal; + /* 0x01D4 */ MapSelectEntry* scenes; + /* 0x01D8 */ s32 currentScene; + /* 0x01DC */ s32 pageDownIndex; // Index of pageDownStops + /* 0x01E0 */ s32 pageDownStops[7]; + /* 0x01FC */ s32 topDisplayedScene; // The scene which is currently at the top of the screen + /* 0x0200 */ s32 verticalInputAccumulator; + /* 0x0204 */ s32 verticalInput; + /* 0x0208 */ s32 timerUp; + /* 0x020A */ s32 timerDown; + /* 0x020C */ s32 lockUp; + /* 0x0210 */ s32 lockDown; + /* 0x0214 */ u8 showControls; + /* 0x0218 */ u8 toggleBGM; + /* 0x021A */ u8 isBGMPlaying; + /* 0x021C */ u8 sceneLayer; + /* 0x0220 */ u8 selectedSceneColor; +} MapSelectState; // size = 0x240 + +void MapSelect_Init(GameState* thisx); +void MapSelect_Main(GameState* thisx); +void MapSelect_Draw(MapSelectState* this); +void MapSelect_Destroy(GameState* thisx); +void MapSelect_UpdateMenu(MapSelectState* this); +void MapSelect_DrawMenu(MapSelectState* this); +void MapSelect_DrawLoadingScreen(MapSelectState* this); +void MapSelect_LoadTitle(MapSelectState* this); +void MapSelect_LoadDebugOpening(MapSelectState* this); +void MapSelect_LoadGame(MapSelectState* this, s32 entranceIndex); +void MapSelect_PrintMenu(MapSelectState* this, GfxPrint* printer); +void MapSelect_PrintLoadingMessage(MapSelectState* this, GfxPrint* printer, u8 yPos); +void MapSelect_PrintAgeSetting(MapSelectState* this, GfxPrint* printer, s32 age); +void MapSelect_PrintSceneLayerSetting(MapSelectState* this, GfxPrint* printer); +void MapSelect_PrintControls(MapSelectState* this, GfxPrint* printer); + +#endif diff --git a/include/prenmi_buff.h b/include/prenmi_buff.h new file mode 100644 index 000000000..b0a9e66f7 --- /dev/null +++ b/include/prenmi_buff.h @@ -0,0 +1,25 @@ +#ifndef PRENMI_BUFF_H +#define PRENMI_BUFF_H + +#include "ultra64.h" +#include "alignment.h" + +// This struct is used at osAppNMIBuffer which is not at an 8-byte aligned address. This causes an unaligned access +// crash if the OSTime variables use 64-bit load/store instructions, which is the case in any MIPS ABI other than O32 +// where 64-bit load/store instructions are emulated with 2x 32-bit load/store instructions. The alignment attribute +// conveys that this structure will not always be 8-bytes aligned, allowing a modern compiler to generate non-crashing +// code for accessing these. This is not an issue in the original compiler as it only output O32 ABI code. +ALIGNED(4) typedef struct PreNmiBuff { + /* 0x00 */ u32 resetting; + /* 0x04 */ u32 resetCount; + /* 0x08 */ OSTime duration; + /* 0x10 */ OSTime resetTime; +} PreNmiBuff; // size = 0x18 (actually osAppNMIBuffer is 0x40 bytes large but the rest is unused) + +extern PreNmiBuff* gAppNmiBufferPtr; + +void PreNmiBuff_Init(PreNmiBuff* this); +void PreNmiBuff_SetReset(PreNmiBuff* this); +u32 PreNmiBuff_IsResetting(PreNmiBuff* this); + +#endif diff --git a/include/prenmi_state.h b/include/prenmi_state.h new file mode 100644 index 000000000..3710425ca --- /dev/null +++ b/include/prenmi_state.h @@ -0,0 +1,16 @@ +#ifndef PRENMI_STATE_H +#define PRENMI_STATE_H + +#include "ultra64.h" +#include "z64game.h" + +typedef struct PreNMIState { + /* 0x00 */ GameState state; + /* 0xA4 */ u32 timer; + /* 0xA8 */ s32 unk_A8; +} PreNMIState; // size = 0xAC + +void PreNMI_Init(GameState* thisx); +void PreNMI_Destroy(GameState* thisx); + +#endif diff --git a/include/sample_state.h b/include/sample_state.h new file mode 100644 index 000000000..b568a83f9 --- /dev/null +++ b/include/sample_state.h @@ -0,0 +1,17 @@ +#ifndef SAMPLE_STATE_H +#define SAMPLE_STATE_H + +#include "ultra64.h" +#include "z64game.h" +#include "z64view.h" + +typedef struct SampleState { + /* 0x0000 */ GameState state; + /* 0x00A4 */ u8* staticSegment; + /* 0x00A8 */ View view; +} SampleState; // size = 0x1D0 + +void Sample_Init(GameState* thisx); +void Sample_Destroy(GameState* thisx); + +#endif diff --git a/include/setup_state.h b/include/setup_state.h new file mode 100644 index 000000000..863b71401 --- /dev/null +++ b/include/setup_state.h @@ -0,0 +1,13 @@ +#ifndef SETUP_STATE_H +#define SETUP_STATE_H + +#include "z64game.h" + +typedef struct SetupState { + /* 0x00 */ GameState state; +} SetupState; // size = 0xA4 + +void Setup_Init(GameState* thisx); +void Setup_Destroy(GameState* thisx); + +#endif diff --git a/include/title_setup_state.h b/include/title_setup_state.h new file mode 100644 index 000000000..30219872a --- /dev/null +++ b/include/title_setup_state.h @@ -0,0 +1,15 @@ +#ifndef TITLE_SETUP_STATE_H +#define TITLE_SETUP_STATE_H + +#include "z64game.h" +#include "z64view.h" + +typedef struct TitleSetupState { + /* 0x0000 */ GameState state; + /* 0x00A8 */ View view; +} TitleSetupState; // size = 0x1D0 + +void TitleSetup_Init(GameState* thisx); +void TitleSetup_Destroy(GameState* thisx); + +#endif diff --git a/include/variables.h b/include/variables.h index bb5640042..fedab195c 100644 --- a/include/variables.h +++ b/include/variables.h @@ -78,7 +78,6 @@ extern u32 __osTimerCounter; extern EffectSsOverlay gEffectSsOverlayTable[EFFECT_SS_TYPE_MAX]; extern ActorOverlay gActorOverlayTable[ACTOR_ID_MAX]; // original name: "actor_dlftbls" 801162A0 extern s32 gMaxActorId; // original name: "MaxProfile" -extern GameStateOverlay gGameStateOverlayTable[GAMESTATE_ID_MAX]; extern s32 gZeldaArenaLogSeverity; extern MapData gMapDataTable; extern s16 gSpoilingItems[3]; @@ -163,7 +162,6 @@ extern f32 gBossMarkScale; extern u32 D_8016139C; extern PauseMapMarksData* gLoadedPauseMarkDataTable; -extern PreNmiBuff* gAppNmiBufferPtr; extern Scheduler gScheduler; extern PadMgr gPadMgr; extern IrqMgr gIrqMgr; diff --git a/include/vi_mode.h b/include/vi_mode.h new file mode 100644 index 000000000..89de610a8 --- /dev/null +++ b/include/vi_mode.h @@ -0,0 +1,45 @@ +#ifndef VI_MODE_H +#define VI_MODE_H + +#include "ultra64.h" +#include "libu64/pad.h" +#include "versions.h" + +typedef enum ViModeEditState { +#if OOT_VERSION < PAL_1_0 + /* -2 */ VI_MODE_EDIT_STATE_NEGATIVE_2 = -2, + /* -1 */ VI_MODE_EDIT_STATE_NEGATIVE_1, + /* 0 */ VI_MODE_EDIT_STATE_INACTIVE, + /* 1 */ VI_MODE_EDIT_STATE_2, // active, more adjustments + /* 2 */ VI_MODE_EDIT_STATE_3 // active, more adjustments, print comparison with NTSC LAN1 mode +#else + /* 0 */ VI_MODE_EDIT_STATE_INACTIVE, + /* 1 */ VI_MODE_EDIT_STATE_ACTIVE, + /* 2 */ VI_MODE_EDIT_STATE_2, // active, more adjustments + /* 3 */ VI_MODE_EDIT_STATE_3 // active, more adjustments, print comparison with NTSC LAN1 mode +#endif +} ViModeEditState; + +typedef struct ViMode { + /* 0x00 */ OSViMode customViMode; + /* 0x50 */ s32 viHeight; + /* 0x54 */ s32 viWidth; + /* 0x58 */ s32 rightAdjust; + /* 0x5C */ s32 leftAdjust; + /* 0x60 */ s32 lowerAdjust; + /* 0x64 */ s32 upperAdjust; + /* 0x68 */ s32 editState; + /* 0x6C */ s32 tvType; + /* 0x70 */ u32 loRes; + /* 0x74 */ u32 antialiasOff; + /* 0x78 */ u32 modeN; // Controls interlacing, the meaning of this mode is different based on choice of resolution + /* 0x7C */ u32 fb16Bit; + /* 0x80 */ u32 viFeatures; + /* 0x84 */ u32 unk_84; +} ViMode; // size = 0x88 + +void ViMode_Init(ViMode* viMode); +void ViMode_Destroy(ViMode* viMode); +void ViMode_Update(ViMode* viMode, Input* input); + +#endif diff --git a/include/z64.h b/include/z64.h index 7089ff37c..57d9c8a2f 100644 --- a/include/z64.h +++ b/include/z64.h @@ -73,299 +73,6 @@ #include "libc64/sprintf.h" #include "libu64/debug.h" -typedef struct SetupState { - /* 0x00 */ GameState state; -} SetupState; // size = 0xA4 - -typedef struct ConsoleLogoState { - /* 0x0000 */ GameState state; - /* 0x00A4 */ u8* staticSegment; - /* 0x00A8 */ View view; - /* 0x01D0 */ SramContext sramCtx; - /* 0x01D4 */ s16 timer; // not used in mq dbg (some sort of timer that doesn't seem to affect anything) - /* 0x01D6 */ s16 coverAlpha; - /* 0x01D8 */ s16 addAlpha; - /* 0x01DA */ s16 visibleDuration; - /* 0x01DC */ s16 ult; - /* 0x01DE */ s16 uls; - /* 0x01E0 */ u8 unk_1E0; - /* 0x01E1 */ u8 exit; - /* 0x01E2 */ char unk_1E2[0x06]; -} ConsoleLogoState; // size = 0x1E8 - -typedef struct DebugOpeningState { - GameState state; - View view; - s32 currentOption; - char* controlGuideString; - u8 page; - SkyboxContext skyboxCtx; - EnvironmentContext envCtx; -} DebugOpeningState; - -// vvv IS_MAP_SELECT_ENABLED vvv -struct MapSelectState; - -typedef struct SceneSelectEntry { - /* 0x00 */ char* name; - /* 0x04 */ void (*loadFunc)(struct MapSelectState*, s32); - /* 0x08 */ s32 entranceIndex; -} SceneSelectEntry; // size = 0xC - -typedef struct MapSelectState { - /* 0x0000 */ GameState state; - /* 0x00A8 */ View view; - /* 0x01D0 */ s32 sceneTotal; - /* 0x01D4 */ SceneSelectEntry* scenes; - /* 0x01D8 */ s32 currentScene; - /* 0x01DC */ s32 pageDownIndex; // Index of pageDownStops - /* 0x01E0 */ s32 pageDownStops[7]; - /* 0x01FC */ s32 topDisplayedScene; // The scene which is currently at the top of the screen - /* 0x0200 */ s32 verticalInputAccumulator; - /* 0x0204 */ s32 verticalInput; - /* 0x0208 */ s32 timerUp; - /* 0x020A */ s32 timerDown; - /* 0x020C */ s32 lockUp; - /* 0x0210 */ s32 lockDown; - /* 0x0214 */ u8 showControls; - /* 0x0218 */ u8 toggleBGM; - /* 0x021A */ u8 isBGMPlaying; - /* 0x021C */ u8 sceneLayer; - /* 0x0220 */ u8 selectedSceneColor; -} MapSelectState; // size = 0x240 - -// ^^^ IS_MAP_SELECT_ENABLED ^^^ - -typedef struct SampleState { - /* 0x0000 */ GameState state; - /* 0x00A4 */ u8* staticSegment; - /* 0x00A8 */ View view; -} SampleState; // size = 0x1D0 - -typedef enum PauseBgPreRenderState { - /* 0 */ PAUSE_BG_PRERENDER_OFF, // Inactive, do nothing. - /* 1 */ PAUSE_BG_PRERENDER_SETUP, // The current frame is only drawn for the purpose of serving as the pause background. - /* 2 */ PAUSE_BG_PRERENDER_PROCESS, // The previous frame was PAUSE_BG_PRERENDER_SETUP, now apply prerender filters. - /* 3 */ PAUSE_BG_PRERENDER_READY, // The pause background is ready to be used. - /* 4 */ PAUSE_BG_PRERENDER_MAX -} PauseBgPreRenderState; - -typedef enum TransitionTileState { - /* 0 */ TRANS_TILE_OFF, // Inactive, do nothing - /* 1 */ TRANS_TILE_SETUP, // Save the necessary buffers - /* 2 */ TRANS_TILE_PROCESS, // Initialize the transition - /* 3 */ TRANS_TILE_READY // The transition is ready, so will update and draw each frame -} TransitionTileState; - -typedef struct TitleSetupState { - /* 0x0000 */ GameState state; - /* 0x00A8 */ View view; -} TitleSetupState; // size = 0x1D0 - -typedef struct FileSelectState { - /* 0x00000 */ GameState state; - /* 0x000A4 */ Vtx* windowVtx; - /* 0x000A8 */ u8* staticSegment; - /* 0x000AC */ u8* parameterSegment; -#if OOT_PAL - /* 0x000B0 */ u8* objectMagSegment; -#endif - /* 0x000B8 */ View view; - /* 0x001E0 */ SramContext sramCtx; - /* 0x001E4 */ char unk_1E4[0x4]; - /* 0x001E8 */ SkyboxContext skyboxCtx; - /* 0x00348 */ MessageContext msgCtx; - /* 0x0E760 */ Font font; - /* 0x1C8E8 */ EnvironmentContext envCtx; - /* 0x1C9E4 */ char unk_1C9E4[0x4]; - /* 0x1C9E8 */ Vtx* windowContentVtx; - /* 0x1C9EC */ Vtx* keyboardVtx; - /* 0x1C9F0 */ Vtx* nameEntryVtx; - /* 0x1C9F4 */ u8 n64ddFlag; - /* 0x1C9F6 */ u16 deaths[3]; - /* 0x1C9FC */ u8 fileNames[3][8]; - /* 0x1CA14 */ u16 healthCapacities[3]; - /* 0x1CA1C */ u32 questItems[3]; - /* 0x1CA28 */ s16 n64ddFlags[3]; - /* 0x1CA2E */ s8 defense[3]; -#if OOT_PAL - /* 0x1CA32 */ u16 health[3]; -#endif - /* 0x1CA38 */ s16 buttonIndex; - /* 0x1CA3A */ s16 confirmButtonIndex; // 0: yes, 1: quit - /* 0x1CA3C */ s16 menuMode; - /* 0x1CA3E */ s16 configMode; - /* 0x1CA40 */ s16 prevConfigMode; - /* 0x1CA42 */ s16 nextConfigMode; - /* 0x1CA44 */ s16 selectMode; - /* 0x1CA46 */ s16 selectedFileIndex; - /* 0x1CA48 */ char unk_1CA48[0x2]; - /* 0x1CA4A */ s16 fileNamesY[3]; - /* 0x1CA50 */ s16 actionTimer; - /* 0x1CA52 */ s16 buttonYOffsets[6]; - /* 0x1CA5E */ s16 copyDestFileIndex; - /* 0x1CA60 */ s16 warningLabel; - /* 0x1CA62 */ s16 warningButtonIndex; - /* 0x1CA64 */ s16 titleLabel; - /* 0x1CA66 */ s16 nextTitleLabel; - /* 0x1CA68 */ s16 windowColor[3]; - /* 0x1CA6E */ s16 titleAlpha[2]; - /* 0x1CA72 */ s16 windowAlpha; - /* 0x1CA74 */ s16 fileButtonAlpha[3]; - /* 0x1CA7A */ s16 nameBoxAlpha[3]; - /* 0x1CA80 */ s16 nameAlpha[3]; - /* 0x1CA86 */ s16 connectorAlpha[3]; - /* 0x1CA8C */ s16 fileInfoAlpha[3]; - /* 0x1CA92 */ s16 actionButtonAlpha[4]; // also contains the alphas for the confirm buttons - /* 0x1CA9A */ s16 optionButtonAlpha; - /* 0x1CA9C */ s16 nameEntryBoxAlpha; - /* 0x1CA9E */ s16 controlsAlpha; - /* 0x1CAA0 */ s16 emptyFileTextAlpha; - /* 0x1CAA2 */ s16 highlightColor[4]; - /* 0x1CAAA */ s16 highlightPulseDir; // 0 fade out, 1 fade in - /* 0x1CAAC */ s16 unk_1CAAC; // initialized but never used - /* 0x1CAAE */ s16 confirmButtonTexIndices[2]; - /* 0x1CAB2 */ s16 inputTimerX; - /* 0x1CAB4 */ s16 inputTimerY; - /* 0x1CAB6 */ s16 stickXDir; - /* 0x1CAB8 */ s16 stickYDir; - /* 0x1CABA */ s16 stickAdjX; - /* 0x1CABC */ s16 stickAdjY; - /* 0x1CABE */ s16 nameEntryBoxPosX; - /* 0x1CAC0 */ s16 windowPosX; - /* 0x1CAC4 */ f32 windowRot; - /* 0x1CAC8 */ s16 kbdButton; // only for buttons, not characters - /* 0x1CACA */ s16 charPage; // 0: hiragana, 1: katakana, 2: alphabet - /* 0x1CACC */ s16 charBgAlpha; // square shape the letter sits in - /* 0x1CACE */ s16 charIndex; // 0 - 64, top left to bottom right - /* 0x1CAD0 */ s16 kbdX; // (0, 0) is top left character - /* 0x1CAD2 */ s16 kbdY; - /* 0x1CAD4 */ s16 newFileNameCharCount; - /* 0x1CAD6 */ s16 unk_1CAD6[5]; -} FileSelectState; // size = 0x1CAE0 - -typedef struct GameStateOverlay { - /* 0x00 */ void* loadedRamAddr; - /* 0x04 */ RomFile file; // if applicable - /* 0x0C */ void* vramStart; // if applicable - /* 0x10 */ void* vramEnd; // if applicable - /* 0x14 */ void* unk_14; - /* 0x18 */ void* init; // initializes and executes the given context - /* 0x1C */ void* destroy; // deconstructs the context, and sets the next context to load - /* 0x20 */ void* unk_20; - /* 0x24 */ void* unk_24; - /* 0x28 */ UNK_TYPE4 unk_28; - /* 0x2C */ u32 instanceSize; -} GameStateOverlay; // size = 0x30 - -typedef struct PreNMIState { - /* 0x00 */ GameState state; - /* 0xA4 */ u32 timer; - /* 0xA8 */ UNK_TYPE4 unk_A8; -} PreNMIState; // size = 0xAC - -typedef struct ISVDbg { - /* 0x00 */ u32 magic; // IS64 - /* 0x04 */ u32 get; - /* 0x08 */ u8 unk_08[0x14-0x08]; - /* 0x14 */ u32 put; - /* 0x18 */ u8 unk_18[0x20-0x18]; - /* 0x20 */ u8 data[0x10000-0x20]; -} ISVDbg; - -typedef struct LocaleCartInfo { - /* 0x00 */ char name[0x18]; - /* 0x18 */ u32 mediaFormat; - /* 0x1C */ union { - struct { - u16 cartId; - u8 countryCode; - u8 version; - }; - u32 regionInfo; - }; -} LocaleCartInfo; // size = 0x20 - -typedef struct Yaz0Header { - /* 0x00 */ char magic[4]; // Yaz0 - /* 0x04 */ u32 decSize; - /* 0x08 */ u32 compInfoOffset; // only used in mio0 - /* 0x0C */ u32 uncompDataOffset; // only used in mio0 -} Yaz0Header; // size = 0x10 - -/* Relocation entry field getters */ -#define RELOC_SECTION(reloc) ((reloc) >> 30) -#define RELOC_OFFSET(reloc) ((reloc) & 0xFFFFFF) -#define RELOC_TYPE_MASK(reloc) ((reloc) & 0x3F000000) -#define RELOC_TYPE_SHIFT 24 - -/* MIPS Relocation Types, matches the MIPS ELF spec */ -#define R_MIPS_32 2 -#define R_MIPS_26 4 -#define R_MIPS_HI16 5 -#define R_MIPS_LO16 6 - -/* Reloc section id, must fit in 2 bits otherwise the relocation format must be modified */ -typedef enum RelocSectionId { - /* 0 */ RELOC_SECTION_NULL, - /* 1 */ RELOC_SECTION_TEXT, - /* 2 */ RELOC_SECTION_DATA, - /* 3 */ RELOC_SECTION_RODATA, - /* 4 */ RELOC_SECTION_MAX -} RelocSectionId; - -typedef struct OverlayRelocationSection { - /* 0x00 */ u32 textSize; - /* 0x04 */ u32 dataSize; - /* 0x08 */ u32 rodataSize; - /* 0x0C */ u32 bssSize; - /* 0x10 */ u32 nRelocations; - /* 0x14 */ u32 relocations[1]; // size is nRelocations -} OverlayRelocationSection; // size >= 0x18 - -// This struct is used at osAppNMIBuffer which is not at an 8-byte aligned address. This causes an unaligned access -// crash if the OSTime variables use 64-bit load/store instructions, which is the case in any MIPS ABI other than O32 -// where 64-bit load/store instructions are emulated with 2x 32-bit load/store instructions. The alignment attribute -// conveys that this structure will not always be 8-bytes aligned, allowing a modern compiler to generate non-crashing -// code for accessing these. This is not an issue in the original compiler as it only output O32 ABI code. -ALIGNED(4) typedef struct PreNmiBuff { - /* 0x00 */ u32 resetting; - /* 0x04 */ u32 resetCount; - /* 0x08 */ OSTime duration; - /* 0x10 */ OSTime resetTime; -} PreNmiBuff; // size = 0x18 (actually osAppNMIBuffer is 0x40 bytes large but the rest is unused) - -typedef enum ViModeEditState { -#if OOT_VERSION < PAL_1_0 - /* -2 */ VI_MODE_EDIT_STATE_NEGATIVE_2 = -2, - /* -1 */ VI_MODE_EDIT_STATE_NEGATIVE_1, - /* 0 */ VI_MODE_EDIT_STATE_INACTIVE, - /* 1 */ VI_MODE_EDIT_STATE_2, // active, more adjustments - /* 2 */ VI_MODE_EDIT_STATE_3 // active, more adjustments, print comparison with NTSC LAN1 mode -#else - /* 0 */ VI_MODE_EDIT_STATE_INACTIVE, - /* 1 */ VI_MODE_EDIT_STATE_ACTIVE, - /* 2 */ VI_MODE_EDIT_STATE_2, // active, more adjustments - /* 3 */ VI_MODE_EDIT_STATE_3 // active, more adjustments, print comparison with NTSC LAN1 mode -#endif -} ViModeEditState; - -typedef struct ViMode { - /* 0x00 */ OSViMode customViMode; - /* 0x50 */ s32 viHeight; - /* 0x54 */ s32 viWidth; - /* 0x58 */ s32 rightAdjust; - /* 0x5C */ s32 leftAdjust; - /* 0x60 */ s32 lowerAdjust; - /* 0x64 */ s32 upperAdjust; - /* 0x68 */ s32 editState; - /* 0x6C */ s32 tvType; - /* 0x70 */ u32 loRes; - /* 0x74 */ u32 antialiasOff; - /* 0x78 */ u32 modeN; // Controls interlacing, the meaning of this mode is different based on choice of resolution - /* 0x7C */ u32 fb16Bit; - /* 0x80 */ u32 viFeatures; - /* 0x84 */ u32 unk_84; -} ViMode; // size = 0x88 +// TODO: include all files listed above into the right place, and then delete this file. #endif diff --git a/include/z64game.h b/include/z64game.h index e2d9275fd..c6cbd69f0 100644 --- a/include/z64game.h +++ b/include/z64game.h @@ -5,6 +5,7 @@ #include "ultra64/ultratypes.h" #include "libu64/pad.h" #include "gamealloc.h" +#include "romfile.h" #include "tha.h" #include "config.h" @@ -21,6 +22,22 @@ typedef enum GameStateId { #undef DEFINE_GAMESTATE #undef DEFINE_GAMESTATE_INTERNAL +typedef struct GameStateOverlay { + /* 0x00 */ void* loadedRamAddr; + /* 0x04 */ RomFile file; // if applicable + /* 0x0C */ void* vramStart; // if applicable + /* 0x10 */ void* vramEnd; // if applicable + /* 0x14 */ void* unk_14; + /* 0x18 */ void* init; + /* 0x1C */ void* destroy; + /* 0x20 */ void* unk_20; + /* 0x24 */ void* unk_24; + /* 0x28 */ s32 unk_28; + /* 0x2C */ u32 instanceSize; +} GameStateOverlay; // size = 0x30 + +extern GameStateOverlay gGameStateOverlayTable[GAMESTATE_ID_MAX]; + struct GameState; typedef void (*GameStateFunc)(struct GameState* gameState); diff --git a/include/z64play.h b/include/z64play.h index 7073dbff4..93d59b707 100644 --- a/include/z64play.h +++ b/include/z64play.h @@ -33,6 +33,21 @@ struct Player; struct QuestHintCmd; struct VisMono; +typedef enum PauseBgPreRenderState { + /* 0 */ PAUSE_BG_PRERENDER_OFF, // Inactive, do nothing. + /* 1 */ PAUSE_BG_PRERENDER_SETUP, // The current frame is only drawn for the purpose of serving as the pause background. + /* 2 */ PAUSE_BG_PRERENDER_PROCESS, // The previous frame was PAUSE_BG_PRERENDER_SETUP, now apply prerender filters. + /* 3 */ PAUSE_BG_PRERENDER_READY, // The pause background is ready to be used. + /* 4 */ PAUSE_BG_PRERENDER_MAX +} PauseBgPreRenderState; + +typedef enum TransitionTileState { + /* 0 */ TRANS_TILE_OFF, // Inactive, do nothing + /* 1 */ TRANS_TILE_SETUP, // Save the necessary buffers + /* 2 */ TRANS_TILE_PROCESS, // Initialize the transition + /* 3 */ TRANS_TILE_READY // The transition is ready, so will update and draw each frame +} TransitionTileState; + typedef struct SceneSequences { /* 0x00 */ u8 seqId; /* 0x01 */ u8 natureAmbienceId; @@ -129,8 +144,6 @@ void Play_SetViewpoint(PlayState* this, s16 viewpoint); s32 Play_CheckViewpoint(PlayState* this, s16 viewpoint); void Play_SetShopBrowsingViewpoint(PlayState* this); Gfx* Play_SetFog(PlayState* this, Gfx* gfx); -void Play_Destroy(GameState* thisx); -void Play_Init(GameState* thisx); void Play_Main(GameState* thisx); int Play_InCsMode(PlayState* this); f32 func_800BFCB8(PlayState* this, MtxF* mf, Vec3f* pos); @@ -158,11 +171,27 @@ int Play_CamIsNotFixed(PlayState* this); s32 func_800C0D34(PlayState* this, Actor* actor, s16* yaw); s32 func_800C0DB4(PlayState* this, Vec3f* pos); +void Play_Init(GameState* thisx); +void Play_Destroy(GameState* thisx); + #if ENABLE_CUTSCENE_IMPROVEMENTS u16 Play_GetActorCsCamSetting(PlayState* this, s32 csCamDataIndex); Vec3s* Play_GetActorCsCamFuncData(PlayState* this, s32 csCamDataIndex); #endif +#if ENABLE_MOTION_BLUR +void Play_DrawMotionBlur(PlayState* this); +void Play_InitMotionBlur(PlayState* this); +void Play_DestroyMotionBlur(void); +void Play_SetMotionBlurPriorityAlpha(u32 alpha); +void Play_EnableMotionBlurPriority(u32 alpha); +void Play_DisableMotionBlurPriority(void); +#endif + +void Play_SetMotionBlurAlpha(u32 alpha); +void Play_EnableMotionBlur(u32 alpha); +void Play_DisableMotionBlur(void); + #if DEBUG_FEATURES extern void* gDebugCutsceneScript; #endif diff --git a/src/boot/is_debug.c b/src/boot/is_debug.c index 5415b8a7b..1f8938f9d 100644 --- a/src/boot/is_debug.c +++ b/src/boot/is_debug.c @@ -1,5 +1,14 @@ #include "global.h" +typedef struct ISVDbg { + /* 0x00 */ u32 magic; // "IS64" + /* 0x04 */ u32 get; + /* 0x08 */ u8 unk_08[0xC]; + /* 0x14 */ u32 put; + /* 0x18 */ u8 unk_18[0x8]; + /* 0x20 */ u8 data[0xFFE0]; +} ISVDbg; // size = 0x10000 + #define gISVDbgPrnAdrs ((ISVDbg*)0xB3FF0000) #define ASCII_TO_U32(a, b, c, d) ((u32)((a << 24) | (b << 16) | (c << 8) | (d << 0))) diff --git a/src/boot/z_locale.c b/src/boot/z_locale.c index a8e048ae7..cec845546 100644 --- a/src/boot/z_locale.c +++ b/src/boot/z_locale.c @@ -6,6 +6,19 @@ s32 gCurrentRegion = 0; +typedef struct LocaleCartInfo { + /* 0x00 */ char name[0x18]; + /* 0x18 */ u32 mediaFormat; + /* 0x1C */ union { + struct { + u16 cartId; + u8 countryCode; + u8 version; + }; + u32 regionInfo; + }; +} LocaleCartInfo; // size = 0x20 + void Locale_Init(void) { #if !PLATFORM_GC ALIGNED(4) u8 regionInfo[4]; diff --git a/src/boot/z_std_dma.c b/src/boot/z_std_dma.c index 813b4e415..2befc1391 100644 --- a/src/boot/z_std_dma.c +++ b/src/boot/z_std_dma.c @@ -34,7 +34,7 @@ #include "global.h" #pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ - "ntsc-1.2:20 pal-1.0:18 pal-1.1:18" + "ntsc-1.2:76 pal-1.0:74 pal-1.1:74" StackEntry sDmaMgrStackInfo; OSMesgQueue sDmaMgrMsgQueue; diff --git a/src/code/fault_gc.c b/src/code/fault_gc.c index 6f43a7c4e..67ac8e065 100644 --- a/src/code/fault_gc.c +++ b/src/code/fault_gc.c @@ -40,8 +40,8 @@ * DPad-Up may be pressed to enable sending fault pages over osSyncPrintf as well as displaying them on-screen. * DPad-Down disables sending fault pages over osSyncPrintf. */ -#pragma increment_block_number "gc-eu:96 gc-eu-mq:96 gc-eu-mq-dbg:96 gc-jp:112 gc-jp-ce:112 gc-jp-mq:112 gc-us:112" \ - "gc-us-mq:112 ique-cn:112" +#pragma increment_block_number "gc-eu:160 gc-eu-mq:160 gc-eu-mq-dbg:160 gc-jp:160 gc-jp-ce:160 gc-jp-mq:160 gc-us:160" \ + "gc-us-mq:160 ique-cn:160" #include "global.h" #include "libc64/sleep.h" diff --git a/src/code/fault_n64.c b/src/code/fault_n64.c index ecfc87f10..feb884716 100644 --- a/src/code/fault_n64.c +++ b/src/code/fault_n64.c @@ -13,7 +13,7 @@ #include "macros.h" #include "global.h" -#pragma increment_block_number "ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128" +#pragma increment_block_number "ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192" typedef struct FaultMgr { OSThread thread; diff --git a/src/code/game.c b/src/code/game.c index 10d21f42d..b835a3a0f 100644 --- a/src/code/game.c +++ b/src/code/game.c @@ -18,6 +18,7 @@ #include "speed_meter.h" #include "terminal.h" #include "versions.h" +#include "vi_mode.h" #include "z64debug.h" #include "z64game.h" #include "z64vis.h" diff --git a/src/code/graph.c b/src/code/graph.c index 35357ffb5..4c05e86b7 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -1,16 +1,25 @@ #include "libc64/malloc.h" #include "libc64/sprintf.h" #include "libu64/debug.h" + +#include "console_logo_state.h" #include "buffers.h" #include "gfx.h" #include "fault.h" +#include "file_select_state.h" #include "line_numbers.h" +#include "map_select_state.h" +#include "prenmi_buff.h" +#include "prenmi_state.h" #include "regs.h" +#include "setup_state.h" #include "sys_ucode.h" +#include "title_setup_state.h" #include "terminal.h" #include "ucode_disas.h" #include "versions.h" #include "z64save.h" +#include "z64play.h" #include "macros.h" #include "global.h" @@ -18,8 +27,8 @@ #define GFXPOOL_HEAD_MAGIC 0x1234 #define GFXPOOL_TAIL_MAGIC 0x5678 -#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.0:192" \ - "ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192" +#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.0:224" \ + "ntsc-1.1:224 ntsc-1.2:224 pal-1.0:224 pal-1.1:224" /** * The time at which the previous `Graph_Update` ended. diff --git a/src/code/main.c b/src/code/main.c index d2feaf499..804a1938b 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -14,6 +14,7 @@ extern struct IrqMgr gIrqMgr; #include "debug_arena.h" #include "fault.h" +#include "prenmi_buff.h" #include "segmented_address.h" #include "stack.h" #include "terminal.h" @@ -27,8 +28,8 @@ extern struct IrqMgr gIrqMgr; #include "global.h" -#pragma increment_block_number "gc-eu:96 gc-eu-mq:96 gc-jp:96 gc-jp-ce:96 gc-jp-mq:96 gc-us:96 gc-us-mq:96 ique-cn:96" \ - "ntsc-1.0:79 ntsc-1.1:79 ntsc-1.2:79 pal-1.0:77 pal-1.1:77" +#pragma increment_block_number "gc-eu:144 gc-eu-mq:144 gc-jp:144 gc-jp-ce:144 gc-jp-mq:144 gc-us:144 gc-us-mq:144" \ + "ique-cn:144 ntsc-1.0:129 ntsc-1.1:129 ntsc-1.2:129 pal-1.0:127 pal-1.1:127" extern u8 _buffersSegmentEnd[]; diff --git a/src/code/title_setup.c b/src/code/title_setup.c index fcc6eaa23..8234a562b 100644 --- a/src/code/title_setup.c +++ b/src/code/title_setup.c @@ -1,4 +1,7 @@ +#include "setup_state.h" + #include "global.h" +#include "console_logo_state.h" void Setup_InitImpl(SetupState* this) { PRINTF(T("ゼルダ共通データ初期化\n", "Zelda common data initialization\n")); diff --git a/src/code/z_DLF.c b/src/code/z_DLF.c index f56fcc742..7934b7745 100644 --- a/src/code/z_DLF.c +++ b/src/code/z_DLF.c @@ -1,3 +1,5 @@ +#include "libu64/overlay.h" + #include "global.h" #include "terminal.h" diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 42efb8787..fed73e75e 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1,4 +1,5 @@ #include "libc64/math64.h" +#include "libu64/overlay.h" #include "fault.h" #include "gfx.h" #include "gfx_setupdl.h" diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index b0a5abf48..68622986e 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -11,7 +11,7 @@ #include "z64player.h" #include "z64skin_matrix.h" -#pragma increment_block_number "ntsc-1.0:184 ntsc-1.1:184 ntsc-1.2:184" +#pragma increment_block_number "ntsc-1.0:176 ntsc-1.1:176 ntsc-1.2:176" u16 DynaSSNodeList_GetNextNodeIdx(DynaSSNodeList* nodeList); void BgCheck_GetStaticLookupIndicesFromPos(CollisionContext* colCtx, Vec3f* pos, Vec3i* sector); diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 4546f59d9..f65b83509 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -8,8 +8,8 @@ #include "overlays/actors/ovl_En_Horse/z_en_horse.h" #include "config.h" -#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" \ - "ique-cn:192 ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192" +#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 ique-cn:0" \ + "ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0" s16 Camera_RequestSettingImpl(Camera* camera, s16 requestedSetting, s16 flags); s32 Camera_RequestModeImpl(Camera* camera, s16 requestedMode, u8 forceModeChange); @@ -3640,7 +3640,7 @@ s32 Camera_KeepOn3(Camera* camera) { } #pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ - "ique-cn:128 ntsc-1.0:118 ntsc-1.1:118 ntsc-1.2:118 pal-1.0:116 pal-1.1:116" + "ique-cn:128 ntsc-1.0:109 ntsc-1.1:109 ntsc-1.2:109 pal-1.0:107 pal-1.1:107" s32 Camera_KeepOn4(Camera* camera) { static Vec3f D_8015BD50; diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 154d83af1..c4d39ab26 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -15,7 +15,7 @@ #include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h" #include "z_lib.h" -#pragma increment_block_number "ique-cn:0 ntsc-1.0:232 ntsc-1.1:232 ntsc-1.2:232 pal-1.0:232 pal-1.1:232" +#pragma increment_block_number "ique-cn:0 ntsc-1.0:224 ntsc-1.1:224 ntsc-1.2:224 pal-1.0:224 pal-1.1:224" typedef s32 (*ColChkResetFunc)(PlayState*, Collider*); typedef void (*ColChkApplyFunc)(PlayState*, CollisionCheckContext*, Collider*); diff --git a/src/code/z_common_data.c b/src/code/z_common_data.c index d9077faef..ff4842024 100644 --- a/src/code/z_common_data.c +++ b/src/code/z_common_data.c @@ -7,8 +7,8 @@ #include "global.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.0:176" \ - "ntsc-1.1:176 ntsc-1.2:176 pal-1.0:192 pal-1.1:192" +#pragma increment_block_number "gc-eu:64 gc-eu-mq:64 gc-jp:64 gc-jp-ce:64 gc-jp-mq:64 gc-us:64 gc-us-mq:64" \ + "ntsc-1.0:176 ntsc-1.1:176 ntsc-1.2:176 pal-1.0:192 pal-1.1:192" ALIGNED(16) SaveContext gSaveContext; #if PLATFORM_IQUE diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 1a569bed9..d1d7855b4 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -1,4 +1,4 @@ -#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 ique-cn:0" \ +#pragma increment_block_number "gc-eu:0 gc-eu-mq:128 gc-jp:0 gc-jp-ce:0 gc-jp-mq:128 gc-us:0 gc-us-mq:128 ique-cn:0" \ "ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0" #include "global.h" @@ -150,8 +150,8 @@ u16 gCamAtSplinePointsAppliedFrame; u16 gCamEyePointAppliedFrame; u16 gCamAtPointAppliedFrame; -#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ - "ique-cn:128 ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0" +#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 ique-cn:0" \ + "ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128" // Cam ID to return to when a scripted cutscene is finished s16 sReturnToCamId; diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c index 9a3df7eef..d424191d2 100644 --- a/src/code/z_effect_soft_sprite.c +++ b/src/code/z_effect_soft_sprite.c @@ -1,3 +1,4 @@ +#include "libu64/overlay.h" #include "global.h" #include "terminal.h" diff --git a/src/code/z_game_dlftbls.c b/src/code/z_game_dlftbls.c index 2cad84089..95969c291 100644 --- a/src/code/z_game_dlftbls.c +++ b/src/code/z_game_dlftbls.c @@ -1,3 +1,10 @@ +#include "setup_state.h" +#include "map_select_state.h" +#include "console_logo_state.h" +#include "z64play.h" +#include "title_setup_state.h" +#include "file_select_state.h" + #include "global.h" // Linker symbol declarations (used in the table below) diff --git a/src/code/z_kaleido_manager.c b/src/code/z_kaleido_manager.c index 42ec59fd0..e1d7f5529 100644 --- a/src/code/z_kaleido_manager.c +++ b/src/code/z_kaleido_manager.c @@ -1,3 +1,5 @@ +#include "libu64/overlay.h" + #include "global.h" #include "terminal.h" diff --git a/src/code/z_kaleido_scope_call.c b/src/code/z_kaleido_scope_call.c index f1017342a..35e14433a 100644 --- a/src/code/z_kaleido_scope_call.c +++ b/src/code/z_kaleido_scope_call.c @@ -1,5 +1,5 @@ -#pragma increment_block_number "gc-eu:160 gc-eu-mq:160 gc-jp:160 gc-jp-ce:160 gc-jp-mq:160 gc-us:160 gc-us-mq:160" \ - "ique-cn:160 ntsc-1.0:160 ntsc-1.1:160 ntsc-1.2:160 pal-1.0:160 pal-1.1:160" +#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" \ + "ique-cn:192 ntsc-1.0:224 ntsc-1.1:224 ntsc-1.2:224 pal-1.0:224 pal-1.1:224" #include "libu64/debug.h" #include "kaleido_manager.h" diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index fd864e8fd..6da51ed68 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -236,7 +236,7 @@ s16 sSunDepthTestX; s16 sSunDepthTestY; #pragma increment_block_number "gc-eu:160 gc-eu-mq:160 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ - "ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:192 pal-1.1:192" + "ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:160 pal-1.1:160" LightNode* sNGameOverLightNode; LightInfo sNGameOverLightInfo; diff --git a/src/code/z_map_mark.c b/src/code/z_map_mark.c index 72b2f1081..7c9cc6164 100644 --- a/src/code/z_map_mark.c +++ b/src/code/z_map_mark.c @@ -1,4 +1,5 @@ #include "libu64/debug.h" +#include "libu64/overlay.h" #include "regs.h" #include "romfile.h" #include "segment_symbols.h" diff --git a/src/code/z_message.c b/src/code/z_message.c index 63e1fd796..e0355409f 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -24,7 +24,7 @@ #include "assets/textures/parameter_static/parameter_static.h" #pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ - "ntsc-1.0:144 ntsc-1.1:144 ntsc-1.2:144 pal-1.0:128 pal-1.1:128" + "ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:128 pal-1.1:128" #if !PLATFORM_IQUE #define MSG_BUF_DECODED (msgCtx->msgBufDecoded) diff --git a/src/code/z_play.c b/src/code/z_play.c index 65bd20226..61305f381 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -3,6 +3,7 @@ #include "controller.h" #include "fault.h" #include "config.h" +#include "file_select_state.h" #include "gfx.h" #include "gfxalloc.h" #include "kaleido_manager.h" @@ -21,6 +22,7 @@ #include "sys_math3d.h" #include "sys_matrix.h" #include "terminal.h" +#include "title_setup_state.h" #include "versions.h" #include "zelda_arena.h" #include "z64cutscene_flags.h" @@ -40,7 +42,7 @@ #include "global.h" #pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ - "ique-cn:192 ntsc-1.0:96 ntsc-1.1:96 ntsc-1.2:96 pal-1.0:96 pal-1.1:96" + "ique-cn:192 ntsc-1.0:144 ntsc-1.1:144 ntsc-1.2:144 pal-1.0:144 pal-1.1:144" TransitionTile gTransitionTile; s32 gTransitionTileState; diff --git a/src/code/z_prenmi.c b/src/code/z_prenmi.c index 2d118fa39..3f52ff3ac 100644 --- a/src/code/z_prenmi.c +++ b/src/code/z_prenmi.c @@ -1,3 +1,5 @@ +#include "prenmi_state.h" + #include "global.h" #include "terminal.h" #include "versions.h" diff --git a/src/code/z_prenmi_buff.c b/src/code/z_prenmi_buff.c index c00d0513c..17ef0b78c 100644 --- a/src/code/z_prenmi_buff.c +++ b/src/code/z_prenmi_buff.c @@ -1,3 +1,4 @@ +#include "prenmi_buff.h" #include "global.h" #define COLD_RESET 0 diff --git a/src/code/z_sample.c b/src/code/z_sample.c index b6843823a..85cce033d 100644 --- a/src/code/z_sample.c +++ b/src/code/z_sample.c @@ -1,3 +1,5 @@ +#include "sample_state.h" + #include "global.h" void Sample_HandleStateChange(SampleState* this) { diff --git a/src/code/z_sram.c b/src/code/z_sram.c index ee7743b5e..79845f171 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -1,3 +1,4 @@ +#include "file_select_state.h" #include "global.h" #include "terminal.h" #include "versions.h" diff --git a/src/code/z_vimode.c b/src/code/z_vimode.c index 0d2f5716f..668e9648e 100644 --- a/src/code/z_vimode.c +++ b/src/code/z_vimode.c @@ -1,3 +1,5 @@ +#include "vi_mode.h" + #include "global.h" #include "ultra64/viint.h" #include "versions.h" diff --git a/src/compression/yaz0.c b/src/compression/yaz0.c index cc4d6a17a..e2e1b464c 100644 --- a/src/compression/yaz0.c +++ b/src/compression/yaz0.c @@ -52,6 +52,13 @@ void* Yaz0_NextDMA(u8* curSrcPos) { return dst; } +typedef struct Yaz0Header { + /* 0x00 */ char magic[4]; // Yaz0 + /* 0x04 */ u32 decSize; + /* 0x08 */ u32 compInfoOffset; // only used in mio0 + /* 0x0C */ u32 uncompDataOffset; // only used in mio0 +} Yaz0Header; // size = 0x10 + void Yaz0_DecompressImpl(u8* src, u8* dst) { Yaz0Header* header = (Yaz0Header*)src; u32 bitIdx = 0; diff --git a/src/libu64/load_gc.c b/src/libu64/load_gc.c index 39662cbce..8d1ff315c 100644 --- a/src/libu64/load_gc.c +++ b/src/libu64/load_gc.c @@ -1,3 +1,5 @@ +#include "libu64/overlay.h" + #include "global.h" size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd, void* allocatedRamAddr) { diff --git a/src/libu64/loadfragment2_gc.c b/src/libu64/loadfragment2_gc.c index 6befb8c9b..477b7d1c2 100644 --- a/src/libu64/loadfragment2_gc.c +++ b/src/libu64/loadfragment2_gc.c @@ -1,3 +1,5 @@ +#include "libu64/overlay.h" + #include "global.h" void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd) { diff --git a/src/libu64/loadfragment2_n64.c b/src/libu64/loadfragment2_n64.c index 6a06b1ba0..b3d7751d8 100644 --- a/src/libu64/loadfragment2_n64.c +++ b/src/libu64/loadfragment2_n64.c @@ -6,6 +6,8 @@ * * @see Overlay_Relocate */ +#include "libu64/overlay.h" + #include "global.h" s32 gOverlayLogSeverity = 2; diff --git a/src/libu64/relocation_gc.c b/src/libu64/relocation_gc.c index 1d2f3193d..a2961bcc5 100644 --- a/src/libu64/relocation_gc.c +++ b/src/libu64/relocation_gc.c @@ -6,6 +6,8 @@ * * @see Overlay_Relocate */ +#include "libu64/overlay.h" + #include "global.h" // Extract MIPS register rs from an instruction word diff --git a/src/n64dd/z_n64dd.c b/src/n64dd/z_n64dd.c index 864b67d82..1b6934f50 100644 --- a/src/n64dd/z_n64dd.c +++ b/src/n64dd/z_n64dd.c @@ -8,7 +8,7 @@ #include "line_numbers.h" #include "z64thread.h" -#pragma increment_block_number "ntsc-1.0:64 ntsc-1.1:64 ntsc-1.2:64 pal-1.0:64 pal-1.1:64" +#pragma increment_block_number "ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128" typedef struct struct_801D9C30 { /* 0x000 */ s32 unk_000; // disk start diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 3bf7e4b96..f0e1656fa 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -29,7 +29,7 @@ #include "assets/overlays/ovl_Boss_Ganon2/ovl_Boss_Ganon2.h" #pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ - "ique-cn:128" + "ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/src/overlays/gamestates/ovl_debug_opening/debug_opening.h b/src/overlays/gamestates/ovl_debug_opening/debug_opening.h index 577df0fe6..ed3cd75b8 100644 --- a/src/overlays/gamestates/ovl_debug_opening/debug_opening.h +++ b/src/overlays/gamestates/ovl_debug_opening/debug_opening.h @@ -6,13 +6,13 @@ #if IS_DEBUG_BOOT_ENABLED -typedef enum { +typedef enum CurrentPage { /* 1 */ OPTIONS_PAGE = 1, /* 2 */ COMMANDS_PAGE, /* 3 */ BUILDINFO_PAGE } CurrentPage; -typedef enum { +typedef enum CurrentOption { /* 0 */ OPTION_CHOOSE_SAVE_FILE, /* 1 */ OPTION_LOAD_DEFINED_SCENE, /* 2 */ OPTION_LOAD_MAP_SELECT, @@ -20,11 +20,19 @@ typedef enum { /* 4 */ OPTION_LOAD_FILE_SELECT, } CurrentOption; -struct DebugOpeningState; +typedef struct DebugOpeningState { + GameState state; + View view; + s32 currentOption; + char* controlGuideString; + u8 page; + SkyboxContext skyboxCtx; + EnvironmentContext envCtx; +} DebugOpeningState; typedef void (*OptionFunc)(DebugOpeningState*); -typedef struct { +typedef struct OptionInfo { OptionFunc func; char* name; } OptionInfo; 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 2a561d919..12ace92ce 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -1,3 +1,4 @@ +#include "file_select_state.h" #include "file_select.h" #include "attributes.h" @@ -5,6 +6,7 @@ #include "gfx_setupdl.h" #include "letterbox.h" #include "macros.h" +#include "map_select_state.h" #if PLATFORM_N64 #include "n64dd.h" #endif diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c b/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c index 4479689ed..538663066 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c @@ -1,3 +1,4 @@ +#include "file_select_state.h" #include "file_select.h" #include "controller.h" diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c index b1b22c074..9418e67d0 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c @@ -1,3 +1,4 @@ +#include "file_select_state.h" #include "file_select.h" #include "controller.h" diff --git a/src/overlays/gamestates/ovl_opening/z_opening.c b/src/overlays/gamestates/ovl_opening/z_opening.c index 171f3d728..41bf3b50e 100644 --- a/src/overlays/gamestates/ovl_opening/z_opening.c +++ b/src/overlays/gamestates/ovl_opening/z_opening.c @@ -4,6 +4,8 @@ * Description: Initializes the game into the title screen */ +#include "title_setup_state.h" + #include "global.h" #include "z64save.h" #include "z64sram.h" diff --git a/src/overlays/gamestates/ovl_select/z_select.c b/src/overlays/gamestates/ovl_select/z_select.c index fb92a4d96..de6ffbc83 100644 --- a/src/overlays/gamestates/ovl_select/z_select.c +++ b/src/overlays/gamestates/ovl_select/z_select.c @@ -117,7 +117,7 @@ void MapSelect_Destroy(GameState* thisx) { void MapSelect_UpdateMenu(MapSelectState* this) { Input* input = &this->state.input[0]; s32 pad; - SceneSelectEntry* selectedScene; + MapSelectEntry* selectedScene; u16 sfx, sfxIndex; if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN)) { @@ -173,9 +173,9 @@ void MapSelect_UpdateMenu(MapSelectState* this) { if (this->verticalInputAccumulator == 0) { // load the scene if (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_START)) { - selectedScene = &this->scenes[this->currentScene]; - if (selectedScene->loadFunc != NULL) { - selectedScene->loadFunc(this, selectedScene->entranceIndex); + selectedEntry = &this->entries[this->currentEntry]; + if (selectedEntry->loadFunc != NULL) { + selectedEntry->loadFunc(this, selectedEntry->entranceIndex); } } @@ -273,7 +273,7 @@ void MapSelect_UpdateMenu(MapSelectState* this) { this->pageDownIndex++; this->pageDownIndex = (this->pageDownIndex + ARRAY_COUNT(this->pageDownStops)) % ARRAY_COUNT(this->pageDownStops); - this->currentScene = this->topDisplayedScene = this->pageDownStops[this->pageDownIndex]; + this->currentEntry = this->topDisplayedEntry = this->pageDownStops[this->pageDownIndex]; } this->verticalInputAccumulator += this->verticalInput; @@ -312,8 +312,8 @@ void MapSelect_UpdateMenu(MapSelectState* this) { this->currentScene = (this->currentScene + this->sceneTotal) % this->sceneTotal; this->topDisplayedScene = (this->topDisplayedScene + this->sceneTotal) % this->sceneTotal; - dREG(80) = this->currentScene; - dREG(81) = this->topDisplayedScene; + dREG(80) = this->currentEntry; + dREG(81) = this->topDisplayedEntry; dREG(82) = this->pageDownIndex; if (this->timerUp != 0) { diff --git a/src/overlays/gamestates/ovl_select/z_select.h b/src/overlays/gamestates/ovl_select/z_select.h index ffe12d43b..b9770c3a7 100644 --- a/src/overlays/gamestates/ovl_select/z_select.h +++ b/src/overlays/gamestates/ovl_select/z_select.h @@ -10,25 +10,10 @@ #include "terminal.h" #include "z64save.h" #include "z64sram.h" +#include "map_select_state.h" #include "global.h" -void MapSelect_Init(GameState* thisx); -void MapSelect_Main(GameState* thisx); -void MapSelect_Draw(MapSelectState* this); -void MapSelect_Destroy(GameState* thisx); -void MapSelect_UpdateMenu(MapSelectState* this); -void MapSelect_DrawMenu(MapSelectState* this); -void MapSelect_DrawLoadingScreen(MapSelectState* this); -void MapSelect_LoadTitle(MapSelectState* this); -void MapSelect_LoadDebugOpening(MapSelectState* this); -void MapSelect_LoadGame(MapSelectState* this, s32 entranceIndex); -void MapSelect_PrintMenu(MapSelectState* this, GfxPrint* printer); -void MapSelect_PrintLoadingMessage(MapSelectState* this, GfxPrint* printer, u8 yPos); -void MapSelect_PrintAgeSetting(MapSelectState* this, GfxPrint* printer, s32 age); -void MapSelect_PrintSceneLayerSetting(MapSelectState* this, GfxPrint* printer); -void MapSelect_PrintControls(MapSelectState* this, GfxPrint* printer); - static const char* sAgeLabels[] = { "Adult", "Child", @@ -71,7 +56,7 @@ static const Color_RGBA8 sColors[] = { { 255, 255, 255, 255 }, // White }; -static SceneSelectEntry sScenes[] = { +static MapSelectEntry sScenes[] = { #if IS_DEBUG_BOOT_ENABLED { "Boot Menu", (void*)MapSelect_LoadDebugOpening, 0 }, #endif diff --git a/src/overlays/gamestates/ovl_title/z_title.c b/src/overlays/gamestates/ovl_title/z_title.c index c5a1b84ca..c598b5d29 100644 --- a/src/overlays/gamestates/ovl_title/z_title.c +++ b/src/overlays/gamestates/ovl_title/z_title.c @@ -4,8 +4,11 @@ * Description: Displays the Nintendo Logo */ +#include "console_logo_state.h" + #include "global.h" #include "alloca.h" +#include "title_setup_state.h" #include "versions.h" #include "helpers.h" diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c index 4675406c2..a52410b8c 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c @@ -4,6 +4,7 @@ #endif #include "seqcmd.h" #include "terminal.h" +#include "title_setup_state.h" #include "versions.h" #include "z64save.h" @@ -19,7 +20,7 @@ #endif #include "assets/textures/icon_item_gameover_static/icon_item_gameover_static.h" -#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128" +#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128" #if N64_BTN_COLORS #define KALEIDO_PROMPT_CURSOR_R 100