Compare commits
No commits in common. "c7f32874ae8f451853458a8794777529dfa4a8b9" and "16adace2102c7473dfeb84d5dbabba149d156701" have entirely different histories.
c7f32874ae
...
16adace210
@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ccf426abdad56c74682de4e38b3048e3
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,14 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 29131082dba8d234481296f0cf29a1fe, type: 3}
|
||||
m_Name: ROMDB
|
||||
m_EditorClassIdentifier:
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31d7b6b33f06e3d468b409ab9e71bf1f
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 319a1a12506a5334ebd963b4fd991c2a
|
||||
guid: 6b52033f7628c4346a6dd0b2806e75ee
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
@ -0,0 +1,40 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!84 &8400000
|
||||
RenderTexture:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: RenderTexture
|
||||
m_ImageContentsHash:
|
||||
serializedVersion: 2
|
||||
Hash: 00000000000000000000000000000000
|
||||
m_ForcedFallbackFormat: 4
|
||||
m_DownscaleFallback: 0
|
||||
m_IsAlphaChannelOptional: 0
|
||||
serializedVersion: 5
|
||||
m_Width: 256
|
||||
m_Height: 240
|
||||
m_AntiAliasing: 1
|
||||
m_MipCount: -1
|
||||
m_DepthStencilFormat: 92
|
||||
m_ColorFormat: 8
|
||||
m_MipMap: 0
|
||||
m_GenerateMips: 1
|
||||
m_SRGB: 0
|
||||
m_UseDynamicScale: 0
|
||||
m_BindMS: 0
|
||||
m_EnableCompatibleFormat: 1
|
||||
m_EnableRandomWrite: 0
|
||||
m_TextureSettings:
|
||||
serializedVersion: 2
|
||||
m_FilterMode: 1
|
||||
m_Aniso: 0
|
||||
m_MipBias: 0
|
||||
m_WrapU: 1
|
||||
m_WrapV: 1
|
||||
m_WrapW: 1
|
||||
m_Dimension: 2
|
||||
m_VolumeDepth: 1
|
||||
m_ShadowSamplingMode: 2
|
@ -1,8 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 42cbfafb123e63b45841ae95eb432053
|
||||
guid: 6645567e4c11d9447b1aee2406f681c5
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +1,8 @@
|
||||
using AxibugEmuOnline.Client.ClientCore;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using System.Net.Http;
|
||||
using UnityEngine;
|
||||
using VirtualNes.Core;
|
||||
|
||||
@ -15,9 +15,9 @@ namespace AxibugEmuOnline.Client
|
||||
get
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
return "Assets/StreamingAssets/NES/Roms";
|
||||
return "Assets/StreamingAssets/Roms";
|
||||
#else
|
||||
return $"{Application.streamingAssetsPath}/NES/Roms";
|
||||
return $"{Application.streamingAssetsPath}/Roms";
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -44,7 +44,7 @@ namespace AxibugEmuOnline.Client
|
||||
|
||||
public Stream OpenFile_DISKSYS()
|
||||
{
|
||||
return new MemoryStream(Resources.Load<TextAsset>("NES/Disksys.rom").bytes);
|
||||
return File.Open($"{Application.streamingAssetsPath}/Disksys.rom", FileMode.Open, FileAccess.Read);
|
||||
}
|
||||
|
||||
public void SaveSRAMToFile(byte[] sramContent, string romName)
|
||||
@ -92,11 +92,5 @@ namespace AxibugEmuOnline.Client
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public bool TryGetMapperNo(ROM rom, out int mapperNo)
|
||||
{
|
||||
var db = Resources.Load<RomDB>("NES/ROMDB");
|
||||
return db.GetMapperNo(rom.GetPROM_CRC(), out mapperNo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
using AxibugEmuOnline.Client.ClientCore;
|
||||
using System;
|
||||
using System.Xml.Linq;
|
||||
using UnityEngine;
|
||||
using VirtualNes.Core;
|
||||
using VirtualNes.Core.Debug;
|
||||
@ -58,29 +56,5 @@ namespace AxibugEmuOnline.Client
|
||||
AudioProvider.ProcessSound(m_nesIns);
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[ContextMenu("IMPORT")]
|
||||
public void TTTA()
|
||||
{
|
||||
var db = Resources.Load<RomDB>("NES/ROMDB");
|
||||
db.Clear();
|
||||
|
||||
var dbFile = Resources.Load<TextAsset>("NES/nes20db");
|
||||
var xml = XDocument.Parse(dbFile.text);
|
||||
var games = xml.Element("nes20db").Elements("game");
|
||||
foreach (var game in games)
|
||||
{
|
||||
var crcStr = game.Element("rom").Attribute("crc32").Value;
|
||||
var crc = uint.Parse($"{crcStr}", System.Globalization.NumberStyles.HexNumber);
|
||||
|
||||
var mapper = int.Parse($"{game.Element("pcb").Attribute("mapper").Value}");
|
||||
|
||||
db.AddInfo(new RomDB.RomInfo { CRC = crc, Mapper = mapper });
|
||||
}
|
||||
|
||||
UnityEditor.AssetDatabase.SaveAssets();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -1,55 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AxibugEmuOnline.Client.ClientCore
|
||||
{
|
||||
public class RomDB : ScriptableObject
|
||||
{
|
||||
[SerializeField]
|
||||
private List<RomInfo> romInfos = new List<RomInfo>();
|
||||
|
||||
private Dictionary<uint, RomInfo> crc_Info_mapper;
|
||||
|
||||
public void AddInfo(RomInfo romInfo)
|
||||
{
|
||||
romInfos.Add(romInfo);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
romInfos.Clear();
|
||||
}
|
||||
|
||||
public bool GetMapperNo(uint crc, out int mapperNo)
|
||||
{
|
||||
if (crc_Info_mapper == null)
|
||||
{
|
||||
crc_Info_mapper = new Dictionary<uint, RomInfo>();
|
||||
foreach (var info in romInfos)
|
||||
{
|
||||
crc_Info_mapper[info.CRC] = info;
|
||||
}
|
||||
}
|
||||
|
||||
if (crc_Info_mapper.TryGetValue(crc, out var romInfo))
|
||||
{
|
||||
mapperNo = romInfo.Mapper;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
mapperNo = -1;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class RomInfo
|
||||
{
|
||||
public uint CRC;
|
||||
public int Mapper;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 29131082dba8d234481296f0cf29a1fe
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,6 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fc7102c34a9fa4148b4aa74d54e82b1f
|
||||
folderAsset: yes
|
||||
guid: 588a6a32c9d46b943b4909b1757f4572
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
@ -415,6 +415,12 @@ namespace VirtualNes.Core
|
||||
{
|
||||
header.control2 |= (byte)EnumRomControlByte2.ROM_VSUNISYSTEM;
|
||||
}
|
||||
|
||||
//吞食天地2 豪华中文版
|
||||
if (crc == 0x19B9E732)
|
||||
{
|
||||
mapper = 199;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -247,8 +247,8 @@ namespace VirtualNes.Core
|
||||
Debuger.Log($"Mapper : #{rom.GetMapperNo():D3}");
|
||||
Debuger.Log($"PROM-CRC : #{rom.GetPROM_CRC():X2}");
|
||||
Debuger.Log($"VROM-CRC : #{rom.GetVROM_CRC():X2}");
|
||||
Debuger.Log($"PRG SIZE : {16 * rom.GetPROM_SIZE():0000}K");
|
||||
Debuger.Log($"CHR SIZE : {8 * rom.GetVROM_SIZE():0000}K");
|
||||
Debuger.Log($"PRG SIZE : {16 * rom.GetPROM_SIZE():4:0000}K");
|
||||
Debuger.Log($"CHR SIZE : {8 * rom.GetVROM_SIZE():4:0000}K");
|
||||
|
||||
Debuger.Log($"V MIRROR :{rom.IsVMIRROR()}");
|
||||
Debuger.Log($"4 SCREEN :{rom.Is4SCREEN()}");
|
||||
|
@ -244,11 +244,6 @@ namespace VirtualNes.Core
|
||||
|
||||
FileNameCheck(fname);
|
||||
|
||||
if (Supporter.TryGetMapperNo(this, out int mapperNo))
|
||||
{
|
||||
mapper = mapperNo;
|
||||
}
|
||||
|
||||
RomPatch.DoPatch(ref crc, ref lpPRG, ref lpCHR, ref mapper, ref header);
|
||||
|
||||
fdsmakerID = fdsgameID = 0;
|
||||
@ -367,7 +362,7 @@ namespace VirtualNes.Core
|
||||
return (header.control2 & (byte)EnumRomControlByte2.ROM_VSUNISYSTEM) != 0;
|
||||
}
|
||||
|
||||
public uint GetPROM_CRC()
|
||||
internal uint GetPROM_CRC()
|
||||
{
|
||||
return crc;
|
||||
}
|
||||
|
@ -49,11 +49,6 @@ namespace VirtualNes.Core
|
||||
return s_support.OpenFile(directPath, fileName);
|
||||
}
|
||||
|
||||
public static bool TryGetMapperNo(ROM rom, out int mapperNo)
|
||||
{
|
||||
return s_support.TryGetMapperNo(rom, out mapperNo);
|
||||
}
|
||||
|
||||
public static EmulatorConfig Config => s_support.Config;
|
||||
}
|
||||
|
||||
@ -69,6 +64,5 @@ namespace VirtualNes.Core
|
||||
void PrepareDirectory(string directPath);
|
||||
void SaveFile(byte[] fileData, string directPath, string fileName);
|
||||
Stream OpenFile(string directPath, string fileName);
|
||||
bool TryGetMapperNo(ROM rom, out int mapperNo);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user