1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-01-17 05:57:00 +00:00

[ntsc-1.2] Match z_file_choose.c and z_boss_tw.c (#2146)

* Match z_file_choose.c

* Match z_boss_tw.c

* Format

* end: -> close_disps:
This commit is contained in:
cadmic 2024-09-06 21:12:12 -07:00 committed by GitHub
parent ed870e051d
commit 8a3ba35070
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 85 additions and 48 deletions

View file

@ -399,7 +399,7 @@ void EffectBlure_DrawElemNoInterpolation(EffectBlure* this, EffectBlureElement*
if (vtx == NULL) { if (vtx == NULL) {
PRINTF(T("z_eff_blure.c::SQ_NoInterpolate_disp() 頂点確保できず。\n", PRINTF(T("z_eff_blure.c::SQ_NoInterpolate_disp() 頂点確保できず。\n",
"z_eff_blure.c::SQ_NoInterpolate_disp() Vertices cannot be secured.\n")); "z_eff_blure.c::SQ_NoInterpolate_disp() Vertices cannot be secured.\n"));
goto end; goto close_disps;
} }
vtx[0].v = baseVtx; vtx[0].v = baseVtx;
@ -470,7 +470,7 @@ void EffectBlure_DrawElemNoInterpolation(EffectBlure* this, EffectBlureElement*
gSPVertex(POLY_XLU_DISP++, vtx, 4, 0); gSPVertex(POLY_XLU_DISP++, vtx, 4, 0);
gSP2Triangles(POLY_XLU_DISP++, 0, 1, 2, 0, 0, 2, 3, 0); gSP2Triangles(POLY_XLU_DISP++, 0, 1, 2, 0, 0, 2, 3, 0);
end: close_disps:
CLOSE_DISPS(gfxCtx, "../z_eff_blure.c", 932); CLOSE_DISPS(gfxCtx, "../z_eff_blure.c", 932);
} }

View file

@ -174,7 +174,7 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) {
if (vertices == NULL) { if (vertices == NULL) {
PRINTF(T("EffectSparkInfo_disp():メモリー確保失敗 graph_malloc\n", PRINTF(T("EffectSparkInfo_disp():メモリー確保失敗 graph_malloc\n",
"EffectSparkInfo_disp(): Memory Allocation Failure graph_malloc\n")); "EffectSparkInfo_disp(): Memory Allocation Failure graph_malloc\n"));
goto end; goto close_disps;
} }
j = 0; j = 0;
@ -262,7 +262,7 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) {
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &sp12C); mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &sp12C);
if (mtx == NULL) { if (mtx == NULL) {
goto end; goto close_disps;
} }
gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@ -273,6 +273,6 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) {
gDPPipeSync(POLY_XLU_DISP++); gDPPipeSync(POLY_XLU_DISP++);
} }
end: close_disps:
CLOSE_DISPS(gfxCtx, "../z_eff_spark.c", 498); CLOSE_DISPS(gfxCtx, "../z_eff_spark.c", 498);
} }

View file

@ -3411,7 +3411,10 @@ void func_80942C70(Actor* thisx, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 6765); OPEN_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 6765);
if (this->beamDist != 0.0f) { if (this->beamDist == 0.0f) {
goto close_disps;
}
Matrix_Push(); Matrix_Push();
gSPSegment(POLY_XLU_DISP++, 0xC, gSPSegment(POLY_XLU_DISP++, 0xC,
Gfx_TexScroll(play->state.gfxCtx, 0, (u8)(this->work[CS_TIMER_1] * -0xF), 0x20, 0x40)); Gfx_TexScroll(play->state.gfxCtx, 0, (u8)(this->work[CS_TIMER_1] * -0xF), 0x20, 0x40));
@ -3448,8 +3451,8 @@ void func_80942C70(Actor* thisx, PlayState* play) {
} }
Matrix_Pop(); Matrix_Pop();
}
close_disps:
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 6878); CLOSE_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 6878);
} }

View file

@ -3,6 +3,9 @@
#include "versions.h" #include "versions.h"
#include "assets/textures/title_static/title_static.h" #include "assets/textures/title_static/title_static.h"
#include "assets/textures/parameter_static/parameter_static.h" #include "assets/textures/parameter_static/parameter_static.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
static s16 sUnused = 106; static s16 sUnused = 106;
@ -219,6 +222,14 @@ void FileSelect_UpdateMainMenu(GameState* thisx) {
} else if (!this->n64ddFlags[this->buttonIndex]) { } else if (!this->n64ddFlags[this->buttonIndex]) {
Audio_PlaySfxGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else {
#if PLATFORM_N64
if (D_80121212 != 0) {
func_801C7268();
// Setting ioData to 1 and writing it to ioPort 7 will skip the harp intro
Audio_PlaySequenceWithSeqPlayerIO(SEQ_PLAYER_BGM_MAIN, NA_BGM_FILE_SELECT, 0, 7, 1);
}
#endif
} }
} else { } else {
if (this->warningLabel == FS_WARNING_NONE) { if (this->warningLabel == FS_WARNING_NONE) {
@ -821,14 +832,13 @@ static s16 sHeartEnvColors[2][3] = { { 50, 40, 60 }, { 255, 255, 255 } };
void FileSelect_DrawFileInfo(GameState* thisx, s16 fileIndex, s16 isActive) { void FileSelect_DrawFileInfo(GameState* thisx, s16 fileIndex, s16 isActive) {
FileSelectState* this = (FileSelectState*)thisx; FileSelectState* this = (FileSelectState*)thisx;
Font* sp54 = &this->font; Font* sp54 = &this->font;
s32 heartType; s16 heartType;
s16 i;
s16 vtxOffset; s16 vtxOffset;
s16 i;
s16 j; s16 j;
s16 k;
s16 deathCountSplit[3]; s16 deathCountSplit[3];
if (1) {}
OPEN_DISPS(this->state.gfxCtx, "../z_file_choose.c", 1709); OPEN_DISPS(this->state.gfxCtx, "../z_file_choose.c", 1709);
gDPPipeSync(POLY_OPA_DISP++); gDPPipeSync(POLY_OPA_DISP++);
@ -857,8 +867,8 @@ void FileSelect_DrawFileInfo(GameState* thisx, s16 fileIndex, s16 isActive) {
FileSelect_SplitNumber(this->deaths[fileIndex], &deathCountSplit[0], &deathCountSplit[1], &deathCountSplit[2]); FileSelect_SplitNumber(this->deaths[fileIndex], &deathCountSplit[0], &deathCountSplit[1], &deathCountSplit[2]);
// draw death count // draw death count
for (i = 0, vtxOffset = 0; i < 3; i++, vtxOffset += 4) { for (k = 0, vtxOffset = 0; k < 3; k++, vtxOffset += 4) {
FileSelect_DrawCharacter(this->state.gfxCtx, sp54->fontBuf + deathCountSplit[i] * FONT_CHAR_TEX_SIZE, FileSelect_DrawCharacter(this->state.gfxCtx, sp54->fontBuf + deathCountSplit[k] * FONT_CHAR_TEX_SIZE,
vtxOffset); vtxOffset);
} }
@ -874,10 +884,10 @@ void FileSelect_DrawFileInfo(GameState* thisx, s16 fileIndex, s16 isActive) {
gDPSetEnvColor(POLY_OPA_DISP++, sHeartEnvColors[heartType][0], sHeartEnvColors[heartType][1], gDPSetEnvColor(POLY_OPA_DISP++, sHeartEnvColors[heartType][0], sHeartEnvColors[heartType][1],
sHeartEnvColors[heartType][2], 255); sHeartEnvColors[heartType][2], 255);
i = this->healthCapacities[fileIndex] / 0x10; k = this->healthCapacities[fileIndex] / 0x10;
// draw hearts // draw hearts
for (vtxOffset = 0, j = 0; j < i; j++, vtxOffset += 4) { for (vtxOffset = 0, j = 0; j < k; j++, vtxOffset += 4) {
gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[D_8081284C[fileIndex] + vtxOffset] + 0x30, 4, 0); gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[D_8081284C[fileIndex] + vtxOffset] + 0x30, 4, 0);
POLY_OPA_DISP = FileSelect_QuadTextureIA8(POLY_OPA_DISP, sHeartTextures[heartType], 0x10, 0x10, 0); POLY_OPA_DISP = FileSelect_QuadTextureIA8(POLY_OPA_DISP, sHeartTextures[heartType], 0x10, 0x10, 0);
@ -984,9 +994,9 @@ static void* sOptionsButtonTextures[] = LANGUAGE_ARRAY(gFileSelOptionsButtonJPNT
void FileSelect_DrawWindowContents(GameState* thisx) { void FileSelect_DrawWindowContents(GameState* thisx) {
FileSelectState* this = (FileSelectState*)thisx; FileSelectState* this = (FileSelectState*)thisx;
s16 fileIndex; s16 fileIndex;
s16 temp;
s16 i; s16 i;
s16 quadVtxIndex; s16 quadVtxIndex;
s16 temp;
s16 isActive; s16 isActive;
s16 pad; s16 pad;
@ -1560,6 +1570,14 @@ void FileSelect_LoadGame(GameState* thisx) {
gSaveContext.save.info.equips.equipment &= gEquipNegMasks[EQUIP_TYPE_SWORD]; gSaveContext.save.info.equips.equipment &= gEquipNegMasks[EQUIP_TYPE_SWORD];
gSaveContext.save.info.inventory.equipment ^= OWNED_EQUIP_FLAG(EQUIP_TYPE_SWORD, swordEquipValue - 1); gSaveContext.save.info.inventory.equipment ^= OWNED_EQUIP_FLAG(EQUIP_TYPE_SWORD, swordEquipValue - 1);
} }
#if PLATFORM_N64
if (D_80121212 != 0) {
s32 fileNum = gSaveContext.fileNum;
n64dd_SetDiskVersion(this->n64ddFlags[fileNum]);
}
#endif
} }
static void (*sSelectModeUpdateFuncs[])(GameState*) = { static void (*sSelectModeUpdateFuncs[])(GameState*) = {
@ -1645,7 +1663,15 @@ void FileSelect_Main(GameState* thisx) {
OPEN_DISPS(this->state.gfxCtx, "../z_file_choose.c", 2898); OPEN_DISPS(this->state.gfxCtx, "../z_file_choose.c", 2898);
#if PLATFORM_N64
if ((D_80121212 != 0) && (func_801C70FC() != 0)) {
this->n64ddFlag = 1;
} else {
this->n64ddFlag = 0; this->n64ddFlag = 0;
}
#else
this->n64ddFlag = 0;
#endif
gSPSegment(POLY_OPA_DISP++, 0x00, NULL); gSPSegment(POLY_OPA_DISP++, 0x00, NULL);
gSPSegment(POLY_OPA_DISP++, 0x01, this->staticSegment); gSPSegment(POLY_OPA_DISP++, 0x01, this->staticSegment);
@ -1924,6 +1950,12 @@ void FileSelect_Init(GameState* thisx) {
u32 size = (uintptr_t)_title_staticSegmentRomEnd - (uintptr_t)_title_staticSegmentRomStart; u32 size = (uintptr_t)_title_staticSegmentRomEnd - (uintptr_t)_title_staticSegmentRomStart;
s32 pad; s32 pad;
#if PLATFORM_N64
if (D_80121212 != 0) {
func_801C7268();
}
#endif
SREG(30) = 1; SREG(30) = 1;
PRINTF("SIZE=%x\n", size); PRINTF("SIZE=%x\n", size);

View file

@ -308,7 +308,7 @@ void FileSelect_SetNameEntryVtx(GameState* thisx) {
gSPVertex(POLY_OPA_DISP++, this->nameEntryVtx + 4, 32, 0); gSPVertex(POLY_OPA_DISP++, this->nameEntryVtx + 4, 32, 0);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->nameEntryBoxAlpha); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->nameEntryBoxAlpha);
for (phi_v0 = 0, phi_s0 = 0; phi_s0 < 0x20; phi_s0 += 4, phi_v0++) { for (phi_s0 = 0, phi_v0 = 0; phi_s0 < 0x20; phi_s0 += 4, phi_v0++) {
FileSelect_DrawCharacter(this->state.gfxCtx, FileSelect_DrawCharacter(this->state.gfxCtx,
font->fontBuf + this->fileNames[this->buttonIndex][phi_v0] * FONT_CHAR_TEX_SIZE, font->fontBuf + this->fileNames[this->buttonIndex][phi_v0] * FONT_CHAR_TEX_SIZE,
phi_s0); phi_s0);

View file

@ -1,7 +1,7 @@
offset,vram,.text offset,vram,.text
0,80803880,src/overlays/gamestates/ovl_file_choose/z_file_copy_erase 0,80803880,src/overlays/gamestates/ovl_file_choose/z_file_copy_erase
3040,808068C0,src/overlays/gamestates/ovl_file_choose/z_file_nameset 3040,808068C0,src/overlays/gamestates/ovl_file_choose/z_file_nameset
8440,8080BCC0,z_file_choose 8440,8080BCC0,src/overlays/gamestates/ovl_file_choose/z_file_choose
offset,vram,.data offset,vram,.data
EC50,808124D0,src/overlays/gamestates/ovl_file_choose/z_file_nameset_data EC50,808124D0,src/overlays/gamestates/ovl_file_choose/z_file_nameset_data

1 offset vram .text
2 0 80803880 src/overlays/gamestates/ovl_file_choose/z_file_copy_erase
3 3040 808068C0 src/overlays/gamestates/ovl_file_choose/z_file_nameset
4 8440 8080BCC0 z_file_choose src/overlays/gamestates/ovl_file_choose/z_file_choose
5 offset vram .data
6 EC50 808124D0 src/overlays/gamestates/ovl_file_choose/z_file_nameset_data
7 F330 80812BB0 src/overlays/gamestates/ovl_file_choose/z_file_copy_erase

View file

@ -3099,6 +3099,8 @@ Regs_InitDataImpl = 0x800E2704; // type:func
Regs_InitData = 0x800E35D0; // type:func Regs_InitData = 0x800E35D0; // type:func
njpgdspMainTextStart = 0x800E7200; // type:func njpgdspMainTextStart = 0x800E7200; // type:func
func_801C6E80 = 0x801C7740; // type:func func_801C6E80 = 0x801C7740; // type:func
func_801C70FC = 0x801C79BC; // type:func
func_801C7268 = 0x801C7BC4; // type:func
func_801C7C1C = 0x801C8510; // type:func func_801C7C1C = 0x801C8510; // type:func
n64dd_SetDiskVersion = 0x801C8808; // type:func n64dd_SetDiskVersion = 0x801C8808; // type:func
ConsoleLogo_Calc = 0x80800000; // type:func ConsoleLogo_Calc = 0x80800000; // type:func