forked from sin365/AxibugEmuOnline
MAME:解决SWITCH平台NEOGEO闪退问题,本质NVRAM文件检测导致
This commit is contained in:
parent
501f87c4f1
commit
d2cc4fa05d
@ -378,9 +378,9 @@ namespace MAME.Core
|
||||
|
||||
public static void nvram_handler_load_neogeo()
|
||||
{
|
||||
if (MameMainMotion.IoSupport.File_Exists("nvram\\" + Machine.sName + ".nv"))
|
||||
if (MameMainMotion.resource.getnvram(Machine.sName,out byte[] data))
|
||||
{
|
||||
MameMainMotion.IoSupport.File_ReadAllBytes("nvram\\" + Machine.sName + ".nv");
|
||||
mainram2_set = data;
|
||||
//FileStream fs1 = new FileStream("nvram\\" + Machine.sName + ".nv", FileMode.Open);
|
||||
//int n = (int)fs1.Length;
|
||||
//fs1.Read(mainram2, 0, n);
|
||||
|
||||
@ -13,5 +13,6 @@
|
||||
byte[] _1 { get; }
|
||||
byte[] readme { get; }
|
||||
string mame { get; }
|
||||
bool getnvram(string sName,out byte[] data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 866081b364edae242bc388b4f2fab6f8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 36b7809304e9e8b4890425b0441c3d65
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7d71b0c3073e6c043be8e55da918aed4
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -26,4 +26,16 @@ public class UniResources : IResources
|
||||
public byte[] readme => Resources.Load<TextAsset>(ResourceRoot + "readme.txt").bytes;
|
||||
|
||||
public string mame => Resources.Load<TextAsset>(ResourceRoot + "mame.xml").text;//ok
|
||||
|
||||
public bool getnvram(string sName, out byte[] data)
|
||||
{
|
||||
TextAsset asset = Resources.Load<TextAsset>(ResourceRoot + "nvram/" + sName + ".nv");
|
||||
if (asset == null)
|
||||
{
|
||||
data = null;
|
||||
return false;
|
||||
}
|
||||
data = asset.bytes;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user