From 9f9a0e2f51bc877959defb8bf51d9eebebcf5d31 Mon Sep 17 00:00:00 2001 From: Josh Bodner Date: Wed, 30 Mar 2022 21:02:57 -0700 Subject: [PATCH] Added DPad support to file selection and pause screens --- .../ovl_file_choose/z_file_choose.c | 6 +- .../ovl_file_choose/z_file_copy_erase.c | 16 +- .../ovl_file_choose/z_file_nameset_PAL.c | 19 +- .../ovl_kaleido_scope/z_kaleido_collect.c | 162 +++++++++--------- .../ovl_kaleido_scope/z_kaleido_equipment.c | 12 +- .../misc/ovl_kaleido_scope/z_kaleido_item.c | 16 +- .../ovl_kaleido_scope/z_kaleido_map_PAL.c | 28 +-- .../misc/ovl_kaleido_scope/z_kaleido_prompt.c | 4 +- .../ovl_kaleido_scope/z_kaleido_scope_PAL.c | 4 +- 9 files changed, 133 insertions(+), 134 deletions(-) diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index ca5154567..9cfcc9bae 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -237,10 +237,10 @@ void FileChoose_UpdateMainMenu(GameState* thisx) { } } } else { - if (ABS(this->stickRelY) > 30) { + if ((ABS(this->stickRelY) > 30) || CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - if (this->stickRelY > 30) { + if ((this->stickRelY > 30) || CHECK_BTN_ALL(input->press.button, BTN_DUP)) { this->buttonIndex--; if (this->buttonIndex < FS_BTN_MAIN_FILE_1) { this->buttonIndex = FS_BTN_MAIN_OPTIONS; @@ -1332,7 +1332,7 @@ void FileChoose_ConfirmFile(GameState* thisx) { } else if (CHECK_BTN_ALL(input->press.button, BTN_B)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->selectMode++; - } else if (ABS(this->stickRelY) >= 30) { + } else if ((ABS(this->stickRelY) >= 30) || CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->confirmButtonIndex ^= 1; } diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c index 5d13c408d..865c1c397 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c @@ -82,10 +82,10 @@ void FileChoose_SelectCopySource(GameState* thisx) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } } else { - if (ABS(this->stickRelY) >= 30) { + if ((ABS(this->stickRelY) >= 30) || CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - if (this->stickRelY >= 30) { + if ((this->stickRelY >= 30) || CHECK_BTN_ALL(input->press.button, BTN_DUP)) { this->buttonIndex--; if (this->buttonIndex < FS_BTN_COPY_FILE_1) { @@ -194,10 +194,10 @@ void FileChoose_SelectCopyDest(GameState* thisx) { } } else { - if (ABS(this->stickRelY) >= 30) { + if ((ABS(this->stickRelY) >= 30) || CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - if (this->stickRelY >= 30) { + if ((this->stickRelY >= 30) || CHECK_BTN_ALL(input->press.button, BTN_DUP)) { this->buttonIndex--; if ((this->buttonIndex == this->selectedFileIndex)) { @@ -377,7 +377,7 @@ void FileChoose_CopyConfirm(GameState* thisx) { this->configMode = CM_COPY_ANIM_1; func_800AA000(300.0f, 0xB4, 0x14, 0x64); Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - } else if (ABS(this->stickRelY) >= 30) { + } else if ((ABS(this->stickRelY) >= 30) || CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->buttonIndex ^= 1; } @@ -700,10 +700,10 @@ void FileChoose_EraseSelect(GameState* thisx) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } } else { - if (ABS(this->stickRelY) >= 30) { + if ((ABS(this->stickRelY) >= 30) || CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - if (this->stickRelY >= 30) { + if ((this->stickRelY >= 30) || CHECK_BTN_ALL(input->press.button, BTN_DUP)) { this->buttonIndex--; if (this->buttonIndex < FS_BTN_ERASE_FILE_1) { this->buttonIndex = FS_BTN_ERASE_QUIT; @@ -833,7 +833,7 @@ void FileChoose_EraseConfirm(GameState* thisx) { this->nextTitleLabel = FS_TITLE_ERASE_COMPLETE; func_800AA000(200.0f, 0xFF, 0x14, 0x96); sEraseDelayTimer = 15; - } else if (ABS(this->stickRelY) >= 30) { + } else if ((ABS(this->stickRelY) >= 30) || CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->buttonIndex ^= 1; } diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c index 73aa5e6d1..0787b30be 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c @@ -509,12 +509,13 @@ void FileChoose_StartNameEntry(GameState* thisx) { */ void FileChoose_UpdateKeyboardCursor(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; + Input* input = &this->state.input[0]; s16 prevKbdX; this->kbdButton = 99; if (this->kbdY != 5) { - if (this->stickRelX < -30) { + if ((this->stickRelX < -30) || CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->charIndex--; this->kbdX--; @@ -522,7 +523,7 @@ void FileChoose_UpdateKeyboardCursor(GameState* thisx) { this->kbdX = 12; this->charIndex = (this->kbdY * 13) + this->kbdX; } - } else if (this->stickRelX > 30) { + } else if ((this->stickRelX > 30) || CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->charIndex++; this->kbdX++; @@ -532,13 +533,13 @@ void FileChoose_UpdateKeyboardCursor(GameState* thisx) { } } } else { - if (this->stickRelX < -30) { + if ((this->stickRelX < -30) || CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->kbdX--; if (this->kbdX < 3) { this->kbdX = 4; } - } else if (this->stickRelX > 30) { + } else if ((this->stickRelX > 30) || CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->kbdX++; if (this->kbdX > 4) { @@ -547,7 +548,7 @@ void FileChoose_UpdateKeyboardCursor(GameState* thisx) { } } - if (this->stickRelY > 30) { + if ((this->stickRelY > 30) || CHECK_BTN_ALL(input->press.button, BTN_DUP)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->kbdY--; @@ -578,7 +579,7 @@ void FileChoose_UpdateKeyboardCursor(GameState* thisx) { this->charIndex += this->kbdX; } } - } else if (this->stickRelY < -30) { + } else if ((this->stickRelY < -30) || CHECK_BTN_ALL(input->press.button, BTN_DDOWN)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->kbdY++; @@ -675,7 +676,7 @@ void FileChoose_UpdateOptionsMenu(GameState* thisx) { return; } - if (this->stickRelX < -30) { + if ((this->stickRelX < -30) || CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); if (sSelectedSetting == FS_SETTING_AUDIO) { @@ -688,7 +689,7 @@ void FileChoose_UpdateOptionsMenu(GameState* thisx) { } else { gSaveContext.zTargetSetting ^= 1; } - } else if (this->stickRelX > 30) { + } else if ((this->stickRelX > 30) || CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); if (sSelectedSetting == FS_SETTING_AUDIO) { @@ -702,7 +703,7 @@ void FileChoose_UpdateOptionsMenu(GameState* thisx) { } } - if ((this->stickRelY < -30) || (this->stickRelY > 30)) { + if ((ABS(this->stickRelY) > 30) || CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); sSelectedSetting ^= 1; } else if (CHECK_BTN_ALL(input->press.button, BTN_A)) { diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c index 46be1154f..271dbb0c9 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c @@ -83,96 +83,92 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx if (pauseCtx->cursorSpecialPos == 0) { pauseCtx->nameColorSet = 0; + sp216 = pauseCtx->cursorSlot[PAUSE_QUEST]; + phi_s3 = pauseCtx->cursorPoint[PAUSE_QUEST]; - if ((pauseCtx->state != 6) || ((pauseCtx->stickRelX == 0) && (pauseCtx->stickRelY == 0))) { - sp216 = pauseCtx->cursorSlot[PAUSE_QUEST]; - } else { - phi_s3 = pauseCtx->cursorPoint[PAUSE_QUEST]; - - if (pauseCtx->stickRelX < -30) { - phi_s0 = D_8082A1AC[phi_s3][2]; - if (phi_s0 == -3) { - KaleidoScope_MoveCursorToSpecialPos(globalCtx, PAUSE_CURSOR_PAGE_LEFT); - pauseCtx->unk_1E4 = 0; - } else { - while (phi_s0 >= 0) { - if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { - break; - } - phi_s0 = D_8082A1AC[phi_s0][2]; - } - } - } else if (pauseCtx->stickRelX > 30) { - phi_s0 = D_8082A1AC[phi_s3][3]; - if (phi_s0 == -2) { - KaleidoScope_MoveCursorToSpecialPos(globalCtx, PAUSE_CURSOR_PAGE_RIGHT); - pauseCtx->unk_1E4 = 0; - } else { - while (phi_s0 >= 0) { - if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { - break; - } - phi_s0 = D_8082A1AC[phi_s0][3]; - } - } - } - - if (pauseCtx->stickRelY < -30) { - phi_s0 = D_8082A1AC[phi_s3][1]; - while (phi_s0 >= 0) { - if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { - break; - } - phi_s0 = D_8082A1AC[phi_s0][1]; - } - } else if (pauseCtx->stickRelY > 30) { - phi_s0 = D_8082A1AC[phi_s3][0]; - while (phi_s0 >= 0) { - if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { - break; - } - phi_s0 = D_8082A1AC[phi_s0][0]; - } - } - - if (phi_s3 != pauseCtx->cursorPoint[PAUSE_QUEST]) { + if ((pauseCtx->stickRelX < -30) || CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { + phi_s0 = D_8082A1AC[phi_s3][2]; + if (phi_s0 == -3) { + KaleidoScope_MoveCursorToSpecialPos(globalCtx, PAUSE_CURSOR_PAGE_LEFT); pauseCtx->unk_1E4 = 0; - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - } - - if (pauseCtx->cursorPoint[PAUSE_QUEST] != 0x18) { - if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) { - if (pauseCtx->cursorPoint[PAUSE_QUEST] < 6) { - phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x66; - osSyncPrintf("000 ccc=%d\n", phi_s0_2); - } else if (pauseCtx->cursorPoint[PAUSE_QUEST] < 0x12) { - phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x54; - osSyncPrintf("111 ccc=%d\n", phi_s0_2); - } else { - phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x5A; - osSyncPrintf("222 ccc=%d (%d, %d, %d)\n", phi_s0_2, pauseCtx->cursorPoint[PAUSE_QUEST], - 0x12, 0x6C); + } else { + while (phi_s0 >= 0) { + if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { + break; } + phi_s0 = D_8082A1AC[phi_s0][2]; + } + } + } else if ((pauseCtx->stickRelX > 30) || CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { + phi_s0 = D_8082A1AC[phi_s3][3]; + if (phi_s0 == -2) { + KaleidoScope_MoveCursorToSpecialPos(globalCtx, PAUSE_CURSOR_PAGE_RIGHT); + pauseCtx->unk_1E4 = 0; + } else { + while (phi_s0 >= 0) { + if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { + break; + } + phi_s0 = D_8082A1AC[phi_s0][3]; + } + } + } + + if ((pauseCtx->stickRelY < -30) || CHECK_BTN_ALL(input->press.button, BTN_DDOWN)) { + phi_s0 = D_8082A1AC[phi_s3][1]; + while (phi_s0 >= 0) { + if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { + break; + } + phi_s0 = D_8082A1AC[phi_s0][1]; + } + } else if ((pauseCtx->stickRelY > 30) || CHECK_BTN_ALL(input->press.button, BTN_DUP)) { + phi_s0 = D_8082A1AC[phi_s3][0]; + while (phi_s0 >= 0) { + if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { + break; + } + phi_s0 = D_8082A1AC[phi_s0][0]; + } + } + + if (phi_s3 != pauseCtx->cursorPoint[PAUSE_QUEST]) { + pauseCtx->unk_1E4 = 0; + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + } + + if (pauseCtx->cursorPoint[PAUSE_QUEST] != 0x18) { + if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) { + if (pauseCtx->cursorPoint[PAUSE_QUEST] < 6) { + phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x66; + osSyncPrintf("000 ccc=%d\n", phi_s0_2); + } else if (pauseCtx->cursorPoint[PAUSE_QUEST] < 0x12) { + phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x54; + osSyncPrintf("111 ccc=%d\n", phi_s0_2); } else { - phi_s0_2 = PAUSE_ITEM_NONE; - osSyncPrintf("999 ccc=%d (%d, %d)\n", PAUSE_ITEM_NONE, pauseCtx->cursorPoint[PAUSE_QUEST], - 0x18); + phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x5A; + osSyncPrintf("222 ccc=%d (%d, %d, %d)\n", phi_s0_2, pauseCtx->cursorPoint[PAUSE_QUEST], + 0x12, 0x6C); } } else { - if ((gSaveContext.inventory.questItems & 0xF0000000) != 0) { - phi_s0_2 = 0x72; - } else { - phi_s0_2 = PAUSE_ITEM_NONE; - } - osSyncPrintf("888 ccc=%d (%d, %d, %x)\n", phi_s0_2, pauseCtx->cursorPoint[PAUSE_QUEST], 0x72, - gSaveContext.inventory.questItems & 0xF0000000); + phi_s0_2 = PAUSE_ITEM_NONE; + osSyncPrintf("999 ccc=%d (%d, %d)\n", PAUSE_ITEM_NONE, pauseCtx->cursorPoint[PAUSE_QUEST], + 0x18); } - - sp216 = pauseCtx->cursorPoint[PAUSE_QUEST]; - pauseCtx->cursorItem[pauseCtx->pageIndex] = phi_s0_2; - pauseCtx->cursorSlot[pauseCtx->pageIndex] = sp216; + } else { + if ((gSaveContext.inventory.questItems & 0xF0000000) != 0) { + phi_s0_2 = 0x72; + } else { + phi_s0_2 = PAUSE_ITEM_NONE; + } + osSyncPrintf("888 ccc=%d (%d, %d, %x)\n", phi_s0_2, pauseCtx->cursorPoint[PAUSE_QUEST], 0x72, + gSaveContext.inventory.questItems & 0xF0000000); } + sp216 = pauseCtx->cursorPoint[PAUSE_QUEST]; + pauseCtx->cursorItem[pauseCtx->pageIndex] = phi_s0_2; + pauseCtx->cursorSlot[pauseCtx->pageIndex] = sp216; + KaleidoScope_SetCursorVtx(pauseCtx, sp216 * 4, pauseCtx->questVtx); if ((pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0) && (pauseCtx->cursorSpecialPos == 0)) { @@ -215,7 +211,7 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx } } } else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { - if (pauseCtx->stickRelX > 30) { + if ((pauseCtx->stickRelX > 30) || CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { pauseCtx->cursorPoint[PAUSE_QUEST] = 0x15; pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; @@ -232,7 +228,7 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx pauseCtx->cursorSlot[pauseCtx->pageIndex] = sp216; } } else { - if (pauseCtx->stickRelX < -30) { + if ((pauseCtx->stickRelX < -30) || CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { pauseCtx->cursorPoint[PAUSE_QUEST] = 0; pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index 3c236637b..d365c5ee4 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -174,7 +174,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { cursorMoveResult = 0; while (cursorMoveResult == 0) { - if (pauseCtx->stickRelX < -30) { + if ((pauseCtx->stickRelX < -30) || CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { if (pauseCtx->cursorX[PAUSE_EQUIP] != 0) { pauseCtx->cursorX[PAUSE_EQUIP] -= 1; pauseCtx->cursorPoint[PAUSE_EQUIP] -= 1; @@ -216,7 +216,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { cursorMoveResult = 3; } } - } else if (pauseCtx->stickRelX > 30) { + } else if ((pauseCtx->stickRelX > 30) || CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { if (pauseCtx->cursorX[PAUSE_EQUIP] < 3) { pauseCtx->cursorX[PAUSE_EQUIP] += 1; pauseCtx->cursorPoint[PAUSE_EQUIP] += 1; @@ -264,7 +264,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { cursorMoveResult = 0; while (cursorMoveResult == 0) { - if (pauseCtx->stickRelY > 30) { + if ((pauseCtx->stickRelY > 30) || CHECK_BTN_ALL(input->press.button, BTN_DUP)) { if (pauseCtx->cursorY[PAUSE_EQUIP] != 0) { pauseCtx->cursorY[PAUSE_EQUIP] -= 1; pauseCtx->cursorPoint[PAUSE_EQUIP] -= 4; @@ -286,7 +286,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { pauseCtx->cursorPoint[PAUSE_EQUIP] = cursorPoint; cursorMoveResult = 3; } - } else if (pauseCtx->stickRelY < -30) { + } else if ((pauseCtx->stickRelY < -30) || CHECK_BTN_ALL(input->press.button, BTN_DDOWN)) { if (pauseCtx->cursorY[PAUSE_EQUIP] < 3) { pauseCtx->cursorY[PAUSE_EQUIP] += 1; pauseCtx->cursorPoint[PAUSE_EQUIP] += 4; @@ -309,7 +309,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { } } } else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { - if (pauseCtx->stickRelX > 30) { + if ((pauseCtx->stickRelX > 30) || CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; @@ -356,7 +356,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { } } } else { - if (pauseCtx->stickRelX < -30) { + if ((pauseCtx->stickRelX < -30) || CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index bb42ff711..cce1185be 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -120,7 +120,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { pauseCtx->stickRelX = 40; } - if (ABS(pauseCtx->stickRelX) > 30) { + if ((ABS(pauseCtx->stickRelX) > 30) || CHECK_BTN_ANY(input->press.button, BTN_DLEFT | BTN_DRIGHT)) { cursorPoint = pauseCtx->cursorPoint[PAUSE_ITEM]; cursorX = pauseCtx->cursorX[PAUSE_ITEM]; cursorY = pauseCtx->cursorY[PAUSE_ITEM]; @@ -132,7 +132,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { if (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]]) {} while (moveCursorResult == 0) { - if (pauseCtx->stickRelX < -30) { + if ((pauseCtx->stickRelX < -30) || CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { if (pauseCtx->cursorX[PAUSE_ITEM] != 0) { pauseCtx->cursorX[PAUSE_ITEM] -= 1; pauseCtx->cursorPoint[PAUSE_ITEM] -= 1; @@ -164,7 +164,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { moveCursorResult = 2; } } - } else if (pauseCtx->stickRelX > 30) { + } else if ((pauseCtx->stickRelX > 30) || CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { if (pauseCtx->cursorX[PAUSE_ITEM] < 5) { pauseCtx->cursorX[PAUSE_ITEM] += 1; pauseCtx->cursorPoint[PAUSE_ITEM] += 1; @@ -208,7 +208,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { cursorItem, pauseCtx->cursorSpecialPos); } } else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { - if (pauseCtx->stickRelX > 30) { + if ((pauseCtx->stickRelX > 30) || CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; @@ -242,7 +242,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { } } } else { - if (pauseCtx->stickRelX < -30) { + if ((pauseCtx->stickRelX < -30) || CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; @@ -280,13 +280,13 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { if (pauseCtx->cursorSpecialPos == 0) { if (cursorItem != PAUSE_ITEM_NONE) { - if (ABS(pauseCtx->stickRelY) > 30) { + if ((ABS(pauseCtx->stickRelY) > 30) || CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP)) { moveCursorResult = 0; cursorPoint = pauseCtx->cursorPoint[PAUSE_ITEM]; cursorY = pauseCtx->cursorY[PAUSE_ITEM]; while (moveCursorResult == 0) { - if (pauseCtx->stickRelY > 30) { + if ((pauseCtx->stickRelY > 30) || CHECK_BTN_ALL(input->press.button, BTN_DUP)) { if (pauseCtx->cursorY[PAUSE_ITEM] != 0) { pauseCtx->cursorY[PAUSE_ITEM] -= 1; pauseCtx->cursorPoint[PAUSE_ITEM] -= 6; @@ -300,7 +300,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { moveCursorResult = 2; } - } else if (pauseCtx->stickRelY < -30) { + } else if ((pauseCtx->stickRelY < -30) || CHECK_BTN_ALL(input->press.button, BTN_DDOWN)) { if (pauseCtx->cursorY[PAUSE_ITEM] < 3) { pauseCtx->cursorY[PAUSE_ITEM] += 1; pauseCtx->cursorPoint[PAUSE_ITEM] += 6; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c index af5c2b424..062e6ffcc 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c @@ -36,6 +36,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC static u16 mapBgPulseStage = 0; InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; PauseContext* pauseCtx = &globalCtx->pauseCtx; + Input* input = &globalCtx->state.input[0]; s16 i; s16 j; s16 oldCursorPoint; @@ -51,7 +52,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC oldCursorPoint = pauseCtx->cursorPoint[PAUSE_MAP]; if (pauseCtx->cursorSpecialPos == 0) { - if (pauseCtx->stickRelX > 30) { + if ((pauseCtx->stickRelX > 30) || CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { if (pauseCtx->cursorX[PAUSE_MAP] != 0) { KaleidoScope_MoveCursorToSpecialPos(globalCtx, PAUSE_CURSOR_PAGE_RIGHT); } else { @@ -67,7 +68,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC } } } - } else if (pauseCtx->stickRelX < -30) { + } else if ((pauseCtx->stickRelX < -30) || CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { if (pauseCtx->cursorX[PAUSE_MAP] == 0) { KaleidoScope_MoveCursorToSpecialPos(globalCtx, PAUSE_CURSOR_PAGE_LEFT); } else { @@ -82,7 +83,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC } if (pauseCtx->cursorPoint[PAUSE_MAP] < 3) { - if (pauseCtx->stickRelY > 30) { + if ((pauseCtx->stickRelY > 30) || CHECK_BTN_ALL(input->press.button, BTN_DUP)) { 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 +93,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC } } } else { - if (pauseCtx->stickRelY < -30) { + if ((pauseCtx->stickRelY < -30) || CHECK_BTN_ALL(input->press.button, BTN_DDOWN)) { 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 +105,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC } } } else { - if (pauseCtx->stickRelY > 30) { + if ((pauseCtx->stickRelY > 30) || CHECK_BTN_ALL(input->press.button, BTN_DUP)) { 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 +116,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC } } } - } else if (pauseCtx->stickRelY < -30) { + } else if ((pauseCtx->stickRelY < -30) || CHECK_BTN_ALL(input->press.button, BTN_DDOWN)) { 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 +139,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC } } } else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { - if (pauseCtx->stickRelX > 30) { + if ((pauseCtx->stickRelX > 30) || CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->dungeonMapSlot; @@ -148,7 +149,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } } else { - if (pauseCtx->stickRelX < -30) { + if ((pauseCtx->stickRelX < -30) || CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; pauseCtx->cursorX[PAUSE_MAP] = 1; @@ -396,6 +397,7 @@ void KaleidoScope_DrawWorldMap(GlobalContext* globalCtx, GraphicsContext* gfxCtx }; static u16 D_8082A6D4 = 0; PauseContext* pauseCtx = &globalCtx->pauseCtx; + Input* input = &globalCtx->state.input[0]; s16 i; s16 j; s16 t; @@ -412,7 +414,7 @@ void KaleidoScope_DrawWorldMap(GlobalContext* globalCtx, GraphicsContext* gfxCtx oldCursorPoint = pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; if (pauseCtx->cursorSpecialPos == 0) { - if (pauseCtx->stickRelX > 30) { + if ((pauseCtx->stickRelX > 30) || CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { D_8082A6D4 = 0; do { @@ -423,7 +425,7 @@ void KaleidoScope_DrawWorldMap(GlobalContext* globalCtx, GraphicsContext* gfxCtx break; } } while (pauseCtx->worldMapPoints[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]] == 0); - } else if (pauseCtx->stickRelX < -30) { + } else if ((pauseCtx->stickRelX < -30) || CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { D_8082A6D4 = 0; do { @@ -444,7 +446,7 @@ void KaleidoScope_DrawWorldMap(GlobalContext* globalCtx, GraphicsContext* gfxCtx } else { pauseCtx->cursorItem[PAUSE_MAP] = gSaveContext.worldMapArea + 0x18; if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { - if (pauseCtx->stickRelX > 30) { + if ((pauseCtx->stickRelX > 30) || CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = 0; pauseCtx->cursorSpecialPos = 0; @@ -459,7 +461,7 @@ void KaleidoScope_DrawWorldMap(GlobalContext* globalCtx, GraphicsContext* gfxCtx D_8082A6D4 = 0; } } else { - if (pauseCtx->stickRelX < -30) { + if ((pauseCtx->stickRelX < -30) || CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = 11; pauseCtx->cursorSpecialPos = 0; @@ -663,7 +665,7 @@ void KaleidoScope_DrawWorldMap(GlobalContext* globalCtx, GraphicsContext* gfxCtx gDPLoadTextureBlock(POLY_KAL_DISP++, gWorldMapDotTex, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 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); - for (j = i = 0; i < 12; i++, t++, j += 4) { + for (j = t = i = 0; i < 12; i++, t++, j += 4) { if (pauseCtx->worldMapPoints[i] != 0) { gDPPipeSync(POLY_KAL_DISP++); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c index c16404fb2..8a99d685b 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c @@ -9,10 +9,10 @@ void KaleidoScope_UpdatePrompt(GlobalContext* globalCtx) { 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) && ((relStickX >= 30) || CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); pauseCtx->promptChoice = 4; - } else if ((pauseCtx->promptChoice != 0) && (relStickX <= -30)) { + } else if ((pauseCtx->promptChoice != 0) && ((relStickX <= -30) || CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); pauseCtx->promptChoice = 0; } diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index a5c160700..d8f303762 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -967,7 +967,7 @@ void KaleidoScope_HandlePageToggles(PauseContext* pauseCtx, Input* input) { } if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { - if (pauseCtx->stickRelX < -30) { + if ((pauseCtx->stickRelX < -30) || CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { pauseCtx->pageSwitchTimer++; if ((pauseCtx->pageSwitchTimer >= 10) || (pauseCtx->pageSwitchTimer == 0)) { KaleidoScope_SwitchPage(pauseCtx, 0); @@ -976,7 +976,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->stickRelX > 30) || CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { pauseCtx->pageSwitchTimer++; if ((pauseCtx->pageSwitchTimer >= 10) || (pauseCtx->pageSwitchTimer == 0)) { KaleidoScope_SwitchPage(pauseCtx, 2);