Fix intro FLIC brightness, 120/9 fps A/V sync, and authentic INTRO.EXE audio script

This commit is contained in:
Luxferre committed 2026-12-01 16:12:57 +02:00
1 parent 7673e25883
commit 5c2ac8e70f
9 files changed
+264 -38

No files matched your search

+35
View File
@@ -299,6 +299,41 @@ int main() {
CHECK(off_st.finite_ok && off_st.rms < 0.001f);
}
// 8. Intro SFX looping & targeted stop commands
{
eng.stop_music();
eng.set_engine_state(false, 0.0f, false, 0.0f);
eng.set_pitstop_state(false, false, 1.0f);
std::vector<float> settle(12000 * 2, 0.0f);
eng.mix_offline(settle.data(), 12000);
// HELEHIT.WAV (0-based idx 5, 0.702s) looped should still sound after 1.0s
eng.play_intro_sfx(5, 0.85f, true);
std::vector<float> first_sec(48000 * 2, 0.0f);
eng.mix_offline(first_sec.data(), 48000);
std::vector<float> quarter_sec(12000 * 2, 0.0f);
eng.mix_offline(quarter_sec.data(), 12000);
BufferStats loop_st = measure_buffer(quarter_sec, "Intro SFX looped (past sample end)");
CHECK(loop_st.finite_ok && loop_st.rms > 0.01f);
eng.stop_intro_sfx(5);
std::vector<float> silence_buf(4800 * 2, 0.0f);
eng.mix_offline(silence_buf.data(), 4800);
BufferStats stop_st = measure_buffer(silence_buf, "Intro SFX targeted stop");
CHECK(stop_st.finite_ok && stop_st.peak == 0.0f);
eng.play_intro_sfx(7, 0.62f, true); // FIRE.WAV
eng.play_intro_sfx(12, 0.62f, true); // SMALLCAR.WAV
eng.mix_offline(quarter_sec.data(), 12000);
BufferStats multi_st = measure_buffer(quarter_sec, "Intro SFX multi-voice loop");
CHECK(multi_st.finite_ok && multi_st.rms > 0.01f);
eng.stop_intro_sfx(-1);
eng.mix_offline(silence_buf.data(), 4800);
BufferStats stop_all_st = measure_buffer(silence_buf, "Intro SFX stop all");
CHECK(stop_all_st.finite_ok && stop_all_st.peak == 0.0f);
}
std::cout << "[PASS] AudioEngine, OPL3 FM, SoundFont SBK, Normalization & Limiter validated\n";
return 0;
}