From faf5c506fff7dedcdb0cb760e4862bb2bc660f44 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Tue, 10 Mar 2026 13:06:50 -0300 Subject: [PATCH 01/23] Add A6Gorgon Cutscene Record from N64 Hardware & Refactor code. --- include/fox_record.h | 17 ++- src/engine/cutscene_record.c | 182 +++++++++++++++++++++++++++++ src/engine/fox_demo.c | 55 +-------- src/overlays/ovl_ending/fox_end1.c | 11 +- src/overlays/ovl_i1/fox_co.c | 37 +----- src/overlays/ovl_i2/fox_me.c | 10 +- src/overlays/ovl_i3/fox_a6.c | 8 ++ src/overlays/ovl_i5/fox_ma.c | 26 +---- src/overlays/ovl_i6/fox_andross.c | 79 +------------ src/overlays/ovl_i6/fox_sy.c | 10 +- 10 files changed, 221 insertions(+), 214 deletions(-) create mode 100644 src/engine/cutscene_record.c diff --git a/include/fox_record.h b/include/fox_record.h index 531b6c42..6077c6bd 100644 --- a/include/fox_record.h +++ b/include/fox_record.h @@ -1,6 +1,6 @@ /** * Used to reproduce recordings made from real N64 hardware - * to accurately reproduce Cutscenes at the correct speed. + * to accurately play cutscenes at the correct speed. * These recordings adjust gVisPerFrame during runtime to produce * the same behaviour as the original game. */ @@ -15,8 +15,19 @@ typedef struct Record { } Record; extern Record gCarrierCutsceneRecord[13]; +extern Record gWarpzoneCsRecord[19]; +extern Record gA6GorgonCsRecord[12]; +extern Record gSyRobotCutsceneRecord[3]; +extern Record gAndrossRobotKillCutscene2[20]; +extern Record gAndrossRobotKillCutscene1[25]; +extern Record gMacbethCutsceneRecord[14]; +extern Record gGrangaCutsceneRecord[13]; +extern Record gMeCrusherCutsceneRecord[3]; +extern Record gEndingCsRecord[37]; -void UpdateVisPerFrameFromRecording(Record* record, s32 maxFrames); -void UpdateVisPerFrameFromRecording_Ending(Record* record, s32 maxFrames); +extern int gA6GorgonCsFrameCount; +extern int gWarpzoneCsFrameCount; + +void UpdateVisPerFrameFromRecording(Record* record, s32 maxFrames, int* frameCounter); #endif diff --git a/src/engine/cutscene_record.c b/src/engine/cutscene_record.c new file mode 100644 index 00000000..611c2bbe --- /dev/null +++ b/src/engine/cutscene_record.c @@ -0,0 +1,182 @@ +#include "global.h" +#include "fox_record.h" + +void UpdateVisPerFrameFromRecording(Record* record, s32 maxFrames, int* frameCounter) { + int i; + + if (*frameCounter > record[maxFrames - 1].frame) { + return; + } + + for (i = 0; i < maxFrames; i++) { + if (*frameCounter == record[i].frame) { + gVIsPerFrame = record[i].vis; + } + } +} + +int gWarpzoneCsFrameCount = 0; +int gA6GorgonCsFrameCount = 0; + +Record gWarpzoneCsRecord[19] = { + { 2, 1 }, { 3, 3 }, { 4, 4 }, { 3, 8 }, { 2, 9 }, { 3, 52 }, { 2, 54 }, { 3, 69 }, { 2, 70 }, { 3, 75 }, + { 2, 76 }, { 3, 79 }, { 2, 117 }, { 3, 118 }, { 2, 120 }, { 3, 145 }, { 2, 215 }, { 3, 216 }, { 2, 230 }, +}; + +Record gA6GorgonCsRecord[12] = { + { 3, 0 }, { 4, 3 }, { 5, 6 }, { 4, 37 }, { 5, 38 }, { 4, 44 }, + { 3, 53 }, { 4, 54 }, { 3, 57 }, { 4, 58 }, { 3, 59 }, { 2, 170 }, +}; + +Record gEndingCsRecord[37] = { + { 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 }, +}; + +// MeCrusher destroy cutscene timings recorded from a real N64 +Record gMeCrusherCutsceneRecord[3] = { + { 2, 0 }, + { 3, 200 }, + { 2, 224 }, +}; + +// Carrier destroy cutscene timings recorded from a real N64 +Record gCarrierCutsceneRecord[13] = { + { 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[13] = { + { 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 }, +}; + +// Train cutscene timings recorded from a real N64 +Record gMacbethCutsceneRecord[14] = { + // 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 }, +}; + +// 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[25] = { + { 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[20] = { + { 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 + +// SyRobot destroy cutscene timings recorded from a real N64 +Record gSyRobotCutsceneRecord[3] = { + { 2, 0 }, + { 3, 129 }, + { 2, 230 }, +}; diff --git a/src/engine/fox_demo.c b/src/engine/fox_demo.c index 8b243ca6..ce091ef0 100644 --- a/src/engine/fox_demo.c +++ b/src/engine/fox_demo.c @@ -22,55 +22,6 @@ #include "fox_co.h" #include "fox_record.h" -int gWarpzoneCsFrameCount = 0; - -Record gWarpzoneCsRecord[] = { - { 2, 1 }, { 3, 3 }, { 4, 4 }, { 3, 8 }, { 2, 9 }, { 3, 52 }, { 2, 54 }, { 3, 69 }, { 2, 70 }, { 3, 75 }, - { 2, 76 }, { 3, 79 }, { 2, 117 }, { 3, 118 }, { 2, 120 }, { 3, 145 }, { 2, 215 }, { 3, 216 }, { 2, 230 }, -}; - -void UpdateVisPerFrameFromRecording(Record* record, s32 maxFrames) { - int i; - - if (gCsFrameCount > record[maxFrames - 1].frame) { - return; - } - - for (i = 0; i < maxFrames; i++) { - if (gCsFrameCount == record[i].frame) { - gVIsPerFrame = record[i].vis; - } - } -} - -void UpdateVisPerFrameFromRecording_Warpzone(Record* record, s32 maxFrames) { - int i; - - if (gWarpzoneCsFrameCount > record[maxFrames - 1].frame) { - return; - } - - for (i = 0; i < maxFrames; i++) { - if (gWarpzoneCsFrameCount == record[i].frame) { - gVIsPerFrame = record[i].vis; - } - } -} - -void UpdateVisPerFrameFromRecording_Ending(Record* record, s32 maxFrames) { - int i; - - if (gGameFrameCount > record[maxFrames - 1].frame) { - return; - } - - for (i = 0; i < maxFrames; i++) { - if (gGameFrameCount == record[i].frame) { - gVIsPerFrame = record[i].vis; - } - } -} - void func_demo_80048AC0(TeamId teamId) { s32 teamShield; @@ -448,8 +399,9 @@ void Cutscene_EnterWarpZone(Player* player) { s32 var_v0; s32 pad[4]; + // @Port: Vi recording gWarpzoneCsFrameCount++; - UpdateVisPerFrameFromRecording_Warpzone(gWarpzoneCsRecord, ARRAY_COUNT(gWarpzoneCsRecord)); + UpdateVisPerFrameFromRecording(gWarpzoneCsRecord, ARRAY_COUNT(gWarpzoneCsRecord), &gWarpzoneCsFrameCount); player->pos.x += player->vel.x; player->flags_228 = 0; @@ -982,7 +934,8 @@ void Cutscene_CoComplete2(Player* player) { Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 5.0f, 0.01f); - UpdateVisPerFrameFromRecording(gCarrierCutsceneRecord, ARRAY_COUNT(gCarrierCutsceneRecord)); + // @Port: Vi recording + UpdateVisPerFrameFromRecording(gCarrierCutsceneRecord, ARRAY_COUNT(gCarrierCutsceneRecord), &gCsFrameCount); switch (player->csState) { case 10: 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..e8bbbea7 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]; @@ -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_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_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..702f1181 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) { @@ -2144,7 +2137,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: From 00cde39873277cb34d4eef96c4c5e928d2e7748d Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Wed, 11 Mar 2026 13:31:17 -0300 Subject: [PATCH 02/23] Selectable Radio Comm Box position --- src/engine/fox_hud.c | 91 ++++++++++++++++++++++------------ src/engine/fox_radio.c | 107 +++++++++++++++++++++++++++------------- src/port/ui/ImguiUI.cpp | 19 +++++++ 3 files changed, 153 insertions(+), 64 deletions(-) diff --git a/src/engine/fox_hud.c b/src/engine/fox_hud.c index bbf8de24..363f7555 100644 --- a/src/engine/fox_hud.c +++ b/src/engine/fox_hud.c @@ -210,22 +210,35 @@ void HUD_TeamDownWrench_Draw(s32 arg0) { } } } else { - f32 x = 48.0f; - f32 y = 0.0f; - HUD_MatrixTranslateCoordLeft(&x, &y); - y = -81.0f; - Lib_InitOrtho(&gMasterDisp); - Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x, y, -600.0f, MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, M_PI / 4, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, 0.31f, 0.31f, 1.0f, MTXF_APPLY); - Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, aDownWrenchDL); - Matrix_RotateZ(gGfxMatrix, 3 * M_PI / 2, MTXF_APPLY); - Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, aDownWrenchDL); - Matrix_Pop(&gGfxMatrix); - Lib_InitPerspective(&gMasterDisp); + if (CVarGetInteger("gRadioCommBox.expand", 0) == 1) { + f32 x = 48.0f; + f32 y = 0.0f; + HUD_MatrixTranslateCoordLeft(&x, &y); + y = -81.0f; + Lib_InitOrtho(&gMasterDisp); + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, x, y, -600.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_PI / 4, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.31f, 0.31f, 1.0f, MTXF_APPLY); + Matrix_SetGfxMtx(&gMasterDisp); + gSPDisplayList(gMasterDisp++, aDownWrenchDL); + Matrix_RotateZ(gGfxMatrix, 3 * M_PI / 2, MTXF_APPLY); + Matrix_SetGfxMtx(&gMasterDisp); + gSPDisplayList(gMasterDisp++, aDownWrenchDL); + Matrix_Pop(&gGfxMatrix); + Lib_InitPerspective(&gMasterDisp); + } else { + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, -234.0f, -167.0f, -600.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_PI / 4, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.68f, 0.68f, 1.0f, MTXF_APPLY); + Matrix_SetGfxMtx(&gMasterDisp); + gSPDisplayList(gMasterDisp++, aDownWrenchDL); + Matrix_RotateZ(gGfxMatrix, 3 * M_PI / 2, MTXF_APPLY); + Matrix_SetGfxMtx(&gMasterDisp); + gSPDisplayList(gMasterDisp++, aDownWrenchDL); + Matrix_Pop(&gGfxMatrix); + } } } @@ -2262,7 +2275,12 @@ void HUD_RadioCharacterName_Draw(void) { RCP_SetupDL(&gMasterDisp, SETUPDL_76_OPTIONAL); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); - f32 xPos = OTRGetRectDimensionFromLeftEdgeOverride(73.0f); + f32 xPos; + if (CVarGetInteger("gRadioCommBox.expand", 0) == 1) { + xPos = OTRGetRectDimensionFromLeftEdgeOverride(73.0f); + } else { + xPos = 73.0f; + } switch ((s32) gRadioMsgRadioId) { case RCID_FOX: @@ -2635,20 +2653,31 @@ void HUD_RadioDamage_Draw(void) { } if ((D_80161788 != 0) || (D_8016178C != 0)) { - RCP_SetupDL(&gMasterDisp, SETUPDL_12); - gDPSetPrimColor(gMasterDisp++, 0, 0, r, g, b, alpha); - f32 x = 48.0f; - f32 y = 0.0f; - HUD_MatrixTranslateCoordLeft(&x, &y); - y = -81.0f; - Lib_InitOrtho(&gMasterDisp); - Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x, y, -139.4f, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, 2.25f, 2.25f, 2.25f, MTXF_APPLY); - Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, sRadioDamageDL); - Matrix_Pop(&gGfxMatrix); - Lib_InitPerspective(&gMasterDisp); + if (CVarGetInteger("gRadioCommBox.expand", 0) == 1) { + RCP_SetupDL(&gMasterDisp, SETUPDL_12); + gDPSetPrimColor(gMasterDisp++, 0, 0, r, g, b, alpha); + f32 x = 48.0f; + f32 y = 0.0f; + HUD_MatrixTranslateCoordLeft(&x, &y); + y = -81.0f; + Lib_InitOrtho(&gMasterDisp); + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, x, y, -139.4f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 2.25f, 2.25f, 2.25f, MTXF_APPLY); + Matrix_SetGfxMtx(&gMasterDisp); + gSPDisplayList(gMasterDisp++, sRadioDamageDL); + Matrix_Pop(&gGfxMatrix); + Lib_InitPerspective(&gMasterDisp); + } else { + RCP_SetupDL(&gMasterDisp, SETUPDL_12); + gDPSetPrimColor(gMasterDisp++, 0, 0, r, g, b, alpha); + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, -53.9f, -38.5f, -139.4f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, MTXF_APPLY); + Matrix_SetGfxMtx(&gMasterDisp); + gSPDisplayList(gMasterDisp++, sRadioDamageDL); + Matrix_Pop(&gGfxMatrix); + } } } diff --git a/src/engine/fox_radio.c b/src/engine/fox_radio.c index 365b98b3..e60f80c1 100644 --- a/src/engine/fox_radio.c +++ b/src/engine/fox_radio.c @@ -130,36 +130,61 @@ void Radio_PlayMessage(u16* msg, RadioCharacterId character) { } void Radio_CalculatePositions() { - switch (gGameState) { - case GSTATE_TITLE: - gRadioPrintPosY = 176; - gRadioPrintPosX = OTRGetRectDimensionFromLeftEdgeOverride(85.0f); - gRadioTextBoxPosX = OTRGetRectDimensionFromLeftEdgeOverride(80.0f); - gRadioTextBoxPosY = 174.0f; - gRadioTextBoxScaleX = 4.63f; - gRadioPortraitPosX = OTRGetRectDimensionFromLeftEdgeOverride(32.0f); - gRadioPortraitPosY = 174.0f; - break; + if (CVarGetInteger("gRadioCommBox.expand", 0) == 1) { + switch (gGameState) { + case GSTATE_TITLE: + gRadioPrintPosY = 176; + gRadioPrintPosX = OTRGetRectDimensionFromLeftEdgeOverride(85.0f); + gRadioTextBoxPosX = OTRGetRectDimensionFromLeftEdgeOverride(80.0f); + gRadioTextBoxPosY = 174.0f; + gRadioTextBoxScaleX = 4.63f; + gRadioPortraitPosX = OTRGetRectDimensionFromLeftEdgeOverride(32.0f); + gRadioPortraitPosY = 174.0f; + break; - case GSTATE_ENDING: - gRadioPrintPosY = 176; - gRadioPrintPosX = 85.0f; - gRadioTextBoxPosX = 80.0f; - gRadioTextBoxPosY = 174.0f; - gRadioTextBoxScaleX = 4.63f; - gRadioPortraitPosX = 32.0f; - gRadioPortraitPosY = 174.0f; - break; + case GSTATE_ENDING: + gRadioPrintPosY = 176; + gRadioPrintPosX = 85.0f; + gRadioTextBoxPosX = 80.0f; + gRadioTextBoxPosY = 174.0f; + gRadioTextBoxScaleX = 4.63f; + gRadioPortraitPosX = 32.0f; + gRadioPortraitPosY = 174.0f; + break; - case GSTATE_PLAY: - gRadioPrintPosY = 180; - gRadioPrintPosX = OTRGetRectDimensionFromLeftEdgeOverride(79.0f); - gRadioTextBoxPosX = OTRGetRectDimensionFromLeftEdgeOverride(74.0f); - gRadioTextBoxPosY = 178.0f; - gRadioTextBoxScaleX = 4.53f; - gRadioPortraitPosX = OTRGetRectDimensionFromLeftEdgeOverride(26.0f); - gRadioPortraitPosY = 178.0f; - break; + case GSTATE_PLAY: + gRadioPrintPosY = 180; + gRadioPrintPosX = OTRGetRectDimensionFromLeftEdgeOverride(79.0f); + gRadioTextBoxPosX = OTRGetRectDimensionFromLeftEdgeOverride(74.0f); + gRadioTextBoxPosY = 178.0f; + gRadioTextBoxScaleX = 4.53f; + gRadioPortraitPosX = OTRGetRectDimensionFromLeftEdgeOverride(26.0f); + gRadioPortraitPosY = 178.0f; + break; + } + } else { + switch (gGameState) { + case GSTATE_TITLE: + case GSTATE_ENDING: + gRadioPrintPosY = 176; + gRadioPrintPosX = 85; + gRadioTextBoxPosX = 80.0f; + gRadioTextBoxPosY = 174.0f; + gRadioTextBoxScaleX = 4.63f; + gRadioPortraitPosX = 32.0f; + gRadioPortraitPosY = 174.0f; + break; + + case GSTATE_PLAY: + gRadioPrintPosY = 180; + gRadioPrintPosX = 79; + gRadioTextBoxPosX = 74.0f; + gRadioTextBoxPosY = 178.0f; + gRadioTextBoxScaleX = 4.53f; + gRadioPortraitPosX = 26.0f; + gRadioPortraitPosY = 178.0f; + break; + } } } @@ -718,12 +743,20 @@ void Radio_Draw(void) { (gCurrentRadioPortrait != RCID_1000)) { RCP_SetupDL(&gMasterDisp, SETUPDL_76_OPTIONAL); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255); - Graphics_DisplaySmallText(OTRGetRectDimensionFromLeftEdgeOverride(31.0f), 167, 1.0f, 1.0f, "DOWN"); + if (CVarGetInteger("gRadioCommBox.expand", 0) == 1) { + Graphics_DisplaySmallText(OTRGetRectDimensionFromLeftEdgeOverride(31.0f), 167, 1.0f, 1.0f, "DOWN"); + } else { + Graphics_DisplaySmallText(31, 167, 1.0f, 1.0f, "DOWN"); + } HUD_TeamDownWrench_Draw(1); } if (((gCurrentRadioPortrait != RCID_STATIC) && (gCurrentRadioPortrait != RCID_STATIC + 1)) && (gCurrentRadioPortrait != RCID_1000)) { - HUD_TeamShields_Draw(OTRGetRectDimensionFromLeftEdgeOverride(22.0f), 165.0f, gTeamShields[idx]); + if (CVarGetInteger("gRadioCommBox.expand", 0) == 1) { + HUD_TeamShields_Draw(OTRGetRectDimensionFromLeftEdgeOverride(22.0f), 165.0f, gTeamShields[idx]); + } else { + HUD_TeamShields_Draw(22.0f, 165.0f, gTeamShields[idx]); + } } } @@ -767,12 +800,20 @@ void Radio_Draw(void) { (gCurrentRadioPortrait != RCID_STATIC + 1) && (gCurrentRadioPortrait != RCID_1000)) { RCP_SetupDL(&gMasterDisp, SETUPDL_76_OPTIONAL); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255); - Graphics_DisplaySmallText(OTRGetRectDimensionFromLeftEdgeOverride(31.0f), 167, 1.0f, 1.0f, "DOWN"); + if (CVarGetInteger("gRadioCommBox.expand", 0) == 1) { + Graphics_DisplaySmallText(OTRGetRectDimensionFromLeftEdgeOverride(31.0f), 167, 1.0f, 1.0f, "DOWN"); + } else { + Graphics_DisplaySmallText(31.0f, 167, 1.0f, 1.0f, "DOWN"); + } } if (((gCurrentRadioPortrait != RCID_STATIC) && (gCurrentRadioPortrait != RCID_STATIC + 1)) && (gCurrentRadioPortrait != RCID_1000)) { - HUD_TeamShields_Draw(OTRGetRectDimensionFromLeftEdgeOverride(22.0f), 165.0f, - gActors[idx].health * 2.55f); + if (CVarGetInteger("gRadioCommBox.expand", 0) == 1) { + HUD_TeamShields_Draw(OTRGetRectDimensionFromLeftEdgeOverride(22.0f), 165.0f, + gActors[idx].health * 2.55f); + } else { + HUD_TeamShields_Draw(22.0f, 165.0f, gActors[idx].health * 2.55f); + } } } if (((gCurrentRadioPortrait != RCID_STATIC) && (gCurrentRadioPortrait != RCID_STATIC + 1)) && diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp index 67dfb7e1..b9bc2c32 100644 --- a/src/port/ui/ImguiUI.cpp +++ b/src/port/ui/ImguiUI.cpp @@ -570,6 +570,10 @@ static const char* hudAspects[] = { "Expand", "Custom", "Original (4:3)", "Widescreen (16:9)", "Nintendo 3DS (5:3)", "16:10 (8:5)", "Ultrawide (21:9)" }; +static const char* radioCommBox[] = { + "Original", "Expand" +}; + void DrawEnhancementsMenu() { if (UIWidgets::BeginMenu("Enhancements")) { @@ -622,6 +626,21 @@ void DrawEnhancementsMenu() { } if (UIWidgets::BeginMenu("HUD")) { + if (UIWidgets::CVarCombobox("Radio Communication Box", "gRadioCommBox.Selection", radioCommBox, + { + .tooltip = "Which Aspect Ratio to use when drawing the Radio Communication Box", + .defaultIndex = 0, + })) { + switch (CVarGetInteger("gRadioCommBox.Selection", 0)) { + case 0: + CVarSetInteger("gRadioCommBox.expand", 0); + break; + case 1: + CVarSetInteger("gRadioCommBox.expand", 1); + break; + } + } + if (UIWidgets::CVarCombobox("HUD Aspect Ratio", "gHUDAspectRatio.Selection", hudAspects, { .tooltip = "Which Aspect Ratio to use when drawing the HUD (Radar, gauges and radio messages)", From 47831f54ae2dbc274252aa556f4b1fa4b9731d65 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Thu, 12 Mar 2026 19:44:03 -0300 Subject: [PATCH 03/23] Refactor Interpolation System --- include/functions.h | 2 +- src/engine/fox_beam.c | 10 +- src/engine/fox_bg.c | 25 ++-- src/engine/fox_display.c | 109 ++++++++------- src/engine/fox_edisplay.c | 34 +++-- src/engine/fox_effect.c | 3 +- src/engine/fox_play.c | 2 +- src/overlays/ovl_i5/fox_ground.c | 224 +++++++++++++++++-------------- src/overlays/ovl_i5/fox_ti.c | 2 +- 9 files changed, 225 insertions(+), 186 deletions(-) diff --git a/include/functions.h b/include/functions.h index a7217af0..b224066d 100644 --- a/include/functions.h +++ b/include/functions.h @@ -505,7 +505,7 @@ void Ending_Main(void); void Ending_Draw(void); // sf_i5_5 -bool Ground_801B49D0(Actor* actor); +bool Ground_List_Setup(Actor* actor); // libultra void gSPSegmentLoadRes(void* value, int segNum, uintptr_t target); diff --git a/src/engine/fox_beam.c b/src/engine/fox_beam.c index ae19d6f7..4006d4dc 100644 --- a/src/engine/fox_beam.c +++ b/src/engine/fox_beam.c @@ -1067,6 +1067,8 @@ void PlayerShot_DrawHitmark(PlayerShot* shot) { return; } } else { + FrameInterpolation_RecordOpenChild(shot, 1); + shot->obj.rot.y = -gPlayer[gPlayerNum].camYaw; Matrix_RotateY(gGfxMatrix, shot->obj.rot.y, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); @@ -1088,6 +1090,8 @@ void PlayerShot_DrawHitmark(PlayerShot* shot) { gSPDisplayList(gMasterDisp++, D_1025800); break; } + + FrameInterpolation_RecordCloseChild(); } } @@ -1249,6 +1253,8 @@ void PlayerShot_DrawShot(PlayerShot* shot) { Object_Kill(&shot->obj, shot->sfxSource); } } else { + FrameInterpolation_RecordOpenChild(shot, 0); + if ((shot->obj.id == PLAYERSHOT_TANK) || (shot->obj.id == PLAYERSHOT_ON_FOOT) || (shot->obj.id == PLAYERSHOT_7)) { shot->obj.rot.y = RAD_TO_DEG(-gPlayer[gPlayerNum].camYaw); @@ -1512,12 +1518,11 @@ void PlayerShot_DrawShot(PlayerShot* shot) { gSPDisplayList(gMasterDisp++, D_GREAT_FOX_E00DFB0); break; } + FrameInterpolation_RecordCloseChild(); } } void PlayerShot_Draw(PlayerShot* shot) { - FrameInterpolation_RecordOpenChild(shot, 0); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); switch (shot->obj.status) { case SHOT_ACTIVE: PlayerShot_DrawShot(shot); @@ -1526,7 +1531,6 @@ void PlayerShot_Draw(PlayerShot* shot) { PlayerShot_DrawHitmark(shot); break; } - FrameInterpolation_RecordCloseChild(); } void PlayerShot_UpdateHitmark(PlayerShot* shot) { diff --git a/src/engine/fox_bg.c b/src/engine/fox_bg.c index 9cdb5f07..06f83608 100644 --- a/src/engine/fox_bg.c +++ b/src/engine/fox_bg.c @@ -308,7 +308,6 @@ void Background_DrawStarfield(void) { FrameInterpolation_ShouldInterpolateFrame(false); } else { FrameInterpolation_RecordOpenChild("Starfield", i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); } // Translate to (vx, vy) in ortho coordinates @@ -442,9 +441,8 @@ void Background_DrawPartialStarfield(s32 yMin, s32 yMax) { // Stars that are in // Check if the star is within the visible screen area if ((vx >= 0) && (vx < currentScreenWidth) && (yMin < vy) && (vy < yMax)) { - // Tag the transform. Assuming TAG_STARFIELD is a defined base tag value - FrameInterpolation_RecordOpenChild("SmallStarfield", i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + + FrameInterpolation_RecordOpenChild("PartialStarfield", i); // Translate to (vx, vy) in ortho coordinates Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, vx - (currentScreenWidth / 2.0f), -(vy - (currentScreenHeight / 2.0f)), 0.0f, @@ -551,7 +549,6 @@ void Background_DrawBackdrop(void) { } else { // @port: Tag the transform. FrameInterpolation_RecordOpenChild("Backdrop", i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); } switch (gCurrentLevel) { @@ -627,7 +624,6 @@ void Background_DrawBackdrop(void) { } else { // @port: Tag the transform. FrameInterpolation_RecordOpenChild("Backdrop", i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); } switch ((s32) gCurrentLevel) { @@ -669,7 +665,6 @@ void Background_DrawBackdrop(void) { } else { // @port: Tag the transform. FrameInterpolation_RecordOpenChild("Backdrop", 0); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); } if ((gDrawBackdrop == 2) || (gDrawBackdrop == 7)) { @@ -771,7 +766,6 @@ void Background_DrawBackdrop(void) { // Render the textures across the screen (left to right) for (int i = 0; i < 5; i++) { FrameInterpolation_RecordOpenChild("Backdrop", i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); if (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) { gSPDisplayList(gMasterDisp++, D_AQ_601AFF0); } else { @@ -839,7 +833,6 @@ void Background_DrawBackdrop(void) { } else { // @port: Tag the transform. FrameInterpolation_RecordOpenChild("Backdrop", i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); } if (gCurrentLevel == LEVEL_TITANIA) { @@ -1139,12 +1132,16 @@ void Background_DrawSun(void) { sunScale = sKaSunScales; } for (i = 0; i < 5; i++, sunColor++, sunAlpha++, sunDL++, sunScale++) { + FrameInterpolation_RecordOpenChild("Sun", i); + Matrix_Push(&gGfxMatrix); Matrix_Scale(gGfxMatrix, *sunScale, *sunScale, *sunScale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, sunColor->r, sunColor->g, sunColor->b, *sunAlpha); gSPDisplayList(gMasterDisp++, *sunDL); Matrix_Pop(&gGfxMatrix); + + FrameInterpolation_RecordCloseChild(); } Matrix_Pop(&gGfxMatrix); } @@ -1265,7 +1262,7 @@ void AllRangeGround_Draw(void) { // LOWER RIGHT QUADRANT if (gPlayer[0].pos.x > maxDistX && gPlayer[0].pos.z > maxDistZ) { // lower right corner piece : 4 - // // lower middle left piece : 5 + // lower middle left piece : 5 // lower middle right piece : 6 // side upper right piece: 14 // side lower right piece : 15 @@ -1274,11 +1271,11 @@ void AllRangeGround_Draw(void) { } } - Matrix_Push(&gGfxMatrix); - // @port: Tag the transform. FrameInterpolation_RecordOpenChild("360Ground", i); + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, sGroundPositions360x_FIX[i], 0.0f, sGroundPositions360z_FIX[i], MTXF_APPLY); if (gCurrentLevel == LEVEL_TRAINING) { @@ -1394,6 +1391,8 @@ void Background_DrawGround(void) { #endif } + FrameInterpolation_RecordOpenChild("Ground", 0); + Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, gPlayer[gPlayerNum].xPath, -3.0f + gCameraShakeY, sp1D4, MTXF_APPLY); @@ -2255,6 +2254,8 @@ void Background_DrawGround(void) { break; } Matrix_Pop(&gGfxMatrix); + + FrameInterpolation_RecordCloseChild(); } // Unused. Early water implementation in Aquas? diff --git a/src/engine/fox_display.c b/src/engine/fox_display.c index 8351cd54..1434d68a 100644 --- a/src/engine/fox_display.c +++ b/src/engine/fox_display.c @@ -271,11 +271,11 @@ void Display_OnFootFalco_PostLimbDraw(s32 limbIndex, Vec3f* rot, void* data) { } void Display_OnFootMuzzleFlash(Player* player) { - Matrix_Push(&gGfxMatrix); - // @port: Tag the transform. FrameInterpolation_RecordOpenChild("Display_OnFootMuzzleFlash", player->num); + Matrix_Push(&gGfxMatrix); + Matrix_Copy(gGfxMatrix, &gIdentityMatrix); if ((player->state == PLAYERSTATE_ACTIVE) && (player->csTimer != 0)) { Matrix_Translate(gGfxMatrix, D_display_801613B0[player->num].x, D_display_801613B0[player->num].y, @@ -325,6 +325,8 @@ void Display_Landmaster(Player* player) { Vec3f sp4C = { 0.0f, 0.0f, 90.0f }; Vec3f sp40 = { 0.0f, 40.0f, -70.0f }; + FrameInterpolation_RecordOpenChild("Landmaster", player->num); + Matrix_Push(&gGfxMatrix); if (!gVersusMode) { @@ -364,6 +366,8 @@ void Display_Landmaster(Player* player) { Matrix_MultVec3f(gGfxMatrix, &sp4C, &D_display_80161548[player->num]); Matrix_Pop(&gGfxMatrix); + + FrameInterpolation_RecordCloseChild(); } Gfx* sFaceDL[] = { aAwFoxHeadDL, aAwFalcoHeadDL, aAwSlippyHeadDL, aAwPeppyHeadDL }; @@ -375,11 +379,11 @@ f32 sReticleScales[] = { 0.0f, 0.0f, 0.0f, 0.0f }; f32 sPlayerShadowing = 0.0f; void Display_LandmasterMuzzleFlash(Player* player) { - Matrix_Push(&gGfxMatrix); - // @port: Tag the transform. FrameInterpolation_RecordOpenChild("Display_LandmasterMuzzleFlash", player->num); + Matrix_Push(&gGfxMatrix); + if ((player->state == PLAYERSTATE_ACTIVE) && (player->unk_1A0 != 0)) { Matrix_Translate(gGfxMatrix, D_display_80161548[player->num].x, D_display_80161548[player->num].y, D_display_80161548[player->num].z, MTXF_APPLY); @@ -431,11 +435,11 @@ void Display_LandmasterThrusters(Player* player) { sp2C *= 1.1f; } - Matrix_Push(&gGfxMatrix); - // @port: Tag the transform. FrameInterpolation_RecordOpenChild("Display_LandmasterThrusters_1", player->num); + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, 20.0f, 30.0f, -10.0f, MTXF_APPLY); if (!gVersusMode) { @@ -468,11 +472,11 @@ void Display_LandmasterThrusters(Player* player) { sp2C *= 1.1f; } - Matrix_Push(&gGfxMatrix); - // @port: Tag the transform. FrameInterpolation_RecordOpenChild("Display_LandmasterThrusters_2", player->num); + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, -20.0f, 30.0f, -10.0f, MTXF_APPLY); if (!gVersusMode) { @@ -697,10 +701,11 @@ void Display_ArwingWings(ArwingInfo* arwing) { } gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); - Matrix_Pop(&gGfxMatrix); // @port Pop the transform id. FrameInterpolation_RecordCloseChild(); + + Matrix_Pop(&gGfxMatrix); } void Display_Unused(f32 arg0, f32 arg1, UNK_TYPE arg2, UNK_TYPE arg3) { @@ -708,11 +713,11 @@ void Display_Unused(f32 arg0, f32 arg1, UNK_TYPE arg2, UNK_TYPE arg3) { } void Display_CockpitGlass(void) { - Matrix_Push(&gGfxMatrix); - // @port: Tag the transform. FrameInterpolation_RecordOpenChild("Display_CockpitGlass", 0); + Matrix_Push(&gGfxMatrix); + Matrix_Copy(gGfxMatrix, &D_display_80161418[0]); Matrix_Translate(gGfxMatrix, 0.0f, D_display_800CA290, D_display_800CA294, MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_display_800CA28C, D_display_800CA28C, D_display_800CA28C, MTXF_APPLY); @@ -793,10 +798,10 @@ void Display_Reticle(Player* player) { (((gGameState == GSTATE_PLAY) && (player->state == PLAYERSTATE_ACTIVE)) || (gGameState == GSTATE_MENU))) { for (i = 0; i < 2; i++) { FrameInterpolation_RecordOpenChild("Reticle", (player->num << 16) + i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); translate = &D_display_801613E0[i]; Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, translate->x, translate->y, translate->z, MTXF_APPLY); + if (gChargeTimers[player->num] >= 20) { RCP_SetupDL(&gMasterDisp, SETUPDL_63_OPTIONAL); if (i == 1) { @@ -815,6 +820,7 @@ void Display_Reticle(Player* player) { Matrix_Scale(gGfxMatrix, sReticleScales[player->num], sReticleScales[player->num], 1.0f, MTXF_APPLY); Math_SmoothStepToF(&sReticleScales[player->num], 1.0f, 1.0f, 0.2f, 0.0f); } + Matrix_Scale(gGfxMatrix, 4.0f, 4.0f, 4.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024F60); @@ -856,6 +862,8 @@ void Display_PlayerShadow_Draw(Player* player) { player->shadowing = 180; } + FrameInterpolation_RecordOpenChild("PlayerShadow", player->num); + switch (player->form) { case FORM_ARWING: fake_label: @@ -895,6 +903,8 @@ void Display_PlayerShadow_Draw(Player* player) { Matrix_Pop(&gGfxMatrix); break; } + + FrameInterpolation_RecordCloseChild(); } void Display_DrawEngineGlow(EngineGlowColor color) { @@ -921,6 +931,9 @@ void Display_DrawEngineGlow(EngineGlowColor color) { void Display_LandmasterEngineGlow_Draw(Player* player) { RCP_SetupDL_64(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 100); + + FrameInterpolation_RecordOpenChild("LandmasterEngineGlow", player->num); + Matrix_Push(&gGfxMatrix); Matrix_RotateZ(gGfxMatrix, player->bankAngle * M_DTOR, MTXF_APPLY); if (player->form == FORM_LANDMASTER) { @@ -941,6 +954,8 @@ void Display_LandmasterEngineGlow_Draw(Player* player) { Matrix_SetGfxMtx(&gMasterDisp); Display_DrawEngineGlow(gLevelType); Matrix_Pop(&gGfxMatrix); + + FrameInterpolation_RecordCloseChild(); } void Display_BarrelRollShield(Player* player) { @@ -970,10 +985,10 @@ void Display_BarrelRollShield(Player* player) { zRotDirection = -1.0f; } - Matrix_Push(&gGfxMatrix); - // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("BarrelRollShield", 0); + FrameInterpolation_RecordOpenChild("BarrelRollShield", player->num); + + Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, player->pos.x + dest.x, player->pos.y + dest.y, player->trueZpos + player->zPath + dest.z, MTXF_APPLY); @@ -1005,10 +1020,10 @@ void Display_BarrelRollShield(Player* player) { void Display_UnusedShield(Player* player) { if (gShieldAlpha[player->num] > 1.0f) { - Matrix_Push(&gGfxMatrix); - // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("Display_UnusedShield", 0); + FrameInterpolation_RecordOpenChild("Display_UnusedShield", player->num); + + Matrix_Push(&gGfxMatrix); Matrix_Copy(gGfxMatrix, &D_display_80161418[player->num]); Matrix_Translate(gGfxMatrix, 0.0f, -5.0f, 10.0f, MTXF_APPLY); @@ -1046,12 +1061,16 @@ void Display_ArwingLaserCharge(Player* player) { Matrix_MultVec3f(gCalcMatrix, &spC4, &sp94); } + Matrix_Push(&gGfxMatrix); - + sp80 = gChargeTimers[player->num] / 20.0f; - + Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, MTXF_NEW); Matrix_Scale(gGfxMatrix, sp80, sp80, 1.0f, MTXF_APPLY); + + FrameInterpolation_RecordOpenChild("ArwingLaserCharge", player->num); + Matrix_Push(&gGfxMatrix); if (player->alternateView && (gLevelMode == LEVELMODE_ON_RAILS)) { @@ -1089,6 +1108,10 @@ void Display_ArwingLaserCharge(Player* player) { gSPDisplayList(gMasterDisp++, aStarDL); Matrix_Pop(&gGfxMatrix); + FrameInterpolation_RecordCloseChild(); + + FrameInterpolation_RecordOpenChild("ArwingLaserCharge2", player->num); + if (player->alternateView && (gLevelMode == LEVELMODE_ON_RAILS)) { Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 0.3f, MTXF_APPLY); } @@ -1103,6 +1126,8 @@ void Display_ArwingLaserCharge(Player* player) { Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, aOrbDL); Matrix_Pop(&gGfxMatrix); + + FrameInterpolation_RecordCloseChild(); } if (gMuzzleFlashScale[player->num] > 0.1f) { Matrix_Push(&gGfxMatrix); @@ -1124,10 +1149,10 @@ void Display_ArwingLaserCharge(Player* player) { Matrix_MultVec3f(gCalcMatrix, &spC4, &sp94); } - Matrix_Push(&gGfxMatrix); - // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("ArwingMuzzleFlash", 0); + FrameInterpolation_RecordOpenChild("ArwingMuzzleFlash1", player->num); + + Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, MTXF_NEW); Matrix_Scale(gGfxMatrix, gMuzzleFlashScale[player->num], gMuzzleFlashScale[player->num], 1.0f, @@ -1152,10 +1177,11 @@ void Display_ArwingLaserCharge(Player* player) { } Matrix_MultVec3f(gCalcMatrix, &spAC, &sp94); Matrix_MultVec3f(gCalcMatrix, &spA0, &sp88); - Matrix_Push(&gGfxMatrix); // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("ArwingMuzzleFlash", 0); + FrameInterpolation_RecordOpenChild("ArwingMuzzleFlash2", player->num); + + Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, MTXF_NEW); Matrix_Scale(gGfxMatrix, gMuzzleFlashScale[player->num], gMuzzleFlashScale[player->num], 1.0f, @@ -1170,7 +1196,7 @@ void Display_ArwingLaserCharge(Player* player) { Matrix_Push(&gGfxMatrix); // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("ArwingMuzzleFlash", 1); + FrameInterpolation_RecordOpenChild("ArwingMuzzleFlash3", player->num); Matrix_Translate(gGfxMatrix, sp88.x, sp88.y, sp88.z, MTXF_NEW); Matrix_Scale(gGfxMatrix, gMuzzleFlashScale[player->num], gMuzzleFlashScale[player->num], 1.0f, @@ -1343,7 +1369,7 @@ void Display_ArwingWingTrail_Draw(Player* player) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 100); // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("WingTrail", 0); + FrameInterpolation_RecordOpenChild("WingTrail", player->num); if (player->arwing.leftWingState == WINGSTATE_INTACT) { Matrix_Push(&gGfxMatrix); @@ -1363,7 +1389,7 @@ void Display_ArwingWingTrail_Draw(Player* player) { FrameInterpolation_RecordCloseChild(); // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("WingTrail", 1); + FrameInterpolation_RecordOpenChild("WingTrail2", player->num); if (player->arwing.rightWingState == WINGSTATE_INTACT) { Matrix_Push(&gGfxMatrix); @@ -1637,8 +1663,8 @@ void Display_ActorMarks(void) { for (i = 0; i < ARRAY_COUNT(gTeamArrowsViewPos); i++) { if (gTeamArrowsViewPos[i].z < 0.0f) { - FrameInterpolation_RecordOpenChild(&gTeamArrowsViewPos[i], i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + FrameInterpolation_RecordOpenChild("ActorMarks", i); + var_fs0 = (VEC3F_MAG(&gTeamArrowsViewPos[i])) * 0.0015f; if (var_fs0 > 100.0f) { var_fs0 = 100.0f; @@ -1683,8 +1709,7 @@ void Display_LockOnIndicator(void) { if (gLockOnTargetViewPos[i].z < 0.0f) { var_fs0 = VEC3F_MAG(&gLockOnTargetViewPos[i]); if (var_fs0 < 20000.0f) { - FrameInterpolation_RecordOpenChild("LcckOnIndicator", 0); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + FrameInterpolation_RecordOpenChild("LockOnIndicator", i); var_fs0 *= 0.0015f; if (var_fs0 > 100.0f) { var_fs0 = 100.0f; @@ -1797,9 +1822,7 @@ void Display_CsLevelCompleteHandleCamera(Player* player) { break; } } -#if 1 -f32 gTestVarF = 0.0f; -#endif + void Display_Update(void) { s32 i; Vec3f tempVec; @@ -1895,8 +1918,7 @@ void Display_Update(void) { printf("CAMERA 1 SKIPED: %d\n", camSkipTimes++); gCamera1Skipped = true; } else { - FrameInterpolation_RecordOpenChild("GamePlayCam", 0); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + FrameInterpolation_RecordOpenChild("GamePlayCam", camPlayer->num); gCamera1Skipped = false; } @@ -1919,10 +1941,8 @@ void Display_Update(void) { } Background_DrawBackdrop(); - FrameInterpolation_RecordOpenChild("Sun", 0); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); Background_DrawSun(); - FrameInterpolation_RecordCloseChild(); + Matrix_Push(&gGfxMatrix); Matrix_LookAt(gGfxMatrix, gPlayCamEye.x, gPlayCamEye.y, gPlayCamEye.z, gPlayCamAt.x, gPlayCamAt.y, gPlayCamAt.z, playerCamUp.x, playerCamUp.y, playerCamUp.z, MTXF_APPLY); @@ -1938,10 +1958,7 @@ void Display_Update(void) { Matrix_Pop(&gGfxMatrix); } else if (gGroundSurface != SURFACE_WATER) { D_bg_8015F964 = false; - FrameInterpolation_RecordOpenChild("Ground", 0); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); Background_DrawGround(); - FrameInterpolation_RecordCloseChild(); } } @@ -2010,10 +2027,7 @@ void Display_Update(void) { if ((gGroundSurface == SURFACE_WATER) || (gAqDrawMode != 0)) { D_bg_8015F964 = true; Effect_Draw(1); - FrameInterpolation_RecordOpenChild("Ground", 0); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); Background_DrawGround(); - FrameInterpolation_RecordCloseChild(); } if ((gCurrentLevel != LEVEL_AQUAS) && @@ -2026,12 +2040,9 @@ void Display_Update(void) { for (i = 0, player = &gPlayer[0]; i < gCamCount; i++, player++) { if (sPlayersVisible[i]) { - FrameInterpolation_RecordOpenChild(player, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); Display_PlayerShadow_Update(player); Display_PlayerFeatures(player); Display_ArwingWingTrail_Update(player); - FrameInterpolation_RecordCloseChild(); } } diff --git a/src/engine/fox_edisplay.c b/src/engine/fox_edisplay.c index 8ac59c45..969cd8ad 100644 --- a/src/engine/fox_edisplay.c +++ b/src/engine/fox_edisplay.c @@ -833,8 +833,7 @@ void ItemCheckpoint_Draw(ItemCheckpoint* this) { s32 i; if (((gGameFrameCount & 0x18) != 0) && (this->state == 0)) { - FrameInterpolation_RecordOpenChild(this, 0); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + FrameInterpolation_RecordOpenChild("ItemCheckpoint", 0); Matrix_Push(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, SETUPDL_64); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255); @@ -846,14 +845,14 @@ void ItemCheckpoint_Draw(ItemCheckpoint* this) { Matrix_Pop(&gGfxMatrix); FrameInterpolation_RecordCloseChild(); } - FrameInterpolation_RecordOpenChild(this, 1); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); RCP_SetupDL(&gMasterDisp, SETUPDL_29); gSPTexture(gMasterDisp++, 2000, 2000, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN); Matrix_RotateZ(gGfxMatrix, this->unk_58 * M_DTOR, MTXF_APPLY); for (i = 0; i < 8; i++) { + FrameInterpolation_RecordOpenChild("ItemCheckpoint", i + 1); + Matrix_Push(&gGfxMatrix); Matrix_RotateZ(gGfxMatrix, i * 45.0f * M_DTOR, MTXF_APPLY); Matrix_Translate(gGfxMatrix, 2.0f * this->width, 0.0f, 0.0f, MTXF_APPLY); @@ -861,9 +860,10 @@ void ItemCheckpoint_Draw(ItemCheckpoint* this) { Graphics_SetScaleMtx(2.0f * this->unk_50); gSPDisplayList(gMasterDisp++, D_101CAE0); Matrix_Pop(&gGfxMatrix); + + FrameInterpolation_RecordCloseChild(); } gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN); - FrameInterpolation_RecordCloseChild(); } void ItemSilverRing_Draw(ItemSilverRing* this) { @@ -1797,7 +1797,7 @@ void Object_DrawAll(s32 cullDirection) { for (i = 0, scenery360 = gScenery360; i < 200; i++, scenery360++) { FrameInterpolation_RecordOpenChild(scenery360, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + if ((scenery360->obj.status == OBJ_ACTIVE) && (scenery360->obj.id != OBJ_SCENERY_LEVEL_OBJECTS)) { if (gCurrentLevel == LEVEL_BOLSE) { spAC.x = scenery360->sfxSource[0]; @@ -1810,6 +1810,7 @@ void Object_DrawAll(s32 cullDirection) { Scenery360_Draw(scenery360); Matrix_Pop(&gGfxMatrix); } + FrameInterpolation_RecordCloseChild(); } } else { @@ -1817,7 +1818,7 @@ void Object_DrawAll(s32 cullDirection) { for (i = 0, scenery = gScenery; i < ARRAY_COUNT(gScenery); i++, scenery++) { if (scenery->obj.status >= OBJ_ACTIVE) { FrameInterpolation_RecordOpenChild(scenery, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + if (cullDirection > 0) { Display_SetSecondLight(&scenery->obj.pos); } @@ -1825,6 +1826,7 @@ void Object_DrawAll(s32 cullDirection) { Scenery_Draw(scenery, cullDirection); Matrix_Pop(&gGfxMatrix); Object_UpdateSfxSource(scenery->sfxSource); + FrameInterpolation_RecordCloseChild(); } } @@ -1833,7 +1835,7 @@ void Object_DrawAll(s32 cullDirection) { for (i = 0, boss = &gBosses[0]; i < ARRAY_COUNT(gBosses); i++, boss++) { if ((boss->obj.status >= OBJ_ACTIVE) && (boss->obj.id != OBJ_BOSS_BO_BASE_SHIELD)) { FrameInterpolation_RecordOpenChild(boss, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + if ((boss->timer_05C % 2) == 0) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } else { @@ -1850,6 +1852,7 @@ void Object_DrawAll(s32 cullDirection) { Object_DrawShadow(i, &boss->obj); Matrix_Pop(&gGfxMatrix); } + FrameInterpolation_RecordCloseChild(); } } @@ -1860,7 +1863,7 @@ void Object_DrawAll(s32 cullDirection) { for (i = 0, sprite = &gSprites[0]; i < ARRAY_COUNT(gSprites); i++, sprite++) { if ((sprite->obj.status >= OBJ_ACTIVE) && func_enmy_80060FE4(&sprite->obj.pos, -12000.0f)) { FrameInterpolation_RecordOpenChild(sprite, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + Matrix_Push(&gGfxMatrix); if ((sprite->obj.id == OBJ_SPRITE_CO_RUIN1) || (sprite->obj.id == OBJ_SPRITE_CO_RUIN2)) { @@ -1871,6 +1874,7 @@ void Object_DrawAll(s32 cullDirection) { Sprite_Draw(sprite, cullDirection); Matrix_Pop(&gGfxMatrix); + FrameInterpolation_RecordCloseChild(); } } @@ -1878,7 +1882,7 @@ void Object_DrawAll(s32 cullDirection) { for (i = 0, actor = &gActors[0]; i < ARRAY_COUNT(gActors); i++, actor++) { if (actor->obj.status >= OBJ_ACTIVE) { FrameInterpolation_RecordOpenChild(actor, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + if ((actor->timer_0C6 % 2) == 0) { if (gCurrentLevel == LEVEL_UNK_15) { RCP_SetupDL_23(); @@ -1940,12 +1944,13 @@ void Object_DrawAll(s32 cullDirection) { for (i = 0, item = &gItems[0]; i < ARRAY_COUNT(gItems); i++, item++) { if (item->obj.status >= OBJ_ACTIVE) { FrameInterpolation_RecordOpenChild(item, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + Matrix_Push(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, SETUPDL_29); Object_SetCullDirection(cullDirection); Item_Draw(item, cullDirection); Matrix_Pop(&gGfxMatrix); + FrameInterpolation_RecordCloseChild(); } } @@ -1964,7 +1969,7 @@ void Effect_DrawAll(s32 arg0) { for (i = 0, effect = &gEffects[0]; i < ARRAY_COUNT(gEffects); i++, effect++) { if (effect->obj.status >= OBJ_ACTIVE) { FrameInterpolation_RecordOpenChild(effect, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + if (effect->info.unk_14 == 1) { effect->obj.rot.y = RAD_TO_DEG(-gPlayer[gPlayerNum].camYaw); effect->obj.rot.x = RAD_TO_DEG(gPlayer[gPlayerNum].camPitch); @@ -1985,6 +1990,7 @@ void Effect_DrawAll(s32 arg0) { Matrix_Pop(&gGfxMatrix); } } + FrameInterpolation_RecordCloseChild(); } } @@ -1992,7 +1998,7 @@ void Effect_DrawAll(s32 arg0) { for (i = 0, boss = &gBosses[0]; i < ARRAY_COUNT(gBosses); i++, boss++) { if ((boss->obj.status >= OBJ_ACTIVE) && (boss->obj.id == OBJ_BOSS_BO_BASE_SHIELD)) { FrameInterpolation_RecordOpenChild(boss, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + if ((boss->timer_05C % 2) == 0) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } else { @@ -2002,6 +2008,7 @@ void Effect_DrawAll(s32 arg0) { Matrix_Push(&gGfxMatrix); Boss_Draw(boss, arg0); Matrix_Pop(&gGfxMatrix); + FrameInterpolation_RecordCloseChild(); } } @@ -2065,7 +2072,6 @@ void TexturedLine_Draw(void) { for (i = 0; i < ARRAY_COUNT(gTexturedLines); i++) { TexturedLine* texLine = &gTexturedLines[i]; FrameInterpolation_RecordOpenChild(texLine, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); if (gTexturedLines[i].mode != 0) { Matrix_Push(&gGfxMatrix); diff --git a/src/engine/fox_effect.c b/src/engine/fox_effect.c index 3a7665a5..ada1e7ca 100644 --- a/src/engine/fox_effect.c +++ b/src/engine/fox_effect.c @@ -148,10 +148,11 @@ void BonusText_DrawAll(void) { for (i = 0, bonus = gBonusText; i < ARRAY_COUNT(gBonusText); i++, bonus++) { if (bonus->hits != 0) { FrameInterpolation_RecordOpenChild(bonus, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + Matrix_Push(&gGfxMatrix); BonusText_Draw(bonus); Matrix_Pop(&gGfxMatrix); + FrameInterpolation_RecordCloseChild(); } } diff --git a/src/engine/fox_play.c b/src/engine/fox_play.c index cb8cc26c..c11c9dd6 100644 --- a/src/engine/fox_play.c +++ b/src/engine/fox_play.c @@ -2919,7 +2919,7 @@ void Play_Init(void) { D_ctx_801782C8 = 0; if (gCurrentLevel == LEVEL_TITANIA) { - Ground_801B5110(0.0f, 0.0f, 200.0f); + Ground_Init(0.0f, 0.0f, 200.0f); } if (gCurrentLevel == LEVEL_AQUAS) { gWaterLevel = 1000.0f; 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_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 }; From a69e9659393f88dcca22ff9d563ee4e9e0019d33 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Thu, 12 Mar 2026 20:01:06 -0300 Subject: [PATCH 04/23] fix function name --- include/i5.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/i5.h b/include/i5.h index ea4c4b94..af06200c 100644 --- a/include/i5.h +++ b/include/i5.h @@ -49,7 +49,7 @@ void Macbeth_MaProximityLight_Init(Scenery *); void Macbeth_Actor207_Init(Actor *); void Macbeth_801ACFBC(void); void Macbeth_801AD080(void); -void Ground_801B5110(f32, f32, f32); +void Ground_Init(f32, f32, f32); void Ground_801B58AC(Gfx **, f32); bool Ground_801B6AEC(f32, f32, f32); s32 Ground_801B6E20(f32, f32, f32 *, f32 *, f32 *); From 1bb941bcb1786d3ebf6d6349b4d35200a8328573 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Thu, 12 Mar 2026 21:49:26 -0300 Subject: [PATCH 05/23] Fix CI try --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2e6fc63f..89c2dc2b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -181,7 +181,7 @@ jobs: cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release cmake --build build-cmake --config Release -j3 (cd build-cmake && cpack -G External) - wget -O gamecontrollerdb.txt https://github.com/mdqinc/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt + wget -O gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt mv README.md readme.txt mv build-cmake/*.appimage starship.appimage - name: Upload build @@ -215,7 +215,7 @@ jobs: sudo sh /tmp/cmake.sh --prefix=/usr/local/ --exclude-subdir cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake cmake --build build-switch --config Release -j3 - wget -O gamecontrollerdb.txt https://github.com/mdqinc/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt + wget -O gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt mv README.md readme.txt mv build-switch/*.nro Starship.nro - name: Upload build From 3d882079075d7725d6c16049017149c4f2c0c531 Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Fri, 13 Mar 2026 11:09:47 -0500 Subject: [PATCH 06/23] Fix macOS CI (#243) * Fix macOS CI * fix switch * Fix readme links --- .github/workflows/mac.yml | 20 ++++------- .github/workflows/main.yml | 62 ++++++++++++++++++++++++++------- .github/workflows/switch.yml | 2 +- Brewfile | 8 +++++ CMakeLists.txt | 14 ++++++++ Info.plist | 5 +++ README.md | 3 +- cmake/configure-packaging.cmake | 2 +- libultraship | 2 +- 9 files changed, 89 insertions(+), 29 deletions(-) create mode 100644 Brewfile diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index f70c52e2..27a0a5ac 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -6,24 +6,18 @@ on: jobs: build: - runs-on: macOS-latest + runs-on: macOS-15 steps: - uses: actions/checkout@v4 with: submodules: recursive + - uses: actions/cache@v4 + with: + path: ~/Library/Caches/Homebrew + key: ${{ runner.os }}-${{ runner.arch }}-homebrew-${{ github.ref }}-${{ github.sha }} - name: Install dependencies - run: brew install sdl2 libpng glew ninja cmake libzip nlohmann-json tinyxml2 spdlog vorbis-tools + run: HOMEBREW_NO_AUTO_UPDATE=1 brew bundle --no-upgrade - name: Build run: | cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release - cmake --build build-cmake -j - - name: Create Package - run: | - mkdir starship-release - mv build-cmake/Starship starship-release/ - - name: Publish packaged artifacts - uses: actions/upload-artifact@v4 - with: - name: starship-mac-x64 - path: starship-release - retention-days: 1 \ No newline at end of file + cmake --build build-cmake -j \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 89c2dc2b..2df69ed5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -73,19 +73,23 @@ jobs: name: starship-windows path: starship-release - build-macos: + build-macos-x64: needs: generate-port-o2r - runs-on: macOS-latest + runs-on: macos-15-intel steps: - uses: actions/checkout@v4 with: submodules: recursive + - uses: actions/cache@v4 + with: + path: ~/Library/Caches/Homebrew + key: ${{ runner.os }}-${{ runner.arch }}-homebrew-${{ github.ref }}-${{ github.sha }} - name: Install dependencies - run: brew install sdl2 libpng glew ninja cmake libzip nlohmann-json tinyxml2 spdlog vorbis-tools + run: HOMEBREW_NO_AUTO_UPDATE=1 brew bundle --no-upgrade - name: Build run: | cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release - cmake --build build-cmake --config Release -j3 + cmake --build build-cmake -j - name: Download starship.o2r uses: actions/download-artifact@v4 with: @@ -93,17 +97,51 @@ jobs: path: ./build-cmake - name: Create Package run: | - mkdir starship-release - mv build-cmake/Starship starship-release/ - mv build-cmake/starship.o2r starship-release/ - mv config.yml starship-release/ - mv assets starship-release/ - curl -o starship-release/gamecontrollerdb.txt -sSL 'https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/refs/heads/master/gamecontrollerdb.txt' + (cd build-cmake && cpack) + mv _packages/*.dmg Starship.dmg + mv README.md readme.txt - name: Publish packaged artifacts uses: actions/upload-artifact@v4 with: - name: starship-mac-x64 - path: starship-release + name: Starship-mac-x64 + path: | + Starship.dmg + readme.txt + + build-macos-arm64: + needs: generate-port-o2r + runs-on: macos-15 + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: actions/cache@v4 + with: + path: ~/Library/Caches/Homebrew + key: ${{ runner.os }}-${{ runner.arch }}-homebrew-${{ github.ref }}-${{ github.sha }} + - name: Install dependencies + run: HOMEBREW_NO_AUTO_UPDATE=1 brew bundle --no-upgrade + - name: Build + run: | + cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release + cmake --build build-cmake -j + - name: Download starship.o2r + uses: actions/download-artifact@v4 + with: + name: starship.o2r + path: ./build-cmake + - name: Create Package + run: | + (cd build-cmake && cpack) + mv _packages/*.dmg Starship.dmg + mv README.md readme.txt + - name: Publish packaged artifacts + uses: actions/upload-artifact@v4 + with: + name: Starship-mac-arm64 + path: | + Starship.dmg + readme.txt build-linux: needs: generate-port-o2r diff --git a/.github/workflows/switch.yml b/.github/workflows/switch.yml index 5fe784c3..784bfb05 100644 --- a/.github/workflows/switch.yml +++ b/.github/workflows/switch.yml @@ -25,7 +25,7 @@ jobs: sudo sh /tmp/cmake.sh --prefix=/usr/local/ --exclude-subdir cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake cmake --build build-switch --config Release -j3 - wget -O gamecontrollerdb.txt https://github.com/mdqinc/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt + wget -O gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt mv README.md readme.txt mv build-switch/*.nro Starship.nro - name: Upload build diff --git a/Brewfile b/Brewfile new file mode 100644 index 00000000..ce9675fa --- /dev/null +++ b/Brewfile @@ -0,0 +1,8 @@ +brew "sdl2" +brew "libpng" +brew "glew" +brew "libzip" +brew "nlohmann-json" +brew "tinyxml2" +brew "spdlog" +brew "vorbis-tools" \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index d9564403..e7d0e797 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -633,6 +633,9 @@ add_custom_target( COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/starship.o2r" "${CMAKE_BINARY_DIR}/starship.o2r" ) +find_program(CURL NAMES curl DOC "Path to the curl program. Used to download files.") +execute_process(COMMAND ${CURL} -sSfL https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt -o ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt OUTPUT_VARIABLE RESULT) + if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") install(FILES "${CMAKE_BINARY_DIR}/starship.o2r" DESTINATION . COMPONENT ${PROJECT_NAME}) endif() @@ -656,6 +659,17 @@ add_custom_target(CreateOSXIcons ) add_dependencies(${PROJECT_NAME} CreateOSXIcons) configure_file("${CMAKE_SOURCE_DIR}/Info.plist" "${CMAKE_BINARY_DIR}/Info.plist" COPYONLY) + INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ../MacOS COMPONENT Starship) + INSTALL(FILES ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt DESTINATION ../MacOS COMPONENT Starship) + INSTALL(FILES ${CMAKE_BINARY_DIR}/starship.o2r DESTINATION ../Resources COMPONENT Starship) + INSTALL(FILES ${CMAKE_BINARY_DIR}/config.yml DESTINATION ../Resources COMPONENT Starship) + INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/assets/ DESTINATION ../Resources/assets COMPONENT Starship) + + # Fix bundle to include and relink all dependencies + install(CODE " + include(BundleUtilities) + fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/../MacOS/Starship\" \"\" \"${dirs}\") + ") endif() set_property(TARGET ${PROJECT_NAME} PROPERTY APPIMAGE_DESKTOP_FILE_TERMINAL YES) diff --git a/Info.plist b/Info.plist index 39fb6bc1..c0f51ab9 100644 --- a/Info.plist +++ b/Info.plist @@ -33,6 +33,11 @@ public.app-category.games LSMinimumSystemVersion 10.15 + LSEnvironment + + SHIP_HOME + ~/Library/Application Support/com.Starship.Starship + LSArchitecturePriority arm64 diff --git a/README.md b/README.md index 75c9d0b0..f8690383 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,8 @@ If you want to manually compile Starship, please consult the [building instructi If you want to playtest a continuous integration build, you can find them at the links below. Keep in mind that these are for playtesting only, and you will likely encounter bugs and possibly crashes. * [Windows](https://nightly.link/HarbourMasters/Starship/workflows/main/main/starship-windows.zip) -* [macOS](https://nightly.link/HarbourMasters/Starship/workflows/main/main/starship-mac-x64.zip) +* [macOS (Apple Silicon)](https://nightly.link/HarbourMasters/Starship/workflows/main/main/Starship-mac-arm64.zip) +* [macOS (Intel)](https://nightly.link/HarbourMasters/Starship/workflows/main/main/Starship-mac-x64.zip) * [Linux](https://nightly.link/HarbourMasters/Starship/workflows/main/main/Starship-linux.zip) * [Switch](https://nightly.link/HarbourMasters/Starship/workflows/main/main/Starship-switch.zip) diff --git a/cmake/configure-packaging.cmake b/cmake/configure-packaging.cmake index f3d2c115..8fb030b1 100644 --- a/cmake/configure-packaging.cmake +++ b/cmake/configure-packaging.cmake @@ -22,7 +22,7 @@ endif() if (CPACK_GENERATOR MATCHES "Bundle") set(CPACK_BUNDLE_NAME "Starship") - set(CPACK_BUNDLE_PLIST "macosx/Info.plist") + set(CPACK_BUNDLE_PLIST "Info.plist") set(CPACK_BUNDLE_ICON "macosx/Starship.icns") # set(CPACK_BUNDLE_STARTUP_COMMAND "macosx/Starship-macos.sh") set(CPACK_BUNDLE_APPLE_CERT_APP "-") diff --git a/libultraship b/libultraship index 09dfab5f..eaaf9d0f 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 09dfab5fb2a9a047a6e268dc9db2daad9b2ce5f0 +Subproject commit eaaf9d0fc91e2c400f49ef2a1f8547a691ce4d3c From 10ec999591f5fb680214acca5cb045eeb9373e3f Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Tue, 17 Mar 2026 22:58:02 -0300 Subject: [PATCH 07/23] Solar Intro Cutscene Vi Recording --- include/fox_record.h | 1 + src/engine/cutscene_record.c | 36 +++++++++++++++++++++++------------- src/engine/fox_demo.c | 2 ++ 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/include/fox_record.h b/include/fox_record.h index 6077c6bd..6d9cec6e 100644 --- a/include/fox_record.h +++ b/include/fox_record.h @@ -24,6 +24,7 @@ extern Record gMacbethCutsceneRecord[14]; extern Record gGrangaCutsceneRecord[13]; extern Record gMeCrusherCutsceneRecord[3]; extern Record gEndingCsRecord[37]; +extern Record gSolarIntroCsRecord[16]; extern int gA6GorgonCsFrameCount; extern int gWarpzoneCsFrameCount; diff --git a/src/engine/cutscene_record.c b/src/engine/cutscene_record.c index 611c2bbe..3bf8a512 100644 --- a/src/engine/cutscene_record.c +++ b/src/engine/cutscene_record.c @@ -18,6 +18,8 @@ void UpdateVisPerFrameFromRecording(Record* record, s32 maxFrames, int* frameCou int gWarpzoneCsFrameCount = 0; int gA6GorgonCsFrameCount = 0; +// clang-format off + Record gWarpzoneCsRecord[19] = { { 2, 1 }, { 3, 3 }, { 4, 4 }, { 3, 8 }, { 2, 9 }, { 3, 52 }, { 2, 54 }, { 3, 69 }, { 2, 70 }, { 3, 75 }, { 2, 76 }, { 3, 79 }, { 2, 117 }, { 3, 118 }, { 2, 120 }, { 3, 145 }, { 2, 215 }, { 3, 216 }, { 2, 230 }, @@ -100,15 +102,7 @@ Record gMacbethCutsceneRecord[14] = { { 2, 942 }, }; -// 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[25] = { { 3, 0 }, { 2, 8 }, @@ -146,10 +140,6 @@ Record gAndrossRobotKillCutscene1[25] = { { 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[20] = { { 4, 0 }, { 2, 1 }, @@ -172,7 +162,6 @@ Record gAndrossRobotKillCutscene2[20] = { { 3, 207 }, { 2, 211 }, }; -// clang-format on // SyRobot destroy cutscene timings recorded from a real N64 Record gSyRobotCutsceneRecord[3] = { @@ -180,3 +169,24 @@ Record gSyRobotCutsceneRecord[3] = { { 3, 129 }, { 2, 230 }, }; + +Record gSolarIntroCsRecord[16] = { + { 2, 0 }, + { 3, 94 }, + { 2, 105 }, + { 3, 362 }, + { 4, 377 }, + { 3, 379 }, + { 4, 381 }, + { 2, 382 }, + { 3, 443 }, + { 2, 444 }, + { 3, 456 }, + { 2, 492 }, + { 3, 494 }, + { 2, 499 }, + { 3, 552 }, + { 2, 629 }, +}; + +// clang-format on diff --git a/src/engine/fox_demo.c b/src/engine/fox_demo.c index ce091ef0..dfdacc77 100644 --- a/src/engine/fox_demo.c +++ b/src/engine/fox_demo.c @@ -630,6 +630,8 @@ void Cutscene_LevelStart(Player* player) { break; case LEVEL_SOLAR: + // @Port: Vi recording + UpdateVisPerFrameFromRecording(gSolarIntroCsRecord, ARRAY_COUNT(gSolarIntroCsRecord), &gCsFrameCount); Solar_LevelStart(player); break; From 5050031c1e8b5be9e7061da8498a32c3c06c7436 Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Thu, 19 Mar 2026 13:33:55 -0500 Subject: [PATCH 08/23] Try to use macos-14 (#244) --- .github/workflows/mac.yml | 2 +- .github/workflows/main.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 27a0a5ac..d7471c18 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -6,7 +6,7 @@ on: jobs: build: - runs-on: macOS-15 + runs-on: macos-14 steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2df69ed5..e35cc68e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -75,7 +75,7 @@ jobs: build-macos-x64: needs: generate-port-o2r - runs-on: macos-15-intel + runs-on: macos-14-large # macos-14-large is the only way we can get x64 steps: - uses: actions/checkout@v4 with: @@ -110,7 +110,7 @@ jobs: build-macos-arm64: needs: generate-port-o2r - runs-on: macos-15 + runs-on: macos-14 steps: - uses: actions/checkout@v4 with: From 0b90f2620e565a622f6f2b1256022d4c12fcea50 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Fri, 20 Mar 2026 14:38:36 -0300 Subject: [PATCH 09/23] Corneria_CoCarrier_Init Correction --- src/overlays/ovl_i1/fox_co.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/overlays/ovl_i1/fox_co.c b/src/overlays/ovl_i1/fox_co.c index e8bbbea7..9d068d5a 100644 --- a/src/overlays/ovl_i1/fox_co.c +++ b/src/overlays/ovl_i1/fox_co.c @@ -1690,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; From 3e3e7b8af9eac176f13f1aebef9a62e0e7971237 Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Fri, 20 Mar 2026 18:02:12 -0500 Subject: [PATCH 10/23] MacOS CI Universal Build (#246) * Another attempt * Use macports --- .github/macports.yml | 21 +++++++++++++++ .github/workflows/mac.yml | 14 +++++----- .github/workflows/main.yml | 53 +++++++------------------------------- README.md | 3 +-- 4 files changed, 38 insertions(+), 53 deletions(-) create mode 100644 .github/macports.yml diff --git a/.github/macports.yml b/.github/macports.yml new file mode 100644 index 00000000..97622472 --- /dev/null +++ b/.github/macports.yml @@ -0,0 +1,21 @@ +ports: + - name: libsdl2 + select: [ universal ] + - name: libpng + select: [ universal ] + - name: glew + select: [ universal ] + - name: libzip + select: [ universal ] + - name: nlohmann-json + select: [ universal ] + - name: tinyxml2 + select: [ universal ] + - name: libogg + select: [ universal ] + - name: libopus + select: [ universal ] + - name: opusfile + select: [ universal ] + - name: libvorbis + select: [ universal ] \ No newline at end of file diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index d7471c18..266a808a 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -8,16 +8,16 @@ jobs: build: runs-on: macos-14 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: submodules: recursive - - uses: actions/cache@v4 + - uses: melusina-org/setup-macports@v1 with: - path: ~/Library/Caches/Homebrew - key: ${{ runner.os }}-${{ runner.arch }}-homebrew-${{ github.ref }}-${{ github.sha }} - - name: Install dependencies - run: HOMEBREW_NO_AUTO_UPDATE=1 brew bundle --no-upgrade + parameters: '.github/macports.yml' + - uses: hendrikmuhs/ccache-action@v1.2 + with: + key: macos-ccache-${{ github.ref }} - name: Build run: | - cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release + cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" cmake --build build-cmake -j \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e35cc68e..41c68a74 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -73,57 +73,22 @@ jobs: name: starship-windows path: starship-release - build-macos-x64: - needs: generate-port-o2r - runs-on: macos-14-large # macos-14-large is the only way we can get x64 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - uses: actions/cache@v4 - with: - path: ~/Library/Caches/Homebrew - key: ${{ runner.os }}-${{ runner.arch }}-homebrew-${{ github.ref }}-${{ github.sha }} - - name: Install dependencies - run: HOMEBREW_NO_AUTO_UPDATE=1 brew bundle --no-upgrade - - name: Build - run: | - cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release - cmake --build build-cmake -j - - name: Download starship.o2r - uses: actions/download-artifact@v4 - with: - name: starship.o2r - path: ./build-cmake - - name: Create Package - run: | - (cd build-cmake && cpack) - mv _packages/*.dmg Starship.dmg - mv README.md readme.txt - - name: Publish packaged artifacts - uses: actions/upload-artifact@v4 - with: - name: Starship-mac-x64 - path: | - Starship.dmg - readme.txt - - build-macos-arm64: + build-macos: needs: generate-port-o2r runs-on: macos-14 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: submodules: recursive - - uses: actions/cache@v4 + - uses: melusina-org/setup-macports@v1 with: - path: ~/Library/Caches/Homebrew - key: ${{ runner.os }}-${{ runner.arch }}-homebrew-${{ github.ref }}-${{ github.sha }} - - name: Install dependencies - run: HOMEBREW_NO_AUTO_UPDATE=1 brew bundle --no-upgrade + parameters: '.github/macports.yml' + - uses: hendrikmuhs/ccache-action@v1.2 + with: + key: macos-ccache-${{ github.ref }} - name: Build run: | - cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release + cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" cmake --build build-cmake -j - name: Download starship.o2r uses: actions/download-artifact@v4 @@ -138,7 +103,7 @@ jobs: - name: Publish packaged artifacts uses: actions/upload-artifact@v4 with: - name: Starship-mac-arm64 + name: Starship-mac path: | Starship.dmg readme.txt diff --git a/README.md b/README.md index f8690383..eaccfeb8 100644 --- a/README.md +++ b/README.md @@ -83,8 +83,7 @@ If you want to manually compile Starship, please consult the [building instructi If you want to playtest a continuous integration build, you can find them at the links below. Keep in mind that these are for playtesting only, and you will likely encounter bugs and possibly crashes. * [Windows](https://nightly.link/HarbourMasters/Starship/workflows/main/main/starship-windows.zip) -* [macOS (Apple Silicon)](https://nightly.link/HarbourMasters/Starship/workflows/main/main/Starship-mac-arm64.zip) -* [macOS (Intel)](https://nightly.link/HarbourMasters/Starship/workflows/main/main/Starship-mac-x64.zip) +* [macOS](https://nightly.link/HarbourMasters/Starship/workflows/main/main/Starship-mac.zip) * [Linux](https://nightly.link/HarbourMasters/Starship/workflows/main/main/Starship-linux.zip) * [Switch](https://nightly.link/HarbourMasters/Starship/workflows/main/main/Starship-switch.zip) From 62eb5a198bc5a8806f8c1b43551cd689e929455e Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Fri, 20 Mar 2026 21:53:27 -0500 Subject: [PATCH 11/23] Tweak actions cache (#248) --- .github/workflows/mac.yml | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 266a808a..569dcca2 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -16,7 +16,7 @@ jobs: parameters: '.github/macports.yml' - uses: hendrikmuhs/ccache-action@v1.2 with: - key: macos-ccache-${{ github.ref }} + key: macos # ccache-macos - name: Build run: | cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 41c68a74..2780b521 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -85,7 +85,7 @@ jobs: parameters: '.github/macports.yml' - uses: hendrikmuhs/ccache-action@v1.2 with: - key: macos-ccache-${{ github.ref }} + key: macos # ccache-macos - name: Build run: | cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" From 7dd7ec260bf1820caf95edd886d0893533f0e93c Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Mon, 23 Mar 2026 18:29:19 -0300 Subject: [PATCH 12/23] No need to rotate buildings twice if we're already doing it in Object_SetMatrix --- src/engine/fox_enmy.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/engine/fox_enmy.c b/src/engine/fox_enmy.c index 5c7663b2..18e99218 100644 --- a/src/engine/fox_enmy.c +++ b/src/engine/fox_enmy.c @@ -2005,6 +2005,13 @@ void Sprite167_Update(Sprite167* this) { // World-aligned billboarding void SceneryRotateTowardsCamera(Scenery* this) { + bool isBuilding = (this->obj.id >= OBJ_SCENERY_CO_BUILDING_5 && this->obj.id <= OBJ_SCENERY_CO_BUILDING_8 || + this->obj.id == OBJ_SCENERY_CO_BUILDING_10); + + if (isBuilding) { + return; + } + this->obj.rot.y = 0.0f; if (gPlayer[0].cam.eye.x < this->obj.pos.x) { this->obj.rot.y = 271.0f; From 0caf5e2d6693ab4101d98f035452a05efc92ef1b Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Sun, 26 Apr 2026 23:05:57 -0300 Subject: [PATCH 13/23] Fix Crash in Sector Y BOSS --- src/overlays/ovl_i6/fox_sy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/overlays/ovl_i6/fox_sy.c b/src/overlays/ovl_i6/fox_sy.c index 702f1181..f0521611 100644 --- a/src/overlays/ovl_i6/fox_sy.c +++ b/src/overlays/ovl_i6/fox_sy.c @@ -87,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; From fad71e70d7a39719988d1b94d6951b4615345146 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Thu, 30 Apr 2026 17:53:21 -0300 Subject: [PATCH 14/23] Add Spanish Translation ROMHACK support --- config.yml | 21 +++++++++++++++++++++ src/port/extractor/GameExtractor.cpp | 1 + 2 files changed, 22 insertions(+) diff --git a/config.yml b/config.yml index 3c4b0d50..bba72275 100644 --- a/config.yml +++ b/config.yml @@ -120,6 +120,27 @@ d064229a32cc05ab85e2381ce07744eb3ffaf530: # - include/sf64event.h # - include/sf64player.h +# EU SPANISH ROMHACK (For audio extraction) +e6dad7523ff8f83fad6fbdb59d472b4f76340c2b: + name: Star Fox 64 (EU) (SPANISH ROMHACK) (V1.0) + path: assets/yaml/eu/rev0 + config: + gbi: F3DEX + sort: OFFSET + logging: INFO + output: + binary: ./mods/sf64eu.o2r + code: src/eu/assets + headers: include/assets + modding: src/eu/assets + # enums: + # - include/sf64object.h + # - include/sf64level.h + # - include/sf64mesg.h + # - include/sf64audio_external.h + # - include/sf64event.h + # - include/sf64player.h + c8a10699dea52f4bb2e2311935c1376dfb352e7a: name: Star Fox 64 (CN) (V1.1) (Compressed) preprocess: diff --git a/src/port/extractor/GameExtractor.cpp b/src/port/extractor/GameExtractor.cpp index d75ab3c3..9be7f4b7 100644 --- a/src/port/extractor/GameExtractor.cpp +++ b/src/port/extractor/GameExtractor.cpp @@ -18,6 +18,7 @@ std::unordered_map mGameList = { { "d064229a32cc05ab85e2381ce07744eb3ffaf530", "Star Fox 64 (J) (V1.0) (Uncompressed)" }, { "05b307b8804f992af1a1e2fbafbd588501fdf799", "Star Fox 64 (E) (V1.0)" }, { "09f5d5c14219fc77a36c5a6ad5e63f7abd8b3385", "Star Fox 64 (E) (V1.0) (Uncompressed)" }, + { "e6dad7523ff8f83fad6fbdb59d472b4f76340c2b", "Star Fox 64 (E) (V1.0) (Spanish Romhack)" }, { "c8a10699dea52f4bb2e2311935c1376dfb352e7a", "Star Fox 64 (C) (V1.1)" }, { "3a05aba5549fa71e8b16a0c6e2c8481b070818a9", "Star Fox 64 (C) (V1.1) (Uncompressed)" }, }; From 39bf387e58342e5e2f090c823f3a09bc174ccd30 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Thu, 30 Apr 2026 19:21:33 -0300 Subject: [PATCH 15/23] Accomodate menu for the Spanish audio romhack support --- src/port/Engine.h | 1 + src/port/ui/ImguiUI.cpp | 32 +++++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/port/Engine.h b/src/port/Engine.h index bbb50c60..b937e9db 100644 --- a/src/port/Engine.h +++ b/src/port/Engine.h @@ -6,6 +6,7 @@ typedef enum { SF64_VER_US = 0x94F1D5A7, SF64_VER_EU = 0x6EE9ADE7, + SF64_VER_EU_SPA = 0x3964945f, SF64_VER_JP = 0x3728D3E1 } SF64Version; diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp index b9bc2c32..5874ac2a 100644 --- a/src/port/ui/ImguiUI.cpp +++ b/src/port/ui/ImguiUI.cpp @@ -115,6 +115,9 @@ static const char* filters[3] = { static const char* voiceLangs[] = { "Original", /*"Japanese",*/ "Lylat" }; +static const char* voiceLangsSPA[] = { + "EspaƱol", /*"Japanese",*/ "Lylat" +}; void DrawSpeakerPositionEditor() { static ImVec2 lastCanvasPos; @@ -309,15 +312,26 @@ void DrawSettingsMenu(){ UIWidgets::Spacer(0); if (UIWidgets::BeginMenu("Language")) { ImGui::Dummy(ImVec2(150, 0.0f)); - if (!GameEngine::HasVersion(SF64_VER_JP) && GameEngine::HasVersion(SF64_VER_EU)){ - //UIWidgets::Spacer(0); - if (UIWidgets::CVarCombobox("Voices", "gVoiceLanguage", voiceLangs, - { - .tooltip = "Changes the language of the voice acting in the game", - .defaultIndex = 0, - })) { - Audio_SetVoiceLanguage(CVarGetInteger("gVoiceLanguage", 0)); - }; + if (!GameEngine::HasVersion(SF64_VER_JP) && (GameEngine::HasVersion(SF64_VER_EU) || GameEngine::HasVersion(SF64_VER_EU_SPA))) { + if (GameEngine::HasVersion(SF64_VER_EU_SPA)) { + //UIWidgets::Spacer(0); + if (UIWidgets::CVarCombobox("Voices", "gVoiceLanguage", voiceLangsSPA, + { + .tooltip = "Changes the language of the voice acting in the game", + .defaultIndex = 0, + })) { + Audio_SetVoiceLanguage(CVarGetInteger("gVoiceLanguage", 0)); + }; + } else { + //UIWidgets::Spacer(0); + if (UIWidgets::CVarCombobox("Voices", "gVoiceLanguage", voiceLangs, + { + .tooltip = "Changes the language of the voice acting in the game", + .defaultIndex = 0, + })) { + Audio_SetVoiceLanguage(CVarGetInteger("gVoiceLanguage", 0)); + }; + } } else { if (UIWidgets::Button("Install JP/EU Audio")) { if (GameEngine::GenAssetFile(false)){ From 073d2660d54cd447800ada9443e19eec886d276b Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Sat, 9 May 2026 01:49:20 -0300 Subject: [PATCH 16/23] CI Try --- .github/workflows/switch.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/switch.yml b/.github/workflows/switch.yml index 784bfb05..00f9a283 100644 --- a/.github/workflows/switch.yml +++ b/.github/workflows/switch.yml @@ -18,14 +18,14 @@ jobs: sudo apt-get update sudo apt-get install -y ninja-build sudo apt-get remove -y cmake - git -C libultraship remote add nx https://github.com/Net64DD/libultraship.git + git -C libultraship remote add nx https://github.com/sonicdcer/libultraship.git git -C libultraship fetch nx - git -C libultraship checkout nx/main-nx + git -C libultraship checkout nx/main-nx_backup wget https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.sh -O /tmp/cmake.sh sudo sh /tmp/cmake.sh --prefix=/usr/local/ --exclude-subdir cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake cmake --build build-switch --config Release -j3 - wget -O gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt + wget -O gamecontrollerdb.txt https://github.com/mdqinc/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt mv README.md readme.txt mv build-switch/*.nro Starship.nro - name: Upload build From 50550e5a2ed1952160596a84a43eb71b81f89f4b Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Sat, 9 May 2026 01:54:07 -0300 Subject: [PATCH 17/23] Fix wget --- .github/workflows/switch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/switch.yml b/.github/workflows/switch.yml index 00f9a283..3d83c850 100644 --- a/.github/workflows/switch.yml +++ b/.github/workflows/switch.yml @@ -25,7 +25,7 @@ jobs: sudo sh /tmp/cmake.sh --prefix=/usr/local/ --exclude-subdir cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake cmake --build build-switch --config Release -j3 - wget -O gamecontrollerdb.txt https://github.com/mdqinc/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt + wget -O gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt mv README.md readme.txt mv build-switch/*.nro Starship.nro - name: Upload build From 6cc3b1e4280dff309c21701e90d522deadfd95bf Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Sat, 9 May 2026 02:16:17 -0300 Subject: [PATCH 18/23] CI Try 2 --- .github/workflows/switch.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/switch.yml b/.github/workflows/switch.yml index 3d83c850..fd676fbf 100644 --- a/.github/workflows/switch.yml +++ b/.github/workflows/switch.yml @@ -18,9 +18,9 @@ jobs: sudo apt-get update sudo apt-get install -y ninja-build sudo apt-get remove -y cmake - git -C libultraship remote add nx https://github.com/sonicdcer/libultraship.git + git -C libultraship remote add nx https://github.com/Net64DD/libultraship.git git -C libultraship fetch nx - git -C libultraship checkout nx/main-nx_backup + git -C libultraship checkout 2623c6bad4e2e7d2e6191816439f7a3f6e5ccb21 wget https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.sh -O /tmp/cmake.sh sudo sh /tmp/cmake.sh --prefix=/usr/local/ --exclude-subdir cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake From 9eb0d11d55425c386103afafcb8092ee66e2579a Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Sat, 9 May 2026 02:25:01 -0300 Subject: [PATCH 19/23] CI Try 3 --- .github/workflows/switch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/switch.yml b/.github/workflows/switch.yml index fd676fbf..07126f8d 100644 --- a/.github/workflows/switch.yml +++ b/.github/workflows/switch.yml @@ -20,7 +20,7 @@ jobs: sudo apt-get remove -y cmake git -C libultraship remote add nx https://github.com/Net64DD/libultraship.git git -C libultraship fetch nx - git -C libultraship checkout 2623c6bad4e2e7d2e6191816439f7a3f6e5ccb21 + git -C libultraship checkout 09dfab5fb2a9a047a6e268dc9db2daad9b2ce5f0 wget https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.sh -O /tmp/cmake.sh sudo sh /tmp/cmake.sh --prefix=/usr/local/ --exclude-subdir cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake From 2444d5e5b8d53f37aa129f8bf10fe3feb95ae925 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Sat, 9 May 2026 02:35:12 -0300 Subject: [PATCH 20/23] CI Try 4 --- include/endianness.h | 85 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 include/endianness.h diff --git a/include/endianness.h b/include/endianness.h new file mode 100644 index 00000000..3b17a8b9 --- /dev/null +++ b/include/endianness.h @@ -0,0 +1,85 @@ +#pragma once + +#ifdef __cplusplus +namespace Ship { +enum class Endianness { + Little = 0, + Big = 1, + +#if (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) || defined(__BIG_ENDIAN__) + Native = Big, +#else + Native = Little, +#endif +}; +} // namespace Ship +#endif + +#ifdef _MSC_VER +#include + +#define BSWAP16 _byteswap_ushort +#define BSWAP32 _byteswap_ulong +#define BSWAP64 _byteswap_uint64 + +#define BOMSWAP16 _byteswap_ushort +#define BOMSWAP32 _byteswap_ulong +#define BOMSWAP64 _byteswap_uint64 + +#define BOMSWAP16_CONST(x) ((((x) >> 8) & 0x00FF) | (((x) << 8) & 0xFF00)) +#define BOMSWAP32_CONST(x) \ + ((((x) >> 24) & 0x000000FF) | (((x) >> 8) & 0x0000FF00) | (((x) << 8) & 0x00FF0000) | (((x) << 24) & 0xFF000000)) +#define BOMSWAP64_CONST(x) \ + ((((x) >> 56) & 0x00000000000000FF) | (((x) >> 40) & 0x000000000000FF00) | (((x) >> 24) & 0x0000000000FF0000) | \ + (((x) >> 8) & 0x00000000FF000000) | (((x) << 8) & 0x000000FF00000000) | (((x) << 24) & 0x0000FF0000000000) | \ + (((x) << 40) & 0x00FF000000000000) | (((x) << 56) & 0xFF00000000000000)) +#else + +#define BSWAP16 __builtin_bswap16 +#define BSWAP32 __builtin_bswap32 +#define BSWAP64 __builtin_bswap64 + +#define BOMSWAP16 __builtin_bswap16 +#define BOMSWAP32 __builtin_bswap32 +#define BOMSWAP64 __builtin_bswap64 + +#define BOMSWAP16_CONST __builtin_bswap16 +#define BOMSWAP32_CONST __builtin_bswap32 +#define BOMSWAP64_CONST __builtin_bswap64 +#endif + +#if (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) || defined(__BIG_ENDIAN__) +#ifndef IS_BIGENDIAN +#define IS_BIGENDIAN +#endif +#endif + +#ifdef IS_BIGENDIAN +#define BE16SWAP(x) (x) +#define BE32SWAP(x) (x) +#define BE64SWAP(x) (x) +#define LE16SWAP(x) BOMSWAP16(x) +#define LE32SWAP(x) BOMSWAP32(x) +#define LE64SWAP(x) BOMSWAP64(x) + +#define BE16SWAP_CONST(x) (x) +#define BE32SWAP_CONST(x) (x) +#define BE64SWAP_CONST(x) (x) +#define LE16SWAP_CONST(x) BOMSWAP16_CONST(x) +#define LE32SWAP_CONST(x) BOMSWAP32_CONST(x) +#define LE64SWAP_CONST(x) BOMSWAP64_CONST(x) +#else +#define BE16SWAP(x) BOMSWAP16(x) +#define BE32SWAP(x) BOMSWAP32(x) +#define BE64SWAP(x) BOMSWAP64(x) +#define LE16SWAP(x) (x) +#define LE32SWAP(x) (x) +#define LE64SWAP(x) (x) + +#define BE16SWAP_CONST(x) BOMSWAP16_CONST(x) +#define BE32SWAP_CONST(x) BOMSWAP32_CONST(x) +#define BE64SWAP_CONST(x) BOMSWAP64_CONST(x) +#define LE16SWAP_CONST(x) (x) +#define LE32SWAP_CONST(x) (x) +#define LE64SWAP_CONST(x) (x) +#endif From be6c807be42d155cdf1b369f4e55ce8670169371 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Sat, 9 May 2026 02:51:08 -0300 Subject: [PATCH 21/23] CI Try 5 --- .github/workflows/main.yml | 4 +- .github/workflows/switch.yml | 4 +- include/endianness.h | 85 ------------------------------------ 3 files changed, 4 insertions(+), 89 deletions(-) delete mode 100644 include/endianness.h diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2780b521..6d98ae4e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -211,9 +211,9 @@ jobs: sudo apt-get update sudo apt-get install -y ninja-build sudo apt-get remove -y cmake - git -C libultraship remote add nx https://github.com/Net64DD/libultraship.git + git -C libultraship remote add nx https://github.com/sonicdcer/libultraship.git git -C libultraship fetch nx - git -C libultraship checkout nx/main-nx + git -C libultraship checkout nx/main-nx_backup wget https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.sh -O /tmp/cmake.sh sudo sh /tmp/cmake.sh --prefix=/usr/local/ --exclude-subdir cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake diff --git a/.github/workflows/switch.yml b/.github/workflows/switch.yml index 07126f8d..3d83c850 100644 --- a/.github/workflows/switch.yml +++ b/.github/workflows/switch.yml @@ -18,9 +18,9 @@ jobs: sudo apt-get update sudo apt-get install -y ninja-build sudo apt-get remove -y cmake - git -C libultraship remote add nx https://github.com/Net64DD/libultraship.git + git -C libultraship remote add nx https://github.com/sonicdcer/libultraship.git git -C libultraship fetch nx - git -C libultraship checkout 09dfab5fb2a9a047a6e268dc9db2daad9b2ce5f0 + git -C libultraship checkout nx/main-nx_backup wget https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.sh -O /tmp/cmake.sh sudo sh /tmp/cmake.sh --prefix=/usr/local/ --exclude-subdir cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake diff --git a/include/endianness.h b/include/endianness.h deleted file mode 100644 index 3b17a8b9..00000000 --- a/include/endianness.h +++ /dev/null @@ -1,85 +0,0 @@ -#pragma once - -#ifdef __cplusplus -namespace Ship { -enum class Endianness { - Little = 0, - Big = 1, - -#if (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) || defined(__BIG_ENDIAN__) - Native = Big, -#else - Native = Little, -#endif -}; -} // namespace Ship -#endif - -#ifdef _MSC_VER -#include - -#define BSWAP16 _byteswap_ushort -#define BSWAP32 _byteswap_ulong -#define BSWAP64 _byteswap_uint64 - -#define BOMSWAP16 _byteswap_ushort -#define BOMSWAP32 _byteswap_ulong -#define BOMSWAP64 _byteswap_uint64 - -#define BOMSWAP16_CONST(x) ((((x) >> 8) & 0x00FF) | (((x) << 8) & 0xFF00)) -#define BOMSWAP32_CONST(x) \ - ((((x) >> 24) & 0x000000FF) | (((x) >> 8) & 0x0000FF00) | (((x) << 8) & 0x00FF0000) | (((x) << 24) & 0xFF000000)) -#define BOMSWAP64_CONST(x) \ - ((((x) >> 56) & 0x00000000000000FF) | (((x) >> 40) & 0x000000000000FF00) | (((x) >> 24) & 0x0000000000FF0000) | \ - (((x) >> 8) & 0x00000000FF000000) | (((x) << 8) & 0x000000FF00000000) | (((x) << 24) & 0x0000FF0000000000) | \ - (((x) << 40) & 0x00FF000000000000) | (((x) << 56) & 0xFF00000000000000)) -#else - -#define BSWAP16 __builtin_bswap16 -#define BSWAP32 __builtin_bswap32 -#define BSWAP64 __builtin_bswap64 - -#define BOMSWAP16 __builtin_bswap16 -#define BOMSWAP32 __builtin_bswap32 -#define BOMSWAP64 __builtin_bswap64 - -#define BOMSWAP16_CONST __builtin_bswap16 -#define BOMSWAP32_CONST __builtin_bswap32 -#define BOMSWAP64_CONST __builtin_bswap64 -#endif - -#if (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) || defined(__BIG_ENDIAN__) -#ifndef IS_BIGENDIAN -#define IS_BIGENDIAN -#endif -#endif - -#ifdef IS_BIGENDIAN -#define BE16SWAP(x) (x) -#define BE32SWAP(x) (x) -#define BE64SWAP(x) (x) -#define LE16SWAP(x) BOMSWAP16(x) -#define LE32SWAP(x) BOMSWAP32(x) -#define LE64SWAP(x) BOMSWAP64(x) - -#define BE16SWAP_CONST(x) (x) -#define BE32SWAP_CONST(x) (x) -#define BE64SWAP_CONST(x) (x) -#define LE16SWAP_CONST(x) BOMSWAP16_CONST(x) -#define LE32SWAP_CONST(x) BOMSWAP32_CONST(x) -#define LE64SWAP_CONST(x) BOMSWAP64_CONST(x) -#else -#define BE16SWAP(x) BOMSWAP16(x) -#define BE32SWAP(x) BOMSWAP32(x) -#define BE64SWAP(x) BOMSWAP64(x) -#define LE16SWAP(x) (x) -#define LE32SWAP(x) (x) -#define LE64SWAP(x) (x) - -#define BE16SWAP_CONST(x) BOMSWAP16_CONST(x) -#define BE32SWAP_CONST(x) BOMSWAP32_CONST(x) -#define BE64SWAP_CONST(x) BOMSWAP64_CONST(x) -#define LE16SWAP_CONST(x) (x) -#define LE32SWAP_CONST(x) (x) -#define LE64SWAP_CONST(x) (x) -#endif From 157100f2b4a68d27f46ff10a079fc2f16105e442 Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti <96613413+sonicdcer@users.noreply.github.com> Date: Mon, 15 Jun 2026 02:51:06 -0300 Subject: [PATCH 22/23] Refresh CI.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eaccfeb8..9c4b52ce 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [comment]: <> (Todo: Make Light Mode Image) [comment]: <> (Todo: Make Dark Mode Image) - + # Starship Lead Developers: From b96d7e4c530a11975b0f7a618253b9a0ea225880 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya0@users.noreply.github.com> Date: Mon, 15 Jun 2026 01:59:47 -0400 Subject: [PATCH 23/23] remove space from readme added in previous commit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c4b52ce..eaccfeb8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [comment]: <> (Todo: Make Light Mode Image) [comment]: <> (Todo: Make Dark Mode Image) - + # Starship Lead Developers: