Assetized all remaining variables for N64-ification

This commit is contained in:
Stardust Sauce 2022-04-02 23:42:14 -04:00
parent d97271c95a
commit 6d2e828520
1 changed files with 40 additions and 22 deletions

View File

@ -14,6 +14,8 @@
#include "vt.h" #include "vt.h"
#include "SohHooks.h" #include "SohHooks.h"
#include <colors/colorPaths.h>
static void* sEquipmentFRATexs[] = { static void* sEquipmentFRATexs[] = {
gPauseEquipment00FRATex, gPauseEquipment01Tex, gPauseEquipment02Tex, gPauseEquipment03Tex, gPauseEquipment04Tex, gPauseEquipment00FRATex, gPauseEquipment01Tex, gPauseEquipment02Tex, gPauseEquipment03Tex, gPauseEquipment04Tex,
gPauseEquipment10FRATex, gPauseEquipment11Tex, gPauseEquipment12Tex, gPauseEquipment13Tex, gPauseEquipment14Tex, gPauseEquipment10FRATex, gPauseEquipment11Tex, gPauseEquipment12Tex, gPauseEquipment13Tex, gPauseEquipment14Tex,
@ -713,6 +715,8 @@ static s16 D_8082ABA4 = 0;
static s16 sInDungeonScene = false; static s16 sInDungeonScene = false;
static Color_RGB8 savePromptColor;
static f32 D_8082ABAC[] = { static f32 D_8082ABAC[] = {
-4.0f, 4.0f, 4.0f, 4.0f, 4.0f, -4.0f, -4.0f, -4.0f, -4.0f, 4.0f, 4.0f, 4.0f, 4.0f, -4.0f, -4.0f, -4.0f,
}; };
@ -754,11 +758,7 @@ static void* sCursorTexs[] = {
gPauseMenuCursorBottomRightTex, gPauseMenuCursorBottomRightTex,
}; };
static s16 sCursorColors[][3] = { static Color_RGB8 sCursorColors[3];
{ 255, 255, 255 },
{ 255, 255, 0 },
{ 0, 255, 50 },
};
static void* sSavePromptTexs[] = { static void* sSavePromptTexs[] = {
gPauseSavePromptENGTex, gPauseSavePromptENGTex,
@ -991,6 +991,13 @@ void KaleidoScope_DrawCursor(GlobalContext* globalCtx, u16 pageIndex) {
PauseContext* pauseCtx = &globalCtx->pauseCtx; PauseContext* pauseCtx = &globalCtx->pauseCtx;
u16 temp; u16 temp;
// Initiailize static cursor variables
if (sCursorColors[0].r == NULL) {
sCursorColors[0] = *(Color_RGB8*)ResourceMgr_LoadBlobByName(colorPauseCursorNoEquip);
sCursorColors[1] = *(Color_RGB8*)ResourceMgr_LoadBlobByName(colorPauseCursorCEquip);
sCursorColors[2] = *(Color_RGB8*)ResourceMgr_LoadBlobByName(colorPauseCursorAEquip);
}
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_kaleido_scope_PAL.c", 955); OPEN_DISPS(globalCtx->state.gfxCtx, "../z_kaleido_scope_PAL.c", 955);
temp = pauseCtx->unk_1E4; temp = pauseCtx->unk_1E4;
@ -1005,9 +1012,9 @@ void KaleidoScope_DrawCursor(GlobalContext* globalCtx, u16 pageIndex) {
gDPPipeSync(POLY_KAL_DISP++); gDPPipeSync(POLY_KAL_DISP++);
gDPSetCombineLERP(POLY_KAL_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, gDPSetCombineLERP(POLY_KAL_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, sCursorColors[pauseCtx->cursorColorSet >> 2][0], gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, sCursorColors[pauseCtx->cursorColorSet >> 2].r,
sCursorColors[pauseCtx->cursorColorSet >> 2][1], sCursorColors[pauseCtx->cursorColorSet >> 2].g,
sCursorColors[pauseCtx->cursorColorSet >> 2][2], 255); sCursorColors[pauseCtx->cursorColorSet >> 2].b, 255);
gDPSetEnvColor(POLY_KAL_DISP++, D_8082AB8C, D_8082AB90, D_8082AB94, 255); gDPSetEnvColor(POLY_KAL_DISP++, D_8082AB8C, D_8082AB90, D_8082AB94, 255);
gSPVertex(POLY_KAL_DISP++, pauseCtx->cursorVtx, 16, 0); gSPVertex(POLY_KAL_DISP++, pauseCtx->cursorVtx, 16, 0);
@ -1061,9 +1068,16 @@ Gfx* KaleidoScope_DrawPageSections(Gfx* gfx, Vtx* vertices, void** textures) {
} }
void KaleidoScope_DrawPages(GlobalContext* globalCtx, GraphicsContext* gfxCtx) { void KaleidoScope_DrawPages(GlobalContext* globalCtx, GraphicsContext* gfxCtx) {
static s16 D_8082ACF4[][3] = { // Initiailize static cursor variables
{ 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 255, 255, 0 }, { 0, 0, 0 }, if (sCursorColors[0].r == NULL) {
{ 0, 0, 0 }, { 255, 255, 0 }, { 0, 255, 50 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 255, 50 }, sCursorColors[0] = *(Color_RGB8*)ResourceMgr_LoadBlobByName(colorPauseCursorNoEquip);
sCursorColors[1] = *(Color_RGB8*)ResourceMgr_LoadBlobByName(colorPauseCursorCEquip);
sCursorColors[2] = *(Color_RGB8*)ResourceMgr_LoadBlobByName(colorPauseCursorAEquip);
}
Color_RGB8 D_8082ACF4[] = {
{ 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, sCursorColors[1], { 0, 0, 0 },
{ 0, 0, 0 }, sCursorColors[1], sCursorColors[2], { 0, 0, 0 }, { 0, 0, 0 }, sCursorColors[2],
}; };
static s16 D_8082AD3C = 20; static s16 D_8082AD3C = 20;
static s16 D_8082AD40 = 0; static s16 D_8082AD40 = 0;
@ -1080,20 +1094,20 @@ void KaleidoScope_DrawPages(GlobalContext* globalCtx, GraphicsContext* gfxCtx) {
if ((pauseCtx->state < 8) || (pauseCtx->state > 0x11)) { if ((pauseCtx->state < 8) || (pauseCtx->state > 0x11)) {
if (pauseCtx->state != 7) { if (pauseCtx->state != 7) {
stepR = ABS(D_8082AB8C - D_8082ACF4[pauseCtx->cursorColorSet + D_8082AD40][0]) / D_8082AD3C; stepR = ABS(D_8082AB8C - D_8082ACF4[pauseCtx->cursorColorSet + D_8082AD40].r) / D_8082AD3C;
stepG = ABS(D_8082AB90 - D_8082ACF4[pauseCtx->cursorColorSet + D_8082AD40][1]) / D_8082AD3C; stepG = ABS(D_8082AB90 - D_8082ACF4[pauseCtx->cursorColorSet + D_8082AD40].g) / D_8082AD3C;
stepB = ABS(D_8082AB94 - D_8082ACF4[pauseCtx->cursorColorSet + D_8082AD40][2]) / D_8082AD3C; stepB = ABS(D_8082AB94 - D_8082ACF4[pauseCtx->cursorColorSet + D_8082AD40].b) / D_8082AD3C;
if (D_8082AB8C >= D_8082ACF4[pauseCtx->cursorColorSet + D_8082AD40][0]) { if (D_8082AB8C >= D_8082ACF4[pauseCtx->cursorColorSet + D_8082AD40].r) {
D_8082AB8C -= stepR; D_8082AB8C -= stepR;
} else { } else {
D_8082AB8C += stepR; D_8082AB8C += stepR;
} }
if (D_8082AB90 >= D_8082ACF4[pauseCtx->cursorColorSet + D_8082AD40][1]) { if (D_8082AB90 >= D_8082ACF4[pauseCtx->cursorColorSet + D_8082AD40].g) {
D_8082AB90 -= stepG; D_8082AB90 -= stepG;
} else { } else {
D_8082AB90 += stepG; D_8082AB90 += stepG;
} }
if (D_8082AB94 >= D_8082ACF4[pauseCtx->cursorColorSet + D_8082AD40][2]) { if (D_8082AB94 >= D_8082ACF4[pauseCtx->cursorColorSet + D_8082AD40].b) {
D_8082AB94 -= stepB; D_8082AB94 -= stepB;
} else { } else {
D_8082AB94 += stepB; D_8082AB94 += stepB;
@ -1101,9 +1115,9 @@ void KaleidoScope_DrawPages(GlobalContext* globalCtx, GraphicsContext* gfxCtx) {
D_8082AD3C--; D_8082AD3C--;
if (D_8082AD3C == 0) { if (D_8082AD3C == 0) {
D_8082AB8C = D_8082ACF4[pauseCtx->cursorColorSet + D_8082AD40][0]; D_8082AB8C = D_8082ACF4[pauseCtx->cursorColorSet + D_8082AD40].r;
D_8082AB90 = D_8082ACF4[pauseCtx->cursorColorSet + D_8082AD40][1]; D_8082AB90 = D_8082ACF4[pauseCtx->cursorColorSet + D_8082AD40].g;
D_8082AB94 = D_8082ACF4[pauseCtx->cursorColorSet + D_8082AD40][2]; D_8082AB94 = D_8082ACF4[pauseCtx->cursorColorSet + D_8082AD40].b;
D_8082AD3C = ZREG(28 + D_8082AD40); D_8082AD3C = ZREG(28 + D_8082AD40);
D_8082AD40++; D_8082AD40++;
if (D_8082AD40 >= 4) { if (D_8082AD40 >= 4) {
@ -1386,13 +1400,17 @@ void KaleidoScope_DrawPages(GlobalContext* globalCtx, GraphicsContext* gfxCtx) {
gSPVertex(POLY_KAL_DISP++, &pauseCtx->saveVtx[60], 32, 0); gSPVertex(POLY_KAL_DISP++, &pauseCtx->saveVtx[60], 32, 0);
if (savePromptColor.r == NULL) {
savePromptColor = *(Color_RGB8*) ResourceMgr_LoadBlobByName(colorPauseSavePrompt);
}
if (((pauseCtx->state == 7) && (pauseCtx->unk_1EC < 4)) || (pauseCtx->state == 0xE)) { if (((pauseCtx->state == 7) && (pauseCtx->unk_1EC < 4)) || (pauseCtx->state == 0xE)) {
POLY_KAL_DISP = POLY_KAL_DISP =
KaleidoScope_QuadTextureIA8(POLY_KAL_DISP, sSavePromptTexs[gSaveContext.language], 152, 16, 0); KaleidoScope_QuadTextureIA8(POLY_KAL_DISP, sSavePromptTexs[gSaveContext.language], 152, 16, 0);
gDPSetCombineLERP(POLY_KAL_DISP++, 1, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, 1, 0, PRIMITIVE, 0, TEXEL0, gDPSetCombineLERP(POLY_KAL_DISP++, 1, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, 1, 0, PRIMITIVE, 0, TEXEL0,
0, PRIMITIVE, 0); 0, PRIMITIVE, 0);
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 100, 255, 100, VREG(61)); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, savePromptColor.r, savePromptColor.g, savePromptColor.b, VREG(61));
if (pauseCtx->promptChoice == 0) { if (pauseCtx->promptChoice == 0) {
gSPDisplayList(POLY_KAL_DISP++, gPromptCursorLeftDL); gSPDisplayList(POLY_KAL_DISP++, gPromptCursorLeftDL);
@ -1416,7 +1434,7 @@ void KaleidoScope_DrawPages(GlobalContext* globalCtx, GraphicsContext* gfxCtx) {
gDPSetCombineLERP(POLY_KAL_DISP++, 1, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, 1, 0, PRIMITIVE, 0, gDPSetCombineLERP(POLY_KAL_DISP++, 1, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, 1, 0, PRIMITIVE, 0,
TEXEL0, 0, PRIMITIVE, 0); TEXEL0, 0, PRIMITIVE, 0);
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 100, 255, 100, VREG(61)); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, savePromptColor.r, savePromptColor.g, savePromptColor.b, VREG(61));
if (pauseCtx->promptChoice == 0) { if (pauseCtx->promptChoice == 0) {
gSPDisplayList(POLY_KAL_DISP++, gPromptCursorLeftDL); gSPDisplayList(POLY_KAL_DISP++, gPromptCursorLeftDL);