1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-04 15:04:31 +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

@ -30,11 +30,11 @@ u16 gUpgradeCapacities[][4] = {
{ 0, 20, 30, 40 }, // Deku Nut Upgrades
};
u32 gGoldSkullFlgMask[] = { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 };
u32 gGoldSkullFlgShift[] = { 0, 8, 16, 24 };
u32 gGsFlagsMask[] = { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 };
u32 gGsFlagsShift[] = { 0, 8, 16, 24 };
// TODO: use symbols for these icon textures once textures are properly in C
u32 gItemIcons[] = {
void* gItemIcons[] = {
0x08000000, 0x08001000, 0x08002000, 0x08003000, 0x08004000, 0x08005000, 0x08006000, 0x08007000, 0x08008000,
0x08009000, 0x0800A000, 0x0800B000, 0x0800C000, 0x0800D000, 0x0800E000, 0x0800F000, 0x08010000, 0x08011000,
0x08012000, 0x08013000, 0x08014000, 0x08015000, 0x08016000, 0x08017000, 0x08018000, 0x08019000, 0x0801A000,
@ -95,7 +95,7 @@ u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment) {
}
Player_SetEquipmentData(globalCtx, player);
globalCtx->pauseCtx.unk_238 = 10;
globalCtx->pauseCtx.cursorSpecialPos = PAUSE_CURSOR_PAGE_LEFT;
}
return sp26;

View file

@ -145,7 +145,7 @@ void FlagSet_Update(GlobalContext* globalCtx) {
}
if (CHECK_BTN_ALL(input->press.button, BTN_L)) {
globalCtx->pauseCtx.flag = 0;
globalCtx->pauseCtx.debugState = 0;
}
CLOSE_DISPS(gfxCtx, "../flg_set.c", 241);

View file

@ -3119,7 +3119,7 @@ f32 BgCheck_RaycastFloorDyna(DynaRaycast* dynaRaycast) {
if ((result != BGCHECK_Y_MIN) && (dynaActor != NULL) && (dynaRaycast->globalCtx != NULL)) {
pauseState = dynaRaycast->globalCtx->pauseCtx.state != 0;
if (pauseState == 0) {
pauseState = dynaRaycast->globalCtx->pauseCtx.flag != 0;
pauseState = dynaRaycast->globalCtx->pauseCtx.debugState != 0;
}
if (!pauseState && (dynaRaycast->colCtx->dyna.bgActorFlags[*dynaRaycast->bgId] & 2)) {
curTransform = &dynaRaycast->dyna->bgActors[*dynaRaycast->bgId].curTransform;

View file

@ -7,7 +7,7 @@ void func_80110990(GlobalContext* globalCtx) {
void func_801109B0(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
u32 parameterSize;
u16 do_actionOffset;
u16 doActionOffset;
u8 temp;
gSaveContext.unk_1422 = 0;
@ -40,72 +40,72 @@ void func_801109B0(GlobalContext* globalCtx) {
DmaMgr_SendRequest1(interfaceCtx->parameterSegment, (u32)_parameter_staticSegmentRomStart, parameterSize,
"../z_construct.c", 162);
interfaceCtx->do_actionSegment = GameState_Alloc(&globalCtx->state, 0x480, "../z_construct.c", 166);
interfaceCtx->doActionSegment = GameState_Alloc(&globalCtx->state, 0x480, "../z_construct.c", 166);
// Translates to: "DO Action Texture Initialization"
osSyncPrintf("DOアクション テクスチャ初期=%x\n", 0x480);
osSyncPrintf("parameter->do_actionSegment=%x\n", interfaceCtx->do_actionSegment);
osSyncPrintf("parameter->do_actionSegment=%x\n", interfaceCtx->doActionSegment);
ASSERT(interfaceCtx->do_actionSegment != NULL, "parameter->do_actionSegment != NULL", "../z_construct.c", 169);
ASSERT(interfaceCtx->doActionSegment != NULL, "parameter->do_actionSegment != NULL", "../z_construct.c", 169);
if (gSaveContext.language == 0) {
do_actionOffset = 0;
doActionOffset = 0;
} else if (gSaveContext.language == 1) {
do_actionOffset = 0x2B80;
doActionOffset = 0x2B80;
} else {
do_actionOffset = 0x5700;
doActionOffset = 0x5700;
}
DmaMgr_SendRequest1(interfaceCtx->do_actionSegment, (u32)_do_action_staticSegmentRomStart + do_actionOffset, 0x300,
DmaMgr_SendRequest1(interfaceCtx->doActionSegment, (u32)_do_action_staticSegmentRomStart + doActionOffset, 0x300,
"../z_construct.c", 174);
if (gSaveContext.language == 0) {
do_actionOffset = 0x480;
doActionOffset = 0x480;
} else if (gSaveContext.language == 1) {
do_actionOffset = 0x3000;
doActionOffset = 0x3000;
} else {
do_actionOffset = 0x5B80;
doActionOffset = 0x5B80;
}
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->do_actionSegment + 0x300),
(u32)_do_action_staticSegmentRomStart + do_actionOffset, 0x180, "../z_construct.c", 178);
DmaMgr_SendRequest1(interfaceCtx->doActionSegment + 0x300, (u32)_do_action_staticSegmentRomStart + doActionOffset,
0x180, "../z_construct.c", 178);
interfaceCtx->icon_itemSegment = GameState_Alloc(&globalCtx->state, 0x4000, "../z_construct.c", 190);
interfaceCtx->iconItemSegment = GameState_Alloc(&globalCtx->state, 0x4000, "../z_construct.c", 190);
// Translates to: "Icon Item Texture Initialization = %x"
osSyncPrintf("アイコンアイテム テクスチャ初期=%x\n", 0x4000);
osSyncPrintf("parameter->icon_itemSegment=%x\n", interfaceCtx->icon_itemSegment);
osSyncPrintf("parameter->icon_itemSegment=%x\n", interfaceCtx->iconItemSegment);
ASSERT(interfaceCtx->icon_itemSegment != NULL, "parameter->icon_itemSegment != NULL", "../z_construct.c", 193);
ASSERT(interfaceCtx->iconItemSegment != NULL, "parameter->icon_itemSegment != NULL", "../z_construct.c", 193);
osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", gSaveContext.equips.buttonItems[0],
gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2],
gSaveContext.equips.buttonItems[3]);
if (gSaveContext.equips.buttonItems[0] < 0xF0) {
DmaMgr_SendRequest1(interfaceCtx->icon_itemSegment,
DmaMgr_SendRequest1(interfaceCtx->iconItemSegment,
_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[0] * 0x1000, 0x1000,
"../z_construct.c", 198);
} else if (gSaveContext.equips.buttonItems[0] != 0xFF) {
DmaMgr_SendRequest1(interfaceCtx->icon_itemSegment,
DmaMgr_SendRequest1(interfaceCtx->iconItemSegment,
_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[0] * 0x1000, 0x1000,
"../z_construct.c", 203);
}
if (gSaveContext.equips.buttonItems[1] < 0xF0) {
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x1000),
DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x1000,
_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[1] * 0x1000, 0x1000,
"../z_construct.c", 209);
}
if (gSaveContext.equips.buttonItems[2] < 0xF0) {
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x2000),
DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x2000,
_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[2] * 0x1000, 0x1000,
"../z_construct.c", 214);
}
if (gSaveContext.equips.buttonItems[3] < 0xF0) {
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x3000),
DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x3000,
_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[3] * 0x1000, 0x1000,
"../z_construct.c", 219);
}

View file

