diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Essgee.Unity/AxiMemory.cs b/AxibugEmuOnline.Client/Assets/Plugins/Essgee.Unity/AxiMemory.cs index ce03876d..159b9fa8 100644 --- a/AxibugEmuOnline.Client/Assets/Plugins/Essgee.Unity/AxiMemory.cs +++ b/AxibugEmuOnline.Client/Assets/Plugins/Essgee.Unity/AxiMemory.cs @@ -82,7 +82,6 @@ namespace Essgee.Utilities } } #endregion - public static void Write(this System.IO.BinaryWriter bw, byte* bufferPtr, int offset, int count) { // 使用指针复制数据到临时数组 @@ -90,21 +89,22 @@ namespace Essgee.Utilities // 使用BinaryWriter写入临时数组 bw.Write(TempBuffer_src, 0, count); } - public static void Write(this System.IO.FileStream fs, byte* bufferPtr, int offset, int count) - { - // 使用指针复制数据到临时数组 - Buffer.MemoryCopy(bufferPtr + offset, TempBuffer, 0, count); - // 使用BinaryWriter写入临时数组 - fs.Write(TempBuffer_src, 0, count); - } - public static int Read(this System.IO.FileStream fs, byte* bufferPtr, int offset, int count) - { - // 使用BinaryWriter写入临时数组 - count = fs.Read(TempBuffer_src, offset, count); - // 使用指针复制数据到临时数组 - Buffer.MemoryCopy(TempBuffer, bufferPtr + offset, 0, count); - return count; - } + + //public static void Write(this System.IO.FileStream fs, byte* bufferPtr, int offset, int count) + //{ + // // 使用指针复制数据到临时数组 + // Buffer.MemoryCopy(bufferPtr + offset, TempBuffer, 0, count); + // // 使用BinaryWriter写入临时数组 + // fs.Write(TempBuffer_src, 0, count); + //} + //public static int Read(this System.IO.FileStream fs, byte* bufferPtr, int offset, int count) + //{ + // // 使用BinaryWriter写入临时数组 + // count = fs.Read(TempBuffer_src, offset, count); + // // 使用指针复制数据到临时数组 + // Buffer.MemoryCopy(TempBuffer, bufferPtr + offset, 0, count); + // return count; + //} } internal unsafe static class AxiArray diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Essgee.Unity/Emulation/CartridgeLoader.cs b/AxibugEmuOnline.Client/Assets/Plugins/Essgee.Unity/Emulation/CartridgeLoader.cs index 1bd992b1..4bd9b3e3 100644 --- a/AxibugEmuOnline.Client/Assets/Plugins/Essgee.Unity/Emulation/CartridgeLoader.cs +++ b/AxibugEmuOnline.Client/Assets/Plugins/Essgee.Unity/Emulation/CartridgeLoader.cs @@ -39,6 +39,7 @@ namespace Essgee.Emulation var fileExtension = System.IO.Path.GetExtension(fileName); if (fileExtension == ".zip") { + UnityEngine.Debug.Log("使用ZipFile.Open解压Zip:"+fileName); using (var zip = ZipFile.Open(fileName, ZipArchiveMode.Read)) { foreach (var entry in zip.Entries) @@ -60,7 +61,7 @@ namespace Essgee.Emulation else if (fileExtensionSystemDictionary.ContainsKey(fileExtension)) { machineType = fileExtensionSystemDictionary[fileExtension]; - romData = System.IO.File.ReadAllBytes(fileName); + romData = EmulatorHandler.io.File_ReadAllBytes(fileName); } } catch (Exception ex) when (!AppEnvironment.DebugMode) diff --git a/AxibugEmuOnline.Client/Assets/Plugins/IngameDebugConsole/Scripts/DebugLogManager.cs b/AxibugEmuOnline.Client/Assets/Plugins/IngameDebugConsole/Scripts/DebugLogManager.cs index 0237a95e..388dcbe4 100644 --- a/AxibugEmuOnline.Client/Assets/Plugins/IngameDebugConsole/Scripts/DebugLogManager.cs +++ b/AxibugEmuOnline.Client/Assets/Plugins/IngameDebugConsole/Scripts/DebugLogManager.cs @@ -1805,7 +1805,9 @@ namespace IngameDebugConsole public void SaveLogsToFile( string filePath ) { +#if !UNITY_SWITCH File.WriteAllText( filePath, GetAllLogs() ); +#endif Debug.Log( "Logs saved to: " + filePath ); } @@ -1815,7 +1817,7 @@ namespace IngameDebugConsole if( !avoidScreenCutout ) return; -#if UNITY_2017_2_OR_NEWER && ( UNITY_EDITOR || UNITY_ANDROID || UNITY_IOS ) +#if UNITY_2017_2_OR_NEWER && (UNITY_EDITOR || UNITY_ANDROID || UNITY_IOS) // Check if there is a cutout at the top of the screen int screenHeight = Screen.height; float safeYMax = Screen.safeArea.yMax; diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/WavWrite.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/WavWrite.cs index e1afab9a..f269c3af 100644 --- a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/WavWrite.cs +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/WavWrite.cs @@ -1,4 +1,4 @@ - +#if !UNITY_SWITCH using System.IO; namespace MAME.Core @@ -81,4 +81,5 @@ namespace MAME.Core mWriter.Flush(); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Plugins/StoicGooseUnity/AxiMemory.cs b/AxibugEmuOnline.Client/Assets/Plugins/StoicGooseUnity/AxiMemory.cs index 839268b8..ea12178c 100644 --- a/AxibugEmuOnline.Client/Assets/Plugins/StoicGooseUnity/AxiMemory.cs +++ b/AxibugEmuOnline.Client/Assets/Plugins/StoicGooseUnity/AxiMemory.cs @@ -93,7 +93,6 @@ namespace StoicGooseUnity } } #endregion - public static void Write(this System.IO.BinaryWriter bw, byte* bufferPtr, int offset, int count) { // 使用指针复制数据到临时数组 @@ -101,6 +100,7 @@ namespace StoicGooseUnity // 使用BinaryWriter写入临时数组 bw.Write(TempBuffer_src, 0, count); } + /* public static void Write(this System.IO.FileStream fs, byte* bufferPtr, int offset, int count) { // 使用指针复制数据到临时数组 @@ -115,7 +115,7 @@ namespace StoicGooseUnity // 使用指针复制数据到临时数组 Buffer.MemoryCopy(TempBuffer, bufferPtr + offset, 0, count); return count; - } + }*/ } internal unsafe static class AxiArray diff --git a/AxibugEmuOnline.Client/Assets/Plugins/UIEffect_v2018/Scripts/Common/MaterialResolver.cs b/AxibugEmuOnline.Client/Assets/Plugins/UIEffect_v2018/Scripts/Common/MaterialResolver.cs index 821b8a80..3640bb41 100644 --- a/AxibugEmuOnline.Client/Assets/Plugins/UIEffect_v2018/Scripts/Common/MaterialResolver.cs +++ b/AxibugEmuOnline.Client/Assets/Plugins/UIEffect_v2018/Scripts/Common/MaterialResolver.cs @@ -66,6 +66,10 @@ namespace Coffee.UIExtensions static void SaveMaterial(Material mat, Shader shader, bool isMainAsset) { +#if !UNITY_EDITOR + return; +#endif + string materialPath = GetDefaultMaterialPath(shader); #if UIEFFECT_SEPARATE