Expand description
WipEout’s retail note owner, pinned by the tests that came with it.
WipEout’s PAL sound driver (PlayNote at 8003f2fc, UpdateNotes at
8003ec80) shares channels 1 to 23 between effects and loops, never uses
channel 0, and decides everything audible from three numbers per channel
and a program-to-channel table. Owner is that logic with no hardware in
it. It is the reference a Policy::StrictRetail
lane is held to: the differential test in this module drives an Owner and
a StrictRetail mixer lane through the same long sequence and requires the
same channel every time.
What an Owner has that a mixer lane does not is retail’s bookkeeping around
the allocation: the program-to-channel table that Owner::kill follows
even after the channel was reused, the eight-update release, the fade
window, and the pause save and restore. A game replaying retail behaviour
uses Owner for those and the lane for everything else.
The shared policy and the duration cadence are confirmed against the PAL retail build; the NTSC retail build has not been checked.
§Example
use psx_sfx::retail::Owner;
let mut owner = Owner::new();
// A loop (duration -1) takes channel 1 and is never stolen.
assert_eq!(owner.play(19, 0, -1), Some(1));
// An effect of priority 1 lasting 20 updates takes the next free channel.
assert_eq!(owner.play(7, 1, 20), Some(2));Structs§
- Channel
- One channel of the owner.
- Owner
- The channel table and program map.
- Update
- What one
Owner::updateasks the hardware to do.
Constants§
- NOTE_
FADE_ STEPS - Updates before the end of a note during which its volume fades.
- NOTE_
RELEASE - Updates a killed note keeps playing before it is released.
- PROGRAMS
- Program identities: 35 original, plus 7 for the second local player.