Run the sound manager's job at 60 Hz with whole steps above 60 fps.

The job (main+0x415300) hands the time manager's step to the sound system in its phase 0 and runs the sound objects'
and the system's updates in phases 1 and 2. With the set ostep that step is a fraction of a frame above 60 fps, and fed
fractions the game has been reported to keep sounds held after an area unloaded until no voice was free, new sounds
and then the music going silent until a restart. The new set osound (sound_steps, on by default) calls the page's
+0xf10 after the job's prologue: phase 0 adds the step to what the job is owed and runs once a whole step has built
up, phases 1 and 2 follow that choice, and a job that does not run gets phase 3, which returns through its own
epilogue. After phase 0's load of the step the page's +0xf00 makes a fraction one whole step. At 60 fps and below
the job runs every frame with the game's step. Both sites were checked against the module; frame_step_check covers
the gate at 60, 30, 144 and 240 fps. Needs the game code generated again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-13 05:50:19 -05:00
parent f512a98988
commit 328554e7c6
8 changed files with 157 additions and 4 deletions

View File

@@ -33,12 +33,15 @@ uint8_t rt_patch_on[RT_PATCH_COUNT > 0 ? RT_PATCH_COUNT : 1]; // read by the g
#include "debug_tools.h"
__attribute__((constructor)) static void freecam_register(void) { rt_register_host(RT_PATCH_PAGE + 0xf70, dbg_freecam_host); }
// The time of day's site of the set ostep (patches-v111.txt) calls the page's +0xf60, the water renderer's site its
// +0xf50, and the surfaces' fixed-step sites of the set owater its +0xf20 (frame_rate.c).
// +0xf50, the surfaces' fixed-step sites of the set owater its +0xf20, and the sound job's two sites of the set osound
// its +0xf10 and +0xf00 (frame_rate.c).
__attribute__((constructor)) static void day_register(void) {
if (!RT_V111) return;
rt_register_host(RT_PATCH_PAGE + 0xf60, frame_rate_day_host);
rt_register_host(RT_PATCH_PAGE + 0xf50, frame_rate_water_host);
rt_register_host(RT_PATCH_PAGE + 0xf20, frame_rate_sim_host);
rt_register_host(RT_PATCH_PAGE + 0xf10, frame_rate_sound_gate_host);
rt_register_host(RT_PATCH_PAGE + 0xf00, frame_rate_sound_step_host);
}
#endif