mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-03 22:44:30 +00:00
Match a few more functions (#446)
This commit is contained in:
parent
08c4065a5e
commit
57db7ba526
10 changed files with 120 additions and 2077 deletions
|
@ -2016,9 +2016,7 @@ void Cutscene_HandleEntranceTriggers(GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void Cutscene_HandleConditionalTriggers(GlobalContext* globalCtx) {
|
||||
s32 temp; // inline temp needed to match regalloc
|
||||
|
||||
osSyncPrintf("\ngame_info.mode=[%d] restart_flag", temp = gSaveContext.respawnFlag);
|
||||
osSyncPrintf("\ngame_info.mode=[%d] restart_flag", ((void)0, gSaveContext.respawnFlag));
|
||||
|
||||
if ((gSaveContext.gameMode == 0) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
|
||||
if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(0xAC)) {
|
||||
|
@ -2037,12 +2035,12 @@ void Cutscene_HandleConditionalTriggers(GlobalContext* globalCtx) {
|
|||
gSaveContext.cutsceneIndex = 0xFFF0;
|
||||
} else if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) &&
|
||||
LINK_IS_ADULT && !Flags_GetEventChkInf(0xC4) &&
|
||||
(gEntranceTable[temp = gSaveContext.entranceIndex].scene == SCENE_TOKINOMA)) {
|
||||
(gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_TOKINOMA)) {
|
||||
Flags_SetEventChkInf(0xC4);
|
||||
gSaveContext.entranceIndex = 0x0053;
|
||||
gSaveContext.cutsceneIndex = 0xFFF8;
|
||||
} else if (!Flags_GetEventChkInf(0xC7) &&
|
||||
(gEntranceTable[temp = gSaveContext.entranceIndex].scene == SCENE_GANON_DEMO)) {
|
||||
(gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_GANON_DEMO)) {
|
||||
Flags_SetEventChkInf(0xC7);
|
||||
gSaveContext.entranceIndex = 0x0517;
|
||||
gSaveContext.cutsceneIndex = 0xFFF0;
|
||||
|
|
|
@ -11,7 +11,9 @@ extern void KaleidoScope_Update(GlobalContext*);
|
|||
extern void KaleidoScope_Draw(GlobalContext*);
|
||||
|
||||
void KaleidoScopeCall_LoadPlayer() {
|
||||
if ((u32)gKaleidoMgrCurOvl != (u32)&gKaleidoMgrOverlayTable[KALEIDO_OVL_PLAYER_ACTOR]) {
|
||||
KaleidoManagerOvl* playerActorOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_PLAYER_ACTOR];
|
||||
|
||||
if (gKaleidoMgrCurOvl != playerActorOvl) {
|
||||
if (gKaleidoMgrCurOvl) {
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
osSyncPrintf("カレイド領域 強制排除\n"); // Kaleido area forced exclusion
|
||||
|
@ -21,7 +23,7 @@ void KaleidoScopeCall_LoadPlayer() {
|
|||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
osSyncPrintf("プレイヤーアクター搬入\n"); // Player actor import
|
||||
osSyncPrintf(VT_RST);
|
||||
KaleidoManager_LoadOvl(&gKaleidoMgrOverlayTable[KALEIDO_OVL_PLAYER_ACTOR]);
|
||||
KaleidoManager_LoadOvl(playerActorOvl);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,13 +46,9 @@ void KaleidoScopeCall_Destroy(GlobalContext* globalCtx) {
|
|||
KaleidoSetup_Destroy(globalCtx);
|
||||
}
|
||||
|
||||
// regalloc
|
||||
#ifdef NON_MATCHING
|
||||
void KaleidoScopeCall_Update(GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
PauseContext* pauseCtx;
|
||||
|
||||
pauseCtx = &globalCtx->pauseCtx;
|
||||
KaleidoManagerOvl* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
|
||||
PauseContext* pauseCtx = &globalCtx->pauseCtx;
|
||||
|
||||
if (pauseCtx->state != 0 || pauseCtx->flag != 0) {
|
||||
if (pauseCtx->state == 1) {
|
||||
|
@ -60,7 +58,7 @@ void KaleidoScopeCall_Update(GlobalContext* globalCtx) {
|
|||
R_PAUSE_MENU_MODE = 1;
|
||||
pauseCtx->unk_1E4 = 0;
|
||||
pauseCtx->unk_1EC = 0;
|
||||
pauseCtx->state++;
|
||||
pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1;
|
||||
}
|
||||
} else if (pauseCtx->state == 8) {
|
||||
HREG(80) = 7;
|
||||
|
@ -68,15 +66,15 @@ void KaleidoScopeCall_Update(GlobalContext* globalCtx) {
|
|||
R_PAUSE_MENU_MODE = 1;
|
||||
pauseCtx->unk_1E4 = 0;
|
||||
pauseCtx->unk_1EC = 0;
|
||||
pauseCtx->state++;
|
||||
pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1;
|
||||
} 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++;
|
||||
}
|
||||
} else if (pauseCtx->state != 0) {
|
||||
if (&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE] != gKaleidoMgrCurOvl) {
|
||||
if (gKaleidoMgrCurOvl) {
|
||||
if (gKaleidoMgrCurOvl != kaleidoScopeOvl) {
|
||||
if (gKaleidoMgrCurOvl != NULL) {
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
osSyncPrintf("カレイド領域 プレイヤー 強制排除\n"); // Kaleid Zone Player Forced Elimination
|
||||
osSyncPrintf(VT_RST);
|
||||
|
@ -85,32 +83,29 @@ void KaleidoScopeCall_Update(GlobalContext* globalCtx) {
|
|||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
osSyncPrintf("カレイド領域 カレイドスコープ搬入\n"); // Kaleid area Kaleidoscope loading
|
||||
osSyncPrintf(VT_RST);
|
||||
KaleidoManager_LoadOvl(&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE]);
|
||||
KaleidoManager_LoadOvl(kaleidoScopeOvl);
|
||||
}
|
||||
if (&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE] == gKaleidoMgrCurOvl) {
|
||||
|
||||
if (gKaleidoMgrCurOvl == kaleidoScopeOvl) {
|
||||
sKaleidoScopeUpdateFunc(globalCtx);
|
||||
if (globalCtx->pauseCtx.state == 0 && globalCtx->pauseCtx.flag == 0) {
|
||||
osSyncPrintf(VT_FGCOL(GREEN));
|
||||
osSyncPrintf("カレイド領域 カレイドスコープ排出\n"); // Kaleid area Kaleidoscope emission
|
||||
osSyncPrintf(VT_RST);
|
||||
KaleidoManager_ClearOvl(&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE]);
|
||||
KaleidoManager_ClearOvl(kaleidoScopeOvl);
|
||||
KaleidoScopeCall_LoadPlayer();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kaleido_scope_call/KaleidoScopeCall_Update.s")
|
||||
#endif
|
||||
|
||||
void KaleidoScopeCall_Draw(GlobalContext* globalCtx) {
|
||||
KaleidoManagerOvl* kaleidoScopeOvl;
|
||||
KaleidoManagerOvl* 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)) {
|
||||
kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
|
||||
if (gKaleidoMgrCurOvl == kaleidoScopeOvl) {
|
||||
sKaleidoScopeDrawFunc(globalCtx);
|
||||
}
|
||||
|
|
|
@ -2356,8 +2356,6 @@ s32 func_80087708(GlobalContext* globalCtx, s16 arg1, s16 arg2) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// this function still needs some work
|
||||
void Interface_UpdateMagicBar(GlobalContext* globalCtx) {
|
||||
static s16 sMagicBorderColors[][3] = {
|
||||
{ 0xFF, 0xFF, 0xFF },
|
||||
|
@ -2368,28 +2366,33 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) {
|
|||
static s16 sMagicBorderIndexes[] = { 0, 1, 1, 0 };
|
||||
static s16 sMagicBorderRatio = 2;
|
||||
static s16 sMagicBorderStep = 1;
|
||||
s16* color;
|
||||
s16 maxMagic;
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
s16 borderChangeR;
|
||||
s16 borderChangeG;
|
||||
s16 borderChangeB;
|
||||
s16 temp;
|
||||
|
||||
switch (gSaveContext.unk_13F0) {
|
||||
case 8:
|
||||
maxMagic = gSaveContext.magicLevel * 0x30;
|
||||
if (gSaveContext.unk_13F4 != maxMagic) {
|
||||
if (gSaveContext.unk_13F4 < maxMagic) {
|
||||
temp = gSaveContext.magicLevel * 0x30;
|
||||
if (gSaveContext.unk_13F4 != temp) {
|
||||
if (gSaveContext.unk_13F4 < temp) {
|
||||
gSaveContext.unk_13F4 += 8;
|
||||
if (gSaveContext.unk_13F4 > maxMagic) {
|
||||
gSaveContext.unk_13F4 = maxMagic;
|
||||
if (gSaveContext.unk_13F4 > temp) {
|
||||
gSaveContext.unk_13F4 = temp;
|
||||
}
|
||||
} else {
|
||||
gSaveContext.unk_13F4 -= 8;
|
||||
if (gSaveContext.unk_13F4 <= maxMagic) {
|
||||
gSaveContext.unk_13F4 = maxMagic;
|
||||
if (gSaveContext.unk_13F4 <= temp) {
|
||||
gSaveContext.unk_13F4 = temp;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gSaveContext.unk_13F0 = 9;
|
||||
}
|
||||
break;
|
||||
|
||||
case 9:
|
||||
gSaveContext.magic += 4;
|
||||
|
||||
|
@ -2398,60 +2401,61 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) {
|
|||
&D_801333E8);
|
||||
}
|
||||
|
||||
// Translates to: "Storage MAGIC_NOW=%d (%d)"
|
||||
osSyncPrintf("蓄電 MAGIC_NOW=%d (%d)\n", gSaveContext.magic, gSaveContext.unk_13F6);
|
||||
// Translates to: "Storage MAGIC_NOW=%d (%d)"
|
||||
osSyncPrintf("蓄電 MAGIC_NOW=%d (%d)\n", gSaveContext.magic, gSaveContext.unk_13F6);
|
||||
if (gSaveContext.magic >= gSaveContext.unk_13F6) {
|
||||
gSaveContext.magic = gSaveContext.unk_13F6;
|
||||
gSaveContext.unk_13F0 = gSaveContext.unk_13F2;
|
||||
gSaveContext.unk_13F2 = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
sMagicBorderRatio = 2;
|
||||
gSaveContext.unk_13F0 = 2;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
gSaveContext.magic -= 2;
|
||||
if (gSaveContext.magic <= 0) {
|
||||
gSaveContext.magic = 0;
|
||||
gSaveContext.unk_13F0 = 3;
|
||||
sMagicBorderB = 255;
|
||||
sMagicBorderG = 255;
|
||||
sMagicBorderR = 255;
|
||||
sMagicBorderR = sMagicBorderG = sMagicBorderB = 255;
|
||||
} else if (gSaveContext.magic == gSaveContext.unk_13F8) {
|
||||
gSaveContext.unk_13F0 = 3;
|
||||
sMagicBorderB = 255;
|
||||
sMagicBorderG = 255;
|
||||
sMagicBorderR = 255;
|
||||
sMagicBorderR = sMagicBorderG = sMagicBorderB = 255;
|
||||
}
|
||||
case 3:
|
||||
case 4:
|
||||
case 6:
|
||||
color = sMagicBorderColors[sMagicBorderIndexes[sMagicBorderStep]];
|
||||
temp = sMagicBorderIndexes[sMagicBorderStep];
|
||||
borderChangeR = ABS(sMagicBorderR - sMagicBorderColors[temp][0]) / sMagicBorderRatio;
|
||||
borderChangeG = ABS(sMagicBorderG - sMagicBorderColors[temp][1]) / sMagicBorderRatio;
|
||||
borderChangeB = ABS(sMagicBorderB - sMagicBorderColors[temp][2]) / sMagicBorderRatio;
|
||||
|
||||
if (sMagicBorderR >= color[0]) {
|
||||
sMagicBorderR -= ABS(sMagicBorderR - color[0]) / sMagicBorderRatio;
|
||||
if (sMagicBorderR >= sMagicBorderColors[temp][0]) {
|
||||
sMagicBorderR -= borderChangeR;
|
||||
} else {
|
||||
sMagicBorderR += ABS(sMagicBorderR - color[0]) / sMagicBorderRatio;
|
||||
sMagicBorderR += borderChangeR;
|
||||
}
|
||||
|
||||
if (sMagicBorderG >= color[1]) {
|
||||
sMagicBorderG -= ABS(sMagicBorderG - color[1]) / sMagicBorderRatio;
|
||||
if (sMagicBorderG >= sMagicBorderColors[temp][1]) {
|
||||
sMagicBorderG -= borderChangeG;
|
||||
} else {
|
||||
sMagicBorderG += ABS(sMagicBorderG - color[1]) / sMagicBorderRatio;
|
||||
sMagicBorderG += borderChangeG;
|
||||
}
|
||||
|
||||
if (sMagicBorderB >= color[2]) {
|
||||
sMagicBorderB -= ABS(sMagicBorderB - color[2]) / sMagicBorderRatio;
|
||||
if (sMagicBorderB >= sMagicBorderColors[temp][2]) {
|
||||
sMagicBorderB -= borderChangeB;
|
||||
} else {
|
||||
sMagicBorderB += ABS(sMagicBorderB - color[2]) / sMagicBorderRatio;
|
||||
sMagicBorderB += borderChangeB;
|
||||
}
|
||||
|
||||
sMagicBorderRatio--;
|
||||
if (sMagicBorderRatio == 0) {
|
||||
sMagicBorderR = color[0];
|
||||
sMagicBorderG = color[1];
|
||||
sMagicBorderB = color[2];
|
||||
sMagicBorderR = sMagicBorderColors[temp][0];
|
||||
sMagicBorderG = sMagicBorderColors[temp][1];
|
||||
sMagicBorderB = sMagicBorderColors[temp][2];
|
||||
sMagicBorderRatio = YREG(40 + sMagicBorderStep);
|
||||
sMagicBorderStep++;
|
||||
if (sMagicBorderStep >= 4) {
|
||||
|
@ -2459,16 +2463,16 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
sMagicBorderB = 255;
|
||||
sMagicBorderG = 255;
|
||||
sMagicBorderR = 255;
|
||||
sMagicBorderR = sMagicBorderG = sMagicBorderB = 255;
|
||||
gSaveContext.unk_13F0 = 0;
|
||||
break;
|
||||
|
||||
case 7:
|
||||
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) &&
|
||||
(globalCtx->msgCtx.msgMode == 0) && (globalCtx->unk_10A20 == 0) && (globalCtx->sceneLoadFlag == 0) &&
|
||||
(globalCtx->transitionMode == 0) && !Gameplay_InCsMode(globalCtx)) {
|
||||
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) && (msgCtx->msgMode == 0) &&
|
||||
(globalCtx->unk_10A20 == 0) && (globalCtx->sceneLoadFlag == 0) && (globalCtx->transitionMode == 0) &&
|
||||
!Gameplay_InCsMode(globalCtx)) {
|
||||
if ((gSaveContext.magic == 0) || ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) ||
|
||||
((gSaveContext.equips.buttonItems[1] != ITEM_LENS) &&
|
||||
(gSaveContext.equips.buttonItems[2] != ITEM_LENS) &&
|
||||
|
@ -2482,38 +2486,41 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) {
|
|||
break;
|
||||
}
|
||||
|
||||
globalCtx->interfaceCtx.unk_230--;
|
||||
if (globalCtx->interfaceCtx.unk_230 == 0) {
|
||||
interfaceCtx->unk_230--;
|
||||
if (interfaceCtx->unk_230 == 0) {
|
||||
gSaveContext.magic--;
|
||||
globalCtx->interfaceCtx.unk_230 = 80;
|
||||
interfaceCtx->unk_230 = 80;
|
||||
}
|
||||
}
|
||||
|
||||
color = sMagicBorderColors[sMagicBorderIndexes[sMagicBorderStep]];
|
||||
temp = sMagicBorderIndexes[sMagicBorderStep];
|
||||
borderChangeR = ABS(sMagicBorderR - sMagicBorderColors[temp][0]) / sMagicBorderRatio;
|
||||
borderChangeG = ABS(sMagicBorderG - sMagicBorderColors[temp][1]) / sMagicBorderRatio;
|
||||
borderChangeB = ABS(sMagicBorderB - sMagicBorderColors[temp][2]) / sMagicBorderRatio;
|
||||
|
||||
if (sMagicBorderR >= color[0]) {
|
||||
sMagicBorderR -= ABS(sMagicBorderR - color[0]) / sMagicBorderRatio;
|
||||
if (sMagicBorderR >= sMagicBorderColors[temp][0]) {
|
||||
sMagicBorderR -= borderChangeR;
|
||||
} else {
|
||||
sMagicBorderR += ABS(sMagicBorderR - color[0]) / sMagicBorderRatio;
|
||||
sMagicBorderR += borderChangeR;
|
||||
}
|
||||
|
||||
if (sMagicBorderG >= color[1]) {
|
||||
sMagicBorderG -= ABS(sMagicBorderG - color[1]) / sMagicBorderRatio;
|
||||
if (sMagicBorderG >= sMagicBorderColors[temp][1]) {
|
||||
sMagicBorderG -= borderChangeG;
|
||||
} else {
|
||||
sMagicBorderG += ABS(sMagicBorderG - color[1]) / sMagicBorderRatio;
|
||||
sMagicBorderG += borderChangeG;
|
||||
}
|
||||
|
||||
if (sMagicBorderB >= color[2]) {
|
||||
sMagicBorderB -= ABS(sMagicBorderB - color[2]) / sMagicBorderRatio;
|
||||
if (sMagicBorderB >= sMagicBorderColors[temp][2]) {
|
||||
sMagicBorderB -= borderChangeB;
|
||||
} else {
|
||||
sMagicBorderB += ABS(sMagicBorderB - color[2]) / sMagicBorderRatio;
|
||||
sMagicBorderB += borderChangeB;
|
||||
}
|
||||
|
||||
sMagicBorderRatio--;
|
||||
if (sMagicBorderRatio == 0) {
|
||||
sMagicBorderR = color[0];
|
||||
sMagicBorderG = color[1];
|
||||
sMagicBorderB = color[2];
|
||||
sMagicBorderR = sMagicBorderColors[temp][0];
|
||||
sMagicBorderG = sMagicBorderColors[temp][1];
|
||||
sMagicBorderB = sMagicBorderColors[temp][2];
|
||||
sMagicBorderRatio = YREG(40 + sMagicBorderStep);
|
||||
sMagicBorderStep++;
|
||||
if (sMagicBorderStep >= 4) {
|
||||
|
@ -2521,6 +2528,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 10:
|
||||
gSaveContext.magic += 4;
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_GAUGE_UP - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
|
@ -2530,24 +2538,12 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) {
|
|||
gSaveContext.unk_13F2 = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
gSaveContext.unk_13F0 = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
s16 sMagicBorderColors[][3] = {
|
||||
{ 0xFF, 0xFF, 0xFF },
|
||||
{ 0x96, 0x96, 0x96 },
|
||||
{ 0xFF, 0xFF, 0x96 },
|
||||
{ 0xFF, 0xFF, 0x32 },
|
||||
};
|
||||
s16 sMagicBorderIndexes[] = { 0, 1, 1, 0 };
|
||||
s16 sMagicBorderRatio = 2;
|
||||
s16 sMagicBorderStep = 1;
|
||||
void Interface_UpdateMagicBar(GlobalContext* globalCtx);
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Interface_UpdateMagicBar.s")
|
||||
#endif
|
||||
|
||||
void Interface_DrawMagicBar(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
|
@ -2689,15 +2685,14 @@ u8* sCUpLabelTextures[] = { D_02002FC0, D_02002FC0, D_02002FC0 };
|
|||
|
||||
s16 sStartButtonLeftPos[] = { 132, 130, 130 };
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc and ordering differences
|
||||
void Interface_DrawItemButtons(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
Player* player = PLAYER;
|
||||
f32 temp;
|
||||
s16 i; // sp+0x14A
|
||||
s16 cUpAlpha;
|
||||
s32 pad;
|
||||
PauseContext* pauseCtx = &globalCtx->pauseCtx;
|
||||
s16 temp;
|
||||
s16 dxdy;
|
||||
s16 width;
|
||||
s16 height;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_parameter.c", 2900);
|
||||
|
||||
|
@ -2734,7 +2729,7 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
|
|||
(R_ITEM_BTN_X(3) + R_ITEM_BTN_WIDTH(3)) << 2, (R_ITEM_BTN_Y(3) + R_ITEM_BTN_WIDTH(3)) << 2,
|
||||
G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(3) * 2, R_ITEM_BTN_DD(3) * 2);
|
||||
|
||||
if ((globalCtx->pauseCtx.state < 8) || (globalCtx->pauseCtx.state >= 18)) {
|
||||
if ((pauseCtx->state < 8) || (pauseCtx->state >= 18)) {
|
||||
if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.flag != 0)) {
|
||||
// Start Button Texture, Color & Label
|
||||
gDPPipeSync(oGfxCtx->overlay.p++);
|
||||
|
@ -2761,12 +2756,13 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
|
|||
G_TX_NOLOD);
|
||||
gDPSetTileSize(oGfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 188, 60);
|
||||
|
||||
temp = R_START_LABEL_DD(gSaveContext.language) / 100.0f;
|
||||
gSPTextureRectangle(oGfxCtx->overlay.p++, R_START_LABEL_X(gSaveContext.language) << 2,
|
||||
R_START_LABEL_Y(gSaveContext.language) << 2,
|
||||
(R_START_LABEL_X(gSaveContext.language) + (s16)(16.0f / temp)) << 2,
|
||||
(R_START_LABEL_Y(gSaveContext.language) + (s16)(48.0f / temp)) << 2, G_TX_RENDERTILE, 0,
|
||||
0, (s16)(1024.0f / temp), (s16)(1024.0f / temp));
|
||||
dxdy = 1024.0f / (R_START_LABEL_DD(gSaveContext.language) / 100.0f);
|
||||
width = 48.0f / (R_START_LABEL_DD(gSaveContext.language) / 100.0f);
|
||||
height = 16.0f / (R_START_LABEL_DD(gSaveContext.language) / 100.0f);
|
||||
gSPTextureRectangle(
|
||||
oGfxCtx->overlay.p++, R_START_LABEL_X(gSaveContext.language) << 2,
|
||||
R_START_LABEL_Y(gSaveContext.language) << 2, (R_START_LABEL_X(gSaveContext.language) + width) << 2,
|
||||
(R_START_LABEL_Y(gSaveContext.language) + height) << 2, G_TX_RENDERTILE, 0, 0, dxdy, dxdy);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2777,20 +2773,20 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
|
|||
gDPPipeSync(oGfxCtx->overlay.p++);
|
||||
|
||||
if ((gSaveContext.unk_13EA == 1) || (gSaveContext.unk_13EA == 2) || (gSaveContext.unk_13EA == 5)) {
|
||||
cUpAlpha = 0;
|
||||
} else if ((player->stateFlags2 & 0x00200000) || (func_8008F2F8(globalCtx) == 4) ||
|
||||
temp = 0;
|
||||
} else if ((player->stateFlags1 & 0x00200000) || (func_8008F2F8(globalCtx) == 4) ||
|
||||
(player->stateFlags2 & 0x00040000)) {
|
||||
cUpAlpha = 70;
|
||||
temp = 70;
|
||||
} else {
|
||||
cUpAlpha = interfaceCtx->healthAlpha;
|
||||
temp = interfaceCtx->healthAlpha;
|
||||
}
|
||||
|
||||
gDPSetPrimColor(oGfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), cUpAlpha);
|
||||
gDPSetPrimColor(oGfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), temp);
|
||||
gDPSetCombineMode(oGfxCtx->overlay.p++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
||||
gSPTextureRectangle(oGfxCtx->overlay.p++, R_C_UP_BTN_X << 2, R_C_UP_BTN_Y << 2, (R_C_UP_BTN_X + 16) << 2,
|
||||
(R_C_UP_BTN_Y + 16) << 2, G_TX_RENDERTILE, 0, 0, 2048, 2048);
|
||||
gDPPipeSync(oGfxCtx->overlay.p++);
|
||||
gDPSetPrimColor(oGfxCtx->overlay.p++, 0, 0, 255, 255, 255, cUpAlpha);
|
||||
gDPSetPrimColor(oGfxCtx->overlay.p++, 0, 0, 255, 255, 255, temp);
|
||||
gDPSetEnvColor(oGfxCtx->overlay.p++, 0, 0, 0, 0);
|
||||
gDPSetCombineLERP(oGfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE,
|
||||
0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
||||
|
@ -2814,20 +2810,20 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
|
|||
|
||||
sCUpTimer--;
|
||||
if (sCUpTimer == 0) {
|
||||
sCUpTimer = 10;
|
||||
sCUpInvisible ^= 1;
|
||||
sCUpTimer = 10;
|
||||
}
|
||||
}
|
||||
|
||||
gDPPipeSync(oGfxCtx->overlay.p++);
|
||||
|
||||
// Empty C Button Arrows
|
||||
for (i = 1; i < 4; i++) {
|
||||
if (gSaveContext.equips.buttonItems[i] > 0xF0) {
|
||||
if (i == 1) {
|
||||
for (temp = 1; temp < 4; temp++) {
|
||||
if (gSaveContext.equips.buttonItems[temp] > 0xF0) {
|
||||
if (temp == 1) {
|
||||
gDPSetPrimColor(oGfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2),
|
||||
interfaceCtx->cLeftAlpha);
|
||||
} else if (i == 2) {
|
||||
} else if (temp == 2) {
|
||||
gDPSetPrimColor(oGfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2),
|
||||
interfaceCtx->cDownAlpha);
|
||||
} else {
|
||||
|
@ -2835,18 +2831,14 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
|
|||
interfaceCtx->cRightAlpha);
|
||||
}
|
||||
|
||||
oGfxCtx->overlay.p =
|
||||
Gfx_TextureIA8(oGfxCtx->overlay.p, &D_02000A00[i + 1], 0x20, 0x20, R_ITEM_BTN_X(i), R_ITEM_BTN_Y(i),
|
||||
R_ITEM_BTN_WIDTH(i), R_ITEM_BTN_WIDTH(i), R_ITEM_BTN_DD(i) * 2, R_ITEM_BTN_DD(i) * 2);
|
||||
oGfxCtx->overlay.p = Gfx_TextureIA8(
|
||||
oGfxCtx->overlay.p, &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);
|
||||
}
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_parameter.c", 3071);
|
||||
}
|
||||
#else
|
||||
void Interface_DrawItemButtons(GlobalContext* globalCtx);
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Interface_DrawItemButtons.s")
|
||||
#endif
|
||||
|
||||
void Interface_DrawItemIconTexture(GlobalContext* globalCtx, void* texture, s16 button) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_parameter.c", 3079);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue