summaryrefslogtreecommitdiff
path: root/src/overlays
diff options
context:
space:
mode:
authorSonicDcer <alejandro.asenjo88@gmail.com>2026-06-15 03:13:19 -0300
committerSonicDcer <alejandro.asenjo88@gmail.com>2026-06-15 03:13:19 -0300
commitcee62dd2c39ecf9c032c573fabed1fbb08f9517a (patch)
tree34594092ae41c0d92b2b05c0f52be1d8bd18a253 /src/overlays
parented6604310a74c2207716a5bee32ae05d5fd00f7a (diff)
parentb96d7e4c530a11975b0f7a618253b9a0ea225880 (diff)
Merge branch 'main' of github.com:HarbourMasters/Starship
Diffstat (limited to 'src/overlays')
-rw-r--r--src/overlays/ovl_ending/fox_end1.c11
-rw-r--r--src/overlays/ovl_i1/fox_co.c39
-rw-r--r--src/overlays/ovl_i2/fox_me.c10
-rw-r--r--src/overlays/ovl_i3/fox_a6.c8
-rw-r--r--src/overlays/ovl_i5/fox_ground.c224
-rw-r--r--src/overlays/ovl_i5/fox_ma.c26
-rw-r--r--src/overlays/ovl_i5/fox_ti.c2
-rw-r--r--src/overlays/ovl_i6/fox_andross.c79
-rw-r--r--src/overlays/ovl_i6/fox_sy.c13
9 files changed, 146 insertions, 266 deletions
diff --git a/src/overlays/ovl_ending/fox_end1.c b/src/overlays/ovl_ending/fox_end1.c
index 4116210c..ec1890e1 100644
--- a/src/overlays/ovl_ending/fox_end1.c
+++ b/src/overlays/ovl_ending/fox_end1.c
@@ -9,14 +9,6 @@
#include "port/mods/PortEnhancements.h"
#include "fox_record.h"
-Record gEndingCsRecord[] = {
- { 2, 0 }, { 5, 1 }, { 2, 2 }, { 3, 277 }, { 2, 278 }, { 3, 340 }, { 2, 397 }, { 3, 537 },
- { 2, 538 }, { 3, 548 }, { 2, 549 }, { 3, 568 }, { 2, 569 }, { 3, 620 }, { 2, 623 }, { 3, 803 },
- { 2, 806 }, { 3, 814 }, { 2, 823 }, { 3, 1282 }, { 2, 1284 }, { 5, 3703 }, { 2, 3704 }, { 4, 3904 },
- { 2, 3905 }, { 3, 4782 }, { 2, 4783 }, { 3, 4785 }, { 2, 4820 }, { 3, 4986 }, { 2, 6779 }, { 5, 6780 },
- { 2, 6781 }, { 3, 6785 }, { 4, 6786 }, { 3, 6793 }, { 2, 6799 },
-};
-
void Ending_8018CE20(s32);
void Ending_801926D4(void);
extern u32 D_ending_80192E70;
@@ -1116,7 +1108,8 @@ void Ending_Main(void) {
Ending_8018B3D8();
Ending_8018ABE8();
- UpdateVisPerFrameFromRecording_Ending(gEndingCsRecord, ARRAY_COUNT(gEndingCsRecord));
+ // @Port: Vi recording
+ UpdateVisPerFrameFromRecording(gEndingCsRecord, ARRAY_COUNT(gEndingCsRecord), &gGameFrameCount);
}
void DrawBorders(void) {
diff --git a/src/overlays/ovl_i1/fox_co.c b/src/overlays/ovl_i1/fox_co.c
index e1a6ddf2..9d068d5a 100644
--- a/src/overlays/ovl_i1/fox_co.c
+++ b/src/overlays/ovl_i1/fox_co.c
@@ -11,40 +11,6 @@
#include "port/hooks/Events.h"
#include "fox_record.h"
-// Carrier destroy cutscene timings recorded from a real N64
-Record gCarrierCutsceneRecord[] = {
- { 2, 0 },
- { 3, 2 },
- { 4, 16 },
- { 3, 50 },
- { 4, 58 },
- { 5, 67 },
- { 4, 68 },
- { 5, 71 },
- { 4, 73 },
- { 5, 74 },
- { 4, 106 },
- { 3, 146 },
- { 2, 194 },
-};
-
-// Granga destroy cutscene timings recorded from a real N64
-Record gGrangaCutsceneRecord[] = {
- { 2, 0 },
- { 3, 1 },
- { 2, 5 },
- { 3, 7 },
- { 2, 52 },
- { 3, 78 },
- { 4, 103 },
- { 3, 125 },
- { 2, 153 },
- { 3, 155 },
- { 2, 157 },
- { 3, 158 },
- { 2, 160 },
-};
-
u8 sFightCarrier;
f32 sCoGrangaWork[68];
@@ -1724,7 +1690,7 @@ void Corneria_CoCarrier_Init(CoCarrier* this) {
timer = this->timer_05A;
// OBJ_BOSS_CO_CARRIER_LEFT to OBJ_BOSS_CO_CARRIER_BOTTOM
- for (i = CARRIER_LEFT; i < ARRAY_COUNT(gBosses); i++) {
+ for (i = CARRIER_LEFT; i <= CARRIER_BOTTOM; i++) {
Boss_Initialize(&gBosses[i]);
gBosses[i].obj.status = OBJ_INIT;
gBosses[i].obj.id = (i - 1) + OBJ_BOSS_CO_CARRIER_LEFT;
@@ -3489,7 +3455,8 @@ void Corneria_LevelComplete1(Player* player) {
f32 temp_fa1;
f32 temp_deg;
- UpdateVisPerFrameFromRecording(gGrangaCutsceneRecord, ARRAY_COUNT(gGrangaCutsceneRecord));
+ // @Port: Vi recording
+ UpdateVisPerFrameFromRecording(gGrangaCutsceneRecord, ARRAY_COUNT(gGrangaCutsceneRecord), &gCsFrameCount);
player->arwing.upperRightFlapYrot = player->arwing.upperLeftFlapYrot = player->arwing.bottomRightFlapYrot =
player->arwing.bottomLeftFlapYrot = 0.0f;
diff --git a/src/overlays/ovl_i2/fox_me.c b/src/overlays/ovl_i2/fox_me.c
index f2cec042..02be4e00 100644
--- a/src/overlays/ovl_i2/fox_me.c
+++ b/src/overlays/ovl_i2/fox_me.c
@@ -8,13 +8,6 @@
#include "assets/ast_meteo.h"
#include "fox_record.h"
-// MeCrusher destroy cutscene timings recorded from a real N64
-Record gMeCrusherCutsceneRecord[] = {
- { 2, 0 },
- { 3, 200 },
- { 2, 224 },
-};
-
Vec3f D_i2_80195430[] = {
{ 122.0, -5.0, -1200.0 }, { 122.0, -103.0, -727.0 }, { 142.0, -323.0, -848.0 }, { 362.0, -59.0, -435.0 },
{ 692.0, -84.0, -308.0 }, { 1000.0, -7.0, -308.0 }, { 164.0, -700.0, -308.0 }, { 263.0, -370.0, -11.0 },
@@ -2434,7 +2427,8 @@ void Meteo_LevelComplete(Player* player) {
Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 20.0f, 0.0f);
Math_SmoothStepToF(&player->boostSpeed, 0.0f, 0.1f, 3.0f, 0.0f);
- UpdateVisPerFrameFromRecording(gMeCrusherCutsceneRecord, ARRAY_COUNT(gMeCrusherCutsceneRecord));
+ // @Port: Vi recording
+ UpdateVisPerFrameFromRecording(gMeCrusherCutsceneRecord, ARRAY_COUNT(gMeCrusherCutsceneRecord), &gCsFrameCount);
switch (player->csState) {
case 0:
diff --git a/src/overlays/ovl_i3/fox_a6.c b/src/overlays/ovl_i3/fox_a6.c
index f2426fa8..1facf2b2 100644
--- a/src/overlays/ovl_i3/fox_a6.c
+++ b/src/overlays/ovl_i3/fox_a6.c
@@ -6,6 +6,7 @@
#include "global.h"
#include "assets/ast_area_6.h"
+#include "fox_record.h"
void Area6_8018A1B0(Boss* this, s32 arg1);
void Area6_8018A2C4(Boss* this);
@@ -425,6 +426,9 @@ void Area6_A6Gorgon_Init(A6Gorgon* this) {
gProjectFar = 25000.0f;
gBossFrameCount = 0;
+ // @Port: Vi recording
+ gA6GorgonCsFrameCount = 0;
+
this->health = 780;
this->fwork[A6_FWK_2] = this->fwork[A6_FWK_34] = 2.0f;
@@ -1187,6 +1191,10 @@ void Area6_A6Gorgon_Update(A6Gorgon* this) {
break;
case 11:
+ // @Port: Vi recording
+ UpdateVisPerFrameFromRecording(gA6GorgonCsRecord, ARRAY_COUNT(gA6GorgonCsRecord), &gA6GorgonCsFrameCount);
+ gA6GorgonCsFrameCount++;
+
if ((this->timer_052 == 160) &&
((gPlayer[0].state == PLAYERSTATE_ACTIVE) || (gPlayer[0].state == PLAYERSTATE_U_TURN))) {
gPlayer[0].state = PLAYERSTATE_LEVEL_COMPLETE;
diff --git a/src/overlays/ovl_i5/fox_ground.c b/src/overlays/ovl_i5/fox_ground.c
index 1e761284..19622d13 100644
--- a/src/overlays/ovl_i5/fox_ground.c
+++ b/src/overlays/ovl_i5/fox_ground.c
@@ -9,15 +9,15 @@ void Ground_801B68A8(Gfx** dlist, s32 arg1, s32 arg2);
typedef struct {
/* 0x00 */ s32 unk_00;
- /* 0x04 */ s32 unk_04;
- /* 0x08 */ f32 unk_08;
- /* 0x0C */ f32 unk_0C;
- /* 0x10 */ f32 unk_10;
- /* 0x14 */ f32 unk_14;
- /* 0x18 */ f32 unk_18;
+ /* 0x04 */ s32 type;
+ /* 0x08 */ f32 xPos;
+ /* 0x0C */ f32 zPos;
+ /* 0x10 */ f32 xRot;
+ /* 0x14 */ f32 yRot;
+ /* 0x18 */ f32 zRot;
/* 0x1C */ s16 unk_1C;
/* 0x20 */ f32 unk_20;
-} UnkStruct_801C62E8; // size = 0x24
+} GroundObj; // size = 0x24
typedef union {
f32 a[3];
@@ -64,79 +64,80 @@ s32 D_i5_801C5C04;
s32 D_i5_801C5C08;
s32 D_i5_801C5C0C;
f32 D_i5_801C5C10;
-s32 D_i5_801C5C14;
-Mtx D_i5_801C5C18[27];
+s32 sGroundMode;
+Mtx sGroundMtx[27];
Vec3f D_i5_801C62D8;
-UnkStruct_801C62E8 D_i5_801C62E8[20];
+GroundObj sGroundList[20];
Vec3fa D_i5_801C65B8[3][15][4];
s32 D_i5_801C6E28[4][3];
-bool Ground_801B49D0(Actor* actor) {
+bool Ground_List_Setup(TiTerrain* actor) {
s32 i;
bool found = false;
- UnkStruct_801C62E8* var_v0 = D_i5_801C62E8;
+ GroundObj* ground = sGroundList;
- for (i = 0; i < ARRAY_COUNT(D_i5_801C62E8); i++, var_v0++) {
- if (var_v0->unk_00 == 0) {
+ for (i = 0; i < ARRAY_COUNT(sGroundList); i++, ground++) {
+ if (ground->unk_00 == 0) {
found = true;
- var_v0->unk_00 = 1;
- var_v0->unk_04 = actor->obj.pos.y;
- var_v0->unk_08 = actor->obj.pos.x;
- var_v0->unk_0C = actor->obj.pos.z;
- var_v0->unk_10 = actor->obj.rot.x;
- var_v0->unk_14 = actor->obj.rot.y;
- var_v0->unk_18 = actor->obj.rot.z;
+ ground->unk_00 = 1;
+ ground->type = actor->obj.pos.y; // ???
+ ground->xPos = actor->obj.pos.x;
+ ground->zPos = actor->obj.pos.z;
+ ground->xRot = actor->obj.rot.x;
+ ground->yRot = actor->obj.rot.y;
+ ground->zRot = actor->obj.rot.z;
break;
}
}
- actor->obj.status = 0;
+ actor->obj.status = OBJ_FREE;
+
return found;
}
-void Ground_801B4A54(UnkStruct_801C62E8* arg0) {
+void Ground_GroundObj_Clear(GroundObj* arg0) {
// Lots of conversions between floats, and ints unnecessarily here because of this chain assignment.
- arg0->unk_00 = arg0->unk_04 = arg0->unk_08 = arg0->unk_0C = arg0->unk_10 = arg0->unk_14 = arg0->unk_18 =
- arg0->unk_1C = arg0->unk_20 = 0;
+ arg0->unk_00 = arg0->type = arg0->xPos = arg0->zPos = arg0->xRot = arg0->yRot = arg0->zRot = arg0->unk_1C =
+ arg0->unk_20 = 0;
}
void Ground_801B4AA8(s32* arg0, s32* arg1) {
Actor actor;
- UnkStruct_801C62E8* var_s2 = D_i5_801C62E8;
+ GroundObj* ground = sGroundList;
s32* var_s1;
f32 temp_fa0;
f32 temp_fs0;
f32 temp_fs1;
f32 var_fv0;
f32 var_fv1;
- s32 unk_04;
- f32 unk_08;
- f32 unk_10;
- f32 unk_14;
- f32 unk_18;
+ s32 type;
+ f32 xPos;
+ f32 xRot;
+ f32 yRot;
+ f32 zRot;
s32 i;
s32 j;
- for (i = 0; i < ARRAY_COUNT(D_i5_801C62E8); i++, var_s2++) {
- if (var_s2->unk_00 != 0) {
- unk_04 = var_s2->unk_04;
- unk_08 = var_s2->unk_08;
- unk_10 = var_s2->unk_10;
- unk_14 = var_s2->unk_14;
- unk_18 = var_s2->unk_18;
+ for (i = 0; i < ARRAY_COUNT(sGroundList); i++, ground++) {
+ if (ground->unk_00 != 0) {
+ type = ground->type;
+ xPos = ground->xPos;
+ xRot = ground->xRot;
+ yRot = ground->yRot;
+ zRot = ground->zRot;
var_s1 = arg0;
if (arg0 == NULL) {
- unk_04 = D_i5_801BA970[unk_04];
+ type = D_i5_801BA970[type];
}
- if (var_s2->unk_00 == 1) {
- switch (unk_04) {
+ if (ground->unk_00 == 1) {
+ switch (type) {
case 0:
break;
case 1:
case 3:
- var_s2->unk_20 = var_s2->unk_18;
+ ground->unk_20 = ground->zRot;
break;
case 4:
@@ -161,109 +162,107 @@ void Ground_801B4AA8(s32* arg0, s32* arg1) {
case 8:
PRINTF("RANDAMU YAMA\n"); // RANDOM MOUNTAIN
- var_s2->unk_20 = 5000.0f;
+ ground->unk_20 = 5000.0f;
break;
}
- var_s2->unk_00 = 2;
+ ground->unk_00 = 2;
}
- switch (unk_04) {
+ switch (type) {
case 0:
break;
case 1:
for (j = 0; j < 16; j++, var_s1++) {
- temp_fs0 = (j * 220.0f * D_i5_801BE740) - 1760.0f - unk_08;
- if (fabsf(temp_fs0) <= unk_10) {
- temp_fs1 = __sinf((var_s2->unk_20 / unk_18) * (M_DTOR * 180.0f));
- var_fv0 = __cosf((temp_fs0 / unk_10) * (M_DTOR * 90.0f));
- *var_s1 += var_fv0 * unk_14 * temp_fs1;
+ temp_fs0 = (j * 220.0f * D_i5_801BE740) - 1760.0f - xPos;
+ if (fabsf(temp_fs0) <= xRot) {
+ temp_fs1 = __sinf((ground->unk_20 / zRot) * (M_DTOR * 180.0f));
+ var_fv0 = __cosf((temp_fs0 / xRot) * (M_DTOR * 90.0f));
+ *var_s1 += var_fv0 * yRot * temp_fs1;
}
}
- var_s2->unk_20 -= 220.0f;
- if (var_s2->unk_20 <= 0.0f) {
- Ground_801B4A54(var_s2);
+ ground->unk_20 -= 220.0f;
+ if (ground->unk_20 <= 0.0f) {
+ Ground_GroundObj_Clear(ground);
}
break;
case 2:
- unk_08 += (1760.0f - (unk_10 * 0.5f));
- var_fv1 = unk_14;
+ xPos += (1760.0f - (xRot * 0.5f));
+ var_fv1 = yRot;
- if (var_s2->unk_20 <= var_fv1 / (70.0f * M_DTOR)) {
- var_fv1 = var_s2->unk_20 * (70.0f * M_DTOR);
- } else if (var_fv1 / (70.0f * M_DTOR) >= (unk_18 - var_s2->unk_20)) {
- var_fv1 = (unk_18 - var_s2->unk_20) * (70.0f * M_DTOR);
+ if (ground->unk_20 <= var_fv1 / (70.0f * M_DTOR)) {
+ var_fv1 = ground->unk_20 * (70.0f * M_DTOR);
+ } else if (var_fv1 / (70.0f * M_DTOR) >= (zRot - ground->unk_20)) {
+ var_fv1 = (zRot - ground->unk_20) * (70.0f * M_DTOR);
}
for (j = 0, var_fv0 = 0.0f; j < 16; j++, var_fv0 += 220.0f, var_s1++) {
- if (unk_08 <= var_fv0 && var_fv0 <= (unk_08 + unk_10) && *var_s1 < var_fv1) {
+ if (xPos <= var_fv0 && var_fv0 <= (xPos + xRot) && *var_s1 < var_fv1) {
*var_s1 = var_fv1;
}
}
- var_s2->unk_20 += 220.0f;
- if (unk_18 <= var_s2->unk_20) {
- Ground_801B4A54(var_s2);
+ ground->unk_20 += 220.0f;
+ if (zRot <= ground->unk_20) {
+ Ground_GroundObj_Clear(ground);
}
break;
case 3:
for (j = 0; j < 16; j++, var_s1++) {
- temp_fs0 =
- (j * 220.0f * D_i5_801BE740) - 1760.0f - var_s2->unk_08 +
- (__sinf(((var_s2->unk_20 * 8.0f) / var_s2->unk_18) * 2 * (M_DTOR * 180.0f)) * 500.0f);
- if (fabsf(temp_fs0) <= var_s2->unk_10) {
- temp_fa0 = __cosf((temp_fs0 / var_s2->unk_10) * (M_DTOR * 90.0f));
+ temp_fs0 = (j * 220.0f * D_i5_801BE740) - 1760.0f - ground->xPos +
+ (__sinf(((ground->unk_20 * 8.0f) / ground->zRot) * 2 * (M_DTOR * 180.0f)) * 500.0f);
+ if (fabsf(temp_fs0) <= ground->xRot) {
+ temp_fa0 = __cosf((temp_fs0 / ground->xRot) * (M_DTOR * 90.0f));
if (temp_fa0 >= 0.7) {
temp_fa0 = 0.7f;
}
*var_s1 -=
- temp_fa0 * var_s2->unk_14 * 4.0f * ((var_s2->unk_18 - var_s2->unk_20) / var_s2->unk_18);
+ temp_fa0 * ground->yRot * 4.0f * ((ground->zRot - ground->unk_20) / ground->zRot);
}
- *var_s1 +=
- (var_s2->unk_14 - ((var_s2->unk_20 / var_s2->unk_18) * var_s2->unk_14)) * 4.0f * 0.7f;
+ *var_s1 += (ground->yRot - ((ground->unk_20 / ground->zRot) * ground->yRot)) * 4.0f * 0.7f;
}
- var_s2->unk_20 -= 220.0f;
- if (var_s2->unk_20 <= 0.0f) {
- Ground_801B4A54(var_s2);
+ ground->unk_20 -= 220.0f;
+ if (ground->unk_20 <= 0.0f) {
+ Ground_GroundObj_Clear(ground);
}
break;
case 8:
- if (var_s2->unk_1C <= 0) {
- for (j = 0; j < (s32) var_s2->unk_18; j++) {
- var_s2->unk_1C = 1;
+ if (ground->unk_1C <= 0) {
+ for (j = 0; j < (s32) ground->zRot; j++) {
+ ground->unk_1C = 1;
actor.obj.pos.x = RAND_FLOAT(3300.0f) - 1650.0f;
actor.obj.pos.z = 0.0f;
actor.obj.pos.y = 1.0f;
- actor.obj.rot.x = var_s2->unk_10 + RAND_FLOAT(var_s2->unk_10) * 0.25f;
+ actor.obj.rot.x = ground->xRot + RAND_FLOAT(ground->xRot) * 0.25f;
actor.obj.rot.z = 2.0f * actor.obj.rot.x; // Should this have been obj.rot.y?
- actor.obj.rot.z = var_s2->unk_14 + RAND_FLOAT(var_s2->unk_14) * 0.25f;
- Ground_801B49D0(&actor);
+ actor.obj.rot.z = ground->yRot + RAND_FLOAT(ground->yRot) * 0.25f;
+ Ground_List_Setup(&actor);
}
- var_s2->unk_20 -= 220.0f;
- if (var_s2->unk_20 <= 0.0f) {
- Ground_801B4A54(var_s2);
+ ground->unk_20 -= 220.0f;
+ if (ground->unk_20 <= 0.0f) {
+ Ground_GroundObj_Clear(ground);
}
} else {
- var_s2->unk_1C--;
+ ground->unk_1C--;
}
break;
default:
- Ground_801B4A54(var_s2);
+ Ground_GroundObj_Clear(ground);
break;
}
}
}
}
-void Ground_801B5110(f32 x, f32 y, f32 z) {
- UnkStruct_801C62E8* ptr;
+void Ground_Init(f32 x, f32 y, f32 z) {
+ GroundObj* ptr;
s32 i;
s32 k;
@@ -277,10 +276,10 @@ void Ground_801B5110(f32 x, f32 y, f32 z) {
D_i5_801C62D8.x = x;
D_i5_801C62D8.y = y;
D_i5_801C62D8.z = z;
- D_i5_801C5C14 = 1;
+ sGroundMode = 1;
- for (i = 0, ptr = D_i5_801C62E8; i < ARRAY_COUNT(D_i5_801C62E8); i++, ptr++) {
- Ground_801B4A54(ptr);
+ for (i = 0, ptr = sGroundList; i < ARRAY_COUNT(sGroundList); i++, ptr++) {
+ Ground_GroundObj_Clear(ptr);
}
for (i = 0; i < ARRAY_COUNT(D_i5_801C1D48); i++) {
@@ -350,8 +349,8 @@ void Ground_801B5244(s32 arg0, s32 arg1) {
}
}
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_i5_801C24B8[sp5C] * -220.0f, MTXF_NEW);
- Matrix_ToMtx(&D_i5_801C5C18[sp60]);
- gSPMatrix(D_i5_801C5C00++, &D_i5_801C5C18[sp60], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
+ Matrix_ToMtx(&sGroundMtx[sp60]);
+ gSPMatrix(D_i5_801C5C00++, &sGroundMtx[sp60], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPEndDisplayList(D_i5_801C5C00++);
sp5C = (sp5C + 1) % 28;
sp60 = (sp60 + 1) % 27;
@@ -369,10 +368,13 @@ void Ground_801B58AC(Gfx** dList, f32 arg1) {
RCP_SetupDL(dList, 0x1D);
RCP_SetFog(dList, gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
- spC4 = D_i5_801C5C14;
+ spC4 = sGroundMode;
+
+ // ONE PLANE POLYGON
+ if (sGroundMode & 2) {
+ // @port Skip interpolation
+ FrameInterpolation_ShouldInterpolateFrame(false);
- if (D_i5_801C5C14 & 2) {
- FrameInterpolation_RecordOpenChild(dList, D_i5_801C5C10);
gDPSetupTile((*dList)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, 0, G_TX_MIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
gDPLoadTileTexture((*dList)++, D_TI_6001BA8, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32);
@@ -383,10 +385,16 @@ void Ground_801B58AC(Gfx** dList, f32 arg1) {
gSPDisplayList((*dList)++, D_i5_801BA950);
gSPPopMatrix((*dList)++, G_MTX_MODELVIEW);
Ground_801B4AA8(NULL, &spC4);
- FrameInterpolation_RecordCloseChild();
+
+ // @port renable interpolation
+ FrameInterpolation_ShouldInterpolateFrame(true);
}
- if (D_i5_801C5C14 & 1) {
+ // TERRAIN POLYGON
+ if (sGroundMode & 1) {
+ // @port Skip interpolation
+ FrameInterpolation_ShouldInterpolateFrame(false);
+
if (D_i5_801C5C0C == 1) {
D_i5_801C5C0C = 0;
temp_hi = (D_i5_801C5C08 + 27) % 28;
@@ -421,29 +429,33 @@ void Ground_801B58AC(Gfx** dList, f32 arg1) {
D_i5_801BE748[(D_i5_801C5C04 + 27) % 27][i][1].v.ob[2] = 0;
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_i5_801C24B8[D_i5_801C5C08] * -220.0f, MTXF_NEW);
- Matrix_ToMtx(&D_i5_801C5C18[D_i5_801C5C04]);
+ Matrix_ToMtx(&sGroundMtx[D_i5_801C5C04]);
}
Ground_801B5FE0(D_i5_801C5C08, D_i5_801C5C04, 1);
}
+
gSPMatrix((*dList)++, &gIdentityMtx, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
Ground_801B68A8(dList, D_i5_801C5C04, 1);
gSPPopMatrix((*dList)++, G_MTX_MODELVIEW);
+
+ // @port renable interpolation
+ FrameInterpolation_ShouldInterpolateFrame(true);
}
D_i5_801C5C10 += arg1;
- if ((D_i5_801C5C14 & 1) && (D_i5_801C24B8[(D_i5_801C5C08 + 25) % 28] * 220.0f <= D_i5_801C5C10)) {
+ if ((sGroundMode & 1) && (D_i5_801C24B8[(D_i5_801C5C08 + 25) % 28] * 220.0f <= D_i5_801C5C10)) {
D_i5_801C5C0C = 1;
D_i5_801C5C10 = Math_ModF(D_i5_801C5C10, D_i5_801C24B8[(D_i5_801C5C08 + 25) % 28] * 220.0f);
D_i5_801C5C04 = (D_i5_801C5C04 + 26) % 27;
D_i5_801C5C08 = (D_i5_801C5C08 + 27) % 28;
}
- if (D_i5_801C5C14 & 2) {
+ if (sGroundMode & 2) {
D_i5_801C5C10 = Math_ModF(D_i5_801C5C10, 220.0f * D_i5_801BE744);
}
- D_i5_801C5C14 = spC4;
+ sGroundMode = spC4;
}
void Ground_801B5FE0(s32 arg0, s32 arg1, s32 arg2) {
@@ -565,10 +577,12 @@ void Ground_801B68A8(Gfx** dlist, s32 arg1, s32 arg2) {
s32 j;
s32 var;
+ // @port Skip interpolation
+ FrameInterpolation_ShouldInterpolateFrame(false);
+
gDPSetupTile((*dlist)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, 0, G_TX_MIRROR | G_TX_WRAP,
G_TX_MIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
gDPLoadTileTexture((*dlist)++, D_TI_6001BA8, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32);
- FrameInterpolation_RecordOpenChild(dlist, D_i5_801C5C10);
Matrix_Translate(gGfxMatrix, D_i5_801C62D8.x, D_i5_801C62D8.y, D_i5_801C62D8.z + D_i5_801C5C10, MTXF_NEW);
Matrix_ToMtx(gGfxMtx);
gSPMatrix((*dlist)++, gGfxMtx++, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@@ -579,7 +593,9 @@ void Ground_801B68A8(Gfx** dlist, s32 arg1, s32 arg2) {
gSPDisplayList((*dlist)++, &D_i5_801C2528[j]);
j = (j + 26) % 27;
}
- FrameInterpolation_RecordCloseChild();
+
+ // @port renable interpolation
+ FrameInterpolation_ShouldInterpolateFrame(true);
}
bool Ground_801B6AEC(f32 arg0, f32 arg1, f32 arg2) {
@@ -694,7 +710,7 @@ s32 Ground_801B6E20(f32 arg0, f32 arg1, f32* arg2, f32* arg3, f32* arg4) {
*arg4 = 0.0f;
*arg2 = 0.0f;
- if (D_i5_801C5C14 & 1) {
+ if (sGroundMode & 1) {
temp_fs2 = arg1 - D_i5_801C5C10 - D_i5_801C62D8.z;
var_v1 = 0;
var_s6 = (D_i5_801C5C04 + 25) % 27;
diff --git a/src/overlays/ovl_i5/fox_ma.c b/src/overlays/ovl_i5/fox_ma.c
index edc31257..f6b6bd52 100644
--- a/src/overlays/ovl_i5/fox_ma.c
+++ b/src/overlays/ovl_i5/fox_ma.c
@@ -60,29 +60,6 @@ Vec3f D_i5_801BE688[2];
Vec3f D_i5_801BE6A0[12];
s32 D_i5_801BE734[4];
-// Train cutscene timings recorded from a real N64
-Record gMacbethCutsceneRecord[] = {
- // Train breaking barriers
- { 2, 0 },
- { 3, 2 },
- { 2, 31 },
- { 3, 400 },
- { 2, 418 },
- { 3, 433 },
- { 4, 435 },
- { 3, 444 },
- { 2, 509 },
- // { 3, 559 },
- // { 2, 581 },
- // { 3, 587 },
- // Explosions
- { 2, 589 },
- { 3, 714 },
- { 4, 821 },
- { 5, 849 },
- { 2, 942 },
-};
-
UnkStruct_D_i5_801B8E50 D_i5_801B8E50[156] = {
{ 5174.4f, -2141.0f, 0.0f, 350.0f, OBJ_SCENERY_MA_TRAIN_TRACK_3 },
{ 3401.4f, -1828.0f, 0.0f, 350.0f, OBJ_SCENERY_MA_TRAIN_TRACK_3 },
@@ -6509,7 +6486,8 @@ void Macbeth_LevelComplete2(Player* player) {
Vec3f spD8;
f32 zeroVar = 0.0f;
- UpdateVisPerFrameFromRecording(gMacbethCutsceneRecord, ARRAY_COUNT(gMacbethCutsceneRecord));
+ // @Port: Vi recording
+ UpdateVisPerFrameFromRecording(gMacbethCutsceneRecord, ARRAY_COUNT(gMacbethCutsceneRecord), &gCsFrameCount);
switch (player->csState) {
case 0:
diff --git a/src/overlays/ovl_i5/fox_ti.c b/src/overlays/ovl_i5/fox_ti.c
index f484ce3b..30cf25c9 100644
--- a/src/overlays/ovl_i5/fox_ti.c
+++ b/src/overlays/ovl_i5/fox_ti.c
@@ -121,7 +121,7 @@ void Titania_Effect368_Spawn(f32 xPos, f32 yPos, f32 zPos, f32 yRot, f32 scale2)
}
void Titania_TiTerrain_Update(TiTerrain* this) {
- Ground_801B49D0(this);
+ Ground_List_Setup(this);
}
Vec3f D_i5_801B7520 = { -150.0f, 0.0f, 0.0f };
diff --git a/src/overlays/ovl_i6/fox_andross.c b/src/overlays/ovl_i6/fox_andross.c
index ba243c31..18d6cf82 100644
--- a/src/overlays/ovl_i6/fox_andross.c
+++ b/src/overlays/ovl_i6/fox_andross.c
@@ -3852,80 +3852,6 @@ f32 D_i6_801A7F4C;
f32 D_i6_801A7F50;
f32 D_i6_801A7F54;
-// clang-format off
-
-// After defeating Andross
-/*
-03 00 00 00 02 00 00 08 03 00 00 13 02 00 00 23 03 00 00 9C 02 00 00 A6 03 00 00 C1 04 00 00 C6 03 00 00 C7 04 00 00 C9
-03 00 00 CD 04 00 00 CF 03 00 00 D7 04 00 00 EA 03 00 00 EC 04 00 00 ED 03 00 00 EF 04 00 00 F4 03 00 00 F5 04 00 00 F6
-03 00 01 10 04 00 01 12 03 00 01 22 04 00 01 24 03 00 01 27 04 00 01 2D 03 00 01 2E 04 00 01 30 03 00 01 31 04 00 01 33
-03 00 01 4C 04 00 01 4E 03 00 01 4F
-*/
-Record gAndrossRobotKillCutscene1[] = {
- { 3, 0 },
- { 2, 8 },
- { 3, 19 },
- { 2, 35 },
- { 3, 156 },
- { 2, 166 },
- { 3, 193 },
- { 4, 198 },
- { 3, 199 },
- { 4, 201 },
- { 3, 205 },
- { 4, 207 },
- { 3, 215 },
- { 4, 234 },
- // { 3, 236 },
- { 4, 237 },
- { 3, 239 },
- { 4, 244 },
- // { 3, 245 },
- { 4, 246 },
- // { 3, 272 },
- { 4, 274 },
- // { 3, 290 },
- { 4, 292 },
- // { 3, 295 }, // too much?
- { 4, 301 },
- // { 3, 302 },
- { 4, 304 },
- // { 3, 305 },
- { 4, 307 },
- // { 3, 332 },
- { 4, 334 },
- // { 3, 335 },
- { 2, 339 },
-};
-
-/*
-04 00 00 00 02 00 00 01 05 00 00 02 02 00 00 03 03 00 00 2A 02 00 00 2B 03 00 00 39 02 00 00 3A 03 00 00 3F 02 00 00 45
-03 00 00 9E 04 00 00 A1 05 00 00 A3 04 00 00 B6 03 00 00 B9 04 00 00 BD 05 00 00 C1 04 00 00 CD 03 00 00 CF 02 00 00 D3
-*/
-Record gAndrossRobotKillCutscene2[] = {
- { 4, 0 },
- { 2, 1 },
- { 5, 2 },
- { 2, 3 },
- { 3, 42 },
- { 2, 43 },
- { 3, 57 },
- { 2, 58 },
- { 3, 63 },
- { 2, 69 },
- { 3, 158 },
- { 4, 161 },
- { 5, 163 },
- { 4, 182 },
- { 3, 185 },
- { 4, 189 },
- { 5, 193 },
- { 4, 205 },
- { 3, 207 },
- { 2, 211 },
-};
-// clang-format on
-
// Andross_LevelComplete
void Andross_80193C4C(Player* player) {
s32 i;
@@ -3938,10 +3864,11 @@ void Andross_80193C4C(Player* player) {
Vec3f sp68;
s32 rnd;
+ // @Port: Vi recording
if (player->csState < 3) {
- UpdateVisPerFrameFromRecording(gAndrossRobotKillCutscene1, ARRAY_COUNT(gAndrossRobotKillCutscene1));
+ UpdateVisPerFrameFromRecording(gAndrossRobotKillCutscene1, ARRAY_COUNT(gAndrossRobotKillCutscene1), &gCsFrameCount);
} else if ((player->csState > 2) && player->csState < 6) {
- UpdateVisPerFrameFromRecording(gAndrossRobotKillCutscene2, ARRAY_COUNT(gAndrossRobotKillCutscene2));
+ UpdateVisPerFrameFromRecording(gAndrossRobotKillCutscene2, ARRAY_COUNT(gAndrossRobotKillCutscene2), &gCsFrameCount);
}
Math_SmoothStepToF(D_ctx_80177A48, 1.0f, 1.0f, 0.01f, 0.0f);
diff --git a/src/overlays/ovl_i6/fox_sy.c b/src/overlays/ovl_i6/fox_sy.c
index c24562b4..f0521611 100644
--- a/src/overlays/ovl_i6/fox_sy.c
+++ b/src/overlays/ovl_i6/fox_sy.c
@@ -30,13 +30,6 @@ void SectorY_801A0510(ActorCutscene*, s32);
void SectorY_ActorDebris_Setup(Actor*, f32, f32, f32, f32, f32, f32, s32);
void SectorY_ActorDebris_Spawn(f32, f32, f32, f32, f32, f32, s32);
-// SyRobot destroy cutscene timings recorded from a real N64
-Record gSyRobotCutsceneRecord[] = {
- { 2, 0 },
- { 3, 129 },
- { 2, 230 },
-};
-
f32 D_i6_801A8440[3];
void SectorY_80197B30(ActorCutscene* this, s32 timer) {
@@ -94,6 +87,9 @@ void SectorY_SyShogun_Init(SyShogun* this) {
if (gPlayer[0].state == PLAYERSTATE_START_360) {
this->obj.pos.z = -28900.0f;
gScenery360[SHOGUN_SHIP].obj.pos.z = -30000.0f;
+
+ // @port: Fix crash with expanded draw distance.
+ gScenery360[SHOGUN_SHIP].info.dList = aSySaruzinDL;
}
this->rot_078.y = 0.0f;
@@ -2144,7 +2140,8 @@ void SectorY_LevelComplete(Player* player) {
SyShogun* boss = &gBosses[0];
f32 temp_ft1;
- UpdateVisPerFrameFromRecording(gSyRobotCutsceneRecord, ARRAY_COUNT(gSyRobotCutsceneRecord));
+ // @Port: Vi recording
+ UpdateVisPerFrameFromRecording(gSyRobotCutsceneRecord, ARRAY_COUNT(gSyRobotCutsceneRecord), &gCsFrameCount);
switch (player->csState) {
case 0: