From 4bc56aef26c1aa3fa1c2ca3486acb00738d5cb3c Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Sat, 10 Feb 2024 23:01:44 -0800 Subject: [PATCH] fix(zc): load default quest for sfx when loading replay Quests before custom sfx rely on the default quest providing sfx, but that wasn't being loaded when playing back a replay. So it would either use whatever the last quest loaded, or have nothing, which was the case for the replay test script. --- src/zc/zelda.cpp | 4 ++++ tests/replays/demons_inferno/demons_inferno_1_of_2.zplay | 4 ++-- tests/replays/demons_inferno/demons_inferno_2_of_2.zplay | 4 ++-- tests/replays/grassland_attack.zplay | 4 ++-- tests/replays/hell_awaits/hell_awaits_1_of_2.zplay | 4 ++-- tests/replays/hell_awaits/hell_awaits_2_of_2.zplay | 4 ++-- tests/run_replay_tests.py | 2 ++ 7 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/zc/zelda.cpp b/src/zc/zelda.cpp index 41fef09669..51d0e4c26b 100644 --- a/src/zc/zelda.cpp +++ b/src/zc/zelda.cpp @@ -4041,6 +4041,10 @@ static void load_replay_file(ReplayMode mode, std::string replay_file, int frame if (strlen(zc_get_config("zeldadx", "replay_snapshot", "")) > 0) replay_add_snapshot_frame(zc_get_config("zeldadx", "replay_snapshot", "")); + + // Older quests don't have a misc section, and QMisc isn't set by default except via loading the default quest. + // So do that here, since not all code paths to this will have done it already. + init_NES_mode(); } static bool load_replay_file_deffered_called = false; diff --git a/tests/replays/demons_inferno/demons_inferno_1_of_2.zplay b/tests/replays/demons_inferno/demons_inferno_1_of_2.zplay index 1f640b3d2e..d9d3792c45 100644 --- a/tests/replays/demons_inferno/demons_inferno_1_of_2.zplay +++ b/tests/replays/demons_inferno/demons_inferno_1_of_2.zplay @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2f4623b23286f6f3d0e4e1c919288c9beac9751058e55dfcc4435ac982bc4740 -size 1199143 +oid sha256:b62f8b24f0d1631e0244d16d0b40404bc8ee83d7538b805f7100d891a9f7fe49 +size 1202358 diff --git a/tests/replays/demons_inferno/demons_inferno_2_of_2.zplay b/tests/replays/demons_inferno/demons_inferno_2_of_2.zplay index 2cf22ac24c..1efb8e5836 100644 --- a/tests/replays/demons_inferno/demons_inferno_2_of_2.zplay +++ b/tests/replays/demons_inferno/demons_inferno_2_of_2.zplay @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d711adda97450ef4511eea24c59bc48629c18e29b3e58522a0c33a725446b5c1 -size 8481311 +oid sha256:3ab70b512b7ae0c1b423179921cf8c41938b98e9ce669974e03c3225d4e04810 +size 8512495 diff --git a/tests/replays/grassland_attack.zplay b/tests/replays/grassland_attack.zplay index 354d23d335..ebaacfc79f 100644 --- a/tests/replays/grassland_attack.zplay +++ b/tests/replays/grassland_attack.zplay @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:41519cf2c12e51a813cfd0628faf2d8487d05504d6e3d1322c51f1aa55f960e6 -size 583434 +oid sha256:7260b037832041f0ee9e47d537556bb730742defbf6798ae9b0fd0a6f1fd09f5 +size 584249 diff --git a/tests/replays/hell_awaits/hell_awaits_1_of_2.zplay b/tests/replays/hell_awaits/hell_awaits_1_of_2.zplay index ad3e563ea4..7cde02ba78 100644 --- a/tests/replays/hell_awaits/hell_awaits_1_of_2.zplay +++ b/tests/replays/hell_awaits/hell_awaits_1_of_2.zplay @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:28db06e6c5ff69920395b9a7d22561a6d8e016f282ea004515a103061d240990 -size 9056758 +oid sha256:629e5a14daee83f92727be6aa362736bcd49951f10a2d63eb7fdf9af676c80b1 +size 9094396 diff --git a/tests/replays/hell_awaits/hell_awaits_2_of_2.zplay b/tests/replays/hell_awaits/hell_awaits_2_of_2.zplay index 485dfb2d58..79dc9657e8 100644 --- a/tests/replays/hell_awaits/hell_awaits_2_of_2.zplay +++ b/tests/replays/hell_awaits/hell_awaits_2_of_2.zplay @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0d20539bea385145e59296ce7eaef0c08248f6afb1e992577ed372533481d9e1 -size 8004056 +oid sha256:79dd6f3a799e131d2bccf561e59fae793fe5346f4a70e066e0d51402b9a85293 +size 8043242 diff --git a/tests/run_replay_tests.py b/tests/run_replay_tests.py index 2b803ae2d6..fb9bfacaf9 100644 --- a/tests/run_replay_tests.py +++ b/tests/run_replay_tests.py @@ -264,6 +264,8 @@ def on_created(self, event): mode = 'assert' if args.update: mode = 'update' + if args.frame: + args.headless = False elif args.replay: mode = 'replay' else: