mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-15 20:35:13 +00:00
z_scene_table, z_view, and z_fbdemo_fade OK (#561)
* fbdemo * the view is clear * more matchings * scene table doesn't want to be nice * small thing in view * can do * accidentally a value
This commit is contained in:
parent
09ddf4f71e
commit
a8ae9f48b7
13 changed files with 49 additions and 898 deletions
|
@ -28,8 +28,12 @@ Gfx D_8012B000[] = {
|
|||
#ifdef NON_EQUIVALENT
|
||||
// The general control flow is correct and nothing is especially out of order but there are
|
||||
// many small reoderings and regalloc all over so functional equivalence cannot be verified
|
||||
// The first loop is down to regalloc. The second needs work.
|
||||
void TransitionUnk_InitGraphics(TransitionUnk* this) {
|
||||
Vtx* vtx2;
|
||||
s32 pad;
|
||||
s32 pad2;
|
||||
s32 pad3;
|
||||
Vtx_t* vtx2;
|
||||
s32 frame;
|
||||
s32 rowTex;
|
||||
s32 row;
|
||||
|
@ -45,20 +49,21 @@ void TransitionUnk_InitGraphics(TransitionUnk* this) {
|
|||
for (frame = 0; frame < 2; frame++) {
|
||||
this->frame = frame;
|
||||
vtx = (frame == 0) ? this->vtxFrame1 : this->vtxFrame2;
|
||||
for (col = 0, colTex = 0; col < this->col + 1; col++, colTex += 0x20) {
|
||||
for (row = 0, rowTex = 0; row < this->row + 1; row++, rowTex += 0x20) {
|
||||
vtx2 = vtx;
|
||||
vtx2->v.tc[0] = rowTex * 0x40;
|
||||
vtx2->v.ob[0] = rowTex;
|
||||
vtx2->v.ob[1] = col * 0x20;
|
||||
vtx2->v.ob[2] = -5;
|
||||
vtx2->v.flag = 0;
|
||||
vtx2->v.tc[1] = colTex * 0x40;
|
||||
vtx2->v.cn[0] = 0;
|
||||
vtx2->v.cn[1] = 0;
|
||||
vtx2->v.cn[2] = 120;
|
||||
vtx2->v.cn[3] = 255;
|
||||
for (colTex = 0, col = 0; col < this->col + 1; colTex += 0x20, col++) {
|
||||
for (rowTex = 0, row = 0; row < this->row + 1; rowTex += 0x20, row++) {
|
||||
vtx2 = &vtx->v;
|
||||
vtx++;
|
||||
|
||||
vtx2->tc[0] = rowTex << 6;
|
||||
vtx2->ob[0] = row * 0x20;
|
||||
vtx2->ob[1] = col * 0x20;
|
||||
vtx2->ob[2] = -5;
|
||||
vtx2->flag = 0;
|
||||
vtx2->tc[1] = colTex << 6;
|
||||
vtx2->cn[0] = 0;
|
||||
vtx2->cn[1] = 0;
|
||||
vtx2->cn[2] = 120;
|
||||
vtx2->cn[3] = 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,8 +35,6 @@ TransitionFade* TransitionFade_Init(TransitionFade* this) {
|
|||
void TransitionFade_Destroy(TransitionFade* this) {
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// Ordering differences around alpha temp
|
||||
void TransitionFade_Update(TransitionFade* this, s32 updateRate) {
|
||||
s32 alpha;
|
||||
s16 newAlpha;
|
||||
|
@ -54,19 +52,20 @@ void TransitionFade_Update(TransitionFade* this, s32 updateRate) {
|
|||
// Divide by 0! Zero is included in ZCommonGet fade_speed
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "0除算! ZCommonGet fade_speed に0がはいってる" VT_RST);
|
||||
}
|
||||
alpha = (this->fadeTimer * 255.0f) / gSaveContext.fadeDuration;
|
||||
|
||||
alpha = (255.0f * this->fadeTimer) / (0, gSaveContext.fadeDuration);
|
||||
this->fadeColor.a = (this->fadeDirection != 0) ? 255 - alpha : alpha;
|
||||
break;
|
||||
case 2:
|
||||
newAlpha = this->fadeColor.a;
|
||||
if (iREG(50) != 0) {
|
||||
if (iREG(50) < 0) {
|
||||
if (Math_ApproxS(&newAlpha, 255, 255) != 0) {
|
||||
if (Math_ApproxS(&newAlpha, 255, 255)) {
|
||||
iREG(50) = 150;
|
||||
}
|
||||
} else {
|
||||
Math_ApproxS(&iREG(50), 20, 60);
|
||||
if (Math_ApproxS(&newAlpha, 0, iREG(50)) != 0) {
|
||||
if (Math_ApproxS(&newAlpha, 0, iREG(50))) {
|
||||
iREG(50) = 0;
|
||||
this->isDone = 1;
|
||||
}
|
||||
|
@ -76,9 +75,6 @@ void TransitionFade_Update(TransitionFade* this, s32 updateRate) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_fade/TransitionFade_Update.s")
|
||||
#endif
|
||||
|
||||
void TransitionFade_Draw(TransitionFade* this, Gfx** gfxP) {
|
||||
Gfx* gfx;
|
||||
|
|
|
@ -3047,7 +3047,8 @@ s16 D_80125B5C[] = { 91, 91 }; // unused
|
|||
|
||||
// Due to an unknown reason, bss ordering changes within the 5 static variables in the function below.
|
||||
// In order to restore the correct order, we need a specific number of bss variables in the file before that point.
|
||||
// For this, we introduce 3 dummy variables which end up in padding at the end of the file's bss, so they don't actually take space.
|
||||
// For this, we introduce 3 dummy variables which end up in padding at the end of the file's bss, so they don't actually
|
||||
// take space.
|
||||
s8 sBssDummy1;
|
||||
s8 sBssDummy2;
|
||||
s8 sBssDummy3;
|
||||
|
|
|
@ -2310,9 +2310,6 @@ void func_8009FC90(GlobalContext* globalCtx) {
|
|||
|
||||
f32 D_8012A398 = 0.0f;
|
||||
|
||||
// Scene Draw Config 21
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc differences and single equivalent instruction difference
|
||||
void func_8009FE58(GlobalContext* globalCtx) {
|
||||
static s16 D_8012A39C = 538;
|
||||
static s16 D_8012A3A0 = 4272;
|
||||
|
@ -2346,11 +2343,10 @@ void func_8009FE58(GlobalContext* globalCtx) {
|
|||
D_8012A3A0 += 1820;
|
||||
|
||||
temp = 0.020000001f;
|
||||
func_800AA76C(&globalCtx->view, Math_Coss(D_8012A39C) * (0.00009587531f * temp),
|
||||
Math_Sins(D_8012A39C) * (0.00009587531f * temp), Math_Sins(D_8012A3A0) * (0.00009587531f * temp));
|
||||
func_800AA78C(&globalCtx->view, 1.0f + (Math_Sins(D_8012A3A0) * (0.79999995f * temp)),
|
||||
1.0f + (Math_Coss(D_8012A3A0) * (0.39999998f * temp)),
|
||||
1.0f + (Math_Coss(D_8012A39C) * (1 * temp)));
|
||||
func_800AA76C(&globalCtx->view, 0.00009587531f * temp * Math_Coss(D_8012A39C),
|
||||
0.00009587531f * temp * Math_Sins(D_8012A39C), 0.00009587531f * temp * Math_Sins(D_8012A3A0));
|
||||
func_800AA78C(&globalCtx->view, 1.f + (0.79999995f * temp * Math_Sins(D_8012A3A0)),
|
||||
1.f + (0.39999998f * temp * Math_Coss(D_8012A3A0)), 1.f + (1 * temp * Math_Coss(D_8012A39C)));
|
||||
func_800AA7AC(&globalCtx->view, 0.95f);
|
||||
|
||||
switch (globalCtx->unk_11D30[0]) {
|
||||
|
@ -2377,7 +2373,7 @@ void func_8009FE58(GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (globalCtx->roomCtx.curRoom.num == 2) {
|
||||
Matrix_Scale(1, sinf(D_8012A398) * 0.8f, 1, MTXMODE_NEW);
|
||||
Matrix_Scale(1.0f, sinf(D_8012A398) * 0.8f, 1.0f, MTXMODE_NEW);
|
||||
} else {
|
||||
Matrix_Scale(1.005f, sinf(D_8012A398) * 0.8f, 1.005f, MTXMODE_NEW);
|
||||
}
|
||||
|
@ -2386,12 +2382,6 @@ void func_8009FE58(GlobalContext* globalCtx) {
|
|||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 7811);
|
||||
}
|
||||
#else
|
||||
s16 D_8012A39C = 538;
|
||||
s16 D_8012A3A0 = 4272;
|
||||
void func_8009FE58(GlobalContext* globalCtx);
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_scene_table/func_8009FE58.s")
|
||||
#endif
|
||||
|
||||
// Scene Draw Config 26
|
||||
void func_800A0334(GlobalContext* globalCtx) {
|
||||
|
|
|
@ -194,7 +194,7 @@ void func_800AA78C(View* view, f32 x, f32 y, f32 z) {
|
|||
view->unk_F4.z = z;
|
||||
}
|
||||
|
||||
void func_800AA7AC(View* view, f32 arg1) {
|
||||
s32 func_800AA7AC(View* view, f32 arg1) {
|
||||
view->unk_100 = arg1;
|
||||
}
|
||||
|
||||
|
@ -260,7 +260,7 @@ s32 func_800AA890(View* view, Mtx* mtx) {
|
|||
}
|
||||
|
||||
void func_800AAA50(View* view, s32 arg1) {
|
||||
arg1 = (view->flags & arg1) | arg1 >> 4;
|
||||
arg1 = (view->flags & arg1) | (arg1 >> 4);
|
||||
|
||||
if (arg1 & 8) {
|
||||
func_800AB0A8(view);
|
||||
|
@ -522,8 +522,6 @@ s32 func_800AB944(View* view) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc differences, skips a t register at arg1's assignment
|
||||
s32 func_800AB9EC(View* view, s32 arg1, Gfx** gfxp) {
|
||||
Gfx* gfx = *gfxp;
|
||||
GraphicsContext* gfxCtx = view->gfxCtx;
|
||||
|
@ -595,9 +593,6 @@ s32 func_800AB9EC(View* view, s32 arg1, Gfx** gfxp) {
|
|||
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_view/func_800AB9EC.s")
|
||||
#endif
|
||||
|
||||
s32 func_800ABE74(f32 eyeX, f32 eyeY, f32 eyeZ) {
|
||||
s32 error = 0;
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
#define THIS ((BgRelayObjects*)thisx)
|
||||
|
||||
typedef enum {
|
||||
WINDMILL_ROTATING_GEAR,
|
||||
WINDMILL_DAMPE_STONE_DOOR
|
||||
/* 0 */ WINDMILL_ROTATING_GEAR,
|
||||
/* 1 */ WINDMILL_DAMPE_STONE_DOOR
|
||||
} WindmillSetpiecesMode;
|
||||
|
||||
void BgRelayObjects_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
|
|
@ -381,7 +381,6 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) {
|
|||
temp_a0 += phi_v0;
|
||||
phi_v1 = (s16)(temp_a0 - phi_a1);
|
||||
|
||||
|
||||
if (((this->unk_25C[idx] * phi_v0) <= 0) && (phi_v1 > -100) && (phi_v1 < 100)) {
|
||||
temp_a0 = phi_a1;
|
||||
phi_v0 = 0;
|
||||
|
@ -430,7 +429,8 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) {
|
|||
if (animCurrentFrame <= 42.0f) {
|
||||
phi_v1_2 = phi_a1 - 2000;
|
||||
} else {
|
||||
phi_v1_2 = (s32)((((animCurrentFrame - 42.0f) * 6200.0f) / (unk_3F4 - 42.0f)) + -2000.0f) + phi_a1;
|
||||
phi_v1_2 =
|
||||
(s32)((((animCurrentFrame - 42.0f) * 6200.0f) / (unk_3F4 - 42.0f)) + -2000.0f) + phi_a1;
|
||||
}
|
||||
|
||||
if (phi_v1_2 >= temp_a0) {
|
||||
|
|
|
@ -14,7 +14,7 @@ typedef enum {
|
|||
/* 0 */ ENZO_EFFECT_NONE,
|
||||
/* 1 */ ENZO_EFFECT_RIPPLE,
|
||||
/* 2 */ ENZO_EFFECT_SPLASH,
|
||||
/* 3 */ ENZO_EFFECT_BUBBLE,
|
||||
/* 3 */ ENZO_EFFECT_BUBBLE
|
||||
} EnZoEffectType;
|
||||
|
||||
void EnZo_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
@ -82,7 +82,7 @@ void EnZo_Bubble(EnZo* this, Vec3f* pos) {
|
|||
effect->scale = ((Math_Rand_ZeroOne() - 0.5f) * 0.02f) + 0.12f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
effect++;
|
||||
}
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ void EnZo_Splash(EnZo* this, Vec3f* pos, Vec3f* vel, f32 scale) {
|
|||
effect->color.a = (Math_Rand_ZeroOne() * 100.0f) + 100.0f;
|
||||
effect->scale = scale;
|
||||
break;
|
||||
}
|
||||
}
|
||||
effect++;
|
||||
}
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ void EnZo_DrawBubbles(EnZo* this, GlobalContext* globalCtx) {
|
|||
Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_zo_eff.c", 281),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, D_06002350);
|
||||
}
|
||||
effect++;
|
||||
|
@ -273,7 +273,7 @@ void EnZo_DrawSplashes(EnZo* this, GlobalContext* globalCtx) {
|
|||
func_800D1FD4(&globalCtx->mf_11DA0);
|
||||
Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_zo_eff.c", 325),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
gSPDisplayList(POLY_XLU_DISP++, D_06002510);
|
||||
}
|
||||
|
@ -292,14 +292,12 @@ void EnZo_TreadWaterRipples(EnZo* this, f32 scale, f32 targetScale, u8 alpha) {
|
|||
}
|
||||
|
||||
static ColliderCylinderInit sCylinderInit = {
|
||||
{ COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER, },
|
||||
{ COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER },
|
||||
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
|
||||
{ 0x1A, 0x40, 0, { 0, 0, 0 } },
|
||||
};
|
||||
|
||||
static CollisionCheckInfoInit2 sColChkInit = {
|
||||
0x00, 0x0000, 0x0000, 0x0000, 0xFF,
|
||||
};
|
||||
static CollisionCheckInfoInit2 sColChkInit = { 0, 0, 0, 0, 0xFF };
|
||||
|
||||
const ActorInit En_Zo_InitVars = {
|
||||
ACTOR_EN_ZO,
|
||||
|
@ -314,14 +312,10 @@ const ActorInit En_Zo_InitVars = {
|
|||
};
|
||||
|
||||
static struct_80034EC0_Entry sAnimations[] = {
|
||||
{ &D_06002FE8, 1.0f, 0.0f, -1.0f, 0, -8.0f, },
|
||||
{ &D_06002FE8, 1.0f, 0.0f, -1.0f, 0, 0.0f, },
|
||||
{ &D_06002F10, 0.0f, 1.0f, 1.0f, 2, 0.0f, },
|
||||
{ &D_06002F10, 1.0f, 1.0f, -1.0f, 0, -8.0f, },
|
||||
{ &D_06002F10, 1.0f, 8.0f, -1.0f, 0, -8.0f, },
|
||||
{ &D_0600219C, 1.0f, 0.0f, -1.0f, 0, -8.0f, },
|
||||
{ &D_06000598, 1.0f, 0.0f, -1.0f, 0, -8.0f, },
|
||||
{ &D_06000D48, 1.0f, 0.0f, -1.0f, 0, -8.0f, },
|
||||
{ &D_06002FE8, 1.0f, 0.0f, -1.0f, 0, -8.0f }, { &D_06002FE8, 1.0f, 0.0f, -1.0f, 0, 0.0f },
|
||||
{ &D_06002F10, 0.0f, 1.0f, 1.0f, 2, 0.0f }, { &D_06002F10, 1.0f, 1.0f, -1.0f, 0, -8.0f },
|
||||
{ &D_06002F10, 1.0f, 8.0f, -1.0f, 0, -8.0f }, { &D_0600219C, 1.0f, 0.0f, -1.0f, 0, -8.0f },
|
||||
{ &D_06000598, 1.0f, 0.0f, -1.0f, 0, -8.0f }, { &D_06000D48, 1.0f, 0.0f, -1.0f, 0, -8.0f },
|
||||
};
|
||||
|
||||
void EnZo_SpawnSplashes(EnZo* this) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue