From acf1071ea2ef0c059040ba391c31dba187ec223c Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Mon, 15 Sep 2025 18:35:48 +0800 Subject: [PATCH] =?UTF-8?q?Mame=20NEOGEO=20SoundStream=20Monkey=20Patch(?= =?UTF-8?q?=E6=9A=82=E6=97=B6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Plugins/Mame.Core/sound/Streams.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Streams.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Streams.cs index 21eb07f0..32407a9b 100644 --- a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Streams.cs +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/Streams.cs @@ -112,7 +112,15 @@ namespace MAME.Core int samples_to_lose = output_bufindex - max_samples_per_update; for (i = 0; i < streamoutput.Length; i++) { - for (j = 0; j < max_samples_per_update; j++) + //src; + //for (j = 0; j < max_samples_per_update; j++) + //{ + // streamoutput[i][j] = streamoutput[i][samples_to_lose + j]; + //} + + //这是一个Monkey Patch, 这里一维数组是0~2,二位数组可能不正常 + int maxcount = Math.Min(streamoutput[i].Length, max_samples_per_update); + for (j = 0; j < maxcount; j++) { streamoutput[i][j] = streamoutput[i][samples_to_lose + j]; }