2020-10-03 15:22:44 +00:00
|
|
|
#include "global.h"
|
|
|
|
#include "vt.h"
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void (*sKaleidoScopeUpdateFunc)(PlayState* play);
|
|
|
|
void (*sKaleidoScopeDrawFunc)(PlayState* play);
|
2021-05-02 23:15:16 +00:00
|
|
|
f32 gBossMarkScale;
|
2020-03-17 04:31:30 +00:00
|
|
|
u32 D_8016139C;
|
2021-05-02 23:15:16 +00:00
|
|
|
PauseMapMarksData* gLoadedPauseMarkDataTable;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
extern void KaleidoScope_Update(PlayState* play);
|
|
|
|
extern void KaleidoScope_Draw(PlayState* play);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-03-21 19:49:11 +00:00
|
|
|
void KaleidoScopeCall_LoadPlayer(void) {
|
2021-05-02 23:15:16 +00:00
|
|
|
KaleidoMgrOverlay* playerActorOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_PLAYER_ACTOR];
|
2020-10-13 03:15:42 +00:00
|
|
|
|
|
|
|
if (gKaleidoMgrCurOvl != playerActorOvl) {
|
2021-05-02 23:15:16 +00:00
|
|
|
if (gKaleidoMgrCurOvl != NULL) {
|
2020-03-17 04:31:30 +00:00
|
|
|
osSyncPrintf(VT_FGCOL(GREEN));
|
2021-05-02 23:15:16 +00:00
|
|
|
osSyncPrintf("カレイド領域 強制排除\n"); // "Kaleido area forced exclusion"
|
2020-03-17 04:31:30 +00:00
|
|
|
osSyncPrintf(VT_RST);
|
2021-05-02 23:15:16 +00:00
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
KaleidoManager_ClearOvl(gKaleidoMgrCurOvl);
|
|
|
|
}
|
2021-05-02 23:15:16 +00:00
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
osSyncPrintf(VT_FGCOL(GREEN));
|
2021-05-02 23:15:16 +00:00
|
|
|
osSyncPrintf("プレイヤーアクター搬入\n"); // "Player actor import"
|
2020-03-17 04:31:30 +00:00
|
|
|
osSyncPrintf(VT_RST);
|
2021-05-02 23:15:16 +00:00
|
|
|
|
2020-10-13 03:15:42 +00:00
|
|
|
KaleidoManager_LoadOvl(playerActorOvl);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void KaleidoScopeCall_Init(PlayState* play) {
|
2021-09-04 13:33:19 +00:00
|
|
|
// "Kaleidoscope replacement construction"
|
|
|
|
osSyncPrintf("カレイド・スコープ入れ替え コンストラクト \n");
|
2021-05-02 23:15:16 +00:00
|
|
|
|
2020-06-04 21:54:50 +00:00
|
|
|
sKaleidoScopeUpdateFunc = KaleidoManager_GetRamAddr(KaleidoScope_Update);
|
|
|
|
sKaleidoScopeDrawFunc = KaleidoManager_GetRamAddr(KaleidoScope_Draw);
|
2020-04-04 17:28:53 +00:00
|
|
|
|
2020-06-04 21:54:50 +00:00
|
|
|
LOG_ADDRESS("kaleido_scope_move", KaleidoScope_Update, "../z_kaleido_scope_call.c", 98);
|
2020-04-04 17:28:53 +00:00
|
|
|
LOG_ADDRESS("kaleido_scope_move_func", sKaleidoScopeUpdateFunc, "../z_kaleido_scope_call.c", 99);
|
2020-06-04 21:54:50 +00:00
|
|
|
LOG_ADDRESS("kaleido_scope_draw", KaleidoScope_Draw, "../z_kaleido_scope_call.c", 100);
|
2020-04-04 17:28:53 +00:00
|
|
|
LOG_ADDRESS("kaleido_scope_draw_func", sKaleidoScopeDrawFunc, "../z_kaleido_scope_call.c", 101);
|
2021-05-02 23:15:16 +00:00
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
KaleidoSetup_Init(play);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void KaleidoScopeCall_Destroy(PlayState* play) {
|
2021-09-04 13:33:19 +00:00
|
|
|
// "Kaleidoscope replacement destruction"
|
|
|
|
osSyncPrintf("カレイド・スコープ入れ替え デストラクト \n");
|
2021-05-02 23:15:16 +00:00
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
KaleidoSetup_Destroy(play);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void KaleidoScopeCall_Update(PlayState* play) {
|
2021-05-02 23:15:16 +00:00
|
|
|
KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
|
2022-05-21 18:23:43 +00:00
|
|
|
PauseContext* pauseCtx = &play->pauseCtx;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2021-05-02 23:15:16 +00:00
|
|
|
if ((pauseCtx->state != 0) || (pauseCtx->debugState != 0)) {
|
2020-03-22 21:19:43 +00:00
|
|
|
if (pauseCtx->state == 1) {
|
2022-08-15 13:39:06 +00:00
|
|
|
if (Letterbox_GetSize() == 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
HREG(80) = 7;
|
|
|
|
HREG(82) = 3;
|
|
|
|
R_PAUSE_MENU_MODE = 1;
|
|
|
|
pauseCtx->unk_1E4 = 0;
|
|
|
|
pauseCtx->unk_1EC = 0;
|
2020-10-13 03:15:42 +00:00
|
|
|
pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
2020-03-22 21:19:43 +00:00
|
|
|
} else if (pauseCtx->state == 8) {
|
2020-03-17 04:31:30 +00:00
|
|
|
HREG(80) = 7;
|
|
|
|
HREG(82) = 3;
|
|
|
|
R_PAUSE_MENU_MODE = 1;
|
|
|
|
pauseCtx->unk_1E4 = 0;
|
|
|
|
pauseCtx->unk_1EC = 0;
|
2020-10-13 03:15:42 +00:00
|
|
|
pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1;
|
2021-05-02 23:15:16 +00:00
|
|
|
} else if ((pauseCtx->state == 2) || (pauseCtx->state == 9)) {
|
2020-05-19 19:55:49 +00:00
|
|
|
osSyncPrintf("PR_KAREIDOSCOPE_MODE=%d\n", R_PAUSE_MENU_MODE);
|
2021-05-02 23:15:16 +00:00
|
|
|
|
2020-03-23 23:11:21 +00:00
|
|
|
if (R_PAUSE_MENU_MODE >= 3) {
|
2020-03-17 04:31:30 +00:00
|
|
|
pauseCtx->state++;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-22 21:19:43 +00:00
|
|
|
} else if (pauseCtx->state != 0) {
|
2020-10-13 03:15:42 +00:00
|
|
|
if (gKaleidoMgrCurOvl != kaleidoScopeOvl) {
|
|
|
|
if (gKaleidoMgrCurOvl != NULL) {
|
2020-03-17 04:31:30 +00:00
|
|
|
osSyncPrintf(VT_FGCOL(GREEN));
|
2021-09-04 13:33:19 +00:00
|
|
|
// "Kaleido area Player Forced Elimination"
|
|
|
|
osSyncPrintf("カレイド領域 プレイヤー 強制排除\n");
|
2020-03-17 04:31:30 +00:00
|
|
|
osSyncPrintf(VT_RST);
|
2021-05-02 23:15:16 +00:00
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
KaleidoManager_ClearOvl(gKaleidoMgrCurOvl);
|
|
|
|
}
|
2021-05-02 23:15:16 +00:00
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
osSyncPrintf(VT_FGCOL(GREEN));
|
2021-09-04 13:33:19 +00:00
|
|
|
// "Kaleido area Kaleidoscope loading"
|
|
|
|
osSyncPrintf("カレイド領域 カレイドスコープ搬入\n");
|
2020-03-17 04:31:30 +00:00
|
|
|
osSyncPrintf(VT_RST);
|
2021-05-02 23:15:16 +00:00
|
|
|
|
2020-10-13 03:15:42 +00:00
|
|
|
KaleidoManager_LoadOvl(kaleidoScopeOvl);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
2020-10-13 03:15:42 +00:00
|
|
|
|
|
|
|
if (gKaleidoMgrCurOvl == kaleidoScopeOvl) {
|
2022-05-21 18:23:43 +00:00
|
|
|
sKaleidoScopeUpdateFunc(play);
|
2021-05-02 23:15:16 +00:00
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
osSyncPrintf(VT_FGCOL(GREEN));
|
2021-09-04 13:33:19 +00:00
|
|
|
// "Kaleido area Kaleidoscope Emission"
|
|
|
|
osSyncPrintf("カレイド領域 カレイドスコープ排出\n");
|
2020-03-17 04:31:30 +00:00
|
|
|
osSyncPrintf(VT_RST);
|
2021-05-02 23:15:16 +00:00
|
|
|
|
2020-10-13 03:15:42 +00:00
|
|
|
KaleidoManager_ClearOvl(kaleidoScopeOvl);
|
2020-03-17 04:31:30 +00:00
|
|
|
KaleidoScopeCall_LoadPlayer();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void KaleidoScopeCall_Draw(PlayState* play) {
|
2021-05-02 23:15:16 +00:00
|
|
|
KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (R_PAUSE_MENU_MODE >= 3) {
|
2022-05-21 18:23:43 +00:00
|
|
|
if (((play->pauseCtx.state >= 4) && (play->pauseCtx.state <= 7)) ||
|
|
|
|
((play->pauseCtx.state >= 11) && (play->pauseCtx.state <= 18))) {
|
2020-03-22 21:19:43 +00:00
|
|
|
if (gKaleidoMgrCurOvl == kaleidoScopeOvl) {
|
2022-05-21 18:23:43 +00:00
|
|
|
sKaleidoScopeDrawFunc(play);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|