1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-14 11:00:41 +00:00

stickRel -> stickAdj (#1367)

* kaleido and filselect

* ocarina and KaleidoScope_UpdatePrompt
This commit is contained in:
Dragorn421 2022-08-30 20:55:37 +02:00 committed by GitHub
parent 327a813b37
commit 1ab4e6ee5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 93 additions and 93 deletions

View file

@ -82,12 +82,12 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
if (pauseCtx->cursorSpecialPos == 0) {
pauseCtx->nameColorSet = 0;
if ((pauseCtx->state != 6) || ((pauseCtx->stickRelX == 0) && (pauseCtx->stickRelY == 0))) {
if ((pauseCtx->state != 6) || ((pauseCtx->stickAdjX == 0) && (pauseCtx->stickAdjY == 0))) {
sp216 = pauseCtx->cursorSlot[PAUSE_QUEST];
} else {
phi_s3 = pauseCtx->cursorPoint[PAUSE_QUEST];
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
phi_s0 = D_8082A1AC[phi_s3][2];
if (phi_s0 == -3) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT);
@ -100,7 +100,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
phi_s0 = D_8082A1AC[phi_s0][2];
}
}
} else if (pauseCtx->stickRelX > 30) {
} else if (pauseCtx->stickAdjX > 30) {
phi_s0 = D_8082A1AC[phi_s3][3];
if (phi_s0 == -2) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT);
@ -115,7 +115,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
}
}
if (pauseCtx->stickRelY < -30) {
if (pauseCtx->stickAdjY < -30) {
phi_s0 = D_8082A1AC[phi_s3][1];
while (phi_s0 >= 0) {
if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) {
@ -123,7 +123,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
}
phi_s0 = D_8082A1AC[phi_s0][1];
}
} else if (pauseCtx->stickRelY > 30) {
} else if (pauseCtx->stickAdjY > 30) {
phi_s0 = D_8082A1AC[phi_s3][0];
while (phi_s0 >= 0) {
if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) {
@ -202,7 +202,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
}
}
} else if (pauseCtx->unk_1E4 == 5) {
if ((pauseCtx->stickRelX != 0) || (pauseCtx->stickRelY != 0)) {
if ((pauseCtx->stickAdjX != 0) || (pauseCtx->stickAdjY != 0)) {
pauseCtx->unk_1E4 = 0;
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
}
@ -214,7 +214,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
}
}
} else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) {
if (pauseCtx->stickRelX > 30) {
if (pauseCtx->stickAdjX > 30) {
pauseCtx->cursorPoint[PAUSE_QUEST] = 0x15;
pauseCtx->nameDisplayTimer = 0;
pauseCtx->cursorSpecialPos = 0;
@ -232,7 +232,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
pauseCtx->cursorSlot[pauseCtx->pageIndex] = sp216;
}
} else {
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
pauseCtx->cursorPoint[PAUSE_QUEST] = 0;
pauseCtx->nameDisplayTimer = 0;
pauseCtx->cursorSpecialPos = 0;

View file

@ -110,8 +110,8 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
OPEN_DISPS(play->state.gfxCtx, "../z_kaleido_debug.c", 402);
pauseCtx->stickRelX = input->rel.stick_x;
pauseCtx->stickRelY = input->rel.stick_y;
pauseCtx->stickAdjX = input->rel.stick_x;
pauseCtx->stickAdjY = input->rel.stick_y;
Gfx_SetupDL_39Opa(play->state.gfxCtx);

View file

@ -168,7 +168,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
cursorMoveResult = 0;
while (cursorMoveResult == 0) {
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
if (pauseCtx->cursorX[PAUSE_EQUIP] != 0) {
pauseCtx->cursorX[PAUSE_EQUIP] -= 1;
pauseCtx->cursorPoint[PAUSE_EQUIP] -= 1;
@ -210,7 +210,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
cursorMoveResult = 3;
}
}
} else if (pauseCtx->stickRelX > 30) {
} else if (pauseCtx->stickAdjX > 30) {
if (pauseCtx->cursorX[PAUSE_EQUIP] < 3) {
pauseCtx->cursorX[PAUSE_EQUIP] += 1;
pauseCtx->cursorPoint[PAUSE_EQUIP] += 1;
@ -258,7 +258,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
cursorMoveResult = 0;
while (cursorMoveResult == 0) {
if (pauseCtx->stickRelY > 30) {
if (pauseCtx->stickAdjY > 30) {
if (pauseCtx->cursorY[PAUSE_EQUIP] != 0) {
pauseCtx->cursorY[PAUSE_EQUIP] -= 1;
pauseCtx->cursorPoint[PAUSE_EQUIP] -= 4;
@ -280,7 +280,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
pauseCtx->cursorPoint[PAUSE_EQUIP] = cursorPoint;
cursorMoveResult = 3;
}
} else if (pauseCtx->stickRelY < -30) {
} else if (pauseCtx->stickAdjY < -30) {
if (pauseCtx->cursorY[PAUSE_EQUIP] < 3) {
pauseCtx->cursorY[PAUSE_EQUIP] += 1;
pauseCtx->cursorPoint[PAUSE_EQUIP] += 4;
@ -303,7 +303,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
}
}
} else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) {
if (pauseCtx->stickRelX > 30) {
if (pauseCtx->stickAdjX > 30) {
pauseCtx->nameDisplayTimer = 0;
pauseCtx->cursorSpecialPos = 0;
@ -351,7 +351,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
}
}
} else {
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
pauseCtx->nameDisplayTimer = 0;
pauseCtx->cursorSpecialPos = 0;
Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,

View file

@ -114,10 +114,10 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
pauseCtx->cursorColorSet = 4;
if (cursorItem == PAUSE_ITEM_NONE) {
pauseCtx->stickRelX = 40;
pauseCtx->stickAdjX = 40;
}
if (ABS(pauseCtx->stickRelX) > 30) {
if (ABS(pauseCtx->stickAdjX) > 30) {
cursorPoint = pauseCtx->cursorPoint[PAUSE_ITEM];
cursorX = pauseCtx->cursorX[PAUSE_ITEM];
cursorY = pauseCtx->cursorY[PAUSE_ITEM];
@ -129,7 +129,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
if (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]]) {}
while (moveCursorResult == 0) {
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
if (pauseCtx->cursorX[PAUSE_ITEM] != 0) {
pauseCtx->cursorX[PAUSE_ITEM] -= 1;
pauseCtx->cursorPoint[PAUSE_ITEM] -= 1;
@ -161,7 +161,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
moveCursorResult = 2;
}
}
} else if (pauseCtx->stickRelX > 30) {
} else if (pauseCtx->stickAdjX > 30) {
if (pauseCtx->cursorX[PAUSE_ITEM] < 5) {
pauseCtx->cursorX[PAUSE_ITEM] += 1;
pauseCtx->cursorPoint[PAUSE_ITEM] += 1;
@ -205,7 +205,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
cursorItem, pauseCtx->cursorSpecialPos);
}
} else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) {
if (pauseCtx->stickRelX > 30) {
if (pauseCtx->stickAdjX > 30) {
pauseCtx->nameDisplayTimer = 0;
pauseCtx->cursorSpecialPos = 0;
@ -240,7 +240,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
}
}
} else {
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
pauseCtx->nameDisplayTimer = 0;
pauseCtx->cursorSpecialPos = 0;
@ -279,13 +279,13 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
if (pauseCtx->cursorSpecialPos == 0) {
if (cursorItem != PAUSE_ITEM_NONE) {
if (ABS(pauseCtx->stickRelY) > 30) {
if (ABS(pauseCtx->stickAdjY) > 30) {
moveCursorResult = 0;
cursorPoint = pauseCtx->cursorPoint[PAUSE_ITEM];
cursorY = pauseCtx->cursorY[PAUSE_ITEM];
while (moveCursorResult == 0) {
if (pauseCtx->stickRelY > 30) {
if (pauseCtx->stickAdjY > 30) {
if (pauseCtx->cursorY[PAUSE_ITEM] != 0) {
pauseCtx->cursorY[PAUSE_ITEM] -= 1;
pauseCtx->cursorPoint[PAUSE_ITEM] -= 6;
@ -299,7 +299,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
moveCursorResult = 2;
}
} else if (pauseCtx->stickRelY < -30) {
} else if (pauseCtx->stickAdjY < -30) {
if (pauseCtx->cursorY[PAUSE_ITEM] < 3) {
pauseCtx->cursorY[PAUSE_ITEM] += 1;
pauseCtx->cursorPoint[PAUSE_ITEM] += 6;

View file

@ -51,7 +51,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
oldCursorPoint = pauseCtx->cursorPoint[PAUSE_MAP];
if (pauseCtx->cursorSpecialPos == 0) {
if (pauseCtx->stickRelX > 30) {
if (pauseCtx->stickAdjX > 30) {
if (pauseCtx->cursorX[PAUSE_MAP] != 0) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT);
} else {
@ -67,7 +67,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
}
}
}
} else if (pauseCtx->stickRelX < -30) {
} else if (pauseCtx->stickAdjX < -30) {
if (pauseCtx->cursorX[PAUSE_MAP] == 0) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT);
} else {
@ -82,7 +82,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
}
if (pauseCtx->cursorPoint[PAUSE_MAP] < 3) {
if (pauseCtx->stickRelY > 30) {
if (pauseCtx->stickAdjY > 30) {
if (pauseCtx->cursorPoint[PAUSE_MAP] != 0) {
for (i = pauseCtx->cursorPoint[PAUSE_MAP] - 1; i >= 0; i--) {
if (CHECK_DUNGEON_ITEM(i, gSaveContext.mapIndex)) {
@ -92,7 +92,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
}
}
} else {
if (pauseCtx->stickRelY < -30) {
if (pauseCtx->stickAdjY < -30) {
if (pauseCtx->cursorPoint[PAUSE_MAP] != 2) {
for (i = pauseCtx->cursorPoint[PAUSE_MAP] + 1; i < 3; i++) {
if (CHECK_DUNGEON_ITEM(i, gSaveContext.mapIndex)) {
@ -104,7 +104,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
}
}
} else {
if (pauseCtx->stickRelY > 30) {
if (pauseCtx->stickAdjY > 30) {
if (pauseCtx->cursorPoint[PAUSE_MAP] >= 4) {
for (i = pauseCtx->cursorPoint[PAUSE_MAP] - 3 - 1; i >= 0; i--) {
if ((gSaveContext.sceneFlags[gSaveContext.mapIndex].floors & gBitFlags[i]) ||
@ -115,7 +115,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
}
}
}
} else if (pauseCtx->stickRelY < -30) {
} else if (pauseCtx->stickAdjY < -30) {
if (pauseCtx->cursorPoint[PAUSE_MAP] != 10) {
for (i = pauseCtx->cursorPoint[PAUSE_MAP] - 3 + 1; i < 11; i++) {
if ((gSaveContext.sceneFlags[gSaveContext.mapIndex].floors & gBitFlags[i]) ||
@ -138,7 +138,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
}
}
} else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) {
if (pauseCtx->stickRelX > 30) {
if (pauseCtx->stickAdjX > 30) {
pauseCtx->nameDisplayTimer = 0;
pauseCtx->cursorSpecialPos = 0;
pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->dungeonMapSlot;
@ -149,7 +149,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}
} else {
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
pauseCtx->nameDisplayTimer = 0;
pauseCtx->cursorSpecialPos = 0;
pauseCtx->cursorX[PAUSE_MAP] = 1;
@ -415,7 +415,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) {
oldCursorPoint = pauseCtx->cursorPoint[PAUSE_WORLD_MAP];
if (pauseCtx->cursorSpecialPos == 0) {
if (pauseCtx->stickRelX > 30) {
if (pauseCtx->stickAdjX > 30) {
D_8082A6D4 = 0;
do {
@ -426,7 +426,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) {
break;
}
} while (pauseCtx->worldMapPoints[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]] == 0);
} else if (pauseCtx->stickRelX < -30) {
} else if (pauseCtx->stickAdjX < -30) {
D_8082A6D4 = 0;
do {
@ -447,7 +447,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) {
} else {
pauseCtx->cursorItem[PAUSE_MAP] = gSaveContext.worldMapArea + 0x18;
if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) {
if (pauseCtx->stickRelX > 30) {
if (pauseCtx->stickAdjX > 30) {
pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = 0;
pauseCtx->cursorSpecialPos = 0;
@ -463,7 +463,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) {
D_8082A6D4 = 0;
}
} else {
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = 11;
pauseCtx->cursorSpecialPos = 0;

View file

@ -5,15 +5,15 @@ static s16 D_8082A6E0[] = { 100, 255 };
void KaleidoScope_UpdatePrompt(PlayState* play) {
PauseContext* pauseCtx = &play->pauseCtx;
Input* input = &play->state.input[0];
s8 relStickX = input->rel.stick_x;
s8 stickAdjX = input->rel.stick_x;
s16 step;
if (((pauseCtx->state == 7) && (pauseCtx->unk_1EC == 1)) || (pauseCtx->state == 0xE) || (pauseCtx->state == 0x10)) {
if ((pauseCtx->promptChoice == 0) && (relStickX >= 30)) {
if ((pauseCtx->promptChoice == 0) && (stickAdjX >= 30)) {
Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
pauseCtx->promptChoice = 4;
} else if ((pauseCtx->promptChoice != 0) && (relStickX <= -30)) {
} else if ((pauseCtx->promptChoice != 0) && (stickAdjX <= -30)) {
Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
pauseCtx->promptChoice = 0;

View file

@ -408,7 +408,7 @@ void KaleidoScope_HandlePageToggles(PauseContext* pauseCtx, Input* input) {
}
if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) {
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
pauseCtx->pageSwitchTimer++;
if ((pauseCtx->pageSwitchTimer >= 10) || (pauseCtx->pageSwitchTimer == 0)) {
KaleidoScope_SwitchPage(pauseCtx, 0);
@ -417,7 +417,7 @@ void KaleidoScope_HandlePageToggles(PauseContext* pauseCtx, Input* input) {
pauseCtx->pageSwitchTimer = -1;
}
} else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_RIGHT) {
if (pauseCtx->stickRelX > 30) {
if (pauseCtx->stickAdjX > 30) {
pauseCtx->pageSwitchTimer++;
if ((pauseCtx->pageSwitchTimer >= 10) || (pauseCtx->pageSwitchTimer == 0)) {
KaleidoScope_SwitchPage(pauseCtx, 2);
@ -552,23 +552,23 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) {
}
}
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
if (D_8082AD4C == -1) {
if (--D_8082AD44 < 0) {
D_8082AD44 = XREG(6);
} else {
pauseCtx->stickRelX = 0;
pauseCtx->stickAdjX = 0;
}
} else {
D_8082AD44 = XREG(8);
D_8082AD4C = -1;
}
} else if (pauseCtx->stickRelX > 30) {
} else if (pauseCtx->stickAdjX > 30) {
if (D_8082AD4C == 1) {
if (--D_8082AD44 < 0) {
D_8082AD44 = XREG(6);
} else {
pauseCtx->stickRelX = 0;
pauseCtx->stickAdjX = 0;
}
} else {
D_8082AD44 = XREG(8);
@ -578,23 +578,23 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) {
D_8082AD4C = 0;
}
if (pauseCtx->stickRelY < -30) {
if (pauseCtx->stickAdjY < -30) {
if (D_8082AD50 == -1) {
if (--D_8082AD48 < 0) {
D_8082AD48 = XREG(6);
} else {
pauseCtx->stickRelY = 0;
pauseCtx->stickAdjY = 0;
}
} else {
D_8082AD48 = XREG(8);
D_8082AD50 = -1;
}
} else if (pauseCtx->stickRelY > 30) {
} else if (pauseCtx->stickAdjY > 30) {
if (D_8082AD50 == 1) {
if (--D_8082AD48 < 0) {
D_8082AD48 = XREG(6);
} else {
pauseCtx->stickRelY = 0;
pauseCtx->stickAdjY = 0;
}
} else {
D_8082AD48 = XREG(8);
@ -2262,8 +2262,8 @@ void KaleidoScope_Draw(PlayState* play) {
OPEN_DISPS(play->state.gfxCtx, "../z_kaleido_scope_PAL.c", 3188);
pauseCtx->stickRelX = input->rel.stick_x;
pauseCtx->stickRelY = input->rel.stick_y;
pauseCtx->stickAdjX = input->rel.stick_x;
pauseCtx->stickAdjY = input->rel.stick_y;
gSPSegment(POLY_OPA_DISP++, 0x02, interfaceCtx->parameterSegment);
gSPSegment(POLY_OPA_DISP++, 0x07, pauseCtx->playerSegment);
@ -2492,8 +2492,8 @@ void KaleidoScope_Update(PlayState* play) {
((pauseCtx->state >= 0xA) && (pauseCtx->state <= 0x12)))) {
if ((!pauseCtx->unk_1E4 || (pauseCtx->unk_1E4 == 8)) && (pauseCtx->state == 6)) {
pauseCtx->stickRelX = input->rel.stick_x;
pauseCtx->stickRelY = input->rel.stick_y;
pauseCtx->stickAdjX = input->rel.stick_x;
pauseCtx->stickAdjY = input->rel.stick_y;
KaleidoScope_UpdateCursorSize(play);
KaleidoScope_HandlePageToggles(pauseCtx, input);
} else if ((pauseCtx->pageIndex == PAUSE_QUEST) && ((pauseCtx->unk_1E4 < 3) || (pauseCtx->unk_1E4 == 5))) {