Port NVIDIA Wave32 lowering, smooth movie-plane uploads, XMA audio fixes, and 32GB RAM residency budgets

This commit is contained in:
codec_d committed 2026-11-25 15:31:19 -08:00
1 parent 45e90f4de8
commit 3bcc96f9bb
11 files changed
+463 -110

No files matched your search

+21 -3
View File
@@ -517,7 +517,16 @@ fn pump(context: Context, voice: &mut Voice) {
return;
}
while context.field(1, 31, 1) == 1 {
if voice.pcm.len() < SAMPLES_PER_BLOCK && !decode(context, voice) {
// A skipped frame or an input boundary can advance the decoder without
// producing samples. Publish only complete blocks, except the final
// padded tail. Limit empty steps so a broken looping voice cannot hold
// its lock or stall other voices for the whole decoding pass.
for _ in 0..8 {
if voice.pcm.len() >= SAMPLES_PER_BLOCK || !decode(context, voice) {
break;
}
}
if voice.pcm.is_empty() || (voice.pcm.len() < SAMPLES_PER_BLOCK && !voice.ended) {
return;
}
// The write block is the title's too: taken modulo the ring before
@@ -549,12 +558,21 @@ fn pump(context: Context, voice: &mut Voice) {
/// Decodes the next frame of the current input into `voice.pcm`; false
/// when there is nothing left to decode.
fn decode(context: Context, voice: &mut Voice) -> bool {
let valid = context.field(0, 20, 2);
if voice.ended {
return false;
// The title can refill either input while the context stays enabled.
// Flush the previous tail once and leave the ring idle until a valid
// buffer is published. The decoder resets its overlap when flushed.
if valid == 0 {
return false;
}
voice.ended = false;
if context.field(2, 26, 5) == INPUT_INVALID {
context.set_field(2, 26, 6, 0);
}
}
let channels = context.channels();
let mut current = context.field(4, 31, 1);
let valid = context.field(0, 20, 2);
if valid & (1 << current) == 0 {
if valid & (1 << (1 - current)) == 0 {
// Out of input: the overlap tail, then nothing.