mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-14 11:54:39 +00:00
Decompile the pause menu aka. ovl_kaleido_scope (+ minor changes) (#803)
* Decompile ovl_kaleido_scope + minor cleanups * Add a common header for ovl_kaleido_scope * Start cleaning up and documenting kaleido_scope (+ some interface docs) * Improve and fix some kaleido_scope non matchings * Match KaleidoSetup_Init * Extract icon_item_fra/ger_static files * Add more documentation and matches to kaleido_scope * Improve the z_kaleido_collect.c non matching * Rename z_kaleido_8081EFF0.c to z_kaleido_prompt.c * Update most kaleido variables to be static * Improve GS flag macros * Improve z_lmap_mark.c and extract z_lmap_mark_data.c with a script * Various minor fixes and improvements * Minor fixes and review changes * Review changes part 2 * Rename gSetTileCustom to gDPSetTileCustom * Review changes part 3
This commit is contained in:
parent
4e9f40cb13
commit
a53e084cd2
106 changed files with 8605 additions and 24307 deletions
|
@ -1,48 +1,18 @@
|
|||
#include "global.h"
|
||||
|
||||
s16 sKaleidoSetupKscpPos0[] = {
|
||||
2,
|
||||
3,
|
||||
0,
|
||||
1,
|
||||
};
|
||||
f32 sKaleidoSetupEyeX0[] = {
|
||||
0.0f,
|
||||
64.0f,
|
||||
0.0f,
|
||||
-64.0f,
|
||||
};
|
||||
f32 sKaleidoSetupEyeZ0[] = {
|
||||
-64.0f,
|
||||
0.0f,
|
||||
64.0f,
|
||||
0.0f,
|
||||
};
|
||||
s16 sKaleidoSetupKscpPos0[] = { PAUSE_QUEST, PAUSE_EQUIP, PAUSE_ITEM, PAUSE_MAP };
|
||||
f32 sKaleidoSetupEyeX0[] = { 0.0f, 64.0f, 0.0f, -64.0f };
|
||||
f32 sKaleidoSetupEyeZ0[] = { -64.0f, 0.0f, 64.0f, 0.0f };
|
||||
|
||||
s16 sKaleidoSetupKscpPos1[] = {
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
0,
|
||||
};
|
||||
f32 sKaleidoSetupEyeX1[] = {
|
||||
-64.0f,
|
||||
0.0f,
|
||||
64.0f,
|
||||
0.0f,
|
||||
};
|
||||
f32 sKaleidoSetupEyeZ1[] = {
|
||||
0.0f,
|
||||
-64.0f,
|
||||
0.0f,
|
||||
64.0f,
|
||||
};
|
||||
s16 sKaleidoSetupKscpPos1[] = { PAUSE_MAP, PAUSE_QUEST, PAUSE_EQUIP, PAUSE_ITEM };
|
||||
f32 sKaleidoSetupEyeX1[] = { -64.0f, 0.0f, 64.0f, 0.0f };
|
||||
f32 sKaleidoSetupEyeZ1[] = { 0.0f, -64.0f, 0.0f, 64.0f };
|
||||
|
||||
void KaleidoSetup_Update(GlobalContext* globalCtx) {
|
||||
PauseContext* pauseCtx = &globalCtx->pauseCtx;
|
||||
Input* input = &globalCtx->state.input[0];
|
||||
|
||||
if (pauseCtx->state == 0 && pauseCtx->flag == 0 && globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE &&
|
||||
if (pauseCtx->state == 0 && pauseCtx->debugState == 0 && globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE &&
|
||||
globalCtx->sceneLoadFlag == 0 && globalCtx->transitionMode == 0 && gSaveContext.cutsceneIndex < 0xFFF0 &&
|
||||
gSaveContext.nextCutsceneIndex < 0xFFF0 && !Gameplay_InCsMode(globalCtx) &&
|
||||
globalCtx->shootingGalleryStatus <= 1 && gSaveContext.unk_13F0 != 8 && gSaveContext.unk_13F0 != 9 &&
|
||||
|
@ -50,54 +20,59 @@ void KaleidoSetup_Update(GlobalContext* globalCtx) {
|
|||
|
||||
if (CHECK_BTN_ALL(input->cur.button, BTN_L) && CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
|
||||
if (BREG(0)) {
|
||||
pauseCtx->flag = 3;
|
||||
pauseCtx->debugState = 3;
|
||||
}
|
||||
} else if (CHECK_BTN_ALL(input->press.button, BTN_START)) {
|
||||
gSaveContext.unk_13EE = gSaveContext.unk_13EA;
|
||||
WREG(16) = -0xAF;
|
||||
WREG(17) = 0x9B;
|
||||
|
||||
WREG(16) = -175;
|
||||
WREG(17) = 155;
|
||||
|
||||
pauseCtx->unk_1EA = 0;
|
||||
pauseCtx->unk_1E4 = 1;
|
||||
|
||||
if (ZREG(48) == 0) {
|
||||
pauseCtx->eye.x = sKaleidoSetupEyeX0[pauseCtx->kscpPos];
|
||||
pauseCtx->eye.z = sKaleidoSetupEyeZ0[pauseCtx->kscpPos];
|
||||
pauseCtx->kscpPos = sKaleidoSetupKscpPos0[pauseCtx->kscpPos];
|
||||
pauseCtx->eye.x = sKaleidoSetupEyeX0[pauseCtx->pageIndex];
|
||||
pauseCtx->eye.z = sKaleidoSetupEyeZ0[pauseCtx->pageIndex];
|
||||
pauseCtx->pageIndex = sKaleidoSetupKscpPos0[pauseCtx->pageIndex];
|
||||
} else {
|
||||
pauseCtx->eye.x = sKaleidoSetupEyeX1[pauseCtx->kscpPos];
|
||||
pauseCtx->eye.z = sKaleidoSetupEyeZ1[pauseCtx->kscpPos];
|
||||
pauseCtx->kscpPos = sKaleidoSetupKscpPos1[pauseCtx->kscpPos];
|
||||
pauseCtx->eye.x = sKaleidoSetupEyeX1[pauseCtx->pageIndex];
|
||||
pauseCtx->eye.z = sKaleidoSetupEyeZ1[pauseCtx->pageIndex];
|
||||
pauseCtx->pageIndex = sKaleidoSetupKscpPos1[pauseCtx->pageIndex];
|
||||
}
|
||||
|
||||
pauseCtx->mode = (u16)(pauseCtx->kscpPos * 2) + 1; // cast required
|
||||
pauseCtx->mode = (u16)(pauseCtx->pageIndex * 2) + 1;
|
||||
pauseCtx->state = 1;
|
||||
|
||||
osSyncPrintf("Mode=%d eye.x=%f, eye.z=%f kscp_pos=%d\n", pauseCtx->mode, pauseCtx->eye.x,
|
||||
pauseCtx->eye.z, pauseCtx->kscpPos);
|
||||
pauseCtx->eye.z, pauseCtx->pageIndex);
|
||||
}
|
||||
|
||||
if (pauseCtx->state == 1) {
|
||||
WREG(2) = -0x1860;
|
||||
WREG(2) = -6240;
|
||||
R_UPDATE_RATE = 2;
|
||||
|
||||
if (ShrinkWindow_GetVal()) {
|
||||
ShrinkWindow_SetVal(0);
|
||||
}
|
||||
|
||||
func_800F64E0(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc differences
|
||||
void KaleidoSetup_Init(GlobalContext* globalCtx) {
|
||||
PauseContext* pauseCtx = &globalCtx->pauseCtx;
|
||||
u64 temp = 0; // Necessary to match
|
||||
|
||||
pauseCtx->state = 0;
|
||||
pauseCtx->flag = 0;
|
||||
pauseCtx->unk_208 = 0;
|
||||
pauseCtx->debugState = 0;
|
||||
pauseCtx->alpha = 0;
|
||||
pauseCtx->unk_1EA = 0;
|
||||
pauseCtx->unk_1E4 = 0;
|
||||
pauseCtx->mode = 0;
|
||||
pauseCtx->kscpPos = 0;
|
||||
pauseCtx->unk_218 = 0;
|
||||
pauseCtx->pageIndex = PAUSE_ITEM;
|
||||
|
||||
pauseCtx->unk_1F4 = 160.0f;
|
||||
pauseCtx->unk_1F8 = 160.0f;
|
||||
pauseCtx->unk_1FC = 160.0f;
|
||||
|
@ -106,38 +81,41 @@ void KaleidoSetup_Init(GlobalContext* globalCtx) {
|
|||
pauseCtx->unk_1F0 = 936.0f;
|
||||
pauseCtx->eye.x = pauseCtx->eye.y = 0.0f;
|
||||
pauseCtx->unk_204 = -314.0f;
|
||||
pauseCtx->unk_21A = VREG(30) + 3;
|
||||
pauseCtx->unk_21C = 0;
|
||||
pauseCtx->unk_21E = 1;
|
||||
pauseCtx->unk_220 = 10;
|
||||
pauseCtx->unk_222 = 0;
|
||||
pauseCtx->unk_22C = 0;
|
||||
pauseCtx->unk_224 = 0;
|
||||
pauseCtx->unk_22E = 0;
|
||||
pauseCtx->unk_226 = 0;
|
||||
pauseCtx->unk_230 = 0;
|
||||
pauseCtx->unk_228 = 1;
|
||||
pauseCtx->unk_232 = 0;
|
||||
pauseCtx->unk_23E = 999;
|
||||
pauseCtx->unk_240 = VREG(30) + 3;
|
||||
pauseCtx->unk_242 = 999;
|
||||
pauseCtx->unk_244 = 59;
|
||||
pauseCtx->unk_246 = 0;
|
||||
pauseCtx->unk_248 = VREG(30) + 3;
|
||||
pauseCtx->unk_24A = 0;
|
||||
pauseCtx->unk_24C = pauseCtx->unk_21E;
|
||||
pauseCtx->unk_25A = -40;
|
||||
pauseCtx->unk_25C = 0;
|
||||
pauseCtx->unk_25E = 0;
|
||||
pauseCtx->unk_260 = 4;
|
||||
|
||||
pauseCtx->cursorPoint[PAUSE_ITEM] = 0;
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = VREG(30) + 3;
|
||||
pauseCtx->cursorPoint[PAUSE_QUEST] = 0;
|
||||
pauseCtx->cursorPoint[PAUSE_EQUIP] = 1;
|
||||
pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = 10;
|
||||
|
||||
pauseCtx->cursorX[PAUSE_ITEM] = 0;
|
||||
pauseCtx->cursorY[PAUSE_ITEM] = 0;
|
||||
pauseCtx->cursorX[PAUSE_MAP] = 0;
|
||||
pauseCtx->cursorY[PAUSE_MAP] = 0;
|
||||
pauseCtx->cursorX[PAUSE_QUEST] = temp;
|
||||
pauseCtx->cursorY[PAUSE_QUEST] = temp;
|
||||
pauseCtx->cursorX[PAUSE_EQUIP] = 1;
|
||||
pauseCtx->cursorY[PAUSE_EQUIP] = 0;
|
||||
|
||||
pauseCtx->cursorItem[PAUSE_ITEM] = PAUSE_ITEM_NONE;
|
||||
pauseCtx->cursorItem[PAUSE_MAP] = VREG(30) + 3;
|
||||
pauseCtx->cursorItem[PAUSE_QUEST] = PAUSE_ITEM_NONE;
|
||||
pauseCtx->cursorItem[PAUSE_EQUIP] = ITEM_SWORD_KOKIRI;
|
||||
|
||||
pauseCtx->cursorSlot[PAUSE_ITEM] = 0;
|
||||
pauseCtx->cursorSlot[PAUSE_MAP] = VREG(30) + 3;
|
||||
pauseCtx->cursorSlot[PAUSE_QUEST] = 0;
|
||||
pauseCtx->cursorSlot[PAUSE_EQUIP] = pauseCtx->cursorPoint[PAUSE_EQUIP];
|
||||
|
||||
pauseCtx->infoPanelOffsetY = -40;
|
||||
pauseCtx->nameDisplayTimer = 0;
|
||||
pauseCtx->nameColorSet = 0;
|
||||
pauseCtx->cursorColorSet = 4;
|
||||
pauseCtx->unk_264 = -1;
|
||||
pauseCtx->unk_238 = 0;
|
||||
pauseCtx->cursorSpecialPos = 0;
|
||||
|
||||
View_Init(&pauseCtx->view, globalCtx->state.gfxCtx);
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kaleido_setup/KaleidoSetup_Init.s")
|
||||
#endif
|
||||
|
||||
void KaleidoSetup_Destroy(GlobalContext* globalCtx) {
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue