1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-17 13:24:45 +00:00

Decompile the pause menu aka. ovl_kaleido_scope (+ minor changes) (#803)

* Decompile ovl_kaleido_scope + minor cleanups

* Add a common header for ovl_kaleido_scope

* Start cleaning up and documenting kaleido_scope (+ some interface docs)

* Improve and fix some kaleido_scope non matchings

* Match KaleidoSetup_Init

* Extract icon_item_fra/ger_static files

* Add more documentation and matches to kaleido_scope

* Improve the z_kaleido_collect.c non matching

* Rename z_kaleido_8081EFF0.c to z_kaleido_prompt.c

* Update most kaleido variables to be static

* Improve GS flag macros

* Improve z_lmap_mark.c and extract z_lmap_mark_data.c with a script

* Various minor fixes and improvements

* Minor fixes and review changes

* Review changes part 2

* Rename gSetTileCustom to gDPSetTileCustom

* Review changes part 3
This commit is contained in:
Roman971 2021-05-03 01:15:16 +02:00 committed by GitHub
parent 4e9f40cb13
commit a53e084cd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
106 changed files with 8605 additions and 24307 deletions

View file

@ -1,35 +1,38 @@
#include "global.h"
#include "vt.h"
void (*sKaleidoScopeUpdateFunc)(GlobalContext*);
void (*sKaleidoScopeDrawFunc)(GlobalContext*);
f32 D_80161398;
void (*sKaleidoScopeUpdateFunc)(GlobalContext* globalCtx);
void (*sKaleidoScopeDrawFunc)(GlobalContext* globalCtx);
f32 gBossMarkScale;
u32 D_8016139C;
void* D_801613A0;
PauseMapMarksData* gLoadedPauseMarkDataTable;
extern void KaleidoScope_Update(GlobalContext*);
extern void KaleidoScope_Draw(GlobalContext*);
extern void KaleidoScope_Update(GlobalContext* globalCtx);
extern void KaleidoScope_Draw(GlobalContext* globalCtx);
void KaleidoScopeCall_LoadPlayer() {
KaleidoManagerOvl* playerActorOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_PLAYER_ACTOR];
KaleidoMgrOverlay* playerActorOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_PLAYER_ACTOR];
if (gKaleidoMgrCurOvl != playerActorOvl) {
if (gKaleidoMgrCurOvl) {
if (gKaleidoMgrCurOvl != NULL) {
osSyncPrintf(VT_FGCOL(GREEN));
osSyncPrintf("カレイド領域 強制排除\n"); // Kaleido area forced exclusion
osSyncPrintf("カレイド領域 強制排除\n"); // "Kaleido area forced exclusion"
osSyncPrintf(VT_RST);
KaleidoManager_ClearOvl(gKaleidoMgrCurOvl);
}
osSyncPrintf(VT_FGCOL(GREEN));
osSyncPrintf("プレイヤーアクター搬入\n"); // Player actor import
osSyncPrintf("プレイヤーアクター搬入\n"); // "Player actor import"
osSyncPrintf(VT_RST);
KaleidoManager_LoadOvl(playerActorOvl);
}
}
void KaleidoScopeCall_Init(GlobalContext* globalCtx) {
// Kaleidoscope replacement construct
osSyncPrintf("カレイド・スコープ入れ替え コンストラクト \n");
osSyncPrintf("カレイド・スコープ入れ替え コンストラクト \n"); // "Kaleidoscope replacement construction"
sKaleidoScopeUpdateFunc = KaleidoManager_GetRamAddr(KaleidoScope_Update);
sKaleidoScopeDrawFunc = KaleidoManager_GetRamAddr(KaleidoScope_Draw);
@ -37,20 +40,21 @@ void KaleidoScopeCall_Init(GlobalContext* globalCtx) {
LOG_ADDRESS("kaleido_scope_move_func", sKaleidoScopeUpdateFunc, "../z_kaleido_scope_call.c", 99);
LOG_ADDRESS("kaleido_scope_draw", KaleidoScope_Draw, "../z_kaleido_scope_call.c", 100);
LOG_ADDRESS("kaleido_scope_draw_func", sKaleidoScopeDrawFunc, "../z_kaleido_scope_call.c", 101);
KaleidoSetup_Init(globalCtx);
}
void KaleidoScopeCall_Destroy(GlobalContext* globalCtx) {
// Kaleidoscope replacement destruction
osSyncPrintf("カレイド・スコープ入れ替え デストラクト \n");
osSyncPrintf("カレイド・スコープ入れ替え デストラクト \n"); // "Kaleidoscope replacement destruction"
KaleidoSetup_Destroy(globalCtx);
}
void KaleidoScopeCall_Update(GlobalContext* globalCtx) {
KaleidoManagerOvl* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
PauseContext* pauseCtx = &globalCtx->pauseCtx;
if (pauseCtx->state != 0 || pauseCtx->flag != 0) {
if ((pauseCtx->state != 0) || (pauseCtx->debugState != 0)) {
if (pauseCtx->state == 1) {
if (ShrinkWindow_GetCurrentVal() == 0) {
HREG(80) = 7;
@ -67,8 +71,9 @@ void KaleidoScopeCall_Update(GlobalContext* globalCtx) {
pauseCtx->unk_1E4 = 0;
pauseCtx->unk_1EC = 0;
pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1;
} else if (pauseCtx->state == 2 || pauseCtx->state == 9) {
} else if ((pauseCtx->state == 2) || (pauseCtx->state == 9)) {
osSyncPrintf("PR_KAREIDOSCOPE_MODE=%d\n", R_PAUSE_MENU_MODE);
if (R_PAUSE_MENU_MODE >= 3) {
pauseCtx->state++;
}
@ -76,22 +81,27 @@ void KaleidoScopeCall_Update(GlobalContext* globalCtx) {
if (gKaleidoMgrCurOvl != kaleidoScopeOvl) {
if (gKaleidoMgrCurOvl != NULL) {
osSyncPrintf(VT_FGCOL(GREEN));
osSyncPrintf("カレイド領域 プレイヤー 強制排除\n"); // Kaleid Zone Player Forced Elimination
osSyncPrintf("カレイド領域 プレイヤー 強制排除\n"); // "Kaleido area Player Forced Elimination"
osSyncPrintf(VT_RST);
KaleidoManager_ClearOvl(gKaleidoMgrCurOvl);
}
osSyncPrintf(VT_FGCOL(GREEN));
osSyncPrintf("カレイド領域 カレイドスコープ搬入\n"); // Kaleid area Kaleidoscope loading
osSyncPrintf("カレイド領域 カレイドスコープ搬入\n"); // "Kaleido area Kaleidoscope loading"
osSyncPrintf(VT_RST);
KaleidoManager_LoadOvl(kaleidoScopeOvl);
}
if (gKaleidoMgrCurOvl == kaleidoScopeOvl) {
sKaleidoScopeUpdateFunc(globalCtx);
if (globalCtx->pauseCtx.state == 0 && globalCtx->pauseCtx.flag == 0) {
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0)) {
osSyncPrintf(VT_FGCOL(GREEN));
osSyncPrintf("カレイド領域 カレイドスコープ排出\n"); // Kaleid area Kaleidoscope emission
osSyncPrintf("カレイド領域 カレイドスコープ排出\n"); // "Kaleido area Kaleidoscope Emission"
osSyncPrintf(VT_RST);
KaleidoManager_ClearOvl(kaleidoScopeOvl);
KaleidoScopeCall_LoadPlayer();
}
@ -101,11 +111,11 @@ void KaleidoScopeCall_Update(GlobalContext* globalCtx) {
}
void KaleidoScopeCall_Draw(GlobalContext* globalCtx) {
KaleidoManagerOvl* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
if (R_PAUSE_MENU_MODE >= 3) {
if ((globalCtx->pauseCtx.state >= 4 && globalCtx->pauseCtx.state < 8) ||
(globalCtx->pauseCtx.state >= 11 && globalCtx->pauseCtx.state < 19)) {
if (((globalCtx->pauseCtx.state >= 4) && (globalCtx->pauseCtx.state <= 7)) ||
((globalCtx->pauseCtx.state >= 11) && (globalCtx->pauseCtx.state <= 18))) {
if (gKaleidoMgrCurOvl == kaleidoScopeOvl) {
sKaleidoScopeDrawFunc(globalCtx);
}