@ -57,10 +57,11 @@ void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx);
void Cutscene_DrawDebugInfo(GlobalContext* globalCtx, Gfx** dlist, CutsceneContext* csCtx) {
GfxPrint printer;
u8 pad2[8];
s32 pad[2];
GfxPrint_Init(&printer);
GfxPrint_Open(&printer, *dlist);
GfxPrint_SetPos(&printer, 22, 25);
GfxPrint_SetColor(&printer, 255, 255, 55, 32);
GfxPrint_Printf(&printer, "%s", "FLAME ");
@ -69,6 +70,7 @@ void Cutscene_DrawDebugInfo(GlobalContext* globalCtx, Gfx** dlist, CutsceneConte
GfxPrint_SetColor(&printer, 50, 255, 255, 60);
GfxPrint_SetPos(&printer, 4, 26);
GfxPrint_Printf(&printer, "%s", "SKIP=(START) or (Cursole Right)");
*dlist = GfxPrint_Close(&printer);
GfxPrint_Destroy(&printer);
}

View file

@ -7,77 +7,85 @@
_ovl_##name##SegmentEnd, 0, #name, \
}
KaleidoManagerOvl gKaleidoMgrOverlayTable[] = {
KaleidoMgrOverlay gKaleidoMgrOverlayTable[] = {
KALEIDO_OVERLAY(kaleido_scope),
KALEIDO_OVERLAY(player_actor),
};
void* sKaleidoAreaPtr = NULL;
KaleidoManagerOvl* gKaleidoMgrCurOvl = NULL;
u32 D_8012D1E0 = 0;
KaleidoMgrOverlay* gKaleidoMgrCurOvl = NULL;
u8 gBossMarkState = 0;
void KaleidoManager_LoadOvl(KaleidoManagerOvl* ovl) {
void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl) {
LogUtils_CheckNullPointer("KaleidoArea_allocp", sKaleidoAreaPtr, "../z_kaleido_manager.c", 99);
ovl->loadedRamAddr = sKaleidoAreaPtr;
Overlay_Load(ovl->vromStart, ovl->vromEnd, ovl->vramStart, ovl->vramEnd, ovl->loadedRamAddr);
osSyncPrintf(VT_FGCOL(GREEN));
osSyncPrintf("OVL(k):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n", ovl->vramStart, ovl->vramEnd, ovl->loadedRamAddr,
((u32)ovl->loadedRamAddr + ovl->vramEnd) - (u32)ovl->vramStart,
(u32)ovl->loadedRamAddr + (u32)ovl->vramEnd - (u32)ovl->vramStart,
(u32)ovl->vramStart - (u32)ovl->loadedRamAddr, ovl->name);
osSyncPrintf(VT_RST);
ovl->off = (u32)ovl->loadedRamAddr - (u32)ovl->vramStart;
ovl->offset = (u32)ovl->loadedRamAddr - (u32)ovl->vramStart;
gKaleidoMgrCurOvl = ovl;
}
void KaleidoManager_ClearOvl(KaleidoManagerOvl* ovl) {
if (ovl->loadedRamAddr) {
ovl->off = 0;
bzero(ovl->loadedRamAddr, ovl->vramEnd - (u32)ovl->vramStart);
void KaleidoManager_ClearOvl(KaleidoMgrOverlay* ovl) {
if (ovl->loadedRamAddr != NULL) {
ovl->offset = 0;
bzero(ovl->loadedRamAddr, (u32)ovl->vramEnd - (u32)ovl->vramStart);
ovl->loadedRamAddr = NULL;
gKaleidoMgrCurOvl = NULL;
}
}
void KaleidoManager_Init(GlobalContext* globalCtx) {
s32 largestOvl = 0;
s32 vramSize;
u32 idx;
s32 largestSize = 0;
s32 size;
u32 i;
for (idx = 0; idx < ARRAY_COUNT(gKaleidoMgrOverlayTable); idx++) {
vramSize = gKaleidoMgrOverlayTable[idx].vramEnd - (u32)gKaleidoMgrOverlayTable[idx].vramStart;
if (largestOvl < vramSize) {
largestOvl = vramSize;
for (i = 0; i < ARRAY_COUNT(gKaleidoMgrOverlayTable); i++) {
size = (u32)gKaleidoMgrOverlayTable[i].vramEnd - (u32)gKaleidoMgrOverlayTable[i].vramStart;
if (size > largestSize) {
largestSize = size;
}
}
osSyncPrintf(VT_FGCOL(GREEN));
osSyncPrintf("KaleidoArea の最大サイズは %d バイトを確保します\n", largestOvl);
osSyncPrintf("KaleidoArea の最大サイズは %d バイトを確保します\n", largestSize);
osSyncPrintf(VT_RST);
sKaleidoAreaPtr = GameState_Alloc(&globalCtx->state, largestOvl, "../z_kaleido_manager.c", 150);
sKaleidoAreaPtr = GameState_Alloc(&globalCtx->state, largestSize, "../z_kaleido_manager.c", 150);
LogUtils_CheckNullPointer("KaleidoArea_allocp", sKaleidoAreaPtr, "../z_kaleido_manager.c", 151);
osSyncPrintf(VT_FGCOL(GREEN));
osSyncPrintf("KaleidoArea %08x - %08x\n", sKaleidoAreaPtr, (u32)sKaleidoAreaPtr + largestOvl);
osSyncPrintf("KaleidoArea %08x - %08x\n", sKaleidoAreaPtr, (u32)sKaleidoAreaPtr + largestSize);
osSyncPrintf(VT_RST);
gKaleidoMgrCurOvl = 0;
}
void KaleidoManager_Destroy() {
if (gKaleidoMgrCurOvl) {
if (gKaleidoMgrCurOvl != NULL) {
KaleidoManager_ClearOvl(gKaleidoMgrCurOvl);
gKaleidoMgrCurOvl = NULL;
}
sKaleidoAreaPtr = NULL;
}
// NOTE: this function looks messed up and probably doesn't work like how the devs wanted it to work
void* KaleidoManager_GetRamAddr(void* vram) {
KaleidoManagerOvl* iter = gKaleidoMgrCurOvl;
KaleidoManagerOvl* ovl = iter;
u32 idx;
KaleidoMgrOverlay* iter = gKaleidoMgrCurOvl;
KaleidoMgrOverlay* ovl = iter;
u32 i;
if (ovl == NULL) {
iter = &gKaleidoMgrOverlayTable[0];
for (idx = 0; idx != ARRAY_COUNT(gKaleidoMgrOverlayTable); idx++) {
if ((u32)vram >= (u32)iter->vramStart && (u32)iter->vramEnd >= (u32)vram) {
for (i = 0; i < ARRAY_COUNT(gKaleidoMgrOverlayTable); i++) {
if (((u32)vram >= (u32)iter->vramStart) && ((u32)iter->vramEnd >= (u32)vram)) {
KaleidoManager_LoadOvl(iter);
ovl = iter;
goto KaleidoManager_GetRamAddr_end;
@ -90,9 +98,9 @@ void* KaleidoManager_GetRamAddr(void* vram) {
}
KaleidoManager_GetRamAddr_end:
if (ovl == NULL || (u32)vram < (u32)ovl->vramStart || (u32)vram >= (u32)ovl->vramEnd) {
if ((ovl == NULL) || ((u32)vram < (u32)ovl->vramStart) || ((u32)vram >= (u32)ovl->vramEnd)) {
return NULL;
}
return (void*)((u32)vram + ovl->off);
return (void*)((u32)vram + ovl->offset);
}

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);
}

View file

@ -1,48 +1,18 @@
#include "global.h"
s16 sKaleidoSetupKscpPos0[] = {
2,
3,
0,
1,
};
f32 sKaleidoSetupEyeX0[] = {
0.0f,
64.0f,
0.0f,
-64.0f,
};
f32 sKaleidoSetupEyeZ0[] = {
-64.0f,
0.0f,
64.0f,
0.0f,
};
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[] = {
1,
2,
3,
0,
};
f32 sKaleidoSetupEyeX1[] = {
-64.0f,
0.0f,
64.0f,
0.0f,
};
f32 sKaleidoSetupEyeZ1[] = {
0.0f,
-64.0f,
0.0f,
64.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 };
void KaleidoSetup_Update(GlobalContext* globalCtx) {
PauseContext* pauseCtx = &globalCtx->pauseCtx;
Input* input = &globalCtx->state.input[0];
if (pauseCtx->state == 0 && pauseCtx->flag == 0 && globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE &&
if (pauseCtx->state == 0 && pauseCtx->debugState == 0 && globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE &&
globalCtx->sceneLoadFlag == 0 && globalCtx->transitionMode == 0 && gSaveContext.cutsceneIndex < 0xFFF0 &&
gSaveContext.nextCutsceneIndex < 0xFFF0 && !Gameplay_InCsMode(globalCtx) &&
globalCtx->shootingGalleryStatus <= 1 && gSaveContext.unk_13F0 != 8 && gSaveContext.unk_13F0 != 9 &&
@ -50,54 +20,59 @@ void KaleidoSetup_Update(GlobalContext* globalCtx) {
if (CHECK_BTN_ALL(input->cur.button, BTN_L) && CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
if (BREG(0)) {
pauseCtx->flag = 3;
pauseCtx->debugState = 3;
}
} else if (CHECK_BTN_ALL(input->press.button, BTN_START)) {
gSaveContext.unk_13EE = gSaveContext.unk_13EA;
WREG(16) = -0xAF;
WREG(17) = 0x9B;
WREG(16) = -175;
WREG(17) = 155;
pauseCtx->unk_1EA = 0;
pauseCtx->unk_1E4 = 1;
if (ZREG(48) == 0) {
pauseCtx->eye.x = sKaleidoSetupEyeX0[pauseCtx->kscpPos];
pauseCtx->eye.z = sKaleidoSetupEyeZ0[pauseCtx->kscpPos];
pauseCtx->kscpPos = sKaleidoSetupKscpPos0[pauseCtx->kscpPos];
pauseCtx->eye.x = sKaleidoSetupEyeX0[pauseCtx->pageIndex];
pauseCtx->eye.z = sKaleidoSetupEyeZ0[pauseCtx->pageIndex];
pauseCtx->pageIndex = sKaleidoSetupKscpPos0[pauseCtx->pageIndex];
} else {
pauseCtx->eye.x = sKaleidoSetupEyeX1[pauseCtx->kscpPos];
pauseCtx->eye.z = sKaleidoSetupEyeZ1[pauseCtx->kscpPos];
pauseCtx->kscpPos = sKaleidoSetupKscpPos1[pauseCtx->kscpPos];
pauseCtx->eye.x = sKaleidoSetupEyeX1[pauseCtx->pageIndex];
pauseCtx->eye.z = sKaleidoSetupEyeZ1[pauseCtx->pageIndex];
pauseCtx->pageIndex = sKaleidoSetupKscpPos1[pauseCtx->pageIndex];
}
pauseCtx->mode = (u16)(pauseCtx->kscpPos * 2) + 1; // cast required
pauseCtx->mode = (u16)(pauseCtx->pageIndex * 2) + 1;
pauseCtx->state = 1;
osSyncPrintf("=%d eye.x=%f, eye.z=%f kscp_pos=%d\n", pauseCtx->mode, pauseCtx->eye.x,
pauseCtx->eye.z, pauseCtx->kscpPos);
pauseCtx->eye.z, pauseCtx->pageIndex);
}
if (pauseCtx->state == 1) {
WREG(2) = -0x1860;
WREG(2) = -6240;
R_UPDATE_RATE = 2;
if (ShrinkWindow_GetVal()) {
ShrinkWindow_SetVal(0);
}
func_800F64E0(1);
}
}
}
#ifdef NON_MATCHING
// regalloc differences
void KaleidoSetup_Init(GlobalContext* globalCtx) {
PauseContext* pauseCtx = &globalCtx->pauseCtx;
u64 temp = 0; // Necessary to match
pauseCtx->state = 0;
pauseCtx->flag = 0;
pauseCtx->unk_208 = 0;
pauseCtx->debugState = 0;
pauseCtx->alpha = 0;
pauseCtx->unk_1EA = 0;
pauseCtx->unk_1E4 = 0;
pauseCtx->mode = 0;
pauseCtx->kscpPos = 0;
pauseCtx->unk_218 = 0;
pauseCtx->pageIndex = PAUSE_ITEM;
pauseCtx->unk_1F4 = 160.0f;
pauseCtx->unk_1F8 = 160.0f;
pauseCtx->unk_1FC = 160.0f;
@ -106,38 +81,41 @@ void KaleidoSetup_Init(GlobalContext* globalCtx) {
pauseCtx->unk_1F0 = 936.0f;
pauseCtx->eye.x = pauseCtx->eye.y = 0.0f;
pauseCtx->unk_204 = -314.0f;
pauseCtx->unk_21A = VREG(30) + 3;
pauseCtx->unk_21C = 0;
pauseCtx->unk_21E = 1;
pauseCtx->unk_220 = 10;
pauseCtx->unk_222 = 0;
pauseCtx->unk_22C = 0;
pauseCtx->unk_224 = 0;
pauseCtx->unk_22E = 0;
pauseCtx->unk_226 = 0;
pauseCtx->unk_230 = 0;
pauseCtx->unk_228 = 1;
pauseCtx->unk_232 = 0;
pauseCtx->unk_23E = 999;
pauseCtx->unk_240 = VREG(30) + 3;
pauseCtx->unk_242 = 999;
pauseCtx->unk_244 = 59;
pauseCtx->unk_246 = 0;
pauseCtx->unk_248 = VREG(30) + 3;
pauseCtx->unk_24A = 0;
pauseCtx->unk_24C = pauseCtx->unk_21E;
pauseCtx->unk_25A = -40;
pauseCtx->unk_25C = 0;
pauseCtx->unk_25E = 0;
pauseCtx->unk_260 = 4;
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;
pauseCtx->unk_264 = -1;
pauseCtx->unk_238 = 0;
pauseCtx->cursorSpecialPos = 0;
View_Init(&pauseCtx->view, globalCtx->state.gfxCtx);
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kaleido_setup/KaleidoSetup_Init.s")
#endif
void KaleidoSetup_Destroy(GlobalContext* globalCtx) {
}

View file

@ -1,7 +1,7 @@
#include "global.h"
#include "textures/parameter_static/parameter_static.h"
/*
/**
* These are the colors for the hearts in the interface. The prim color is the red color of the heart
* for the base hearts, while the prim color for the double defense hearts is the white outline. The
* env color for the base hearts is the purple-ish outline, while the env color for the double defense
@ -24,7 +24,7 @@
#define HEARTS_DD_ENV_G 0
#define HEARTS_DD_ENV_B 0
/*
/**
* The burn and drown colors listed here are unused. Prerelease footage of the game confirms that at one
* point in development the orange color was to be used while taking damage from hot environments.
* Based on this, we can assume that the blue heart color was to be used while drowning.
@ -55,8 +55,8 @@ static s16 sHeartsPrimColors[3][3] = {
static s16 sHeartsEnvColors[3][3] = {
{ HEARTS_ENV_R, HEARTS_ENV_G, HEARTS_ENV_B },
{ HEARTS_BURN_ENV_R, HEARTS_BURN_ENV_G },
{ HEARTS_DROWN_ENV_R, HEARTS_DROWN_ENV_G, HEARTS_DROWN_ENV_B },
{ HEARTS_BURN_ENV_R, HEARTS_BURN_ENV_G }, // unused
{ HEARTS_DROWN_ENV_R, HEARTS_DROWN_ENV_G, HEARTS_DROWN_ENV_B }, // unused
};
static s16 sHeartsPrimFactors[3][3] = {
@ -152,10 +152,10 @@ static s16 sHeartsDDEnvFactors[3][3] = {
};
// Current colors for the double defense hearts
s16 sHeartsDDPrim[3];
s16 sHeartsDDEnv[3];
s16 sBeatingHeartsDDPrim[2][3];
s16 sBeatingHeartsDDEnv[2][3];
s16 sBeatingHeartsDDPrim[3];
s16 sBeatingHeartsDDEnv[3];
s16 sHeartsDDPrim[2][3];
s16 sHeartsDDEnv[2][3];
void HealthMeter_Init(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
@ -181,13 +181,13 @@ void HealthMeter_Init(GlobalContext* globalCtx) {
interfaceCtx->heartsEnvG[1] = HEARTS_ENV_G;
interfaceCtx->heartsEnvB[1] = HEARTS_ENV_B;
sBeatingHeartsDDPrim[0][0] = sBeatingHeartsDDPrim[1][0] = HEARTS_DD_PRIM_R;
sBeatingHeartsDDPrim[0][1] = sBeatingHeartsDDPrim[1][1] = HEARTS_DD_PRIM_G;
sBeatingHeartsDDPrim[0][2] = sBeatingHeartsDDPrim[1][2] = HEARTS_DD_PRIM_B;
sHeartsDDPrim[0][0] = sHeartsDDPrim[1][0] = HEARTS_DD_PRIM_R;
sHeartsDDPrim[0][1] = sHeartsDDPrim[1][1] = HEARTS_DD_PRIM_G;
sHeartsDDPrim[0][2] = sHeartsDDPrim[1][2] = HEARTS_DD_PRIM_B;
sBeatingHeartsDDEnv[0][0] = sBeatingHeartsDDEnv[1][0] = HEARTS_DD_ENV_R;
sBeatingHeartsDDEnv[0][1] = sBeatingHeartsDDEnv[1][1] = HEARTS_DD_ENV_G;
sBeatingHeartsDDEnv[0][2] = sBeatingHeartsDDEnv[1][2] = HEARTS_DD_ENV_B;
sHeartsDDEnv[0][0] = sHeartsDDEnv[1][0] = HEARTS_DD_ENV_R;
sHeartsDDEnv[0][1] = sHeartsDDEnv[1][1] = HEARTS_DD_ENV_G;
sHeartsDDEnv[0][2] = sHeartsDDEnv[1][2] = HEARTS_DD_ENV_B;
}
void HealthMeter_Update(GlobalContext* globalCtx) {
@ -253,37 +253,37 @@ void HealthMeter_Update(GlobalContext* globalCtx) {
interfaceCtx->beatingHeartEnv[1] = (u8)(gFactor + HEARTS_ENV_G) & 0xFF;
interfaceCtx->beatingHeartEnv[2] = (u8)(bFactor + HEARTS_ENV_B) & 0xFF;
sBeatingHeartsDDPrim[0][0] = HEARTS_DD_PRIM_R;
sBeatingHeartsDDPrim[0][1] = HEARTS_DD_PRIM_G;
sBeatingHeartsDDPrim[0][2] = HEARTS_DD_PRIM_B;
sHeartsDDPrim[0][0] = HEARTS_DD_PRIM_R;
sHeartsDDPrim[0][1] = HEARTS_DD_PRIM_G;
sHeartsDDPrim[0][2] = HEARTS_DD_PRIM_B;
sBeatingHeartsDDEnv[0][0] = HEARTS_DD_ENV_R;
sBeatingHeartsDDEnv[0][1] = HEARTS_DD_ENV_G;
sBeatingHeartsDDEnv[0][2] = HEARTS_DD_ENV_B;
sHeartsDDEnv[0][0] = HEARTS_DD_ENV_R;
sHeartsDDEnv[0][1] = HEARTS_DD_ENV_G;
sHeartsDDEnv[0][2] = HEARTS_DD_ENV_B;
sBeatingHeartsDDPrim[1][0] = sHeartsDDPrimColors[ddType][0];
sBeatingHeartsDDPrim[1][1] = sHeartsDDPrimColors[ddType][1];
sBeatingHeartsDDPrim[1][2] = sHeartsDDPrimColors[ddType][2];
sHeartsDDPrim[1][0] = sHeartsDDPrimColors[ddType][0];
sHeartsDDPrim[1][1] = sHeartsDDPrimColors[ddType][1];
sHeartsDDPrim[1][2] = sHeartsDDPrimColors[ddType][2];
sBeatingHeartsDDEnv[1][0] = sHeartsDDEnvColors[ddType][0];
sBeatingHeartsDDEnv[1][1] = sHeartsDDEnvColors[ddType][1];
sBeatingHeartsDDEnv[1][2] = sHeartsDDEnvColors[ddType][2];
sHeartsDDEnv[1][0] = sHeartsDDEnvColors[ddType][0];
sHeartsDDEnv[1][1] = sHeartsDDEnvColors[ddType][1];
sHeartsDDEnv[1][2] = sHeartsDDEnvColors[ddType][2];
rFactor = sHeartsDDPrimFactors[ddType][0] * ddFactor;
gFactor = sHeartsDDPrimFactors[ddType][1] * ddFactor;
bFactor = sHeartsDDPrimFactors[ddType][2] * ddFactor;
sHeartsDDPrim[0] = (u8)(rFactor + HEARTS_DD_PRIM_R) & 0xFF;
sHeartsDDPrim[1] = (u8)(gFactor + HEARTS_DD_PRIM_G) & 0xFF;
sHeartsDDPrim[2] = (u8)(bFactor + HEARTS_DD_PRIM_B) & 0xFF;
sBeatingHeartsDDPrim[0] = (u8)(rFactor + HEARTS_DD_PRIM_R) & 0xFF;
sBeatingHeartsDDPrim[1] = (u8)(gFactor + HEARTS_DD_PRIM_G) & 0xFF;
sBeatingHeartsDDPrim[2] = (u8)(bFactor + HEARTS_DD_PRIM_B) & 0xFF;
rFactor = sHeartsDDEnvFactors[ddType][0] * ddFactor;
gFactor = sHeartsDDEnvFactors[ddType][1] * ddFactor;
bFactor = sHeartsDDEnvFactors[ddType][2] * ddFactor;
sHeartsDDEnv[0] = (u8)(rFactor + HEARTS_DD_ENV_R) & 0xFF;
sHeartsDDEnv[1] = (u8)(gFactor + HEARTS_DD_ENV_G) & 0xFF;
sHeartsDDEnv[2] = (u8)(bFactor + HEARTS_DD_ENV_B) & 0xFF;
sBeatingHeartsDDEnv[0] = (u8)(rFactor + HEARTS_DD_ENV_R) & 0xFF;
sBeatingHeartsDDEnv[1] = (u8)(gFactor + HEARTS_DD_ENV_G) & 0xFF;
sBeatingHeartsDDEnv[2] = (u8)(bFactor + HEARTS_DD_ENV_B) & 0xFF;
}
s32 func_80078E18(GlobalContext* globalCtx) {
@ -329,7 +329,7 @@ u64* sHeartTextures[] = {
gHUDHeartThreeQuarterTex, gHUDHeartThreeQuarterTex, gHUDHeartThreeQuarterTex, gHUDHeartThreeQuarterTex,
};
u64* sDDHeartTextures[] = {
u64* sHeartDDTextures[] = {
gHUDDefenseHeartFullTex, gHUDDefenseHeartQuarterTex, gHUDDefenseHeartQuarterTex,
gHUDDefenseHeartQuarterTex, gHUDDefenseHeartQuarterTex, gHUDDefenseHeartQuarterTex,
gHUDDefenseHeartHalfTex, gHUDDefenseHeartHalfTex, gHUDDefenseHeartHalfTex,
@ -351,7 +351,7 @@ void HealthMeter_Draw(GlobalContext* globalCtx) {
f32 temp4;
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Vtx* sp154 = interfaceCtx->vtx_12C;
Vtx* sp154 = interfaceCtx->beatingHeartVtx;
s32 curHeartFraction = gSaveContext.health % 0x10;
s16 totalHeartCount = gSaveContext.healthCapacity / 0x10;
s16 fullHeartCount = gSaveContext.health / 0x10;
@ -424,43 +424,41 @@ void HealthMeter_Draw(GlobalContext* globalCtx) {
if (curColorSet != 4) {
curColorSet = 4;
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, sBeatingHeartsDDPrim[0][0], sBeatingHeartsDDPrim[0][1],
sBeatingHeartsDDPrim[0][2], interfaceCtx->healthAlpha);
gDPSetEnvColor(OVERLAY_DISP++, sBeatingHeartsDDEnv[0][0], sBeatingHeartsDDEnv[0][1],
sBeatingHeartsDDEnv[0][2], 255);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, sHeartsDDPrim[0][0], sHeartsDDPrim[0][1], sHeartsDDPrim[0][2],
interfaceCtx->healthAlpha);
gDPSetEnvColor(OVERLAY_DISP++, sHeartsDDEnv[0][0], sHeartsDDEnv[0][1], sHeartsDDEnv[0][2], 255);
}
} else if (i == fullHeartCount) {
if (curColorSet != 5) {
curColorSet = 5;
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, sHeartsDDPrim[0], sHeartsDDPrim[1], sHeartsDDPrim[2],
interfaceCtx->healthAlpha);
gDPSetEnvColor(OVERLAY_DISP++, sHeartsDDEnv[0], sHeartsDDEnv[1], sHeartsDDEnv[2], 0xFF);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, sBeatingHeartsDDPrim[0], sBeatingHeartsDDPrim[1],
sBeatingHeartsDDPrim[2], interfaceCtx->healthAlpha);
gDPSetEnvColor(OVERLAY_DISP++, sBeatingHeartsDDEnv[0], sBeatingHeartsDDEnv[1],
sBeatingHeartsDDEnv[2], 255);
}
} else if (i > fullHeartCount) {
if (curColorSet != 6) {
curColorSet = 6;
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, sBeatingHeartsDDPrim[0][0], sBeatingHeartsDDPrim[0][1],
sBeatingHeartsDDPrim[0][2], interfaceCtx->healthAlpha);
gDPSetEnvColor(OVERLAY_DISP++, sBeatingHeartsDDEnv[0][0], sBeatingHeartsDDEnv[0][1],
sBeatingHeartsDDEnv[0][2], 255);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, sHeartsDDPrim[0][0], sHeartsDDPrim[0][1], sHeartsDDPrim[0][2],
interfaceCtx->healthAlpha);
gDPSetEnvColor(OVERLAY_DISP++, sHeartsDDEnv[0][0], sHeartsDDEnv[0][1], sHeartsDDEnv[0][2], 255);
}
} else {
if (curColorSet != 7) {
curColorSet = 7;
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, sBeatingHeartsDDPrim[1][0], sBeatingHeartsDDPrim[1][1],
sBeatingHeartsDDPrim[1][2], interfaceCtx->healthAlpha);
gDPSetEnvColor(OVERLAY_DISP++, sBeatingHeartsDDEnv[1][0], sBeatingHeartsDDEnv[1][1],
sBeatingHeartsDDEnv[1][2], 255);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, sHeartsDDPrim[1][0], sHeartsDDPrim[1][1], sHeartsDDPrim[1][2],
interfaceCtx->healthAlpha);
gDPSetEnvColor(OVERLAY_DISP++, sHeartsDDEnv[1][0], sHeartsDDEnv[1][1], sHeartsDDEnv[1][2], 255);
}
}
if (i < fullHeartCount) {
heartBgImg = gHUDDefenseHeartFullTex;
} else if (i == fullHeartCount) {
heartBgImg = sDDHeartTextures[curHeartFraction];
heartBgImg = sHeartDDTextures[curHeartFraction];
} else {
heartBgImg = gHUDDefenseHeartEmptyTex;
}
@ -545,8 +543,8 @@ void HealthMeter_HandleCriticalAlarm(GlobalContext* globalCtx) {
if (interfaceCtx->unk_22A <= 0) {
interfaceCtx->unk_22A = 0;
interfaceCtx->unk_22C = 0;
if (!Player_InCsMode(globalCtx) && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) &&
HealthMeter_IsCritical() && !Gameplay_InCsMode(globalCtx)) {
if (!Player_InCsMode(globalCtx) && (globalCtx->pauseCtx.state == 0) &&
(globalCtx->pauseCtx.debugState == 0) && HealthMeter_IsCritical() && !Gameplay_InCsMode(globalCtx)) {
func_80078884(NA_SE_SY_HITPOINT_ALARM);
}
}

View file

@ -20,20 +20,20 @@ void Map_SavePlayerInitialInfo(GlobalContext* globalCtx) {
void Map_SetPaletteData(GlobalContext* globalCtx, s16 room) {
s32 mapIndex = gSaveContext.mapIndex;
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
s16 paletteNum = gMapData->roomPalette[mapIndex][room];
s16 paletteIndex = gMapData->roomPalette[mapIndex][room];
if (interfaceCtx->mapRoomNum == room) {
interfaceCtx->mapPaletteNum = paletteNum;
interfaceCtx->mapPaletteIndex = paletteIndex;
}
osSyncPrintf(VT_FGCOL(YELLOW));
// Translates to: "PALETE Set"
osSyncPrintf("PALETEセット 【 i=%x : room=%x 】Room_Inf[%d][4]=%x ( map_palete_no = %d )\n", paletteNum,
room, mapIndex, gSaveContext.sceneFlags[mapIndex].rooms, interfaceCtx->mapPaletteNum);
osSyncPrintf("PALETEセット 【 i=%x : room=%x 】Room_Inf[%d][4]=%x ( map_palete_no = %d )\n", paletteIndex,
room, mapIndex, gSaveContext.sceneFlags[mapIndex].rooms, interfaceCtx->mapPaletteIndex);
osSyncPrintf(VT_RST);
interfaceCtx->unk_140[paletteNum * 2] = 2;
interfaceCtx->unk_140[paletteNum * 2 + 1] = 0xBF;
interfaceCtx->mapPalette[paletteIndex * 2] = 2;
interfaceCtx->mapPalette[paletteIndex * 2 + 1] = 0xBF;
}
void Map_SetFloorPalettesData(GlobalContext* globalCtx, s16 floor) {
@ -43,13 +43,13 @@ void Map_SetFloorPalettesData(GlobalContext* globalCtx, s16 floor) {
s16 i;
for (i = 0; i < 16; i++) {
interfaceCtx->unk_140[i] = 0;
interfaceCtx->unk_140[i + 16] = 0;
interfaceCtx->mapPalette[i] = 0;
interfaceCtx->mapPalette[i + 16] = 0;
}
if (CHECK_DUNGEON_ITEM(DUNGEON_MAP, mapIndex)) {
interfaceCtx->unk_140[30] = 0;
interfaceCtx->unk_140[31] = 1;
interfaceCtx->mapPalette[30] = 0;
interfaceCtx->mapPalette[31] = 1;
}
switch (globalCtx->sceneNum) {
@ -397,7 +397,7 @@ void Minimap_Draw(GlobalContext* globalCtx) {
if (CHECK_DUNGEON_ITEM(DUNGEON_COMPASS, mapIndex)) {
Minimap_DrawCompassIcons(globalCtx); // Draw icons for the player spawn and current position
func_80094520(globalCtx->state.gfxCtx);
MapMark_DrawConditionally(globalCtx);
MapMark_Draw(globalCtx);
}
}
@ -510,7 +510,7 @@ void Map_Update(GlobalContext* globalCtx) {
s16 floor;
s16 i;
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0)) {
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0)) {
switch (globalCtx->sceneNum) {
case SCENE_YDAN:
case SCENE_DDAN:
@ -522,11 +522,11 @@ void Map_Update(GlobalContext* globalCtx) {
case SCENE_HAKADAN:
case SCENE_HAKADANCH:
case SCENE_ICE_DOUKUTO:
interfaceCtx->unk_140[30] = 0;
interfaceCtx->mapPalette[30] = 0;
if (CHECK_DUNGEON_ITEM(DUNGEON_MAP, mapIndex)) {
interfaceCtx->unk_140[31] = 1;
interfaceCtx->mapPalette[31] = 1;
} else {
interfaceCtx->unk_140[31] = 0;
interfaceCtx->mapPalette[31] = 0;
}
for (floor = 0; floor < 8; floor++) {

View file

@ -74,7 +74,7 @@ void MapMark_ClearPointers(GlobalContext* globalCtx) {
sLoadedMarkDataTable = NULL;
}
void MapMark_Draw(GlobalContext* globalCtx) {
void MapMark_DrawForDungeon(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx;
MapMarkIconData* mapMarkIconData;
MapMarkPoint* markPoint;
@ -86,7 +86,7 @@ void MapMark_Draw(GlobalContext* globalCtx) {
interfaceCtx = &globalCtx->interfaceCtx;
if (gMapData != NULL && globalCtx->interfaceCtx.mapRoomNum >= gMapData->dgnMinimapCount[dungeon]) {
if ((gMapData != NULL) && (globalCtx->interfaceCtx.mapRoomNum >= gMapData->dgnMinimapCount[dungeon])) {
// Translates to: "ROOM NUMBER EXCEEDED, YIKES %d/%d MapMarkDraw PROCESSING INTERRUPTED"
osSyncPrintf(VT_COL(RED, WHITE) "部屋番号がオーバーしてるで,ヤバイで %d/%d \nMapMarkDraw の処理を中断します\n",
VT_RST, globalCtx->interfaceCtx.mapRoomNum, gMapData->dgnMinimapCount[dungeon]);
@ -107,7 +107,7 @@ void MapMark_Draw(GlobalContext* globalCtx) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->minimapAlpha);
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, interfaceCtx->minimapAlpha);
markPoint = mapMarkIconData->points;
markPoint = &mapMarkIconData->points[0];
for (i = 0; i < mapMarkIconData->count; i++) {
if ((mapMarkIconData->markType != MAP_MARK_CHEST) || !Flags_GetTreasure(globalCtx, markPoint->chestFlag)) {
markInfo = &sMapMarkInfoTable[mapMarkIconData->markType];
@ -131,7 +131,7 @@ void MapMark_Draw(GlobalContext* globalCtx) {
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_map_mark.c", 339);
}
void MapMark_DrawConditionally(GlobalContext* globalCtx) {
void MapMark_Draw(GlobalContext* globalCtx) {
switch (globalCtx->sceneNum) {
case SCENE_YDAN:
case SCENE_DDAN:
@ -148,6 +148,7 @@ void MapMark_DrawConditionally(GlobalContext* globalCtx) {
case SCENE_BDAN_BOSS:
case SCENE_MORIBOSSROOM:
case SCENE_FIRE_BS:
MapMark_Draw(globalCtx);
MapMark_DrawForDungeon(globalCtx);
break;
}
}

View file

@ -1251,7 +1251,7 @@ void Interface_LoadItemIcon1(GlobalContext* globalCtx, u16 button) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK);
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, (u32)interfaceCtx->icon_itemSegment + button * 0x1000,
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, interfaceCtx->iconItemSegment + button * 0x1000,
(u32)_icon_item_staticSegmentRomStart + (gSaveContext.equips.buttonItems[button] * 0x1000),
0x1000, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1171);
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
@ -1261,7 +1261,7 @@ void Interface_LoadItemIcon2(GlobalContext* globalCtx, u16 button) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK);
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_180, (u32)interfaceCtx->icon_itemSegment + button * 0x1000,
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_180, interfaceCtx->iconItemSegment + button * 0x1000,
(u32)_icon_item_staticSegmentRomStart + (gSaveContext.equips.buttonItems[button] * 0x1000),
0x1000, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1193);
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
@ -1998,7 +1998,7 @@ void Inventory_UpdateBottleItem(GlobalContext* globalCtx, u8 item, u8 button) {
Interface_LoadItemIcon1(globalCtx, button);
globalCtx->pauseCtx.unk_23E = item;
globalCtx->pauseCtx.cursorItem[PAUSE_ITEM] = item;
gSaveContext.buttonStatus[button] = BTN_ENABLED;
}
@ -2053,12 +2053,12 @@ void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 a
if ((action != 0x0A) && (action != 0x27) && (action != 0x44)) {
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK);
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, (u32)interfaceCtx->do_actionSegment + (arg2 * 0x180),
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, interfaceCtx->doActionSegment + (arg2 * 0x180),
(u32)_do_action_staticSegmentRomStart + (action * 0x180), 0x180, 0,
&interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2145);
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
} else {
gSegments[7] = VIRTUAL_TO_PHYSICAL(interfaceCtx->do_actionSegment);
gSegments[7] = VIRTUAL_TO_PHYSICAL(interfaceCtx->doActionSegment);
func_80086D5C(SEGMENTED_TO_VIRTUAL(sDoActionTextures[arg2]), 0x180 / 4);
}
}
@ -2114,7 +2114,7 @@ void Interface_LoadActionLabelB(GlobalContext* globalCtx, u16 action) {
interfaceCtx->unk_1FC = action;
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK);
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, (u32)interfaceCtx->do_actionSegment + 0x180,
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, interfaceCtx->doActionSegment + 0x180,
(u32)_do_action_staticSegmentRomStart + (action * 0x180), 0x180, 0, &interfaceCtx->loadQueue,
NULL, "../z_parameter.c", 2228);
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
@ -2452,7 +2452,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) {
break;
case 7:
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) && (msgCtx->msgMode == 0) &&
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) && (msgCtx->msgMode == 0) &&
(globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE) && (globalCtx->sceneLoadFlag == 0) &&
(globalCtx->transitionMode == 0) && !Gameplay_InCsMode(globalCtx)) {
if ((gSaveContext.magic == 0) || ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) ||
@ -2668,7 +2668,7 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_B_BTN_COLOR(0), R_B_BTN_COLOR(1), R_B_BTN_COLOR(2), interfaceCtx->bAlpha);
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255);
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, &D_02000A00[0], 32, 32, R_ITEM_BTN_X(0), R_ITEM_BTN_Y(0),
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, D_02000A00[0], 32, 32, R_ITEM_BTN_X(0), R_ITEM_BTN_Y(0),
R_ITEM_BTN_WIDTH(0), R_ITEM_BTN_WIDTH(0), R_ITEM_BTN_DD(0) * 2, R_ITEM_BTN_DD(0) * 2);
// C-Left Button Color & Texture
@ -2694,7 +2694,7 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(3) * 2, R_ITEM_BTN_DD(3) * 2);
if ((pauseCtx->state < 8) || (pauseCtx->state >= 18)) {
if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.flag != 0)) {
if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.debugState != 0)) {
// Start Button Texture, Color & Label
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 120, 120, 120, interfaceCtx->startAlpha);
@ -2707,7 +2707,7 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
gDPLoadTextureBlock_4b(OVERLAY_DISP++, (u32)interfaceCtx->do_actionSegment + 0x300, G_IM_FMT_IA, 48, 16, 0,
gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + 0x300, G_IM_FMT_IA, 48, 16, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD);
@ -2721,7 +2721,7 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
}
}
if (interfaceCtx->naviCalling && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) &&
if (interfaceCtx->naviCalling && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) &&
(globalCtx->csCtx.state == CS_STATE_IDLE)) {
if (!sCUpInvisible) {
// C-Up Button Texture, Color & Label (Navi Text)
@ -2777,7 +2777,7 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
interfaceCtx->cRightAlpha);
}
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, &D_02000A00[temp + 1], 0x20, 0x20, R_ITEM_BTN_X(temp),
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, D_02000A00[temp + 1], 0x20, 0x20, R_ITEM_BTN_X(temp),
R_ITEM_BTN_Y(temp), R_ITEM_BTN_WIDTH(temp), R_ITEM_BTN_WIDTH(temp),
R_ITEM_BTN_DD(temp) * 2, R_ITEM_BTN_DD(temp) * 2);
}
@ -2847,11 +2847,11 @@ void Interface_DrawAmmoCount(GlobalContext* globalCtx, s16 button, s16 alpha) {
}
if (i != 0) {
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, &D_020035C0[i], 8, 8, R_ITEM_AMMO_X(button),
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, D_020035C0[i], 8, 8, R_ITEM_AMMO_X(button),
R_ITEM_AMMO_Y(button), 8, 8, 1024, 1024);
}
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, &D_020035C0[ammo], 8, 8, R_ITEM_AMMO_X(button) + 6,
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, D_020035C0[ammo], 8, 8, R_ITEM_AMMO_X(button) + 6,
R_ITEM_AMMO_Y(button), 8, 8, 1024, 1024);
}
@ -2871,9 +2871,9 @@ void Interface_DrawActionButton(GlobalContext* globalCtx) {
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_parameter.c", 3177),
G_MTX_MODELVIEW | G_MTX_LOAD);
gSPVertex(OVERLAY_DISP++, interfaceCtx->vtx_128, 4, 0);
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[0], 4, 0);
gDPLoadTextureBlock(OVERLAY_DISP++, &D_02000A00[0], G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP,
gDPLoadTextureBlock(OVERLAY_DISP++, D_02000A00[0], G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSP1Quadrangle(OVERLAY_DISP++, 0, 2, 3, 1, 0);
@ -2885,101 +2885,104 @@ void Interface_InitVertices(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
s16 i;
interfaceCtx->vtx_128 = Graph_Alloc(globalCtx->state.gfxCtx, 8 * sizeof(Vtx));
interfaceCtx->actionVtx = Graph_Alloc(globalCtx->state.gfxCtx, 8 * sizeof(Vtx));
// clang-format off
interfaceCtx->vtx_128[0].v.ob[0] =
interfaceCtx->vtx_128[2].v.ob[0] = -14;
interfaceCtx->vtx_128[1].v.ob[0] =
interfaceCtx->vtx_128[3].v.ob[0] = interfaceCtx->vtx_128[0].v.ob[0] + 28;
interfaceCtx->actionVtx[0].v.ob[0] =
interfaceCtx->actionVtx[2].v.ob[0] = -14;
interfaceCtx->actionVtx[1].v.ob[0] =
interfaceCtx->actionVtx[3].v.ob[0] = interfaceCtx->actionVtx[0].v.ob[0] + 28;
interfaceCtx->vtx_128[0].v.ob[1] =
interfaceCtx->vtx_128[1].v.ob[1] = 14;
interfaceCtx->vtx_128[2].v.ob[1] =
interfaceCtx->vtx_128[3].v.ob[1] = interfaceCtx->vtx_128[0].v.ob[1] - 28;
interfaceCtx->actionVtx[0].v.ob[1] =
interfaceCtx->actionVtx[1].v.ob[1] = 14;
interfaceCtx->actionVtx[2].v.ob[1] =
interfaceCtx->actionVtx[3].v.ob[1] = interfaceCtx->actionVtx[0].v.ob[1] - 28;
interfaceCtx->vtx_128[4].v.ob[0] =
interfaceCtx->vtx_128[6].v.ob[0] = -(XREG(21) / 2);
interfaceCtx->vtx_128[5].v.ob[0] =
interfaceCtx->vtx_128[7].v.ob[0] = interfaceCtx->vtx_128[4].v.ob[0] + XREG(21);
interfaceCtx->actionVtx[4].v.ob[0] =
interfaceCtx->actionVtx[6].v.ob[0] = -(XREG(21) / 2);
interfaceCtx->actionVtx[5].v.ob[0] =
interfaceCtx->actionVtx[7].v.ob[0] = interfaceCtx->actionVtx[4].v.ob[0] + XREG(21);
interfaceCtx->vtx_128[4].v.ob[1] =
interfaceCtx->vtx_128[5].v.ob[1] = XREG(28) / 2;
interfaceCtx->vtx_128[6].v.ob[1] =
interfaceCtx->vtx_128[7].v.ob[1] = interfaceCtx->vtx_128[4].v.ob[1] - XREG(28);
interfaceCtx->actionVtx[4].v.ob[1] =
interfaceCtx->actionVtx[5].v.ob[1] = XREG(28) / 2;
interfaceCtx->actionVtx[6].v.ob[1] =
interfaceCtx->actionVtx[7].v.ob[1] = interfaceCtx->actionVtx[4].v.ob[1] - XREG(28);
for (i = 0; i < 8; i += 4) {
interfaceCtx->vtx_128[i].v.ob[2] = interfaceCtx->vtx_128[i+1].v.ob[2] =
interfaceCtx->vtx_128[i+2].v.ob[2] = interfaceCtx->vtx_128[i+3].v.ob[2] = 0;
interfaceCtx->actionVtx[i].v.ob[2] = interfaceCtx->actionVtx[i+1].v.ob[2] =
interfaceCtx->actionVtx[i+2].v.ob[2] = interfaceCtx->actionVtx[i+3].v.ob[2] = 0;
interfaceCtx->vtx_128[i].v.flag = interfaceCtx->vtx_128[i+1].v.flag =
interfaceCtx->vtx_128[i+2].v.flag = interfaceCtx->vtx_128[i+3].v.flag = 0;
interfaceCtx->actionVtx[i].v.flag = interfaceCtx->actionVtx[i+1].v.flag =
interfaceCtx->actionVtx[i+2].v.flag = interfaceCtx->actionVtx[i+3].v.flag = 0;
interfaceCtx->vtx_128[i].v.tc[0] = interfaceCtx->vtx_128[i].v.tc[1] =
interfaceCtx->vtx_128[i+1].v.tc[1] = interfaceCtx->vtx_128[i+2].v.tc[0] = 0;
interfaceCtx->vtx_128[i+1].v.tc[0] = interfaceCtx->vtx_128[i+2].v.tc[1] =
interfaceCtx->vtx_128[i+3].v.tc[0] = interfaceCtx->vtx_128[i+3].v.tc[1] = 1024;
interfaceCtx->actionVtx[i].v.tc[0] = interfaceCtx->actionVtx[i].v.tc[1] =
interfaceCtx->actionVtx[i+1].v.tc[1] = interfaceCtx->actionVtx[i+2].v.tc[0] = 0;
interfaceCtx->actionVtx[i+1].v.tc[0] = interfaceCtx->actionVtx[i+2].v.tc[1] =
interfaceCtx->actionVtx[i+3].v.tc[0] = interfaceCtx->actionVtx[i+3].v.tc[1] = 1024;
interfaceCtx->vtx_128[i].v.cn[0] = interfaceCtx->vtx_128[i+1].v.cn[0] =
interfaceCtx->vtx_128[i+2].v.cn[0] = interfaceCtx->vtx_128[i+3].v.cn[0] =
interfaceCtx->vtx_128[i].v.cn[1] = interfaceCtx->vtx_128[i+1].v.cn[1] =
interfaceCtx->vtx_128[i+2].v.cn[1] = interfaceCtx->vtx_128[i+3].v.cn[1] =
interfaceCtx->vtx_128[i].v.cn[2] = interfaceCtx->vtx_128[i+1].v.cn[2] =
interfaceCtx->vtx_128[i+2].v.cn[2] = interfaceCtx->vtx_128[i+3].v.cn[2] = 0xFF;
interfaceCtx->actionVtx[i].v.cn[0] = interfaceCtx->actionVtx[i+1].v.cn[0] =
interfaceCtx->actionVtx[i+2].v.cn[0] = interfaceCtx->actionVtx[i+3].v.cn[0] =
interfaceCtx->actionVtx[i].v.cn[1] = interfaceCtx->actionVtx[i+1].v.cn[1] =
interfaceCtx->actionVtx[i+2].v.cn[1] = interfaceCtx->actionVtx[i+3].v.cn[1] =
interfaceCtx->actionVtx[i].v.cn[2] = interfaceCtx->actionVtx[i+1].v.cn[2] =
interfaceCtx->actionVtx[i+2].v.cn[2] = interfaceCtx->actionVtx[i+3].v.cn[2] = 255;
interfaceCtx->vtx_128[i].v.cn[3] = interfaceCtx->vtx_128[i+1].v.cn[3] =
interfaceCtx->vtx_128[i+2].v.cn[3] = interfaceCtx->vtx_128[i+3].v.cn[3] = 0xFF;
interfaceCtx->actionVtx[i].v.cn[3] = interfaceCtx->actionVtx[i+1].v.cn[3] =
interfaceCtx->actionVtx[i+2].v.cn[3] = interfaceCtx->actionVtx[i+3].v.cn[3] = 255;
}
interfaceCtx->vtx_128[5].v.tc[0] = interfaceCtx->vtx_128[7].v.tc[0] = 1536;
interfaceCtx->vtx_128[6].v.tc[1] = interfaceCtx->vtx_128[7].v.tc[1] = 512;
interfaceCtx->actionVtx[5].v.tc[0] = interfaceCtx->actionVtx[7].v.tc[0] = 1536;
interfaceCtx->actionVtx[6].v.tc[1] = interfaceCtx->actionVtx[7].v.tc[1] = 512;
interfaceCtx->vtx_12C = Graph_Alloc(globalCtx->state.gfxCtx, 4 * sizeof(Vtx));
interfaceCtx->beatingHeartVtx = Graph_Alloc(globalCtx->state.gfxCtx, 4 * sizeof(Vtx));
interfaceCtx->vtx_12C[0].v.ob[0] = interfaceCtx->vtx_12C[2].v.ob[0] = -8;
interfaceCtx->vtx_12C[1].v.ob[0] = interfaceCtx->vtx_12C[3].v.ob[0] = 8;
interfaceCtx->vtx_12C[0].v.ob[1] = interfaceCtx->vtx_12C[1].v.ob[1] = 8;
interfaceCtx->vtx_12C[2].v.ob[1] = interfaceCtx->vtx_12C[3].v.ob[1] = -8;
interfaceCtx->beatingHeartVtx[0].v.ob[0] = interfaceCtx->beatingHeartVtx[2].v.ob[0] = -8;
interfaceCtx->beatingHeartVtx[1].v.ob[0] = interfaceCtx->beatingHeartVtx[3].v.ob[0] = 8;
interfaceCtx->beatingHeartVtx[0].v.ob[1] = interfaceCtx->beatingHeartVtx[1].v.ob[1] = 8;
interfaceCtx->beatingHeartVtx[2].v.ob[1] = interfaceCtx->beatingHeartVtx[3].v.ob[1] = -8;
interfaceCtx->vtx_12C[0].v.ob[2] = interfaceCtx->vtx_12C[1].v.ob[2] =
interfaceCtx->vtx_12C[2].v.ob[2] = interfaceCtx->vtx_12C[3].v.ob[2] = 0;
interfaceCtx->beatingHeartVtx[0].v.ob[2] = interfaceCtx->beatingHeartVtx[1].v.ob[2] =
interfaceCtx->beatingHeartVtx[2].v.ob[2] = interfaceCtx->beatingHeartVtx[3].v.ob[2] = 0;
interfaceCtx->vtx_12C[0].v.flag = interfaceCtx->vtx_12C[1].v.flag =
interfaceCtx->vtx_12C[2].v.flag = interfaceCtx->vtx_12C[3].v.flag = 0;
interfaceCtx->beatingHeartVtx[0].v.flag = interfaceCtx->beatingHeartVtx[1].v.flag =
interfaceCtx->beatingHeartVtx[2].v.flag = interfaceCtx->beatingHeartVtx[3].v.flag = 0;
interfaceCtx->vtx_12C[0].v.tc[0] = interfaceCtx->vtx_12C[0].v.tc[1] =
interfaceCtx->vtx_12C[1].v.tc[1] = interfaceCtx->vtx_12C[2].v.tc[0] = 0;
interfaceCtx->vtx_12C[1].v.tc[0] = interfaceCtx->vtx_12C[2].v.tc[1] =
interfaceCtx->vtx_12C[3].v.tc[0] = interfaceCtx->vtx_12C[3].v.tc[1] = 512;
interfaceCtx->beatingHeartVtx[0].v.tc[0] = interfaceCtx->beatingHeartVtx[0].v.tc[1] =
interfaceCtx->beatingHeartVtx[1].v.tc[1] = interfaceCtx->beatingHeartVtx[2].v.tc[0] = 0;
interfaceCtx->beatingHeartVtx[1].v.tc[0] = interfaceCtx->beatingHeartVtx[2].v.tc[1] =
interfaceCtx->beatingHeartVtx[3].v.tc[0] = interfaceCtx->beatingHeartVtx[3].v.tc[1] = 512;
interfaceCtx->vtx_12C[0].v.cn[0] = interfaceCtx->vtx_12C[1].v.cn[0] =
interfaceCtx->vtx_12C[2].v.cn[0] = interfaceCtx->vtx_12C[3].v.cn[0] =
interfaceCtx->vtx_12C[0].v.cn[1] = interfaceCtx->vtx_12C[1].v.cn[1] =
interfaceCtx->vtx_12C[2].v.cn[1] = interfaceCtx->vtx_12C[3].v.cn[1] =
interfaceCtx->vtx_12C[0].v.cn[2] = interfaceCtx->vtx_12C[1].v.cn[2] =
interfaceCtx->vtx_12C[2].v.cn[2] = interfaceCtx->vtx_12C[3].v.cn[2] =
interfaceCtx->vtx_12C[0].v.cn[3] = interfaceCtx->vtx_12C[1].v.cn[3] =
interfaceCtx->vtx_12C[2].v.cn[3] = interfaceCtx->vtx_12C[3].v.cn[3] = 0xFF;
interfaceCtx->beatingHeartVtx[0].v.cn[0] = interfaceCtx->beatingHeartVtx[1].v.cn[0] =
interfaceCtx->beatingHeartVtx[2].v.cn[0] = interfaceCtx->beatingHeartVtx[3].v.cn[0] =
interfaceCtx->beatingHeartVtx[0].v.cn[1] = interfaceCtx->beatingHeartVtx[1].v.cn[1] =
interfaceCtx->beatingHeartVtx[2].v.cn[1] = interfaceCtx->beatingHeartVtx[3].v.cn[1] =
interfaceCtx->beatingHeartVtx[0].v.cn[2] = interfaceCtx->beatingHeartVtx[1].v.cn[2] =
interfaceCtx->beatingHeartVtx[2].v.cn[2] = interfaceCtx->beatingHeartVtx[3].v.cn[2] =
interfaceCtx->beatingHeartVtx[0].v.cn[3] = interfaceCtx->beatingHeartVtx[1].v.cn[3] =
interfaceCtx->beatingHeartVtx[2].v.cn[3] = interfaceCtx->beatingHeartVtx[3].v.cn[3] = 255;
// clang-format on
}
void func_8008A8B8(GlobalContext* globalCtx, s32 topY, s32 bottomY, s32 leftX, s32 rightX) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
Vec3f sp40;
Vec3f sp34;
Vec3f sp28;
Vec3f eye;
Vec3f lookAt;
Vec3f up;
eye.x = eye.y = eye.z = 0.0f;
lookAt.x = lookAt.y = 0.0f;
lookAt.z = -1.0f;
up.x = up.z = 0.0f;
up.y = 1.0f;
func_800AA358(&interfaceCtx->view, &eye, &lookAt, &up);
sp40.x = sp40.y = sp40.z = 0.0f;
sp34.x = sp34.y = 0.0f;
sp34.z = -1.0f;
sp28.x = sp28.z = 0.0f;
sp28.y = 1.0f;
func_800AA358(&interfaceCtx->view, &sp40, &sp34, &sp28);
interfaceCtx->viewport.topY = topY;
interfaceCtx->viewport.bottomY = bottomY;
interfaceCtx->viewport.leftX = leftX;
interfaceCtx->viewport.rightX = rightX;
View_SetViewport(&interfaceCtx->view, &interfaceCtx->viewport);
func_800AA460(&interfaceCtx->view, 60.0f, 10.0f, 60.0f);
func_800AB560(&interfaceCtx->view);
}
@ -2989,9 +2992,9 @@ void func_8008A994(InterfaceContext* interfaceCtx) {
func_800AB2C4(&interfaceCtx->view);
}
s16 sMagicArrowEffectsR[] = { 0xFF, 0x64, 0xFF };
s16 sMagicArrowEffectsG[] = { 0x00, 0x64, 0xFF };
s16 sMagicArrowEffectsB[] = { 0x00, 0xFF, 0x64 };
s16 sMagicArrowEffectsR[] = { 255, 100, 255 };
s16 sMagicArrowEffectsG[] = { 0, 100, 255 };
s16 sMagicArrowEffectsB[] = { 0, 255, 100 };
s16 sTimerDigitLeftPos[] = { 16, 25, 34, 42, 51 };
s16 sDigitWidth[] = { 9, 9, 8, 9, 9 };
@ -3039,11 +3042,11 @@ void Interface_Draw(GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_parameter.c", 3405);
gSPSegment(OVERLAY_DISP++, 0x02, interfaceCtx->parameterSegment);
gSPSegment(OVERLAY_DISP++, 0x07, interfaceCtx->do_actionSegment);
gSPSegment(OVERLAY_DISP++, 0x08, interfaceCtx->icon_itemSegment);
gSPSegment(OVERLAY_DISP++, 0x07, interfaceCtx->doActionSegment);
gSPSegment(OVERLAY_DISP++, 0x08, interfaceCtx->iconItemSegment);
gSPSegment(OVERLAY_DISP++, 0x0B, interfaceCtx->mapSegment);
if (pauseCtx->flag == 0) {
if (pauseCtx->debugState == 0) {
Interface_InitVertices(globalCtx);
func_8008A994(interfaceCtx);
HealthMeter_Draw(globalCtx);
@ -3093,12 +3096,12 @@ void Interface_Draw(GlobalContext* globalCtx) {
phi_s2 = 42;
if (interfaceCtx->counterDigits[2] != 0) {
OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, &D_02003040[interfaceCtx->counterDigits[2]], 8, 16,
OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, D_02003040[interfaceCtx->counterDigits[2]], 8, 16,
phi_s2, 190, 8, 16, 1024, 1024);
phi_s2 = 50;
}
OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, &D_02003040[interfaceCtx->counterDigits[3]], 8, 16,
OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, D_02003040[interfaceCtx->counterDigits[3]], 8, 16,
phi_s2, 190, 8, 16, 1024, 1024);
}
@ -3146,7 +3149,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
phi_s1 = sRupeeDigitsCount[CUR_UPG_VALUE(UPG_WALLET)];
for (phi_s3 = 0; phi_s3 < phi_s1; phi_s3++, phi_s0++, phi_s2 += 8) {
OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, &D_02003040[interfaceCtx->counterDigits[phi_s0]], 8, 16, phi_s2,
OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, D_02003040[interfaceCtx->counterDigits[phi_s0]], 8, 16, phi_s2,
206, 8, 16, 1024, 1024);
}
@ -3168,7 +3171,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
if (interfaceCtx->unk_1FA == 0) {
// B Button Icon & possibly Ammo Count
if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) {
Interface_DrawItemIconTexture(globalCtx, (void*)(u32)interfaceCtx->icon_itemSegment, 0);
Interface_DrawItemIconTexture(globalCtx, interfaceCtx->iconItemSegment, 0);
if ((player->stateFlags1 & 0x00800000) || (globalCtx->shootingGalleryStatus > 1) ||
((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))) {
@ -3185,7 +3188,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->bAlpha);
gDPLoadTextureBlock_4b(OVERLAY_DISP++, (u32)interfaceCtx->do_actionSegment + 0x180, G_IM_FMT_IA, 48, 16, 0,
gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + 0x180, G_IM_FMT_IA, 48, 16, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD);
@ -3202,7 +3205,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
if (gSaveContext.equips.buttonItems[1] < 0xF0) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cLeftAlpha);
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
Interface_DrawItemIconTexture(globalCtx, (void*)((u32)interfaceCtx->icon_itemSegment + 0x1000), 1);
Interface_DrawItemIconTexture(globalCtx, interfaceCtx->iconItemSegment + 0x1000, 1);
gDPPipeSync(OVERLAY_DISP++);
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
@ -3215,7 +3218,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
if (gSaveContext.equips.buttonItems[2] < 0xF0) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cDownAlpha);
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
Interface_DrawItemIconTexture(globalCtx, (void*)((u32)interfaceCtx->icon_itemSegment + 0x2000), 2);
Interface_DrawItemIconTexture(globalCtx, interfaceCtx->iconItemSegment + 0x2000, 2);
gDPPipeSync(OVERLAY_DISP++);
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
@ -3228,7 +3231,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
if (gSaveContext.equips.buttonItems[3] < 0xF0) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cRightAlpha);
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
Interface_DrawItemIconTexture(globalCtx, (void*)((u32)interfaceCtx->icon_itemSegment + 0x3000), 3);
Interface_DrawItemIconTexture(globalCtx, interfaceCtx->iconItemSegment + 0x3000, 3);
gDPPipeSync(OVERLAY_DISP++);
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
@ -3255,12 +3258,12 @@ void Interface_Draw(GlobalContext* globalCtx) {
Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY);
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_parameter.c", 3701),
G_MTX_MODELVIEW | G_MTX_LOAD);
gSPVertex(OVERLAY_DISP++, &interfaceCtx->vtx_128[4], 4, 0);
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[4], 4, 0);
if ((interfaceCtx->unk_1EC < 2) || (interfaceCtx->unk_1EC == 3)) {
Interface_DrawActionLabel(globalCtx->state.gfxCtx, (void*)(u32)interfaceCtx->do_actionSegment);
Interface_DrawActionLabel(globalCtx->state.gfxCtx, interfaceCtx->doActionSegment);
} else {
Interface_DrawActionLabel(globalCtx->state.gfxCtx, (void*)((u32)interfaceCtx->do_actionSegment + 0x180));
Interface_DrawActionLabel(globalCtx->state.gfxCtx, interfaceCtx->doActionSegment + 0x180);
}
gDPPipeSync(OVERLAY_DISP++);
@ -3269,45 +3272,45 @@ void Interface_Draw(GlobalContext* globalCtx) {
if ((pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 3)) {
// Inventory Equip Effects
gSPSegment(OVERLAY_DISP++, 0x08, pauseCtx->unk_128);
gSPSegment(OVERLAY_DISP++, 0x08, pauseCtx->iconItemSegment);
func_80094A14(globalCtx->state.gfxCtx);
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
gSPMatrix(OVERLAY_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
pauseCtx->vtx_168[16].v.ob[0] = pauseCtx->vtx_168[18].v.ob[0] = pauseCtx->unk_254 / 10;
pauseCtx->vtx_168[17].v.ob[0] = pauseCtx->vtx_168[19].v.ob[0] =
pauseCtx->vtx_168[16].v.ob[0] + WREG(90) / 10;
pauseCtx->vtx_168[16].v.ob[1] = pauseCtx->vtx_168[17].v.ob[1] = pauseCtx->unk_256 / 10;
pauseCtx->vtx_168[18].v.ob[1] = pauseCtx->vtx_168[19].v.ob[1] =
pauseCtx->vtx_168[16].v.ob[1] - WREG(90) / 10;
pauseCtx->cursorVtx[16].v.ob[0] = pauseCtx->cursorVtx[18].v.ob[0] = pauseCtx->equipAnimX / 10;
pauseCtx->cursorVtx[17].v.ob[0] = pauseCtx->cursorVtx[19].v.ob[0] =
pauseCtx->cursorVtx[16].v.ob[0] + WREG(90) / 10;
pauseCtx->cursorVtx[16].v.ob[1] = pauseCtx->cursorVtx[17].v.ob[1] = pauseCtx->equipAnimY / 10;
pauseCtx->cursorVtx[18].v.ob[1] = pauseCtx->cursorVtx[19].v.ob[1] =
pauseCtx->cursorVtx[16].v.ob[1] - WREG(90) / 10;
if (pauseCtx->unk_24E < 0xBF) {
if (pauseCtx->equipTargetItem < 0xBF) {
// Normal Equip (icon goes from the inventory slot to the C button when equipping it)
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, pauseCtx->unk_258);
gSPVertex(OVERLAY_DISP++, &pauseCtx->vtx_168[16], 4, 0);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, pauseCtx->equipAnimAlpha);
gSPVertex(OVERLAY_DISP++, &pauseCtx->cursorVtx[16], 4, 0);
gDPLoadTextureBlock(OVERLAY_DISP++, gItemIcons[pauseCtx->unk_24E], G_IM_FMT_RGBA, G_IM_SIZ_32b, 32, 32,
0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD);
gDPLoadTextureBlock(OVERLAY_DISP++, gItemIcons[pauseCtx->equipTargetItem], G_IM_FMT_RGBA, G_IM_SIZ_32b,
32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
} else {
// Magic Arrow Equip Effect
phi_s3_2 = pauseCtx->unk_24E - 0xBF;
phi_s3_2 = pauseCtx->equipTargetItem - 0xBF;
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, sMagicArrowEffectsR[phi_s3_2], sMagicArrowEffectsG[phi_s3_2],
sMagicArrowEffectsB[phi_s3_2], pauseCtx->unk_258);
sMagicArrowEffectsB[phi_s3_2], pauseCtx->equipAnimAlpha);
if ((pauseCtx->unk_258 > 0) && (pauseCtx->unk_258 < 0xFF)) {
phi_s3_2 = (pauseCtx->unk_258 / 8) / 2;
pauseCtx->vtx_168[16].v.ob[0] = pauseCtx->vtx_168[18].v.ob[0] =
pauseCtx->vtx_168[16].v.ob[0] - phi_s3_2;
pauseCtx->vtx_168[17].v.ob[0] = pauseCtx->vtx_168[19].v.ob[0] =
pauseCtx->vtx_168[16].v.ob[0] + phi_s3_2 * 2 + 32;
pauseCtx->vtx_168[16].v.ob[1] = pauseCtx->vtx_168[17].v.ob[1] =
pauseCtx->vtx_168[16].v.ob[1] + phi_s3_2;
pauseCtx->vtx_168[18].v.ob[1] = pauseCtx->vtx_168[19].v.ob[1] =
pauseCtx->vtx_168[16].v.ob[1] - phi_s3_2 * 2 - 32;
if ((pauseCtx->equipAnimAlpha > 0) && (pauseCtx->equipAnimAlpha < 255)) {
phi_s3_2 = (pauseCtx->equipAnimAlpha / 8) / 2;
pauseCtx->cursorVtx[16].v.ob[0] = pauseCtx->cursorVtx[18].v.ob[0] =
pauseCtx->cursorVtx[16].v.ob[0] - phi_s3_2;
pauseCtx->cursorVtx[17].v.ob[0] = pauseCtx->cursorVtx[19].v.ob[0] =
pauseCtx->cursorVtx[16].v.ob[0] + phi_s3_2 * 2 + 32;
pauseCtx->cursorVtx[16].v.ob[1] = pauseCtx->cursorVtx[17].v.ob[1] =
pauseCtx->cursorVtx[16].v.ob[1] + phi_s3_2;
pauseCtx->cursorVtx[18].v.ob[1] = pauseCtx->cursorVtx[19].v.ob[1] =
pauseCtx->cursorVtx[16].v.ob[1] - phi_s3_2 * 2 - 32;
}
gSPVertex(OVERLAY_DISP++, &pauseCtx->vtx_168[16], 4, 0);
gSPVertex(OVERLAY_DISP++, &pauseCtx->cursorVtx[16], 4, 0);
gDPLoadTextureBlock(OVERLAY_DISP++, D_080895C0, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD);
@ -3318,7 +3321,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
func_80094520(globalCtx->state.gfxCtx);
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0)) {
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0)) {
if (gSaveContext.minigameState != 1) {
// Carrots rendering if the action corresponds to riding a horse
if (interfaceCtx->unk_1EE == 8) {
@ -3364,7 +3367,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
for (phi_s3 = 0; phi_s3 < 4; phi_s3++) {
if (sHBAScoreDigits[phi_s3] != 0 || (phi_s0 != 0) || (phi_s3 >= 3)) {
OVERLAY_DISP =
Gfx_TextureI8(OVERLAY_DISP, &D_02003040[sHBAScoreDigits[phi_s3]], 8, 16, phi_s1,
Gfx_TextureI8(OVERLAY_DISP, D_02003040[sHBAScoreDigits[phi_s3]], 8, 16, phi_s1,
ZREG(15) - 2, sDigitWidth[0], VREG(42), VREG(43) * 2, VREG(43) * 2);
phi_s1 += 9;
phi_s0++;
@ -3413,7 +3416,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
}
}
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) &&
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) &&
(globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE) && (msgCtx->msgMode == 0) &&
!(player->stateFlags2 & 0x01000000) && (globalCtx->sceneLoadFlag == 0) &&
(globalCtx->transitionMode == 0) && !Gameplay_InCsMode(globalCtx) && (gSaveContext.minigameState != 1) &&
@ -3779,7 +3782,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
}
for (phi_s3 = 0; phi_s3 < 5; phi_s3++) {
OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, &D_02003040[sTimerDigits[phi_s3]], 8, 16,
OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, D_02003040[sTimerDigits[phi_s3]], 8, 16,
gSaveContext.timerX[sp274] + sTimerDigitLeftPos[phi_s3],
gSaveContext.timerY[sp274], sDigitWidth[phi_s3], VREG(42),
VREG(43) * 2, VREG(43) * 2);
@ -3788,7 +3791,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
}
}
if (pauseCtx->flag == 3) {
if (pauseCtx->debugState == 3) {
FlagSet_Update(globalCtx);
}
@ -3832,7 +3835,7 @@ void Interface_Update(GlobalContext* globalCtx) {
osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language);
}
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0)) {
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0)) {
if ((gSaveContext.minigameState == 1) || (gSaveContext.sceneSetupIndex < 4) ||
((globalCtx->sceneNum == SCENE_SPOT20) && (gSaveContext.sceneSetupIndex == 4))) {
if ((msgCtx->msgMode == 0) || ((msgCtx->msgMode != 0) && (globalCtx->sceneNum == SCENE_BOWLING))) {
@ -3974,7 +3977,7 @@ void Interface_Update(GlobalContext* globalCtx) {
HealthMeter_Update(globalCtx);
if ((gSaveContext.timer1State >= 3) && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) &&
if ((gSaveContext.timer1State >= 3) && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) &&
(msgCtx->msgMode == 0) && !(player->stateFlags2 & 0x01000000) && (globalCtx->sceneLoadFlag == 0) &&
(globalCtx->transitionMode == 0) && !Gameplay_InCsMode(globalCtx)) {}
@ -4055,7 +4058,7 @@ void Interface_Update(GlobalContext* globalCtx) {
WREG(7) = interfaceCtx->unk_1F4;
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) && (msgCtx->msgMode == 0) &&
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) && (msgCtx->msgMode == 0) &&
(globalCtx->sceneLoadFlag == 0) && (globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE) &&
(globalCtx->transitionMode == 0) &&
((globalCtx->csCtx.state == CS_STATE_IDLE) || !Player_InCsMode(globalCtx))) {

View file

@ -778,7 +778,7 @@ void Gameplay_Update(GlobalContext* globalCtx) {
LOG_NUM("1", 1, "../z_play.c", 3551);
}
sp80 = (globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.flag != 0);
sp80 = (globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.debugState != 0);
if (1 && HREG(63)) {
LOG_NUM("1", 1, "../z_play.c", 3555);
@ -903,7 +903,7 @@ void Gameplay_Update(GlobalContext* globalCtx) {
if (globalCtx->unk_1242B != 0) {
if (CHECK_BTN_ALL(input[0].press.button, BTN_CUP)) {
if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.flag != 0)) {
if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.debugState != 0)) {
// Translates to: "Changing viewpoint is prohibited due to the kaleidoscope"
osSyncPrintf(VT_FGCOL(CYAN) "カレイドスコープ中につき視点変更を禁止しております\n" VT_RST);
} else if (Player_InCsMode(globalCtx)) {
@ -928,7 +928,7 @@ void Gameplay_Update(GlobalContext* globalCtx) {
LOG_NUM("1", 1, "../z_play.c", 3716);
}
if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.flag != 0)) {
if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.debugState != 0)) {
if (1 && HREG(63)) {
LOG_NUM("1", 1, "../z_play.c", 3721);
}
@ -1031,7 +1031,7 @@ skip:
}
void Gameplay_DrawOverlayElements(GlobalContext* globalCtx) {
if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.flag != 0)) {
if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.debugState != 0)) {
KaleidoScopeCall_Draw(globalCtx);
}

View file

@ -1367,7 +1367,7 @@ u32 func_80091738(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime) {
SkelAnime_InitLink(globalCtx, skelAnime, gPlayerSkelHeaders[(void)0, gSaveContext.linkAge], &gPlayerAnim_003238, 9,
ptr, ptr, PLAYER_LIMB_MAX);
return size + 0x8890;
return size + 0x8800 + 0x90;
}
u8 D_801261F8[] = { 2, 2, 5 };
@ -1412,7 +1412,7 @@ s32 func_80091880(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
return 0;
}
void func_80091A24(GlobalContext* globalCtx, void* seg04, void* seg06, SkelAnime* arg3, Vec3f* pos, Vec3s* rot,
void func_80091A24(GlobalContext* globalCtx, void* seg04, void* seg06, SkelAnime* skelAnime, Vec3f* pos, Vec3s* rot,
f32 scale, s32 sword, s32 tunic, s32 shield, s32 boots, s32 width, s32 height, Vec3f* eye, Vec3f* at,
f32 fovy, void* img1, void* img2) {
static Vp viewport = { 128, 224, 511, 0, 128, 224, 511, 0 };
@ -1503,8 +1503,8 @@ void func_80091A24(GlobalContext* globalCtx, void* seg04, void* seg06, SkelAnime
gSPSegment(POLY_OPA_DISP++, 0x0C, gCullBackDList);
func_8008F470(globalCtx, arg3->skeleton, arg3->jointTable, arg3->dListCount, 0, tunic, boots, 0, func_80091880,
NULL, &sp12C);
func_8008F470(globalCtx, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount, 0, tunic, boots, 0,
func_80091880, NULL, &sp12C);
gSPEndDisplayList(POLY_OPA_DISP++);
gSPEndDisplayList(POLY_XLU_DISP++);
@ -1515,8 +1515,8 @@ void func_80091A24(GlobalContext* globalCtx, void* seg04, void* seg06, SkelAnime
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 3288);
}
void func_8009214C(GlobalContext* globalCtx, u8* segment, SkelAnime* arg2, Vec3f* pos, Vec3s* rot, f32 scale, s32 sword,
s32 tunic, s32 shield, s32 boots) {
void func_8009214C(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime, Vec3f* pos, Vec3s* rot, f32 scale,
s32 sword, s32 tunic, s32 shield, s32 boots) {
static Vec3f eye = { 0.0f, 0.0f, -400.0f };
static Vec3f at = { 0.0f, 0.0f, 0.0f };
Vec3s* destTable;
@ -1543,12 +1543,12 @@ void func_8009214C(GlobalContext* globalCtx, u8* segment, SkelAnime* arg2, Vec3f
}
srcTable = SEGMENTED_TO_VIRTUAL(srcTable);
destTable = arg2->jointTable;
for (i = 0; i < arg2->limbCount; i++) {
destTable = skelAnime->jointTable;
for (i = 0; i < skelAnime->limbCount; i++) {
*destTable++ = *srcTable++;
}
func_80091A24(globalCtx, segment + 0x3800, segment + 0x8800, arg2, pos, rot, scale, sword, tunic, shield, boots, 64,
112, &eye, &at, 60.0f, globalCtx->state.gfxCtx->curFrameBuffer,
func_80091A24(globalCtx, segment + 0x3800, segment + 0x8800, skelAnime, pos, rot, scale, sword, tunic, shield,
boots, 64, 112, &eye, &at, 60.0f, globalCtx->state.gfxCtx->curFrameBuffer,
globalCtx->state.gfxCtx->curFrameBuffer + 0x1C00);
}

View file

@ -27,7 +27,7 @@ void Sample_Draw(SampleContext* this) {
gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_LOAD);
}
POLY_OPA_DISP = Gfx_SetFog2(POLY_OPA_DISP, 0xFF, 0xFF, 0xFF, 0, 0, 0);
POLY_OPA_DISP = Gfx_SetFog2(POLY_OPA_DISP, 255, 255, 255, 0, 0, 0);
func_80093D18(gfxCtx);
gDPSetCycleType(POLY_OPA_DISP++, G_CYC_1CYCLE);
@ -54,24 +54,24 @@ void Sample_SetupView(SampleContext* this) {
View_Init(view, gfxCtx);
SET_FULLSCREEN_VIEWPORT(view);
func_800AA460(view, 60, 10, 12800);
func_800AA460(view, 60.0f, 10.0f, 12800.0f);
{
Vec3f v1;
Vec3f v2;
Vec3f v3;
Vec3f eye;
Vec3f lookAt;
Vec3f up;
v1.x = 0;
v1.y = 0;
v2.x = 0;
v2.y = 0;
v2.z = 0;
v3.x = 0;
v3.z = 0;
v1.z = 3000;
v3.y = 1;
eye.x = 0.0f;
eye.y = 0.0f;
eye.z = 3000.0f;
lookAt.x = 0.0f;
lookAt.y = 0.0f;
lookAt.z = 0.0f;
up.x = 0.0f;
up.z = 0.0f;
up.y = 1.0f;
func_800AA358(view, &v1, &v2, &v3);
func_800AA358(view, &eye, &lookAt, &up);
}
}

View file

@ -451,7 +451,7 @@ void Sram_OpenSave(SramContext* sramCtx) {
* Write the contents of the Save Context to a main and backup slot in SRAM.
* Note: The whole Save Context is written even though only the `save` substruct is read back later
*/
void Sram_WriteSave(s32 unused) {
void Sram_WriteSave(SramContext* sramCtx) {
u16 offset;
u16 checksum;
u16 j;