From 72a1b76ba071980db97c3282cb6aa324243623ba Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Fri, 16 Aug 2024 10:29:51 +0800 Subject: [PATCH] =?UTF-8?q?Rom=E4=BB=8ERomLib=E8=AF=BB=E5=8F=96=E5=90=8E,?= =?UTF-8?q?=E4=B8=80=E4=BA=9BRom=E4=BF=A1=E6=81=AF=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=85=A5=E5=8F=A3=E7=9A=84=E5=96=84=E5=90=8E=E5=B7=A5=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Script/NesEmulator/CoreSupporter.cs | 18 +++++------------- .../VirtualNes.Core/CoreLibs/MemoryUtility.cs | 1 + 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/CoreSupporter.cs b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/CoreSupporter.cs index 31c63cb..f7786e5 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/CoreSupporter.cs +++ b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/CoreSupporter.cs @@ -8,17 +8,6 @@ namespace AxibugEmuOnline.Client { public class CoreSupporter : ISupporterImpl { - private static string RomDirectoryPath - { - get - { -#if UNITY_EDITOR - return "Assets/StreamingAssets/NES/Roms"; -#else - return $"{Application.streamingAssetsPath}/NES/Roms"; -#endif - } - } public Stream OpenRom(string fname) { @@ -38,8 +27,11 @@ namespace AxibugEmuOnline.Client public void GetRomPathInfo(string fname, out string fullPath, out string directPath) { - directPath = RomDirectoryPath; - fullPath = $"{directPath}/{fname}"; + var romFile = AppAxibugEmuOnline.romLib.GetNesRomFile(fname); + UnityEngine.Debug.Assert(romFile != null); + + fullPath = romFile.LocalFilePath; + directPath = Path.GetDirectoryName(fullPath); } public Stream OpenFile_DISKSYS() diff --git a/AxibugEmuOnline.Client/Assets/VirtualNes.Core/CoreLibs/MemoryUtility.cs b/AxibugEmuOnline.Client/Assets/VirtualNes.Core/CoreLibs/MemoryUtility.cs index 4f376fd..eea81c1 100644 --- a/AxibugEmuOnline.Client/Assets/VirtualNes.Core/CoreLibs/MemoryUtility.cs +++ b/AxibugEmuOnline.Client/Assets/VirtualNes.Core/CoreLibs/MemoryUtility.cs @@ -1,4 +1,5 @@ using System; +using System.Runtime.CompilerServices; namespace VirtualNes.Core {