1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-02-23 15:55:47 +00:00
This commit is contained in:
Dragorn421 2022-08-22 16:10:11 +02:00
parent fec5cd84af
commit 9a5ca68dee
No known key found for this signature in database
GPG key ID: 32B53D2D16FC4118
14 changed files with 999 additions and 819 deletions

View file

@ -733,6 +733,52 @@ typedef enum {
#define PAUSE_EQUIP_BUFFER_SIZE sizeof(u16[PAUSE_EQUIP_PLAYER_HEIGHT][PAUSE_EQUIP_PLAYER_WIDTH])
#define PAUSE_PLAYER_SEGMENT_GAMEPLAY_KEEP_BUFFER_SIZE 0x5000
typedef enum {
/* 0 */ PAUSECTX_STATE_0,
/* 1 */ PAUSECTX_STATE_1,
/* 2 */ PAUSECTX_STATE_2,
/* 3 */ PAUSECTX_STATE_3,
/* 4 */ PAUSECTX_STATE_4,
/* 5 */ PAUSECTX_STATE_5,
/* 6 */ PAUSECTX_STATE_6,
/* 7 */ PAUSECTX_STATE_7, // save
/* 8 */ PAUSECTX_STATE_8, // saveGameOver
/* 9 */ PAUSECTX_STATE_9, // saveGameOver
/* 10 */ PAUSECTX_STATE_10, // game over saveGameOver
/* 11 */ PAUSECTX_STATE_11, // game over KaleidoScope_DrawGameOver saveGameOver
/* 12 */ PAUSECTX_STATE_12, // game over KaleidoScope_DrawGameOver saveGameOver
/* 13 */ PAUSECTX_STATE_13, // game over KaleidoScope_DrawGameOver saveGameOver
/* 14 */ PAUSECTX_STATE_14, // game over KaleidoScope_DrawGameOver saveGameOver
/* 15 */ PAUSECTX_STATE_15, // game over KaleidoScope_DrawGameOver saveGameOver
/* 16 */ PAUSECTX_STATE_16, // game over KaleidoScope_DrawGameOver saveGameOver
/* 17 */ PAUSECTX_STATE_17, // game over KaleidoScope_DrawGameOver saveGameOver
/* 18 */ PAUSECTX_STATE_18,
/* 19 */ PAUSECTX_STATE_19
} PauseCtxState;
typedef enum {
/* 0 */ PAUSECTX_UNK_1E4_0,
/* 1 */ PAUSECTX_UNK_1E4_1,
/* 2 */ PAUSECTX_UNK_1E4_2,
/* 3 */ PAUSECTX_UNK_1E4_3,
/* 4 */ PAUSECTX_UNK_1E4_4,
/* 5 */ PAUSECTX_UNK_1E4_5,
/* 6 */ PAUSECTX_UNK_1E4_6,
/* 7 */ PAUSECTX_UNK_1E4_7,
/* 8 */ PAUSECTX_UNK_1E4_8,
/* 9 */ PAUSECTX_UNK_1E4_9
} PauseCtxUnk1E4;
typedef enum {
/* 0 */ PAUSECTX_UNK_1EC_0,
/* 1 */ PAUSECTX_UNK_1EC_1,
/* 2 */ PAUSECTX_UNK_1EC_2,
/* 3 */ PAUSECTX_UNK_1EC_3,
/* 4 */ PAUSECTX_UNK_1EC_4,
/* 5 */ PAUSECTX_UNK_1EC_5,
/* 6 */ PAUSECTX_UNK_1EC_6
} PauseCtxUnk1EC;
typedef struct {
/* 0x0000 */ View view;
/* 0x0128 */ u8* iconItemSegment;
@ -767,11 +813,11 @@ typedef struct {
/* 0x01EA */ u16 unk_1EA;
/* 0x01EC */ u16 unk_1EC;
/* 0x01F0 */ f32 unk_1F0;
/* 0x01F4 */ f32 unk_1F4;
/* 0x01F8 */ f32 unk_1F8;
/* 0x01FC */ f32 unk_1FC;
/* 0x0200 */ f32 unk_200;
/* 0x0204 */ f32 unk_204; // "angle_s"
/* 0x01F4 */ f32 rotXpauseItem_unk_1F4;
/* 0x01F8 */ f32 rotPauseEquip_unk_1F8;
/* 0x01FC */ f32 rotPauseMap_unk_1FC;
/* 0x0200 */ f32 rotPauseQuest_unk_200;
/* 0x0204 */ f32 rotXorZ_unk_204; // "angle_s"
/* 0x0208 */ u16 alpha;
/* 0x020A */ s16 offsetY;
/* 0x020C */ char unk_20C[0x08];

View file

@ -345,9 +345,9 @@ void func_80111070(void) {
XREG(3) = -4;
XREG(4) = 3;
XREG(5) = 0;
XREG(6) = 2;
XREG(6) = 2; // pause menu: stick input repeat cooldown (from first repeat onwards)
XREG(7) = 30;
XREG(8) = 10;
XREG(8) = 10; // pause menu: stick input repeat cooldown (from initial input to first repeat)
XREG(9) = 0;
XREG(10) = -9550;
XREG(11) = 9950;
@ -430,8 +430,8 @@ void func_80111070(void) {
XREG(93) = 100;
XREG(94) = 160;
XREG(95) = 200;
WREG(2) = -6080;
WREG(3) = 9355;
WREG(2) = -6080; // y offset of pause menu
WREG(3) = 9355; // somehow, depth offset of pause menu (offset on distance to "center")
WREG(4) = 8;
WREG(5) = 3;
WREG(6) = 8;

View file

@ -56,30 +56,30 @@ void KaleidoScopeCall_Update(PlayState* play) {
KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
PauseContext* pauseCtx = &play->pauseCtx;
if ((pauseCtx->state != 0) || (pauseCtx->debugState != 0)) {
if (pauseCtx->state == 1) {
if ((pauseCtx->state != PAUSECTX_STATE_0) || (pauseCtx->debugState != 0)) {
if (pauseCtx->state == PAUSECTX_STATE_1) {
if (Letterbox_GetSize() == 0) {
HREG(80) = 7;
HREG(82) = 3;
R_PAUSE_MENU_MODE = 1;
pauseCtx->unk_1E4 = 0;
pauseCtx->unk_1EC = 0;
pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1;
pauseCtx->unk_1E4 = PAUSECTX_UNK_1E4_0;
pauseCtx->unk_1EC = PAUSECTX_UNK_1EC_0;
pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1; // PAUSECTX_STATE_2
}
} else if (pauseCtx->state == 8) {
} else if (pauseCtx->state == PAUSECTX_STATE_8) {
HREG(80) = 7;
HREG(82) = 3;
R_PAUSE_MENU_MODE = 1;
pauseCtx->unk_1E4 = 0;
pauseCtx->unk_1EC = 0;
pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1;
} else if ((pauseCtx->state == 2) || (pauseCtx->state == 9)) {
pauseCtx->unk_1E4 = PAUSECTX_UNK_1E4_0;
pauseCtx->unk_1EC = PAUSECTX_UNK_1EC_0;
pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1; // PAUSECTX_STATE_9
} else if ((pauseCtx->state == PAUSECTX_STATE_2) || (pauseCtx->state == PAUSECTX_STATE_9)) {
osSyncPrintf("PR_KAREIDOSCOPE_MODE=%d\n", R_PAUSE_MENU_MODE);
if (R_PAUSE_MENU_MODE >= 3) {
pauseCtx->state++;
}
} else if (pauseCtx->state != 0) {
} else if (pauseCtx->state != PAUSECTX_STATE_0) {
if (gKaleidoMgrCurOvl != kaleidoScopeOvl) {
if (gKaleidoMgrCurOvl != NULL) {
osSyncPrintf(VT_FGCOL(GREEN));

View file

@ -12,11 +12,11 @@ void KaleidoSetup_Update(PlayState* play) {
PauseContext* pauseCtx = &play->pauseCtx;
Input* input = &play->state.input[0];
if (pauseCtx->state == 0 && pauseCtx->debugState == 0 && play->gameOverCtx.state == GAMEOVER_INACTIVE &&
play->transitionTrigger == TRANS_TRIGGER_OFF && play->transitionMode == TRANS_MODE_OFF &&
gSaveContext.cutsceneIndex < 0xFFF0 && gSaveContext.nextCutsceneIndex < 0xFFF0 && !Play_InCsMode(play) &&
play->shootingGalleryStatus <= 1 && gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY &&
gSaveContext.magicState != MAGIC_STATE_FILL &&
if (pauseCtx->state == PAUSECTX_STATE_0 && pauseCtx->debugState == 0 &&
play->gameOverCtx.state == GAMEOVER_INACTIVE && play->transitionTrigger == TRANS_TRIGGER_OFF &&
play->transitionMode == TRANS_MODE_OFF && gSaveContext.cutsceneIndex < 0xFFF0 &&
gSaveContext.nextCutsceneIndex < 0xFFF0 && !Play_InCsMode(play) && play->shootingGalleryStatus <= 1 &&
gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY && gSaveContext.magicState != MAGIC_STATE_FILL &&
(play->sceneId != SCENE_BOWLING || !Flags_GetSwitch(play, 0x38))) {
if (CHECK_BTN_ALL(input->cur.button, BTN_L) && CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
@ -30,7 +30,7 @@ void KaleidoSetup_Update(PlayState* play) {
WREG(17) = 155;
pauseCtx->unk_1EA = 0;
pauseCtx->unk_1E4 = 1;
pauseCtx->unk_1E4 = PAUSECTX_UNK_1E4_1;
if (ZREG(48) == 0) {
pauseCtx->eye.x = sKaleidoSetupEyeX0[pauseCtx->pageIndex];
@ -43,13 +43,13 @@ void KaleidoSetup_Update(PlayState* play) {
}
pauseCtx->mode = (u16)(pauseCtx->pageIndex * 2) + 1;
pauseCtx->state = 1;
pauseCtx->state = PAUSECTX_STATE_1;
osSyncPrintf("=%d eye.x=%f, eye.z=%f kscp_pos=%d\n", pauseCtx->mode, pauseCtx->eye.x,
pauseCtx->eye.z, pauseCtx->pageIndex);
}
if (pauseCtx->state == 1) {
if (pauseCtx->state == PAUSECTX_STATE_1) {
WREG(2) = -6240;
R_UPDATE_RATE = 2;
@ -66,22 +66,20 @@ void KaleidoSetup_Init(PlayState* play) {
PauseContext* pauseCtx = &play->pauseCtx;
u64 temp = 0; // Necessary to match
pauseCtx->state = 0;
pauseCtx->state = PAUSECTX_STATE_0;
pauseCtx->debugState = 0;
pauseCtx->alpha = 0;
pauseCtx->unk_1EA = 0;
pauseCtx->unk_1E4 = 0;
pauseCtx->unk_1E4 = PAUSECTX_UNK_1E4_0;
pauseCtx->mode = 0;
pauseCtx->pageIndex = PAUSE_ITEM;
pauseCtx->unk_1F4 = 160.0f;
pauseCtx->unk_1F8 = 160.0f;
pauseCtx->unk_1FC = 160.0f;
pauseCtx->unk_200 = 160.0f;
pauseCtx->rotXpauseItem_unk_1F4 = pauseCtx->rotPauseEquip_unk_1F8 = pauseCtx->rotPauseMap_unk_1FC =
pauseCtx->rotPauseQuest_unk_200 = 160.0f;
pauseCtx->eye.z = 64.0f;
pauseCtx->unk_1F0 = 936.0f;
pauseCtx->eye.x = pauseCtx->eye.y = 0.0f;
pauseCtx->unk_204 = -314.0f;
pauseCtx->rotXorZ_unk_204 = -314.0f;
pauseCtx->cursorPoint[PAUSE_ITEM] = 0;
pauseCtx->cursorPoint[PAUSE_MAP] = VREG(30) + 3;

View file

@ -886,7 +886,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
func_800AA16C();
}
if (pauseCtx->state == 0) {
if (pauseCtx->state == PAUSECTX_STATE_0) {
if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0)) {
if (play->skyboxId == SKYBOX_NORMAL_SKY) {
play->skyboxCtx.rot.y -= 0.001f;
@ -918,7 +918,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
}
}
if ((pauseCtx->state == 0) && (gameOverCtx->state == GAMEOVER_INACTIVE)) {
if ((pauseCtx->state == PAUSECTX_STATE_0) && (gameOverCtx->state == GAMEOVER_INACTIVE)) {
if (((msgCtx->msgLength == 0) && (msgCtx->msgMode == MSGMODE_NONE)) ||
(((void)0, gSaveContext.gameMode) == GAMEMODE_END_CREDITS)) {
if ((envCtx->changeSkyboxTimer == 0) && !FrameAdvance_IsEnabled(play) &&

View file

@ -2103,7 +2103,7 @@ void Interface_SetDoAction(PlayState* play, u16 action) {
interfaceCtx->unk_1EC = 1;
interfaceCtx->unk_1F4 = 0.0f;
Interface_LoadActionLabel(interfaceCtx, action, 1);
if (pauseCtx->state != 0) {
if (pauseCtx->state != PAUSECTX_STATE_0) {
interfaceCtx->unk_1EC = 3;
}
}
@ -2763,7 +2763,9 @@ void Interface_DrawItemButtons(PlayState* play) {
(R_ITEM_BTN_X(3) + R_ITEM_BTN_WIDTH(3)) << 2, (R_ITEM_BTN_Y(3) + R_ITEM_BTN_WIDTH(3)) << 2,
G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(3) << 1, R_ITEM_BTN_DD(3) << 1);
if ((pauseCtx->state < 8) || (pauseCtx->state >= 18)) {
if ((pauseCtx->state < PAUSECTX_STATE_8) /* PAUSECTX_STATE_0, PAUSECTX_STATE_1, PAUSECTX_STATE_2, PAUSECTX_STATE_3,
PAUSECTX_STATE_4, PAUSECTX_STATE_5, PAUSECTX_STATE_6, PAUSECTX_STATE_7 */
|| (pauseCtx->state >= PAUSECTX_STATE_18) /* PAUSECTX_STATE_18, PAUSECTX_STATE_19 */) {
if ((play->pauseCtx.state != 0) || (play->pauseCtx.debugState != 0)) {
// Start Button Texture, Color & Label
gDPPipeSync(OVERLAY_DISP++);
@ -3318,7 +3320,7 @@ void Interface_Draw(PlayState* play) {
func_8008A994(interfaceCtx);
if ((pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 3)) {
if ((pauseCtx->state == PAUSECTX_STATE_6) && (pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_3)) {
// Inventory Equip Effects
gSPSegment(OVERLAY_DISP++, 0x08, pauseCtx->iconItemSegment);
Gfx_SetupDL_42Overlay(play->state.gfxCtx);

View file

@ -1448,6 +1448,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve
Matrix_MultVec3f(&sZeroVec, sCurBodyPartPos);
}
if (limbIndex == PLAYER_LIMB_L_HAND) {
MtxF sp14C;
Actor* hookedActor;

View file

@ -75,14 +75,15 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
OPEN_DISPS(gfxCtx, "../z_kaleido_collect.c", 248);
if ((!pauseCtx->unk_1E4 || (pauseCtx->unk_1E4 == 5) || (pauseCtx->unk_1E4 == 8)) &&
if ((!pauseCtx->unk_1E4 /* PAUSECTX_UNK_1E4_0 */ || (pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_5) ||
(pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_8)) &&
(pauseCtx->pageIndex == PAUSE_QUEST)) {
pauseCtx->cursorColorSet = 0;
if (pauseCtx->cursorSpecialPos == 0) {
pauseCtx->nameColorSet = 0;
if ((pauseCtx->state != 6) || ((pauseCtx->stickRelX == 0) && (pauseCtx->stickRelY == 0))) {
if ((pauseCtx->state != PAUSECTX_STATE_6) || ((pauseCtx->stickRelX == 0) && (pauseCtx->stickRelY == 0))) {
sp216 = pauseCtx->cursorSlot[PAUSE_QUEST];
} else {
phi_s3 = pauseCtx->cursorPoint[PAUSE_QUEST];
@ -91,7 +92,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
phi_s0 = D_8082A1AC[phi_s3][2];
if (phi_s0 == -3) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT);
pauseCtx->unk_1E4 = 0;
pauseCtx->unk_1E4 = PAUSECTX_UNK_1E4_0;
} else {
while (phi_s0 >= 0) {
if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) {
@ -104,7 +105,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
phi_s0 = D_8082A1AC[phi_s3][3];
if (phi_s0 == -2) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT);
pauseCtx->unk_1E4 = 0;
pauseCtx->unk_1E4 = PAUSECTX_UNK_1E4_0;
} else {
while (phi_s0 >= 0) {
if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) {
@ -134,7 +135,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
}
if (phi_s3 != pauseCtx->cursorPoint[PAUSE_QUEST]) {
pauseCtx->unk_1E4 = 0;
pauseCtx->unk_1E4 = PAUSECTX_UNK_1E4_0;
Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}
@ -174,7 +175,8 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
KaleidoScope_SetCursorVtx(pauseCtx, sp216 * 4, pauseCtx->questVtx);
if ((pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0) && (pauseCtx->cursorSpecialPos == 0)) {
if ((pauseCtx->state == PAUSECTX_STATE_6) && (pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_0) &&
(pauseCtx->cursorSpecialPos == 0)) {
if ((sp216 >= QUEST_SONG_MINUET) && (sp216 < QUEST_KOKIRI_EMERALD)) {
if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) {
sp216 = pauseCtx->cursorSlot[PAUSE_QUEST];
@ -197,19 +199,19 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
VREG(23) = -49;
VREG(24) = -46;
VREG(25) = -41;
pauseCtx->unk_1E4 = 8;
pauseCtx->unk_1E4 = PAUSECTX_UNK_1E4_8;
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
}
}
} else if (pauseCtx->unk_1E4 == 5) {
} else if (pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_5) {
if ((pauseCtx->stickRelX != 0) || (pauseCtx->stickRelY != 0)) {
pauseCtx->unk_1E4 = 0;
pauseCtx->unk_1E4 = PAUSECTX_UNK_1E4_0;
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
}
} else if (pauseCtx->unk_1E4 == 8) {
} else if (pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_8) {
if (CHECK_BTN_ALL(input->press.button, BTN_A) && (sp216 >= QUEST_SONG_MINUET) &&
(sp216 < QUEST_KOKIRI_EMERALD)) {
pauseCtx->unk_1E4 = 9;
pauseCtx->unk_1E4 = PAUSECTX_UNK_1E4_9;
D_8082A120 = 10;
}
}
@ -258,7 +260,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
}
} else {
if (pauseCtx->unk_1E4 == 9) {
if (pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_9) {
pauseCtx->cursorColorSet = 8;
if (--D_8082A120 == 0) {
@ -278,7 +280,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT);
pauseCtx->ocarinaSongIdx = gOcarinaSongItemMap[sp216 - QUEST_SONG_MINUET];
AudioOcarina_SetPlaybackSong(pauseCtx->ocarinaSongIdx + 1, 1);
pauseCtx->unk_1E4 = 2;
pauseCtx->unk_1E4 = PAUSECTX_UNK_1E4_2;
pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff();
pauseCtx->ocarinaStaff->pos = 0;
sp216 = pauseCtx->cursorSlot[PAUSE_QUEST];
@ -437,7 +439,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
gDPSetCombineLERP(POLY_OPA_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
if ((pauseCtx->state == 4) || (pauseCtx->state == 0x12)) {
if ((pauseCtx->state == PAUSECTX_STATE_4) || (pauseCtx->state == PAUSECTX_STATE_18)) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, D_8082A070[0][0], D_8082A070[0][1], D_8082A070[0][2],
pauseCtx->alpha);
} else {
@ -454,23 +456,26 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
48, 48, 0);
}
if (pauseCtx->state == 6) {
if (pauseCtx->state == PAUSECTX_STATE_6) {
gDPPipeSync(POLY_OPA_DISP++);
gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
sp21A += 4;
if ((pauseCtx->cursorSpecialPos == 0) && (sp216 >= 6) && (sp216 < 0x12)) {
if ((pauseCtx->unk_1E4 < 3) || (pauseCtx->unk_1E4 == 5) || (pauseCtx->unk_1E4 == 8)) {
if ((pauseCtx->unk_1E4 < 3) || (pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_5) ||
(pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_8)) {
if (pauseCtx->cursorItem[pauseCtx->pageIndex] != PAUSE_ITEM_NONE) {
pauseCtx->cursorColorSet = 8;
if ((pauseCtx->unk_1E4 >= 2) && (pauseCtx->unk_1E4 < 7)) {
// PAUSECTX_UNK_1E4_2, PAUSECTX_UNK_1E4_3, PAUSECTX_UNK_1E4_4, PAUSECTX_UNK_1E4_5,
// PAUSECTX_UNK_1E4_6
if ((pauseCtx->unk_1E4 >= PAUSECTX_UNK_1E4_2) && (pauseCtx->unk_1E4 < PAUSECTX_UNK_1E4_7)) {
pauseCtx->cursorColorSet = 0;
}
}
}
}
if (pauseCtx->unk_1E4 == 2) {
if (pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_2) {
pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff();
if (pauseCtx->ocarinaStaff->pos != 0) {
@ -515,7 +520,10 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0);
}
}
} else if (((pauseCtx->unk_1E4 >= 4) && (pauseCtx->unk_1E4 <= 6)) || (pauseCtx->unk_1E4 == 8)) {
} else if (((pauseCtx->unk_1E4 >= PAUSECTX_UNK_1E4_4) &&
(pauseCtx->unk_1E4 <=
PAUSECTX_UNK_1E4_6)) /* PAUSECTX_UNK_1E4_4, PAUSECTX_UNK_1E4_5, PAUSECTX_UNK_1E4_6 */
|| (pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_8)) {
sp224 = pauseCtx->ocarinaSongIdx;
sp226 = gOcarinaSongButtons[sp224].numButtons;
@ -528,7 +536,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
gDPPipeSync(POLY_OPA_DISP++);
if (pauseCtx->unk_1E4 == 8) {
if (pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_8) {
if (gOcarinaSongButtons[sp224].buttonsIndex[phi_s3] == OCARINA_BTN_A) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 80, 255, 150, 200);
} else {
@ -549,7 +557,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0);
}
if (pauseCtx->unk_1E4 != 8) {
if (pauseCtx->unk_1E4 != PAUSECTX_UNK_1E4_8) {
pauseCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff();
if (pauseCtx->ocarinaStaff->pos != 0) {
@ -601,7 +609,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0);
}
if (pauseCtx->unk_1E4 == 4) {
if (pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_4) {
for (phi_s3 = 0; phi_s3 < 8; phi_s3++) {
D_8082A124[phi_s3] = 0xFF;
D_8082A150[phi_s3] = 0;
@ -613,7 +621,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff();
pauseCtx->ocarinaStaff->pos = 0;
pauseCtx->ocarinaStaff->state = 0xFE;
pauseCtx->unk_1E4 = 5;
pauseCtx->unk_1E4 = PAUSECTX_UNK_1E4_5;
}
}
}

View file

@ -150,7 +150,8 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
}
}
if ((pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0) && (pauseCtx->pageIndex == PAUSE_EQUIP)) {
if ((pauseCtx->state == PAUSECTX_STATE_6) && (pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_0) &&
(pauseCtx->pageIndex == PAUSE_EQUIP)) {
oldCursorPoint = pauseCtx->cursorPoint[PAUSE_EQUIP];
pauseCtx->cursorColorSet = 0;
@ -465,9 +466,9 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
KaleidoScope_SetCursorVtx(pauseCtx, cursorSlot * 4, pauseCtx->equipVtx);
if ((pauseCtx->cursorSpecialPos == 0) && (cursorItem != PAUSE_ITEM_NONE) && (pauseCtx->state == 6) &&
(pauseCtx->unk_1E4 == 0) && CHECK_BTN_ALL(input->press.button, BTN_A) &&
(pauseCtx->cursorX[PAUSE_EQUIP] != 0)) {
if ((pauseCtx->cursorSpecialPos == 0) && (cursorItem != PAUSE_ITEM_NONE) &&
(pauseCtx->state == PAUSECTX_STATE_6) && (pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_0) &&
CHECK_BTN_ALL(input->press.button, BTN_A) && (pauseCtx->cursorX[PAUSE_EQUIP] != 0)) {
if ((gEquipAgeReqs[pauseCtx->cursorY[PAUSE_EQUIP]][pauseCtx->cursorX[PAUSE_EQUIP]] == 9) ||
(gEquipAgeReqs[pauseCtx->cursorY[PAUSE_EQUIP]][pauseCtx->cursorX[PAUSE_EQUIP]] ==
@ -496,7 +497,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
pauseCtx->unk_1E4 = 7;
pauseCtx->unk_1E4 = PAUSECTX_UNK_1E4_7;
sEquipTimer = 10;
} else {
Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
@ -508,13 +509,13 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}
} else if ((pauseCtx->unk_1E4 == 7) && (pauseCtx->pageIndex == PAUSE_EQUIP)) {
} else if ((pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_7) && (pauseCtx->pageIndex == PAUSE_EQUIP)) {
KaleidoScope_SetCursorVtx(pauseCtx, pauseCtx->cursorSlot[PAUSE_EQUIP] * 4, pauseCtx->equipVtx);
pauseCtx->cursorColorSet = 8;
sEquipTimer--;
if (sEquipTimer == 0) {
pauseCtx->unk_1E4 = 0;
pauseCtx->unk_1E4 = PAUSECTX_UNK_1E4_0;
}
}
@ -581,11 +582,11 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
KaleidoScope_DrawPlayerWork(play);
if ((pauseCtx->unk_1E4 == 7) && (sEquipTimer == 10)) {
if ((pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_7) && (sEquipTimer == 10)) {
KaleidoScope_SetupPlayerPreRender(play);
}
if ((pauseCtx->unk_1E4 == 7) && (sEquipTimer == 9)) {
if ((pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_7) && (sEquipTimer == 9)) {
//! @bug: This function shouldn't take any arguments
KaleidoScope_ProcessPlayerPreRender(play);
}

View file

@ -103,7 +103,8 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
pauseCtx->cursorColorSet = 0;
pauseCtx->nameColorSet = 0;
if ((pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0) && (pauseCtx->pageIndex == PAUSE_ITEM)) {
if ((pauseCtx->state == PAUSECTX_STATE_6) && (pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_0) &&
(pauseCtx->pageIndex == PAUSE_ITEM)) {
moveCursorResult = 0;
oldCursorPoint = pauseCtx->cursorPoint[PAUSE_ITEM];
@ -344,7 +345,8 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
index = cursorSlot * 4; // required to match?
KaleidoScope_SetCursorVtx(pauseCtx, index, pauseCtx->itemVtx);
if ((pauseCtx->debugState == 0) && (pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0)) {
if ((pauseCtx->debugState == 0) && (pauseCtx->state == PAUSECTX_STATE_6) &&
(pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_0)) {
if (CHECK_BTN_ANY(input->press.button, BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT)) {
if (((gSlotAgeReqs[cursorSlot] == 9) ||
(gSlotAgeReqs[cursorSlot] == ((void)0, gSaveContext.linkAge))) &&
@ -359,7 +361,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
pauseCtx->equipTargetItem = cursorItem;
pauseCtx->equipTargetSlot = cursorSlot;
pauseCtx->unk_1E4 = 3;
pauseCtx->unk_1E4 = PAUSECTX_UNK_1E4_3;
pauseCtx->equipAnimX = pauseCtx->itemVtx[index].v.ob[0] * 10;
pauseCtx->equipAnimY = pauseCtx->itemVtx[index].v.ob[1] * 10;
pauseCtx->equipAnimAlpha = 255;
@ -408,7 +410,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}
} else if ((pauseCtx->unk_1E4 == 3) && (pauseCtx->pageIndex == PAUSE_ITEM)) {
} else if ((pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_3) && (pauseCtx->pageIndex == PAUSE_ITEM)) {
KaleidoScope_SetCursorVtx(pauseCtx, cursorSlot * 4, pauseCtx->itemVtx);
pauseCtx->cursorColorSet = 4;
}
@ -432,7 +434,8 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha);
if (gSaveContext.inventory.items[i] != ITEM_NONE) {
if ((pauseCtx->unk_1E4 == 0) && (pauseCtx->pageIndex == PAUSE_ITEM) && (pauseCtx->cursorSpecialPos == 0)) {
if ((pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_0) && (pauseCtx->pageIndex == PAUSE_ITEM) &&
(pauseCtx->cursorSpecialPos == 0)) {
if ((gSlotAgeReqs[i] == 9) || (gSlotAgeReqs[i] == ((void)0, gSaveContext.linkAge))) {
if ((sEquipState == 2) && (i == 3)) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, magicArrowEffectsR[pauseCtx->equipTargetItem - 0xBF],
@ -801,7 +804,7 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) {
gSaveContext.equips.cButtonSlots[2]);
}
pauseCtx->unk_1E4 = 0;
pauseCtx->unk_1E4 = PAUSECTX_UNK_1E4_0;
sEquipMoveTimer = 10;
WREG(90) = 320;
WREG(87) = WREG(91);

View file

@ -46,7 +46,8 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
OPEN_DISPS(gfxCtx, "../z_kaleido_map_PAL.c", 123);
if ((pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0) && (pauseCtx->pageIndex == PAUSE_MAP)) {
if ((pauseCtx->state == PAUSECTX_STATE_6) && (pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_0) &&
(pauseCtx->pageIndex == PAUSE_MAP)) {
pauseCtx->cursorColorSet = 0;
oldCursorPoint = pauseCtx->cursorPoint[PAUSE_MAP];
@ -410,7 +411,8 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) {
OPEN_DISPS(gfxCtx, "../z_kaleido_map_PAL.c", 556);
if ((pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0) && (pauseCtx->pageIndex == PAUSE_MAP)) {
if ((pauseCtx->state == PAUSECTX_STATE_6) && (pauseCtx->unk_1E4 == PAUSECTX_UNK_1E4_0) &&
(pauseCtx->pageIndex == PAUSE_MAP)) {
pauseCtx->cursorColorSet = 0;
oldCursorPoint = pauseCtx->cursorPoint[PAUSE_WORLD_MAP];
@ -560,8 +562,8 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) {
for (j = i = 0; i < 8; i++, j += 4) {
if (!(gSaveContext.worldMapAreaData & gBitFlags[cloudFlagNums[k + i]])) {
gDPLoadTextureBlock_4b(POLY_OPA_DISP++, cloudTexs[k + i], G_IM_FMT_I, D_8082AAEC[k + i],
D_8082AB2C[k + i], 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR,
gDPLoadTextureBlock_4b(POLY_OPA_DISP++, cloudTexs[k + i], G_IM_FMT_I, D_8082AAEC_width_MAP_PAGE_VTX_NOT_IN_DUNGEON_SCENE_[k + i],
D_8082AB2C_height_MAP_PAGE_VTX_NOT_IN_DUNGEON_SCENE_[k + i], 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR,
G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSP1Quadrangle(POLY_OPA_DISP++, j, j + 2, j + 3, j + 1, 0);

View file

@ -8,7 +8,8 @@ void KaleidoScope_UpdatePrompt(PlayState* play) {
s8 relStickX = input->rel.stick_x;
s16 step;
if (((pauseCtx->state == 7) && (pauseCtx->unk_1EC == 1)) || (pauseCtx->state == 0xE) || (pauseCtx->state == 0x10)) {
if (((pauseCtx->state == PAUSECTX_STATE_7) && (pauseCtx->unk_1EC == PAUSECTX_UNK_1EC_1)) ||
(pauseCtx->state == PAUSECTX_STATE_14) || (pauseCtx->state == PAUSECTX_STATE_16)) {
if ((pauseCtx->promptChoice == 0) && (relStickX >= 30)) {
Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);

View file

@ -5,8 +5,8 @@
#include "global.h"
extern u8 gAmmoItems[];
extern s16 D_8082AAEC[];
extern s16 D_8082AB2C[];
extern s16 D_8082AAEC_width_MAP_PAGE_VTX_NOT_IN_DUNGEON_SCENE_[];
extern s16 D_8082AB2C_height_MAP_PAGE_VTX_NOT_IN_DUNGEON_SCENE_[];
extern u8 gSlotAgeReqs[];
extern u8 gEquipAgeReqs[EQUIP_TYPE_MAX][4];
extern u8 gAreaGsFlags[];

File diff suppressed because it is too large Load diff