From 5a0f13f7948da17acddab00de8d6a25801d4c2e9 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Sat, 21 Jun 2025 01:34:58 -0300 Subject: [PATCH] simplify recordings --- include/fox_record.h | 5 ++-- src/engine/fox_demo.c | 8 +----- src/overlays/ovl_i1/fox_co.c | 54 +++++++++++++++++++----------------- src/overlays/ovl_i2/fox_me.c | 17 +++--------- src/overlays/ovl_i5/fox_ma.c | 38 ++++++++++++------------- src/overlays/ovl_i6/fox_sy.c | 14 +++------- 6 files changed, 59 insertions(+), 77 deletions(-) diff --git a/include/fox_record.h b/include/fox_record.h index 1fbfd3ff..ec4ba827 100644 --- a/include/fox_record.h +++ b/include/fox_record.h @@ -14,9 +14,8 @@ typedef struct Record { u16 frame; } Record; -extern u8 gCarrierCutsceneRecord[200]; +extern Record gCarrierCutsceneRecord[13]; -void UpdateVisPerFrameFromRecording(u8* record, s32 maxFrames); -void UpdateVisPerFrameFromRecording2(Record* record, s32 maxFrames); +void UpdateVisPerFrameFromRecording(Record* record, s32 maxFrames); #endif diff --git a/src/engine/fox_demo.c b/src/engine/fox_demo.c index c3315a63..ed5334fa 100644 --- a/src/engine/fox_demo.c +++ b/src/engine/fox_demo.c @@ -22,13 +22,7 @@ #include "fox_co.h" #include "fox_record.h" -void UpdateVisPerFrameFromRecording(u8* record, s32 maxFrames) { - if (gCsFrameCount < maxFrames) { - gVIsPerFrame = record[gCsFrameCount]; - } -} - -void UpdateVisPerFrameFromRecording2(Record* record, s32 maxFrames) { +void UpdateVisPerFrameFromRecording(Record* record, s32 maxFrames) { int i; if (gCsFrameCount > record[maxFrames - 1].frame) { diff --git a/src/overlays/ovl_i1/fox_co.c b/src/overlays/ovl_i1/fox_co.c index a3cd7257..e1a6ddf2 100644 --- a/src/overlays/ovl_i1/fox_co.c +++ b/src/overlays/ovl_i1/fox_co.c @@ -12,31 +12,37 @@ #include "fox_record.h" // Carrier destroy cutscene timings recorded from a real N64 -u8 gCarrierCutsceneRecord[200] = { - 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x04, 0x05, 0x05, 0x04, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 +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 -u8 gGrangaCutsceneRecord[161] = { - 0x02, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x03, 0x03, 0x02, 0x03, 0x03, 0x02 +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; @@ -211,9 +217,7 @@ void Corneria_CoGranga_HandleDamage(CoGranga* this) { this->state = GRANGA_EXPLODE; - this->timer_050 = 100; // original value - // @port: Adjust timing to compensate the lack of lag. - // this->timer_050 = 138; // @port + this->timer_050 = 100; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 80); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 80); diff --git a/src/overlays/ovl_i2/fox_me.c b/src/overlays/ovl_i2/fox_me.c index 8e77d794..f2cec042 100644 --- a/src/overlays/ovl_i2/fox_me.c +++ b/src/overlays/ovl_i2/fox_me.c @@ -9,19 +9,10 @@ #include "fox_record.h" // MeCrusher destroy cutscene timings recorded from a real N64 -u8 gMeCrusherCutsceneRecord[] = { - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02 +Record gMeCrusherCutsceneRecord[] = { + { 2, 0 }, + { 3, 200 }, + { 2, 224 }, }; Vec3f D_i2_80195430[] = { diff --git a/src/overlays/ovl_i5/fox_ma.c b/src/overlays/ovl_i5/fox_ma.c index 0db5a77f..edc31257 100644 --- a/src/overlays/ovl_i5/fox_ma.c +++ b/src/overlays/ovl_i5/fox_ma.c @@ -61,26 +61,26 @@ Vec3f D_i5_801BE6A0[12]; s32 D_i5_801BE734[4]; // Train cutscene timings recorded from a real N64 -Record sf64_virecord_macbeth_records[] = { +Record gMacbethCutsceneRecord[] = { // Train breaking barriers - { 0x02, 0x000000 }, - { 0x03, 0x000002 }, - { 0x02, 0x00001F }, - { 0x03, 0x000190 }, - { 0x02, 0x0001A2 }, - { 0x03, 0x0001B1 }, - { 0x04, 0x0001B3 }, - { 0x03, 0x0001BC }, - { 0x02, 0x0001FD }, - // { 0x03, 0x00022F }, - // { 0x02, 0x000245 }, - // { 0x03, 0x00024B }, + { 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 - { 0x02, 0x00024D }, - { 0x03, 0x0002CA }, - { 0x04, 0x000335 }, - { 0x05, 0x000351 }, - { 0x02, 0x0003AE }, + { 2, 589 }, + { 3, 714 }, + { 4, 821 }, + { 5, 849 }, + { 2, 942 }, }; UnkStruct_D_i5_801B8E50 D_i5_801B8E50[156] = { @@ -6509,7 +6509,7 @@ void Macbeth_LevelComplete2(Player* player) { Vec3f spD8; f32 zeroVar = 0.0f; - UpdateVisPerFrameFromRecording2(sf64_virecord_macbeth_records, ARRAY_COUNT(sf64_virecord_macbeth_records)); + UpdateVisPerFrameFromRecording(gMacbethCutsceneRecord, ARRAY_COUNT(gMacbethCutsceneRecord)); switch (player->csState) { case 0: diff --git a/src/overlays/ovl_i6/fox_sy.c b/src/overlays/ovl_i6/fox_sy.c index da5153c3..c8120187 100644 --- a/src/overlays/ovl_i6/fox_sy.c +++ b/src/overlays/ovl_i6/fox_sy.c @@ -31,16 +31,10 @@ 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 -u8 gSyRobotCutsceneRecord[158] = { - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02 +Record gSyRobotCutsceneRecord[] = { + { 2, 0 }, + { 3, 129 }, + { 2, 230 }, }; f32 D_i6_801A8440[3];