summaryrefslogtreecommitdiff
path: root/src/engine
diff options
context:
space:
mode:
authorSonicDcer <alejandro.asenjo88@gmail.com>2025-05-25 16:47:24 -0300
committerSonicDcer <alejandro.asenjo88@gmail.com>2025-05-25 16:47:24 -0300
commit2e057c10d4fd35ad5a020922076ce59da795a49a (patch)
treef813933149d572c3815fd35f648692f41bfcb6bc /src/engine
parenta500ca7d8dde8534c5b3e6724f470fdd7d5028ae (diff)
parent8fffcdb5577a22d5ad4f761bcbdf1ad0468c3450 (diff)
Merge branch 'main' of github.com:HarbourMasters/Starship
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/fox_display.c17
-rw-r--r--src/engine/fox_effect.c21
-rw-r--r--src/engine/fox_load.c1
-rw-r--r--src/engine/fox_std_lib.c2
-rw-r--r--src/engine/fox_versus.c10
5 files changed, 46 insertions, 5 deletions
diff --git a/src/engine/fox_display.c b/src/engine/fox_display.c
index 0d6e2bad..ffbdcebe 100644
--- a/src/engine/fox_display.c
+++ b/src/engine/fox_display.c
@@ -432,6 +432,10 @@ void Display_LandmasterThrusters(Player* player) {
}
Matrix_Push(&gGfxMatrix);
+
+ // @port: Tag the transform.
+ FrameInterpolation_RecordOpenChild("Display_LandmasterThrusters_1", player->num);
+
Matrix_Translate(gGfxMatrix, 20.0f, 30.0f, -10.0f, MTXF_APPLY);
if (!gVersusMode) {
@@ -447,6 +451,10 @@ void Display_LandmasterThrusters(Player* player) {
} else {
gSPDisplayList(gMasterDisp++, D_versus_301B6E0);
}
+
+ // @port Pop the transform id.
+ FrameInterpolation_RecordCloseChild();
+
Matrix_Pop(&gGfxMatrix);
}
@@ -461,6 +469,10 @@ void Display_LandmasterThrusters(Player* player) {
}
Matrix_Push(&gGfxMatrix);
+
+ // @port: Tag the transform.
+ FrameInterpolation_RecordOpenChild("Display_LandmasterThrusters_2", player->num);
+
Matrix_Translate(gGfxMatrix, -20.0f, 30.0f, -10.0f, MTXF_APPLY);
if (!gVersusMode) {
@@ -476,8 +488,13 @@ void Display_LandmasterThrusters(Player* player) {
} else {
gSPDisplayList(gMasterDisp++, D_versus_301B6E0);
}
+
+ // @port Pop the transform id.
+ FrameInterpolation_RecordCloseChild();
+
Matrix_Pop(&gGfxMatrix);
}
+
Matrix_Pop(&gGfxMatrix);
}
diff --git a/src/engine/fox_effect.c b/src/engine/fox_effect.c
index 010d8bab..3a7665a5 100644
--- a/src/engine/fox_effect.c
+++ b/src/engine/fox_effect.c
@@ -218,6 +218,9 @@ void Effect_Effect372_Draw(Effect372* this) {
}
void Effect_Effect382_Draw(Effect382* this) {
+ // @port Skip interpolation
+ FrameInterpolation_ShouldInterpolateFrame(false);
+
RCP_SetupDL_49();
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_44);
gDPSetEnvColor(gMasterDisp++, 255, 255, 255, this->unk_44);
@@ -225,6 +228,10 @@ void Effect_Effect382_Draw(Effect382* this) {
Matrix_Translate(gGfxMatrix, 0.0f, 20.0f, 0.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_ZO_6024220);
+
+ // @port renable interpolation
+ FrameInterpolation_ShouldInterpolateFrame(true);
+
RCP_SetupDL(&gMasterDisp, SETUPDL_64);
}
@@ -746,6 +753,9 @@ void Effect_Effect357_Draw(Effect357* this) {
gSPFogPosition(gMasterDisp++, gFogNear, 1005);
}
+ // @port: Tag the transform.
+ FrameInterpolation_RecordOpenChild("Effect357", this->unk_4C | (this->index << 16) & 0x00FF);
+
Graphics_SetScaleMtx(this->scale2);
switch (gCurrentLevel) {
@@ -887,6 +897,8 @@ void Effect_Effect357_Draw(Effect357* this) {
}
break;
}
+ // @port Pop the transform id.
+ FrameInterpolation_RecordCloseChild();
RCP_SetupDL(&gMasterDisp, SETUPDL_64);
@@ -2276,11 +2288,18 @@ void Effect_Effect374_Draw(Effect374* this) {
break;
case 1:
+ // @port Skip interpolation
+ FrameInterpolation_ShouldInterpolateFrame(false);
+
Matrix_Scale(gGfxMatrix, this->scale1, this->scale2, 2.5f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
RCP_SetupDL_40();
gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK);
gSPDisplayList(gMasterDisp++, D_ENMY_PLANET_4008F70);
+
+ // @port renable interpolation
+ FrameInterpolation_ShouldInterpolateFrame(true);
+
RCP_SetupDL(&gMasterDisp, SETUPDL_64);
break;
}
@@ -3795,7 +3814,7 @@ void Effect_Effect395_Update(Effect395* this) {
D_ctx_801779A8[0] = 50.0f;
if (this->unk_46 == 10) {
gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255;
- if (CVarGetInteger("gDisableGorgonFlash", 0) == 0){
+ if (CVarGetInteger("gDisableGorgonFlash", 0) == 0) {
gFillScreenAlpha = gFillScreenAlphaTarget = 255;
}
gFillScreenAlphaTarget = 0;
diff --git a/src/engine/fox_load.c b/src/engine/fox_load.c
index f740a0e2..9ba73553 100644
--- a/src/engine/fox_load.c
+++ b/src/engine/fox_load.c
@@ -34,6 +34,7 @@ void Load_RomFile(void* vRomAddress, void* dest, ptrdiff_t size) {
u8 Load_SceneFiles(Scene* scene) {
#if 1
+ // TODO: BUG! sCurrentScene and scene never change so this will never be true.
bool hasSceneChanged = memcmp(&sCurrentScene, scene, sizeof(Scene)) != 0;
sCurrentScene = *scene;
return hasSceneChanged;
diff --git a/src/engine/fox_std_lib.c b/src/engine/fox_std_lib.c
index 47be8b2a..a8f8de36 100644
--- a/src/engine/fox_std_lib.c
+++ b/src/engine/fox_std_lib.c
@@ -42,6 +42,8 @@ void Lib_Texture_Scroll(u16* texture, s32 width, s32 height, u8 mode) {
width = newWidth;
height = newHeight;
+ scale = 1; // TODO: a higher scale causes performance issues for large textures ?
+
for(s32 i = 0; i < (s32) scale; i++){
switch (mode) {
case 0:
diff --git a/src/engine/fox_versus.c b/src/engine/fox_versus.c
index fb56a60e..2bba4e29 100644
--- a/src/engine/fox_versus.c
+++ b/src/engine/fox_versus.c
@@ -97,7 +97,7 @@ void func_versus_800BC9DC(f32 xPos, f32 yPos, f32 scale, s32 yScale) {
s32 D_800D4AB0[] = { 40, 64, 64 };
Lib_TextureRect_CI8(&gMasterDisp, D_800D4ABC[yScale], D_800D4AA4[yScale], D_800D4AB0[yScale], 40, xPos, yPos, scale,
- scale);
+ scale);
}
void func_versus_800BCB44(f32 xPos, f32 yPos, f32 scale) {
@@ -110,7 +110,7 @@ void func_versus_800BCC48(f32 xPos, f32 yPos, f32 xScale, f32 yScale, s32 arg4)
s32 D_800D4AE8[] = { 104, 152, 168, 152 };
Lib_TextureRect_CI8(&gMasterDisp, D_800D4AD8[arg4], D_800D4AC8[arg4], D_800D4AE8[arg4], 25, xPos, yPos, xScale,
- yScale);
+ yScale);
}
void func_versus_800BCE24(f32 xPos, f32 yPos, f32 xScale, f32 yScale) {
@@ -168,8 +168,7 @@ void func_versus_800BD350(f32 xPos, f32 yPos) {
}
void func_versus_800BD3A8(f32 xPos, f32 yPos) {
- Lib_TextureRect_CI4(&gMasterDisp, aVsHandicapFrameTex, aVsHandicapFrameTLUT, 80, 71, xPos, yPos, 1.0f,
- 1.0f);
+ Lib_TextureRect_CI4(&gMasterDisp, aVsHandicapFrameTex, aVsHandicapFrameTLUT, 80, 71, xPos, yPos, 1.0f, 1.0f);
}
void func_versus_800BD4D4(f32 xPos, f32 yPos, s32 arg2) {
@@ -1262,6 +1261,9 @@ s32 func_versus_800C1138(s32 max, s32 arg1) {
void Versus_InitMatch(void) {
s32 i;
+ // Until Load_SceneFiles gets fixed, this fixes most of the audio issues in versus
+ AUDIO_SET_SPEC_ALT(SFXCHAN_3, AUDIOSPEC_16);
+
for (i = 0, sVsPlayerCount = 0; i < 4; i++) {
if (!gPlayerInactive[i]) {
sVsPlayerCount++;