mirror of
https://github.com/zeldaret/oot.git
synced 2025-05-10 19:13:42 +00:00
[ntsc-1.2] Match z_demo.c, z_eff_blure.c, z_eff_spark.c (#2096)
* Match z_demo.c * Match z_eff_blure.c * Match z_eff_spark.c (fake inc.) * review * improve EffectSpark_Draw match Co-authored-by: cadmic <cadmic24@gmail.com> * cleanup * fix merge * review * better match EffectBlure_DrawSimpleVertices (ty cadmic) * review * rm unneeded include versions.h --------- Co-authored-by: cadmic <cadmic24@gmail.com>
This commit is contained in:
parent
a63f0a63b5
commit
dc964931c2
4 changed files with 123 additions and 110 deletions
|
@ -34,6 +34,8 @@ typedef struct n64ddStruct_80121AF0 {
|
||||||
char unk_48[0x24];
|
char unk_48[0x24];
|
||||||
void (*unk_6C)(struct PlayState*, SceneDrawConfigFunc*);
|
void (*unk_6C)(struct PlayState*, SceneDrawConfigFunc*);
|
||||||
s32 (*unk_70)(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk, OSMesgQueue* queue, OSMesg msg);
|
s32 (*unk_70)(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk, OSMesgQueue* queue, OSMesg msg);
|
||||||
|
char unk_74[4];
|
||||||
|
s32 (*unk_78)(struct PlayState*, void*, void*);
|
||||||
} n64ddStruct_80121AF0; // size = ?
|
} n64ddStruct_80121AF0; // size = ?
|
||||||
|
|
||||||
void func_800ADA80(void);
|
void func_800ADA80(void);
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "quake.h"
|
#include "quake.h"
|
||||||
#include "z64camera.h"
|
#include "z64camera.h"
|
||||||
|
#if PLATFORM_N64
|
||||||
|
#include "n64dd.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "assets/scenes/indoors/tokinoma/tokinoma_scene.h"
|
#include "assets/scenes/indoors/tokinoma/tokinoma_scene.h"
|
||||||
|
|
||||||
|
@ -111,7 +114,7 @@ EntranceCutscene sEntranceCutsceneTable[] = {
|
||||||
{ ENTR_KOKIRI_FOREST_12, 2, EVENTCHKINF_C6, gKokiriForestDekuSproutCs },
|
{ ENTR_KOKIRI_FOREST_12, 2, EVENTCHKINF_C6, gKokiriForestDekuSproutCs },
|
||||||
};
|
};
|
||||||
|
|
||||||
void* sUnusedEntranceCsList[] = {
|
void* sCutscenesUnknownList[] = {
|
||||||
gDekuTreeIntroCs, gJabuJabuIntroCs, gDcOpeningCs, gMinuetCs, gIceCavernSerenadeCs, gTowerBarrierCs,
|
gDekuTreeIntroCs, gJabuJabuIntroCs, gDcOpeningCs, gMinuetCs, gIceCavernSerenadeCs, gTowerBarrierCs,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1702,6 +1705,9 @@ s32 CutsceneCmd_SetCamAt(PlayState* play, CutsceneContext* csCtx, u8* script, u8
|
||||||
|
|
||||||
void CutsceneCmd_Text(PlayState* play, CutsceneContext* csCtx, CsCmdText* cmd) {
|
void CutsceneCmd_Text(PlayState* play, CutsceneContext* csCtx, CsCmdText* cmd) {
|
||||||
u8 dialogState;
|
u8 dialogState;
|
||||||
|
#if PLATFORM_N64
|
||||||
|
s32 pad;
|
||||||
|
#endif
|
||||||
s16 endFrame;
|
s16 endFrame;
|
||||||
|
|
||||||
if ((csCtx->curFrame > cmd->startFrame) && (csCtx->curFrame <= cmd->endFrame)) {
|
if ((csCtx->curFrame > cmd->startFrame) && (csCtx->curFrame <= cmd->endFrame)) {
|
||||||
|
@ -2416,6 +2422,14 @@ void Cutscene_HandleConditionalTriggers(PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Cutscene_SetScript(PlayState* play, void* script) {
|
void Cutscene_SetScript(PlayState* play, void* script) {
|
||||||
|
#if PLATFORM_N64
|
||||||
|
if ((B_80121AF0 != NULL) && (B_80121AF0->unk_78 != NULL)) {
|
||||||
|
if (B_80121AF0->unk_78(play, script, sCutscenesUnknownList)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (SEGMENT_NUMBER(script) != 0) {
|
if (SEGMENT_NUMBER(script) != 0) {
|
||||||
play->csCtx.script = SEGMENTED_TO_VIRTUAL(script);
|
play->csCtx.script = SEGMENTED_TO_VIRTUAL(script);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -399,7 +399,9 @@ 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"));
|
||||||
} else {
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
vtx[0].v = baseVtx;
|
vtx[0].v = baseVtx;
|
||||||
vtx[1].v = baseVtx;
|
vtx[1].v = baseVtx;
|
||||||
vtx[2].v = baseVtx;
|
vtx[2].v = baseVtx;
|
||||||
|
@ -421,8 +423,6 @@ void EffectBlure_DrawElemNoInterpolation(EffectBlure* this, EffectBlureElement*
|
||||||
vtx[0].v.cn[2] = sp78.b;
|
vtx[0].v.cn[2] = sp78.b;
|
||||||
vtx[0].v.cn[3] = sp78.a;
|
vtx[0].v.cn[3] = sp78.a;
|
||||||
|
|
||||||
if (1) {} // Necessary to match
|
|
||||||
|
|
||||||
sp60.x = sp8C.x;
|
sp60.x = sp8C.x;
|
||||||
sp60.y = sp8C.y;
|
sp60.y = sp8C.y;
|
||||||
sp60.z = sp8C.z;
|
sp60.z = sp8C.z;
|
||||||
|
@ -465,10 +465,12 @@ void EffectBlure_DrawElemNoInterpolation(EffectBlure* this, EffectBlureElement*
|
||||||
vtx[3].v.cn[2] = sp78.b;
|
vtx[3].v.cn[2] = sp78.b;
|
||||||
vtx[3].v.cn[3] = sp78.a;
|
vtx[3].v.cn[3] = sp78.a;
|
||||||
|
|
||||||
|
if (1) {}
|
||||||
|
|
||||||
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(gfxCtx, "../z_eff_blure.c", 932);
|
CLOSE_DISPS(gfxCtx, "../z_eff_blure.c", 932);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -759,9 +761,6 @@ void EffectBlure_DrawSimpleVertices(GraphicsContext* gfxCtx, EffectBlure* this,
|
||||||
MtxF sp94;
|
MtxF sp94;
|
||||||
f32 scale;
|
f32 scale;
|
||||||
s32 i;
|
s32 i;
|
||||||
s32 j;
|
|
||||||
|
|
||||||
j = 0;
|
|
||||||
|
|
||||||
for (i = 0; i < this->numElements - 1; i++) {
|
for (i = 0; i < this->numElements - 1; i++) {
|
||||||
if (this->drawMode == 1) {
|
if (this->drawMode == 1) {
|
||||||
|
@ -771,9 +770,7 @@ void EffectBlure_DrawSimpleVertices(GraphicsContext* gfxCtx, EffectBlure* this,
|
||||||
gDPPipeSync(POLY_XLU_DISP++);
|
gDPPipeSync(POLY_XLU_DISP++);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (1) {} // Necessary to match
|
gSPVertex(POLY_XLU_DISP++, &vtx[4 * i], 4, 0);
|
||||||
|
|
||||||
gSPVertex(POLY_XLU_DISP++, &vtx[j], 4, 0);
|
|
||||||
gSP2Triangles(POLY_XLU_DISP++, 0, 1, 3, 0, 0, 3, 2, 0);
|
gSP2Triangles(POLY_XLU_DISP++, 0, 1, 3, 0, 0, 3, 2, 0);
|
||||||
|
|
||||||
if (this->flags & 4) {
|
if (this->flags & 4) {
|
||||||
|
@ -806,13 +803,11 @@ void EffectBlure_DrawSimpleVertices(GraphicsContext* gfxCtx, EffectBlure* this,
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
gSPVertex(POLY_XLU_DISP++, &vtx[j], 4, 0);
|
gSPVertex(POLY_XLU_DISP++, &vtx[4 * i], 4, 0);
|
||||||
gSP2Triangles(POLY_XLU_DISP++, 0, 1, 3, 0, 0, 3, 2, 0);
|
gSP2Triangles(POLY_XLU_DISP++, 0, 1, 3, 0, 0, 3, 2, 0);
|
||||||
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
j += 4;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -222,41 +222,43 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) {
|
||||||
vertices[j].v.tc[0] = 0;
|
vertices[j].v.tc[0] = 0;
|
||||||
vertices[j].v.tc[1] = 1024;
|
vertices[j].v.tc[1] = 1024;
|
||||||
vertices[j].v.flag = 0;
|
vertices[j].v.flag = 0;
|
||||||
|
j++;
|
||||||
|
|
||||||
vertices[j + 1].v.ob[0] = 32;
|
vertices[j].v.ob[0] = 32;
|
||||||
vertices[j + 1].v.ob[1] = 32;
|
vertices[j].v.ob[1] = 32;
|
||||||
vertices[j + 1].v.ob[2] = 0;
|
vertices[j].v.ob[2] = 0;
|
||||||
vertices[j + 1].v.cn[0] = sp1CF;
|
vertices[j].v.cn[0] = sp1CF;
|
||||||
vertices[j + 1].v.cn[1] = sp1CE;
|
vertices[j].v.cn[1] = sp1CE;
|
||||||
vertices[j + 1].v.cn[2] = sp1CD;
|
vertices[j].v.cn[2] = sp1CD;
|
||||||
vertices[j + 1].v.cn[3] = sp1CC;
|
vertices[j].v.cn[3] = sp1CC;
|
||||||
vertices[j + 1].v.tc[0] = 1024;
|
vertices[j].v.tc[0] = 1024;
|
||||||
vertices[j + 1].v.tc[1] = 0;
|
vertices[j].v.tc[1] = 0;
|
||||||
vertices[j + 1].v.flag = 0;
|
vertices[j].v.flag = 0;
|
||||||
|
j++;
|
||||||
|
|
||||||
vertices[j + 2].v.ob[0] = -32;
|
vertices[j].v.ob[0] = -32;
|
||||||
vertices[j + 2].v.ob[1] = 32;
|
vertices[j].v.ob[1] = 32;
|
||||||
vertices[j + 2].v.ob[2] = 0;
|
vertices[j].v.ob[2] = 0;
|
||||||
vertices[j + 2].v.cn[0] = sp1CB;
|
vertices[j].v.cn[0] = sp1CB;
|
||||||
vertices[j + 2].v.cn[1] = sp1CA;
|
vertices[j].v.cn[1] = sp1CA;
|
||||||
vertices[j + 2].v.cn[2] = sp1C9;
|
vertices[j].v.cn[2] = sp1C9;
|
||||||
vertices[j + 2].v.cn[3] = sp1C8;
|
vertices[j].v.cn[3] = sp1C8;
|
||||||
vertices[j + 2].v.tc[0] = 0;
|
vertices[j].v.tc[0] = 0;
|
||||||
vertices[j + 2].v.tc[1] = 0;
|
vertices[j].v.tc[1] = 0;
|
||||||
vertices[j + 2].v.flag = 0;
|
vertices[j].v.flag = 0;
|
||||||
|
j++;
|
||||||
|
|
||||||
vertices[j + 3].v.ob[0] = 32;
|
vertices[j].v.ob[0] = 32;
|
||||||
vertices[j + 3].v.ob[1] = -32;
|
vertices[j].v.ob[1] = -32;
|
||||||
vertices[j + 3].v.ob[2] = 0;
|
vertices[j].v.ob[2] = 0;
|
||||||
vertices[j + 3].v.cn[0] = sp1C7;
|
vertices[j].v.cn[0] = sp1C7;
|
||||||
vertices[j + 3].v.cn[1] = sp1C6;
|
vertices[j].v.cn[1] = sp1C6;
|
||||||
vertices[j + 3].v.cn[2] = sp1C5;
|
vertices[j].v.cn[2] = sp1C5;
|
||||||
vertices[j + 3].v.cn[3] = sp1C4;
|
vertices[j].v.cn[3] = sp1C4;
|
||||||
vertices[j + 3].v.tc[0] = 1024;
|
vertices[j].v.tc[0] = 1024;
|
||||||
vertices[j + 3].v.tc[1] = 1024;
|
vertices[j].v.tc[1] = 1024;
|
||||||
vertices[j + 3].v.flag = 0;
|
vertices[j].v.flag = 0;
|
||||||
|
j++;
|
||||||
j += 4;
|
|
||||||
|
|
||||||
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &sp12C);
|
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &sp12C);
|
||||||
if (mtx == NULL) {
|
if (mtx == NULL) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue