From 1fd27d7fb7daa72255349545ac55778a09e9f918 Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Wed, 10 Jul 2024 17:04:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=9F=B3=E9=A2=91=E6=B5=81?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=8D=E5=A4=9F=E6=97=B6=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/MyNes.Core/MyNesMain.cs | 1 + .../Assets/Scene/EmuTest.unity | 4 ++-- .../Assets/Script/Emu/AudioProvider.cs | 12 ++++------ .../ProjectSettings/ProjectSettings.asset | 22 ++++++++++++------- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/MyNes.Core/MyNesMain.cs b/AxibugEmuOnline.Client/Assets/MyNes.Core/MyNesMain.cs index 20c6979..77ad1e7 100644 --- a/AxibugEmuOnline.Client/Assets/MyNes.Core/MyNesMain.cs +++ b/AxibugEmuOnline.Client/Assets/MyNes.Core/MyNesMain.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; +using UnityEngine; namespace MyNes.Core { diff --git a/AxibugEmuOnline.Client/Assets/Scene/EmuTest.unity b/AxibugEmuOnline.Client/Assets/Scene/EmuTest.unity index a9a232b..d995976 100644 --- a/AxibugEmuOnline.Client/Assets/Scene/EmuTest.unity +++ b/AxibugEmuOnline.Client/Assets/Scene/EmuTest.unity @@ -167,8 +167,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ac8cd27a180bf3e489b2ca27c821bffe, type: 3} m_Name: m_EditorClassIdentifier: - VideoCom: {fileID: 0} - AudioCom: {fileID: 0} + VideoCom: {fileID: 730321753} + AudioCom: {fileID: 1379369700} --- !u!1 &455467288 GameObject: m_ObjectHideFlags: 0 diff --git a/AxibugEmuOnline.Client/Assets/Script/Emu/AudioProvider.cs b/AxibugEmuOnline.Client/Assets/Script/Emu/AudioProvider.cs index 497d808..fc25771 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Emu/AudioProvider.cs +++ b/AxibugEmuOnline.Client/Assets/Script/Emu/AudioProvider.cs @@ -34,22 +34,18 @@ namespace AxibugEmuOnline.Client m_as.Play(); } + float lastData = 0; void OnAudioFilterRead(float[] data, int channels) { - while (_buffer.Count >= data.Length / 2) - { - //Thread.Sleep(10); - break; - } - int step = channels; for (int i = 0; i < data.Length; i += step) { - var rawData = _buffer.Count > 0 ? _buffer.Dequeue() : 0; - var rawFloat = rawData / 124f; + var rawFloat = _buffer.Count > 0 ? (_buffer.Dequeue() / 124f) : lastData; data[i] = rawFloat; for (int fill = 1; fill < step; fill++) data[i + fill] = rawFloat; + + lastData = rawFloat; } } diff --git a/AxibugEmuOnline.Client/ProjectSettings/ProjectSettings.asset b/AxibugEmuOnline.Client/ProjectSettings/ProjectSettings.asset index 129a36f..1551015 100644 --- a/AxibugEmuOnline.Client/ProjectSettings/ProjectSettings.asset +++ b/AxibugEmuOnline.Client/ProjectSettings/ProjectSettings.asset @@ -155,13 +155,18 @@ PlayerSettings: useHDRDisplay: 0 hdrBitDepth: 0 m_ColorGamuts: 00000000 - targetPixelDensity: 0 + targetPixelDensity: 30 resolutionScalingMode: 0 resetResolutionOnWindowResize: 0 androidSupportedAspectRatio: 1 androidMaxAspectRatio: 2.1 - applicationIdentifier: {} - buildNumber: {} + applicationIdentifier: + Standalone: com.DefaultCompany.AxibugEmuOnline.Client + buildNumber: + Standalone: 0 + VisionOS: 0 + iPhone: 0 + tvOS: 0 overrideDefaultApplicationIdentifier: 0 AndroidBundleVersionCode: 1 AndroidMinSdkVersion: 22 @@ -180,12 +185,12 @@ PlayerSettings: strictShaderVariantMatching: 0 VertexChannelCompressionMask: 4054 iPhoneSdkVersion: 988 - iOSTargetOSVersionString: + iOSTargetOSVersionString: 12.0 tvOSSdkVersion: 0 tvOSRequireExtendedGameController: 0 - tvOSTargetOSVersionString: + tvOSTargetOSVersionString: 12.0 VisionOSSdkVersion: 0 - VisionOSTargetOSVersionString: + VisionOSTargetOSVersionString: 1.0 uIPrerenderedIcon: 0 uIRequiresPersistentWiFi: 0 uIRequiresFullScreen: 1 @@ -313,7 +318,7 @@ PlayerSettings: locationUsageDescription: microphoneUsageDescription: bluetoothUsageDescription: - macOSTargetOSVersion: + macOSTargetOSVersion: 10.13.0 switchNMETAOverride: switchNetLibKey: switchSocketMemoryPoolSize: 6144 @@ -563,7 +568,8 @@ PlayerSettings: scriptingDefineSymbols: {} additionalCompilerArguments: {} platformArchitecture: {} - scriptingBackend: {} + scriptingBackend: + Standalone: 1 il2cppCompilerConfiguration: {} il2cppCodeGeneration: {} managedStrippingLevel: {}