2020-10-03 15:22:44 +00:00
|
|
|
|
#include "global.h"
|
2020-06-17 19:23:42 +00:00
|
|
|
|
|
2021-05-02 23:15:16 +00:00
|
|
|
|
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[] = { 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 };
|
2020-06-17 19:23:42 +00:00
|
|
|
|
|
|
|
|
|
void KaleidoSetup_Update(GlobalContext* globalCtx) {
|
|
|
|
|
PauseContext* pauseCtx = &globalCtx->pauseCtx;
|
|
|
|
|
Input* input = &globalCtx->state.input[0];
|
|
|
|
|
|
2021-05-02 23:15:16 +00:00
|
|
|
|
if (pauseCtx->state == 0 && pauseCtx->debugState == 0 && globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE &&
|
2022-04-27 20:00:25 +00:00
|
|
|
|
globalCtx->transitionTrigger == TRANS_TRIGGER_OFF && globalCtx->transitionMode == TRANS_MODE_OFF &&
|
2022-05-17 22:41:50 +00:00
|
|
|
|
gSaveContext.cutsceneIndex < 0xFFF0 && gSaveContext.nextCutsceneIndex < 0xFFF0 && !Play_InCsMode(globalCtx) &&
|
|
|
|
|
globalCtx->shootingGalleryStatus <= 1 && gSaveContext.unk_13F0 != 8 && gSaveContext.unk_13F0 != 9 &&
|
|
|
|
|
(globalCtx->sceneNum != SCENE_BOWLING || !Flags_GetSwitch(globalCtx, 0x38))) {
|
2020-06-17 19:23:42 +00:00
|
|
|
|
|
2020-10-03 15:22:44 +00:00
|
|
|
|
if (CHECK_BTN_ALL(input->cur.button, BTN_L) && CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
|
2020-06-17 19:23:42 +00:00
|
|
|
|
if (BREG(0)) {
|
2021-05-02 23:15:16 +00:00
|
|
|
|
pauseCtx->debugState = 3;
|
2020-06-17 19:23:42 +00:00
|
|
|
|
}
|
2020-10-03 15:22:44 +00:00
|
|
|
|
} else if (CHECK_BTN_ALL(input->press.button, BTN_START)) {
|
2020-06-17 19:23:42 +00:00
|
|
|
|
gSaveContext.unk_13EE = gSaveContext.unk_13EA;
|
2021-05-02 23:15:16 +00:00
|
|
|
|
|
|
|
|
|
WREG(16) = -175;
|
|
|
|
|
WREG(17) = 155;
|
|
|
|
|
|
2020-06-17 19:23:42 +00:00
|
|
|
|
pauseCtx->unk_1EA = 0;
|
|
|
|
|
pauseCtx->unk_1E4 = 1;
|
2021-05-02 23:15:16 +00:00
|
|
|
|
|
2020-06-17 19:23:42 +00:00
|
|
|
|
if (ZREG(48) == 0) {
|
2021-05-02 23:15:16 +00:00
|
|
|
|
pauseCtx->eye.x = sKaleidoSetupEyeX0[pauseCtx->pageIndex];
|
|
|
|
|
pauseCtx->eye.z = sKaleidoSetupEyeZ0[pauseCtx->pageIndex];
|
|
|
|
|
pauseCtx->pageIndex = sKaleidoSetupKscpPos0[pauseCtx->pageIndex];
|
2020-06-17 19:23:42 +00:00
|
|
|
|
} else {
|
2021-05-02 23:15:16 +00:00
|
|
|
|
pauseCtx->eye.x = sKaleidoSetupEyeX1[pauseCtx->pageIndex];
|
|
|
|
|
pauseCtx->eye.z = sKaleidoSetupEyeZ1[pauseCtx->pageIndex];
|
|
|
|
|
pauseCtx->pageIndex = sKaleidoSetupKscpPos1[pauseCtx->pageIndex];
|
2020-06-17 19:23:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-05-02 23:15:16 +00:00
|
|
|
|
pauseCtx->mode = (u16)(pauseCtx->pageIndex * 2) + 1;
|
2020-06-17 19:23:42 +00:00
|
|
|
|
pauseCtx->state = 1;
|
2021-05-02 23:15:16 +00:00
|
|
|
|
|
2020-10-13 16:32:19 +00:00
|
|
|
|
osSyncPrintf("Mode=%d eye.x=%f, eye.z=%f kscp_pos=%d\n", pauseCtx->mode, pauseCtx->eye.x,
|
2021-05-02 23:15:16 +00:00
|
|
|
|
pauseCtx->eye.z, pauseCtx->pageIndex);
|
2020-06-17 19:23:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (pauseCtx->state == 1) {
|
2021-05-02 23:15:16 +00:00
|
|
|
|
WREG(2) = -6240;
|
2020-06-17 19:23:42 +00:00
|
|
|
|
R_UPDATE_RATE = 2;
|
2021-05-02 23:15:16 +00:00
|
|
|
|
|
2020-07-09 01:54:39 +00:00
|
|
|
|
if (ShrinkWindow_GetVal()) {
|
|
|
|
|
ShrinkWindow_SetVal(0);
|
2020-06-17 19:23:42 +00:00
|
|
|
|
}
|
2021-05-02 23:15:16 +00:00
|
|
|
|
|
2020-06-17 19:23:42 +00:00
|
|
|
|
func_800F64E0(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KaleidoSetup_Init(GlobalContext* globalCtx) {
|
|
|
|
|
PauseContext* pauseCtx = &globalCtx->pauseCtx;
|
2021-05-02 23:15:16 +00:00
|
|
|
|
u64 temp = 0; // Necessary to match
|
2020-08-23 21:50:30 +00:00
|
|
|
|
|
2020-06-17 19:23:42 +00:00
|
|
|
|
pauseCtx->state = 0;
|
2021-05-02 23:15:16 +00:00
|
|
|
|
pauseCtx->debugState = 0;
|
|
|
|
|
pauseCtx->alpha = 0;
|
2020-06-17 19:23:42 +00:00
|
|
|
|
pauseCtx->unk_1EA = 0;
|
|
|
|
|
pauseCtx->unk_1E4 = 0;
|
|
|
|
|
pauseCtx->mode = 0;
|
2021-05-02 23:15:16 +00:00
|
|
|
|
pauseCtx->pageIndex = PAUSE_ITEM;
|
|
|
|
|
|
2020-06-17 19:23:42 +00:00
|
|
|
|
pauseCtx->unk_1F4 = 160.0f;
|
|
|
|
|
pauseCtx->unk_1F8 = 160.0f;
|
|
|
|
|
pauseCtx->unk_1FC = 160.0f;
|
|
|
|
|
pauseCtx->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;
|
2021-05-02 23:15:16 +00:00
|
|
|
|
|
|
|
|
|
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;
|
z_message_PAL, message_data_static and surrounding doc (#996)
* Initial progress on z_message_PAL, very messy
* Fix merge
* Some more progress
* Fix merge
* More z_message_PAL
* Small progress
* More small progress
* message_data_static files OK
* Prepare z_message_tables
* Matched another function, small updates
* Attempt to use asm-processor static-symbols branch
* Refactor text id declarations
* Begin large text codes parser function
* Fix merge
* Refactor done
* Build OK, add color and highscore names
* Remove encoded text headers and automatically encode during build
* Fix kanfont
* Various cleanups
* DISP macros
* Another match aside data
* Further progress
* Small improvements
* Deduplicate magic values for text control codes, small improvements
* Tiny progress
* Minor cleanups
* Clean up z_message_PAL comment
* Progress on large functions
* Further progress on large functions
* Changes to mkldscript to link .data in the .rodata section
* data OK
* Few improvements
* Use gDPLoadTextureBlock macros where appropriate
* rm z_message_tables, progress on large functions
* 2 more matches
* Improvements
* Small progress
* More progress on big function
* progress
* match func_80107980
* match Message_Update
* match func_8010BED8
* done
* Progress on remaining large functions
* Small progress on largest function
* Another match, extract text and move to assets, improve text build system
* Small nonmatchings improvements
* docs wip
* Largest function maybe equivalent
* Fix merge
* Document do_action values, largest function is almost instruction-matching
* Rename NAVI do_action to NONE, as that appears to be how that value is used in practice
* Fix merge
* one match
* Last function is instruction-matching
* Fix
* Improvements thanks to engineer124
* Stack matched thanks to petrie911, now just a/v/low t regalloc issues, some cleanup
* More variables labeled, use text state enum everywhere
* More labels and names
* Fix
* Actor_IsTalking -> Actor_TalkRequested
* Match func_8010C39C and remove unused asm
* More docs
* Mostly ocarina related docs
* All msgModes named
* Fix assetclean
* Cleanup
* Extraction fixes and headers
* Suggestions
* Review suggestions
* Change text extraction again, only extract if the headers do not already exist
* Fix
* Use ast for charmap, fix assetclean for real this time
* Review suggestions
* BGM ids and ran formatter
* Review comments
* rename include_readonly to include_data_with_rodata
* Remove leading 0s in number directives
* Review suggestions for message_data_static
* textbox pos enum comments, rename several enum names from Message to TextBox
Co-authored-by: Thar0 <maximilianc64@gmail.com>
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
Co-authored-by: Roman971 <romanlasnier@hotmail.com>
2021-11-23 01:20:30 +00:00
|
|
|
|
pauseCtx->ocarinaSongIdx = -1;
|
2021-05-02 23:15:16 +00:00
|
|
|
|
pauseCtx->cursorSpecialPos = 0;
|
2020-08-23 21:50:30 +00:00
|
|
|
|
|
2020-06-17 19:23:42 +00:00
|
|
|
|
View_Init(&pauseCtx->view, globalCtx->state.gfxCtx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KaleidoSetup_Destroy(GlobalContext* globalCtx) {
|
|
|
|
|
}
|