From d62b3f4467e43ac26584d5c08dc1d05a84f6f624 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Sun, 7 Mar 2021 19:15:40 -0700 Subject: [PATCH] mcpx/apu: Leave voice active at EOL if persist set --- hw/xbox/mcpx/apu.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/xbox/mcpx/apu.c b/hw/xbox/mcpx/apu.c index 399b7f0497..66540222e8 100644 --- a/hw/xbox/mcpx/apu.c +++ b/hw/xbox/mcpx/apu.c @@ -1868,8 +1868,14 @@ static int voice_get_samples(MCPXAPUState *d, uint32_t v, float samples[][2], voice_set_mask(d, v, NV_PAVS_VOICE_PAR_OFFSET, NV_PAVS_VOICE_PAR_OFFSET_CBO, 0); d->vp.ssl[v].ssl_seg = 0; - d->vp.ssl[v].ssl_index = 0; - voice_off(d, v); + if (!persist) { + d->vp.ssl[v].ssl_index = 0; + voice_off(d, v); + } else { + set_notify_status( + d, v, MCPX_HW_NOTIFIER_SSLA_DONE + d->vp.ssl[v].ssl_index, + NV1BA0_NOTIFICATION_STATUS_DONE_SUCCESS); + } return -1; } @@ -2028,9 +2034,6 @@ static int voice_get_samples(MCPXAPUState *d, uint32_t v, float samples[][2], set_notify_status(d, v, MCPX_HW_NOTIFIER_SSLA_DONE + ssl_index, NV1BA0_NOTIFICATION_STATUS_DONE_SUCCESS); } - if (d->vp.ssl[v].count[d->vp.ssl[v].ssl_index] == 0) { - voice_off(d, v); - } } else { if (loop) { cbo = lbo;