diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Debugger.cs b/AxibugEmuOnline.Client.PSVita/Assets/Debugger.cs new file mode 100644 index 0000000..0f54dda --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Debugger.cs @@ -0,0 +1,436 @@ +using UnityEngine; +using System.Collections.Generic; +using System; +using UnityEngine.Profiling; + +public class Debugger : MonoBehaviour +{ + /// + /// 是否允许调试 + /// + public bool AllowDebugging = true; + + private DebugType _debugType = DebugType.Console; + private List _logInformations = new List(); + private int _currentLogIndex = -1; + private int _infoLogCount = 0; + private int _warningLogCount = 0; + private int _errorLogCount = 0; + private int _fatalLogCount = 0; + private bool _showInfoLog = true; + private bool _showWarningLog = true; + private bool _showErrorLog = true; + private bool _showFatalLog = true; + private Vector2 _scrollLogView = Vector2.zero; + private Vector2 _scrollCurrentLogView = Vector2.zero; + private Vector2 _scrollSystemView = Vector2.zero; + private bool _expansion = false; + private Rect _windowRect = new Rect(0, 0, 100, 60); + + private int _fps = 0; + private Color _fpsColor = Color.white; + private int _frameNumber = 0; + private float _lastShowFPSTime = 0f; + + private void Start() + { + DontDestroyOnLoad(this.gameObject); + if (AllowDebugging) + { + Application.logMessageReceived += LogHandler; + } + } + private void Update() + { + if (AllowDebugging) + { + _frameNumber += 1; + float time = Time.realtimeSinceStartup - _lastShowFPSTime; + if (time >= 1) + { + _fps = (int)(_frameNumber / time); + _frameNumber = 0; + _lastShowFPSTime = Time.realtimeSinceStartup; + } + } + } + private void OnDestory() + { + if (AllowDebugging) + { + Application.logMessageReceived -= LogHandler; + } + } + + bool bUnityWaterFrist = false; + private void LogHandler(string condition, string stackTrace, LogType type) + { + if (condition.Contains("UnityWater") || stackTrace.Contains("UnityWater")) + { + if(bUnityWaterFrist) + return; + + bUnityWaterFrist = true; + } + + LogData log = new LogData(); + log.time = DateTime.Now.ToString("HH:mm:ss"); + log.message = condition; + log.stackTrace = stackTrace; + + if (type == LogType.Assert) + { + log.type = "Fatal"; + _fatalLogCount += 1; + } + else if (type == LogType.Exception || type == LogType.Error) + { + log.type = "Error"; + _errorLogCount += 1; + } + else if (type == LogType.Warning) + { + log.type = "Warning"; + _warningLogCount += 1; + } + else if (type == LogType.Log) + { + log.type = "Info"; + _infoLogCount += 1; + } + + _logInformations.Add(log); + + if (_warningLogCount > 0) + { + _fpsColor = Color.yellow; + } + if (_errorLogCount > 0) + { + _fpsColor = Color.red; + } + } + + private void OnGUI() + { + if (AllowDebugging) + { + if (_expansion) + { + _windowRect = GUI.Window(0, _windowRect, ExpansionGUIWindow, "DEBUGGER"); + } + else + { + _windowRect = GUI.Window(0, _windowRect, ShrinkGUIWindow, "DEBUGGER"); + } + } + } + private void ExpansionGUIWindow(int windowId) + { + GUI.DragWindow(new Rect(0, 0, 10000, 20)); + + #region title + GUILayout.BeginHorizontal(); + GUI.contentColor = _fpsColor; + if (GUILayout.Button("FPS:" + _fps, GUILayout.Height(30))) + { + _expansion = false; + _windowRect.width = 100; + _windowRect.height = 60; + } + GUI.contentColor = (_debugType == DebugType.Console ? Color.white : Color.gray); + if (GUILayout.Button("Console", GUILayout.Height(30))) + { + _debugType = DebugType.Console; + } + GUI.contentColor = (_debugType == DebugType.Memory ? Color.white : Color.gray); + if (GUILayout.Button("Memory", GUILayout.Height(30))) + { + _debugType = DebugType.Memory; + } + GUI.contentColor = (_debugType == DebugType.System ? Color.white : Color.gray); + if (GUILayout.Button("System", GUILayout.Height(30))) + { + _debugType = DebugType.System; + } + GUI.contentColor = (_debugType == DebugType.Screen ? Color.white : Color.gray); + if (GUILayout.Button("Screen", GUILayout.Height(30))) + { + _debugType = DebugType.Screen; + } + GUI.contentColor = (_debugType == DebugType.Quality ? Color.white : Color.gray); + if (GUILayout.Button("Quality", GUILayout.Height(30))) + { + _debugType = DebugType.Quality; + } + GUI.contentColor = (_debugType == DebugType.Environment ? Color.white : Color.gray); + if (GUILayout.Button("Environment", GUILayout.Height(30))) + { + _debugType = DebugType.Environment; + } + GUI.contentColor = Color.white; + GUILayout.EndHorizontal(); + #endregion + + #region console + if (_debugType == DebugType.Console) + { + GUILayout.BeginHorizontal(); + if (GUILayout.Button("Clear")) + { + _logInformations.Clear(); + _fatalLogCount = 0; + _warningLogCount = 0; + _errorLogCount = 0; + _infoLogCount = 0; + _currentLogIndex = -1; + _fpsColor = Color.white; + } + GUI.contentColor = (_showInfoLog ? Color.white : Color.gray); + _showInfoLog = GUILayout.Toggle(_showInfoLog, "Info [" + _infoLogCount + "]"); + GUI.contentColor = (_showWarningLog ? Color.white : Color.gray); + _showWarningLog = GUILayout.Toggle(_showWarningLog, "Warning [" + _warningLogCount + "]"); + GUI.contentColor = (_showErrorLog ? Color.white : Color.gray); + _showErrorLog = GUILayout.Toggle(_showErrorLog, "Error [" + _errorLogCount + "]"); + GUI.contentColor = (_showFatalLog ? Color.white : Color.gray); + _showFatalLog = GUILayout.Toggle(_showFatalLog, "Fatal [" + _fatalLogCount + "]"); + GUI.contentColor = Color.white; + GUILayout.EndHorizontal(); + + _scrollLogView = GUILayout.BeginScrollView(_scrollLogView, "Box", GUILayout.Height(165)); + for (int i = 0; i < _logInformations.Count; i++) + { + bool show = false; + Color color = Color.white; + switch (_logInformations[i].type) + { + case "Fatal": + show = _showFatalLog; + color = Color.red; + break; + case "Error": + show = _showErrorLog; + color = Color.red; + break; + case "Info": + show = _showInfoLog; + color = Color.white; + break; + case "Warning": + show = _showWarningLog; + color = Color.yellow; + break; + default: + break; + } + + if (show) + { + GUILayout.BeginHorizontal(); + if (GUILayout.Toggle(_currentLogIndex == i, "")) + { + _currentLogIndex = i; + } + GUI.contentColor = color; + GUILayout.Label("[" + _logInformations[i].type + "] "); + GUILayout.Label("[" + _logInformations[i].time + "] "); + GUILayout.Label(_logInformations[i].message); + GUILayout.FlexibleSpace(); + GUI.contentColor = Color.white; + GUILayout.EndHorizontal(); + } + } + GUILayout.EndScrollView(); + + _scrollCurrentLogView = GUILayout.BeginScrollView(_scrollCurrentLogView, "Box", GUILayout.Height(100)); + if (_currentLogIndex != -1) + { + GUILayout.Label(_logInformations[_currentLogIndex].message + "\r\n\r\n" + _logInformations[_currentLogIndex].stackTrace); + } + GUILayout.EndScrollView(); + } + #endregion + + #region memory + else if (_debugType == DebugType.Memory) + { + GUILayout.BeginHorizontal(); + GUILayout.Label("Memory Information"); + GUILayout.EndHorizontal(); + + GUILayout.BeginVertical("Box"); +#if UNITY_5 + GUILayout.Label("总内存:" + Profiler.GetTotalReservedMemory() / 1000000 + "MB"); + GUILayout.Label("已占用内存:" + Profiler.GetTotalAllocatedMemory() / 1000000 + "MB"); + GUILayout.Label("空闲中内存:" + Profiler.GetTotalUnusedReservedMemory() / 1000000 + "MB"); + GUILayout.Label("总Mono堆内存:" + Profiler.GetMonoHeapSize() / 1000000 + "MB"); + GUILayout.Label("已占用Mono堆内存:" + Profiler.GetMonoUsedSize() / 1000000 + "MB"); +#endif +#if UNITY_7 + GUILayout.Label("总内存:" + Profiler.GetTotalReservedMemoryLong() / 1000000 + "MB"); + GUILayout.Label("已占用内存:" + Profiler.GetTotalAllocatedMemoryLong() / 1000000 + "MB"); + GUILayout.Label("空闲中内存:" + Profiler.GetTotalUnusedReservedMemoryLong() / 1000000 + "MB"); + GUILayout.Label("总Mono堆内存:" + Profiler.GetMonoHeapSizeLong() / 1000000 + "MB"); + GUILayout.Label("已占用Mono堆内存:" + Profiler.GetMonoUsedSizeLong() / 1000000 + "MB"); +#endif + GUILayout.EndVertical(); + + GUILayout.BeginHorizontal(); + if (GUILayout.Button("卸载未使用的资源")) + { + Resources.UnloadUnusedAssets(); + } + GUILayout.EndHorizontal(); + + GUILayout.BeginHorizontal(); + if (GUILayout.Button("使用GC垃圾回收")) + { + GC.Collect(); + } + GUILayout.EndHorizontal(); + } + #endregion + + #region system + else if (_debugType == DebugType.System) + { + GUILayout.BeginHorizontal(); + GUILayout.Label("System Information"); + GUILayout.EndHorizontal(); + + _scrollSystemView = GUILayout.BeginScrollView(_scrollSystemView, "Box"); + GUILayout.Label("操作系统:" + SystemInfo.operatingSystem); + GUILayout.Label("系统内存:" + SystemInfo.systemMemorySize + "MB"); + GUILayout.Label("处理器:" + SystemInfo.processorType); + GUILayout.Label("处理器数量:" + SystemInfo.processorCount); + GUILayout.Label("显卡:" + SystemInfo.graphicsDeviceName); + GUILayout.Label("显卡类型:" + SystemInfo.graphicsDeviceType); + GUILayout.Label("显存:" + SystemInfo.graphicsMemorySize + "MB"); + GUILayout.Label("显卡标识:" + SystemInfo.graphicsDeviceID); + GUILayout.Label("显卡供应商:" + SystemInfo.graphicsDeviceVendor); + GUILayout.Label("显卡供应商标识码:" + SystemInfo.graphicsDeviceVendorID); + GUILayout.Label("设备模式:" + SystemInfo.deviceModel); + GUILayout.Label("设备名称:" + SystemInfo.deviceName); + GUILayout.Label("设备类型:" + SystemInfo.deviceType); + GUILayout.Label("设备标识:" + SystemInfo.deviceUniqueIdentifier); + GUILayout.EndScrollView(); + } + #endregion + + #region screen + else if (_debugType == DebugType.Screen) + { + GUILayout.BeginHorizontal(); + GUILayout.Label("Screen Information"); + GUILayout.EndHorizontal(); + + GUILayout.BeginVertical("Box"); + GUILayout.Label("DPI:" + Screen.dpi); + GUILayout.Label("分辨率:" + Screen.currentResolution.ToString()); + GUILayout.EndVertical(); + + GUILayout.BeginHorizontal(); + if (GUILayout.Button("全屏")) + { + Screen.SetResolution(Screen.currentResolution.width, Screen.currentResolution.height, !Screen.fullScreen); + } + GUILayout.EndHorizontal(); + } + #endregion + + #region Quality + else if (_debugType == DebugType.Quality) + { + GUILayout.BeginHorizontal(); + GUILayout.Label("Quality Information"); + GUILayout.EndHorizontal(); + + GUILayout.BeginVertical("Box"); + string value = ""; + if (QualitySettings.GetQualityLevel() == 0) + { + value = " [最低]"; + } + else if (QualitySettings.GetQualityLevel() == QualitySettings.names.Length - 1) + { + value = " [最高]"; + } + + GUILayout.Label("图形质量:" + QualitySettings.names[QualitySettings.GetQualityLevel()] + value); + GUILayout.EndVertical(); + + GUILayout.BeginHorizontal(); + if (GUILayout.Button("降低一级图形质量")) + { + QualitySettings.DecreaseLevel(); + } + GUILayout.EndHorizontal(); + + GUILayout.BeginHorizontal(); + if (GUILayout.Button("提升一级图形质量")) + { + QualitySettings.IncreaseLevel(); + } + GUILayout.EndHorizontal(); + } + #endregion + + #region Environment + else if (_debugType == DebugType.Environment) + { + GUILayout.BeginHorizontal(); + GUILayout.Label("Environment Information"); + GUILayout.EndHorizontal(); + + GUILayout.BeginVertical("Box"); + GUILayout.Label("项目名称:" + Application.productName); +#if UNITY_5 + GUILayout.Label("项目ID:" + Application.bundleIdentifier); +#endif +#if UNITY_7 + GUILayout.Label("项目ID:" + Application.identifier); +#endif + GUILayout.Label("项目版本:" + Application.version); + GUILayout.Label("Unity版本:" + Application.unityVersion); + GUILayout.Label("公司名称:" + Application.companyName); + GUILayout.EndVertical(); + + GUILayout.BeginHorizontal(); + if (GUILayout.Button("退出程序")) + { + Application.Quit(); + } + GUILayout.EndHorizontal(); + } + #endregion + } + private void ShrinkGUIWindow(int windowId) + { + GUI.DragWindow(new Rect(0, 0, 10000, 20)); + + GUI.contentColor = _fpsColor; + if (GUILayout.Button("FPS:" + _fps, GUILayout.Width(80), GUILayout.Height(30))) + { + _expansion = true; + _windowRect.width = 600; + _windowRect.height = 360; + } + GUI.contentColor = Color.white; + } +} +public struct LogData +{ + public string time; + public string type; + public string message; + public string stackTrace; +} +public enum DebugType +{ + Console, + Memory, + System, + Screen, + Quality, + Environment +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Debugger.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/Debugger.cs.meta new file mode 100644 index 0000000..1ab5033 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Debugger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f6742d2e5aa8bf40b765aa44eca65d2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/New Folder.meta b/AxibugEmuOnline.Client.PSVita/Assets/New Folder.meta new file mode 100644 index 0000000..fe1b5bc --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/New Folder.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3072205f33d4ee84d8117484f05398b2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Buffers.dll b/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Buffers.dll new file mode 100644 index 0000000..c0970c0 Binary files /dev/null and b/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Buffers.dll differ diff --git a/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Buffers.dll.meta b/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Buffers.dll.meta new file mode 100644 index 0000000..c319544 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Buffers.dll.meta @@ -0,0 +1,30 @@ +fileFormatVersion: 2 +guid: dbd119f599580a244b1858693cc49865 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Memory.dll b/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Memory.dll new file mode 100644 index 0000000..1e6aef8 Binary files /dev/null and b/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Memory.dll differ diff --git a/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Memory.dll.meta b/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Memory.dll.meta new file mode 100644 index 0000000..f5d2ca5 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Memory.dll.meta @@ -0,0 +1,30 @@ +fileFormatVersion: 2 +guid: 7783572e2d0e10145b5a94249ebd46d5 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Numerics.Vectors.dll b/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Numerics.Vectors.dll new file mode 100644 index 0000000..a808165 Binary files /dev/null and b/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Numerics.Vectors.dll differ diff --git a/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Numerics.Vectors.dll.meta b/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Numerics.Vectors.dll.meta new file mode 100644 index 0000000..1190a47 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Numerics.Vectors.dll.meta @@ -0,0 +1,30 @@ +fileFormatVersion: 2 +guid: a870099e75652f540b865b7a83e4a232 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Runtime.CompilerServices.Unsafe.dll b/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 0000000..b17135b Binary files /dev/null and b/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Runtime.CompilerServices.Unsafe.dll differ diff --git a/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Runtime.CompilerServices.Unsafe.dll.meta b/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Runtime.CompilerServices.Unsafe.dll.meta new file mode 100644 index 0000000..1abf788 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/New Folder/System.Runtime.CompilerServices.Unsafe.dll.meta @@ -0,0 +1,30 @@ +fileFormatVersion: 2 +guid: 68c1d0e6ce0a09444999776ea1f3c0e4 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Prefabs.meta b/AxibugEmuOnline.Client.PSVita/Assets/Prefabs.meta new file mode 100644 index 0000000..b05ee29 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8d7ded91aab4c0b42abba5042aaceb39 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Prefabs/NesCoreProxy.prefab b/AxibugEmuOnline.Client.PSVita/Assets/Prefabs/NesCoreProxy.prefab new file mode 100644 index 0000000..4494fbd --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Prefabs/NesCoreProxy.prefab @@ -0,0 +1,625 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1575933574 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1575933575} + - component: {fileID: 1575933577} + - component: {fileID: 1575933576} + m_Layer: 5 + m_Name: notify + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1575933575 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1575933574} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 8662582775439058149} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0, y: 0} +--- !u!222 &1575933577 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1575933574} + m_CullTransparentMesh: 1 +--- !u!114 &1575933576 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1575933574} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 6 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: +--- !u!1 &319390252125274553 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3543948837876491845} + - component: {fileID: 2496653285840897638} + m_Layer: 0 + m_Name: Input + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3543948837876491845 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 319390252125274553} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 8662582775964487076} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2496653285840897638 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 319390252125274553} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d79c33962dea7dc48b2c5fcd45afe1ad, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &8662582774585465456 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8662582774585465455} + - component: {fileID: 8662582774585465453} + - component: {fileID: 8662582774585465454} + m_Layer: 5 + m_Name: canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8662582774585465455 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662582774585465456} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: -1, z: 1} + m_Children: [] + m_Father: {fileID: 8662582775439058149} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8662582774585465453 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662582774585465456} + m_CullTransparentMesh: 1 +--- !u!114 &8662582774585465454 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662582774585465456} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Texture: {fileID: 8400000, guid: 5d4a385f133f9074583d64ab2172a03b, type: 2} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!1 &8662582774971523582 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3209572454846341542} + - component: {fileID: 8662582774971523580} + - component: {fileID: 8662582774971523579} + m_Layer: 5 + m_Name: Audio + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3209572454846341542 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662582774971523582} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 8662582775964487076} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!82 &8662582774971523580 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662582774971523582} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 0 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!114 &8662582774971523579 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662582774971523582} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 765129d4fad76714191795975893ea9c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_coreProxy: {fileID: 8662582775964487075} + m_as: {fileID: 8662582774971523580} +--- !u!1 &8662582775350046795 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7667066390141474019} + - component: {fileID: 8662582775350046791} + - component: {fileID: 8662582775350046790} + m_Layer: 5 + m_Name: Video + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7667066390141474019 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662582775350046795} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 8662582775439058149} + m_Father: {fileID: 8662582775964487076} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!222 &8662582775350046791 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662582775350046795} + m_CullTransparentMesh: 1 +--- !u!114 &8662582775350046790 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662582775350046795} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f2632911774df3c488ec24b39651c4de, type: 3} + m_Name: + m_EditorClassIdentifier: + m_coreProxy: {fileID: 8662582775964487075} + m_drawCanvas: {fileID: 8662582774585465454} + m_fpsText: {fileID: 8662582775359084754} + m_nofity: {fileID: 1575933576} +--- !u!1 &8662582775359084756 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8662582775359084755} + - component: {fileID: 8662582775359084753} + - component: {fileID: 8662582775359084754} + m_Layer: 5 + m_Name: fps + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8662582775359084755 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662582775359084756} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 8662582775439058149} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 1, y: 0} +--- !u!222 &8662582775359084753 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662582775359084756} + m_CullTransparentMesh: 1 +--- !u!114 &8662582775359084754 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662582775359084756} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 8 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: +--- !u!1 &8662582775439058150 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8662582775439058149} + - component: {fileID: 8662582775439058146} + - component: {fileID: 8662582775439058147} + - component: {fileID: 8662582775439058148} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8662582775439058149 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662582775439058150} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 8662582774585465455} + - {fileID: 8662582775359084755} + - {fileID: 1575933575} + m_Father: {fileID: 7667066390141474019} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &8662582775439058146 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662582775439058150} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &8662582775439058147 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662582775439058150} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!114 &8662582775439058148 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662582775439058150} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!1 &8662582775964487077 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8662582775964487076} + - component: {fileID: 8662582775964487075} + m_Layer: 0 + m_Name: NesCoreProxy + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8662582775964487076 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662582775964487077} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 7667066390141474019} + - {fileID: 3209572454846341542} + - {fileID: 3543948837876491845} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &8662582775964487075 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662582775964487077} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ac8cd27a180bf3e489b2ca27c821bffe, type: 3} + m_Name: + m_EditorClassIdentifier: + VideoCom: {fileID: 8662582775350046790} + AudioCom: {fileID: 8662582774971523579} + InputManager: {fileID: 2496653285840897638} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Prefabs/NesCoreProxy.prefab.meta b/AxibugEmuOnline.Client.PSVita/Assets/Prefabs/NesCoreProxy.prefab.meta new file mode 100644 index 0000000..70b5aae --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Prefabs/NesCoreProxy.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d75df7d1f5a2c824ab5013cbd79da7a4 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Resources.meta b/AxibugEmuOnline.Client.PSVita/Assets/Resources.meta new file mode 100644 index 0000000..dfacc8d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 481be8b9dd1218749a75bf1bd4612c04 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Resources/BillingMode.json b/AxibugEmuOnline.Client.PSVita/Assets/Resources/BillingMode.json new file mode 100644 index 0000000..6f4bfb7 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Resources/BillingMode.json @@ -0,0 +1 @@ +{"androidStore":"GooglePlay"} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Resources/BillingMode.json.meta b/AxibugEmuOnline.Client.PSVita/Assets/Resources/BillingMode.json.meta new file mode 100644 index 0000000..4217ccf --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Resources/BillingMode.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8ce858366bedbe74f989c336dd5b1986 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Resources/NES.meta b/AxibugEmuOnline.Client.PSVita/Assets/Resources/NES.meta new file mode 100644 index 0000000..07ebe32 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Resources/NES.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 319a1a12506a5334ebd963b4fd991c2a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Resources/NES/Disksys.rom.bytes b/AxibugEmuOnline.Client.PSVita/Assets/Resources/NES/Disksys.rom.bytes new file mode 100644 index 0000000..93a8d93 Binary files /dev/null and b/AxibugEmuOnline.Client.PSVita/Assets/Resources/NES/Disksys.rom.bytes differ diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Resources/NES/Disksys.rom.bytes.meta b/AxibugEmuOnline.Client.PSVita/Assets/Resources/NES/Disksys.rom.bytes.meta new file mode 100644 index 0000000..8f97ed5 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Resources/NES/Disksys.rom.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ccf426abdad56c74682de4e38b3048e3 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Resources/NES/ROMDB.asset b/AxibugEmuOnline.Client.PSVita/Assets/Resources/NES/ROMDB.asset new file mode 100644 index 0000000..3e8ce5d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Resources/NES/ROMDB.asset @@ -0,0 +1,18103 @@ +%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: + romInfos: + - CRC: 2204913575 + Mapper: 0 + - CRC: 1154621315 + Mapper: 0 + - CRC: 1944328903 + Mapper: 1 + - CRC: 387076579 + Mapper: 0 + - CRC: 1313009978 + Mapper: 2 + - CRC: 703336401 + Mapper: 4 + - CRC: 3641771249 + Mapper: 0 + - CRC: 2227044585 + Mapper: 0 + - CRC: 4174721393 + Mapper: 4 + - CRC: 3823289279 + Mapper: 3 + - CRC: 349001582 + Mapper: 1 + - CRC: 2082974598 + Mapper: 4 + - CRC: 3860266762 + Mapper: 1 + - CRC: 507981434 + Mapper: 1 + - CRC: 741545501 + Mapper: 1 + - CRC: 3396536689 + Mapper: 4 + - CRC: 3938008315 + Mapper: 1 + - CRC: 695310521 + Mapper: 4 + - CRC: 4073600577 + Mapper: 68 + - CRC: 938841168 + Mapper: 2 + - CRC: 4220164992 + Mapper: 1 + - CRC: 1535344269 + Mapper: 1 + - CRC: 2457072014 + Mapper: 1 + - CRC: 844501324 + Mapper: 4 + - CRC: 3354198856 + Mapper: 4 + - CRC: 1073370978 + Mapper: 1 + - CRC: 373214382 + Mapper: 0 + - CRC: 210864741 + Mapper: 0 + - CRC: 122602532 + Mapper: 1 + - CRC: 527755884 + Mapper: 2 + - CRC: 3786563802 + Mapper: 2 + - CRC: 1701815221 + Mapper: 87 + - CRC: 252974373 + Mapper: 152 + - CRC: 3634256487 + Mapper: 3 + - CRC: 2025215916 + Mapper: 118 + - CRC: 155092063 + Mapper: 1 + - CRC: 353637377 + Mapper: 4 + - CRC: 3913936778 + Mapper: 4 + - CRC: 767580783 + Mapper: 0 + - CRC: 2345526682 + Mapper: 2 + - CRC: 4161318752 + Mapper: 184 + - CRC: 2102775593 + Mapper: 2 + - CRC: 1668795253 + Mapper: 1 + - CRC: 1961928863 + Mapper: 185 + - CRC: 2331136304 + Mapper: 206 + - CRC: 1212834011 + Mapper: 2 + - CRC: 726016016 + Mapper: 0 + - CRC: 523083191 + Mapper: 0 + - CRC: 2259465067 + Mapper: 3 + - CRC: 1726848000 + Mapper: 4 + - CRC: 1221201633 + Mapper: 69 + - CRC: 3212793012 + Mapper: 4 + - CRC: 2925280660 + Mapper: 1 + - CRC: 2024049443 + Mapper: 0 + - CRC: 4186515820 + Mapper: 2 + - CRC: 1299732905 + Mapper: 69 + - CRC: 2213182212 + Mapper: 4 + - CRC: 2114272868 + Mapper: 0 + - CRC: 3053416875 + Mapper: 19 + - CRC: 726499502 + Mapper: 4 + - CRC: 1638421226 + Mapper: 1 + - CRC: 2385981720 + Mapper: 1 + - CRC: 2550582148 + Mapper: 7 + - CRC: 737874310 + Mapper: 1 + - CRC: 2538506304 + Mapper: 1 + - CRC: 3784479650 + Mapper: 1 + - CRC: 3270456354 + Mapper: 1 + - CRC: 3094641343 + Mapper: 1 + - CRC: 3286137961 + Mapper: 1 + - CRC: 1002435494 + Mapper: 1 + - CRC: 2711829381 + Mapper: 1 + - CRC: 2213213105 + Mapper: 1 + - CRC: 4126422449 + Mapper: 0 + - CRC: 1841466202 + Mapper: 25 + - CRC: 3963676443 + Mapper: 140 + - CRC: 2829695362 + Mapper: 185 + - CRC: 3748125345 + Mapper: 0 + - CRC: 9317680 + Mapper: 1 + - CRC: 958046648 + Mapper: 1 + - CRC: 4263044790 + Mapper: 0 + - CRC: 3181186693 + Mapper: 2 + - CRC: 205526928 + Mapper: 1 + - CRC: 4076634642 + Mapper: 0 + - CRC: 1098402170 + Mapper: 2 + - CRC: 2304145000 + Mapper: 1 + - CRC: 1961758716 + Mapper: 1 + - CRC: 3147353400 + Mapper: 1 + - CRC: 1826360537 + Mapper: 48 + - CRC: 652746760 + Mapper: 4 + - CRC: 2681427970 + Mapper: 3 + - CRC: 3910623529 + Mapper: 4 + - CRC: 3462877306 + Mapper: 0 + - CRC: 2373445094 + Mapper: 4 + - CRC: 119088652 + Mapper: 3 + - CRC: 3411725129 + Mapper: 4 + - CRC: 1062642578 + Mapper: 1 + - CRC: 2579731961 + Mapper: 48 + - CRC: 3406445300 + Mapper: 1 + - CRC: 833899621 + Mapper: 4 + - CRC: 4092667549 + Mapper: 1 + - CRC: 3829400024 + Mapper: 1 + - CRC: 2141375573 + Mapper: 3 + - CRC: 3209644966 + Mapper: 4 + - CRC: 1647248797 + Mapper: 0 + - CRC: 1933674273 + Mapper: 0 + - CRC: 2576544837 + Mapper: 3 + - CRC: 2914373811 + Mapper: 0 + - CRC: 3771450042 + Mapper: 1 + - CRC: 1819320699 + Mapper: 2 + - CRC: 2573757869 + Mapper: 1 + - CRC: 3643009883 + Mapper: 1 + - CRC: 2285130986 + Mapper: 87 + - CRC: 955213493 + Mapper: 87 + - CRC: 3095049050 + Mapper: 0 + - CRC: 3090475824 + Mapper: 2 + - CRC: 553224567 + Mapper: 87 + - CRC: 1224117568 + Mapper: 0 + - CRC: 616206538 + Mapper: 1 + - CRC: 2026128909 + Mapper: 1 + - CRC: 815932840 + Mapper: 4 + - CRC: 2791605075 + Mapper: 1 + - CRC: 3698684719 + Mapper: 4 + - CRC: 2670138079 + Mapper: 1 + - CRC: 215456625 + Mapper: 3 + - CRC: 3846142549 + Mapper: 1 + - CRC: 3674542190 + Mapper: 16 + - CRC: 3330499574 + Mapper: 180 + - CRC: 4240386225 + Mapper: 23 + - CRC: 3914618108 + Mapper: 4 + - CRC: 3827953875 + Mapper: 1 + - CRC: 1914393111 + Mapper: 2 + - CRC: 1056924388 + Mapper: 4 + - CRC: 517246044 + Mapper: 2 + - CRC: 1069669401 + Mapper: 3 + - CRC: 1945626072 + Mapper: 1 + - CRC: 4264971237 + Mapper: 1 + - CRC: 2353879510 + Mapper: 1 + - CRC: 1605069774 + Mapper: 0 + - CRC: 341482092 + Mapper: 0 + - CRC: 3513323560 + Mapper: 154 + - CRC: 683859918 + Mapper: 1 + - CRC: 736253161 + Mapper: 0 + - CRC: 2977216128 + Mapper: 0 + - CRC: 2524397362 + Mapper: 19 + - CRC: 281651081 + Mapper: 19 + - CRC: 1402198345 + Mapper: 76 + - CRC: 2813350764 + Mapper: 48 + - CRC: 2051635939 + Mapper: 33 + - CRC: 3865828815 + Mapper: 1 + - CRC: 3514529498 + Mapper: 1 + - CRC: 4167292347 + Mapper: 0 + - CRC: 1872217889 + Mapper: 0 + - CRC: 3017231373 + Mapper: 0 + - CRC: 3792812346 + Mapper: 0 + - CRC: 1214563076 + Mapper: 0 + - CRC: 1672389120 + Mapper: 0 + - CRC: 1352774654 + Mapper: 0 + - CRC: 317115257 + Mapper: 0 + - CRC: 1793495591 + Mapper: 4 + - CRC: 2791675609 + Mapper: 4 + - CRC: 1842236195 + Mapper: 1 + - CRC: 2786048593 + Mapper: 4 + - CRC: 4150325707 + Mapper: 0 + - CRC: 3695552646 + Mapper: 4 + - CRC: 708617481 + Mapper: 4 + - CRC: 1044844512 + Mapper: 4 + - CRC: 428617537 + Mapper: 1 + - CRC: 3730314069 + Mapper: 1 + - CRC: 1852367642 + Mapper: 16 + - CRC: 3217531625 + Mapper: 16 + - CRC: 3696410380 + Mapper: 16 + - CRC: 2569274739 + Mapper: 16 + - CRC: 2840859730 + Mapper: 16 + - CRC: 325887049 + Mapper: 16 + - CRC: 406346194 + Mapper: 159 + - CRC: 867736009 + Mapper: 16 + - CRC: 2505238751 + Mapper: 66 + - CRC: 3618245485 + Mapper: 206 + - CRC: 2070792050 + Mapper: 95 + - CRC: 1259187406 + Mapper: 1 + - CRC: 712850143 + Mapper: 19 + - CRC: 719664586 + Mapper: 19 + - CRC: 2761640120 + Mapper: 1 + - CRC: 2257912266 + Mapper: 1 + - CRC: 1211407115 + Mapper: 2 + - CRC: 769071819 + Mapper: 1 + - CRC: 127201957 + Mapper: 1 + - CRC: 2282044709 + Mapper: 3 + - CRC: 2895680972 + Mapper: 23 + - CRC: 2783361785 + Mapper: 206 + - CRC: 3483170722 + Mapper: 1 + - CRC: 3954724225 + Mapper: 1 + - CRC: 3530135699 + Mapper: 88 + - CRC: 2152696202 + Mapper: 2 + - CRC: 2278440756 + Mapper: 4 + - CRC: 3297631058 + Mapper: 4 + - CRC: 3176280081 + Mapper: 210 + - CRC: 609847185 + Mapper: 0 + - CRC: 3990668392 + Mapper: 2 + - CRC: 1167920170 + Mapper: 1 + - CRC: 3599396659 + Mapper: 1 + - CRC: 267822005 + Mapper: 69 + - CRC: 3079056277 + Mapper: 3 + - CRC: 2657527403 + Mapper: 3 + - CRC: 4032015455 + Mapper: 4 + - CRC: 2010954659 + Mapper: 1 + - CRC: 3787472566 + Mapper: 3 + - CRC: 4242197120 + Mapper: 0 + - CRC: 2050640365 + Mapper: 0 + - CRC: 4098939706 + Mapper: 2 + - CRC: 604794344 + Mapper: 1 + - CRC: 2638600428 + Mapper: 1 + - CRC: 547048429 + Mapper: 26 + - CRC: 2064269753 + Mapper: 2 + - CRC: 1236186022 + Mapper: 0 + - CRC: 2890660316 + Mapper: 75 + - CRC: 3780941629 + Mapper: 1 + - CRC: 3227137627 + Mapper: 0 + - CRC: 3199403128 + Mapper: 0 + - CRC: 3764408182 + Mapper: 0 + - CRC: 2166627820 + Mapper: 4 + - CRC: 3971953614 + Mapper: 4 + - CRC: 1058394637 + Mapper: 153 + - CRC: 3544434282 + Mapper: 16 + - CRC: 1481669577 + Mapper: 1 + - CRC: 2606005765 + Mapper: 10 + - CRC: 2633651687 + Mapper: 1 + - CRC: 2183081887 + Mapper: 1 + - CRC: 611336235 + Mapper: 1 + - CRC: 345771715 + Mapper: 1 + - CRC: 3500799201 + Mapper: 1 + - CRC: 4158360412 + Mapper: 0 + - CRC: 4150290448 + Mapper: 0 + - CRC: 2303735740 + Mapper: 0 + - CRC: 2991786748 + Mapper: 0 + - CRC: 196457376 + Mapper: 66 + - CRC: 1531732294 + Mapper: 206 + - CRC: 3259485312 + Mapper: 210 + - CRC: 2629599827 + Mapper: 206 + - CRC: 2279066352 + Mapper: 185 + - CRC: 2095231347 + Mapper: 185 + - CRC: 924426861 + Mapper: 206 + - CRC: 1226673371 + Mapper: 206 + - CRC: 126946297 + Mapper: 2 + - CRC: 2761053126 + Mapper: 206 + - CRC: 702449583 + Mapper: 3 + - CRC: 55871114 + Mapper: 3 + - CRC: 1621952778 + Mapper: 3 + - CRC: 789742866 + Mapper: 3 + - CRC: 3148188645 + Mapper: 70 + - CRC: 3935368162 + Mapper: 3 + - CRC: 1825184799 + Mapper: 3 + - CRC: 2420397326 + Mapper: 3 + - CRC: 2316478425 + Mapper: 3 + - CRC: 923593573 + Mapper: 70 + - CRC: 1557527972 + Mapper: 66 + - CRC: 3327491586 + Mapper: 206 + - CRC: 4123979663 + Mapper: 206 + - CRC: 3710516569 + Mapper: 206 + - CRC: 1328486470 + Mapper: 206 + - CRC: 202871514 + Mapper: 19 + - CRC: 2156267248 + Mapper: 210 + - CRC: 1858412005 + Mapper: 210 + - CRC: 2919224911 + Mapper: 210 + - CRC: 1116799945 + Mapper: 210 + - CRC: 207250071 + Mapper: 67 + - CRC: 269590123 + Mapper: 93 + - CRC: 4169521457 + Mapper: 1 + - CRC: 2819596673 + Mapper: 1 + - CRC: 1595202632 + Mapper: 4 + - CRC: 2760223725 + Mapper: 1 + - CRC: 457549630 + Mapper: 0 + - CRC: 2198404823 + Mapper: 1 + - CRC: 2538407749 + Mapper: 4 + - CRC: 1181679042 + Mapper: 1 + - CRC: 4145970909 + Mapper: 1 + - CRC: 3377818422 + Mapper: 1 + - CRC: 3533550535 + Mapper: 1 + - CRC: 1474437328 + Mapper: 4 + - CRC: 1464247393 + Mapper: 19 + - CRC: 3583253161 + Mapper: 1 + - CRC: 2843756216 + Mapper: 10 + - CRC: 2546652016 + Mapper: 10 + - CRC: 3480231332 + Mapper: 0 + - CRC: 3088171092 + Mapper: 3 + - CRC: 393475949 + Mapper: 3 + - CRC: 1778314418 + Mapper: 3 + - CRC: 4134870333 + Mapper: 2 + - CRC: 1664322620 + Mapper: 0 + - CRC: 3909234802 + Mapper: 0 + - CRC: 3477978558 + Mapper: 0 + - CRC: 1579478746 + Mapper: 4 + - CRC: 3910253764 + Mapper: 0 + - CRC: 139420109 + Mapper: 0 + - CRC: 1990633491 + Mapper: 0 + - CRC: 2247175479 + Mapper: 1 + - CRC: 774556393 + Mapper: 1 + - CRC: 3521445988 + Mapper: 1 + - CRC: 4056378093 + Mapper: 1 + - CRC: 3036647911 + Mapper: 1 + - CRC: 498933035 + Mapper: 0 + - CRC: 1079493915 + Mapper: 3 + - CRC: 356891923 + Mapper: 1 + - CRC: 3656670185 + Mapper: 1 + - CRC: 224782279 + Mapper: 69 + - CRC: 1534773535 + Mapper: 18 + - CRC: 2036960152 + Mapper: 4 + - CRC: 4239470864 + Mapper: 1 + - CRC: 1057784118 + Mapper: 1 + - CRC: 1552966624 + Mapper: 0 + - CRC: 3133804713 + Mapper: 33 + - CRC: 2684381990 + Mapper: 1 + - CRC: 668158551 + Mapper: 4 + - CRC: 405365098 + Mapper: 3 + - CRC: 3728301821 + Mapper: 3 + - CRC: 1524364896 + Mapper: 25 + - CRC: 3639603423 + Mapper: 3 + - CRC: 3227577610 + Mapper: 1 + - CRC: 495542542 + Mapper: 4 + - CRC: 392092171 + Mapper: 4 + - CRC: 3170272785 + Mapper: 1 + - CRC: 3499848924 + Mapper: 1 + - CRC: 144114203 + Mapper: 69 + - CRC: 3671624901 + Mapper: 2 + - CRC: 1673847074 + Mapper: 1 + - CRC: 3904546690 + Mapper: 1 + - CRC: 184236382 + Mapper: 5 + - CRC: 1637607954 + Mapper: 4 + - CRC: 3641198902 + Mapper: 4 + - CRC: 37378610 + Mapper: 0 + - CRC: 702641151 + Mapper: 0 + - CRC: 3027593698 + Mapper: 4 + - CRC: 3021029180 + Mapper: 1 + - CRC: 734994738 + Mapper: 4 + - CRC: 1922205336 + Mapper: 69 + - CRC: 2017620722 + Mapper: 2 + - CRC: 1742062585 + Mapper: 2 + - CRC: 649796748 + Mapper: 3 + - CRC: 3128323782 + Mapper: 1 + - CRC: 2975224765 + Mapper: 2 + - CRC: 4152965209 + Mapper: 2 + - CRC: 39359896 + Mapper: 1 + - CRC: 4280604564 + Mapper: 0 + - CRC: 3125914735 + Mapper: 78 + - CRC: 182701150 + Mapper: 4 + - CRC: 811055364 + Mapper: 1 + - CRC: 767017758 + Mapper: 1 + - CRC: 2244318527 + Mapper: 1 + - CRC: 846593406 + Mapper: 3 + - CRC: 801221550 + Mapper: 1 + - CRC: 1203896843 + Mapper: 19 + - CRC: 2239078603 + Mapper: 0 + - CRC: 569923201 + Mapper: 87 + - CRC: 2550917430 + Mapper: 0 + - CRC: 2438615975 + Mapper: 0 + - CRC: 1793548974 + Mapper: 0 + - CRC: 2856523950 + Mapper: 1 + - CRC: 190351372 + Mapper: 0 + - CRC: 2376394041 + Mapper: 1 + - CRC: 3523448773 + Mapper: 32 + - CRC: 391087626 + Mapper: 1 + - CRC: 4161526864 + Mapper: 33 + - CRC: 2151389561 + Mapper: 4 + - CRC: 1028351217 + Mapper: 4 + - CRC: 1495796716 + Mapper: 4 + - CRC: 2528809136 + Mapper: 2 + - CRC: 231027080 + Mapper: 1 + - CRC: 3013230427 + Mapper: 2 + - CRC: 2457631290 + Mapper: 0 + - CRC: 1888395966 + Mapper: 4 + - CRC: 3434042426 + Mapper: 4 + - CRC: 2379060358 + Mapper: 1 + - CRC: 3111526810 + Mapper: 4 + - CRC: 2629491749 + Mapper: 5 + - CRC: 3475187983 + Mapper: 19 + - CRC: 1903013541 + Mapper: 19 + - CRC: 1265562521 + Mapper: 188 + - CRC: 1358160696 + Mapper: 188 + - CRC: 2918897334 + Mapper: 188 + - CRC: 2343000136 + Mapper: 0 + - CRC: 645814575 + Mapper: 206 + - CRC: 660748211 + Mapper: 206 + - CRC: 1106629517 + Mapper: 1 + - CRC: 3947254102 + Mapper: 3 + - CRC: 1096197069 + Mapper: 1 + - CRC: 2959869556 + Mapper: 75 + - CRC: 916300845 + Mapper: 19 + - CRC: 2886954797 + Mapper: 3 + - CRC: 1019960663 + Mapper: 4 + - CRC: 1727322613 + Mapper: 1 + - CRC: 2325143565 + Mapper: 23 + - CRC: 3345228903 + Mapper: 1 + - CRC: 1670822280 + Mapper: 5 + - CRC: 4128481001 + Mapper: 2 + - CRC: 1949534207 + Mapper: 85 + - CRC: 3648795056 + Mapper: 206 + - CRC: 2398063478 + Mapper: 4 + - CRC: 2920452012 + Mapper: 2 + - CRC: 3929132243 + Mapper: 2 + - CRC: 3387815301 + Mapper: 4 + - CRC: 171950995 + Mapper: 0 + - CRC: 1020705550 + Mapper: 2 + - CRC: 1973937049 + Mapper: 0 + - CRC: 794148488 + Mapper: 0 + - CRC: 2636250774 + Mapper: 206 + - CRC: 1503099462 + Mapper: 0 + - CRC: 947980945 + Mapper: 0 + - CRC: 3745400274 + Mapper: 1 + - CRC: 982483376 + Mapper: 184 + - CRC: 3760272300 + Mapper: 1 + - CRC: 3631517194 + Mapper: 18 + - CRC: 2126968667 + Mapper: 4 + - CRC: 3086125333 + Mapper: 159 + - CRC: 217329257 + Mapper: 159 + - CRC: 3703141070 + Mapper: 159 + - CRC: 1580489581 + Mapper: 0 + - CRC: 2390408700 + Mapper: 2 + - CRC: 2563557803 + Mapper: 68 + - CRC: 161189034 + Mapper: 1 + - CRC: 1190334253 + Mapper: 1 + - CRC: 2234630502 + Mapper: 1 + - CRC: 607815477 + Mapper: 32 + - CRC: 1034029150 + Mapper: 2 + - CRC: 903399777 + Mapper: 19 + - CRC: 777403494 + Mapper: 206 + - CRC: 1561526725 + Mapper: 0 + - CRC: 3301151898 + Mapper: 0 + - CRC: 3136004609 + Mapper: 1 + - CRC: 3679864360 + Mapper: 1 + - CRC: 4266578987 + Mapper: 4 + - CRC: 3214086442 + Mapper: 1 + - CRC: 2153742780 + Mapper: 2 + - CRC: 2500458243 + Mapper: 4 + - CRC: 3027460012 + Mapper: 5 + - CRC: 3825944947 + Mapper: 206 + - CRC: 1473340145 + Mapper: 4 + - CRC: 2655453643 + Mapper: 3 + - CRC: 2614941842 + Mapper: 4 + - CRC: 2622624320 + Mapper: 185 + - CRC: 3557796179 + Mapper: 185 + - CRC: 722865136 + Mapper: 4 + - CRC: 2460096604 + Mapper: 9 + - CRC: 746684436 + Mapper: 9 + - CRC: 2001806216 + Mapper: 0 + - CRC: 2900717369 + Mapper: 19 + - CRC: 2397200248 + Mapper: 80 + - CRC: 1681519930 + Mapper: 1 + - CRC: 2676176603 + Mapper: 2 + - CRC: 3832224861 + Mapper: 140 + - CRC: 848539626 + Mapper: 140 + - CRC: 3968501839 + Mapper: 3 + - CRC: 3456571727 + Mapper: 66 + - CRC: 2255854607 + Mapper: 1 + - CRC: 4212917585 + Mapper: 1 + - CRC: 652450101 + Mapper: 4 + - CRC: 550242205 + Mapper: 4 + - CRC: 3871933086 + Mapper: 1 + - CRC: 4158684035 + Mapper: 1 + - CRC: 991592175 + Mapper: 4 + - CRC: 637835160 + Mapper: 4 + - CRC: 1749756207 + Mapper: 19 + - CRC: 1280849597 + Mapper: 19 + - CRC: 2443989326 + Mapper: 88 + - CRC: 101993290 + Mapper: 77 + - CRC: 1773984651 + Mapper: 1 + - CRC: 1005132323 + Mapper: 4 + - CRC: 1496432129 + Mapper: 1 + - CRC: 767766946 + Mapper: 4 + - CRC: 3051504420 + Mapper: 4 + - CRC: 264825271 + Mapper: 4 + - CRC: 1939476519 + Mapper: 0 + - CRC: 64318711 + Mapper: 1 + - CRC: 711285153 + Mapper: 33 + - CRC: 2057315191 + Mapper: 2 + - CRC: 3456561876 + Mapper: 4 + - CRC: 2312380568 + Mapper: 0 + - CRC: 1049999909 + Mapper: 0 + - CRC: 1557866531 + Mapper: 0 + - CRC: 746416371 + Mapper: 0 + - CRC: 3809160143 + Mapper: 0 + - CRC: 831879908 + Mapper: 1 + - CRC: 3333806048 + Mapper: 1 + - CRC: 738473857 + Mapper: 3 + - CRC: 4035874544 + Mapper: 4 + - CRC: 3345595188 + Mapper: 4 + - CRC: 1601079815 + Mapper: 66 + - CRC: 3563569356 + Mapper: 23 + - CRC: 2403637230 + Mapper: 3 + - CRC: 47683435 + Mapper: 0 + - CRC: 2664144333 + Mapper: 1 + - CRC: 1197267966 + Mapper: 72 + - CRC: 56476393 + Mapper: 0 + - CRC: 1239035766 + Mapper: 18 + - CRC: 229946242 + Mapper: 18 + - CRC: 2897804934 + Mapper: 0 + - CRC: 2980662146 + Mapper: 152 + - CRC: 2135511683 + Mapper: 0 + - CRC: 1434576949 + Mapper: 0 + - CRC: 1887834058 + Mapper: 0 + - CRC: 661881409 + Mapper: 0 + - CRC: 2086235717 + Mapper: 0 + - CRC: 2931293417 + Mapper: 33 + - CRC: 1887490552 + Mapper: 3 + - CRC: 1322501873 + Mapper: 1 + - CRC: 1178659808 + Mapper: 1 + - CRC: 23109463 + Mapper: 2 + - CRC: 3376958387 + Mapper: 1 + - CRC: 318810295 + Mapper: 206 + - CRC: 2922517305 + Mapper: 206 + - CRC: 3705603806 + Mapper: 206 + - CRC: 3250228153 + Mapper: 4 + - CRC: 2218271281 + Mapper: 9 + - CRC: 4108147621 + Mapper: 1 + - CRC: 2270354635 + Mapper: 3 + - CRC: 1072325994 + Mapper: 1 + - CRC: 2592115771 + Mapper: 3 + - CRC: 333062434 + Mapper: 88 + - CRC: 4129757777 + Mapper: 25 + - CRC: 858540000 + Mapper: 4 + - CRC: 1690922835 + Mapper: 0 + - CRC: 2772936428 + Mapper: 0 + - CRC: 4201663622 + Mapper: 2 + - CRC: 904920334 + Mapper: 2 + - CRC: 1053667831 + Mapper: 2 + - CRC: 1393282228 + Mapper: 4 + - CRC: 2743621611 + Mapper: 1 + - CRC: 2129012203 + Mapper: 0 + - CRC: 911756438 + Mapper: 4 + - CRC: 3257922008 + Mapper: 1 + - CRC: 3230803872 + Mapper: 4 + - CRC: 1632653692 + Mapper: 1 + - CRC: 3656508540 + Mapper: 4 + - CRC: 4049708504 + Mapper: 4 + - CRC: 3774868685 + Mapper: 4 + - CRC: 4259258677 + Mapper: 4 + - CRC: 761679257 + Mapper: 4 + - CRC: 3541944592 + Mapper: 2 + - CRC: 3802634839 + Mapper: 1 + - CRC: 2665210594 + Mapper: 19 + - CRC: 2667550418 + Mapper: 1 + - CRC: 1921776269 + Mapper: 0 + - CRC: 3162569554 + Mapper: 5 + - CRC: 131673137 + Mapper: 118 + - CRC: 23892952 + Mapper: 1 + - CRC: 2892311367 + Mapper: 73 + - CRC: 1033230438 + Mapper: 3 + - CRC: 1213907096 + Mapper: 3 + - CRC: 4156052196 + Mapper: 3 + - CRC: 3956245529 + Mapper: 4 + - CRC: 3884595532 + Mapper: 4 + - CRC: 2734101440 + Mapper: 4 + - CRC: 275166829 + Mapper: 4 + - CRC: 1733645335 + Mapper: 4 + - CRC: 1821641305 + Mapper: 4 + - CRC: 3782230092 + Mapper: 159 + - CRC: 661309218 + Mapper: 159 + - CRC: 2957617348 + Mapper: 16 + - CRC: 3263431538 + Mapper: 16 + - CRC: 3689736015 + Mapper: 4 + - CRC: 2368142826 + Mapper: 4 + - CRC: 252051210 + Mapper: 185 + - CRC: 1356482663 + Mapper: 4 + - CRC: 3477123525 + Mapper: 4 + - CRC: 952090684 + Mapper: 2 + - CRC: 2987135024 + Mapper: 93 + - CRC: 733389048 + Mapper: 2 + - CRC: 3183551717 + Mapper: 4 + - CRC: 2440925794 + Mapper: 2 + - CRC: 4151716384 + Mapper: 206 + - CRC: 2416851491 + Mapper: 4 + - CRC: 3833503655 + Mapper: 0 + - CRC: 3395976177 + Mapper: 206 + - CRC: 2868155204 + Mapper: 1 + - CRC: 2369532851 + Mapper: 1 + - CRC: 1702852725 + Mapper: 0 + - CRC: 2184124395 + Mapper: 1 + - CRC: 4008063310 + Mapper: 4 + - CRC: 3626082758 + Mapper: 3 + - CRC: 2836684984 + Mapper: 7 + - CRC: 280686323 + Mapper: 0 + - CRC: 1129552444 + Mapper: 1 + - CRC: 1749744845 + Mapper: 3 + - CRC: 3653276593 + Mapper: 0 + - CRC: 2912707554 + Mapper: 70 + - CRC: 1868990128 + Mapper: 65 + - CRC: 1616430685 + Mapper: 0 + - CRC: 3279888988 + Mapper: 2 + - CRC: 1667834811 + Mapper: 0 + - CRC: 1191016515 + Mapper: 210 + - CRC: 180213194 + Mapper: 1 + - CRC: 3473710487 + Mapper: 185 + - CRC: 1308464286 + Mapper: 0 + - CRC: 1943402451 + Mapper: 0 + - CRC: 3406460593 + Mapper: 1 + - CRC: 3329779106 + Mapper: 0 + - CRC: 1228657407 + Mapper: 0 + - CRC: 649948870 + Mapper: 0 + - CRC: 457318044 + Mapper: 3 + - CRC: 3395908891 + Mapper: 19 + - CRC: 3134417943 + Mapper: 4 + - CRC: 191120340 + Mapper: 4 + - CRC: 4053406127 + Mapper: 1 + - CRC: 1413513500 + Mapper: 2 + - CRC: 413697456 + Mapper: 4 + - CRC: 4078816277 + Mapper: 4 + - CRC: 2424636910 + Mapper: 0 + - CRC: 3753954849 + Mapper: 1 + - CRC: 650112295 + Mapper: 4 + - CRC: 4050945759 + Mapper: 1 + - CRC: 1897671438 + Mapper: 206 + - CRC: 2218046051 + Mapper: 3 + - CRC: 3890085603 + Mapper: 4 + - CRC: 1390589408 + Mapper: 4 + - CRC: 3561354904 + Mapper: 0 + - CRC: 2163965547 + Mapper: 4 + - CRC: 3351038337 + Mapper: 3 + - CRC: 439264953 + Mapper: 1 + - CRC: 476494582 + Mapper: 2 + - CRC: 3514151115 + Mapper: 1 + - CRC: 2672900299 + Mapper: 1 + - CRC: 2629501585 + Mapper: 4 + - CRC: 1068065399 + Mapper: 2 + - CRC: 2075485775 + Mapper: 206 + - CRC: 167763781 + Mapper: 1 + - CRC: 2971995404 + Mapper: 4 + - CRC: 2238608896 + Mapper: 1 + - CRC: 1885067203 + Mapper: 4 + - CRC: 2084384419 + Mapper: 2 + - CRC: 623901970 + Mapper: 1 + - CRC: 3744954054 + Mapper: 4 + - CRC: 138648917 + Mapper: 0 + - CRC: 855254127 + Mapper: 0 + - CRC: 1326892292 + Mapper: 4 + - CRC: 2580776566 + Mapper: 4 + - CRC: 280033456 + Mapper: 80 + - CRC: 3671281382 + Mapper: 1 + - CRC: 1485730962 + Mapper: 1 + - CRC: 36014521 + Mapper: 4 + - CRC: 2321268947 + Mapper: 4 + - CRC: 1225689676 + Mapper: 25 + - CRC: 1247812140 + Mapper: 25 + - CRC: 3571048986 + Mapper: 0 + - CRC: 3531316560 + Mapper: 4 + - CRC: 1835387590 + Mapper: 2 + - CRC: 4166919757 + Mapper: 4 + - CRC: 18213616 + Mapper: 3 + - CRC: 3497289021 + Mapper: 3 + - CRC: 1549408952 + Mapper: 3 + - CRC: 1072975751 + Mapper: 1 + - CRC: 4249217473 + Mapper: 1 + - CRC: 658944926 + Mapper: 4 + - CRC: 3303114863 + Mapper: 1 + - CRC: 2128620706 + Mapper: 1 + - CRC: 2577804871 + Mapper: 2 + - CRC: 2957747801 + Mapper: 2 + - CRC: 4180146755 + Mapper: 4 + - CRC: 1086369095 + Mapper: 48 + - CRC: 328930746 + Mapper: 1 + - CRC: 2465219888 + Mapper: 2 + - CRC: 3873400342 + Mapper: 87 + - CRC: 2681673981 + Mapper: 4 + - CRC: 352380981 + Mapper: 48 + - CRC: 3505091743 + Mapper: 18 + - CRC: 1229110696 + Mapper: 4 + - CRC: 3114993322 + Mapper: 1 + - CRC: 3486818945 + Mapper: 155 + - CRC: 3780272680 + Mapper: 206 + - CRC: 3950396775 + Mapper: 0 + - CRC: 3426043056 + Mapper: 1 + - CRC: 3666830766 + Mapper: 1 + - CRC: 116478485 + Mapper: 0 + - CRC: 2071133092 + Mapper: 1 + - CRC: 778611964 + Mapper: 3 + - CRC: 3808763950 + Mapper: 4 + - CRC: 805167656 + Mapper: 2 + - CRC: 3828752743 + Mapper: 85 + - CRC: 2436008989 + Mapper: 23 + - CRC: 1972378392 + Mapper: 1 + - CRC: 1767268115 + Mapper: 4 + - CRC: 1256866039 + Mapper: 4 + - CRC: 1744881075 + Mapper: 4 + - CRC: 936056833 + Mapper: 2 + - CRC: 3398872334 + Mapper: 4 + - CRC: 1193486137 + Mapper: 1 + - CRC: 379626403 + Mapper: 1 + - CRC: 608690235 + Mapper: 210 + - CRC: 1738785634 + Mapper: 1 + - CRC: 1022786284 + Mapper: 2 + - CRC: 3623533249 + Mapper: 22 + - CRC: 2556108037 + Mapper: 87 + - CRC: 557626363 + Mapper: 4 + - CRC: 621771027 + Mapper: 1 + - CRC: 1910032105 + Mapper: 1 + - CRC: 2038482167 + Mapper: 4 + - CRC: 2453639515 + Mapper: 4 + - CRC: 2598357232 + Mapper: 4 + - CRC: 1701659237 + Mapper: 0 + - CRC: 2446667418 + Mapper: 18 + - CRC: 3333281989 + Mapper: 206 + - CRC: 1474933276 + Mapper: 1 + - CRC: 495712036 + Mapper: 1 + - CRC: 3607009318 + Mapper: 1 + - CRC: 4259400910 + Mapper: 0 + - CRC: 65177999 + Mapper: 4 + - CRC: 1690028919 + Mapper: 0 + - CRC: 265732040 + Mapper: 4 + - CRC: 2231406780 + Mapper: 1 + - CRC: 3099176099 + Mapper: 0 + - CRC: 1360190497 + Mapper: 0 + - CRC: 1965507564 + Mapper: 1 + - CRC: 603239567 + Mapper: 4 + - CRC: 2981194634 + Mapper: 2 + - CRC: 1544699639 + Mapper: 4 + - CRC: 1429831091 + Mapper: 4 + - CRC: 1233225654 + Mapper: 1 + - CRC: 2914521336 + Mapper: 2 + - CRC: 1305286126 + Mapper: 1 + - CRC: 3052922465 + Mapper: 1 + - CRC: 1103900839 + Mapper: 1 + - CRC: 2605738568 + Mapper: 0 + - CRC: 4085285445 + Mapper: 2 + - CRC: 3015904234 + Mapper: 0 + - CRC: 2722534694 + Mapper: 0 + - CRC: 2948800788 + Mapper: 1 + - CRC: 2343198706 + Mapper: 0 + - CRC: 2261711890 + Mapper: 0 + - CRC: 4134454546 + Mapper: 4 + - CRC: 508377137 + Mapper: 1 + - CRC: 934685956 + Mapper: 118 + - CRC: 1510233331 + Mapper: 4 + - CRC: 2455011100 + Mapper: 1 + - CRC: 2061549372 + Mapper: 1 + - CRC: 3834827866 + Mapper: 0 + - CRC: 2313192958 + Mapper: 1 + - CRC: 3504304750 + Mapper: 2 + - CRC: 3770070971 + Mapper: 2 + - CRC: 4083299681 + Mapper: 4 + - CRC: 1097018550 + Mapper: 1 + - CRC: 154059100 + Mapper: 3 + - CRC: 1325607219 + Mapper: 4 + - CRC: 3394256690 + Mapper: 1 + - CRC: 2183129978 + Mapper: 0 + - CRC: 2777320865 + Mapper: 4 + - CRC: 228975406 + Mapper: 87 + - CRC: 4017723071 + Mapper: 19 + - CRC: 2634321572 + Mapper: 96 + - CRC: 3284173085 + Mapper: 96 + - CRC: 1314019287 + Mapper: 1 + - CRC: 1166209582 + Mapper: 4 + - CRC: 655273685 + Mapper: 0 + - CRC: 3796140977 + Mapper: 1 + - CRC: 651085606 + Mapper: 1 + - CRC: 4173440656 + Mapper: 1 + - CRC: 2644134438 + Mapper: 4 + - CRC: 4130719124 + Mapper: 184 + - CRC: 2432105011 + Mapper: 22 + - CRC: 214564844 + Mapper: 23 + - CRC: 1338177139 + Mapper: 75 + - CRC: 678415648 + Mapper: 21 + - CRC: 3952259882 + Mapper: 25 + - CRC: 919743189 + Mapper: 25 + - CRC: 1263630313 + Mapper: 4 + - CRC: 4095401312 + Mapper: 206 + - CRC: 1639197018 + Mapper: 87 + - CRC: 317737183 + Mapper: 75 + - CRC: 253471719 + Mapper: 18 + - CRC: 968264355 + Mapper: 23 + - CRC: 336658523 + Mapper: 4 + - CRC: 4271487981 + Mapper: 4 + - CRC: 3642816991 + Mapper: 33 + - CRC: 3675873384 + Mapper: 2 + - CRC: 1575781624 + Mapper: 1 + - CRC: 206017645 + Mapper: 210 + - CRC: 2536310981 + Mapper: 1 + - CRC: 2431441630 + Mapper: 3 + - CRC: 1697592100 + Mapper: 18 + - CRC: 4293415038 + Mapper: 4 + - CRC: 1812176145 + Mapper: 68 + - CRC: 2770819894 + Mapper: 68 + - CRC: 2724346817 + Mapper: 68 + - CRC: 185820555 + Mapper: 1 + - CRC: 1690135771 + Mapper: 1 + - CRC: 1318702756 + Mapper: 4 + - CRC: 1127843420 + Mapper: 69 + - CRC: 4239772446 + Mapper: 2 + - CRC: 1431323315 + Mapper: 3 + - CRC: 3523092792 + Mapper: 3 + - CRC: 915521824 + Mapper: 18 + - CRC: 2667819295 + Mapper: 2 + - CRC: 4170383611 + Mapper: 2 + - CRC: 2724374559 + Mapper: 16 + - CRC: 3703029921 + Mapper: 2 + - CRC: 3580384831 + Mapper: 4 + - CRC: 2323450558 + Mapper: 33 + - CRC: 856548456 + Mapper: 0 + - CRC: 2200216676 + Mapper: 2 + - CRC: 3678901879 + Mapper: 1 + - CRC: 1166511487 + Mapper: 4 + - CRC: 1378483421 + Mapper: 2 + - CRC: 3734805604 + Mapper: 80 + - CRC: 2693482241 + Mapper: 0 + - CRC: 2692489089 + Mapper: 0 + - CRC: 3181967588 + Mapper: 152 + - CRC: 625378630 + Mapper: 3 + - CRC: 2318848695 + Mapper: 1 + - CRC: 42350084 + Mapper: 2 + - CRC: 548371994 + Mapper: 4 + - CRC: 3176198704 + Mapper: 4 + - CRC: 3185815195 + Mapper: 66 + - CRC: 861967343 + Mapper: 66 + - CRC: 3609286771 + Mapper: 1 + - CRC: 2666509492 + Mapper: 4 + - CRC: 85775858 + Mapper: 4 + - CRC: 1157177382 + Mapper: 1 + - CRC: 3257672619 + Mapper: 1 + - CRC: 689687933 + Mapper: 1 + - CRC: 2345339283 + Mapper: 4 + - CRC: 2950707202 + Mapper: 4 + - CRC: 3767306848 + Mapper: 4 + - CRC: 2604421412 + Mapper: 4 + - CRC: 3389605960 + Mapper: 32 + - CRC: 4265115621 + Mapper: 32 + - CRC: 3324133414 + Mapper: 1 + - CRC: 3794278790 + Mapper: 1 + - CRC: 1895201463 + Mapper: 1 + - CRC: 2332292941 + Mapper: 21 + - CRC: 499185472 + Mapper: 210 + - CRC: 3542333446 + Mapper: 210 + - CRC: 704772561 + Mapper: 206 + - CRC: 3371026814 + Mapper: 4 + - CRC: 160196394 + Mapper: 19 + - CRC: 3863710069 + Mapper: 19 + - CRC: 2881450519 + Mapper: 1 + - CRC: 3438500866 + Mapper: 1 + - CRC: 407642404 + Mapper: 5 + - CRC: 4002309459 + Mapper: 5 + - CRC: 1987637717 + Mapper: 207 + - CRC: 2663237966 + Mapper: 1 + - CRC: 461101177 + Mapper: 1 + - CRC: 88522002 + Mapper: 4 + - CRC: 4132222277 + Mapper: 2 + - CRC: 1521829781 + Mapper: 1 + - CRC: 472537343 + Mapper: 4 + - CRC: 1988762474 + Mapper: 4 + - CRC: 2383253881 + Mapper: 1 + - CRC: 1218255275 + Mapper: 1 + - CRC: 1251587198 + Mapper: 0 + - CRC: 2382785739 + Mapper: 2 + - CRC: 2679000390 + Mapper: 2 + - CRC: 2068118314 + Mapper: 1 + - CRC: 416566202 + Mapper: 1 + - CRC: 773750744 + Mapper: 4 + - CRC: 1690368571 + Mapper: 2 + - CRC: 3717124343 + Mapper: 70 + - CRC: 706288126 + Mapper: 4 + - CRC: 683791317 + Mapper: 2 + - CRC: 3870493619 + Mapper: 1 + - CRC: 549835143 + Mapper: 4 + - CRC: 2804932099 + Mapper: 7 + - CRC: 1065014293 + Mapper: 1 + - CRC: 722591920 + Mapper: 1 + - CRC: 4008289922 + Mapper: 5 + - CRC: 4189332495 + Mapper: 5 + - CRC: 4114638715 + Mapper: 5 + - CRC: 2707521018 + Mapper: 5 + - CRC: 1005934950 + Mapper: 3 + - CRC: 1371374390 + Mapper: 2 + - CRC: 257892230 + Mapper: 1 + - CRC: 2637491653 + Mapper: 3 + - CRC: 3522682682 + Mapper: 2 + - CRC: 1998381911 + Mapper: 1 + - CRC: 1665569686 + Mapper: 1 + - CRC: 1621342211 + Mapper: 3 + - CRC: 2569728057 + Mapper: 1 + - CRC: 4079437985 + Mapper: 4 + - CRC: 3447336919 + Mapper: 1 + - CRC: 282468681 + Mapper: 2 + - CRC: 175351698 + Mapper: 1 + - CRC: 444504045 + Mapper: 1 + - CRC: 2654341134 + Mapper: 4 + - CRC: 2068973231 + Mapper: 16 + - CRC: 3078044167 + Mapper: 4 + - CRC: 1163700190 + Mapper: 0 + - CRC: 3811835809 + Mapper: 1 + - CRC: 2047988425 + Mapper: 1 + - CRC: 2617589540 + Mapper: 1 + - CRC: 2816967917 + Mapper: 1 + - CRC: 2304050432 + Mapper: 0 + - CRC: 2602601137 + Mapper: 1 + - CRC: 2017505677 + Mapper: 4 + - CRC: 73305304 + Mapper: 4 + - CRC: 3422252517 + Mapper: 4 + - CRC: 3345657332 + Mapper: 2 + - CRC: 2477969092 + Mapper: 65 + - CRC: 2015436479 + Mapper: 4 + - CRC: 2507029904 + Mapper: 4 + - CRC: 1515850969 + Mapper: 1 + - CRC: 4264855761 + Mapper: 5 + - CRC: 1096700169 + Mapper: 1 + - CRC: 569951403 + Mapper: 89 + - CRC: 1402464267 + Mapper: 206 + - CRC: 449249717 + Mapper: 1 + - CRC: 1668971211 + Mapper: 1 + - CRC: 3409109571 + Mapper: 4 + - CRC: 3091887052 + Mapper: 4 + - CRC: 2492337110 + Mapper: 4 + - CRC: 1355602483 + Mapper: 1 + - CRC: 1808162174 + Mapper: 140 + - CRC: 3356613754 + Mapper: 19 + - CRC: 2765938472 + Mapper: 1 + - CRC: 1909058846 + Mapper: 1 + - CRC: 1025257783 + Mapper: 78 + - CRC: 3145695898 + Mapper: 5 + - CRC: 1685710698 + Mapper: 18 + - CRC: 1516790001 + Mapper: 4 + - CRC: 2921860640 + Mapper: 4 + - CRC: 1152409818 + Mapper: 1 + - CRC: 3272384201 + Mapper: 1 + - CRC: 835169555 + Mapper: 4 + - CRC: 517461694 + Mapper: 4 + - CRC: 42169586 + Mapper: 4 + - CRC: 874981297 + Mapper: 80 + - CRC: 4108705550 + Mapper: 4 + - CRC: 3880427866 + Mapper: 1 + - CRC: 2176315816 + Mapper: 210 + - CRC: 3181875806 + Mapper: 87 + - CRC: 3373824835 + Mapper: 4 + - CRC: 228590232 + Mapper: 1 + - CRC: 1561353232 + Mapper: 4 + - CRC: 1448756865 + Mapper: 1 + - CRC: 2658631333 + Mapper: 1 + - CRC: 564001471 + Mapper: 2 + - CRC: 2720200096 + Mapper: 0 + - CRC: 4227900034 + Mapper: 0 + - CRC: 3648361891 + Mapper: 87 + - CRC: 117032724 + Mapper: 18 + - CRC: 3471148411 + Mapper: 1 + - CRC: 1433803057 + Mapper: 0 + - CRC: 791556343 + Mapper: 4 + - CRC: 2079893648 + Mapper: 4 + - CRC: 3620419983 + Mapper: 1 + - CRC: 3111766741 + Mapper: 32 + - CRC: 2659812229 + Mapper: 65 + - CRC: 3510204736 + Mapper: 97 + - CRC: 2873599246 + Mapper: 2 + - CRC: 4157735297 + Mapper: 1 + - CRC: 3535570675 + Mapper: 1 + - CRC: 1365976082 + Mapper: 4 + - CRC: 742662578 + Mapper: 16 + - CRC: 306721389 + Mapper: 4 + - CRC: 2700712888 + Mapper: 2 + - CRC: 3254515289 + Mapper: 23 + - CRC: 3813257016 + Mapper: 24 + - CRC: 674943524 + Mapper: 32 + - CRC: 3934885439 + Mapper: 3 + - CRC: 1142614758 + Mapper: 94 + - CRC: 2190446367 + Mapper: 1 + - CRC: 1735829879 + Mapper: 3 + - CRC: 543258410 + Mapper: 2 + - CRC: 646855120 + Mapper: 1 + - CRC: 3257649275 + Mapper: 4 + - CRC: 3576883599 + Mapper: 5 + - CRC: 602523446 + Mapper: 1 + - CRC: 1135645771 + Mapper: 3 + - CRC: 1256558429 + Mapper: 18 + - CRC: 3664317719 + Mapper: 1 + - CRC: 4197091979 + Mapper: 4 + - CRC: 4202562298 + Mapper: 3 + - CRC: 1961991286 + Mapper: 3 + - CRC: 1725760737 + Mapper: 1 + - CRC: 3836204086 + Mapper: 4 + - CRC: 1036704322 + Mapper: 2 + - CRC: 3640021474 + Mapper: 2 + - CRC: 3318736206 + Mapper: 2 + - CRC: 584504765 + Mapper: 206 + - CRC: 1682845995 + Mapper: 1 + - CRC: 3430567370 + Mapper: 4 + - CRC: 1225929030 + Mapper: 23 + - CRC: 3914158465 + Mapper: 1 + - CRC: 236356549 + Mapper: 80 + - CRC: 4292467460 + Mapper: 0 + - CRC: 1386949911 + Mapper: 1 + - CRC: 372034512 + Mapper: 1 + - CRC: 2545698181 + Mapper: 1 + - CRC: 302573396 + Mapper: 1 + - CRC: 2880073592 + Mapper: 1 + - CRC: 1903358932 + Mapper: 1 + - CRC: 3042404384 + Mapper: 1 + - CRC: 2623075494 + Mapper: 4 + - CRC: 271041586 + Mapper: 2 + - CRC: 2654298727 + Mapper: 1 + - CRC: 244940022 + Mapper: 1 + - CRC: 172152911 + Mapper: 2 + - CRC: 676893499 + Mapper: 1 + - CRC: 163708029 + Mapper: 1 + - CRC: 3391398306 + Mapper: 67 + - CRC: 972213835 + Mapper: 5 + - CRC: 3279042971 + Mapper: 206 + - CRC: 1688217365 + Mapper: 1 + - CRC: 68195157 + Mapper: 2 + - CRC: 1351170904 + Mapper: 1 + - CRC: 1209342385 + Mapper: 1 + - CRC: 717562684 + Mapper: 2 + - CRC: 2766747103 + Mapper: 69 + - CRC: 1275370750 + Mapper: 69 + - CRC: 2282106266 + Mapper: 4 + - CRC: 937576343 + Mapper: 4 + - CRC: 2815648606 + Mapper: 2 + - CRC: 1694317478 + Mapper: 4 + - CRC: 1657174404 + Mapper: 1 + - CRC: 2647224007 + Mapper: 18 + - CRC: 1066231945 + Mapper: 18 + - CRC: 4184672200 + Mapper: 1 + - CRC: 391924284 + Mapper: 75 + - CRC: 2135281653 + Mapper: 92 + - CRC: 1818342946 + Mapper: 72 + - CRC: 2996286951 + Mapper: 92 + - CRC: 817835450 + Mapper: 86 + - CRC: 2431906145 + Mapper: 86 + - CRC: 1562658007 + Mapper: 86 + - CRC: 4058428790 + Mapper: 86 + - CRC: 2666019094 + Mapper: 72 + - CRC: 1826212899 + Mapper: 1 + - CRC: 3705198324 + Mapper: 4 + - CRC: 3162184975 + Mapper: 33 + - CRC: 2931647817 + Mapper: 48 + - CRC: 2918582006 + Mapper: 33 + - CRC: 3070306804 + Mapper: 4 + - CRC: 281604858 + Mapper: 19 + - CRC: 1735576198 + Mapper: 4 + - CRC: 384384825 + Mapper: 1 + - CRC: 887012861 + Mapper: 1 + - CRC: 2211148863 + Mapper: 1 + - CRC: 1394134457 + Mapper: 4 + - CRC: 3915272672 + Mapper: 1 + - CRC: 3692955602 + Mapper: 1 + - CRC: 2621345728 + Mapper: 1 + - CRC: 151177456 + Mapper: 1 + - CRC: 3141751381 + Mapper: 1 + - CRC: 3126390057 + Mapper: 1 + - CRC: 153015721 + Mapper: 4 + - CRC: 3504682068 + Mapper: 80 + - CRC: 3466812762 + Mapper: 80 + - CRC: 1048075715 + Mapper: 1 + - CRC: 3796759379 + Mapper: 2 + - CRC: 2477249132 + Mapper: 4 + - CRC: 3296945076 + Mapper: 4 + - CRC: 4117276580 + Mapper: 1 + - CRC: 2388841001 + Mapper: 185 + - CRC: 2301410242 + Mapper: 185 + - CRC: 2279230416 + Mapper: 185 + - CRC: 2336893030 + Mapper: 3 + - CRC: 2595018589 + Mapper: 3 + - CRC: 2605971528 + Mapper: 1 + - CRC: 485296239 + Mapper: 5 + - CRC: 642721457 + Mapper: 1 + - CRC: 221545175 + Mapper: 4 + - CRC: 2506193293 + Mapper: 1 + - CRC: 40656842 + Mapper: 152 + - CRC: 4201464449 + Mapper: 3 + - CRC: 906668212 + Mapper: 1 + - CRC: 2561243737 + Mapper: 4 + - CRC: 1785426489 + Mapper: 2 + - CRC: 636333916 + Mapper: 1 + - CRC: 4217992250 + Mapper: 1 + - CRC: 1867399954 + Mapper: 5 + - CRC: 1396176700 + Mapper: 4 + - CRC: 4116788672 + Mapper: 4 + - CRC: 2823932649 + Mapper: 16 + - CRC: 1974725431 + Mapper: 18 + - CRC: 1775271387 + Mapper: 2 + - CRC: 246052117 + Mapper: 2 + - CRC: 568140148 + Mapper: 1 + - CRC: 3862794643 + Mapper: 1 + - CRC: 943124140 + Mapper: 1 + - CRC: 3155289626 + Mapper: 19 + - CRC: 2643943763 + Mapper: 1 + - CRC: 963579225 + Mapper: 1 + - CRC: 2246052107 + Mapper: 4 + - CRC: 126676272 + Mapper: 1 + - CRC: 60508828 + Mapper: 1 + - CRC: 3252136733 + Mapper: 0 + - CRC: 1868405546 + Mapper: 32 + - CRC: 1040229235 + Mapper: 3 + - CRC: 1276021691 + Mapper: 1 + - CRC: 4256737946 + Mapper: 4 + - CRC: 1511585297 + Mapper: 2 + - CRC: 2035067574 + Mapper: 75 + - CRC: 1270264880 + Mapper: 3 + - CRC: 2318829380 + Mapper: 2 + - CRC: 2371581888 + Mapper: 1 + - CRC: 3903811573 + Mapper: 3 + - CRC: 2560062865 + Mapper: 4 + - CRC: 3197481497 + Mapper: 2 + - CRC: 1625646065 + Mapper: 2 + - CRC: 3245446756 + Mapper: 155 + - CRC: 3929962717 + Mapper: 18 + - CRC: 2774665376 + Mapper: 2 + - CRC: 158594836 + Mapper: 1 + - CRC: 599721223 + Mapper: 1 + - CRC: 2223401 + Mapper: 1 + - CRC: 3959756740 + Mapper: 0 + - CRC: 2405600593 + Mapper: 4 + - CRC: 1952854631 + Mapper: 1 + - CRC: 127365510 + Mapper: 1 + - CRC: 193889865 + Mapper: 2 + - CRC: 666984465 + Mapper: 1 + - CRC: 623298883 + Mapper: 66 + - CRC: 1880824543 + Mapper: 4 + - CRC: 1651162441 + Mapper: 4 + - CRC: 2077817090 + Mapper: 4 + - CRC: 1782938179 + Mapper: 3 + - CRC: 2617559253 + Mapper: 16 + - CRC: 2994441460 + Mapper: 23 + - CRC: 3778559467 + Mapper: 26 + - CRC: 1161231900 + Mapper: 2 + - CRC: 4065936244 + Mapper: 4 + - CRC: 758092216 + Mapper: 1 + - CRC: 3208000975 + Mapper: 2 + - CRC: 3503054536 + Mapper: 1 + - CRC: 2719901532 + Mapper: 34 + - CRC: 2502598263 + Mapper: 1 + - CRC: 3092470947 + Mapper: 0 + - CRC: 2844008487 + Mapper: 0 + - CRC: 601430982 + Mapper: 0 + - CRC: 2243692407 + Mapper: 4 + - CRC: 4145347299 + Mapper: 1 + - CRC: 1497669179 + Mapper: 4 + - CRC: 2399213331 + Mapper: 4 + - CRC: 2554167669 + Mapper: 157 + - CRC: 2303655356 + Mapper: 157 + - CRC: 434639969 + Mapper: 157 + - CRC: 3188098367 + Mapper: 157 + - CRC: 199271208 + Mapper: 157 + - CRC: 1531278913 + Mapper: 157 + - CRC: 4112154438 + Mapper: 157 + - CRC: 1029064535 + Mapper: 0 + - CRC: 315020743 + Mapper: 2 + - CRC: 1240942048 + Mapper: 1 + - CRC: 845853622 + Mapper: 4 + - CRC: 1293600140 + Mapper: 1 + - CRC: 3660363162 + Mapper: 7 + - CRC: 2973030163 + Mapper: 1 + - CRC: 744032423 + Mapper: 4 + - CRC: 2977264883 + Mapper: 1 + - CRC: 1575360057 + Mapper: 1 + - CRC: 630530369 + Mapper: 4 + - CRC: 1572692121 + Mapper: 1 + - CRC: 2615030375 + Mapper: 3 + - CRC: 429052259 + Mapper: 4 + - CRC: 2379818789 + Mapper: 1 + - CRC: 1908344671 + Mapper: 1 + - CRC: 1854265565 + Mapper: 1 + - CRC: 902044884 + Mapper: 1 + - CRC: 1218377378 + Mapper: 1 + - CRC: 1539954593 + Mapper: 1 + - CRC: 2830162518 + Mapper: 1 + - CRC: 1676251820 + Mapper: 2 + - CRC: 3307717271 + Mapper: 4 + - CRC: 2471342410 + Mapper: 1 + - CRC: 3690530674 + Mapper: 3 + - CRC: 3803462248 + Mapper: 2 + - CRC: 427011752 + Mapper: 1 + - CRC: 2578052478 + Mapper: 1 + - CRC: 3342920518 + Mapper: 7 + - CRC: 4077187513 + Mapper: 2 + - CRC: 855311747 + Mapper: 3 + - CRC: 338024436 + Mapper: 3 + - CRC: 88913131 + Mapper: 4 + - CRC: 668856871 + Mapper: 2 + - CRC: 393341583 + Mapper: 3 + - CRC: 2087674207 + Mapper: 1 + - CRC: 934949473 + Mapper: 1 + - CRC: 2774508439 + Mapper: 3 + - CRC: 371028347 + Mapper: 4 + - CRC: 1088093370 + Mapper: 1 + - CRC: 451393843 + Mapper: 1 + - CRC: 1075005864 + Mapper: 0 + - CRC: 1825859961 + Mapper: 3 + - CRC: 368995599 + Mapper: 5 + - CRC: 1533847124 + Mapper: 1 + - CRC: 414337509 + Mapper: 1 + - CRC: 1125688056 + Mapper: 1 + - CRC: 527344675 + Mapper: 1 + - CRC: 413790425 + Mapper: 4 + - CRC: 1087461814 + Mapper: 1 + - CRC: 2950479140 + Mapper: 0 + - CRC: 3022266316 + Mapper: 1 + - CRC: 3673037298 + Mapper: 1 + - CRC: 1790628710 + Mapper: 1 + - CRC: 1053441498 + Mapper: 4 + - CRC: 687453215 + Mapper: 4 + - CRC: 3117356831 + Mapper: 1 + - CRC: 3259474493 + Mapper: 4 + - CRC: 65816239 + Mapper: 69 + - CRC: 331768190 + Mapper: 4 + - CRC: 741203892 + Mapper: 1 + - CRC: 1355598061 + Mapper: 3 + - CRC: 3468057350 + Mapper: 7 + - CRC: 664211676 + Mapper: 7 + - CRC: 3951347020 + Mapper: 7 + - CRC: 2795972024 + Mapper: 2 + - CRC: 3291374730 + Mapper: 1 + - CRC: 3300322620 + Mapper: 1 + - CRC: 2222810925 + Mapper: 4 + - CRC: 3528935200 + Mapper: 1 + - CRC: 2327128612 + Mapper: 2 + - CRC: 1058002788 + Mapper: 1 + - CRC: 1607641777 + Mapper: 4 + - CRC: 515595074 + Mapper: 1 + - CRC: 3684552585 + Mapper: 0 + - CRC: 1313144644 + Mapper: 4 + - CRC: 2834618782 + Mapper: 1 + - CRC: 3751875057 + Mapper: 4 + - CRC: 1594609194 + Mapper: 1 + - CRC: 2783498957 + Mapper: 1 + - CRC: 3767911410 + Mapper: 4 + - CRC: 1586496802 + Mapper: 1 + - CRC: 3785288092 + Mapper: 4 + - CRC: 2694878660 + Mapper: 3 + - CRC: 3458369652 + Mapper: 4 + - CRC: 3673806819 + Mapper: 0 + - CRC: 3186640623 + Mapper: 7 + - CRC: 3676111845 + Mapper: 2 + - CRC: 795271938 + Mapper: 2 + - CRC: 3190096776 + Mapper: 4 + - CRC: 1489493423 + Mapper: 4 + - CRC: 188762389 + Mapper: 4 + - CRC: 4112047448 + Mapper: 7 + - CRC: 4023545399 + Mapper: 7 + - CRC: 1932071309 + Mapper: 2 + - CRC: 94800072 + Mapper: 2 + - CRC: 182897122 + Mapper: 2 + - CRC: 791486377 + Mapper: 2 + - CRC: 311453284 + Mapper: 3 + - CRC: 180464271 + Mapper: 2 + - CRC: 3060320252 + Mapper: 2 + - CRC: 3978585534 + Mapper: 5 + - CRC: 3295798317 + Mapper: 1 + - CRC: 3521807555 + Mapper: 1 + - CRC: 3938681093 + Mapper: 3 + - CRC: 3452322300 + Mapper: 2 + - CRC: 4233593767 + Mapper: 1 + - CRC: 2347932854 + Mapper: 1 + - CRC: 2005086230 + Mapper: 0 + - CRC: 3511876354 + Mapper: 1 + - CRC: 2928043700 + Mapper: 3 + - CRC: 2192549928 + Mapper: 1 + - CRC: 2747323551 + Mapper: 2 + - CRC: 1472376398 + Mapper: 4 + - CRC: 762693545 + Mapper: 1 + - CRC: 3366801202 + Mapper: 7 + - CRC: 3794876435 + Mapper: 4 + - CRC: 19120126 + Mapper: 2 + - CRC: 2193508132 + Mapper: 2 + - CRC: 3321888901 + Mapper: 2 + - CRC: 852443911 + Mapper: 1 + - CRC: 547692955 + Mapper: 4 + - CRC: 2839908784 + Mapper: 4 + - CRC: 4127412272 + Mapper: 2 + - CRC: 3610943564 + Mapper: 1 + - CRC: 3515771875 + Mapper: 4 + - CRC: 3354444887 + Mapper: 4 + - CRC: 322292485 + Mapper: 4 + - CRC: 4026893494 + Mapper: 4 + - CRC: 2285080277 + Mapper: 4 + - CRC: 2894974442 + Mapper: 3 + - CRC: 2654482111 + Mapper: 1 + - CRC: 3249811975 + Mapper: 7 + - CRC: 965443970 + Mapper: 1 + - CRC: 1573793514 + Mapper: 1 + - CRC: 1736514982 + Mapper: 3 + - CRC: 3779441729 + Mapper: 1 + - CRC: 309626488 + Mapper: 4 + - CRC: 3262319664 + Mapper: 34 + - CRC: 2729387472 + Mapper: 0 + - CRC: 687567278 + Mapper: 1 + - CRC: 2804265683 + Mapper: 4 + - CRC: 1182886170 + Mapper: 1 + - CRC: 1760335819 + Mapper: 1 + - CRC: 3952697582 + Mapper: 3 + - CRC: 2774072146 + Mapper: 1 + - CRC: 3610820697 + Mapper: 2 + - CRC: 140371913 + Mapper: 1 + - CRC: 3685771813 + Mapper: 0 + - CRC: 485362721 + Mapper: 7 + - CRC: 204372067 + Mapper: 4 + - CRC: 2871002804 + Mapper: 3 + - CRC: 84193287 + Mapper: 0 + - CRC: 725060881 + Mapper: 7 + - CRC: 1358761158 + Mapper: 4 + - CRC: 331838685 + Mapper: 4 + - CRC: 2321812207 + Mapper: 4 + - CRC: 253542472 + Mapper: 1 + - CRC: 1132362601 + Mapper: 2 + - CRC: 3504959339 + Mapper: 2 + - CRC: 1935804673 + Mapper: 2 + - CRC: 1296022136 + Mapper: 1 + - CRC: 2707838095 + Mapper: 1 + - CRC: 2166294233 + Mapper: 66 + - CRC: 3621952515 + Mapper: 4 + - CRC: 994019568 + Mapper: 1 + - CRC: 625287500 + Mapper: 1 + - CRC: 2354739278 + Mapper: 1 + - CRC: 2825540376 + Mapper: 1 + - CRC: 1349395869 + Mapper: 1 + - CRC: 3389209402 + Mapper: 2 + - CRC: 1942486260 + Mapper: 2 + - CRC: 4021325941 + Mapper: 2 + - CRC: 600046381 + Mapper: 1 + - CRC: 951423204 + Mapper: 1 + - CRC: 3186178457 + Mapper: 1 + - CRC: 1137712144 + Mapper: 4 + - CRC: 717779587 + Mapper: 0 + - CRC: 94244063 + Mapper: 1 + - CRC: 176054996 + Mapper: 4 + - CRC: 197829847 + Mapper: 4 + - CRC: 1173372206 + Mapper: 1 + - CRC: 1474110417 + Mapper: 1 + - CRC: 3877483112 + Mapper: 1 + - CRC: 749395996 + Mapper: 4 + - CRC: 3463951550 + Mapper: 1 + - CRC: 3468503601 + Mapper: 1 + - CRC: 3577006478 + Mapper: 4 + - CRC: 949251139 + Mapper: 3 + - CRC: 645784780 + Mapper: 3 + - CRC: 3111529896 + Mapper: 3 + - CRC: 114764931 + Mapper: 2 + - CRC: 4180404210 + Mapper: 2 + - CRC: 4060010936 + Mapper: 2 + - CRC: 270008434 + Mapper: 1 + - CRC: 1519078824 + Mapper: 1 + - CRC: 3913542733 + Mapper: 1 + - CRC: 1045997694 + Mapper: 1 + - CRC: 3199293525 + Mapper: 3 + - CRC: 1466568168 + Mapper: 2 + - CRC: 489526271 + Mapper: 4 + - CRC: 2358111670 + Mapper: 4 + - CRC: 498105357 + Mapper: 0 + - CRC: 488678854 + Mapper: 4 + - CRC: 4041840411 + Mapper: 4 + - CRC: 2429979203 + Mapper: 3 + - CRC: 460442843 + Mapper: 4 + - CRC: 3969289297 + Mapper: 4 + - CRC: 247906339 + Mapper: 5 + - CRC: 572899855 + Mapper: 1 + - CRC: 2936402814 + Mapper: 4 + - CRC: 719943264 + Mapper: 1 + - CRC: 1779780456 + Mapper: 3 + - CRC: 3034875806 + Mapper: 2 + - CRC: 734158170 + Mapper: 1 + - CRC: 2428990401 + Mapper: 118 + - CRC: 2215939955 + Mapper: 1 + - CRC: 2679318819 + Mapper: 1 + - CRC: 1949855509 + Mapper: 1 + - CRC: 3479145200 + Mapper: 1 + - CRC: 3889349789 + Mapper: 0 + - CRC: 2315533526 + Mapper: 4 + - CRC: 4113756314 + Mapper: 1 + - CRC: 1318424947 + Mapper: 3 + - CRC: 890078046 + Mapper: 3 + - CRC: 324202937 + Mapper: 1 + - CRC: 249130818 + Mapper: 4 + - CRC: 1844238470 + Mapper: 1 + - CRC: 3199773441 + Mapper: 66 + - CRC: 3516779307 + Mapper: 4 + - CRC: 2826455346 + Mapper: 2 + - CRC: 490851468 + Mapper: 3 + - CRC: 779020685 + Mapper: 1 + - CRC: 2216389046 + Mapper: 1 + - CRC: 887795764 + Mapper: 4 + - CRC: 3944027806 + Mapper: 1 + - CRC: 943500223 + Mapper: 119 + - CRC: 946464152 + Mapper: 2 + - CRC: 3395214332 + Mapper: 4 + - CRC: 4078778019 + Mapper: 4 + - CRC: 772227510 + Mapper: 4 + - CRC: 3626175758 + Mapper: 1 + - CRC: 4100018230 + Mapper: 1 + - CRC: 1515132269 + Mapper: 1 + - CRC: 1998358613 + Mapper: 4 + - CRC: 3217019485 + Mapper: 4 + - CRC: 4171699134 + Mapper: 3 + - CRC: 2009041699 + Mapper: 0 + - CRC: 4221097070 + Mapper: 0 + - CRC: 2925841015 + Mapper: 0 + - CRC: 1451103776 + Mapper: 1 + - CRC: 1700724461 + Mapper: 2 + - CRC: 757545636 + Mapper: 2 + - CRC: 1330017296 + Mapper: 1 + - CRC: 93266850 + Mapper: 4 + - CRC: 2345292102 + Mapper: 1 + - CRC: 782814230 + Mapper: 2 + - CRC: 2697140823 + Mapper: 4 + - CRC: 3033012955 + Mapper: 4 + - CRC: 3747911227 + Mapper: 4 + - CRC: 2974721234 + Mapper: 1 + - CRC: 589825134 + Mapper: 7 + - CRC: 1766105114 + Mapper: 4 + - CRC: 1258560363 + Mapper: 7 + - CRC: 3272863572 + Mapper: 2 + - CRC: 492503973 + Mapper: 2 + - CRC: 1168381828 + Mapper: 4 + - CRC: 4136208985 + Mapper: 4 + - CRC: 668027476 + Mapper: 3 + - CRC: 3050376540 + Mapper: 7 + - CRC: 711338695 + Mapper: 7 + - CRC: 199069145 + Mapper: 7 + - CRC: 1787320223 + Mapper: 7 + - CRC: 1901513549 + Mapper: 1 + - CRC: 15293830 + Mapper: 2 + - CRC: 651364396 + Mapper: 4 + - CRC: 3476171699 + Mapper: 3 + - CRC: 809321329 + Mapper: 2 + - CRC: 3804556750 + Mapper: 1 + - CRC: 3191372528 + Mapper: 3 + - CRC: 998202171 + Mapper: 4 + - CRC: 1953803410 + Mapper: 4 + - CRC: 2896250328 + Mapper: 3 + - CRC: 4096462269 + Mapper: 3 + - CRC: 1418341436 + Mapper: 206 + - CRC: 3440434402 + Mapper: 4 + - CRC: 1359250238 + Mapper: 4 + - CRC: 3656414367 + Mapper: 1 + - CRC: 3598702246 + Mapper: 1 + - CRC: 2397553726 + Mapper: 4 + - CRC: 2859186565 + Mapper: 2 + - CRC: 2173883111 + Mapper: 1 + - CRC: 2839631202 + Mapper: 1 + - CRC: 28625545 + Mapper: 3 + - CRC: 8616288 + Mapper: 4 + - CRC: 4115346621 + Mapper: 3 + - CRC: 3615050492 + Mapper: 4 + - CRC: 1591144993 + Mapper: 4 + - CRC: 923307775 + Mapper: 4 + - CRC: 1446784192 + Mapper: 4 + - CRC: 4108311316 + Mapper: 2 + - CRC: 3956271045 + Mapper: 1 + - CRC: 3586540119 + Mapper: 0 + - CRC: 2859771096 + Mapper: 3 + - CRC: 2618848811 + Mapper: 5 + - CRC: 2957511401 + Mapper: 5 + - CRC: 3889859076 + Mapper: 4 + - CRC: 2296489460 + Mapper: 1 + - CRC: 4051812385 + Mapper: 4 + - CRC: 74866992 + Mapper: 1 + - CRC: 2719567021 + Mapper: 2 + - CRC: 97408524 + Mapper: 4 + - CRC: 2795448826 + Mapper: 1 + - CRC: 1886892149 + Mapper: 1 + - CRC: 3300689314 + Mapper: 2 + - CRC: 1080153959 + Mapper: 2 + - CRC: 2241619425 + Mapper: 1 + - CRC: 1531666518 + Mapper: 4 + - CRC: 3162500537 + Mapper: 4 + - CRC: 3051590370 + Mapper: 4 + - CRC: 2941679326 + Mapper: 0 + - CRC: 4253903989 + Mapper: 2 + - CRC: 2476282931 + Mapper: 4 + - CRC: 2559263853 + Mapper: 0 + - CRC: 2968253403 + Mapper: 4 + - CRC: 154764591 + Mapper: 1 + - CRC: 40780229 + Mapper: 4 + - CRC: 1589176071 + Mapper: 1 + - CRC: 3334663605 + Mapper: 1 + - CRC: 2447566947 + Mapper: 4 + - CRC: 2167969287 + Mapper: 0 + - CRC: 2688172587 + Mapper: 3 + - CRC: 2531705294 + Mapper: 3 + - CRC: 228547537 + Mapper: 1 + - CRC: 2214344952 + Mapper: 4 + - CRC: 159860599 + Mapper: 7 + - CRC: 542480154 + Mapper: 4 + - CRC: 1440448042 + Mapper: 4 + - CRC: 1592131726 + Mapper: 1 + - CRC: 265273421 + Mapper: 1 + - CRC: 1614457431 + Mapper: 4 + - CRC: 734427816 + Mapper: 4 + - CRC: 413329231 + Mapper: 4 + - CRC: 1054668776 + Mapper: 4 + - CRC: 2559023272 + Mapper: 4 + - CRC: 1860483850 + Mapper: 2 + - CRC: 302484221 + Mapper: 4 + - CRC: 2171875820 + Mapper: 2 + - CRC: 87524871 + Mapper: 1 + - CRC: 3165436916 + Mapper: 4 + - CRC: 1879574544 + Mapper: 1 + - CRC: 2485850640 + Mapper: 4 + - CRC: 2087337297 + Mapper: 3 + - CRC: 1874020834 + Mapper: 4 + - CRC: 2553150264 + Mapper: 4 + - CRC: 1395271654 + Mapper: 4 + - CRC: 2864899934 + Mapper: 3 + - CRC: 1064829820 + Mapper: 4 + - CRC: 2924666574 + Mapper: 0 + - CRC: 1483354743 + Mapper: 3 + - CRC: 3821386557 + Mapper: 4 + - CRC: 2538056713 + Mapper: 1 + - CRC: 3846366159 + Mapper: 4 + - CRC: 45737922 + Mapper: 1 + - CRC: 795446349 + Mapper: 3 + - CRC: 168371901 + Mapper: 1 + - CRC: 3067269888 + Mapper: 0 + - CRC: 2674659740 + Mapper: 1 + - CRC: 3050475170 + Mapper: 3 + - CRC: 87503402 + Mapper: 7 + - CRC: 3530489208 + Mapper: 66 + - CRC: 4139350428 + Mapper: 1 + - CRC: 3115637216 + Mapper: 118 + - CRC: 1385914911 + Mapper: 1 + - CRC: 1625699639 + Mapper: 1 + - CRC: 1081962493 + Mapper: 47 + - CRC: 901185215 + Mapper: 2 + - CRC: 1196533585 + Mapper: 1 + - CRC: 2785846230 + Mapper: 4 + - CRC: 1025263764 + Mapper: 4 + - CRC: 2418946408 + Mapper: 4 + - CRC: 3078640156 + Mapper: 4 + - CRC: 2085253848 + Mapper: 1 + - CRC: 46938483 + Mapper: 3 + - CRC: 185471631 + Mapper: 105 + - CRC: 2720421882 + Mapper: 4 + - CRC: 4286710741 + Mapper: 4 + - CRC: 2363783387 + Mapper: 5 + - CRC: 1178787238 + Mapper: 1 + - CRC: 2929669072 + Mapper: 4 + - CRC: 3989005867 + Mapper: 1 + - CRC: 2509130670 + Mapper: 1 + - CRC: 1772068997 + Mapper: 0 + - CRC: 676729119 + Mapper: 1 + - CRC: 1965383560 + Mapper: 1 + - CRC: 2655952066 + Mapper: 0 + - CRC: 2847667279 + Mapper: 0 + - CRC: 1807130830 + Mapper: 1 + - CRC: 1130032838 + Mapper: 4 + - CRC: 973694385 + Mapper: 2 + - CRC: 839411750 + Mapper: 3 + - CRC: 540360291 + Mapper: 1 + - CRC: 3426158924 + Mapper: 1 + - CRC: 3691180181 + Mapper: 1 + - CRC: 624482400 + Mapper: 1 + - CRC: 3516587499 + Mapper: 119 + - CRC: 3169286257 + Mapper: 3 + - CRC: 3010894417 + Mapper: 1 + - CRC: 1767183778 + Mapper: 1 + - CRC: 3530798089 + Mapper: 4 + - CRC: 1559574260 + Mapper: 4 + - CRC: 2418175552 + Mapper: 4 + - CRC: 2816370148 + Mapper: 1 + - CRC: 1892562801 + Mapper: 2 + - CRC: 1450534421 + Mapper: 1 + - CRC: 1106895018 + Mapper: 118 + - CRC: 3874524819 + Mapper: 2 + - CRC: 1689718994 + Mapper: 2 + - CRC: 3109985919 + Mapper: 9 + - CRC: 1846457406 + Mapper: 2 + - CRC: 3949007675 + Mapper: 3 + - CRC: 2514806164 + Mapper: 1 + - CRC: 3232904480 + Mapper: 3 + - CRC: 1012695508 + Mapper: 206 + - CRC: 3708170140 + Mapper: 7 + - CRC: 2867669340 + Mapper: 1 + - CRC: 2665292121 + Mapper: 7 + - CRC: 3972874377 + Mapper: 1 + - CRC: 1078668939 + Mapper: 4 + - CRC: 2342338204 + Mapper: 1 + - CRC: 3540571436 + Mapper: 0 + - CRC: 2661407862 + Mapper: 2 + - CRC: 3787726204 + Mapper: 2 + - CRC: 2739054077 + Mapper: 2 + - CRC: 1335737317 + Mapper: 2 + - CRC: 641386656 + Mapper: 4 + - CRC: 645490520 + Mapper: 4 + - CRC: 2690027037 + Mapper: 2 + - CRC: 1677508829 + Mapper: 1 + - CRC: 1538664072 + Mapper: 206 + - CRC: 3921905644 + Mapper: 4 + - CRC: 2329556119 + Mapper: 1 + - CRC: 2259734991 + Mapper: 1 + - CRC: 3284976787 + Mapper: 1 + - CRC: 2165013177 + Mapper: 2 + - CRC: 3033397599 + Mapper: 1 + - CRC: 2567538112 + Mapper: 1 + - CRC: 2517137800 + Mapper: 1 + - CRC: 422401135 + Mapper: 4 + - CRC: 1198391851 + Mapper: 4 + - CRC: 1744269592 + Mapper: 1 + - CRC: 2301099340 + Mapper: 4 + - CRC: 25855641 + Mapper: 4 + - CRC: 961375791 + Mapper: 4 + - CRC: 1768118894 + Mapper: 1 + - CRC: 594591913 + Mapper: 4 + - CRC: 2856949697 + Mapper: 4 + - CRC: 4027704464 + Mapper: 5 + - CRC: 3323469860 + Mapper: 1 + - CRC: 1850593234 + Mapper: 4 + - CRC: 3727014159 + Mapper: 2 + - CRC: 3011002154 + Mapper: 2 + - CRC: 935621845 + Mapper: 2 + - CRC: 1947770386 + Mapper: 1 + - CRC: 66803638 + Mapper: 4 + - CRC: 267161810 + Mapper: 2 + - CRC: 665467187 + Mapper: 0 + - CRC: 619629589 + Mapper: 1 + - CRC: 865351670 + Mapper: 1 + - CRC: 3960455902 + Mapper: 1 + - CRC: 4259432429 + Mapper: 1 + - CRC: 1559668782 + Mapper: 1 + - CRC: 3721989177 + Mapper: 4 + - CRC: 1780441738 + Mapper: 4 + - CRC: 2854287165 + Mapper: 4 + - CRC: 3191600051 + Mapper: 1 + - CRC: 2233383358 + Mapper: 3 + - CRC: 1681244309 + Mapper: 1 + - CRC: 1024038578 + Mapper: 1 + - CRC: 3696076244 + Mapper: 2 + - CRC: 1584821873 + Mapper: 2 + - CRC: 3091458948 + Mapper: 2 + - CRC: 3880423867 + Mapper: 1 + - CRC: 3202466009 + Mapper: 4 + - CRC: 110500836 + Mapper: 1 + - CRC: 1111153294 + Mapper: 2 + - CRC: 3920019985 + Mapper: 1 + - CRC: 857870426 + Mapper: 1 + - CRC: 2684235605 + Mapper: 1 + - CRC: 2254900371 + Mapper: 0 + - CRC: 1860783410 + Mapper: 4 + - CRC: 4260648603 + Mapper: 1 + - CRC: 1223230672 + Mapper: 1 + - CRC: 2828153430 + Mapper: 1 + - CRC: 497836552 + Mapper: 1 + - CRC: 2165422600 + Mapper: 7 + - CRC: 1080577685 + Mapper: 3 + - CRC: 3989773169 + Mapper: 7 + - CRC: 572580170 + Mapper: 1 + - CRC: 2580634257 + Mapper: 0 + - CRC: 3598279290 + Mapper: 4 + - CRC: 3484327418 + Mapper: 1 + - CRC: 3340337073 + Mapper: 3 + - CRC: 3298830098 + Mapper: 0 + - CRC: 1156792690 + Mapper: 0 + - CRC: 4243002129 + Mapper: 3 + - CRC: 1659037692 + Mapper: 4 + - CRC: 4242802852 + Mapper: 3 + - CRC: 640375325 + Mapper: 3 + - CRC: 384541962 + Mapper: 4 + - CRC: 3849676924 + Mapper: 2 + - CRC: 2977051448 + Mapper: 3 + - CRC: 3250807659 + Mapper: 4 + - CRC: 604890934 + Mapper: 4 + - CRC: 2671977876 + Mapper: 2 + - CRC: 3495231408 + Mapper: 4 + - CRC: 2291214795 + Mapper: 4 + - CRC: 3336404585 + Mapper: 1 + - CRC: 3316691371 + Mapper: 2 + - CRC: 1641570663 + Mapper: 1 + - CRC: 2376487380 + Mapper: 4 + - CRC: 49166086 + Mapper: 1 + - CRC: 811290210 + Mapper: 4 + - CRC: 1100243408 + Mapper: 2 + - CRC: 1754886649 + Mapper: 1 + - CRC: 4023334749 + Mapper: 2 + - CRC: 3477374882 + Mapper: 1 + - CRC: 1470916527 + Mapper: 4 + - CRC: 3394849486 + Mapper: 4 + - CRC: 2695935810 + Mapper: 4 + - CRC: 778240493 + Mapper: 4 + - CRC: 2543604500 + Mapper: 2 + - CRC: 3896573217 + Mapper: 4 + - CRC: 2873181278 + Mapper: 4 + - CRC: 3612026649 + Mapper: 3 + - CRC: 531154084 + Mapper: 1 + - CRC: 2717863453 + Mapper: 1 + - CRC: 1180587139 + Mapper: 4 + - CRC: 873983046 + Mapper: 2 + - CRC: 2119695340 + Mapper: 4 + - CRC: 3552573230 + Mapper: 3 + - CRC: 1089284765 + Mapper: 1 + - CRC: 1210874287 + Mapper: 1 + - CRC: 2415073430 + Mapper: 0 + - CRC: 3206875890 + Mapper: 0 + - CRC: 2039409560 + Mapper: 1 + - CRC: 2478085506 + Mapper: 1 + - CRC: 2903679823 + Mapper: 1 + - CRC: 3456107053 + Mapper: 1 + - CRC: 2242298069 + Mapper: 1 + - CRC: 1768781881 + Mapper: 1 + - CRC: 642904615 + Mapper: 4 + - CRC: 3666758388 + Mapper: 4 + - CRC: 3041636030 + Mapper: 4 + - CRC: 395971927 + Mapper: 4 + - CRC: 2146918937 + Mapper: 1 + - CRC: 3144513865 + Mapper: 4 + - CRC: 2837544610 + Mapper: 4 + - CRC: 4002553230 + Mapper: 1 + - CRC: 2257997533 + Mapper: 4 + - CRC: 3928470647 + Mapper: 4 + - CRC: 709277055 + Mapper: 2 + - CRC: 2622716185 + Mapper: 4 + - CRC: 328529278 + Mapper: 1 + - CRC: 3869538226 + Mapper: 2 + - CRC: 1699843758 + Mapper: 1 + - CRC: 3065991479 + Mapper: 1 + - CRC: 104748627 + Mapper: 1 + - CRC: 1735725204 + Mapper: 1 + - CRC: 1433876608 + Mapper: 2 + - CRC: 3639506537 + Mapper: 1 + - CRC: 578614647 + Mapper: 4 + - CRC: 1371464682 + Mapper: 1 + - CRC: 2608994947 + Mapper: 1 + - CRC: 1800601706 + Mapper: 1 + - CRC: 487542123 + Mapper: 2 + - CRC: 4084985813 + Mapper: 4 + - CRC: 2670653216 + Mapper: 2 + - CRC: 309247846 + Mapper: 4 + - CRC: 3842674992 + Mapper: 1 + - CRC: 3623236108 + Mapper: 1 + - CRC: 435473003 + Mapper: 1 + - CRC: 803343737 + Mapper: 4 + - CRC: 3669510812 + Mapper: 4 + - CRC: 2576709558 + Mapper: 2 + - CRC: 771719132 + Mapper: 1 + - CRC: 4198700139 + Mapper: 2 + - CRC: 66623949 + Mapper: 4 + - CRC: 1316451130 + Mapper: 4 + - CRC: 2290730340 + Mapper: 4 + - CRC: 2819231489 + Mapper: 4 + - CRC: 737549395 + Mapper: 4 + - CRC: 1628937210 + Mapper: 4 + - CRC: 2553890981 + Mapper: 3 + - CRC: 52899483 + Mapper: 4 + - CRC: 3813906079 + Mapper: 4 + - CRC: 1771566561 + Mapper: 3 + - CRC: 3152899694 + Mapper: 3 + - CRC: 1071805179 + Mapper: 1 + - CRC: 3942116722 + Mapper: 1 + - CRC: 1004684527 + Mapper: 2 + - CRC: 600932190 + Mapper: 4 + - CRC: 2451140979 + Mapper: 1 + - CRC: 2462136548 + Mapper: 1 + - CRC: 2110475288 + Mapper: 1 + - CRC: 670617810 + Mapper: 4 + - CRC: 3918182723 + Mapper: 4 + - CRC: 493743308 + Mapper: 1 + - CRC: 1863321981 + Mapper: 1 + - CRC: 1380502259 + Mapper: 1 + - CRC: 1947635775 + Mapper: 4 + - CRC: 1502722512 + Mapper: 4 + - CRC: 2698988431 + Mapper: 4 + - CRC: 1651688777 + Mapper: 4 + - CRC: 1401737962 + Mapper: 1 + - CRC: 759295890 + Mapper: 2 + - CRC: 547304839 + Mapper: 1 + - CRC: 1485451774 + Mapper: 1 + - CRC: 549950955 + Mapper: 1 + - CRC: 902231412 + Mapper: 4 + - CRC: 3624617148 + Mapper: 66 + - CRC: 769404355 + Mapper: 1 + - CRC: 2947837398 + Mapper: 2 + - CRC: 3284641128 + Mapper: 3 + - CRC: 332771748 + Mapper: 7 + - CRC: 260505268 + Mapper: 2 + - CRC: 2175134565 + Mapper: 4 + - CRC: 2581453572 + Mapper: 4 + - CRC: 2657129124 + Mapper: 4 + - CRC: 3733969205 + Mapper: 4 + - CRC: 2142718531 + Mapper: 4 + - CRC: 3594203381 + Mapper: 4 + - CRC: 1355978419 + Mapper: 1 + - CRC: 1310865037 + Mapper: 2 + - CRC: 3480030586 + Mapper: 2 + - CRC: 1871377384 + Mapper: 4 + - CRC: 4187895787 + Mapper: 1 + - CRC: 612722343 + Mapper: 2 + - CRC: 3056194901 + Mapper: 4 + - CRC: 3931027102 + Mapper: 1 + - CRC: 4027178450 + Mapper: 4 + - CRC: 163611575 + Mapper: 1 + - CRC: 2141295079 + Mapper: 1 + - CRC: 2627679601 + Mapper: 3 + - CRC: 3105380364 + Mapper: 1 + - CRC: 3999830763 + Mapper: 2 + - CRC: 4231945350 + Mapper: 2 + - CRC: 251080935 + Mapper: 4 + - CRC: 3475415369 + Mapper: 2 + - CRC: 2751864855 + Mapper: 1 + - CRC: 2723837199 + Mapper: 1 + - CRC: 1210314494 + Mapper: 1 + - CRC: 3817326463 + Mapper: 4 + - CRC: 2674712945 + Mapper: 4 + - CRC: 2896254531 + Mapper: 5 + - CRC: 2611770351 + Mapper: 4 + - CRC: 3379784093 + Mapper: 1 + - CRC: 1966565542 + Mapper: 4 + - CRC: 1583803114 + Mapper: 13 + - CRC: 662140469 + Mapper: 0 + - CRC: 1075126775 + Mapper: 4 + - CRC: 3060145114 + Mapper: 2 + - CRC: 4154095063 + Mapper: 4 + - CRC: 368104433 + Mapper: 2 + - CRC: 2966224911 + Mapper: 4 + - CRC: 1588057104 + Mapper: 4 + - CRC: 859588768 + Mapper: 4 + - CRC: 4227377029 + Mapper: 7 + - CRC: 862517243 + Mapper: 7 + - CRC: 10155710 + Mapper: 7 + - CRC: 1748514311 + Mapper: 7 + - CRC: 1109442928 + Mapper: 7 + - CRC: 2440523992 + Mapper: 4 + - CRC: 3276159549 + Mapper: 4 + - CRC: 313705313 + Mapper: 7 + - CRC: 1876271729 + Mapper: 4 + - CRC: 3888742818 + Mapper: 4 + - CRC: 272531071 + Mapper: 1 + - CRC: 4149083281 + Mapper: 1 + - CRC: 1384645269 + Mapper: 1 + - CRC: 2527001060 + Mapper: 2 + - CRC: 3652933420 + Mapper: 1 + - CRC: 1807957295 + Mapper: 4 + - CRC: 1348441877 + Mapper: 7 + - CRC: 642998005 + Mapper: 7 + - CRC: 3528859762 + Mapper: 7 + - CRC: 893873799 + Mapper: 4 + - CRC: 2241062317 + Mapper: 4 + - CRC: 1463085982 + Mapper: 3 + - CRC: 2940211434 + Mapper: 3 + - CRC: 4128483577 + Mapper: 7 + - CRC: 4132518285 + Mapper: 1 + - CRC: 981935033 + Mapper: 1 + - CRC: 3951048208 + Mapper: 4 + - CRC: 2068762811 + Mapper: 4 + - CRC: 2686651765 + Mapper: 2 + - CRC: 3563133817 + Mapper: 4 + - CRC: 924024889 + Mapper: 7 + - CRC: 1897436856 + Mapper: 1 + - CRC: 3755413031 + Mapper: 0 + - CRC: 2975936486 + Mapper: 1 + - CRC: 1355891196 + Mapper: 1 + - CRC: 1387628338 + Mapper: 4 + - CRC: 3890927931 + Mapper: 1 + - CRC: 3801262608 + Mapper: 2 + - CRC: 3123849317 + Mapper: 1 + - CRC: 3629616125 + Mapper: 4 + - CRC: 2871706405 + Mapper: 1 + - CRC: 2395719031 + Mapper: 1 + - CRC: 985694986 + Mapper: 1 + - CRC: 1802901592 + Mapper: 1 + - CRC: 2235559588 + Mapper: 4 + - CRC: 926511508 + Mapper: 1 + - CRC: 3746487315 + Mapper: 1 + - CRC: 2717452326 + Mapper: 1 + - CRC: 1295275042 + Mapper: 1 + - CRC: 1104359383 + Mapper: 7 + - CRC: 1972639954 + Mapper: 2 + - CRC: 3720796617 + Mapper: 4 + - CRC: 2540213202 + Mapper: 3 + - CRC: 2340240501 + Mapper: 1 + - CRC: 3684435757 + Mapper: 7 + - CRC: 3062863892 + Mapper: 4 + - CRC: 3984045139 + Mapper: 2 + - CRC: 3851613498 + Mapper: 3 + - CRC: 2786407734 + Mapper: 1 + - CRC: 3593531023 + Mapper: 1 + - CRC: 2351246020 + Mapper: 4 + - CRC: 3846256809 + Mapper: 0 + - CRC: 2321933692 + Mapper: 4 + - CRC: 3546609686 + Mapper: 1 + - CRC: 526803174 + Mapper: 1 + - CRC: 2043973428 + Mapper: 4 + - CRC: 3123871705 + Mapper: 69 + - CRC: 3505851958 + Mapper: 4 + - CRC: 4233111278 + Mapper: 3 + - CRC: 601347215 + Mapper: 7 + - CRC: 1380604466 + Mapper: 7 + - CRC: 3303545124 + Mapper: 4 + - CRC: 3174276725 + Mapper: 2 + - CRC: 885123219 + Mapper: 1 + - CRC: 4202620482 + Mapper: 1 + - CRC: 3236818384 + Mapper: 2 + - CRC: 2164713108 + Mapper: 1 + - CRC: 3375071563 + Mapper: 4 + - CRC: 3858547905 + Mapper: 1 + - CRC: 2309248070 + Mapper: 4 + - CRC: 3382405386 + Mapper: 1 + - CRC: 1730194348 + Mapper: 4 + - CRC: 675882374 + Mapper: 4 + - CRC: 3019904810 + Mapper: 2 + - CRC: 361811810 + Mapper: 4 + - CRC: 1516433791 + Mapper: 4 + - CRC: 2375032749 + Mapper: 4 + - CRC: 519977195 + Mapper: 7 + - CRC: 3481053629 + Mapper: 2 + - CRC: 1730093992 + Mapper: 5 + - CRC: 3606526014 + Mapper: 1 + - CRC: 2838833122 + Mapper: 2 + - CRC: 3229013615 + Mapper: 1 + - CRC: 4164816173 + Mapper: 1 + - CRC: 2230844465 + Mapper: 1 + - CRC: 1746376872 + Mapper: 3 + - CRC: 2307801650 + Mapper: 7 + - CRC: 337992791 + Mapper: 1 + - CRC: 2175748857 + Mapper: 2 + - CRC: 667551353 + Mapper: 7 + - CRC: 3487574746 + Mapper: 1 + - CRC: 1727439774 + Mapper: 1 + - CRC: 1145030349 + Mapper: 1 + - CRC: 4201894818 + Mapper: 4 + - CRC: 1761195509 + Mapper: 1 + - CRC: 802350642 + Mapper: 1 + - CRC: 209207052 + Mapper: 0 + - CRC: 1618726944 + Mapper: 1 + - CRC: 2530194648 + Mapper: 7 + - CRC: 3922940651 + Mapper: 4 + - CRC: 2930956116 + Mapper: 4 + - CRC: 2711667007 + Mapper: 1 + - CRC: 2135732660 + Mapper: 2 + - CRC: 2536886887 + Mapper: 1 + - CRC: 1329278551 + Mapper: 66 + - CRC: 2965128913 + Mapper: 66 + - CRC: 4179196253 + Mapper: 4 + - CRC: 3825381684 + Mapper: 3 + - CRC: 158172004 + Mapper: 2 + - CRC: 818276047 + Mapper: 2 + - CRC: 219424858 + Mapper: 2 + - CRC: 3492411457 + Mapper: 2 + - CRC: 884700539 + Mapper: 1 + - CRC: 970207841 + Mapper: 4 + - CRC: 2454511115 + Mapper: 1 + - CRC: 2763901981 + Mapper: 1 + - CRC: 2316071735 + Mapper: 0 + - CRC: 627282673 + Mapper: 4 + - CRC: 2560364569 + Mapper: 4 + - CRC: 3149336793 + Mapper: 4 + - CRC: 3545486161 + Mapper: 4 + - CRC: 4201969238 + Mapper: 4 + - CRC: 2267932578 + Mapper: 4 + - CRC: 1992384995 + Mapper: 1 + - CRC: 4225008244 + Mapper: 4 + - CRC: 1403630906 + Mapper: 1 + - CRC: 1220079192 + Mapper: 1 + - CRC: 2576712872 + Mapper: 0 + - CRC: 1325964938 + Mapper: 4 + - CRC: 2261030342 + Mapper: 4 + - CRC: 2046199996 + Mapper: 4 + - CRC: 2357744495 + Mapper: 4 + - CRC: 2069222529 + Mapper: 1 + - CRC: 2473173752 + Mapper: 2 + - CRC: 3523982871 + Mapper: 118 + - CRC: 3222287762 + Mapper: 1 + - CRC: 1179124786 + Mapper: 1 + - CRC: 1448811483 + Mapper: 0 + - CRC: 1371872309 + Mapper: 3 + - CRC: 723562530 + Mapper: 4 + - CRC: 1647183178 + Mapper: 1 + - CRC: 3080466957 + Mapper: 2 + - CRC: 1741406368 + Mapper: 4 + - CRC: 471936669 + Mapper: 119 + - CRC: 1757818448 + Mapper: 4 + - CRC: 3213396853 + Mapper: 1 + - CRC: 1035824559 + Mapper: 1 + - CRC: 2889766519 + Mapper: 1 + - CRC: 2118887311 + Mapper: 4 + - CRC: 2256959536 + Mapper: 3 + - CRC: 2459059528 + Mapper: 0 + - CRC: 1401034930 + Mapper: 2 + - CRC: 2375734207 + Mapper: 2 + - CRC: 2792182096 + Mapper: 1 + - CRC: 3748465896 + Mapper: 1 + - CRC: 1766621215 + Mapper: 7 + - CRC: 1270462528 + Mapper: 4 + - CRC: 84952343 + Mapper: 7 + - CRC: 2205147842 + Mapper: 2 + - CRC: 2061877250 + Mapper: 4 + - CRC: 2695209145 + Mapper: 4 + - CRC: 3087110839 + Mapper: 2 + - CRC: 68429668 + Mapper: 4 + - CRC: 2875658788 + Mapper: 1 + - CRC: 1813689925 + Mapper: 4 + - CRC: 3167743772 + Mapper: 4 + - CRC: 3512830091 + Mapper: 2 + - CRC: 3851426457 + Mapper: 4 + - CRC: 738758085 + Mapper: 4 + - CRC: 3002040139 + Mapper: 4 + - CRC: 310212340 + Mapper: 4 + - CRC: 671798213 + Mapper: 1 + - CRC: 3618856829 + Mapper: 2 + - CRC: 1179281323 + Mapper: 0 + - CRC: 2519771109 + Mapper: 1 + - CRC: 2606140612 + Mapper: 1 + - CRC: 898509277 + Mapper: 1 + - CRC: 3762538149 + Mapper: 1 + - CRC: 1879244429 + Mapper: 2 + - CRC: 3774872530 + Mapper: 4 + - CRC: 1001594424 + Mapper: 4 + - CRC: 1532670456 + Mapper: 4 + - CRC: 2942675588 + Mapper: 4 + - CRC: 3282084832 + Mapper: 0 + - CRC: 4230978349 + Mapper: 4 + - CRC: 2253438537 + Mapper: 4 + - CRC: 4243311711 + Mapper: 0 + - CRC: 3850261380 + Mapper: 0 + - CRC: 4120706109 + Mapper: 1 + - CRC: 4105636862 + Mapper: 1 + - CRC: 1625987232 + Mapper: 1 + - CRC: 3696399490 + Mapper: 1 + - CRC: 4122128330 + Mapper: 1 + - CRC: 1059838565 + Mapper: 1 + - CRC: 1371482287 + Mapper: 7 + - CRC: 2204534212 + Mapper: 1 + - CRC: 2713770496 + Mapper: 0 + - CRC: 737212869 + Mapper: 0 + - CRC: 2523926957 + Mapper: 4 + - CRC: 2791541946 + Mapper: 1 + - CRC: 2205826442 + Mapper: 4 + - CRC: 1280179 + Mapper: 4 + - CRC: 462629866 + Mapper: 4 + - CRC: 2765944622 + Mapper: 4 + - CRC: 2487708272 + Mapper: 2 + - CRC: 2227478830 + Mapper: 2 + - CRC: 2001819789 + Mapper: 1 + - CRC: 2217361369 + Mapper: 3 + - CRC: 1985155130 + Mapper: 4 + - CRC: 978144528 + Mapper: 9 + - CRC: 626335551 + Mapper: 9 + - CRC: 324247860 + Mapper: 4 + - CRC: 1322075684 + Mapper: 4 + - CRC: 62447354 + Mapper: 1 + - CRC: 968582678 + Mapper: 1 + - CRC: 2149911908 + Mapper: 4 + - CRC: 2803096880 + Mapper: 69 + - CRC: 2444538327 + Mapper: 66 + - CRC: 755108197 + Mapper: 1 + - CRC: 1932102791 + Mapper: 37 + - CRC: 4100912026 + Mapper: 37 + - CRC: 4039219455 + Mapper: 1 + - CRC: 376951325 + Mapper: 1 + - CRC: 2376492669 + Mapper: 4 + - CRC: 2081880089 + Mapper: 4 + - CRC: 2131284185 + Mapper: 4 + - CRC: 2175968205 + Mapper: 4 + - CRC: 2074343598 + Mapper: 4 + - CRC: 1428767519 + Mapper: 1 + - CRC: 2453124167 + Mapper: 4 + - CRC: 121245374 + Mapper: 1 + - CRC: 2166427491 + Mapper: 0 + - CRC: 3153994740 + Mapper: 4 + - CRC: 1352556594 + Mapper: 2 + - CRC: 3995179593 + Mapper: 3 + - CRC: 2982754248 + Mapper: 1 + - CRC: 138301377 + Mapper: 4 + - CRC: 402815519 + Mapper: 2 + - CRC: 2668728371 + Mapper: 1 + - CRC: 3601682077 + Mapper: 0 + - CRC: 2454176653 + Mapper: 119 + - CRC: 3504296542 + Mapper: 4 + - CRC: 2542672380 + Mapper: 1 + - CRC: 3086194995 + Mapper: 2 + - CRC: 2190704698 + Mapper: 2 + - CRC: 1621793504 + Mapper: 2 + - CRC: 1260312110 + Mapper: 2 + - CRC: 954101843 + Mapper: 2 + - CRC: 933620562 + Mapper: 4 + - CRC: 2973696212 + Mapper: 2 + - CRC: 3525967196 + Mapper: 9 + - CRC: 4230849158 + Mapper: 3 + - CRC: 3853087422 + Mapper: 7 + - CRC: 1184046752 + Mapper: 1 + - CRC: 814590343 + Mapper: 7 + - CRC: 3609551073 + Mapper: 1 + - CRC: 2410080556 + Mapper: 4 + - CRC: 1699696272 + Mapper: 1 + - CRC: 3188626371 + Mapper: 1 + - CRC: 3239419938 + Mapper: 4 + - CRC: 2337088579 + Mapper: 1 + - CRC: 1905619379 + Mapper: 0 + - CRC: 389586493 + Mapper: 1 + - CRC: 3061651190 + Mapper: 1 + - CRC: 3567110788 + Mapper: 1 + - CRC: 4246861133 + Mapper: 1 + - CRC: 2577564278 + Mapper: 2 + - CRC: 2307005995 + Mapper: 1 + - CRC: 2832807223 + Mapper: 1 + - CRC: 1842064125 + Mapper: 4 + - CRC: 2626832153 + Mapper: 4 + - CRC: 581670548 + Mapper: 2 + - CRC: 2844792518 + Mapper: 1 + - CRC: 3201595411 + Mapper: 4 + - CRC: 2902693104 + Mapper: 4 + - CRC: 3769393730 + Mapper: 2 + - CRC: 2400811786 + Mapper: 2 + - CRC: 1168759663 + Mapper: 2 + - CRC: 3156582795 + Mapper: 4 + - CRC: 1889309593 + Mapper: 1 + - CRC: 333452873 + Mapper: 4 + - CRC: 2667669629 + Mapper: 4 + - CRC: 3057678579 + Mapper: 4 + - CRC: 722769884 + Mapper: 4 + - CRC: 881672177 + Mapper: 4 + - CRC: 1142810328 + Mapper: 1 + - CRC: 1464754059 + Mapper: 1 + - CRC: 2197817745 + Mapper: 2 + - CRC: 4194388897 + Mapper: 2 + - CRC: 1726733156 + Mapper: 2 + - CRC: 228648739 + Mapper: 1 + - CRC: 3272100051 + Mapper: 0 + - CRC: 193954088 + Mapper: 4 + - CRC: 941946789 + Mapper: 1 + - CRC: 3877438286 + Mapper: 1 + - CRC: 2842035856 + Mapper: 1 + - CRC: 3586492639 + Mapper: 1 + - CRC: 2536318852 + Mapper: 0 + - CRC: 2298746014 + Mapper: 7 + - CRC: 4052020013 + Mapper: 4 + - CRC: 1975773140 + Mapper: 3 + - CRC: 2091964173 + Mapper: 7 + - CRC: 3980371470 + Mapper: 4 + - CRC: 3253280063 + Mapper: 0 + - CRC: 228756048 + Mapper: 3 + - CRC: 1558536027 + Mapper: 3 + - CRC: 3428138948 + Mapper: 4 + - CRC: 4241978091 + Mapper: 4 + - CRC: 1424243799 + Mapper: 4 + - CRC: 2575573756 + Mapper: 4 + - CRC: 3853008923 + Mapper: 1 + - CRC: 4121016571 + Mapper: 4 + - CRC: 2586685574 + Mapper: 0 + - CRC: 3914238013 + Mapper: 4 + - CRC: 517326849 + Mapper: 4 + - CRC: 3227149234 + Mapper: 4 + - CRC: 3307793750 + Mapper: 4 + - CRC: 2294484954 + Mapper: 4 + - CRC: 2863236567 + Mapper: 1 + - CRC: 1711694630 + Mapper: 4 + - CRC: 3511929590 + Mapper: 2 + - CRC: 1175671105 + Mapper: 2 + - CRC: 4261991938 + Mapper: 1 + - CRC: 1620204808 + Mapper: 1 + - CRC: 2139100008 + Mapper: 1 + - CRC: 2262838629 + Mapper: 4 + - CRC: 3481575282 + Mapper: 1 + - CRC: 3311762450 + Mapper: 4 + - CRC: 11342217 + Mapper: 1 + - CRC: 878874884 + Mapper: 4 + - CRC: 2077011899 + Mapper: 4 + - CRC: 1864839179 + Mapper: 1 + - CRC: 810527014 + Mapper: 0 + - CRC: 413157413 + Mapper: 4 + - CRC: 1563105634 + Mapper: 4 + - CRC: 4261380309 + Mapper: 1 + - CRC: 3211789424 + Mapper: 1 + - CRC: 1758436216 + Mapper: 1 + - CRC: 2334561469 + Mapper: 1 + - CRC: 2519909488 + Mapper: 1 + - CRC: 3164340171 + Mapper: 1 + - CRC: 2735817471 + Mapper: 1 + - CRC: 2843043748 + Mapper: 1 + - CRC: 3833031211 + Mapper: 2 + - CRC: 2614358978 + Mapper: 4 + - CRC: 3808591550 + Mapper: 1 + - CRC: 2892010272 + Mapper: 4 + - CRC: 1265961088 + Mapper: 4 + - CRC: 2291640561 + Mapper: 2 + - CRC: 4270878741 + Mapper: 2 + - CRC: 2620411372 + Mapper: 4 + - CRC: 3357707092 + Mapper: 4 + - CRC: 1708239716 + Mapper: 4 + - CRC: 2108129041 + Mapper: 4 + - CRC: 4252932734 + Mapper: 1 + - CRC: 3984545109 + Mapper: 1 + - CRC: 3561701678 + Mapper: 1 + - CRC: 2308457028 + Mapper: 7 + - CRC: 2650115712 + Mapper: 1 + - CRC: 3013037420 + Mapper: 1 + - CRC: 1718347244 + Mapper: 4 + - CRC: 3732817449 + Mapper: 1 + - CRC: 3925405461 + Mapper: 4 + - CRC: 2513320792 + Mapper: 4 + - CRC: 1482401853 + Mapper: 4 + - CRC: 1076021582 + Mapper: 2 + - CRC: 3867259648 + Mapper: 4 + - CRC: 1086301792 + Mapper: 3 + - CRC: 2513682431 + Mapper: 3 + - CRC: 2442667934 + Mapper: 7 + - CRC: 3274610290 + Mapper: 4 + - CRC: 2688069618 + Mapper: 4 + - CRC: 3370899831 + Mapper: 4 + - CRC: 2030774619 + Mapper: 4 + - CRC: 2994215961 + Mapper: 4 + - CRC: 3616275240 + Mapper: 2 + - CRC: 3787824532 + Mapper: 4 + - CRC: 4231149265 + Mapper: 2 + - CRC: 48278948 + Mapper: 4 + - CRC: 3309105616 + Mapper: 1 + - CRC: 1570309437 + Mapper: 3 + - CRC: 3065365362 + Mapper: 2 + - CRC: 1330164288 + Mapper: 2 + - CRC: 1293809033 + Mapper: 1 + - CRC: 1321270988 + Mapper: 4 + - CRC: 3237106154 + Mapper: 4 + - CRC: 1720522517 + Mapper: 4 + - CRC: 1561145415 + Mapper: 4 + - CRC: 3643948774 + Mapper: 1 + - CRC: 2154684958 + Mapper: 7 + - CRC: 1584241013 + Mapper: 7 + - CRC: 2600841848 + Mapper: 4 + - CRC: 107518628 + Mapper: 1 + - CRC: 119360557 + Mapper: 4 + - CRC: 327705285 + Mapper: 2 + - CRC: 569549222 + Mapper: 4 + - CRC: 1816827701 + Mapper: 7 + - CRC: 3611678667 + Mapper: 0 + - CRC: 3816438187 + Mapper: 4 + - CRC: 1207797967 + Mapper: 1 + - CRC: 2547330054 + Mapper: 1 + - CRC: 1203151775 + Mapper: 1 + - CRC: 70310664 + Mapper: 4 + - CRC: 1202408786 + Mapper: 0 + - CRC: 1071202826 + Mapper: 0 + - CRC: 3592743176 + Mapper: 1 + - CRC: 3189315652 + Mapper: 0 + - CRC: 4138240470 + Mapper: 1 + - CRC: 306743644 + Mapper: 7 + - CRC: 2139585012 + Mapper: 2 + - CRC: 1545002031 + Mapper: 1 + - CRC: 3560014427 + Mapper: 2 + - CRC: 234899527 + Mapper: 1 + - CRC: 276039111 + Mapper: 2 + - CRC: 337638638 + Mapper: 1 + - CRC: 2651404061 + Mapper: 0 + - CRC: 740665056 + Mapper: 0 + - CRC: 2154716375 + Mapper: 1 + - CRC: 890845219 + Mapper: 4 + - CRC: 3897892648 + Mapper: 0 + - CRC: 2692802529 + Mapper: 3 + - CRC: 1523308421 + Mapper: 3 + - CRC: 1894005210 + Mapper: 0 + - CRC: 2376026505 + Mapper: 0 + - CRC: 1081983112 + Mapper: 0 + - CRC: 824564514 + Mapper: 1 + - CRC: 2252332728 + Mapper: 4 + - CRC: 1827869034 + Mapper: 1 + - CRC: 3062894159 + Mapper: 9 + - CRC: 1553815514 + Mapper: 4 + - CRC: 3378024857 + Mapper: 4 + - CRC: 2733002334 + Mapper: 1 + - CRC: 1588125427 + Mapper: 4 + - CRC: 3072096679 + Mapper: 119 + - CRC: 717521279 + Mapper: 4 + - CRC: 699593864 + Mapper: 2 + - CRC: 3896594830 + Mapper: 1 + - CRC: 2576088072 + Mapper: 4 + - CRC: 1152409350 + Mapper: 1 + - CRC: 2713261453 + Mapper: 4 + - CRC: 4024620067 + Mapper: 2 + - CRC: 3364042670 + Mapper: 2 + - CRC: 759263827 + Mapper: 7 + - CRC: 3443996718 + Mapper: 4 + - CRC: 2344978635 + Mapper: 4 + - CRC: 2862232740 + Mapper: 4 + - CRC: 3114233040 + Mapper: 0 + - CRC: 2150003168 + Mapper: 1 + - CRC: 76995992 + Mapper: 4 + - CRC: 2957792241 + Mapper: 1 + - CRC: 82790641 + Mapper: 0 + - CRC: 2903208418 + Mapper: 87 + - CRC: 872122898 + Mapper: 4 + - CRC: 377249499 + Mapper: 3 + - CRC: 2560339844 + Mapper: 2 + - CRC: 1783732830 + Mapper: 0 + - CRC: 855100494 + Mapper: 0 + - CRC: 401248936 + Mapper: 1 + - CRC: 3830744485 + Mapper: 206 + - CRC: 2201477411 + Mapper: 206 + - CRC: 20281668 + Mapper: 99 + - CRC: 262349506 + Mapper: 99 + - CRC: 730153486 + Mapper: 1 + - CRC: 2883690690 + Mapper: 99 + - CRC: 4033857570 + Mapper: 99 + - CRC: 3377668520 + Mapper: 99 + - CRC: 4211989991 + Mapper: 99 + - CRC: 2200761746 + Mapper: 206 + - CRC: 3273147819 + Mapper: 99 + - CRC: 1607923203 + Mapper: 99 + - CRC: 480533101 + Mapper: 99 + - CRC: 4017812280 + Mapper: 99 + - CRC: 3903979927 + Mapper: 99 + - CRC: 2884166004 + Mapper: 99 + - CRC: 1398694226 + Mapper: 99 + - CRC: 1715937022 + Mapper: 99 + - CRC: 3393100570 + Mapper: 99 + - CRC: 538574437 + Mapper: 67 + - CRC: 1895806353 + Mapper: 99 + - CRC: 3798307809 + Mapper: 99 + - CRC: 1986800812 + Mapper: 99 + - CRC: 362738625 + Mapper: 99 + - CRC: 2540234208 + Mapper: 99 + - CRC: 1211506297 + Mapper: 99 + - CRC: 2982462728 + Mapper: 99 + - CRC: 2291794601 + Mapper: 99 + - CRC: 1672214665 + Mapper: 99 + - CRC: 564548551 + Mapper: 206 + - CRC: 302066905 + Mapper: 206 + - CRC: 3297948881 + Mapper: 99 + - CRC: 2309160247 + Mapper: 99 + - CRC: 740083418 + Mapper: 99 + - CRC: 2719166718 + Mapper: 99 + - CRC: 952225858 + Mapper: 99 + - CRC: 1466457708 + Mapper: 99 + - CRC: 582847016 + Mapper: 99 + - CRC: 4290704244 + Mapper: 2 + - CRC: 4002084114 + Mapper: 75 + - CRC: 128119730 + Mapper: 99 + - CRC: 2598550176 + Mapper: 99 + - CRC: 2565064538 + Mapper: 99 + - CRC: 2097090436 + Mapper: 99 + - CRC: 1388642768 + Mapper: 206 + - CRC: 1740292434 + Mapper: 99 + - CRC: 119324683 + Mapper: 99 + - CRC: 1962349492 + Mapper: 75 + - CRC: 2349608437 + Mapper: 2 + - CRC: 737288031 + Mapper: 99 + - CRC: 1372023107 + Mapper: 99 + - CRC: 3255737511 + Mapper: 99 + - CRC: 1958651474 + Mapper: 36 + - CRC: 1909125271 + Mapper: 0 + - CRC: 3546338809 + Mapper: 79 + - CRC: 833393274 + Mapper: 79 + - CRC: 2010777295 + Mapper: 115 + - CRC: 743215958 + Mapper: 116 + - CRC: 3219003404 + Mapper: 116 + - CRC: 2313601521 + Mapper: 3 + - CRC: 319221346 + Mapper: 90 + - CRC: 1494306424 + Mapper: 4 + - CRC: 676465699 + Mapper: 90 + - CRC: 3188350654 + Mapper: 114 + - CRC: 1200721284 + Mapper: 150 + - CRC: 188027808 + Mapper: 0 + - CRC: 2140937708 + Mapper: 152 + - CRC: 3644052969 + Mapper: 132 + - CRC: 4139154401 + Mapper: 0 + - CRC: 2895309280 + Mapper: 0 + - CRC: 3637784367 + Mapper: 150 + - CRC: 1404773419 + Mapper: 147 + - CRC: 3744576356 + Mapper: 112 + - CRC: 3700312511 + Mapper: 79 + - CRC: 1426811827 + Mapper: 90 + - CRC: 2169411658 + Mapper: 90 + - CRC: 1945851308 + Mapper: 150 + - CRC: 40640026 + Mapper: 3 + - CRC: 3138334038 + Mapper: 132 + - CRC: 1298714545 + Mapper: 38 + - CRC: 3170995983 + Mapper: 143 + - CRC: 1186297115 + Mapper: 244 + - CRC: 788423215 + Mapper: 3 + - CRC: 463744224 + Mapper: 211 + - CRC: 1732217005 + Mapper: 91 + - CRC: 1590540926 + Mapper: 91 + - CRC: 1721681721 + Mapper: 12 + - CRC: 3593192318 + Mapper: 0 + - CRC: 263177995 + Mapper: 0 + - CRC: 4070143772 + Mapper: 215 + - CRC: 3424794506 + Mapper: 123 + - CRC: 2820425819 + Mapper: 4 + - CRC: 216765734 + Mapper: 3 + - CRC: 4015521033 + Mapper: 173 + - CRC: 3247946004 + Mapper: 83 + - CRC: 3451438757 + Mapper: 83 + - CRC: 2764742065 + Mapper: 193 + - CRC: 1668363496 + Mapper: 193 + - CRC: 1587593371 + Mapper: 193 + - CRC: 4250262835 + Mapper: 112 + - CRC: 1041696520 + Mapper: 139 + - CRC: 908067056 + Mapper: 90 + - CRC: 3063905295 + Mapper: 0 + - CRC: 2817494912 + Mapper: 4 + - CRC: 738032332 + Mapper: 178 + - CRC: 3496325905 + Mapper: 178 + - CRC: 1276903288 + Mapper: 3 + - CRC: 2101480265 + Mapper: 150 + - CRC: 3078519591 + Mapper: 4 + - CRC: 1206550599 + Mapper: 139 + - CRC: 3898297661 + Mapper: 2 + - CRC: 436308518 + Mapper: 3 + - CRC: 1226627422 + Mapper: 4 + - CRC: 979728333 + Mapper: 4 + - CRC: 3983297862 + Mapper: 116 + - CRC: 2096542474 + Mapper: 0 + - CRC: 3981273455 + Mapper: 2 + - CRC: 1525465154 + Mapper: 66 + - CRC: 809322557 + Mapper: 3 + - CRC: 3400796780 + Mapper: 150 + - CRC: 2562368674 + Mapper: 107 + - CRC: 1455027776 + Mapper: 216 + - CRC: 1184895253 + Mapper: 0 + - CRC: 356863154 + Mapper: 143 + - CRC: 1627788114 + Mapper: 112 + - CRC: 4004290599 + Mapper: 90 + - CRC: 3717000497 + Mapper: 209 + - CRC: 104534353 + Mapper: 209 + - CRC: 4173551831 + Mapper: 79 + - CRC: 2479478504 + Mapper: 90 + - CRC: 1623190284 + Mapper: 90 + - CRC: 2670334804 + Mapper: 215 + - CRC: 704457832 + Mapper: 123 + - CRC: 3414119315 + Mapper: 215 + - CRC: 2744324554 + Mapper: 4 + - CRC: 4078243330 + Mapper: 91 + - CRC: 4294008771 + Mapper: 90 + - CRC: 1908030427 + Mapper: 90 + - CRC: 3807485415 + Mapper: 91 + - CRC: 1372498985 + Mapper: 4 + - CRC: 1409261781 + Mapper: 4 + - CRC: 1088157602 + Mapper: 150 + - CRC: 807572775 + Mapper: 0 + - CRC: 1748475867 + Mapper: 79 + - CRC: 1793402228 + Mapper: 215 + - CRC: 228121427 + Mapper: 114 + - CRC: 2104179618 + Mapper: 4 + - CRC: 2452477262 + Mapper: 150 + - CRC: 3189236347 + Mapper: 150 + - CRC: 2400537101 + Mapper: 173 + - CRC: 1706471272 + Mapper: 0 + - CRC: 763834594 + Mapper: 141 + - CRC: 3338930603 + Mapper: 3 + - CRC: 753718832 + Mapper: 36 + - CRC: 2718648707 + Mapper: 141 + - CRC: 3902872535 + Mapper: 0 + - CRC: 2908144711 + Mapper: 173 + - CRC: 3153356011 + Mapper: 79 + - CRC: 694789569 + Mapper: 0 + - CRC: 673662405 + Mapper: 141 + - CRC: 2177404017 + Mapper: 132 + - CRC: 3794164724 + Mapper: 141 + - CRC: 919220482 + Mapper: 4 + - CRC: 923058617 + Mapper: 4 + - CRC: 732458870 + Mapper: 3 + - CRC: 2597209454 + Mapper: 138 + - CRC: 1971256163 + Mapper: 0 + - CRC: 3375832763 + Mapper: 116 + - CRC: 3826121598 + Mapper: 116 + - CRC: 521348820 + Mapper: 121 + - CRC: 831411458 + Mapper: 121 + - CRC: 2022124503 + Mapper: 4 + - CRC: 3228544252 + Mapper: 150 + - CRC: 691367856 + Mapper: 83 + - CRC: 2745958549 + Mapper: 189 + - CRC: 1796792250 + Mapper: 83 + - CRC: 1821960307 + Mapper: 4 + - CRC: 147804431 + Mapper: 83 + - CRC: 3721375832 + Mapper: 121 + - CRC: 2914033650 + Mapper: 187 + - CRC: 339604772 + Mapper: 36 + - CRC: 3643154414 + Mapper: 4 + - CRC: 1223942746 + Mapper: 83 + - CRC: 2162890809 + Mapper: 114 + - CRC: 2199809550 + Mapper: 4 + - CRC: 1316432383 + Mapper: 114 + - CRC: 136804582 + Mapper: 91 + - CRC: 880377288 + Mapper: 114 + - CRC: 1778635763 + Mapper: 114 + - CRC: 3156482161 + Mapper: 121 + - CRC: 809461657 + Mapper: 90 + - CRC: 2945611980 + Mapper: 90 + - CRC: 3629085092 + Mapper: 121 + - CRC: 428809271 + Mapper: 141 + - CRC: 1099279777 + Mapper: 141 + - CRC: 3490322247 + Mapper: 121 + - CRC: 1108410695 + Mapper: 3 + - CRC: 545116612 + Mapper: 0 + - CRC: 2841284954 + Mapper: 150 + - CRC: 3723297086 + Mapper: 4 + - CRC: 1276360144 + Mapper: 187 + - CRC: 3447390251 + Mapper: 121 + - CRC: 2434373183 + Mapper: 215 + - CRC: 1055536942 + Mapper: 189 + - CRC: 103664493 + Mapper: 211 + - CRC: 3721124374 + Mapper: 150 + - CRC: 2873131963 + Mapper: 219 + - CRC: 3745765610 + Mapper: 121 + - CRC: 3974977689 + Mapper: 121 + - CRC: 3175907962 + Mapper: 172 + - CRC: 3647955369 + Mapper: 132 + - CRC: 1670233170 + Mapper: 193 + - CRC: 209924549 + Mapper: 83 + - CRC: 590900112 + Mapper: 83 + - CRC: 3079702092 + Mapper: 79 + - CRC: 4243428936 + Mapper: 117 + - CRC: 4214199455 + Mapper: 112 + - CRC: 1491484290 + Mapper: 112 + - CRC: 4049852059 + Mapper: 115 + - CRC: 2880358774 + Mapper: 90 + - CRC: 3320169906 + Mapper: 115 + - CRC: 485789425 + Mapper: 3 + - CRC: 3250035476 + Mapper: 79 + - CRC: 201122217 + Mapper: 136 + - CRC: 3164321473 + Mapper: 27 + - CRC: 2732832262 + Mapper: 246 + - CRC: 1745694426 + Mapper: 150 + - CRC: 3657609709 + Mapper: 148 + - CRC: 1898003105 + Mapper: 0 + - CRC: 1387457251 + Mapper: 173 + - CRC: 1892985333 + Mapper: 173 + - CRC: 203416125 + Mapper: 0 + - CRC: 351565763 + Mapper: 66 + - CRC: 3157492638 + Mapper: 121 + - CRC: 2485389132 + Mapper: 115 + - CRC: 1317011528 + Mapper: 115 + - CRC: 132852754 + Mapper: 208 + - CRC: 1915702840 + Mapper: 3 + - CRC: 2836745149 + Mapper: 173 + - CRC: 597258705 + Mapper: 2 + - CRC: 999346462 + Mapper: 3 + - CRC: 2518342823 + Mapper: 0 + - CRC: 3468854530 + Mapper: 136 + - CRC: 3529984778 + Mapper: 132 + - CRC: 2895620617 + Mapper: 172 + - CRC: 446417543 + Mapper: 132 + - CRC: 3988153029 + Mapper: 4 + - CRC: 3442949034 + Mapper: 14 + - CRC: 723578267 + Mapper: 3 + - CRC: 2294892345 + Mapper: 133 + - CRC: 3712850530 + Mapper: 209 + - CRC: 269564239 + Mapper: 112 + - CRC: 628951493 + Mapper: 79 + - CRC: 1063015341 + Mapper: 79 + - CRC: 1083416864 + Mapper: 243 + - CRC: 3722204856 + Mapper: 240 + - CRC: 125164648 + Mapper: 150 + - CRC: 3566357690 + Mapper: 149 + - CRC: 3431370062 + Mapper: 149 + - CRC: 3835859406 + Mapper: 23 + - CRC: 237387079 + Mapper: 23 + - CRC: 1449094852 + Mapper: 240 + - CRC: 3041965607 + Mapper: 136 + - CRC: 3956480212 + Mapper: 117 + - CRC: 372183825 + Mapper: 34 + - CRC: 2837701697 + Mapper: 133 + - CRC: 274584966 + Mapper: 27 + - CRC: 400561058 + Mapper: 0 + - CRC: 2893743938 + Mapper: 2 + - CRC: 4235766959 + Mapper: 90 + - CRC: 3633883392 + Mapper: 3 + - CRC: 735354472 + Mapper: 115 + - CRC: 497648921 + Mapper: 3 + - CRC: 2161521778 + Mapper: 145 + - CRC: 2850490214 + Mapper: 83 + - CRC: 729270384 + Mapper: 115 + - CRC: 2723230207 + Mapper: 116 + - CRC: 1705723597 + Mapper: 172 + - CRC: 181388237 + Mapper: 132 + - CRC: 1929017539 + Mapper: 139 + - CRC: 4235690517 + Mapper: 148 + - CRC: 2833688514 + Mapper: 148 + - CRC: 1446918474 + Mapper: 150 + - CRC: 76752345 + Mapper: 112 + - CRC: 2847965171 + Mapper: 4 + - CRC: 1693556316 + Mapper: 4 + - CRC: 3209599269 + Mapper: 4 + - CRC: 2757931289 + Mapper: 4 + - CRC: 593188059 + Mapper: 4 + - CRC: 3476861537 + Mapper: 4 + - CRC: 1363064697 + Mapper: 4 + - CRC: 178559273 + Mapper: 4 + - CRC: 2622162905 + Mapper: 0 + - CRC: 2909997811 + Mapper: 198 + - CRC: 3925401628 + Mapper: 198 + - CRC: 685080750 + Mapper: 227 + - CRC: 4242863493 + Mapper: 241 + - CRC: 2954423452 + Mapper: 241 + - CRC: 624407526 + Mapper: 241 + - CRC: 555553257 + Mapper: 241 + - CRC: 3602604433 + Mapper: 74 + - CRC: 210222069 + Mapper: 4 + - CRC: 2306920680 + Mapper: 176 + - CRC: 3027746625 + Mapper: 240 + - CRC: 1463149261 + Mapper: 191 + - CRC: 3981018336 + Mapper: 2 + - CRC: 955529553 + Mapper: 74 + - CRC: 356432200 + Mapper: 4 + - CRC: 4095697369 + Mapper: 227 + - CRC: 3647838500 + Mapper: 4 + - CRC: 2525540074 + Mapper: 163 + - CRC: 3383470064 + Mapper: 163 + - CRC: 870008250 + Mapper: 163 + - CRC: 1872020965 + Mapper: 163 + - CRC: 339430704 + Mapper: 163 + - CRC: 3603673181 + Mapper: 163 + - CRC: 2687616034 + Mapper: 4 + - CRC: 1019566660 + Mapper: 163 + - CRC: 2800022086 + Mapper: 4 + - CRC: 3617901477 + Mapper: 163 + - CRC: 3743922540 + Mapper: 163 + - CRC: 287424721 + Mapper: 163 + - CRC: 2355154639 + Mapper: 163 + - CRC: 2386728105 + Mapper: 163 + - CRC: 4112804071 + Mapper: 163 + - CRC: 1152162958 + Mapper: 163 + - CRC: 4017857669 + Mapper: 163 + - CRC: 1403122742 + Mapper: 178 + - CRC: 551669572 + Mapper: 163 + - CRC: 81780948 + Mapper: 163 + - CRC: 2736340049 + Mapper: 163 + - CRC: 72223658 + Mapper: 178 + - CRC: 2552655162 + Mapper: 163 + - CRC: 2240374061 + Mapper: 162 + - CRC: 77439310 + Mapper: 163 + - CRC: 4162120791 + Mapper: 178 + - CRC: 2686889554 + Mapper: 163 + - CRC: 3069651480 + Mapper: 163 + - CRC: 1359522687 + Mapper: 163 + - CRC: 1823921689 + Mapper: 163 + - CRC: 2394010831 + Mapper: 163 + - CRC: 2791790253 + Mapper: 163 + - CRC: 979447904 + Mapper: 163 + - CRC: 2356388987 + Mapper: 163 + - CRC: 2463097591 + Mapper: 178 + - CRC: 3826098575 + Mapper: 163 + - CRC: 3009145135 + Mapper: 163 + - CRC: 3229405902 + Mapper: 163 + - CRC: 2453127680 + Mapper: 163 + - CRC: 1336945219 + Mapper: 163 + - CRC: 1389887000 + Mapper: 163 + - CRC: 367333069 + Mapper: 163 + - CRC: 127528593 + Mapper: 178 + - CRC: 272827790 + Mapper: 178 + - CRC: 2686231943 + Mapper: 163 + - CRC: 2314513617 + Mapper: 163 + - CRC: 3148560993 + Mapper: 163 + - CRC: 1292559771 + Mapper: 178 + - CRC: 1707490499 + Mapper: 163 + - CRC: 738319878 + Mapper: 163 + - CRC: 4020767749 + Mapper: 178 + - CRC: 1020352263 + Mapper: 178 + - CRC: 2583599797 + Mapper: 162 + - CRC: 3054807714 + Mapper: 163 + - CRC: 2158071004 + Mapper: 163 + - CRC: 1196604766 + Mapper: 163 + - CRC: 2196898990 + Mapper: 162 + - CRC: 460628002 + Mapper: 163 + - CRC: 1767537264 + Mapper: 163 + - CRC: 573182826 + Mapper: 163 + - CRC: 3955679970 + Mapper: 163 + - CRC: 3498082258 + Mapper: 163 + - CRC: 1380644584 + Mapper: 163 + - CRC: 671278095 + Mapper: 163 + - CRC: 4159963940 + Mapper: 178 + - CRC: 2890470663 + Mapper: 163 + - CRC: 2453987515 + Mapper: 163 + - CRC: 499927572 + Mapper: 178 + - CRC: 421494110 + Mapper: 163 + - CRC: 535198643 + Mapper: 163 + - CRC: 1232318827 + Mapper: 163 + - CRC: 2178390912 + Mapper: 178 + - CRC: 3653187931 + Mapper: 178 + - CRC: 164081363 + Mapper: 163 + - CRC: 1312743304 + Mapper: 163 + - CRC: 1958866375 + Mapper: 163 + - CRC: 1916560197 + Mapper: 163 + - CRC: 501569697 + Mapper: 178 + - CRC: 3662131290 + Mapper: 163 + - CRC: 91171726 + Mapper: 163 + - CRC: 818023306 + Mapper: 178 + - CRC: 3767186734 + Mapper: 163 + - CRC: 68578966 + Mapper: 163 + - CRC: 2247775201 + Mapper: 163 + - CRC: 555866802 + Mapper: 163 + - CRC: 2324648357 + Mapper: 178 + - CRC: 3824129849 + Mapper: 163 + - CRC: 1137367158 + Mapper: 178 + - CRC: 2421525317 + Mapper: 178 + - CRC: 2963736281 + Mapper: 176 + - CRC: 1715419410 + Mapper: 4 + - CRC: 1591930775 + Mapper: 176 + - CRC: 774365359 + Mapper: 227 + - CRC: 491065804 + Mapper: 178 + - CRC: 2623106760 + Mapper: 4 + - CRC: 1350027969 + Mapper: 176 + - CRC: 2744468475 + Mapper: 4 + - CRC: 4082423879 + Mapper: 176 + - CRC: 3514198379 + Mapper: 227 + - CRC: 3071370645 + Mapper: 4 + - CRC: 150729712 + Mapper: 162 + - CRC: 3959999542 + Mapper: 178 + - CRC: 3575501356 + Mapper: 176 + - CRC: 4070343046 + Mapper: 176 + - CRC: 4246964176 + Mapper: 4 + - CRC: 4124265614 + Mapper: 162 + - CRC: 3883217332 + Mapper: 253 + - CRC: 1404446776 + Mapper: 176 + - CRC: 283625172 + Mapper: 176 + - CRC: 3980925820 + Mapper: 176 + - CRC: 3345484171 + Mapper: 176 + - CRC: 2808843599 + Mapper: 227 + - CRC: 1964427392 + Mapper: 249 + - CRC: 2999857817 + Mapper: 249 + - CRC: 1153565728 + Mapper: 176 + - CRC: 2340349083 + Mapper: 252 + - CRC: 2415663204 + Mapper: 176 + - CRC: 2406135212 + Mapper: 176 + - CRC: 438992631 + Mapper: 178 + - CRC: 3657906462 + Mapper: 4 + - CRC: 4060555966 + Mapper: 4 + - CRC: 2490904509 + Mapper: 176 + - CRC: 2567249077 + Mapper: 176 + - CRC: 974978593 + Mapper: 176 + - CRC: 3605672384 + Mapper: 176 + - CRC: 1223550966 + Mapper: 4 + - CRC: 860108040 + Mapper: 176 + - CRC: 292451547 + Mapper: 4 + - CRC: 1989564218 + Mapper: 176 + - CRC: 2549340097 + Mapper: 176 + - CRC: 2187651666 + Mapper: 176 + - CRC: 234065195 + Mapper: 4 + - CRC: 1261677106 + Mapper: 242 + - CRC: 260636900 + Mapper: 4 + - CRC: 3615897836 + Mapper: 4 + - CRC: 1464945772 + Mapper: 245 + - CRC: 878634266 + Mapper: 245 + - CRC: 703300401 + Mapper: 4 + - CRC: 3550636508 + Mapper: 4 + - CRC: 821672774 + Mapper: 242 + - CRC: 581293667 + Mapper: 4 + - CRC: 157124216 + Mapper: 176 + - CRC: 931126070 + Mapper: 176 + - CRC: 431613746 + Mapper: 199 + - CRC: 1063331011 + Mapper: 176 + - CRC: 1772341852 + Mapper: 176 + - CRC: 4005486792 + Mapper: 176 + - CRC: 540032477 + Mapper: 195 + - CRC: 992359022 + Mapper: 165 + - CRC: 2280692768 + Mapper: 165 + - CRC: 2813832118 + Mapper: 165 + - CRC: 1929589430 + Mapper: 165 + - CRC: 1700288986 + Mapper: 4 + - CRC: 1114363140 + Mapper: 4 + - CRC: 2777510496 + Mapper: 4 + - CRC: 1386607956 + Mapper: 176 + - CRC: 2788976531 + Mapper: 242 + - CRC: 1266930131 + Mapper: 4 + - CRC: 3997824265 + Mapper: 176 + - CRC: 2545501686 + Mapper: 178 + - CRC: 3672825435 + Mapper: 195 + - CRC: 1233121610 + Mapper: 4 + - CRC: 2759207802 + Mapper: 4 + - CRC: 1366689859 + Mapper: 195 + - CRC: 3226284813 + Mapper: 176 + - CRC: 1921511150 + Mapper: 249 + - CRC: 2223975785 + Mapper: 176 + - CRC: 4098117687 + Mapper: 4 + - CRC: 742215408 + Mapper: 176 + - CRC: 2048501056 + Mapper: 178 + - CRC: 259249288 + Mapper: 176 + - CRC: 49303968 + Mapper: 249 + - CRC: 2836487105 + Mapper: 192 + - CRC: 2303175557 + Mapper: 176 + - CRC: 2340650751 + Mapper: 4 + - CRC: 1573409824 + Mapper: 4 + - CRC: 891147571 + Mapper: 176 + - CRC: 1776367432 + Mapper: 4 + - CRC: 2568891179 + Mapper: 4 + - CRC: 3938170416 + Mapper: 176 + - CRC: 4057206619 + Mapper: 176 + - CRC: 2472485145 + Mapper: 199 + - CRC: 3123266394 + Mapper: 176 + - CRC: 145424910 + Mapper: 4 + - CRC: 1533099728 + Mapper: 4 + - CRC: 2187351328 + Mapper: 4 + - CRC: 1518908848 + Mapper: 176 + - CRC: 1055824600 + Mapper: 242 + - CRC: 708516115 + Mapper: 4 + - CRC: 1876699770 + Mapper: 176 + - CRC: 49123346 + Mapper: 4 + - CRC: 1314198685 + Mapper: 4 + - CRC: 2757972945 + Mapper: 176 + - CRC: 3044435545 + Mapper: 4 + - CRC: 2114924845 + Mapper: 4 + - CRC: 3211695605 + Mapper: 176 + - CRC: 1097598881 + Mapper: 176 + - CRC: 3115261347 + Mapper: 4 + - CRC: 2234311019 + Mapper: 176 + - CRC: 3772616055 + Mapper: 176 + - CRC: 3408234938 + Mapper: 249 + - CRC: 3463384238 + Mapper: 4 + - CRC: 883710697 + Mapper: 176 + - CRC: 437838861 + Mapper: 249 + - CRC: 1800187008 + Mapper: 176 + - CRC: 3996785832 + Mapper: 162 + - CRC: 4002760877 + Mapper: 195 + - CRC: 3386468527 + Mapper: 176 + - CRC: 749322111 + Mapper: 199 + - CRC: 4029802445 + Mapper: 176 + - CRC: 3220686348 + Mapper: 176 + - CRC: 3477789357 + Mapper: 162 + - CRC: 2360016755 + Mapper: 176 + - CRC: 1964093647 + Mapper: 74 + - CRC: 2505480838 + Mapper: 176 + - CRC: 2768315647 + Mapper: 4 + - CRC: 2725468431 + Mapper: 4 + - CRC: 1968675859 + Mapper: 165 + - CRC: 2732352767 + Mapper: 176 + - CRC: 3589778159 + Mapper: 176 + - CRC: 129494441 + Mapper: 227 + - CRC: 1742720910 + Mapper: 194 + - CRC: 88855529 + Mapper: 74 + - CRC: 3665647725 + Mapper: 176 + - CRC: 285517241 + Mapper: 4 + - CRC: 3920881719 + Mapper: 4 + - CRC: 2986630812 + Mapper: 162 + - CRC: 2562837835 + Mapper: 192 + - CRC: 1356200267 + Mapper: 176 + - CRC: 1935014115 + Mapper: 4 + - CRC: 3124969147 + Mapper: 4 + - CRC: 4186323679 + Mapper: 176 + - CRC: 1072916003 + Mapper: 176 + - CRC: 470387010 + Mapper: 162 + - CRC: 4035967261 + Mapper: 195 + - CRC: 336357949 + Mapper: 4 + - CRC: 1138429190 + Mapper: 4 + - CRC: 1240605017 + Mapper: 176 + - CRC: 2110663115 + Mapper: 176 + - CRC: 755529715 + Mapper: 195 + - CRC: 1313777608 + Mapper: 4 + - CRC: 2180030774 + Mapper: 195 + - CRC: 1089021274 + Mapper: 4 + - CRC: 230683925 + Mapper: 176 + - CRC: 158598153 + Mapper: 4 + - CRC: 955252030 + Mapper: 176 + - CRC: 2752522507 + Mapper: 4 + - CRC: 3428236542 + Mapper: 176 + - CRC: 4253562151 + Mapper: 176 + - CRC: 596194143 + Mapper: 199 + - CRC: 3159017470 + Mapper: 176 + - CRC: 3103577125 + Mapper: 176 + - CRC: 4051585493 + Mapper: 176 + - CRC: 2107404806 + Mapper: 176 + - CRC: 3626689703 + Mapper: 4 + - CRC: 931057622 + Mapper: 249 + - CRC: 2976727656 + Mapper: 176 + - CRC: 892510484 + Mapper: 176 + - CRC: 558124762 + Mapper: 4 + - CRC: 313641203 + Mapper: 4 + - CRC: 668713991 + Mapper: 176 + - CRC: 3953171162 + Mapper: 176 + - CRC: 1658710308 + Mapper: 176 + - CRC: 2012198361 + Mapper: 4 + - CRC: 2408565159 + Mapper: 176 + - CRC: 1418556159 + Mapper: 176 + - CRC: 1016985158 + Mapper: 176 + - CRC: 3429782668 + Mapper: 176 + - CRC: 2904699255 + Mapper: 176 + - CRC: 4065152771 + Mapper: 177 + - CRC: 2930863245 + Mapper: 241 + - CRC: 1437259344 + Mapper: 177 + - CRC: 3703166913 + Mapper: 177 + - CRC: 4213926672 + Mapper: 241 + - CRC: 3981156245 + Mapper: 176 + - CRC: 2811191108 + Mapper: 176 + - CRC: 1599015687 + Mapper: 176 + - CRC: 978695665 + Mapper: 241 + - CRC: 2460043334 + Mapper: 199 + - CRC: 4001434965 + Mapper: 192 + - CRC: 953964912 + Mapper: 241 + - CRC: 1963834440 + Mapper: 177 + - CRC: 3204338816 + Mapper: 177 + - CRC: 46404664 + Mapper: 176 + - CRC: 3051895962 + Mapper: 177 + - CRC: 2160762799 + Mapper: 176 + - CRC: 3274088600 + Mapper: 176 + - CRC: 2417299372 + Mapper: 177 + - CRC: 2461263264 + Mapper: 177 + - CRC: 855669607 + Mapper: 177 + - CRC: 3752673126 + Mapper: 4 + - CRC: 2105821162 + Mapper: 177 + - CRC: 3647784798 + Mapper: 253 + - CRC: 3648749642 + Mapper: 177 + - CRC: 2025414707 + Mapper: 177 + - CRC: 4173751477 + Mapper: 242 + - CRC: 875958755 + Mapper: 4 + - CRC: 2745335537 + Mapper: 253 + - CRC: 493643897 + Mapper: 227 + - CRC: 1181776279 + Mapper: 253 + - CRC: 2043624462 + Mapper: 4 + - CRC: 2858839065 + Mapper: 224 + - CRC: 2966426067 + Mapper: 224 + - CRC: 370422553 + Mapper: 224 + - CRC: 3764371999 + Mapper: 224 + - CRC: 4172647257 + Mapper: 224 + - CRC: 3407588157 + Mapper: 224 + - CRC: 2061754375 + Mapper: 4 + - CRC: 3720422125 + Mapper: 224 + - CRC: 1294471623 + Mapper: 224 + - CRC: 611651165 + Mapper: 224 + - CRC: 3327702696 + Mapper: 224 + - CRC: 3934458391 + Mapper: 224 + - CRC: 2464918875 + Mapper: 224 + - CRC: 1210123044 + Mapper: 224 + - CRC: 876204352 + Mapper: 224 + - CRC: 2584367898 + Mapper: 224 + - CRC: 3053302731 + Mapper: 224 + - CRC: 1329754384 + Mapper: 224 + - CRC: 2758635340 + Mapper: 224 + - CRC: 3758218774 + Mapper: 224 + - CRC: 1415895032 + Mapper: 224 + - CRC: 1299406001 + Mapper: 224 + - CRC: 1560564860 + Mapper: 224 + - CRC: 3411168066 + Mapper: 224 + - CRC: 1597383064 + Mapper: 224 + - CRC: 1174853958 + Mapper: 240 + - CRC: 920553703 + Mapper: 224 + - CRC: 4176071119 + Mapper: 224 + - CRC: 1002368387 + Mapper: 224 + - CRC: 3167845405 + Mapper: 224 + - CRC: 2764281141 + Mapper: 224 + - CRC: 1019556082 + Mapper: 240 + - CRC: 1992026390 + Mapper: 224 + - CRC: 2605813076 + Mapper: 224 + - CRC: 3899824595 + Mapper: 224 + - CRC: 2436459327 + Mapper: 224 + - CRC: 2858557344 + Mapper: 224 + - CRC: 1221719370 + Mapper: 224 + - CRC: 752918981 + Mapper: 224 + - CRC: 4225431279 + Mapper: 4 + - CRC: 142125038 + Mapper: 164 + - CRC: 1453380209 + Mapper: 164 + - CRC: 3407804689 + Mapper: 164 + - CRC: 228325186 + Mapper: 4 + - CRC: 3161809574 + Mapper: 164 + - CRC: 2181675641 + Mapper: 164 + - CRC: 540638822 + Mapper: 227 + - CRC: 1622708940 + Mapper: 227 + - CRC: 4063856642 + Mapper: 176 + - CRC: 550877841 + Mapper: 4 + - CRC: 3052004244 + Mapper: 4 + - CRC: 1731194246 + Mapper: 192 + - CRC: 41932692 + Mapper: 176 + - CRC: 1821597474 + Mapper: 4 + - CRC: 237366249 + Mapper: 165 + - CRC: 1594041503 + Mapper: 178 + - CRC: 2083611120 + Mapper: 178 + - CRC: 1299278055 + Mapper: 178 + - CRC: 4213531601 + Mapper: 176 + - CRC: 1488289789 + Mapper: 4 + - CRC: 3046266952 + Mapper: 253 + - CRC: 2971773021 + Mapper: 195 + - CRC: 3507811652 + Mapper: 79 + - CRC: 3661828019 + Mapper: 148 + - CRC: 1398559814 + Mapper: 148 + - CRC: 89405775 + Mapper: 79 + - CRC: 304313724 + Mapper: 11 + - CRC: 3064408058 + Mapper: 79 + - CRC: 626105966 + Mapper: 148 + - CRC: 4007727554 + Mapper: 148 + - CRC: 2469143300 + Mapper: 148 + - CRC: 421066377 + Mapper: 0 + - CRC: 3314868532 + Mapper: 79 + - CRC: 990138222 + Mapper: 148 + - CRC: 793951200 + Mapper: 148 + - CRC: 2586027096 + Mapper: 148 + - CRC: 2232362419 + Mapper: 79 + - CRC: 3358130302 + Mapper: 79 + - CRC: 2133858546 + Mapper: 148 + - CRC: 3523341774 + Mapper: 148 + - CRC: 4142724855 + Mapper: 170 + - CRC: 1027601731 + Mapper: 79 + - CRC: 2569495939 + Mapper: 136 + - CRC: 1210293058 + Mapper: 79 + - CRC: 3101349330 + Mapper: 79 + - CRC: 203564181 + Mapper: 228 + - CRC: 1371583102 + Mapper: 228 + - CRC: 4137283198 + Mapper: 68 + - CRC: 3421779567 + Mapper: 158 + - CRC: 3152285124 + Mapper: 11 + - CRC: 1821587324 + Mapper: 71 + - CRC: 1084614262 + Mapper: 11 + - CRC: 1942111956 + Mapper: 11 + - CRC: 2133127104 + Mapper: 11 + - CRC: 1930694383 + Mapper: 11 + - CRC: 1745725325 + Mapper: 11 + - CRC: 2382437003 + Mapper: 11 + - CRC: 3486887010 + Mapper: 11 + - CRC: 1529574091 + Mapper: 71 + - CRC: 3437019078 + Mapper: 71 + - CRC: 3172289598 + Mapper: 71 + - CRC: 3265552686 + Mapper: 79 + - CRC: 1756360543 + Mapper: 148 + - CRC: 1183237597 + Mapper: 41 + - CRC: 878524954 + Mapper: 11 + - CRC: 3515389501 + Mapper: 11 + - CRC: 2595386542 + Mapper: 228 + - CRC: 3080660561 + Mapper: 11 + - CRC: 1927701394 + Mapper: 11 + - CRC: 1554660961 + Mapper: 144 + - CRC: 3202696230 + Mapper: 79 + - CRC: 2393585692 + Mapper: 79 + - CRC: 917723528 + Mapper: 79 + - CRC: 515156256 + Mapper: 79 + - CRC: 3173586826 + Mapper: 79 + - CRC: 156611916 + Mapper: 79 + - CRC: 179465654 + Mapper: 11 + - CRC: 1599863380 + Mapper: 11 + - CRC: 2292625810 + Mapper: 79 + - CRC: 4085521869 + Mapper: 79 + - CRC: 268296792 + Mapper: 206 + - CRC: 465995432 + Mapper: 71 + - CRC: 163781844 + Mapper: 11 + - CRC: 3444613266 + Mapper: 206 + - CRC: 2913055023 + Mapper: 148 + - CRC: 2460209159 + Mapper: 34 + - CRC: 329168309 + Mapper: 206 + - CRC: 1371996743 + Mapper: 11 + - CRC: 2567453498 + Mapper: 11 + - CRC: 3411264803 + Mapper: 11 + - CRC: 2482218128 + Mapper: 64 + - CRC: 2234662870 + Mapper: 79 + - CRC: 1669326428 + Mapper: 79 + - CRC: 1014905077 + Mapper: 11 + - CRC: 2125371923 + Mapper: 234 + - CRC: 654699243 + Mapper: 234 + - CRC: 573006355 + Mapper: 11 + - CRC: 4032327893 + Mapper: 79 + - CRC: 298880198 + Mapper: 11 + - CRC: 2452993403 + Mapper: 71 + - CRC: 3861787522 + Mapper: 71 + - CRC: 1571409608 + Mapper: 11 + - CRC: 346560053 + Mapper: 11 + - CRC: 1137904687 + Mapper: 0 + - CRC: 3926995240 + Mapper: 11 + - CRC: 2637756665 + Mapper: 0 + - CRC: 3879629408 + Mapper: 206 + - CRC: 3924911731 + Mapper: 148 + - CRC: 1783115891 + Mapper: 11 + - CRC: 3927509002 + Mapper: 79 + - CRC: 611501035 + Mapper: 0 + - CRC: 3097004233 + Mapper: 232 + - CRC: 2032169129 + Mapper: 232 + - CRC: 3435852648 + Mapper: 232 + - CRC: 2531247990 + Mapper: 206 + - CRC: 4251183020 + Mapper: 206 + - CRC: 775055901 + Mapper: 206 + - CRC: 1955728403 + Mapper: 168 + - CRC: 68506563 + Mapper: 168 + - CRC: 2867798628 + Mapper: 168 + - CRC: 1630762295 + Mapper: 168 + - CRC: 1046079825 + Mapper: 168 + - CRC: 4138322805 + Mapper: 168 + - CRC: 3186075573 + Mapper: 79 + - CRC: 1629830428 + Mapper: 11 + - CRC: 2979681757 + Mapper: 64 + - CRC: 269635081 + Mapper: 11 + - CRC: 4180403180 + Mapper: 64 + - CRC: 2537275253 + Mapper: 11 + - CRC: 3943422590 + Mapper: 64 + - CRC: 3342566140 + Mapper: 11 + - CRC: 3389687454 + Mapper: 11 + - CRC: 3022169722 + Mapper: 64 + - CRC: 3064117633 + Mapper: 79 + - CRC: 424182030 + Mapper: 11 + - CRC: 3079062188 + Mapper: 11 + - CRC: 336616467 + Mapper: 11 + - CRC: 983109344 + Mapper: 71 + - CRC: 1528210376 + Mapper: 11 + - CRC: 1596731797 + Mapper: 206 + - CRC: 1297251658 + Mapper: 11 + - CRC: 876379056 + Mapper: 148 + - CRC: 2783483509 + Mapper: 11 + - CRC: 956025989 + Mapper: 71 + - CRC: 2773942749 + Mapper: 11 + - CRC: 1443624358 + Mapper: 11 + - CRC: 2258062540 + Mapper: 11 + - CRC: 2125191772 + Mapper: 11 + - CRC: 1114938005 + Mapper: 11 + - CRC: 1041396181 + Mapper: 79 + - CRC: 1476443693 + Mapper: 206 + - CRC: 3296656398 + Mapper: 79 + - CRC: 2199886874 + Mapper: 79 + - CRC: 2300851421 + Mapper: 71 + - CRC: 2284722433 + Mapper: 79 + - CRC: 2834678443 + Mapper: 206 + - CRC: 2179783181 + Mapper: 11 + - CRC: 3684290763 + Mapper: 71 + - CRC: 2654443160 + Mapper: 71 + - CRC: 616174301 + Mapper: 71 + - CRC: 4147300605 + Mapper: 71 + - CRC: 4120372148 + Mapper: 79 + - CRC: 3211008170 + Mapper: 3 + - CRC: 4021467112 + Mapper: 0 + - CRC: 2421920758 + Mapper: 0 + - CRC: 4068718218 + Mapper: 216 + - CRC: 3154531388 + Mapper: 0 + - CRC: 2110828488 + Mapper: 147 + - CRC: 589023086 + Mapper: 11 + - CRC: 1192326119 + Mapper: 150 + - CRC: 1894980908 + Mapper: 71 + - CRC: 3920437603 + Mapper: 3 + - CRC: 841785194 + Mapper: 3 + - CRC: 4280086442 + Mapper: 0 + - CRC: 801023597 + Mapper: 36 + - CRC: 3074779754 + Mapper: 4 + - CRC: 1490154602 + Mapper: 139 + - CRC: 2059108861 + Mapper: 71 + - CRC: 10826306 + Mapper: 113 + - CRC: 586737280 + Mapper: 79 + - CRC: 1059344618 + Mapper: 79 + - CRC: 1975458174 + Mapper: 241 + - CRC: 359702728 + Mapper: 189 + - CRC: 2248687548 + Mapper: 3 + - CRC: 596946460 + Mapper: 150 + - CRC: 1457580262 + Mapper: 4 + - CRC: 3261588595 + Mapper: 241 + - CRC: 3205253213 + Mapper: 3 + - CRC: 1908415257 + Mapper: 0 + - CRC: 2731570421 + Mapper: 79 + - CRC: 3131897121 + Mapper: 3 + - CRC: 3282750868 + Mapper: 3 + - CRC: 432963346 + Mapper: 0 + - CRC: 3947678257 + Mapper: 79 + - CRC: 2044158538 + Mapper: 189 + - CRC: 2470989001 + Mapper: 234 + - CRC: 2000250670 + Mapper: 79 + - CRC: 3676296782 + Mapper: 71 + - CRC: 1621464612 + Mapper: 113 + - CRC: 2621802979 + Mapper: 0 + - CRC: 1262537689 + Mapper: 232 + - CRC: 1620506702 + Mapper: 104 + - CRC: 612157245 + Mapper: 150 + - CRC: 2038738541 + Mapper: 36 + - CRC: 1580651454 + Mapper: 113 + - CRC: 4113892368 + Mapper: 79 + - CRC: 344516959 + Mapper: 79 + - CRC: 886962182 + Mapper: 150 + - CRC: 956527578 + Mapper: 83 + - CRC: 1786507319 + Mapper: 232 + - CRC: 1873971959 + Mapper: 4 + - CRC: 2987571800 + Mapper: 81 + - CRC: 2688941597 + Mapper: 232 + - CRC: 3026350478 + Mapper: 232 + - CRC: 3032145750 + Mapper: 0 + - CRC: 2485760758 + Mapper: 71 + - CRC: 2036057124 + Mapper: 137 + - CRC: 104885945 + Mapper: 113 + - CRC: 3718353145 + Mapper: 79 + - CRC: 4294820624 + Mapper: 79 + - CRC: 2721887833 + Mapper: 36 + - CRC: 3327438681 + Mapper: 13 + - CRC: 1634865507 + Mapper: 0 + - CRC: 3954535952 + Mapper: 11 + - CRC: 2204883677 + Mapper: 216 + - CRC: 3354246190 + Mapper: 13 + - CRC: 3161679035 + Mapper: 4 + - CRC: 1644218013 + Mapper: 0 + - CRC: 3939763543 + Mapper: 0 + - CRC: 1525660820 + Mapper: 133 + - CRC: 2972962727 + Mapper: 11 + - CRC: 1357631173 + Mapper: 0 + - CRC: 370707209 + Mapper: 11 + - CRC: 1914266020 + Mapper: 0 + - CRC: 779033205 + Mapper: 0 + - CRC: 4058445288 + Mapper: 11 + - CRC: 2260617030 + Mapper: 2 + - CRC: 242672833 + Mapper: 190 + - CRC: 3966603534 + Mapper: 156 + - CRC: 1285624469 + Mapper: 150 + - CRC: 3963321159 + Mapper: 64 + - CRC: 282164123 + Mapper: 206 + - CRC: 3511043172 + Mapper: 156 + - CRC: 2645039352 + Mapper: 11 + - CRC: 807226040 + Mapper: 150 + - CRC: 2259814065 + Mapper: 156 + - CRC: 3940024369 + Mapper: 126 + - CRC: 3648432132 + Mapper: 242 + - CRC: 560037926 + Mapper: 227 + - CRC: 64402648 + Mapper: 227 + - CRC: 3063400750 + Mapper: 241 + - CRC: 853382814 + Mapper: 45 + - CRC: 1875624713 + Mapper: 126 + - CRC: 2468438649 + Mapper: 46 + - CRC: 3106188838 + Mapper: 124 + - CRC: 1770748488 + Mapper: 241 + - CRC: 2942908254 + Mapper: 0 + - CRC: 333016255 + Mapper: 4 + - CRC: 777480393 + Mapper: 0 + - CRC: 665641779 + Mapper: 0 + - CRC: 160154005 + Mapper: 4 + - CRC: 2903736799 + Mapper: 0 + - CRC: 1328799565 + Mapper: 0 + - CRC: 2318970400 + Mapper: 0 + - CRC: 471117254 + Mapper: 4 + - CRC: 3346226516 + Mapper: 0 + - CRC: 2960223426 + Mapper: 4 + - CRC: 1841566239 + Mapper: 0 + - CRC: 1008737740 + Mapper: 4 + - CRC: 2490011280 + Mapper: 4 + - CRC: 2612589648 + Mapper: 4 + - CRC: 4113026456 + Mapper: 4 + - CRC: 3803290827 + Mapper: 0 + - CRC: 1385997252 + Mapper: 0 + - CRC: 2469715547 + Mapper: 0 + - CRC: 798349099 + Mapper: 4 + - CRC: 3518570276 + Mapper: 0 + - CRC: 1155309404 + Mapper: 4 + - CRC: 3245413396 + Mapper: 0 + - CRC: 420842717 + Mapper: 0 + - CRC: 3783758456 + Mapper: 4 + - CRC: 3241742872 + Mapper: 4 + - CRC: 2532518143 + Mapper: 4 + - CRC: 1286524285 + Mapper: 4 + - CRC: 544059928 + Mapper: 4 + - CRC: 2167139703 + Mapper: 0 + - CRC: 2038548322 + Mapper: 4 + - CRC: 2254383684 + Mapper: 4 + - CRC: 2705276204 + Mapper: 4 + - CRC: 4220819148 + Mapper: 4 + - CRC: 784449239 + Mapper: 4 + - CRC: 902141622 + Mapper: 4 + - CRC: 2571891230 + Mapper: 0 + - CRC: 16896342 + Mapper: 0 + - CRC: 2245696583 + Mapper: 4 + - CRC: 3640900082 + Mapper: 0 + - CRC: 710287169 + Mapper: 4 + - CRC: 1151781383 + Mapper: 4 + - CRC: 653495340 + Mapper: 4 + - CRC: 4145721776 + Mapper: 4 + - CRC: 247925884 + Mapper: 4 + - CRC: 3295599122 + Mapper: 4 + - CRC: 277402008 + Mapper: 0 + - CRC: 2452770137 + Mapper: 4 + - CRC: 368645007 + Mapper: 4 + - CRC: 3756978242 + Mapper: 4 + - CRC: 3225597445 + Mapper: 4 + - CRC: 2496511026 + Mapper: 4 + - CRC: 2566331312 + Mapper: 4 + - CRC: 1241327719 + Mapper: 4 + - CRC: 2346188275 + Mapper: 4 + - CRC: 2920974505 + Mapper: 34 + - CRC: 2228591192 + Mapper: 0 + - CRC: 2407208553 + Mapper: 0 + - CRC: 3021790266 + Mapper: 178 + - CRC: 2451002677 + Mapper: 178 + - CRC: 2911026154 + Mapper: 176 + - CRC: 120059306 + Mapper: 178 + - CRC: 4199522974 + Mapper: 178 + - CRC: 1832354848 + Mapper: 178 + - CRC: 4264654427 + Mapper: 164 + - CRC: 4123036415 + Mapper: 241 + - CRC: 3232195624 + Mapper: 241 + - CRC: 2880633204 + Mapper: 241 + - CRC: 679502467 + Mapper: 241 + - CRC: 4057962818 + Mapper: 241 + - CRC: 3942577547 + Mapper: 167 + - CRC: 915151272 + Mapper: 34 + - CRC: 75282460 + Mapper: 178 + - CRC: 4173054508 + Mapper: 0 + - CRC: 3854229732 + Mapper: 241 + - CRC: 3225659615 + Mapper: 176 + - CRC: 754309893 + Mapper: 176 + - CRC: 411247729 + Mapper: 2 + - CRC: 1075027683 + Mapper: 241 + - CRC: 1721381618 + Mapper: 241 + - CRC: 177416629 + Mapper: 241 + - CRC: 352682641 + Mapper: 241 + - CRC: 3829796338 + Mapper: 241 + - CRC: 154154142 + Mapper: 241 + - CRC: 1106221764 + Mapper: 167 + - CRC: 2231797777 + Mapper: 241 + - CRC: 4119290320 + Mapper: 177 + - CRC: 1870923629 + Mapper: 178 + - CRC: 4052468280 + Mapper: 178 + - CRC: 1577531931 + Mapper: 167 + - CRC: 3587631812 + Mapper: 241 + - CRC: 3549458226 + Mapper: 241 + - CRC: 2507849255 + Mapper: 241 + - CRC: 2073402546 + Mapper: 178 + - CRC: 2613325393 + Mapper: 4 + - CRC: 1294748809 + Mapper: 0 + - CRC: 3247965536 + Mapper: 4 + - CRC: 1403254520 + Mapper: 0 + - CRC: 2364518274 + Mapper: 0 + - CRC: 3476823965 + Mapper: 0 + - CRC: 5325639 + Mapper: 4 + - CRC: 3266577815 + Mapper: 0 + - CRC: 3540575047 + Mapper: 0 + - CRC: 1433180114 + Mapper: 242 + - CRC: 675087417 + Mapper: 176 + - CRC: 2560302900 + Mapper: 176 + - CRC: 3802452001 + Mapper: 176 + - CRC: 1492420949 + Mapper: 45 + - CRC: 3839742923 + Mapper: 134 + - CRC: 1271554122 + Mapper: 134 + - CRC: 2603751286 + Mapper: 201 + - CRC: 3274388896 + Mapper: 52 + - CRC: 2201111842 + Mapper: 52 + - CRC: 2038890409 + Mapper: 197 + - CRC: 357090333 + Mapper: 52 + - CRC: 3997753572 + Mapper: 52 + - CRC: 4223176474 + Mapper: 176 + - CRC: 2164364475 + Mapper: 52 + - CRC: 860917118 + Mapper: 176 + - CRC: 3539076703 + Mapper: 52 + - CRC: 3329522062 + Mapper: 52 + - CRC: 438510273 + Mapper: 52 + - CRC: 988116949 + Mapper: 45 + - CRC: 1735511297 + Mapper: 45 + - CRC: 4055179956 + Mapper: 52 + - CRC: 166181872 + Mapper: 52 + - CRC: 3775929752 + Mapper: 52 + - CRC: 856473691 + Mapper: 52 + - CRC: 21532216 + Mapper: 52 + - CRC: 1883613370 + Mapper: 52 + - CRC: 1140355308 + Mapper: 52 + - CRC: 2711496680 + Mapper: 52 + - CRC: 1425957589 + Mapper: 52 + - CRC: 949612894 + Mapper: 52 + - CRC: 1313846073 + Mapper: 242 + - CRC: 3056885940 + Mapper: 227 + - CRC: 936094043 + Mapper: 176 + - CRC: 3733341303 + Mapper: 52 + - CRC: 2024374222 + Mapper: 229 + - CRC: 848840454 + Mapper: 176 + - CRC: 29508206 + Mapper: 176 + - CRC: 3773655217 + Mapper: 176 + - CRC: 3571245746 + Mapper: 52 + - CRC: 85738087 + Mapper: 52 + - CRC: 265013079 + Mapper: 52 + - CRC: 242782596 + Mapper: 134 + - CRC: 1460674680 + Mapper: 134 + - CRC: 2373886576 + Mapper: 134 + - CRC: 3678017027 + Mapper: 134 + - CRC: 3843168034 + Mapper: 134 + - CRC: 2973962717 + Mapper: 134 + - CRC: 2611827027 + Mapper: 134 + - CRC: 3889272878 + Mapper: 134 + - CRC: 916846537 + Mapper: 134 + - CRC: 1036764181 + Mapper: 134 + - CRC: 3924646086 + Mapper: 134 + - CRC: 2966935503 + Mapper: 134 + - CRC: 3284018830 + Mapper: 134 + - CRC: 3036275714 + Mapper: 134 + - CRC: 547921711 + Mapper: 134 + - CRC: 643546919 + Mapper: 134 + - CRC: 2368005507 + Mapper: 134 + - CRC: 3683451579 + Mapper: 134 + - CRC: 3563080126 + Mapper: 134 + - CRC: 1261973243 + Mapper: 134 + - CRC: 4027935666 + Mapper: 176 + - CRC: 1793967925 + Mapper: 176 + - CRC: 3587228748 + Mapper: 176 + - CRC: 258642727 + Mapper: 45 + - CRC: 1817696285 + Mapper: 45 + - CRC: 3250531780 + Mapper: 45 + - CRC: 564976035 + Mapper: 176 + - CRC: 3293035006 + Mapper: 176 + - CRC: 13137785 + Mapper: 176 + - CRC: 3336139569 + Mapper: 176 + - CRC: 1466799497 + Mapper: 176 + - CRC: 1440299702 + Mapper: 176 + - CRC: 3050461728 + Mapper: 176 + - CRC: 2075228975 + Mapper: 176 + - CRC: 904686097 + Mapper: 176 + - CRC: 3545464592 + Mapper: 176 + - CRC: 28569042 + Mapper: 176 + - CRC: 689918744 + Mapper: 176 + - CRC: 3904723651 + Mapper: 176 + - CRC: 2972502933 + Mapper: 176 + - CRC: 3962864144 + Mapper: 176 + - CRC: 3576175859 + Mapper: 176 + - CRC: 527090222 + Mapper: 176 + - CRC: 3029167910 + Mapper: 176 + - CRC: 1096104995 + Mapper: 176 + - CRC: 927436556 + Mapper: 176 + - CRC: 3185214926 + Mapper: 176 + - CRC: 2563084656 + Mapper: 176 + - CRC: 817822376 + Mapper: 176 + - CRC: 2244136072 + Mapper: 176 + - CRC: 3395299130 + Mapper: 176 + - CRC: 3253542644 + Mapper: 176 + - CRC: 1075326966 + Mapper: 176 + - CRC: 4107158828 + Mapper: 176 + - CRC: 4113013750 + Mapper: 176 + - CRC: 4065069926 + Mapper: 176 + - CRC: 2653964729 + Mapper: 176 + - CRC: 1752021275 + Mapper: 176 + - CRC: 4011453715 + Mapper: 176 + - CRC: 991481985 + Mapper: 176 + - CRC: 1083572645 + Mapper: 176 + - CRC: 3366662653 + Mapper: 176 + - CRC: 2268106653 + Mapper: 176 + - CRC: 788288693 + Mapper: 176 + - CRC: 4233428793 + Mapper: 176 + - CRC: 999609194 + Mapper: 176 + - CRC: 2091138185 + Mapper: 176 + - CRC: 1838301182 + Mapper: 176 + - CRC: 2346804508 + Mapper: 176 + - CRC: 1101089158 + Mapper: 63 + - CRC: 2204979966 + Mapper: 57 + - CRC: 505254767 + Mapper: 45 + - CRC: 343130522 + Mapper: 178 + - CRC: 3301890564 + Mapper: 178 + - CRC: 1293917278 + Mapper: 178 + - CRC: 543972186 + Mapper: 128 + - CRC: 3618365324 + Mapper: 176 + - CRC: 385857033 + Mapper: 242 + - CRC: 1839308617 + Mapper: 242 + - CRC: 3320314421 + Mapper: 52 + - CRC: 2167185223 + Mapper: 52 + - CRC: 2511120295 + Mapper: 176 + - CRC: 3864063121 + Mapper: 176 + - CRC: 1984100022 + Mapper: 176 + - CRC: 611724520 + Mapper: 176 + - CRC: 1981608128 + Mapper: 176 + - CRC: 374407899 + Mapper: 176 + - CRC: 1712641216 + Mapper: 176 + - CRC: 2476747802 + Mapper: 176 + - CRC: 3005709164 + Mapper: 176 + - CRC: 1064704591 + Mapper: 176 + - CRC: 116558973 + Mapper: 178 + - CRC: 1710204416 + Mapper: 45 + - CRC: 956782475 + Mapper: 176 + - CRC: 253589888 + Mapper: 176 + - CRC: 2744210589 + Mapper: 176 + - CRC: 2406975958 + Mapper: 176 + - CRC: 114376094 + Mapper: 176 + - CRC: 784162774 + Mapper: 176 + - CRC: 602181738 + Mapper: 176 + - CRC: 269834898 + Mapper: 176 + - CRC: 4134094062 + Mapper: 176 + - CRC: 2343497152 + Mapper: 176 + - CRC: 959476625 + Mapper: 176 + - CRC: 1926146846 + Mapper: 176 + - CRC: 131331787 + Mapper: 176 + - CRC: 1312082954 + Mapper: 176 + - CRC: 540513073 + Mapper: 176 + - CRC: 2452428541 + Mapper: 176 + - CRC: 1647222325 + Mapper: 176 + - CRC: 1718514541 + Mapper: 176 + - CRC: 421092479 + Mapper: 176 + - CRC: 1870093338 + Mapper: 176 + - CRC: 2881840610 + Mapper: 58 + - CRC: 1855616943 + Mapper: 58 + - CRC: 971918145 + Mapper: 57 + - CRC: 2176558999 + Mapper: 57 + - CRC: 3225474070 + Mapper: 58 + - CRC: 2672658150 + Mapper: 58 + - CRC: 1586575352 + Mapper: 58 + - CRC: 301725373 + Mapper: 58 + - CRC: 1303521404 + Mapper: 58 + - CRC: 70739486 + Mapper: 58 + - CRC: 524964717 + Mapper: 58 + - CRC: 4253290222 + Mapper: 58 + - CRC: 169449329 + Mapper: 58 + - CRC: 643934454 + Mapper: 58 + - CRC: 2769643051 + Mapper: 57 + - CRC: 3861869279 + Mapper: 58 + - CRC: 3937712020 + Mapper: 58 + - CRC: 3553268959 + Mapper: 58 + - CRC: 4002867025 + Mapper: 58 + - CRC: 1313399002 + Mapper: 58 + - CRC: 364888500 + Mapper: 57 + - CRC: 3190692384 + Mapper: 57 + - CRC: 160913509 + Mapper: 57 + - CRC: 1376193569 + Mapper: 57 + - CRC: 3681777442 + Mapper: 57 + - CRC: 321062742 + Mapper: 57 + - CRC: 1234845542 + Mapper: 58 + - CRC: 681801724 + Mapper: 58 + - CRC: 1048365782 + Mapper: 58 + - CRC: 4269208336 + Mapper: 58 + - CRC: 1219972386 + Mapper: 58 + - CRC: 3217844577 + Mapper: 58 + - CRC: 3779952325 + Mapper: 58 + - CRC: 1006351077 + Mapper: 58 + - CRC: 3147742711 + Mapper: 58 + - CRC: 332502566 + Mapper: 58 + - CRC: 2785291480 + Mapper: 58 + - CRC: 1082751639 + Mapper: 58 + - CRC: 1169052659 + Mapper: 58 + - CRC: 301855694 + Mapper: 57 + - CRC: 3436945901 + Mapper: 58 + - CRC: 381425082 + Mapper: 58 + - CRC: 583361584 + Mapper: 58 + - CRC: 2941706877 + Mapper: 58 + - CRC: 4095146912 + Mapper: 58 + - CRC: 4053049989 + Mapper: 58 + - CRC: 2938731854 + Mapper: 58 + - CRC: 2710430920 + Mapper: 58 + - CRC: 1937193047 + Mapper: 58 + - CRC: 3042462368 + Mapper: 58 + - CRC: 1187671280 + Mapper: 57 + - CRC: 3462056834 + Mapper: 57 + - CRC: 4144523871 + Mapper: 58 + - CRC: 825584223 + Mapper: 58 + - CRC: 2051742213 + Mapper: 58 + - CRC: 3894291922 + Mapper: 58 + - CRC: 664940358 + Mapper: 58 + - CRC: 19592355 + Mapper: 58 + - CRC: 3645909385 + Mapper: 58 + - CRC: 573765822 + Mapper: 58 + - CRC: 1036572758 + Mapper: 58 + - CRC: 3254732921 + Mapper: 57 + - CRC: 919459122 + Mapper: 57 + - CRC: 834193616 + Mapper: 57 + - CRC: 768403368 + Mapper: 57 + - CRC: 1150743282 + Mapper: 57 + - CRC: 1251617690 + Mapper: 58 + - CRC: 2100888026 + Mapper: 58 + - CRC: 1724789033 + Mapper: 58 + - CRC: 664304716 + Mapper: 58 + - CRC: 2367984823 + Mapper: 58 + - CRC: 4177384877 + Mapper: 58 + - CRC: 1006926705 + Mapper: 58 + - CRC: 1297066913 + Mapper: 58 + - CRC: 1693031907 + Mapper: 58 + - CRC: 3058203503 + Mapper: 58 + - CRC: 4038504696 + Mapper: 58 + - CRC: 1116880456 + Mapper: 58 + - CRC: 998249461 + Mapper: 58 + - CRC: 1826987100 + Mapper: 58 + - CRC: 2973186827 + Mapper: 58 + - CRC: 1444942738 + Mapper: 45 + - CRC: 3880847339 + Mapper: 215 + - CRC: 2516634000 + Mapper: 45 + - CRC: 1487396849 + Mapper: 45 + - CRC: 2526569963 + Mapper: 45 + - CRC: 3956894349 + Mapper: 45 + - CRC: 271860246 + Mapper: 45 + - CRC: 1988631029 + Mapper: 45 + - CRC: 2136387957 + Mapper: 45 + - CRC: 273403050 + Mapper: 45 + - CRC: 2284841381 + Mapper: 45 + - CRC: 913497762 + Mapper: 45 + - CRC: 3208385877 + Mapper: 45 + - CRC: 2260424401 + Mapper: 45 + - CRC: 250487882 + Mapper: 52 + - CRC: 1795649427 + Mapper: 45 + - CRC: 2964174699 + Mapper: 205 + - CRC: 3281067614 + Mapper: 134 + - CRC: 2948203318 + Mapper: 45 + - CRC: 2842691940 + Mapper: 45 + - CRC: 1370043864 + Mapper: 45 + - CRC: 4073257957 + Mapper: 45 + - CRC: 753078662 + Mapper: 45 + - CRC: 478498134 + Mapper: 45 + - CRC: 2306782586 + Mapper: 45 + - CRC: 25842011 + Mapper: 45 + - CRC: 804221185 + Mapper: 45 + - CRC: 1325035568 + Mapper: 45 + - CRC: 1435250303 + Mapper: 45 + - CRC: 4280365641 + Mapper: 45 + - CRC: 677403419 + Mapper: 45 + - CRC: 1754246923 + Mapper: 242 + - CRC: 379690425 + Mapper: 176 + - CRC: 809063242 + Mapper: 45 + - CRC: 761906257 + Mapper: 45 + - CRC: 1046683858 + Mapper: 45 + - CRC: 3761952192 + Mapper: 45 + - CRC: 2190130364 + Mapper: 45 + - CRC: 1402825499 + Mapper: 45 + - CRC: 1758969110 + Mapper: 45 + - CRC: 2463896551 + Mapper: 45 + - CRC: 2438048911 + Mapper: 45 + - CRC: 246455557 + Mapper: 45 + - CRC: 3749644387 + Mapper: 45 + - CRC: 1303145316 + Mapper: 45 + - CRC: 3593731871 + Mapper: 45 + - CRC: 4042400417 + Mapper: 45 + - CRC: 28435124 + Mapper: 45 + - CRC: 3383417312 + Mapper: 45 + - CRC: 399784697 + Mapper: 176 + - CRC: 3303665205 + Mapper: 45 + - CRC: 2567816570 + Mapper: 45 + - CRC: 2894227158 + Mapper: 45 + - CRC: 21481877 + Mapper: 45 + - CRC: 4185824484 + Mapper: 45 + - CRC: 2164112823 + Mapper: 45 + - CRC: 1824450508 + Mapper: 45 + - CRC: 1608388455 + Mapper: 45 + - CRC: 2076870379 + Mapper: 45 + - CRC: 2355100605 + Mapper: 45 + - CRC: 288459415 + Mapper: 45 + - CRC: 2029954376 + Mapper: 45 + - CRC: 1619417425 + Mapper: 45 + - CRC: 650761279 + Mapper: 45 + - CRC: 3684948366 + Mapper: 45 + - CRC: 1607341802 + Mapper: 45 + - CRC: 920944200 + Mapper: 45 + - CRC: 1934464794 + Mapper: 45 + - CRC: 772093114 + Mapper: 45 + - CRC: 3510149579 + Mapper: 175 + - CRC: 1272168143 + Mapper: 61 + - CRC: 4265102923 + Mapper: 176 + - CRC: 1113543461 + Mapper: 176 + - CRC: 3523651295 + Mapper: 176 + - CRC: 4082128238 + Mapper: 176 + - CRC: 3146930366 + Mapper: 176 + - CRC: 1665394342 + Mapper: 176 + - CRC: 3468158223 + Mapper: 176 + - CRC: 2443758974 + Mapper: 176 + - CRC: 3346831584 + Mapper: 176 + - CRC: 3809616062 + Mapper: 176 + - CRC: 3055797200 + Mapper: 176 + - CRC: 2720917917 + Mapper: 176 + - CRC: 1688181309 + Mapper: 176 + - CRC: 3307185253 + Mapper: 176 + - CRC: 822063222 + Mapper: 176 + - CRC: 1475113698 + Mapper: 176 + - CRC: 1272971249 + Mapper: 58 + - CRC: 346189639 + Mapper: 58 + - CRC: 404655374 + Mapper: 58 + - CRC: 2451453330 + Mapper: 58 + - CRC: 148622455 + Mapper: 176 + - CRC: 4039475635 + Mapper: 176 + - CRC: 247172663 + Mapper: 45 + - CRC: 23317075 + Mapper: 176 + - CRC: 3204538144 + Mapper: 176 + - CRC: 1466877792 + Mapper: 176 + - CRC: 3902082022 + Mapper: 176 + - CRC: 3465111398 + Mapper: 176 + - CRC: 1353458070 + Mapper: 176 + - CRC: 2144786341 + Mapper: 176 + - CRC: 310150991 + Mapper: 176 + - CRC: 1732068731 + Mapper: 176 + - CRC: 1463172367 + Mapper: 176 + - CRC: 3106401413 + Mapper: 176 + - CRC: 1734816328 + Mapper: 176 + - CRC: 3247078347 + Mapper: 176 + - CRC: 3103707460 + Mapper: 176 + - CRC: 2083744935 + Mapper: 176 + - CRC: 2412307758 + Mapper: 176 + - CRC: 1027113544 + Mapper: 176 + - CRC: 283621101 + Mapper: 176 + - CRC: 965388722 + Mapper: 176 + - CRC: 1136505087 + Mapper: 176 + - CRC: 2613621564 + Mapper: 45 + - CRC: 954610448 + Mapper: 176 + - CRC: 4222125971 + Mapper: 176 + - CRC: 1039375588 + Mapper: 176 + - CRC: 2364044813 + Mapper: 176 + - CRC: 2941607946 + Mapper: 176 + - CRC: 1981268038 + Mapper: 176 + - CRC: 2037598438 + Mapper: 45 + - CRC: 1599916561 + Mapper: 176 + - CRC: 3837703987 + Mapper: 176 + - CRC: 3116300295 + Mapper: 176 + - CRC: 1034843033 + Mapper: 176 + - CRC: 1906101770 + Mapper: 176 + - CRC: 316515362 + Mapper: 176 + - CRC: 2869545099 + Mapper: 176 + - CRC: 2732720924 + Mapper: 176 + - CRC: 1617163477 + Mapper: 176 + - CRC: 3539334429 + Mapper: 176 + - CRC: 3207680141 + Mapper: 176 + - CRC: 2744949355 + Mapper: 176 + - CRC: 730343793 + Mapper: 176 + - CRC: 2551899835 + Mapper: 176 + - CRC: 1562454444 + Mapper: 176 + - CRC: 2048326584 + Mapper: 178 + - CRC: 4128680938 + Mapper: 178 + - CRC: 2597955817 + Mapper: 176 + - CRC: 1377499259 + Mapper: 176 + - CRC: 2852504978 + Mapper: 176 + - CRC: 542961779 + Mapper: 176 + - CRC: 3557355708 + Mapper: 176 + - CRC: 542984046 + Mapper: 176 + - CRC: 3685667417 + Mapper: 176 + - CRC: 2384135822 + Mapper: 176 + - CRC: 3378958428 + Mapper: 176 + - CRC: 1206580068 + Mapper: 176 + - CRC: 4199348549 + Mapper: 176 + - CRC: 632855935 + Mapper: 57 + - CRC: 2967157438 + Mapper: 45 + - CRC: 1407177815 + Mapper: 200 + - CRC: 819926292 + Mapper: 212 + - CRC: 187496255 + Mapper: 176 + - CRC: 756835962 + Mapper: 176 + - CRC: 634899346 + Mapper: 176 + - CRC: 2399113529 + Mapper: 176 + - CRC: 1510882921 + Mapper: 176 + - CRC: 567560266 + Mapper: 176 + - CRC: 3896399654 + Mapper: 176 + - CRC: 3670085228 + Mapper: 52 + - CRC: 2554859079 + Mapper: 52 + - CRC: 98536577 + Mapper: 52 + - CRC: 1245675341 + Mapper: 59 + - CRC: 1236084024 + Mapper: 59 + - CRC: 1222438123 + Mapper: 59 + - CRC: 4030458976 + Mapper: 221 + - CRC: 1395515423 + Mapper: 221 + - CRC: 2611227379 + Mapper: 63 + - CRC: 2346771474 + Mapper: 63 + - CRC: 587441854 + Mapper: 63 + - CRC: 1614223871 + Mapper: 221 + - CRC: 649653932 + Mapper: 63 + - CRC: 2205247483 + Mapper: 63 + - CRC: 2652857057 + Mapper: 63 + - CRC: 1441936187 + Mapper: 221 + - CRC: 2193164466 + Mapper: 63 + - CRC: 3698529897 + Mapper: 221 + - CRC: 3569756875 + Mapper: 174 + - CRC: 1326900051 + Mapper: 221 + - CRC: 458279647 + Mapper: 221 + - CRC: 2821800557 + Mapper: 221 + - CRC: 1274225276 + Mapper: 63 + - CRC: 2708864909 + Mapper: 221 + - CRC: 692136841 + Mapper: 45 + - CRC: 3400962658 + Mapper: 45 + - CRC: 2954530118 + Mapper: 57 + - CRC: 2160839371 + Mapper: 235 + - CRC: 3538365172 + Mapper: 235 + - CRC: 1635105184 + Mapper: 235 + - CRC: 2744069917 + Mapper: 235 + - CRC: 1952081809 + Mapper: 235 + - CRC: 1185001083 + Mapper: 235 + - CRC: 2511356520 + Mapper: 235 + - CRC: 1314285737 + Mapper: 235 + - CRC: 3236232949 + Mapper: 61 + - CRC: 2696991560 + Mapper: 236 + - CRC: 1774555012 + Mapper: 52 + - CRC: 1703363504 + Mapper: 52 + - CRC: 2693128485 + Mapper: 59 + - CRC: 3662188428 + Mapper: 226 + - CRC: 196410746 + Mapper: 236 + - CRC: 563285015 + Mapper: 236 + - CRC: 1420186352 + Mapper: 59 + - CRC: 1027662651 + Mapper: 59 + - CRC: 1326269571 + Mapper: 236 + - CRC: 2978626706 + Mapper: 236 + - CRC: 1054688678 + Mapper: 215 + - CRC: 3125695654 + Mapper: 215 + - CRC: 3367646643 + Mapper: 215 + - CRC: 1048784542 + Mapper: 215 + - CRC: 3405916127 + Mapper: 52 + - CRC: 2130447660 + Mapper: 59 + - CRC: 467579635 + Mapper: 236 + - CRC: 3614761025 + Mapper: 59 + - CRC: 3091105907 + Mapper: 59 + - CRC: 1158469742 + Mapper: 59 + - CRC: 2223538175 + Mapper: 59 + - CRC: 1240238294 + Mapper: 59 + - CRC: 1929183317 + Mapper: 59 + - CRC: 3205093999 + Mapper: 59 + - CRC: 1613786905 + Mapper: 59 + - CRC: 3295462647 + Mapper: 59 + - CRC: 1155331673 + Mapper: 59 + - CRC: 779265497 + Mapper: 59 + - CRC: 2683598551 + Mapper: 236 + - CRC: 2526283568 + Mapper: 215 + - CRC: 931621575 + Mapper: 215 + - CRC: 187920195 + Mapper: 215 + - CRC: 2209433663 + Mapper: 215 + - CRC: 3937829320 + Mapper: 59 + - CRC: 1838342129 + Mapper: 59 + - CRC: 69397828 + Mapper: 59 + - CRC: 1342887769 + Mapper: 59 + - CRC: 3635541093 + Mapper: 59 + - CRC: 570257731 + Mapper: 59 + - CRC: 2812905112 + Mapper: 59 + - CRC: 733610874 + Mapper: 59 + - CRC: 972363005 + Mapper: 59 + - CRC: 1011782902 + Mapper: 59 + - CRC: 910591780 + Mapper: 59 + - CRC: 797884979 + Mapper: 236 + - CRC: 41740683 + Mapper: 236 + - CRC: 2918445263 + Mapper: 236 + - CRC: 3321390398 + Mapper: 59 + - CRC: 1509352006 + Mapper: 236 + - CRC: 3481467625 + Mapper: 59 + - CRC: 354911564 + Mapper: 59 + - CRC: 3626816839 + Mapper: 45 + - CRC: 1360311158 + Mapper: 45 + - CRC: 2371202610 + Mapper: 45 + - CRC: 2836238943 + Mapper: 45 + - CRC: 3873828508 + Mapper: 45 + - CRC: 3276576311 + Mapper: 45 + - CRC: 3153849532 + Mapper: 176 + - CRC: 2186698319 + Mapper: 45 + - CRC: 706566451 + Mapper: 176 + - CRC: 123095750 + Mapper: 176 + - CRC: 3865148401 + Mapper: 176 + - CRC: 2744427459 + Mapper: 116 + - CRC: 3144698196 + Mapper: 45 + - CRC: 1505425935 + Mapper: 178 + - CRC: 3075083454 + Mapper: 233 + - CRC: 66973613 + Mapper: 230 + - CRC: 1685392888 + Mapper: 226 + - CRC: 3178873054 + Mapper: 226 + - CRC: 2993951981 + Mapper: 233 + - CRC: 3490935759 + Mapper: 226 + - CRC: 3080425882 + Mapper: 230 + - CRC: 1475479036 + Mapper: 226 + - CRC: 1425204850 + Mapper: 226 + - CRC: 831892566 + Mapper: 230 + - CRC: 1444761091 + Mapper: 226 + - CRC: 2594989908 + Mapper: 226 + - CRC: 3388550105 + Mapper: 226 + - CRC: 1229069706 + Mapper: 134 + - CRC: 172895939 + Mapper: 176 + - CRC: 4029388371 + Mapper: 176 + - CRC: 3620868668 + Mapper: 176 + - CRC: 2360791852 + Mapper: 176 + - CRC: 1577100879 + Mapper: 59 + - CRC: 4150525562 + Mapper: 45 + - CRC: 2467917461 + Mapper: 176 + - CRC: 1240655169 + Mapper: 45 + - CRC: 4026702486 + Mapper: 45 + - CRC: 442868965 + Mapper: 45 + - CRC: 2564138549 + Mapper: 45 + - CRC: 96057851 + Mapper: 45 + - CRC: 3776670623 + Mapper: 45 + - CRC: 479077326 + Mapper: 45 + - CRC: 2246767370 + Mapper: 45 + - CRC: 2566478149 + Mapper: 45 + - CRC: 1548423096 + Mapper: 45 + - CRC: 3853195442 + Mapper: 45 + - CRC: 3057081960 + Mapper: 45 + - CRC: 1642606533 + Mapper: 45 + - CRC: 3054493247 + Mapper: 45 + - CRC: 4171365658 + Mapper: 45 + - CRC: 2181838547 + Mapper: 45 + - CRC: 917002595 + Mapper: 45 + - CRC: 2642564824 + Mapper: 45 + - CRC: 2115641382 + Mapper: 45 + - CRC: 3682683193 + Mapper: 45 + - CRC: 1077040715 + Mapper: 45 + - CRC: 3670928666 + Mapper: 45 + - CRC: 3424680377 + Mapper: 45 + - CRC: 1054869033 + Mapper: 45 + - CRC: 3206778695 + Mapper: 45 + - CRC: 1293219925 + Mapper: 45 + - CRC: 1082394041 + Mapper: 212 + - CRC: 1045025251 + Mapper: 236 + - CRC: 1010202597 + Mapper: 45 + - CRC: 410829038 + Mapper: 52 + - CRC: 248371161 + Mapper: 59 + - CRC: 1316036440 + Mapper: 59 + - CRC: 2625361664 + Mapper: 45 + - CRC: 2354324974 + Mapper: 242 + - CRC: 2449913735 + Mapper: 176 + - CRC: 2947385706 + Mapper: 52 + - CRC: 3976093770 + Mapper: 176 + - CRC: 3325672258 + Mapper: 176 + - CRC: 2138554170 + Mapper: 176 + - CRC: 2721229390 + Mapper: 176 + - CRC: 2670030194 + Mapper: 134 + - CRC: 4117086243 + Mapper: 176 + - CRC: 18027044 + Mapper: 176 + - CRC: 2054615737 + Mapper: 176 + - CRC: 3909268757 + Mapper: 134 + - CRC: 3393371530 + Mapper: 134 + - CRC: 4239175722 + Mapper: 176 + - CRC: 1524488514 + Mapper: 176 + - CRC: 2483631068 + Mapper: 176 + - CRC: 3228343031 + Mapper: 176 + - CRC: 1921819823 + Mapper: 176 + - CRC: 1191014178 + Mapper: 176 + - CRC: 3302085368 + Mapper: 176 + - CRC: 2198736079 + Mapper: 134 + - CRC: 1834483828 + Mapper: 176 + - CRC: 1141947789 + Mapper: 176 + - CRC: 1947185383 + Mapper: 57 + - CRC: 133508075 + Mapper: 57 + - CRC: 444880057 + Mapper: 57 + - CRC: 2571670625 + Mapper: 57 + - CRC: 52959044 + Mapper: 52 + - CRC: 3273027089 + Mapper: 176 + - CRC: 4028219375 + Mapper: 176 + - CRC: 3188003338 + Mapper: 176 + - CRC: 4084317426 + Mapper: 176 + - CRC: 4196184156 + Mapper: 176 + - CRC: 1156869052 + Mapper: 176 + - CRC: 3554120816 + Mapper: 176 + - CRC: 172518871 + Mapper: 176 + - CRC: 2466275387 + Mapper: 176 + - CRC: 1665152731 + Mapper: 176 + - CRC: 3618156490 + Mapper: 176 + - CRC: 1790349135 + Mapper: 176 + - CRC: 519245000 + Mapper: 176 + - CRC: 2826232342 + Mapper: 52 + - CRC: 2339159064 + Mapper: 134 + - CRC: 1293419852 + Mapper: 176 + - CRC: 2659596019 + Mapper: 176 + - CRC: 467888226 + Mapper: 52 + - CRC: 1410253495 + Mapper: 52 + - CRC: 280861541 + Mapper: 52 + - CRC: 3389084030 + Mapper: 52 + - CRC: 1674854178 + Mapper: 176 + - CRC: 14718367 + Mapper: 134 + - CRC: 3378466085 + Mapper: 176 + - CRC: 4212219833 + Mapper: 176 + - CRC: 2941788828 + Mapper: 176 + - CRC: 679715329 + Mapper: 176 + - CRC: 1599354867 + Mapper: 134 + - CRC: 2784282434 + Mapper: 134 + - CRC: 303900772 + Mapper: 59 + - CRC: 1560681988 + Mapper: 176 + - CRC: 3297806016 + Mapper: 52 + - CRC: 3087072934 + Mapper: 134 + - CRC: 4126701272 + Mapper: 134 + - CRC: 252035302 + Mapper: 176 + - CRC: 480264766 + Mapper: 176 + - CRC: 2956263922 + Mapper: 52 + - CRC: 2023180485 + Mapper: 134 + - CRC: 1528298279 + Mapper: 176 + - CRC: 3317894906 + Mapper: 176 + - CRC: 3136792123 + Mapper: 176 + - CRC: 3444942949 + Mapper: 176 + - CRC: 415150710 + Mapper: 176 + - CRC: 3818961381 + Mapper: 176 + - CRC: 2461344599 + Mapper: 176 + - CRC: 3734288381 + Mapper: 176 + - CRC: 3580831662 + Mapper: 176 + - CRC: 1942792912 + Mapper: 176 + - CRC: 243754716 + Mapper: 176 + - CRC: 382417663 + Mapper: 176 + - CRC: 682508805 + Mapper: 176 + - CRC: 2446007620 + Mapper: 176 + - CRC: 2935545844 + Mapper: 176 + - CRC: 98842437 + Mapper: 176 + - CRC: 3560054868 + Mapper: 57 + - CRC: 506468961 + Mapper: 52 + - CRC: 599877675 + Mapper: 134 + - CRC: 2590132686 + Mapper: 134 + - CRC: 2018781137 + Mapper: 219 + - CRC: 1632105728 + Mapper: 52 + - CRC: 3459540730 + Mapper: 52 + - CRC: 3137483396 + Mapper: 121 + - CRC: 70879903 + Mapper: 176 + - CRC: 1502794812 + Mapper: 52 + - CRC: 3097927962 + Mapper: 52 + - CRC: 3740806315 + Mapper: 52 + - CRC: 1737352618 + Mapper: 176 + - CRC: 3940864686 + Mapper: 178 + - CRC: 1134908573 + Mapper: 178 + - CRC: 3266900643 + Mapper: 178 + - CRC: 2692442279 + Mapper: 178 + - CRC: 1233951173 + Mapper: 178 + - CRC: 497878842 + Mapper: 178 + - CRC: 1144750995 + Mapper: 178 + - CRC: 3577194151 + Mapper: 178 + - CRC: 832584740 + Mapper: 178 + - CRC: 635252578 + Mapper: 178 + - CRC: 1802322762 + Mapper: 178 + - CRC: 848299072 + Mapper: 178 + - CRC: 3723864262 + Mapper: 178 + - CRC: 2206303190 + Mapper: 178 + - CRC: 247180919 + Mapper: 178 + - CRC: 3649870450 + Mapper: 178 + - CRC: 1773280235 + Mapper: 178 + - CRC: 1558049043 + Mapper: 178 + - CRC: 3234382875 + Mapper: 178 + - CRC: 795390981 + Mapper: 178 + - CRC: 4140313131 + Mapper: 178 + - CRC: 66311741 + Mapper: 178 + - CRC: 3738592489 + Mapper: 178 + - CRC: 2435179519 + Mapper: 178 + - CRC: 1821875116 + Mapper: 176 + - CRC: 3438175699 + Mapper: 90 + - CRC: 454524190 + Mapper: 51 + - CRC: 3952872302 + Mapper: 51 + - CRC: 2044559523 + Mapper: 91 + - CRC: 2232095426 + Mapper: 91 + - CRC: 360599156 + Mapper: 90 + - CRC: 3647573083 + Mapper: 90 + - CRC: 1079033740 + Mapper: 90 + - CRC: 2259053197 + Mapper: 45 + - CRC: 3815786496 + Mapper: 45 + - CRC: 1785380771 + Mapper: 45 + - CRC: 865252382 + Mapper: 176 + - CRC: 852340099 + Mapper: 176 + - CRC: 1015630545 + Mapper: 176 + - CRC: 2026805613 + Mapper: 176 + - CRC: 2195572585 + Mapper: 45 + - CRC: 1488041531 + Mapper: 45 + - CRC: 1435823534 + Mapper: 45 + - CRC: 99285874 + Mapper: 45 + - CRC: 3256846368 + Mapper: 45 + - CRC: 1136202444 + Mapper: 45 + - CRC: 641680464 + Mapper: 45 + - CRC: 2276293184 + Mapper: 45 + - CRC: 2696750858 + Mapper: 45 + - CRC: 999048740 + Mapper: 45 + - CRC: 966497168 + Mapper: 45 + - CRC: 3885962622 + Mapper: 176 + - CRC: 987979457 + Mapper: 176 + - CRC: 3511031767 + Mapper: 176 + - CRC: 4214503932 + Mapper: 141 + - CRC: 790005477 + Mapper: 141 + - CRC: 1274546936 + Mapper: 141 + - CRC: 3687181529 + Mapper: 141 + - CRC: 3694265879 + Mapper: 141 + - CRC: 4155081262 + Mapper: 141 + - CRC: 219506813 + Mapper: 141 + - CRC: 1366692350 + Mapper: 141 + - CRC: 220216805 + Mapper: 141 + - CRC: 455187969 + Mapper: 15 + - CRC: 1672230364 + Mapper: 45 + - CRC: 2615092260 + Mapper: 176 + - CRC: 23945413 + Mapper: 241 + - CRC: 1654636268 + Mapper: 176 + - CRC: 1259626508 + Mapper: 242 + - CRC: 3065604610 + Mapper: 205 + - CRC: 155861393 + Mapper: 45 + - CRC: 446906621 + Mapper: 45 + - CRC: 2955096249 + Mapper: 202 + - CRC: 1537302502 + Mapper: 200 + - CRC: 1860096339 + Mapper: 176 + - CRC: 2613001821 + Mapper: 15 + - CRC: 2752544126 + Mapper: 242 + - CRC: 2402932356 + Mapper: 176 + - CRC: 3965617855 + Mapper: 203 + - CRC: 2641268964 + Mapper: 203 + - CRC: 2121317620 + Mapper: 242 + - CRC: 234849503 + Mapper: 227 + - CRC: 516022251 + Mapper: 217 + - CRC: 1785071945 + Mapper: 134 + - CRC: 1231208484 + Mapper: 242 + - CRC: 3632251267 + Mapper: 45 + - CRC: 682175110 + Mapper: 45 + - CRC: 3461048083 + Mapper: 217 + - CRC: 3805964974 + Mapper: 134 + - CRC: 2069041724 + Mapper: 242 + - CRC: 1760427498 + Mapper: 176 + - CRC: 2392411085 + Mapper: 176 + - CRC: 3669810223 + Mapper: 205 + - CRC: 2842386061 + Mapper: 205 + - CRC: 1713981792 + Mapper: 202 + - CRC: 830367192 + Mapper: 200 + - CRC: 3056710973 + Mapper: 200 + - CRC: 2816537218 + Mapper: 45 + - CRC: 1314853434 + Mapper: 176 + - CRC: 3175819008 + Mapper: 45 + - CRC: 1613594139 + Mapper: 45 + - CRC: 3722854772 + Mapper: 45 + - CRC: 882708785 + Mapper: 45 + - CRC: 3237009464 + Mapper: 200 + - CRC: 2349098104 + Mapper: 227 + - CRC: 2913057494 + Mapper: 203 + - CRC: 3988901193 + Mapper: 202 + - CRC: 430118767 + Mapper: 212 + - CRC: 2108871157 + Mapper: 176 + - CRC: 1977610660 + Mapper: 176 + - CRC: 1412164950 + Mapper: 225 + - CRC: 3375974737 + Mapper: 204 + - CRC: 169626146 + Mapper: 134 + - CRC: 3130469855 + Mapper: 212 + - CRC: 1391932884 + Mapper: 45 + - CRC: 2392522480 + Mapper: 225 + - CRC: 1405347544 + Mapper: 134 + - CRC: 2886192119 + Mapper: 201 + - CRC: 2899087414 + Mapper: 176 + - CRC: 839987262 + Mapper: 134 + - CRC: 3082130507 + Mapper: 45 + - CRC: 2477017337 + Mapper: 212 + - CRC: 2621630050 + Mapper: 83 + - CRC: 1714285154 + Mapper: 212 + - CRC: 3037564860 + Mapper: 176 + - CRC: 1819410094 + Mapper: 45 + - CRC: 1017932358 + Mapper: 242 + - CRC: 42979060 + Mapper: 212 + - CRC: 3860187359 + Mapper: 60 + - CRC: 2575149652 + Mapper: 60 + - CRC: 339423015 + Mapper: 60 + - CRC: 2676440676 + Mapper: 60 + - CRC: 261127807 + Mapper: 176 + - CRC: 2296431756 + Mapper: 176 + - CRC: 4006543807 + Mapper: 176 + - CRC: 2140915941 + Mapper: 45 + - CRC: 1881805535 + Mapper: 62 + - CRC: 1435241923 + Mapper: 178 + - CRC: 289494286 + Mapper: 52 + - CRC: 3076080485 + Mapper: 45 + - CRC: 2085535148 + Mapper: 212 + - CRC: 317112642 + Mapper: 134 + - CRC: 2407215079 + Mapper: 45 + - CRC: 3160840527 + Mapper: 62 + - CRC: 1319800078 + Mapper: 45 + - CRC: 2953648830 + Mapper: 45 + - CRC: 1533001348 + Mapper: 44 + - CRC: 446088275 + Mapper: 45 + - CRC: 2652576084 + Mapper: 134 + - CRC: 2174347840 + Mapper: 214 + - CRC: 3063434669 + Mapper: 176 + - CRC: 2118423893 + Mapper: 53 + - CRC: 722893296 + Mapper: 212 + - CRC: 764427790 + Mapper: 212 + - CRC: 1914130211 + Mapper: 212 + - CRC: 1699126120 + Mapper: 212 + - CRC: 1829606906 + Mapper: 217 + - CRC: 3663963952 + Mapper: 212 + - CRC: 2871099865 + Mapper: 212 + - CRC: 659491302 + Mapper: 212 + - CRC: 318270029 + Mapper: 217 + - CRC: 4278760434 + Mapper: 212 + - CRC: 4019163037 + Mapper: 212 + - CRC: 1641912863 + Mapper: 212 + - CRC: 1174918557 + Mapper: 212 + - CRC: 656869817 + Mapper: 237 + - CRC: 77735208 + Mapper: 45 + - CRC: 3115780362 + Mapper: 45 + - CRC: 3503859033 + Mapper: 45 + - CRC: 669403707 + Mapper: 225 + - CRC: 2020223588 + Mapper: 45 + - CRC: 2739584700 + Mapper: 225 + - CRC: 2174929994 + Mapper: 4 + - CRC: 4281574181 + Mapper: 0 + - CRC: 2742671292 + Mapper: 0 + - CRC: 3976854256 + Mapper: 4 + - CRC: 2399138459 + Mapper: 4 + - CRC: 2634261945 + Mapper: 71 + - CRC: 3059074362 + Mapper: 0 + - CRC: 1363636384 + Mapper: 71 + - CRC: 3601657305 + Mapper: 215 + - CRC: 3531565610 + Mapper: 71 + - CRC: 336387839 + Mapper: 4 + - CRC: 4077413190 + Mapper: 71 + - CRC: 2754310940 + Mapper: 4 + - CRC: 4159297037 + Mapper: 4 + - CRC: 1834081849 + Mapper: 0 + - CRC: 2119753609 + Mapper: 0 + - CRC: 2574549552 + Mapper: 215 + - CRC: 3756784155 + Mapper: 215 + - CRC: 110957077 + Mapper: 215 + - CRC: 335558003 + Mapper: 71 + - CRC: 2434492415 + Mapper: 4 + - CRC: 3083636644 + Mapper: 11 + - CRC: 2721778032 + Mapper: 4 + - CRC: 3933398041 + Mapper: 71 + - CRC: 2848362776 + Mapper: 0 + - CRC: 520748075 + Mapper: 4 + - CRC: 1387124870 + Mapper: 4 + - CRC: 3912958596 + Mapper: 4 + - CRC: 497770850 + Mapper: 4 + - CRC: 2419763370 + Mapper: 4 + - CRC: 2716442036 + Mapper: 4 + - CRC: 1746927308 + Mapper: 4 + - CRC: 4190829184 + Mapper: 4 + - CRC: 122803325 + Mapper: 4 + - CRC: 293202376 + Mapper: 176 + - CRC: 473912547 + Mapper: 71 + - CRC: 2772157525 + Mapper: 71 + - CRC: 1410008302 + Mapper: 206 + - CRC: 2486466343 + Mapper: 4 + - CRC: 1839271340 + Mapper: 71 + - CRC: 2713728764 + Mapper: 0 + - CRC: 1224552375 + Mapper: 206 + - CRC: 587444971 + Mapper: 81 + - CRC: 962402195 + Mapper: 90 + - CRC: 2765709905 + Mapper: 71 + - CRC: 4033243964 + Mapper: 0 + - CRC: 4025180361 + Mapper: 228 + - CRC: 2228299697 + Mapper: 176 + - CRC: 4133327785 + Mapper: 4 + - CRC: 1936080437 + Mapper: 4 + - CRC: 548539416 + Mapper: 71 + - CRC: 3251832875 + Mapper: 132 + - CRC: 2980664514 + Mapper: 132 + - CRC: 3367359389 + Mapper: 4 + - CRC: 3015585649 + Mapper: 3 + - CRC: 1937550635 + Mapper: 4 + - CRC: 3073788520 + Mapper: 141 + - CRC: 2958603439 + Mapper: 141 + - CRC: 1496954411 + Mapper: 141 + - CRC: 3551291792 + Mapper: 4 + - CRC: 927118776 + Mapper: 0 + - CRC: 3120061211 + Mapper: 0 + - CRC: 1245530000 + Mapper: 0 + - CRC: 78034029 + Mapper: 0 + - CRC: 2089393402 + Mapper: 0 + - CRC: 1536396031 + Mapper: 0 + - CRC: 977065845 + Mapper: 0 + - CRC: 4179969784 + Mapper: 0 + - CRC: 3654481259 + Mapper: 0 + - CRC: 2258428584 + Mapper: 0 + - CRC: 4060801170 + Mapper: 0 + - CRC: 2106550825 + Mapper: 0 + - CRC: 2440844760 + Mapper: 0 + - CRC: 684819372 + Mapper: 0 + - CRC: 3581856131 + Mapper: 0 + - CRC: 58667649 + Mapper: 0 + - CRC: 635664550 + Mapper: 0 + - CRC: 1374625683 + Mapper: 0 + - CRC: 64378544 + Mapper: 0 + - CRC: 3801032086 + Mapper: 0 + - CRC: 887804515 + Mapper: 0 + - CRC: 3508162841 + Mapper: 0 + - CRC: 3911484467 + Mapper: 0 + - CRC: 2844355935 + Mapper: 0 + - CRC: 395849197 + Mapper: 0 + - CRC: 3629646653 + Mapper: 3 + - CRC: 1956569775 + Mapper: 0 + - CRC: 1477889221 + Mapper: 6 + - CRC: 1626471791 + Mapper: 3 + - CRC: 1889135303 + Mapper: 0 + - CRC: 3906304839 + Mapper: 0 + - CRC: 2929645070 + Mapper: 0 + - CRC: 255169234 + Mapper: 0 + - CRC: 2733876149 + Mapper: 0 + - CRC: 3371606554 + Mapper: 0 + - CRC: 3983455932 + Mapper: 0 + - CRC: 3833523600 + Mapper: 0 + - CRC: 2037011928 + Mapper: 0 + - CRC: 3908355665 + Mapper: 0 + - CRC: 2333877531 + Mapper: 0 + - CRC: 2928806121 + Mapper: 0 + - CRC: 742383528 + Mapper: 0 + - CRC: 3820585283 + Mapper: 3 + - CRC: 2631714618 + Mapper: 0 + - CRC: 883234557 + Mapper: 0 + - CRC: 3523823942 + Mapper: 0 + - CRC: 4176778406 + Mapper: 0 + - CRC: 3886912226 + Mapper: 0 + - CRC: 3907898209 + Mapper: 0 + - CRC: 3482905418 + Mapper: 0 + - CRC: 1386728506 + Mapper: 0 + - CRC: 1688408881 + Mapper: 0 + - CRC: 2043222278 + Mapper: 0 + - CRC: 25556505 + Mapper: 0 + - CRC: 586768369 + Mapper: 0 + - CRC: 4077447546 + Mapper: 0 + - CRC: 4261041741 + Mapper: 0 + - CRC: 2444605089 + Mapper: 0 + - CRC: 4246817880 + Mapper: 0 + - CRC: 746028357 + Mapper: 3 + - CRC: 3900577838 + Mapper: 0 + - CRC: 488126617 + Mapper: 6 + - CRC: 1467253435 + Mapper: 3 + - CRC: 1614580414 + Mapper: 6 + - CRC: 4224300247 + Mapper: 6 + - CRC: 101674613 + Mapper: 6 + - CRC: 3991231772 + Mapper: 6 + - CRC: 4149343031 + Mapper: 6 + - CRC: 3832288621 + Mapper: 3 + - CRC: 4124074442 + Mapper: 3 + - CRC: 1572912824 + Mapper: 3 + - CRC: 518818063 + Mapper: 0 + - CRC: 1927488514 + Mapper: 3 + - CRC: 3913340271 + Mapper: 0 + - CRC: 3664563585 + Mapper: 6 + - CRC: 1006636778 + Mapper: 3 + - CRC: 2473468573 + Mapper: 0 + - CRC: 3305039180 + Mapper: 6 + - CRC: 89182386 + Mapper: 0 + - CRC: 2101655880 + Mapper: 6 + - CRC: 3591245994 + Mapper: 3 + - CRC: 188578628 + Mapper: 3 + - CRC: 2486135728 + Mapper: 3 + - CRC: 333414503 + Mapper: 6 + - CRC: 3876844644 + Mapper: 6 + - CRC: 3789331284 + Mapper: 3 + - CRC: 1724271760 + Mapper: 6 + - CRC: 408739746 + Mapper: 6 + - CRC: 3024622710 + Mapper: 0 + - CRC: 2218191710 + Mapper: 0 + - CRC: 170023422 + Mapper: 0 + - CRC: 2116365868 + Mapper: 0 + - CRC: 660458627 + Mapper: 6 + - CRC: 841970234 + Mapper: 0 + - CRC: 3694374616 + Mapper: 3 + - CRC: 3058227828 + Mapper: 0 + - CRC: 864749287 + Mapper: 0 + - CRC: 3506170186 + Mapper: 0 + - CRC: 1486565064 + Mapper: 0 + - CRC: 2407626158 + Mapper: 0 + - CRC: 1316231430 + Mapper: 0 + - CRC: 4072976929 + Mapper: 0 + - CRC: 1236228385 + Mapper: 0 + - CRC: 888923710 + Mapper: 6 + - CRC: 1545278566 + Mapper: 0 + - CRC: 304580640 + Mapper: 3 + - CRC: 493023551 + Mapper: 0 + - CRC: 810035180 + Mapper: 3 + - CRC: 1337719412 + Mapper: 3 + - CRC: 1902919630 + Mapper: 0 + - CRC: 3087484014 + Mapper: 3 + - CRC: 1769313830 + Mapper: 0 + - CRC: 2381179399 + Mapper: 3 + - CRC: 1413246686 + Mapper: 0 + - CRC: 2915981883 + Mapper: 3 + - CRC: 2550693453 + Mapper: 3 + - CRC: 1735741505 + Mapper: 3 + - CRC: 83047757 + Mapper: 3 + - CRC: 3824416430 + Mapper: 3 + - CRC: 1223704987 + Mapper: 6 + - CRC: 2012308301 + Mapper: 6 + - CRC: 4203620331 + Mapper: 6 + - CRC: 799591348 + Mapper: 6 + - CRC: 3788085211 + Mapper: 6 + - CRC: 2940862975 + Mapper: 6 + - CRC: 4126517853 + Mapper: 6 + - CRC: 2699862265 + Mapper: 0 + - CRC: 1907519653 + Mapper: 6 + - CRC: 1360950264 + Mapper: 6 + - CRC: 1037285918 + Mapper: 2 + - CRC: 3658622517 + Mapper: 2 + - CRC: 217051471 + Mapper: 6 + - CRC: 696301142 + Mapper: 2 + - CRC: 2980358398 + Mapper: 6 + - CRC: 3022673863 + Mapper: 2 + - CRC: 1865834107 + Mapper: 2 + - CRC: 1587067466 + Mapper: 2 + - CRC: 2508143912 + Mapper: 2 + - CRC: 3102963741 + Mapper: 2 + - CRC: 2542298196 + Mapper: 2 + - CRC: 359014529 + Mapper: 2 + - CRC: 2850228262 + Mapper: 6 + - CRC: 614509082 + Mapper: 6 + - CRC: 841784073 + Mapper: 2 + - CRC: 3003232476 + Mapper: 2 + - CRC: 1221123667 + Mapper: 2 + - CRC: 1672421423 + Mapper: 2 + - CRC: 1148310833 + Mapper: 2 + - CRC: 320477387 + Mapper: 2 + - CRC: 2352829672 + Mapper: 2 + - CRC: 2024839558 + Mapper: 2 + - CRC: 3046799913 + Mapper: 2 + - CRC: 4229962822 + Mapper: 2 + - CRC: 1616862545 + Mapper: 2 + - CRC: 1067020537 + Mapper: 2 + - CRC: 2206988143 + Mapper: 2 + - CRC: 4244261918 + Mapper: 2 + - CRC: 2518875097 + Mapper: 2 + - CRC: 3902225221 + Mapper: 6 + - CRC: 4098388460 + Mapper: 6 + - CRC: 2793267049 + Mapper: 6 + - CRC: 2708126009 + Mapper: 2 + - CRC: 419514397 + Mapper: 6 + - CRC: 2173495466 + Mapper: 6 + - CRC: 2290909399 + Mapper: 6 + - CRC: 430438292 + Mapper: 2 + - CRC: 323964488 + Mapper: 6 + - CRC: 3860761070 + Mapper: 2 + - CRC: 2539139880 + Mapper: 6 + - CRC: 540881579 + Mapper: 2 + - CRC: 3142510995 + Mapper: 2 + - CRC: 2617333123 + Mapper: 6 + - CRC: 1343411664 + Mapper: 2 + - CRC: 4000250199 + Mapper: 2 + - CRC: 793125768 + Mapper: 2 + - CRC: 2202210433 + Mapper: 2 + - CRC: 2245261189 + Mapper: 2 + - CRC: 1595608580 + Mapper: 6 + - CRC: 352294146 + Mapper: 6 + - CRC: 2105969721 + Mapper: 2 + - CRC: 1326774680 + Mapper: 6 + - CRC: 3005454604 + Mapper: 6 + - CRC: 3545231083 + Mapper: 6 + - CRC: 3770735804 + Mapper: 6 + - CRC: 3975386701 + Mapper: 6 + - CRC: 652721781 + Mapper: 6 + - CRC: 262585680 + Mapper: 6 + - CRC: 4285949920 + Mapper: 6 + - CRC: 1856079786 + Mapper: 6 + - CRC: 1613827189 + Mapper: 6 + - CRC: 2364318390 + Mapper: 6 + - CRC: 3352171561 + Mapper: 6 + - CRC: 2468060010 + Mapper: 6 + - CRC: 3237712300 + Mapper: 2 + - CRC: 497586053 + Mapper: 66 + - CRC: 4033124520 + Mapper: 8 + - CRC: 3575621617 + Mapper: 8 + - CRC: 3896669381 + Mapper: 8 + - CRC: 739555345 + Mapper: 8 + - CRC: 1272163992 + Mapper: 6 + - CRC: 4146117127 + Mapper: 6 + - CRC: 1718054441 + Mapper: 6 + - CRC: 132425342 + Mapper: 6 + - CRC: 1454206951 + Mapper: 6 + - CRC: 3567380723 + Mapper: 6 + - CRC: 80319770 + Mapper: 6 + - CRC: 119138690 + Mapper: 6 + - CRC: 4291839811 + Mapper: 6 + - CRC: 1582769140 + Mapper: 2 + - CRC: 2743656972 + Mapper: 6 + - CRC: 45134853 + Mapper: 2 + - CRC: 174329578 + Mapper: 6 + - CRC: 3383553053 + Mapper: 6 + - CRC: 3904144204 + Mapper: 6 + - CRC: 2869413875 + Mapper: 6 + - CRC: 3707107888 + Mapper: 6 + - CRC: 1556210374 + Mapper: 6 + - CRC: 2538916815 + Mapper: 6 + - CRC: 528580632 + Mapper: 6 + - CRC: 739562846 + Mapper: 6 + - CRC: 2344368034 + Mapper: 6 + - CRC: 3043824271 + Mapper: 6 + - CRC: 1888532561 + Mapper: 6 + - CRC: 995198573 + Mapper: 6 + - CRC: 3332795240 + Mapper: 6 + - CRC: 1048769112 + Mapper: 6 + - CRC: 3838772179 + Mapper: 6 + - CRC: 2259826015 + Mapper: 6 + - CRC: 207761287 + Mapper: 6 + - CRC: 210036619 + Mapper: 6 + - CRC: 925488425 + Mapper: 6 + - CRC: 555550681 + Mapper: 6 + - CRC: 223535846 + Mapper: 6 + - CRC: 569107269 + Mapper: 6 + - CRC: 2222664965 + Mapper: 6 + - CRC: 3332685691 + Mapper: 6 + - CRC: 1854512335 + Mapper: 6 + - CRC: 4038127345 + Mapper: 6 + - CRC: 3063853390 + Mapper: 6 + - CRC: 2826290665 + Mapper: 6 + - CRC: 859073746 + Mapper: 6 + - CRC: 1458574192 + Mapper: 6 + - CRC: 1017888627 + Mapper: 6 + - CRC: 971088385 + Mapper: 6 + - CRC: 161146615 + Mapper: 6 + - CRC: 2347367251 + Mapper: 6 + - CRC: 2791125511 + Mapper: 6 + - CRC: 486029898 + Mapper: 6 + - CRC: 1713570163 + Mapper: 6 + - CRC: 2301684580 + Mapper: 6 + - CRC: 3298189890 + Mapper: 6 + - CRC: 1719342003 + Mapper: 6 + - CRC: 3434771192 + Mapper: 6 + - CRC: 2043331909 + Mapper: 6 + - CRC: 1450829020 + Mapper: 6 + - CRC: 4262706685 + Mapper: 6 + - CRC: 1234710912 + Mapper: 6 + - CRC: 2575272080 + Mapper: 6 + - CRC: 2158906354 + Mapper: 6 + - CRC: 3250368129 + Mapper: 6 + - CRC: 2762489322 + Mapper: 6 + - CRC: 4275088228 + Mapper: 6 + - CRC: 3422565603 + Mapper: 6 + - CRC: 1483999689 + Mapper: 6 + - CRC: 1293236221 + Mapper: 6 + - CRC: 2934966835 + Mapper: 6 + - CRC: 3626493973 + Mapper: 6 + - CRC: 826080650 + Mapper: 6 + - CRC: 826686717 + Mapper: 6 + - CRC: 3719125120 + Mapper: 6 + - CRC: 1034826549 + Mapper: 6 + - CRC: 429530929 + Mapper: 6 + - CRC: 2669978059 + Mapper: 6 + - CRC: 1793287925 + Mapper: 6 + - CRC: 2705328559 + Mapper: 6 + - CRC: 2985190012 + Mapper: 6 + - CRC: 4066876762 + Mapper: 6 + - CRC: 4068449928 + Mapper: 6 + - CRC: 3421686326 + Mapper: 6 + - CRC: 2382153347 + Mapper: 6 + - CRC: 205994843 + Mapper: 6 + - CRC: 1894237027 + Mapper: 6 + - CRC: 1699576382 + Mapper: 6 + - CRC: 1843688180 + Mapper: 6 + - CRC: 2062426465 + Mapper: 6 + - CRC: 673884128 + Mapper: 6 + - CRC: 345325900 + Mapper: 6 + - CRC: 600663134 + Mapper: 6 + - CRC: 1130940449 + Mapper: 6 + - CRC: 3120403302 + Mapper: 6 + - CRC: 967450864 + Mapper: 6 + - CRC: 2100473017 + Mapper: 6 + - CRC: 176751425 + Mapper: 6 + - CRC: 3013323572 + Mapper: 6 + - CRC: 1394008474 + Mapper: 6 + - CRC: 880201823 + Mapper: 6 + - CRC: 2215280691 + Mapper: 6 + - CRC: 3472725306 + Mapper: 6 + - CRC: 1429781465 + Mapper: 6 + - CRC: 2212993957 + Mapper: 6 + - CRC: 2260736849 + Mapper: 6 + - CRC: 809964319 + Mapper: 6 + - CRC: 3745227989 + Mapper: 6 + - CRC: 244590843 + Mapper: 6 + - CRC: 3286493184 + Mapper: 6 + - CRC: 3310572721 + Mapper: 6 + - CRC: 3733738129 + Mapper: 6 + - CRC: 3218417977 + Mapper: 6 + - CRC: 108615153 + Mapper: 6 + - CRC: 1480401354 + Mapper: 6 + - CRC: 1254729288 + Mapper: 6 + - CRC: 2940889503 + Mapper: 6 + - CRC: 3647342132 + Mapper: 6 + - CRC: 2430194331 + Mapper: 17 + - CRC: 505072558 + Mapper: 6 + - CRC: 1468455887 + Mapper: 6 + - CRC: 2451257778 + Mapper: 6 + - CRC: 3023446676 + Mapper: 2 + - CRC: 3959746778 + Mapper: 6 + - CRC: 3502696279 + Mapper: 6 + - CRC: 1092542265 + Mapper: 6 + - CRC: 646548330 + Mapper: 6 + - CRC: 2687187513 + Mapper: 6 + - CRC: 3928726847 + Mapper: 6 + - CRC: 1739255818 + Mapper: 6 + - CRC: 3431630418 + Mapper: 6 + - CRC: 3590098119 + Mapper: 6 + - CRC: 1243678599 + Mapper: 6 + - CRC: 3806930212 + Mapper: 6 + - CRC: 161939202 + Mapper: 6 + - CRC: 895404797 + Mapper: 6 + - CRC: 3595821691 + Mapper: 6 + - CRC: 3185640470 + Mapper: 6 + - CRC: 3084500403 + Mapper: 6 + - CRC: 732104467 + Mapper: 6 + - CRC: 3276190412 + Mapper: 6 + - CRC: 3963122900 + Mapper: 6 + - CRC: 1374493150 + Mapper: 6 + - CRC: 1527457470 + Mapper: 6 + - CRC: 850985097 + Mapper: 6 + - CRC: 1168371721 + Mapper: 6 + - CRC: 1113103391 + Mapper: 6 + - CRC: 1482689143 + Mapper: 6 + - CRC: 1344876244 + Mapper: 6 + - CRC: 87836313 + Mapper: 6 + - CRC: 2037305250 + Mapper: 6 + - CRC: 2413530978 + Mapper: 6 + - CRC: 948031836 + Mapper: 6 + - CRC: 942209321 + Mapper: 6 + - CRC: 2099157452 + Mapper: 6 + - CRC: 998031690 + Mapper: 6 + - CRC: 436852771 + Mapper: 6 + - CRC: 1679089725 + Mapper: 6 + - CRC: 1705670606 + Mapper: 6 + - CRC: 791162774 + Mapper: 6 + - CRC: 2123598487 + Mapper: 6 + - CRC: 1817712314 + Mapper: 6 + - CRC: 4023135657 + Mapper: 6 + - CRC: 166907198 + Mapper: 6 + - CRC: 3508087335 + Mapper: 6 + - CRC: 940622106 + Mapper: 6 + - CRC: 144998781 + Mapper: 6 + - CRC: 2540235040 + Mapper: 6 + - CRC: 3374829094 + Mapper: 6 + - CRC: 2605345366 + Mapper: 6 + - CRC: 1534740862 + Mapper: 6 + - CRC: 1971048355 + Mapper: 6 + - CRC: 1826731207 + Mapper: 6 + - CRC: 3096519803 + Mapper: 6 + - CRC: 2197062537 + Mapper: 6 + - CRC: 1532525245 + Mapper: 6 + - CRC: 355447327 + Mapper: 6 + - CRC: 80224350 + Mapper: 6 + - CRC: 296707215 + Mapper: 6 + - CRC: 982477894 + Mapper: 6 + - CRC: 1742436251 + Mapper: 6 + - CRC: 1763970511 + Mapper: 6 + - CRC: 1263811412 + Mapper: 6 + - CRC: 3314486933 + Mapper: 6 + - CRC: 711671457 + Mapper: 6 + - CRC: 2347778260 + Mapper: 6 + - CRC: 2088109908 + Mapper: 6 + - CRC: 1771664990 + Mapper: 6 + - CRC: 1004416593 + Mapper: 6 + - CRC: 2024321389 + Mapper: 6 + - CRC: 2702856769 + Mapper: 6 + - CRC: 2323044952 + Mapper: 6 + - CRC: 2741365540 + Mapper: 6 + - CRC: 908646769 + Mapper: 6 + - CRC: 1083125448 + Mapper: 6 + - CRC: 3859567192 + Mapper: 6 + - CRC: 1115614949 + Mapper: 6 + - CRC: 2820428266 + Mapper: 6 + - CRC: 414625560 + Mapper: 6 + - CRC: 3657071116 + Mapper: 6 + - CRC: 3028042120 + Mapper: 6 + - CRC: 1438388476 + Mapper: 6 + - CRC: 563159651 + Mapper: 6 + - CRC: 894025118 + Mapper: 6 + - CRC: 2596979433 + Mapper: 6 + - CRC: 2097134683 + Mapper: 6 + - CRC: 764176935 + Mapper: 6 + - CRC: 1671917336 + Mapper: 6 + - CRC: 3717116416 + Mapper: 6 + - CRC: 597511209 + Mapper: 6 + - CRC: 1861829993 + Mapper: 6 + - CRC: 1474208253 + Mapper: 6 + - CRC: 2033365152 + Mapper: 6 + - CRC: 295036739 + Mapper: 6 + - CRC: 966050926 + Mapper: 6 + - CRC: 2981053714 + Mapper: 6 + - CRC: 1355069169 + Mapper: 6 + - CRC: 2243817555 + Mapper: 6 + - CRC: 3120098420 + Mapper: 6 + - CRC: 3351726484 + Mapper: 6 + - CRC: 3702987942 + Mapper: 6 + - CRC: 3898536802 + Mapper: 6 + - CRC: 3012751560 + Mapper: 6 + - CRC: 952339423 + Mapper: 6 + - CRC: 861129467 + Mapper: 6 + - CRC: 3486121717 + Mapper: 6 + - CRC: 1620308433 + Mapper: 6 + - CRC: 3980843753 + Mapper: 6 + - CRC: 3815593518 + Mapper: 6 + - CRC: 3491402922 + Mapper: 6 + - CRC: 698147253 + Mapper: 6 + - CRC: 4186099189 + Mapper: 6 + - CRC: 3006449836 + Mapper: 6 + - CRC: 1653391736 + Mapper: 6 + - CRC: 599387453 + Mapper: 6 + - CRC: 647716638 + Mapper: 6 + - CRC: 3952092187 + Mapper: 6 + - CRC: 2790505618 + Mapper: 6 + - CRC: 4206007721 + Mapper: 6 + - CRC: 3533082397 + Mapper: 6 + - CRC: 4006058330 + Mapper: 6 + - CRC: 2876818428 + Mapper: 6 + - CRC: 615941251 + Mapper: 6 + - CRC: 3694261294 + Mapper: 6 + - CRC: 1311845878 + Mapper: 6 + - CRC: 774354849 + Mapper: 6 + - CRC: 3324294892 + Mapper: 6 + - CRC: 2796703038 + Mapper: 6 + - CRC: 1457338348 + Mapper: 6 + - CRC: 1224318044 + Mapper: 6 + - CRC: 95062191 + Mapper: 6 + - CRC: 3771640714 + Mapper: 6 + - CRC: 3997903488 + Mapper: 6 + - CRC: 1553837630 + Mapper: 6 + - CRC: 188471779 + Mapper: 6 + - CRC: 1428432355 + Mapper: 6 + - CRC: 3801401455 + Mapper: 6 + - CRC: 3736440817 + Mapper: 6 + - CRC: 3865991584 + Mapper: 6 + - CRC: 774047085 + Mapper: 6 + - CRC: 627327467 + Mapper: 6 + - CRC: 1244894608 + Mapper: 6 + - CRC: 2151753637 + Mapper: 6 + - CRC: 2236420682 + Mapper: 6 + - CRC: 1187272582 + Mapper: 6 + - CRC: 2153761815 + Mapper: 6 + - CRC: 36774884 + Mapper: 6 + - CRC: 679039488 + Mapper: 12 + - CRC: 836203281 + Mapper: 12 + - CRC: 900055621 + Mapper: 12 + - CRC: 1782907758 + Mapper: 12 + - CRC: 3063248383 + Mapper: 12 + - CRC: 1831655097 + Mapper: 12 + - CRC: 1027746522 + Mapper: 12 + - CRC: 3349504370 + Mapper: 12 + - CRC: 4043050671 + Mapper: 12 + - CRC: 1550091726 + Mapper: 12 + - CRC: 3534531927 + Mapper: 12 + - CRC: 1725986068 + Mapper: 12 + - CRC: 2270149346 + Mapper: 12 + - CRC: 4098879466 + Mapper: 12 + - CRC: 468163704 + Mapper: 12 + - CRC: 3376720614 + Mapper: 12 + - CRC: 2417236694 + Mapper: 12 + - CRC: 691459299 + Mapper: 12 + - CRC: 3656880416 + Mapper: 12 + - CRC: 2763598701 + Mapper: 12 + - CRC: 86158112 + Mapper: 12 + - CRC: 1626384397 + Mapper: 12 + - CRC: 3539626241 + Mapper: 12 + - CRC: 3610551131 + Mapper: 12 + - CRC: 3644108173 + Mapper: 12 + - CRC: 2295489850 + Mapper: 17 + - CRC: 2401665412 + Mapper: 12 + - CRC: 1220963563 + Mapper: 12 + - CRC: 2074247378 + Mapper: 12 + - CRC: 2731994676 + Mapper: 12 + - CRC: 728766697 + Mapper: 12 + - CRC: 778769458 + Mapper: 0 + - CRC: 2974705294 + Mapper: 3 + - CRC: 2827849241 + Mapper: 2 + - CRC: 3524403095 + Mapper: 2 + - CRC: 2698901636 + Mapper: 6 + - CRC: 2184904085 + Mapper: 2 + - CRC: 3552097973 + Mapper: 6 + - CRC: 3170475154 + Mapper: 17 + - CRC: 1655643076 + Mapper: 6 + - CRC: 3663011099 + Mapper: 17 + - CRC: 3666714801 + Mapper: 6 + - CRC: 433402090 + Mapper: 6 + - CRC: 1685117168 + Mapper: 6 + - CRC: 3032952615 + Mapper: 6 + - CRC: 1531805650 + Mapper: 6 + - CRC: 215282823 + Mapper: 6 + - CRC: 3182026507 + Mapper: 6 + - CRC: 1983045643 + Mapper: 6 + - CRC: 2015426342 + Mapper: 6 + - CRC: 729801943 + Mapper: 6 + - CRC: 383983146 + Mapper: 6 + - CRC: 2688422273 + Mapper: 6 + - CRC: 930695334 + Mapper: 17 + - CRC: 1454931125 + Mapper: 6 + - CRC: 3858089254 + Mapper: 6 + - CRC: 2576110851 + Mapper: 17 + - CRC: 1267611731 + Mapper: 17 + - CRC: 180771904 + Mapper: 6 + - CRC: 3178312411 + Mapper: 17 + - CRC: 3670886825 + Mapper: 17 + - CRC: 297316542 + Mapper: 17 + - CRC: 1164800848 + Mapper: 17 + - CRC: 2589452236 + Mapper: 17 + - CRC: 818941687 + Mapper: 17 + - CRC: 3645990515 + Mapper: 17 + - CRC: 1530616769 + Mapper: 17 + - CRC: 1874141179 + Mapper: 17 + - CRC: 1766609559 + Mapper: 6 + - CRC: 2720783021 + Mapper: 17 + - CRC: 2389481971 + Mapper: 17 + - CRC: 1589033009 + Mapper: 17 + - CRC: 344061229 + Mapper: 17 + - CRC: 3838502310 + Mapper: 17 + - CRC: 2507235511 + Mapper: 17 + - CRC: 2557326127 + Mapper: 17 + - CRC: 25954531 + Mapper: 17 + - CRC: 3159426803 + Mapper: 17 + - CRC: 1199249667 + Mapper: 17 + - CRC: 2236565089 + Mapper: 17 + - CRC: 4035812135 + Mapper: 17 + - CRC: 1164483499 + Mapper: 17 + - CRC: 884419261 + Mapper: 17 + - CRC: 3095502387 + Mapper: 17 + - CRC: 2168488107 + Mapper: 17 + - CRC: 2713226555 + Mapper: 17 + - CRC: 2879045859 + Mapper: 17 + - CRC: 4034618532 + Mapper: 17 + - CRC: 543422654 + Mapper: 17 + - CRC: 402171626 + Mapper: 17 + - CRC: 1361022112 + Mapper: 17 + - CRC: 1514206514 + Mapper: 17 + - CRC: 1153461337 + Mapper: 17 + - CRC: 979512440 + Mapper: 17 + - CRC: 3453745869 + Mapper: 17 + - CRC: 3846860155 + Mapper: 17 + - CRC: 1984686699 + Mapper: 17 + - CRC: 994913177 + Mapper: 17 + - CRC: 1275617681 + Mapper: 17 + - CRC: 984474230 + Mapper: 17 + - CRC: 2685707827 + Mapper: 17 + - CRC: 879343380 + Mapper: 17 + - CRC: 1885213642 + Mapper: 6 + - CRC: 2501644974 + Mapper: 17 + - CRC: 958572149 + Mapper: 17 + - CRC: 705946906 + Mapper: 12 + - CRC: 1036606253 + Mapper: 17 + - CRC: 2331313296 + Mapper: 17 + - CRC: 3066591909 + Mapper: 17 + - CRC: 2340490112 + Mapper: 17 + - CRC: 534532846 + Mapper: 17 + - CRC: 2517352591 + Mapper: 17 + - CRC: 1664773891 + Mapper: 17 + - CRC: 983070543 + Mapper: 17 + - CRC: 313804074 + Mapper: 17 + - CRC: 2939333458 + Mapper: 17 + - CRC: 3198234236 + Mapper: 17 + - CRC: 112918650 + Mapper: 17 + - CRC: 1373087703 + Mapper: 17 + - CRC: 1934927012 + Mapper: 17 + - CRC: 616251240 + Mapper: 17 + - CRC: 1975393431 + Mapper: 17 + - CRC: 1630467066 + Mapper: 12 + - CRC: 3945362209 + Mapper: 17 + - CRC: 3628915276 + Mapper: 17 + - CRC: 1002811171 + Mapper: 17 + - CRC: 941904153 + Mapper: 17 + - CRC: 1534381796 + Mapper: 17 + - CRC: 834226679 + Mapper: 17 + - CRC: 664815678 + Mapper: 17 + - CRC: 3290956091 + Mapper: 17 + - CRC: 1844122970 + Mapper: 17 + - CRC: 2903781560 + Mapper: 17 + - CRC: 2986334620 + Mapper: 17 + - CRC: 4111554156 + Mapper: 17 + - CRC: 1216012652 + Mapper: 17 + - CRC: 796098231 + Mapper: 17 + - CRC: 2583520373 + Mapper: 6 + - CRC: 3494915629 + Mapper: 0 + - CRC: 3855808649 + Mapper: 0 + - CRC: 463750039 + Mapper: 0 + - CRC: 2409970976 + Mapper: 0 + - CRC: 592285305 + Mapper: 0 + - CRC: 656533427 + Mapper: 0 + - CRC: 1477326094 + Mapper: 0 + - CRC: 1476041955 + Mapper: 0 + - CRC: 643974434 + Mapper: 0 + - CRC: 3866197448 + Mapper: 0 + - CRC: 670209553 + Mapper: 0 + - CRC: 3468805708 + Mapper: 0 + - CRC: 931442592 + Mapper: 0 + - CRC: 195713718 + Mapper: 0 + - CRC: 2797706774 + Mapper: 0 + - CRC: 2370715338 + Mapper: 0 + - CRC: 3877899186 + Mapper: 0 + - CRC: 2967573528 + Mapper: 0 + - CRC: 1811291317 + Mapper: 0 + - CRC: 4267893404 + Mapper: 0 + - CRC: 1812247513 + Mapper: 0 + - CRC: 254164569 + Mapper: 0 + - CRC: 2644682358 + Mapper: 0 + - CRC: 1625668665 + Mapper: 0 + - CRC: 4140285552 + Mapper: 0 + - CRC: 505130681 + Mapper: 0 + - CRC: 4175420446 + Mapper: 0 + - CRC: 3175850819 + Mapper: 0 + - CRC: 2190512119 + Mapper: 0 + - CRC: 156112189 + Mapper: 0 + - CRC: 2975320070 + Mapper: 0 + - CRC: 2273852950 + Mapper: 0 + - CRC: 2252268952 + Mapper: 0 + - CRC: 2079430015 + Mapper: 0 + - CRC: 3629884882 + Mapper: 0 + - CRC: 1639793039 + Mapper: 0 + - CRC: 371191389 + Mapper: 0 + - CRC: 2502904355 + Mapper: 0 + - CRC: 1004429012 + Mapper: 0 + - CRC: 3804492822 + Mapper: 0 + - CRC: 2248324962 + Mapper: 0 + - CRC: 3829936022 + Mapper: 0 + - CRC: 3118639735 + Mapper: 0 + - CRC: 4202847544 + Mapper: 0 + - CRC: 2430367294 + Mapper: 0 + - CRC: 2096884592 + Mapper: 0 + - CRC: 952959285 + Mapper: 0 + - CRC: 2956724393 + Mapper: 0 + - CRC: 2616488259 + Mapper: 0 + - CRC: 1178140212 + Mapper: 0 + - CRC: 3379343181 + Mapper: 0 + - CRC: 3037168324 + Mapper: 0 + - CRC: 151349471 + Mapper: 0 + - CRC: 3013078460 + Mapper: 0 + - CRC: 2617769918 + Mapper: 0 + - CRC: 1440840526 + Mapper: 0 + - CRC: 1688264993 + Mapper: 0 + - CRC: 897259773 + Mapper: 0 + - CRC: 1433972934 + Mapper: 0 + - CRC: 1332289453 + Mapper: 0 + - CRC: 2048033231 + Mapper: 0 + - CRC: 1126727289 + Mapper: 0 + - CRC: 2245499570 + Mapper: 0 + - CRC: 739653140 + Mapper: 0 + - CRC: 1212875739 + Mapper: 0 + - CRC: 1627702832 + Mapper: 0 + - CRC: 581374406 + Mapper: 0 + - CRC: 236550750 + Mapper: 0 + - CRC: 323475145 + Mapper: 0 + - CRC: 3465869615 + Mapper: 0 + - CRC: 2104593220 + Mapper: 0 + - CRC: 2833489606 + Mapper: 0 + - CRC: 209353534 + Mapper: 0 + - CRC: 4041776890 + Mapper: 0 + - CRC: 2228282004 + Mapper: 0 + - CRC: 3672401832 + Mapper: 0 + - CRC: 626326013 + Mapper: 0 + - CRC: 1095331517 + Mapper: 0 + - CRC: 2693627049 + Mapper: 0 + - CRC: 599292525 + Mapper: 0 + - CRC: 1470178736 + Mapper: 0 + - CRC: 1274490781 + Mapper: 0 + - CRC: 3611656820 + Mapper: 0 + - CRC: 4273954241 + Mapper: 0 + - CRC: 1300389393 + Mapper: 0 + - CRC: 2855239057 + Mapper: 0 + - CRC: 1191631645 + Mapper: 0 + - CRC: 2598054647 + Mapper: 0 + - CRC: 546173705 + Mapper: 0 + - CRC: 286772869 + Mapper: 0 + - CRC: 1691706134 + Mapper: 0 + - CRC: 3131763176 + Mapper: 0 + - CRC: 3417148169 + Mapper: 0 + - CRC: 3172624209 + Mapper: 0 + - CRC: 743332349 + Mapper: 0 + - CRC: 2201245935 + Mapper: 0 + - CRC: 2014289704 + Mapper: 0 + - CRC: 1493195982 + Mapper: 0 + - CRC: 1951175598 + Mapper: 0 + - CRC: 347330935 + Mapper: 3 + - CRC: 3352342422 + Mapper: 3 + - CRC: 4181998163 + Mapper: 3 + - CRC: 8107402 + Mapper: 3 + - CRC: 2114077588 + Mapper: 3 + - CRC: 1859251211 + Mapper: 3 + - CRC: 1624041821 + Mapper: 3 + - CRC: 825628155 + Mapper: 3 + - CRC: 656743788 + Mapper: 3 + - CRC: 3725807367 + Mapper: 3 + - CRC: 238086854 + Mapper: 3 + - CRC: 2028674303 + Mapper: 3 + - CRC: 1578818961 + Mapper: 3 + - CRC: 2288737235 + Mapper: 3 + - CRC: 489795281 + Mapper: 3 + - CRC: 81264858 + Mapper: 3 + - CRC: 1168755111 + Mapper: 3 + - CRC: 2989820159 + Mapper: 3 + - CRC: 2351160260 + Mapper: 3 + - CRC: 3142007361 + Mapper: 3 + - CRC: 365182840 + Mapper: 3 + - CRC: 4187301303 + Mapper: 3 + - CRC: 2341355610 + Mapper: 3 + - CRC: 126379250 + Mapper: 3 + - CRC: 3321567078 + Mapper: 3 + - CRC: 4142054766 + Mapper: 3 + - CRC: 1122887883 + Mapper: 3 + - CRC: 2806195695 + Mapper: 3 + - CRC: 581052605 + Mapper: 3 + - CRC: 586083437 + Mapper: 3 + - CRC: 3080673411 + Mapper: 3 + - CRC: 1324624332 + Mapper: 3 + - CRC: 4056149222 + Mapper: 3 + - CRC: 2663385414 + Mapper: 3 + - CRC: 1316643201 + Mapper: 3 + - CRC: 2213838771 + Mapper: 3 + - CRC: 1876039042 + Mapper: 3 + - CRC: 3314477655 + Mapper: 3 + - CRC: 2155440197 + Mapper: 2 + - CRC: 2573248793 + Mapper: 2 + - CRC: 3569873091 + Mapper: 2 + - CRC: 612526375 + Mapper: 2 + - CRC: 134865022 + Mapper: 2 + - CRC: 1445804692 + Mapper: 2 + - CRC: 1038728021 + Mapper: 2 + - CRC: 1450496499 + Mapper: 2 + - CRC: 1036405952 + Mapper: 2 + - CRC: 2101924331 + Mapper: 2 + - CRC: 438123682 + Mapper: 2 + - CRC: 947375774 + Mapper: 2 + - CRC: 328141744 + Mapper: 2 + - CRC: 2258356978 + Mapper: 2 + - CRC: 1061300539 + Mapper: 2 + - CRC: 2966837519 + Mapper: 2 + - CRC: 2815567855 + Mapper: 2 + - CRC: 1283448150 + Mapper: 2 + - CRC: 512504559 + Mapper: 2 + - CRC: 1743643508 + Mapper: 2 + - CRC: 910969289 + Mapper: 2 + - CRC: 1841729753 + Mapper: 2 + - CRC: 2529876699 + Mapper: 2 + - CRC: 3362687331 + Mapper: 2 + - CRC: 3158594638 + Mapper: 2 + - CRC: 3032521293 + Mapper: 2 + - CRC: 2667930130 + Mapper: 66 + - CRC: 1937929689 + Mapper: 66 + - CRC: 3577243292 + Mapper: 66 + - CRC: 2679879435 + Mapper: 66 + - CRC: 471005088 + Mapper: 6 + - CRC: 2068541009 + Mapper: 6 + - CRC: 98797409 + Mapper: 6 + - CRC: 2737480157 + Mapper: 6 + - CRC: 2799567996 + Mapper: 6 + - CRC: 2838269931 + Mapper: 2 + - CRC: 3490789156 + Mapper: 6 + - CRC: 352797039 + Mapper: 6 + - CRC: 1812165401 + Mapper: 6 + - CRC: 63469932 + Mapper: 6 + - CRC: 2046993025 + Mapper: 3 + - CRC: 1191862075 + Mapper: 3 + - CRC: 1788924246 + Mapper: 3 + - CRC: 3776332927 + Mapper: 3 + - CRC: 926586214 + Mapper: 3 + - CRC: 3664977684 + Mapper: 2 + - CRC: 2374446537 + Mapper: 3 + - CRC: 3011686052 + Mapper: 2 + - CRC: 1339423499 + Mapper: 3 + - CRC: 3444750193 + Mapper: 3 + - CRC: 4068724568 + Mapper: 3 + - CRC: 1969129396 + Mapper: 3 + - CRC: 698299739 + Mapper: 2 + - CRC: 3801166325 + Mapper: 3 + - CRC: 200087074 + Mapper: 3 + - CRC: 2874725978 + Mapper: 2 + - CRC: 2227369409 + Mapper: 3 + - CRC: 2079858428 + Mapper: 0 + - CRC: 182667115 + Mapper: 3 + - CRC: 434542439 + Mapper: 3 + - CRC: 3120371425 + Mapper: 3 + - CRC: 2979003756 + Mapper: 0 + - CRC: 2880839564 + Mapper: 0 + - CRC: 3480534178 + Mapper: 3 + - CRC: 2309695448 + Mapper: 2 + - CRC: 3219706782 + Mapper: 3 + - CRC: 3898637618 + Mapper: 3 + - CRC: 2449743945 + Mapper: 2 + - CRC: 199596380 + Mapper: 66 + - CRC: 1988052620 + Mapper: 71 + - CRC: 1029848174 + Mapper: 2 + - CRC: 683978852 + Mapper: 3 + - CRC: 2136276929 + Mapper: 3 + - CRC: 4071353136 + Mapper: 3 + - CRC: 3956302925 + Mapper: 3 + - CRC: 3756752536 + Mapper: 3 + - CRC: 976969305 + Mapper: 4 + - CRC: 3573430668 + Mapper: 4 + - CRC: 342580314 + Mapper: 4 + - CRC: 3885378103 + Mapper: 4 + - CRC: 490585777 + Mapper: 0 + - CRC: 1436411850 + Mapper: 206 + - CRC: 660487419 + Mapper: 0 + - CRC: 2475139756 + Mapper: 0 + - CRC: 2401532900 + Mapper: 0 + - CRC: 3217062606 + Mapper: 4 + - CRC: 4071102105 + Mapper: 4 + - CRC: 1958804751 + Mapper: 0 + - CRC: 2928053896 + Mapper: 1 + - CRC: 2806594893 + Mapper: 0 + - CRC: 451946862 + Mapper: 4 + - CRC: 1396885239 + Mapper: 4 + - CRC: 2062129976 + Mapper: 4 + - CRC: 4209481207 + Mapper: 0 + - CRC: 2913874019 + Mapper: 0 + - CRC: 148219628 + Mapper: 4 + - CRC: 1471301557 + Mapper: 4 + - CRC: 3049424630 + Mapper: 4 + - CRC: 1367315570 + Mapper: 4 + - CRC: 368464054 + Mapper: 4 + - CRC: 3568126143 + Mapper: 0 + - CRC: 724810188 + Mapper: 0 + - CRC: 4235249802 + Mapper: 0 + - CRC: 1194418380 + Mapper: 0 + - CRC: 3166957159 + Mapper: 0 + - CRC: 416391352 + Mapper: 0 + - CRC: 2657449325 + Mapper: 4 + - CRC: 965637442 + Mapper: 4 + - CRC: 2500075343 + Mapper: 4 + - CRC: 3785978703 + Mapper: 0 + - CRC: 124699177 + Mapper: 0 + - CRC: 175019589 + Mapper: 4 + - CRC: 4026826457 + Mapper: 4 + - CRC: 1014633257 + Mapper: 2 + - CRC: 16927471 + Mapper: 0 + - CRC: 4037447316 + Mapper: 4 + - CRC: 1972332647 + Mapper: 0 + - CRC: 2617028325 + Mapper: 0 + - CRC: 118354031 + Mapper: 0 + - CRC: 2220687819 + Mapper: 4 + - CRC: 993099675 + Mapper: 2 + - CRC: 3897048118 + Mapper: 3 + - CRC: 2741794200 + Mapper: 4 + - CRC: 4243555012 + Mapper: 4 + - CRC: 3827396472 + Mapper: 2 + - CRC: 2662800633 + Mapper: 0 + - CRC: 4294788809 + Mapper: 0 + - CRC: 616044385 + Mapper: 0 + - CRC: 1363546040 + Mapper: 4 + - CRC: 455316986 + Mapper: 0 + - CRC: 1458561549 + Mapper: 0 + - CRC: 2324167629 + Mapper: 0 + - CRC: 4258380644 + Mapper: 0 + - CRC: 651231219 + Mapper: 4 + - CRC: 3256251548 + Mapper: 4 + - CRC: 1495455918 + Mapper: 0 + - CRC: 3161341862 + Mapper: 4 + - CRC: 2097339082 + Mapper: 4 + - CRC: 1463036992 + Mapper: 0 + - CRC: 2501020832 + Mapper: 4 + - CRC: 4021416054 + Mapper: 4 + - CRC: 249908074 + Mapper: 4 + - CRC: 4036138291 + Mapper: 2 + - CRC: 485312940 + Mapper: 4 + - CRC: 3804065003 + Mapper: 0 + - CRC: 3675337200 + Mapper: 206 + - CRC: 3208136564 + Mapper: 0 + - CRC: 2049755500 + Mapper: 4 + - CRC: 2973895152 + Mapper: 4 + - CRC: 140210211 + Mapper: 4 + - CRC: 2499020386 + Mapper: 4 + - CRC: 1880590149 + Mapper: 4 + - CRC: 1708670046 + Mapper: 4 + - CRC: 773328993 + Mapper: 4 + - CRC: 4030266932 + Mapper: 0 + - CRC: 1287539244 + Mapper: 0 + - CRC: 3576693169 + Mapper: 4 + - CRC: 1860447204 + Mapper: 4 + - CRC: 2336524419 + Mapper: 4 + - CRC: 3482062099 + Mapper: 0 + - CRC: 1050498683 + Mapper: 2 + - CRC: 2545339161 + Mapper: 4 + - CRC: 1983430067 + Mapper: 4 + - CRC: 2631390085 + Mapper: 4 + - CRC: 3178844493 + Mapper: 4 + - CRC: 3928297892 + Mapper: 4 + - CRC: 200667698 + Mapper: 4 + - CRC: 3232125176 + Mapper: 7 + - CRC: 3178622329 + Mapper: 71 + - CRC: 2531195582 + Mapper: 142 + - CRC: 2943980944 + Mapper: 108 + - CRC: 797332273 + Mapper: 108 + - CRC: 3851241201 + Mapper: 4 + - CRC: 3034860251 + Mapper: 1 + - CRC: 4289980234 + Mapper: 4 + - CRC: 1945650192 + Mapper: 2 + - CRC: 2871902598 + Mapper: 4 + - CRC: 3129727863 + Mapper: 0 + - CRC: 3914530901 + Mapper: 0 + - CRC: 300772866 + Mapper: 0 + - CRC: 2606621445 + Mapper: 127 + - CRC: 79917586 + Mapper: 1 + - CRC: 3484558566 + Mapper: 222 + - CRC: 881369460 + Mapper: 0 + - CRC: 3055863000 + Mapper: 2 + - CRC: 2791976398 + Mapper: 0 + - CRC: 3832153539 + Mapper: 0 + - CRC: 1267307173 + Mapper: 142 + - CRC: 2722040359 + Mapper: 3 + - CRC: 1722227977 + Mapper: 0 + - CRC: 2153291254 + Mapper: 108 + - CRC: 1116236998 + Mapper: 142 + - CRC: 1074288825 + Mapper: 0 + - CRC: 498620511 + Mapper: 42 + - CRC: 1855871120 + Mapper: 2 + - CRC: 649363972 + Mapper: 11 + - CRC: 3001661819 + Mapper: 4 + - CRC: 1564832992 + Mapper: 0 + - CRC: 1362488034 + Mapper: 4 + - CRC: 836195763 + Mapper: 0 + - CRC: 704123528 + Mapper: 4 + - CRC: 333379801 + Mapper: 4 + - CRC: 1904950214 + Mapper: 4 + - CRC: 2358765931 + Mapper: 1 + - CRC: 409678388 + Mapper: 4 + - CRC: 69273512 + Mapper: 4 + - CRC: 2239857912 + Mapper: 4 + - CRC: 1493703009 + Mapper: 0 + - CRC: 2909164927 + Mapper: 206 + - CRC: 3354616174 + Mapper: 4 + - CRC: 1700894374 + Mapper: 0 + - CRC: 1897712900 + Mapper: 0 + - CRC: 4052491439 + Mapper: 3 + - CRC: 3867506019 + Mapper: 4 + - CRC: 1767444714 + Mapper: 209 + - CRC: 3960497988 + Mapper: 4 + - CRC: 165928116 + Mapper: 125 + - CRC: 18405488 + Mapper: 4 + - CRC: 2084935305 + Mapper: 4 + - CRC: 2438058769 + Mapper: 197 + - CRC: 4265477025 + Mapper: 197 + - CRC: 4280936427 + Mapper: 4 + - CRC: 101911054 + Mapper: 4 + - CRC: 1057927232 + Mapper: 4 + - CRC: 1228138879 + Mapper: 85 + - CRC: 670278146 + Mapper: 4 + - CRC: 761901194 + Mapper: 4 + - CRC: 3190113807 + Mapper: 4 + - CRC: 1502911652 + Mapper: 4 + - CRC: 882276567 + Mapper: 4 + - CRC: 1114801944 + Mapper: 4 + - CRC: 3840135917 + Mapper: 0 + - CRC: 3134472150 + Mapper: 0 + - CRC: 1731346871 + Mapper: 0 + - CRC: 934729485 + Mapper: 4 + - CRC: 1675481625 + Mapper: 0 + - CRC: 3225789294 + Mapper: 108 + - CRC: 2989244877 + Mapper: 0 + - CRC: 4018874402 + Mapper: 1 + - CRC: 116851797 + Mapper: 4 + - CRC: 3043862626 + Mapper: 4 + - CRC: 1939580928 + Mapper: 0 + - CRC: 3696843218 + Mapper: 4 + - CRC: 975945452 + Mapper: 176 + - CRC: 483796978 + Mapper: 4 + - CRC: 2362948385 + Mapper: 4 + - CRC: 1498469014 + Mapper: 197 + - CRC: 921493009 + Mapper: 197 + - CRC: 281776991 + Mapper: 4 + - CRC: 3399580341 + Mapper: 0 + - CRC: 825528813 + Mapper: 50 + - CRC: 1905239058 + Mapper: 40 + - CRC: 2290550282 + Mapper: 43 + - CRC: 1335622076 + Mapper: 43 + - CRC: 3392978860 + Mapper: 4 + - CRC: 209622211 + Mapper: 56 + - CRC: 3573000937 + Mapper: 2 + - CRC: 554630364 + Mapper: 71 + - CRC: 2488279223 + Mapper: 4 + - CRC: 3995202147 + Mapper: 4 + - CRC: 128750351 + Mapper: 4 + - CRC: 178378557 + Mapper: 4 + - CRC: 952225549 + Mapper: 0 + - CRC: 683991544 + Mapper: 4 + - CRC: 1762844290 + Mapper: 4 + - CRC: 2465010307 + Mapper: 176 + - CRC: 4066391124 + Mapper: 2 + - CRC: 3160382600 + Mapper: 4 + - CRC: 3391870525 + Mapper: 4 + - CRC: 2620254481 + Mapper: 4 + - CRC: 2123429297 + Mapper: 4 + - CRC: 2827772808 + Mapper: 4 + - CRC: 243715513 + Mapper: 0 + - CRC: 3650530126 + Mapper: 66 + - CRC: 3027662904 + Mapper: 0 + - CRC: 586850949 + Mapper: 0 + - CRC: 4001543146 + Mapper: 120 + - CRC: 493865374 + Mapper: 4 + - CRC: 3862964056 + Mapper: 4 + - CRC: 2079472514 + Mapper: 4 + - CRC: 2338925759 + Mapper: 103 + - CRC: 492089814 + Mapper: 0 + - CRC: 423572498 + Mapper: 208 + - CRC: 151784471 + Mapper: 42 + - CRC: 1308117029 + Mapper: 42 + - CRC: 1130819778 + Mapper: 171 + - CRC: 2411028620 + Mapper: 132 + - CRC: 3871193868 + Mapper: 183 + - CRC: 3920647414 + Mapper: 86 + - CRC: 3623954834 + Mapper: 108 + - CRC: 4213640086 + Mapper: 3 + - CRC: 2785598978 + Mapper: 85 + - CRC: 2857930057 + Mapper: 3 + - CRC: 2442689345 + Mapper: 0 + - CRC: 1787950953 + Mapper: 2 + - CRC: 672343789 + Mapper: 142 + - CRC: 2086512200 + Mapper: 40 + - CRC: 4284204394 + Mapper: 4 + - CRC: 1683328964 + Mapper: 4 + - CRC: 1429919356 + Mapper: 4 + - CRC: 1059107509 + Mapper: 4 + - CRC: 1944727958 + Mapper: 4 + - CRC: 2165113138 + Mapper: 2 + - CRC: 1414698606 + Mapper: 4 + - CRC: 3743892277 + Mapper: 156 + - CRC: 2500473455 + Mapper: 0 + - CRC: 3387823527 + Mapper: 3 + - CRC: 2075099458 + Mapper: 0 + - CRC: 1233769809 + Mapper: 1 + - CRC: 631045630 + Mapper: 4 + - CRC: 2959793096 + Mapper: 69 + - CRC: 1578448473 + Mapper: 25 + - CRC: 1684231039 + Mapper: 4 + - CRC: 372924122 + Mapper: 4 + - CRC: 340644613 + Mapper: 4 + - CRC: 3261585505 + Mapper: 0 + - CRC: 3364560987 + Mapper: 0 + - CRC: 2923686333 + Mapper: 0 + - CRC: 2780690919 + Mapper: 4 + - CRC: 2140689490 + Mapper: 0 + - CRC: 1305666989 + Mapper: 4 + - CRC: 51089114 + Mapper: 4 + - CRC: 4038178152 + Mapper: 4 + - CRC: 903481863 + Mapper: 2 + - CRC: 675116839 + Mapper: 0 + - CRC: 3319769960 + Mapper: 4 + - CRC: 262275699 + Mapper: 4 + - CRC: 2496185244 + Mapper: 4 + - CRC: 2236657129 + Mapper: 4 + - CRC: 313884290 + Mapper: 1 + - CRC: 1586264027 + Mapper: 0 + - CRC: 790934766 + Mapper: 4 + - CRC: 555191629 + Mapper: 3 + - CRC: 782832890 + Mapper: 25 + - CRC: 3884179078 + Mapper: 4 + - CRC: 3847696511 + Mapper: 4 + - CRC: 2422620718 + Mapper: 4 + - CRC: 4260118943 + Mapper: 196 + - CRC: 1366866299 + Mapper: 196 + - CRC: 2755182683 + Mapper: 4 + - CRC: 435270591 + Mapper: 197 + - CRC: 3052714417 + Mapper: 55 + - CRC: 2325001599 + Mapper: 2 + - CRC: 2744811619 + Mapper: 0 + - CRC: 67812404 + Mapper: 4 + - CRC: 4238981741 + Mapper: 0 + - CRC: 371331092 + Mapper: 87 + - CRC: 2379958823 + Mapper: 0 + - CRC: 498794077 + Mapper: 1 + - CRC: 94913358 + Mapper: 4 + - CRC: 3032125154 + Mapper: 0 + - CRC: 382943424 + Mapper: 4 + - CRC: 1140273379 + Mapper: 0 + - CRC: 157695429 + Mapper: 1 + - CRC: 3923847065 + Mapper: 4 + - CRC: 847109612 + Mapper: 0 + - CRC: 496010395 + Mapper: 4 + - CRC: 3359279578 + Mapper: 3 + - CRC: 3681845105 + Mapper: 4 + - CRC: 4250751422 + Mapper: 3 + - CRC: 3456645415 + Mapper: 4 + - CRC: 3293401002 + Mapper: 0 + - CRC: 2046922271 + Mapper: 0 + - CRC: 3436283489 + Mapper: 4 + - CRC: 1696189243 + Mapper: 0 + - CRC: 3777281110 + Mapper: 91 + - CRC: 106054749 + Mapper: 4 + - CRC: 1951008545 + Mapper: 4 + - CRC: 1811150499 + Mapper: 42 + - CRC: 3019532713 + Mapper: 85 + - CRC: 1344749167 + Mapper: 189 + - CRC: 3711115871 + Mapper: 91 + - CRC: 1675789390 + Mapper: 189 + - CRC: 2036613668 + Mapper: 4 + - CRC: 2001193062 + Mapper: 4 + - CRC: 3654190124 + Mapper: 4 + - CRC: 471863449 + Mapper: 0 + - CRC: 4116837889 + Mapper: 4 + - CRC: 1775798672 + Mapper: 0 + - CRC: 1588471533 + Mapper: 254 + - CRC: 620032919 + Mapper: 4 + - CRC: 1886764894 + Mapper: 25 + - CRC: 3914573430 + Mapper: 0 + - CRC: 449707609 + Mapper: 176 + - CRC: 3285456783 + Mapper: 4 + - CRC: 12504062 + Mapper: 4 + - CRC: 3554010808 + Mapper: 4 + - CRC: 2201786571 + Mapper: 4 + - CRC: 1045853153 + Mapper: 4 + - CRC: 1104710508 + Mapper: 4 + - CRC: 507868878 + Mapper: 4 + - CRC: 1974528405 + Mapper: 250 + - CRC: 1927424510 + Mapper: 4 + - CRC: 4272446026 + Mapper: 0 + - CRC: 2814822466 + Mapper: 0 + - CRC: 1805412531 + Mapper: 1 + - CRC: 908580450 + Mapper: 4 + - CRC: 3813830027 + Mapper: 4 + - CRC: 627541319 + Mapper: 4 + - CRC: 1144262054 + Mapper: 0 + - CRC: 1005621019 + Mapper: 0 + - CRC: 1259618230 + Mapper: 0 + - CRC: 1380697209 + Mapper: 0 + - CRC: 1081362906 + Mapper: 0 + - CRC: 2218763480 + Mapper: 4 + - CRC: 1089405182 + Mapper: 99 + - CRC: 2667418418 + Mapper: 0 + - CRC: 3946379438 + Mapper: 0 + - CRC: 3938645359 + Mapper: 4 + - CRC: 168365073 + Mapper: 4 + - CRC: 541860444 + Mapper: 91 + - CRC: 2694490156 + Mapper: 91 + - CRC: 2530105454 + Mapper: 189 + - CRC: 3336699677 + Mapper: 4 + - CRC: 3844220360 + Mapper: 4 + - CRC: 3412468838 + Mapper: 4 + - CRC: 1571481242 + Mapper: 90 + - CRC: 1279614455 + Mapper: 3 + - CRC: 2048662015 + Mapper: 0 + - CRC: 2203962286 + Mapper: 196 + - CRC: 2979839128 + Mapper: 4 + - CRC: 1666874386 + Mapper: 4 + - CRC: 3923887820 + Mapper: 4 + - CRC: 148495787 + Mapper: 4 + - CRC: 3930167225 + Mapper: 222 + - CRC: 3263013911 + Mapper: 222 + - CRC: 3804842946 + Mapper: 48 + - CRC: 3991341241 + Mapper: 4 + - CRC: 2865191738 + Mapper: 4 + - CRC: 3998619840 + Mapper: 4 + - CRC: 1785528886 + Mapper: 189 + - CRC: 3770105794 + Mapper: 4 + - CRC: 2612421427 + Mapper: 4 + - CRC: 1525822285 + Mapper: 0 + - CRC: 2762955643 + Mapper: 91 + - CRC: 763719585 + Mapper: 90 + - CRC: 2862927702 + Mapper: 196 + - CRC: 1574366393 + Mapper: 4 + - CRC: 3036497533 + Mapper: 55 + - CRC: 141693433 + Mapper: 196 + - CRC: 101995078 + Mapper: 23 + - CRC: 2382433047 + Mapper: 40 + - CRC: 2558499002 + Mapper: 196 + - CRC: 4056190305 + Mapper: 196 + - CRC: 1467636842 + Mapper: 91 + - CRC: 376189371 + Mapper: 196 + - CRC: 1808822650 + Mapper: 4 + - CRC: 4071899954 + Mapper: 4 + - CRC: 1885765509 + Mapper: 4 + - CRC: 4091465961 + Mapper: 196 + - CRC: 2744462094 + Mapper: 4 + - CRC: 2483833607 + Mapper: 0 + - CRC: 2423023032 + Mapper: 0 + - CRC: 293937499 + Mapper: 0 + - CRC: 2003548228 + Mapper: 106 + - CRC: 1515826431 + Mapper: 0 + - CRC: 2013564865 + Mapper: 0 + - CRC: 3775331980 + Mapper: 4 + - CRC: 1309858393 + Mapper: 0 + - CRC: 2767281534 + Mapper: 4 + - CRC: 150164555 + Mapper: 4 + - CRC: 4294272231 + Mapper: 4 + - CRC: 450729306 + Mapper: 4 + - CRC: 3580817891 + Mapper: 4 + - CRC: 480229623 + Mapper: 250 + - CRC: 3148170683 + Mapper: 4 + - CRC: 1284572428 + Mapper: 4 + - CRC: 3572435112 + Mapper: 2 + - CRC: 2879252767 + Mapper: 4 + - CRC: 731628998 + Mapper: 4 + - CRC: 2427549749 + Mapper: 1 + - CRC: 2300770207 + Mapper: 0 + - CRC: 699530748 + Mapper: 4 + - CRC: 2447732459 + Mapper: 35 + - CRC: 3125151318 + Mapper: 148 + - CRC: 824622330 + Mapper: 0 + - CRC: 2010793697 + Mapper: 4 + - CRC: 4264776834 + Mapper: 4 + - CRC: 3770725795 + Mapper: 196 + - CRC: 3687406239 + Mapper: 55 + - CRC: 1647321339 + Mapper: 3 + - CRC: 668694204 + Mapper: 1 + - CRC: 3183361174 + Mapper: 238 + - CRC: 349641419 + Mapper: 4 + - CRC: 1981928818 + Mapper: 171 + - CRC: 1086357851 + Mapper: 0 + - CRC: 2059109333 + Mapper: 0 + - CRC: 2028222822 + Mapper: 0 + - CRC: 2223882916 + Mapper: 4 + - CRC: 4169195536 + Mapper: 25 + - CRC: 1680364971 + Mapper: 3 + - CRC: 3304662298 + Mapper: 118 + - CRC: 2814819712 + Mapper: 2 + - CRC: 1131755654 + Mapper: 27 + - CRC: 3160276456 + Mapper: 1 + - CRC: 2631209612 + Mapper: 4 + - CRC: 3799062798 + Mapper: 4 + - CRC: 394944987 + Mapper: 4 + - CRC: 4021343023 + Mapper: 4 + - CRC: 404589791 + Mapper: 4 + - CRC: 1921941252 + Mapper: 0 + - CRC: 3744175547 + Mapper: 0 + - CRC: 465171358 + Mapper: 0 + - CRC: 273820795 + Mapper: 0 + - CRC: 374849619 + Mapper: 4 + - CRC: 2584960642 + Mapper: 0 + - CRC: 2670785265 + Mapper: 4 + - CRC: 4010799057 + Mapper: 0 + - CRC: 2362035093 + Mapper: 0 + - CRC: 2059247672 + Mapper: 0 + - CRC: 3130518660 + Mapper: 0 + - CRC: 1060786334 + Mapper: 0 + - CRC: 1125801817 + Mapper: 0 + - CRC: 3487093925 + Mapper: 0 + - CRC: 2167702048 + Mapper: 4 + - CRC: 4141368763 + Mapper: 0 + - CRC: 972467736 + Mapper: 0 + - CRC: 4260773421 + Mapper: 4 + - CRC: 3029413208 + Mapper: 4 + - CRC: 2924053849 + Mapper: 0 + - CRC: 3129752405 + Mapper: 0 + - CRC: 4194880703 + Mapper: 0 + - CRC: 3566420684 + Mapper: 0 + - CRC: 3784104362 + Mapper: 0 + - CRC: 3323378389 + Mapper: 0 + - CRC: 2792479269 + Mapper: 0 + - CRC: 583339826 + Mapper: 4 + - CRC: 13066387 + Mapper: 4 + - CRC: 2095010261 + Mapper: 0 + - CRC: 1295614652 + Mapper: 0 + - CRC: 2634968274 + Mapper: 0 + - CRC: 2795113218 + Mapper: 0 + - CRC: 4161489351 + Mapper: 0 + - CRC: 2761065481 + Mapper: 87 + - CRC: 2490320073 + Mapper: 4 + - CRC: 1189726925 + Mapper: 0 + - CRC: 4016857004 + Mapper: 0 + - CRC: 1046043602 + Mapper: 0 + - CRC: 2891716672 + Mapper: 34 + - CRC: 3139143978 + Mapper: 0 + - CRC: 2406871984 + Mapper: 0 + - CRC: 2031400674 + Mapper: 4 + - CRC: 2050794935 + Mapper: 0 + - CRC: 2919307699 + Mapper: 0 + - CRC: 1455198439 + Mapper: 0 + - CRC: 304878611 + Mapper: 30 + - CRC: 1744301913 + Mapper: 30 + - CRC: 4178655295 + Mapper: 4 + - CRC: 3091215783 + Mapper: 0 + - CRC: 2202176088 + Mapper: 0 + - CRC: 3227162411 + Mapper: 0 + - CRC: 2238795104 + Mapper: 0 + - CRC: 1978135557 + Mapper: 0 + - CRC: 1081821946 + Mapper: 3 + - CRC: 3193576791 + Mapper: 113 + - CRC: 2072649775 + Mapper: 113 + - CRC: 178391488 + Mapper: 2 + - CRC: 1759082550 + Mapper: 2 + - CRC: 671517142 + Mapper: 2 + - CRC: 864772403 + Mapper: 2 + - CRC: 535790041 + Mapper: 2 + - CRC: 542749347 + Mapper: 2 + - CRC: 212709890 + Mapper: 2 + - CRC: 21372031 + Mapper: 2 + - CRC: 2670432642 + Mapper: 0 + - CRC: 4213220477 + Mapper: 1 + - CRC: 3826393304 + Mapper: 30 + - CRC: 2945780412 + Mapper: 0 + - CRC: 3880157095 + Mapper: 0 + - CRC: 195064699 + Mapper: 30 + - CRC: 1630039383 + Mapper: 1 + - CRC: 1077082636 + Mapper: 1 + - CRC: 240748886 + Mapper: 0 + - CRC: 378006407 + Mapper: 0 + - CRC: 1605502506 + Mapper: 3 + - CRC: 1526085540 + Mapper: 0 + - CRC: 2901209709 + Mapper: 0 + - CRC: 308405668 + Mapper: 0 + - CRC: 1421879091 + Mapper: 0 + - CRC: 2036853132 + Mapper: 0 + - CRC: 4133831354 + Mapper: 0 + - CRC: 2608796827 + Mapper: 180 + - CRC: 2932354954 + Mapper: 1 + - CRC: 1054006546 + Mapper: 0 + - CRC: 2837336678 + Mapper: 0 + - CRC: 1472627349 + Mapper: 30 + - CRC: 1277477749 + Mapper: 2 + - CRC: 1066738924 + Mapper: 4 + - CRC: 844906066 + Mapper: 4 + - CRC: 1378804239 + Mapper: 0 + - CRC: 889599249 + Mapper: 0 + - CRC: 1836054574 + Mapper: 0 + - CRC: 864263104 + Mapper: 0 + - CRC: 3936689413 + Mapper: 0 + - CRC: 3800194643 + Mapper: 0 + - CRC: 3676787249 + Mapper: 0 + - CRC: 1889880159 + Mapper: 4 + - CRC: 3159825575 + Mapper: 4 + - CRC: 1310791908 + Mapper: 0 + - CRC: 1845173143 + Mapper: 0 + - CRC: 1820388979 + Mapper: 0 + - CRC: 969041696 + Mapper: 0 + - CRC: 245752826 + Mapper: 0 + - CRC: 4123593388 + Mapper: 1 + - CRC: 3818835796 + Mapper: 4 + - CRC: 1981197707 + Mapper: 0 + - CRC: 657068131 + Mapper: 3 + - CRC: 3905239173 + Mapper: 2 + - CRC: 3739771678 + Mapper: 2 + - CRC: 3637746213 + Mapper: 69 + - CRC: 2493050102 + Mapper: 0 + - CRC: 720176726 + Mapper: 0 + - CRC: 245722797 + Mapper: 0 + - CRC: 918774010 + Mapper: 30 + - CRC: 4290794919 + Mapper: 0 + - CRC: 1678004068 + Mapper: 3 + - CRC: 1135404452 + Mapper: 0 + - CRC: 857459847 + Mapper: 0 + - CRC: 1756032317 + Mapper: 0 + - CRC: 2146404937 + Mapper: 0 + - CRC: 4177153778 + Mapper: 2 + - CRC: 3124309410 + Mapper: 2 + - CRC: 2514652528 + Mapper: 113 + - CRC: 4216160174 + Mapper: 113 + - CRC: 818411305 + Mapper: 0 + - CRC: 3963971628 + Mapper: 0 + - CRC: 803820954 + Mapper: 30 + - CRC: 1412721471 + Mapper: 4 + - CRC: 2644516419 + Mapper: 0 + - CRC: 3755059104 + Mapper: 0 + - CRC: 443907094 + Mapper: 0 + - CRC: 2344891702 + Mapper: 0 + - CRC: 1213011103 + Mapper: 0 + - CRC: 1108650884 + Mapper: 0 + - CRC: 896359090 + Mapper: 0 + - CRC: 3639244402 + Mapper: 0 + - CRC: 4019739108 + Mapper: 4 + - CRC: 2071817408 + Mapper: 45 + - CRC: 121833205 + Mapper: 0 + - CRC: 956421223 + Mapper: 0 + - CRC: 2340257834 + Mapper: 30 + - CRC: 4121325847 + Mapper: 0 + - CRC: 1760512297 + Mapper: 30 + - CRC: 2050846724 + Mapper: 4 + - CRC: 3762442652 + Mapper: 4 + - CRC: 2629690889 + Mapper: 2 + - CRC: 2853704949 + Mapper: 4 + - CRC: 1093816212 + Mapper: 0 + - CRC: 34785796 + Mapper: 4 + - CRC: 993317476 + Mapper: 4 + - CRC: 2698671952 + Mapper: 4 + - CRC: 99141112 + Mapper: 30 + - CRC: 2197619204 + Mapper: 0 + - CRC: 101214081 + Mapper: 1 + - CRC: 2581096443 + Mapper: 24 + - CRC: 4192067327 + Mapper: 30 + - CRC: 3807771642 + Mapper: 0 + - CRC: 3900614236 + Mapper: 0 + - CRC: 1966572441 + Mapper: 4 + - CRC: 296263896 + Mapper: 30 + - CRC: 3865302901 + Mapper: 30 + - CRC: 3957578932 + Mapper: 1 + - CRC: 3253643089 + Mapper: 1 + - CRC: 529400835 + Mapper: 24 + - CRC: 1194039092 + Mapper: 2 + - CRC: 3876360435 + Mapper: 0 + - CRC: 3409742339 + Mapper: 30 + - CRC: 2237849537 + Mapper: 0 + - CRC: 1928793123 + Mapper: 0 + - CRC: 2515306007 + Mapper: 0 + - CRC: 793790808 + Mapper: 0 + - CRC: 3287795210 + Mapper: 0 + - CRC: 3232206257 + Mapper: 0 + - CRC: 2537422553 + Mapper: 3 + - CRC: 2596685044 + Mapper: 1 + - CRC: 4189874925 + Mapper: 0 + - CRC: 2660157996 + Mapper: 30 + - CRC: 1026452091 + Mapper: 0 + - CRC: 942892113 + Mapper: 3 + - CRC: 2331673288 + Mapper: 3 + - CRC: 3093528208 + Mapper: 0 + - CRC: 615514166 + Mapper: 0 + - CRC: 2745650127 + Mapper: 0 + - CRC: 4177918156 + Mapper: 0 + - CRC: 3332357151 + Mapper: 3 + - CRC: 2775888564 + Mapper: 3 + - CRC: 1220077004 + Mapper: 0 + - CRC: 1857024989 + Mapper: 2 + - CRC: 3162426296 + Mapper: 0 + - CRC: 3506167890 + Mapper: 0 + - CRC: 3170752478 + Mapper: 0 + - CRC: 3959210487 + Mapper: 0 + - CRC: 482169110 + Mapper: 0 + - CRC: 1137698475 + Mapper: 0 + - CRC: 4292733566 + Mapper: 2 + - CRC: 1152000057 + Mapper: 28 + - CRC: 3713082887 + Mapper: 0 + - CRC: 357552766 + Mapper: 30 + - CRC: 4278402498 + Mapper: 0 + - CRC: 1414418354 + Mapper: 0 + - CRC: 3017349042 + Mapper: 0 + - CRC: 2399493803 + Mapper: 0 + - CRC: 1163993260 + Mapper: 0 + - CRC: 2474980340 + Mapper: 0 + - CRC: 1814368562 + Mapper: 0 + - CRC: 742437019 + Mapper: 1 + - CRC: 3933970601 + Mapper: 0 + - CRC: 3082569635 + Mapper: 0 + - CRC: 1980610265 + Mapper: 0 + - CRC: 2823647730 + Mapper: 0 + - CRC: 713424975 + Mapper: 0 + - CRC: 1707270698 + Mapper: 0 + - CRC: 1362607186 + Mapper: 24 + - CRC: 1562736460 + Mapper: 0 + - CRC: 1916387143 + Mapper: 0 + - CRC: 3064987640 + Mapper: 0 + - CRC: 3829386352 + Mapper: 0 + - CRC: 3127682378 + Mapper: 4 + - CRC: 1448785278 + Mapper: 4 + - CRC: 213603597 + Mapper: 0 + - CRC: 1019864666 + Mapper: 0 + - CRC: 3062611680 + Mapper: 3 + - CRC: 1512196304 + Mapper: 0 + - CRC: 2929286657 + Mapper: 30 + - CRC: 3553483130 + Mapper: 0 + - CRC: 2959762815 + Mapper: 0 + - CRC: 2861798273 + Mapper: 0 + - CRC: 2564164850 + Mapper: 29 + - CRC: 3953338972 + Mapper: 29 + - CRC: 2554999519 + Mapper: 29 + - CRC: 2454396038 + Mapper: 0 + - CRC: 3741440542 + Mapper: 2 + - CRC: 1580776443 + Mapper: 0 + - CRC: 3958382181 + Mapper: 4 + - CRC: 2318116758 + Mapper: 0 + - CRC: 2126678463 + Mapper: 0 + - CRC: 1286374209 + Mapper: 2 + - CRC: 2679699522 + Mapper: 2 + - CRC: 3437960419 + Mapper: 2 + - CRC: 4108217540 + Mapper: 2 + - CRC: 1287972830 + Mapper: 2 + - CRC: 3386146239 + Mapper: 0 + - CRC: 139559997 + Mapper: 0 + - CRC: 3969629201 + Mapper: 25 + - CRC: 2038530662 + Mapper: 0 + - CRC: 4040752260 + Mapper: 30 + - CRC: 1381187414 + Mapper: 30 + - CRC: 2005827646 + Mapper: 30 + - CRC: 2248718143 + Mapper: 0 + - CRC: 1495476714 + Mapper: 0 + - CRC: 749233411 + Mapper: 2 + - CRC: 116640276 + Mapper: 0 + - CRC: 3047376410 + Mapper: 4 + - CRC: 767539254 + Mapper: 3 + - CRC: 3715827381 + Mapper: 3 + - CRC: 2717416896 + Mapper: 0 + - CRC: 3050930233 + Mapper: 0 + - CRC: 334033482 + Mapper: 0 + - CRC: 2695768621 + Mapper: 2 + - CRC: 4194988229 + Mapper: 3 + - CRC: 687879814 + Mapper: 3 + - CRC: 1261215976 + Mapper: 0 + - CRC: 687551095 + Mapper: 30 + - CRC: 3225129079 + Mapper: 66 + - CRC: 3884460551 + Mapper: 1 + - CRC: 3713106529 + Mapper: 0 + - CRC: 2429741552 + Mapper: 0 + - CRC: 1822087653 + Mapper: 0 + - CRC: 3247593012 + Mapper: 0 + - CRC: 2684508833 + Mapper: 0 + - CRC: 1399738880 + Mapper: 0 + - CRC: 3330796686 + Mapper: 2 + - CRC: 4127052015 + Mapper: 30 + - CRC: 2779919473 + Mapper: 30 + - CRC: 3280526804 + Mapper: 0 + - CRC: 406041649 + Mapper: 2 + - CRC: 4251726255 + Mapper: 66 + - CRC: 1599444791 + Mapper: 0 + - CRC: 3563797549 + Mapper: 0 + - CRC: 1019521852 + Mapper: 0 + - CRC: 1277052080 + Mapper: 0 + - CRC: 468827054 + Mapper: 30 + - CRC: 2846786414 + Mapper: 0 + - CRC: 3571757396 + Mapper: 0 + - CRC: 2093714718 + Mapper: 0 + - CRC: 155671545 + Mapper: 0 + - CRC: 1486442219 + Mapper: 0 + - CRC: 368790914 + Mapper: 0 + - CRC: 4209185416 + Mapper: 0 + - CRC: 3545067059 + Mapper: 0 + - CRC: 1592044028 + Mapper: 218 + - CRC: 2755153034 + Mapper: 218 + - CRC: 2041703369 + Mapper: 0 + - CRC: 3395645932 + Mapper: 0 + - CRC: 130648757 + Mapper: 0 + - CRC: 2982765736 + Mapper: 4 + - CRC: 973091233 + Mapper: 0 + - CRC: 275055161 + Mapper: 0 + - CRC: 3202272279 + Mapper: 0 + - CRC: 3137551164 + Mapper: 30 + - CRC: 2456307873 + Mapper: 0 + - CRC: 3875200063 + Mapper: 0 + - CRC: 1855589328 + Mapper: 0 + - CRC: 609078061 + Mapper: 2 + - CRC: 1816332439 + Mapper: 2 + - CRC: 3670303638 + Mapper: 2 + - CRC: 1963835528 + Mapper: 2 + - CRC: 2142488032 + Mapper: 2 + - CRC: 565873894 + Mapper: 0 + - CRC: 3130442352 + Mapper: 3 + - CRC: 3425782006 + Mapper: 2 + - CRC: 3770296808 + Mapper: 0 + - CRC: 4188356210 + Mapper: 0 + - CRC: 871911097 + Mapper: 1 + - CRC: 1557058796 + Mapper: 11 + - CRC: 1910523972 + Mapper: 30 + - CRC: 35220030 + Mapper: 30 + - CRC: 4205645962 + Mapper: 0 + - CRC: 3038142434 + Mapper: 0 + - CRC: 3736214686 + Mapper: 0 + - CRC: 1286550010 + Mapper: 1 + - CRC: 544692001 + Mapper: 30 + - CRC: 2074007260 + Mapper: 0 + - CRC: 3566749034 + Mapper: 0 + - CRC: 296535066 + Mapper: 0 + - CRC: 1747892308 + Mapper: 0 + - CRC: 1186878179 + Mapper: 0 + - CRC: 3820981990 + Mapper: 30 + - CRC: 3952598236 + Mapper: 0 + - CRC: 3996239144 + Mapper: 0 + - CRC: 1748436088 + Mapper: 30 + - CRC: 1162427693 + Mapper: 30 + - CRC: 831261273 + Mapper: 30 + - CRC: 2839095110 + Mapper: 28 + - CRC: 3208804340 + Mapper: 1 + - CRC: 4021530647 + Mapper: 4 + - CRC: 2243341807 + Mapper: 30 + - CRC: 185353587 + Mapper: 0 + - CRC: 206868119 + Mapper: 0 + - CRC: 4230986192 + Mapper: 0 + - CRC: 3688299489 + Mapper: 0 + - CRC: 29073202 + Mapper: 111 + - CRC: 635592791 + Mapper: 4 + - CRC: 782949656 + Mapper: 0 + - CRC: 1052874085 + Mapper: 0 + - CRC: 2066136740 + Mapper: 0 + - CRC: 1654563888 + Mapper: 0 + - CRC: 2519811618 + Mapper: 0 + - CRC: 4103739478 + Mapper: 0 + - CRC: 243843352 + Mapper: 0 + - CRC: 1300955647 + Mapper: 30 + - CRC: 125533672 + Mapper: 0 + - CRC: 2604684105 + Mapper: 3 + - CRC: 553432292 + Mapper: 0 + - CRC: 3676495064 + Mapper: 0 + - CRC: 1097788086 + Mapper: 0 + - CRC: 225944228 + Mapper: 0 + - CRC: 1597919249 + Mapper: 0 + - CRC: 2090348113 + Mapper: 30 + - CRC: 1863538511 + Mapper: 30 + - CRC: 3611257204 + Mapper: 1 + - CRC: 1676564984 + Mapper: 1 + - CRC: 1535984504 + Mapper: 34 + - CRC: 4202224631 + Mapper: 0 + - CRC: 2490789452 + Mapper: 2 + - CRC: 2981050538 + Mapper: 1 + - CRC: 1425746665 + Mapper: 1 + - CRC: 1728562810 + Mapper: 0 + - CRC: 822081259 + Mapper: 30 + - CRC: 1203561689 + Mapper: 0 + - CRC: 192279803 + Mapper: 0 + - CRC: 260536972 + Mapper: 0 + - CRC: 625787286 + Mapper: 0 + - CRC: 3245578531 + Mapper: 0 + - CRC: 3620568718 + Mapper: 2 + - CRC: 925973067 + Mapper: 0 + - CRC: 2439314990 + Mapper: 0 + - CRC: 2586914892 + Mapper: 0 + - CRC: 763451680 + Mapper: 0 + - CRC: 3468944773 + Mapper: 0 + - CRC: 2344483606 + Mapper: 1 + - CRC: 1576381271 + Mapper: 1 + - CRC: 1367647008 + Mapper: 1 + - CRC: 1072710800 + Mapper: 1 + - CRC: 1612403873 + Mapper: 30 + - CRC: 3649981404 + Mapper: 30 + - CRC: 3632921257 + Mapper: 0 + - CRC: 2588661057 + Mapper: 1 + - CRC: 3966500344 + Mapper: 0 + - CRC: 3556584386 + Mapper: 0 + - CRC: 443594654 + Mapper: 0 + - CRC: 2134781300 + Mapper: 0 + - CRC: 1996353579 + Mapper: 0 + - CRC: 3204730226 + Mapper: 0 + - CRC: 915472092 + Mapper: 0 + - CRC: 225515819 + Mapper: 30 + - CRC: 1262369836 + Mapper: 30 + - CRC: 861105797 + Mapper: 0 + - CRC: 947729416 + Mapper: 2 + - CRC: 3528607273 + Mapper: 0 + - CRC: 2631703293 + Mapper: 4 + - CRC: 2014670396 + Mapper: 30 + - CRC: 605636666 + Mapper: 0 + - CRC: 1999061811 + Mapper: 0 + - CRC: 1471343151 + Mapper: 3 + - CRC: 3011114253 + Mapper: 3 + - CRC: 2834108416 + Mapper: 3 + - CRC: 4268954263 + Mapper: 0 + - CRC: 126566030 + Mapper: 0 + - CRC: 1426973593 + Mapper: 0 + - CRC: 4013000706 + Mapper: 0 + - CRC: 3840439495 + Mapper: 3 + - CRC: 1512708621 + Mapper: 0 + - CRC: 2547528550 + Mapper: 0 + - CRC: 4184400786 + Mapper: 2 + - CRC: 3362776873 + Mapper: 0 + - CRC: 3122393041 + Mapper: 0 + - CRC: 3297053648 + Mapper: 30 + - CRC: 331525107 + Mapper: 1 + - CRC: 356702107 + Mapper: 0 + - CRC: 3337998528 + Mapper: 0 + - CRC: 2883456967 + Mapper: 0 + - CRC: 921953786 + Mapper: 0 + - CRC: 524050874 + Mapper: 0 + - CRC: 238785681 + Mapper: 3 + - CRC: 3517632757 + Mapper: 0 + - CRC: 3104593598 + Mapper: 0 + - CRC: 4141830609 + Mapper: 30 + - CRC: 536103387 + Mapper: 0 + - CRC: 1301373449 + Mapper: 30 + - CRC: 2259212939 + Mapper: 0 + - CRC: 1690472767 + Mapper: 0 + - CRC: 1756867314 + Mapper: 0 + - CRC: 1063610338 + Mapper: 0 + - CRC: 3001449119 + Mapper: 0 + - CRC: 1704701031 + Mapper: 0 + - CRC: 784460078 + Mapper: 3 + - CRC: 1024024007 + Mapper: 30 + - CRC: 1277929084 + Mapper: 0 + - CRC: 2681838368 + Mapper: 6 + - CRC: 3006386024 + Mapper: 0 + - CRC: 242135584 + Mapper: 2 + - CRC: 2599028299 + Mapper: 0 + - CRC: 1587863529 + Mapper: 0 + - CRC: 3229082438 + Mapper: 0 + - CRC: 27159676 + Mapper: 0 + - CRC: 924063760 + Mapper: 2 + - CRC: 1223875829 + Mapper: 0 + - CRC: 480695490 + Mapper: 0 + - CRC: 3595043158 + Mapper: 218 + - CRC: 3021976525 + Mapper: 30 + - CRC: 236272775 + Mapper: 0 + - CRC: 905744641 + Mapper: 30 + - CRC: 3999509706 + Mapper: 0 + - CRC: 4068290485 + Mapper: 1 + - CRC: 727273900 + Mapper: 30 + - CRC: 3956229566 + Mapper: 2 + - CRC: 3811864943 + Mapper: 0 + - CRC: 3654031418 + Mapper: 30 + - CRC: 877062887 + Mapper: 34 + - CRC: 659533374 + Mapper: 34 + - CRC: 2658504890 + Mapper: 34 + - CRC: 2254040531 + Mapper: 111 + - CRC: 2501570753 + Mapper: 2 + - CRC: 1320647780 + Mapper: 7 + - CRC: 3124373676 + Mapper: 0 + - CRC: 328523472 + Mapper: 2 + - CRC: 1540122576 + Mapper: 2 + - CRC: 706747636 + Mapper: 0 + - CRC: 3854403218 + Mapper: 30 + - CRC: 464577493 + Mapper: 0 + - CRC: 1700931218 + Mapper: 0 + - CRC: 1824950256 + Mapper: 0 + - CRC: 2585163849 + Mapper: 0 + - CRC: 1210951488 + Mapper: 0 + - CRC: 200482264 + Mapper: 0 + - CRC: 2978316091 + Mapper: 3 + - CRC: 1833766365 + Mapper: 0 + - CRC: 1255011680 + Mapper: 0 + - CRC: 1565305931 + Mapper: 4 + - CRC: 4189668559 + Mapper: 30 + - CRC: 2632136525 + Mapper: 3 + - CRC: 2403214841 + Mapper: 7 + - CRC: 2753093277 + Mapper: 2 + - CRC: 1052446317 + Mapper: 2 + - CRC: 2855201663 + Mapper: 0 + - CRC: 807183803 + Mapper: 2 + - CRC: 4025740469 + Mapper: 0 + - CRC: 2457888895 + Mapper: 2 + - CRC: 1148696838 + Mapper: 0 + - CRC: 2541140720 + Mapper: 2 + - CRC: 3616288806 + Mapper: 0 + - CRC: 2651775965 + Mapper: 30 + - CRC: 2424913136 + Mapper: 0 + - CRC: 2121599802 + Mapper: 0 + - CRC: 3838016004 + Mapper: 0 + - CRC: 4110432319 + Mapper: 2 + - CRC: 1610838169 + Mapper: 4 + - CRC: 3042435884 + Mapper: 30 + - CRC: 780596418 + Mapper: 30 + - CRC: 1930326188 + Mapper: 0 + - CRC: 284319239 + Mapper: 3 + - CRC: 821554488 + Mapper: 0 + - CRC: 1324527007 + Mapper: 0 + - CRC: 4158158445 + Mapper: 0 + - CRC: 3774841521 + Mapper: 0 + - CRC: 249244272 + Mapper: 0 + - CRC: 2210983415 + Mapper: 0 + - CRC: 1640139870 + Mapper: 1 + - CRC: 2075449649 + Mapper: 30 + - CRC: 484958864 + Mapper: 30 + - CRC: 2877150952 + Mapper: 0 + - CRC: 4054148724 + Mapper: 45 + - CRC: 856647736 + Mapper: 30 + - CRC: 487194453 + Mapper: 28 + - CRC: 2628846768 + Mapper: 0 + - CRC: 1609049174 + Mapper: 3 + - CRC: 1304124587 + Mapper: 30 + - CRC: 264753662 + Mapper: 30 + - CRC: 439497975 + Mapper: 30 + - CRC: 131999520 + Mapper: 0 + - CRC: 1435466364 + Mapper: 4 + - CRC: 4157547771 + Mapper: 4 + - CRC: 1366216982 + Mapper: 0 + - CRC: 3813569039 + Mapper: 30 + - CRC: 4178269235 + Mapper: 30 + - CRC: 1741294505 + Mapper: 30 + - CRC: 1065874772 + Mapper: 2 + - CRC: 993270684 + Mapper: 4 + - CRC: 3132755348 + Mapper: 0 + - CRC: 378968059 + Mapper: 0 + - CRC: 3141888506 + Mapper: 2 + - CRC: 3460445538 + Mapper: 30 + - CRC: 1362102816 + Mapper: 30 + - CRC: 751871141 + Mapper: 30 + - CRC: 2899400564 + Mapper: 2 + - CRC: 2604342516 + Mapper: 0 + - CRC: 2349544236 + Mapper: 1 + - CRC: 1635063865 + Mapper: 30 + - CRC: 3699864882 + Mapper: 30 + - CRC: 1835109853 + Mapper: 2 + - CRC: 2938684252 + Mapper: 2 + - CRC: 1283894548 + Mapper: 2 + - CRC: 2373762884 + Mapper: 4 + - CRC: 2904404190 + Mapper: 0 + - CRC: 959613866 + Mapper: 0 + - CRC: 3516260316 + Mapper: 0 + - CRC: 3710981595 + Mapper: 0 + - CRC: 1006954735 + Mapper: 2 + - CRC: 1789155148 + Mapper: 0 + - CRC: 3095946988 + Mapper: 4 + - CRC: 412797458 + Mapper: 3 + - CRC: 525901297 + Mapper: 0 + - CRC: 2534501698 + Mapper: 0 + - CRC: 3749986803 + Mapper: 0 + - CRC: 2068045327 + Mapper: 113 + - CRC: 655840832 + Mapper: 113 + - CRC: 1979369546 + Mapper: 4 + - CRC: 712155217 + Mapper: 4 + - CRC: 1969473723 + Mapper: 45 + - CRC: 2640734900 + Mapper: 176 + - CRC: 105809472 + Mapper: 45 + - CRC: 3572419134 + Mapper: 45 + - CRC: 2787944601 + Mapper: 176 + - CRC: 2721292593 + Mapper: 176 + - CRC: 3041985453 + Mapper: 176 + - CRC: 3203074823 + Mapper: 176 + - CRC: 3943160082 + Mapper: 45 + - CRC: 2244083009 + Mapper: 45 + - CRC: 355047522 + Mapper: 45 + - CRC: 4077772001 + Mapper: 45 + - CRC: 1294312358 + Mapper: 176 + - CRC: 1509735494 + Mapper: 176 + - CRC: 3654686812 + Mapper: 176 + - CRC: 417174460 + Mapper: 176 + - CRC: 2577733226 + Mapper: 134 + - CRC: 3534006726 + Mapper: 176 + - CRC: 2163335454 + Mapper: 176 + - CRC: 1575005655 + Mapper: 176 + - CRC: 2287522807 + Mapper: 176 + - CRC: 4223981373 + Mapper: 205 + - CRC: 79154189 + Mapper: 1 + - CRC: 3457669067 + Mapper: 4 + - CRC: 1180739386 + Mapper: 4 + - CRC: 2356358912 + Mapper: 90 + - CRC: 89537333 + Mapper: 4 + - CRC: 3460759642 + Mapper: 4 + - CRC: 776207015 + Mapper: 7 + - CRC: 2532418615 + Mapper: 71 + - CRC: 1883273805 + Mapper: 215 + - CRC: 3674392566 + Mapper: 4 + - CRC: 896653183 + Mapper: 228 + - CRC: 1139741592 + Mapper: 228 + - CRC: 860776876 + Mapper: 4 + - CRC: 1296523415 + Mapper: 24 + - CRC: 3620444103 + Mapper: 2 + - CRC: 2487698826 + Mapper: 3 + - CRC: 291234304 + Mapper: 90 + - CRC: 2552553965 + Mapper: 4 + - CRC: 3138236913 + Mapper: 25 + - CRC: 1728876554 + Mapper: 7 + - CRC: 1066158335 + Mapper: 7 + - CRC: 1070173311 + Mapper: 2 + - CRC: 376185880 + Mapper: 23 + - CRC: 3819032141 + Mapper: 23 + - CRC: 3949603286 + Mapper: 23 + - CRC: 961202098 + Mapper: 23 + - CRC: 3343413693 + Mapper: 23 + - CRC: 2818096072 + Mapper: 1 + - CRC: 282721091 + Mapper: 45 + - CRC: 2000495865 + Mapper: 1 + - CRC: 1885631588 + Mapper: 1 + - CRC: 2267812914 + Mapper: 90 + - CRC: 2279391120 + Mapper: 73 + - CRC: 4142300084 + Mapper: 159 + - CRC: 3847769503 + Mapper: 5 + - CRC: 604187737 + Mapper: 4 + - CRC: 1785356544 + Mapper: 3 + - CRC: 4243435802 + Mapper: 4 + - CRC: 3832394636 + Mapper: 4 + - CRC: 3346690431 + Mapper: 4 + - CRC: 2724726324 + Mapper: 0 + - CRC: 2932836137 + Mapper: 4 + - CRC: 1419272139 + Mapper: 90 + - CRC: 2758069129 + Mapper: 3 + - CRC: 628666335 + Mapper: 1 + - CRC: 1016233268 + Mapper: 4 + - CRC: 4257550003 + Mapper: 4 + - CRC: 2885643220 + Mapper: 4 + - CRC: 2997000491 + Mapper: 219 + - CRC: 522248046 + Mapper: 4 + - CRC: 2614107607 + Mapper: 1 + - CRC: 3778779897 + Mapper: 45 + - CRC: 3697417681 + Mapper: 0 + - CRC: 3588760127 + Mapper: 75 + - CRC: 1393331660 + Mapper: 176 + - CRC: 1894210766 + Mapper: 121 + - CRC: 973228842 + Mapper: 2 + - CRC: 370187152 + Mapper: 90 + - CRC: 2894197833 + Mapper: 164 + - CRC: 3763287071 + Mapper: 4 + - CRC: 3136706482 + Mapper: 4 + - CRC: 230910628 + Mapper: 4 + - CRC: 3278185257 + Mapper: 0 + - CRC: 119536840 + Mapper: 164 + - CRC: 2554527338 + Mapper: 164 + - CRC: 542866273 + Mapper: 227 + - CRC: 3967557744 + Mapper: 0 + - CRC: 2244613191 + Mapper: 1 + - CRC: 2129005588 + Mapper: 3 + - CRC: 2827436408 + Mapper: 141 + - CRC: 540579898 + Mapper: 11 + - CRC: 410181391 + Mapper: 141 + - CRC: 4270652450 + Mapper: 0 + - CRC: 3396032827 + Mapper: 81 + - CRC: 182409675 + Mapper: 141 + - CRC: 1000657595 + Mapper: 79 + - CRC: 861823801 + Mapper: 23 + - CRC: 445478523 + Mapper: 23 + - CRC: 1588252297 + Mapper: 0 + - CRC: 690145900 + Mapper: 4 + - CRC: 1740743293 + Mapper: 23 + - CRC: 1748698429 + Mapper: 4 + - CRC: 1889564644 + Mapper: 4 + - CRC: 915159702 + Mapper: 4 + - CRC: 3917426525 + Mapper: 0 + - CRC: 3035613388 + Mapper: 0 + - CRC: 2403495083 + Mapper: 0 + - CRC: 2231302389 + Mapper: 0 + - CRC: 3008556101 + Mapper: 0 + - CRC: 1512463553 + Mapper: 5 + - CRC: 3929656591 + Mapper: 0 + - CRC: 1007452157 + Mapper: 0 + - CRC: 3187260059 + Mapper: 3 + - CRC: 1890886711 + Mapper: 4 + - CRC: 534641483 + Mapper: 0 + - CRC: 2960240852 + Mapper: 0 + - CRC: 4157115445 + Mapper: 0 + - CRC: 2091341930 + Mapper: 1 + - CRC: 2223016 + Mapper: 0 + - CRC: 3376410612 + Mapper: 0 + - CRC: 687607671 + Mapper: 0 + - CRC: 3397518532 + Mapper: 2 + - CRC: 3715869954 + Mapper: 0 + - CRC: 710087382 + Mapper: 0 + - CRC: 690736673 + Mapper: 0 + - CRC: 3897869189 + Mapper: 0 + - CRC: 3373639583 + Mapper: 0 + - CRC: 4292579705 + Mapper: 4 + - CRC: 3233467863 + Mapper: 0 + - CRC: 3969121831 + Mapper: 0 + - CRC: 3261227766 + Mapper: 0 + - CRC: 1197231691 + Mapper: 0 + - CRC: 3265735622 + Mapper: 111 + - CRC: 373567777 + Mapper: 111 + - CRC: 2571315285 + Mapper: 0 + - CRC: 248675896 + Mapper: 0 + - CRC: 1695844543 + Mapper: 0 + - CRC: 3175802899 + Mapper: 0 + - CRC: 817375169 + Mapper: 1 + - CRC: 410526186 + Mapper: 4 + - CRC: 3628781932 + Mapper: 4 + - CRC: 2518847502 + Mapper: 0 + - CRC: 4029479015 + Mapper: 0 + - CRC: 3407359872 + Mapper: 0 + - CRC: 1935200851 + Mapper: 218 + - CRC: 1016264790 + Mapper: 218 + - CRC: 3809981194 + Mapper: 0 + - CRC: 2047774772 + Mapper: 0 + - CRC: 2957804033 + Mapper: 4 + - CRC: 2576418727 + Mapper: 4 + - CRC: 1790152187 + Mapper: 0 + - CRC: 70753891 + Mapper: 4 + - CRC: 2750178626 + Mapper: 0 + - CRC: 979413410 + Mapper: 4 + - CRC: 3989327347 + Mapper: 24 + - CRC: 2249009631 + Mapper: 1 + - CRC: 989217974 + Mapper: 7 + - CRC: 3388686020 + Mapper: 0 + - CRC: 1218295918 + Mapper: 0 + - CRC: 3429186766 + Mapper: 5 + - CRC: 3964721796 + Mapper: 0 + - CRC: 167846364 + Mapper: 4 + - CRC: 3769304792 + Mapper: 0 + - CRC: 2030322298 + Mapper: 0 + - CRC: 366871883 + Mapper: 0 + - CRC: 852563785 + Mapper: 3 + - CRC: 2216551817 + Mapper: 0 + - CRC: 2706770411 + Mapper: 0 + - CRC: 1516088341 + Mapper: 0 + - CRC: 425128652 + Mapper: 0 + - CRC: 3817894710 + Mapper: 0 + - CRC: 4044085301 + Mapper: 0 + - CRC: 888752780 + Mapper: 4 + - CRC: 1012655673 + Mapper: 2 + - CRC: 22118947 + Mapper: 0 + - CRC: 1774300031 + Mapper: 0 + - CRC: 2831571437 + Mapper: 0 + - CRC: 2173042640 + Mapper: 1 + - CRC: 377208641 + Mapper: 0 + - CRC: 1376137669 + Mapper: 0 + - CRC: 4064872285 + Mapper: 4 + - CRC: 2758257478 + Mapper: 0 + - CRC: 3731505145 + Mapper: 4 + - CRC: 2334397480 + Mapper: 0 + - CRC: 4053601192 + Mapper: 0 + - CRC: 4245402472 + Mapper: 4 + - CRC: 1524339828 + Mapper: 24 + - CRC: 46277132 + Mapper: 0 + - CRC: 1376031902 + Mapper: 4 + - CRC: 3614021435 + Mapper: 1 + - CRC: 2452956079 + Mapper: 0 + - CRC: 3949163849 + Mapper: 4 + - CRC: 3475387965 + Mapper: 1 + - CRC: 1516416969 + Mapper: 0 + - CRC: 2559244785 + Mapper: 1 + - CRC: 2378985319 + Mapper: 0 + - CRC: 3950341575 + Mapper: 0 + - CRC: 3782774834 + Mapper: 0 + - CRC: 315750536 + Mapper: 0 + - CRC: 3455220604 + Mapper: 3 + - CRC: 3564201186 + Mapper: 4 + - CRC: 2842186262 + Mapper: 0 + - CRC: 705466629 + Mapper: 3 + - CRC: 1269525684 + Mapper: 0 + - CRC: 559251907 + Mapper: 0 + - CRC: 4015064815 + Mapper: 0 + - CRC: 3671820943 + Mapper: 0 + - CRC: 186289776 + Mapper: 0 + - CRC: 3696084583 + Mapper: 0 + - CRC: 3482409098 + Mapper: 24 + - CRC: 1907984037 + Mapper: 24 + - CRC: 1344632273 + Mapper: 24 + - CRC: 829459506 + Mapper: 24 + - CRC: 1069483136 + Mapper: 0 + - CRC: 2320965774 + Mapper: 0 + - CRC: 864521995 + Mapper: 0 + - CRC: 1215434868 + Mapper: 0 + - CRC: 3353290005 + Mapper: 0 + - CRC: 2459406558 + Mapper: 0 + - CRC: 1463680506 + Mapper: 1 + - CRC: 2242917231 + Mapper: 0 + - CRC: 1087155867 + Mapper: 2 + - CRC: 3339217233 + Mapper: 0 + - CRC: 2425763920 + Mapper: 0 + - CRC: 676055269 + Mapper: 0 + - CRC: 4068674324 + Mapper: 2 + - CRC: 1115772379 + Mapper: 1 + - CRC: 3652297759 + Mapper: 5 + - CRC: 3804131348 + Mapper: 4 + - CRC: 4269944602 + Mapper: 4 + - CRC: 4214014305 + Mapper: 4 + - CRC: 1930753481 + Mapper: 4 + - CRC: 4244089646 + Mapper: 1 + - CRC: 3233802705 + Mapper: 4 + - CRC: 2249052303 + Mapper: 1 + - CRC: 1668625312 + Mapper: 2 + - CRC: 320759783 + Mapper: 1 + - CRC: 2362860843 + Mapper: 4 + - CRC: 1101223791 + Mapper: 1 + - CRC: 328695393 + Mapper: 4 + - CRC: 1363169552 + Mapper: 4 + - CRC: 2080162113 + Mapper: 1 + - CRC: 3345432026 + Mapper: 3 + - CRC: 1857069775 + Mapper: 1 + - CRC: 1007765986 + Mapper: 90 + - CRC: 4145633619 + Mapper: 90 + - CRC: 583750485 + Mapper: 2 + - CRC: 3146737526 + Mapper: 0 + - CRC: 634390258 + Mapper: 4 + - CRC: 1535463125 + Mapper: 0 + - CRC: 1967677807 + Mapper: 2 + - CRC: 4027000542 + Mapper: 1 + - CRC: 2497871364 + Mapper: 4 + - CRC: 3627913009 + Mapper: 0 + - CRC: 3588805208 + Mapper: 0 + - CRC: 261285460 + Mapper: 3 + - CRC: 130813593 + Mapper: 3 + - CRC: 2677144016 + Mapper: 3 + - CRC: 660907591 + Mapper: 1 + - CRC: 1637346326 + Mapper: 1 + - CRC: 726240821 + Mapper: 1 + - CRC: 995306375 + Mapper: 4 + - CRC: 3452973445 + Mapper: 3 + - CRC: 3036056177 + Mapper: 1 + - CRC: 763467425 + Mapper: 3 + - CRC: 1694365621 + Mapper: 0 + - CRC: 3508155281 + Mapper: 3 + - CRC: 3703765091 + Mapper: 0 + - CRC: 2832885687 + Mapper: 0 + - CRC: 2130428481 + Mapper: 4 + - CRC: 3771886988 + Mapper: 1 + - CRC: 2949376938 + Mapper: 4 + - CRC: 3532385919 + Mapper: 1 + - CRC: 1650303411 + Mapper: 1 + - CRC: 1110247204 + Mapper: 4 + - CRC: 2546644828 + Mapper: 4 + - CRC: 2743247596 + Mapper: 4 + - CRC: 2946912061 + Mapper: 4 + - CRC: 2481878591 + Mapper: 69 + - CRC: 831309964 + Mapper: 4 + - CRC: 2664532745 + Mapper: 4 + - CRC: 1072364933 + Mapper: 7 + - CRC: 2196040634 + Mapper: 7 + - CRC: 1549804657 + Mapper: 7 + - CRC: 2158161854 + Mapper: 0 + - CRC: 43323943 + Mapper: 3 + - CRC: 1867941354 + Mapper: 9 + - CRC: 2562383521 + Mapper: 19 + - CRC: 3992887685 + Mapper: 0 + - CRC: 2630610079 + Mapper: 1 + - CRC: 1829802767 + Mapper: 1 + - CRC: 1106717375 + Mapper: 0 + - CRC: 1329781639 + Mapper: 0 + - CRC: 1445569459 + Mapper: 4 + - CRC: 2414390726 + Mapper: 0 + - CRC: 2136726955 + Mapper: 0 + - CRC: 1567562084 + Mapper: 0 + - CRC: 3473942885 + Mapper: 0 + - CRC: 2221695277 + Mapper: 1 + - CRC: 3255251713 + Mapper: 7 + - CRC: 4162805513 + Mapper: 0 + - CRC: 3889608472 + Mapper: 0 + - CRC: 2782717793 + Mapper: 4 + - CRC: 1342453647 + Mapper: 1 + - CRC: 4161277605 + Mapper: 0 + - CRC: 2896595640 + Mapper: 0 + - CRC: 2689863459 + Mapper: 3 + - CRC: 3198083564 + Mapper: 0 + - CRC: 2398397081 + Mapper: 4 + - CRC: 373309962 + Mapper: 4 + - CRC: 2251825291 + Mapper: 4 + - CRC: 1203198157 + Mapper: 4 + - CRC: 163272282 + Mapper: 4 + - CRC: 1798311151 + Mapper: 4 + - CRC: 2236829417 + Mapper: 4 + - CRC: 4167475658 + Mapper: 0 + - CRC: 3328983707 + Mapper: 211 + - CRC: 535094858 + Mapper: 1 + - CRC: 348872734 + Mapper: 1 + - CRC: 1246465823 + Mapper: 1 + - CRC: 3494311732 + Mapper: 1 + - CRC: 3897016180 + Mapper: 1 + - CRC: 351465792 + Mapper: 1 + - CRC: 1201205664 + Mapper: 1 + - CRC: 2955970466 + Mapper: 1 + - CRC: 2291296799 + Mapper: 1 + - CRC: 1381024095 + Mapper: 1 + - CRC: 1060360780 + Mapper: 1 + - CRC: 918699676 + Mapper: 66 + - CRC: 2990649553 + Mapper: 66 + - CRC: 3108777128 + Mapper: 210 + - CRC: 1151140974 + Mapper: 4 + - CRC: 109746302 + Mapper: 1 + - CRC: 870272108 + Mapper: 1 + - CRC: 3758654608 + Mapper: 4 + - CRC: 1111353285 + Mapper: 4 + - CRC: 2196680263 + Mapper: 2 + - CRC: 3469762496 + Mapper: 2 + - CRC: 210930702 + Mapper: 2 + - CRC: 3807876747 + Mapper: 2 + - CRC: 2966408742 + Mapper: 4 + - CRC: 643506958 + Mapper: 1 + - CRC: 667492594 + Mapper: 4 + - CRC: 3910613003 + Mapper: 1 + - CRC: 3533614866 + Mapper: 1 + - CRC: 420982331 + Mapper: 0 + - CRC: 3235810175 + Mapper: 0 + - CRC: 4034681700 + Mapper: 0 + - CRC: 3867040257 + Mapper: 0 + - CRC: 1885371352 + Mapper: 0 + - CRC: 3233428718 + Mapper: 0 + - CRC: 2430891997 + Mapper: 0 + - CRC: 3607041573 + Mapper: 1 + - CRC: 1994824408 + Mapper: 3 + - CRC: 2313676936 + Mapper: 0 + - CRC: 661932147 + Mapper: 0 + - CRC: 2528585468 + Mapper: 1 + - CRC: 2657986883 + Mapper: 1 + - CRC: 243863672 + Mapper: 3 + - CRC: 2972073243 + Mapper: 1 + - CRC: 152510486 + Mapper: 0 + - CRC: 1661983631 + Mapper: 1 + - CRC: 849050906 + Mapper: 4 + - CRC: 752976587 + Mapper: 0 + - CRC: 4094726872 + Mapper: 0 + - CRC: 3926027848 + Mapper: 1 + - CRC: 1680830673 + Mapper: 0 + - CRC: 1569519810 + Mapper: 0 + - CRC: 2762095750 + Mapper: 0 + - CRC: 3954294853 + Mapper: 0 + - CRC: 2017638717 + Mapper: 0 + - CRC: 156619115 + Mapper: 206 + - CRC: 3467961780 + Mapper: 0 + - CRC: 2633732505 + Mapper: 3 + - CRC: 1415101186 + Mapper: 0 + - CRC: 138078850 + Mapper: 1 + - CRC: 2592302945 + Mapper: 9 + - CRC: 1549635468 + Mapper: 206 + - CRC: 3779589660 + Mapper: 1 + - CRC: 4215015025 + Mapper: 1 + - CRC: 3656121357 + Mapper: 4 + - CRC: 1675681658 + Mapper: 4 + - CRC: 1187282027 + Mapper: 1 + - CRC: 3467771202 + Mapper: 4 + - CRC: 1224883434 + Mapper: 0 + - CRC: 2380101460 + Mapper: 5 + - CRC: 1841864177 + Mapper: 5 + - CRC: 2212925247 + Mapper: 5 + - CRC: 3040786325 + Mapper: 1 + - CRC: 2819790001 + Mapper: 4 + - CRC: 1528618312 + Mapper: 66 + - CRC: 2895323631 + Mapper: 5 + - CRC: 3808236688 + Mapper: 5 + - CRC: 629397715 + Mapper: 4 + - CRC: 1966429239 + Mapper: 4 + - CRC: 869774889 + Mapper: 4 + - CRC: 2614314756 + Mapper: 184 + - CRC: 2386990517 + Mapper: 0 + - CRC: 1705569424 + Mapper: 0 + - CRC: 3904869111 + Mapper: 3 + - CRC: 3049405196 + Mapper: 0 + - CRC: 3169992077 + Mapper: 0 + - CRC: 480317580 + Mapper: 0 + - CRC: 1482349909 + Mapper: 0 + - CRC: 1820778803 + Mapper: 0 + - CRC: 3419932115 + Mapper: 0 + - CRC: 293733064 + Mapper: 0 + - CRC: 2049462024 + Mapper: 0 + - CRC: 578099536 + Mapper: 0 + - CRC: 3332239832 + Mapper: 0 + - CRC: 124728377 + Mapper: 0 + - CRC: 711580390 + Mapper: 0 + - CRC: 1577387610 + Mapper: 0 + - CRC: 2648183503 + Mapper: 0 + - CRC: 30514485 + Mapper: 0 + - CRC: 3261458246 + Mapper: 0 + - CRC: 224395979 + Mapper: 0 + - CRC: 3073890804 + Mapper: 0 + - CRC: 4097209958 + Mapper: 0 + - CRC: 4202737553 + Mapper: 0 + - CRC: 3936861731 + Mapper: 0 + - CRC: 1906609959 + Mapper: 0 + - CRC: 2690972137 + Mapper: 0 + - CRC: 1345631129 + Mapper: 0 + - CRC: 1624103077 + Mapper: 0 + - CRC: 3809165868 + Mapper: 0 + - CRC: 622776082 + Mapper: 0 + - CRC: 2077271757 + Mapper: 0 + - CRC: 2149306441 + Mapper: 0 + - CRC: 3120179102 + Mapper: 0 + - CRC: 2294554176 + Mapper: 4 + - CRC: 1528241756 + Mapper: 4 + - CRC: 170640276 + Mapper: 4 + - CRC: 3099192772 + Mapper: 4 + - CRC: 2510966964 + Mapper: 4 + - CRC: 2310282213 + Mapper: 4 + - CRC: 1605725434 + Mapper: 4 + - CRC: 1088499487 + Mapper: 4 + - CRC: 652717737 + Mapper: 4 + - CRC: 2082522054 + Mapper: 4 + - CRC: 1064589262 + Mapper: 4 + - CRC: 2387163472 + Mapper: 4 + - CRC: 457429101 + Mapper: 4 + - CRC: 724330874 + Mapper: 4 + - CRC: 2546296016 + Mapper: 4 + - CRC: 1883647789 + Mapper: 4 + - CRC: 3331034837 + Mapper: 4 + - CRC: 2455534801 + Mapper: 4 + - CRC: 742874511 + Mapper: 4 + - CRC: 4161369161 + Mapper: 4 + - CRC: 3664577395 + Mapper: 4 + - CRC: 3095023 + Mapper: 4 + - CRC: 3879935573 + Mapper: 4 + - CRC: 3961494947 + Mapper: 4 + - CRC: 4106128011 + Mapper: 4 + - CRC: 2057505137 + Mapper: 4 + - CRC: 2418955075 + Mapper: 4 + - CRC: 1784734316 + Mapper: 4 + - CRC: 4009953324 + Mapper: 4 + - CRC: 1441377706 + Mapper: 4 + - CRC: 4026803607 + Mapper: 4 + - CRC: 2463562659 + Mapper: 4 + - CRC: 4271401416 + Mapper: 4 + - CRC: 3107107503 + Mapper: 4 + - CRC: 2462684144 + Mapper: 4 + - CRC: 3062225395 + Mapper: 4 + - CRC: 3623248702 + Mapper: 4 + - CRC: 3695086617 + Mapper: 4 + - CRC: 718456623 + Mapper: 4 + - CRC: 1700647037 + Mapper: 4 + - CRC: 1741035906 + Mapper: 4 + - CRC: 2780824057 + Mapper: 4 + - CRC: 1205817310 + Mapper: 4 + - CRC: 3472887945 + Mapper: 4 + - CRC: 2001989331 + Mapper: 4 + - CRC: 2538315747 + Mapper: 4 + - CRC: 1792537035 + Mapper: 4 + - CRC: 963850376 + Mapper: 4 + - CRC: 609586259 + Mapper: 4 + - CRC: 387024890 + Mapper: 4 + - CRC: 2716470585 + Mapper: 4 + - CRC: 843335624 + Mapper: 4 + - CRC: 4056148240 + Mapper: 4 + - CRC: 183321036 + Mapper: 4 + - CRC: 676686370 + Mapper: 4 + - CRC: 3443254389 + Mapper: 4 + - CRC: 2999689101 + Mapper: 4 + - CRC: 2863327917 + Mapper: 4 + - CRC: 1080044075 + Mapper: 4 + - CRC: 3572137830 + Mapper: 4 + - CRC: 3498834449 + Mapper: 4 + - CRC: 1163385059 + Mapper: 4 + - CRC: 2508763543 + Mapper: 4 + - CRC: 3919993639 + Mapper: 4 + - CRC: 2541912198 + Mapper: 4 + - CRC: 2152505079 + Mapper: 4 + - CRC: 2214668778 + Mapper: 4 + - CRC: 3370252330 + Mapper: 4 + - CRC: 4070330599 + Mapper: 4 + - CRC: 2327480031 + Mapper: 4 + - CRC: 4143683671 + Mapper: 4 + - CRC: 259403333 + Mapper: 4 + - CRC: 1951873410 + Mapper: 4 + - CRC: 3000696705 + Mapper: 4 + - CRC: 4087195245 + Mapper: 4 + - CRC: 2774745583 + Mapper: 4 + - CRC: 821979635 + Mapper: 4 + - CRC: 1187375712 + Mapper: 4 + - CRC: 288942138 + Mapper: 4 + - CRC: 2811216923 + Mapper: 4 + - CRC: 2528676715 + Mapper: 4 + - CRC: 2898134479 + Mapper: 4 + - CRC: 3662111043 + Mapper: 4 + - CRC: 577657693 + Mapper: 4 + - CRC: 3446295335 + Mapper: 4 + - CRC: 1529407424 + Mapper: 4 + - CRC: 834011690 + Mapper: 4 + - CRC: 2261064448 + Mapper: 4 + - CRC: 4017560512 + Mapper: 4 + - CRC: 983484493 + Mapper: 4 + - CRC: 1997951375 + Mapper: 4 + - CRC: 2120052967 + Mapper: 4 + - CRC: 3069845675 + Mapper: 4 + - CRC: 1722384051 + Mapper: 4 + - CRC: 3596012087 + Mapper: 4 + - CRC: 2815024123 + Mapper: 4 + - CRC: 521335593 + Mapper: 4 + - CRC: 634068542 + Mapper: 4 + - CRC: 3219030507 + Mapper: 4 + - CRC: 1291257600 + Mapper: 4 + - CRC: 2356919211 + Mapper: 4 + - CRC: 191457857 + Mapper: 4 + - CRC: 4163438713 + Mapper: 4 + - CRC: 377450438 + Mapper: 4 + - CRC: 1916265082 + Mapper: 4 + - CRC: 661628526 + Mapper: 4 + - CRC: 837893139 + Mapper: 4 + - CRC: 3613153168 + Mapper: 4 + - CRC: 3967781247 + Mapper: 4 + - CRC: 64120941 + Mapper: 4 + - CRC: 3958350664 + Mapper: 4 + - CRC: 289544547 + Mapper: 4 + - CRC: 544210921 + Mapper: 4 + - CRC: 873380818 + Mapper: 4 + - CRC: 3549955625 + Mapper: 4 + - CRC: 3288046962 + Mapper: 4 + - CRC: 1910260826 + Mapper: 4 + - CRC: 1101573448 + Mapper: 4 + - CRC: 3978735182 + Mapper: 4 + - CRC: 3327618730 + Mapper: 4 + - CRC: 3645201778 + Mapper: 195 + - CRC: 2676106419 + Mapper: 195 + - CRC: 3736209174 + Mapper: 195 + - CRC: 4226522478 + Mapper: 195 + - CRC: 2800127112 + Mapper: 2 + - CRC: 1105434330 + Mapper: 2 + - CRC: 3869136829 + Mapper: 2 + - CRC: 405271249 + Mapper: 2 + - CRC: 3251140605 + Mapper: 2 + - CRC: 2880612818 + Mapper: 2 + - CRC: 2930085518 + Mapper: 2 + - CRC: 183669655 + Mapper: 2 + - CRC: 2926047183 + Mapper: 2 + - CRC: 3303940794 + Mapper: 5 + - CRC: 4070939260 + Mapper: 5 + - CRC: 707625941 + Mapper: 5 + - CRC: 453156881 + Mapper: 1 + - CRC: 910314293 + Mapper: 1 + - CRC: 3215837728 + Mapper: 1 + - CRC: 3765599819 + Mapper: 1 + - CRC: 1640598048 + Mapper: 2 + - CRC: 1644829425 + Mapper: 2 + - CRC: 1105363547 + Mapper: 24 + - CRC: 1469194028 + Mapper: 2 + - CRC: 3476562991 + Mapper: 2 + - CRC: 734471941 + Mapper: 2 + - CRC: 3454659192 + Mapper: 2 + - CRC: 2579690790 + Mapper: 2 + - CRC: 1026695267 + Mapper: 2 + - CRC: 3505980684 + Mapper: 2 + - CRC: 130208113 + Mapper: 2 + - CRC: 2312733952 + Mapper: 2 + - CRC: 2690842025 + Mapper: 2 + - CRC: 3292785710 + Mapper: 2 + - CRC: 895237336 + Mapper: 2 + - CRC: 3269302573 + Mapper: 2 + - CRC: 2337857056 + Mapper: 2 + - CRC: 429580090 + Mapper: 2 + - CRC: 861920238 + Mapper: 2 + - CRC: 1203069369 + Mapper: 2 + - CRC: 494347370 + Mapper: 2 + - CRC: 8613860 + Mapper: 2 + - CRC: 3513042456 + Mapper: 2 + - CRC: 657316942 + Mapper: 2 + - CRC: 3858483449 + Mapper: 1 + - CRC: 2439169673 + Mapper: 2 + - CRC: 1993063110 + Mapper: 2 + - CRC: 944387902 + Mapper: 2 + - CRC: 448257612 + Mapper: 2 + - CRC: 380883202 + Mapper: 2 + - CRC: 272054420 + Mapper: 2 + - CRC: 1484993341 + Mapper: 2 + - CRC: 794699254 + Mapper: 2 + - CRC: 2936088217 + Mapper: 2 + - CRC: 3249123613 + Mapper: 2 + - CRC: 3094652260 + Mapper: 2 + - CRC: 1418247819 + Mapper: 2 + - CRC: 1427555702 + Mapper: 2 + - CRC: 3037337743 + Mapper: 2 + - CRC: 2769695703 + Mapper: 2 + - CRC: 1697285947 + Mapper: 2 + - CRC: 1533067994 + Mapper: 2 + - CRC: 326318390 + Mapper: 2 + - CRC: 3634367694 + Mapper: 1 + - CRC: 3726091727 + Mapper: 1 + - CRC: 3004796270 + Mapper: 2 + - CRC: 91492363 + Mapper: 2 + - CRC: 4015190929 + Mapper: 2 + - CRC: 3682402252 + Mapper: 2 + - CRC: 668030505 + Mapper: 24 + - CRC: 3193950103 + Mapper: 2 + - CRC: 24096240 + Mapper: 2 + - CRC: 2628434590 + Mapper: 4 + - CRC: 2276281650 + Mapper: 4 + - CRC: 2499761508 + Mapper: 1 + - CRC: 3088326051 + Mapper: 2 + - CRC: 132988821 + Mapper: 4 + - CRC: 1056603716 + Mapper: 2 + - CRC: 2683646539 + Mapper: 4 + - CRC: 4145303904 + Mapper: 2 + - CRC: 1560910382 + Mapper: 1 + - CRC: 1280140807 + Mapper: 4 + - CRC: 3393581317 + Mapper: 4 + - CRC: 2900209531 + Mapper: 4 + - CRC: 2578922693 + Mapper: 4 + - CRC: 2386194959 + Mapper: 4 + - CRC: 2508725701 + Mapper: 4 + - CRC: 1838608733 + Mapper: 4 + - CRC: 557786175 + Mapper: 4 + - CRC: 2805474463 + Mapper: 4 + - CRC: 3953016187 + Mapper: 4 + - CRC: 2449871739 + Mapper: 2 + - CRC: 2545805087 + Mapper: 4 + - CRC: 359143819 + Mapper: 4 + - CRC: 2158182544 + Mapper: 1 + - CRC: 2848258332 + Mapper: 1 + - CRC: 2943632750 + Mapper: 1 + - CRC: 4033500976 + Mapper: 4 + - CRC: 2493202154 + Mapper: 4 + - CRC: 153907170 + Mapper: 4 + - CRC: 1257623479 + Mapper: 4 + - CRC: 1673369481 + Mapper: 4 + - CRC: 1985335915 + Mapper: 2 + - CRC: 3523390375 + Mapper: 2 + - CRC: 4158887825 + Mapper: 4 + - CRC: 3679683666 + Mapper: 4 + - CRC: 2646382854 + Mapper: 4 + - CRC: 1445880660 + Mapper: 2 + - CRC: 3425098501 + Mapper: 1 + - CRC: 3081126058 + Mapper: 5 + - CRC: 880789378 + Mapper: 4 + - CRC: 3163906820 + Mapper: 4 + - CRC: 2759175901 + Mapper: 2 + - CRC: 2728498909 + Mapper: 2 + - CRC: 2514364174 + Mapper: 2 + - CRC: 1104638070 + Mapper: 2 + - CRC: 314664851 + Mapper: 2 + - CRC: 4048643519 + Mapper: 4 + - CRC: 2958084416 + Mapper: 4 + - CRC: 2201244839 + Mapper: 4 + - CRC: 1821610644 + Mapper: 4 + - CRC: 764558955 + Mapper: 4 + - CRC: 519480204 + Mapper: 4 + - CRC: 1610026867 + Mapper: 4 + - CRC: 3258316888 + Mapper: 4 + - CRC: 48487232 + Mapper: 4 + - CRC: 2649257681 + Mapper: 4 + - CRC: 1339659458 + Mapper: 2 + - CRC: 4031197488 + Mapper: 4 + - CRC: 2632336596 + Mapper: 1 + - CRC: 1863833143 + Mapper: 4 + - CRC: 1152395466 + Mapper: 4 + - CRC: 2890535508 + Mapper: 4 + - CRC: 202276159 + Mapper: 4 + - CRC: 2360664805 + Mapper: 4 + - CRC: 3803477778 + Mapper: 4 + - CRC: 1785404923 + Mapper: 4 + - CRC: 769530739 + Mapper: 4 + - CRC: 3609001225 + Mapper: 4 + - CRC: 523239191 + Mapper: 2 + - CRC: 1979072186 + Mapper: 4 + - CRC: 1847303099 + Mapper: 2 + - CRC: 3757566652 + Mapper: 4 + - CRC: 861484788 + Mapper: 4 + - CRC: 1782307021 + Mapper: 4 + - CRC: 3990390938 + Mapper: 2 + - CRC: 3771969934 + Mapper: 4 + - CRC: 356124253 + Mapper: 4 + - CRC: 3592940729 + Mapper: 4 + - CRC: 32251423 + Mapper: 1 + - CRC: 1937318916 + Mapper: 1 + - CRC: 915612388 + Mapper: 1 + - CRC: 3395570829 + Mapper: 1 + - CRC: 1921446916 + Mapper: 1 + - CRC: 47078847 + Mapper: 1 + - CRC: 433323330 + Mapper: 2 + - CRC: 2647939626 + Mapper: 4 + - CRC: 957288249 + Mapper: 4 + - CRC: 1340313167 + Mapper: 4 + - CRC: 3950261854 + Mapper: 1 + - CRC: 1548265009 + Mapper: 1 + - CRC: 1242298497 + Mapper: 1 + - CRC: 1893062826 + Mapper: 1 + - CRC: 3958986725 + Mapper: 1 + - CRC: 150624846 + Mapper: 1 + - CRC: 1492374904 + Mapper: 1 + - CRC: 41001793 + Mapper: 1 + - CRC: 2636664246 + Mapper: 1 + - CRC: 3791347349 + Mapper: 1 + - CRC: 1608666851 + Mapper: 1 + - CRC: 627319894 + Mapper: 4 + - CRC: 3230873658 + Mapper: 4 + - CRC: 3558342371 + Mapper: 4 + - CRC: 746481282 + Mapper: 4 + - CRC: 1005483741 + Mapper: 4 + - CRC: 475894882 + Mapper: 4 + - CRC: 1216511485 + Mapper: 4 + - CRC: 242969798 + Mapper: 4 + - CRC: 1435426809 + Mapper: 4 + - CRC: 3463224476 + Mapper: 4 + - CRC: 1747115667 + Mapper: 5 + - CRC: 4027690966 + Mapper: 4 + - CRC: 3916711685 + Mapper: 4 + - CRC: 1337635809 + Mapper: 4 + - CRC: 816812711 + Mapper: 4 + - CRC: 306555809 + Mapper: 4 + - CRC: 3429066532 + Mapper: 4 + - CRC: 3728394203 + Mapper: 4 + - CRC: 2222634112 + Mapper: 4 + - CRC: 764424240 + Mapper: 4 + - CRC: 4002223956 + Mapper: 4 + - CRC: 1071300554 + Mapper: 4 + - CRC: 1638299383 + Mapper: 4 + - CRC: 4257778241 + Mapper: 4 + - CRC: 2788735296 + Mapper: 4 + - CRC: 2329764992 + Mapper: 4 + - CRC: 3866364318 + Mapper: 4 + - CRC: 807355946 + Mapper: 4 + - CRC: 1775189446 + Mapper: 4 + - CRC: 3651184472 + Mapper: 4 + - CRC: 20547967 + Mapper: 4 + - CRC: 2814751999 + Mapper: 4 + - CRC: 1430796380 + Mapper: 4 + - CRC: 1072775940 + Mapper: 4 + - CRC: 806042711 + Mapper: 4 + - CRC: 3284736706 + Mapper: 4 + - CRC: 3025140782 + Mapper: 4 + - CRC: 3892427514 + Mapper: 2 + - CRC: 2141864975 + Mapper: 1 + - CRC: 2494637786 + Mapper: 1 + - CRC: 4116039552 + Mapper: 2 + - CRC: 3285606997 + Mapper: 2 + - CRC: 2662778768 + Mapper: 1 + - CRC: 4089345551 + Mapper: 1 + - CRC: 857427041 + Mapper: 2 + - CRC: 521239854 + Mapper: 1 + - CRC: 133656248 + Mapper: 1 + - CRC: 969647230 + Mapper: 2 + - CRC: 3844477536 + Mapper: 1 + - CRC: 2016941 + Mapper: 4 + - CRC: 696185800 + Mapper: 4 + - CRC: 4272810187 + Mapper: 2 + - CRC: 614360272 + Mapper: 1 + - CRC: 2785315160 + Mapper: 4 + - CRC: 1695448098 + Mapper: 4 + - CRC: 2160156310 + Mapper: 4 + - CRC: 311172377 + Mapper: 4 + - CRC: 1314212855 + Mapper: 4 + - CRC: 788987351 + Mapper: 0 + - CRC: 2300264444 + Mapper: 0 + - CRC: 3844906194 + Mapper: 0 + - CRC: 2912804074 + Mapper: 0 + - CRC: 4119751190 + Mapper: 0 + - CRC: 3420042887 + Mapper: 4 + - CRC: 4040422673 + Mapper: 0 + - CRC: 4085164967 + Mapper: 0 + - CRC: 4162448321 + Mapper: 4 + - CRC: 2379260100 + Mapper: 0 + - CRC: 3636449839 + Mapper: 4 + - CRC: 2365668500 + Mapper: 0 + - CRC: 862253066 + Mapper: 4 + - CRC: 2719161623 + Mapper: 0 + - CRC: 762362813 + Mapper: 4 + - CRC: 2605624218 + Mapper: 0 + - CRC: 3239347528 + Mapper: 4 + - CRC: 869359960 + Mapper: 4 + - CRC: 2259664663 + Mapper: 0 + - CRC: 2602386493 + Mapper: 0 + - CRC: 2684782543 + Mapper: 0 + - CRC: 2980965307 + Mapper: 0 + - CRC: 3883796027 + Mapper: 0 + - CRC: 2744815470 + Mapper: 4 + - CRC: 243775703 + Mapper: 0 + - CRC: 1417144532 + Mapper: 0 + - CRC: 805340419 + Mapper: 0 + - CRC: 2785905864 + Mapper: 0 + - CRC: 2330942331 + Mapper: 0 + - CRC: 546384135 + Mapper: 0 + - CRC: 2752120502 + Mapper: 0 + - CRC: 2953320984 + Mapper: 4 + - CRC: 456139867 + Mapper: 4 + - CRC: 2571618790 + Mapper: 4 + - CRC: 148193260 + Mapper: 0 + - CRC: 1286858073 + Mapper: 3 + - CRC: 703012696 + Mapper: 4 + - CRC: 3737954900 + Mapper: 0 + - CRC: 2139835245 + Mapper: 0 + - CRC: 3753425283 + Mapper: 0 + - CRC: 1019120605 + Mapper: 0 + - CRC: 1821633879 + Mapper: 4 + - CRC: 2500182724 + Mapper: 0 + - CRC: 1594253445 + Mapper: 4 + - CRC: 217348390 + Mapper: 0 + - CRC: 1387224879 + Mapper: 0 + - CRC: 1717455689 + Mapper: 4 + - CRC: 197129675 + Mapper: 4 + - CRC: 2862146826 + Mapper: 4 + - CRC: 1105535522 + Mapper: 4 + - CRC: 2280979046 + Mapper: 4 + - CRC: 3919656785 + Mapper: 0 + - CRC: 1689994560 + Mapper: 3 + - CRC: 3794805767 + Mapper: 0 + - CRC: 3513073607 + Mapper: 0 + - CRC: 3903621690 + Mapper: 0 + - CRC: 763714611 + Mapper: 0 + - CRC: 705011435 + Mapper: 0 + - CRC: 3986915401 + Mapper: 0 + - CRC: 1999255698 + Mapper: 0 + - CRC: 4273641940 + Mapper: 0 + - CRC: 3879395424 + Mapper: 0 + - CRC: 937480534 + Mapper: 4 + - CRC: 2872027324 + Mapper: 0 + - CRC: 3259981796 + Mapper: 0 + - CRC: 332764550 + Mapper: 4 + - CRC: 4241991055 + Mapper: 0 + - CRC: 2195183147 + Mapper: 0 + - CRC: 1559271990 + Mapper: 0 + - CRC: 3888762914 + Mapper: 0 + - CRC: 892742545 + Mapper: 4 + - CRC: 1579546729 + Mapper: 206 + - CRC: 359095337 + Mapper: 4 + - CRC: 1341481403 + Mapper: 206 + - CRC: 3998602664 + Mapper: 4 + - CRC: 977915778 + Mapper: 5 + - CRC: 3797394011 + Mapper: 0 + - CRC: 3563626050 + Mapper: 4 + - CRC: 3253999427 + Mapper: 0 + - CRC: 1876016656 + Mapper: 0 + - CRC: 2970025228 + Mapper: 4 + - CRC: 3322823861 + Mapper: 0 + - CRC: 885140993 + Mapper: 0 + - CRC: 3296346798 + Mapper: 0 + - CRC: 853191099 + Mapper: 0 + - CRC: 601231204 + Mapper: 0 + - CRC: 598566936 + Mapper: 0 + - CRC: 4114907832 + Mapper: 0 + - CRC: 3320009438 + Mapper: 0 + - CRC: 3814851161 + Mapper: 0 + - CRC: 929433014 + Mapper: 0 + - CRC: 564628120 + Mapper: 4 + - CRC: 2139913731 + Mapper: 0 + - CRC: 2650334447 + Mapper: 4 + - CRC: 506491925 + Mapper: 0 + - CRC: 3285499688 + Mapper: 0 + - CRC: 3889475421 + Mapper: 4 + - CRC: 1915743118 + Mapper: 0 + - CRC: 1314966582 + Mapper: 0 + - CRC: 1305623566 + Mapper: 0 + - CRC: 3281052616 + Mapper: 0 + - CRC: 818800875 + Mapper: 0 + - CRC: 3759781080 + Mapper: 0 + - CRC: 2136632150 + Mapper: 206 + - CRC: 2623106095 + Mapper: 0 + - CRC: 684167177 + Mapper: 0 + - CRC: 4048141681 + Mapper: 0 + - CRC: 4076236286 + Mapper: 0 + - CRC: 1210926541 + Mapper: 0 + - CRC: 1556766102 + Mapper: 0 + - CRC: 3510754829 + Mapper: 0 + - CRC: 2448906282 + Mapper: 0 + - CRC: 518355726 + Mapper: 0 + - CRC: 27436553 + Mapper: 0 + - CRC: 682816615 + Mapper: 0 + - CRC: 3038127238 + Mapper: 0 + - CRC: 780865038 + Mapper: 0 + - CRC: 551127063 + Mapper: 0 + - CRC: 2338345252 + Mapper: 0 + - CRC: 333634127 + Mapper: 0 + - CRC: 2829516779 + Mapper: 24 + - CRC: 1029163840 + Mapper: 0 + - CRC: 646802812 + Mapper: 0 + - CRC: 1261758327 + Mapper: 0 + - CRC: 2009865902 + Mapper: 4 + - CRC: 3972601141 + Mapper: 4 + - CRC: 1032709983 + Mapper: 4 + - CRC: 2867655924 + Mapper: 4 + - CRC: 1570022127 + Mapper: 4 + - CRC: 3817879386 + Mapper: 4 + - CRC: 3375909221 + Mapper: 4 + - CRC: 3349681482 + Mapper: 4 + - CRC: 1348861291 + Mapper: 4 + - CRC: 3236907436 + Mapper: 4 + - CRC: 1968469527 + Mapper: 1 + - CRC: 3362883270 + Mapper: 4 + - CRC: 2777190530 + Mapper: 4 + - CRC: 1549904275 + Mapper: 4 + - CRC: 1285039300 + Mapper: 4 + - CRC: 3281470446 + Mapper: 4 + - CRC: 2073340066 + Mapper: 4 + - CRC: 2800411987 + Mapper: 4 + - CRC: 2942356551 + Mapper: 4 + - CRC: 3248776918 + Mapper: 4 + - CRC: 962068098 + Mapper: 4 + - CRC: 2000578820 + Mapper: 4 + - CRC: 2559376318 + Mapper: 4 + - CRC: 35684258 + Mapper: 4 + - CRC: 3600309030 + Mapper: 4 + - CRC: 3767461004 + Mapper: 5 + - CRC: 1132064507 + Mapper: 4 + - CRC: 176868801 + Mapper: 4 + - CRC: 2064746777 + Mapper: 4 + - CRC: 1938341565 + Mapper: 4 + - CRC: 4210317592 + Mapper: 0 + - CRC: 111529700 + Mapper: 4 + - CRC: 235942570 + Mapper: 4 + - CRC: 784014400 + Mapper: 0 + - CRC: 1779483005 + Mapper: 0 + - CRC: 747404252 + Mapper: 4 + - CRC: 3498765393 + Mapper: 0 + - CRC: 857869318 + Mapper: 4 + - CRC: 2335593675 + Mapper: 4 + - CRC: 2717655947 + Mapper: 0 + - CRC: 756173276 + Mapper: 4 + - CRC: 1174868218 + Mapper: 0 + - CRC: 3819730360 + Mapper: 0 + - CRC: 3260177560 + Mapper: 0 + - CRC: 158314458 + Mapper: 0 + - CRC: 3559535502 + Mapper: 0 + - CRC: 1165052281 + Mapper: 0 + - CRC: 2163037037 + Mapper: 0 + - CRC: 1247780478 + Mapper: 4 + - CRC: 3335998624 + Mapper: 4 + - CRC: 2284368608 + Mapper: 1 + - CRC: 2758919557 + Mapper: 1 + - CRC: 2344172280 + Mapper: 1 + - CRC: 2992373931 + Mapper: 1 + - CRC: 3138333206 + Mapper: 1 + - CRC: 3279350470 + Mapper: 0 + - CRC: 393538488 + Mapper: 2 + - CRC: 136718061 + Mapper: 3 + - CRC: 3088996173 + Mapper: 0 + - CRC: 949960893 + Mapper: 0 + - CRC: 946858515 + Mapper: 0 + - CRC: 3241298932 + Mapper: 0 + - CRC: 4116248621 + Mapper: 206 + - CRC: 3260634969 + Mapper: 0 + - CRC: 2868488914 + Mapper: 0 + - CRC: 1424088884 + Mapper: 0 + - CRC: 1804926779 + Mapper: 0 + - CRC: 2998433385 + Mapper: 0 + - CRC: 2832970832 + Mapper: 0 + - CRC: 1047462259 + Mapper: 4 + - CRC: 1599208639 + Mapper: 0 + - CRC: 584585885 + Mapper: 0 + - CRC: 1528029808 + Mapper: 0 + - CRC: 1920277408 + Mapper: 0 + - CRC: 2545314752 + Mapper: 0 + - CRC: 4021564491 + Mapper: 0 + - CRC: 3643017601 + Mapper: 0 + - CRC: 2082903438 + Mapper: 0 + - CRC: 410950919 + Mapper: 0 + - CRC: 662222886 + Mapper: 4 + - CRC: 3553840261 + Mapper: 0 + - CRC: 3036517513 + Mapper: 0 + - CRC: 3074296084 + Mapper: 0 + - CRC: 3480017253 + Mapper: 0 + - CRC: 144611250 + Mapper: 0 + - CRC: 493356492 + Mapper: 1 + - CRC: 3100426025 + Mapper: 4 + - CRC: 2608584054 + Mapper: 1 + - CRC: 1296738053 + Mapper: 0 + - CRC: 4240687705 + Mapper: 4 + - CRC: 79153839 + Mapper: 0 + - CRC: 1656353164 + Mapper: 4 + - CRC: 2232116400 + Mapper: 0 + - CRC: 2926807518 + Mapper: 4 + - CRC: 2435982949 + Mapper: 0 + - CRC: 3299870905 + Mapper: 4 + - CRC: 2139080529 + Mapper: 0 + - CRC: 481950253 + Mapper: 4 + - CRC: 1907201726 + Mapper: 0 + - CRC: 2138385567 + Mapper: 4 + - CRC: 2797926781 + Mapper: 0 + - CRC: 1347589992 + Mapper: 0 + - CRC: 3965185350 + Mapper: 0 + - CRC: 904918253 + Mapper: 0 + - CRC: 1302560997 + Mapper: 0 + - CRC: 18167754 + Mapper: 0 + - CRC: 3264567550 + Mapper: 0 + - CRC: 40746903 + Mapper: 0 + - CRC: 3491529177 + Mapper: 3 + - CRC: 2486616916 + Mapper: 3 + - CRC: 3324876336 + Mapper: 4 + - CRC: 1528515370 + Mapper: 4 + - CRC: 2328949783 + Mapper: 4 + - CRC: 248635859 + Mapper: 4 + - CRC: 3201633827 + Mapper: 0 + - CRC: 1868085302 + Mapper: 0 + - CRC: 1659232297 + Mapper: 0 + - CRC: 4243692044 + Mapper: 0 + - CRC: 3189411787 + Mapper: 0 + - CRC: 683057219 + Mapper: 0 + - CRC: 2150436193 + Mapper: 0 + - CRC: 1368874331 + Mapper: 0 + - CRC: 329963383 + Mapper: 0 + - CRC: 2014037042 + Mapper: 0 + - CRC: 327071520 + Mapper: 0 + - CRC: 2413705286 + Mapper: 0 + - CRC: 117171045 + Mapper: 1 + - CRC: 1321762304 + Mapper: 1 + - CRC: 4154466154 + Mapper: 4 + - CRC: 3478754033 + Mapper: 4 + - CRC: 3829597228 + Mapper: 4 + - CRC: 3321350370 + Mapper: 4 + - CRC: 2279582431 + Mapper: 4 + - CRC: 2149637127 + Mapper: 4 + - CRC: 571584948 + Mapper: 4 + - CRC: 2942511301 + Mapper: 4 + - CRC: 1675275640 + Mapper: 4 + - CRC: 1752758882 + Mapper: 4 + - CRC: 4282723560 + Mapper: 4 + - CRC: 3797227705 + Mapper: 4 + - CRC: 1724507484 + Mapper: 4 + - CRC: 2533334678 + Mapper: 4 + - CRC: 1322945785 + Mapper: 4 + - CRC: 1492783730 + Mapper: 4 + - CRC: 1220997730 + Mapper: 4 + - CRC: 2464186066 + Mapper: 4 + - CRC: 703977406 + Mapper: 4 + - CRC: 3712438855 + Mapper: 4 + - CRC: 2727248385 + Mapper: 4 + - CRC: 1414068073 + Mapper: 4 + - CRC: 1738979609 + Mapper: 4 + - CRC: 4228725292 + Mapper: 4 + - CRC: 1233894090 + Mapper: 4 + - CRC: 3711393334 + Mapper: 4 + - CRC: 4092517746 + Mapper: 4 + - CRC: 1753389945 + Mapper: 4 + - CRC: 1413511652 + Mapper: 4 + - CRC: 3286431433 + Mapper: 4 + - CRC: 4247963486 + Mapper: 4 + - CRC: 1002448493 + Mapper: 4 + - CRC: 101181939 + Mapper: 4 + - CRC: 3638689240 + Mapper: 4 + - CRC: 1860337778 + Mapper: 4 + - CRC: 4193798915 + Mapper: 4 + - CRC: 3825314772 + Mapper: 4 + - CRC: 3502269878 + Mapper: 4 + - CRC: 3609489711 + Mapper: 4 + - CRC: 4262044646 + Mapper: 4 + - CRC: 1300838780 + Mapper: 4 + - CRC: 3524554832 + Mapper: 4 + - CRC: 1278540372 + Mapper: 4 + - CRC: 450313421 + Mapper: 4 + - CRC: 401686141 + Mapper: 4 + - CRC: 2563491286 + Mapper: 4 + - CRC: 2745602927 + Mapper: 4 + - CRC: 2174065329 + Mapper: 4 + - CRC: 1018261869 + Mapper: 4 + - CRC: 95629582 + Mapper: 4 + - CRC: 1210454179 + Mapper: 4 + - CRC: 33084655 + Mapper: 4 + - CRC: 300349131 + Mapper: 4 + - CRC: 35318846 + Mapper: 4 + - CRC: 816661506 + Mapper: 4 + - CRC: 1892396326 + Mapper: 4 + - CRC: 2103399633 + Mapper: 4 + - CRC: 2409961283 + Mapper: 4 + - CRC: 1438598988 + Mapper: 4 + - CRC: 3929876576 + Mapper: 4 + - CRC: 3994386196 + Mapper: 4 + - CRC: 3913932849 + Mapper: 4 + - CRC: 2881051839 + Mapper: 4 + - CRC: 2124311405 + Mapper: 4 + - CRC: 844250802 + Mapper: 4 + - CRC: 44121289 + Mapper: 4 + - CRC: 964931971 + Mapper: 4 + - CRC: 2342584019 + Mapper: 4 + - CRC: 107982070 + Mapper: 4 + - CRC: 960169268 + Mapper: 4 + - CRC: 3780050987 + Mapper: 4 + - CRC: 915896754 + Mapper: 4 + - CRC: 2450740730 + Mapper: 4 + - CRC: 3867329706 + Mapper: 4 + - CRC: 2668345533 + Mapper: 4 + - CRC: 3565903229 + Mapper: 4 + - CRC: 1190200800 + Mapper: 4 + - CRC: 4040508483 + Mapper: 4 + - CRC: 1285694216 + Mapper: 4 + - CRC: 1960548019 + Mapper: 4 + - CRC: 1295734541 + Mapper: 4 + - CRC: 3206628295 + Mapper: 4 + - CRC: 354663529 + Mapper: 4 + - CRC: 4236662744 + Mapper: 4 + - CRC: 3059115520 + Mapper: 4 + - CRC: 3790217575 + Mapper: 4 + - CRC: 955228470 + Mapper: 4 + - CRC: 482039555 + Mapper: 4 + - CRC: 784424002 + Mapper: 4 + - CRC: 3249491808 + Mapper: 4 + - CRC: 1727768017 + Mapper: 4 + - CRC: 2856881859 + Mapper: 4 + - CRC: 2413454634 + Mapper: 1 + - CRC: 1592397932 + Mapper: 1 + - CRC: 1517195041 + Mapper: 1 + - CRC: 3848704986 + Mapper: 1 + - CRC: 596401530 + Mapper: 1 + - CRC: 57911841 + Mapper: 1 + - CRC: 1597096639 + Mapper: 1 + - CRC: 2304254405 + Mapper: 1 + - CRC: 37697222 + Mapper: 1 + - CRC: 2227574345 + Mapper: 1 + - CRC: 3215818255 + Mapper: 1 + - CRC: 752480 + Mapper: 1 + - CRC: 2015868799 + Mapper: 1 + - CRC: 1258528720 + Mapper: 1 + - CRC: 4085390188 + Mapper: 1 + - CRC: 2028522977 + Mapper: 1 + - CRC: 366849281 + Mapper: 1 + - CRC: 2376082799 + Mapper: 1 + - CRC: 3765762878 + Mapper: 1 + - CRC: 1667660419 + Mapper: 1 + - CRC: 3159591005 + Mapper: 1 + - CRC: 2674935765 + Mapper: 1 + - CRC: 2995620835 + Mapper: 1 + - CRC: 3148180487 + Mapper: 1 + - CRC: 350003287 + Mapper: 1 + - CRC: 2682349042 + Mapper: 1 + - CRC: 3559959023 + Mapper: 5 + - CRC: 3814042488 + Mapper: 45 + - CRC: 4055872326 + Mapper: 176 + - CRC: 2893434845 + Mapper: 176 + - CRC: 2504016749 + Mapper: 45 + - CRC: 3041299175 + Mapper: 45 + - CRC: 722448315 + Mapper: 176 + - CRC: 353948751 + Mapper: 45 + - CRC: 616490340 + Mapper: 45 + - CRC: 2864412254 + Mapper: 45 + - CRC: 2030802798 + Mapper: 45 + - CRC: 3608402605 + Mapper: 45 + - CRC: 1791026623 + Mapper: 45 + - CRC: 571377154 + Mapper: 45 + - CRC: 4207508427 + Mapper: 45 + - CRC: 231080605 + Mapper: 45 + - CRC: 2575221521 + Mapper: 45 + - CRC: 3321204003 + Mapper: 45 + - CRC: 4112095084 + Mapper: 45 + - CRC: 2429246860 + Mapper: 45 + - CRC: 1048147430 + Mapper: 45 + - CRC: 941799461 + Mapper: 176 + - CRC: 3036790535 + Mapper: 176 + - CRC: 4062099842 + Mapper: 45 + - CRC: 3023912241 + Mapper: 45 + - CRC: 2706614423 + Mapper: 45 + - CRC: 2779280732 + Mapper: 176 + - CRC: 2250665322 + Mapper: 176 + - CRC: 3347029997 + Mapper: 176 + - CRC: 1847499049 + Mapper: 176 + - CRC: 899108652 + Mapper: 176 + - CRC: 142677662 + Mapper: 176 + - CRC: 2773722134 + Mapper: 176 + - CRC: 1384847513 + Mapper: 45 + - CRC: 2049506649 + Mapper: 45 + - CRC: 571863152 + Mapper: 45 + - CRC: 2866489535 + Mapper: 45 + - CRC: 2708660288 + Mapper: 45 + - CRC: 283721406 + Mapper: 45 + - CRC: 61246409 + Mapper: 45 + - CRC: 1550255015 + Mapper: 45 + - CRC: 885292953 + Mapper: 45 + - CRC: 2900062003 + Mapper: 45 + - CRC: 3596997937 + Mapper: 28 + - CRC: 1682041078 + Mapper: 28 + - CRC: 506909194 + Mapper: 34 + - CRC: 3455406742 + Mapper: 34 + - CRC: 3863327111 + Mapper: 34 + - CRC: 2912915158 + Mapper: 34 + - CRC: 1851889439 + Mapper: 28 + - CRC: 4040527596 + Mapper: 28 + - CRC: 1712295554 + Mapper: 28 + - CRC: 3426575447 + Mapper: 1 + - CRC: 773339932 + Mapper: 45 + - CRC: 3325226123 + Mapper: 52 + - CRC: 4259552762 + Mapper: 52 + - CRC: 3649499606 + Mapper: 52 + - CRC: 1643648503 + Mapper: 52 + - CRC: 243363799 + Mapper: 45 + - CRC: 2182781172 + Mapper: 1 + - CRC: 7749366 + Mapper: 1 + - CRC: 3557607157 + Mapper: 1 + - CRC: 3293788750 + Mapper: 45 + - CRC: 2612450844 + Mapper: 45 + - CRC: 3096021621 + Mapper: 45 + - CRC: 1086089938 + Mapper: 45 + - CRC: 3366001892 + Mapper: 45 + - CRC: 200038266 + Mapper: 45 + - CRC: 1298461950 + Mapper: 45 + - CRC: 2802867448 + Mapper: 45 + - CRC: 375800475 + Mapper: 45 + - CRC: 2846932034 + Mapper: 45 + - CRC: 1874864425 + Mapper: 5 + - CRC: 101990323 + Mapper: 5 + - CRC: 3691167888 + Mapper: 45 + - CRC: 2038037856 + Mapper: 45 + - CRC: 2938777597 + Mapper: 45 + - CRC: 3843728800 + Mapper: 45 + - CRC: 3875001339 + Mapper: 1 + - CRC: 4074037352 + Mapper: 45 + - CRC: 1451858410 + Mapper: 0 + - CRC: 344933063 + Mapper: 0 + - CRC: 3237067146 + Mapper: 0 + - CRC: 3076401665 + Mapper: 0 + - CRC: 2591475635 + Mapper: 0 + - CRC: 2225427802 + Mapper: 0 + - CRC: 4023087319 + Mapper: 0 + - CRC: 2456155008 + Mapper: 0 + - CRC: 2221438663 + Mapper: 0 + - CRC: 846328944 + Mapper: 0 + - CRC: 2988743322 + Mapper: 0 + - CRC: 4027489937 + Mapper: 0 + - CRC: 1425620370 + Mapper: 4 + - CRC: 3828428064 + Mapper: 0 + - CRC: 3793375179 + Mapper: 0 + - CRC: 2344053766 + Mapper: 0 + - CRC: 526863386 + Mapper: 0 + - CRC: 1626244058 + Mapper: 0 + - CRC: 1257707581 + Mapper: 0 + - CRC: 360360538 + Mapper: 0 + - CRC: 1701418773 + Mapper: 0 + - CRC: 3644984527 + Mapper: 0 + - CRC: 2846650507 + Mapper: 0 + - CRC: 997534572 + Mapper: 0 + - CRC: 3925553387 + Mapper: 0 + - CRC: 448052980 + Mapper: 0 + - CRC: 413812033 + Mapper: 0 + - CRC: 3733624287 + Mapper: 0 + - CRC: 1860991030 + Mapper: 0 + - CRC: 1488703564 + Mapper: 0 + - CRC: 3260470739 + Mapper: 0 + - CRC: 872628654 + Mapper: 0 + - CRC: 757758790 + Mapper: 0 + - CRC: 1934118531 + Mapper: 0 + - CRC: 1064925141 + Mapper: 0 + - CRC: 365910272 + Mapper: 0 + - CRC: 2905223755 + Mapper: 0 + - CRC: 3125594816 + Mapper: 0 + - CRC: 1480159394 + Mapper: 0 + - CRC: 737178771 + Mapper: 1 + - CRC: 405997056 + Mapper: 172 + - CRC: 3697685309 + Mapper: 65 + - CRC: 4234824004 + Mapper: 242 + - CRC: 1219632753 + Mapper: 162 + - CRC: 194458288 + Mapper: 249 + - CRC: 780465086 + Mapper: 227 + - CRC: 1710349201 + Mapper: 164 + - CRC: 170148392 + Mapper: 164 + - CRC: 235700856 + Mapper: 249 + - CRC: 559880320 + Mapper: 227 + - CRC: 1688436375 + Mapper: 227 + - CRC: 520316750 + Mapper: 227 + - CRC: 4034666979 + Mapper: 176 + - CRC: 2826798639 + Mapper: 176 + - CRC: 4078800733 + Mapper: 4 + - CRC: 3441633348 + Mapper: 136 + - CRC: 823594589 + Mapper: 227 + - CRC: 412677155 + Mapper: 227 + - CRC: 1732911685 + Mapper: 192 + - CRC: 1378984212 + Mapper: 11 + - CRC: 3107656486 + Mapper: 5 + - CRC: 359527675 + Mapper: 4 + - CRC: 939335637 + Mapper: 0 + - CRC: 3652748796 + Mapper: 0 + - CRC: 1908875420 + Mapper: 185 + - CRC: 739881921 + Mapper: 1 + - CRC: 3187683394 + Mapper: 4 + - CRC: 1023621050 + Mapper: 0 + - CRC: 1165819718 + Mapper: 0 + - CRC: 3635140494 + Mapper: 0 + - CRC: 53142102 + Mapper: 0 + - CRC: 2219807068 + Mapper: 0 + - CRC: 1463037933 + Mapper: 0 + - CRC: 716248277 + Mapper: 2 + - CRC: 670506375 + Mapper: 4 + - CRC: 3168238447 + Mapper: 0 + - CRC: 2235111788 + Mapper: 0 + - CRC: 763610172 + Mapper: 0 + - CRC: 4125501764 + Mapper: 0 + - CRC: 1704530234 + Mapper: 2 + - CRC: 1664723942 + Mapper: 0 + - CRC: 611060902 + Mapper: 0 + - CRC: 1794142349 + Mapper: 0 + - CRC: 1424593253 + Mapper: 0 + - CRC: 3035028772 + Mapper: 1 + - CRC: 224185939 + Mapper: 1 + - CRC: 670047218 + Mapper: 1 + - CRC: 1720210902 + Mapper: 1 + - CRC: 2978797454 + Mapper: 0 + - CRC: 2096492457 + Mapper: 1 + - CRC: 3783336131 + Mapper: 0 + - CRC: 1597721651 + Mapper: 0 + - CRC: 2024016853 + Mapper: 2 + - CRC: 2553128287 + Mapper: 24 + - CRC: 4235424162 + Mapper: 6 + - CRC: 65650739 + Mapper: 0 + - CRC: 2896412875 + Mapper: 2 + - CRC: 4058304175 + Mapper: 1 + - CRC: 3337771552 + Mapper: 1 + - CRC: 3961886806 + Mapper: 1 + - CRC: 1173682828 + Mapper: 4 + - CRC: 2834609246 + Mapper: 4 + - CRC: 2913072956 + Mapper: 1 + - CRC: 1427495215 + Mapper: 2 + - CRC: 181141630 + Mapper: 2 + - CRC: 1104355795 + Mapper: 18 + - CRC: 3003895396 + Mapper: 1 + - CRC: 2623300654 + Mapper: 4 + - CRC: 297924230 + Mapper: 1 + - CRC: 3214178682 + Mapper: 1 + - CRC: 3676519441 + Mapper: 1 + - CRC: 1114344560 + Mapper: 1 + - CRC: 1393020681 + Mapper: 1 + - CRC: 906117525 + Mapper: 0 + - CRC: 3160658939 + Mapper: 0 + - CRC: 749537118 + Mapper: 0 + - CRC: 2798425392 + Mapper: 0 + - CRC: 2939265808 + Mapper: 2 + - CRC: 3017354872 + Mapper: 118 + - CRC: 2016495282 + Mapper: 4 + - CRC: 881927486 + Mapper: 4 + - CRC: 3755272243 + Mapper: 4 + - CRC: 1589117596 + Mapper: 1 + - CRC: 3846715483 + Mapper: 4 + - CRC: 3702960346 + Mapper: 2 + - CRC: 2735796620 + Mapper: 185 + - CRC: 3890947721 + Mapper: 4 + - CRC: 280854325 + Mapper: 4 + - CRC: 1726970660 + Mapper: 3 + - CRC: 1569725438 + Mapper: 2 + - CRC: 346612741 + Mapper: 1 + - CRC: 3521642284 + Mapper: 1 + - CRC: 4173570985 + Mapper: 1 + - CRC: 3110121788 + Mapper: 25 + - CRC: 582815590 + Mapper: 140 + - CRC: 3608164587 + Mapper: 227 + - CRC: 4250961757 + Mapper: 1 + - CRC: 7567145 + Mapper: 1 + - CRC: 469428134 + Mapper: 1 + - CRC: 2781495858 + Mapper: 1 + - CRC: 4008138826 + Mapper: 1 + - CRC: 3550546744 + Mapper: 1 + - CRC: 1969401362 + Mapper: 4 + - CRC: 3789249713 + Mapper: 0 + - CRC: 1855718774 + Mapper: 72 + - CRC: 1776613715 + Mapper: 2 + - CRC: 1119860073 + Mapper: 2 + - CRC: 1329780258 + Mapper: 3 + - CRC: 2108357579 + Mapper: 1 + - CRC: 2551056125 + Mapper: 4 + - CRC: 1075757763 + Mapper: 4 + - CRC: 2578679839 + Mapper: 1 + - CRC: 3414794473 + Mapper: 1 + - CRC: 3493394326 + Mapper: 4 + - CRC: 3817537915 + Mapper: 24 + - CRC: 2476667002 + Mapper: 24 + - CRC: 1555219984 + Mapper: 1 + - CRC: 3627579849 + Mapper: 23 + - CRC: 4112953344 + Mapper: 23 + - CRC: 1324081959 + Mapper: 1 + - CRC: 4189543481 + Mapper: 1 + - CRC: 2218020853 + Mapper: 16 + - CRC: 240312728 + Mapper: 4 + - CRC: 4118670039 + Mapper: 2 + - CRC: 1099632784 + Mapper: 1 + - CRC: 3352701680 + Mapper: 4 + - CRC: 361821191 + Mapper: 4 + - CRC: 4102702787 + Mapper: 163 + - CRC: 3781748129 + Mapper: 1 + - CRC: 3358815761 + Mapper: 1 + - CRC: 1029684580 + Mapper: 2 + - CRC: 2166960388 + Mapper: 1 + - CRC: 854142420 + Mapper: 4 + - CRC: 3302800152 + Mapper: 23 + - CRC: 754150360 + Mapper: 4 + - CRC: 3788637045 + Mapper: 23 + - CRC: 1343963627 + Mapper: 4 + - CRC: 1616870621 + Mapper: 1 + - CRC: 3759376873 + Mapper: 3 + - CRC: 385268837 + Mapper: 1 + - CRC: 366657262 + Mapper: 4 + - CRC: 3691392493 + Mapper: 4 + - CRC: 2767359785 + Mapper: 4 + - CRC: 3018036565 + Mapper: 16 + - CRC: 3001556836 + Mapper: 23 + - CRC: 2494822535 + Mapper: 4 + - CRC: 3097930505 + Mapper: 2 + - CRC: 1439286708 + Mapper: 69 + - CRC: 2777966508 + Mapper: 69 + - CRC: 3821637632 + Mapper: 4 + - CRC: 274739487 + Mapper: 2 + - CRC: 2598876962 + Mapper: 4 + - CRC: 3718654034 + Mapper: 1 + - CRC: 60040872 + Mapper: 1 + - CRC: 3452670349 + Mapper: 2 + - CRC: 3487629100 + Mapper: 23 + - CRC: 1428399911 + Mapper: 2 + - CRC: 757897663 + Mapper: 4 + - CRC: 674080908 + Mapper: 4 + - CRC: 3516806406 + Mapper: 16 + - CRC: 2463208139 + Mapper: 16 + - CRC: 3613218185 + Mapper: 16 + - CRC: 508381419 + Mapper: 154 + - CRC: 1885562369 + Mapper: 1 + - CRC: 2813358462 + Mapper: 76 + - CRC: 1587411330 + Mapper: 19 + - CRC: 658717009 + Mapper: 76 + - CRC: 625408350 + Mapper: 4 + - CRC: 4101897234 + Mapper: 80 + - CRC: 1777568221 + Mapper: 0 + - CRC: 241627341 + Mapper: 4 + - CRC: 70412475 + Mapper: 48 + - CRC: 856823147 + Mapper: 1 + - CRC: 1191465879 + Mapper: 66 + - CRC: 362419007 + Mapper: 66 + - CRC: 3429553787 + Mapper: 1 + - CRC: 1917045382 + Mapper: 4 + - CRC: 1315906919 + Mapper: 2 + - CRC: 2202116997 + Mapper: 16 + - CRC: 1391387254 + Mapper: 16 + - CRC: 4266841141 + Mapper: 16 + - CRC: 2640799461 + Mapper: 16 + - CRC: 1515950898 + Mapper: 16 + - CRC: 3037935095 + Mapper: 16 + - CRC: 4268492911 + Mapper: 159 + - CRC: 2619868066 + Mapper: 91 + - CRC: 666487723 + Mapper: 159 + - CRC: 2699802758 + Mapper: 66 + - CRC: 65506656 + Mapper: 16 + - CRC: 2546109956 + Mapper: 206 + - CRC: 1962009823 + Mapper: 4 + - CRC: 1303125467 + Mapper: 222 + - CRC: 2825061346 + Mapper: 19 + - CRC: 637177102 + Mapper: 19 + - CRC: 2676163416 + Mapper: 1 + - CRC: 301086928 + Mapper: 3 + - CRC: 1628415768 + Mapper: 3 + - CRC: 2361261128 + Mapper: 3 + - CRC: 4232078208 + Mapper: 3 + - CRC: 616983748 + Mapper: 23 + - CRC: 2363433737 + Mapper: 206 + - CRC: 314100349 + Mapper: 1 + - CRC: 43649596 + Mapper: 4 + - CRC: 389320034 + Mapper: 1 + - CRC: 13460263 + Mapper: 1 + - CRC: 1650485591 + Mapper: 3 + - CRC: 4105639827 + Mapper: 3 + - CRC: 3571574174 + Mapper: 185 + - CRC: 1546523534 + Mapper: 185 + - CRC: 2948573815 + Mapper: 185 + - CRC: 2520242063 + Mapper: 3 + - CRC: 3658779737 + Mapper: 3 + - CRC: 1016285989 + Mapper: 1 + - CRC: 1790373206 + Mapper: 1 + - CRC: 1317893842 + Mapper: 1 + - CRC: 3466612455 + Mapper: 2 + - CRC: 1841648711 + Mapper: 2 + - CRC: 3682874907 + Mapper: 26 + - CRC: 1202016309 + Mapper: 4 + - CRC: 1864435044 + Mapper: 4 + - CRC: 3993672513 + Mapper: 10 + - CRC: 1087765713 + Mapper: 10 + - CRC: 3451077197 + Mapper: 206 + - CRC: 3761449424 + Mapper: 206 + - CRC: 1457579718 + Mapper: 206 + - CRC: 3174911656 + Mapper: 206 + - CRC: 810395278 + Mapper: 3 + - CRC: 3312040929 + Mapper: 3 + - CRC: 3714327465 + Mapper: 3 + - CRC: 1244440603 + Mapper: 206 + - CRC: 559427155 + Mapper: 206 + - CRC: 473154110 + Mapper: 19 + - CRC: 470489955 + Mapper: 19 + - CRC: 3115507977 + Mapper: 210 + - CRC: 125476622 + Mapper: 210 + - CRC: 374113955 + Mapper: 210 + - CRC: 923567259 + Mapper: 210 + - CRC: 2101065667 + Mapper: 210 + - CRC: 1272317357 + Mapper: 1 + - CRC: 1790864519 + Mapper: 2 + - CRC: 286093875 + Mapper: 4 + - CRC: 992041654 + Mapper: 18 + - CRC: 4020282601 + Mapper: 1 + - CRC: 238718725 + Mapper: 1 + - CRC: 3781161919 + Mapper: 1 + - CRC: 3888289880 + Mapper: 1 + - CRC: 106476468 + Mapper: 1 + - CRC: 3913142030 + Mapper: 1 + - CRC: 1654312577 + Mapper: 1 + - CRC: 976523277 + Mapper: 1 + - CRC: 1419780000 + Mapper: 1 + - CRC: 1343935400 + Mapper: 1 + - CRC: 426495558 + Mapper: 1 + - CRC: 276578380 + Mapper: 176 + - CRC: 873691294 + Mapper: 4 + - CRC: 3621515230 + Mapper: 5 + - CRC: 688780141 + Mapper: 4 + - CRC: 3675630312 + Mapper: 4 + - CRC: 1620334774 + Mapper: 163 + - CRC: 867305664 + Mapper: 163 + - CRC: 777055758 + Mapper: 1 + - CRC: 1218306707 + Mapper: 10 + - CRC: 1324145654 + Mapper: 10 + - CRC: 3805217238 + Mapper: 10 + - CRC: 3443489021 + Mapper: 10 + - CRC: 1818616134 + Mapper: 10 + - CRC: 1622212283 + Mapper: 2 + - CRC: 3086317904 + Mapper: 3 + - CRC: 1794367224 + Mapper: 3 + - CRC: 1109848704 + Mapper: 2 + - CRC: 4111110835 + Mapper: 2 + - CRC: 3048513411 + Mapper: 4 + - CRC: 19796707 + Mapper: 1 + - CRC: 959325836 + Mapper: 1 + - CRC: 4135837932 + Mapper: 1 + - CRC: 1361618001 + Mapper: 4 + - CRC: 2242707788 + Mapper: 1 + - CRC: 2316503543 + Mapper: 23 + - CRC: 3088096014 + Mapper: 21 + - CRC: 1061399598 + Mapper: 25 + - CRC: 1467730212 + Mapper: 25 + - CRC: 2630220435 + Mapper: 75 + - CRC: 702147327 + Mapper: 22 + - CRC: 642875658 + Mapper: 156 + - CRC: 103597051 + Mapper: 4 + - CRC: 935508444 + Mapper: 3 + - CRC: 392220573 + Mapper: 2 + - CRC: 167833429 + Mapper: 69 + - CRC: 3018769433 + Mapper: 1 + - CRC: 4237018552 + Mapper: 23 + - CRC: 4288255380 + Mapper: 75 + - CRC: 909326674 + Mapper: 25 + - CRC: 1883435130 + Mapper: 4 + - CRC: 1733695916 + Mapper: 4 + - CRC: 2966877990 + Mapper: 1 + - CRC: 3959173117 + Mapper: 1 + - CRC: 2051846963 + Mapper: 0 + - CRC: 244216618 + Mapper: 3 + - CRC: 2719839704 + Mapper: 1 + - CRC: 2119818254 + Mapper: 1 + - CRC: 4128298135 + Mapper: 4 + - CRC: 4042232987 + Mapper: 4 + - CRC: 475484260 + Mapper: 4 + - CRC: 2944775486 + Mapper: 23 + - CRC: 778785863 + Mapper: 4 + - CRC: 418707647 + Mapper: 4 + - CRC: 3909252205 + Mapper: 1 + - CRC: 1341997644 + Mapper: 69 + - CRC: 2388491385 + Mapper: 2 + - CRC: 3793008528 + Mapper: 2 + - CRC: 2728878736 + Mapper: 3 + - CRC: 2503999052 + Mapper: 4 + - CRC: 708656673 + Mapper: 2 + - CRC: 2826468754 + Mapper: 1 + - CRC: 3546095945 + Mapper: 1 + - CRC: 1448046945 + Mapper: 78 + - CRC: 3355218987 + Mapper: 172 + - CRC: 230431742 + Mapper: 3 + - CRC: 2600999895 + Mapper: 112 + - CRC: 3837542573 + Mapper: 4 + - CRC: 1659721919 + Mapper: 66 + - CRC: 2325103308 + Mapper: 4 + - CRC: 1429340180 + Mapper: 19 + - CRC: 4237257244 + Mapper: 4 + - CRC: 4092428779 + Mapper: 1 + - CRC: 2823602982 + Mapper: 0 + - CRC: 1227174207 + Mapper: 33 + - CRC: 3513323108 + Mapper: 4 + - CRC: 3365034160 + Mapper: 1 + - CRC: 2447568359 + Mapper: 4 + - CRC: 1301456677 + Mapper: 2 + - CRC: 2723454918 + Mapper: 2 + - CRC: 2279477192 + Mapper: 3 + - CRC: 771624684 + Mapper: 4 + - CRC: 3898911311 + Mapper: 19 + - CRC: 2905345587 + Mapper: 4 + - CRC: 1934960856 + Mapper: 5 + - CRC: 4055302317 + Mapper: 184 + - CRC: 1923704699 + Mapper: 184 + - CRC: 2277887868 + Mapper: 206 + - CRC: 225392402 + Mapper: 4 + - CRC: 3571757005 + Mapper: 3 + - CRC: 3868154967 + Mapper: 1 + - CRC: 1513785411 + Mapper: 1 + - CRC: 2283169274 + Mapper: 4 + - CRC: 2822860511 + Mapper: 4 + - CRC: 1248434261 + Mapper: 65 + - CRC: 2190018550 + Mapper: 75 + - CRC: 1286776078 + Mapper: 19 + - CRC: 274658829 + Mapper: 0 + - CRC: 3240735407 + Mapper: 1 + - CRC: 2951507295 + Mapper: 2 + - CRC: 3318674116 + Mapper: 1 + - CRC: 3464838925 + Mapper: 23 + - CRC: 498395132 + Mapper: 23 + - CRC: 1457840143 + Mapper: 65 + - CRC: 2721967958 + Mapper: 4 + - CRC: 3733723100 + Mapper: 4 + - CRC: 1353983966 + Mapper: 4 + - CRC: 4095562611 + Mapper: 2 + - CRC: 16028545 + Mapper: 85 + - CRC: 2794499741 + Mapper: 206 + - CRC: 436136479 + Mapper: 2 + - CRC: 3569336982 + Mapper: 24 + - CRC: 2550142456 + Mapper: 4 + - CRC: 1923019235 + Mapper: 4 + - CRC: 651102808 + Mapper: 0 + - CRC: 728636840 + Mapper: 1 + - CRC: 1984702592 + Mapper: 4 + - CRC: 1615752870 + Mapper: 0 + - CRC: 1685976711 + Mapper: 2 + - CRC: 1304613611 + Mapper: 206 + - CRC: 1066121517 + Mapper: 1 + - CRC: 1921582123 + Mapper: 26 + - CRC: 3649521127 + Mapper: 18 + - CRC: 3018564244 + Mapper: 4 + - CRC: 4149003842 + Mapper: 68 + - CRC: 2081504628 + Mapper: 0 + - CRC: 673288263 + Mapper: 0 + - CRC: 177263779 + Mapper: 118 + - CRC: 1010328445 + Mapper: 19 + - CRC: 3854906550 + Mapper: 1 + - CRC: 1364245533 + Mapper: 1 + - CRC: 4154864323 + Mapper: 1 + - CRC: 1974656533 + Mapper: 1 + - CRC: 1827667676 + Mapper: 4 + - CRC: 1770849439 + Mapper: 4 + - CRC: 3028547332 + Mapper: 4 + - CRC: 409712575 + Mapper: 5 + - CRC: 3304987127 + Mapper: 5 + - CRC: 1982223281 + Mapper: 4 + - CRC: 2234488150 + Mapper: 4 + - CRC: 767317459 + Mapper: 80 + - CRC: 3835642000 + Mapper: 1 + - CRC: 1341377154 + Mapper: 140 + - CRC: 2940900799 + Mapper: 3 + - CRC: 2385158331 + Mapper: 0 + - CRC: 2872673696 + Mapper: 0 + - CRC: 2497779060 + Mapper: 4 + - CRC: 2156251741 + Mapper: 4 + - CRC: 2249078824 + Mapper: 1 + - CRC: 2950807828 + Mapper: 1 + - CRC: 3671305770 + Mapper: 3 + - CRC: 3487964459 + Mapper: 23 + - CRC: 1618181441 + Mapper: 75 + - CRC: 1280550385 + Mapper: 25 + - CRC: 2157721720 + Mapper: 4 + - CRC: 2034757318 + Mapper: 4 + - CRC: 339473375 + Mapper: 4 + - CRC: 2579042213 + Mapper: 19 + - CRC: 378942796 + Mapper: 210 + - CRC: 348076931 + Mapper: 4 + - CRC: 2398815287 + Mapper: 4 + - CRC: 4230052677 + Mapper: 4 + - CRC: 3315873038 + Mapper: 2 + - CRC: 2943610596 + Mapper: 0 + - CRC: 3473562696 + Mapper: 87 + - CRC: 3276707842 + Mapper: 87 + - CRC: 4129491029 + Mapper: 18 + - CRC: 3856037693 + Mapper: 18 + - CRC: 2113304130 + Mapper: 18 + - CRC: 1684360367 + Mapper: 75 + - CRC: 1497653302 + Mapper: 0 + - CRC: 442295687 + Mapper: 1 + - CRC: 2231870713 + Mapper: 1 + - CRC: 1019569210 + Mapper: 68 + - CRC: 2394476187 + Mapper: 1 + - CRC: 3708638884 + Mapper: 2 + - CRC: 1849455330 + Mapper: 32 + - CRC: 3447891679 + Mapper: 1 + - CRC: 922867120 + Mapper: 4 + - CRC: 1154506747 + Mapper: 4 + - CRC: 4138802528 + Mapper: 66 + - CRC: 2722917922 + Mapper: 23 + - CRC: 1928244781 + Mapper: 1 + - CRC: 3748020352 + Mapper: 1 + - CRC: 3654011269 + Mapper: 1 + - CRC: 443677958 + Mapper: 1 + - CRC: 3021838075 + Mapper: 0 + - CRC: 4147145720 + Mapper: 32 + - CRC: 1871043859 + Mapper: 32 + - CRC: 2779838947 + Mapper: 2 + - CRC: 1761867452 + Mapper: 19 + - CRC: 1923029195 + Mapper: 2 + - CRC: 4142747937 + Mapper: 2 + - CRC: 3272829088 + Mapper: 18 + - CRC: 2836575969 + Mapper: 18 + - CRC: 3061195341 + Mapper: 152 + - CRC: 3043446223 + Mapper: 224 + - CRC: 2073181990 + Mapper: 163 + - CRC: 3387355431 + Mapper: 1 + - CRC: 343628549 + Mapper: 0 + - CRC: 740130556 + Mapper: 33 + - CRC: 3547923722 + Mapper: 1 + - CRC: 3052350959 + Mapper: 1 + - CRC: 1765092196 + Mapper: 3 + - CRC: 596582726 + Mapper: 2 + - CRC: 37153320 + Mapper: 69 + - CRC: 2724094795 + Mapper: 0 + - CRC: 4091992683 + Mapper: 32 + - CRC: 2849599818 + Mapper: 4 + - CRC: 3331665857 + Mapper: 3 + - CRC: 106143476 + Mapper: 4 + - CRC: 1812030235 + Mapper: 4 + - CRC: 1570134854 + Mapper: 4 + - CRC: 1634352784 + Mapper: 2 + - CRC: 3974713834 + Mapper: 4 + - CRC: 1877413 + Mapper: 1 + - CRC: 2420552653 + Mapper: 2 + - CRC: 2361143388 + Mapper: 4 + - CRC: 3152045512 + Mapper: 4 + - CRC: 4113328087 + Mapper: 1 + - CRC: 2275861947 + Mapper: 4 + - CRC: 4237869571 + Mapper: 1 + - CRC: 980264065 + Mapper: 18 + - CRC: 3080326382 + Mapper: 2 + - CRC: 3198518905 + Mapper: 4 + - CRC: 3048992233 + Mapper: 4 + - CRC: 4147697401 + Mapper: 4 + - CRC: 2220810189 + Mapper: 3 + - CRC: 2977081042 + Mapper: 3 + - CRC: 354657129 + Mapper: 3 + - CRC: 447225623 + Mapper: 4 + - CRC: 520609217 + Mapper: 4 + - CRC: 1065527261 + Mapper: 4 + - CRC: 4233279600 + Mapper: 4 + - CRC: 2205146208 + Mapper: 159 + - CRC: 3717474966 + Mapper: 159 + - CRC: 1889692403 + Mapper: 159 + - CRC: 2904800124 + Mapper: 159 + - CRC: 2680262111 + Mapper: 4 + - CRC: 2668605901 + Mapper: 4 + - CRC: 2822831440 + Mapper: 4 + - CRC: 3894270198 + Mapper: 19 + - CRC: 1326595268 + Mapper: 2 + - CRC: 2291142526 + Mapper: 1 + - CRC: 2748472742 + Mapper: 2 + - CRC: 3841504510 + Mapper: 4 + - CRC: 3069707861 + Mapper: 1 + - CRC: 2067845685 + Mapper: 1 + - CRC: 2461321173 + Mapper: 3 + - CRC: 4154354239 + Mapper: 4 + - CRC: 1595873566 + Mapper: 2 + - CRC: 839063832 + Mapper: 2 + - CRC: 3502575383 + Mapper: 210 + - CRC: 1982279271 + Mapper: 3 + - CRC: 1456704179 + Mapper: 152 + - CRC: 1089933758 + Mapper: 152 + - CRC: 89228248 + Mapper: 3 + - CRC: 3404517287 + Mapper: 2 + - CRC: 1605496053 + Mapper: 0 + - CRC: 3017975612 + Mapper: 1 + - CRC: 95016869 + Mapper: 1 + - CRC: 2324480477 + Mapper: 19 + - CRC: 4118578391 + Mapper: 19 + - CRC: 2456624372 + Mapper: 206 + - CRC: 3362642005 + Mapper: 2 + - CRC: 2632674672 + Mapper: 2 + - CRC: 206589685 + Mapper: 1 + - CRC: 127290498 + Mapper: 1 + - CRC: 2914632816 + Mapper: 0 + - CRC: 184666477 + Mapper: 2 + - CRC: 2248903340 + Mapper: 4 + - CRC: 1124186476 + Mapper: 3 + - CRC: 3005579794 + Mapper: 4 + - CRC: 1135671921 + Mapper: 4 + - CRC: 2788062816 + Mapper: 0 + - CRC: 1425849923 + Mapper: 4 + - CRC: 773981980 + Mapper: 3 + - CRC: 2818398896 + Mapper: 1 + - CRC: 4219145975 + Mapper: 4 + - CRC: 3782962812 + Mapper: 4 + - CRC: 3482378141 + Mapper: 4 + - CRC: 3961612967 + Mapper: 4 + - CRC: 3268074310 + Mapper: 4 + - CRC: 2533852698 + Mapper: 2 + - CRC: 1023325409 + Mapper: 206 + - CRC: 3783027481 + Mapper: 4 + - CRC: 3493961548 + Mapper: 2 + - CRC: 1853363584 + Mapper: 1 + - CRC: 2317413409 + Mapper: 1 + - CRC: 811322721 + Mapper: 3 + - CRC: 2709568881 + Mapper: 4 + - CRC: 4030916133 + Mapper: 80 + - CRC: 896804599 + Mapper: 2 + - CRC: 884306490 + Mapper: 1 + - CRC: 1796122144 + Mapper: 1 + - CRC: 245208610 + Mapper: 4 + - CRC: 4264544434 + Mapper: 4 + - CRC: 2121166456 + Mapper: 4 + - CRC: 2117519755 + Mapper: 1 + - CRC: 378555707 + Mapper: 207 + - CRC: 260241791 + Mapper: 1 + - CRC: 1506748502 + Mapper: 1 + - CRC: 562739559 + Mapper: 2 + - CRC: 1522242685 + Mapper: 4 + - CRC: 1549164325 + Mapper: 118 + - CRC: 1908941883 + Mapper: 210 + - CRC: 2878202001 + Mapper: 1 + - CRC: 1610160018 + Mapper: 2 + - CRC: 1088383589 + Mapper: 1 + - CRC: 44703299 + Mapper: 1 + - CRC: 837334620 + Mapper: 4 + - CRC: 1688730638 + Mapper: 1 + - CRC: 3817029690 + Mapper: 4 + - CRC: 143238577 + Mapper: 23 + - CRC: 1218539877 + Mapper: 23 + - CRC: 4252742399 + Mapper: 1 + - CRC: 2957097868 + Mapper: 162 + - CRC: 3291140465 + Mapper: 162 + - CRC: 1592987090 + Mapper: 1 + - CRC: 3787424202 + Mapper: 4 + - CRC: 3669336455 + Mapper: 18 + - CRC: 3954936978 + Mapper: 4 + - CRC: 1146403048 + Mapper: 2 + - CRC: 193397541 + Mapper: 2 + - CRC: 1318956594 + Mapper: 184 + - CRC: 1135531537 + Mapper: 68 + - CRC: 922145291 + Mapper: 206 + - CRC: 803877058 + Mapper: 206 + - CRC: 2631807030 + Mapper: 4 + - CRC: 437925512 + Mapper: 4 + - CRC: 835721685 + Mapper: 4 + - CRC: 4016376048 + Mapper: 4 + - CRC: 841946309 + Mapper: 3 + - CRC: 2637081649 + Mapper: 3 + - CRC: 2314791898 + Mapper: 1 + - CRC: 1838464079 + Mapper: 184 + - CRC: 483519207 + Mapper: 4 + - CRC: 646309703 + Mapper: 112 + - CRC: 2558950951 + Mapper: 112 + - CRC: 436519483 + Mapper: 19 + - CRC: 3053200264 + Mapper: 4 + - CRC: 1701647481 + Mapper: 4 + - CRC: 802499315 + Mapper: 4 + - CRC: 2364220407 + Mapper: 4 + - CRC: 1291945457 + Mapper: 2 + - CRC: 3911859096 + Mapper: 4 + - CRC: 3186700412 + Mapper: 22 + - CRC: 1287315952 + Mapper: 22 + - CRC: 1020194389 + Mapper: 80 + - CRC: 3709554706 + Mapper: 4 + - CRC: 3111912128 + Mapper: 4 + - CRC: 3611341660 + Mapper: 87 + - CRC: 1705546166 + Mapper: 2 + - CRC: 1249473793 + Mapper: 2 + - CRC: 3444733257 + Mapper: 206 + - CRC: 2535882309 + Mapper: 210 + - CRC: 1949422083 + Mapper: 210 + - CRC: 1211345240 + Mapper: 206 + - CRC: 2813266873 + Mapper: 21 + - CRC: 2042992765 + Mapper: 21 + - CRC: 622870666 + Mapper: 21 + - CRC: 205635689 + Mapper: 4 + - CRC: 1784031527 + Mapper: 4 + - CRC: 591895013 + Mapper: 4 + - CRC: 3688611495 + Mapper: 2 + - CRC: 3452342833 + Mapper: 4 + - CRC: 949106148 + Mapper: 2 + - CRC: 1534288342 + Mapper: 83 + - CRC: 3620560637 + Mapper: 163 + - CRC: 2980594707 + Mapper: 1 + - CRC: 2667076595 + Mapper: 140 + - CRC: 1745243510 + Mapper: 118 + - CRC: 2743935478 + Mapper: 4 + - CRC: 4108201573 + Mapper: 1 + - CRC: 208019105 + Mapper: 157 + - CRC: 1710402053 + Mapper: 157 + - CRC: 4031943954 + Mapper: 4 + - CRC: 3450660057 + Mapper: 1 + - CRC: 2093195349 + Mapper: 4 + - CRC: 2740218458 + Mapper: 4 + - CRC: 2412915267 + Mapper: 4 + - CRC: 2643236990 + Mapper: 33 + - CRC: 3508563342 + Mapper: 33 + - CRC: 4117443468 + Mapper: 100 + - CRC: 3543740785 + Mapper: 4 + - CRC: 4079988236 + Mapper: 1 + - CRC: 2018621332 + Mapper: 1 + - CRC: 4219892386 + Mapper: 4 + - CRC: 3113714552 + Mapper: 3 + - CRC: 3202049554 + Mapper: 3 + - CRC: 3543862107 + Mapper: 2 + - CRC: 1975272229 + Mapper: 4 + - CRC: 3884226718 + Mapper: 1 + - CRC: 3454773022 + Mapper: 78 + - CRC: 2353439879 + Mapper: 2 + - CRC: 2187473026 + Mapper: 32 + - CRC: 4219763994 + Mapper: 23 + - CRC: 252239749 + Mapper: 1 + - CRC: 3672260662 + Mapper: 1 + - CRC: 3801149072 + Mapper: 2 + - CRC: 28864549 + Mapper: 1 + - CRC: 3978902450 + Mapper: 201 + - CRC: 2473054708 + Mapper: 176 + - CRC: 597248373 + Mapper: 176 + - CRC: 2800711650 + Mapper: 0 + - CRC: 2639707308 + Mapper: 2 + - CRC: 1140537021 + Mapper: 2 + - CRC: 363973565 + Mapper: 2 + - CRC: 2938796508 + Mapper: 2 + - CRC: 3951613538 + Mapper: 7 + - CRC: 977779285 + Mapper: 2 + - CRC: 80537132 + Mapper: 2 + - CRC: 3664606177 + Mapper: 0 + - CRC: 3638127175 + Mapper: 0 + - CRC: 1782614547 + Mapper: 45 + - CRC: 1483856312 + Mapper: 2 + - CRC: 4149824432 + Mapper: 2 + - CRC: 1694096152 + Mapper: 15 + - CRC: 3224386211 + Mapper: 242 + - CRC: 2127861776 + Mapper: 246 + - CRC: 367429824 + Mapper: 111 + - CRC: 3239985385 + Mapper: 4 + - CRC: 3457164179 + Mapper: 15 + - CRC: 3277757096 + Mapper: 176 + - CRC: 3243683054 + Mapper: 163 + - CRC: 2675700591 + Mapper: 4 + - CRC: 1747783574 + Mapper: 163 + - CRC: 3542584646 + Mapper: 52 + - CRC: 2560266089 + Mapper: 52 + - CRC: 2318418705 + Mapper: 52 + - CRC: 203001371 + Mapper: 52 + - CRC: 1651627957 + Mapper: 52 + - CRC: 367057596 + Mapper: 52 + - CRC: 2236957795 + Mapper: 52 + - CRC: 838586211 + Mapper: 52 + - CRC: 183778621 + Mapper: 52 + - CRC: 2511829533 + Mapper: 52 + - CRC: 2988183794 + Mapper: 52 + - CRC: 4037835313 + Mapper: 44 + - CRC: 4294063145 + Mapper: 44 + - CRC: 3287552338 + Mapper: 52 + - CRC: 1010254952 + Mapper: 52 + - CRC: 3640395406 + Mapper: 201 + - CRC: 3494527206 + Mapper: 3 + - CRC: 444107343 + Mapper: 4 + - CRC: 1532239456 + Mapper: 115 + - CRC: 925436704 + Mapper: 176 + - CRC: 2647856005 + Mapper: 241 + - CRC: 2942701265 + Mapper: 4 + - CRC: 2709340395 + Mapper: 152 + - CRC: 1843419699 + Mapper: 241 + - CRC: 2630408366 + Mapper: 0 + - CRC: 466048703 + Mapper: 1 + - CRC: 1071394750 + Mapper: 132 + - CRC: 3133037596 + Mapper: 15 + - CRC: 1887453386 + Mapper: 241 + - CRC: 4068009061 + Mapper: 3 + - CRC: 3295276117 + Mapper: 71 + - CRC: 1088549022 + Mapper: 71 + - CRC: 732990410 + Mapper: 4 + - CRC: 3637458291 + Mapper: 5 + - CRC: 3252443922 + Mapper: 15 + - CRC: 2174973991 + Mapper: 241 + - CRC: 3267110810 + Mapper: 4 + - CRC: 1301475072 + Mapper: 11 + - CRC: 1734242625 + Mapper: 12 + - CRC: 2616518667 + Mapper: 4 + - CRC: 4156892253 + Mapper: 4 + - CRC: 2861173205 + Mapper: 3 + - CRC: 2753108462 + Mapper: 3 + - CRC: 3161753013 + Mapper: 1 + - CRC: 2470966914 + Mapper: 3 + - CRC: 3064178916 + Mapper: 1 + - CRC: 3855685921 + Mapper: 0 + - CRC: 1153505351 + Mapper: 0 + - CRC: 4092406510 + Mapper: 4 + - CRC: 291684920 + Mapper: 4 + - CRC: 716697493 + Mapper: 1 + - CRC: 616236382 + Mapper: 5 + - CRC: 2580499936 + Mapper: 1 + - CRC: 3158702494 + Mapper: 4 + - CRC: 521142468 + Mapper: 218 + - CRC: 850164587 + Mapper: 218 + - CRC: 3052130419 + Mapper: 218 + - CRC: 759260335 + Mapper: 218 + - CRC: 2710144061 + Mapper: 0 + - CRC: 2202669437 + Mapper: 0 + - CRC: 431634056 + Mapper: 4 + - CRC: 3373921053 + Mapper: 4 + - CRC: 401355463 + Mapper: 241 + - CRC: 934507126 + Mapper: 241 + - CRC: 4280987274 + Mapper: 4 + - CRC: 1675070119 + Mapper: 66 + - CRC: 4191897533 + Mapper: 99 + - CRC: 2006020391 + Mapper: 1 + - CRC: 3364675021 + Mapper: 1 + - CRC: 1594873992 + Mapper: 82 + - CRC: 99634860 + Mapper: 82 + - CRC: 221140608 + Mapper: 15 + - CRC: 532874128 + Mapper: 4 + - CRC: 751044824 + Mapper: 4 + - CRC: 534976010 + Mapper: 4 + - CRC: 3120616385 + Mapper: 218 + - CRC: 85876934 + Mapper: 36 + - CRC: 3298780167 + Mapper: 66 + - CRC: 3585929701 + Mapper: 66 + - CRC: 2917652609 + Mapper: 241 + - CRC: 3167296179 + Mapper: 4 + - CRC: 834662365 + Mapper: 4 + - CRC: 3215981410 + Mapper: 4 + - CRC: 3566236659 + Mapper: 4 + - CRC: 3739245091 + Mapper: 4 + - CRC: 12789846 + Mapper: 4 + - CRC: 2134526685 + Mapper: 4 + - CRC: 314611392 + Mapper: 2 + - CRC: 2932514114 + Mapper: 99 + - CRC: 995051728 + Mapper: 137 + - CRC: 1079935356 + Mapper: 4 + - CRC: 3512300041 + Mapper: 4 + - CRC: 1852412863 + Mapper: 1 + - CRC: 2863723166 + Mapper: 4 + - CRC: 3283280798 + Mapper: 4 + - CRC: 4037434757 + Mapper: 4 + - CRC: 3271205932 + Mapper: 4 + - CRC: 770380472 + Mapper: 3 + - CRC: 31861474 + Mapper: 2 + - CRC: 2340268216 + Mapper: 1 + - CRC: 268374141 + Mapper: 99 + - CRC: 4250873095 + Mapper: 4 + - CRC: 1093556749 + Mapper: 99 + - CRC: 2097272032 + Mapper: 1 + - CRC: 648205589 + Mapper: 1 + - CRC: 3979608786 + Mapper: 3 + - CRC: 2139914802 + Mapper: 1 + - CRC: 493242981 + Mapper: 1 + - CRC: 1778209114 + Mapper: 75 + - CRC: 2830618663 + Mapper: 206 + - CRC: 2032988543 + Mapper: 99 + - CRC: 341896315 + Mapper: 15 + - CRC: 37674266 + Mapper: 4 + - CRC: 1199196045 + Mapper: 148 + - CRC: 3037839435 + Mapper: 176 + - CRC: 2280294141 + Mapper: 4 + - CRC: 53764227 + Mapper: 176 + - CRC: 1891268826 + Mapper: 176 + - CRC: 4265096054 + Mapper: 176 + - CRC: 1730897464 + Mapper: 241 + - CRC: 1810502197 + Mapper: 4 + - CRC: 2523345103 + Mapper: 0 + - CRC: 2342303986 + Mapper: 3 + - CRC: 2103503231 + Mapper: 15 + - CRC: 2245872054 + Mapper: 176 + - CRC: 3380131482 + Mapper: 241 + - CRC: 905493877 + Mapper: 176 + - CRC: 2883873197 + Mapper: 15 + - CRC: 2540873648 + Mapper: 164 + - CRC: 2972611751 + Mapper: 241 + - CRC: 2790185598 + Mapper: 15 + - CRC: 868605842 + Mapper: 195 + - CRC: 465616492 + Mapper: 195 + - CRC: 963272594 + Mapper: 195 + - CRC: 238755129 + Mapper: 4 + - CRC: 3312476366 + Mapper: 4 + - CRC: 167510727 + Mapper: 176 + - CRC: 461873739 + Mapper: 241 + - CRC: 2436601335 + Mapper: 176 + - CRC: 2888919743 + Mapper: 241 + - CRC: 3295440743 + Mapper: 241 + - CRC: 1254387270 + Mapper: 0 + - CRC: 2538276178 + Mapper: 173 + - CRC: 2621056715 + Mapper: 173 + - CRC: 1418527301 + Mapper: 15 + - CRC: 3999712744 + Mapper: 176 + - CRC: 2476454539 + Mapper: 189 + - CRC: 643895455 + Mapper: 176 + - CRC: 983385027 + Mapper: 4 + - CRC: 2140413446 + Mapper: 241 + - CRC: 2854462543 + Mapper: 241 + - CRC: 1044789283 + Mapper: 241 + - CRC: 458243013 + Mapper: 4 + - CRC: 2221708036 + Mapper: 4 + - CRC: 3778255340 + Mapper: 4 + - CRC: 3243577999 + Mapper: 176 + - CRC: 776941649 + Mapper: 176 + - CRC: 1350140641 + Mapper: 4 + - CRC: 892048342 + Mapper: 4 + - CRC: 421767365 + Mapper: 176 + - CRC: 1423543161 + Mapper: 241 + - CRC: 1609937404 + Mapper: 241 + - CRC: 2463791542 + Mapper: 0 + - CRC: 2545430355 + Mapper: 176 + - CRC: 35440657 + Mapper: 15 + - CRC: 1048951311 + Mapper: 4 + - CRC: 1022854063 + Mapper: 241 + - CRC: 2927971567 + Mapper: 74 + - CRC: 4082776136 + Mapper: 241 + - CRC: 3036921664 + Mapper: 165 + - CRC: 2541560515 + Mapper: 176 + - CRC: 733207230 + Mapper: 82 + - CRC: 197099723 + Mapper: 82 + - CRC: 2359766400 + Mapper: 82 + - CRC: 2958149243 + Mapper: 15 + - CRC: 777519544 + Mapper: 241 + - CRC: 896145129 + Mapper: 176 + - CRC: 1408499643 + Mapper: 241 + - CRC: 724067841 + Mapper: 3 + - CRC: 693644449 + Mapper: 150 + - CRC: 4123093780 + Mapper: 176 + - CRC: 689306352 + Mapper: 3 + - CRC: 253763853 + Mapper: 241 + - CRC: 4057465843 + Mapper: 176 + - CRC: 769271861 + Mapper: 176 + - CRC: 2457303929 + Mapper: 195 + - CRC: 3777554733 + Mapper: 66 + - CRC: 1226761959 + Mapper: 1 + - CRC: 487953488 + Mapper: 241 + - CRC: 3567063407 + Mapper: 176 + - CRC: 3909460561 + Mapper: 4 + - CRC: 1910174118 + Mapper: 176 + - CRC: 42805674 + Mapper: 241 + - CRC: 3797021792 + Mapper: 150 + - CRC: 3081586355 + Mapper: 241 + - CRC: 3514414312 + Mapper: 241 + - CRC: 3907713985 + Mapper: 176 + - CRC: 1108743472 + Mapper: 176 + - CRC: 1407526093 + Mapper: 228 + - CRC: 1361564315 + Mapper: 228 + - CRC: 2789365080 + Mapper: 228 + - CRC: 2795197011 + Mapper: 228 + - CRC: 1315105051 + Mapper: 228 + - CRC: 141280439 + Mapper: 228 + - CRC: 2989625668 + Mapper: 228 + - CRC: 976451340 + Mapper: 228 + - CRC: 420318289 + Mapper: 228 + - CRC: 321810081 + Mapper: 228 + - CRC: 1020850319 + Mapper: 228 + - CRC: 3941062816 + Mapper: 228 + - CRC: 188308130 + Mapper: 228 + - CRC: 972647322 + Mapper: 228 + - CRC: 1402007393 + Mapper: 3 + - CRC: 690878114 + Mapper: 4 + - CRC: 1862343829 + Mapper: 0 + - CRC: 1084942306 + Mapper: 0 + - CRC: 2598224214 + Mapper: 0 + - CRC: 1630573905 + Mapper: 0 + - CRC: 2587816164 + Mapper: 15 + - CRC: 731244693 + Mapper: 34 + - CRC: 3183242895 + Mapper: 34 + - CRC: 960487618 + Mapper: 34 + - CRC: 506247372 + Mapper: 34 + - CRC: 1103740192 + Mapper: 15 + - CRC: 1755765048 + Mapper: 2 + - CRC: 1439359806 + Mapper: 2 + - CRC: 2039095314 + Mapper: 4 + - CRC: 524362254 + Mapper: 4 + - CRC: 2134753051 + Mapper: 176 + - CRC: 3054930012 + Mapper: 176 + - CRC: 1476466001 + Mapper: 34 + - CRC: 3994856707 + Mapper: 4 + - CRC: 1695703131 + Mapper: 4 + - CRC: 4114580445 + Mapper: 4 + - CRC: 1556947145 + Mapper: 4 + - CRC: 2506300 + Mapper: 4 + - CRC: 710658693 + Mapper: 4 + - CRC: 2664808008 + Mapper: 30 + - CRC: 987930960 + Mapper: 30 + - CRC: 3171360295 + Mapper: 30 + - CRC: 2233264656 + Mapper: 0 + - CRC: 2651791543 + Mapper: 30 + - CRC: 2799708533 + Mapper: 0 + - CRC: 2719864079 + Mapper: 30 + - CRC: 3503343922 + Mapper: 0 + - CRC: 3442865350 + Mapper: 30 + - CRC: 4272621809 + Mapper: 2 + - CRC: 180123480 + Mapper: 30 + - CRC: 4174400160 + Mapper: 2 + - CRC: 1269000406 + Mapper: 30 + - CRC: 2416748581 + Mapper: 2 + - CRC: 97032071 + Mapper: 30 + - CRC: 929865676 + Mapper: 2 + - CRC: 3189765019 + Mapper: 30 + - CRC: 1791967837 + Mapper: 30 + - CRC: 943922166 + Mapper: 2 + - CRC: 1040402027 + Mapper: 2 + - CRC: 3134598267 + Mapper: 30 + - CRC: 625200872 + Mapper: 30 + - CRC: 3635110536 + Mapper: 2 + - CRC: 3308064939 + Mapper: 4 + - CRC: 206875549 + Mapper: 3 + - CRC: 2497673891 + Mapper: 1 + - CRC: 268854161 + Mapper: 2 + - CRC: 3700887250 + Mapper: 111 + - CRC: 2076978766 + Mapper: 0 + - CRC: 631053326 + Mapper: 0 + - CRC: 1829503454 + Mapper: 111 + - CRC: 1900410471 + Mapper: 30 + - CRC: 2513940758 + Mapper: 4 + - CRC: 4163188312 + Mapper: 30 + - CRC: 3814055025 + Mapper: 30 + - CRC: 4266831868 + Mapper: 30 + - CRC: 1958224801 + Mapper: 30 + - CRC: 1220237937 + Mapper: 2 + - CRC: 2935252174 + Mapper: 2 + - CRC: 4200421965 + Mapper: 30 + - CRC: 1356044990 + Mapper: 0 + - CRC: 583617888 + Mapper: 0 + - CRC: 771284578 + Mapper: 30 + - CRC: 2102802754 + Mapper: 2 + - CRC: 2901173550 + Mapper: 2 + - CRC: 815114012 + Mapper: 5 + - CRC: 3444470832 + Mapper: 5 + - CRC: 1024890779 + Mapper: 1 + - CRC: 1889227954 + Mapper: 1 + - CRC: 2596477413 + Mapper: 11 + - CRC: 2659861943 + Mapper: 1 + - CRC: 3311437015 + Mapper: 1 + - CRC: 1015556930 + Mapper: 2 + - CRC: 3287524512 + Mapper: 0 + - CRC: 1968930137 + Mapper: 2 + - CRC: 1997058694 + Mapper: 2 + - CRC: 3152253915 + Mapper: 4 + - CRC: 3989301446 + Mapper: 1 + - CRC: 1427743526 + Mapper: 3 + - CRC: 2427564809 + Mapper: 3 + - CRC: 3683546824 + Mapper: 0 + - CRC: 1170422299 + Mapper: 2 + - CRC: 1460164985 + Mapper: 2 + - CRC: 3793913000 + Mapper: 30 + - CRC: 1403642554 + Mapper: 4 + - CRC: 2897078935 + Mapper: 0 + - CRC: 3969687187 + Mapper: 3 + - CRC: 3319038055 + Mapper: 4 + - CRC: 2567489225 + Mapper: 3 + - CRC: 4083617763 + Mapper: 0 + - CRC: 122467111 + Mapper: 0 + - CRC: 1450123110 + Mapper: 2 + - CRC: 1513590492 + Mapper: 0 + - CRC: 1967516248 + Mapper: 30 + - CRC: 1267002274 + Mapper: 0 + - CRC: 2451179948 + Mapper: 30 + - CRC: 999670101 + Mapper: 4 + - CRC: 1609540347 + Mapper: 111 + - CRC: 481807938 + Mapper: 1 + - CRC: 1931958167 + Mapper: 0 + - CRC: 4213544156 + Mapper: 0 + - CRC: 71181637 + Mapper: 34 + - CRC: 4093760494 + Mapper: 4 + - CRC: 2808619369 + Mapper: 4 + - CRC: 13266695 + Mapper: 105 + - CRC: 1905177610 + Mapper: 2 + - CRC: 735249033 + Mapper: 4 + - CRC: 1618566989 + Mapper: 111 + - CRC: 1689245074 + Mapper: 23 + - CRC: 4174846355 + Mapper: 2 + - CRC: 834548539 + Mapper: 30 + - CRC: 2344629260 + Mapper: 30 + - CRC: 2870072689 + Mapper: 111 + - CRC: 139631946 + Mapper: 1 + - CRC: 4232127646 + Mapper: 4 + - CRC: 1750362927 + Mapper: 34 + - CRC: 261305277 + Mapper: 34 + - CRC: 3083784720 + Mapper: 4 + - CRC: 47454954 + Mapper: 2 + - CRC: 474468866 + Mapper: 2 + - CRC: 2300318908 + Mapper: 30 + - CRC: 3479036604 + Mapper: 1 + - CRC: 1503013333 + Mapper: 4 + - CRC: 262836083 + Mapper: 4 + - CRC: 1756911912 + Mapper: 4 + - CRC: 3704049394 + Mapper: 4 + - CRC: 1315672184 + Mapper: 0 + - CRC: 1185887979 + Mapper: 30 + - CRC: 2960234871 + Mapper: 0 + - CRC: 1088112096 + Mapper: 4 + - CRC: 2714430980 + Mapper: 0 + - CRC: 1734072779 + Mapper: 30 + - CRC: 552051870 + Mapper: 30 + - CRC: 2024283147 + Mapper: 30 + - CRC: 573248416 + Mapper: 30 + - CRC: 288534185 + Mapper: 0 + - CRC: 780562509 + Mapper: 30 + - CRC: 1421668364 + Mapper: 4 + - CRC: 206093022 + Mapper: 34 + - CRC: 3743043712 + Mapper: 1 + - CRC: 850305071 + Mapper: 30 + - CRC: 258908415 + Mapper: 0 + - CRC: 3370867325 + Mapper: 0 + - CRC: 1683574179 + Mapper: 4 + - CRC: 3885476759 + Mapper: 30 + - CRC: 3005391854 + Mapper: 30 + - CRC: 2002588876 + Mapper: 4 + - CRC: 2303697313 + Mapper: 2 + - CRC: 3908402127 + Mapper: 2 + - CRC: 763414238 + Mapper: 2 + - CRC: 1822471260 + Mapper: 4 + - CRC: 1767914935 + Mapper: 4 + - CRC: 2818740390 + Mapper: 0 + - CRC: 3865761464 + Mapper: 0 + - CRC: 1634122625 + Mapper: 0 + - CRC: 2843659867 + Mapper: 1 + - CRC: 1480358946 + Mapper: 30 + - CRC: 2514470684 + Mapper: 30 + - CRC: 3030888468 + Mapper: 2 + - CRC: 3367588152 + Mapper: 30 + - CRC: 2186482634 + Mapper: 2 + - CRC: 2530797918 + Mapper: 4 + - CRC: 4129241866 + Mapper: 4 + - CRC: 1317733659 + Mapper: 30 + - CRC: 2012120956 + Mapper: 3 + - CRC: 3248333183 + Mapper: 1 + - CRC: 2973257325 + Mapper: 1 + - CRC: 1333060150 + Mapper: 71 + - CRC: 417643773 + Mapper: 2 + - CRC: 1243653221 + Mapper: 2 + - CRC: 997620554 + Mapper: 2 + - CRC: 941866449 + Mapper: 4 + - CRC: 3236279208 + Mapper: 4 + - CRC: 2574697497 + Mapper: 4 + - CRC: 1947525080 + Mapper: 4 + - CRC: 3420625986 + Mapper: 4 + - CRC: 2278526710 + Mapper: 2 + - CRC: 2189542671 + Mapper: 23 + - CRC: 4068312891 + Mapper: 24 + - CRC: 626025405 + Mapper: 23 + - CRC: 2378961300 + Mapper: 23 + - CRC: 4114630478 + Mapper: 1 + - CRC: 2774492887 + Mapper: 4 + - CRC: 1590199972 + Mapper: 1 + - CRC: 211871113 + Mapper: 184 + - CRC: 998456522 + Mapper: 0 + - CRC: 2742394035 + Mapper: 1 + - CRC: 2636163909 + Mapper: 0 + - CRC: 532006749 + Mapper: 0 + - CRC: 1736841767 + Mapper: 0 + - CRC: 3757041869 + Mapper: 0 + - CRC: 2864778262 + Mapper: 0 + - CRC: 35664563 + Mapper: 0 + - CRC: 2795118378 + Mapper: 0 + - CRC: 2641861384 + Mapper: 0 + - CRC: 1714130076 + Mapper: 0 + - CRC: 2169470481 + Mapper: 0 + - CRC: 3570313699 + Mapper: 0 + - CRC: 2377324336 + Mapper: 0 + - CRC: 3892317175 + Mapper: 0 + - CRC: 3724626298 + Mapper: 0 + - CRC: 3602634938 + Mapper: 0 + - CRC: 1189139325 + Mapper: 1 + - CRC: 877921048 + Mapper: 1 + - CRC: 640627116 + Mapper: 1 + - CRC: 802758014 + Mapper: 0 + - CRC: 2014904820 + Mapper: 0 + - CRC: 1059307924 + Mapper: 0 + - CRC: 3522957014 + Mapper: 0 + - CRC: 2758462118 + Mapper: 0 + - CRC: 2396372100 + Mapper: 0 + - CRC: 140083273 + Mapper: 1 + - CRC: 3858788437 + Mapper: 0 + - CRC: 1405194776 + Mapper: 0 + - CRC: 2727501863 + Mapper: 0 + - CRC: 1594748032 + Mapper: 2 + - CRC: 3899092343 + Mapper: 0 + - CRC: 1948446487 + Mapper: 0 + - CRC: 3911109673 + Mapper: 1 + - CRC: 346916196 + Mapper: 0 + - CRC: 2799123395 + Mapper: 3 + - CRC: 2687601588 + Mapper: 3 + - CRC: 921116430 + Mapper: 4 + - CRC: 1260324850 + Mapper: 4 + - CRC: 1968017712 + Mapper: 4 + - CRC: 1887772742 + Mapper: 3 + - CRC: 3919118888 + Mapper: 206 + - CRC: 1202074548 + Mapper: 0 + - CRC: 4148585552 + Mapper: 0 + - CRC: 220685455 + Mapper: 0 + - CRC: 264380389 + Mapper: 76 + - CRC: 3341669812 + Mapper: 206 + - CRC: 2905538941 + Mapper: 95 + - CRC: 2719721032 + Mapper: 4 + - CRC: 1822086248 + Mapper: 88 + - CRC: 2084097828 + Mapper: 206 + - CRC: 1430664738 + Mapper: 206 + - CRC: 43357345 + Mapper: 206 + - CRC: 87739963 + Mapper: 0 + - CRC: 1528701029 + Mapper: 0 + - CRC: 2119474761 + Mapper: 4 + - CRC: 904024458 + Mapper: 19 + - CRC: 3827425971 + Mapper: 4 + - CRC: 709832906 + Mapper: 206 + - CRC: 134789798 + Mapper: 0 + - CRC: 3899691705 + Mapper: 4 + - CRC: 593195501 + Mapper: 206 + - CRC: 3414742813 + Mapper: 19 + - CRC: 1892458754 + Mapper: 0 + - CRC: 4284463058 + Mapper: 19 + - CRC: 2100905116 + Mapper: 19 + - CRC: 1140314069 + Mapper: 0 + - CRC: 1017429928 + Mapper: 88 + - CRC: 1840030266 + Mapper: 19 + - CRC: 650840171 + Mapper: 206 + - CRC: 362133461 + Mapper: 210 + - CRC: 1737515787 + Mapper: 0 + - CRC: 444020875 + Mapper: 206 + - CRC: 1707715213 + Mapper: 206 + - CRC: 3370093758 + Mapper: 0 + - CRC: 341831214 + Mapper: 206 + - CRC: 2220346636 + Mapper: 0 + - CRC: 3622690931 + Mapper: 0 + - CRC: 2141606278 + Mapper: 206 + - CRC: 584139386 + Mapper: 206 + - CRC: 2279604293 + Mapper: 19 + - CRC: 1910406346 + Mapper: 19 + - CRC: 719813531 + Mapper: 1 + - CRC: 2216075479 + Mapper: 1 + - CRC: 4092394922 + Mapper: 4 + - CRC: 1866580589 + Mapper: 4 + - CRC: 104350208 + Mapper: 0 + - CRC: 2470871952 + Mapper: 1 + - CRC: 328513299 + Mapper: 2 + - CRC: 2165320174 + Mapper: 2 + - CRC: 3852225177 + Mapper: 1 + - CRC: 1461966743 + Mapper: 1 + - CRC: 270169760 + Mapper: 1 + - CRC: 3176739564 + Mapper: 2 + - CRC: 1397690798 + Mapper: 2 + - CRC: 3875625513 + Mapper: 5 + - CRC: 79879282 + Mapper: 5 + - CRC: 3523704282 + Mapper: 87 + - CRC: 1840291015 + Mapper: 3 + - CRC: 3158224241 + Mapper: 0 + - CRC: 2011879697 + Mapper: 0 + - CRC: 1870023101 + Mapper: 1 + - CRC: 966886295 + Mapper: 4 + - CRC: 3317836317 + Mapper: 95 + - CRC: 1377394724 + Mapper: 0 + - CRC: 48978762 + Mapper: 0 + - CRC: 3083540276 + Mapper: 0 + - CRC: 1002483174 + Mapper: 0 + - CRC: 3069503078 + Mapper: 10 + - CRC: 3291309092 + Mapper: 1 + - CRC: 2234881305 + Mapper: 1 + - CRC: 894615163 + Mapper: 1 + - CRC: 745733296 + Mapper: 1 + - CRC: 2449647791 + Mapper: 1 + - CRC: 1662249927 + Mapper: 4 + - CRC: 2897145354 + Mapper: 4 + - CRC: 8982302 + Mapper: 4 + - CRC: 3077435069 + Mapper: 10 + - CRC: 2137852072 + Mapper: 1 + - CRC: 3789011361 + Mapper: 0 + - CRC: 2138747618 + Mapper: 25 + - CRC: 933282021 + Mapper: 69 + - CRC: 2352355182 + Mapper: 0 + - CRC: 1332722290 + Mapper: 4 + - CRC: 1699661760 + Mapper: 1 + - CRC: 2928687118 + Mapper: 3 + - CRC: 2338488443 + Mapper: 3 + - CRC: 3521087686 + Mapper: 2 + - CRC: 1528738295 + Mapper: 0 + - CRC: 4269212858 + Mapper: 0 + - CRC: 2962031476 + Mapper: 0 + - CRC: 4174734585 + Mapper: 0 + - CRC: 2579698734 + Mapper: 0 + - CRC: 469648043 + Mapper: 1 + - CRC: 3807869032 + Mapper: 4 + - CRC: 3983842896 + Mapper: 1 + - CRC: 3794303377 + Mapper: 1 + - CRC: 22078191 + Mapper: 1 + - CRC: 380658999 + Mapper: 4 + - CRC: 2324213369 + Mapper: 4 + - CRC: 1704093416 + Mapper: 4 + - CRC: 1722001997 + Mapper: 4 + - CRC: 6059369 + Mapper: 4 + - CRC: 1036686922 + Mapper: 4 + - CRC: 2935338066 + Mapper: 2 + - CRC: 2146100806 + Mapper: 4 + - CRC: 1372894273 + Mapper: 5 + - CRC: 3583695679 + Mapper: 1 + - CRC: 132698319 + Mapper: 1 + - CRC: 62769519 + Mapper: 3 + - CRC: 1301906995 + Mapper: 3 + - CRC: 3010685667 + Mapper: 4 + - CRC: 2572407626 + Mapper: 1 + - CRC: 1075538640 + Mapper: 1 + - CRC: 603143458 + Mapper: 118 + - CRC: 3521571513 + Mapper: 4 + - CRC: 3204140968 + Mapper: 4 + - CRC: 1976463074 + Mapper: 4 + - CRC: 803518021 + Mapper: 1 + - CRC: 2600995694 + Mapper: 0 + - CRC: 2351964900 + Mapper: 1 + - CRC: 3082659322 + Mapper: 9 + - CRC: 3704276697 + Mapper: 9 + - CRC: 480513967 + Mapper: 2 + - CRC: 4224648848 + Mapper: 1 + - CRC: 298351618 + Mapper: 4 + - CRC: 286993181 + Mapper: 4 + - CRC: 465827131 + Mapper: 4 + - CRC: 2812816224 + Mapper: 2 + - CRC: 663809384 + Mapper: 1 + - CRC: 1714714297 + Mapper: 1 + - CRC: 873718587 + Mapper: 3 + - CRC: 698428394 + Mapper: 4 + - CRC: 4104043774 + Mapper: 206 + - CRC: 1213796755 + Mapper: 0 + - CRC: 4206531814 + Mapper: 0 + - CRC: 1558020111 + Mapper: 0 + - CRC: 3887287298 + Mapper: 4 + - CRC: 4138092341 + Mapper: 4 + - CRC: 863311746 + Mapper: 4 + - CRC: 2280180380 + Mapper: 2 + - CRC: 3354747016 + Mapper: 4 + - CRC: 3199946241 + Mapper: 1 + - CRC: 91172963 + Mapper: 4 + - CRC: 58503604 + Mapper: 4 + - CRC: 4046034922 + Mapper: 4 + - CRC: 4108296243 + Mapper: 4 + - CRC: 3295242719 + Mapper: 4 + - CRC: 1338836166 + Mapper: 4 + - CRC: 2148564868 + Mapper: 1 + - CRC: 3696079002 + Mapper: 1 + - CRC: 2205352478 + Mapper: 1 + - CRC: 2455528387 + Mapper: 3 + - CRC: 3842818410 + Mapper: 1 + - CRC: 1786052450 + Mapper: 1 + - CRC: 518960470 + Mapper: 4 + - CRC: 200456369 + Mapper: 4 + - CRC: 609724690 + Mapper: 206 + - CRC: 1889637061 + Mapper: 0 + - CRC: 3327220782 + Mapper: 0 + - CRC: 1694359593 + Mapper: 4 + - CRC: 3399969063 + Mapper: 4 + - CRC: 3529490982 + Mapper: 1 + - CRC: 1084887563 + Mapper: 1 + - CRC: 640214740 + Mapper: 4 + - CRC: 3419920725 + Mapper: 2 + - CRC: 3484721939 + Mapper: 3 + - CRC: 1928260899 + Mapper: 2 + - CRC: 1268699058 + Mapper: 21 + - CRC: 371951030 + Mapper: 210 + - CRC: 3467958527 + Mapper: 1 + - CRC: 3944285031 + Mapper: 19 + - CRC: 3241039938 + Mapper: 87 + - CRC: 3992325411 + Mapper: 87 + - CRC: 15461241 + Mapper: 1 + - CRC: 2143278425 + Mapper: 1 + - CRC: 517196451 + Mapper: 24 + - CRC: 1083554663 + Mapper: 3 + - CRC: 3480795654 + Mapper: 1 + - CRC: 292760793 + Mapper: 23 + - CRC: 2867455791 + Mapper: 1 + - CRC: 1269733058 + Mapper: 2 + - CRC: 3333530820 + Mapper: 4 + - CRC: 2933099866 + Mapper: 1 + - CRC: 3720612424 + Mapper: 86 + - CRC: 1618989742 + Mapper: 1 + - CRC: 1182191315 + Mapper: 1 + - CRC: 4237211194 + Mapper: 3 + - CRC: 3282612717 + Mapper: 1 + - CRC: 2781193505 + Mapper: 4 + - CRC: 2149318574 + Mapper: 4 + - CRC: 2192918373 + Mapper: 4 + - CRC: 724489452 + Mapper: 4 + - CRC: 268889031 + Mapper: 4 + - CRC: 2294507958 + Mapper: 1 + - CRC: 2297189872 + Mapper: 87 + - CRC: 1286775045 + Mapper: 0 + - CRC: 3645071714 + Mapper: 0 + - CRC: 1170783938 + Mapper: 101 + - CRC: 2738264962 + Mapper: 87 + - CRC: 1072762429 + Mapper: 2 + - CRC: 3455467276 + Mapper: 4 + - CRC: 3257876127 + Mapper: 1 + - CRC: 1337713433 + Mapper: 1 + - CRC: 1022839262 + Mapper: 1 + - CRC: 21229236 + Mapper: 2 + - CRC: 604529593 + Mapper: 2 + - CRC: 2913210290 + Mapper: 1 + - CRC: 4237159407 + Mapper: 152 + - CRC: 2758639362 + Mapper: 4 + - CRC: 3492526172 + Mapper: 2 + - CRC: 1348641611 + Mapper: 184 + - CRC: 507540359 + Mapper: 0 + - CRC: 3477373871 + Mapper: 3 + - CRC: 2084752251 + Mapper: 3 + - CRC: 2088372851 + Mapper: 1 + - CRC: 2026666347 + Mapper: 4 + - CRC: 702363636 + Mapper: 69 + - CRC: 2171261304 + Mapper: 4 + - CRC: 3415186103 + Mapper: 4 + - CRC: 4130013991 + Mapper: 71 + - CRC: 420369151 + Mapper: 4 + - CRC: 3062081622 + Mapper: 1 + - CRC: 3482922548 + Mapper: 4 + - CRC: 3435148352 + Mapper: 156 + - CRC: 2760713921 + Mapper: 2 + - CRC: 2375488860 + Mapper: 2 + - CRC: 4060704156 + Mapper: 2 + - CRC: 3981649515 + Mapper: 5 + - CRC: 1395822532 + Mapper: 2 + - CRC: 3429672156 + Mapper: 1 + - CRC: 616951600 + Mapper: 1 + - CRC: 1859329229 + Mapper: 1 + - CRC: 281046567 + Mapper: 1 + - CRC: 3407336478 + Mapper: 2 + - CRC: 2124139013 + Mapper: 2 + - CRC: 3202550879 + Mapper: 4 + - CRC: 872879069 + Mapper: 4 + - CRC: 2377398308 + Mapper: 1 + - CRC: 1857238777 + Mapper: 1 + - CRC: 105186734 + Mapper: 1 + - CRC: 2077918658 + Mapper: 1 + - CRC: 3937403566 + Mapper: 4 + - CRC: 2026432841 + Mapper: 4 + - CRC: 1095118113 + Mapper: 1 + - CRC: 1876336436 + Mapper: 1 + - CRC: 3298806452 + Mapper: 1 + - CRC: 1110623753 + Mapper: 1 + - CRC: 333487482 + Mapper: 4 + - CRC: 1674808198 + Mapper: 71 + - CRC: 2841838968 + Mapper: 71 + - CRC: 657849151 + Mapper: 71 + - CRC: 1328127944 + Mapper: 71 + - CRC: 740717419 + Mapper: 2 + - CRC: 4283684670 + Mapper: 2 + - CRC: 2313966536 + Mapper: 2 + - CRC: 2474885142 + Mapper: 30 + - CRC: 1131512989 + Mapper: 30 + - CRC: 207335243 + Mapper: 30 + - CRC: 2096696705 + Mapper: 4 + - CRC: 2156947415 + Mapper: 3 + - CRC: 3111910871 + Mapper: 3 + - CRC: 473029984 + Mapper: 3 + - CRC: 255560163 + Mapper: 0 + - CRC: 744467484 + Mapper: 1 + - CRC: 3836141905 + Mapper: 3 + - CRC: 2476928763 + Mapper: 1 + - CRC: 525592902 + Mapper: 1 + - CRC: 3727962093 + Mapper: 30 + - CRC: 2463983594 + Mapper: 1 + - CRC: 437641811 + Mapper: 69 + - CRC: 2810314666 + Mapper: 11 + - CRC: 1942805216 + Mapper: 1 + - CRC: 2648674327 + Mapper: 4 + - CRC: 4044406342 + Mapper: 1 + - CRC: 3367835912 + Mapper: 3 + - CRC: 3865153932 + Mapper: 69 + - CRC: 3706473049 + Mapper: 4 + - CRC: 2346532243 + Mapper: 4 + - CRC: 234905800 + Mapper: 1 + - CRC: 1473457435 + Mapper: 11 + - CRC: 967512007 + Mapper: 64 + - CRC: 1632340048 + Mapper: 4 + - CRC: 2747214554 + Mapper: 2 + - CRC: 4194043648 + Mapper: 2 + - CRC: 3642553308 + Mapper: 2 + - CRC: 3675203994 + Mapper: 4 + - CRC: 481927193 + Mapper: 4 + - CRC: 2644150724 + Mapper: 1 + - CRC: 1385728053 + Mapper: 0 + - CRC: 3111093025 + Mapper: 3 + - CRC: 2360134277 + Mapper: 4 + - CRC: 244604833 + Mapper: 4 + - CRC: 2580055624 + Mapper: 1 + - CRC: 4233132785 + Mapper: 4 + - CRC: 621658372 + Mapper: 4 + - CRC: 3687244340 + Mapper: 4 + - CRC: 3924671012 + Mapper: 0 + - CRC: 1271357206 + Mapper: 11 + - CRC: 1689832930 + Mapper: 64 + - CRC: 2927490943 + Mapper: 4 + - CRC: 2862585701 + Mapper: 23 + - CRC: 1495815329 + Mapper: 4 + - CRC: 2115267646 + Mapper: 4 + - CRC: 3084294765 + Mapper: 4 + - CRC: 757067376 + Mapper: 4 + - CRC: 1437861163 + Mapper: 2 + - CRC: 3725339049 + Mapper: 1 + - CRC: 306715840 + Mapper: 4 + - CRC: 3369507074 + Mapper: 4 + - CRC: 3454949684 + Mapper: 4 + - CRC: 2924335849 + Mapper: 4 + - CRC: 970409048 + Mapper: 4 + - CRC: 2707499192 + Mapper: 4 + - CRC: 2308051932 + Mapper: 4 + - CRC: 3739202527 + Mapper: 4 + - CRC: 2540220021 + Mapper: 1 + - CRC: 611609358 + Mapper: 0 + - CRC: 3109564256 + Mapper: 0 + - CRC: 4270128300 + Mapper: 4 + - CRC: 968348234 + Mapper: 11 + - CRC: 1744580160 + Mapper: 69 + - CRC: 1698757603 + Mapper: 4 + - CRC: 4112548959 + Mapper: 71 + - CRC: 783275433 + Mapper: 71 + - CRC: 1522268257 + Mapper: 1 + - CRC: 1860836112 + Mapper: 1 + - CRC: 2554531657 + Mapper: 71 + - CRC: 599719774 + Mapper: 1 + - CRC: 1663611981 + Mapper: 4 + - CRC: 568495952 + Mapper: 1 + - CRC: 1564524682 + Mapper: 2 + - CRC: 2435418588 + Mapper: 0 + - CRC: 1818584482 + Mapper: 4 + - CRC: 3919663563 + Mapper: 4 + - CRC: 2163449177 + Mapper: 79 + - CRC: 298429495 + Mapper: 1 + - CRC: 4140595865 + Mapper: 1 + - CRC: 1578534429 + Mapper: 79 + - CRC: 3947710091 + Mapper: 11 + - CRC: 4138406562 + Mapper: 1 + - CRC: 1809253498 + Mapper: 79 + - CRC: 356229564 + Mapper: 1 + - CRC: 3745767539 + Mapper: 4 + - CRC: 2059659425 + Mapper: 4 + - CRC: 1674817524 + Mapper: 4 + - CRC: 918794554 + Mapper: 2 + - CRC: 2026318965 + Mapper: 1 + - CRC: 1312183183 + Mapper: 4 + - CRC: 1764696214 + Mapper: 11 + - CRC: 3028293762 + Mapper: 4 + - CRC: 2422213509 + Mapper: 0 + - CRC: 362924976 + Mapper: 4 + - CRC: 4257727755 + Mapper: 5 + - CRC: 3606031245 + Mapper: 4 + - CRC: 1573502017 + Mapper: 7 + - CRC: 716113924 + Mapper: 11 + - CRC: 4030623090 + Mapper: 4 + - CRC: 1227867401 + Mapper: 79 + - CRC: 3894178281 + Mapper: 3 + - CRC: 3542005691 + Mapper: 1 + - CRC: 3003488673 + Mapper: 4 + - CRC: 3486686355 + Mapper: 4 + - CRC: 2622237596 + Mapper: 4 + - CRC: 913663694 + Mapper: 1 + - CRC: 22889813 + Mapper: 4 + - CRC: 122967119 + Mapper: 4 + - CRC: 1379432006 + Mapper: 1 + - CRC: 3780053567 + Mapper: 1 + - CRC: 3650783236 + Mapper: 3 + - CRC: 3733206346 + Mapper: 1 + - CRC: 1207433312 + Mapper: 4 + - CRC: 2690130333 + Mapper: 1 + - CRC: 3857321662 + Mapper: 1 + - CRC: 3677179805 + Mapper: 4 + - CRC: 535974318 + Mapper: 1 + - CRC: 26427761 + Mapper: 4 + - CRC: 4122603165 + Mapper: 0 + - CRC: 228255097 + Mapper: 0 + - CRC: 1366641724 + Mapper: 0 + - CRC: 4101079677 + Mapper: 1 + - CRC: 3371303929 + Mapper: 1 + - CRC: 990858674 + Mapper: 2 + - CRC: 1322625622 + Mapper: 1 + - CRC: 4198714889 + Mapper: 1 + - CRC: 2245012692 + Mapper: 4 + - CRC: 2929156732 + Mapper: 1 + - CRC: 3172178919 + Mapper: 11 + - CRC: 183122167 + Mapper: 11 + - CRC: 3036539256 + Mapper: 4 + - CRC: 2104238181 + Mapper: 1 + - CRC: 2012280605 + Mapper: 4 + - CRC: 2830225873 + Mapper: 7 + - CRC: 480159068 + Mapper: 1 + - CRC: 3832213025 + Mapper: 4 + - CRC: 3220297799 + Mapper: 4 + - CRC: 3840394797 + Mapper: 4 + - CRC: 2204553074 + Mapper: 2 + - CRC: 3682535358 + Mapper: 4 + - CRC: 32914714 + Mapper: 1 + - CRC: 3591965795 + Mapper: 4 + - CRC: 3025792452 + Mapper: 66 + - CRC: 2866438668 + Mapper: 4 + - CRC: 1458591827 + Mapper: 4 + - CRC: 1762328223 + Mapper: 4 + - CRC: 2961655648 + Mapper: 1 + - CRC: 1431736077 + Mapper: 2 + - CRC: 3257275773 + Mapper: 79 + - CRC: 2835778839 + Mapper: 0 + - CRC: 1591658701 + Mapper: 1 + - CRC: 4189768853 + Mapper: 1 + - CRC: 1613088352 + Mapper: 11 + - CRC: 376809153 + Mapper: 4 + - CRC: 745816303 + Mapper: 71 + - CRC: 744639327 + Mapper: 64 + - CRC: 1785708876 + Mapper: 1 + - CRC: 3118232926 + Mapper: 3 + - CRC: 729091065 + Mapper: 87 + - CRC: 1020572704 + Mapper: 33 + - CRC: 2563224794 + Mapper: 2 + - CRC: 3458486464 + Mapper: 3 + - CRC: 3954566758 + Mapper: 2 + - CRC: 590869598 + Mapper: 3 + - CRC: 2522363069 + Mapper: 18 + - CRC: 4195483709 + Mapper: 0 + - CRC: 3871950145 + Mapper: 23 + - CRC: 3342461070 + Mapper: 86 + - CRC: 2506681204 + Mapper: 1 + - CRC: 4225568539 + Mapper: 2 + - CRC: 372191886 + Mapper: 3 + - CRC: 2666746332 + Mapper: 3 + - CRC: 2081458467 + Mapper: 1 + - CRC: 3561995013 + Mapper: 2 + - CRC: 4271891674 + Mapper: 3 + - CRC: 205923896 + Mapper: 1 + - CRC: 603162183 + Mapper: 0 + - CRC: 339165480 + Mapper: 1 + - CRC: 366737352 + Mapper: 1 + - CRC: 2925218605 + Mapper: 2 + - CRC: 3810975989 + Mapper: 3 + - CRC: 2867469607 + Mapper: 2 + - CRC: 4154543681 + Mapper: 2 + - CRC: 1352028475 + Mapper: 0 + - CRC: 2932396624 + Mapper: 3 + - CRC: 3555498154 + Mapper: 4 + - CRC: 1401945090 + Mapper: 4 + - CRC: 4127420120 + Mapper: 23 + - CRC: 4130555220 + Mapper: 4 + - CRC: 3848971752 + Mapper: 4 + - CRC: 2016741436 + Mapper: 30 + - CRC: 3050474815 + Mapper: 0 + - CRC: 3394624326 + Mapper: 30 + - CRC: 4218882462 + Mapper: 1 + - CRC: 216648192 + Mapper: 4 + - CRC: 2689258427 + Mapper: 4 + - CRC: 419908893 + Mapper: 4 + - CRC: 4094113662 + Mapper: 34 + - CRC: 1340571713 + Mapper: 34 + - CRC: 1634424273 + Mapper: 4 + - CRC: 4133879327 + Mapper: 2 + - CRC: 1646361511 + Mapper: 184 + - CRC: 3239553451 + Mapper: 2 + - CRC: 2157292848 + Mapper: 4 + - CRC: 560482661 + Mapper: 0 + - CRC: 2708706081 + Mapper: 0 + - CRC: 2103383195 + Mapper: 4 + - CRC: 164263419 + Mapper: 3 + - CRC: 1870204827 + Mapper: 2 + - CRC: 335070232 + Mapper: 2 + - CRC: 2696465241 + Mapper: 2 + - CRC: 2323485799 + Mapper: 0 + - CRC: 4108821900 + Mapper: 0 + - CRC: 1751558537 + Mapper: 1 + - CRC: 96775987 + Mapper: 93 + - CRC: 3668674363 + Mapper: 2 + - CRC: 1062723648 + Mapper: 1 + - CRC: 4042345548 + Mapper: 3 + - CRC: 2982669089 + Mapper: 5 + - CRC: 1979732493 + Mapper: 2 + - CRC: 274825430 + Mapper: 7 + - CRC: 2943048581 + Mapper: 1 + - CRC: 4213518886 + Mapper: 2 + - CRC: 3181478843 + Mapper: 4 + - CRC: 2559322382 + Mapper: 1 + - CRC: 1434572845 + Mapper: 2 + - CRC: 2243952623 + Mapper: 2 + - CRC: 49419723 + Mapper: 30 + - CRC: 3401150800 + Mapper: 2 + - CRC: 698777085 + Mapper: 2 + - CRC: 752654156 + Mapper: 2 + - CRC: 540378069 + Mapper: 23 + - CRC: 3607592342 + Mapper: 4 + - CRC: 2482300745 + Mapper: 28 + - CRC: 3612669184 + Mapper: 68 + - CRC: 3124975242 + Mapper: 80 + - CRC: 1878707941 + Mapper: 4 + - CRC: 3554853536 + Mapper: 0 + - CRC: 584567134 + Mapper: 3 + - CRC: 3409312400 + Mapper: 23 + - CRC: 767231309 + Mapper: 0 + - CRC: 927452427 + Mapper: 0 + - CRC: 3448257756 + Mapper: 0 + - CRC: 3779715250 + Mapper: 1 + - CRC: 772755887 + Mapper: 0 + - CRC: 793754547 + Mapper: 0 + - CRC: 853552312 + Mapper: 0 + - CRC: 2010485760 + Mapper: 0 + - CRC: 4001259998 + Mapper: 0 + - CRC: 1328336131 + Mapper: 176 + - CRC: 918715112 + Mapper: 176 + - CRC: 94499073 + Mapper: 176 + - CRC: 1519002535 + Mapper: 45 + - CRC: 2406271066 + Mapper: 4 + - CRC: 1743831562 + Mapper: 45 + - CRC: 181388688 + Mapper: 235 + - CRC: 3749787213 + Mapper: 235 + - CRC: 3433641407 + Mapper: 236 + - CRC: 1727064461 + Mapper: 134 + - CRC: 1490874 + Mapper: 176 + - CRC: 1603672139 + Mapper: 176 + - CRC: 4200275238 + Mapper: 176 + - CRC: 1017162433 + Mapper: 57 + - CRC: 2322604046 + Mapper: 57 + - CRC: 2494607668 + Mapper: 176 + - CRC: 1761484927 + Mapper: 52 + - CRC: 2836574308 + Mapper: 51 + - CRC: 1362237882 + Mapper: 90 + - CRC: 3295660182 + Mapper: 90 + - CRC: 3911721424 + Mapper: 202 + - CRC: 1647800721 + Mapper: 4 + - CRC: 285668359 + Mapper: 203 + - CRC: 3163125874 + Mapper: 203 + - CRC: 434837363 + Mapper: 30 + - CRC: 1051709458 + Mapper: 116 + - CRC: 1669047560 + Mapper: 3 + - CRC: 2079070021 + Mapper: 0 + - CRC: 2898793802 + Mapper: 2 + - CRC: 3060407214 + Mapper: 3 + - CRC: 2344791174 + Mapper: 0 + - CRC: 1700514044 + Mapper: 3 + - CRC: 27218715 + Mapper: 3 + - CRC: 3257935309 + Mapper: 4 + - CRC: 3649646720 + Mapper: 0 + - CRC: 835439937 + Mapper: 7 + - CRC: 2628624756 + Mapper: 11 + - CRC: 170874208 + Mapper: 15 + - CRC: 1192364433 + Mapper: 150 + - CRC: 4255014358 + Mapper: 11 + - CRC: 3511683532 + Mapper: 11 + - CRC: 2437155499 + Mapper: 147 + - CRC: 2045347332 + Mapper: 147 + - CRC: 425315096 + Mapper: 2 + - CRC: 162346867 + Mapper: 2 + - CRC: 1300072812 + Mapper: 0 + - CRC: 207567219 + Mapper: 0 + - CRC: 3330467132 + Mapper: 79 + - CRC: 2646154203 + Mapper: 3 + - CRC: 1931474842 + Mapper: 212 + - CRC: 3114946283 + Mapper: 4 + - CRC: 867450784 + Mapper: 4 + - CRC: 1085861530 + Mapper: 4 + - CRC: 1078561836 + Mapper: 0 + - CRC: 2643107892 + Mapper: 163 + - CRC: 4244085203 + Mapper: 69 + - CRC: 3390545325 + Mapper: 11 + - CRC: 1911167090 + Mapper: 11 + - CRC: 1669440361 + Mapper: 3 + - CRC: 982970801 + Mapper: 3 + - CRC: 3277101028 + Mapper: 69 + - CRC: 1537328591 + Mapper: 42 + - CRC: 811100749 + Mapper: 99 + - CRC: 1733127390 + Mapper: 176 + - CRC: 283422476 + Mapper: 1 + - CRC: 4100210101 + Mapper: 1 + - CRC: 3453715913 + Mapper: 1 + - CRC: 577580713 + Mapper: 1 + - CRC: 2457719967 + Mapper: 23 + - CRC: 412230257 + Mapper: 0 + - CRC: 3406066285 + Mapper: 3 + - CRC: 718485769 + Mapper: 176 + - CRC: 3252648601 + Mapper: 0 + - CRC: 152726092 + Mapper: 1 + - CRC: 1036547458 + Mapper: 209 + - CRC: 2072215518 + Mapper: 9 + - CRC: 439558307 + Mapper: 215 + - CRC: 2022461889 + Mapper: 215 + - CRC: 1038261900 + Mapper: 215 + - CRC: 2463748712 + Mapper: 4 + - CRC: 1583802052 + Mapper: 163 + - CRC: 1389948444 + Mapper: 4 + - CRC: 3946865423 + Mapper: 221 + - CRC: 849085257 + Mapper: 0 + - CRC: 1477782338 + Mapper: 79 + - CRC: 448092166 + Mapper: 215 + - CRC: 4117589318 + Mapper: 243 + - CRC: 432139601 + Mapper: 243 + - CRC: 2315430141 + Mapper: 4 + - CRC: 1248756065 + Mapper: 4 + - CRC: 45875982 + Mapper: 0 + - CRC: 817607253 + Mapper: 173 + - CRC: 3872942573 + Mapper: 176 + - CRC: 3134066708 + Mapper: 1 + - CRC: 2733290694 + Mapper: 15 + - CRC: 2787867105 + Mapper: 79 + - CRC: 1257718522 + Mapper: 1 + - CRC: 2730305246 + Mapper: 4 + - CRC: 3900870657 + Mapper: 148 + - CRC: 2253542224 + Mapper: 148 + - CRC: 946278154 + Mapper: 148 + - CRC: 1501811501 + Mapper: 4 + - CRC: 2947363355 + Mapper: 4 + - CRC: 243176201 + Mapper: 189 + - CRC: 580840427 + Mapper: 4 + - CRC: 191795677 + Mapper: 4 + - CRC: 3212372161 + Mapper: 4 + - CRC: 1022294742 + Mapper: 4 + - CRC: 2743990169 + Mapper: 4 + - CRC: 148968279 + Mapper: 3 + - CRC: 2138941429 + Mapper: 134 + - CRC: 1607107536 + Mapper: 45 + - CRC: 962323606 + Mapper: 3 + - CRC: 1850120127 + Mapper: 1 + - CRC: 2070714464 + Mapper: 219 + - CRC: 561396629 + Mapper: 1 + - CRC: 437149004 + Mapper: 99 + - CRC: 2748713273 + Mapper: 99 + - CRC: 4244324918 + Mapper: 99 + - CRC: 4237174058 + Mapper: 99 + - CRC: 1804498452 + Mapper: 99 + - CRC: 3439696618 + Mapper: 99 + - CRC: 4252438402 + Mapper: 99 + - CRC: 2571773713 + Mapper: 99 + - CRC: 1673797506 + Mapper: 163 + - CRC: 4164220468 + Mapper: 178 + - CRC: 1503355768 + Mapper: 23 + - CRC: 3456853626 + Mapper: 75 + - CRC: 144403662 + Mapper: 25 + - CRC: 951704689 + Mapper: 3 + - CRC: 2648771217 + Mapper: 163 + - CRC: 4229993993 + Mapper: 163 + - CRC: 1768790243 + Mapper: 163 + - CRC: 2669248299 + Mapper: 163 + - CRC: 1827523133 + Mapper: 4 + - CRC: 2539611362 + Mapper: 163 + - CRC: 2438746489 + Mapper: 163 + - CRC: 2409311032 + Mapper: 163 + - CRC: 807945220 + Mapper: 4 + - CRC: 1879207231 + Mapper: 4 + - CRC: 2234243894 + Mapper: 163 + - CRC: 3021796421 + Mapper: 163 + - CRC: 2016002985 + Mapper: 163 + - CRC: 3157801993 + Mapper: 163 + - CRC: 2848223530 + Mapper: 163 + - CRC: 2112363461 + Mapper: 198 + - CRC: 962851114 + Mapper: 198 + - CRC: 3266325361 + Mapper: 163 + - CRC: 88360096 + Mapper: 163 + - CRC: 400053472 + Mapper: 165 + - CRC: 2964405693 + Mapper: 178 + - CRC: 2611288250 + Mapper: 163 + - CRC: 1104108394 + Mapper: 246 + - CRC: 1833894074 + Mapper: 156 + - CRC: 1094720621 + Mapper: 167 + - CRC: 1143937577 + Mapper: 192 + - CRC: 1376687059 + Mapper: 4 + - CRC: 710888538 + Mapper: 132 + - CRC: 1289782008 + Mapper: 163 + - CRC: 765699228 + Mapper: 163 + - CRC: 1704759028 + Mapper: 4 + - CRC: 946461588 + Mapper: 163 + - CRC: 1463898038 + Mapper: 163 + - CRC: 1782488643 + Mapper: 4 + - CRC: 2542942686 + Mapper: 163 + - CRC: 3631338470 + Mapper: 176 + - CRC: 2848544470 + Mapper: 15 + - CRC: 834781080 + Mapper: 163 + - CRC: 742051928 + Mapper: 4 + - CRC: 1767686528 + Mapper: 243 + - CRC: 1942002635 + Mapper: 148 + - CRC: 477203304 + Mapper: 4 + - CRC: 4034023461 + Mapper: 27 + - CRC: 2202973307 + Mapper: 27 + - CRC: 1110685454 + Mapper: 0 + - CRC: 3894875333 + Mapper: 4 + - CRC: 4026101386 + Mapper: 163 + - CRC: 3404394090 + Mapper: 4 + - CRC: 4167630928 + Mapper: 4 + - CRC: 1087231331 + Mapper: 4 + - CRC: 2825086044 + Mapper: 79 + - CRC: 395164280 + Mapper: 0 + - CRC: 1019018324 + Mapper: 5 + - CRC: 1768362745 + Mapper: 1 + - CRC: 776785734 + Mapper: 0 + - CRC: 1965794202 + Mapper: 0 + - CRC: 3314986363 + Mapper: 1 + - CRC: 222772966 + Mapper: 186 diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Resources/NES/ROMDB.asset.meta b/AxibugEmuOnline.Client.PSVita/Assets/Resources/NES/ROMDB.asset.meta new file mode 100644 index 0000000..8311962 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Resources/NES/ROMDB.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 42cbfafb123e63b45841ae95eb432053 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Resources/VirtuaNesDraw.shader b/AxibugEmuOnline.Client.PSVita/Assets/Resources/VirtuaNesDraw.shader new file mode 100644 index 0000000..13abf1d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Resources/VirtuaNesDraw.shader @@ -0,0 +1,131 @@ +Shader "AleinUI/Clip" +{ + Properties + { + _MainTex ("Sprite Texture", 2D) = "white" {} + _PalTex ("PAL", 2D) = "white" {} + _Color ("Tint", Color) = (1,1,1,1) + + _StencilComp ("Stencil Comparison", Float) = 8 + _Stencil ("Stencil ID", Float) = 0 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + + _ColorMask ("Color Mask", Float) = 15 + + + [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 + } + + SubShader + { + Tags + { + "Queue"="Transparent" + "IgnoreProjector"="True" + "RenderType"="Transparent" + "PreviewType"="Plane" + "CanUseSpriteAtlas"="True" + } + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Cull Off + Lighting Off + ZWrite Off + ZTest [unity_GUIZTestMode] + Blend SrcAlpha OneMinusSrcAlpha + ColorMask [_ColorMask] + + Pass + { + Name "Default" + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 2.0 + + #include "UnityCG.cginc" + #include "UnityUI.cginc" + + #pragma multi_compile_local _ UNITY_UI_CLIP_RECT + #pragma multi_compile_local _ UNITY_UI_ALPHACLIP + + struct appdata_t + { + float4 vertex : POSITION; + float4 color : COLOR; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float2 texcoord : TEXCOORD0; + float4 worldPosition : TEXCOORD1; + UNITY_VERTEX_OUTPUT_STEREO + }; + + sampler2D _MainTex; + fixed4 _Color; + fixed4 _TextureSampleAdd; + float4 _ClipRect; + float4 _MainTex_ST; + float4 _MainTex_TexelSize; + sampler2D _PalTex; + + v2f vert(appdata_t v) + { + v2f OUT; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); + OUT.worldPosition = v.vertex; + OUT.vertex = UnityObjectToClipPos(OUT.worldPosition); + + OUT.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); + + OUT.color = v.color * _Color; + return OUT; + } + + fixed4 frag(v2f IN) : SV_Target + { + float2 mapUV = IN.texcoord; + + float start= 8.0/272.0; + float end = (272.0-8.0)/272.0; + + mapUV.x = lerp(start,end, mapUV.x); + + half4 color = tex2D(_MainTex,mapUV); + + //float rawIndex = color.b; + float rawIndex = color.r; + + color = tex2D(_PalTex,float2(rawIndex,0.5)); + + #ifdef UNITY_UI_CLIP_RECT + color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect); + #endif + + #ifdef UNITY_UI_ALPHACLIP + clip (color.a - 0.001); + #endif + + + return color; + } + ENDCG + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Resources/VirtuaNesDraw.shader.meta b/AxibugEmuOnline.Client.PSVita/Assets/Resources/VirtuaNesDraw.shader.meta new file mode 100644 index 0000000..a89d157 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Resources/VirtuaNesDraw.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3dd2917646ccf2b4baee8a5d1c15247f +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Resources/VirtuaNesMaterial.mat b/AxibugEmuOnline.Client.PSVita/Assets/Resources/VirtuaNesMaterial.mat new file mode 100644 index 0000000..0c5f293 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Resources/VirtuaNesMaterial.mat @@ -0,0 +1,87 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: VirtuaNesMaterial + m_Shader: {fileID: 4800000, guid: 3dd2917646ccf2b4baee8a5d1c15247f, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _PalTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _ColorMask: 15 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + - _UVSec: 0 + - _UseUIAlphaClip: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Resources/VirtuaNesMaterial.mat.meta b/AxibugEmuOnline.Client.PSVita/Assets/Resources/VirtuaNesMaterial.mat.meta new file mode 100644 index 0000000..a2c1344 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Resources/VirtuaNesMaterial.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 374f5ecbae26b7149be2a078f37ad800 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Scene.meta b/AxibugEmuOnline.Client.PSVita/Assets/Scene.meta new file mode 100644 index 0000000..a2af5ba --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Scene.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 97287d4650544eb4daa041e4a384a06b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Scene/AxibugEmuOnline.Client.unity b/AxibugEmuOnline.Client.PSVita/Assets/Scene/AxibugEmuOnline.Client.unity new file mode 100644 index 0000000..264e198 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Scene/AxibugEmuOnline.Client.unity @@ -0,0 +1,588 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &537454904 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 537454906} + - component: {fileID: 537454905} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &537454905 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 537454904} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &537454906 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 537454904} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &589359925 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 589359928} + - component: {fileID: 589359927} + - component: {fileID: 589359926} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &589359926 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 589359925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &589359927 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 589359925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &589359928 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 589359925} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &622947734 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 622947735} + - component: {fileID: 622947737} + - component: {fileID: 622947736} + m_Layer: 5 + m_Name: Game + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &622947735 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 622947734} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1361633018} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &622947736 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 622947734} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Texture: {fileID: 8400000, guid: 6645567e4c11d9447b1aee2406f681c5, type: 2} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!222 &622947737 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 622947734} + m_CullTransparentMesh: 0 +--- !u!1 &1355724343 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1355724346} + - component: {fileID: 1355724345} + - component: {fileID: 1355724344} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1355724344 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1355724343} + m_Enabled: 1 +--- !u!20 &1355724345 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1355724343} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1355724346 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1355724343} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1361633014 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1361633018} + - component: {fileID: 1361633017} + - component: {fileID: 1361633016} + - component: {fileID: 1361633015} + m_Layer: 5 + m_Name: UI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1361633015 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1361633014} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &1361633016 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1361633014} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!223 &1361633017 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1361633014} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &1361633018 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1361633014} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 622947735} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!1 &1498586261 +GameObject: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1498586263} + - component: {fileID: 1498586262} + m_Layer: 0 + m_Name: UndoProRecords + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1498586262 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1498586261} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: df9ab10aeab793d47a27405557d0b929, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &1498586263 +Transform: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1498586261} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Scene/AxibugEmuOnline.Client.unity.meta b/AxibugEmuOnline.Client.PSVita/Assets/Scene/AxibugEmuOnline.Client.unity.meta new file mode 100644 index 0000000..fa040cd --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Scene/AxibugEmuOnline.Client.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: eb0c18a619175384d95147898a43054b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Scene/EmuTest.unity b/AxibugEmuOnline.Client.PSVita/Assets/Scene/EmuTest.unity new file mode 100644 index 0000000..e73c73e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Scene/EmuTest.unity @@ -0,0 +1,424 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &708549044 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 708549046} + - component: {fileID: 708549045} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &708549045 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 708549044} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &708549046 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 708549044} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &1232273651 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1232273654} + - component: {fileID: 1232273653} + - component: {fileID: 1232273652} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1232273652 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1232273651} + m_Enabled: 1 +--- !u!20 &1232273653 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1232273651} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 1, g: 1, b: 1, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1232273654 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1232273651} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1359344831 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1359344834} + - component: {fileID: 1359344833} + - component: {fileID: 1359344832} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1359344832 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1359344831} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &1359344833 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1359344831} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &1359344834 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1359344831} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &4232056520998800727 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4232056521131536011, guid: f8bea3f8aa351bb46ada33b2274729ea, type: 3} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 4232056521131536011, guid: f8bea3f8aa351bb46ada33b2274729ea, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4232056521131536011, guid: f8bea3f8aa351bb46ada33b2274729ea, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4232056521131536011, guid: f8bea3f8aa351bb46ada33b2274729ea, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4232056521131536011, guid: f8bea3f8aa351bb46ada33b2274729ea, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4232056521131536011, guid: f8bea3f8aa351bb46ada33b2274729ea, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4232056521131536011, guid: f8bea3f8aa351bb46ada33b2274729ea, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4232056521131536011, guid: f8bea3f8aa351bb46ada33b2274729ea, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4232056521131536011, guid: f8bea3f8aa351bb46ada33b2274729ea, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4232056521131536011, guid: f8bea3f8aa351bb46ada33b2274729ea, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4232056521131536011, guid: f8bea3f8aa351bb46ada33b2274729ea, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4232056521131536013, guid: f8bea3f8aa351bb46ada33b2274729ea, type: 3} + propertyPath: m_Name + value: NesEmulator + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f8bea3f8aa351bb46ada33b2274729ea, type: 3} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Scene/EmuTest.unity.meta b/AxibugEmuOnline.Client.PSVita/Assets/Scene/EmuTest.unity.meta new file mode 100644 index 0000000..17bcd88 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Scene/EmuTest.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3dba71db67877594a9b5b77059205ec8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Scene/New Render Texture.renderTexture b/AxibugEmuOnline.Client.PSVita/Assets/Scene/New Render Texture.renderTexture new file mode 100644 index 0000000..ec610c1 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Scene/New Render Texture.renderTexture @@ -0,0 +1,38 @@ +%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: New Render Texture + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_ForcedFallbackFormat: 4 + m_DownscaleFallback: 0 + m_IsAlphaChannelOptional: 0 + serializedVersion: 3 + m_Width: 256 + m_Height: 240 + m_AntiAliasing: 1 + m_MipCount: -1 + m_DepthFormat: 0 + m_ColorFormat: 8 + m_MipMap: 0 + m_GenerateMips: 1 + m_SRGB: 0 + m_UseDynamicScale: 0 + m_BindMS: 0 + m_EnableCompatibleFormat: 1 + 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 diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Scene/New Render Texture.renderTexture.meta b/AxibugEmuOnline.Client.PSVita/Assets/Scene/New Render Texture.renderTexture.meta new file mode 100644 index 0000000..c3d7147 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Scene/New Render Texture.renderTexture.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5d4a385f133f9074583d64ab2172a03b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 8400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Scenes.meta b/AxibugEmuOnline.Client.PSVita/Assets/Scenes.meta new file mode 100644 index 0000000..17072cf --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4f704ae4b4f98ae41a0bce26658850c1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Scenes/SampleScene.unity b/AxibugEmuOnline.Client.PSVita/Assets/Scenes/SampleScene.unity new file mode 100644 index 0000000..dc5bd16 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Scenes/SampleScene.unity @@ -0,0 +1,933 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 10 + m_Resolution: 2 + m_BakeResolution: 10 + m_AtlasSize: 512 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 256 + m_PVRBounces: 2 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &85201915 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 85201916} + - component: {fileID: 85201919} + - component: {fileID: 85201918} + - component: {fileID: 85201917} + m_Layer: 5 + m_Name: btnStart + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &85201916 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 85201915} + m_LocalRotation: {x: -1, y: -0, z: -0, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 422799409} + m_Father: {fileID: 1067981924} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 44, y: -499} + m_SizeDelta: {x: 67.6, y: 28.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &85201917 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 85201915} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 85201918} + m_OnClick: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &85201918 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 85201915} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &85201919 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 85201915} + m_CullTransparentMesh: 0 +--- !u!1 &97286095 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 97286097} + - component: {fileID: 97286096} + - component: {fileID: 97286098} + m_Layer: 0 + m_Name: NesEmu + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &97286096 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 97286095} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 39557e19783acee499ace6c68549e8f8, type: 3} + m_Name: + m_EditorClassIdentifier: + VideoProvider: {fileID: 1168232458} + AudioProvider: {fileID: 1963186404} + btnStart: {fileID: 85201917} + RomName: KickMaster.nes +--- !u!4 &97286097 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 97286095} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1168232457} + - {fileID: 1963186403} + - {fileID: 1179864540} + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &97286098 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 97286095} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f6742d2e5aa8bf40b765aa44eca65d2, type: 3} + m_Name: + m_EditorClassIdentifier: + AllowDebugging: 1 +--- !u!1 &422799408 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 422799409} + - component: {fileID: 422799411} + - component: {fileID: 422799410} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &422799409 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 422799408} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 85201916} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &422799410 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 422799408} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Start +--- !u!222 &422799411 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 422799408} + m_CullTransparentMesh: 0 +--- !u!1 &534669902 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 534669905} + - component: {fileID: 534669904} + - component: {fileID: 534669903} + - component: {fileID: 534669906} + m_Layer: 0 + m_Name: Main Camera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &534669903 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 534669902} + m_Enabled: 0 +--- !u!20 &534669904 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 534669902} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &534669905 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 534669902} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &534669906 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 534669902} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 24d3dec34287f264d9d50bd278042e4b, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &683409679 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 683409682} + - component: {fileID: 683409681} + - component: {fileID: 683409680} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &683409680 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 683409679} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &683409681 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 683409679} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &683409682 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 683409679} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1067981923 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1067981924} + - component: {fileID: 1067981926} + - component: {fileID: 1067981925} + m_Layer: 5 + m_Name: RawImage + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1067981924 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1067981923} + m_LocalRotation: {x: 1, y: 0, z: 0, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 85201916} + m_Father: {fileID: 1179864540} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 180, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1067981925 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1067981923} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -98529514, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: 374f5ecbae26b7149be2a078f37ad800, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Texture: {fileID: 8400000, guid: ffe34aaf87e4b9942b4c2ac05943d444, type: 2} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!222 &1067981926 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1067981923} + m_CullTransparentMesh: 0 +--- !u!1 &1168232456 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1168232457} + - component: {fileID: 1168232458} + m_Layer: 0 + m_Name: VideoProvider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1168232457 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1168232456} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 97286097} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1168232458 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1168232456} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 83fbe375412d1af4482ae76e81c1dda2, type: 3} + m_Name: + m_EditorClassIdentifier: + NesEmu: {fileID: 0} + Image: {fileID: 1067981925} + fpstext: {fileID: 1559076253} + detalTime: 0 +--- !u!1 &1179864539 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1179864540} + - component: {fileID: 1179864543} + - component: {fileID: 1179864542} + - component: {fileID: 1179864541} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1179864540 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1179864539} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 1067981924} + - {fileID: 1559076252} + m_Father: {fileID: 97286097} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!114 &1179864541 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1179864539} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &1179864542 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1179864539} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &1179864543 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1179864539} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!1 &1559076251 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1559076252} + - component: {fileID: 1559076254} + - component: {fileID: 1559076253} + m_Layer: 5 + m_Name: FPS + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1559076252 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1559076251} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1179864540} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 89, y: -26.25} + m_SizeDelta: {x: 152.2, y: 30.5} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1559076253 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1559076251} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 0.009791947, b: 0, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 17 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 0 + m_MaxSize: 50 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: FPS +--- !u!222 &1559076254 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1559076251} + m_CullTransparentMesh: 0 +--- !u!1 &1963186402 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1963186403} + - component: {fileID: 1963186404} + - component: {fileID: 1963186405} + m_Layer: 0 + m_Name: AudioProvider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1963186403 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1963186402} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 97286097} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1963186404 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1963186402} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a6a09b6a4cf4c2d4f994a13fd7e89d6f, type: 3} + m_Name: + m_EditorClassIdentifier: + m_as: {fileID: 1963186405} +--- !u!82 &1963186405 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1963186402} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 1 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Scenes/SampleScene.unity.meta b/AxibugEmuOnline.Client.PSVita/Assets/Scenes/SampleScene.unity.meta new file mode 100644 index 0000000..9531828 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Scenes/SampleScene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 99c9720ab356a0642a771bea13969a05 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script.meta b/AxibugEmuOnline.Client.PSVita/Assets/Script.meta new file mode 100644 index 0000000..6d4a585 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cb2f15a5cdbcfcc498fecad6768c5ec9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/AxibugEmuOnline.Client.asmdef b/AxibugEmuOnline.Client.PSVita/Assets/Script/AxibugEmuOnline.Client.asmdef new file mode 100644 index 0000000..ddf7720 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/AxibugEmuOnline.Client.asmdef @@ -0,0 +1,10 @@ +{ + "name": "AxibugEmuOnline.Client", + "references": [ + "VirtualNes.Core" + ], + "optionalUnityReferences": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/AxibugEmuOnline.Client.asmdef.meta b/AxibugEmuOnline.Client.PSVita/Assets/Script/AxibugEmuOnline.Client.asmdef.meta new file mode 100644 index 0000000..11f4d03 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/AxibugEmuOnline.Client.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3fe77f1eed9fc0847a86648f644fe815 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/CorePath.cs b/AxibugEmuOnline.Client.PSVita/Assets/Script/CorePath.cs new file mode 100644 index 0000000..fef03f2 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/CorePath.cs @@ -0,0 +1,12 @@ +using UnityEngine; + +public static class CorePath +{ +#if UNITY_EDITOR + public static string DataPath => Application.persistentDataPath; +#elif UNITY_PSP2 + public static string DataPath => Application.dataPath; +#else + public static string DataPath => Application.persistentDataPath; +#endif +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/CorePath.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/Script/CorePath.cs.meta new file mode 100644 index 0000000..ca0d085 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/CorePath.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d39954e798484ba44a30cfbd2ebb7fc7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator.meta b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator.meta new file mode 100644 index 0000000..49f52ed --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5ff32bd86cd0f8245811007dc4e50768 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/AudioProvider.cs b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/AudioProvider.cs new file mode 100644 index 0000000..e70b190 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/AudioProvider.cs @@ -0,0 +1,52 @@ +using UnityEngine; +using VirtualNes.Core; + +namespace AxibugEmuOnline.Client +{ + public class AudioProvider : MonoBehaviour + { + public NesEmulator NesEmu { get; set; } + + [SerializeField] + private AudioSource m_as; + + private SoundBuffer _buffer = new SoundBuffer(4096); + public void Start() + { + var dummy = AudioClip.Create("dummy", 1, 1, AudioSettings.outputSampleRate, false); + + dummy.SetData(new float[] { 1 }, 0); + m_as.clip = dummy; //just to let unity play the audiosource + m_as.loop = true; + m_as.spatialBlend = 1; + m_as.Play(); + } + + void OnAudioFilterRead(float[] data, int channels) + { + int step = channels; + + if (NesEmu == null || NesEmu.NesCore == null) return; + + ProcessSound(NesEmu.NesCore, (uint)(data.Length / channels)); + + for (int i = 0; i < data.Length; i += step) + { + float rawFloat = 0; + byte rawData; + if (_buffer.TryRead(out rawData)) + rawFloat = rawData / 255f; + + data[i] = rawFloat; + for (int fill = 1; fill < step; fill++) + data[i + fill] = rawFloat; + } + } + + void ProcessSound(NES nes, uint feedCount) + { + nes.apu.Process(_buffer, feedCount); + } + } + +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/AudioProvider.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/AudioProvider.cs.meta new file mode 100644 index 0000000..2ec068d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/AudioProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a6a09b6a4cf4c2d4f994a13fd7e89d6f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/CoreDebuger.cs b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/CoreDebuger.cs new file mode 100644 index 0000000..b163434 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/CoreDebuger.cs @@ -0,0 +1,21 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using VirtualNes.Core.Debug; + +namespace AxibugEmuOnline.Client +{ + public class CoreDebuger : IDebugerImpl + { + + public void Log(string message) + { + Debug.Log(message); + } + + public void LogError(string message) + { + Debug.LogError(message); + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/CoreDebuger.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/CoreDebuger.cs.meta new file mode 100644 index 0000000..b7a7572 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/CoreDebuger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 06357866273334741b885e5a1ad23afd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/CoreSupporter.cs b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/CoreSupporter.cs new file mode 100644 index 0000000..a882f73 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/CoreSupporter.cs @@ -0,0 +1,113 @@ +using AxibugEmuOnline.Client.ClientCore; +using System; +using System.IO; +using System.Linq; +using System.Xml.Linq; +using UnityEngine; +using VirtualNes.Core; + +namespace AxibugEmuOnline.Client +{ + public class CoreSupporter : ISupporterImpl + { + private static string RomDirectoryPath + { + get + { +#if UNITY_EDITOR + return "Assets/StreamingAssets/NES/Roms"; +#elif UNITY_PSP2 + return $"{Application.dataPath}/StreamingAssets/NES/Roms"; +#else + return $"{Application.streamingAssetsPath}/NES/Roms"; +#endif + } + } + + public Stream OpenRom(string fname) + { + Debug.Log($" OpenRom -> {RomDirectoryPath}/{fname}"); + try + { + var stream = File.Open($"{RomDirectoryPath}/{fname}", FileMode.Open,FileAccess.Read); + Debug.Log($" OpenRom -> OK!"); + return stream; + } + catch (Exception ex) + { + Debug.Log($" OpenRom -> Err!"); + Debug.LogError(ex); + return null; + } + } + + public void GetRomPathInfo(string fname, out string fullPath, out string directPath) + { + directPath = RomDirectoryPath; + fullPath = $"{directPath}/{fname}"; + } + + public Stream OpenFile_DISKSYS() + { + return new MemoryStream(Resources.Load("NES/Disksys.rom").bytes); + } + + public void SaveSRAMToFile(byte[] sramContent, string romName) + { + string sramDirectoryPath = $"{CorePath.DataPath}/sav"; + Directory.CreateDirectory(sramDirectoryPath); + romName = Path.GetFileNameWithoutExtension(romName); + File.WriteAllBytes($"{sramDirectoryPath}/{romName}.sav", sramContent); + } + + public void SaveDISKToFile(byte[] diskFileContent, string romName) + { + string diskFileDirectoryPath = $"{CorePath.DataPath}/dsv"; + Directory.CreateDirectory(diskFileDirectoryPath); + romName = Path.GetFileNameWithoutExtension(romName); + File.WriteAllBytes($"{diskFileDirectoryPath}/{romName}.dsv", diskFileContent); + } + + public EmulatorConfig Config { get; private set; } = new EmulatorConfig(); + + public void PrepareDirectory(string directPath) + { + Directory.CreateDirectory($"{CorePath.DataPath}/{directPath}"); + } + + public void SaveFile(byte[] fileData, string directPath, string fileName) + { + PrepareDirectory(directPath); + + var fileFullpath = $"{CorePath.DataPath}/{directPath}/{fileName}"; + File.WriteAllBytes(fileFullpath, fileData); + } + + public Stream OpenFile(string directPath, string fileName) + { + try + { + var data = File.ReadAllBytes($"{CorePath.DataPath}/{directPath}/{fileName}"); + if (data == null) return null; + return new MemoryStream(data); + } + catch + { + return null; + } + + } + + public bool TryGetMapperNo(ROM rom, out int mapperNo) + { + var db = Resources.Load("NES/ROMDB"); + return db.GetMapperNo(rom.GetPROM_CRC(), out mapperNo); + } + + public ControllerState GetControllerState() + { + var mapper = NesControllerMapper.Get(); + return mapper.CreateState(); + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/CoreSupporter.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/CoreSupporter.cs.meta new file mode 100644 index 0000000..5bad9b0 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/CoreSupporter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8207d923313517f448d7b4d54756e993 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/NesControllerMapper.cs b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/NesControllerMapper.cs new file mode 100644 index 0000000..9165be0 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/NesControllerMapper.cs @@ -0,0 +1,135 @@ +using System; +using System.IO; +using UnityEngine; +using VirtualNes.Core; + +namespace AxibugEmuOnline.Client +{ + public class NesControllerMapper + { + private static readonly string ConfigFilePath = $"{CorePath.DataPath}/NES/ControllerMapper.json"; + + public MapperSetter Player1 = new MapperSetter(); + public MapperSetter Player2 = new MapperSetter(); + public MapperSetter Player3 = new MapperSetter(); + public MapperSetter Player4 = new MapperSetter(); + + public NesControllerMapper() + { + Player1.UP.keyCode = KeyCode.JoystickButton8; + Player1.DOWN.keyCode = KeyCode.JoystickButton10; + Player1.LEFT.keyCode = KeyCode.JoystickButton11; + Player1.RIGHT.keyCode = KeyCode.JoystickButton9; + Player1.B.keyCode = KeyCode.JoystickButton0; + Player1.A.keyCode = KeyCode.JoystickButton1; + Player1.SELECT.keyCode = KeyCode.JoystickButton6; + Player1.START.keyCode = KeyCode.JoystickButton7; + + //dictKeyCfgs.Add(KeyCode.JoystickButton7, MotionKey.P1_GAMESTART); + //dictKeyCfgs.Add(KeyCode.JoystickButton6, MotionKey.P1_INSERT_COIN); + //dictKeyCfgs.Add(KeyCode.JoystickButton8, MotionKey.P1_UP); + //dictKeyCfgs.Add(KeyCode.JoystickButton10, MotionKey.P1_DOWN); + //dictKeyCfgs.Add(KeyCode.JoystickButton11, MotionKey.P1_LEFT); + //dictKeyCfgs.Add(KeyCode.JoystickButton9, MotionKey.P1_RIGHT); + //dictKeyCfgs.Add(KeyCode.JoystickButton2, MotionKey.P1_BTN_1); + //dictKeyCfgs.Add(KeyCode.JoystickButton0, MotionKey.P1_BTN_2); + //dictKeyCfgs.Add(KeyCode.JoystickButton1, MotionKey.P1_BTN_3); + //dictKeyCfgs.Add(KeyCode.JoystickButton3, MotionKey.P1_BTN_4); + } + + public void Save() + { + var jsonStr = JsonUtility.ToJson(this); + File.WriteAllText(ConfigFilePath, jsonStr); + } + + public ControllerState CreateState() + { + var state1 = Player1.GetButtons(); + var state2 = Player2.GetButtons(); + var state3 = Player3.GetButtons(); + var state4 = Player4.GetButtons(); + + return new ControllerState(state1, state2, state3, state4); + } + + private static NesControllerMapper s_setting; + public static NesControllerMapper Get() + { + if (s_setting == null) + { + try + { + var json = File.ReadAllText($"{CorePath.DataPath}/Nes/ControllerMapper.json"); + s_setting = JsonUtility.FromJson(json); + } + catch + { + s_setting = new NesControllerMapper(); + } + } + + return s_setting; + } + + [Serializable] + public class Mapper + { + public EnumButtonType buttonType; + public KeyCode keyCode; + + public Mapper(EnumButtonType buttonType) + { + this.buttonType = buttonType; + } + } + + [Serializable] + public class MapperSetter + { + public Mapper UP = new Mapper(EnumButtonType.UP); + public Mapper DOWN = new Mapper(EnumButtonType.DOWN); + public Mapper LEFT = new Mapper(EnumButtonType.LEFT); + public Mapper RIGHT = new Mapper(EnumButtonType.RIGHT); + public Mapper A = new Mapper(EnumButtonType.A); + public Mapper B = new Mapper(EnumButtonType.B); + public Mapper SELECT = new Mapper(EnumButtonType.SELECT); + public Mapper START = new Mapper(EnumButtonType.START); + public Mapper MIC = new Mapper(EnumButtonType.MIC); + + public EnumButtonType GetButtons() + { + EnumButtonType res = 0; + + if (Input.GetKey(UP.keyCode)) + res |= EnumButtonType.UP; + + if (Input.GetKey(DOWN.keyCode)) + res |= EnumButtonType.DOWN; + + if (Input.GetKey(LEFT.keyCode)) + res |= EnumButtonType.LEFT; + + if (Input.GetKey(RIGHT.keyCode)) + res |= EnumButtonType.RIGHT; + + if (Input.GetKey(A.keyCode)) + res |= EnumButtonType.A; + + if (Input.GetKey(B.keyCode)) + res |= EnumButtonType.B; + + if (Input.GetKey(SELECT.keyCode)) + res |= EnumButtonType.SELECT; + + if (Input.GetKey(START.keyCode)) + res |= EnumButtonType.START; + + if (Input.GetKey(MIC.keyCode)) + res |= EnumButtonType.MIC; + + return res; + } + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/NesControllerMapper.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/NesControllerMapper.cs.meta new file mode 100644 index 0000000..2350d8d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/NesControllerMapper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 66fc8233a79cd254f8d005452dcd4ac0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/NesEmulator.cs b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/NesEmulator.cs new file mode 100644 index 0000000..3888f86 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/NesEmulator.cs @@ -0,0 +1,121 @@ +using AxibugEmuOnline.Client.ClientCore; +using System; +using System.Diagnostics; +using System.IO; +using System.Xml.Linq; +using UnityEngine; +using UnityEngine.EventSystems; +using UnityEngine.UI; +using VirtualNes.Core; +using VirtualNes.Core.Debug; + +namespace AxibugEmuOnline.Client +{ + public class NesEmulator : MonoBehaviour + { + public NES NesCore { get; private set; } + + public VideoProvider VideoProvider; + public AudioProvider AudioProvider; + + public Button btnStart; + +#if UNITY_EDITOR || UNITY_PSP2 + public string RomName; +#endif + + private void Start() + { + Application.targetFrameRate = 60; + VideoProvider.NesEmu = this; + AudioProvider.NesEmu = this; + +#if UNITY_EDITOR || UNITY_PSP2 + //StartGame(RomName); +#endif + + btnStart.onClick.AddListener(() + => + { + StartGame(RomName); + //失去焦点 + EventSystem.current.SetSelectedGameObject(null); + }); + } + + public void StartGame(string romName) + { + StopGame(); + + Supporter.Setup(new CoreSupporter()); + Debuger.Setup(new CoreDebuger()); + + try + { + NesCore = new NES(romName); + } + catch (Exception ex) + { + NesCore = null; + UnityEngine.Debug.LogError(ex); + } + } + + public void StopGame() + { + NesCore?.Dispose(); + NesCore = null; + } + + private void Update() + { + if (NesCore != null) + { + var controlState = Supporter.GetControllerState(); + NesCore.pad.Sync(controlState); + + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Reset(); + stopwatch.Start(); + + NesCore.EmulateFrame(true); + + stopwatch.Stop(); + // 获取计时器的总时间 + TimeSpan ts = stopwatch.Elapsed; + + UnityEngine.Debug.Log($"-> {(ts.Ticks / 10)}μs"); + + var screenBuffer = NesCore.ppu.GetScreenPtr(); + var lineColorMode = NesCore.ppu.GetLineColorMode(); + VideoProvider.SetDrawData(screenBuffer, lineColorMode, 256, 240); + } + } + +#if UNITY_EDITOR + [ContextMenu("IMPORT")] + public void TTTA() + { + var db = Resources.Load("NES/ROMDB"); + db.Clear(); + + var xmlStr = File.ReadAllText("nes20db.xml"); + var xml = XDocument.Parse(xmlStr); + 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}"); + + if (mapper > 255) continue; + db.AddInfo(new RomDB.RomInfo { CRC = crc, Mapper = mapper }); + } + + UnityEditor.EditorUtility.SetDirty(db); + UnityEditor.AssetDatabase.SaveAssets(); + } +#endif + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/NesEmulator.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/NesEmulator.cs.meta new file mode 100644 index 0000000..d178f30 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/NesEmulator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 39557e19783acee499ace6c68549e8f8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/NesEmulator.prefab b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/NesEmulator.prefab new file mode 100644 index 0000000..de3b472 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/NesEmulator.prefab @@ -0,0 +1,528 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &9760340517325694 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4785916497946256520} + - component: {fileID: 9003897287163669553} + - component: {fileID: 8726979175317618791} + m_Layer: 0 + m_Name: AudioProvider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4785916497946256520 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9760340517325694} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4232056521131536011} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &9003897287163669553 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9760340517325694} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a6a09b6a4cf4c2d4f994a13fd7e89d6f, type: 3} + m_Name: + m_EditorClassIdentifier: + NesEmu: {fileID: 4232056521131536012} + m_as: {fileID: 8726979175317618791} +--- !u!82 &8726979175317618791 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9760340517325694} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 1 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!1 &3545890545112170401 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1038087993597378172} + - component: {fileID: 3032498056073774270} + - component: {fileID: 634277252673086327} + m_Layer: 5 + m_Name: Viewer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &1038087993597378172 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3545890545112170401} + m_LocalRotation: {x: 1, y: 0, z: 0, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4232056520494431727} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 180, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 128, y: 256} + m_Pivot: {x: 0, y: 0} +--- !u!222 &3032498056073774270 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3545890545112170401} + m_CullTransparentMesh: 1 +--- !u!114 &634277252673086327 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3545890545112170401} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Texture: {fileID: 8400000, guid: ffe34aaf87e4b9942b4c2ac05943d444, type: 2} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!1 &4232056520112715746 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4232056520112715745} + - component: {fileID: 4232056520112715744} + m_Layer: 0 + m_Name: VideoProvider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4232056520112715745 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4232056520112715746} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4232056521131536011} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4232056520112715744 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4232056520112715746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 83fbe375412d1af4482ae76e81c1dda2, type: 3} + m_Name: + m_EditorClassIdentifier: + NesEmu: {fileID: 4232056521131536012} + Image: {fileID: 4232056521759880274} +--- !u!1 &4232056520494431712 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4232056520494431727} + - component: {fileID: 4232056520494431724} + - component: {fileID: 4232056520494431725} + - component: {fileID: 4232056520494431726} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4232056520494431727 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4232056520494431712} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 4232056521759880275} + - {fileID: 1038087993597378172} + m_Father: {fileID: 4232056521131536011} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &4232056520494431724 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4232056520494431712} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &4232056520494431725 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4232056520494431712} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!114 &4232056520494431726 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4232056520494431712} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!1 &4232056521131536013 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4232056521131536011} + - component: {fileID: 4232056521131536012} + m_Layer: 0 + m_Name: NesEmulator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4232056521131536011 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4232056521131536013} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4232056520112715745} + - {fileID: 393435831810118449} + - {fileID: 4785916497946256520} + - {fileID: 4232056520494431727} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4232056521131536012 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4232056521131536013} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 39557e19783acee499ace6c68549e8f8, type: 3} + m_Name: + m_EditorClassIdentifier: + VideoProvider: {fileID: 4232056520112715744} + AudioProvider: {fileID: 9003897287163669553} + RomName: +--- !u!1 &4232056521759880276 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4232056521759880275} + - component: {fileID: 4232056521759880273} + - component: {fileID: 4232056521759880274} + m_Layer: 5 + m_Name: RawImage + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4232056521759880275 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4232056521759880276} + m_LocalRotation: {x: 1, y: 0, z: 0, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4232056520494431727} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 180, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 272, y: 240} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &4232056521759880273 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4232056521759880276} + m_CullTransparentMesh: 1 +--- !u!114 &4232056521759880274 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4232056521759880276} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Texture: {fileID: 8400000, guid: ffe34aaf87e4b9942b4c2ac05943d444, type: 2} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!1 &7856060136050839404 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 393435831810118449} + - component: {fileID: 499856625911497759} + m_Layer: 0 + m_Name: PatternViewer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &393435831810118449 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7856060136050839404} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4232056521131536011} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &499856625911497759 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7856060136050839404} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c7a50c189f5be5b4ea54de444f8488a0, type: 3} + m_Name: + m_EditorClassIdentifier: + img: {fileID: 634277252673086327} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/NesEmulator.prefab.meta b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/NesEmulator.prefab.meta new file mode 100644 index 0000000..6e48698 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/NesEmulator.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f8bea3f8aa351bb46ada33b2274729ea +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/PaletteDefine.cs b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/PaletteDefine.cs new file mode 100644 index 0000000..0d501a1 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/PaletteDefine.cs @@ -0,0 +1,296 @@ +using VirtualNes.Core; + +namespace AxibugEmuOnline.Client +{ + public static class PaletteDefine + { + public struct RGBQUAD + { + public byte rgbBlue; + public byte rgbGreen; + public byte rgbRed; + public byte rgbReserved; + } + + public class PALBUF + { + public byte r; + public byte g; + public byte b; + + public PALBUF(byte r, byte g, byte b) + { + this.r = r; + this.g = g; + this.b = b; + } + } + + // スキャンラインカラー + private static int m_nScanlineColor => Supporter.Config.graphics.nScanlineColor; + + public static float[][] PalConvTbl = new float[8][] + { + new float[3]{1.00f, 1.00f, 1.00f}, + new float[3]{1.00f, 0.80f, 0.73f}, + new float[3]{0.73f, 1.00f, 0.70f}, + new float[3]{0.76f, 0.78f, 0.58f}, + new float[3]{0.86f, 0.80f, 1.00f}, + new float[3]{0.83f, 0.68f, 0.85f}, + new float[3]{0.67f, 0.77f, 0.83f}, + new float[3]{0.68f, 0.68f, 0.68f}, + }; + + public static PALBUF[] m_PaletteBuf = new PALBUF[64] + { + new PALBUF(0x7F, 0x7F, 0x7F), + new PALBUF(0x20, 0x00, 0xB0), + new PALBUF(0x28, 0x00, 0xB8), + new PALBUF(0x60, 0x10, 0xA0), + new PALBUF(0x98, 0x20, 0x78), + new PALBUF(0xB0, 0x10, 0x30), + new PALBUF(0xA0, 0x30, 0x00), + new PALBUF(0x78, 0x40, 0x00), + new PALBUF(0x48, 0x58, 0x00), + new PALBUF(0x38, 0x68, 0x00), + new PALBUF(0x38, 0x6C, 0x00), + new PALBUF(0x30, 0x60, 0x40), + new PALBUF(0x30, 0x50, 0x80), + new PALBUF(0x00, 0x00, 0x00), + new PALBUF(0x00, 0x00, 0x00), + new PALBUF(0x00, 0x00, 0x00), + new PALBUF(0xBC, 0xBC, 0xBC), + new PALBUF(0x40, 0x60, 0xF8), + new PALBUF(0x40, 0x40, 0xFF), + new PALBUF(0x90, 0x40, 0xF0), + new PALBUF(0xD8, 0x40, 0xC0), + new PALBUF(0xD8, 0x40, 0x60), + new PALBUF(0xE0, 0x50, 0x00), + new PALBUF(0xC0, 0x70, 0x00), + new PALBUF(0x88, 0x88, 0x00), + new PALBUF(0x50, 0xA0, 0x00), + new PALBUF(0x48, 0xA8, 0x10), + new PALBUF(0x48, 0xA0, 0x68), + new PALBUF(0x40, 0x90, 0xC0), + new PALBUF(0x00, 0x00, 0x00), + new PALBUF(0x00, 0x00, 0x00), + new PALBUF(0x00, 0x00, 0x00), + new PALBUF(0xFF, 0xFF, 0xFF), + new PALBUF(0x60, 0xA0, 0xFF), + new PALBUF(0x50, 0x80, 0xFF), + new PALBUF(0xA0, 0x70, 0xFF), + new PALBUF(0xF0, 0x60, 0xFF), + new PALBUF(0xFF, 0x60, 0xB0), + new PALBUF(0xFF, 0x78, 0x30), + new PALBUF(0xFF, 0xA0, 0x00), + new PALBUF(0xE8, 0xD0, 0x20), + new PALBUF(0x98, 0xE8, 0x00), + new PALBUF(0x70, 0xF0, 0x40), + new PALBUF(0x70, 0xE0, 0x90), + new PALBUF(0x60, 0xD0, 0xE0), + new PALBUF(0x60, 0x60, 0x60), + new PALBUF(0x00, 0x00, 0x00), + new PALBUF(0x00, 0x00, 0x00), + new PALBUF(0xFF, 0xFF, 0xFF), + new PALBUF(0x90, 0xD0, 0xFF), + new PALBUF(0xA0, 0xB8, 0xFF), + new PALBUF(0xC0, 0xB0, 0xFF), + new PALBUF(0xE0, 0xB0, 0xFF), + new PALBUF(0xFF, 0xB8, 0xE8), + new PALBUF(0xFF, 0xC8, 0xB8), + new PALBUF(0xFF, 0xD8, 0xA0), + new PALBUF(0xFF, 0xF0, 0x90), + new PALBUF(0xC8, 0xF0, 0x80), + new PALBUF(0xA0, 0xF0, 0xA0), + new PALBUF(0xA0, 0xFF, 0xC8), + new PALBUF(0xA0, 0xFF, 0xF0), + new PALBUF(0xA0, 0xA0, 0xA0), + new PALBUF(0x00, 0x00, 0x00), + new PALBUF(0x00, 0x00, 0x00), + }; + + #region 256色モード用 + // Color + public static RGBQUAD[][] m_cpPalette = new RGBQUAD[8][] + { + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + }; + // Monochrome + public static RGBQUAD[][] m_mpPalette = new RGBQUAD[8][] + { + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + }; + #endregion + + #region ピクセルフォーマットに変換したパレット + // Color + public static uint[][] m_cnPalette = new uint[8][] + { + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + }; + // Color/Scanline + public static uint[][] m_csPalette = new uint[8][] + { + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + }; + + // Monochrome + public static uint[][] m_mnPalette = new uint[8][] + { + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + }; + + // Monochrome/Scanline + public static uint[][] m_msPalette = new uint[8][] + { + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + }; + #endregion + + public static RGBQUAD[] GetPaletteData() + { + RGBQUAD[] rgb = new RGBQUAD[256]; + for (int i = 0; i < 64; i++) + { + rgb[i] = m_cpPalette[0][i]; + rgb[i + 0x40] = m_mpPalette[0][i]; + } + + return rgb; + } + + static PaletteDefine() + { + int Rbit = 0, Gbit = 0, Bbit = 0; + int Rsft = 0, Gsft = 0, Bsft = 0; + + GetBitMask(0xFF0000, ref Rsft, ref Rbit); + GetBitMask(0x00FF00, ref Gsft, ref Gbit); + GetBitMask(0x0000FF, ref Bsft, ref Bbit); + + for (int j = 0; j < 8; j++) + { + for (int i = 0; i < 64; i++) + { + uint Rn, Gn, Bn; + uint Rs, Gs, Bs; + + // Normal + Rn = (uint)(PalConvTbl[j][0] * m_PaletteBuf[i].r); + Gn = (uint)(PalConvTbl[j][1] * m_PaletteBuf[i].g); + Bn = (uint)(PalConvTbl[j][2] * m_PaletteBuf[i].b); + // Scanline + Rs = (uint)(PalConvTbl[j][0] * m_PaletteBuf[i].r * m_nScanlineColor / 100.0f); + Gs = (uint)(PalConvTbl[j][1] * m_PaletteBuf[i].g * m_nScanlineColor / 100.0f); + Bs = (uint)(PalConvTbl[j][2] * m_PaletteBuf[i].b * m_nScanlineColor / 100.0f); + + m_cpPalette[j][i + 0x00].rgbRed = (byte)Rn; + m_cpPalette[j][i + 0x00].rgbGreen = (byte)Gn; + m_cpPalette[j][i + 0x00].rgbBlue = (byte)Bn; + m_cpPalette[j][i + 0x40].rgbRed = (byte)Rs; + m_cpPalette[j][i + 0x40].rgbGreen = (byte)Gs; + m_cpPalette[j][i + 0x40].rgbBlue = (byte)Bs; + + m_cnPalette[j][i] = ((Rn >> (8 - Rbit)) << Rsft) | ((Gn >> (8 - Gbit)) << Gsft) | ((Bn >> (8 - Bbit)) << Bsft); + m_csPalette[j][i] = ((Rs >> (8 - Rbit)) << Rsft) | ((Gs >> (8 - Gbit)) << Gsft) | ((Bs >> (8 - Bbit)) << Bsft); + + // Monochrome + Rn = (uint)(m_PaletteBuf[i & 0x30].r); + Gn = (uint)(m_PaletteBuf[i & 0x30].g); + Bn = (uint)(m_PaletteBuf[i & 0x30].b); + Rn = + Gn = + Bn = (uint)(0.299f * Rn + 0.587f * Gn + 0.114f * Bn); + Rn = (uint)(PalConvTbl[j][0] * Rn); + Gn = (uint)(PalConvTbl[j][1] * Gn); + Bn = (uint)(PalConvTbl[j][2] * Bn); + if (Rn > 0xFF) Rs = 0xFF; + if (Gn > 0xFF) Gs = 0xFF; + if (Bn > 0xFF) Bs = 0xFF; + // Scanline + Rs = (uint)(m_PaletteBuf[i & 0x30].r * m_nScanlineColor / 100.0f); + Gs = (uint)(m_PaletteBuf[i & 0x30].g * m_nScanlineColor / 100.0f); + Bs = (uint)(m_PaletteBuf[i & 0x30].b * m_nScanlineColor / 100.0f); + Rs = + Gs = + Bs = (uint)(0.299f * Rs + 0.587f * Gs + 0.114f * Bs); + Rs = (uint)(PalConvTbl[j][0] * Rs); + Gs = (uint)(PalConvTbl[j][1] * Gs); + Bs = (uint)(PalConvTbl[j][2] * Bs); + if (Rs > 0xFF) Rs = 0xFF; + if (Gs > 0xFF) Gs = 0xFF; + if (Bs > 0xFF) Bs = 0xFF; + + m_mpPalette[j][i + 0x00].rgbRed = (byte)Rn; + m_mpPalette[j][i + 0x00].rgbGreen = (byte)Gn; + m_mpPalette[j][i + 0x00].rgbBlue = (byte)Bn; + m_mpPalette[j][i + 0x40].rgbRed = (byte)Rs; + m_mpPalette[j][i + 0x40].rgbGreen = (byte)Gs; + m_mpPalette[j][i + 0x40].rgbBlue = (byte)Bs; + + m_mnPalette[j][i] = ((Rn >> (8 - Rbit)) << Rsft) | ((Gn >> (8 - Gbit)) << Gsft) | ((Bn >> (8 - Bbit)) << Bsft); + m_msPalette[j][i] = ((Rs >> (8 - Rbit)) << Rsft) | ((Gs >> (8 - Gbit)) << Gsft) | ((Bs >> (8 - Bbit)) << Bsft); + } + } + } + + // ビット位置の取得 + static void GetBitMask(uint val, ref int shift, ref int bits) + { + shift = 0; + while (((val & (1 << shift)) == 0) && (shift < 32)) + { + shift++; + } + + bits = 32; + while (((val & (1 << (bits - 1))) == 0) && (bits > 0)) + { + bits--; + } + bits = bits - shift; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/PaletteDefine.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/PaletteDefine.cs.meta new file mode 100644 index 0000000..d93c9c2 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/PaletteDefine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bbd3f54279eb4ae45831a914b13d1cec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/PatternViewer.cs b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/PatternViewer.cs new file mode 100644 index 0000000..7abb3af --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/PatternViewer.cs @@ -0,0 +1,85 @@ +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +using VirtualNes; +using static AxibugEmuOnline.Client.PaletteDefine; + +namespace AxibugEmuOnline.Client +{ + public class PatternViewer : MonoBehaviour + { + public RawImage img; + + private Color32[] m_lpPattern = new Color32[128 * 256]; + private Texture2D m_texture; + private Dictionary colors = new Dictionary(); + + private void Awake() + { + m_texture = new Texture2D(128, 256); + } + + private void Update() + { + Paint(); + } + + private void OnEnable() + { + img.gameObject.SetActive(true); + } + + private void OnDisable() + { + img.gameObject.SetActive(false); + } + + public void Paint() + { + img.texture = m_texture; + + var pal = MMU.SPPAL; + var palette = PaletteDefine.GetPaletteData(); + colors[0] = palette[pal[0]]; + colors[1] = palette[pal[1]]; + colors[2] = palette[pal[2]]; + colors[3] = palette[pal[3]]; + + for (int i = 0; i < 8; i++) + { + var Ptn = MMU.PPU_MEM_BANK[i]; + int lpPtn = 0; + for (int p = 0; p < 64; p++) + { + int lpScn = i * 32 * 128 + (p & 15) * 8 + (p / 16) * 8 * 128; + for (int y = 0; y < 8; y++) + { + byte chr_l = Ptn[lpPtn + y]; + byte chr_h = Ptn[lpPtn + y + 8]; + m_lpPattern[lpScn + 0] = ToColor32(colors, (((chr_h >> 6) & 2) | ((chr_l >> 7) & 1))); + m_lpPattern[lpScn + 4] = ToColor32(colors, (((chr_h >> 2) & 2) | ((chr_l >> 3) & 1))); + m_lpPattern[lpScn + 1] = ToColor32(colors, (((chr_h >> 5) & 2) | ((chr_l >> 6) & 1))); + m_lpPattern[lpScn + 5] = ToColor32(colors, (((chr_h >> 1) & 2) | ((chr_l >> 2) & 1))); + m_lpPattern[lpScn + 2] = ToColor32(colors, (((chr_h >> 4) & 2) | ((chr_l >> 5) & 1))); + m_lpPattern[lpScn + 6] = ToColor32(colors, (((chr_h >> 0) & 2) | ((chr_l >> 1) & 1))); + m_lpPattern[lpScn + 3] = ToColor32(colors, (((chr_h >> 3) & 2) | ((chr_l >> 4) & 1))); + m_lpPattern[lpScn + 7] = ToColor32(colors, (((chr_h << 1) & 2) | ((chr_l >> 0) & 1))); + // Next line + lpScn += 128; + } + // Next pattern + lpPtn += 16; + } + } + + m_texture.SetPixels32(m_lpPattern); + m_texture.Apply(); + } + + private Color32 ToColor32(Dictionary map, int v) + { + var raw = map[(byte)v]; + return new Color32(raw.rgbRed, raw.rgbGreen, raw.rgbBlue, 255); + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/PatternViewer.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/PatternViewer.cs.meta new file mode 100644 index 0000000..8079167 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/PatternViewer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c7a50c189f5be5b4ea54de444f8488a0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/RomDB.cs b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/RomDB.cs new file mode 100644 index 0000000..178b2ff --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/RomDB.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace AxibugEmuOnline.Client.ClientCore +{ + public class RomDB : ScriptableObject + { + [SerializeField] + private List romInfos = new List(); + + private Dictionary 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(); + foreach (var info in romInfos) + { + crc_Info_mapper[info.CRC] = info; + } + } + RomInfo romInfo; + + if (crc_Info_mapper.TryGetValue(crc, out romInfo)) + { + mapperNo = romInfo.Mapper; + return true; + } + else + { + mapperNo = -1; + return false; + } + } + + [Serializable] + public class RomInfo + { + public uint CRC; + public int Mapper; + } + } + +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/RomDB.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/RomDB.cs.meta new file mode 100644 index 0000000..cd743a2 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/RomDB.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 29131082dba8d234481296f0cf29a1fe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/VideoProvider.cs b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/VideoProvider.cs new file mode 100644 index 0000000..a3f0f82 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/VideoProvider.cs @@ -0,0 +1,69 @@ +using System; +using System.Runtime.InteropServices; +using UnityEngine; +using UnityEngine.UI; + +namespace AxibugEmuOnline.Client +{ + public class VideoProvider : MonoBehaviour + { + public NesEmulator NesEmu; + + public RawImage Image; + public Text fpstext; + + private UInt32[] wrapTexBuffer; + private IntPtr wrapTexBufferPointer; + private Texture2D wrapTex; + private int TexBufferSize; + + private Texture2D pPal; + float lasttime; + public float detalTime; + public void SetDrawData(uint[] screenData, byte[] lineColorMode, int screenWidth, int screenHeight) + { + if (wrapTex == null) + { + //wrapTex = new Texture2D(272, 240, TextureFormat.BGRA32, false); + wrapTex = new Texture2D(272, 240, TextureFormat.RGBA32, false); + wrapTex.filterMode = FilterMode.Point; + wrapTexBuffer = screenData; + + // ̶飬ֹƶ + GCHandle handle = GCHandle.Alloc(wrapTexBuffer, GCHandleType.Pinned); + // ȡָ + wrapTexBufferPointer = handle.AddrOfPinnedObject(); + + Image.texture = wrapTex; + Image.material.SetTexture("_MainTex", wrapTex); + + TexBufferSize = wrapTexBuffer.Length * 4; + + var palRaw = PaletteDefine.m_cnPalette[0]; + //pPal = new Texture2D(palRaw.Length, 1, TextureFormat.BGRA32, 1, true); + pPal = new Texture2D(palRaw.Length, 1, TextureFormat.RGBA32, true); + pPal.filterMode = FilterMode.Point; + for (int i = 0; i < palRaw.Length; i++) + { + uint colorRaw = palRaw[i]; + var argbColor = BitConverter.GetBytes(colorRaw); + Color temp = Color.white; + temp.r = argbColor[2] / 255f; + temp.g = argbColor[1] / 255f; + temp.b = argbColor[0] / 255f; + temp.a = 1; + pPal.SetPixel(i, 0, temp); + } + pPal.Apply(); + Image.material.SetTexture("_PalTex", pPal); + } + + wrapTex.LoadRawTextureData(wrapTexBufferPointer, TexBufferSize); + wrapTex.Apply(); + + detalTime = Time.time - lasttime; + lasttime = Time.time; + fpstext.text = (1f / detalTime).ToString(); + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/VideoProvider.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/VideoProvider.cs.meta new file mode 100644 index 0000000..a7c1dff --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/NesEmulator/VideoProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 83fbe375412d1af4482ae76e81c1dda2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/RingBuffer.cs b/AxibugEmuOnline.Client.PSVita/Assets/Script/RingBuffer.cs new file mode 100644 index 0000000..ff3727c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/RingBuffer.cs @@ -0,0 +1,72 @@ +using System.Threading; + +public class RingBuffer +{ + private readonly T[] buffer; + private readonly int capacity; + private int writePos; + private int readPos; + private int count; + + public RingBuffer(int capacity) + { + this.capacity = capacity; + this.buffer = new T[capacity]; + this.writePos = 0; + this.readPos = 0; + this.count = 0; + } + + public void Write(T item) + { + int localWritePos; + int localReadPos; + + do + { + localWritePos = Volatile.Read(ref writePos); + localReadPos = Volatile.Read(ref readPos); + + int nextWritePos = (localWritePos + 1) % capacity; + + if (nextWritePos == localReadPos) + { + // ɵδ + Interlocked.CompareExchange(ref readPos, (localReadPos + 1) % capacity, localReadPos); + } + } + while (Interlocked.CompareExchange(ref writePos, (localWritePos + 1) % capacity, localWritePos) != localWritePos); + + buffer[localWritePos] = item; + Interlocked.Increment(ref count); + } + + public bool TryRead(out T item) + { + item = default(T); + + int localReadPos; + int localWritePos; + + do + { + localReadPos = Volatile.Read(ref readPos); + localWritePos = Volatile.Read(ref writePos); + + if (localReadPos == localWritePos) + { + return false; // Ϊ + } + } + while (Interlocked.CompareExchange(ref readPos, (localReadPos + 1) % capacity, localReadPos) != localReadPos); + + item = buffer[localReadPos]; + Interlocked.Decrement(ref count); + return true; + } + + public int Available() + { + return Volatile.Read(ref count); + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/RingBuffer.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/Script/RingBuffer.cs.meta new file mode 100644 index 0000000..902ec9a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/RingBuffer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6bd0f6c1647ed3f49a59e7f06406f49b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/SoundBuffer.cs b/AxibugEmuOnline.Client.PSVita/Assets/Script/SoundBuffer.cs new file mode 100644 index 0000000..0430c54 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/SoundBuffer.cs @@ -0,0 +1,11 @@ +using VirtualNes.Core; + +public class SoundBuffer : RingBuffer, ISoundDataBuffer +{ + public SoundBuffer(int capacity) : base(capacity) { } + + public void WriteByte(byte value) + { + Write(value); + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/Script/SoundBuffer.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/Script/SoundBuffer.cs.meta new file mode 100644 index 0000000..128c170 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/Script/SoundBuffer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c5f491c577bed63478340426f7698563 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets.meta b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets.meta new file mode 100644 index 0000000..6ecc4e7 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1bb2987740587b44e90ef7dfc1832a23 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES.meta b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES.meta new file mode 100644 index 0000000..eeda059 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fc7102c34a9fa4148b4aa74d54e82b1f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms.meta b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms.meta new file mode 100644 index 0000000..97938b3 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ac852e7a0b9604940b0f7e0180fd2707 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/KickMaster.nes b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/KickMaster.nes new file mode 100644 index 0000000..ba2dbba Binary files /dev/null and b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/KickMaster.nes differ diff --git a/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/KickMaster.nes.meta b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/KickMaster.nes.meta new file mode 100644 index 0000000..58be4e5 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/KickMaster.nes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8cc6e346f997e294c9dcea50436c1757 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/Kirby.nes b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/Kirby.nes new file mode 100644 index 0000000..f2ac915 Binary files /dev/null and b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/Kirby.nes differ diff --git a/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/Kirby.nes.meta b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/Kirby.nes.meta new file mode 100644 index 0000000..803c960 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/Kirby.nes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 41cd7684d8de61f4499c3aa27a6c5b3a +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/Mario.nes b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/Mario.nes new file mode 100644 index 0000000..878ef21 Binary files /dev/null and b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/Mario.nes differ diff --git a/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/Mario.nes.meta b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/Mario.nes.meta new file mode 100644 index 0000000..66eb8f2 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/Mario.nes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 50dfce75937af2a44bafd221a0163501 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/ff1.NES b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/ff1.NES new file mode 100644 index 0000000..1665b6d Binary files /dev/null and b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/ff1.NES differ diff --git a/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/ff1.NES.meta b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/ff1.NES.meta new file mode 100644 index 0000000..2681206 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/ff1.NES.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 091b4306faaa8fc4084836c5237b76c8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/msg.nes b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/msg.nes new file mode 100644 index 0000000..3a5f57d Binary files /dev/null and b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/msg.nes differ diff --git a/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/msg.nes.meta b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/msg.nes.meta new file mode 100644 index 0000000..8a69b2d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/msg.nes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a5222bc76eba99e4c9fc92b70f4103bc +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/tortoise4.nes b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/tortoise4.nes new file mode 100644 index 0000000..46a85a0 Binary files /dev/null and b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/tortoise4.nes differ diff --git a/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/tortoise4.nes.meta b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/tortoise4.nes.meta new file mode 100644 index 0000000..206dbb7 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/tortoise4.nes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7abf09a3e3fd84648852e5d972dfd260 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/tstd2.nes b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/tstd2.nes new file mode 100644 index 0000000..68461fd Binary files /dev/null and b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/tstd2.nes differ diff --git a/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/tstd2.nes.meta b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/tstd2.nes.meta new file mode 100644 index 0000000..0d85e01 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/StreamingAssets/NES/Roms/tstd2.nes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0fcf57d6e248ead4a874daa51181ec5f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core.meta new file mode 100644 index 0000000..e529317 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2c5bcc6d5df67f04d93e0ab812c36b4e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/APU.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/APU.cs new file mode 100644 index 0000000..4fc1e64 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/APU.cs @@ -0,0 +1,559 @@ +//using Codice.CM.Client.Differences; +using System; +using System.IO; +using System.Security.Principal; +using UnityEngine; +using VirtualNes.Core; +using VirtualNes.Core.Debug; + +namespace VirtualNes.Core +{ + public class APU + { + public const uint QUEUE_LENGTH = 8192; + + // Volume adjust + // Internal sounds + public const uint RECTANGLE_VOL = 0x0F0; + public const uint TRIANGLE_VOL = 0x130; + public const uint NOISE_VOL = 0x0C0; + public const uint DPCM_VOL = 0x0F0; + // Extra sounds + public const uint VRC6_VOL = 0x0F0; + public const uint VRC7_VOL = 0x130; + public const uint FDS_VOL = 0x0F0; + public const uint MMC5_VOL = 0x0F0; + public const uint N106_VOL = 0x088; + public const uint FME7_VOL = 0x130; + + private NES nes; + private byte exsound_select; + private APU_INTERNAL @internal = new APU_INTERNAL(); + private APU_VRC6 vrc6 = new APU_VRC6(); + private APU_VRC7 vrc7 = new APU_VRC7(); + private APU_MMC5 mmc5 = new APU_MMC5(); + private APU_FDS fds = new APU_FDS(); + private APU_N106 n106 = new APU_N106(); + private APU_FME7 fme7 = new APU_FME7(); + private int last_data; + private int last_diff; + protected short[] m_SoundBuffer = new short[256]; + protected int[] lowpass_filter = new int[4]; + protected QUEUE queue = new QUEUE(); + protected QUEUE exqueue = new QUEUE(); + protected bool[] m_bMute = new bool[16]; + protected double elapsed_time; + + public APU(NES parent) + { + exsound_select = 0; + + nes = parent; + @internal.SetParent(parent); + + last_data = last_diff = 0; + + Array.Clear(m_SoundBuffer, 0, m_SoundBuffer.Length); + Array.Clear(lowpass_filter, 0, lowpass_filter.Length); + + for (int i = 0; i < m_bMute.Length; i++) + m_bMute[i] = true; + } + + public void Dispose() + { + @internal.Dispose(); + vrc6.Dispose(); + vrc7.Dispose(); + mmc5.Dispose(); + fds.Dispose(); + n106.Dispose(); + fme7.Dispose(); + } + + private int[] vol = new int[24]; + static double cutofftemp = (2.0 * 3.141592653579 * 40.0); + static double tmp = 0.0; + + public void Process(ISoundDataBuffer lpBuffer, uint dwSize) + { + int nBits = Supporter.Config.sound.nBits; + uint dwLength = (uint)(dwSize / (nBits / 8)); + int output; + QUEUEDATA q = new QUEUEDATA(); + uint writetime; + + var pSoundBuf = m_SoundBuffer; + int nCcount = 0; + + int nFilterType = Supporter.Config.sound.nFilterType; + + if (!Supporter.Config.sound.bEnable) + { + byte empty = (byte)(Supporter.Config.sound.nRate == 8 ? 128 : 0); + for (int i = 0; i < dwSize; i++) + lpBuffer.WriteByte(empty); + return; + } + + // Volume setup + // 0:Master + // 1:Rectangle 1 + // 2:Rectangle 2 + // 3:Triangle + // 4:Noise + // 5:DPCM + // 6:VRC6 + // 7:VRC7 + // 8:FDS + // 9:MMC5 + // 10:N106 + // 11:FME7 + MemoryUtility.ZEROMEMORY(vol, vol.Length); + + var bMute = m_bMute; + var nVolume = Supporter.Config.sound.nVolume; + + int nMasterVolume = bMute[0] ? nVolume[0] : 0; + + // Internal + vol[0] = (int)(bMute[1] ? (RECTANGLE_VOL * nVolume[1] * nMasterVolume) / (100 * 100) : 0); + vol[1] = (int)(bMute[2] ? (RECTANGLE_VOL * nVolume[2] * nMasterVolume) / (100 * 100) : 0); + vol[2] = (int)(bMute[3] ? (TRIANGLE_VOL * nVolume[3] * nMasterVolume) / (100 * 100) : 0); + vol[3] = (int)(bMute[4] ? (NOISE_VOL * nVolume[4] * nMasterVolume) / (100 * 100) : 0); + vol[4] = (int)(bMute[5] ? (DPCM_VOL * nVolume[5] * nMasterVolume) / (100 * 100) : 0); + + // VRC6 + vol[5] = (int)(bMute[6] ? (VRC6_VOL * nVolume[6] * nMasterVolume) / (100 * 100) : 0); + vol[6] = (int)(bMute[7] ? (VRC6_VOL * nVolume[6] * nMasterVolume) / (100 * 100) : 0); + vol[7] = (int)(bMute[8] ? (VRC6_VOL * nVolume[6] * nMasterVolume) / (100 * 100) : 0); + + // VRC7 + vol[8] = (int)(bMute[6] ? (VRC7_VOL * nVolume[7] * nMasterVolume) / (100 * 100) : 0); + + // FDS + vol[9] = (int)(bMute[6] ? (FDS_VOL * nVolume[8] * nMasterVolume) / (100 * 100) : 0); + + // MMC5 + vol[10] = (int)(bMute[6] ? (MMC5_VOL * nVolume[9] * nMasterVolume) / (100 * 100) : 0); + vol[11] = (int)(bMute[7] ? (MMC5_VOL * nVolume[9] * nMasterVolume) / (100 * 100) : 0); + vol[12] = (int)(bMute[8] ? (MMC5_VOL * nVolume[9] * nMasterVolume) / (100 * 100) : 0); + + // N106 + vol[13] = (int)(bMute[6] ? (N106_VOL * nVolume[10] * nMasterVolume) / (100 * 100) : 0); + vol[14] = (int)(bMute[7] ? (N106_VOL * nVolume[10] * nMasterVolume) / (100 * 100) : 0); + vol[15] = (int)(bMute[8] ? (N106_VOL * nVolume[10] * nMasterVolume) / (100 * 100) : 0); + vol[16] = (int)(bMute[9] ? (N106_VOL * nVolume[10] * nMasterVolume) / (100 * 100) : 0); + vol[17] = (int)(bMute[10] ? (N106_VOL * nVolume[10] * nMasterVolume) / (100 * 100) : 0); + vol[18] = (int)(bMute[11] ? (N106_VOL * nVolume[10] * nMasterVolume) / (100 * 100) : 0); + vol[19] = (int)(bMute[12] ? (N106_VOL * nVolume[10] * nMasterVolume) / (100 * 100) : 0); + vol[20] = (int)(bMute[13] ? (N106_VOL * nVolume[10] * nMasterVolume) / (100 * 100) : 0); + + // FME7 + vol[21] = (int)(bMute[6] ? (FME7_VOL * nVolume[11] * nMasterVolume) / (100 * 100) : 0); + vol[22] = (int)(bMute[7] ? (FME7_VOL * nVolume[11] * nMasterVolume) / (100 * 100) : 0); + vol[23] = (int)(bMute[8] ? (FME7_VOL * nVolume[11] * nMasterVolume) / (100 * 100) : 0); + + // double cycle_rate = ((double)FRAME_CYCLES*60.0/12.0)/(double)Config.sound.nRate; + double cycle_rate = (nes.nescfg.FrameCycles * 60.0 / 12.0) / Supporter.Config.sound.nRate; + + // CPUサイクル数がループしてしまった時の対策処理 + if (elapsed_time > nes.cpu.GetTotalCycles()) + { + QueueFlush(); + } + + while ((dwLength--) != 0) + { + writetime = (uint)elapsed_time; + + while (GetQueue((int)writetime, ref q)) + { + WriteProcess(q.addr, q.data); + } + + while (GetExQueue((int)writetime, ref q)) + { + WriteExProcess(q.addr, q.data); + } + + // 0-4:internal 5-7:VRC6 8:VRC7 9:FDS 10-12:MMC5 13-20:N106 21-23:FME7 + output = 0; + output += @internal.Process(0) * vol[0]; + output += @internal.Process(1) * vol[1]; + output += @internal.Process(2) * vol[2]; + output += @internal.Process(3) * vol[3]; + output += @internal.Process(4) * vol[4]; + + if ((exsound_select & 0x01) != 0) + { + output += vrc6.Process(0) * vol[5]; + output += vrc6.Process(1) * vol[6]; + output += vrc6.Process(2) * vol[7]; + } + if ((exsound_select & 0x02) != 0) + { + output += vrc7.Process(0) * vol[8]; + } + if ((exsound_select & 0x04) != 0) + { + output += fds.Process(0) * vol[9]; + } + if ((exsound_select & 0x08) != 0) + { + output += mmc5.Process(0) * vol[10]; + output += mmc5.Process(1) * vol[11]; + output += mmc5.Process(2) * vol[12]; + } + if ((exsound_select & 0x10) != 0) + { + output += n106.Process(0) * vol[13]; + output += n106.Process(1) * vol[14]; + output += n106.Process(2) * vol[15]; + output += n106.Process(3) * vol[16]; + output += n106.Process(4) * vol[17]; + output += n106.Process(5) * vol[18]; + output += n106.Process(6) * vol[19]; + output += n106.Process(7) * vol[20]; + } + if ((exsound_select & 0x20) != 0) + { + fme7.Process(3); // Envelope & Noise + output += fme7.Process(0) * vol[21]; + output += fme7.Process(1) * vol[22]; + output += fme7.Process(2) * vol[23]; + } + + output >>= 8; + + if (nFilterType == 1) + { + //ローパスフィルターTYPE 1(Simple) + output = (lowpass_filter[0] + output) / 2; + lowpass_filter[0] = output; + } + else if (nFilterType == 2) + { + //ローパスフィルターTYPE 2(Weighted type 1) + output = (lowpass_filter[1] + lowpass_filter[0] + output) / 3; + lowpass_filter[1] = lowpass_filter[0]; + lowpass_filter[0] = output; + } + else if (nFilterType == 3) + { + //ローパスフィルターTYPE 3(Weighted type 2) + output = (lowpass_filter[2] + lowpass_filter[1] + lowpass_filter[0] + output) / 4; + lowpass_filter[2] = lowpass_filter[1]; + lowpass_filter[1] = lowpass_filter[0]; + lowpass_filter[0] = output; + } + else if (nFilterType == 4) + { + //ローパスフィルターTYPE 4(Weighted type 3) + output = (lowpass_filter[1] + lowpass_filter[0] * 2 + output) / 4; + lowpass_filter[1] = lowpass_filter[0]; + lowpass_filter[0] = output; + } + // DC成分のカット(HPF TEST) + { + // static double cutoff = (2.0*3.141592653579*40.0/44100.0); + double cutoff = cutofftemp / Supporter.Config.sound.nRate; + double @in, @out; + + @in = output; + @out = (@in - tmp); + tmp = tmp + cutoff * @out; + + output = (int)@out; + } + + // Limit + if (output > 0x7FFF) + { + output = 0x7FFF; + } + else if (output < -0x8000) + { + output = -0x8000; + } + + if (nBits != 8) + { + byte highByte = (byte)(output >> 8); // 获取高8位 + byte lowByte = (byte)(output & 0xFF); // 获取低8位 + lpBuffer.WriteByte(highByte); + lpBuffer.WriteByte(lowByte); + } + else + { + lpBuffer.WriteByte((byte)((output >> 8) ^ 0x80)); + } + + if (nCcount < 0x0100) + pSoundBuf[nCcount++] = (short)output; + + // elapsedtime += cycle_rate; + elapsed_time += cycle_rate; + } + + + if (elapsed_time > ((nes.nescfg.FrameCycles / 24) + nes.cpu.GetTotalCycles())) + { + elapsed_time = nes.cpu.GetTotalCycles(); + } + if ((elapsed_time + (nes.nescfg.FrameCycles / 6)) < nes.cpu.GetTotalCycles()) + { + elapsed_time = nes.cpu.GetTotalCycles(); + } + } + + private bool GetExQueue(int writetime, ref QUEUEDATA ret) + { + if (exqueue.wrptr == exqueue.rdptr) + { + return false; + } + if (exqueue.data[exqueue.rdptr].time <= writetime) + { + ret = exqueue.data[exqueue.rdptr]; + exqueue.rdptr++; + exqueue.rdptr = (int)(exqueue.rdptr & (QUEUE_LENGTH - 1)); + return true; + } + return false; + } + + private void QueueFlush() + { + while (queue.wrptr != queue.rdptr) + { + WriteProcess(queue.data[queue.rdptr].addr, queue.data[queue.rdptr].data); + queue.rdptr++; + queue.rdptr = (int)(queue.rdptr & (QUEUE_LENGTH - 1)); + } + + while (exqueue.wrptr != exqueue.rdptr) + { + WriteExProcess(exqueue.data[exqueue.rdptr].addr, exqueue.data[exqueue.rdptr].data); + exqueue.rdptr++; + exqueue.rdptr = (int)(exqueue.rdptr & (QUEUE_LENGTH - 1)); + } + } + + private void WriteExProcess(ushort addr, byte data) + { + if ((exsound_select & 0x01) != 0) + { + vrc6.Write(addr, data); + } + if ((exsound_select & 0x02) != 0) + { + vrc7.Write(addr, data); + } + if ((exsound_select & 0x04) != 0) + { + fds.Write(addr, data); + } + if ((exsound_select & 0x08) != 0) + { + mmc5.Write(addr, data); + } + if ((exsound_select & 0x10) != 0) + { + if (addr == 0x0000) + { + byte dummy = n106.Read(addr); + } + else + { + n106.Write(addr, data); + } + } + if ((exsound_select & 0x20) != 0) + { + fme7.Write(addr, data); + } + } + + private void WriteProcess(ushort addr, byte data) + { + // $4018はVirtuaNES固有ポート + if (addr >= 0x4000 && addr <= 0x401F) + { + @internal.Write(addr, data); + } + } + + internal void SyncDPCM(int cycles) + { + @internal.Sync(cycles); + } + + internal byte Read(ushort addr) + { + return @internal.SyncRead(addr); + } + + internal void Write(ushort addr, byte data) + { + // $4018偼VirtuaNES屌桳億乕僩 + if (addr >= 0x4000 && addr <= 0x401F) + { + @internal.SyncWrite(addr, data); + SetQueue(nes.cpu.GetTotalCycles(), addr, data); + } + } + + private void SetQueue(int writetime, ushort addr, byte data) + { + queue.data[queue.wrptr].time = writetime; + queue.data[queue.wrptr].addr = addr; + queue.data[queue.wrptr].data = data; + queue.wrptr++; + + var newwrptr = (int)(queue.wrptr & (QUEUE_LENGTH - 1)); + queue.wrptr = newwrptr; + + if (queue.wrptr == queue.rdptr) + { + Debuger.LogError("queue overflow."); + } + } + + private bool GetQueue(int writetime, ref QUEUEDATA ret) + { + if (queue.wrptr == queue.rdptr) + { + return false; + } + if (queue.data[queue.rdptr].time <= writetime) + { + ret = queue.data[queue.rdptr]; + queue.rdptr++; + var newrdptr = (int)(queue.rdptr & (QUEUE_LENGTH - 1)); + queue.rdptr = newrdptr; + return true; + } + return false; + } + + public void SoundSetup() + { + float fClock = nes.nescfg.CpuClock; + int nRate = Supporter.Config.sound.nRate; + + @internal.Setup(fClock, nRate); + vrc6.Setup(fClock, nRate); + vrc7.Setup(fClock, nRate); + mmc5.Setup(fClock, nRate); + fds.Setup(fClock, nRate); + n106.Setup(fClock, nRate); + fme7.Setup(fClock, nRate); + } + + internal void SelectExSound(byte data) + { + exsound_select = data; + } + + internal void Reset() + { + queue = new QUEUE(); + exqueue = new QUEUE(); + + elapsed_time = 0; + + float fClock = nes.nescfg.CpuClock; + int nRate = Supporter.Config.sound.nRate; + + @internal.Reset(fClock, nRate); + vrc6.Reset(fClock, nRate); + vrc7.Reset(fClock, nRate); + mmc5.Reset(fClock, nRate); + fds.Reset(fClock, nRate); + n106.Reset(fClock, nRate); + fme7.Reset(fClock, nRate); + + SoundSetup(); + } + + internal void ExWrite(ushort addr, byte data) + { + SetExQueue(nes.cpu.GetTotalCycles(), addr, data); + + if ((exsound_select & 0x04) != 0) + { + if (addr >= 0x4040 && addr < 0x4100) + { + fds.SyncWrite(addr, data); + } + } + + if ((exsound_select & 0x08) != 0) + { + if (addr >= 0x5000 && addr <= 0x5015) + { + mmc5.SyncWrite(addr, data); + } + } + } + + private void SetExQueue(int writetime, ushort addr, byte data) + { + exqueue.data[exqueue.wrptr].time = writetime; + exqueue.data[exqueue.wrptr].addr = addr; + exqueue.data[exqueue.wrptr].data = data; + exqueue.wrptr++; + var temp = QUEUE_LENGTH - 1; + exqueue.wrptr = (int)(exqueue.wrptr & temp); + if (exqueue.wrptr == exqueue.rdptr) + { + Debuger.LogError("exqueue overflow."); + } + } + + internal byte ExRead(ushort addr) + { + byte data = 0; + + if ((exsound_select & 0x10) != 0) + { + if (addr == 0x4800) + { + SetExQueue(nes.cpu.GetTotalCycles(), 0, 0); + } + } + if ((exsound_select & 0x04) != 0) + { + if (addr >= 0x4040 && addr < 0x4100) + { + data = fds.SyncRead(addr); + } + } + if ((exsound_select & 0x08) != 0) + { + if (addr >= 0x5000 && addr <= 0x5015) + { + data = mmc5.SyncRead(addr); + } + } + + return data; + } + } + + public struct QUEUEDATA + { + public int time; + public ushort addr; + public byte data; + public byte reserved; + } + + public class QUEUE + { + public int rdptr; + public int wrptr; + public QUEUEDATA[] data = new QUEUEDATA[8192]; + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/APU.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/APU.cs.meta new file mode 100644 index 0000000..220749a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/APU.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cb5a8e579d35b9a4ca7966225235265a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX.meta new file mode 100644 index 0000000..1ce615d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e6179c4bc7e6fa744901b21b63e98aba +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_FDS.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_FDS.cs new file mode 100644 index 0000000..597bb4b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_FDS.cs @@ -0,0 +1,472 @@ +using System; + +namespace VirtualNes.Core +{ + public class APU_FDS : APU_INTERFACE + { + FDSSOUND fds = new FDSSOUND(); + FDSSOUND fds_sync = new FDSSOUND(); + int[] output_buf = new int[8]; + int sampling_rate; + + public APU_FDS() + { + fds.ZeroMemory(); + fds_sync.ZeroMemory(); + + Array.Clear(output_buf, 0, output_buf.Length); + + sampling_rate = 22050; + } + + public override void Reset(float fClock, int nRate) + { + fds.ZeroMemory(); + fds_sync.ZeroMemory(); + + sampling_rate = 22050; + } + + public override void Setup(float fClock, int nRate) + { + sampling_rate = nRate; + } + + int[] tbl_writesub = { 30, 20, 15, 12 }; + + private void WriteSub(ushort addr, byte data, FDSSOUND ch, double rate) + { + if (addr < 0x4040 || addr > 0x40BF) + return; + + ch.reg[addr - 0x4040] = data; + if (addr >= 0x4040 && addr <= 0x407F) + { + if (ch.wave_setup != 0) + { + ch.main_wavetable[addr - 0x4040] = 0x20 - (data & 0x3F); + } + } + else + { + switch (addr) + { + case 0x4080: // Volume Envelope + ch.volenv_mode = (byte)(data >> 6); + if ((data & 0x80) != 0) + { + ch.volenv_gain = (byte)(data & 0x3F); + + // 即時反映 + if (ch.main_addr == 0) + { + ch.now_volume = (ch.volenv_gain < 0x21) ? ch.volenv_gain : 0x20; + } + } + // エンベロープ1段階の演算 + ch.volenv_decay = (byte)(data & 0x3F); + ch.volenv_phaseacc = (double)ch.envelope_speed * (double)(ch.volenv_decay + 1) * rate / (232.0 * 960.0); + break; + + case 0x4082: // Main Frequency(Low) + ch.main_frequency = (ch.main_frequency & ~0x00FF) | data; + break; + case 0x4083: // Main Frequency(High) + ch.main_enable = (byte)((~data) & (1 << 7)); + ch.envelope_enable = (byte)((~data) & (1 << 6)); + if (ch.main_enable == 0) + { + ch.main_addr = 0; + ch.now_volume = (ch.volenv_gain < 0x21) ? ch.volenv_gain : 0x20; + } + // ch.main_frequency = (ch.main_frequency&0x00FF)|(((INT)data&0x3F)<<8); + ch.main_frequency = (ch.main_frequency & 0x00FF) | ((data & 0x0F) << 8); + break; + + case 0x4084: // Sweep Envelope + ch.swpenv_mode = (byte)(data >> 6); + if ((data & 0x80) != 0) + { + ch.swpenv_gain = (byte)(data & 0x3F); + } + // エンベロープ1段階の演算 + ch.swpenv_decay = (byte)(data & 0x3F); + ch.swpenv_phaseacc = (double)ch.envelope_speed * (double)(ch.swpenv_decay + 1) * rate / (232.0 * 960.0); + break; + + case 0x4085: // Sweep Bias + if ((data & 0x40) != 0) ch.sweep_bias = (data & 0x3f) - 0x40; + else ch.sweep_bias = data & 0x3f; + ch.lfo_addr = 0; + break; + + case 0x4086: // Effector(LFO) Frequency(Low) + ch.lfo_frequency = (ch.lfo_frequency & (~0x00FF)) | data; + break; + case 0x4087: // Effector(LFO) Frequency(High) + ch.lfo_enable = (byte)((~data & 0x80)); + ch.lfo_frequency = (ch.lfo_frequency & 0x00FF) | ((data & 0x0F) << 8); + break; + + case 0x4088: // Effector(LFO) wavetable + if (ch.lfo_enable == 0) + { + // FIFO? + for (byte i = 0; i < 31; i++) + { + ch.lfo_wavetable[i * 2 + 0] = ch.lfo_wavetable[(i + 1) * 2 + 0]; + ch.lfo_wavetable[i * 2 + 1] = ch.lfo_wavetable[(i + 1) * 2 + 1]; + } + ch.lfo_wavetable[31 * 2 + 0] = (byte)(data & 0x07); + ch.lfo_wavetable[31 * 2 + 1] = (byte)(data & 0x07); + } + break; + + case 0x4089: // Sound control + { + ch.master_volume = tbl_writesub[data & 3]; + ch.wave_setup = (byte)(data & 0x80); + } + break; + + case 0x408A: // Sound control 2 + ch.envelope_speed = data; + break; + + default: + break; + } + } + } + + public override void Write(ushort addr, byte data) + { + WriteSub(addr, data, fds, sampling_rate); + } + + public override byte Read(ushort addr) + { + byte data = (byte)(addr >> 8); + + if (addr >= 0x4040 && addr <= 0x407F) + { + data = (byte)(fds.main_wavetable[addr & 0x3F] | 0x40); + } + else + if (addr == 0x4090) + { + data = (byte)((fds.volenv_gain & 0x3F) | 0x40); + } + else + if (addr == 0x4092) + { + data = (byte)((fds.swpenv_gain & 0x3F) | 0x40); + } + + return data; + } + + int[] tbl_process = { 0, 1, 2, 4, 0, -4, -2, -1 }; + public override int Process(int channel) + { + // Envelope unit + if (fds.envelope_enable != 0 && fds.envelope_speed != 0) + { + // Volume envelope + if (fds.volenv_mode < 2) + { + double decay = ((double)fds.envelope_speed * (double)(fds.volenv_decay + 1) * (double)sampling_rate) / (232.0 * 960.0); + fds.volenv_phaseacc -= 1.0; + while (fds.volenv_phaseacc < 0.0) + { + fds.volenv_phaseacc += decay; + + if (fds.volenv_mode == 0) + { + // 減少モード + if (fds.volenv_gain != 0) + fds.volenv_gain--; + } + else + if (fds.volenv_mode == 1) + { + if (fds.volenv_gain < 0x20) + fds.volenv_gain++; + } + } + } + + // Sweep envelope + if (fds.swpenv_mode < 2) + { + double decay = ((double)fds.envelope_speed * (double)(fds.swpenv_decay + 1) * (double)sampling_rate) / (232.0 * 960.0); + fds.swpenv_phaseacc -= 1.0; + while (fds.swpenv_phaseacc < 0.0) + { + fds.swpenv_phaseacc += decay; + + if (fds.swpenv_mode == 0) + { + // 減少モード + if (fds.swpenv_gain != 0) + fds.swpenv_gain--; + } + else + if (fds.swpenv_mode == 1) + { + if (fds.swpenv_gain < 0x20) + fds.swpenv_gain++; + } + } + } + } + + // Effector(LFO) unit + int sub_freq = 0; + // if( fds.lfo_enable && fds.envelope_speed && fds.lfo_frequency ) { + if (fds.lfo_enable != 0) + { + if (fds.lfo_frequency != 0) + { + fds.lfo_phaseacc -= (1789772.5 * (double)fds.lfo_frequency) / 65536.0; + while (fds.lfo_phaseacc < 0.0) + { + fds.lfo_phaseacc += (double)sampling_rate; + + if (fds.lfo_wavetable[fds.lfo_addr] == 4) + fds.sweep_bias = 0; + else + fds.sweep_bias += tbl_process[fds.lfo_wavetable[fds.lfo_addr]]; + + fds.lfo_addr = (fds.lfo_addr + 1) & 63; + } + } + + if (fds.sweep_bias > 63) + fds.sweep_bias -= 128; + else if (fds.sweep_bias < -64) + fds.sweep_bias += 128; + + int sub_multi = fds.sweep_bias * fds.swpenv_gain; + + if ((sub_multi & 0x0F) != 0) + { + // 16で割り切れない場合 + sub_multi = (sub_multi / 16); + if (fds.sweep_bias >= 0) + sub_multi += 2; // 正の場合 + else + sub_multi -= 1; // 負の場合 + } + else + { + // 16で割り切れる場合 + sub_multi = (sub_multi / 16); + } + // 193を超えると-258する(-64へラップ) + if (sub_multi > 193) + sub_multi -= 258; + // -64を下回ると+256する(192へラップ) + if (sub_multi < -64) + sub_multi += 256; + + sub_freq = (fds.main_frequency) * sub_multi / 64; + } + + // Main unit + int output = 0; + if (fds.main_enable != 0 && fds.main_frequency != 0 && fds.wave_setup == 0) + { + int freq; + int main_addr_old = fds.main_addr; + + freq = (int)((fds.main_frequency + sub_freq) * 1789772.5 / 65536.0); + + fds.main_addr = (fds.main_addr + freq + 64 * sampling_rate) % (64 * sampling_rate); + + // 1周期を超えたらボリューム更新 + if (main_addr_old > fds.main_addr) + fds.now_volume = (fds.volenv_gain < 0x21) ? fds.volenv_gain : 0x20; + + output = fds.main_wavetable[(fds.main_addr / sampling_rate) & 0x3f] * 8 * fds.now_volume * fds.master_volume / 30; + + if (fds.now_volume != 0) + fds.now_freq = freq * 4; + else + fds.now_freq = 0; + } + else + { + fds.now_freq = 0; + output = 0; + } + + // LPF + output = (output_buf[0] * 2 + output) / 3; + output_buf[0] = output; + + fds.output = output; + return fds.output; + } + + internal void SyncWrite(ushort addr, byte data) + { + WriteSub(addr, data, fds_sync, 1789772.5d); + } + + + + internal byte SyncRead(ushort addr) + { + byte data = (byte)(addr >> 8); + + if (addr >= 0x4040 && addr <= 0x407F) + { + data = (byte)(fds_sync.main_wavetable[addr & 0x3F] | 0x40); + } + else + if (addr == 0x4090) + { + data = (byte)((fds_sync.volenv_gain & 0x3F) | 0x40); + } + else + if (addr == 0x4092) + { + data = (byte)((fds_sync.swpenv_gain & 0x3F) | 0x40); + } + + return data; + } + + public override bool Sync(int cycles) + { + // Envelope unit + if (fds_sync.envelope_enable != 0 && fds_sync.envelope_speed != 0) + { + // Volume envelope + double decay; + if (fds_sync.volenv_mode < 2) + { + decay = ((double)fds_sync.envelope_speed * (double)(fds_sync.volenv_decay + 1) * 1789772.5) / (232.0 * 960.0); + fds_sync.volenv_phaseacc -= (double)cycles; + while (fds_sync.volenv_phaseacc < 0.0) + { + fds_sync.volenv_phaseacc += decay; + + if (fds_sync.volenv_mode == 0) + { + // 減少モード + if (fds_sync.volenv_gain != 0) + fds_sync.volenv_gain--; + } + else + if (fds_sync.volenv_mode == 1) + { + // 増加モード + if (fds_sync.volenv_gain < 0x20) + fds_sync.volenv_gain++; + } + } + } + + // Sweep envelope + if (fds_sync.swpenv_mode < 2) + { + decay = ((double)fds_sync.envelope_speed * (double)(fds_sync.swpenv_decay + 1) * 1789772.5) / (232.0 * 960.0); + fds_sync.swpenv_phaseacc -= (double)cycles; + while (fds_sync.swpenv_phaseacc < 0.0) + { + fds_sync.swpenv_phaseacc += decay; + + if (fds_sync.swpenv_mode == 0) + { + // 減少モード + if (fds_sync.swpenv_gain != 0) + fds_sync.swpenv_gain--; + } + else + if (fds_sync.swpenv_mode == 1) + { + // 増加モード + if (fds_sync.swpenv_gain < 0x20) + fds_sync.swpenv_gain++; + } + } + } + } + + return false; + } + + public override int GetFreq(int channel) + { + return fds.now_freq; + } + + private class FDSSOUND + { + public byte[] reg = new byte[0x80]; + public byte volenv_mode; // Volume Envelope + public byte volenv_gain; + public byte volenv_decay; + public double volenv_phaseacc; + public byte swpenv_mode; // Sweep Envelope + public byte swpenv_gain; + public byte swpenv_decay; + public double swpenv_phaseacc; + // For envelope unit + public byte envelope_enable; // $4083 bit6 + public byte envelope_speed; // $408A + // For $4089 + public byte wave_setup; // bit7 + public int master_volume; // bit1-0 + // For Main unit + public int[] main_wavetable = new int[64]; + public byte main_enable; + public int main_frequency; + public int main_addr; + // For Effector(LFO) unit + public byte[] lfo_wavetable = new byte[64]; + public byte lfo_enable; // 0:Enable 1:Wavetable setup + public int lfo_frequency; + public int lfo_addr; + public double lfo_phaseacc; + // For Sweep unit + public int sweep_bias; + // Misc + public int now_volume; + public int now_freq; + public int output; + + public void ZeroMemory() + { + Array.Clear(reg, 0, reg.Length); + volenv_mode = 0; + volenv_gain = 0; + volenv_decay = 0; + volenv_phaseacc = 0.0; + swpenv_mode = 0; + swpenv_gain = 0; + swpenv_decay = 0; + swpenv_phaseacc = 0.0; + envelope_enable = 0; + envelope_speed = 0; + wave_setup = 0; + master_volume = 0; + Array.Clear(main_wavetable, 0, main_wavetable.Length); + main_enable = 0; + main_frequency = 0; + main_addr = 0; + Array.Clear(lfo_wavetable, 0, lfo_wavetable.Length); + lfo_enable = 0; + lfo_frequency = 0; + lfo_addr = 0; + lfo_phaseacc = 0.0; + sweep_bias = 0; + now_volume = 0; + now_freq = 0; + output = 0; + } + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_FDS.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_FDS.cs.meta new file mode 100644 index 0000000..5580ec2 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_FDS.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5e16912525198924a860e53ab4ef0c81 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_FME7.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_FME7.cs new file mode 100644 index 0000000..40c5b9d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_FME7.cs @@ -0,0 +1,28 @@ +using System; + +namespace VirtualNes.Core +{ + public class APU_FME7 : APU_INTERFACE + { + public override void Reset(float fClock, int nRate) + { + //todo : 实现 + } + + public override void Setup(float fClock, int nRate) + { + //todo : 实现 + } + + public override void Write(ushort addr, byte data) + { + //todo : 实现 + } + + public override int Process(int channel) + { + //todo : 实现 + return 0; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_FME7.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_FME7.cs.meta new file mode 100644 index 0000000..4edc65e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_FME7.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 03e0258857a7134438a497aec27ea607 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_INTERFACE.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_INTERFACE.cs new file mode 100644 index 0000000..cd9993c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_INTERFACE.cs @@ -0,0 +1,36 @@ +namespace VirtualNes.Core +{ + public abstract class APU_INTERFACE + { + public const float APU_CLOCK = 1789772.5f; + + public virtual void Dispose() { } + + public abstract void Reset(float fClock, int nRate); + public abstract void Setup(float fClock, int nRate); + public abstract void Write(ushort addr, byte data); + public abstract int Process(int channel); + public virtual byte Read(ushort addr) + { + return (byte)(addr >> 8); + } + public virtual void WriteSync(ushort addr, byte data) { } + public virtual byte ReadSync(ushort addr) { return 0; } + public virtual void VSync() { } + public virtual bool Sync(int cycles) { return false; } + public virtual int GetFreq(int channel) { return 0; } + public virtual int GetStateSize() { return 0; } + public virtual void SaveState(byte[] p) { } + public virtual void LoadState(byte[] p) { } + + public static int INT2FIX(int x) + { + return x << 16; + } + + public static int FIX2INT(int x) + { + return x >> 16; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_INTERFACE.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_INTERFACE.cs.meta new file mode 100644 index 0000000..fdd8b0c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_INTERFACE.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cc44be42b66d6ac4aade437e81960274 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_INTERNAL.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_INTERNAL.cs new file mode 100644 index 0000000..85f9d98 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_INTERNAL.cs @@ -0,0 +1,1413 @@ +//using Codice.CM.Client.Differences; +using System; +using System.Runtime.CompilerServices; +using UnityEngine; + +namespace VirtualNes.Core +{ + public class APU_INTERNAL : APU_INTERFACE + { + // Volume shift + public const int RECTANGLE_VOL_SHIFT = 8; + public const int TRIANGLE_VOL_SHIFT = 9; + public const int NOISE_VOL_SHIFT = 8; + public const int DPCM_VOL_SHIFT = 8; + + // Tables + static public int[] freq_limit = new int[8] + { + 0x03FF, 0x0555, 0x0666, 0x071C, 0x0787, 0x07C1, 0x07E0, 0x07F0 + }; + static public int[] duty_lut = new int[4] + { + 2, 4, 8, 12 + }; + static public int[] noise_freq = new int[16]{ + 4, 8, 16, 32, 64, 96, 128, 160, + 202, 254, 380, 508, 762, 1016, 2034, 4068 + }; + + private static int[] vbl_length = new int[32] + { + 5, 127, 10, 1, 19, 2, 40, 3, + 80, 4, 30, 5, 7, 6, 13, 7, + 6, 8, 12, 9, 24, 10, 48, 11, + 96, 12, 36, 13, 8, 14, 16, 15, + }; + + private static int[] dpcm_cycles_pal = new int[16] + { + 397, 353, 315, 297, 265, 235, 209, 198, + 176, 148, 131, 118, 98, 78, 66, 50, + }; + + private static int[] dpcm_cycles = new int[16] + { + 428, 380, 340, 320, 286, 254, 226, 214, + 190, 160, 142, 128, 106, 85, 72, 54, + }; + + private NES nes; + // Frame Counter + private int FrameCycle; + private int FrameCount; + private int FrameType; + private byte FrameIRQ; + private byte FrameIRQoccur; + + // Channels + private RECTANGLE ch0 = new RECTANGLE(); + private RECTANGLE ch1 = new RECTANGLE(); + private TRIANGLE ch2 = new TRIANGLE(); + private NOISE ch3 = new NOISE(); + private DPCM ch4 = new DPCM(); + + // Sound + private float cpu_clock; + private int sampling_rate; + private int cycle_rate; + + // $4015 Reg + private byte reg4015, sync_reg4015; + + private const int TONEDATA_MAX = 16; + private const int TONEDATA_LEN = 32; + private const int CHANNEL_MAX = 3; + private const int TONE_MAX = 4; + + bool[] bToneTableEnable = new bool[TONEDATA_MAX]; + int[,] ToneTable = new int[TONEDATA_MAX, TONEDATA_LEN]; + int[,] ChannelTone = new int[CHANNEL_MAX, TONE_MAX]; + + public void SetParent(NES parent) + { + nes = parent; + } + + public override bool Sync(int cycles) + { + FrameCycle -= cycles * 2; + if (FrameCycle <= 0) + { + FrameCycle += 14915; + + UpdateFrame(); + } + + var result = FrameIRQoccur | (SyncUpdateDPCM(cycles) ? 1 : 0); + return result != 0; + } + + private bool SyncUpdateDPCM(int cycles) + { + bool bIRQ = false; + + if (ch4.sync_enable != 0) + { + ch4.sync_cycles -= cycles; + while (ch4.sync_cycles < 0) + { + ch4.sync_cycles += ch4.sync_cache_cycles; + if (ch4.sync_dmalength != 0) + { + // if( !(--ch4.sync_dmalength) ) { + if (--ch4.sync_dmalength < 2) + { + if (ch4.sync_looping != 0) + { + ch4.sync_dmalength = ch4.sync_cache_dmalength; + } + else + { + ch4.sync_dmalength = 0; + + if (ch4.sync_irq_gen != 0) + { + ch4.sync_irq_enable = 0xFF; + nes.cpu.SetIRQ(CPU.IRQ_DPCM); + } + } + } + } + } + } + if (ch4.sync_irq_enable != 0) + { + bIRQ = true; + } + + return bIRQ; + } + + private void UpdateFrame() + { + if (FrameCount == 0) + { + if ((FrameIRQ & 0xC0) == 0 && nes.GetFrameIRQmode()) + { + FrameIRQoccur = 0xFF; + nes.cpu.SetIRQ(CPU.IRQ_FRAMEIRQ); + } + } + + if (FrameCount == 3) + { + if ((FrameIRQ & 0x80) != 0) + { + FrameCycle += 14915; + } + } + + // Counters Update + nes.Write(0x4018, (byte)FrameCount); + + FrameCount = (FrameCount + 1) & 3; + } + + public override void Reset(float fClock, int nRate) + { + ch0.ZeroMemory(); + ch1.ZeroMemory(); + ch2.ZeroMemory(); + ch3.ZeroMemory(); + + Array.Clear(bToneTableEnable, 0, bToneTableEnable.Length); + Array.Clear(ToneTable, 0, ToneTable.Length); + Array.Clear(ChannelTone, 0, ChannelTone.Length); + + reg4015 = sync_reg4015 = 0; + + // Sweep complement + ch0.complement = 0x00; + ch1.complement = 0xFF; + + // Noise shift register + ch3.shift_reg = 0x4000; + + Setup(fClock, nRate); + + // $4011ϳڻʤ + ushort addr; + for (addr = 0x4000; addr <= 0x4010; addr++) + { + Write(addr, 0x00); + SyncWrite(addr, 0x00); + } + // Write( 0x4001, 0x08 ); // Resetrinc`ɤˤʤ? + // Write( 0x4005, 0x08 ); // Resetrinc`ɤˤʤ? + Write(0x4012, 0x00); + Write(0x4013, 0x00); + Write(0x4015, 0x00); + SyncWrite(0x4012, 0x00); + SyncWrite(0x4013, 0x00); + SyncWrite(0x4015, 0x00); + + // $4017ϕzߤdzڻʤ(ڥ`ɤ0ǤΤڴեȤ) + FrameIRQ = 0xC0; + FrameCycle = 0; + FrameIRQoccur = 0; + FrameCount = 0; + FrameType = 0; + } + + public override void Setup(float fClock, int nRate) + { + cpu_clock = fClock; + sampling_rate = nRate; + + cycle_rate = (int)(fClock * 65536.0f / nRate); + } + + public override void Write(ushort addr, byte data) + { + switch (addr) + { + // CH0,1 rectangle + case 0x4000: + case 0x4001: + case 0x4002: + case 0x4003: + case 0x4004: + case 0x4005: + case 0x4006: + case 0x4007: + WriteRectangle((addr < 0x4004) ? 0 : 1, addr, data); + break; + + // CH2 triangle + case 0x4008: + case 0x4009: + case 0x400A: + case 0x400B: + WriteTriangle(addr, data); + break; + + // CH3 noise + case 0x400C: + case 0x400D: + case 0x400E: + case 0x400F: + WriteNoise(addr, data); + break; + + // CH4 DPCM + case 0x4010: + case 0x4011: + case 0x4012: + case 0x4013: + WriteDPCM(addr, data); + break; + + case 0x4015: + reg4015 = data; + + if ((data & (1 << 0)) == 0) + { + ch0.enable = 0; + ch0.len_count = 0; + } + if ((data & (1 << 1)) == 0) + { + ch1.enable = 0; + ch1.len_count = 0; + } + if ((data & (1 << 2)) == 0) + { + ch2.enable = 0; + ch2.len_count = 0; + ch2.lin_count = 0; + ch2.counter_start = 0; + } + if ((data & (1 << 3)) == 0) + { + ch3.enable = 0; + ch3.len_count = 0; + } + if ((data & (1 << 4)) == 0) + { + ch4.enable = 0; + ch4.dmalength = 0; + } + else + { + ch4.enable = 0xFF; + if (ch4.dmalength == 0) + { + ch4.address = ch4.cache_addr; + ch4.dmalength = ch4.cache_dmalength; + ch4.phaseacc = 0; + } + } + break; + + case 0x4017: + break; + + // VirtuaNESХݩ` + case 0x4018: + UpdateRectangle(ch0, data); + UpdateRectangle(ch1, data); + UpdateTriangle(data); + UpdateNoise(data); + break; + + default: + break; + } + } + + private void UpdateNoise(int type) + { + if (ch3.enable == 0 || ch3.len_count <= 0) + return; + + // Update Length + if (ch3.holdnote == 0) + { + // Holdnote + if ((type & 1) == 0 && ch3.len_count != 0) + { + ch3.len_count--; + } + } + + // Update Envelope + if (ch3.env_count != 0) + { + ch3.env_count--; + } + if (ch3.env_count == 0) + { + ch3.env_count = ch3.env_decay; + + // Holdnote + if (ch3.holdnote != 0) + { + ch3.env_vol = (ch3.env_vol - 1) & 0x0F; + } + else if (ch3.env_vol != 0) + { + ch3.env_vol--; + } + } + + if (ch3.env_fixed == 0) + { + ch3.nowvolume = ch3.env_vol << RECTANGLE_VOL_SHIFT; + } + } + + private void UpdateTriangle(int type) + { + if (ch2.enable == 0) + return; + + if ((type & 1) == 0 && ch2.holdnote == 0) + { + if (ch2.len_count != 0) + { + ch2.len_count--; + } + } + + // if( !ch2.len_count ) { + // ch2.lin_count = 0; + // } + + // Update Length/Linear + if (ch2.counter_start != 0) + { + ch2.lin_count = ch2.reg[0] & 0x7F; + } + else if (ch2.lin_count != 0) + { + ch2.lin_count--; + } + if (ch2.holdnote == 0 && ch2.lin_count != 0) + { + ch2.counter_start = 0; + } + } + + private void UpdateRectangle(RECTANGLE ch, int type) + { + if (ch.enable == 0 || ch.len_count <= 0) + return; + + // Update Length/Sweep + if ((type & 1) == 0) + { + // Update Length + if (ch.len_count != 0 && ch.holdnote == 0) + { + // Holdnote + if (ch.len_count != 0) + { + ch.len_count--; + } + } + + // Update Sweep + if (ch.swp_on != 0 && ch.swp_shift != 0) + { + if (ch.swp_count != 0) + { + ch.swp_count--; + } + if (ch.swp_count == 0) + { + ch.swp_count = ch.swp_decay; + if (ch.swp_inc != 0) + { + // Sweep increment(to higher frequency) + if (ch.complement == 0) + ch.freq += ~(ch.freq >> ch.swp_shift); // CH 0 + else + ch.freq -= (ch.freq >> ch.swp_shift); // CH 1 + } + else + { + // Sweep decrement(to lower frequency) + ch.freq += (ch.freq >> ch.swp_shift); + } + } + } + } + + // Update Envelope + if (ch.env_count != 0) + { + ch.env_count--; + } + if (ch.env_count == 0) + { + ch.env_count = ch.env_decay; + + // Holdnote + if (ch.holdnote != 0) + { + ch.env_vol = (ch.env_vol - 1) & 0x0F; + } + else if (ch.env_vol != 0) + { + ch.env_vol--; + } + } + + if (ch.env_fixed == 0) + { + ch.nowvolume = ch.env_vol << RECTANGLE_VOL_SHIFT; + } + } + + private void WriteDPCM(ushort addr, byte data) + { + ch4.reg[addr & 3] = data; + switch (addr & 3) + { + case 0: + ch4.freq = INT2FIX(nes.GetVideoMode() ? dpcm_cycles_pal[data & 0x0F] : dpcm_cycles[data & 0x0F]); + // ch4.freq = INT2FIX( dpcm_cycles[data&0x0F] ); + //// ch4.freq = INT2FIX( (dpcm_cycles[data&0x0F]-((data&0x0F)^0x0F)*2-2) ); + ch4.looping = (byte)(data & 0x40); + break; + case 1: + ch4.dpcm_value = (byte)((data & 0x7F) >> 1); + break; + case 2: + ch4.cache_addr = (ushort)(0xC000 + (ushort)(data << 6)); + break; + case 3: + ch4.cache_dmalength = ((data << 4) + 1) << 3; + break; + } + } + + private void WriteNoise(ushort addr, byte data) + { + ch3.reg[addr & 3] = data; + switch (addr & 3) + { + case 0: + ch3.holdnote = (byte)(data & 0x20); + ch3.volume = (byte)(data & 0x0F); + ch3.env_fixed = (byte)(data & 0x10); + ch3.env_decay = (byte)((data & 0x0F) + 1); + break; + case 1: // Unused + break; + case 2: + ch3.freq = INT2FIX(noise_freq[data & 0x0F]); + ch3.xor_tap = (byte)((data & 0x80) != 0 ? 0x40 : 0x02); + break; + case 3: // Master + ch3.len_count = vbl_length[data >> 3] * 2; + ch3.env_vol = 0x0F; + ch3.env_count = (byte)(ch3.env_decay + 1); + + if ((reg4015 & (1 << 3)) != 0) + ch3.enable = 0xFF; + break; + } + } + + private void WriteTriangle(ushort addr, byte data) + { + ch2.reg[addr & 3] = data; + switch (addr & 3) + { + case 0: + ch2.holdnote = (byte)(data & 0x80); + break; + case 1: // Unused + break; + case 2: + ch2.freq = INT2FIX(((ch2.reg[3] & 0x07) << 8) + data + 1); + break; + case 3: // Master + ch2.freq = INT2FIX((((data & 0x07) << 8) + ch2.reg[2] + 1)); + ch2.len_count = vbl_length[data >> 3] * 2; + ch2.counter_start = 0x80; + + if ((reg4015 & (1 << 2)) != 0) + ch2.enable = 0xFF; + break; + } + } + + private void WriteRectangle(int no, ushort addr, byte data) + { + RECTANGLE ch = (no == 0) ? ch0 : ch1; + + ch.reg[addr & 3] = data; + switch (addr & 3) + { + case 0: + ch.holdnote = (byte)(data & 0x20); + ch.volume = (byte)(data & 0x0F); + ch.env_fixed = (byte)(data & 0x10); + ch.env_decay = (byte)((data & 0x0F) + 1); + ch.duty = duty_lut[data >> 6]; + break; + case 1: + ch.swp_on = (byte)(data & 0x80); + ch.swp_inc = (byte)(data & 0x08); + ch.swp_shift = (byte)(data & 0x07); + ch.swp_decay = (byte)(((data >> 4) & 0x07) + 1); + ch.freqlimit = freq_limit[data & 0x07]; + break; + case 2: + ch.freq = (ch.freq & (~0xFF)) + data; + break; + case 3: // Master + ch.freq = ((data & 0x07) << 8) + (ch.freq & 0xFF); + ch.len_count = vbl_length[data >> 3] * 2; + ch.env_vol = 0x0F; + ch.env_count = (byte)(ch.env_decay + 1); + ch.adder = 0; + + if ((reg4015 & (1 << no)) != 0) + ch.enable = 0xFF; + break; + } + } + + public override int Process(int channel) + { + switch (channel) + { + case 0: + return RenderRectangle(ch0); + case 1: + return RenderRectangle(ch1); + case 2: + return RenderTriangle(); + case 3: + return RenderNoise(); + case 4: + return RenderDPCM(); + default: + return 0; + } + } + + private int RenderDPCM() + { + if (ch4.dmalength != 0) + { + ch4.phaseacc -= cycle_rate; + + while (ch4.phaseacc < 0) + { + ch4.phaseacc += ch4.freq; + if ((ch4.dmalength & 7) == 0) + { + ch4.cur_byte = nes.Read(ch4.address); + if (0xFFFF == ch4.address) + ch4.address = 0x8000; + else + ch4.address++; + } + + if ((--ch4.dmalength) == 0) + { + if (ch4.looping != 0) + { + ch4.address = ch4.cache_addr; + ch4.dmalength = ch4.cache_dmalength; + } + else + { + ch4.enable = 0; + break; + } + } + // positive delta + if ((ch4.cur_byte & (1 << ((ch4.dmalength & 7) ^ 7))) != 0) + { + if (ch4.dpcm_value < 0x3F) + ch4.dpcm_value += 1; + } + else + { + // negative delta + if (ch4.dpcm_value > 1) + ch4.dpcm_value -= 1; + } + } + } + + // ץΥå(TEST) + ch4.dpcm_output_real = ((ch4.reg[1] & 0x01) + ch4.dpcm_value * 2) - 0x40; + if (Math.Abs(ch4.dpcm_output_real - ch4.dpcm_output_fake) <= 8) + { + ch4.dpcm_output_fake = ch4.dpcm_output_real; + ch4.output = ch4.dpcm_output_real << DPCM_VOL_SHIFT; + } + else + { + if (ch4.dpcm_output_real > ch4.dpcm_output_fake) + ch4.dpcm_output_fake += 8; + else + ch4.dpcm_output_fake -= 8; + ch4.output = ch4.dpcm_output_fake << DPCM_VOL_SHIFT; + } + return ch4.output; + } + + private int RenderNoise() + { + if (ch3.enable == 0 || ch3.len_count <= 0) + return 0; + + if (ch3.env_fixed != 0) + { + ch3.nowvolume = ch3.volume << RECTANGLE_VOL_SHIFT; + } + + int vol = 256 - ((ch4.reg[1] & 0x01) + ch4.dpcm_value * 2); + + ch3.phaseacc -= cycle_rate; + if (ch3.phaseacc >= 0) + return ch3.output * vol / 256; + + if (ch3.freq > cycle_rate) + { + ch3.phaseacc += ch3.freq; + if (NoiseShiftreg(ch3.xor_tap)) + ch3.output = ch3.nowvolume; + else + ch3.output = -ch3.nowvolume; + + return ch3.output * vol / 256; + } + + int num_times, total; + num_times = total = 0; + while (ch3.phaseacc < 0) + { + ch3.phaseacc += ch3.freq; + if (NoiseShiftreg(ch3.xor_tap)) + ch3.output = ch3.nowvolume; + else + ch3.output = -ch3.nowvolume; + + total += ch3.output; + num_times++; + } + + return (total / num_times) * vol / 256; + } + + private bool NoiseShiftreg(byte xor_tap) + { + int bit0, bit14; + + bit0 = ch3.shift_reg & 1; + if ((ch3.shift_reg & xor_tap) != 0) bit14 = bit0 ^ 1; + else bit14 = bit0 ^ 0; + ch3.shift_reg >>= 1; + ch3.shift_reg |= (bit14 << 14); + return (bit0 ^ 1) != 0; + } + + private int RenderTriangle() + { + int vol; + if (Supporter.Config.sound.bDisableVolumeEffect) + { + vol = 256; + } + else + { + vol = 256 - ((ch4.reg[1] & 0x01) + ch4.dpcm_value * 2); + } + + if (ch2.enable == 0 || (ch2.len_count <= 0) || (ch2.lin_count <= 0)) + { + return ch2.nowvolume * vol / 256; + } + + if (ch2.freq < INT2FIX(8)) + { + return ch2.nowvolume * vol / 256; + } + + if (!(Supporter.Config.sound.bChangeTone && ChannelTone[2, 0] != 0)) + { + ch2.phaseacc -= cycle_rate; + if (ch2.phaseacc >= 0) + { + return ch2.nowvolume * vol / 256; + } + + if (ch2.freq > cycle_rate) + { + ch2.phaseacc += ch2.freq; + ch2.adder = (ch2.adder + 1) & 0x1F; + + if (ch2.adder < 0x10) + { + ch2.nowvolume = (ch2.adder & 0x0F) << TRIANGLE_VOL_SHIFT; + } + else + { + ch2.nowvolume = (0x0F - (ch2.adder & 0x0F)) << TRIANGLE_VOL_SHIFT; + } + + return ch2.nowvolume * vol / 256; + } + + // ƽ + int num_times, total; + num_times = total = 0; + while (ch2.phaseacc < 0) + { + ch2.phaseacc += ch2.freq; + ch2.adder = (ch2.adder + 1) & 0x1F; + + if (ch2.adder < 0x10) + { + ch2.nowvolume = (ch2.adder & 0x0F) << TRIANGLE_VOL_SHIFT; + } + else + { + ch2.nowvolume = (0x0F - (ch2.adder & 0x0F)) << TRIANGLE_VOL_SHIFT; + } + + total += ch2.nowvolume; + num_times++; + } + + return (total / num_times) * vol / 256; + } + else + { + int x = ChannelTone[2, 0] - 1; + int pTone = 0; + + ch2.phaseacc -= cycle_rate; + if (ch2.phaseacc >= 0) + { + return ch2.nowvolume * vol / 256; + } + + if (ch2.freq > cycle_rate) + { + ch2.phaseacc += ch2.freq; + ch2.adder = (ch2.adder + 1) & 0x1F; + var temp = ToneTable[x, pTone + (ch2.adder & 0x1F)]; + ch2.nowvolume = temp * 0x0F; + return ch2.nowvolume * vol / 256; + } + + // ƽ + int num_times, total; + num_times = total = 0; + while (ch2.phaseacc < 0) + { + ch2.phaseacc += ch2.freq; + ch2.adder = (ch2.adder + 1) & 0x1F; + var temp = ToneTable[x, pTone + (ch2.adder & 0x1F)]; + total += temp * 0x0F; + num_times++; + } + + return (total / num_times) * vol / 256; + } + } + + private int RenderRectangle(RECTANGLE ch) + { + if (ch.enable == 0 || ch.len_count <= 0) + return 0; + + // Channel disable? + if ((ch.freq < 8) || (ch.swp_inc == 0 && ch.freq > ch.freqlimit)) + { + return 0; + } + + if (ch.env_fixed != 0) + { + ch.nowvolume = ch.volume << RECTANGLE_VOL_SHIFT; + } + int volume = ch.nowvolume; + + if (!(Supporter.Config.sound.bChangeTone && (ChannelTone[(ch.complement == 0) ? 0 : 1, ch.reg[0] >> 6]) != 0)) + { + // agI + double total; + double sample_weight = ch.phaseacc; + if (sample_weight > cycle_rate) + { + sample_weight = cycle_rate; + } + total = (ch.adder < ch.duty) ? sample_weight : -sample_weight; + + int freq = INT2FIX(ch.freq + 1); + ch.phaseacc -= cycle_rate; + while (ch.phaseacc < 0) + { + ch.phaseacc += freq; + ch.adder = (ch.adder + 1) & 0x0F; + + sample_weight = freq; + if (ch.phaseacc > 0) + { + sample_weight -= ch.phaseacc; + } + total += (ch.adder < ch.duty) ? sample_weight : -sample_weight; + } + return (int)(volume * total / cycle_rate + 0.5); + } + else + { + int x = ChannelTone[(ch.complement == 0) ? 0 : 1, ch.reg[0] >> 6] - 1; + int pTone = 0; + + // Ÿo + ch.phaseacc -= cycle_rate * 2; + if (ch.phaseacc >= 0) + { + var temp = ToneTable[x, pTone + (ch.adder & 0x1F)]; + return temp * volume / ((1 << RECTANGLE_VOL_SHIFT) / 2); + } + + // 1ƥåפ + int freq = INT2FIX(ch.freq + 1); + if (freq > cycle_rate * 2) + { + ch.phaseacc += freq; + ch.adder = (ch.adder + 1) & 0x1F; + var temp = ToneTable[x, pTone + (ch.adder & 0x1F)]; + return temp * volume / ((1 << RECTANGLE_VOL_SHIFT) / 2); + } + + // ƽ + int num_times, total; + num_times = total = 0; + while (ch.phaseacc < 0) + { + ch.phaseacc += freq; + ch.adder = (ch.adder + 1) & 0x1F; + var temp = ToneTable[x, pTone + (ch.adder & 0x1F)]; + total += temp * volume / ((1 << RECTANGLE_VOL_SHIFT) / 2); + num_times++; + } + return total / num_times; + } + } + + internal byte SyncRead(ushort addr) + { + byte data = (byte)(addr >> 8); + + if (addr == 0x4015) + { + data = 0; + if ((ch0.sync_enable != 0) && ch0.sync_len_count > 0) data |= (1 << 0); + if ((ch1.sync_enable != 0) && ch1.sync_len_count > 0) data |= (1 << 1); + if ((ch2.sync_enable != 0) && ch2.sync_len_count > 0) data |= (1 << 2); + if ((ch3.sync_enable != 0) && ch3.sync_len_count > 0) data |= (1 << 3); + if ((ch4.sync_enable != 0) && (ch4.sync_dmalength != 0)) data |= (1 << 4); + if (FrameIRQoccur != 0) data |= (1 << 6); + if (ch4.sync_irq_enable != 0) data |= (1 << 7); + FrameIRQoccur = 0; + + nes.cpu.ClrIRQ(CPU.IRQ_FRAMEIRQ); + } + if (addr == 0x4017) + { + if (FrameIRQoccur != 0) + { + data = 0; + } + else + { + data |= (1 << 6); + } + } + return data; + } + + internal void SyncWrite(ushort addr, byte data) + { + switch (addr) + { + // CH0,1 rectangle + case 0x4000: + case 0x4001: + case 0x4002: + case 0x4003: + case 0x4004: + case 0x4005: + case 0x4006: + case 0x4007: + SyncWriteRectangle((addr < 0x4004) ? 0 : 1, addr, data); + break; + // CH2 triangle + case 0x4008: + case 0x4009: + case 0x400A: + case 0x400B: + SyncWriteTriangle(addr, data); + break; + // CH3 noise + case 0x400C: + case 0x400D: + case 0x400E: + case 0x400F: + SyncWriteNoise(addr, data); + break; + // CH4 DPCM + case 0x4010: + case 0x4011: + case 0x4012: + case 0x4013: + SyncWriteDPCM(addr, data); + break; + + case 0x4015: + sync_reg4015 = data; + + if ((data & (1 << 0)) == 0) + { + ch0.sync_enable = 0; + ch0.sync_len_count = 0; + } + if ((data & (1 << 1)) == 0) + { + ch1.sync_enable = 0; + ch1.sync_len_count = 0; + } + if ((data & (1 << 2)) == 0) + { + ch2.sync_enable = 0; + ch2.sync_len_count = 0; + ch2.sync_lin_count = 0; + ch2.sync_counter_start = 0; + } + if ((data & (1 << 3)) == 0) + { + ch3.sync_enable = 0; + ch3.sync_len_count = 0; + } + if ((data & (1 << 4)) == 0) + { + ch4.sync_enable = 0; + ch4.sync_dmalength = 0; + ch4.sync_irq_enable = 0; + + nes.cpu.ClrIRQ(CPU.IRQ_DPCM); + } + else + { + ch4.sync_enable = 0xFF; + if (ch4.sync_dmalength == 0) + { + // ch4.sync_cycles = ch4.sync_cache_cycles; + ch4.sync_dmalength = ch4.sync_cache_dmalength; + ch4.sync_cycles = 0; + } + } + break; + + case 0x4017: + SyncWrite4017(data); + break; + + // VirtuaNESŗL|[g + case 0x4018: + SyncUpdateRectangle(ch0, data); + SyncUpdateRectangle(ch1, data); + SyncUpdateTriangle(data); + SyncUpdateNoise(data); + break; + default: + break; + } + } + + private void SyncUpdateNoise(int type) + { + if (ch3.sync_enable == 0 || ch3.sync_len_count <= 0) + return; + + // Update Length + if (ch3.sync_len_count != 0 && ch3.sync_holdnote == 0) + { + if ((type & 1) == 0 && ch3.sync_len_count != 0) + { + ch3.sync_len_count--; + } + } + } + + private void SyncUpdateTriangle(int type) + { + if (ch2.sync_enable == 0) + return; + + if ((type & 1) == 0 && ch2.sync_holdnote == 0) + { + if (ch2.sync_len_count != 0) + { + ch2.sync_len_count--; + } + } + + // Update Length/Linear + if (ch2.sync_counter_start != 0) + { + ch2.sync_lin_count = ch2.sync_reg[0] & 0x7F; + } + else if (ch2.sync_lin_count != 0) + { + ch2.sync_lin_count--; + } + if (ch2.sync_holdnote == 0 && ch2.sync_lin_count != 0) + { + ch2.sync_counter_start = 0; + } + } + + private void SyncUpdateRectangle(RECTANGLE ch, int type) + { + if (ch.sync_enable == 0 || ch.sync_len_count <= 0) + return; + + // Update Length + if (ch.sync_len_count != 0 && ch.sync_holdnote == 0) + { + if ((type & 1) == 0 && ch.sync_len_count != 0) + { + ch.sync_len_count--; + } + } + } + + private void SyncWrite4017(byte data) + { + FrameCycle = 0; + FrameIRQ = data; + FrameIRQoccur = 0; + + nes.cpu.ClrIRQ(CPU.IRQ_FRAMEIRQ); + + FrameType = (data & 0x80) != 0 ? 1 : 0; + FrameCount = 0; + if ((data & 0x80) > 0) + { + UpdateFrame(); + } + FrameCount = 1; + FrameCycle = 14915; + } + + private void SyncWriteDPCM(ushort addr, byte data) + { + ch4.reg[addr & 3] = data; + switch (addr & 3) + { + case 0: + ch4.sync_cache_cycles = nes.GetVideoMode() ? dpcm_cycles_pal[data & 0x0F] * 8 : dpcm_cycles[data & 0x0F] * 8; + ch4.sync_looping = (byte)(data & 0x40); + ch4.sync_irq_gen = (byte)(data & 0x80); + if (ch4.sync_irq_gen == 0) + { + ch4.sync_irq_enable = 0; + nes.cpu.ClrIRQ(CPU.IRQ_DPCM); + } + break; + case 1: + break; + case 2: + break; + case 3: + ch4.sync_cache_dmalength = (data << 4) + 1; + break; + } + } + + private void SyncWriteNoise(ushort addr, byte data) + { + ch3.sync_reg[addr & 3] = data; + switch (addr & 3) + { + case 0: + ch3.sync_holdnote = (byte)(data & 0x20); + break; + case 1: + break; + case 2: + break; + case 3: // Master + ch3.sync_len_count = vbl_length[data >> 3] * 2; + if ((sync_reg4015 & (1 << 3)) != 0) + ch3.sync_enable = 0xFF; + break; + } + } + + private void SyncWriteTriangle(ushort addr, byte data) + { + ch2.sync_reg[addr & 3] = data; + switch (addr & 3) + { + case 0: + ch2.sync_holdnote = (byte)(data & 0x80); + break; + case 1: + break; + case 2: + break; + case 3: // Master + ch2.sync_len_count = vbl_length[ch2.sync_reg[3] >> 3] * 2; + ch2.sync_counter_start = 0x80; + + if ((sync_reg4015 & (1 << 2)) != 0) + ch2.sync_enable = 0xFF; + break; + } + } + + private void SyncWriteRectangle(int no, ushort addr, byte data) + { + RECTANGLE ch = (no == 0) ? ch0 : ch1; + + ch.sync_reg[addr & 3] = data; + switch (addr & 3) + { + case 0: + ch.sync_holdnote = (byte)(data & 0x20); + break; + case 1: + case 2: + break; + case 3: // Master + ch.sync_len_count = vbl_length[data >> 3] * 2; + if ((sync_reg4015 & (1 << no)) != 0) + ch.sync_enable = 0xFF; + break; + } + } + public class RECTANGLE + { + public byte[] reg = new byte[4]; // register + + public byte enable; // enable + public byte holdnote; // holdnote + public byte volume; // volume + public byte complement; + + // For Render + public int phaseacc; + public int freq; + public int freqlimit; + public int adder; + public int duty; + public int len_count; + + public int nowvolume; + + // For Envelope + public byte env_fixed; + public byte env_decay; + public byte env_count; + public byte dummy0; + public int env_vol; + + // For Sweep + public byte swp_on; + public byte swp_inc; + public byte swp_shift; + public byte swp_decay; + public byte swp_count; + public byte[] dummy1 = new byte[3]; + + // For sync; + public byte[] sync_reg = new byte[4]; + public byte sync_output_enable; + public byte sync_enable; + public byte sync_holdnote; + public byte dummy2; + public int sync_len_count; + + public void ZeroMemory() + { + Array.Clear(reg, 0, reg.Length); + enable = 0; + holdnote = 0; + volume = 0; + complement = 0; + + phaseacc = 0; + freq = 0; + freqlimit = 0; + adder = 0; + duty = 0; + len_count = 0; + + nowvolume = 0; + + env_fixed = 0; + env_decay = 0; + env_count = 0; + dummy0 = 0; + env_vol = 0; + + swp_on = 0; + swp_inc = 0; + swp_shift = 0; + swp_decay = 0; + swp_count = 0; + Array.Clear(dummy1, 0, dummy1.Length); + + Array.Clear(sync_reg, 0, sync_reg.Length); + sync_output_enable = 0; + sync_enable = 0; + sync_holdnote = 0; + dummy2 = 0; + sync_len_count = 0; + } + } + public class TRIANGLE + { + public byte[] reg = new byte[4]; + + public byte enable; + public byte holdnote; + public byte counter_start; + public byte dummy0; + + public int phaseacc; + public int freq; + public int len_count; + public int lin_count; + public int adder; + + public int nowvolume; + + // For sync; + public byte[] sync_reg = new byte[4]; + public byte sync_enable; + public byte sync_holdnote; + public byte sync_counter_start; + // public byte dummy1; + public int sync_len_count; + public int sync_lin_count; + + internal void ZeroMemory() + { + Array.Clear(reg, 0, reg.Length); + + enable = 0; + holdnote = 0; + counter_start = 0; + dummy0 = 0; + phaseacc = 0; + freq = 0; + len_count = 0; + lin_count = 0; + adder = 0; + nowvolume = 0; + Array.Clear(sync_reg, 0, sync_reg.Length); + sync_enable = 0; + sync_holdnote = 0; + sync_counter_start = 0; + + sync_len_count = 0; + sync_lin_count = 0; + } + } + public class DPCM + { + public byte[] reg = new byte[4]; + public byte enable; + public byte looping; + public byte cur_byte; + public byte dpcm_value; + + public int freq; + public int phaseacc; + public int output; + + public ushort address, cache_addr; + public int dmalength, cache_dmalength; + public int dpcm_output_real, dpcm_output_fake, dpcm_output_old, dpcm_output_offset; + + // For sync + public byte[] sync_reg = new byte[4]; + public byte sync_enable; + public byte sync_looping; + public byte sync_irq_gen; + public byte sync_irq_enable; + public int sync_cycles, sync_cache_cycles; + public int sync_dmalength, sync_cache_dmalength; + } + public class NOISE + { + public byte[] reg = new byte[4]; // register + + public byte enable; // enable + public byte holdnote; // holdnote + public byte volume; // volume + public byte xor_tap; + public int shift_reg; + + // For Render + public int phaseacc; + public int freq; + public int len_count; + + public int nowvolume; + public int output; + + // For Envelope + public byte env_fixed; + public byte env_decay; + public byte env_count; + public byte dummy0; + public int env_vol; + + // For sync; + public byte[] sync_reg = new byte[4]; + public byte sync_output_enable; + public byte sync_enable; + public byte sync_holdnote; + public byte dummy1; + public int sync_len_count; + + internal void ZeroMemory() + { + Array.Clear(reg, 0, reg.Length); + + enable = 0; + holdnote = 0; + volume = 0; + xor_tap = 0; + shift_reg = 0; + + phaseacc = 0; + freq = 0; + len_count = 0; + nowvolume = 0; + output = 0; + + env_fixed = 0; + env_decay = 0; + env_count = 0; + dummy0 = 0; + env_vol = 0; + + Array.Clear(sync_reg, 0, sync_reg.Length); + sync_output_enable = 0; + sync_enable = 0; + sync_holdnote = 0; + dummy1 = 0; + sync_len_count = 0; + } + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_INTERNAL.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_INTERNAL.cs.meta new file mode 100644 index 0000000..116b105 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_INTERNAL.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d5f443ad7d5ef1d4394c7fe540f2e3e4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_MMC5.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_MMC5.cs new file mode 100644 index 0000000..e46b6d9 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_MMC5.cs @@ -0,0 +1,415 @@ +//using Codice.CM.Client.Differences; +using System; + +namespace VirtualNes.Core +{ + public class APU_MMC5 : APU_INTERFACE + { + public const int RECTANGLE_VOL_SHIFT = 8; + public const int DAOUT_VOL_SHIFT = 6; + + SYNCRECTANGLE sch0 = new SYNCRECTANGLE(); + SYNCRECTANGLE sch1 = new SYNCRECTANGLE(); + RECTANGLE ch0 = new RECTANGLE(); + RECTANGLE ch1 = new RECTANGLE(); + + byte reg5010; + byte reg5011; + byte reg5015; + byte sync_reg5015; + int FrameCycle; + float cpu_clock; + int cycle_rate; + + // Tables + static int[] vbl_length = new int[32]; + static int[] duty_lut = new int[4]; + + static int[] decay_lut = new int[16]; + static int[] vbl_lut = new int[32]; + + public APU_MMC5() + { + // 仮設定 + Reset(APU_INTERFACE.APU_CLOCK, 22050); + } + + public override void Reset(float fClock, int nRate) + { + sch0.ZeroMemory(); + sch1.ZeroMemory(); + + reg5010 = reg5011 = reg5015 = 0; + + sync_reg5015 = 0; + FrameCycle = 0; + + Setup(fClock, nRate); + + for (ushort addr = 0x5000; addr <= 0x5015; addr++) + { + Write(addr, 0); + } + } + + public override void Setup(float fClock, int nRate) + { + cpu_clock = fClock; + cycle_rate = (int)(fClock * 65536.0f / nRate); + + // Create Tables + int i; + int samples = (int)(nRate / 60.0f); + for (i = 0; i < 16; i++) + decay_lut[i] = (i + 1) * samples * 5; + for (i = 0; i < 32; i++) + vbl_lut[i] = vbl_length[i] * samples * 5; + } + + public override void Write(ushort addr, byte data) + { + switch (addr) + { + // MMC5 CH0 rectangle + case 0x5000: + ch0.reg[0] = data; + ch0.volume = (byte)(data & 0x0F); + ch0.holdnote = (byte)(data & 0x20); + ch0.fixed_envelope = (byte)(data & 0x10); + ch0.env_decay = decay_lut[data & 0x0F]; + ch0.duty_flip = duty_lut[data >> 6]; + break; + case 0x5001: + ch0.reg[1] = data; + break; + case 0x5002: + ch0.reg[2] = data; + ch0.freq = INT2FIX(((ch0.reg[3] & 0x07) << 8) + data + 1); + break; + case 0x5003: + ch0.reg[3] = data; + ch0.vbl_length = vbl_lut[data >> 3]; + ch0.env_vol = 0; + ch0.freq = INT2FIX(((data & 0x07) << 8) + ch0.reg[2] + 1); + if ((reg5015 & 0x01) != 0) + ch0.enable = 0xFF; + break; + // MMC5 CH1 rectangle + case 0x5004: + ch1.reg[0] = data; + ch1.volume = (byte)(data & 0x0F); + ch1.holdnote = (byte)(data & 0x20); + ch1.fixed_envelope = (byte)(data & 0x10); + ch1.env_decay = decay_lut[data & 0x0F]; + ch1.duty_flip = duty_lut[data >> 6]; + break; + case 0x5005: + ch1.reg[1] = data; + break; + case 0x5006: + ch1.reg[2] = data; + ch1.freq = INT2FIX(((ch1.reg[3] & 0x07) << 8) + data + 1); + break; + case 0x5007: + ch1.reg[3] = data; + ch1.vbl_length = vbl_lut[data >> 3]; + ch1.env_vol = 0; + ch1.freq = INT2FIX(((data & 0x07) << 8) + ch1.reg[2] + 1); + if ((reg5015 & 0x02) != 0) + ch1.enable = 0xFF; + break; + case 0x5010: + reg5010 = data; + break; + case 0x5011: + reg5011 = data; + break; + case 0x5012: + case 0x5013: + case 0x5014: + break; + case 0x5015: + reg5015 = data; + if ((reg5015 & 0x01) != 0) + { + ch0.enable = 0xFF; + } + else + { + ch0.enable = 0; + ch0.vbl_length = 0; + } + if ((reg5015 & 0x02) != 0) + { + ch1.enable = 0xFF; + } + else + { + ch1.enable = 0; + ch1.vbl_length = 0; + } + break; + } + } + + internal void SyncWrite(ushort addr, byte data) + { + switch (addr) + { + // MMC5 CH0 rectangle + case 0x5000: + sch0.reg[0] = data; + sch0.holdnote = (byte)(data & 0x20); + break; + case 0x5001: + case 0x5002: + sch0.reg[addr & 3] = data; + break; + case 0x5003: + sch0.reg[3] = data; + sch0.vbl_length = vbl_length[data >> 3]; + if ((sync_reg5015 & 0x01) != 0) + sch0.enable = 0xFF; + break; + // MMC5 CH1 rectangle + case 0x5004: + sch1.reg[0] = data; + sch1.holdnote = (byte)(data & 0x20); + break; + case 0x5005: + case 0x5006: + sch1.reg[addr & 3] = data; + break; + case 0x5007: + sch1.reg[3] = data; + sch1.vbl_length = vbl_length[data >> 3]; + if ((sync_reg5015 & 0x02) != 0) + sch1.enable = 0xFF; + break; + case 0x5010: + case 0x5011: + case 0x5012: + case 0x5013: + case 0x5014: + break; + case 0x5015: + sync_reg5015 = data; + if ((sync_reg5015 & 0x01) != 0) + { + sch0.enable = 0xFF; + } + else + { + sch0.enable = 0; + sch0.vbl_length = 0; + } + if ((sync_reg5015 & 0x02) != 0) + { + sch1.enable = 0xFF; + } + else + { + sch1.enable = 0; + sch1.vbl_length = 0; + } + break; + } + } + + internal byte SyncRead(ushort addr) + { + byte data = 0; + + if (addr == 0x5015) + { + if ((sch0.enable != 0) && sch0.vbl_length > 0) data |= (1 << 0); + if ((sch1.enable != 0) && sch1.vbl_length > 0) data |= (1 << 1); + } + + return data; + } + + public override bool Sync(int cycles) + { + FrameCycle += cycles; + if (FrameCycle >= 7457 * 5 / 2) + { + FrameCycle -= 7457 * 5 / 2; + + if (sch0.enable != 0 && sch0.holdnote == 0) + { + if ((sch0.vbl_length) != 0) + { + sch0.vbl_length--; + } + } + if (sch1.enable != 0 && sch1.holdnote == 0) + { + if ((sch1.vbl_length) != 0) + { + sch1.vbl_length--; + } + } + } + + return false; + } + + public override int Process(int channel) + { + switch (channel) + { + case 0: + return RectangleRender(ch0); + case 1: + return RectangleRender(ch1); + case 2: + return reg5011 << DAOUT_VOL_SHIFT; + } + + return 0; + } + + public override int GetFreq(int channel) + { + if (channel == 0 || channel == 1) + { + RECTANGLE ch = null; + if (channel == 0) ch = ch0; + else ch = ch1; + + if (ch.enable == 0 || ch.vbl_length <= 0) + return 0; + if (ch.freq < INT2FIX(8)) + return 0; + if (ch.fixed_envelope != 0) + { + if (ch.volume == 0) + return 0; + } + else + { + if ((0x0F - ch.env_vol) == 0) + return 0; + } + + return (int)(256.0f * cpu_clock / (FIX2INT(ch.freq) * 16.0f)); + } + + return 0; + } + + private int RectangleRender(RECTANGLE ch) + { + if (ch.enable == 0 || ch.vbl_length <= 0) + return 0; + + // vbl length counter + if (ch.holdnote == 0) + ch.vbl_length -= 5; + + // envelope unit + ch.env_phase -= 5 * 4; + while (ch.env_phase < 0) + { + ch.env_phase += ch.env_decay; + if ((ch.holdnote) != 0) + ch.env_vol = (byte)((ch.env_vol + 1) & 0x0F); + else if (ch.env_vol < 0x0F) + ch.env_vol++; + } + + if (ch.freq < INT2FIX(8)) + return 0; + + int volume; + if ((ch.fixed_envelope) != 0) + volume = ch.volume; + else + volume = (0x0F - ch.env_vol); + + int output = volume << RECTANGLE_VOL_SHIFT; + + ch.phaseacc -= cycle_rate; + if (ch.phaseacc >= 0) + { + if (ch.adder < ch.duty_flip) + ch.output_vol = output; + else + ch.output_vol = -output; + return ch.output_vol; + } + + if (ch.freq > cycle_rate) + { + ch.phaseacc += ch.freq; + ch.adder = (ch.adder + 1) & 0x0F; + if (ch.adder < ch.duty_flip) + ch.output_vol = output; + else + ch.output_vol = -output; + } + else + { + // 加重平均 + int num_times, total; + num_times = total = 0; + while (ch.phaseacc < 0) + { + ch.phaseacc += ch.freq; + ch.adder = (ch.adder + 1) & 0x0F; + if (ch.adder < ch.duty_flip) + total += output; + else + total -= output; + num_times++; + } + ch.output_vol = total / num_times; + } + + return ch.output_vol; + } + + public class SYNCRECTANGLE + { + // For sync + public byte[] reg = new byte[4]; + public byte enable; + public byte holdnote; + public byte[] dummy = new byte[2]; + public int vbl_length; + + public void ZeroMemory() + { + Array.Clear(reg, 0, reg.Length); + enable = 0; + holdnote = 0; + Array.Clear(dummy, 0, dummy.Length); + vbl_length = 0; + } + } + + public class RECTANGLE + { + public byte[] reg = new byte[4]; + public byte enable; + + public int vbl_length; + + public int phaseacc; + public int freq; + + public int output_vol; + public byte fixed_envelope; + public byte holdnote; + public byte volume; + + public byte env_vol; + public int env_phase; + public int env_decay; + + public int adder; + public int duty_flip; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_MMC5.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_MMC5.cs.meta new file mode 100644 index 0000000..250e590 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_MMC5.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 15b983a12234c3c47baefb9fa2751351 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_N106.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_N106.cs new file mode 100644 index 0000000..7e2f21e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_N106.cs @@ -0,0 +1,245 @@ +using RECTANGLE = VirtualNes.Core.APU_VRC6.RECTANGLE; +using SAWTOOTH = VirtualNes.Core.APU_VRC6.SAWTOOTH; + +namespace VirtualNes.Core +{ + public class APU_N106 : APU_INTERFACE + { + RECTANGLE ch0 = new RECTANGLE(); + RECTANGLE ch1 = new RECTANGLE(); + SAWTOOTH ch2 = new SAWTOOTH(); + float cpu_clock; + int cycle_rate; + + public APU_N106() + { + Reset(APU_CLOCK, 22050); + } + + public override void Reset(float fClock, int nRate) + { + ch0.ZeroMemory(); + ch1.ZeroMemory(); + ch2.ZeroMemory(); + + Setup(fClock, nRate); + } + + public override void Setup(float fClock, int nRate) + { + cpu_clock = fClock; + cycle_rate = (int)(fClock * 65536.0f / nRate); + } + + public override void Write(ushort addr, byte data) + { + switch (addr) + { + // VRC6 CH0 rectangle + case 0x9000: + ch0.reg[0] = data; + ch0.gate = (byte)(data & 0x80); + ch0.volume = (byte)(data & 0x0F); + ch0.duty_pos = (byte)((data >> 4) & 0x07); + break; + case 0x9001: + ch0.reg[1] = data; + ch0.freq = INT2FIX((((ch0.reg[2] & 0x0F) << 8) | data) + 1); + break; + case 0x9002: + ch0.reg[2] = data; + ch0.enable = (byte)(data & 0x80); + ch0.freq = INT2FIX((((data & 0x0F) << 8) | ch0.reg[1]) + 1); + break; + // VRC6 CH1 rectangle + case 0xA000: + ch1.reg[0] = data; + ch1.gate = (byte)(data & 0x80); + ch1.volume = (byte)(data & 0x0F); + ch1.duty_pos = (byte)((data >> 4) & 0x07); + break; + case 0xA001: + ch1.reg[1] = data; + ch1.freq = INT2FIX((((ch1.reg[2] & 0x0F) << 8) | data) + 1); + break; + case 0xA002: + ch1.reg[2] = data; + ch1.enable = (byte)(data & 0x80); + ch1.freq = INT2FIX((((data & 0x0F) << 8) | ch1.reg[1]) + 1); + break; + // VRC6 CH2 sawtooth + case 0xB000: + ch2.reg[1] = data; + ch2.phaseaccum = (byte)(data & 0x3F); + break; + case 0xB001: + ch2.reg[1] = data; + ch2.freq = INT2FIX((((ch2.reg[2] & 0x0F) << 8) | data) + 1); + break; + case 0xB002: + ch2.reg[2] = data; + ch2.enable = (byte)(data & 0x80); + ch2.freq = INT2FIX((((data & 0x0F) << 8) | ch2.reg[1]) + 1); + // ch2.adder = 0; // クリアするとノイズの原因になる + // ch2.accum = 0; // クリアするとノイズの原因になる + break; + } + } + + public override int Process(int channel) + { + switch (channel) + { + case 0: + return RectangleRender(ch0); + case 1: + return RectangleRender(ch1); + case 2: + return SawtoothRender(ch2); + } + + return 0; + } + + public override int GetFreq(int channel) + { + if (channel == 0 || channel == 1) + { + RECTANGLE ch; + if (channel == 0) ch = ch0; + else ch = ch1; + if (ch.enable == 0 || ch.gate != 0 || ch.volume == 0) + return 0; + if (ch.freq < INT2FIX(8)) + return 0; + return (int)((256.0f * cpu_clock / (FIX2INT(ch.freq) * 16.0f))); + } + if (channel == 2) + { + SAWTOOTH ch = ch2; + if (ch.enable == 0 || ch.phaseaccum == 0) + return 0; + if (ch.freq < INT2FIX(8)) + return 0; + return (int)(256.0f * cpu_clock / (FIX2INT(ch.freq) * 14.0f)); + } + + return 0; + } + + int RectangleRender(RECTANGLE ch) + { + // Enable? + if (ch.enable == 0) + { + ch.output_vol = 0; + ch.adder = 0; + return ch.output_vol; + } + + // Digitized output + if (ch.gate != 0) + { + ch.output_vol = ch.volume << APU_VRC6.RECTANGLE_VOL_SHIFT; + return ch.output_vol; + } + + // 一定以上の周波数は処理しない(無駄) + if (ch.freq < INT2FIX(8)) + { + ch.output_vol = 0; + return ch.output_vol; + } + + ch.phaseacc -= cycle_rate; + if (ch.phaseacc >= 0) + return ch.output_vol; + + int output = ch.volume << APU_VRC6.RECTANGLE_VOL_SHIFT; + + if (ch.freq > cycle_rate) + { + // add 1 step + ch.phaseacc += ch.freq; + ch.adder = (byte)((ch.adder + 1) & 0x0F); + if (ch.adder <= ch.duty_pos) + ch.output_vol = output; + else + ch.output_vol = -output; + } + else + { + // average calculate + int num_times, total; + num_times = total = 0; + while (ch.phaseacc < 0) + { + ch.phaseacc += ch.freq; + ch.adder = (byte)((ch.adder + 1) & 0x0F); + if (ch.adder <= ch.duty_pos) + total += output; + else + total += -output; + num_times++; + } + ch.output_vol = total / num_times; + } + + return ch.output_vol; + } + + int SawtoothRender(SAWTOOTH ch) + { + // Digitized output + if (ch.enable == 0) + { + ch.output_vol = 0; + return ch.output_vol; + } + + // 一定以上の周波数は処理しない(無駄) + if (ch.freq < INT2FIX(9)) + { + return ch.output_vol; + } + + ch.phaseacc -= cycle_rate / 2; + if (ch.phaseacc >= 0) + return ch.output_vol; + + if (ch.freq > cycle_rate / 2) + { + // add 1 step + ch.phaseacc += ch.freq; + if (++ch.adder >= 7) + { + ch.adder = 0; + ch.accum = 0; + } + ch.accum += ch.phaseaccum; + ch.output_vol = ch.accum << APU_VRC6.SAWTOOTH_VOL_SHIFT; + } + else + { + // average calculate + int num_times, total; + num_times = total = 0; + while (ch.phaseacc < 0) + { + ch.phaseacc += ch.freq; + if (++ch.adder >= 7) + { + ch.adder = 0; + ch.accum = 0; + } + ch.accum += ch.phaseaccum; + total += ch.accum << APU_VRC6.SAWTOOTH_VOL_SHIFT; + num_times++; + } + ch.output_vol = (total / num_times); + } + + return ch.output_vol; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_N106.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_N106.cs.meta new file mode 100644 index 0000000..692dc26 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_N106.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6a47ed257e942d4478215338d8fe4c35 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_VRC6.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_VRC6.cs new file mode 100644 index 0000000..c552529 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_VRC6.cs @@ -0,0 +1,310 @@ +using System; + +namespace VirtualNes.Core +{ + public class APU_VRC6 : APU_INTERFACE + { + public const int RECTANGLE_VOL_SHIFT = 8; + public const int SAWTOOTH_VOL_SHIFT = 6; + + private RECTANGLE ch0 = new RECTANGLE(); + private RECTANGLE ch1 = new RECTANGLE(); + private SAWTOOTH ch2 = new SAWTOOTH(); + + private int cycle_rate; + private float cpu_clock; + + public APU_VRC6() + { + Reset(APU_CLOCK, 22050); + } + + public override void Reset(float fClock, int nRate) + { + ch0.ZeroMemory(); + ch1.ZeroMemory(); + ch2.ZeroMemory(); + + Setup(fClock, nRate); + } + + public override void Setup(float fClock, int nRate) + { + cpu_clock = fClock; + cycle_rate = (int)(fClock * 65536.0f / nRate); + } + + public override void Write(ushort addr, byte data) + { + switch (addr) + { + // VRC6 CH0 rectangle + case 0x9000: + ch0.reg[0] = data; + ch0.gate = (byte)(data & 0x80); + ch0.volume = (byte)(data & 0x0F); + ch0.duty_pos = (byte)((data >> 4) & 0x07); + break; + case 0x9001: + ch0.reg[1] = data; + ch0.freq = INT2FIX((((ch0.reg[2] & 0x0F) << 8) | data) + 1); + break; + case 0x9002: + ch0.reg[2] = data; + ch0.enable = (byte)(data & 0x80); + ch0.freq = INT2FIX((((data & 0x0F) << 8) | ch0.reg[1]) + 1); + break; + // VRC6 CH1 rectangle + case 0xA000: + ch1.reg[0] = data; + ch1.gate = (byte)(data & 0x80); + ch1.volume = (byte)(data & 0x0F); + ch1.duty_pos = (byte)((data >> 4) & 0x07); + break; + case 0xA001: + ch1.reg[1] = data; + ch1.freq = INT2FIX((((ch1.reg[2] & 0x0F) << 8) | data) + 1); + break; + case 0xA002: + ch1.reg[2] = data; + ch1.enable = (byte)(data & 0x80); + ch1.freq = INT2FIX((((data & 0x0F) << 8) | ch1.reg[1]) + 1); + break; + // VRC6 CH2 sawtooth + case 0xB000: + ch2.reg[1] = data; + ch2.phaseaccum = (byte)(data & 0x3F); + break; + case 0xB001: + ch2.reg[1] = data; + ch2.freq = INT2FIX((((ch2.reg[2] & 0x0F) << 8) | data) + 1); + break; + case 0xB002: + ch2.reg[2] = data; + ch2.enable = (byte)(data & 0x80); + ch2.freq = INT2FIX((((data & 0x0F) << 8) | ch2.reg[1]) + 1); + // ch2.adder = 0; // 僋儕傾偡傞偲僲僀僘偺尨場偵側傞 + // ch2.accum = 0; // 僋儕傾偡傞偲僲僀僘偺尨場偵側傞 + break; + } + } + + public override int Process(int channel) + { + switch (channel) + { + case 0: + return RectangleRender(ch0); + case 1: + return RectangleRender(ch1); + case 2: + return SawtoothRender(ch2); + } + + return 0; + } + + public override int GetFreq(int channel) + { + if (channel == 0 || channel == 1) + { + RECTANGLE ch = null; + if (channel == 0) ch = ch0; + else ch = ch1; + if (ch.enable == 0 || ch.gate != 0 || ch.volume == 0) + return 0; + if (ch.freq < INT2FIX(8)) + return 0; + return (int)(256.0f * cpu_clock / (FIX2INT(ch.freq) * 16.0f)); + } + if (channel == 2) + { + SAWTOOTH ch = ch2; + if (ch.enable == 0 || ch.phaseaccum == 0) + return 0; + if (ch.freq < INT2FIX(8)) + return 0; + return (int)(256.0f * cpu_clock / (FIX2INT(ch.freq) * 14.0f)); + } + + return 0; + } + + private int RectangleRender(RECTANGLE ch) + { + // Enable? + if (ch.enable == 0) + { + ch.output_vol = 0; + ch.adder = 0; + return ch.output_vol; + } + + // Digitized output + if (ch.gate != 0) + { + ch.output_vol = ch.volume << RECTANGLE_VOL_SHIFT; + return ch.output_vol; + } + + // 堦掕埲忋偺廃攇悢偼張棟偟側偄(柍懯) + if (ch.freq < INT2FIX(8)) + { + ch.output_vol = 0; + return ch.output_vol; + } + + ch.phaseacc -= cycle_rate; + if (ch.phaseacc >= 0) + return ch.output_vol; + + int output = ch.volume << RECTANGLE_VOL_SHIFT; + + if (ch.freq > cycle_rate) + { + // add 1 step + ch.phaseacc += ch.freq; + ch.adder = (byte)((ch.adder + 1) & 0x0F); + if (ch.adder <= ch.duty_pos) + ch.output_vol = output; + else + ch.output_vol = -output; + } + else + { + // average calculate + int num_times, total; + num_times = total = 0; + while (ch.phaseacc < 0) + { + ch.phaseacc += ch.freq; + ch.adder = (byte)((ch.adder + 1) & 0x0F); + if (ch.adder <= ch.duty_pos) + total += output; + else + total += -output; + num_times++; + } + ch.output_vol = total / num_times; + } + + return ch.output_vol; + } + + private int SawtoothRender(SAWTOOTH ch) + { + // Digitized output + if (ch.enable == 0) + { + ch.output_vol = 0; + return ch.output_vol; + } + + // 堦掕埲忋偺廃攇悢偼張棟偟側偄(柍懯) + if (ch.freq < INT2FIX(9)) + { + return ch.output_vol; + } + + ch.phaseacc -= cycle_rate / 2; + if (ch.phaseacc >= 0) + return ch.output_vol; + + if (ch.freq > cycle_rate / 2) + { + // add 1 step + ch.phaseacc += ch.freq; + if (++ch.adder >= 7) + { + ch.adder = 0; + ch.accum = 0; + } + ch.accum += ch.phaseaccum; + ch.output_vol = ch.accum << SAWTOOTH_VOL_SHIFT; + } + else + { + // average calculate + int num_times, total; + num_times = total = 0; + while (ch.phaseacc < 0) + { + ch.phaseacc += ch.freq; + if (++ch.adder >= 7) + { + ch.adder = 0; + ch.accum = 0; + } + ch.accum += ch.phaseaccum; + total += ch.accum << SAWTOOTH_VOL_SHIFT; + num_times++; + } + ch.output_vol = (total / num_times); + } + + return ch.output_vol; + } + + public class RECTANGLE + { + public byte[] reg = new byte[3]; + + public byte enable; + public byte gate; + public byte volume; + + public int phaseacc; + public int freq; + public int output_vol; + + public byte adder; + public byte duty_pos; + + public void ZeroMemory() + { + Array.Clear(reg, 0, reg.Length); + enable = 0; + gate = 0; + volume = 0; + + phaseacc = 0; + freq = 0; + output_vol = 0; + + adder = 0; + duty_pos = 0; + } + } + + public class SAWTOOTH + { + public byte[] reg = new byte[3]; + + public byte enable; + public byte volume; + + public int phaseacc; + public int freq; + public int output_vol; + + public byte adder; + public byte accum; + public byte phaseaccum; + + public void ZeroMemory() + { + Array.Clear(reg, 0, reg.Length); + enable = 0; + volume = 0; + + phaseacc = 0; + freq = 0; + output_vol = 0; + + adder = 0; + accum = 0; + phaseaccum = 0; + } + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_VRC6.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_VRC6.cs.meta new file mode 100644 index 0000000..e9b6f8a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_VRC6.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 190f3271accd30f4eb5b13590417d265 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_VRC7.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_VRC7.cs new file mode 100644 index 0000000..ffa5157 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_VRC7.cs @@ -0,0 +1,96 @@ +using System; +using VirtualNes.Core.Emu2413; + +namespace VirtualNes.Core +{ + public class APU_VRC7 : APU_INTERFACE + { + OPLL VRC7_OPLL; + byte address; + + public APU_VRC7() + { + Emu2413API.OPLL_init(3579545, 22050); // 仮のサンプリングレート + VRC7_OPLL = Emu2413API.OPLL_new(); + + if (VRC7_OPLL != null) + { + Emu2413API.OPLL_reset(VRC7_OPLL); + Emu2413API.OPLL_reset_patch(VRC7_OPLL, Emu2413API.OPLL_VRC7_TONE); + VRC7_OPLL.masterVolume = 128; + } + + // 仮設定 + Reset(APU_CLOCK, 22050); + } + + public override void Dispose() + { + if (VRC7_OPLL != null) + { + Emu2413API.OPLL_delete(VRC7_OPLL); + VRC7_OPLL = null; + // OPLL_close(); // 無くても良い(中身無し) + } + } + + public override void Reset(float fClock, int nRate) + { + if (VRC7_OPLL != null) + { + Emu2413API.OPLL_reset(VRC7_OPLL); + Emu2413API.OPLL_reset_patch(VRC7_OPLL, Emu2413API.OPLL_VRC7_TONE); + VRC7_OPLL.masterVolume = 128; + } + + address = 0; + + Setup(fClock, nRate); + } + + public override void Setup(float fClock, int nRate) + { + Emu2413API.OPLL_setClock((UInt32)(fClock * 2.0f), (UInt32)nRate); + } + + public override void Write(ushort addr, byte data) + { + if (VRC7_OPLL != null) + { + if (addr == 0x9010) + { + address = data; + } + else if (addr == 0x9030) + { + Emu2413API.OPLL_writeReg(VRC7_OPLL, address, data); + } + } + } + + public override int Process(int channel) + { + if (VRC7_OPLL != null) + return Emu2413API.OPLL_calc(VRC7_OPLL); + + return 0; + } + + float[] blkmul = { 0.5f, 1.0f, 2.0f, 4.0f, 8.0f, 16.0f, 32.0f, 64.0f }; + public override int GetFreq(int channel) + { + if (VRC7_OPLL != null && channel < 8) + { + int fno = ((VRC7_OPLL.reg[0x20 + channel] & 0x01) << 8) + VRC7_OPLL.reg[0x10 + channel]; + int blk = (VRC7_OPLL.reg[0x20 + channel] >> 1) & 0x07; + + if ((VRC7_OPLL.reg[0x20 + channel] & 0x10) != 0) + { + return (int)((256.0d * fno * blkmul[blk]) / ((1 << 18) / (3579545.0 / 72.0))); + } + } + + return 0; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_VRC7.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_VRC7.cs.meta new file mode 100644 index 0000000..15e1c81 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ApuEX/APU_VRC7.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 180a87918f9d49e4fad978014f1d594f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CPU.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CPU.cs new file mode 100644 index 0000000..ea06e43 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CPU.cs @@ -0,0 +1,2070 @@ +#undef DPCM_SYNCCLOCK + +using System; +using VirtualNes.Core.Debug; + +namespace VirtualNes.Core +{ + public class CPU + { + private static int nmicount; + + // 6502 status flags + public const byte C_FLAG = 0x01; // 1: Carry + public const byte Z_FLAG = 0x02; // 1: Zero + public const byte I_FLAG = 0x04; // 1: Irq disabled + public const byte D_FLAG = 0x08; // 1: Decimal mode flag (NES unused) + public const byte B_FLAG = 0x10; // 1: Break + public const byte R_FLAG = 0x20; // 1: Reserved (Always 1) + public const byte V_FLAG = 0x40; // 1: Overflow + public const byte N_FLAG = 0x80; // 1: Negative + + // Interrupt + public const byte NMI_FLAG = 0x01; + public const byte IRQ_FLAG = 0x02; + + public const byte IRQ_FRAMEIRQ = 0x04; + public const byte IRQ_DPCM = 0x08; + public const byte IRQ_MAPPER = 0x10; + public const byte IRQ_MAPPER2 = 0x20; + public const byte IRQ_TRIGGER = 0x40; // one shot(媽IRQ()) + public const byte IRQ_TRIGGER2 = 0x80; // one shot(媽IRQ_NotPending()) + + public static readonly byte IRQ_MASK = unchecked((byte)(~(NMI_FLAG | IRQ_FLAG))); + + // Vector + public const ushort NMI_VECTOR = 0xFFFA; + public const ushort RES_VECTOR = 0xFFFC; + public const ushort IRQ_VECTOR = 0xFFFE; + + private NES nes; + private bool m_bClockProcess; + private int TOTAL_cycles; + private int DMA_cycles; + private Mapper mapper; + private APU apu; + internal R6502 R = new R6502(); + private byte[] ZN_Table = new byte[256]; + private ArrayRef STACK; + + public CPU(NES parent) + { + nes = parent; + m_bClockProcess = false; + + } + + public void Dispose() { } + + ushort EA = 0; + ushort ET = 0; + ushort WT = 0; + byte DT = 0; + int exec_cycles = 0; + + internal long EXEC(int request_cycles) + { + byte opcode = 0; + int OLD_cycles = TOTAL_cycles; + byte nmi_request = 0, irq_request = 0; + bool bClockProcess = m_bClockProcess; + + exec_cycles = 0; + EA = 0; + ET = 0; + WT = 0; + DT = 0; + + while (request_cycles > 0) + { + exec_cycles = 0; + if (DMA_cycles > 0) + { + if (request_cycles <= DMA_cycles) + { + DMA_cycles -= request_cycles; + TOTAL_cycles += request_cycles; + + mapper.Clock(request_cycles); +#if DPCM_SYNCCLOCK + apu.SyncDPCM(request_cycles); +#endif + if (m_bClockProcess) + { + nes.Clock(request_cycles); + } + + goto _execute_exit; + } + else + { + exec_cycles += DMA_cycles; + DMA_cycles = 0; + } + } + + nmi_request = irq_request = 0; + opcode = OP6502(R.PC++); + + if (R.INT_pending != 0) + { + if ((R.INT_pending & NMI_FLAG) != 0) + { + nmi_request = 0xFF; + byte temp = unchecked((byte)(~NMI_FLAG)); + R.INT_pending &= temp; + } + else if ((R.INT_pending & IRQ_MASK) != 0) + { + byte temp = unchecked((byte)(~IRQ_TRIGGER2)); + R.INT_pending &= temp; + if ( + ((R.P & I_FLAG) == 0) + && + (opcode != 0x40) + ) + { + irq_request = 0xFF; + temp = unchecked((byte)(~IRQ_TRIGGER)); + R.INT_pending &= temp; + } + } + } + + switch (opcode) + { + case 0x69: // ADC #$?? + MR_IM(); ADC(); + ADD_CYCLE(2); + break; + case 0x65: // ADC $?? + MR_ZP(); ADC(); + ADD_CYCLE(3); + break; + case 0x75: // ADC $??,X + MR_ZX(); ADC(); + ADD_CYCLE(4); + break; + case 0x6D: // ADC $???? + MR_AB(); ADC(); + ADD_CYCLE(4); + break; + case 0x7D: // ADC $????,X + MR_AX(); ADC(); CHECK_EA(); + ADD_CYCLE(4); + break; + case 0x79: // ADC $????,Y + MR_AY(); ADC(); CHECK_EA(); + ADD_CYCLE(4); + break; + case 0x61: // ADC ($??,X) + MR_IX(); ADC(); + ADD_CYCLE(6); + break; + case 0x71: // ADC ($??),Y + MR_IY(); ADC(); CHECK_EA(); + ADD_CYCLE(4); + break; + + case 0xE9: // SBC #$?? + MR_IM(); SBC(); + ADD_CYCLE(2); + break; + case 0xE5: // SBC $?? + MR_ZP(); SBC(); + ADD_CYCLE(3); + break; + case 0xF5: // SBC $??,X + MR_ZX(); SBC(); + ADD_CYCLE(4); + break; + case 0xED: // SBC $???? + MR_AB(); SBC(); + ADD_CYCLE(4); + break; + case 0xFD: // SBC $????,X + MR_AX(); SBC(); CHECK_EA(); + ADD_CYCLE(4); + break; + case 0xF9: // SBC $????,Y + MR_AY(); SBC(); CHECK_EA(); + ADD_CYCLE(4); + break; + case 0xE1: // SBC ($??,X) + MR_IX(); SBC(); + ADD_CYCLE(6); + break; + case 0xF1: // SBC ($??),Y + MR_IY(); SBC(); CHECK_EA(); + ADD_CYCLE(5); + break; + + case 0xC6: // DEC $?? + MR_ZP(); DEC(); MW_ZP(); + ADD_CYCLE(5); + break; + case 0xD6: // DEC $??,X + MR_ZX(); DEC(); MW_ZP(); + ADD_CYCLE(6); + break; + case 0xCE: // DEC $???? + MR_AB(); DEC(); MW_EA(); + ADD_CYCLE(6); + break; + case 0xDE: // DEC $????,X + MR_AX(); DEC(); MW_EA(); + ADD_CYCLE(7); + break; + + case 0xCA: // DEX + DEX(); + ADD_CYCLE(2); + break; + case 0x88: // DEY + DEY(); + ADD_CYCLE(2); + break; + + case 0xE6: // INC $?? + MR_ZP(); INC(); MW_ZP(); + ADD_CYCLE(5); + break; + case 0xF6: // INC $??,X + MR_ZX(); INC(); MW_ZP(); + ADD_CYCLE(6); + break; + case 0xEE: // INC $???? + MR_AB(); INC(); MW_EA(); + ADD_CYCLE(6); + break; + case 0xFE: // INC $????,X + MR_AX(); INC(); MW_EA(); + ADD_CYCLE(7); + break; + + case 0xE8: // INX + INX(); + ADD_CYCLE(2); + break; + case 0xC8: // INY + INY(); + ADD_CYCLE(2); + break; + + case 0x29: // AND #$?? + MR_IM(); AND(); + ADD_CYCLE(2); + break; + case 0x25: // AND $?? + MR_ZP(); AND(); + ADD_CYCLE(3); + break; + case 0x35: // AND $??,X + MR_ZX(); AND(); + ADD_CYCLE(4); + break; + case 0x2D: // AND $???? + MR_AB(); AND(); + ADD_CYCLE(4); + break; + case 0x3D: // AND $????,X + MR_AX(); AND(); CHECK_EA(); + ADD_CYCLE(4); + break; + case 0x39: // AND $????,Y + MR_AY(); AND(); CHECK_EA(); + ADD_CYCLE(4); + break; + case 0x21: // AND ($??,X) + MR_IX(); AND(); + ADD_CYCLE(6); + break; + case 0x31: // AND ($??),Y + MR_IY(); AND(); CHECK_EA(); + ADD_CYCLE(5); + break; + + case 0x0A: // ASL A + ASL_A(); + ADD_CYCLE(2); + break; + case 0x06: // ASL $?? + MR_ZP(); ASL(); MW_ZP(); + ADD_CYCLE(5); + break; + case 0x16: // ASL $??,X + MR_ZX(); ASL(); MW_ZP(); + ADD_CYCLE(6); + break; + case 0x0E: // ASL $???? + MR_AB(); ASL(); MW_EA(); + ADD_CYCLE(6); + break; + case 0x1E: // ASL $????,X + MR_AX(); ASL(); MW_EA(); + ADD_CYCLE(7); + break; + + case 0x24: // BIT $?? + MR_ZP(); BIT(); + ADD_CYCLE(3); + break; + case 0x2C: // BIT $???? + MR_AB(); BIT(); + ADD_CYCLE(4); + break; + + case 0x49: // EOR #$?? + MR_IM(); EOR(); + ADD_CYCLE(2); + break; + case 0x45: // EOR $?? + MR_ZP(); EOR(); + ADD_CYCLE(3); + break; + case 0x55: // EOR $??,X + MR_ZX(); EOR(); + ADD_CYCLE(4); + break; + case 0x4D: // EOR $???? + MR_AB(); EOR(); + ADD_CYCLE(4); + break; + case 0x5D: // EOR $????,X + MR_AX(); EOR(); CHECK_EA(); + ADD_CYCLE(4); + break; + case 0x59: // EOR $????,Y + MR_AY(); EOR(); CHECK_EA(); + ADD_CYCLE(4); + break; + case 0x41: // EOR ($??,X) + MR_IX(); EOR(); + ADD_CYCLE(6); + break; + case 0x51: // EOR ($??),Y + MR_IY(); EOR(); CHECK_EA(); + ADD_CYCLE(5); + break; + + case 0x4A: // LSR A + LSR_A(); + ADD_CYCLE(2); + break; + case 0x46: // LSR $?? + MR_ZP(); LSR(); MW_ZP(); + ADD_CYCLE(5); + break; + case 0x56: // LSR $??,X + MR_ZX(); LSR(); MW_ZP(); + ADD_CYCLE(6); + break; + case 0x4E: // LSR $???? + MR_AB(); LSR(); MW_EA(); + ADD_CYCLE(6); + break; + case 0x5E: // LSR $????,X + MR_AX(); LSR(); MW_EA(); + ADD_CYCLE(7); + break; + + case 0x09: // ORA #$?? + MR_IM(); ORA(); + ADD_CYCLE(2); + break; + case 0x05: // ORA $?? + MR_ZP(); ORA(); + ADD_CYCLE(3); + break; + case 0x15: // ORA $??,X + MR_ZX(); ORA(); + ADD_CYCLE(4); + break; + case 0x0D: // ORA $???? + MR_AB(); ORA(); + ADD_CYCLE(4); + break; + case 0x1D: // ORA $????,X + MR_AX(); ORA(); CHECK_EA(); + ADD_CYCLE(4); + break; + case 0x19: // ORA $????,Y + MR_AY(); ORA(); CHECK_EA(); + ADD_CYCLE(4); + break; + case 0x01: // ORA ($??,X) + MR_IX(); ORA(); + ADD_CYCLE(6); + break; + case 0x11: // ORA ($??),Y + MR_IY(); ORA(); CHECK_EA(); + ADD_CYCLE(5); + break; + + case 0x2A: // ROL A + ROL_A(); + ADD_CYCLE(2); + break; + case 0x26: // ROL $?? + MR_ZP(); ROL(); MW_ZP(); + ADD_CYCLE(5); + break; + case 0x36: // ROL $??,X + MR_ZX(); ROL(); MW_ZP(); + ADD_CYCLE(6); + break; + case 0x2E: // ROL $???? + MR_AB(); ROL(); MW_EA(); + ADD_CYCLE(6); + break; + case 0x3E: // ROL $????,X + MR_AX(); ROL(); MW_EA(); + ADD_CYCLE(7); + break; + + case 0x6A: // ROR A + ROR_A(); + ADD_CYCLE(2); + break; + case 0x66: // ROR $?? + MR_ZP(); ROR(); MW_ZP(); + ADD_CYCLE(5); + break; + case 0x76: // ROR $??,X + MR_ZX(); ROR(); MW_ZP(); + ADD_CYCLE(6); + break; + case 0x6E: // ROR $???? + MR_AB(); ROR(); MW_EA(); + ADD_CYCLE(6); + break; + case 0x7E: // ROR $????,X + MR_AX(); ROR(); MW_EA(); + ADD_CYCLE(7); + break; + + case 0xA9: // LDA #$?? + MR_IM(); LDA(); + ADD_CYCLE(2); + break; + case 0xA5: // LDA $?? + MR_ZP(); LDA(); + ADD_CYCLE(3); + break; + case 0xB5: // LDA $??,X + MR_ZX(); LDA(); + ADD_CYCLE(4); + break; + case 0xAD: // LDA $???? + MR_AB(); LDA(); + ADD_CYCLE(4); + break; + case 0xBD: // LDA $????,X + MR_AX(); LDA(); CHECK_EA(); + ADD_CYCLE(4); + break; + case 0xB9: // LDA $????,Y + MR_AY(); LDA(); CHECK_EA(); + ADD_CYCLE(4); + break; + case 0xA1: // LDA ($??,X) + MR_IX(); LDA(); + ADD_CYCLE(6); + break; + case 0xB1: // LDA ($??),Y + MR_IY(); LDA(); CHECK_EA(); + ADD_CYCLE(5); + break; + + case 0xA2: // LDX #$?? + MR_IM(); LDX(); + ADD_CYCLE(2); + break; + case 0xA6: // LDX $?? + MR_ZP(); LDX(); + ADD_CYCLE(3); + break; + case 0xB6: // LDX $??,Y + MR_ZY(); LDX(); + ADD_CYCLE(4); + break; + case 0xAE: // LDX $???? + MR_AB(); LDX(); + ADD_CYCLE(4); + break; + case 0xBE: // LDX $????,Y + MR_AY(); LDX(); CHECK_EA(); + ADD_CYCLE(4); + break; + + case 0xA0: // LDY #$?? + MR_IM(); LDY(); + ADD_CYCLE(2); + break; + case 0xA4: // LDY $?? + MR_ZP(); LDY(); + ADD_CYCLE(3); + break; + case 0xB4: // LDY $??,X + MR_ZX(); LDY(); + ADD_CYCLE(4); + break; + case 0xAC: // LDY $???? + MR_AB(); LDY(); + ADD_CYCLE(4); + break; + case 0xBC: // LDY $????,X + MR_AX(); LDY(); CHECK_EA(); + ADD_CYCLE(4); + break; + + case 0x85: // STA $?? + EA_ZP(); STA(); MW_ZP(); + ADD_CYCLE(3); + break; + case 0x95: // STA $??,X + EA_ZX(); STA(); MW_ZP(); + ADD_CYCLE(4); + break; + case 0x8D: // STA $???? + EA_AB(); STA(); MW_EA(); + ADD_CYCLE(4); + break; + case 0x9D: // STA $????,X + EA_AX(); STA(); MW_EA(); + ADD_CYCLE(5); + break; + case 0x99: // STA $????,Y + EA_AY(); STA(); MW_EA(); + ADD_CYCLE(5); + break; + case 0x81: // STA ($??,X) + EA_IX(); STA(); MW_EA(); + ADD_CYCLE(6); + break; + case 0x91: // STA ($??),Y + EA_IY(); STA(); MW_EA(); + ADD_CYCLE(6); + break; + + case 0x86: // STX $?? + EA_ZP(); STX(); MW_ZP(); + ADD_CYCLE(3); + break; + case 0x96: // STX $??,Y + EA_ZY(); STX(); MW_ZP(); + ADD_CYCLE(4); + break; + case 0x8E: // STX $???? + EA_AB(); STX(); MW_EA(); + ADD_CYCLE(4); + break; + + case 0x84: // STY $?? + EA_ZP(); STY(); MW_ZP(); + ADD_CYCLE(3); + break; + case 0x94: // STY $??,X + EA_ZX(); STY(); MW_ZP(); + ADD_CYCLE(4); + break; + case 0x8C: // STY $???? + EA_AB(); STY(); MW_EA(); + ADD_CYCLE(4); + break; + + case 0xAA: // TAX + TAX(); + ADD_CYCLE(2); + break; + case 0x8A: // TXA + TXA(); + ADD_CYCLE(2); + break; + case 0xA8: // TAY + TAY(); + ADD_CYCLE(2); + break; + case 0x98: // TYA + TYA(); + ADD_CYCLE(2); + break; + case 0xBA: // TSX + TSX(); + ADD_CYCLE(2); + break; + case 0x9A: // TXS + TXS(); + ADD_CYCLE(2); + break; + + case 0xC9: // CMP #$?? + MR_IM(); CMP_(); + ADD_CYCLE(2); + break; + case 0xC5: // CMP $?? + MR_ZP(); CMP_(); + ADD_CYCLE(3); + break; + case 0xD5: // CMP $??,X + MR_ZX(); CMP_(); + ADD_CYCLE(4); + break; + case 0xCD: // CMP $???? + MR_AB(); CMP_(); + ADD_CYCLE(4); + break; + case 0xDD: // CMP $????,X + MR_AX(); CMP_(); CHECK_EA(); + ADD_CYCLE(4); + break; + case 0xD9: // CMP $????,Y + MR_AY(); CMP_(); CHECK_EA(); + ADD_CYCLE(4); + break; + case 0xC1: // CMP ($??,X) + MR_IX(); CMP_(); + ADD_CYCLE(6); + break; + case 0xD1: // CMP ($??),Y + MR_IY(); CMP_(); CHECK_EA(); + ADD_CYCLE(5); + break; + + case 0xE0: // CPX #$?? + MR_IM(); CPX(); + ADD_CYCLE(2); + break; + case 0xE4: // CPX $?? + MR_ZP(); CPX(); + ADD_CYCLE(3); + break; + case 0xEC: // CPX $???? + MR_AB(); CPX(); + ADD_CYCLE(4); + break; + + case 0xC0: // CPY #$?? + MR_IM(); CPY(); + ADD_CYCLE(2); + break; + case 0xC4: // CPY $?? + MR_ZP(); CPY(); + ADD_CYCLE(3); + break; + case 0xCC: // CPY $???? + MR_AB(); CPY(); + ADD_CYCLE(4); + break; + + case 0x90: // BCC + MR_IM(); BCC(); + ADD_CYCLE(2); + break; + case 0xB0: // BCS + MR_IM(); BCS(); + ADD_CYCLE(2); + break; + case 0xF0: // BEQ + MR_IM(); BEQ(); + ADD_CYCLE(2); + break; + case 0x30: // BMI + MR_IM(); BMI(); + ADD_CYCLE(2); + break; + case 0xD0: // BNE + MR_IM(); BNE(); + ADD_CYCLE(2); + break; + case 0x10: // BPL + MR_IM(); BPL(); + ADD_CYCLE(2); + break; + case 0x50: // BVC + MR_IM(); BVC(); + ADD_CYCLE(2); + break; + case 0x70: // BVS + MR_IM(); BVS(); + ADD_CYCLE(2); + break; + + case 0x4C: // JMP $???? + JMP(); + ADD_CYCLE(3); + break; + case 0x6C: // JMP ($????) + JMP_ID(); + ADD_CYCLE(5); + break; + + case 0x20: // JSR + JSR(); + ADD_CYCLE(6); + break; + + case 0x40: // RTI + RTI(); + ADD_CYCLE(6); + break; + case 0x60: // RTS + RTS(); + ADD_CYCLE(6); + break; + + // フラグ制御系 + case 0x18: // CLC + CLC(); + ADD_CYCLE(2); + break; + case 0xD8: // CLD + CLD(); + ADD_CYCLE(2); + break; + case 0x58: // CLI + CLI(); + ADD_CYCLE(2); + break; + case 0xB8: // CLV + CLV(); + ADD_CYCLE(2); + break; + + case 0x38: // SEC + SEC(); + ADD_CYCLE(2); + break; + case 0xF8: // SED + SED(); + ADD_CYCLE(2); + break; + case 0x78: // SEI + SEI(); + ADD_CYCLE(2); + break; + + // スタック系 + case 0x48: // PHA + PUSH(R.A); + ADD_CYCLE(3); + break; + case 0x08: // PHP + PUSH((byte)(R.P | B_FLAG)); + ADD_CYCLE(3); + break; + case 0x68: // PLA (N-----Z-) + R.A = POP(); + SET_ZN_FLAG(R.A); + ADD_CYCLE(4); + break; + case 0x28: // PLP + R.P = (byte)(POP() | R_FLAG); + ADD_CYCLE(4); + break; + + // その他 + case 0x00: // BRK + BRK(); + ADD_CYCLE(7); + break; + + case 0xEA: // NOP + ADD_CYCLE(2); + break; + + // 未公開命令群 + case 0x0B: // ANC #$?? + case 0x2B: // ANC #$?? + MR_IM(); ANC(); + ADD_CYCLE(2); + break; + + case 0x8B: // ANE #$?? + MR_IM(); ANE(); + ADD_CYCLE(2); + break; + + case 0x6B: // ARR #$?? + MR_IM(); ARR(); + ADD_CYCLE(2); + break; + + case 0x4B: // ASR #$?? + MR_IM(); ASR(); + ADD_CYCLE(2); + break; + + case 0xC7: // DCP $?? + MR_ZP(); DCP(); MW_ZP(); + ADD_CYCLE(5); + break; + case 0xD7: // DCP $??,X + MR_ZX(); DCP(); MW_ZP(); + ADD_CYCLE(6); + break; + case 0xCF: // DCP $???? + MR_AB(); DCP(); MW_EA(); + ADD_CYCLE(6); + break; + case 0xDF: // DCP $????,X + MR_AX(); DCP(); MW_EA(); + ADD_CYCLE(7); + break; + case 0xDB: // DCP $????,Y + MR_AY(); DCP(); MW_EA(); + ADD_CYCLE(7); + break; + case 0xC3: // DCP ($??,X) + MR_IX(); DCP(); MW_EA(); + ADD_CYCLE(8); + break; + case 0xD3: // DCP ($??),Y + MR_IY(); DCP(); MW_EA(); + ADD_CYCLE(8); + break; + + case 0xE7: // ISB $?? + MR_ZP(); ISB(); MW_ZP(); + ADD_CYCLE(5); + break; + case 0xF7: // ISB $??,X + MR_ZX(); ISB(); MW_ZP(); + ADD_CYCLE(5); + break; + case 0xEF: // ISB $???? + MR_AB(); ISB(); MW_EA(); + ADD_CYCLE(5); + break; + case 0xFF: // ISB $????,X + MR_AX(); ISB(); MW_EA(); + ADD_CYCLE(5); + break; + case 0xFB: // ISB $????,Y + MR_AY(); ISB(); MW_EA(); + ADD_CYCLE(5); + break; + case 0xE3: // ISB ($??,X) + MR_IX(); ISB(); MW_EA(); + ADD_CYCLE(5); + break; + case 0xF3: // ISB ($??),Y + MR_IY(); ISB(); MW_EA(); + ADD_CYCLE(5); + break; + + case 0xBB: // LAS $????,Y + MR_AY(); LAS(); CHECK_EA(); + ADD_CYCLE(4); + break; + + + case 0xA7: // LAX $?? + MR_ZP(); LAX(); + ADD_CYCLE(3); + break; + case 0xB7: // LAX $??,Y + MR_ZY(); LAX(); + ADD_CYCLE(4); + break; + case 0xAF: // LAX $???? + MR_AB(); LAX(); + ADD_CYCLE(4); + break; + case 0xBF: // LAX $????,Y + MR_AY(); LAX(); CHECK_EA(); + ADD_CYCLE(4); + break; + case 0xA3: // LAX ($??,X) + MR_IX(); LAX(); + ADD_CYCLE(6); + break; + case 0xB3: // LAX ($??),Y + MR_IY(); LAX(); CHECK_EA(); + ADD_CYCLE(5); + break; + + case 0xAB: // LXA #$?? + MR_IM(); LXA(); + ADD_CYCLE(2); + break; + + case 0x27: // RLA $?? + MR_ZP(); RLA(); MW_ZP(); + ADD_CYCLE(5); + break; + case 0x37: // RLA $??,X + MR_ZX(); RLA(); MW_ZP(); + ADD_CYCLE(6); + break; + case 0x2F: // RLA $???? + MR_AB(); RLA(); MW_EA(); + ADD_CYCLE(6); + break; + case 0x3F: // RLA $????,X + MR_AX(); RLA(); MW_EA(); + ADD_CYCLE(7); + break; + case 0x3B: // RLA $????,Y + MR_AY(); RLA(); MW_EA(); + ADD_CYCLE(7); + break; + case 0x23: // RLA ($??,X) + MR_IX(); RLA(); MW_EA(); + ADD_CYCLE(8); + break; + case 0x33: // RLA ($??),Y + MR_IY(); RLA(); MW_EA(); + ADD_CYCLE(8); + break; + + case 0x67: // RRA $?? + MR_ZP(); RRA(); MW_ZP(); + ADD_CYCLE(5); + break; + case 0x77: // RRA $??,X + MR_ZX(); RRA(); MW_ZP(); + ADD_CYCLE(6); + break; + case 0x6F: // RRA $???? + MR_AB(); RRA(); MW_EA(); + ADD_CYCLE(6); + break; + case 0x7F: // RRA $????,X + MR_AX(); RRA(); MW_EA(); + ADD_CYCLE(7); + break; + case 0x7B: // RRA $????,Y + MR_AY(); RRA(); MW_EA(); + ADD_CYCLE(7); + break; + case 0x63: // RRA ($??,X) + MR_IX(); RRA(); MW_EA(); + ADD_CYCLE(8); + break; + case 0x73: // RRA ($??),Y + MR_IY(); RRA(); MW_EA(); + ADD_CYCLE(8); + break; + + case 0x87: // SAX $?? + MR_ZP(); SAX(); MW_ZP(); + ADD_CYCLE(3); + break; + case 0x97: // SAX $??,Y + MR_ZY(); SAX(); MW_ZP(); + ADD_CYCLE(4); + break; + case 0x8F: // SAX $???? + MR_AB(); SAX(); MW_EA(); + ADD_CYCLE(4); + break; + case 0x83: // SAX ($??,X) + MR_IX(); SAX(); MW_EA(); + ADD_CYCLE(6); + break; + + case 0xCB: // SBX #$?? + MR_IM(); SBX(); + ADD_CYCLE(2); + break; + + case 0x9F: // SHA $????,Y + MR_AY(); SHA(); MW_EA(); + ADD_CYCLE(5); + break; + case 0x93: // SHA ($??),Y + MR_IY(); SHA(); MW_EA(); + ADD_CYCLE(6); + break; + + case 0x9B: // SHS $????,Y + MR_AY(); SHS(); MW_EA(); + ADD_CYCLE(5); + break; + + case 0x9E: // SHX $????,Y + MR_AY(); SHX(); MW_EA(); + ADD_CYCLE(5); + break; + + case 0x9C: // SHY $????,X + MR_AX(); SHY(); MW_EA(); + ADD_CYCLE(5); + break; + + case 0x07: // SLO $?? + MR_ZP(); SLO(); MW_ZP(); + ADD_CYCLE(5); + break; + case 0x17: // SLO $??,X + MR_ZX(); SLO(); MW_ZP(); + ADD_CYCLE(6); + break; + case 0x0F: // SLO $???? + MR_AB(); SLO(); MW_EA(); + ADD_CYCLE(6); + break; + case 0x1F: // SLO $????,X + MR_AX(); SLO(); MW_EA(); + ADD_CYCLE(7); + break; + case 0x1B: // SLO $????,Y + MR_AY(); SLO(); MW_EA(); + ADD_CYCLE(7); + break; + case 0x03: // SLO ($??,X) + MR_IX(); SLO(); MW_EA(); + ADD_CYCLE(8); + break; + case 0x13: // SLO ($??),Y + MR_IY(); SLO(); MW_EA(); + ADD_CYCLE(8); + break; + + case 0x47: // SRE $?? + MR_ZP(); SRE(); MW_ZP(); + ADD_CYCLE(5); + break; + case 0x57: // SRE $??,X + MR_ZX(); SRE(); MW_ZP(); + ADD_CYCLE(6); + break; + case 0x4F: // SRE $???? + MR_AB(); SRE(); MW_EA(); + ADD_CYCLE(6); + break; + case 0x5F: // SRE $????,X + MR_AX(); SRE(); MW_EA(); + ADD_CYCLE(7); + break; + case 0x5B: // SRE $????,Y + MR_AY(); SRE(); MW_EA(); + ADD_CYCLE(7); + break; + case 0x43: // SRE ($??,X) + MR_IX(); SRE(); MW_EA(); + ADD_CYCLE(8); + break; + case 0x53: // SRE ($??),Y + MR_IY(); SRE(); MW_EA(); + ADD_CYCLE(8); + break; + + case 0xEB: // SBC #$?? (Unofficial) + MR_IM(); SBC(); + ADD_CYCLE(2); + break; + + case 0x1A: // NOP (Unofficial) + case 0x3A: // NOP (Unofficial) + case 0x5A: // NOP (Unofficial) + case 0x7A: // NOP (Unofficial) + case 0xDA: // NOP (Unofficial) + case 0xFA: // NOP (Unofficial) + ADD_CYCLE(2); + break; + case 0x80: // DOP (CYCLES 2) + case 0x82: // DOP (CYCLES 2) + case 0x89: // DOP (CYCLES 2) + case 0xC2: // DOP (CYCLES 2) + case 0xE2: // DOP (CYCLES 2) + R.PC++; + ADD_CYCLE(2); + break; + case 0x04: // DOP (CYCLES 3) + case 0x44: // DOP (CYCLES 3) + case 0x64: // DOP (CYCLES 3) + R.PC++; + ADD_CYCLE(3); + break; + case 0x14: // DOP (CYCLES 4) + case 0x34: // DOP (CYCLES 4) + case 0x54: // DOP (CYCLES 4) + case 0x74: // DOP (CYCLES 4) + case 0xD4: // DOP (CYCLES 4) + case 0xF4: // DOP (CYCLES 4) + R.PC++; + ADD_CYCLE(4); + break; + case 0x0C: // TOP + case 0x1C: // TOP + case 0x3C: // TOP + case 0x5C: // TOP + case 0x7C: // TOP + case 0xDC: // TOP + case 0xFC: // TOP + R.PC += 2; + ADD_CYCLE(4); + break; + + case 0x02: /* JAM */ + case 0x12: /* JAM */ + case 0x22: /* JAM */ + case 0x32: /* JAM */ + case 0x42: /* JAM */ + case 0x52: /* JAM */ + case 0x62: /* JAM */ + case 0x72: /* JAM */ + case 0x92: /* JAM */ + case 0xB2: /* JAM */ + case 0xD2: /* JAM */ + case 0xF2: /* JAM */ + default: + if (!Supporter.Config.emulator.bIllegalOp) + { + throw new Exception("IllegalOp"); + } + else + { + R.PC--; + ADD_CYCLE(4); + } + break; + // default: + // __assume(0); + } + + if (nmi_request != 0) + { + _NMI(); + } + else + if (irq_request != 0) + { + _IRQ(); + } + + request_cycles -= exec_cycles; + TOTAL_cycles += exec_cycles; + + mapper.Clock(exec_cycles); +#if DPCM_SYNCCLOCK + apu->SyncDPCM( exec_cycles ); +#endif + if (bClockProcess) + { + nes.Clock(exec_cycles); + } + } + _execute_exit: +#if !DPCM_SYNCCLOCK + apu.SyncDPCM(TOTAL_cycles - OLD_cycles); +#endif + return TOTAL_cycles - OLD_cycles; + } + private void _IRQ() + { + PUSH((byte)(R.PC >> 8)); + PUSH((byte)(R.PC & 0xFF)); + CLR_FLAG(B_FLAG); + PUSH(R.P); + SET_FLAG(I_FLAG); + R.PC = RD6502W(IRQ_VECTOR); + exec_cycles += 7; + } + + + private ushort RD6502W(ushort addr) + { + if (addr < 0x2000) + { + // RAM (Mirror $0800, $1000, $1800) + return BitConverter.ToUInt16(MMU.RAM, addr & 0x07FF); + } + else if (addr < 0x8000) + { + // Others + return (ushort)(nes.Read(addr) + nes.Read((ushort)(addr + 1)) * 0x100); + } + + var temp = MMU.CPU_MEM_BANK[addr >> 13]; + shortTemp[0] = temp[addr & 0x1FFF]; + shortTemp[1] = temp[(addr & 0x1FFF) + 1]; + return BitConverter.ToUInt16(shortTemp, 0); + } + + private void SET_FLAG(byte V) + { + R.P |= (V); + } + + private void CLR_FLAG(byte V) + { + var temp = (byte)(~V); + R.P &= temp; + } + + private void _NMI() + { + PUSH((byte)(R.PC >> 8)); + PUSH((byte)(R.PC & 0xFF)); + CLR_FLAG(B_FLAG); + PUSH(R.P); + SET_FLAG(I_FLAG); + R.PC = RD6502W(NMI_VECTOR); + exec_cycles += 7; + } + + private void SRE() + { + TST_FLAG((DT & 0x01) != 0, C_FLAG); + DT >>= 1; + R.A ^= DT; + SET_ZN_FLAG(R.A); + } + + private void SLO() + { + TST_FLAG((DT & 0x80) != 0, C_FLAG); + DT <<= 1; + R.A |= DT; + SET_ZN_FLAG(R.A); + } + + private void SHY() + { + DT = (byte)(R.Y & ((EA >> 8) + 1)); + } + + private void SHX() + { + DT = (byte)(R.X & ((EA >> 8) + 1)); + } + + private void SHS() + { + R.S = (byte)(R.A & R.X); + DT = (byte)(R.S & ((EA >> 8) + 1)); + } + + private void SHA() + { + DT = (byte)(R.A & R.X & ((EA >> 8) + 1)); + } + + private void SBX() + { + WT = (ushort)((R.A & R.X) - DT); + TST_FLAG(WT < 0x100, C_FLAG); + R.X = (byte)(WT & 0xFF); + SET_ZN_FLAG(R.X); + } + + private void SAX() + { + DT = (byte)(R.A & R.X); + } + + private void RRA() + { + if ((R.P & C_FLAG) != 0) + { + TST_FLAG((DT & 0x01) != 0, C_FLAG); + DT = (byte)((DT >> 1) | 0x80); + } + else + { + TST_FLAG((DT & 0x01) != 0, C_FLAG); + DT >>= 1; + } + ADC(); + } + + private void RLA() + { + if ((R.P & C_FLAG) != 0) + { + TST_FLAG((DT & 0x80) != 0, C_FLAG); + DT = (byte)((DT << 1) | 1); + } + else + { + TST_FLAG((DT & 0x80) != 0, C_FLAG); + DT <<= 1; + } + R.A &= DT; + SET_ZN_FLAG(R.A); + } + + private void LXA() + { + R.A = R.X = (byte)((R.A | 0xEE) & DT); + SET_ZN_FLAG(R.A); + } + + private void LAX() + { + R.A = DT; + R.X = R.A; + SET_ZN_FLAG(R.A); + } + + private void LAS() + { + R.A = R.X = R.S = (byte)(R.S & DT); + SET_ZN_FLAG(R.A); + } + + private void ISB() + { + DT++; + SBC(); + } + + private void DCP() + { + DT--; + CMP_(); + } + + private void ASR() + { + DT &= R.A; + TST_FLAG((DT & 0x01) != 0, C_FLAG); + R.A = (byte)(DT >> 1); + SET_ZN_FLAG(R.A); + } + + private void ARR() + { + DT &= R.A; + R.A = (byte)((DT >> 1) | ((R.P & C_FLAG) << 7)); + SET_ZN_FLAG(R.A); + TST_FLAG((R.A & 0x40) != 0, C_FLAG); + TST_FLAG(((R.A >> 6) ^ (R.A >> 5)) != 0, V_FLAG); + } + + private void ANE() + { + R.A = (byte)((R.A | 0xEE) & R.X & DT); + SET_ZN_FLAG(R.A); + } + + private void ANC() + { + R.A &= DT; + SET_ZN_FLAG(R.A); + TST_FLAG((R.P & N_FLAG) != 0, C_FLAG); + } + + private void BRK() + { + R.PC++; + PUSH((byte)(R.PC >> 8)); + PUSH((byte)(R.PC & 0xFF)); + SET_FLAG(B_FLAG); + PUSH(R.P); + SET_FLAG(I_FLAG); + R.PC = RD6502W(IRQ_VECTOR); + } + + private byte POP() + { + return STACK[(++R.S) & 0xFF]; + } + + private void PUSH(byte V) + { + STACK[(R.S--) & 0xFF] = V; + } + + private void SEI() + { + R.P |= I_FLAG; + } + + private void SED() + { + R.P |= D_FLAG; + } + + private void SEC() + { + R.P |= C_FLAG; + } + + private void CLV() + { + var temp = unchecked((byte)(~V_FLAG)); + R.P &= temp; + } + + private void CLI() + { + var temp = unchecked((byte)(~I_FLAG)); + R.P &= temp; + } + + private void CLD() + { + var temp = unchecked((byte)(~D_FLAG)); + R.P &= temp; + } + + private void CLC() + { + var temp = unchecked((byte)(~C_FLAG)); + R.P &= temp; + } + + private void RTS() + { + R.PC = POP(); + R.PC |= (ushort)(POP() * 0x0100); + R.PC++; + } + + private void RTI() + { + R.P = (byte)(POP() | R_FLAG); + R.PC = POP(); + R.PC |= (ushort)(POP() * 0x0100); + } + + private void JSR() + { + EA = OP6502W(R.PC); + R.PC++; + PUSH((byte)(R.PC >> 8)); + PUSH((byte)(R.PC & 0xFF)); + R.PC = EA; + } + + private void JMP_ID() + { + WT = OP6502W(R.PC); + EA = RD6502(WT); + WT = (ushort)((WT & 0xFF00) | ((WT + 1) & 0x00FF)); + R.PC = (ushort)(EA + RD6502(WT) * 0x100); + } + + private void JMP() + { + R.PC = OP6502W(R.PC); + } + + private void BVS() + { + if ((R.P & V_FLAG) != 0) + REL_JUMP(); + } + + private void REL_JUMP() + { + ET = R.PC; + EA = (ushort)(R.PC + (sbyte)DT); + R.PC = EA; + ADD_CYCLE(1); + CHECK_EA(); + } + + private void BVC() + { + if ((R.P & V_FLAG) == 0) REL_JUMP(); + } + + private void BPL() + { + if ((R.P & N_FLAG) == 0) REL_JUMP(); + } + + private void BNE() + { + if ((R.P & Z_FLAG) == 0) REL_JUMP(); + } + + private void BMI() + { + if ((R.P & N_FLAG) != 0) REL_JUMP(); + } + + private void BEQ() + { + if ((R.P & Z_FLAG) != 0) REL_JUMP(); + } + + private void BCS() + { + if ((R.P & C_FLAG) != 0) REL_JUMP(); + } + + private void BCC() + { + if ((R.P & C_FLAG) == 0) REL_JUMP(); + } + + private void CPY() + { + WT = (ushort)(R.Y - DT); + TST_FLAG((WT & 0x8000) == 0, C_FLAG); + SET_ZN_FLAG((byte)WT); + } + + private void CPX() + { + WT = (ushort)(R.X - DT); + TST_FLAG((WT & 0x8000) == 0, C_FLAG); + SET_ZN_FLAG((byte)WT); + } + + private void CMP_() + { + WT = (ushort)(R.A - DT); + TST_FLAG((WT & 0x8000) == 0, C_FLAG); + SET_ZN_FLAG((byte)WT); + } + + private void TXS() + { + R.S = R.X; + } + + private void TSX() + { + R.X = R.S; SET_ZN_FLAG(R.X); + } + + private void TYA() + { + R.A = R.Y; SET_ZN_FLAG(R.A); + } + + private void TAY() + { + R.Y = R.A; SET_ZN_FLAG(R.Y); + } + + private void TXA() + { + R.A = R.X; SET_ZN_FLAG(R.A); + } + + private void TAX() + { + R.X = R.A; SET_ZN_FLAG(R.X); + } + + private void STY() + { + DT = R.Y; + } + + private void EA_ZY() + { + DT = OP6502(R.PC++); + EA = (byte)(DT + R.Y); + } + + private void STX() + { + DT = R.X; + } + + private void EA_IY() + { + DT = OP6502(R.PC++); + ET = ZPRDW(DT); + EA = (ushort)(ET + R.Y); + } + + private void EA_IX() + { + DT = OP6502(R.PC++); + EA = ZPRDW(DT + R.X); + } + + private void EA_AY() + { + ET = OP6502W(R.PC); + R.PC += 2; + EA = (ushort)(ET + R.Y); + } + + private void EA_AX() + { + ET = OP6502W(R.PC); + R.PC += 2; + EA = (ushort)(ET + R.X); + } + + private void EA_AB() + { + EA = OP6502W(R.PC); + R.PC += 2; + } + + private void EA_ZX() + { + DT = OP6502(R.PC++); + EA = (byte)(DT + R.X); + } + + private void STA() + { + DT = R.A; + } + + private void EA_ZP() + { + EA = OP6502(R.PC++); + } + + private void LDY() + { + R.Y = DT; SET_ZN_FLAG(R.Y); + } + + private void MR_ZY() + { + DT = OP6502(R.PC++); + EA = (byte)(DT + R.Y); + DT = ZPRD(EA); + } + + private void LDX() + { + R.X = DT; SET_ZN_FLAG(R.X); + } + + private void LDA() + { + R.A = DT; SET_ZN_FLAG(R.A); + } + + private void ROR() + { + if ((R.P & C_FLAG) != 0) + { + TST_FLAG((DT & 0x01) != 0, C_FLAG); + DT = (byte)((DT >> 1) | 0x80); + } + else + { + TST_FLAG((DT & 0x01) != 0, C_FLAG); + DT >>= 1; + } + SET_ZN_FLAG(DT); + } + + private void ROR_A() + { + if ((R.P & C_FLAG) != 0) + { + TST_FLAG((R.A & 0x01) != 0, C_FLAG); + R.A = (byte)((R.A >> 1) | 0x80); + } + else + { + TST_FLAG((R.A & 0x01) != 0, C_FLAG); + R.A >>= 1; + } + SET_ZN_FLAG(R.A); + } + + private void ROL() + { + if ((R.P & C_FLAG) != 0) + { + TST_FLAG((DT & 0x80) != 0, C_FLAG); + DT = (byte)((DT << 1) | 0x01); + } + else + { + TST_FLAG((DT & 0x80) != 0, C_FLAG); + DT <<= 1; + } + SET_ZN_FLAG(DT); + } + + private void ROL_A() + { + if ((R.P & C_FLAG) != 0) + { + TST_FLAG((R.A & 0x80) != 0, C_FLAG); + R.A = (byte)((R.A << 1) | 0x01); + } + else + { + TST_FLAG((R.A & 0x80) != 0, C_FLAG); + R.A <<= 1; + } + SET_ZN_FLAG(R.A); + } + + private void ORA() + { + R.A |= DT; + SET_ZN_FLAG(R.A); + } + + private void LSR_A() + { + TST_FLAG((R.A & 0x01) != 0, C_FLAG); + R.A >>= 1; + SET_ZN_FLAG(R.A); + } + + private void LSR() + { + TST_FLAG((DT & 0x01) != 0, C_FLAG); + DT >>= 1; + SET_ZN_FLAG(DT); + } + + private void EOR() + { + R.A ^= DT; + SET_ZN_FLAG(R.A); + } + + internal void SetClockProcess(bool bEnable) + { + m_bClockProcess = bEnable; + } + + internal byte OP6502(ushort addr) + { + return MMU.CPU_MEM_BANK[addr >> 13][addr & 0x1FFF]; + } + + private byte[] shortTemp = new byte[2]; + internal ushort OP6502W(ushort addr) + { + var bytePage = MMU.CPU_MEM_BANK[addr >> 13]; + var spanByte = bytePage; + shortTemp[0] = spanByte[addr & 0x1FFF]; + shortTemp[1] = spanByte[(addr & 0x1FFF) + 1]; + return BitConverter.ToUInt16(shortTemp, 0); + } + + internal byte RD6502(ushort addr) + { + if (addr < 0x2000) + { + // RAM (Mirror $0800, $1000, $1800) + return MMU.RAM[addr & 0x07FF]; + } + else if (addr < 0x8000) + { + // Others + return nes.Read(addr); + } + else + { + // Dummy access + mapper.Read(addr, MMU.CPU_MEM_BANK[addr >> 13][addr & 0x1FFF]); + } + + // Quick bank read + return MMU.CPU_MEM_BANK[addr >> 13][addr & 0x1FFF]; + } + + private void AND() + { + R.A &= DT; + SET_ZN_FLAG(R.A); + } + + private void MR_IM() + { + DT = OP6502(R.PC++); + } + + private void BIT() + { + TST_FLAG((DT & R.A) == 0, Z_FLAG); + TST_FLAG((DT & 0x80) != 0, N_FLAG); + TST_FLAG((DT & 0x40) != 0, V_FLAG); + } + + private void MR_ZP() + { + EA = OP6502(R.PC++); + DT = ZPRD(EA); + } + + private byte ZPRD(ushort A) + { + return MMU.RAM[A]; + } + + private ushort ZPRDW(int A) + { + ushort ram1 = MMU.RAM[A]; + ushort ram2 = MMU.RAM[A + 1]; + ram2 <<= 8; + return (ushort)(ram1 + ram2); + } + + private void ADC() + { + WT = (ushort)(R.A + DT + (R.P & C_FLAG)); + TST_FLAG(WT > 0xFF, C_FLAG); + var temp = ((~(R.A ^ DT)) & (R.A ^ WT) & 0x80); + TST_FLAG(temp != 0, V_FLAG); + R.A = (byte)WT; + SET_ZN_FLAG(R.A); + } + + private void TST_FLAG(bool F, byte V) + { + byte temp = (byte)~V; + R.P &= temp; + + if (F) R.P |= V; + } + + private void SET_ZN_FLAG(byte A) + { + byte temp = unchecked((byte)(~(Z_FLAG | N_FLAG))); + R.P &= temp; + R.P |= ZN_Table[A]; + } + + private void ADD_CYCLE(int V) + { + exec_cycles += V; + } + + private void MR_ZX() + { + DT = OP6502(R.PC++); + EA = (ushort)(DT + R.X); + DT = ZPRD(EA); + } + + private void MR_AB() + { + EA = OP6502W(R.PC); + R.PC += 2; + DT = RD6502(EA); + } + + private void MR_AX() + { + ET = OP6502W(R.PC); + R.PC += 2; + EA = (ushort)(ET + R.X); + DT = RD6502(EA); + } + + private void CHECK_EA() + { + if ((ET & 0xFF00) != (EA & 0xFF00)) ADD_CYCLE(1); + } + + private void MR_AY() + { + ET = OP6502W(R.PC); + R.PC += 2; + EA = (ushort)(ET + R.Y); + DT = RD6502(EA); + } + + private void MR_IX() + { + DT = OP6502(R.PC++); + EA = ZPRDW(DT + R.X); + DT = RD6502(EA); + } + + private void MR_IY() + { + DT = OP6502(R.PC++); + ET = ZPRDW(DT); + EA = (ushort)(ET + R.Y); + DT = RD6502(EA); + } + private void ASL_A() + { + TST_FLAG((R.A & 0x80) != 0, C_FLAG); + R.A <<= 1; + SET_ZN_FLAG(R.A); + } + + private void ASL() + { + TST_FLAG((DT & 0x80) != 0, C_FLAG); + DT <<= 1; + SET_ZN_FLAG(DT); + } + + private void SBC() + { + WT = (ushort)(R.A - DT - (~R.P & C_FLAG)); + bool f = ((R.A ^ DT) & (R.A ^ WT) & (0x80)) != 0; + TST_FLAG(f, V_FLAG); + TST_FLAG(WT < 0x100, C_FLAG); + R.A = (byte)WT; + SET_ZN_FLAG(R.A); + } + + private void DEC() + { + DT--; + SET_ZN_FLAG(DT); + } + + private void DEX() + { + R.X--; + SET_ZN_FLAG(R.X); + } + + private void DEY() + { + R.Y--; + SET_ZN_FLAG(R.Y); + } + + private void INC() + { + DT++; + SET_ZN_FLAG(DT); + } + + private void INX() + { + R.X++; + SET_ZN_FLAG(R.X); + } + + private void INY() + { + R.Y++; + SET_ZN_FLAG(R.Y); + } + + private void MW_ZP() + { + ZPWR(EA, DT); + } + + private void ZPWR(ushort a, byte v) + { + MMU.RAM[a] = v; + } + + private void MW_EA() + { + WR6502(EA, DT); + } + + internal void ClrIRQ(byte mask) + { + byte temp = (byte)~mask; + R.INT_pending &= temp; + } + + internal void WR6502(ushort addr, byte data) + { + if (addr < 0x2000) + { + // RAM (Mirror $0800, $1000, $1800) + MMU.RAM[addr & 0x07FF] = data; + } + else + { + // Others + nes.Write(addr, data); + } + } + + internal void NMI() + { + R.INT_pending |= NMI_FLAG; + nmicount = 0; + } + + internal void SetIRQ(byte mask) + { + R.INT_pending |= mask; + } + + internal int GetTotalCycles() + { + return TOTAL_cycles; + } + + internal void DMA(int cycles) + { + DMA_cycles += cycles; + } + + internal void Reset() + { + apu = nes.apu; + mapper = nes.mapper; + + R.A = 0x00; + R.X = 0x00; + R.Y = 0x00; + R.S = 0xFF; + R.P = Z_FLAG | R_FLAG; + R.PC = RD6502W(RES_VECTOR); + + R.INT_pending = 0; + + TOTAL_cycles = 0; + DMA_cycles = 0; + + // STACK quick access + STACK = new ArrayRef(MMU.RAM, 0x0100, MMU.RAM.Length - 0x100); + + // Zero/Negative FLAG + ZN_Table[0] = Z_FLAG; + for (int i = 1; i < 256; i++) + ZN_Table[i] = (byte)((i & 0x80) != 0 ? N_FLAG : 0); + } + + internal void GetContext(ref R6502 r) + { + r = R; + } + } + + public enum StatusFlag6502 : int + { + C_FLAG = 0x01, + Z_FLAG = 0x02, + I_FLAG = 0x04, + D_FLAG = 0x08, + B_FLAG = 0x10, + R_FLAG = 0x20, + V_FLAG = 0x40, + N_FLAG = 0x80 + } + + public enum Interrupt : int + { + NMI_FLAG = 0x01, + IRQ_FLAG = 0x02, + IRQ_FRAMEIRQ = 0x04, + IRQ_DPCM = 0x08, + IRQ_MAPPER = 0x10, + IRQ_MAPPER2 = 0x20, + IRQ_TRIGGER = 0x40, + IRQ_TRIGGER2 = 0x80, + IRQ_MASK = (~(NMI_FLAG | IRQ_FLAG)), + } + + public enum Vector : int + { + NMI_VECTOR = 0xFFFA, + RES_VECTOR = 0xFFFC, + IRQ_VECTOR = 0xFFFE + } + + public class R6502 + { + public ushort PC; + public byte A; + public byte P; + public byte X; + public byte Y; + public byte S; + + public byte INT_pending; + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CPU.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CPU.cs.meta new file mode 100644 index 0000000..c59b49a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CPU.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 055e668755423bf4dabeb6cc007bce76 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Cheat.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Cheat.cs new file mode 100644 index 0000000..9d2be19 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Cheat.cs @@ -0,0 +1,36 @@ +namespace VirtualNes.Core +{ + public class CHEATCODE + { + // 埲壓偺俀偮偼OR儅僗僋 + public const int CHEAT_ENABLE = 1 << 0; + public const int CHEAT_KEYDISABLE = 1 << 1; + + // 彂偒崬傒庬椶 + public const int CHEAT_TYPE_ALWAYS = 0; // 忢偵彂偒崬傒 + public const int CHEAT_TYPE_ONCE = 1; // 侾夞偩偗彂偒崬傒 + public const int CHEAT_TYPE_GREATER = 2; // 僨乕僞傛傝戝偒偄帪 + public const int CHEAT_TYPE_LESS = 3; // 僨乕僞傛傝彫偝偄帪 + + // 僨乕僞挿 + public const int CHEAT_LENGTH_1BYTE = 0; + public const int CHEAT_LENGTH_2BYTE = 1; + public const int CHEAT_LENGTH_3BYTE = 2; + public const int CHEAT_LENGTH_4BYTE = 3; + + public byte enable; + public byte type; + public byte length; + public ushort address; + public uint data; + + public string comment; + } + + class GENIECODE + { + public ushort address; + public byte data; + public byte cmp; + }; +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Cheat.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Cheat.cs.meta new file mode 100644 index 0000000..6f40389 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Cheat.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5494fe2d7f568c5498880bcb5625e21e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs.meta new file mode 100644 index 0000000..7a2e409 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7b37fc906e6cec64eb2608762f7f80bf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/ByteArrayRef.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/ByteArrayRef.cs new file mode 100644 index 0000000..37a4905 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/ByteArrayRef.cs @@ -0,0 +1,66 @@ +using System; + +namespace VirtualNes.Core +{ + public class ArrayRef + { + private T[] m_rawArray; + private int m_offset; + private int m_length; + + public int Offset + { + get => m_offset; + set + { + var gap = value - m_offset; + m_length -= gap; + } + } + + public ArrayRef() { } + public ArrayRef(T[] array, int offset, int length) + { + SetArray(array, offset, length); + } + + public ArrayRef(T[] array) : this(array, 0, array.Length) { } + public ArrayRef(T[] array, int offset) : this(array, offset, array.Length - offset) { } + + public void SetArray(T[] array, int offset, int length) + { + m_rawArray = array; + m_offset = offset; + m_length = length; + } + + public void SetArray(T[] array, int offset) + { + m_rawArray = array; + m_offset = offset; + m_length = array.Length - offset; + } + + public T this[int index] + { + get + { + return m_rawArray[m_offset + index]; + } + set + { + m_rawArray[(m_offset + index)] = value; + } + } + + public static implicit operator ArrayRef(T[] array) + { + return new ArrayRef(array); + } + + public static implicit operator Span(ArrayRef array) + { + return new Span(array.m_rawArray, array.Offset, array.m_length); + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/ByteArrayRef.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/ByteArrayRef.cs.meta new file mode 100644 index 0000000..eba7e42 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/ByteArrayRef.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fe59f85b299db6f498a7e87a5125df58 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/CRC.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/CRC.cs new file mode 100644 index 0000000..d111289 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/CRC.cs @@ -0,0 +1,87 @@ +using System; + +namespace VirtualNes.Core +{ + public static class CRC + { + const int CHAR_BIT = 8; + const uint CRCPOLY1 = 0x04C11DB7U; + const uint CRCPOLY2 = 0xEDB88320U; + + static bool m_Init; + static bool m_InitRev; + static uint[] m_CrcTable = new uint[byte.MaxValue + 1]; + static uint[] m_CrcTableRev = new uint[byte.MaxValue + 1]; + + public static ulong Crc(int size, Span c) + { + if (!m_Init) + { + MakeTable(); + m_Init = true; + } + + ulong r = 0xFFFFFFFFUL; + int step = 0; + while (--size >= 0) + { + r = (r << CHAR_BIT) ^ m_CrcTable[(byte)(r >> (32 - CHAR_BIT)) ^ c[step]]; + step++; + } + return ~r & 0xFFFFFFFFUL; + } + public static uint CrcRev(int size, Span c) + { + if (!m_InitRev) + { + MakeTableRev(); + m_InitRev = true; + } + + uint r = 0xFFFFFFFFU; + int step = 0; + while (--size >= 0) + { + r = (r >> CHAR_BIT) ^ m_CrcTableRev[(byte)r ^ c[step]]; + step++; + } + return r ^ 0xFFFFFFFFU; + } + + static void MakeTable() + { + int i, j; + uint r; + + for (i = 0; i <= byte.MaxValue; i++) + { + r = (uint)i << (32 - CHAR_BIT); + for (j = 0; j < CHAR_BIT; j++) + { + if ((r & 0x80000000UL) > 0) r = (r << 1) ^ CRCPOLY1; + else r <<= 1; + } + m_CrcTable[i] = r & 0xFFFFFFFFU; + } + + } + static void MakeTableRev() + { + int i, j; + uint r; + + for (i = 0; i <= byte.MaxValue; i++) + { + r = (uint)i; + for (j = 0; j < CHAR_BIT; j++) + { + if ((r & 1) > 0) r = (r >> 1) ^ CRCPOLY2; + else r >>= 1; + } + m_CrcTableRev[i] = r; + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/CRC.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/CRC.cs.meta new file mode 100644 index 0000000..e8aecd4 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/CRC.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e1939f721bc0cab42add18338dbff333 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/Emu2413.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/Emu2413.meta new file mode 100644 index 0000000..3a84c86 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/Emu2413.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d5b90f721bfc1ac4ea985c0f564d1c6e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/Emu2413/Emu2413.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/Emu2413/Emu2413.cs new file mode 100644 index 0000000..0c1b79b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/Emu2413/Emu2413.cs @@ -0,0 +1,1545 @@ +using System; +using System.Runtime.ConstrainedExecution; +//using System.Runtime.Remoting.Lifetime; +namespace VirtualNes.Core.Emu2413 +{ + public static class Emu2413API + { + static sbyte[][] default_inst = Const.Create_Default_Inst(); + + public const int OPLL_TONE_NUM = 2; + + /* Size of Sintable ( 1 -- 18 can be used, but 7 -- 14 recommended.)*/ + public const int PG_BITS = 9; + public const int PG_WIDTH = (1 << PG_BITS); + + /* Phase increment counter */ + public const int DP_BITS = 18; + public const int DP_WIDTH = (1 << DP_BITS); + public const int DP_BASE_BITS = (DP_BITS - PG_BITS); + + /* Dynamic range */ + public const double DB_STEP = 0.375; + public const int DB_BITS = 7; + public const int DB_MUTE = (1 << DB_BITS); + + /* Dynamic range of envelope */ + public const double EG_STEP = 0.375; + public const int EG_BITS = 7; + //public const int EG_MUTE = (1 << EB_BITS); ?? 原文如此 EB_BITS 根本不存在 + public const int EG_MUTE = (1 << EG_BITS); + + /* Dynamic range of total level */ + public const double TL_STEP = 0.75; + public const int TL_BITS = 6; + public const int TL_MUTE = (1 << TL_BITS); + + /* Dynamic range of sustine level */ + public const double SL_STEP = 3.0; + public const int SL_BITS = 4; + public const int SL_MUTE = (1 << SL_BITS); + + static int EG2DB(int d) + { + return (d * (int)(EG_STEP / DB_STEP)); + } + + static uint TL2EG(int d) + { + return (uint)(d * (int)(TL_STEP / EG_STEP)); + } + + static int SL2EG(int d) + { + return (d * (int)(SL_STEP / EG_STEP)); + } + + /* Volume of Noise (dB) */ + public const double DB_NOISE = 24; + + static uint DB_POS(double x) + { + return (uint)(x / DB_STEP); + } + + static uint DB_NEG(double x) + { + return (uint)(DB_MUTE + DB_MUTE + x / DB_STEP); + } + + /* Bits for liner value */ + public const int DB2LIN_AMP_BITS = 10; + public const int SLOT_AMP_BITS = (DB2LIN_AMP_BITS); + + /* Bits for envelope phase incremental counter */ + public const int EG_DP_BITS = 22; + public const int EG_DP_WIDTH = (1 << EG_DP_BITS); + + /* Bits for Pitch and Amp modulator */ + public const int PM_PG_BITS = 8; + public const int PM_PG_WIDTH = 1 << PM_PG_BITS; + public const int PM_DP_BITS = 16; + public const int PM_DP_WIDTH = (1 << PM_DP_BITS); + public const int AM_PG_BITS = 8; + public const int AM_PG_WIDTH = (1 << AM_PG_BITS); + public const int AM_DP_BITS = 16; + public const int AM_DP_WIDTH = (1 << AM_DP_BITS); + + /* Mask */ + static int OPLL_MASK_CH(int x) + { + return 1 << x; + } + public const int OPLL_MASK_HH = 1 << 9; + public const int OPLL_MASK_CYM = (1 << (10)); + public const int OPLL_MASK_TOM = (1 << (11)); + public const int OPLL_MASK_SD = (1 << (12)); + public const int OPLL_MASK_BD = (1 << (13)); + public const int OPLL_MASK_RYTHM = OPLL_MASK_HH | OPLL_MASK_CYM | OPLL_MASK_TOM | OPLL_MASK_SD | OPLL_MASK_BD; + + /* PM table is calcurated by PM_AMP * pow(2,PM_DEPTH*sin(x)/1200) */ + public const int PM_AMP_BITS = 8; + public const int PM_AMP = (1 << PM_AMP_BITS); + + /* PM speed(Hz) and depth(cent) */ + public const double PM_SPEED = 6.4d; + public const double PM_DEPTH = 13.75d; + + /* AM speed(Hz) and depth(dB) */ + public const double AM_SPEED = 3.7; + public const double AM_DEPTH = 4.8; + + /* Cut the lower b bit(s) off. */ + static int HIGHBITS(int c, int b) + { + return c >> b; + } + + /* Leave the lower b bit(s). */ + static int LOWBITS(int c, int b) + { + return c & ((1 << b) - 1); + } + + /* Expand x which is s bits to d bits. */ + static int EXPAND_BITS(int x, int s, int d) + { + return (x << (d - s)); + } + + /* Expand x which is s bits to d bits and fill expanded bits '1' */ + static int EXPAND_BITS_X(int x, int s, int d) + { + return ((x << (d - s)) | ((1 << (d - s)) - 1)); + } + + /* Adjust envelope speed which depends on sampling rate. */ + static uint rate_adjust(int x) + { + return (uint)((double)x * clk / 72 / rate + 0.5); /* +0.5 to round */ + } + + static OPLL_SLOT MOD(this OPLL opll, int x) + { + return opll.ch[x].mod; + } + static OPLL_SLOT CAR(this OPLL opll, int x) + { + return opll.ch[x].car; + } + + /* Sampling rate */ + static uint rate; + /* Input clock */ + static uint clk; + + /* WaveTable for each envelope amp */ + static uint[] fullsintable = new uint[PG_WIDTH]; + static uint[] halfsintable = new uint[PG_WIDTH]; + static uint[] snaretable = new uint[PG_WIDTH]; + + static int[] noiseAtable = new int[64] + { + -1,1,0,-1,1,0,0,-1,1,0,0,-1,1,0,0,-1,1,0,0,-1,1,0,0,-1,1,0,0,-1,1,0,0, + -1,1,0,0,0,-1,1,0,0,-1,1,0,0,-1,1,0,0,-1,1,0,0,-1,1,0,0,-1,1,0,0,-1,1,0,0 + }; + + static int[] noiseBtable = new int[8] + { + -1,1,-1,1,0,0,0,0 + }; + + static uint[][] waveform = new uint[5][] + { + fullsintable, halfsintable,snaretable,null,null + }; + + /* Noise and LFO */ + static uint pm_dphase; + static uint am_dphase; + + /* dB to Liner table */ + static int[] DB2LIN_TABLE = new int[(DB_MUTE + DB_MUTE) * 2]; + + /* Liner to Log curve conversion table (for Attack rate). */ + static uint[] AR_ADJUST_TABLE = new uint[1 << EG_BITS]; + + /* Empty voice data */ + static OPLL_PATCH null_patch = new OPLL_PATCH(); + + /* Basic voice Data */ + static OPLL_PATCH[][] default_patch = Const.Create_Default_Patch(); + + /* Definition of envelope mode */ + enum EnvelopeMode { SETTLE, ATTACK, DECAY, SUSHOLD, SUSTINE, RELEASE, FINISH }; + + /* Phase incr table for Attack */ + static uint[][] dphaseARTable = new uint[16][] + { + new uint[16],new uint[16],new uint[16],new uint[16],new uint[16], + new uint[16],new uint[16],new uint[16],new uint[16],new uint[16], + new uint[16],new uint[16],new uint[16],new uint[16],new uint[16], + new uint[16], + }; + /* Phase incr table for Decay and Release */ + static uint[][] dphaseDRTable = new uint[16][] + { + new uint[16],new uint[16],new uint[16],new uint[16],new uint[16], + new uint[16],new uint[16],new uint[16],new uint[16],new uint[16], + new uint[16],new uint[16],new uint[16],new uint[16],new uint[16], + new uint[16], + }; + + /* KSL + TL Table */ + static uint[,,,] tllTable = Const.Create_tllTable(); + static int[,,] rksTable = Const.Create_rksTable(); + + /* Phase incr table for PG */ + static uint[,,] dphaseTable = Const.Create_dphaseTable(); + + public const int OPLL_2413_TONE = 0; + public const int OPLL_VRC7_TONE = 1; + + static int[] pmtable = new int[PM_PG_WIDTH]; + static int[] amtable = new int[AM_PG_WIDTH]; + + static int Min(int i, int j) + { + if (i < j) return i; else return j; + } + + /* Table for AR to LogCurve. */ + static void makeAdjustTable() + { + int i; + + AR_ADJUST_TABLE[0] = (1 << EG_BITS); + for (i = 1; i < 128; i++) + AR_ADJUST_TABLE[i] = (uint)((double)(1 << EG_BITS) - 1 - (1 << EG_BITS) * Math.Log(i) / Math.Log(128)); + } + + /* Table for dB(0 -- (1<= DB_MUTE) DB2LIN_TABLE[i] = 0; + DB2LIN_TABLE[i + DB_MUTE + DB_MUTE] = -DB2LIN_TABLE[i]; + } + } + + /* Liner(+0.0 - +1.0) to dB((1< 0) noiseAtable[i] = (int)DB_POS(0); + else if (noiseAtable[i] < 0) noiseAtable[i] = (int)DB_NEG(0); + else noiseAtable[i] = DB_MUTE - 1; + } + + for (i = 0; i < 8; i++) + { + if (noiseBtable[i] > 0) noiseBtable[i] = (int)DB_POS(0); + else if (noiseBtable[i] < 0) noiseBtable[i] = (int)DB_NEG(0); + else noiseBtable[i] = DB_MUTE - 1; + } + + } + + /* Table for Amp Modulator */ + static void makeAmTable() + { + int i; + + for (i = 0; i < AM_PG_WIDTH; i++) + amtable[i] = (int)((double)AM_DEPTH / 2 / DB_STEP * (1.0 + Math.Sin(2.0 * Math.PI * i / PM_PG_WIDTH))); + } + + static uint[] mltable_makeDphaseTable = new uint[16] { 1, 1 * 2, 2 * 2, 3 * 2, 4 * 2, 5 * 2, 6 * 2, 7 * 2, 8 * 2, 9 * 2, 10 * 2, 10 * 2, 12 * 2, 12 * 2, 15 * 2, 15 * 2 }; + /* Phase increment counter table */ + static void makeDphaseTable() + { + uint fnum, block, ML; + + for (fnum = 0; fnum < 512; fnum++) + for (block = 0; block < 8; block++) + for (ML = 0; ML < 16; ML++) + dphaseTable[fnum, block, ML] = rate_adjust((int)((fnum * mltable_makeDphaseTable[ML]) << (int)block) >> (20 - DP_BITS)); + } + + static uint dB2(double x) + { + return (uint)(x * 2); + } + + static uint[] kltable = new uint[16] + { + dB2( 0.000),dB2( 9.000),dB2(12.000),dB2(13.875),dB2(15.000),dB2(16.125),dB2(16.875),dB2(17.625), + dB2(18.000),dB2(18.750),dB2(19.125),dB2(19.500),dB2(19.875),dB2(20.250),dB2(20.625),dB2(21.000) + }; + + static void makeTllTable() + { + int tmp; + int fnum, block, TL, KL; + + for (fnum = 0; fnum < 16; fnum++) + for (block = 0; block < 8; block++) + for (TL = 0; TL < 64; TL++) + for (KL = 0; KL < 4; KL++) + { + if (KL == 0) + { + tllTable[fnum, block, TL, KL] = TL2EG(TL); + } + else + { + tmp = (int)(kltable[fnum] - dB2(3.000) * (7 - block)); + if (tmp <= 0) + tllTable[fnum, block, TL, KL] = TL2EG(TL); + else + tllTable[fnum, block, TL, KL] = (uint)((tmp >> (3 - KL)) / EG_STEP) + TL2EG(TL); + } + } + } + + /* Rate Table for Attack */ + static void makeDphaseARTable() + { + int AR, Rks, RM, RL; + + for (AR = 0; AR < 16; AR++) + for (Rks = 0; Rks < 16; Rks++) + { + RM = AR + (Rks >> 2); + if (RM > 15) RM = 15; + RL = Rks & 3; + switch (AR) + { + case 0: + dphaseARTable[AR][Rks] = 0; + break; + case 15: + dphaseARTable[AR][Rks] = EG_DP_WIDTH; + break; + default: + dphaseARTable[AR][Rks] = rate_adjust((3 * (RL + 4) << (RM + 1))); + break; + } + } + } + + /* Rate Table for Decay */ + static void makeDphaseDRTable() + { + int DR, Rks, RM, RL; + + for (DR = 0; DR < 16; DR++) + for (Rks = 0; Rks < 16; Rks++) + { + RM = DR + (Rks >> 2); + RL = Rks & 3; + if (RM > 15) RM = 15; + switch (DR) + { + case 0: + dphaseDRTable[DR][Rks] = 0; + break; + default: + dphaseDRTable[DR][Rks] = rate_adjust((RL + 4) << (RM - 1)); + break; + } + } + } + + static void makeRksTable() + { + + int fnum8, block, KR; + + for (fnum8 = 0; fnum8 < 2; fnum8++) + for (block = 0; block < 8; block++) + for (KR = 0; KR < 2; KR++) + { + if (KR != 0) + rksTable[fnum8, block, KR] = (block << 1) + fnum8; + else + rksTable[fnum8, block, KR] = block >> 1; + } + } + + private static void makePmTable() + { + int i; + + for (i = 0; i < PM_PG_WIDTH; i++) + pmtable[i] = (int)(PM_AMP * Math.Pow(2, PM_DEPTH * Math.Sin(2.0 * Math.PI * i / PM_PG_WIDTH) / 1200)); + } + + static void dump2patch(ArrayRef dump, ArrayRef patch) + { + patch[0].AM = (uint)((dump[0] >> 7) & 1); + patch[1].AM = (uint)((dump[1] >> 7) & 1); + patch[0].PM = (uint)((dump[0] >> 6) & 1); + patch[1].PM = (uint)((dump[1] >> 6) & 1); + patch[0].EG = (uint)((dump[0] >> 5) & 1); + patch[1].EG = (uint)((dump[1] >> 5) & 1); + patch[0].KR = (uint)((dump[0] >> 4) & 1); + patch[1].KR = (uint)((dump[1] >> 4) & 1); + patch[0].ML = (uint)((dump[0]) & 15); + patch[1].ML = (uint)((dump[1]) & 15); + patch[0].KL = (uint)((dump[2] >> 6) & 3); + patch[1].KL = (uint)((dump[3] >> 6) & 3); + patch[0].TL = (uint)((dump[2]) & 63); + patch[0].FB = (uint)((dump[3]) & 7); + patch[0].WF = (uint)((dump[3] >> 3) & 1); + patch[1].WF = (uint)((dump[3] >> 4) & 1); + patch[0].AR = (uint)((dump[4] >> 4) & 15); + patch[1].AR = (uint)((dump[5] >> 4) & 15); + patch[0].DR = (uint)((dump[4]) & 15); + patch[1].DR = (uint)((dump[5]) & 15); + patch[0].SL = (uint)((dump[6] >> 4) & 15); + patch[1].SL = (uint)((dump[7] >> 4) & 15); + patch[0].RR = (uint)((dump[6]) & 15); + patch[1].RR = (uint)((dump[7]) & 15); + } + + static ArrayRef instSpan = new ArrayRef(); + static ArrayRef patchSpan = new ArrayRef(); + static void makeDefaultPatch() + { + int i, j; + + for (i = 0; i < OPLL_TONE_NUM; i++) + for (j = 0; j < 19; j++) + { + instSpan.SetArray(default_inst[i], j * 16); + patchSpan.SetArray(default_patch[i], j * 2); + dump2patch(instSpan, patchSpan); + } + } + + static uint calc_eg_dphase(OPLL_SLOT slot) + { + + switch ((EnvelopeMode)slot.eg_mode) + { + case EnvelopeMode.ATTACK: + return dphaseARTable[slot.patch.AR][slot.rks]; + + case EnvelopeMode.DECAY: + return dphaseDRTable[slot.patch.DR][slot.rks]; + + case EnvelopeMode.SUSHOLD: + return 0; + + case EnvelopeMode.SUSTINE: + return dphaseDRTable[slot.patch.RR][slot.rks]; + + case EnvelopeMode.RELEASE: + if (slot.sustine != 0) + return dphaseDRTable[5][slot.rks]; + else if (slot.patch.EG != 0) + return dphaseDRTable[slot.patch.RR][slot.rks]; + else + return dphaseDRTable[7][slot.rks]; + + case EnvelopeMode.FINISH: + return 0; + + default: + return 0; + } + } + + public const int SLOT_BD1 = 12; + public const int SLOT_BD2 = 13; + public const int SLOT_HH = 14; + public const int SLOT_SD = 15; + public const int SLOT_TOM = 16; + public const int SLOT_CYM = 17; + + static void UPDATE_PG(OPLL_SLOT S) + { + S.dphase = dphaseTable[S.fnum, S.block, S.patch.ML]; + } + + static void UPDATE_TLL(OPLL_SLOT S) + { + if (S.type == 0) + { + S.tll = tllTable[S.fnum >> 5, S.block, S.patch.TL, S.patch.KL]; + } + else + { + S.tll = tllTable[S.fnum >> 5, S.block, S.volume, S.patch.KL]; + } + } + + static void UPDATE_RKS(OPLL_SLOT S) + { + S.rks = (uint)rksTable[(S.fnum) >> 8, S.block, S.patch.KR]; + } + + static void UPDATE_WF(OPLL_SLOT S) + { + S.sintbl = waveform[S.patch.WF]; + } + + static void UPDATE_EG(OPLL_SLOT S) + { + S.eg_dphase = calc_eg_dphase(S); + } + + static void UPDATE_ALL(OPLL_SLOT S) + { + UPDATE_PG(S); + UPDATE_TLL(S); + UPDATE_RKS(S); + UPDATE_WF(S); + UPDATE_EG(S); /* G should be last */ + } + + /* Force Refresh (When external program changes some parameters). */ + static void OPLL_forceRefresh(OPLL opll) + { + int i; + + if (opll == null) return; + + for (i = 0; i < 18; i++) + { + UPDATE_PG(opll.slot[i]); + UPDATE_RKS(opll.slot[i]); + UPDATE_TLL(opll.slot[i]); + UPDATE_WF(opll.slot[i]); + UPDATE_EG(opll.slot[i]); + } + } + + /* Slot key on */ + static void slotOn(OPLL_SLOT slot) + { + slot.eg_mode = (int)EnvelopeMode.ATTACK; + slot.phase = 0; + slot.eg_phase = 0; + } + + /* Slot key off */ + static void slotOff(OPLL_SLOT slot) + { + if (slot.eg_mode == (int)EnvelopeMode.ATTACK) + slot.eg_phase = (uint)EXPAND_BITS((int)AR_ADJUST_TABLE[HIGHBITS((int)slot.eg_phase, EG_DP_BITS - EG_BITS)], EG_BITS, EG_DP_BITS); + slot.eg_mode = (int)EnvelopeMode.RELEASE; + } + + /* Channel key on */ + static void keyOn(OPLL opll, int i) + { + if (opll.slot_on_flag[i * 2] == 0) slotOn(opll.MOD(i)); + if (opll.slot_on_flag[i * 2 + 1] == 0) slotOn(opll.CAR(i)); + opll.ch[i].key_status = 1; + } + + static void keyOff(OPLL opll, int i) + { + if (opll.slot_on_flag[i * 2 + 1] != 0) slotOff(opll.CAR(i)); + opll.ch[i].key_status = 0; + } + + static void keyOn_BD(OPLL opll) { keyOn(opll, 6); } + static void keyOn_SD(OPLL opll) { if (opll.slot_on_flag[SLOT_SD] == 0) slotOn(opll.CAR(7)); } + static void keyOn_TOM(OPLL opll) { if (opll.slot_on_flag[SLOT_TOM] == 0) slotOn(opll.MOD(8)); } + static void keyOn_HH(OPLL opll) { if (opll.slot_on_flag[SLOT_HH] == 0) slotOn(opll.MOD(7)); } + static void keyOn_CYM(OPLL opll) { if (opll.slot_on_flag[SLOT_CYM] == 0) slotOn(opll.CAR(8)); } + + /* Drum key off */ + + static void keyOff_BD(OPLL opll) { keyOff(opll, 6); } + static void keyOff_SD(OPLL opll) { if (opll.slot_on_flag[SLOT_SD] != 0) slotOff(opll.CAR(7)); } + static void keyOff_TOM(OPLL opll) { if (opll.slot_on_flag[SLOT_TOM] != 0) slotOff(opll.MOD(8)); } + static void keyOff_HH(OPLL opll) { if (opll.slot_on_flag[SLOT_HH] != 0) slotOff(opll.MOD(7)); } + static void keyOff_CYM(OPLL opll) { if (opll.slot_on_flag[SLOT_CYM] != 0) slotOff(opll.CAR(8)); } + + /* Change a voice */ + static void setPatch(OPLL opll, int i, int num) + { + opll.ch[i].patch_number = num; + opll.MOD(i).patch = opll.patch[num * 2 + 0]; + opll.CAR(i).patch = opll.patch[num * 2 + 1]; + } + + /* Change a rythm voice */ + static void setSlotPatch(OPLL_SLOT slot, OPLL_PATCH patch) + { + slot.patch = patch; + } + + /* Set sustine parameter */ + static void setSustine(OPLL opll, int c, int sustine) + { + opll.CAR(c).sustine = sustine; + if (opll.MOD(c).type != 0) opll.MOD(c).sustine = sustine; + } + + /* Volume : 6bit ( Volume register << 2 ) */ + static void setVolume(OPLL opll, int c, int volume) + { + opll.CAR(c).volume = volume; + } + + static void setSlotVolume(OPLL_SLOT slot, int volume) + { + slot.volume = volume; + } + + /* Set F-Number ( fnum : 9bit ) */ + static void setFnumber(OPLL opll, int c, int fnum) + { + opll.CAR(c).fnum = fnum; + opll.MOD(c).fnum = fnum; + } + + /* Set Block data (block : 3bit ) */ + static void setBlock(OPLL opll, int c, int block) + { + opll.CAR(c).block = block; + opll.MOD(c).block = block; + } + + /* Change Rythm Mode */ + static void setRythmMode(OPLL opll, int mode) + { + opll.rythm_mode = mode; + + if (mode != 0) + { + opll.ch[6].patch_number = 16; + opll.ch[7].patch_number = 17; + opll.ch[8].patch_number = 18; + setSlotPatch(opll.slot[SLOT_BD1], opll.patch[16 * 2 + 0]); + setSlotPatch(opll.slot[SLOT_BD2], opll.patch[16 * 2 + 1]); + setSlotPatch(opll.slot[SLOT_HH], opll.patch[17 * 2 + 0]); + setSlotPatch(opll.slot[SLOT_SD], opll.patch[17 * 2 + 1]); + opll.slot[SLOT_HH].type = 1; + setSlotPatch(opll.slot[SLOT_TOM], opll.patch[18 * 2 + 0]); + setSlotPatch(opll.slot[SLOT_CYM], opll.patch[18 * 2 + 1]); + opll.slot[SLOT_TOM].type = 1; + } + else + { + setPatch(opll, 6, opll.reg[0x36] >> 4); + setPatch(opll, 7, opll.reg[0x37] >> 4); + opll.slot[SLOT_HH].type = 0; + setPatch(opll, 8, opll.reg[0x38] >> 4); + opll.slot[SLOT_TOM].type = 0; + } + + if (opll.slot_on_flag[SLOT_BD1] == 0) + opll.slot[SLOT_BD1].eg_mode = (int)EnvelopeMode.FINISH; + if (opll.slot_on_flag[SLOT_BD2] == 0) + opll.slot[SLOT_BD2].eg_mode = (int)EnvelopeMode.FINISH; + if (opll.slot_on_flag[SLOT_HH] == 0) + opll.slot[SLOT_HH].eg_mode = (int)EnvelopeMode.FINISH; + if (opll.slot_on_flag[SLOT_SD] == 0) + opll.slot[SLOT_SD].eg_mode = (int)EnvelopeMode.FINISH; + if (opll.slot_on_flag[SLOT_TOM] == 0) + opll.slot[SLOT_TOM].eg_mode = (int)EnvelopeMode.FINISH; + if (opll.slot_on_flag[SLOT_CYM] == 0) + opll.slot[SLOT_CYM].eg_mode = (int)EnvelopeMode.FINISH; + } + + static void OPLL_copyPatch(OPLL opll, int num, OPLL_PATCH patch) + { + opll.patch[num].Copy(patch); + } + + static void OPLL_SLOT_reset(OPLL_SLOT slot) + { + slot.sintbl = waveform[0]; + slot.phase = 0; + slot.dphase = 0; + slot.output[0] = 0; + slot.output[1] = 0; + slot.feedback = 0; + slot.eg_mode = (int)EnvelopeMode.SETTLE; + slot.eg_phase = EG_DP_WIDTH; + slot.eg_dphase = 0; + slot.rks = 0; + slot.tll = 0; + slot.sustine = 0; + slot.fnum = 0; + slot.block = 0; + slot.volume = 0; + slot.pgout = 0; + slot.egout = 0; + slot.patch = null_patch; + } + + static OPLL_SLOT OPLL_SLOT_new() + { + OPLL_SLOT slot; + slot = new OPLL_SLOT(); + + return slot; + } + + static void OPLL_SLOT_delete(OPLL_SLOT slot) + { + //free(slot); // c# just do nothing + } + + static void OPLL_CH_reset(OPLL_CH ch) + { + if (ch.mod != null) OPLL_SLOT_reset(ch.mod); + if (ch.car != null) OPLL_SLOT_reset(ch.car); + ch.key_status = 0; + } + + static OPLL_CH OPLL_CH_new() + { + OPLL_CH ch; + OPLL_SLOT mod, car; + + mod = OPLL_SLOT_new(); + if (mod == null) return null; + + car = OPLL_SLOT_new(); + if (car == null) + { + OPLL_SLOT_delete(mod); + return null; + } + + ch = new OPLL_CH(); + if (ch == null) + { + OPLL_SLOT_delete(mod); + OPLL_SLOT_delete(car); + return null; + } + + mod.type = 0; + car.type = 1; + ch.mod = mod; + ch.car = car; + + return ch; + } + + static void OPLL_CH_delete(OPLL_CH ch) + { + OPLL_SLOT_delete(ch.mod); + OPLL_SLOT_delete(ch.car); + //free(ch); C# just do nothing + } + + public static OPLL OPLL_new() + { + OPLL opll; + OPLL_CH[] ch = new OPLL_CH[9]; + OPLL_PATCH[] patch = new OPLL_PATCH[19 * 2]; + int i, j; + + for (i = 0; i < 19 * 2; i++) + { + patch[i] = new OPLL_PATCH(); + } + + for (i = 0; i < 9; i++) + { + ch[i] = OPLL_CH_new(); + } + + opll = new OPLL(); + + for (i = 0; i < 19 * 2; i++) + opll.patch[i] = patch[i]; + + + for (i = 0; i < 9; i++) + { + opll.ch[i] = ch[i]; + opll.slot[i * 2 + 0] = opll.ch[i].mod; + opll.slot[i * 2 + 1] = opll.ch[i].car; + } + + for (i = 0; i < 18; i++) + { + opll.slot[i].SetHost(opll); + } + + opll.mask = 0; + + OPLL_reset(opll); + OPLL_reset_patch(opll, 0); + + opll.masterVolume = 32; + + return opll; + } + + public static void OPLL_delete(OPLL opll) + { + int i; + + for (i = 0; i < 9; i++) + OPLL_CH_delete(opll.ch[i]); + + //for (i = 0; i < 19 * 2; i++) + // free(opll->patch[i]); + + //free(opll); + } + + /* Reset patch datas by system default. */ + public static void OPLL_reset_patch(OPLL opll, int type) + { + int i; + + for (i = 0; i < 19 * 2; i++) + OPLL_copyPatch(opll, i, default_patch[type % OPLL_TONE_NUM][i]); + } + + /* Reset whole of OPLL except patch datas. */ + public static void OPLL_reset(OPLL opll) + { + int i; + + if (opll == null) return; + + opll.adr = 0; + + opll.output[0] = 0; + opll.output[1] = 0; + + opll.pm_phase = 0; + opll.am_phase = 0; + + opll.noise_seed = 0xffff; + opll.noiseA = 0; + opll.noiseB = 0; + opll.noiseA_phase = 0; + opll.noiseB_phase = 0; + opll.noiseA_dphase = 0; + opll.noiseB_dphase = 0; + opll.noiseA_idx = 0; + opll.noiseB_idx = 0; + + for (i = 0; i < 9; i++) + { + OPLL_CH_reset(opll.ch[i]); + setPatch(opll, i, 0); + } + + for (i = 0; i < 0x40; i++) OPLL_writeReg(opll, (uint)i, 0); + } + + public static void OPLL_setClock(uint c, uint r) + { + clk = c; + rate = r; + makeDphaseTable(); + makeDphaseARTable(); + makeDphaseDRTable(); + pm_dphase = rate_adjust((int)(PM_SPEED * PM_DP_WIDTH / (clk / 72))); + am_dphase = rate_adjust((int)(AM_SPEED * AM_DP_WIDTH / (clk / 72))); + } + + public static void OPLL_init(uint c, uint r) + { + makePmTable(); + makeAmTable(); + makeDB2LinTable(); + makeAdjustTable(); + makeTllTable(); + makeRksTable(); + makeSinTable(); + makeDefaultPatch(); + OPLL_setClock(c, r); + } + static void OPLL_close() + { + } + + static int wave2_2pi(int e) + { + return (e) >> (SLOT_AMP_BITS - PG_BITS); + } + + static int wave2_4pi(int e) + { + return e; + } + + static int wave2_8pi(int e) + { + return (e) << (2 + PG_BITS - SLOT_AMP_BITS); + } + + /* 16bit rand */ + static uint mrand(uint seed) + { + return ((seed >> 15) ^ ((seed >> 12) & 1)) | ((seed << 1) & 0xffff); + } + + static uint DEC(uint db) + { + if (db < DB_MUTE + DB_MUTE) + { + return (uint)Min((int)(db + DB_POS(0.375 * 2)), DB_MUTE - 1); + } + else + { + return (uint)Min((int)(db + DB_POS(0.375 * 2)), DB_MUTE + DB_MUTE + DB_MUTE - 1); + } + } + + /* Update Noise unit */ + static void update_noise(OPLL opll) + { + opll.noise_seed = mrand(opll.noise_seed); + opll.whitenoise = opll.noise_seed & 1; + + opll.noiseA_phase = (opll.noiseA_phase + opll.noiseA_dphase); + opll.noiseB_phase = (opll.noiseB_phase + opll.noiseB_dphase); + + if (opll.noiseA_phase < (1 << 11)) + { + if (opll.noiseA_phase > 16) opll.noiseA = DB_MUTE - 1; + } + else + { + opll.noiseA_phase &= (1 << 11) - 1; + opll.noiseA_idx = (opll.noiseA_idx + 1) & 63; + opll.noiseA = (uint)noiseAtable[opll.noiseA_idx]; + } + + if (opll.noiseB_phase < (1 << 12)) + { + if (opll.noiseB_phase > 16) opll.noiseB = DB_MUTE - 1; + } + else + { + opll.noiseB_phase &= (1 << 12) - 1; + opll.noiseB_idx = (opll.noiseB_idx + 1) & 7; + opll.noiseB = (uint)noiseBtable[opll.noiseB_idx]; + } + } + + /* Update AM, PM unit */ + static void update_ampm(OPLL opll) + { + opll.pm_phase = (opll.pm_phase + pm_dphase) & (PM_DP_WIDTH - 1); + opll.am_phase = (int)(opll.am_phase + am_dphase) & (AM_DP_WIDTH - 1); + opll.lfo_am = amtable[HIGHBITS(opll.am_phase, AM_DP_BITS - AM_PG_BITS)]; + opll.lfo_pm = pmtable[HIGHBITS((int)(opll.pm_phase), PM_DP_BITS - PM_PG_BITS)]; + } + + /* PG */ + static uint calc_phase(OPLL_SLOT slot) + { + if (slot.patch.PM != 0) + slot.phase = (uint)(slot.phase + (slot.dphase * (slot.plfo_pm)) >> PM_AMP_BITS); + else + slot.phase += slot.dphase; + + slot.phase &= (DP_WIDTH - 1); + + return (uint)HIGHBITS((int)slot.phase, DP_BASE_BITS); + } + + static uint S2E(int x) + { + return (uint)(SL2EG((int)(x / SL_STEP)) << (EG_DP_BITS - EG_BITS)); + } + + static uint[] SL = new uint[16] + { + S2E( 0), S2E( 3), S2E( 6), S2E( 9), S2E(12), S2E(15), S2E(18), S2E(21), + S2E(24), S2E(27), S2E(30), S2E(33), S2E(36), S2E(39), S2E(42), S2E(48) + }; + + /* EG */ + static uint calc_envelope(OPLL_SLOT slot) + { + uint egout; + + switch ((EnvelopeMode)slot.eg_mode) + { + + case EnvelopeMode.ATTACK: + slot.eg_phase += slot.eg_dphase; + if ((EG_DP_WIDTH & slot.eg_phase) != 0) + { + egout = 0; + slot.eg_phase = 0; + slot.eg_mode = (int)EnvelopeMode.DECAY; + UPDATE_EG(slot); + } + else + { + egout = AR_ADJUST_TABLE[HIGHBITS((int)slot.eg_phase, EG_DP_BITS - EG_BITS)]; + } + break; + + case EnvelopeMode.DECAY: + slot.eg_phase += slot.eg_dphase; + egout = (uint)HIGHBITS((int)slot.eg_phase, EG_DP_BITS - EG_BITS); + if (slot.eg_phase >= SL[slot.patch.SL]) + { + if (slot.patch.EG != 0) + { + slot.eg_phase = SL[slot.patch.SL]; + slot.eg_mode = (int)EnvelopeMode.SUSHOLD; + UPDATE_EG(slot); + } + else + { + slot.eg_phase = SL[slot.patch.SL]; + slot.eg_mode = (int)EnvelopeMode.SUSTINE; + UPDATE_EG(slot); + } + egout = (uint)HIGHBITS((int)slot.eg_phase, EG_DP_BITS - EG_BITS); + } + break; + + case EnvelopeMode.SUSHOLD: + egout = (uint)HIGHBITS((int)slot.eg_phase, EG_DP_BITS - EG_BITS); + if (slot.patch.EG == 0) + { + slot.eg_mode = (int)EnvelopeMode.SUSTINE; + UPDATE_EG(slot); + } + break; + + case EnvelopeMode.SUSTINE: + case EnvelopeMode.RELEASE: + slot.eg_phase += slot.eg_dphase; + egout = (uint)HIGHBITS((int)slot.eg_phase, EG_DP_BITS - EG_BITS); + if (egout >= (1 << EG_BITS)) + { + slot.eg_mode = (int)EnvelopeMode.FINISH; + egout = (1 << EG_BITS) - 1; + } + break; + + case EnvelopeMode.FINISH: + egout = (1 << EG_BITS) - 1; + break; + + default: + egout = (1 << EG_BITS) - 1; + break; + } + + if (slot.patch.AM != 0) egout = (uint)(EG2DB((int)(egout + slot.tll)) + (slot.plfo_am)); + else egout = (uint)EG2DB((int)(egout + slot.tll)); + + if (egout >= DB_MUTE) egout = DB_MUTE - 1; + return egout; + } + + static int calc_slot_car(OPLL_SLOT slot, int fm) + { + slot.egout = calc_envelope(slot); + slot.pgout = calc_phase(slot); + if (slot.egout >= (DB_MUTE - 1)) return 0; + + return DB2LIN_TABLE[slot.sintbl[(slot.pgout + wave2_8pi(fm)) & (PG_WIDTH - 1)] + slot.egout]; + } + + static int calc_slot_mod(OPLL_SLOT slot) + { + int fm; + + slot.output[1] = slot.output[0]; + slot.egout = calc_envelope(slot); + slot.pgout = calc_phase(slot); + + if (slot.egout >= (DB_MUTE - 1)) + { + slot.output[0] = 0; + } + else if (slot.patch.FB != 0) + { + fm = (wave2_4pi(slot.feedback) >> (int)(7 - slot.patch.FB)); + slot.output[0] = DB2LIN_TABLE[slot.sintbl[(slot.pgout + fm) & (PG_WIDTH - 1)] + slot.egout]; + } + else + { + slot.output[0] = DB2LIN_TABLE[slot.sintbl[slot.pgout] + slot.egout]; + } + + slot.feedback = (slot.output[1] + slot.output[0]) >> 1; + + return slot.feedback; + } + + static int calc_slot_tom(OPLL_SLOT slot) + { + slot.egout = calc_envelope(slot); + slot.pgout = calc_phase(slot); + if (slot.egout >= (DB_MUTE - 1)) return 0; + + return DB2LIN_TABLE[slot.sintbl[slot.pgout] + slot.egout]; + } + + /* calc SNARE slot */ + static int calc_slot_snare(OPLL_SLOT slot, uint whitenoise) + { + slot.egout = calc_envelope(slot); + slot.pgout = calc_phase(slot); + if (slot.egout >= (DB_MUTE - 1)) return 0; + + if (whitenoise != 0) + return DB2LIN_TABLE[snaretable[slot.pgout] + slot.egout] + DB2LIN_TABLE[slot.egout + 6]; + else + return DB2LIN_TABLE[snaretable[slot.pgout] + slot.egout]; + } + + static int calc_slot_cym(OPLL_SLOT slot, int a, int b, int c) + { + slot.egout = calc_envelope(slot); + if (slot.egout >= (DB_MUTE - 1)) return 0; + + return DB2LIN_TABLE[slot.egout + a] + + ((DB2LIN_TABLE[slot.egout + b] + DB2LIN_TABLE[slot.egout + c]) >> 2); + } + + static int calc_slot_hat(OPLL_SLOT slot, int a, int b, int c, uint whitenoise) + { + slot.egout = calc_envelope(slot); + if (slot.egout >= (DB_MUTE - 1)) return 0; + + if (whitenoise != 0) + { + return DB2LIN_TABLE[slot.egout + a] + + ((DB2LIN_TABLE[slot.egout + b] + DB2LIN_TABLE[slot.egout + c]) >> 2); + } + else + { + return 0; + } + } + + public static short OPLL_calc(OPLL opll) + { + int inst = 0, perc = 0, @out = 0; + int rythmC = 0, rythmH = 0; + int i; + + update_ampm(opll); + update_noise(opll); + + for (i = 0; i < 6; i++) + if ((opll.mask & OPLL_MASK_CH(i)) == 0 && (opll.CAR(i).eg_mode != (int)EnvelopeMode.FINISH)) + inst += calc_slot_car(opll.CAR(i), calc_slot_mod(opll.MOD(i))); + + if (opll.rythm_mode == 0) + { + for (i = 6; i < 9; i++) + if ((opll.mask & OPLL_MASK_CH(i)) == 0 && (opll.CAR(i).eg_mode != (int)EnvelopeMode.FINISH)) + inst += calc_slot_car(opll.CAR(i), calc_slot_mod(opll.MOD(i))); + } + else + { + opll.MOD(7).pgout = calc_phase(opll.MOD(7)); + opll.CAR(8).pgout = calc_phase(opll.CAR(8)); + if (opll.MOD(7).phase < 256) rythmH = (int)DB_NEG(12.0); else rythmH = DB_MUTE - 1; + if (opll.CAR(8).phase < 256) rythmC = (int)DB_NEG(12.0); else rythmC = DB_MUTE - 1; + + if ((opll.mask & OPLL_MASK_BD) == 0 && (opll.CAR(6).eg_mode != (int)EnvelopeMode.FINISH)) + perc += calc_slot_car(opll.CAR(6), calc_slot_mod(opll.MOD(6))); + + if ((opll.mask & OPLL_MASK_HH) == 0 && (opll.MOD(7).eg_mode != (int)EnvelopeMode.FINISH)) + perc += calc_slot_hat(opll.MOD(7), (int)opll.noiseA, (int)opll.noiseB, rythmH, opll.whitenoise); + + if ((opll.mask & OPLL_MASK_SD) == 0 && (opll.CAR(7).eg_mode != (int)EnvelopeMode.FINISH)) + perc += calc_slot_snare(opll.CAR(7), opll.whitenoise); + + if ((opll.mask & OPLL_MASK_TOM) == 0 && (opll.MOD(8).eg_mode != (int)EnvelopeMode.FINISH)) + perc += calc_slot_tom(opll.MOD(8)); + + if ((opll.mask & OPLL_MASK_CYM) == 0 && (opll.CAR(8).eg_mode != (int)EnvelopeMode.FINISH)) + perc += calc_slot_cym(opll.CAR(8), (int)opll.noiseA, (int)opll.noiseB, rythmC); + } + + inst = (inst >> (SLOT_AMP_BITS - 8)); + perc = (perc >> (SLOT_AMP_BITS - 9)); + + @out = ((inst + perc) * opll.masterVolume) >> 2; + + if (@out > 32767) return 32767; + if (@out < -32768) return -32768; + + return (short)@out; + } + + static uint OPLL_setMask(OPLL opll, uint mask) + { + uint ret; + + if (opll != null) + { + ret = opll.mask; + opll.mask = mask; + return ret; + } + else return 0; + } + + static uint OPLL_toggleMask(OPLL opll, uint mask) + { + uint ret; + + if (opll != null) + { + ret = opll.mask; + opll.mask ^= mask; + return ret; + } + else return 0; + } + + public static void OPLL_writeReg(OPLL opll, uint reg, uint data) + { + + int i, v, ch; + + data = data & 0xff; + reg = reg & 0x3f; + + switch (reg) + { + case 0x00: + opll.patch[0].AM = (data >> 7) & 1; + opll.patch[0].PM = (data >> 6) & 1; + opll.patch[0].EG = (data >> 5) & 1; + opll.patch[0].KR = (data >> 4) & 1; + opll.patch[0].ML = (data) & 15; + for (i = 0; i < 9; i++) + { + if (opll.ch[i].patch_number == 0) + { + UPDATE_PG(opll.MOD(i)); + UPDATE_RKS(opll.MOD(i)); + UPDATE_EG(opll.MOD(i)); + } + } + break; + + case 0x01: + opll.patch[1].AM = (data >> 7) & 1; + opll.patch[1].PM = (data >> 6) & 1; + opll.patch[1].EG = (data >> 5) & 1; + opll.patch[1].KR = (data >> 4) & 1; + opll.patch[1].ML = (data) & 15; + for (i = 0; i < 9; i++) + { + if (opll.ch[i].patch_number == 0) + { + UPDATE_PG(opll.CAR(i)); + UPDATE_RKS(opll.CAR(i)); + UPDATE_EG(opll.CAR(i)); + } + } + break; + + case 0x02: + opll.patch[0].KL = (data >> 6) & 3; + opll.patch[0].TL = (data) & 63; + for (i = 0; i < 9; i++) + { + if (opll.ch[i].patch_number == 0) + { + UPDATE_TLL(opll.MOD(i)); + } + } + break; + + case 0x03: + opll.patch[1].KL = (data >> 6) & 3; + opll.patch[1].WF = (data >> 4) & 1; + opll.patch[0].WF = (data >> 3) & 1; + opll.patch[0].FB = (data) & 7; + for (i = 0; i < 9; i++) + { + if (opll.ch[i].patch_number == 0) + { + UPDATE_WF(opll.MOD(i)); + UPDATE_WF(opll.CAR(i)); + } + } + break; + + case 0x04: + opll.patch[0].AR = (data >> 4) & 15; + opll.patch[0].DR = (data) & 15; + for (i = 0; i < 9; i++) + { + if (opll.ch[i].patch_number == 0) + { + UPDATE_EG(opll.MOD(i)); + } + } + break; + + case 0x05: + opll.patch[1].AR = (data >> 4) & 15; + opll.patch[1].DR = (data) & 15; + for (i = 0; i < 9; i++) + { + if (opll.ch[i].patch_number == 0) + { + UPDATE_EG(opll.CAR(i)); + } + } + break; + + case 0x06: + opll.patch[0].SL = (data >> 4) & 15; + opll.patch[0].RR = (data) & 15; + for (i = 0; i < 9; i++) + { + if (opll.ch[i].patch_number == 0) + { + UPDATE_EG(opll.MOD(i)); + } + } + break; + + case 0x07: + opll.patch[1].SL = (data >> 4) & 15; + opll.patch[1].RR = (data) & 15; + for (i = 0; i < 9; i++) + { + if (opll.ch[i].patch_number == 0) + { + UPDATE_EG(opll.CAR(i)); + } + } + break; + + case 0x0e: + + if (opll.rythm_mode != 0) + { + opll.slot_on_flag[SLOT_BD1] = (opll.reg[0x0e] & 0x10) | (opll.reg[0x26] & 0x10); + opll.slot_on_flag[SLOT_BD2] = (opll.reg[0x0e] & 0x10) | (opll.reg[0x26] & 0x10); + opll.slot_on_flag[SLOT_SD] = (opll.reg[0x0e] & 0x08) | (opll.reg[0x27] & 0x10); + opll.slot_on_flag[SLOT_HH] = (opll.reg[0x0e] & 0x01) | (opll.reg[0x27] & 0x10); + opll.slot_on_flag[SLOT_TOM] = (opll.reg[0x0e] & 0x04) | (opll.reg[0x28] & 0x10); + opll.slot_on_flag[SLOT_CYM] = (opll.reg[0x0e] & 0x02) | (opll.reg[0x28] & 0x10); + } + else + { + opll.slot_on_flag[SLOT_BD1] = (opll.reg[0x26] & 0x10); + opll.slot_on_flag[SLOT_BD2] = (opll.reg[0x26] & 0x10); + opll.slot_on_flag[SLOT_SD] = (opll.reg[0x27] & 0x10); + opll.slot_on_flag[SLOT_HH] = (opll.reg[0x27] & 0x10); + opll.slot_on_flag[SLOT_TOM] = (opll.reg[0x28] & 0x10); + opll.slot_on_flag[SLOT_CYM] = (opll.reg[0x28] & 0x10); + } + + if ((((data >> 5) & 1) ^ (opll.rythm_mode)) != 0) + { + setRythmMode(opll, (int)(data & 32) >> 5); + } + + if (opll.rythm_mode != 0) + { + if ((data & 0x10) != 0) keyOn_BD(opll); else keyOff_BD(opll); + if ((data & 0x8) != 0) keyOn_SD(opll); else keyOff_SD(opll); + if ((data & 0x4) != 0) keyOn_TOM(opll); else keyOff_TOM(opll); + if ((data & 0x2) != 0) keyOn_CYM(opll); else keyOff_CYM(opll); + if ((data & 0x1) != 0) keyOn_HH(opll); else keyOff_HH(opll); + } + + UPDATE_ALL(opll.MOD(6)); + UPDATE_ALL(opll.CAR(6)); + UPDATE_ALL(opll.MOD(7)); + UPDATE_ALL(opll.CAR(7)); + UPDATE_ALL(opll.MOD(8)); + UPDATE_ALL(opll.CAR(8)); + break; + + case 0x0f: + break; + + case 0x10: + case 0x11: + case 0x12: + case 0x13: + case 0x14: + case 0x15: + case 0x16: + case 0x17: + case 0x18: + ch = (int)(reg - 0x10); + setFnumber(opll, ch, (int)(data + ((opll.reg[0x20 + ch] & 1) << 8))); + UPDATE_ALL(opll.MOD(ch)); + UPDATE_ALL(opll.CAR(ch)); + switch (reg) + { + case 0x17: + opll.noiseA_dphase = (uint)((data + ((opll.reg[0x27] & 1) << 8)) << ((opll.reg[0x27] >> 1) & 7)); + break; + case 0x18: + opll.noiseB_dphase = (uint)((data + ((opll.reg[0x28] & 1) << 8)) << ((opll.reg[0x28] >> 1) & 7)); + break; + default: + break; + } + break; + + case 0x20: + case 0x21: + case 0x22: + case 0x23: + case 0x24: + case 0x25: + case 0x26: + case 0x27: + case 0x28: + + ch = (int)(reg - 0x20); + setFnumber(opll, ch, (int)(((data & 1) << 8) + opll.reg[0x10 + ch])); + setBlock(opll, ch, (int)((data >> 1) & 7)); + opll.slot_on_flag[ch * 2] = opll.slot_on_flag[ch * 2 + 1] = (opll.reg[reg]) & 0x10; + + if (opll.rythm_mode != 0) + { + switch (reg) + { + case 0x26: + opll.slot_on_flag[SLOT_BD1] |= (opll.reg[0x0e]) & 0x10; + opll.slot_on_flag[SLOT_BD2] |= (opll.reg[0x0e]) & 0x10; + break; + + case 0x27: + opll.noiseA_dphase = (uint)((int)((data & 1) << 8 + opll.reg[0x17]) << (int)((data >> 1) & 7)); + opll.slot_on_flag[SLOT_SD] |= (opll.reg[0x0e]) & 0x08; + opll.slot_on_flag[SLOT_HH] |= (opll.reg[0x0e]) & 0x01; + break; + + case 0x28: + opll.noiseB_dphase = (uint)((int)((data & 1) << 8) + opll.reg[0x18]) << (int)((data >> 1) & 7); + opll.slot_on_flag[SLOT_TOM] |= (opll.reg[0x0e]) & 0x04; + opll.slot_on_flag[SLOT_CYM] |= (opll.reg[0x0e]) & 0x02; + break; + + default: + break; + } + } + + if (((opll.reg[reg] ^ data) & 0x20) != 0) setSustine(opll, ch, (int)((data >> 5) & 1)); + if ((data & 0x10) != 0) keyOn(opll, ch); else keyOff(opll, ch); + UPDATE_ALL(opll.MOD(ch)); + UPDATE_ALL(opll.CAR(ch)); + break; + + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + i = (int)((data >> 4) & 15); + v = (int)(data & 15); + if ((opll.rythm_mode) != 0 && (reg >= 0x36)) + { + switch (reg) + { + case 0x37: + setSlotVolume(opll.MOD(7), i << 2); + break; + case 0x38: + setSlotVolume(opll.MOD(8), i << 2); + break; + } + } + else + { + setPatch(opll, (int)(reg - 0x30), i); + } + + setVolume(opll, (int)(reg - 0x30), v << 2); + UPDATE_ALL(opll.MOD((int)(reg - 0x30))); + UPDATE_ALL(opll.CAR((int)(reg - 0x30))); + break; + + default: + break; + + } + + opll.reg[reg] = (byte)data; + } + + static void OPLL_writeIO(OPLL opll, uint adr, uint val) + { + adr &= 0xff; + if (adr == 0x7C) opll.adr = val; + else if (adr == 0x7D) OPLL_writeReg(opll, opll.adr, val); + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/Emu2413/Emu2413.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/Emu2413/Emu2413.cs.meta new file mode 100644 index 0000000..c25181d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/Emu2413/Emu2413.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f5ecddbb6b69204478d799a484d8c47c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/Emu2413/Emu2413_Class.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/Emu2413/Emu2413_Class.cs new file mode 100644 index 0000000..2f57abb --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/Emu2413/Emu2413_Class.cs @@ -0,0 +1,208 @@ +using System; + +namespace VirtualNes.Core.Emu2413 +{ + public static class Const + { + internal static sbyte[][] Create_Default_Inst() + { + unchecked + { + sbyte[][] res = new sbyte[Emu2413API.OPLL_TONE_NUM][] + { + new sbyte[] + { + (sbyte)0x00,(sbyte) 0x00, (sbyte)0x00, (sbyte)0x00,(sbyte) 0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x61,(sbyte) 0x61, (sbyte)0x1e, (sbyte)0x17,(sbyte) 0xf0, (sbyte)0x7f, (sbyte)0x07, (sbyte)0x17, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x13,(sbyte) 0x41, (sbyte)0x0f, (sbyte)0x0d,(sbyte) 0xce, (sbyte)0xd2, (sbyte)0x43, (sbyte)0x13, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x03,(sbyte) 0x01, (sbyte)0x99, (sbyte)0x04,(sbyte) 0xff, (sbyte)0xc3, (sbyte)0x03, (sbyte)0x73, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x21,(sbyte) 0x61, (sbyte)0x1b, (sbyte)0x07,(sbyte) 0xaf, (sbyte)0x63, (sbyte)0x40, (sbyte)0x28, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x22,(sbyte) 0x21, (sbyte)0x1e, (sbyte)0x06,(sbyte) 0xf0, (sbyte)0x76, (sbyte)0x08, (sbyte)0x28, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x31,(sbyte) 0x22, (sbyte)0x16, (sbyte)0x05,(sbyte) 0x90, (sbyte)0x71, (sbyte)0x00, (sbyte)0x18, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x21,(sbyte) 0x61, (sbyte)0x1d, (sbyte)0x07,(sbyte) 0x82, (sbyte)0x81, (sbyte)0x10, (sbyte)0x17, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x23,(sbyte) 0x21, (sbyte)0x2d, (sbyte)0x16,(sbyte) 0xc0, (sbyte)0x70, (sbyte)0x07, (sbyte)0x07, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x61,(sbyte) 0x21, (sbyte)0x1b, (sbyte)0x06,(sbyte) 0x64, (sbyte)0x65, (sbyte)0x18, (sbyte)0x18, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x61,(sbyte) 0x61, (sbyte)0x0c, (sbyte)0x18,(sbyte) 0x85, (sbyte)0xa0, (sbyte)0x79, (sbyte)0x07, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x23,(sbyte) 0x21, (sbyte)0x87, (sbyte)0x11,(sbyte) 0xf0, (sbyte)0xa4, (sbyte)0x00, (sbyte)0xf7, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x97,(sbyte) 0xe1, (sbyte)0x28, (sbyte)0x07,(sbyte) 0xff, (sbyte)0xf3, (sbyte)0x02, (sbyte)0xf8, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x61,(sbyte) 0x10, (sbyte)0x0c, (sbyte)0x05,(sbyte) 0xf2, (sbyte)0xc4, (sbyte)0x40, (sbyte)0xc8, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x01,(sbyte) 0x01, (sbyte)0x56, (sbyte)0x03,(sbyte) 0xb4, (sbyte)0xb2, (sbyte)0x23, (sbyte)0x58, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x61,(sbyte) 0x41, (sbyte)0x89, (sbyte)0x03,(sbyte) 0xf1, (sbyte)0xf4, (sbyte)0xf0, (sbyte)0x13, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x04,(sbyte) 0x21, (sbyte)0x28, (sbyte)0x00,(sbyte) 0xdf, (sbyte)0xf8, (sbyte)0xff, (sbyte)0xf8, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x23,(sbyte) 0x22, (sbyte)0x00, (sbyte)0x00,(sbyte) 0xd8, (sbyte)0xf8, (sbyte)0xf8, (sbyte)0xf8, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x25,(sbyte) 0x18, (sbyte)0x00, (sbyte)0x00,(sbyte) 0xf8, (sbyte)0xda, (sbyte)0xf8, (sbyte)0x55, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + }, + new sbyte[] + { + (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x33, (sbyte)0x01, (sbyte)0x09, (sbyte)0x0e, (sbyte)0x94, (sbyte)0x90, (sbyte)0x40, (sbyte)0x01, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x13, (sbyte)0x41, (sbyte)0x0f, (sbyte)0x0d, (sbyte)0xce, (sbyte)0xd3, (sbyte)0x43, (sbyte)0x13, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x01, (sbyte)0x12, (sbyte)0x1b, (sbyte)0x06, (sbyte)0xff, (sbyte)0xd2, (sbyte)0x00, (sbyte)0x32, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x61, (sbyte)0x61, (sbyte)0x1b, (sbyte)0x07, (sbyte)0xaf, (sbyte)0x63, (sbyte)0x20, (sbyte)0x28, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x22, (sbyte)0x21, (sbyte)0x1e, (sbyte)0x06, (sbyte)0xf0, (sbyte)0x76, (sbyte)0x08, (sbyte)0x28, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x66, (sbyte)0x21, (sbyte)0x15, (sbyte)0x00, (sbyte)0x93, (sbyte)0x94, (sbyte)0x20, (sbyte)0xf8, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x21, (sbyte)0x61, (sbyte)0x1c, (sbyte)0x07, (sbyte)0x82, (sbyte)0x81, (sbyte)0x10, (sbyte)0x17, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x23, (sbyte)0x21, (sbyte)0x20, (sbyte)0x1f, (sbyte)0xc0, (sbyte)0x71, (sbyte)0x07, (sbyte)0x47, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x25, (sbyte)0x31, (sbyte)0x26, (sbyte)0x05, (sbyte)0x64, (sbyte)0x41, (sbyte)0x18, (sbyte)0xf8, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x17, (sbyte)0x21, (sbyte)0x28, (sbyte)0x07, (sbyte)0xff, (sbyte)0x83, (sbyte)0x02, (sbyte)0xf8, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x97, (sbyte)0x81, (sbyte)0x25, (sbyte)0x07, (sbyte)0xcf, (sbyte)0xc8, (sbyte)0x02, (sbyte)0x14, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x21, (sbyte)0x21, (sbyte)0x54, (sbyte)0x0f, (sbyte)0x80, (sbyte)0x7f, (sbyte)0x07, (sbyte)0x07, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x01, (sbyte)0x01, (sbyte)0x56, (sbyte)0x03, (sbyte)0xd3, (sbyte)0xb2, (sbyte)0x43, (sbyte)0x58, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x31, (sbyte)0x21, (sbyte)0x0c, (sbyte)0x03, (sbyte)0x82, (sbyte)0xc0, (sbyte)0x40, (sbyte)0x07, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x21, (sbyte)0x01, (sbyte)0x0c, (sbyte)0x03, (sbyte)0xd4, (sbyte)0xd3, (sbyte)0x40, (sbyte)0x84, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x04, (sbyte)0x21, (sbyte)0x28, (sbyte)0x00, (sbyte)0xdf, (sbyte)0xf8, (sbyte)0xff, (sbyte)0xf8, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x23, (sbyte)0x22, (sbyte)0x00, (sbyte)0x00, (sbyte)0xa8, (sbyte)0xf8, (sbyte)0xf8, (sbyte)0xf8, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + (sbyte)0x25, (sbyte)0x18, (sbyte)0x00, (sbyte)0x00, (sbyte)0xf8, (sbyte)0xa9, (sbyte)0xf8, (sbyte)0x55, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, (sbyte)0x00, + } + }; + + return res; + } + } + + internal static OPLL_PATCH[][] Create_Default_Patch() + { + OPLL_PATCH[][] res = new OPLL_PATCH[Emu2413API.OPLL_TONE_NUM][] + { + new OPLL_PATCH[(16 + 3) * 2], + new OPLL_PATCH[(16 + 3) * 2], + }; + + for (int x = 0; x < Emu2413API.OPLL_TONE_NUM; x++) + for (int y = 0; y < (16 + 3) * 2; y++) + res[x][y] = new OPLL_PATCH(); + + return res; + } + + internal static uint[,,,] Create_tllTable() + { + var res = new uint[16, 8, 1 << Emu2413API.TL_BITS, 4]; + return res; + } + + internal static Int32[,,] Create_rksTable() + { + return new int[2, 8, 2]; + } + + internal static UInt32[,,] Create_dphaseTable() + { + return new uint[512, 8, 16]; + } + } + public class OPLL_PATCH + { + public uint TL, FB, EG, ML, AR, DR, SL, RR, KR, KL, AM, PM, WF; + + public void Copy(OPLL_PATCH other) + { + TL = other.TL; + FB = other.FB; + EG = other.EG; + ML = other.ML; + AR = other.AR; + DR = other.DR; + SL = other.SL; + RR = other.RR; + KR = other.KR; + KL = other.KL; + AM = other.AM; + PM = other.PM; + WF = other.WF; + } + } + + public class OPLL_SLOT + { + public OPLL_PATCH patch; + + public int type; /* 0 : modulator 1 : carrier */ + + /* OUTPUT */ + public Int32 feedback; + public Int32[] output = new Int32[5]; /* Output value of slot */ + + /* for Phase Generator (PG) */ + public UInt32[] sintbl; /* Wavetable */ + public UInt32 phase; /* Phase */ + public UInt32 dphase; /* Phase increment amount */ + public UInt32 pgout; /* output */ + + /* for Envelope Generator (EG) */ + public int fnum; /* F-Number */ + public int block; /* Block */ + public int volume; /* Current volume */ + public int sustine; /* Sustine 1 = ON, 0 = OFF */ + public UInt32 tll; /* Total Level + Key scale level*/ + public UInt32 rks; /* Key scale offset (Rks) */ + public int eg_mode; /* Current state */ + public UInt32 eg_phase; /* Phase */ + public UInt32 eg_dphase; /* Phase increment amount */ + public UInt32 egout; /* output */ + + + /* refer to opll-> */ + public int plfo_pm => m_host.lfo_pm; + public int plfo_am => m_host.lfo_am; + + private OPLL m_host; + public void SetHost(OPLL host) + { + m_host = host; + } + } + + public class OPLL_CH + { + public int patch_number; + public int key_status; + public OPLL_SLOT mod; + public OPLL_SLOT car; + } + + public class OPLL + { + public UInt32 adr; + public Int32[] output = new Int32[2]; + + /* Register */ + public byte[] reg = new byte[0x40]; + public int[] slot_on_flag = new int[18]; + + /* Rythm Mode : 0 = OFF, 1 = ON */ + public int rythm_mode; + + /* Pitch Modulator */ + public UInt32 pm_phase; + public Int32 lfo_pm; + + /* Amp Modulator */ + public Int32 am_phase; + public Int32 lfo_am; + + /* Noise Generator */ + public UInt32 noise_seed; + public UInt32 whitenoise; + public UInt32 noiseA; + public UInt32 noiseB; + public UInt32 noiseA_phase; + public UInt32 noiseB_phase; + public UInt32 noiseA_idx; + public UInt32 noiseB_idx; + public UInt32 noiseA_dphase; + public UInt32 noiseB_dphase; + + /* Channel & Slot */ + public OPLL_CH[] ch = new OPLL_CH[9]; + public OPLL_SLOT[] slot = new OPLL_SLOT[18]; + + /* Voice Data */ + public OPLL_PATCH[] patch = new OPLL_PATCH[19 * 2]; + public int[] patch_update = new int[2]; /* flag for check patch update */ + + public UInt32 mask; + + public int masterVolume; /* 0min -- 64 -- 127 max (Liner) */ + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/Emu2413/Emu2413_Class.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/Emu2413/Emu2413_Class.cs.meta new file mode 100644 index 0000000..23ad2bb --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/Emu2413/Emu2413_Class.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9c1aaa5374091a64a88e750483fe6f6b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/EnumRenderMethod.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/EnumRenderMethod.cs new file mode 100644 index 0000000..262a6da --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/EnumRenderMethod.cs @@ -0,0 +1,12 @@ +namespace VirtualNes.Core +{ + // 昤夋曽幃 + public enum EnumRenderMethod + { + POST_ALL_RENDER = 0, // 僗僉儍儞儔僀儞暘偺柦椷幚峴屻丆儗儞僟儕儞僌 + PRE_ALL_RENDER = 1, // 儗儞僟儕儞僌偺幚峴屻丆僗僉儍儞儔僀儞暘偺柦椷幚峴 + POST_RENDER = 2, // 昞帵婜娫暘偺柦椷幚峴屻丆儗儞僟儕儞僌 + PRE_RENDER = 3, // 儗儞僟儕儞僌幚峴屻丆昞帵婜娫暘偺柦椷幚峴 + TILE_RENDER = 4 // 僞僀儖儀乕僗儗儞僟儕儞僌 + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/EnumRenderMethod.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/EnumRenderMethod.cs.meta new file mode 100644 index 0000000..396fe6d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/EnumRenderMethod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9c379fb6535bd23449474dee5018652c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/ISoundDataBuffer.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/ISoundDataBuffer.cs new file mode 100644 index 0000000..76a6120 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/ISoundDataBuffer.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VirtualNes.Core +{ + public interface ISoundDataBuffer + { + void WriteByte(byte value); + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/ISoundDataBuffer.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/ISoundDataBuffer.cs.meta new file mode 100644 index 0000000..71ba7b0 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/ISoundDataBuffer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4585a754599519b48bfe50294600818f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/MemoryUtility.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/MemoryUtility.cs new file mode 100644 index 0000000..3c03d31 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/MemoryUtility.cs @@ -0,0 +1,46 @@ +using System; +using System.Runtime.CompilerServices; + +namespace VirtualNes.Core +{ + public static class MemoryUtility + { + public static void ZEROMEMORY(byte[] array, int length) + { + Array.Clear(array, 0, array.Length); + } + public static void ZEROMEMORY(int[] array, int length) + { + Array.Clear(array, 0, array.Length); + } + + public static void memset(byte[] array, byte value, int length) + { + memset(array, 0, value, length); + } + + public static void memset(uint[] array, uint value, int length) + { + for (int i = 0; i < length; i++) + { + array[i] = value; + } + } + + public static void memset(byte[] array, int offset, byte value, int length) + { + for (int i = offset; i < length; i++) + { + array[i] = value; + } + } + + public static void memset(uint[] array, int offset, uint value, int length) + { + for (int i = offset; i < length; i++) + { + array[i] = value; + } + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/MemoryUtility.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/MemoryUtility.cs.meta new file mode 100644 index 0000000..a9afc7a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/MemoryUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8586eb710dc81124593eb5adfa08d73b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/NESCOMMAND.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/NESCOMMAND.cs new file mode 100644 index 0000000..d743f4b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/NESCOMMAND.cs @@ -0,0 +1,23 @@ +namespace VirtualNes.Core +{ + public enum NESCOMMAND + { + NESCMD_NONE = 0, + NESCMD_HWRESET, + NESCMD_SWRESET, + NESCMD_EXCONTROLLER, // Commandparam + NESCMD_DISK_THROTTLE_ON, + NESCMD_DISK_THROTTLE_OFF, + NESCMD_DISK_EJECT, + NESCMD_DISK_0A, + NESCMD_DISK_0B, + NESCMD_DISK_1A, + NESCMD_DISK_1B, + NESCMD_DISK_2A, + NESCMD_DISK_2B, + NESCMD_DISK_3A, + NESCMD_DISK_3B, + + NESCMD_SOUND_MUTE, // CommandParam + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/NESCOMMAND.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/NESCOMMAND.cs.meta new file mode 100644 index 0000000..db767eb --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/NESCOMMAND.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d7e8126382c9728429056ba33afc85eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/NesConfig.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/NesConfig.cs new file mode 100644 index 0000000..edb724e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/NesConfig.cs @@ -0,0 +1,51 @@ +namespace VirtualNes.Core +{ + public class NesConfig + { + public float BaseClock; // NTSC:21477270.0 PAL:21281364.0 + public float CpuClock; // NTSC: 1789772.5 PAL: 1773447.0 + + public int TotalScanlines; // NTSC: 262 PAL: 312 + + public int ScanlineCycles; // NTSC:1364 PAL:1362 + + public int HDrawCycles; // NTSC:1024 PAL:1024 + public int HBlankCycles; // NTSC: 340 PAL: 338 + public int ScanlineEndCycles; // NTSC: 4 PAL: 2 + + public int FrameCycles; // NTSC:29829.52 PAL:35468.94 + public int FrameIrqCycles; // NTSC:29829.52 PAL:35468.94 + + public int FrameRate; // NTSC:60(59.94) PAL:50 + public float FramePeriod; // NTSC:16.683 PAL:20.0 + + public static NesConfig NESCONFIG_NTSC = new NesConfig + { + BaseClock = 21477270.0f, + CpuClock = 1789772.5f, + TotalScanlines = 262, + ScanlineCycles = 1364, + HDrawCycles = 1024, + HBlankCycles = 340, + ScanlineEndCycles = 4, + FrameCycles = 1364 * 262, + FrameIrqCycles = 29830, + FrameRate = 60, + FramePeriod = 1000.0f / 60.0f + }; + public static NesConfig NESCONFIG_PAL = new NesConfig + { + BaseClock = 26601714.0f, + CpuClock = 1662607.125f, + TotalScanlines = 312, + ScanlineCycles = 1278, + HDrawCycles = 960, + HBlankCycles = 318, + ScanlineEndCycles = 2, + FrameCycles = 1278 * 312, + FrameIrqCycles = 33252, + FrameRate = 50, + FramePeriod = 1000.0f / 50.0f + }; + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/NesConfig.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/NesConfig.cs.meta new file mode 100644 index 0000000..d583d21 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/NesConfig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4865f8871b37b0041b77060cf3c62664 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/ROMClasses.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/ROMClasses.cs new file mode 100644 index 0000000..bbc74d3 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/ROMClasses.cs @@ -0,0 +1,140 @@ +using System; + +namespace VirtualNes.Core +{ + public enum EnumRomControlByte1 : byte + { + ROM_VMIRROR = 0x01, + ROM_SAVERAM = 0x02, + ROM_TRAINER = 0x04, + ROM_4SCREEN = 0x08, + } + + public enum EnumRomControlByte2 : byte + { + ROM_VSUNISYSTEM = 0x01 + } + + public enum EnumRomType + { + InValid, + NES, + /// Nintendo Disk System + FDS, + NSF + } + + public class NSFHEADER + { + byte[] ID; + byte Version; + byte TotalSong; + byte StartSong; + ushort LoadAddress; + ushort InitAddress; + ushort PlayAddress; + byte[] SongName; + byte[] ArtistName; + byte[] CopyrightName; + ushort SpeedNTSC; + byte[] BankSwitch; + ushort SpeedPAL; + byte NTSC_PALbits; + public byte ExtraChipSelect; + byte[] Expansion; // must be 0 + + + public static int SizeOf() + { + return 128; + } + + public static NSFHEADER GetDefault() + { + var res = new NSFHEADER(); + res.ID = new byte[5]; + res.SongName = new byte[32]; + res.ArtistName = new byte[32]; + res.CopyrightName = new byte[32]; + res.BankSwitch = new byte[8]; + res.Expansion = new byte[4]; + return res; + } + } + + public class NESHEADER + { + public byte[] ID; + public byte PRG_PAGE_SIZE; + public byte CHR_PAGE_SIZE; + public byte control1; + public byte control2; + public byte[] reserved; + + public bool CheckValid() + { + return GetRomType() != EnumRomType.InValid; + } + + public static int SizeOf() + { + return 16; + } + + public EnumRomType GetRomType() + { + if (ID[0] == 'N' && ID[1] == 'E' && ID[2] == 'S' && ID[3] == 0x1A) + return EnumRomType.NES; + if (ID[0] == 'F' && ID[1] == 'D' && ID[2] == 'S' && ID[3] == 0x1A) + return EnumRomType.FDS; + if (ID[0] == 'N' && ID[1] == 'E' && ID[2] == 'S' && ID[3] == 'M') + return EnumRomType.NSF; + + return EnumRomType.InValid; + } + + public static NESHEADER GetDefault() + { + var res = new NESHEADER(); + res.ID = new byte[4]; + res.reserved = new byte[8]; + return res; + } + + public static NESHEADER Read(Span data) + { + var res = new NESHEADER(); + res.ID = data.Slice(0, 4).ToArray(); + res.PRG_PAGE_SIZE = data[4]; + res.CHR_PAGE_SIZE = data[5]; + res.control1 = data[6]; + res.control2 = data[7]; + res.reserved = data.Slice(8, 8).ToArray(); + + return res; + } + + public byte[] DataToBytes() + { + byte[] res = new byte[16]; + res[0] = ID[0]; + res[1] = ID[1]; + res[2] = ID[2]; + res[3] = ID[3]; + res[4] = PRG_PAGE_SIZE; + res[5] = CHR_PAGE_SIZE; + res[6] = control1; + res[7] = control2; + res[8] = reserved[0]; + res[9] = reserved[1]; + res[10] = reserved[2]; + res[11] = reserved[3]; + res[12] = reserved[4]; + res[13] = reserved[5]; + res[14] = reserved[6]; + res[15] = reserved[7]; + + return res; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/ROMClasses.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/ROMClasses.cs.meta new file mode 100644 index 0000000..da4c0eb --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/ROMClasses.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 65b1ea91f79171f4f82ab91106909f86 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/RomPatch.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/RomPatch.cs new file mode 100644 index 0000000..fb26c67 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/RomPatch.cs @@ -0,0 +1,420 @@ +namespace VirtualNes.Core +{ + public static class RomPatch + { + public static void DoPatch(ref uint crc, ref byte[] lpPRG, ref byte[] lpCHR, ref int mapper, ref NESHEADER header) + { + // Mapper 000 + if (crc == 0x57970078) + { // F-1 Race(J) + lpPRG[0x078C] = 0x6C; + lpPRG[0x3FE1] = 0xFF; + lpPRG[0x3FE6] = 0x00; + } + if (crc == 0xaf2bbcbc // Mach Rider(JU) + || crc == 0x3acd4bf1 // Mach Rider(Alt)(JU) pb`(^^; + || crc == 0x8bbe9bec) + { + lpPRG[0x090D] = 0x6E; + lpPRG[0x7FDF] = 0xFF; + lpPRG[0x7FE4] = 0x00; + + header.control1 = (byte)EnumRomControlByte1.ROM_VMIRROR; + } + + if (crc == 0xe16bb5fe) + { // Zippy Race(J) + header.control1 &= 0xf6; + } + if (crc == 0x85534474) + { // Lode Runner(J) + lpPRG[0x29E9] = 0xEA; // Z[uj[opb` + lpPRG[0x29EA] = 0xEA; + lpPRG[0x29F8] = 0xEA; + lpPRG[0x29F9] = 0xEA; + } + + // Mapper 001 + if (crc == 0x7831b2ff // America Daitouryou Senkyo(J) + || crc == 0x190a3e11 // Be-Bop-Highschool - Koukousei Gokuraku Densetsu(J) + || crc == 0x52449508 // Home Run Nighter - Pennant League!!(J) + || crc == 0x0973f714 // Jangou(J) + || crc == 0x7172f3d4 // Kabushiki Doujou(J) + || crc == 0xa5781280 // Kujaku Ou 2(J) + || crc == 0x8ce9c87b // Money Game, The(J) + || crc == 0xec47296d // Morita Kazuo no Shougi(J) + || crc == 0xcee5857b // Ninjara Hoi!(J) + || crc == 0xe63d9193 // Tanigawa Kouji no Shougi Shinan 3(J) + || crc == 0xd54f5da9 // Tsuppari Wars(J) + || crc == 0x1e0c7ea3) + { // AD&D Dragons of Flame(J) + header.control1 |= (byte)EnumRomControlByte1.ROM_SAVERAM; + } + if (crc == 0x1995ac4e) + { // Ferrari Grand Prix Challenge(J) pb`(^^; + lpPRG[0x1F7AD] = 0xFF; + lpPRG[0x1F7BC] = 0x00; + } + + if (crc == 0x20d22251) + { // Top rider(J) pb`(^^; + lpPRG[0x1F17E] = 0xEA; + lpPRG[0x1F17F] = 0xEA; + } + + if (crc == 0x11469ce3) + { // Viva! Las Vegas(J) pb`(^^; + lpCHR[0x0000] = 0x01; + } + + if (crc == 0x3fccdc7b) + { // Baseball Star - Mezase Sankanou!!(J) pb`(^^; + lpPRG[0x0F666] = 0x9D; + } + + if (crc == 0xdb564628) + { // Mario Open Golf(J) + lpPRG[0x30195] = 0xC0; + } + + // Mapper 002 + if (crc == 0x63af202f) + { // JJ - Tobidase Daisakusen Part 2(J) + header.control1 &= 0xf6; + header.control1 |= (byte)EnumRomControlByte1.ROM_VMIRROR; + } + + if (crc == 0x99a62e47) + { // Black Bass 2, The(J) + header.control1 &= 0xf6; + header.control1 |= (byte)EnumRomControlByte1.ROM_VMIRROR; + } + + if (crc == 0x0eaa7515 // Rod Land(J) + || crc == 0x22ab9694) + { // Rod Land(E) + header.control1 &= 0xf6; + header.control1 |= (byte)EnumRomControlByte1.ROM_VMIRROR; + } + + if (crc == 0x2061772a) + { // Tantei Jinguji Taburou Tokino Sugiyukumamani (J) + header.control1 &= 0xf6; + header.control1 |= (byte)EnumRomControlByte1.ROM_VMIRROR; + } + + // Mapper 003 + if (crc == 0x29401686) + { // Minna no Taabou no Nakayoshi Dai Sakusen(J) + // lpPRG[0x2B3E] = 0x60; + } + if (crc == 0x932a077a) + { // TwinBee(J) + mapper = 87; + } + if (crc == 0x8218c637) + { // Space Hunter(J) + // header.control1 &= 0xf6; + // header.control1 |= ROM_4SCREEN; + header.control1 = (byte)EnumRomControlByte1.ROM_VMIRROR; + } + if (crc == 0x2bb6a0f8 // Sherlock Holmes - Hakushaku Reijou Yuukai Jiken(J) + || crc == 0x28c11d24 // Sukeban Deka 3(J) + || crc == 0x02863604) + { // Sukeban Deka 3(J)(Alt) + header.control1 &= 0xf6; + header.control1 |= (byte)EnumRomControlByte1.ROM_VMIRROR; + } + + // Mapper 004 + if (crc == 0x58581770) + { // Rasaaru Ishii no Childs Quest(J) + header.control1 &= 0xf6; + header.control1 |= (byte)EnumRomControlByte1.ROM_VMIRROR; + } + if (crc == 0xf3feb3ab // Kunio Kun no Jidaigeki Dayo Zenin Shuugou! (J) + || crc == 0xa524ae9b // Otaku no Seiza - An Adventure in the Otaku Galaxy (J) + || crc == 0x46dc6e57 // SD Gundam - Gachapon Senshi 2 - Capsule Senki (J) + || crc == 0x66b2dec7 // SD Gundam - Gachapon Senshi 3 - Eiyuu Senki (J) + || crc == 0x92b07fd9 // SD Gundam - Gachapon Senshi 4 - New Type Story (J) + || crc == 0x8ee6463a // SD Gundam - Gachapon Senshi 5 - Battle of Universal Century (J) + || crc == 0xaf754426 // Ultraman Club 3 (J) + || crc == 0xfe4e5b11 // Ushio to Tora - Shinen no Daiyou (J) + || crc == 0x57c12c17) + { // Yamamura Misa Suspense - Kyouto Zaiteku Satsujin Jiken (J) + header.control1 |= (byte)EnumRomControlByte1.ROM_SAVERAM; + } + if (crc == 0x42e03e4a) + { // RPG Jinsei Game (J) + mapper = 118; + header.control1 |= (byte)EnumRomControlByte1.ROM_SAVERAM; + } + if (crc == 0xfd0299c3) + { // METAL MAX(J) + lpPRG[0x3D522] = 0xA9; + lpPRG[0x3D523] = 0x19; + } + if (crc == 0x1d2e5018 // Rockman 3(J) + || crc == 0x6b999aaf) + { // Mega Man 3(U) + // lpPRG[0x3C179] = 0xBA;// + // lpPRG[0x3C9CC] = 0x9E; + } + + // Mapper 005 + if (crc == 0xe91548d8) + { // Shin 4 Nin Uchi Mahjong - Yakuman Tengoku (J) + header.control1 |= (byte)EnumRomControlByte1.ROM_SAVERAM; + } + + if (crc == 0x255b129c) + { // Gun Sight (J) / Gun Sight (J)[a1] + lpPRG[0x02D0B] = 0x01; + lpPRG[0x0BEC0] = 0x01; + } + + + // Mapper 010 + if (crc == 0xc9cce8f2) + { // Famicom Wars (J) + header.control1 |= (byte)EnumRomControlByte1.ROM_SAVERAM; + } + + // Mapper 016 + if (crc == 0x983d8175 // Datach - Battle Rush - Build Up Robot Tournament (J) + || crc == 0x894efdbc // Datach - Crayon Shin Chan - Ora to Poi Poi (J) + || crc == 0x19e81461 // Datach - Dragon Ball Z - Gekitou Tenkaichi Budou Kai (J) + || crc == 0xbe06853f // Datach - J League Super Top Players (J) + || crc == 0x0be0a328 // Datach - SD Gundam - Gundam Wars (J) + || crc == 0x5b457641 // Datach - Ultraman Club - Supokon Fight! (J) + || crc == 0xf51a7f46 // Datach - Yuu Yuu Hakusho - Bakutou Ankoku Bujutsu Kai (J) + || crc == 0x31cd9903 // Dragon Ball Z - Kyoushuu! Saiya Jin (J) + || crc == 0xe49fc53e // Dragon Ball Z 2 - Gekishin Freeza!! (J) + || crc == 0x09499f4d // Dragon Ball Z 3 - Ressen Jinzou Ningen (J) + || crc == 0x2e991109 // Dragon Ball Z Gaiden - Saiya Jin Zetsumetsu Keikaku (J) + || crc == 0x170250de) + { // Rokudenashi Blues(J) + header.control1 |= (byte)EnumRomControlByte1.ROM_SAVERAM; + } + + // Mapper 019 + if (crc == 0x3296ff7a // Battle Fleet (J) + || crc == 0x429fd177 // Famista '90 (J) + || crc == 0xdd454208 // Hydlide 3 - Yami Kara no Houmonsha (J) + || crc == 0xb1b9e187 // Kaijuu Monogatari (J) + || crc == 0xaf15338f) + { // Mindseeker (J) + header.control1 |= (byte)EnumRomControlByte1.ROM_SAVERAM; + } + + // Mapper 026 + if (crc == 0x836cc1ab) + { // Mouryou Senki Madara (J) + header.control1 |= (byte)EnumRomControlByte1.ROM_SAVERAM; + } + + // Mapper 033 + if (crc == 0x547e6cc1) + { // Flintstones - The Rescue of Dino & Hoppy, The(J) + mapper = 48; + } + + // Mapper 065 + if (crc == 0xfd3fc292) + { // Ai Sensei no Oshiete - Watashi no Hoshi (J) + mapper = 32; + } + + // Mapper 068 + if (crc == 0xfde79681) + { // Maharaja (J) + header.control1 |= (byte)EnumRomControlByte1.ROM_SAVERAM; + } + + // Mapper 069 + if (crc == 0xfeac6916 // Honoo no Toukyuuji - Dodge Danpei 2(J) + || crc == 0x67898319) + { // Barcode World(J) + header.control1 |= (byte)EnumRomControlByte1.ROM_SAVERAM; + } + + // Mapper 080 + if (crc == 0x95aaed34 // Mirai Shinwa Jarvas (J) + || crc == 0x17627d4b) + { // Taito Grand Prix - Eikou heno License (J) + header.control1 |= (byte)EnumRomControlByte1.ROM_SAVERAM; + } + + // Mapper 082 + if (crc == 0x4819a595) + { // Kyuukyoku Harikiri Stadium - Heisei Gannen Ban (J) + header.control1 |= (byte)EnumRomControlByte1.ROM_SAVERAM; + } + + // Mapper 086 + if (crc == 0xe63f7d0b) + { // Urusei Yatsura - Lum no Wedding Bell(J) + mapper = 101; + } + + // Mapper 118 + if (crc == 0x3b0fb600) + { // Ys 3 - Wonderers From Ys (J) + header.control1 |= (byte)EnumRomControlByte1.ROM_SAVERAM; + } + + // Mapper 180 + if (crc == 0xc68363f6) + { // Crazy Climber(J) + header.control1 &= 0xf6; + } + + // VS-Unisystem + if (crc == 0x70901b25) + { // VS Slalom + mapper = 99; + } + + if (crc == 0xd5d7eac4) + { // VS Dr. Mario + mapper = 1; + header.control2 |= (byte)EnumRomControlByte2.ROM_VSUNISYSTEM; + } + + if (crc == 0xffbef374 // VS Castlevania + || crc == 0x8c0c2df5) + { // VS Top Gun + mapper = 2; + header.control2 |= (byte)EnumRomControlByte2.ROM_VSUNISYSTEM; + } + + if (crc == 0xeb2dba63 // VS TKO Boxing + || crc == 0x98cfe016 // VS TKO Boxing (Alt) + || crc == 0x9818f656) + { // VS TKO Boxing (f1) + mapper = 4; + header.control2 |= (byte)EnumRomControlByte2.ROM_VSUNISYSTEM; + } + + if (crc == 0x135adf7c) + { // VS Atari RBI Baseball + mapper = 4; + header.control2 |= (byte)EnumRomControlByte2.ROM_VSUNISYSTEM; + } + + if (crc == 0xf9d3b0a3 // VS Super Xevious + || crc == 0x9924980a // VS Super Xevious (b1) + || crc == 0x66bb838f) + { // VS Super Xevious (b2) + mapper = 4; + header.control1 &= 0xF6; + header.control2 |= (byte)EnumRomControlByte2.ROM_VSUNISYSTEM; + } + + if (crc == 0x17ae56be) + { // VS Freedom Force + mapper = 4; + header.control1 &= 0xF6; + header.control1 |= (byte)EnumRomControlByte1.ROM_4SCREEN; + header.control2 |= (byte)EnumRomControlByte2.ROM_VSUNISYSTEM; + } + + if (crc == 0xe2c0a2be) + { // VS Platoon + mapper = 68; + header.control2 |= (byte)EnumRomControlByte2.ROM_VSUNISYSTEM; + } + + if (crc == 0xcbe85490 // VS Excitebike + || crc == 0x29155e0c // VS Excitebike (Alt) + || crc == 0xff5135a3) + { // VS Hogan's Alley + header.control1 &= 0xF6; + header.control1 |= (byte)EnumRomControlByte1.ROM_4SCREEN; + } + + if (crc == 0x0b65a917) + { // VS Mach Rider(Endurance Course) + lpPRG[0x7FDF] = 0xFF; + lpPRG[0x7FE4] = 0x00; + } + + if (crc == 0x8a6a9848 // VS Mach Rider(Endurance Course)(Alt) + || crc == 0xae8063ef) + { // VS Mach Rider(Japan, Fighting Course) + lpPRG[0x7FDD] = 0xFF; + lpPRG[0x7FE2] = 0x00; + } + + if (crc == 0x16d3f469) + { // VS Ninja Jajamaru Kun (J) + header.control1 &= 0xf6; + header.control1 |= (byte)EnumRomControlByte1.ROM_VMIRROR; + } + + if (crc == 0xc99ec059) + { // VS Raid on Bungeling Bay(J) + mapper = 99; + header.control1 &= 0xF6; + header.control1 |= (byte)EnumRomControlByte1.ROM_4SCREEN; + } + if (crc == 0xca85e56d) + { // VS Mighty Bomb Jack(J) + mapper = 99; + header.control1 &= 0xF6; + header.control1 |= (byte)EnumRomControlByte1.ROM_4SCREEN; + } + + + if (crc == 0xeb2dba63 // VS TKO Boxing + || crc == 0x9818f656 // VS TKO Boxing + || crc == 0xed588f00 // VS Duck Hunt + || crc == 0x8c0c2df5 // VS Top Gun + || crc == 0x16d3f469 // VS Ninja Jajamaru Kun + || crc == 0x8850924b // VS Tetris + || crc == 0xcf36261e // VS Sky Kid + || crc == 0xe1aa8214 // VS Star Luster + || crc == 0xec461db9 // VS Pinball + || crc == 0xe528f651 // VS Pinball (alt) + || crc == 0x17ae56be // VS Freedom Force + || crc == 0xe2c0a2be // VS Platoon + || crc == 0xff5135a3 // VS Hogan's Alley + || crc == 0x70901b25 // VS Slalom + || crc == 0x0b65a917 // VS Mach Rider(Endurance Course) + || crc == 0x8a6a9848 // VS Mach Rider(Endurance Course)(Alt) + || crc == 0xae8063ef // VS Mach Rider(Japan, Fighting Course) + || crc == 0xcc2c4b5d // VS Golf + || crc == 0xa93a5aee // VS Stroke and Match Golf + || crc == 0x86167220 // VS Lady Golf + || crc == 0xffbef374 // VS Castlevania + || crc == 0x135adf7c // VS Atari RBI Baseball + || crc == 0xd5d7eac4 // VS Dr. Mario + || crc == 0x46914e3e // VS Soccer + || crc == 0x70433f2c // VS Battle City + || crc == 0x8d15a6e6 // VS bad .nes + || crc == 0x1e438d52 // VS Goonies + || crc == 0xcbe85490 // VS Excitebike + || crc == 0x29155e0c // VS Excitebike (alt) + || crc == 0x07138c06 // VS Clu Clu Land + || crc == 0x43a357ef // VS Ice Climber + || crc == 0x737dd1bf // VS Super Mario Bros + || crc == 0x4bf3972d // VS Super Mario Bros + || crc == 0x8b60cc58 // VS Super Mario Bros + || crc == 0x8192c804 // VS Super Mario Bros + || crc == 0xd99a2087 // VS Gradius + || crc == 0xf9d3b0a3 // VS Super Xevious + || crc == 0x9924980a // VS Super Xevious + || crc == 0x66bb838f // VS Super Xevious + || crc == 0xc99ec059 // VS Raid on Bungeling Bay(J) + || crc == 0xca85e56d) + { // VS Mighty Bomb Jack(J) + header.control2 |= (byte)EnumRomControlByte2.ROM_VSUNISYSTEM; + } + + if (mapper == 99 || mapper == 151) + { + header.control2 |= (byte)EnumRomControlByte2.ROM_VSUNISYSTEM; + } + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/RomPatch.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/RomPatch.cs.meta new file mode 100644 index 0000000..1670952 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/RomPatch.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 953873ef00535544abd9591708c8e7a5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/State.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/State.cs new file mode 100644 index 0000000..908293b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/State.cs @@ -0,0 +1,54 @@ +using System; + +namespace VirtualNes.Core +{ + public class DISKFILEHDR + { + public byte[] ID = new byte[12]; // "VirtuaNES DI" + public ushort BlockVersion; // 0x0200:0.30 0x0210:0.31 + public ushort Reserved; + public ulong ProgID; // 僾儘僌儔儉ID + public ushort MakerID; // 儊乕僇乕ID + public ushort DiskNo; // 僨傿僗僋悢 + public ulong DifferentSize; // 憡堘悢 + + + public byte[] ToBytes() + { + byte[] res = new byte[36]; + Array.Copy(ID, res, ID.Length); + var temp = BitConverter.GetBytes(BlockVersion); + res[12] = temp[0]; + res[13] = temp[1]; + temp = BitConverter.GetBytes(Reserved); + res[14] = temp[0]; + res[15] = temp[1]; + temp = BitConverter.GetBytes(ProgID); + res[16] = temp[0]; + res[17] = temp[1]; + res[18] = temp[2]; + res[19] = temp[3]; + res[20] = temp[4]; + res[21] = temp[5]; + res[22] = temp[6]; + res[23] = temp[7]; + temp = BitConverter.GetBytes(MakerID); + res[24] = temp[0]; + res[25] = temp[1]; + temp = BitConverter.GetBytes(DiskNo); + res[26] = temp[0]; + res[27] = temp[1]; + temp = BitConverter.GetBytes(ProgID); + res[28] = temp[0]; + res[29] = temp[1]; + res[30] = temp[2]; + res[31] = temp[3]; + res[32] = temp[4]; + res[33] = temp[5]; + res[34] = temp[6]; + res[35] = temp[7]; + + return res; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/State.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/State.cs.meta new file mode 100644 index 0000000..4557eb3 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/CoreLibs/State.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 447095b8c8ae4c74885562c127998e9e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Debuger.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Debuger.cs new file mode 100644 index 0000000..8cce227 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Debuger.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; + +namespace VirtualNes.Core.Debug +{ + public static class Debuger + { + private static IDebugerImpl s_debuger; + public static void Setup(IDebugerImpl debuger) + { + s_debuger = debuger; + } + public static void Log(string message) + { + s_debuger.Log(message); + } + + public static void LogError(string message) + { + s_debuger.LogError(message); + } + } + + public interface IDebugerImpl + { + void Log(string message); + void LogError(string message); + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Debuger.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Debuger.cs.meta new file mode 100644 index 0000000..5ad16c9 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Debuger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7dbca4403bc49f347a8b36f230364226 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/MMU.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/MMU.cs new file mode 100644 index 0000000..f753538 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/MMU.cs @@ -0,0 +1,247 @@ +using System; +using VirtualNes.Core; + +namespace VirtualNes +{ + public static class MMU + { + // CPU 儊儌儕僶儞僋 + public static ArrayRef[] CPU_MEM_BANK = new ArrayRef[8]; // 8K扨埵 + public static byte[] CPU_MEM_TYPE = new byte[8]; + public static int[] CPU_MEM_PAGE = new int[8]; // 僗僥乕僩僙乕僽梡 + // PPU 儊儌儕僶儞僋 + public static ArrayRef[] PPU_MEM_BANK = new ArrayRef[12]; // 1K扨埵 + public static byte[] PPU_MEM_TYPE = new byte[12]; + public static int[] PPU_MEM_PAGE = new int[12]; // 僗僥乕僩僙乕僽梡 + public static byte[] CRAM_USED = new byte[16]; // 僗僥乕僩僙乕僽梡 + + // NES儊儌儕 + public static byte[] RAM = new byte[8 * 1024]; // NES撪憻RAM + public static byte[] WRAM = new byte[128 * 1024]; // 儚乕僋/僶僢僋傾僢僾RAM + public static byte[] DRAM = new byte[40 * 1024]; // 僨傿僗僋僔僗僥儉RAM + public static byte[] XRAM = new byte[8 * 1024]; // 僟儈乕僶儞僋 + public static byte[] ERAM = new byte[32 * 1024]; // 奼挘婡婍梡RAM + + public static byte[] CRAM = new byte[32 * 1024]; // 僉儍儔僋僞僷僞乕儞RAM + public static byte[] VRAM = new byte[4 * 1024]; // 僱乕儉僥乕僽儖/傾僩儕價儏乕僩RAM + + public static byte[] SPRAM = new byte[0x100]; // 僗僾儔僀僩RAM + public static byte[] BGPAL = new byte[0x10]; // BG僷儗僢僩 + public static byte[] SPPAL = new byte[0x10]; // SP僷儗僢僩 + // 儗僕僗僞 + public static byte[] CPUREG = new byte[0x18]; // Nes $4000-$4017 + public static byte[] PPUREG = new byte[0x04]; // Nes $2000-$2003 + + // PPU撪晹儗僕僗僞 + public static byte PPU56Toggle; // $2005-$2006 Toggle + public static byte PPU7_Temp; // $2007 read buffer + public static ushort loopy_t; // same as $2005/$2006 + public static ushort loopy_v; // same as $2005/$2006 + public static ushort loopy_x; // tile x offset + + // ROM僨乕僞億僀儞僞 + public static byte[] PROM; // PROM ptr + public static byte[] VROM; // VROM ptr + + // For dis... + public static byte PROM_ACCESS; + + // ROM 僶儞僋僒僀僘 + public static int PROM_8K_SIZE, PROM_16K_SIZE, PROM_32K_SIZE; + public static int VROM_1K_SIZE, VROM_2K_SIZE, VROM_4K_SIZE, VROM_8K_SIZE; + + // 儊儌儕僞僀僾 + // For PROM (CPU) + public const byte BANKTYPE_ROM = 0x00; + public const byte BANKTYPE_RAM = 0xFF; + public const byte BANKTYPE_DRAM = 0x01; + public const byte BANKTYPE_MAPPER = 0x80; + // For VROM/VRAM=/CRAM (PPU) + public const byte BANKTYPE_VROM = 0x00; + public const byte BANKTYPE_CRAM = 0x01; + public const byte BANKTYPE_VRAM = 0x80; + + // 儈儔乕僞僀僾 + public const byte VRAM_HMIRROR = 0x00; // Horizontal + public const byte VRAM_VMIRROR = 0x01; // Virtical + public const byte VRAM_MIRROR4 = 0x02; // All screen + public const byte VRAM_MIRROR4L = 0x03; // PA10 L屌掕 $2000-$23FF偺儈儔乕 + public const byte VRAM_MIRROR4H = 0x04; // PA10 H屌掕 $2400-$27FF偺儈儔乕 + + // Frame-IRQ儗僕僗僞($4017) + public static int FrameIRQ; + + internal static void SetPROM_Bank(byte page, byte[] ptr, byte type) + { + CPU_MEM_BANK[page] = new ArrayRef(ptr, 0, ptr.Length); + CPU_MEM_TYPE[page] = type; + CPU_MEM_PAGE[page] = 0; + } + + internal static void SetPROM_Bank(byte page, ArrayRef ptr, byte type) + { + CPU_MEM_BANK[page] = ptr; + CPU_MEM_TYPE[page] = type; + CPU_MEM_PAGE[page] = 0; + } + + internal static void SetPROM_8K_Bank(byte page, int bank) + { + bank %= PROM_8K_SIZE; + CPU_MEM_BANK[page] = new ArrayRef(MMU.PROM, 0x2000 * bank, MMU.PROM.Length - 0x2000 * bank); + CPU_MEM_TYPE[page] = BANKTYPE_ROM; + CPU_MEM_PAGE[page] = bank; + } + + internal static void SetPROM_16K_Bank(byte page, int bank) + { + SetPROM_8K_Bank((byte)(page + 0), bank * 2 + 0); + SetPROM_8K_Bank((byte)(page + 1), bank * 2 + 1); + } + + internal static void SetPROM_32K_Bank(int bank) + { + SetPROM_8K_Bank(4, bank * 4 + 0); + SetPROM_8K_Bank(5, bank * 4 + 1); + SetPROM_8K_Bank(6, bank * 4 + 2); + SetPROM_8K_Bank(7, bank * 4 + 3); + } + + internal static void SetPROM_32K_Bank(int bank0, int bank1, int bank2, int bank3) + { + SetPROM_8K_Bank(4, bank0); + SetPROM_8K_Bank(5, bank1); + SetPROM_8K_Bank(6, bank2); + SetPROM_8K_Bank(7, bank3); + } + + // PPU VROM bank + internal static void SetVROM_Bank(byte page, ArrayRef ptr, byte type) + { + PPU_MEM_BANK[page] = ptr; + PPU_MEM_TYPE[page] = type; + PPU_MEM_PAGE[page] = 0; + } + + internal static void SetVROM_1K_Bank(byte page, int bank) + { + bank %= VROM_1K_SIZE; + PPU_MEM_BANK[page] = new ArrayRef(VROM, 0x0400 * bank, VROM.Length - (0x0400 * bank)); + PPU_MEM_TYPE[page] = BANKTYPE_VROM; + PPU_MEM_PAGE[page] = bank; + } + + internal static void SetVROM_2K_Bank(byte page, int bank) + { + SetVROM_1K_Bank((byte)(page + 0), bank * 2 + 0); + SetVROM_1K_Bank((byte)(page + 1), bank * 2 + 1); + } + + internal static void SetVROM_4K_Bank(byte page, int bank) + { + SetVROM_1K_Bank((byte)(page + 0), bank * 4 + 0); + SetVROM_1K_Bank((byte)(page + 1), bank * 4 + 1); + SetVROM_1K_Bank((byte)(page + 2), bank * 4 + 2); + SetVROM_1K_Bank((byte)(page + 3), bank * 4 + 3); + } + + internal static void SetVROM_8K_Bank(int bank) + { + for (byte i = 0; i < 8; i++) + { + SetVROM_1K_Bank(i, bank * 8 + i); + } + } + + internal static void SetVROM_8K_Bank(int bank0, int bank1, int bank2, int bank3, + int bank4, int bank5, int bank6, int bank7) + { + SetVROM_1K_Bank(0, bank0); + SetVROM_1K_Bank(1, bank1); + SetVROM_1K_Bank(2, bank2); + SetVROM_1K_Bank(3, bank3); + SetVROM_1K_Bank(4, bank4); + SetVROM_1K_Bank(5, bank5); + SetVROM_1K_Bank(6, bank6); + SetVROM_1K_Bank(7, bank7); + } + + internal static void SetCRAM_1K_Bank(byte page, int bank) + { + bank &= 0x1F; + PPU_MEM_BANK[page] = new ArrayRef(MMU.CRAM, 0x0400 * bank, MMU.CRAM.Length - 0x0400 * bank); + PPU_MEM_TYPE[page] = BANKTYPE_CRAM; + PPU_MEM_PAGE[page] = bank; + + CRAM_USED[bank >> 2] = 0xFF; // CRAM巊梡僼儔僌 + } + + internal static void SetCRAM_2K_Bank(byte page, int bank) + { + SetCRAM_1K_Bank((byte)(page + 0), bank * 2 + 0); + SetCRAM_1K_Bank((byte)(page + 1), bank * 2 + 1); + } + + internal static void SetCRAM_4K_Bank(byte page, int bank) + { + SetCRAM_1K_Bank((byte)(page + 0), bank * 4 + 0); + SetCRAM_1K_Bank((byte)(page + 1), bank * 4 + 1); + SetCRAM_1K_Bank((byte)(page + 2), bank * 4 + 2); + SetCRAM_1K_Bank((byte)(page + 3), bank * 4 + 3); + } + + internal static void SetCRAM_8K_Bank(int bank) + { + for (byte i = 0; i < 8; i++) + { + SetCRAM_1K_Bank(i, bank * 8 + 1); + } + } + + internal static void SetVRAM_1K_Bank(byte page, int bank) + { + bank &= 3; + PPU_MEM_BANK[page] = new ArrayRef(VRAM, 0x0400 * bank, VRAM.Length - 0x0400 * bank); + PPU_MEM_TYPE[page] = BANKTYPE_VRAM; + PPU_MEM_PAGE[page] = bank; + } + + internal static void SetVRAM_Bank(int bank0, int bank1, int bank2, int bank3) + { + SetVRAM_1K_Bank(8, bank0); + SetVRAM_1K_Bank(9, bank1); + SetVRAM_1K_Bank(10, bank2); + SetVRAM_1K_Bank(11, bank3); + } + + internal static void SetVRAM_Mirror(int type) + { + switch (type) + { + case VRAM_HMIRROR: + SetVRAM_Bank(0, 0, 1, 1); + break; + case VRAM_VMIRROR: + SetVRAM_Bank(0, 1, 0, 1); + break; + case VRAM_MIRROR4L: + SetVRAM_Bank(0, 0, 0, 0); + break; + case VRAM_MIRROR4H: + SetVRAM_Bank(1, 1, 1, 1); + break; + case VRAM_MIRROR4: + SetVRAM_Bank(0, 1, 2, 3); + break; + } + } + + internal static void SetVRAM_Mirror(int bank0, int bank1, int bank2, int bank3) + { + SetVRAM_1K_Bank(8, bank0); + SetVRAM_1K_Bank(9, bank1); + SetVRAM_1K_Bank(10, bank2); + SetVRAM_1K_Bank(11, bank3); + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/MMU.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/MMU.cs.meta new file mode 100644 index 0000000..a77dd40 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/MMU.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 863989820a4fb1d49a7c0c883c5a7078 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper.meta new file mode 100644 index 0000000..5aa92e7 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 351e90d17a844b44f869f7c59fd1efb6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/EEPROM.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/EEPROM.cs new file mode 100644 index 0000000..9525118 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/EEPROM.cs @@ -0,0 +1,455 @@ +using System; + +namespace VirtualNes.Core +{ + + + public class X24C01 + { + public const int X24C01_IDLE = 0; // Idle + public const int X24C01_ADDRESS = 1; // Address set + public const int X24C01_READ = 2; // Read + public const int X24C01_WRITE = 3; // Write + public const int X24C01_ACK = 4; // Acknowledge + public const int X24C01_ACK_WAIT = 5; // Acknowledge wait + + int now_state, next_state; + int bitcnt; + byte addr, data; + byte sda; + byte scl_old, sda_old; + + ArrayRef pEEPDATA; + + public X24C01() + { + now_state = X24C01_IDLE; + next_state = X24C01_IDLE; + addr = 0; + data = 0; + sda = 0xFF; + scl_old = 0; + sda_old = 0; + + pEEPDATA = null; + } + + public void Reset(ArrayRef ptr) + { + now_state = X24C01_IDLE; + next_state = X24C01_IDLE; + addr = 0; + data = 0; + sda = 0xFF; + scl_old = 0; + sda_old = 0; + + pEEPDATA = ptr; + } + + public void Write(byte scl_in, byte sda_in) + { + // Clock line + byte scl_rise = (byte)(~scl_old & scl_in); + byte scl_fall = (byte)(scl_old & ~scl_in); + // Data line + byte sda_rise = (byte)(~sda_old & sda_in); + byte sda_fall = (byte)(sda_old & ~sda_in); + + byte scl_old_temp = scl_old; + byte sda_old_temp = sda_old; + + scl_old = scl_in; + sda_old = sda_in; + + // Start condition? + if (scl_old_temp != 0 && sda_fall != 0) + { + now_state = X24C01_ADDRESS; + bitcnt = 0; + addr = 0; + sda = 0xFF; + return; + } + + // Stop condition? + if (scl_old_temp != 0 && sda_rise != 0) + { + now_state = X24C01_IDLE; + sda = 0xFF; + return; + } + + // SCL ____---- RISE + if (scl_rise != 0) + { + switch (now_state) + { + case X24C01_ADDRESS: + if (bitcnt < 7) + { + // 本来はMSB->LSB + addr = (byte)(addr & (~(1 << bitcnt))); + addr = (byte)(addr | ((sda_in != 0 ? 1 : 0) << bitcnt)); + } + else + { + if (sda_in != 0) + { + next_state = X24C01_READ; + data = pEEPDATA[addr & 0x7F]; + } + else + { + next_state = X24C01_WRITE; + } + } + bitcnt++; + break; + case X24C01_ACK: + sda = 0; // ACK + break; + case X24C01_READ: + if (bitcnt < 8) + { + // 本来はMSB->LSB + sda = (byte)((data & (1 << bitcnt)) != 0 ? 1 : 0); + } + bitcnt++; + break; + case X24C01_WRITE: + if (bitcnt < 8) + { + // 本来はMSB->LSB + data = (byte)(data & (~(1 << bitcnt))); + data = (byte)(data | ((sda_in != 0 ? 1 : 0) << bitcnt)); + } + bitcnt++; + break; + + case X24C01_ACK_WAIT: + if (sda_in == 0) + { + next_state = X24C01_IDLE; + } + break; + } + } + + // SCL ----____ FALL + if (scl_fall != 0) + { + switch (now_state) + { + case X24C01_ADDRESS: + if (bitcnt >= 8) + { + now_state = X24C01_ACK; + sda = 0xFF; + } + break; + case X24C01_ACK: + now_state = next_state; + bitcnt = 0; + sda = 0xFF; + break; + case X24C01_READ: + if (bitcnt >= 8) + { + now_state = X24C01_ACK_WAIT; + addr = (byte)((addr + 1) & 0x7F); + } + break; + case X24C01_WRITE: + if (bitcnt >= 8) + { + now_state = X24C01_ACK; + next_state = X24C01_IDLE; + pEEPDATA[addr & 0x7F] = data; + addr = (byte)((addr + 1) & 0x7F); + } + break; + } + } + } + + public byte Read() + { + return sda; + } + + public void Load(byte[] p) + { + //now_state = *((INT*)&p[0]); + //next_state = *((INT*)&p[4]); + //bitcnt = *((INT*)&p[8]); + //addr = p[12]; + //data = p[13]; + //sda = p[14]; + //scl_old = p[15]; + //sda_old = p[16]; + } + + public void Save(byte[] p) + { + //*((INT*)&p[0]) = now_state; + //*((INT*)&p[4]) = next_state; + //*((INT*)&p[8]) = bitcnt; + //p[12] = addr; + //p[13] = data; + //p[14] = sda; + //p[15] = scl_old; + //p[16] = sda_old; + } + } + + public class X24C02 + { + public const int X24C02_IDLE = 0; // Idle + public const int X24C02_DEVADDR = 1; // Device address set + public const int X24C02_ADDRESS = 2; // Address set + public const int X24C02_READ = 3; // Read + public const int X24C02_WRITE = 4; // Write + public const int X24C02_ACK = 5; // Acknowledge + public const int X24C02_NAK = 6; // Not Acknowledge + public const int X24C02_ACK_WAIT = 7; // Acknowledge wait + + int now_state, next_state; + int bitcnt; + byte addr, data, rw; + byte sda; + byte scl_old, sda_old; + + ArrayRef pEEPDATA; + + public X24C02() + { + now_state = X24C02_IDLE; + next_state = X24C02_IDLE; + addr = 0; + data = 0; + rw = 0; + sda = 0xFF; + scl_old = 0; + sda_old = 0; + + pEEPDATA = null; + } + + public void Reset(ArrayRef ptr) + { + now_state = X24C02_IDLE; + next_state = X24C02_IDLE; + addr = 0; + data = 0; + rw = 0; + sda = 0xFF; + scl_old = 0; + sda_old = 0; + + pEEPDATA = ptr; + } + + public void Write(byte scl_in, byte sda_in) + { + // Clock line + byte scl_rise = (byte)(~scl_old & scl_in); + byte scl_fall = (byte)(scl_old & ~scl_in); + // Data line + byte sda_rise = (byte)(~sda_old & sda_in); + byte sda_fall = (byte)(sda_old & ~sda_in); + + byte scl_old_temp = scl_old; + byte sda_old_temp = sda_old; + + scl_old = scl_in; + sda_old = sda_in; + + // Start condition? + if (scl_old_temp != 0 && sda_fall != 0) + { + now_state = X24C02_DEVADDR; + bitcnt = 0; + sda = 0xFF; + return; + } + + // Stop condition? + if (scl_old_temp != 0 && sda_rise != 0) + { + now_state = X24C02_IDLE; + sda = 0xFF; + return; + } + + // SCL ____---- RISE + if (scl_rise != 0) + { + switch (now_state) + { + case X24C02_DEVADDR: + if (bitcnt < 8) + { + data = (byte)(data & (~(1 << (7 - bitcnt)))); + data = (byte)(data | ((sda_in != 0 ? 1 : 0) << (7 - bitcnt))); + } + bitcnt++; + break; + case X24C02_ADDRESS: + if (bitcnt < 8) + { + addr = (byte)(addr & (~(1 << (7 - bitcnt)))); + addr = (byte)(addr | ((sda_in != 0 ? 1 : 0) << (7 - bitcnt))); + } + bitcnt++; + break; + case X24C02_READ: + if (bitcnt < 8) + { + sda = (byte)((data & (1 << (7 - bitcnt))) != 0 ? 1 : 0); + } + bitcnt++; + break; + case X24C02_WRITE: + if (bitcnt < 8) + { + data = (byte)(data & (~(1 << (7 - bitcnt)))); + data = (byte)(data | ((sda_in != 0 ? 1 : 0) << (7 - bitcnt))); + } + bitcnt++; + break; + case X24C02_NAK: + sda = 0xFF; // NAK + break; + case X24C02_ACK: + sda = 0; // ACK + break; + case X24C02_ACK_WAIT: + if (sda_in == 0) + { + next_state = X24C02_READ; + data = pEEPDATA[addr]; + } + break; + } + } + + // SCL ----____ FALL + if (scl_fall != 0) + { + switch (now_state) + { + case X24C02_DEVADDR: + if (bitcnt >= 8) + { + if ((data & 0xA0) == 0xA0) + { + now_state = X24C02_ACK; + rw = (byte)(data & 0x01); + sda = 0xFF; + if (rw != 0) + { + // Now address read + next_state = X24C02_READ; + data = pEEPDATA[addr]; + } + else + { + next_state = X24C02_ADDRESS; + } + bitcnt = 0; + } + else + { + now_state = X24C02_NAK; + next_state = X24C02_IDLE; + sda = 0xFF; + } + } + break; + case X24C02_ADDRESS: + if (bitcnt >= 8) + { + now_state = X24C02_ACK; + sda = 0xFF; + if (rw != 0) + { + // Readでは絶対来ないが念の為 + next_state = X24C02_IDLE; + } + else + { + // to Data Write + next_state = X24C02_WRITE; + } + bitcnt = 0; + } + break; + case X24C02_READ: + if (bitcnt >= 8) + { + now_state = X24C02_ACK_WAIT; + addr = (byte)((addr + 1) & 0xFF); + } + break; + case X24C02_WRITE: + if (bitcnt >= 8) + { + pEEPDATA[addr] = data; + now_state = X24C02_ACK; + next_state = X24C02_WRITE; + addr = (byte)((addr + 1) & 0xFF); + bitcnt = 0; + } + break; + case X24C02_NAK: + now_state = X24C02_IDLE; + bitcnt = 0; + sda = 0xFF; + break; + case X24C02_ACK: + now_state = next_state; + bitcnt = 0; + sda = 0xFF; + break; + case X24C02_ACK_WAIT: + now_state = next_state; + bitcnt = 0; + sda = 0xFF; + break; + } + } + } + + public byte Read() + { + return sda; + } + + public void Load(byte[] p) + { + //now_state = *((INT*)&p[0]); + //next_state = *((INT*)&p[4]); + //bitcnt = *((INT*)&p[8]); + //addr = p[12]; + //data = p[13]; + //rw = p[14]; + //sda = p[15]; + //scl_old = p[16]; + //sda_old = p[17]; + } + + public void Save(byte[] p) + { + //*((INT*)&p[0]) = now_state; + //*((INT*)&p[4]) = next_state; + //*((INT*)&p[8]) = bitcnt; + //p[12] = addr; + //p[13] = data; + //p[14] = rw; + //p[15] = sda; + //p[16] = scl_old; + //p[17] = sda_old; + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/EEPROM.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/EEPROM.cs.meta new file mode 100644 index 0000000..f305afa --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/EEPROM.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: be5901dc72f4b6045a7c33edba28145f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper.cs new file mode 100644 index 0000000..584048e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper.cs @@ -0,0 +1,247 @@ +using System; + +namespace VirtualNes.Core +{ + public abstract class Mapper + { + protected NES nes; + + public Mapper(NES parent) + { + nes = parent; + } + + public virtual void Dispose() { } + + public abstract void Reset(); + + // $8000-$FFFF Memory write + public virtual void Write(ushort addr, byte data) { } + // $8000-$FFFF Memory read(Dummy) + public virtual void Read(ushort addr, byte data) { } + + // $4100-$7FFF Lower Memory read/write + public virtual byte ReadLow(ushort addr) + { + // $6000-$7FFF WRAM + if (addr >= 0x6000 && addr <= 0x7FFF) + { + return MMU.CPU_MEM_BANK[addr >> 13][addr & 0x1FFF]; + } + + return (byte)(addr >> 8); + } + public virtual void WriteLow(ushort addr, byte data) + { + if (addr >= 0x6000 && addr <= 0x7FFF) + { + MMU.CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + } + } + + // $4018-$40FF Extention register read/write + public virtual byte ExRead(ushort addr) { return 0x00; } + public virtual void ExWrite(ushort addr, byte data) { } + + public virtual byte ExCmdRead(EXCMDRD cmd) { return 0x00; } + public virtual void ExCmdWrite(EXCMDWR cmd, byte data) { } + + // H sync/V sync/Clock sync + public virtual void HSync(int scanline) { } + public virtual void VSync() { } + public virtual void Clock(int cycles) { } + // PPU address bus latch + public virtual void PPU_Latch(ushort addr) { } + // PPU Character latch + public virtual void PPU_ChrLatch(ushort addr) { } + // PPU Extension character/palette + public virtual void PPU_ExtLatchX(int x) { } + public virtual void PPU_ExtLatch(ushort addr, ref byte chr_l, ref byte chr_h, ref byte attr) { } + // For State save + public virtual bool IsStateSave() { return false; } + public virtual void SaveState(byte[] p) { } + public virtual void LoadState(byte[] p) { } + + // Extension commands + // For ExCmdRead command + public enum EXCMDRD + { + EXCMDRD_NONE = 0, + EXCMDRD_DISKACCESS, + } + // For ExCmdWrite command + public enum EXCMDWR + { + EXCMDWR_NONE = 0, + EXCMDWR_DISKINSERT, + EXCMDWR_DISKEJECT, + } + + public static Mapper CreateMapper(NES parent, int no) + { + //todo : 实现加载mapper + switch (no) + { + case 0: return new Mapper000(parent); + case 1: return new Mapper001(parent); + case 2: return new Mapper002(parent); + case 3: return new Mapper003(parent); + case 4: return new Mapper004(parent); + case 5: return new Mapper005(parent); + case 6: return new Mapper006(parent); + case 7: return new Mapper007(parent); + case 8: return new Mapper008(parent); + case 9: return new Mapper009(parent); + case 10: return new Mapper010(parent); + case 11: return new Mapper011(parent); + case 12: return new Mapper012(parent); + case 13: return new Mapper013(parent); + case 15: return new Mapper015(parent); + case 16: return new Mapper016(parent); + case 17: return new Mapper017(parent); + case 18: return new Mapper018(parent); + case 19: return new Mapper019(parent); + case 21: return new Mapper021(parent); + case 22: return new Mapper022(parent); + case 23: return new Mapper023(parent); + case 24: return new Mapper024(parent); + case 25: return new Mapper025(parent); + case 26: return new Mapper026(parent); + case 27: return new Mapper027(parent); + case 32: return new Mapper032(parent); + case 33: return new Mapper033(parent); + case 34: return new Mapper034(parent); + case 35: return new Mapper035(parent); + case 40: return new Mapper040(parent); + case 41: return new Mapper041(parent); + case 42: return new Mapper042(parent); + case 43: return new Mapper043(parent); + case 44: return new Mapper044(parent); + case 45: return new Mapper045(parent); + case 46: return new Mapper046(parent); + case 47: return new Mapper047(parent); + case 48: return new Mapper048(parent); + case 50: return new Mapper050(parent); + case 51: return new Mapper051(parent); + case 57: return new Mapper057(parent); + case 58: return new Mapper058(parent); + case 60: return new Mapper060(parent); + case 61: return new Mapper061(parent); + case 62: return new Mapper062(parent); + case 64: return new Mapper064(parent); + case 65: return new Mapper065(parent); + case 66: return new Mapper066(parent); + case 67: return new Mapper067(parent); + case 68: return new Mapper068(parent); + case 69: return new Mapper069(parent); + case 70: return new Mapper070(parent); + case 71: return new Mapper071(parent); + case 72: return new Mapper072(parent); + case 73: return new Mapper073(parent); + case 74: return new Mapper074(parent); + case 75: return new Mapper075(parent); + case 76: return new Mapper076(parent); + case 77: return new Mapper077(parent); + case 78: return new Mapper078(parent); + case 79: return new Mapper079(parent); + case 80: return new Mapper080(parent); + case 82: return new Mapper082(parent); + case 83: return new Mapper083(parent); + case 85: return new Mapper085(parent); + case 86: return new Mapper086(parent); + case 87: return new Mapper087(parent); + case 88: return new Mapper088(parent); + case 89: return new Mapper089(parent); + case 90: return new Mapper090(parent); + case 91: return new Mapper091(parent); + case 92: return new Mapper092(parent); + case 93: return new Mapper093(parent); + case 94: return new Mapper094(parent); + case 95: return new Mapper095(parent); + case 96: return new Mapper096(parent); + case 97: return new Mapper097(parent); + case 99: return new Mapper099(parent); + case 100: return new Mapper100(parent); + case 101: return new Mapper101(parent); + case 105: return new Mapper105(parent); + case 108: return new Mapper108(parent); + case 109: return new Mapper109(parent); + case 110: return new Mapper110(parent); + case 111: return new Mapper111(parent); + case 112: return new Mapper112(parent); + case 113: return new Mapper113(parent); + case 114: return new Mapper114(parent); + case 115: return new Mapper115(parent); + case 116: return new Mapper116(parent); + case 117: return new Mapper117(parent); + case 118: return new Mapper118(parent); + case 119: return new Mapper119(parent); + case 122: return new Mapper122(parent); + case 133: return new Mapper133(parent); + case 134: return new Mapper134(parent); + case 135: return new Mapper135(parent); + case 140: return new Mapper140(parent); + case 142: return new Mapper142(parent); + case 151: return new Mapper151(parent); + case 160: return new Mapper160(parent); + case 162: return new Mapper162(parent); + case 163: return new Mapper163(parent); + case 164: return new Mapper164(parent); + case 165: return new Mapper165(parent); + case 167: return new Mapper167(parent); + case 175: return new Mapper175(parent); + case 176: return new Mapper176(parent); + case 178: return new Mapper178(parent); + case 180: return new Mapper180(parent); + case 181: return new Mapper181(parent); + case 182: return new Mapper182(parent); + case 183: return new Mapper183(parent); + case 185: return new Mapper185(parent); + case 187: return new Mapper187(parent); + case 188: return new Mapper188(parent); + case 189: return new Mapper189(parent); + case 190: return new Mapper190(parent); + case 191: return new Mapper191(parent); + case 192: return new Mapper192(parent); + case 193: return new Mapper193(parent); + case 194: return new Mapper194(parent); + case 195: return new Mapper195(parent); + case 198: return new Mapper198(parent); + case 199: return new Mapper199(parent); + case 200: return new Mapper200(parent); + case 201: return new Mapper201(parent); + case 202: return new Mapper202(parent); + case 216: return new Mapper216(parent); + case 222: return new Mapper222(parent); + case 225: return new Mapper225(parent); + case 226: return new Mapper226(parent); + case 227: return new Mapper227(parent); + case 228: return new Mapper228(parent); + case 229: return new Mapper229(parent); + case 230: return new Mapper230(parent); + case 231: return new Mapper231(parent); + case 232: return new Mapper232(parent); + case 233: return new Mapper233(parent); + case 234: return new Mapper234(parent); + case 235: return new Mapper235(parent); + case 236: return new Mapper236(parent); + case 240: return new Mapper240(parent); + case 241: return new Mapper241(parent); + case 242: return new Mapper242(parent); + case 243: return new Mapper243(parent); + case 244: return new Mapper244(parent); + case 245: return new Mapper245(parent); + case 246: return new Mapper246(parent); + case 248: return new Mapper248(parent); + case 249: return new Mapper249(parent); + case 251: return new Mapper251(parent); + case 252: return new Mapper252(parent); + case 254: return new Mapper254(parent); + case 255: return new Mapper255(parent); + + default: + throw new NotImplementedException($"Mapper#{no:000} is not Impl"); + } + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper.cs.meta new file mode 100644 index 0000000..dac6129 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9c095219b80f9234fb1a9a87f6fbf004 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper000.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper000.cs new file mode 100644 index 0000000..1146b6e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper000.cs @@ -0,0 +1,47 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper000 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper000 : Mapper + { + + public Mapper000(NES parent) : base(parent) { } + + public override void Reset() + { + switch (PROM_16K_SIZE) + { + default: + case 1: // 16K only + SetPROM_16K_Bank(4, 0); + SetPROM_16K_Bank(6, 0); + break; + case 2: // 32K + SetPROM_32K_Bank(0); + break; + } + + uint crc = nes.rom.GetPROM_CRC(); + if (crc == 0x4e7db5af) + { // Circus Charlie(J) + nes.SetRenderMethod(EnumRenderMethod.POST_RENDER); + } + if (crc == 0x57970078) + { // F-1 Race(J) + nes.SetRenderMethod(EnumRenderMethod.POST_RENDER); + } + if (crc == 0xaf2bbcbc // Mach Rider(JU) + || crc == 0x3acd4bf1) + { // Mach Rider(Alt)(JU) + nes.SetRenderMethod(EnumRenderMethod.POST_RENDER); + } + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper000.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper000.cs.meta new file mode 100644 index 0000000..2a27c36 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper000.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c57bc13f96a8d064a885b65c6aebc351 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper001.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper001.cs new file mode 100644 index 0000000..9cb16d8 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper001.cs @@ -0,0 +1,416 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper001 Nintendo MMC1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper001 : Mapper + { + + uint last_addr; + + BYTE patch; + BYTE wram_patch; + BYTE wram_bank; + BYTE wram_count; + + BYTE[] reg = new byte[4]; + BYTE shift, regbuf; + + public Mapper001(NES parent) : base(parent) { } + + public override void Reset() + { + reg[0] = 0x0C; // D3=1,D2=1 + reg[1] = reg[2] = reg[3] = 0; + shift = regbuf = 0; + + patch = 0; + wram_patch = 0; + + if (PROM_16K_SIZE < 32) + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + else + { + // For 512K/1M byte Cartridge + SetPROM_16K_Bank(4, 0); + SetPROM_16K_Bank(6, 16 - 1); + + patch = 1; + } + + if (VROM_8K_SIZE != 0) + { + // SetVROM_8K_Bank( 0 ); + } + + uint crc = nes.rom.GetPROM_CRC(); + + if (crc == 0xb8e16bd0) + { // Snow Bros.(J) + patch = 2; + } + // if( crc == 0x9b565541 ) { // Triathron, The(J) + // nes.SetFrameIRQmode( FALSE ); + // } + if (crc == 0xc96c6f04) + { // Venus Senki(J) + nes.SetRenderMethod(EnumRenderMethod.POST_ALL_RENDER); + } + // if( crc == 0x5e3f7004 ) { // Softball Tengoku(J) + // } + + if (crc == 0x4d2edf70) + { // Night Rider(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + if (crc == 0xcd2a73f0) + { // Pirates!(U) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + patch = 2; + } + + // if( crc == 0x09efe54b ) { // Majaventure - Mahjong Senki(J) + // nes.SetFrameIRQmode( FALSE ); + // } + + if (crc == 0x11469ce3) + { // Viva! Las Vegas(J) + } + if (crc == 0xd878ebf5) + { // Ninja Ryukenden(J) + nes.SetRenderMethod(EnumRenderMethod.POST_ALL_RENDER); + } + + // if( crc == 0x7bd7b849 ) { // Nekketsu Koukou - Dodgeball Bu(J) + // } + + if (crc == 0x466efdc2) + { // Final Fantasy(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + nes.ppu.SetExtMonoMode(true); + } + if (crc == 0xc9556b36) + { // Final Fantasy I&II(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + nes.ppu.SetExtMonoMode(true); + nes.SetSAVERAM_SIZE(16 * 1024); + wram_patch = 2; + } + + if (crc == 0x717e1169) + { // Cosmic Wars(J) + nes.SetRenderMethod(EnumRenderMethod.PRE_ALL_RENDER); + } + + if (crc == 0xC05D2034) + { // Snake's Revenge(U) + nes.SetRenderMethod(EnumRenderMethod.PRE_ALL_RENDER); + } + + if (crc == 0xb8747abf // Best Play - Pro Yakyuu Special(J) + || crc == 0x29449ba9 // Nobunaga no Yabou - Zenkoku Ban(J) + || crc == 0x2b11e0b0 // Nobunaga no Yabou - Zenkoku Ban(J)(alt) + || crc == 0x4642dda6 // Nobunaga's Ambition(U) + || crc == 0xfb69743a // Aoki Ookami to Shiroki Mejika - Genghis Khan(J) + || crc == 0x2225c20f // Genghis Khan(U) + || crc == 0xabbf7217 // Sangokushi(J) + ) + { + + nes.SetSAVERAM_SIZE(16 * 1024); + wram_patch = 1; + wram_bank = 0; + wram_count = 0; + } + } + + private ArrayRef _PROM_BANK = new ArrayRef(); + //void Mapper001::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + // DEBUGOUT( "MMC1 %04X=%02X\n", addr&0xFFFF,data&0xFF ); + + if (wram_patch == 1 && addr == 0xBFFF) + { + wram_count++; + wram_bank += (byte)(data & 0x01); + if (wram_count == 5) + { + if (wram_bank != 0) + { + _PROM_BANK.SetArray(WRAM, 0x2000); + SetPROM_Bank(3, _PROM_BANK, BANKTYPE_RAM); + } + else + { + _PROM_BANK.SetArray(WRAM, 0x0000); + SetPROM_Bank(3, _PROM_BANK, BANKTYPE_RAM); + } + wram_bank = wram_count = 0; + } + } + + if (patch != 1) + { + if ((addr & 0x6000) != (last_addr & 0x6000)) + { + shift = regbuf = 0; + } + last_addr = addr; + } + + if ((data & 0x80) != 0) + { + shift = regbuf = 0; + // reg[0] = 0x0C; // D3=1,D2=1 + reg[0] |= 0x0C; // D3=1,D2=1 残りはリセットされない + return; + } + + if ((data & 0x01) != 0) regbuf |= (byte)(1 << shift); + if (++shift < 5) + return; + addr = (ushort)((addr & 0x7FFF) >> 13); + reg[addr] = regbuf; + + // DEBUGOUT( "MMC1 %d=%02X\n", addr&0xFFFF,regbuf&0xFF ); + + regbuf = 0; + shift = 0; + + if (patch != 1) + { + // For Normal Cartridge + switch (addr) + { + case 0: + if ((reg[0] & 0x02) != 0) + { + if ((reg[0] & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + else + { + if ((reg[0] & 0x01) != 0) SetVRAM_Mirror(VRAM_MIRROR4H); + else SetVRAM_Mirror(VRAM_MIRROR4L); + } + break; + case 1: + // Register #1 + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x10) != 0) + { + // CHR 4K bank lower($0000-$0FFF) + SetVROM_4K_Bank(0, reg[1]); + // CHR 4K bank higher($1000-$1FFF) + SetVROM_4K_Bank(4, reg[2]); + } + else + { + // CHR 8K bank($0000-$1FFF) + SetVROM_8K_Bank(reg[1] >> 1); + } + } + else + { + // For Romancia + if ((reg[0] & 0x10) != 0) + { + SetCRAM_4K_Bank(0, reg[1]); + } + } + break; + case 2: + // Register #2 + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x10) != 0) + { + // CHR 4K bank lower($0000-$0FFF) + SetVROM_4K_Bank(0, reg[1]); + // CHR 4K bank higher($1000-$1FFF) + SetVROM_4K_Bank(4, reg[2]); + } + else + { + // CHR 8K bank($0000-$1FFF) + SetVROM_8K_Bank(reg[1] >> 1); + } + } + else + { + // For Romancia + if ((reg[0] & 0x10) != 0) + { + SetCRAM_4K_Bank(4, reg[2]); + } + } + break; + case 3: + if (!((reg[0] & 0x08) != 0)) + { + // PRG 32K bank ($8000-$FFFF) + SetPROM_32K_Bank(reg[3] >> 1); + } + else + { + if ((reg[0] & 0x04) != 0) + { + // PRG 16K bank ($8000-$BFFF) + SetPROM_16K_Bank(4, reg[3]); + SetPROM_16K_Bank(6, PROM_16K_SIZE - 1); + } + else + { + // PRG 16K bank ($C000-$FFFF) + SetPROM_16K_Bank(6, reg[3]); + SetPROM_16K_Bank(4, 0); + } + } + break; + } + } + else + { + // For 512K/1M byte Cartridge + INT PROM_BASE = 0; + if (PROM_16K_SIZE >= 32) + { + PROM_BASE = reg[1] & 0x10; + } + + // For FinalFantasy I&II + if (wram_patch == 2) + { + if (((reg[1] & 0x18) == 0)) + { + _PROM_BANK.SetArray(WRAM, 0x0000); + SetPROM_Bank(3, _PROM_BANK, BANKTYPE_RAM); + } + else + { + _PROM_BANK.SetArray(WRAM, 0x2000); + SetPROM_Bank(3, _PROM_BANK, BANKTYPE_RAM); + } + } + + // Register #0 + if (addr == 0) + { + if ((reg[0] & 0x02) != 0) + { + if ((reg[0] & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + else + { + if ((reg[0] & 0x01) != 0) SetVRAM_Mirror(VRAM_MIRROR4H); + else SetVRAM_Mirror(VRAM_MIRROR4L); + } + } + // Register #1 + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x10) != 0) + { + // CHR 4K bank lower($0000-$0FFF) + SetVROM_4K_Bank(0, reg[1]); + } + else + { + // CHR 8K bank($0000-$1FFF) + SetVROM_8K_Bank(reg[1] >> 1); + } + } + else + { + // For Romancia + if ((reg[0] & 0x10) != 0) + { + SetCRAM_4K_Bank(0, reg[1]); + } + } + // Register #2 + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x10) != 0) + { + // CHR 4K bank higher($1000-$1FFF) + SetVROM_4K_Bank(4, reg[2]); + } + } + else + { + // For Romancia + if ((reg[0] & 0x10) != 0) + { + SetCRAM_4K_Bank(4, reg[2]); + } + } + // Register #3 + if (((reg[0] & 0x08) == 0)) + { + // PRG 32K bank ($8000-$FFFF) + SetPROM_32K_Bank((reg[3] & (0xF + PROM_BASE)) >> 1); + } + else + { + if ((reg[0] & 0x04) != 0) + { + // PRG 16K bank ($8000-$BFFF) + SetPROM_16K_Bank(4, PROM_BASE + (reg[3] & 0x0F)); + if (PROM_16K_SIZE >= 32) SetPROM_16K_Bank(6, PROM_BASE + 16 - 1); + } + else + { + // PRG 16K bank ($C000-$FFFF) + SetPROM_16K_Bank(6, PROM_BASE + (reg[3] & 0x0F)); + if (PROM_16K_SIZE >= 32) SetPROM_16K_Bank(4, PROM_BASE); + } + } + } + } + + //void Mapper001::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg[0]; + p[1] = reg[1]; + p[2] = reg[2]; + p[3] = reg[3]; + p[4] = shift; + p[5] = regbuf; + + p[6] = wram_bank; + p[7] = wram_count; + } + + //void Mapper001::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg[0] = p[0]; + reg[1] = p[1]; + reg[2] = p[2]; + reg[3] = p[3]; + shift = p[4]; + regbuf = p[5]; + + wram_bank = p[6]; + wram_count = p[7]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper001.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper001.cs.meta new file mode 100644 index 0000000..8aa5386 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper001.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c921e7f594a988845856d30f6a925157 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper002.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper002.cs new file mode 100644 index 0000000..eacb44f --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper002.cs @@ -0,0 +1,72 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper002 UNROM // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper002 : Mapper + { + + BYTE patch; + public Mapper002(NES parent) : base(parent) { } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + patch = 0; + + uint crc = nes.rom.GetPROM_CRC(); + // if( crc == 0x322c9b09 ) { // Metal Gear (Alt)(J) + //// nes.SetFrameIRQmode( FALSE ); + // } + // if( crc == 0xe7a3867b ) { // Dragon Quest 2(Alt)(J) + // nes.SetFrameIRQmode( FALSE ); + // } + //// if( crc == 0x9622fbd9 ) { // Ballblazer(J) + //// patch = 0; + //// } + if (crc == 0x8c3d54e8 // Ikari(J) + || crc == 0x655efeed // Ikari Warriors(U) + || crc == 0x538218b2) + { // Ikari Warriors(E) + patch = 1; + } + + if (crc == 0xb20c1030) + { // Shanghai(J)(original) + patch = 2; + } + } + + + //void Mapper002::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (!nes.rom.IsSAVERAM()) + { + if (addr >= 0x5000 && patch == 1) + SetPROM_16K_Bank(4, data); + } + else + { + base.WriteLow(addr, data); + } + } + + //void Mapper002::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if (patch != 2) + SetPROM_16K_Bank(4, data); + else + SetPROM_16K_Bank(4, data >> 4); + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper002.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper002.cs.meta new file mode 100644 index 0000000..fcbc878 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper002.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bb072eff593853c41974a6d3b8bc1f93 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper003.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper003.cs new file mode 100644 index 0000000..c96d13c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper003.cs @@ -0,0 +1,66 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper003 CNROM // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper003 : Mapper + { + + public Mapper003(NES parent) : base(parent) { } + + public override void Reset() + { + switch (PROM_16K_SIZE) + { + case 1: // 16K only + SetPROM_16K_Bank(4, 0); + SetPROM_16K_Bank(6, 0); + break; + case 2: // 32K + SetPROM_32K_Bank(0); + break; + } + // nes.SetRenderMethod( NES::TILE_RENDER ); + uint crc = nes.rom.GetPROM_CRC(); + + if (crc == 0x2b72fe7e) + { // Ganso Saiyuuki - Super Monkey Dai Bouken(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + nes.ppu.SetExtNameTableMode(true); + } + + // if( crc == 0xE44D95B5 ) { // ひみつw + // } + } + +#if FALSE//0 +void Mapper003::WriteLow( WORD addr, BYTE data ) +{ + if( patch ) { + Mapper::WriteLow( addr, data ); + } else { + if( nes.rom.IsSAVERAM() ) { + Mapper::WriteLow( addr, data ); + } else { + if( addr >= 0x4800 ) { + SetVROM_8K_Bank( data & 0x03 ); + } + } + } +} +#endif + + //void Mapper003::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + SetVROM_8K_Bank(data); + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper003.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper003.cs.meta new file mode 100644 index 0000000..63b4e2e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper003.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d63147469fd9c5540882a5a89799462b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper004.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper004.cs new file mode 100644 index 0000000..644b64a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper004.cs @@ -0,0 +1,576 @@ +//using Codice.CM.Client.Differences; +using System; + +namespace VirtualNes.Core +{ + public class Mapper004 : Mapper + { + private const int MMC3_IRQ_KLAX = 1; + private const int MMC3_IRQ_SHOUGIMEIKAN = 2; + private const int MMC3_IRQ_DAI2JISUPER = 3; + private const int MMC3_IRQ_DBZ2 = 4; + private const int MMC3_IRQ_ROCKMAN3 = 5; + + protected byte[] reg = new byte[8]; + protected byte prg0, prg1; + protected byte chr01, chr23, chr4, chr5, chr6, chr7; + protected byte we_sram; + + protected byte irq_type; + protected byte irq_enable; + protected byte irq_counter; + protected byte irq_latch; + protected byte irq_request; + protected byte irq_preset; + protected byte irq_preset_vbl; + + protected byte vs_patch; + protected byte vs_index; + + private byte[] VS_TKO_Security = new byte[32] + { + 0xff, 0xbf, 0xb7, 0x97, 0x97, 0x17, 0x57, 0x4f, + 0x6f, 0x6b, 0xeb, 0xa9, 0xb1, 0x90, 0x94, 0x14, + 0x56, 0x4e, 0x6f, 0x6b, 0xeb, 0xa9, 0xb1, 0x90, + 0xd4, 0x5c, 0x3e, 0x26, 0x87, 0x83, 0x13, 0x00 + }; + + public Mapper004(NES parent) : base(parent) { } + + public override void Reset() + { + for (int i = 0; i < 8; i++) + { + reg[i] = 0x00; + } + + prg0 = 0; + prg1 = 1; + SetBank_CPU(); + + chr01 = 0; + chr23 = 2; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + SetBank_PPU(); + + we_sram = 0; // Disable + irq_enable = 0; // Disable + irq_counter = 0; + irq_latch = 0xFF; + irq_request = 0; + irq_preset = 0; + irq_preset_vbl = 0; + + // IRQ僞僀僾愝掕 + nes.SetIrqType(NES.IRQMETHOD.IRQ_CLOCK); + irq_type = 0; + + uint crc = nes.rom.GetPROM_CRC(); + + if (crc == 0x5c707ac4) + { // Mother(J) + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + if (crc == 0xcb106f49) + { // F-1 Sensation(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + if (crc == 0x1170392a) + { // Karakuri Kengou Den - Musashi Road - Karakuri Nin Hashiru!(J) + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + } + if (crc == 0x14a01c70) + { // Gun-Dec(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + if (crc == 0xeffeea40) + { // For Klax(J) + irq_type = MMC3_IRQ_KLAX; + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + if (crc == 0xc17ae2dc) + { // God Slayer - Haruka Tenkuu no Sonata(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + if (crc == 0x126ea4a0) + { // Summer Carnival '92 - Recca(J) + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + } + if (crc == 0x1f2f4861) + { // J League Fighting Soccer - The King of Ace Strikers(J) + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + } + if (crc == 0x5a6860f1) + { // Shougi Meikan '92(J) + irq_type = MMC3_IRQ_SHOUGIMEIKAN; + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + } + if (crc == 0xae280e20) + { // Shougi Meikan '93(J) + irq_type = MMC3_IRQ_SHOUGIMEIKAN; + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + } + if (crc == 0xe19a2473) + { // Sugoro Quest - Dice no Senshi Tachi(J) + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + if (crc == 0x702d9b33) + { // Star Wars - The Empire Strikes Back(Victor)(J) + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + } + if (crc == 0xa9a0d729) + { // Dai Kaijuu - Deburas(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + if (crc == 0xc5fea9f2) + { // Dai 2 Ji - Super Robot Taisen(J) + irq_type = MMC3_IRQ_DAI2JISUPER; + } + if (crc == 0xd852c2f7) + { // Time Zone(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + if (crc == 0xecfd3c69) + { // Taito Chase H.Q.(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + if (crc == 0x7a748058) + { // Tom & Jerry (and Tuffy)(J) + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + } + if (crc == 0xaafe699c) + { // Ninja Ryukenden 3 - Yomi no Hakobune(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + if (crc == 0x6cc62c06) + { // Hoshi no Kirby - Yume no Izumi no Monogatari(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + if (crc == 0x877dba77) + { // My Life My Love - Boku no Yume - Watashi no Negai(J) + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + } + if (crc == 0x6f96ed15) + { // Max Warrior - Wakusei Kaigenrei(J) + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + } + if (crc == 0x8685f366) + { // Matendouji(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + if (crc == 0x8635fed1) + { // Mickey Mouse 3 - Yume Fuusen(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + if (crc == 0x26ff3ea2) + { // Yume Penguin Monogatari(J) + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + } + if (crc == 0x7671bc51) + { // Red Ariimaa 2(J) + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + } + if (crc == 0xade11141) + { // Wanpaku Kokkun no Gourmet World(J) + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + } + if (crc == 0x7c7ab58e) + { // Walkuere no Bouken - Toki no Kagi Densetsu(J) + nes.SetRenderMethod(EnumRenderMethod.POST_RENDER); + } + if (crc == 0x26ff3ea2) + { // Yume Penguin Monogatari(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + if (crc == 0x126ea4a0) + { // Summer Carnival '92 Recca(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + + if (crc == 0x1d2e5018 // Rockman 3(J) + || crc == 0x6b999aaf) + { // Megaman 3(U) + irq_type = MMC3_IRQ_ROCKMAN3; + } + + if (crc == 0xd88d48d7) + { // Kick Master(U) + irq_type = MMC3_IRQ_ROCKMAN3; + } + + if (crc == 0xA67EA466) + { // Alien 3(U) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + + if (crc == 0xe763891b) + { // DBZ2 + irq_type = MMC3_IRQ_DBZ2; + } + + // VS-Unisystem + vs_patch = 0; + vs_index = 0; + + if (crc == 0xeb2dba63 // VS TKO Boxing + || crc == 0x98cfe016) + { // VS TKO Boxing (Alt) + vs_patch = 1; + } + if (crc == 0x135adf7c) + { // VS Atari RBI Baseball + vs_patch = 2; + } + if (crc == 0xf9d3b0a3 // VS Super Xevious + || crc == 0x9924980a // VS Super Xevious (b1) + || crc == 0x66bb838f) + { // VS Super Xevious (b2) + vs_patch = 3; + } + } + + private void SetBank_PPU() + { + if (MMU.VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x80) != 0) + { + MMU.SetVROM_8K_Bank(chr4, chr5, chr6, chr7, + chr01, chr01 + 1, chr23, chr23 + 1); + } + else + { + MMU.SetVROM_8K_Bank(chr01, chr01 + 1, chr23, chr23 + 1, + chr4, chr5, chr6, chr7); + } + } + else + { + if ((reg[0] & 0x80) != 0) + { + MMU.SetCRAM_1K_Bank(4, (chr01 + 0) & 0x07); + MMU.SetCRAM_1K_Bank(5, (chr01 + 1) & 0x07); + MMU.SetCRAM_1K_Bank(6, (chr23 + 0) & 0x07); + MMU.SetCRAM_1K_Bank(7, (chr23 + 1) & 0x07); + MMU.SetCRAM_1K_Bank(0, chr4 & 0x07); + MMU.SetCRAM_1K_Bank(1, chr5 & 0x07); + MMU.SetCRAM_1K_Bank(2, chr6 & 0x07); + MMU.SetCRAM_1K_Bank(3, chr7 & 0x07); + } + else + { + MMU.SetCRAM_1K_Bank(0, (chr01 + 0) & 0x07); + MMU.SetCRAM_1K_Bank(1, (chr01 + 1) & 0x07); + MMU.SetCRAM_1K_Bank(2, (chr23 + 0) & 0x07); + MMU.SetCRAM_1K_Bank(3, (chr23 + 1) & 0x07); + MMU.SetCRAM_1K_Bank(4, chr4 & 0x07); + MMU.SetCRAM_1K_Bank(5, chr5 & 0x07); + MMU.SetCRAM_1K_Bank(6, chr6 & 0x07); + MMU.SetCRAM_1K_Bank(7, chr7 & 0x07); + } + } + } + + public override byte ReadLow(ushort addr) + { + if (vs_patch == 0) + { + if (addr >= 0x5000 && addr <= 0x5FFF) + { + return MMU.XRAM[addr - 0x4000]; + } + } + else if (vs_patch == 1) + { + // VS TKO Boxing Security + if (addr == 0x5E00) + { + vs_index = 0; + return 0x00; + } + else if (addr == 0x5E01) + { + return VS_TKO_Security[(vs_index++) & 0x1F]; + } + } + else if (vs_patch == 2) + { + // VS Atari RBI Baseball Security + if (addr == 0x5E00) + { + vs_index = 0; + return 0x00; + } + else if (addr == 0x5E01) + { + if (vs_index++ == 9) + return 0x6F; + else + return 0xB4; + } + } + else if (vs_patch == 3) + { + // VS Super Xevious + switch (addr) + { + case 0x54FF: + return 0x05; + case 0x5678: + if (vs_index != 0) + return 0x00; + else + return 0x01; + case 0x578f: + if (vs_index != 0) + return 0xD1; + else + return 0x89; + case 0x5567: + if (vs_index != 0) + { + vs_index = 0; + return 0x3E; + } + else + { + vs_index = 1; + return 0x37; + } + default: + break; + } + } + + return base.ReadLow(addr); + } + + public override void WriteLow(ushort addr, byte data) + { + if (addr >= 0x5000 && addr <= 0x5FFF) + { + MMU.XRAM[addr - 0x4000] = data; + } + else + { + base.WriteLow(addr, data); + } + } + + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE001) + { + case 0x8000: + reg[0] = data; + SetBank_CPU(); + SetBank_PPU(); + break; + case 0x8001: + reg[1] = data; + + switch (reg[0] & 0x07) + { + case 0x00: + chr01 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x01: + chr23 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x02: + chr4 = data; + SetBank_PPU(); + break; + case 0x03: + chr5 = data; + SetBank_PPU(); + break; + case 0x04: + chr6 = data; + SetBank_PPU(); + break; + case 0x05: + chr7 = data; + SetBank_PPU(); + break; + case 0x06: + prg0 = data; + SetBank_CPU(); + break; + case 0x07: + prg1 = data; + SetBank_CPU(); + break; + } + break; + case 0xA000: + reg[2] = data; + if (!nes.rom.Is4SCREEN()) + { + if ((data & 0x01) != 0) MMU.SetVRAM_Mirror(MMU.VRAM_HMIRROR); + else MMU.SetVRAM_Mirror(MMU.VRAM_VMIRROR); + } + break; + case 0xA001: + reg[3] = data; + //DEBUGOUT( "MPRWR A=%04X D=%02X L=%3d CYC=%d\n", addr&0xFFFF, data&0xFF, nes->GetScanline(), nes->cpu->GetTotalCycles() ); + break; + case 0xC000: + //DEBUGOUT( "MPRWR A=%04X D=%02X L=%3d CYC=%d\n", addr&0xFFFF, data&0xFF, nes->GetScanline(), nes->cpu->GetTotalCycles() ); + reg[4] = data; + if (irq_type == MMC3_IRQ_KLAX || irq_type == MMC3_IRQ_ROCKMAN3) + { + irq_counter = data; + } + else + { + irq_latch = data; + } + if (irq_type == MMC3_IRQ_DBZ2) + { + irq_latch = 0x07; + } + break; + case 0xC001: + reg[5] = data; + if (irq_type == MMC3_IRQ_KLAX || irq_type == MMC3_IRQ_ROCKMAN3) + { + irq_latch = data; + } + else + { + if ((nes.GetScanline() < 240) || (irq_type == MMC3_IRQ_SHOUGIMEIKAN)) + { + irq_counter |= 0x80; + irq_preset = 0xFF; + } + else + { + irq_counter |= 0x80; + irq_preset_vbl = 0xFF; + irq_preset = 0; + } + } + break; + case 0xE000: + reg[6] = data; + irq_enable = 0; + irq_request = 0; + + nes.cpu.ClrIRQ(CPU.IRQ_MAPPER); + break; + case 0xE001: + reg[7] = data; + irq_enable = 1; + irq_request = 0; + + // nes->cpu->ClrIRQ( IRQ_MAPPER ); + break; + } + } + + public override void Clock(int cycles) + { + + } + + public override void HSync(int scanline) + { + if (irq_type == MMC3_IRQ_KLAX) + { + if ((scanline >= 0 && scanline <= 239) && nes.ppu.IsDispON()) + { + if (irq_enable != 0) + { + if (irq_counter == 0) + { + irq_counter = irq_latch; + irq_request = 0xFF; + } + if (irq_counter > 0) + { + irq_counter--; + } + } + } + if (irq_request != 0) + { + nes.cpu.SetIRQ(CPU.IRQ_MAPPER); + } + } + else if (irq_type == MMC3_IRQ_ROCKMAN3) + { + if ((scanline >= 0 && scanline <= 239) && nes.ppu.IsDispON()) + { + if (irq_enable != 0) + { + if ((--irq_counter) == 0) + { + irq_request = 0xFF; + irq_counter = irq_latch; + } + } + } + if (irq_request != 0) + { + nes.cpu.SetIRQ(CPU.IRQ_MAPPER); + } + } + else + { + if ((scanline >= 0 && scanline <= 239) && nes.ppu.IsDispON()) + { + if (irq_preset_vbl != 0) + { + irq_counter = irq_latch; + irq_preset_vbl = 0; + } + if (irq_preset != 0) + { + irq_counter = irq_latch; + irq_preset = 0; + if (irq_type == MMC3_IRQ_DAI2JISUPER && scanline == 0) + { + irq_counter--; + } + } + else if (irq_counter > 0) + { + irq_counter--; + } + + if (irq_counter == 0) + { + if (irq_enable != 0) + { + irq_request = 0xFF; + + nes.cpu.SetIRQ(CPU.IRQ_MAPPER); + } + irq_preset = 0xFF; + } + } + } + } + + private void SetBank_CPU() + { + if ((reg[0] & 0x40) != 0) + { + MMU.SetPROM_32K_Bank(MMU.PROM_8K_SIZE - 2, prg1, prg0, MMU.PROM_8K_SIZE - 1); + } + else + { + MMU.SetPROM_32K_Bank(prg0, prg1, MMU.PROM_8K_SIZE - 2, MMU.PROM_8K_SIZE - 1); + } + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper004.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper004.cs.meta new file mode 100644 index 0000000..cdf97fb --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper004.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1be6fcc00c619e84cbf0d5d92701b2e3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper005.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper005.cs new file mode 100644 index 0000000..af8e3b8 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper005.cs @@ -0,0 +1,846 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper005 Nintendo MMC5 // +////////////////////////////////////////////////////////////////////////// +using System; +using static VirtualNes.Core.CPU; +using static VirtualNes.Core.PPU; +using static VirtualNes.MMU; +using BYTE = System.Byte; +using INT = System.Int32; + +namespace VirtualNes.Core +{ + public class Mapper005 : Mapper + { + public const int MMC5_IRQ_METAL = 1 << 0; + + BYTE sram_size; + + BYTE prg_size; // $5100 + BYTE chr_size; // $5101 + BYTE sram_we_a, sram_we_b; // $5102-$5103 + BYTE graphic_mode; // $5104 + BYTE nametable_mode; // $5105 + BYTE[] nametable_type = new byte[4]; // $5105 use + + BYTE sram_page; // $5113 + + BYTE fill_chr, fill_pal; // $5106-$5107 + BYTE split_control; // $5200 + BYTE split_scroll; // $5201 + BYTE split_page; // $5202 + + BYTE split_x; + ushort split_addr; + ushort split_yofs; + + BYTE chr_type; + BYTE chr_mode; // $5120-$512B use + //BYTE chr_page[2][8]; + BYTE[,] chr_page = new byte[2, 8]; // $5120-$512B + // BGパターン用バンク + ArrayRef[] BG_MEM_BANK = new ArrayRef[8]{ + new ArrayRef(), + new ArrayRef(), + new ArrayRef(), + new ArrayRef(), + new ArrayRef(), + new ArrayRef(), + new ArrayRef(), + new ArrayRef(), + }; + BYTE[] BG_MEM_PAGE = new byte[8]; + + BYTE irq_status; // $5204(R) + BYTE irq_enable; // $5204(W) + BYTE irq_line; // $5203 + BYTE irq_scanline; + BYTE irq_clear; // HSyncで使用 + BYTE irq_type; + + BYTE mult_a, mult_b; // $5205-$5206 + public Mapper005(NES parent) : base(parent) { } + + public override void Reset() + { + byte i; + + prg_size = 3; + chr_size = 3; + + sram_we_a = 0x00; + sram_we_b = 0x00; + + graphic_mode = 0; + nametable_mode = 0; + + for (i = 0; i < 4; i++) + { + nametable_type[i] = 0; + } + + fill_chr = fill_pal = 0; + split_control = split_scroll = split_page = 0; + + irq_enable = 0; + irq_status = 0; + irq_scanline = 0; + irq_line = 0; + irq_clear = 0; + + irq_type = 0; + + mult_a = mult_b = 0; + + chr_type = 0; + chr_mode = 0; + for (i = 0; i < 8; i++) + { + chr_page[0, i] = i; + chr_page[1, i] = (byte)(4 + (i & 0x03)); + } + + SetPROM_32K_Bank(PROM_8K_SIZE - 1, PROM_8K_SIZE - 1, PROM_8K_SIZE - 1, PROM_8K_SIZE - 1); + SetVROM_8K_Bank(0); + + for (i = 0; i < 8; i++) + { + BG_MEM_BANK[i].SetArray(VROM, 0x0400 * i); + BG_MEM_PAGE[i] = i; + } + + // SRAM設定 + SetBank_SRAM(3, 0); + + sram_size = 0; + nes.SetSAVERAM_SIZE(16 * 1024); + + uint crc = nes.rom.GetPROM_CRC(); + + if (crc == 0x2b548d75 // Bandit Kings of Ancient China(U) + || crc == 0xf4cd4998 // Dai Koukai Jidai(J) + || crc == 0x8fa95456 // Ishin no Arashi(J) + || crc == 0x98c8e090 // Nobunaga no Yabou - Sengoku Gunyuu Den(J) + || crc == 0x8e9a5e2f // L'Empereur(Alt)(U) + || crc == 0x57e3218b // L'Empereur(U) + || crc == 0x2f50bd38 // L'Empereur(J) + || crc == 0xb56958d1 // Nobunaga's Ambition 2(U) + || crc == 0xe6c28c5f // Suikoden - Tenmei no Chikai(J) + || crc == 0xcd35e2e9) + { // Uncharted Waters(U) + sram_size = 1; + nes.SetSAVERAM_SIZE(32 * 1024); + } + else + if (crc == 0xf4120e58 // Aoki Ookami to Shiroki Mejika - Genchou Hishi(J) + || crc == 0x286613d8 // Nobunaga no Yabou - Bushou Fuuun Roku(J) + || crc == 0x11eaad26 // Romance of the Three Kingdoms 2(U) + || crc == 0x95ba5733) + { // Sangokushi 2(J) + sram_size = 2; + nes.SetSAVERAM_SIZE(64 * 1024); + } + + if (crc == 0x95ca9ec7) + { // Castlevania 3 - Dracula's Curse(U) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + + if (crc == 0xcd9acf43) + { // Metal Slader Glory(J) + irq_type = MMC5_IRQ_METAL; + } + + if (crc == 0xe91548d8) + { // Shin 4 Nin Uchi Mahjong - Yakuman Tengoku(J) + chr_type = 1; + } + + nes.ppu.SetExtLatchMode(true); + nes.apu.SelectExSound(8); + } + + //BYTE Mapper005::ReadLow(WORD addr) + public override byte ReadLow(ushort addr) + { + BYTE data = (BYTE)(addr >> 8); + + switch (addr) + { + case 0x5015: + data = nes.apu.ExRead(addr); + break; + + case 0x5204: + data = irq_status; + // irq_status = 0; + irq_status = (byte)(irq_status & ~0x80); + + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0x5205: + data = (byte)(mult_a * mult_b); + break; + case 0x5206: + data = (BYTE)((mult_a * mult_b) >> 8); + break; + } + + if (addr >= 0x5C00 && addr <= 0x5FFF) + { + if (graphic_mode >= 2) + { // ExRAM mode + data = VRAM[0x0800 + (addr & 0x3FF)]; + } + } + else if (addr >= 0x6000 && addr <= 0x7FFF) + { + data = base.ReadLow(addr); + } + + return data; + } + + //void Mapper005::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + byte i; + + switch (addr) + { + case 0x5100: + prg_size = (byte)(data & 0x03); + break; + case 0x5101: + chr_size = (byte)(data & 0x03); + break; + + case 0x5102: + sram_we_a = (byte)(data & 0x03); + break; + case 0x5103: + sram_we_b = (byte)(data & 0x03); + break; + + case 0x5104: + graphic_mode = (byte)(data & 0x03); + break; + case 0x5105: + nametable_mode = data; + for (i = 0; i < 4; i++) + { + nametable_type[i] = (byte)(data & 0x03); + SetVRAM_1K_Bank((byte)(8 + i), nametable_type[i]); + data >>= 2; + } + break; + + case 0x5106: + fill_chr = data; + break; + case 0x5107: + fill_pal = (byte)(data & 0x03); + break; + + case 0x5113: + SetBank_SRAM(3, (byte)(data & 0x07)); + break; + + case 0x5114: + case 0x5115: + case 0x5116: + case 0x5117: + SetBank_CPU(addr, data); + break; + + case 0x5120: + case 0x5121: + case 0x5122: + case 0x5123: + case 0x5124: + case 0x5125: + case 0x5126: + case 0x5127: + chr_mode = 0; + chr_page[0, addr & 0x07] = data; + SetBank_PPU(); + break; + + case 0x5128: + case 0x5129: + case 0x512A: + case 0x512B: + chr_mode = 1; + chr_page[1, (addr & 0x03) + 0] = data; + chr_page[1, (addr & 0x03) + 4] = data; + SetBank_PPU(); + break; + + case 0x5200: + split_control = data; + break; + case 0x5201: + split_scroll = data; + break; + case 0x5202: + split_page = (byte)(data & 0x3F); + break; + + case 0x5203: + irq_line = data; + + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0x5204: + irq_enable = data; + + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + + case 0x5205: + mult_a = data; + break; + case 0x5206: + mult_b = data; + break; + + default: + if (addr >= 0x5000 && addr <= 0x5015) + { + nes.apu.ExWrite(addr, data); + } + else if (addr >= 0x5C00 && addr <= 0x5FFF) + { + if (graphic_mode == 2) + { // ExRAM + VRAM[0x0800 + (addr & 0x3FF)] = data; + } + else if (graphic_mode != 3) + { // Split,ExGraphic + if ((irq_status & 0x40) != 0) + { + VRAM[0x0800 + (addr & 0x3FF)] = data; + } + else + { + VRAM[0x0800 + (addr & 0x3FF)] = 0; + } + } + } + else if (addr >= 0x6000 && addr <= 0x7FFF) + { + if ((sram_we_a == 0x02) && (sram_we_b == 0x01)) + { + if (CPU_MEM_TYPE[3] == BANKTYPE_RAM) + { + CPU_MEM_BANK[3][addr & 0x1FFF] = data; + } + } + } + break; + } + } + + //void Mapper005::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if (sram_we_a == 0x02 && sram_we_b == 0x01) + { + if (addr >= 0x8000 && addr < 0xE000) + { + if (CPU_MEM_TYPE[addr >> 13] == BANKTYPE_RAM) + { + CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + } + } + } + } + + void SetBank_CPU(uint addr, BYTE data) + { + if ((data & 0x80) != 0) + { + // PROM Bank + switch (addr & 7) + { + case 4: + if (prg_size == 3) + { + SetPROM_8K_Bank(4, data & 0x7F); + } + break; + case 5: + if (prg_size == 1 || prg_size == 2) + { + SetPROM_16K_Bank(4, (data & 0x7F) >> 1); + } + else if (prg_size == 3) + { + SetPROM_8K_Bank(5, (data & 0x7F)); + } + break; + case 6: + if (prg_size == 2 || prg_size == 3) + { + SetPROM_8K_Bank(6, (data & 0x7F)); + } + break; + case 7: + if (prg_size == 0) + { + SetPROM_32K_Bank((data & 0x7F) >> 2); + } + else if (prg_size == 1) + { + SetPROM_16K_Bank(6, (data & 0x7F) >> 1); + } + else if (prg_size == 2 || prg_size == 3) + { + SetPROM_8K_Bank(7, (data & 0x7F)); + } + break; + } + } + else + { + // WRAM Bank + switch (addr & 7) + { + case 4: + if (prg_size == 3) + { + SetBank_SRAM(4, (byte)(data & 0x07)); + } + break; + case 5: + if (prg_size == 1 || prg_size == 2) + { + SetBank_SRAM(4, (byte)((data & 0x06) + 0)); + SetBank_SRAM(5, (byte)((data & 0x06) + 1)); + } + else if (prg_size == 3) + { + SetBank_SRAM(5, (byte)(data & 0x07)); + } + break; + case 6: + if (prg_size == 2 || prg_size == 3) + { + SetBank_SRAM(6, (byte)(data & 0x07)); + } + break; + } + } + } + + private ArrayRef _prom_bank = new ArrayRef(); + void SetBank_SRAM(BYTE page, BYTE data) + { + if (sram_size == 0) data = (byte)((data > 3) ? 8 : 0); + if (sram_size == 1) data = (byte)((data > 3) ? 1 : 0); + if (sram_size == 2) data = (byte)((data > 3) ? 8 : data); + if (sram_size == 3) data = (byte)((data > 3) ? 4 : data); + + if (data != 8) + { + int offset = 0x2000 * data; + _prom_bank.SetArray(WRAM, offset, WRAM.Length - offset); + SetPROM_Bank(page, _prom_bank, BANKTYPE_RAM); + CPU_MEM_PAGE[page] = data; + } + else + { + CPU_MEM_TYPE[page] = BANKTYPE_ROM; + } + } + + void SetBank_PPU() + { + INT i; + + if (chr_mode == 0) + { + // PPU SP Bank + switch (chr_size) + { + case 0: + SetVROM_8K_Bank(chr_page[0, 7]); + break; + case 1: + SetVROM_4K_Bank(0, chr_page[0, 3]); + SetVROM_4K_Bank(4, chr_page[0, 7]); + break; + case 2: + SetVROM_2K_Bank(0, chr_page[0, 1]); + SetVROM_2K_Bank(2, chr_page[0, 3]); + SetVROM_2K_Bank(4, chr_page[0, 5]); + SetVROM_2K_Bank(6, chr_page[0, 7]); + break; + case 3: + SetVROM_8K_Bank(chr_page[0, 0], + chr_page[0, 1], + chr_page[0, 2], + chr_page[0, 3], + chr_page[0, 4], + chr_page[0, 5], + chr_page[0, 6], + chr_page[0, 7]); + break; + } + } + else if (chr_mode == 1) + { + // PPU BG Bank + switch (chr_size) + { + case 0: + for (i = 0; i < 8; i++) + { + BG_MEM_BANK[i].SetArray(VROM, 0x2000 * (chr_page[1, 7] % VROM_8K_SIZE) + 0x0400 * i); + BG_MEM_PAGE[i] = (byte)((chr_page[1, 7] % VROM_8K_SIZE) * 8 + i); + } + break; + case 1: + for (i = 0; i < 4; i++) + { + BG_MEM_BANK[i + 0].SetArray(VROM, 0x1000 * (chr_page[1, 3] % VROM_4K_SIZE) + 0x0400 * i); + BG_MEM_BANK[i + 4].SetArray(VROM, 0x1000 * (chr_page[1, 7] % VROM_4K_SIZE) + 0x0400 * i); + BG_MEM_PAGE[i + 0] = (byte)((chr_page[1, 3] % VROM_4K_SIZE) * 4 + i); + BG_MEM_PAGE[i + 4] = (byte)((chr_page[1, 7] % VROM_4K_SIZE) * 4 + i); + } + break; + case 2: + for (i = 0; i < 2; i++) + { + BG_MEM_BANK[i + 0].SetArray(VROM, 0x0800 * (chr_page[1, 1] % VROM_2K_SIZE) + 0x0400 * i); + BG_MEM_BANK[i + 2].SetArray(VROM, 0x0800 * (chr_page[1, 3] % VROM_2K_SIZE) + 0x0400 * i); + BG_MEM_BANK[i + 4].SetArray(VROM, 0x0800 * (chr_page[1, 5] % VROM_2K_SIZE) + 0x0400 * i); + BG_MEM_BANK[i + 6].SetArray(VROM, 0x0800 * (chr_page[1, 7] % VROM_2K_SIZE) + 0x0400 * i); + BG_MEM_PAGE[i + 0] = (byte)((chr_page[1, 1] % VROM_2K_SIZE) * 2 + i); + BG_MEM_PAGE[i + 2] = (byte)((chr_page[1, 3] % VROM_2K_SIZE) * 2 + i); + BG_MEM_PAGE[i + 4] = (byte)((chr_page[1, 5] % VROM_2K_SIZE) * 2 + i); + BG_MEM_PAGE[i + 6] = (byte)((chr_page[1, 7] % VROM_2K_SIZE) * 2 + i); + } + break; + case 3: + for (i = 0; i < 8; i++) + { + BG_MEM_BANK[i].SetArray(VROM, 0x0400 * (chr_page[1, i] % VROM_1K_SIZE)); + BG_MEM_PAGE[i] = (byte)((chr_page[1, i] % VROM_1K_SIZE) + i); + } + break; + } + } + } + + public override void HSync(int scanline) + { + if ((irq_type & MMC5_IRQ_METAL) != 0) + { + if (irq_scanline == irq_line) + { + irq_status |= 0x80; + } + } + + // if( nes.ppu.IsDispON() && scanline < 239 ) { + if (nes.ppu.IsDispON() && scanline < 240) + { + irq_scanline++; + irq_status |= 0x40; + irq_clear = 0; + } + else if ((irq_type & MMC5_IRQ_METAL) != 0) + { + irq_scanline = 0; + irq_status = (byte)(irq_status & ~0x80); + irq_status = (byte)(irq_status & ~0x40); + } + + if ((irq_type & MMC5_IRQ_METAL) == 0) + { + if (irq_scanline == irq_line) + { + irq_status |= 0x80; + } + + if (++irq_clear > 2) + { + irq_scanline = 0; + irq_status = (byte)(irq_status & ~0x80); + irq_status = (byte)(irq_status & ~0x40); + + nes.cpu.ClrIRQ(IRQ_MAPPER); + } + } + + if ((irq_enable & 0x80) != 0 && (irq_status & 0x80) != 0 && (irq_status & 0x40) != 0) + { + nes.cpu.SetIRQ(IRQ_MAPPER); + /// nes.cpu.IRQ_NotPending(); + } + + // For Split mode! + if (scanline == 0) + { + split_yofs = (ushort)(split_scroll & 0x07); + split_addr = (ushort)(((split_scroll & 0xF8) << 2)); + } + else if (nes.ppu.IsDispON()) + { + if (split_yofs == 7) + { + split_yofs = 0; + if ((split_addr & 0x03E0) == 0x03A0) + { + split_addr &= 0x001F; + } + else + { + if ((split_addr & 0x03E0) == 0x03E0) + { + split_addr &= 0x001F; + } + else + { + split_addr += 0x0020; + } + } + } + else + { + split_yofs++; + } + } + } + + //void Mapper005::PPU_ExtLatchX(INT x) + public override void PPU_ExtLatchX(int x) + { + split_x = (byte)x; + } + + //void Mapper005::PPU_ExtLatch(WORD addr, BYTE& chr_l, BYTE& chr_h, BYTE& attr ) + public override void PPU_ExtLatch(ushort addr, ref byte chr_l, ref byte chr_h, ref byte attr) + { + ushort ntbladr, attradr, tileadr, tileofs; + ushort tile_yofs; + uint tilebank; + bool bSplit; + + tile_yofs = nes.ppu.GetTILEY(); + + bSplit = false; + if ((split_control & 0x80) != 0) + { + if ((split_control & 0x40) == 0) + { + // Left side + if ((split_control & 0x1F) > split_x) + { + bSplit = true; + } + } + else + { + // Right side + if ((split_control & 0x1F) <= split_x) + { + bSplit = true; + } + } + } + + if (!bSplit) + { + if (nametable_type[(addr & 0x0C00) >> 10] == 3) + { + // Fill mode + if (graphic_mode == 1) + { + // ExGraphic mode + ntbladr = (ushort)(0x2000 + (addr & 0x0FFF)); + // Get Nametable + tileadr = (ushort)(fill_chr * 0x10 + tile_yofs); + // Get TileBank + tilebank = (uint)(0x1000 * ((VRAM[0x0800 + (ntbladr & 0x03FF)] & 0x3F) % VROM_4K_SIZE)); + // Attribute + attr = (byte)((fill_pal << 2) & 0x0C); + // Get Pattern + chr_l = VROM[tilebank + tileadr]; + chr_h = VROM[tilebank + tileadr + 8]; + } + else + { + // Normal + tileofs = (ushort)((PPUREG[0] & PPU_BGTBL_BIT) != 0 ? 0x1000 : 0x0000); + tileadr = (ushort)(tileofs + fill_chr * 0x10 + tile_yofs); + attr = (byte)((fill_pal << 2) & 0x0C); + // Get Pattern + if (chr_type != 0) + { + chr_l = PPU_MEM_BANK[tileadr >> 10][tileadr & 0x03FF]; + chr_h = PPU_MEM_BANK[tileadr >> 10][(tileadr & 0x03FF) + 8]; + } + else + { + chr_l = BG_MEM_BANK[tileadr >> 10][tileadr & 0x03FF]; + chr_h = BG_MEM_BANK[tileadr >> 10][(tileadr & 0x03FF) + 8]; + } + } + } + else if (graphic_mode == 1) + { + // ExGraphic mode + ntbladr = (ushort)(0x2000 + (addr & 0x0FFF)); + // Get Nametable + tileadr = (ushort)(PPU_MEM_BANK[ntbladr >> 10][ntbladr & 0x03FF] * 0x10 + tile_yofs); + // Get TileBank + tilebank = (uint)(0x1000 * ((VRAM[0x0800 + (ntbladr & 0x03FF)] & 0x3F) % VROM_4K_SIZE)); + // Get Attribute + attr = (byte)((VRAM[0x0800 + (ntbladr & 0x03FF)] & 0xC0) >> 4); + // Get Pattern + chr_l = VROM[tilebank + tileadr]; + chr_h = VROM[tilebank + tileadr + 8]; + } + else + { + // Normal or ExVRAM + tileofs = (ushort)((PPUREG[0] & PPU_BGTBL_BIT) != 0 ? 0x1000 : 0x0000); + ntbladr = (ushort)(0x2000 + (addr & 0x0FFF)); + attradr = (ushort)(0x23C0 + (addr & 0x0C00) + ((addr & 0x0380) >> 4) + ((addr & 0x001C) >> 2)); + // Get Nametable + tileadr = (ushort)(tileofs + PPU_MEM_BANK[ntbladr >> 10][ntbladr & 0x03FF] * 0x10 + tile_yofs); + // Get Attribute + attr = PPU_MEM_BANK[attradr >> 10][attradr & 0x03FF]; + if ((ntbladr & 0x0002) != 0) attr >>= 2; + if ((ntbladr & 0x0040) != 0) attr >>= 4; + attr = (byte)((attr & 0x03) << 2); + // Get Pattern + if (chr_type != 0) + { + chr_l = PPU_MEM_BANK[tileadr >> 10][tileadr & 0x03FF]; + chr_h = PPU_MEM_BANK[tileadr >> 10][(tileadr & 0x03FF) + 8]; + } + else + { + chr_l = BG_MEM_BANK[tileadr >> 10][tileadr & 0x03FF]; + chr_h = BG_MEM_BANK[tileadr >> 10][(tileadr & 0x03FF) + 8]; + } + } + } + else + { + ntbladr = (ushort)(((split_addr & 0x03E0) | (split_x & 0x1F)) & 0x03FF); + // Get Split TileBank + tilebank = (uint)(0x1000 * (split_page % VROM_4K_SIZE)); + tileadr = (ushort)(VRAM[0x0800 + ntbladr] * 0x10 + split_yofs); + // Get Attribute + attradr = (ushort)(0x03C0 + ((ntbladr & 0x0380) >> 4) + ((ntbladr & 0x001C) >> 2)); + attr = VRAM[0x0800 + attradr]; + if ((ntbladr & 0x0002) != 0) attr >>= 2; + if ((ntbladr & 0x0040) != 0) attr >>= 4; + attr = (byte)((attr & 0x03) << 2); + // Get Pattern + chr_l = VROM[tilebank + tileadr]; + chr_h = VROM[tilebank + tileadr + 8]; + } + } + + //void Mapper005::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = prg_size; + p[1] = chr_size; + p[2] = sram_we_a; + p[3] = sram_we_b; + p[4] = graphic_mode; + p[5] = nametable_mode; + p[6] = nametable_type[0]; + p[7] = nametable_type[1]; + p[8] = nametable_type[2]; + p[9] = nametable_type[3]; + p[10] = sram_page; + p[11] = fill_chr; + p[12] = fill_pal; + p[13] = split_control; + p[14] = split_scroll; + p[15] = split_page; + p[16] = chr_mode; + p[17] = irq_status; + p[18] = irq_enable; + p[19] = irq_line; + p[20] = irq_scanline; + p[21] = irq_clear; + p[22] = mult_a; + p[23] = mult_b; + + INT i, j; + for (j = 0; j < 2; j++) + { + for (i = 0; i < 8; i++) + { + p[24 + j * 8 + i] = chr_page[j, i]; + } + } + // for( i = 0; i < 8; i++ ) { + // p[40+i] = BG_MEM_PAGE[i]; + // } + } + + //void Mapper005::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + prg_size = p[0]; + chr_size = p[1]; + sram_we_a = p[2]; + sram_we_b = p[3]; + graphic_mode = p[4]; + nametable_mode = p[5]; + nametable_type[0] = p[6]; + nametable_type[1] = p[7]; + nametable_type[2] = p[8]; + nametable_type[3] = p[9]; + sram_page = p[10]; + fill_chr = p[11]; + fill_pal = p[12]; + split_control = p[13]; + split_scroll = p[14]; + split_page = p[15]; + chr_mode = p[16]; + irq_status = p[17]; + irq_enable = p[18]; + irq_line = p[19]; + irq_scanline = p[20]; + irq_clear = p[21]; + mult_a = p[22]; + mult_b = p[23]; + + INT i, j; + + for (j = 0; j < 2; j++) + { + for (i = 0; i < 8; i++) + { + chr_page[j, i] = p[24 + j * 8 + i]; + } + } + // // BGバンクの再設定処理 + // for( i = 0; i < 8; i++ ) { + // BG_MEM_PAGE[i] = p[40+i]%VROM_1K_SIZE; + // } + // for( i = 0; i < 8; i++ ) { + // BG_MEM_BANK[i] = VROM+0x0400*BG_MEM_PAGE[i]; + // } + + SetBank_PPU(); + + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper005.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper005.cs.meta new file mode 100644 index 0000000..6177e7c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper005.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 26977049b3ea7ad4fa3b5c35a325ae48 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper006.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper006.cs new file mode 100644 index 0000000..78c12e8 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper006.cs @@ -0,0 +1,112 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper006 FFE F4xxx // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper006 : Mapper + { + BYTE irq_enable; + INT irq_counter; + public Mapper006(NES parent) : base(parent) { } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, 14, 15); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + else + { + SetCRAM_8K_Bank(0); + } + + irq_enable = 0; + irq_counter = 0; + } + + //void Mapper006::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + switch (addr) + { + case 0x42FE: + if ((data & 0x10) != 0) SetVRAM_Mirror(VRAM_MIRROR4H); + else SetVRAM_Mirror(VRAM_MIRROR4L); + break; + case 0x42FF: + if ((data & 0x10) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + break; + + case 0x4501: + irq_enable = 0; + + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0x4502: + irq_counter = (irq_counter & 0xFF00) | data; + break; + case 0x4503: + irq_counter = (irq_counter & 0x00FF) | ((INT)data << 8); + irq_enable = 0xFF; + + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + default: + base.WriteLow(addr, data); + break; + } + } + + //void Mapper006::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + SetPROM_16K_Bank(4, (data & 0x3C) >> 2); + SetCRAM_8K_Bank(data & 0x03); + } + + //void Mapper006::HSync(INT scanline) + public override void HSync(int scanline) + { + if (irq_enable != 0) + { + irq_counter += 133; + if (irq_counter >= 0xFFFF) + { + // nes.cpu.IRQ(); + irq_counter = 0; + + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + + //void Mapper006::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //p[0] = irq_enable; + //*(INT*)&p[1] = irq_counter; + } + + //void Mapper006::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //irq_enable = p[0]; + //irq_counter = *(INT*)&p[1]; + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper006.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper006.cs.meta new file mode 100644 index 0000000..7d4fcfc --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper006.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0672fe1374d484f4ab1c824d0882bfdd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper007.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper007.cs new file mode 100644 index 0000000..827a39b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper007.cs @@ -0,0 +1,56 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper007 AOROM/AMROM // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper007 : Mapper + { + + BYTE patch; + public Mapper007(NES parent) : base(parent) { } + + public override void Reset() + { + patch = 0; + + SetPROM_32K_Bank(0); + SetVRAM_Mirror(VRAM_MIRROR4L); + + uint crc = nes.rom.GetPROM_CRC(); + if (crc == 0x3c9fe649) + { // WWF Wrestlemania Challenge(U) + SetVRAM_Mirror(VRAM_VMIRROR); + patch = 1; + } + if (crc == 0x09874777) + { // Marble Madness(U) + nes.SetRenderMethod( EnumRenderMethod.TILE_RENDER); + } + + if (crc == 0x279710DC // Battletoads (U) + || crc == 0xCEB65B06) + { // Battletoads Double Dragon (U) + nes.SetRenderMethod( EnumRenderMethod.PRE_ALL_RENDER); + //::memset(WRAM, 0, sizeof(WRAM)); + MemoryUtility.ZEROMEMORY(WRAM, WRAM.Length); + } + } + + //void Mapper007::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + SetPROM_32K_Bank(data & 0x07); + + if (patch!=0) + { + if ((data & 0x10)!=0) SetVRAM_Mirror(VRAM_MIRROR4H); + else SetVRAM_Mirror(VRAM_MIRROR4L); + } + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper007.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper007.cs.meta new file mode 100644 index 0000000..414d190 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper007.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 063872d968d91234a9a22755e3db7aab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper008.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper008.cs new file mode 100644 index 0000000..bcad768 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper008.cs @@ -0,0 +1,32 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper008 FFE F3xxx // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper008 : Mapper + { + + public Mapper008(NES parent) : base(parent) { } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, 2, 3); + SetVROM_8K_Bank(0); + } + + //void Mapper008::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + SetPROM_16K_Bank(4, (data & 0xF8) >> 3); + SetVROM_8K_Bank(data & 0x07); + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper008.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper008.cs.meta new file mode 100644 index 0000000..7bbe423 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper008.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7e39136ad8af00f4c95499cab3a0aa45 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper009.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper009.cs new file mode 100644 index 0000000..9a98ad4 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper009.cs @@ -0,0 +1,129 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper009 Nintendo MMC2 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper009 : Mapper + { + BYTE[] reg = new byte[4]; + BYTE latch_a, latch_b; + + public Mapper009(NES parent) : base(parent) { } + + public override void Reset() + { + SetPROM_32K_Bank(0, PROM_8K_SIZE - 3, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + reg[0] = 0; reg[1] = 4; + reg[2] = 0; reg[3] = 0; + + latch_a = 0xFE; + latch_b = 0xFE; + SetVROM_4K_Bank(0, 4); + SetVROM_4K_Bank(4, 0); + + nes.ppu.SetChrLatchMode(true); + } + + //void Mapper009::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xF000) + { + case 0xA000: + SetPROM_8K_Bank(4, data); + break; + case 0xB000: + reg[0] = data; + if (latch_a == 0xFD) + { + SetVROM_4K_Bank(0, reg[0]); + } + break; + case 0xC000: + reg[1] = data; + if (latch_a == 0xFE) + { + SetVROM_4K_Bank(0, reg[1]); + } + break; + case 0xD000: + reg[2] = data; + if (latch_b == 0xFD) + { + SetVROM_4K_Bank(4, reg[2]); + } + break; + case 0xE000: + reg[3] = data; + if (latch_b == 0xFE) + { + SetVROM_4K_Bank(4, reg[3]); + } + break; + case 0xF000: + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + break; + } + } + + //void Mapper009::PPU_ChrLatch(WORD addr) + public override void PPU_ChrLatch(ushort addr) + { + if ((addr & 0x1FF0) == 0x0FD0 && latch_a != 0xFD) + { + latch_a = 0xFD; + SetVROM_4K_Bank(0, reg[0]); + } + else if ((addr & 0x1FF0) == 0x0FE0 && latch_a != 0xFE) + { + latch_a = 0xFE; + SetVROM_4K_Bank(0, reg[1]); + } + else if ((addr & 0x1FF0) == 0x1FD0 && latch_b != 0xFD) + { + latch_b = 0xFD; + SetVROM_4K_Bank(4, reg[2]); + } + else if ((addr & 0x1FF0) == 0x1FE0 && latch_b != 0xFE) + { + latch_b = 0xFE; + SetVROM_4K_Bank(4, reg[3]); + } + } + + //void Mapper009::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg[0]; + p[1] = reg[1]; + p[2] = reg[2]; + p[3] = reg[3]; + p[4] = latch_a; + p[5] = latch_b; + } + + //void Mapper009::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg[0] = p[0]; + reg[1] = p[1]; + reg[2] = p[2]; + reg[3] = p[3]; + latch_a = p[4]; + latch_b = p[5]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper009.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper009.cs.meta new file mode 100644 index 0000000..bd399bb --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper009.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 60942642eeee2e04fbe2fad967c2400d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper010.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper010.cs new file mode 100644 index 0000000..b8c0d74 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper010.cs @@ -0,0 +1,129 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper010 Nintendo MMC4 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper010 : Mapper + { + BYTE[] reg = new byte[4]; + BYTE latch_a, latch_b; + + public Mapper010(NES parent) : base(parent) { } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + reg[0] = 0; reg[1] = 4; + reg[2] = 0; reg[3] = 0; + + latch_a = 0xFE; + latch_b = 0xFE; + SetVROM_4K_Bank(0, 4); + SetVROM_4K_Bank(4, 0); + + nes.ppu.SetChrLatchMode(true); + } + + //void Mapper010::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xF000) + { + case 0xA000: + SetPROM_16K_Bank(4, data); + break; + case 0xB000: + reg[0] = data; + if (latch_a == 0xFD) + { + SetVROM_4K_Bank(0, reg[0]); + } + break; + case 0xC000: + reg[1] = data; + if (latch_a == 0xFE) + { + SetVROM_4K_Bank(0, reg[1]); + } + break; + case 0xD000: + reg[2] = data; + if (latch_b == 0xFD) + { + SetVROM_4K_Bank(4, reg[2]); + } + break; + case 0xE000: + reg[3] = data; + if (latch_b == 0xFE) + { + SetVROM_4K_Bank(4, reg[3]); + } + break; + case 0xF000: + if ((data & 0x01) != 0) + SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + break; + } + } + + //void Mapper010::PPU_ChrLatch(WORD addr) + public override void PPU_ChrLatch(ushort addr) + { + if ((addr & 0x1FF0) == 0x0FD0 && latch_a != 0xFD) + { + latch_a = 0xFD; + SetVROM_4K_Bank(0, reg[0]); + } + else if ((addr & 0x1FF0) == 0x0FE0 && latch_a != 0xFE) + { + latch_a = 0xFE; + SetVROM_4K_Bank(0, reg[1]); + } + else if ((addr & 0x1FF0) == 0x1FD0 && latch_b != 0xFD) + { + latch_b = 0xFD; + SetVROM_4K_Bank(4, reg[2]); + } + else if ((addr & 0x1FF0) == 0x1FE0 && latch_b != 0xFE) + { + latch_b = 0xFE; + SetVROM_4K_Bank(4, reg[3]); + } + } + + //void Mapper010::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg[0]; + p[1] = reg[1]; + p[2] = reg[2]; + p[3] = reg[3]; + p[4] = latch_a; + p[5] = latch_b; + } + + //void Mapper010::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg[0] = p[0]; + reg[1] = p[1]; + reg[2] = p[2]; + reg[3] = p[3]; + latch_a = p[4]; + latch_b = p[5]; + } + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper010.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper010.cs.meta new file mode 100644 index 0000000..3a28a56 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper010.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0beeffcb64a5c124c9ef8d2b428f723e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper011.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper011.cs new file mode 100644 index 0000000..94696f4 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper011.cs @@ -0,0 +1,42 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper011 Color Dreams // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper011 : Mapper + { + + public Mapper011(NES parent) : base(parent) { } + + public override void Reset() + { + SetPROM_32K_Bank(0); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + // SetVROM_8K_Bank( 1 ); + } + SetVRAM_Mirror(VRAM_VMIRROR); + } + + //void Mapper011::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + //DEBUGOUT("WR A:%04X D:%02X\n", addr, data); + SetPROM_32K_Bank(data); + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(data >> 4); + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper011.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper011.cs.meta new file mode 100644 index 0000000..8435259 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper011.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1d46cb68121988e498159e8a53b0cb90 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper012.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper012.cs new file mode 100644 index 0000000..68791c4 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper012.cs @@ -0,0 +1,331 @@ +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper012 : Mapper + { + uint vb0, vb1; + BYTE[] reg = new byte[8]; + BYTE prg0, prg1; + BYTE chr01, chr23, chr4, chr5, chr6, chr7; + BYTE we_sram; + + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + BYTE irq_request; + BYTE irq_preset; + BYTE irq_preset_vbl; + + public Mapper012(NES parent) : base(parent) { } + + public override void Reset() + { + for (INT i = 0; i < 8; i++) + { + reg[i] = 0x00; + } + + prg0 = 0; + prg1 = 1; + SetBank_CPU(); + + vb0 = 0; + vb1 = 0; + chr01 = 0; + chr23 = 2; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + SetBank_PPU(); + + we_sram = 0; // Disable + irq_enable = 0; // Disable + irq_counter = 0; + irq_latch = 0xFF; + irq_request = 0; + irq_preset = 0; + irq_preset_vbl = 0; + } + + //void Mapper012::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr > 0x4100 && addr < 0x6000) + { + vb0 = (byte)((data & 0x01) << 8); + vb1 = (byte)((data & 0x10) << 4); + SetBank_PPU(); + } + else + { + base.WriteLow(addr, data); + } + } + + //BYTE Mapper012::ReadLow(WORD addr) + public override byte ReadLow(ushort addr) + { + return 0x01; + } + + //void Mapper012::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + //DEBUGOUT( "MPRWR A=%04X D=%02X L=%3d CYC=%d\n", addr&0xFFFF, data&0xFF, nes.GetScanline(), nes.cpu.GetTotalCycles() ); + + switch (addr & 0xE001) + { + case 0x8000: + reg[0] = data; + SetBank_CPU(); + SetBank_PPU(); + break; + case 0x8001: + reg[1] = data; + + switch (reg[0] & 0x07) + { + case 0x00: + chr01 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x01: + chr23 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x02: + chr4 = data; + SetBank_PPU(); + break; + case 0x03: + chr5 = data; + SetBank_PPU(); + break; + case 0x04: + chr6 = data; + SetBank_PPU(); + break; + case 0x05: + chr7 = data; + SetBank_PPU(); + break; + case 0x06: + prg0 = data; + SetBank_CPU(); + break; + case 0x07: + prg1 = data; + SetBank_CPU(); + break; + } + break; + case 0xA000: + reg[2] = data; + if (!nes.rom.Is4SCREEN()) + { + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + break; + case 0xA001: + reg[3] = data; + break; + case 0xC000: + reg[4] = data; + irq_latch = data; + break; + case 0xC001: + reg[5] = data; + if (nes.GetScanline() < 240) + { + irq_counter |= 0x80; + irq_preset = 0xFF; + } + else + { + irq_counter |= 0x80; + irq_preset_vbl = 0xFF; + irq_preset = 0; + } + break; + case 0xE000: + reg[6] = data; + irq_enable = 0; + irq_request = 0; + + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + reg[7] = data; + irq_enable = 1; + irq_request = 0; + break; + } + } + + //void Mapper012::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239) && nes.ppu.IsDispON()) + { + if (irq_preset_vbl != 0) + { + irq_counter = irq_latch; + irq_preset_vbl = 0; + } + if (irq_preset != 0) + { + irq_counter = irq_latch; + irq_preset = 0; + } + else if (irq_counter > 0) + { + irq_counter--; + } + + if (irq_counter == 0) + { + // Some game set irq_latch to zero to disable irq. So check it here. + if (irq_enable != 0 && irq_latch != 0) + { + irq_request = 0xFF; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + irq_preset = 0xFF; + } + } + } + + void SetBank_CPU() + { + if ((reg[0] & 0x40) != 0) + { + SetPROM_32K_Bank(PROM_8K_SIZE - 2, prg1, prg0, PROM_8K_SIZE - 1); + } + else + { + SetPROM_32K_Bank(prg0, prg1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + } + + void SetBank_PPU() + { + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x80) != 0) + { + SetVROM_8K_Bank( + (int)(vb0 + chr4), + (int)(vb0 + chr5), + (int)(vb0 + chr6), + (int)(vb0 + chr7), + (int)(vb1 + chr01), + (int)(vb1 + chr01 + 1), + (int)(vb1 + chr23), + (int)(vb1 + chr23 + 1) + ); + } + else + { + SetVROM_8K_Bank( + (int)(vb0 + chr01), + (int)(vb0 + chr01 + 1), + (int)(vb0 + chr23), + (int)(vb0 + chr23 + 1), + (int)(vb1 + chr4), + (int)(vb1 + chr5), + (int)(vb1 + chr6), + (int)(vb1 + chr7)) + ; + } + } + else + { + if ((reg[0] & 0x80) != 0) + { + SetCRAM_1K_Bank(4, (chr01 + 0) & 0x07); + SetCRAM_1K_Bank(5, (chr01 + 1) & 0x07); + SetCRAM_1K_Bank(6, (chr23 + 0) & 0x07); + SetCRAM_1K_Bank(7, (chr23 + 1) & 0x07); + SetCRAM_1K_Bank(0, chr4 & 0x07); + SetCRAM_1K_Bank(1, chr5 & 0x07); + SetCRAM_1K_Bank(2, chr6 & 0x07); + SetCRAM_1K_Bank(3, chr7 & 0x07); + } + else + { + SetCRAM_1K_Bank(0, (chr01 + 0) & 0x07); + SetCRAM_1K_Bank(1, (chr01 + 1) & 0x07); + SetCRAM_1K_Bank(2, (chr23 + 0) & 0x07); + SetCRAM_1K_Bank(3, (chr23 + 1) & 0x07); + SetCRAM_1K_Bank(4, chr4 & 0x07); + SetCRAM_1K_Bank(5, chr5 & 0x07); + SetCRAM_1K_Bank(6, chr6 & 0x07); + SetCRAM_1K_Bank(7, chr7 & 0x07); + } + } + } + + //void Mapper012::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //for (INT i = 0; i < 8; i++) + //{ + // p[i] = reg[i]; + //} + //p[8] = prg0; + //p[9] = prg1; + //p[10] = chr01; + //p[11] = chr23; + //p[12] = chr4; + //p[13] = chr5; + //p[14] = chr6; + //p[15] = chr7; + //p[16] = irq_enable; + //p[17] = (BYTE)irq_counter; + //p[18] = irq_latch; + //p[19] = irq_request; + //p[20] = irq_preset; + //p[21] = irq_preset_vbl; + //*((DWORD*)&p[22]) = vb0; + //*((DWORD*)&p[26]) = vb1; + } + + //void Mapper012::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //for (INT i = 0; i < 8; i++) + //{ + // reg[i] = p[i]; + //} + //prg0 = p[8]; + //prg1 = p[9]; + //chr01 = p[10]; + //chr23 = p[11]; + //chr4 = p[12]; + //chr5 = p[13]; + //chr6 = p[14]; + //chr7 = p[15]; + //irq_enable = p[16]; + //irq_counter = (INT)p[17]; + //irq_latch = p[18]; + //irq_request = p[19]; + //irq_preset = p[20]; + //irq_preset_vbl = p[21]; + //vb0 = *((DWORD*)&p[22]); + //vb1 = *((DWORD*)&p[26]); + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper012.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper012.cs.meta new file mode 100644 index 0000000..112ae5f --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper012.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a0d9dccfbd35bbf458c8f5d100e2f89b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper013.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper013.cs new file mode 100644 index 0000000..d483b65 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper013.cs @@ -0,0 +1,33 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper013 CPROM // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper013 : Mapper + { + + public Mapper013(NES parent) : base(parent) { } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, 2, 3); + SetCRAM_4K_Bank(0, 0); + SetCRAM_4K_Bank(4, 0); + } + + //void Mapper013::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + SetPROM_32K_Bank((data & 0x30) >> 4); + SetCRAM_4K_Bank(4, data & 0x03); + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper013.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper013.cs.meta new file mode 100644 index 0000000..625ff50 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper013.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 660200e3200da7d4eb9925d2b63afef5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper015.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper015.cs new file mode 100644 index 0000000..32de355 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper015.cs @@ -0,0 +1,93 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper015 100-in-1 chip // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper015 : Mapper + { + + public Mapper015(NES parent) : base(parent) { } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, 2, 3); + } + + //void Mapper015::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr) + { + case 0x8000: + if ((data & 0x80) != 0) + { + SetPROM_8K_Bank(4, (data & 0x3F) * 2 + 1); + SetPROM_8K_Bank(5, (data & 0x3F) * 2 + 0); + SetPROM_8K_Bank(6, (data & 0x3F) * 2 + 3); + SetPROM_8K_Bank(7, (data & 0x3F) * 2 + 2); + } + else + { + SetPROM_8K_Bank(4, (data & 0x3F) * 2 + 0); + SetPROM_8K_Bank(5, (data & 0x3F) * 2 + 1); + SetPROM_8K_Bank(6, (data & 0x3F) * 2 + 2); + SetPROM_8K_Bank(7, (data & 0x3F) * 2 + 3); + } + if ((data & 0x40) != 0) + SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + break; + case 0x8001: + if ((data & 0x80) != 0) + { + SetPROM_8K_Bank(6, (data & 0x3F) * 2 + 1); + SetPROM_8K_Bank(7, (data & 0x3F) * 2 + 0); + } + else + { + SetPROM_8K_Bank(6, (data & 0x3F) * 2 + 0); + SetPROM_8K_Bank(7, (data & 0x3F) * 2 + 1); + } + break; + case 0x8002: + if ((data & 0x80) != 0) + { + SetPROM_8K_Bank(4, (data & 0x3F) * 2 + 1); + SetPROM_8K_Bank(5, (data & 0x3F) * 2 + 1); + SetPROM_8K_Bank(6, (data & 0x3F) * 2 + 1); + SetPROM_8K_Bank(7, (data & 0x3F) * 2 + 1); + } + else + { + SetPROM_8K_Bank(4, (data & 0x3F) * 2 + 0); + SetPROM_8K_Bank(5, (data & 0x3F) * 2 + 0); + SetPROM_8K_Bank(6, (data & 0x3F) * 2 + 0); + SetPROM_8K_Bank(7, (data & 0x3F) * 2 + 0); + } + break; + case 0x8003: + if ((data & 0x80) != 0) + { + SetPROM_8K_Bank(6, (data & 0x3F) * 2 + 1); + SetPROM_8K_Bank(7, (data & 0x3F) * 2 + 0); + } + else + { + SetPROM_8K_Bank(6, (data & 0x3F) * 2 + 0); + SetPROM_8K_Bank(7, (data & 0x3F) * 2 + 1); + } + if ((data & 0x40) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + break; + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper015.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper015.cs.meta new file mode 100644 index 0000000..e5e5989 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper015.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9a00ec8072aa26648bcd7bef203e9a39 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper016.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper016.cs new file mode 100644 index 0000000..2454a4f --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper016.cs @@ -0,0 +1,429 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper016 Bandai Standard // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.Core.CPU; +using static VirtualNes.MMU; +using BYTE = System.Byte; +using INT = System.Int32; + +namespace VirtualNes.Core +{ + public class Mapper016 : Mapper + { + BYTE patch; // For Famicom Jump 2 + BYTE eeprom_type; // EEPROM type + + BYTE[] reg = new byte[3]; + + BYTE irq_enable; + INT irq_counter; + INT irq_latch; + BYTE irq_type; + + X24C01 x24c01; + X24C02 x24c02; + public Mapper016(NES parent) : base(parent) + { + } + + + public override void Reset() + { + patch = 0; + + reg[0] = reg[1] = reg[2] = 0; + irq_enable = 0; + irq_counter = 0; + irq_latch = 0; + + irq_type = 0; + nes.SetIrqType(NES.IRQMETHOD.IRQ_CLOCK); + + eeprom_type = 0; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + uint crc = nes.rom.GetPROM_CRC(); + + if (crc == 0x3f15d20d // Famicom Jump 2(J) + || crc == 0xf76aa523) + { // Famicom Jump 2(J)(alt) + patch = 1; + eeprom_type = 0xFF; + + WRAM[0x0BBC] = 0xFF; // SRAM対策 + } + + if (crc == 0x1d6f27f7) + { // Dragon Ball Z 2(Korean Hack) + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + eeprom_type = 1; + } + if (crc == 0x6f7247c8) + { // Dragon Ball Z 3(Korean Hack) + nes.SetIrqType(NES.IRQMETHOD.IRQ_CLOCK); + eeprom_type = 1; + } + + if (crc == 0x7fb799fd) + { // Dragon Ball 2 - Dai Maou Fukkatsu(J) + } + if (crc == 0x6c6c2feb // Dragon Ball 3 - Gokuu Den(J) + || crc == 0x8edeb257) + { // Dragon Ball 3 - Gokuu Den(J)(Alt) + } + if (crc == 0x31cd9903) + { // Dragon Ball Z - Kyoushuu! Saiya Jin(J) + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + } + if (crc == 0xe49fc53e // Dragon Ball Z 2 - Gekishin Freeza!!(J) + || crc == 0x1582fee0) + { // Dragon Ball Z 2 - Gekishin Freeza!!(J) [alt] + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + eeprom_type = 1; + } + if (crc == 0x09499f4d) + { // Dragon Ball Z 3 - Ressen Jinzou Ningen(J) + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + eeprom_type = 1; + } + if (crc == 0x2e991109) + { // Dragon Ball Z Gaiden - Saiya Jin Zetsumetsu Keikaku (J) + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + eeprom_type = 1; + } + if (crc == 0x146fb9c3) + { // SD Gundam Gaiden - Knight Gundam Monogatari(J) + } + + if (crc == 0x73ac76db // SD Gundam Gaiden - Knight Gundam Monogatari 2 - Hikari no Kishi(J) + || crc == 0x81a15eb8) + { // SD Gundam Gaiden - Knight Gundam Monogatari 3 - Densetsu no Kishi Dan(J) + eeprom_type = 1; + } + if (crc == 0x170250de) + { // Rokudenashi Blues(J) + nes.SetRenderMethod(EnumRenderMethod.POST_ALL_RENDER); + eeprom_type = 1; + } + + // DATACH系 + if (crc == 0x0be0a328 // Datach - SD Gundam - Gundam Wars(J) + || crc == 0x19e81461 // Datach - Dragon Ball Z - Gekitou Tenkaichi Budou Kai(J) + || crc == 0x5b457641 // Datach - Ultraman Club - Supokon Fight!(J) + || crc == 0x894efdbc // Datach - Crayon Shin Chan - Ora to Poi Poi(J) + || crc == 0x983d8175 // Datach - Battle Rush - Build Up Robot Tournament(J) + || crc == 0xbe06853f) + { // Datach - J League Super Top Players(J) + eeprom_type = 2; + } + if (crc == 0xf51a7f46) + { // Datach - Yuu Yuu Hakusho - Bakutou Ankoku Bujutsu Kai(J) + nes.SetIrqType(NES.IRQMETHOD.IRQ_HSYNC); + eeprom_type = 2; + } + + if (eeprom_type == 0) + { + nes.SetSAVERAM_SIZE(128); + x24c01.Reset(WRAM); + } + else + if (eeprom_type == 1) + { + nes.SetSAVERAM_SIZE(256); + x24c02.Reset(WRAM); + } + else + if (eeprom_type == 2) + { + nes.SetSAVERAM_SIZE(384); + x24c02.Reset(WRAM); + x24c01.Reset(new ArrayRef(WRAM, 256)); + } + } + + //BYTE Mapper016::ReadLow(WORD addr) + public override byte ReadLow(ushort addr) + { + if (patch != 0) + { + return base.ReadLow(addr); + } + else + { + if ((addr & 0x00FF) == 0x0000) + { + BYTE ret = 0; + if (eeprom_type == 0) + { + ret = x24c01.Read(); + } + else + if (eeprom_type == 1) + { + ret = x24c02.Read(); + } + else + if (eeprom_type == 2) + { + ret = (byte)(x24c02.Read() & x24c01.Read()); + } + return (byte)((ret != 0 ? 0x10 : 0) | (nes.GetBarcodeStatus())); + } + } + return 0x00; + } + + //void Mapper016::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (patch == 0) + { + WriteSubA(addr, data); + } + else + { + base.WriteLow(addr, data); + } + } + + public override void Write(ushort addr, byte data) + { + if (patch == 0) + { + WriteSubA(addr, data); + } + else + { + WriteSubB(addr, data); + } + } + + static BYTE eeprom_addinc; + + // Normal mapper #16 + void WriteSubA(ushort addr, BYTE data) + { + switch (addr & 0x000F) + { + case 0x0000: + case 0x0001: + case 0x0002: + case 0x0003: + case 0x0004: + case 0x0005: + case 0x0006: + case 0x0007: + if (VROM_1K_SIZE != 0) + { + SetVROM_1K_Bank((byte)(addr & 0x0007), data); + } + if (eeprom_type == 2) + { + reg[0] = data; + x24c01.Write((byte)((data & 0x08) != 0 ? 0xFF : 0), (byte)((reg[1] & 0x40) != 0 ? 0xFF : 0)); + } + break; + + case 0x0008: + SetPROM_16K_Bank(4, data); + break; + + case 0x0009: + data &= 0x03; + if (data == 0) SetVRAM_Mirror(VRAM_VMIRROR); + else if (data == 1) SetVRAM_Mirror(VRAM_HMIRROR); + else if (data == 2) SetVRAM_Mirror(VRAM_MIRROR4L); + else SetVRAM_Mirror(VRAM_MIRROR4H); + break; + + case 0x000A: + irq_enable = (byte)(data & 0x01); + irq_counter = irq_latch; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0x000B: + irq_latch = (irq_latch & 0xFF00) | data; + irq_counter = (irq_counter & 0xFF00) | data; + break; + case 0x000C: + irq_latch = (data << 8) | (irq_latch & 0x00FF); + irq_counter = (data << 8) | (irq_counter & 0x00FF); + break; + + case 0x000D: + // EEPTYPE0(DragonBallZ) + if (eeprom_type == 0) + { + x24c01.Write((byte)((data & 0x20) != 0 ? 0xFF : 0), (byte)((data & 0x40) != 0 ? 0xFF : 0)); + } + // EEPTYPE1(DragonBallZ2,Z3,Z Gaiden) + if (eeprom_type == 1) + { + x24c02.Write((byte)((data & 0x20) != 0 ? 0xFF : 0), (byte)((data & 0x40) != 0 ? 0xFF : 0)); + } + // EEPTYPE2(DATACH) + if (eeprom_type == 2) + { + reg[1] = data; + x24c02.Write((byte)((data & 0x20) != 0 ? 0xFF : 0), (byte)((data & 0x40) != 0 ? 0xFF : 0)); + x24c01.Write((byte)((reg[0] & 0x08) != 0 ? 0xFF : 0), (byte)((data & 0x40) != 0 ? 0xFF : 0)); + } + break; + } + } + + // Famicom Jump 2 + void WriteSubB(ushort addr, BYTE data) + { + switch (addr) + { + case 0x8000: + case 0x8001: + case 0x8002: + case 0x8003: + reg[0] = (byte)(data & 0x01); + SetPROM_8K_Bank(4, reg[0] * 0x20 + reg[2] * 2 + 0); + SetPROM_8K_Bank(5, reg[0] * 0x20 + reg[2] * 2 + 1); + break; + case 0x8004: + case 0x8005: + case 0x8006: + case 0x8007: + reg[1] = (byte)(data & 0x01); + SetPROM_8K_Bank(6, reg[1] * 0x20 + 0x1E); + SetPROM_8K_Bank(7, reg[1] * 0x20 + 0x1F); + break; + case 0x8008: + reg[2] = data; + SetPROM_8K_Bank(4, reg[0] * 0x20 + reg[2] * 2 + 0); + SetPROM_8K_Bank(5, reg[0] * 0x20 + reg[2] * 2 + 1); + SetPROM_8K_Bank(6, reg[1] * 0x20 + 0x1E); + SetPROM_8K_Bank(7, reg[1] * 0x20 + 0x1F); + break; + + case 0x8009: + data &= 0x03; + if (data == 0) SetVRAM_Mirror(VRAM_VMIRROR); + else if (data == 1) SetVRAM_Mirror(VRAM_HMIRROR); + else if (data == 2) SetVRAM_Mirror(VRAM_MIRROR4L); + else SetVRAM_Mirror(VRAM_MIRROR4H); + break; + + case 0x800A: + irq_enable = (byte)(data & 0x01); + irq_counter = irq_latch; + + // if( !irq_enable ) { + // nes.cpu.ClrIRQ( IRQ_MAPPER ); + // } + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0x800B: + irq_latch = (irq_latch & 0xFF00) | data; + break; + case 0x800C: + irq_latch = (data << 8) | (irq_latch & 0x00FF); + break; + + case 0x800D: + break; + } + } + + public override void HSync(int scanline) + { + if (irq_enable != 0 && (nes.GetIrqType() == (int)NES.IRQMETHOD.IRQ_HSYNC)) + { + if (irq_counter <= 113) + { + nes.cpu.SetIRQ(IRQ_MAPPER); + // nes.cpu.IRQ(); + //// nes.cpu.IRQ_NotPending(); + // irq_enable = 0; + // irq_counter = 0; + irq_counter &= 0xFFFF; + } + else + { + irq_counter -= 113; + } + } + } + + public override void Clock(int cycles) + { + if (irq_enable != 0 && (nes.GetIrqType() == (int)NES.IRQMETHOD.IRQ_CLOCK)) + { + if ((irq_counter -= cycles) <= 0) + { + nes.cpu.SetIRQ(IRQ_MAPPER); + // nes.cpu.IRQ(); + //// nes.cpu.IRQ_NotPending(); + // irq_enable = 0; + // irq_counter = 0; + irq_counter &= 0xFFFF; + } + } + } + + public override void SaveState(byte[] p) + { + //p[0] = reg[0]; + //p[1] = reg[1]; + //p[2] = reg[2]; + //p[3] = irq_enable; + //*(INT*)&p[4] = irq_counter; + //*(INT*)&p[8] = irq_latch; + + //if (eeprom_type == 0) + //{ + // x24c01.Save(&p[16]); + //} + //else + //if (eeprom_type == 1) + //{ + // x24c02.Save(&p[16]); + //} + //else + //if (eeprom_type == 2) + //{ + // x24c02.Save(&p[16]); + // x24c01.Save(&p[48]); + //} + } + + public override void LoadState(byte[] p) + { + //reg[0] = p[0]; + //reg[1] = p[1]; + //reg[2] = p[2]; + //irq_enable = p[3]; + //irq_counter = *(INT*)&p[4]; + //irq_latch = *(INT*)&p[8]; + //if (eeprom_type == 0) + //{ + // x24c01.Load(&p[16]); + //} + //else + //if (eeprom_type == 1) + //{ + // x24c02.Load(&p[16]); + //} + //else + //if (eeprom_type == 2) + //{ + // x24c02.Load(&p[16]); + // x24c01.Load(&p[48]); + //} + } + + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper016.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper016.cs.meta new file mode 100644 index 0000000..cace94d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper016.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6dc87b177aa092e4e98c49eb5b9e0bfb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper017.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper017.cs new file mode 100644 index 0000000..7e526ff --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper017.cs @@ -0,0 +1,127 @@ +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper017 : Mapper + { + BYTE irq_enable; + INT irq_counter; + INT irq_latch; + public Mapper017(NES parent) : base(parent) + { + } + + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + + irq_enable = 0; + irq_counter = 0; + irq_latch = 0; + } + + //void Mapper017::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + switch (addr) + { + case 0x42FE: + if ((data & 0x10) != 0) SetVRAM_Mirror(VRAM_MIRROR4H); + else SetVRAM_Mirror(VRAM_MIRROR4L); + break; + case 0x42FF: + if ((data & 0x10) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + break; + + case 0x4501: + irq_enable = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0x4502: + irq_latch = (irq_latch & 0xFF00) | data; + break; + case 0x4503: + irq_latch = (irq_latch & 0x00FF) | ((INT)data << 8); + irq_counter = irq_latch; + irq_enable = 0xFF; + break; + + case 0x4504: + case 0x4505: + case 0x4506: + case 0x4507: + SetPROM_8K_Bank((byte)(addr & 0x07), data); + break; + + case 0x4510: + case 0x4511: + case 0x4512: + case 0x4513: + case 0x4514: + case 0x4515: + case 0x4516: + case 0x4517: + SetVROM_1K_Bank((byte)(addr & 0x07), data); + break; + + default: + base.WriteLow(addr, data); + break; + } + } + + //void Mapper017::HSync(INT scanline) + public override void HSync(int scanline) + { + if (irq_enable != 0) + { + if (irq_counter >= 0xFFFF - 113) + { + nes.cpu.SetIRQ(IRQ_MAPPER); + // nes.cpu.IRQ(); + // irq_counter = 0; + // irq_enable = 0; + irq_counter &= 0xFFFF; + } + else + { + irq_counter += 113; + } + } + } + + //void Mapper017::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //p[0] = irq_enable; + //*(INT*)&p[1] = irq_counter; + //*(INT*)&p[5] = irq_latch; + } + + //void Mapper017::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //irq_enable = p[0]; + //irq_counter = *(INT*)&p[1]; + //irq_latch = *(INT*)&p[5]; + } + + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper017.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper017.cs.meta new file mode 100644 index 0000000..6b34a7d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper017.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 776d527e770087845a767df931da9af6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper018.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper018.cs new file mode 100644 index 0000000..bf5935f --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper018.cs @@ -0,0 +1,278 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper018 Jaleco SS8806 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper018 : Mapper + { + BYTE[] reg = new byte[11]; + + BYTE irq_enable; + BYTE irq_mode; + INT irq_latch; + INT irq_counter; + public Mapper018(NES parent) : base(parent) + { + } + + + public override void Reset() + { + for (INT i = 0; i < 11; i++) + { + reg[i] = 0; + } + reg[2] = (byte)(PROM_8K_SIZE - 2); + reg[3] = (byte)(PROM_8K_SIZE - 1); + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + irq_enable = 0; + irq_mode = 0; + irq_counter = 0xFFFF; + irq_latch = 0xFFFF; + + uint crc = nes.rom.GetPROM_CRC(); + + if (crc == 0xefb1df9e) + { // The Lord of King(J) + nes.SetRenderMethod(EnumRenderMethod.PRE_ALL_RENDER); + } + if (crc == 0x3746f951) + { // Pizza Pop!(J) + nes.SetRenderMethod(EnumRenderMethod.PRE_ALL_RENDER); + } + + // nes.SetRenderMethod( NES::PRE_ALL_RENDER ); + // nes.SetRenderMethod( NES::POST_ALL_RENDER ); + } + + //void Mapper018::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr) + { + case 0x8000: + reg[0] = (byte)((reg[0] & 0xF0) | (data & 0x0F)); + SetPROM_8K_Bank(4, reg[0]); + break; + case 0x8001: + reg[0] = (byte)((reg[0] & 0x0F) | ((data & 0x0F) << 4)); + SetPROM_8K_Bank(4, reg[0]); + break; + case 0x8002: + reg[1] = (byte)((reg[1] & 0xF0) | (data & 0x0F)); + SetPROM_8K_Bank(5, reg[1]); + break; + case 0x8003: + reg[1] = (byte)((reg[1] & 0x0F) | ((data & 0x0F) << 4)); + SetPROM_8K_Bank(5, reg[1]); + break; + case 0x9000: + reg[2] = (byte)((reg[2] & 0xF0) | (data & 0x0F)); + SetPROM_8K_Bank(6, reg[2]); + break; + case 0x9001: + reg[2] = (byte)((reg[2] & 0x0F) | ((data & 0x0F) << 4)); + SetPROM_8K_Bank(6, reg[2]); + break; + + case 0xA000: + reg[3] = (byte)((reg[3] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(0, reg[3]); + break; + case 0xA001: + reg[3] = (byte)((reg[3] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(0, reg[3]); + break; + case 0xA002: + reg[4] = (byte)((reg[4] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(1, reg[4]); + break; + case 0xA003: + reg[4] = (byte)((reg[4] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(1, reg[4]); + break; + + case 0xB000: + reg[5] = (byte)((reg[5] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(2, reg[5]); + break; + case 0xB001: + reg[5] = (byte)((reg[5] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(2, reg[5]); + break; + case 0xB002: + reg[6] = (byte)((reg[6] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(3, reg[6]); + break; + case 0xB003: + reg[6] = (byte)((reg[6] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(3, reg[6]); + break; + + case 0xC000: + reg[7] = (byte)((reg[7] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(4, reg[7]); + break; + case 0xC001: + reg[7] = (byte)((reg[7] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(4, reg[7]); + break; + case 0xC002: + reg[8] = (byte)((reg[8] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(5, reg[8]); + break; + case 0xC003: + reg[8] = (byte)((reg[8] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(5, reg[8]); + break; + + case 0xD000: + reg[9] = (byte)((reg[9] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(6, reg[9]); + break; + case 0xD001: + reg[9] = (byte)((reg[9] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(6, reg[9]); + break; + case 0xD002: + reg[10] = (byte)((reg[10] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(7, reg[10]); + break; + case 0xD003: + reg[10] = (byte)((reg[10] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(7, reg[10]); + break; + + case 0xE000: + irq_latch = (irq_latch & 0xFFF0) | (data & 0x0F); + break; + case 0xE001: + irq_latch = (irq_latch & 0xFF0F) | ((data & 0x0F) << 4); + break; + case 0xE002: + irq_latch = (irq_latch & 0xF0FF) | ((data & 0x0F) << 8); + break; + case 0xE003: + irq_latch = (irq_latch & 0x0FFF) | ((data & 0x0F) << 12); + break; + + case 0xF000: + // if( data & 0x01 ) { + irq_counter = irq_latch; + // } else { + // irq_counter = 0; + // } + break; + case 0xF001: + irq_mode = (byte)((data >> 1) & 0x07); + irq_enable = ((byte)(data & 0x01)); + // if( !irq_enable ) { + nes.cpu.ClrIRQ(IRQ_MAPPER); + // } + break; + + case 0xF002: + data &= 0x03; + if (data == 0) SetVRAM_Mirror(VRAM_HMIRROR); + else if (data == 1) SetVRAM_Mirror(VRAM_VMIRROR); + else SetVRAM_Mirror(VRAM_MIRROR4L); + break; + } + } + + //void Mapper018::Clock(INT cycles) + public override void Clock(int cycles) + { + bool bIRQ = false; + INT irq_counter_old = irq_counter; + + if (irq_enable != 0 && irq_counter != 0) + { + irq_counter -= cycles; + + switch (irq_mode) + { + case 0: + if (irq_counter <= 0) + { + bIRQ = true; + } + break; + case 1: + if ((irq_counter & 0xF000) != (irq_counter_old & 0xF000)) + { + bIRQ = true; + } + break; + case 2: + case 3: + if ((irq_counter & 0xFF00) != (irq_counter_old & 0xFF00)) + { + bIRQ = true; + } + break; + case 4: + case 5: + case 6: + case 7: + if ((irq_counter & 0xFFF0) != (irq_counter_old & 0xFFF0)) + { + bIRQ = true; + } + break; + } + + if (bIRQ) + { + //// irq_enable = 0; + // irq_counter = irq_latch; + irq_counter = 0; + irq_enable = 0; + // nes.cpu.IRQ_NotPending(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + + //void Mapper018::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //for (INT i = 0; i < 11; i++) + //{ + // p[i] = reg[i]; + //} + //p[11] = irq_enable; + //p[12] = irq_mode; + //*(INT*)&p[13] = irq_counter; + //*(INT*)&p[17] = irq_latch; + } + + //void Mapper018::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //for (INT i = 0; i < 11; i++) + //{ + // p[i] = reg[i]; + //} + //irq_enable = p[11]; + //irq_mode = p[12]; + //irq_counter = *(INT*)&p[13]; + //irq_latch = *(INT*)&p[17]; + } + + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper018.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper018.cs.meta new file mode 100644 index 0000000..1e6d762 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper018.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d9f306005d0826a4e96ceec780568bb3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper019.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper019.cs new file mode 100644 index 0000000..21c861a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper019.cs @@ -0,0 +1,417 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper019 Namcot 106 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper019 : Mapper + { + BYTE patch; + BYTE exsound_enable; + + BYTE[] reg = new byte[3]; + BYTE[] exram = new byte[128]; + + BYTE irq_enable; + ushort irq_counter; + public Mapper019(NES parent) : base(parent) + { + } + + + public override void Reset() + { + patch = 0; + + reg[0] = reg[1] = reg[2] = 0; + + MemoryUtility.ZEROMEMORY(exram, exram.Length); + + irq_enable = 0; + irq_counter = 0; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_1K_SIZE >= 8) + { + SetVROM_8K_Bank(VROM_8K_SIZE - 1); + } + + exsound_enable = 0xFF; + + uint crc = nes.rom.GetPROM_CRC(); + + if (crc == 0xb62a7b71) + { // Family Circuit '91(J) + patch = 1; + } + + if (crc == 0x02738c68) + { // Wagan Land 2(J) + patch = 3; + } + if (crc == 0x14942c06) + { // Wagan Land 3(J) + patch = 2; + } + + if (crc == 0x968dcf09) + { // Final Lap(J) + nes.SetRenderMethod(EnumRenderMethod.PRE_ALL_RENDER); + } + if (crc == 0x3deac303) + { // Rolling Thunder(J) + nes.SetRenderMethod(EnumRenderMethod.POST_ALL_RENDER); + } + + if (crc == 0xb1b9e187) + { // For Kaijuu Monogatari(J) + nes.SetRenderMethod(EnumRenderMethod.POST_ALL_RENDER); + } + + if (crc == 0x6901346e) + { // For Sangokushi 2 - Haou no Tairiku(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + + // if( crc == 0xdd454208 ) { // Hydlide 3(J) + // nes.SetRenderMethod( NES::PRE_ALL_RENDER ); + // } + + if (crc == 0xaf15338f // For Mindseeker(J) + || crc == 0xb1b9e187 // For Kaijuu Monogatari(J) + || crc == 0x96533999 // Dokuganryuu Masamune(J) + // || crc == 0x2b825ce1 // Namco Classic(J) + // || crc == 0x9a2b0641 // Namco Classic 2(J) + || crc == 0x3296ff7a // Battle Fleet(J) + || crc == 0xdd454208) + { // Hydlide 3(J) + exsound_enable = 0; + } + + if (crc == 0x429fd177) + { // Famista '90(J) + exsound_enable = 0; + } + + if (exsound_enable != 0) + { + nes.apu.SelectExSound(0x10); + } + } + + //BYTE Mapper019::ReadLow(WORD addr) + public override byte ReadLow(ushort addr) + { + BYTE data = 0; + + switch (addr & 0xF800) + { + case 0x4800: + if (addr == 0x4800) + { + if (exsound_enable != 0) + { + nes.apu.ExRead(addr); + data = exram[reg[2] & 0x7F]; + } + else + { + data = WRAM[reg[2] & 0x7F]; + } + if ((reg[2] & 0x80) != 0) + reg[2] = (byte)((reg[2] + 1) | 0x80); + return data; + } + break; + case 0x5000: + return (byte)((BYTE)irq_counter & 0x00FF); + case 0x5800: + return (BYTE)((irq_counter >> 8) & 0x7F); + case 0x6000: + case 0x6800: + case 0x7000: + case 0x7800: + return base.ReadLow(addr); + } + + return (BYTE)(addr >> 8); + } + + //void Mapper019::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + switch (addr & 0xF800) + { + case 0x4800: + if (addr == 0x4800) + { + if (exsound_enable != 0) + { + nes.apu.ExWrite(addr, data); + exram[reg[2] & 0x7F] = data; + } + else + { + WRAM[reg[2] & 0x7F] = data; + } + if ((reg[2] & 0x80) != 0) + reg[2] = (byte)((reg[2] + 1) | 0x80); + } + break; + case 0x5000: + irq_counter = (byte)((irq_counter & 0xFF00) | (ushort)data); + // if( irq_enable ) { + // irq_counter++; + // } + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0x5800: + irq_counter = (byte)((irq_counter & 0x00FF) | ((ushort)(data & 0x7F) << 8)); + irq_enable = (byte)(data & 0x80); + // if( irq_enable ) { + // irq_counter++; + // } + // if( !irq_enable ) { + // nes.cpu.ClrIRQ( IRQ_MAPPER ); + // } + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0x6000: + case 0x6800: + case 0x7000: + case 0x7800: + base.WriteLow(addr, data); + break; + } + } + + //void Mapper019::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + //if( addr >= 0xC000 ) { + //DEBUGOUT( "W %04X %02X L:%3d\n", addr, data, nes.GetScanline() ); + //} + switch (addr & 0xF800) + { + case 0x8000: + if ((data < 0xE0) || (reg[0] != 0)) + { + SetVROM_1K_Bank(0, data); + } + else + { + SetCRAM_1K_Bank(0, data & 0x1F); + } + break; + case 0x8800: + if ((data < 0xE0) || (reg[0] != 0)) + { + SetVROM_1K_Bank(1, data); + } + else + { + SetCRAM_1K_Bank(1, data & 0x1F); + } + break; + case 0x9000: + if ((data < 0xE0) || (reg[0] != 0)) + { + SetVROM_1K_Bank(2, data); + } + else + { + SetCRAM_1K_Bank(2, data & 0x1F); + } + break; + case 0x9800: + if ((data < 0xE0) || (reg[0] != 0)) + { + SetVROM_1K_Bank(3, data); + } + else + { + SetCRAM_1K_Bank(3, data & 0x1F); + } + break; + case 0xA000: + if ((data < 0xE0) || (reg[1] != 0)) + { + SetVROM_1K_Bank(4, data); + } + else + { + SetCRAM_1K_Bank(4, data & 0x1F); + } + break; + case 0xA800: + if ((data < 0xE0) || (reg[1] != 0)) + { + SetVROM_1K_Bank(5, data); + } + else + { + SetCRAM_1K_Bank(5, data & 0x1F); + } + break; + case 0xB000: + if ((data < 0xE0) || (reg[1] != 0)) + { + SetVROM_1K_Bank(6, data); + } + else + { + SetCRAM_1K_Bank(6, data & 0x1F); + } + break; + case 0xB800: + if ((data < 0xE0) || (reg[1] != 0)) + { + SetVROM_1K_Bank(7, data); + } + else + { + SetCRAM_1K_Bank(7, data & 0x1F); + } + break; + case 0xC000: + if (patch == 0) + { + if (data <= 0xDF) + { + SetVROM_1K_Bank(8, data); + } + else + { + SetVRAM_1K_Bank(8, data & 0x01); + } + } + break; + case 0xC800: + if (patch == 0) + { + if (data <= 0xDF) + { + SetVROM_1K_Bank(9, data); + } + else + { + SetVRAM_1K_Bank(9, data & 0x01); + } + } + break; + case 0xD000: + if (patch == 0) + { + if (data <= 0xDF) + { + SetVROM_1K_Bank(10, data); + } + else + { + SetVRAM_1K_Bank(10, data & 0x01); + } + } + break; + case 0xD800: + if (patch == 0) + { + if (data <= 0xDF) + { + SetVROM_1K_Bank(11, data); + } + else + { + SetVRAM_1K_Bank(11, data & 0x01); + } + } + break; + case 0xE000: + SetPROM_8K_Bank(4, data & 0x3F); + if (patch == 2) + { + if ((data & 0x40) != 0) SetVRAM_Mirror(VRAM_VMIRROR); + else SetVRAM_Mirror(VRAM_MIRROR4L); + } + if (patch == 3) + { + if ((data & 0x80) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + break; + case 0xE800: + reg[0] = (byte)(data & 0x40); + reg[1] = (byte)(data & 0x80); + SetPROM_8K_Bank(5, data & 0x3F); + break; + case 0xF000: + SetPROM_8K_Bank(6, data & 0x3F); + break; + case 0xF800: + if (addr == 0xF800) + { + if (exsound_enable != 0) + { + nes.apu.ExWrite(addr, data); + } + reg[2] = data; + } + break; + } + } + + //void Mapper019::Clock(INT cycles) + public override void Clock(int cycles) + { + if (irq_enable != 0) + { + irq_counter = (ushort)(irq_counter + cycles); + if (irq_counter >= 0x7FFF) + { + // irq_counter = 0x7FFF; + // nes.cpu.IRQ_NotPending(); + + irq_enable = 0; + // irq_counter &= 0x7FFF; + irq_counter = 0x7FFF; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + + //void Mapper019::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + // p[0] = reg[0]; + // p[1] = reg[1]; + // p[2] = reg[2]; + // p[3] = irq_enable; + // *(WORD*)&p[4] = irq_counter; + + //::memcpy(&p[8], exram, sizeof(exram)); + } + + //void Mapper019::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + // reg[0] = p[0]; + // reg[1] = p[1]; + // reg[2] = p[2]; + // irq_enable = p[3]; + // irq_counter = *(WORD*)&p[4]; + + //::memcpy(exram, &p[8], sizeof(exram)); + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper019.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper019.cs.meta new file mode 100644 index 0000000..1204e14 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper019.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e0d99073c4ae1444bbf4fa05498aecb8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper021.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper021.cs new file mode 100644 index 0000000..178f2d8 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper021.cs @@ -0,0 +1,255 @@ +////////////////// +// Mapper021 Konami VRC4 (Address mask $F006 or $F0C0) // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper021 : Mapper + { + BYTE[] reg = new byte[9]; + + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + INT irq_clock; + public Mapper021(NES parent) : base(parent) + { + } + + + public override void Reset() + { + for (byte i = 0; i < 8; i++) + { + reg[i] = i; + } + reg[8] = 0; + + irq_enable = 0; + irq_counter = 0; + irq_latch = 0; + irq_clock = 0; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + + //void Mapper021::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xF0CF) + { + case 0x8000: + if ((reg[8] & 0x02) != 0) + { + SetPROM_8K_Bank(6, data); + } + else + { + SetPROM_8K_Bank(4, data); + } + break; + case 0xA000: + SetPROM_8K_Bank(5, data); + break; + + case 0x9000: + data &= 0x03; + if (data == 0) SetVRAM_Mirror(VRAM_VMIRROR); + else if (data == 1) SetVRAM_Mirror(VRAM_HMIRROR); + else if (data == 2) SetVRAM_Mirror(VRAM_MIRROR4L); + else SetVRAM_Mirror(VRAM_MIRROR4H); + break; + + case 0x9002: + case 0x9080: + reg[8] = data; + break; + + case 0xB000: + reg[0] = (byte)((reg[0] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(0, reg[0]); + break; + case 0xB002: + case 0xB040: + reg[0] = (byte)((reg[0] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(0, reg[0]); + break; + + case 0xB001: + case 0xB004: + case 0xB080: + reg[1] = (byte)((reg[1] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(1, reg[1]); + break; + case 0xB003: + case 0xB006: + case 0xB0C0: + reg[1] = (byte)((reg[1] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(1, reg[1]); + break; + + case 0xC000: + reg[2] = (byte)((reg[2] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(2, reg[2]); + break; + case 0xC002: + case 0xC040: + reg[2] = (byte)((reg[2] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(2, reg[2]); + break; + + case 0xC001: + case 0xC004: + case 0xC080: + reg[3] = (byte)((reg[3] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(3, reg[3]); + break; + case 0xC003: + case 0xC006: + case 0xC0C0: + reg[3] = (byte)((reg[3] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(3, reg[3]); + break; + + case 0xD000: + reg[4] = (byte)((reg[4] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(4, reg[4]); + break; + case 0xD002: + case 0xD040: + reg[4] = (byte)((reg[4] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(4, reg[4]); + break; + + case 0xD001: + case 0xD004: + case 0xD080: + reg[5] = (byte)((reg[5] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(5, reg[5]); + break; + case 0xD003: + case 0xD006: + case 0xD0C0: + reg[5] = (byte)((reg[5] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(5, reg[5]); + break; + + case 0xE000: + reg[6] = (byte)((reg[6] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(6, reg[6]); + break; + case 0xE002: + case 0xE040: + reg[6] = (byte)((reg[6] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(6, reg[6]); + break; + + case 0xE001: + case 0xE004: + case 0xE080: + reg[7] = (byte)((reg[7] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(7, reg[7]); + break; + case 0xE003: + case 0xE006: + case 0xE0C0: + reg[7] = (byte)((reg[7] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(7, reg[7]); + break; + + case 0xF000: + irq_latch = (byte)((irq_latch & 0xF0) | (data & 0x0F)); + break; + case 0xF002: + case 0xF040: + irq_latch = (byte)((irq_latch & 0x0F) | ((data & 0x0F) << 4)); + break; + + case 0xF003: + case 0xF0C0: + case 0xF006: + irq_enable = (byte)((irq_enable & 0x01) * 3); + irq_clock = 0; + + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + + case 0xF004: + case 0xF080: + irq_enable = (byte)(data & 0x03); + if ((irq_enable & 0x02) != 0) + { + irq_counter = irq_latch; + irq_clock = 0; + } + + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + + // case 0xF006: + // nes.cpu.ClrIRQ( IRQ_MAPPER ); + // break; + } + } + + //void Mapper021::Clock(INT cycles) + public override void Clock(int cycles) + { + if ((irq_enable & 0x02) != 0) + { + if ((irq_clock -= cycles) < 0) + { + irq_clock += 0x72; + if (irq_counter == 0xFF) + { + irq_counter = irq_latch; + // irq_enable = (irq_enable & 0x01) * 3; + // nes.cpu.IRQ_NotPending(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + else + { + irq_counter++; + } + } + } + } + + //void Mapper021::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //for (INT i = 0; i < 9; i++) + //{ + // p[i] = reg[i]; + //} + //p[9] = irq_enable; + //p[10] = irq_counter; + //p[11] = irq_latch; + //*(INT*)&p[12] = irq_clock; + } + + //void Mapper021::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //for (INT i = 0; i < 9; i++) + //{ + // reg[i] = p[i]; + //} + //irq_enable = p[9]; + //irq_counter = p[10]; + //irq_latch = p[11]; + //irq_clock = *(INT*)&p[12]; + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper021.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper021.cs.meta new file mode 100644 index 0000000..db8c641 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper021.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6082f7bf68f41f6439e13610e7766887 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper022.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper022.cs new file mode 100644 index 0000000..eb2add2 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper022.cs @@ -0,0 +1,81 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper022 Konami VRC2 type A // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper022 : Mapper + { + public Mapper022(NES parent) : base(parent) + { + } + + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + + //void Mapper022::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr) + { + case 0x8000: + SetPROM_8K_Bank(4, data); + break; + + case 0x9000: + data &= 0x03; + if (data == 0) SetVRAM_Mirror(VRAM_VMIRROR); + else if (data == 1) SetVRAM_Mirror(VRAM_HMIRROR); + else if (data == 2) SetVRAM_Mirror(VRAM_MIRROR4H); + else SetVRAM_Mirror(VRAM_MIRROR4L); + break; + + case 0xA000: + SetPROM_8K_Bank(5, data); + break; + + case 0xB000: + SetVROM_1K_Bank(0, data >> 1); + break; + + case 0xB001: + SetVROM_1K_Bank(1, data >> 1); + break; + + case 0xC000: + SetVROM_1K_Bank(2, data >> 1); + break; + + case 0xC001: + SetVROM_1K_Bank(3, data >> 1); + break; + + case 0xD000: + SetVROM_1K_Bank(4, data >> 1); + break; + + case 0xD001: + SetVROM_1K_Bank(5, data >> 1); + break; + + case 0xE000: + SetVROM_1K_Bank(6, data >> 1); + break; + + case 0xE001: + SetVROM_1K_Bank(7, data >> 1); + break; + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper022.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper022.cs.meta new file mode 100644 index 0000000..989544d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper022.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b618d4b61b1e6ed48ad8ab3a38947424 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper023.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper023.cs new file mode 100644 index 0000000..cfdf09f --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper023.cs @@ -0,0 +1,271 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper023 Konami VRC2 type B // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper023 : Mapper + { + + ushort addrmask; + + BYTE[] reg = new byte[9]; + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + INT irq_clock; + public Mapper023(NES parent) : base(parent) + { + } + + + public override void Reset() + { + addrmask = 0xFFFF; + + for (byte i = 0; i < 8; i++) + { + reg[i] = i; + } + reg[8] = 0; + + irq_enable = 0; + irq_counter = 0; + irq_latch = 0; + irq_clock = 0; + + reg[9] = 1; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + SetVROM_8K_Bank(0); + + // nes.SetRenderMethod( NES::POST_RENDER ); + + uint crc = nes.rom.GetPROM_CRC(); + + if (crc == 0x93794634 // Akumajou Special Boku Dracula Kun(J) + || crc == 0xc7829dae // Akumajou Special Boku Dracula Kun(T-Eng) + || crc == 0xf82dc02f) + { // Akumajou Special Boku Dracula Kun(T-Eng v1.02) + addrmask = 0xF00C; + nes.SetRenderMethod(EnumRenderMethod.POST_ALL_RENDER); + } + if (crc == 0xdd53c4ae) + { // Tiny Toon Adventures(J) + nes.SetRenderMethod(EnumRenderMethod.POST_ALL_RENDER); + } + } + + //void Mapper023::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + //DEBUGOUT( "MPRWR A=%04X D=%02X L=%3d CYC=%d\n", addr&0xFFFF, data&0xFF, nes.GetScanline(), nes.cpu.GetTotalCycles() ); + switch (addr & addrmask) + { + case 0x8000: + case 0x8004: + case 0x8008: + case 0x800C: + if (reg[8] != 0) + { + SetPROM_8K_Bank(6, data); + } + else + { + SetPROM_8K_Bank(4, data); + } + break; + + case 0x9000: + if (data != 0xFF) + { + data &= 0x03; + if (data == 0) SetVRAM_Mirror(VRAM_VMIRROR); + else if (data == 1) SetVRAM_Mirror(VRAM_HMIRROR); + else if (data == 2) SetVRAM_Mirror(VRAM_MIRROR4L); + else SetVRAM_Mirror(VRAM_MIRROR4H); + } + break; + + case 0x9008: + reg[8] = (byte)(data & 0x02); + break; + + case 0xA000: + case 0xA004: + case 0xA008: + case 0xA00C: + SetPROM_8K_Bank(5, data); + break; + + case 0xB000: + reg[0] = (byte)((reg[0] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(0, reg[0]); + break; + case 0xB001: + case 0xB004: + reg[0] = ((byte)((reg[0] & 0x0F) | ((data & 0x0F) << 4))); + SetVROM_1K_Bank(0, reg[0]); + break; + + case 0xB002: + case 0xB008: + reg[1] = (byte)((reg[1] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(1, reg[1]); + break; + + case 0xB003: + case 0xB00C: + reg[1] = (byte)((reg[1] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(1, reg[1]); + break; + + case 0xC000: + reg[2] = (byte)((reg[2] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(2, reg[2]); + break; + + case 0xC001: + case 0xC004: + reg[2] = (byte)((reg[2] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(2, reg[2]); + break; + + case 0xC002: + case 0xC008: + reg[3] = (byte)((reg[3] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(3, reg[3]); + break; + + case 0xC003: + case 0xC00C: + reg[3] = (byte)((reg[3] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(3, reg[3]); + break; + + case 0xD000: + reg[4] = (byte)((reg[4] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(4, reg[4]); + break; + + case 0xD001: + case 0xD004: + reg[4] = (byte)((reg[4] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(4, reg[4]); + break; + + case 0xD002: + case 0xD008: + reg[5] = (byte)((reg[5] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(5, reg[5]); + break; + + case 0xD003: + case 0xD00C: + reg[5] = (byte)((reg[5] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(5, reg[5]); + break; + + case 0xE000: + reg[6] = (byte)((reg[6] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(6, reg[6]); + break; + + case 0xE001: + case 0xE004: + reg[6] = (byte)((reg[6] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(6, reg[6]); + break; + + case 0xE002: + case 0xE008: + reg[7] = (byte)((reg[7] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(7, reg[7]); + break; + + case 0xE003: + case 0xE00C: + reg[7] = ((byte)((reg[7] & 0x0F) | ((data & 0x0F) << 4))); + SetVROM_1K_Bank(7, reg[7]); + break; + + case 0xF000: + irq_latch = (byte)((irq_latch & 0xF0) | (data & 0x0F)); + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xF004: + irq_latch = (byte)((irq_latch & 0x0F) | ((data & 0x0F) << 4)); + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + + case 0xF008: + irq_enable = (byte)(data & 0x03); + irq_counter = irq_latch; + irq_clock = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + + case 0xF00C: + irq_enable = (byte)((irq_enable & 0x01) * 3); + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + } + } + + //void Mapper023::Clock(INT cycles) + public override void Clock(int cycles) + { + if ((irq_enable & 0x02) != 0) + { + irq_clock += cycles * 3; + while (irq_clock >= 341) + { + irq_clock -= 341; + irq_counter++; + if (irq_counter == 0) + { + irq_counter = irq_latch; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + + //void Mapper023::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //for (INT i = 0; i < 9; i++) + //{ + // p[i] = reg[i]; + //} + //p[9] = irq_enable; + //p[10] = irq_counter; + //p[11] = irq_latch; + //*(INT*)&p[12] = irq_clock; + } + + //void Mapper023::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //for (INT i = 0; i < 9; i++) + //{ + // reg[i] = p[i]; + //} + //irq_enable = p[9]; + //irq_counter = p[10]; + //irq_latch = p[11]; + //irq_clock = *(INT*)&p[12]; + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper023.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper023.cs.meta new file mode 100644 index 0000000..0b14e76 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper023.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d201617d198186e41b362ea94be5533c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper024.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper024.cs new file mode 100644 index 0000000..12c643d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper024.cs @@ -0,0 +1,174 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper024 Konami VRC6 (Normal) // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper024 : Mapper + { + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + INT irq_clock; + public Mapper024(NES parent) : base(parent) + { + } + + + public override void Reset() + { + irq_enable = 0; + irq_counter = 0; + irq_latch = 0; + irq_clock = 0; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + + nes.SetRenderMethod(EnumRenderMethod.POST_RENDER); + // nes.SetRenderMethod( NES::PRE_RENDER ); + + nes.apu.SelectExSound(1); + } + + //void Mapper024::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xF003) + { + case 0x8000: + SetPROM_16K_Bank(4, data); + break; + + case 0x9000: + case 0x9001: + case 0x9002: + case 0xA000: + case 0xA001: + case 0xA002: + case 0xB000: + case 0xB001: + case 0xB002: + nes.apu.ExWrite(addr, data); + break; + + case 0xB003: + data = (byte)(data & 0x0C); + if (data == 0x00) SetVRAM_Mirror(VRAM_VMIRROR); + else if (data == 0x04) SetVRAM_Mirror(VRAM_HMIRROR); + else if (data == 0x08) SetVRAM_Mirror(VRAM_MIRROR4L); + else if (data == 0x0C) SetVRAM_Mirror(VRAM_MIRROR4H); + break; + + case 0xC000: + SetPROM_8K_Bank(6, data); + break; + + case 0xD000: + SetVROM_1K_Bank(0, data); + break; + + case 0xD001: + SetVROM_1K_Bank(1, data); + break; + + case 0xD002: + SetVROM_1K_Bank(2, data); + break; + + case 0xD003: + SetVROM_1K_Bank(3, data); + break; + + case 0xE000: + SetVROM_1K_Bank(4, data); + break; + + case 0xE001: + SetVROM_1K_Bank(5, data); + break; + + case 0xE002: + SetVROM_1K_Bank(6, data); + break; + + case 0xE003: + SetVROM_1K_Bank(7, data); + break; + + case 0xF000: + irq_latch = data; + break; + case 0xF001: + irq_enable = (byte)(data & 0x03); + if ((irq_enable & 0x02) != 0) + { + irq_counter = irq_latch; + irq_clock = 0; + } + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xF002: + irq_enable = (byte)((irq_enable & 0x01) * 3); + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + } + } + + //void Mapper024::Clock(INT cycles) + public override void Clock(int cycles) + { + if ((irq_enable & 0x02) != 0) + { + if ((irq_clock += cycles) >= 0x72) + { + irq_clock -= 0x72; + if (irq_counter == 0xFF) + { + irq_counter = irq_latch; + // nes.cpu.IRQ_NotPending(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + else + { + irq_counter++; + } + } + } + } + + //void Mapper024::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //p[0] = irq_enable; + //p[1] = irq_counter; + //p[2] = irq_latch; + //*(INT*)&p[3] = irq_clock; + } + + //void Mapper024::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //irq_enable = p[0]; + //irq_counter = p[1]; + //irq_latch = p[2]; + //irq_clock = *(INT*)&p[3]; + } + + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper024.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper024.cs.meta new file mode 100644 index 0000000..d1dce11 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper024.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6e319508c6222744dbb48902f10ab3df +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper025.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper025.cs new file mode 100644 index 0000000..4b0e362 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper025.cs @@ -0,0 +1,278 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper025 Konami VRC4 (Normal) // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper025 : Mapper + { + BYTE[] reg = new byte[11]; + BYTE irq_enable; + BYTE irq_latch; + BYTE irq_occur; + BYTE irq_counter; + INT irq_clock; + public Mapper025(NES parent) : base(parent) + { + } + + + public override void Reset() + { + for (INT i = 0; i < 11; i++) + { + reg[i] = 0; + } + reg[9] = (byte)(PROM_8K_SIZE - 2); + + irq_enable = 0; + irq_counter = 0; + irq_latch = 0; + irq_occur = 0; + irq_clock = 0; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + + uint crc = nes.rom.GetPROM_CRC(); + if (crc == 0xc71d4ce7) + { // Gradius II(J) + // nes.SetRenderMethod( NES::POST_RENDER ); + } + if (crc == 0xa2e68da8) + { // For Racer Mini Yonku - Japan Cup(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + if (crc == 0xea74c587) + { // For Teenage Mutant Ninja Turtles(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + if (crc == 0x5f82cb7d) + { // For Teenage Mutant Ninja Turtles 2(J) + } + if (crc == 0x0bbd85ff) + { // For Bio Miracle Bokutte Upa(J) + nes.SetRenderMethod(EnumRenderMethod.PRE_ALL_RENDER); + } + } + + //void Mapper025::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + //if( addr >= 0xF000 ) + //DEBUGOUT( "M25 WR $%04X=$%02X L=%3d\n", addr, data, nes.GetScanline() ); + + switch (addr & 0xF000) + { + case 0x8000: + if ((reg[10] & 0x02) != 0) + { + reg[9] = data; + SetPROM_8K_Bank(6, data); + } + else + { + reg[8] = data; + SetPROM_8K_Bank(4, data); + } + break; + case 0xA000: + SetPROM_8K_Bank(5, data); + break; + } + + switch (addr & 0xF00F) + { + case 0x9000: + data &= 0x03; + if (data == 0) SetVRAM_Mirror(VRAM_VMIRROR); + else if (data == 1) SetVRAM_Mirror(VRAM_HMIRROR); + else if (data == 2) SetVRAM_Mirror(VRAM_MIRROR4L); + else SetVRAM_Mirror(VRAM_MIRROR4H); + break; + + case 0x9001: + case 0x9004: + if ((reg[10] & 0x02) != (data & 0x02)) + { + BYTE swap = reg[8]; + reg[8] = reg[9]; + reg[9] = swap; + + SetPROM_8K_Bank(4, reg[8]); + SetPROM_8K_Bank(6, reg[9]); + } + reg[10] = data; + break; + + case 0xB000: + reg[0] = (byte)((reg[0] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(0, reg[0]); + break; + case 0xB002: + case 0xB008: + reg[0] = (byte)((reg[0] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(0, reg[0]); + break; + + case 0xB001: + case 0xB004: + reg[1] = (byte)((reg[1] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(1, reg[1]); + break; + case 0xB003: + case 0xB00C: + reg[1] = (byte)((reg[1] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(1, reg[1]); + break; + + case 0xC000: + reg[2] = (byte)((reg[2] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(2, reg[2]); + break; + case 0xC002: + case 0xC008: + reg[2] = (byte)((reg[2] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(2, reg[2]); + break; + + case 0xC001: + case 0xC004: + reg[3] = (byte)((reg[3] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(3, reg[3]); + break; + case 0xC003: + case 0xC00C: + reg[3] = (byte)((reg[3] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(3, reg[3]); + break; + + case 0xD000: + reg[4] = (byte)((reg[4] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(4, reg[4]); + break; + case 0xD002: + case 0xD008: + reg[4] = (byte)((reg[4] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(4, reg[4]); + break; + + case 0xD001: + case 0xD004: + reg[5] = (byte)((reg[5] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(5, reg[5]); + break; + case 0xD003: + case 0xD00C: + reg[5] = (byte)((reg[5] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(5, reg[5]); + break; + + case 0xE000: + reg[6] = (byte)((reg[6] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(6, reg[6]); + break; + case 0xE002: + case 0xE008: + reg[6] = (byte)((reg[6] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(6, reg[6]); + break; + + case 0xE001: + case 0xE004: + reg[7] = (byte)((reg[7] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(7, reg[7]); + break; + case 0xE003: + case 0xE00C: + reg[7] = (byte)((reg[7] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(7, reg[7]); + break; + + case 0xF000: + irq_latch = (byte)((irq_latch & 0xF0) | (data & 0x0F)); + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + + case 0xF002: + case 0xF008: + irq_latch = (byte)((irq_latch & 0x0F) | ((data & 0x0F) << 4)); + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + + case 0xF001: + case 0xF004: + irq_enable = (byte)(data & 0x03); + // irq_counter = 0x100 - irq_latch; + irq_counter = irq_latch; + irq_clock = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + + case 0xF003: + case 0xF00C: + irq_enable = (byte)((irq_enable & 0x01) * 3); + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + } + } + + //void Mapper025::Clock(INT cycles) + public override void Clock(int cycles) + { + if ((irq_enable & 0x02) != 0) + { + irq_clock += cycles * 3; + while (irq_clock >= 341) + { + irq_clock -= 341; + irq_counter++; + if (irq_counter == 0) + { + irq_counter = irq_latch; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + + //void Mapper025::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //for (INT i = 0; i < 11; i++) + //{ + // p[i] = reg[i]; + //} + //p[11] = irq_enable; + //p[12] = irq_occur; + //p[13] = irq_latch; + //p[14] = irq_counter; + //*((INT*)&p[15]) = irq_clock; + } + + //void Mapper025::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //for (INT i = 0; i < 11; i++) + //{ + // reg[i] = p[i]; + //} + //irq_enable = p[11]; + //irq_occur = p[12]; + //irq_latch = p[13]; + //irq_counter = p[14]; + //irq_clock = *((INT*)&p[15]); + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper025.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper025.cs.meta new file mode 100644 index 0000000..dd1a8a4 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper025.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6d065f0d406a26d4da372c16493e5bb9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper026.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper026.cs new file mode 100644 index 0000000..5145d37 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper026.cs @@ -0,0 +1,185 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper026 Konami VRC6 (PA0,PA1 reverse) // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper026 : Mapper + { + + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + INT irq_clock; + public Mapper026(NES parent) : base(parent) + { + } + + + public override void Reset() + { + irq_enable = 0; + irq_counter = 0; + irq_latch = 0; + irq_clock = 0; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + + uint crc = nes.rom.GetPROM_CRC(); + if (crc == 0x30e64d03) + { // Esper Dream 2 - Aratanaru Tatakai(J) + nes.SetRenderMethod(EnumRenderMethod.POST_ALL_RENDER); + } + if (crc == 0x836cc1ab) + { // Mouryou Senki Madara(J) + nes.SetRenderMethod(EnumRenderMethod.POST_ALL_RENDER); + } + nes.apu.SelectExSound(1); + } + + //void Mapper026::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xF003) + { + case 0x8000: + SetPROM_16K_Bank(4, data); + break; + + case 0x9000: + case 0x9001: + case 0x9002: + case 0x9003: + case 0xA000: + case 0xA001: + case 0xA002: + case 0xA003: + case 0xB000: + case 0xB001: + case 0xB002: + addr = (ushort)((addr & 0xfffc) | ((addr & 1) << 1) | ((addr & 2) >> 1)); + nes.apu.ExWrite(addr, data); + break; + + case 0xB003: + data = (byte)(data & 0x7F); + if (data == 0x08 || data == 0x2C) SetVRAM_Mirror(VRAM_MIRROR4H); + else if (data == 0x20) SetVRAM_Mirror(VRAM_VMIRROR); + else if (data == 0x24) SetVRAM_Mirror(VRAM_HMIRROR); + else if (data == 0x28) SetVRAM_Mirror(VRAM_MIRROR4L); + break; + + case 0xC000: + SetPROM_8K_Bank(6, data); + break; + + case 0xD000: + SetVROM_1K_Bank(0, data); + break; + + case 0xD001: + SetVROM_1K_Bank(2, data); + break; + + case 0xD002: + SetVROM_1K_Bank(1, data); + break; + + case 0xD003: + SetVROM_1K_Bank(3, data); + break; + + case 0xE000: + SetVROM_1K_Bank(4, data); + break; + + case 0xE001: + SetVROM_1K_Bank(6, data); + break; + + case 0xE002: + SetVROM_1K_Bank(5, data); + break; + + case 0xE003: + SetVROM_1K_Bank(7, data); + break; + + case 0xF000: + irq_latch = data; + break; + case 0xF001: + irq_enable = (byte)((irq_enable & 0x01) * 3); + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xF002: + irq_enable = (byte)(data & 0x03); + if ((irq_enable & 0x02) != 0) + { + irq_counter = irq_latch; + irq_clock = 0; + } + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + } + } + + //void Mapper026::Clock(INT cycles) + public override void Clock(int cycles) + { + if ((irq_enable & 0x02) != 0) + { + if ((irq_clock += cycles) >= 0x72) + { + irq_clock -= 0x72; + if (irq_counter >= 0xFF) + { + irq_counter = irq_latch; + // nes.cpu.IRQ_NotPending(); + //// nes.cpu.IRQ(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + else + { + irq_counter++; + } + } + } + } + + //void Mapper026::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //p[0] = irq_enable; + //p[1] = irq_counter; + //p[2] = irq_latch; + //*(INT*)&p[3] = irq_clock; + } + + //void Mapper026::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //irq_enable = p[0]; + //irq_counter = p[1]; + //irq_latch = p[2]; + //irq_clock = *(INT*)&p[3]; + } + + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper026.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper026.cs.meta new file mode 100644 index 0000000..e517984 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper026.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 96c606c490146244789d313ca2cf55a4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper027.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper027.cs new file mode 100644 index 0000000..d7d83b3 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper027.cs @@ -0,0 +1,228 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper027 Konami VRC4 (World Hero) // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper027 : Mapper + { + ushort[] reg = new ushort[9]; + + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + INT irq_clock; + public Mapper027(NES parent) : base(parent) + { + } + + + public override void Reset() + { + for (INT i = 0; i < 8; i++) + { + reg[i] = (byte)i; + } + reg[8] = 0; + + irq_enable = 0; + irq_counter = 0; + irq_latch = 0; + irq_clock = 0; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + uint crc = nes.rom.GetPROM_CRC(); + if (crc == 0x47DCBCC4) + { // Gradius II(sample) + nes.SetRenderMethod(EnumRenderMethod.POST_RENDER); + } + if (crc == 0x468F21FC) + { // Racer Mini 4 ku(sample) + nes.SetRenderMethod(EnumRenderMethod.POST_RENDER); + } + } + + //void Mapper027::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xF0CF) + { + case 0x8000: + if ((reg[8] & 0x02) != 0) + { + SetPROM_8K_Bank(6, data); + } + else + { + SetPROM_8K_Bank(4, data); + } + break; + case 0xA000: + SetPROM_8K_Bank(5, data); + break; + + case 0x9000: + data &= 0x03; + if (data == 0) SetVRAM_Mirror(VRAM_VMIRROR); + else if (data == 1) SetVRAM_Mirror(VRAM_HMIRROR); + else if (data == 2) SetVRAM_Mirror(VRAM_MIRROR4L); + else SetVRAM_Mirror(VRAM_MIRROR4H); + break; + + case 0x9002: + case 0x9080: + reg[8] = data; + break; + + case 0xB000: + reg[0] = (ushort)((reg[0] & 0xFF0) | (data & 0x0F)); + SetVROM_1K_Bank(0, reg[0]); + break; + case 0xB001: + reg[0] = (ushort)((reg[0] & 0x0F) | (data << 4)); + SetVROM_1K_Bank(0, reg[0]); + break; + + case 0xB002: + reg[1] = (ushort)((reg[1] & 0xFF0) | (data & 0x0F)); + SetVROM_1K_Bank(1, reg[1]); + break; + case 0xB003: + reg[1] = (ushort)((reg[1] & 0x0F) | (data << 4)); + SetVROM_1K_Bank(1, reg[1]); + break; + + case 0xC000: + reg[2] = (ushort)((reg[2] & 0xFF0) | (data & 0x0F)); + SetVROM_1K_Bank(2, reg[2]); + break; + case 0xC001: + reg[2] = (ushort)((reg[2] & 0x0F) | (data << 4)); + SetVROM_1K_Bank(2, reg[2]); + break; + + case 0xC002: + reg[3] = (ushort)((reg[3] & 0xFF0) | (data & 0x0F)); + SetVROM_1K_Bank(3, reg[3]); + break; + case 0xC003: + reg[3] = (ushort)((reg[3] & 0x0F) | (data << 4)); + SetVROM_1K_Bank(3, reg[3]); + break; + + case 0xD000: + reg[4] = (ushort)((reg[4] & 0xFF0) | (data & 0x0F)); + SetVROM_1K_Bank(4, reg[4]); + break; + case 0xD001: + reg[4] = (ushort)((reg[4] & 0x0F) | (data << 4)); + SetVROM_1K_Bank(4, reg[4]); + break; + + case 0xD002: + reg[5] = (ushort)((reg[5] & 0xFF0) | (data & 0x0F)); + SetVROM_1K_Bank(5, reg[5]); + break; + case 0xD003: + reg[5] = (ushort)((reg[5] & 0x0F) | (data << 4)); + SetVROM_1K_Bank(5, reg[5]); + break; + + case 0xE000: + reg[6] = (ushort)((reg[6] & 0xFF0) | (data & 0x0F)); + SetVROM_1K_Bank(6, reg[6]); + break; + case 0xE001: + reg[6] = (ushort)((reg[6] & 0x0F) | (data << 4)); + SetVROM_1K_Bank(6, reg[6]); + break; + + case 0xE002: + reg[7] = (ushort)((reg[7] & 0xFF0) | (data & 0x0F)); + SetVROM_1K_Bank(7, reg[7]); + break; + case 0xE003: + reg[7] = (ushort)((reg[7] & 0x0F) | (data << 4)); + SetVROM_1K_Bank(7, reg[7]); + break; + + case 0xF000: + irq_latch = (byte)((irq_latch & 0xF0) | (data & 0x0F)); + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xF001: + irq_latch = (byte)((irq_latch & 0x0F) | ((data & 0x0F) << 4)); + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + + case 0xF003: + irq_enable = (byte)((irq_enable & 0x01) * 3); + irq_clock = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + + case 0xF002: + irq_enable = (byte)(data & 0x03); + if ((irq_enable & 0x02) != 0) + { + irq_counter = irq_latch; + irq_clock = 0; + } + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + } + } + + //void Mapper027::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((irq_enable & 0x02) != 0) + { + if (irq_counter == 0xFF) + { + irq_counter = irq_latch; + // nes.cpu.IRQ_NotPending(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + else + { + irq_counter++; + } + } + } + + //void Mapper027::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //for (INT i = 0; i < 9; i++) + //{ + // p[i] = reg[i]; + //} + //p[9] = irq_enable; + //p[10] = irq_counter; + //p[11] = irq_latch; + //*(INT*)&p[12] = irq_clock; + } + + //void Mapper027::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //for (INT i = 0; i < 9; i++) + //{ + // reg[i] = p[i]; + //} + //irq_enable = p[9]; + //irq_counter = p[10]; + //irq_latch = p[11]; + //irq_clock = *(INT*)&p[12]; + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper027.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper027.cs.meta new file mode 100644 index 0000000..a6e847b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper027.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 764ca4c42dfc3714e99ff2bbaf56c272 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper032.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper032.cs new file mode 100644 index 0000000..e7345ee --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper032.cs @@ -0,0 +1,123 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper032 Irem G101 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper032 : Mapper + { + BYTE patch; + + BYTE reg; + public Mapper032(NES parent) : base(parent) + { + } + + + public override void Reset() + { + patch = 0; + reg = 0; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_8K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + + uint crc = nes.rom.GetPROM_CRC(); + + // For Major League(J) + if (crc == 0xc0fed437) + { + patch = 1; + } + // For Ai Sensei no Oshiete - Watashi no Hoshi(J) + if (crc == 0xfd3fc292) + { + SetPROM_32K_Bank(30, 31, 30, 31); + } + } + + //void Mapper032::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xF000) + { + case 0x8000: + if ((reg & 0x02) != 0) + { + SetPROM_8K_Bank(6, data); + } + else + { + SetPROM_8K_Bank(4, data); + } + break; + + case 0x9000: + reg = data; + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + break; + + case 0xA000: + SetPROM_8K_Bank(5, data); + break; + } + + switch (addr & 0xF007) + { + case 0xB000: + case 0xB001: + case 0xB002: + case 0xB003: + case 0xB004: + case 0xB005: + SetVROM_1K_Bank((byte)(addr & 0x0007), data); + break; + case 0xB006: + SetVROM_1K_Bank(6, data); + + if (patch != 0 && ((data & 0x40) != 0)) + { + SetVRAM_Mirror(0, 0, 0, 1); + } + break; + case 0xB007: + SetVROM_1K_Bank(7, data); + + if (patch != 0 && ((data & 0x40) != 0)) + { + SetVRAM_Mirror(0, 0, 0, 0); + } + break; + } + } + + //void Mapper032::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg; + } + + //void Mapper032::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg = p[0]; + } + + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper032.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper032.cs.meta new file mode 100644 index 0000000..72e1982 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper032.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 124a427e842cc7d4f879e27d559edfc7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper033.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper033.cs new file mode 100644 index 0000000..aefc121 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper033.cs @@ -0,0 +1,260 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper033 Taito TC0190 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper033 : Mapper + { + BYTE[] reg = new byte[7]; + + BYTE patch; + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + public Mapper033(NES parent) : base(parent) + { + } + + + public override void Reset() + { + patch = 0; + + irq_enable = 0; + irq_counter = 0; + irq_latch = 0; + + reg[0] = 0; + reg[1] = 2; + reg[2] = 4; + reg[3] = 5; + reg[4] = 6; + reg[5] = 7; + reg[6] = 1; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_8K_SIZE != 0) + { + SetBank(); + } + + uint crc = nes.rom.GetPROM_CRC(); + // Check For Old #33 games.... (CRC code by NesToy) + if (crc == 0x5e9bc161 // Akira(J) + || crc == 0xecdbafa4 // Bakushou!! Jinsei Gekijou(J) + || crc == 0x59cd0c31 // Don Doko Don(J) + || crc == 0x837c1342 // Golf Ko Open(J) + || crc == 0x42d893e4 // Operation Wolf(J) + || crc == 0x1388aeb9 // Operation Wolf(U) + || crc == 0x07ee6d8f // Power Blazer(J) + || crc == 0x5193fb54 // Takeshi no Sengoku Fuuunji(J) + || crc == 0xa71c3452) + { // Insector X(J) + patch = 1; + } + + nes.SetRenderMethod(EnumRenderMethod.PRE_RENDER); + + if (crc == 0x202df297) + { // Captain Saver(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + if (crc == 0x63bb86b5) + { // The Jetsons(J) + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + } + + //void Mapper033::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + // LOG( "Mapper033 addr=%04X data=%02X", addr&0xFFFF, data&0xFF ); + + switch (addr) + { + case 0x8000: + if (patch != 0) + { + if ((data & 0x40) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + SetPROM_8K_Bank(4, data & 0x1F); + } + else + { + SetPROM_8K_Bank(4, data); + } + break; + case 0x8001: + if (patch != 0) + { + SetPROM_8K_Bank(5, data & 0x1F); + } + else + { + SetPROM_8K_Bank(5, data); + } + break; + + case 0x8002: + reg[0] = data; + SetBank(); + break; + case 0x8003: + reg[1] = data; + SetBank(); + break; + case 0xA000: + reg[2] = data; + SetBank(); + break; + case 0xA001: + reg[3] = data; + SetBank(); + break; + case 0xA002: + reg[4] = data; + SetBank(); + break; + case 0xA003: + reg[5] = data; + SetBank(); + break; + +#if FLASE//0 + case 0xC003: + case 0xE003: + reg[6] = data; + SetBank(); + break; + + case 0xC000: + irq_counter = data; +// nes.cpu.ClrIRQ( IRQ_MAPPER ); + break; + + case 0xC001: + case 0xC002: + case 0xE001: + case 0xE002: + irq_enable = data; +// nes.cpu.ClrIRQ( IRQ_MAPPER ); + break; +#else + case 0xC000: + irq_latch = data; + irq_counter = irq_latch; + break; + case 0xC001: + irq_counter = irq_latch; + break; + case 0xC002: + irq_enable = 1; + break; + case 0xC003: + irq_enable = 0; + break; + + case 0xE001: + case 0xE002: + case 0xE003: + break; +#endif + + case 0xE000: + if ((data & 0x40) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + break; + } + } + + //void Mapper033::HSync(INT scanline) + public override void HSync(int scanline) + { +#if FALSE//0 +// nes.cpu.ClrIRQ( IRQ_MAPPER ); + if( scanline >= 0 && scanline <= 239 ) { + if( nes.ppu.IsDispON() ) { + if( irq_enable ) { + if( irq_counter == 0xFF ) { + irq_enable = 0; + irq_counter = 0; +// nes.cpu.SetIRQ( IRQ_MAPPER ); + nes.cpu.SetIRQ( IRQ_TRIGGER ); + } else { + irq_counter++; + } + } + } + } +#else + if (scanline >= 0 && scanline <= 239 && nes.ppu.IsDispON()) + { + if (irq_enable != 0) + { + if (++irq_counter == 0) + { + irq_enable = 0; + irq_counter = 0; + nes.cpu.SetIRQ(IRQ_TRIGGER); + } + } + } +#endif + } + + void SetBank() + { + SetVROM_2K_Bank(0, reg[0]); + SetVROM_2K_Bank(2, reg[1]); + + // if( reg[6] & 0x01 ) { + SetVROM_1K_Bank(4, reg[2]); + SetVROM_1K_Bank(5, reg[3]); + SetVROM_1K_Bank(6, reg[4]); + SetVROM_1K_Bank(7, reg[5]); + // } else { + // SetVROM_2K_Bank( 4, reg[0] ); + // SetVROM_2K_Bank( 6, reg[1] ); + // } + } + + //void Mapper033::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + for (INT i = 0; i < 7; i++) + { + p[i] = reg[i]; + } + + p[7] = irq_enable; + p[8] = irq_counter; + p[9] = irq_latch; + } + + //void Mapper033::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + for (INT i = 0; i < 7; i++) + { + reg[i] = p[i]; + } + + irq_enable = p[7]; + irq_counter = p[8]; + irq_latch = p[9]; + } + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper033.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper033.cs.meta new file mode 100644 index 0000000..0938cbf --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper033.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8c7bedd1ba634c14fa3532bb9524cf80 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper034.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper034.cs new file mode 100644 index 0000000..a93eb2d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper034.cs @@ -0,0 +1,54 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper034 Nina-1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper034 : Mapper + { + public Mapper034(NES parent) : base(parent) + { + } + + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper034::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + switch (addr) + { + case 0x7FFD: + SetPROM_32K_Bank(data); + break; + case 0x7FFE: + SetVROM_4K_Bank(0, data); + break; + case 0x7FFF: + SetVROM_4K_Bank(4, data); + break; + } + } + + //void Mapper034::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + SetPROM_32K_Bank(data); + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper034.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper034.cs.meta new file mode 100644 index 0000000..cd0633b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper034.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 647e21ec144715c45bbcf44a6b5757b1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper035.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper035.cs new file mode 100644 index 0000000..9d56e52 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper035.cs @@ -0,0 +1,124 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper035 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper035 : Mapper + { + + BYTE[] reg = new byte[8]; + BYTE[] chr = new byte[8]; + ushort IRQCount, IRQa; + public Mapper035(NES parent) : base(parent) + { + } + + + public override void Reset() + { + for (int i = 0; i < 8; i++) + reg[i] = chr[i] = 0; + + IRQCount = IRQa = 0; + + //SetPROM_32K_Bank( 0, 1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); + + Sync(); + //setprg8r(0x10,0x6000,0); + SetPROM_8K_Bank(7, PROM_8K_SIZE - 1); + } + + void Sync() + { + int i; + SetPROM_8K_Bank(4, reg[0]); + SetPROM_8K_Bank(5, reg[1]); + SetPROM_8K_Bank(6, reg[2]); + for (i = 0; i < 8; i++) + SetVROM_1K_Bank((byte)i, chr[i]); + SetVRAM_Mirror(reg[3] ^ 1); + } + + //void Mapper035::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr >= 0x6000 && addr <= 0x7FFF) + { + XRAM[addr - 0x6000] = data; + } + else + { + base.WriteLow(addr, data); + } + } + //BYTE Mapper035::ReadLow(WORD addr) + public override byte ReadLow(ushort addr) + { + if (addr >= 0x6000 && addr <= 0x7FFF) + { + return XRAM[addr - 0x6000]; + } + else + { + return base.ReadLow(addr); + } + } + + //void Mapper035::Write(WORD A, BYTE V) + public override void Write(ushort A, byte V) + { + switch (A) + { + case 0x8000: reg[0] = V; break; + case 0x8001: reg[1] = V; break; + case 0x8002: reg[2] = V; break; + case 0x9000: chr[0] = V; break; + case 0x9001: chr[1] = V; break; + case 0x9002: chr[2] = V; break; + case 0x9003: chr[3] = V; break; + case 0x9004: chr[4] = V; break; + case 0x9005: chr[5] = V; break; + case 0x9006: chr[6] = V; break; + case 0x9007: chr[7] = V; break; + case 0xC002: + IRQa = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); break; + case 0xC005: IRQCount = V; break; + case 0xC003: IRQa = 1; break; + case 0xD001: reg[3] = V; break; + } + Sync(); + } + + //void Mapper035::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (IRQa!=0) + { + IRQCount--; + if (IRQCount == 0) + { + nes.cpu.SetIRQ(IRQ_MAPPER); + IRQa = 0; + } + } + } + } + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper035.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper035.cs.meta new file mode 100644 index 0000000..0c2f28a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper035.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a56d9f749be056e4b9ccf087899369ad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper040.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper040.cs new file mode 100644 index 0000000..4150669 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper040.cs @@ -0,0 +1,90 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper040 SMB2J // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper040 : Mapper + { + BYTE irq_enable; + INT irq_line; + public Mapper040(NES parent) : base(parent) + { + } + + + public override void Reset() + { + irq_enable = 0; + irq_line = 0; + + SetPROM_8K_Bank(3, 6); + SetPROM_32K_Bank(4, 5, 0, 7); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper040::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE000) + { + case 0x8000: + irq_enable = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xA000: + irq_enable = 0xFF; + irq_line = 37; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xC000: + break; + case 0xE000: + SetPROM_8K_Bank(6, data & 0x07); + break; + } + } + + //void Mapper040::HSync(INT scanline) + public override void HSync(int scanline) + { + if (irq_enable != 0) + { + if (--irq_line <= 0) + { + // nes.cpu.IRQ(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + + //void Mapper040::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //p[0] = irq_enable; + //*(INT*)&p[1] = irq_line; + } + + //void Mapper040::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //irq_enable = p[0]; + //irq_line = *(INT*)&p[1]; + } + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper040.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper040.cs.meta new file mode 100644 index 0000000..38ae7af --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper040.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: de917ab62c02ecc4b87138b609896ce7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper041.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper041.cs new file mode 100644 index 0000000..1586e72 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper041.cs @@ -0,0 +1,78 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper041 Caltron 6-in-1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper041 : Mapper + { + BYTE[] reg = new byte[2]; + public Mapper041(NES parent) : base(parent) + { + } + + + public override void Reset() + { + reg[0] = reg[1] = 0; + + SetPROM_32K_Bank(0, 1, 2, 3); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper041::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr >= 0x6000 && addr < 0x6800) + { + SetPROM_32K_Bank(addr & 0x07); + reg[0] = (byte)(addr & 0x04); + reg[1] &= 0x03; + reg[1] |= (byte)((addr >> 1) & 0x0C); + SetVROM_8K_Bank(reg[1]); + if ((addr & 0x20) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + } + + //void Mapper041::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if (reg[0] != 0) + { + reg[1] &= 0x0C; + reg[1] |= (byte)(addr & 0x03); + SetVROM_8K_Bank(reg[1]); + } + } + + //void Mapper041::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg[0]; + p[1] = reg[1]; + } + + //void Mapper041::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg[0] = p[0]; + reg[1] = p[1]; + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper041.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper041.cs.meta new file mode 100644 index 0000000..f4a1119 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper041.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fc0a11d806679d94da60252475da5996 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper042.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper042.cs new file mode 100644 index 0000000..ac164bf --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper042.cs @@ -0,0 +1,103 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper042 Mario Baby // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper042 : Mapper + { + BYTE irq_enable; + BYTE irq_counter; + public Mapper042(NES parent) : base(parent) + { + } + + + public override void Reset() + { + irq_enable = 0; + irq_counter = 0; + + SetPROM_8K_Bank(3, 0); + SetPROM_32K_Bank(PROM_8K_SIZE - 4, PROM_8K_SIZE - 3, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper042::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE003) + { + case 0xE000: + SetPROM_8K_Bank(3, data & 0x0F); + break; + + case 0xE001: + if ((data & 0x08) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + break; + + case 0xE002: + if ((data & 0x02) != 0) + { + irq_enable = 0xFF; + } + else + { + irq_enable = 0; + irq_counter = 0; + } + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + } + } + + //void Mapper042::HSync(INT scanline) + public override void HSync(int scanline) + { + nes.cpu.ClrIRQ(IRQ_MAPPER); + if (irq_enable != 0) + { + if (irq_counter < 215) + { + irq_counter++; + } + if (irq_counter == 215) + { + irq_enable = 0; + // nes.cpu.IRQ(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + + //void Mapper042::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = irq_enable; + p[1] = irq_counter; + } + + //void Mapper042::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + irq_enable = p[0]; + irq_counter = p[1]; + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper042.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper042.cs.meta new file mode 100644 index 0000000..5a79206 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper042.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0645c16b7e182fa4094ef038567fd95b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper043.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper043.cs new file mode 100644 index 0000000..3957434 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper043.cs @@ -0,0 +1,138 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper043 SMB2J // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper043 : Mapper + { + BYTE irq_enable; + INT irq_counter; + public Mapper043(NES parent) : base(parent) + { + } + + + public override void Reset() + { + irq_enable = 0xFF; + irq_counter = 0; + + SetPROM_8K_Bank(3, 2); + SetPROM_32K_Bank(1, 0, 4, 9); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //BYTE Mapper043::ReadLow(WORD addr) + public override byte ReadLow(ushort addr) + { + if (0x5000 <= addr && addr < 0x6000) + { + byte[] pPtr = nes.rom.GetPROM(); + return pPtr[0x2000 * 8 + 0x1000 + (addr - 0x5000)]; + } + return (BYTE)(addr >> 8); + } + + //void Mapper043::ExWrite(WORD addr, BYTE data) + public override void ExWrite(ushort addr, byte data) + { + if ((addr & 0xF0FF) == 0x4022) + { + switch (data & 0x07) + { + case 0x00: + case 0x02: + case 0x03: + case 0x04: + SetPROM_8K_Bank(6, 4); + break; + case 0x01: + SetPROM_8K_Bank(6, 3); + break; + case 0x05: + SetPROM_8K_Bank(6, 7); + break; + case 0x06: + SetPROM_8K_Bank(6, 5); + break; + case 0x07: + SetPROM_8K_Bank(6, 6); + break; + } + } + } + + //void Mapper043::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if ((addr & 0xF0FF) == 0x4022) + { + ExWrite(addr, data); + } + } + + //void Mapper043::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if (addr == 0x8122) + { + if ((data & 0x03) != 0) + { + irq_enable = 1; + } + else + { + irq_counter = 0; + irq_enable = 0; + } + nes.cpu.ClrIRQ(IRQ_MAPPER); + } + } + + //void Mapper043::HSync(INT scanline) + public override void HSync(int scanline) + { + nes.cpu.ClrIRQ(IRQ_MAPPER); + if (irq_enable != 0) + { + irq_counter += 341; + if (irq_counter >= 12288) + { + irq_counter = 0; + // nes.cpu.IRQ(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + + //void Mapper043::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //p[0] = irq_enable; + //*(INT*)&p[1] = irq_counter; + } + + //void Mapper043::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //irq_enable = p[0]; + //irq_counter = *(INT*)&p[1]; + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper043.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper043.cs.meta new file mode 100644 index 0000000..c4e0641 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper043.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2867bd866aa4459469bc4f3506ac516f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper044.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper044.cs new file mode 100644 index 0000000..3aea21c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper044.cs @@ -0,0 +1,289 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper044 Super HiK 7-in-1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper044 : Mapper + { + BYTE[] reg = new byte[8]; + BYTE patch; + BYTE bank; + BYTE prg0, prg1; + BYTE chr01, chr23, chr4, chr5, chr6, chr7; + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + public Mapper044(NES parent) : base(parent) + { + } + + + public override void Reset() + { + patch = 0; + + if (nes.rom.GetPROM_CRC() == 0x7eef434c) + { + patch = 1; + } + + for (INT i = 0; i < 8; i++) + { + reg[i] = 0; + } + + bank = 0; + prg0 = 0; + prg1 = 1; + + // set VROM banks + if (VROM_1K_SIZE!=0) + { + chr01 = 0; + chr23 = 2; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + } + else + { + chr01 = chr23 = chr4 = chr5 = chr6 = chr7 = 0; + } + + SetBank_CPU(); + SetBank_PPU(); + + irq_enable = 0; + irq_counter = 0; + irq_latch = 0; + } + + //void Mapper044::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr == 0x6000) + { + if (patch!=0) + { + bank = (byte)((data & 0x06) >> 1); + } + else + { + bank = (byte)((data & 0x01) << 1); + } + SetBank_CPU(); + SetBank_PPU(); + } + } + + //void Mapper044::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE001) + { + case 0x8000: + reg[0] = data; + SetBank_CPU(); + SetBank_PPU(); + break; + case 0x8001: + reg[1] = data; + switch (reg[0] & 0x07) + { + case 0x00: + chr01 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x01: + chr23 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x02: + chr4 = data; + SetBank_PPU(); + break; + case 0x03: + chr5 = data; + SetBank_PPU(); + break; + case 0x04: + chr6 = data; + SetBank_PPU(); + break; + case 0x05: + chr7 = data; + SetBank_PPU(); + break; + case 0x06: + prg0 = data; + SetBank_CPU(); + break; + case 0x07: + prg1 = data; + SetBank_CPU(); + break; + } + break; + case 0xA000: + reg[2] = data; + if (!nes.rom.Is4SCREEN()) + { + if ((data & 0x01)!=0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + break; + case 0xA001: + reg[3] = data; + bank = (byte)(data & 0x07); + if (bank == 7) + { + bank = 6; + } + SetBank_CPU(); + SetBank_PPU(); + break; + case 0xC000: + reg[4] = data; + irq_counter = data; + break; + case 0xC001: + reg[5] = data; + irq_latch = data; + break; + case 0xE000: + reg[6] = data; + irq_enable = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + reg[7] = data; + irq_enable = 1; + // nes.cpu.ClrIRQ( IRQ_MAPPER ); + break; + } + } + + //void Mapper044::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable!=0) + { + if ((--irq_counter)==0) + { + irq_counter = irq_latch; + // nes.cpu.IRQ(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + } + + void SetBank_CPU() + { + if ((reg[0] & 0x40)!=0) + { + SetPROM_8K_Bank(4, ((bank == 6) ? 0x1e : 0x0e) | (bank << 4)); + SetPROM_8K_Bank(5, ((bank == 6) ? 0x1f & prg1 : 0x0f & prg1) | (bank << 4)); + SetPROM_8K_Bank(6, ((bank == 6) ? 0x1f & prg0 : 0x0f & prg0) | (bank << 4)); + SetPROM_8K_Bank(7, ((bank == 6) ? 0x1f : 0x0f) | (bank << 4)); + } + else + { + SetPROM_8K_Bank(4, ((bank == 6) ? 0x1f & prg0 : 0x0f & prg0) | (bank << 4)); + SetPROM_8K_Bank(5, ((bank == 6) ? 0x1f & prg1 : 0x0f & prg1) | (bank << 4)); + SetPROM_8K_Bank(6, ((bank == 6) ? 0x1e : 0x0e) | (bank << 4)); + SetPROM_8K_Bank(7, ((bank == 6) ? 0x1f : 0x0f) | (bank << 4)); + } + } + + void SetBank_PPU() + { + if (VROM_1K_SIZE!=0) + { + if ((reg[0] & 0x80)!=0) + { + SetVROM_1K_Bank(0, ((bank == 6) ? 0xff & chr4 : 0x7f & chr4) | (bank << 7)); + SetVROM_1K_Bank(1, ((bank == 6) ? 0xff & chr5 : 0x7f & chr5) | (bank << 7)); + SetVROM_1K_Bank(2, ((bank == 6) ? 0xff & chr6 : 0x7f & chr6) | (bank << 7)); + SetVROM_1K_Bank(3, ((bank == 6) ? 0xff & chr7 : 0x7f & chr7) | (bank << 7)); + SetVROM_1K_Bank(4, ((bank == 6) ? 0xff & chr01 : 0x7f & chr01) | (bank << 7)); + SetVROM_1K_Bank(5, ((bank == 6) ? 0xff & (chr01 + 1) : 0x7f & (chr01 + 1)) | (bank << 7)); + SetVROM_1K_Bank(6, ((bank == 6) ? 0xff & chr23 : 0x7f & chr23) | (bank << 7)); + SetVROM_1K_Bank(7, ((bank == 6) ? 0xff & (chr23 + 1) : 0x7f & (chr23 + 1)) | (bank << 7)); + } + else + { + SetVROM_1K_Bank(0, ((bank == 6) ? 0xff & chr01 : 0x7f & chr01) | (bank << 7)); + SetVROM_1K_Bank(1, ((bank == 6) ? 0xff & (chr01 + 1) : 0x7f & (chr01 + 1)) | (bank << 7)); + SetVROM_1K_Bank(2, ((bank == 6) ? 0xff & chr23 : 0x7f & chr23) | (bank << 7)); + SetVROM_1K_Bank(3, ((bank == 6) ? 0xff & (chr23 + 1) : 0x7f & (chr23 + 1)) | (bank << 7)); + SetVROM_1K_Bank(4, ((bank == 6) ? 0xff & chr4 : 0x7f & chr4) | (bank << 7)); + SetVROM_1K_Bank(5, ((bank == 6) ? 0xff & chr5 : 0x7f & chr5) | (bank << 7)); + SetVROM_1K_Bank(6, ((bank == 6) ? 0xff & chr6 : 0x7f & chr6) | (bank << 7)); + SetVROM_1K_Bank(7, ((bank == 6) ? 0xff & chr7 : 0x7f & chr7) | (bank << 7)); + } + } + } + + //void Mapper044::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + for (INT i = 0; i < 8; i++) + { + p[i] = reg[i]; + } + p[8] = prg0; + p[9] = prg1; + p[10] = chr01; + p[11] = chr23; + p[12] = chr4; + p[13] = chr5; + p[14] = chr6; + p[15] = chr7; + p[16] = irq_enable; + p[17] = irq_counter; + p[18] = irq_latch; + p[19] = bank; + } + + //void Mapper044::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + for (INT i = 0; i < 8; i++) + { + reg[i] = p[i]; + } + prg0 = p[8]; + prg1 = p[9]; + chr01 = p[10]; + chr23 = p[11]; + chr4 = p[12]; + chr5 = p[13]; + chr6 = p[14]; + chr7 = p[15]; + irq_enable = p[16]; + irq_counter = p[17]; + irq_latch = p[18]; + bank = p[19]; + } + + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper044.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper044.cs.meta new file mode 100644 index 0000000..310e8dd --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper044.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4cc48452689c58d4b9272c29c9a812b6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper045.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper045.cs new file mode 100644 index 0000000..fc57fec --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper045.cs @@ -0,0 +1,387 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper045 1000000-in-1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper045 : Mapper + { + BYTE[] reg = new byte[8]; + BYTE patch; + BYTE prg0, prg1, prg2, prg3; + BYTE chr0, chr1, chr2, chr3, chr4, chr5, chr6, chr7; + BYTE[] p = new byte[4]; + INT[] c = new int[8]; + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + BYTE irq_latched; + BYTE irq_reset; + public Mapper045(NES parent) : base(parent) + { + } + + + public override void Reset() + { + patch = 0; + for (INT i = 0; i < 8; i++) + { + reg[i] = 0; + } + + prg0 = 0; + prg1 = 1; + prg2 = (byte)(PROM_8K_SIZE - 2); + prg3 = (byte)(PROM_8K_SIZE - 1); + + uint crc = nes.rom.GetPROM_CRC(); + if (crc == 0x58bcacf6 // Kunio 8-in-1 (Pirate Cart) + || crc == 0x9103cfd6 // HIK 7-in-1 (Pirate Cart) + || crc == 0xc082e6d3) + { // Super 8-in-1 (Pirate Cart) + patch = 1; + prg2 = 62; + prg3 = 63; + } + if (crc == 0xe0dd259d) + { // Super 3-in-1 (Pirate Cart) + patch = 2; + } + SetPROM_32K_Bank(prg0, prg1, prg2, prg3); + p[0] = prg0; + p[1] = prg1; + p[2] = prg2; + p[3] = prg3; + + SetVROM_8K_Bank(0); + + // chr0 = c[0] = 0; + // chr1 = c[1] = 0 + // chr2 = c[2] = 0; + // chr3 = c[3] = 0; + // chr4 = c[4] = 0; + // chr5 = c[5] = 0; + // chr6 = c[6] = 0; + // chr7 = c[7] = 0; + + c[0] = chr0 = 0; + c[1] = chr1 = 1; + c[2] = chr2 = 2; + c[3] = chr3 = 3; + c[4] = chr4 = 4; + c[5] = chr5 = 5; + c[6] = chr6 = 6; + c[7] = chr7 = 7; + + irq_enable = 0; + irq_counter = 0; + irq_latch = 0; + irq_latched = 0; + irq_reset = 0; + } + + //void Mapper045::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + // if( addr == 0x6000 ) { + // if( addr == 0x6000 && !(reg[3]&0x40) ) { + if ((reg[3] & 0x40) == 0) + { + reg[reg[5]] = data; + reg[5] = (byte)((reg[5] + 1) & 0x03); + + SetBank_CPU_4(prg0); + SetBank_CPU_5(prg1); + SetBank_CPU_6(prg2); + SetBank_CPU_7(prg3); + SetBank_PPU(); + } + } + + //void Mapper045::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE001) + { + case 0x8000: + if ((data & 0x40) != (reg[6] & 0x40)) + { + BYTE swp; + swp = prg0; prg0 = prg2; prg2 = swp; + swp = p[0]; p[0] = p[2]; p[2] = swp; + SetBank_CPU_4(p[0]); + SetBank_CPU_5(p[1]); + } + if (VROM_1K_SIZE != 0) + { + if ((data & 0x80) != (reg[6] & 0x80)) + { + INT swp; + swp = chr4; chr4 = chr0; chr0 = (byte)swp; + swp = chr5; chr5 = chr1; chr1 = (byte)swp; + swp = chr6; chr6 = chr2; chr2 = (byte)swp; + swp = chr7; chr7 = chr3; chr3 = (byte)swp; + swp = c[4]; c[4] = c[0]; c[0] = swp; + swp = c[5]; c[5] = c[1]; c[1] = swp; + swp = c[6]; c[6] = c[2]; c[2] = swp; + swp = c[7]; c[7] = c[3]; c[3] = swp; + SetVROM_8K_Bank(c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7]); + } + } + reg[6] = data; + break; + case 0x8001: + switch (reg[6] & 0x07) + { + case 0x00: + chr0 = (byte)((data & 0xFE) + 0); + chr1 = (byte)((data & 0xFE) + 1); + SetBank_PPU(); + break; + case 0x01: + chr2 = (byte)((data & 0xFE) + 0); + chr3 = (byte)((data & 0xFE) + 1); + SetBank_PPU(); + break; + case 0x02: + chr4 = data; + SetBank_PPU(); + break; + case 0x03: + chr5 = data; + SetBank_PPU(); + break; + case 0x04: + chr6 = data; + SetBank_PPU(); + break; + case 0x05: + chr7 = data; + SetBank_PPU(); + break; + case 0x06: + if ((reg[6] & 0x40) != 0) + { + prg2 = (byte)(data & 0x3F); + SetBank_CPU_6(data); + } + else + { + prg0 = (byte)(data & 0x3F); + SetBank_CPU_4(data); + } + break; + case 0x07: + prg1 = (byte)(data & 0x3F); + SetBank_CPU_5(data); + break; + } + break; + case 0xA000: + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + break; + case 0xC000: + if (patch == 2) + { + if (data == 0x29 || data == 0x70) + data = 0x07; + } + irq_latch = data; + irq_latched = 1; + if (irq_reset != 0) + { + irq_counter = data; + irq_latched = 0; + } + // irq_counter = data; + break; + case 0xC001: + // irq_latch = data; + irq_counter = irq_latch; + break; + case 0xE000: + irq_enable = 0; + irq_reset = 1; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + irq_enable = 1; + if (irq_latched != 0) + { + irq_counter = irq_latch; + } + break; + } + } + + //void Mapper045::HSync(INT scanline) + public override void HSync(int scanline) + { + irq_reset = 0; + if ((scanline >= 0 && scanline <= 239) && nes.ppu.IsDispON()) + { + if (irq_counter != 0) + { + irq_counter--; + if (irq_counter == 0) + { + if (irq_enable != 0) + { + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + } + + void SetBank_CPU_4(INT data) + { + data &= (reg[3] & 0x3F) ^ 0xFF; + data &= 0x3F; + data |= reg[1]; + SetPROM_8K_Bank(4, data); + p[0] = (byte)data; + } + + void SetBank_CPU_5(INT data) + { + data &= (reg[3] & 0x3F) ^ 0xFF; + data &= 0x3F; + data |= reg[1]; + SetPROM_8K_Bank(5, data); + p[1] = (byte)data; + } + + void SetBank_CPU_6(INT data) + { + data &= (reg[3] & 0x3F) ^ 0xFF; + data &= 0x3F; + data |= reg[1]; + SetPROM_8K_Bank(6, data); + p[2] = (byte)data; + } + + void SetBank_CPU_7(INT data) + { + data &= (reg[3] & 0x3F) ^ 0xFF; + data &= 0x3F; + data |= reg[1]; + SetPROM_8K_Bank(7, data); + p[3] = (byte)data; + } + + void SetBank_PPU() + { + BYTE[] table = new byte[] { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x01,0x03,0x07,0x0F,0x1F,0x3F,0x7F,0xFF + }; + + c[0] = chr0; + c[1] = chr1; + c[2] = chr2; + c[3] = chr3; + c[4] = chr4; + c[5] = chr5; + c[6] = chr6; + c[7] = chr7; + + for (INT i = 0; i < 8; i++) + { + c[i] &= table[reg[2] & 0x0F]; + c[i] |= reg[0] & ((patch != 1) ? 0xFF : 0xC0); + c[i] += (reg[2] & ((patch != 1) ? 0x10 : 0x30)) << 4; + } + + if ((reg[6] & 0x80) != 0) + { + SetVROM_8K_Bank(c[4], c[5], c[6], c[7], c[0], c[1], c[2], c[3]); + } + else + { + SetVROM_8K_Bank(c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7]); + } + } + + //void Mapper045::SaveState(LPBYTE ps) + public override void SaveState(byte[] p) + { + //INT i; + //for (i = 0; i < 8; i++) + //{ + // ps[i] = reg[i]; + //} + //for (i = 0; i < 4; i++) + //{ + // ps[i + 8] = p[i]; + //} + //for (i = 0; i < 8; i++) + //{ + // *(INT*)&ps[i * 4 + 64] = c[i]; + //} + //ps[20] = prg0; + //ps[21] = prg1; + //ps[22] = prg2; + //ps[23] = prg3; + //ps[24] = chr0; + //ps[25] = chr1; + //ps[26] = chr2; + //ps[27] = chr3; + //ps[28] = chr4; + //ps[29] = chr5; + //ps[30] = chr6; + //ps[31] = chr7; + //ps[32] = irq_enable; + //ps[33] = irq_counter; + //ps[34] = irq_latch; + } + + //void Mapper045::LoadState(LPBYTE ps) + public override void LoadState(byte[] p) + { + //INT i; + //for (i = 0; i < 8; i++) + //{ + // reg[i] = ps[i]; + //} + //for (i = 0; i < 4; i++) + //{ + // p[i] = ps[i + 8]; + //} + //for (i = 0; i < 8; i++) + //{ + // c[i] = *(INT*)&ps[i * 4 + 64]; + //} + //prg0 = ps[20]; + //prg1 = ps[21]; + //prg2 = ps[22]; + //prg3 = ps[23]; + //chr0 = ps[24]; + //chr1 = ps[25]; + //chr2 = ps[26]; + //chr3 = ps[27]; + //chr4 = ps[28]; + //chr5 = ps[29]; + //chr6 = ps[30]; + //chr7 = ps[31]; + //irq_enable = ps[32]; + //irq_counter = ps[33]; + //irq_latch = ps[34]; + } + + + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper045.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper045.cs.meta new file mode 100644 index 0000000..6a679e8 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper045.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ddce49834ab1fac44bde0b09928875e0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper046.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper046.cs new file mode 100644 index 0000000..29fea40 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper046.cs @@ -0,0 +1,88 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper046 Rumble Station // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper046 : Mapper + { + int[] reg = new int[4]; + public Mapper046(NES parent) : base(parent) + { + } + + + public override void Reset() + { + reg[0] = 0; + reg[1] = 0; + reg[2] = 0; + reg[3] = 0; + + SetBank(); + SetVRAM_Mirror(VRAM_VMIRROR); + } + + //void Mapper046::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + reg[0] = data & 0x0F; + reg[1] = (data & 0xF0) >> 4; + SetBank(); + } + + //void Mapper046::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + reg[2] = data & 0x01; + reg[3] = (data & 0x70) >> 4; + SetBank(); + } + + void SetBank() + { + SetPROM_8K_Bank(4, reg[0] * 8 + reg[2] * 4 + 0); + SetPROM_8K_Bank(5, reg[0] * 8 + reg[2] * 4 + 1); + SetPROM_8K_Bank(6, reg[0] * 8 + reg[2] * 4 + 2); + SetPROM_8K_Bank(7, reg[0] * 8 + reg[2] * 4 + 3); + + SetVROM_1K_Bank(0, reg[1] * 64 + reg[3] * 8 + 0); + SetVROM_1K_Bank(1, reg[1] * 64 + reg[3] * 8 + 1); + SetVROM_1K_Bank(2, reg[1] * 64 + reg[3] * 8 + 2); + SetVROM_1K_Bank(3, reg[1] * 64 + reg[3] * 8 + 3); + SetVROM_1K_Bank(4, reg[1] * 64 + reg[3] * 8 + 4); + SetVROM_1K_Bank(5, reg[1] * 64 + reg[3] * 8 + 5); + SetVROM_1K_Bank(6, reg[1] * 64 + reg[3] * 8 + 6); + SetVROM_1K_Bank(7, reg[1] * 64 + reg[3] * 8 + 7); + } + + //void Mapper046::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = (byte)reg[0]; + p[1] = (byte)reg[1]; + p[2] = (byte)reg[2]; + p[3] = (byte)reg[3]; + } + + //void Mapper046::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg[0] = p[0]; + reg[1] = p[1]; + reg[2] = p[2]; + reg[3] = p[3]; + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper046.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper046.cs.meta new file mode 100644 index 0000000..fa1f592 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper046.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 869faf0ac5d44c14eacb8e913bdcc1af +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper047.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper047.cs new file mode 100644 index 0000000..eef8cb7 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper047.cs @@ -0,0 +1,275 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper047 NES-QJ // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper047 : Mapper + { + BYTE[] reg = new byte[8]; + BYTE patch; + BYTE bank; + BYTE prg0, prg1; + BYTE chr01, chr23, chr4, chr5, chr6, chr7; + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + public Mapper047(NES parent) : base(parent) + { + } + + public override void Reset() + { + patch = 0; + + if (nes.rom.GetPROM_CRC() == 0x7eef434c) + { + patch = 1; + } + + for (INT i = 0; i < 8; i++) + { + reg[i] = 0; + } + + bank = 0; + prg0 = 0; + prg1 = 1; + + // set VROM banks + if (VROM_1K_SIZE != 0) + { + chr01 = 0; + chr23 = 2; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + } + else + { + chr01 = chr23 = chr4 = chr5 = chr6 = chr7 = 0; + } + + SetBank_CPU(); + SetBank_PPU(); + + irq_enable = 0; + irq_counter = 0; + irq_latch = 0; + } + + //void Mapper047::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr == 0x6000) + { + if (patch != 0) + { + bank = (byte)((data & 0x06) >> 1); + } + else + { + bank = (byte)((data & 0x01) << 1); + } + SetBank_CPU(); + SetBank_PPU(); + } + } + + //void Mapper047::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE001) + { + case 0x8000: + reg[0] = data; + SetBank_CPU(); + SetBank_PPU(); + break; + case 0x8001: + reg[1] = data; + switch (reg[0] & 0x07) + { + case 0x00: + chr01 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x01: + chr23 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x02: + chr4 = data; + SetBank_PPU(); + break; + case 0x03: + chr5 = data; + SetBank_PPU(); + break; + case 0x04: + chr6 = data; + SetBank_PPU(); + break; + case 0x05: + chr7 = data; + SetBank_PPU(); + break; + case 0x06: + prg0 = data; + SetBank_CPU(); + break; + case 0x07: + prg1 = data; + SetBank_CPU(); + break; + } + break; + case 0xA000: + reg[2] = data; + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + break; + case 0xA001: + reg[3] = data; + break; + case 0xC000: + reg[4] = data; + irq_counter = data; + break; + case 0xC001: + reg[5] = data; + irq_latch = data; + break; + case 0xE000: + reg[6] = data; + irq_enable = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + reg[7] = data; + irq_enable = 1; + break; + } + } + + //void Mapper047::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable != 0) + { + if ((--irq_counter) == 0) + { + irq_counter = irq_latch; + // nes.cpu.IRQ(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + } + + void SetBank_CPU() + { + if ((reg[0] & 0x40) != 0) + { + SetPROM_8K_Bank(4, bank * 8 + ((patch != 0 && bank != 2) ? 6 : 14)); + SetPROM_8K_Bank(5, bank * 8 + prg1); + SetPROM_8K_Bank(6, bank * 8 + prg0); + SetPROM_8K_Bank(7, bank * 8 + ((patch != 0 && bank != 2) ? 7 : 15)); + } + else + { + SetPROM_8K_Bank(4, bank * 8 + prg0); + SetPROM_8K_Bank(5, bank * 8 + prg1); + SetPROM_8K_Bank(6, bank * 8 + ((patch != 0 && bank != 2) ? 6 : 14)); + SetPROM_8K_Bank(7, bank * 8 + ((patch != 0 && bank != 2) ? 7 : 15)); + } + } + + void SetBank_PPU() + { + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x80) != 0) + { + SetVROM_1K_Bank(0, (bank & 0x02) * 64 + chr4); + SetVROM_1K_Bank(1, (bank & 0x02) * 64 + chr5); + SetVROM_1K_Bank(2, (bank & 0x02) * 64 + chr6); + SetVROM_1K_Bank(3, (bank & 0x02) * 64 + chr7); + SetVROM_1K_Bank(4, (bank & 0x02) * 64 + chr01 + 0); + SetVROM_1K_Bank(5, (bank & 0x02) * 64 + chr01 + 1); + SetVROM_1K_Bank(6, (bank & 0x02) * 64 + chr23 + 0); + SetVROM_1K_Bank(7, (bank & 0x02) * 64 + chr23 + 1); + } + else + { + SetVROM_1K_Bank(0, (bank & 0x02) * 64 + chr01 + 0); + SetVROM_1K_Bank(1, (bank & 0x02) * 64 + chr01 + 1); + SetVROM_1K_Bank(2, (bank & 0x02) * 64 + chr23 + 0); + SetVROM_1K_Bank(3, (bank & 0x02) * 64 + chr23 + 1); + SetVROM_1K_Bank(4, (bank & 0x02) * 64 + chr4); + SetVROM_1K_Bank(5, (bank & 0x02) * 64 + chr5); + SetVROM_1K_Bank(6, (bank & 0x02) * 64 + chr6); + SetVROM_1K_Bank(7, (bank & 0x02) * 64 + chr7); + } + } + } + + //void Mapper047::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + for (INT i = 0; i < 8; i++) + { + p[i] = reg[i]; + } + p[8] = prg0; + p[9] = prg1; + p[10] = chr01; + p[11] = chr23; + p[12] = chr4; + p[13] = chr5; + p[14] = chr6; + p[15] = chr7; + p[16] = irq_enable; + p[17] = irq_counter; + p[18] = irq_latch; + p[19] = bank; + } + + //void Mapper047::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + for (INT i = 0; i < 8; i++) + { + reg[i] = p[i]; + } + prg0 = p[8]; + prg1 = p[9]; + chr01 = p[10]; + chr23 = p[11]; + chr4 = p[12]; + chr5 = p[13]; + chr6 = p[14]; + chr7 = p[15]; + irq_enable = p[16]; + irq_counter = p[17]; + irq_latch = p[18]; + bank = p[19]; + } + + + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper047.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper047.cs.meta new file mode 100644 index 0000000..2babab8 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper047.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b35280f1894671747ba810b657054e8e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper048.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper048.cs new file mode 100644 index 0000000..cb3fba6 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper048.cs @@ -0,0 +1,143 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper048 Taito TC190V // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper048 : Mapper + { + BYTE reg; + BYTE irq_enable; + BYTE irq_counter; + public Mapper048(NES parent) : base(parent) + { + } + + public override void Reset() + { + reg = 0; + irq_enable = 0; + irq_counter = 0; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + SetVROM_8K_Bank(0); + + uint crc = nes.rom.GetPROM_CRC(); + // if( crc == 0x547e6cc1 ) { // Flintstones - The Rescue of Dino & Hoppy(J) + // nes.SetRenderMethod( NES::POST_RENDER ); + // } + } + + //void Mapper048::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr) + { + case 0x8000: + if (reg == 0) + { + if ((data & 0x40) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + SetPROM_8K_Bank(4, data); + break; + case 0x8001: + SetPROM_8K_Bank(5, data); + break; + + case 0x8002: + SetVROM_2K_Bank(0, data); + break; + case 0x8003: + SetVROM_2K_Bank(2, data); + break; + case 0xA000: + SetVROM_1K_Bank(4, data); + break; + case 0xA001: + SetVROM_1K_Bank(5, data); + break; + case 0xA002: + SetVROM_1K_Bank(6, data); + break; + case 0xA003: + SetVROM_1K_Bank(7, data); + break; + + case 0xC000: + irq_counter = data; + irq_enable = 0; + // nes.cpu.ClrIRQ( IRQ_MAPPER ); + break; + + case 0xC001: + irq_counter = data; + irq_enable = 1; + // irq_enable = data & 0x01; + // nes.cpu.ClrIRQ( IRQ_MAPPER ); + break; + + case 0xC002: + break; + case 0xC003: + break; + + case 0xE000: + if ((data & 0x40) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + reg = 1; + break; + } + } + + //void Mapper048::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable != 0) + { + if (irq_counter == 0xFF) + { + // nes.cpu.IRQ_NotPending(); + // nes.cpu.SetIRQ( IRQ_MAPPER ); + nes.cpu.SetIRQ(IRQ_TRIGGER2); + } + irq_counter++; + } + } + } + } + + //void Mapper048::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg; + p[1] = irq_enable; + p[2] = irq_counter; + } + + //void Mapper048::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg = p[0]; + irq_enable = p[1]; + irq_counter = p[2]; + } + + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper048.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper048.cs.meta new file mode 100644 index 0000000..61333f9 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper048.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e83144b10b1ec0546b0d4f40b8d5f305 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper050.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper050.cs new file mode 100644 index 0000000..0497cca --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper050.cs @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper050 SMB2J // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper050 : Mapper + { + BYTE irq_enable; + public Mapper050(NES parent) : base(parent) + { + } + + public override void Reset() + { + irq_enable = 0; + SetPROM_8K_Bank(3, 15); + SetPROM_8K_Bank(4, 8); + SetPROM_8K_Bank(5, 9); + SetPROM_8K_Bank(6, 0); + SetPROM_8K_Bank(7, 11); + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper050::ExWrite(WORD addr, BYTE data) + public override void ExWrite(ushort addr, byte data) + { + if ((addr & 0xE060) == 0x4020) + { + if ((addr & 0x0100) != 0) + { + irq_enable = (byte)(data & 0x01); + nes.cpu.ClrIRQ(IRQ_MAPPER); + } + else + { + SetPROM_8K_Bank(6, (data & 0x08) | ((data & 0x01) << 2) | ((data & 0x06) >> 1)); + } + } + } + + //void Mapper050::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if ((addr & 0xE060) == 0x4020) + { + if ((addr & 0x0100) != 0) + { + irq_enable = (byte)(data & 0x01); + nes.cpu.ClrIRQ(IRQ_MAPPER); + } + else + { + SetPROM_8K_Bank(6, (data & 0x08) | ((data & 0x01) << 2) | ((data & 0x06) >> 1)); + } + } + } + + //void Mapper050::HSync(INT scanline) + public override void HSync(int scanline) + { + if (irq_enable != 0) + { + if (scanline == 21) + { + // nes.cpu.IRQ(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + + //void Mapper050::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = irq_enable; + } + + //void Mapper050::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + irq_enable = p[0]; + } + + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper050.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper050.cs.meta new file mode 100644 index 0000000..36e89af --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper050.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 189113b0ca31017448ec750a72e57ddc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper051.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper051.cs new file mode 100644 index 0000000..17d162d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper051.cs @@ -0,0 +1,109 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper051 11-in-1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper051 : Mapper + { + int mode, bank; + public Mapper051(NES parent) : base(parent) + { + } + + public override void Reset() + { + bank = 0; + mode = 1; + + SetBank_CPU(); + SetCRAM_8K_Bank(0); + } + + //void Mapper051::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr >= 0x6000) + { + mode = ((data & 0x10) >> 3) | ((data & 0x02) >> 1); + SetBank_CPU(); + } + } + + //void Mapper051::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + bank = (data & 0x0f) << 2; + if (0xC000 <= addr && addr <= 0xDFFF) + { + mode = (mode & 0x01) | ((data & 0x10) >> 3); + } + SetBank_CPU(); + } + + void SetBank_CPU() + { + switch (mode) + { + case 0: + SetVRAM_Mirror(VRAM_VMIRROR); + SetPROM_8K_Bank(3, (bank | 0x2c | 3)); + SetPROM_8K_Bank(4, (bank | 0x00 | 0)); + SetPROM_8K_Bank(5, (bank | 0x00 | 1)); + SetPROM_8K_Bank(6, (bank | 0x0c | 2)); + SetPROM_8K_Bank(7, (bank | 0x0c | 3)); + break; + case 1: + SetVRAM_Mirror(VRAM_VMIRROR); + SetPROM_8K_Bank(3, (bank | 0x20 | 3)); + SetPROM_8K_Bank(4, (bank | 0x00 | 0)); + SetPROM_8K_Bank(5, (bank | 0x00 | 1)); + SetPROM_8K_Bank(6, (bank | 0x00 | 2)); + SetPROM_8K_Bank(7, (bank | 0x00 | 3)); + break; + case 2: + SetVRAM_Mirror(VRAM_VMIRROR); + SetPROM_8K_Bank(3, (bank | 0x2e | 3)); + SetPROM_8K_Bank(4, (bank | 0x02 | 0)); + SetPROM_8K_Bank(5, (bank | 0x02 | 1)); + SetPROM_8K_Bank(6, (bank | 0x0e | 2)); + SetPROM_8K_Bank(7, (bank | 0x0e | 3)); + break; + case 3: + SetVRAM_Mirror(VRAM_HMIRROR); + SetPROM_8K_Bank(3, (bank | 0x20 | 3)); + SetPROM_8K_Bank(4, (bank | 0x00 | 0)); + SetPROM_8K_Bank(5, (bank | 0x00 | 1)); + SetPROM_8K_Bank(6, (bank | 0x00 | 2)); + SetPROM_8K_Bank(7, (bank | 0x00 | 3)); + break; + } + } + + //void Mapper051::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = (byte)mode; + p[1] = (byte)bank; + } + + //void Mapper051::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + mode = p[0]; + bank = p[1]; + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper051.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper051.cs.meta new file mode 100644 index 0000000..1b8836c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper051.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 571fbd114543cf2498b886722d4db2c9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper057.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper057.cs new file mode 100644 index 0000000..2edede6 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper057.cs @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper057 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper057 : Mapper + { + + BYTE reg; + public Mapper057(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, 0, 1); + SetVROM_8K_Bank(0); + reg = 0; + } + + //void Mapper057::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr) + { + case 0x8000: + case 0x8001: + case 0x8002: + case 0x8003: + if ((data & 0x40) != 0) + { + SetVROM_8K_Bank((data & 0x03) + ((reg & 0x10) >> 1) + (reg & 0x07)); + } + break; + case 0x8800: + reg = data; + + if ((data & 0x80) != 0) + { + SetPROM_8K_Bank(4, ((data & 0x40) >> 6) * 4 + 8 + 0); + SetPROM_8K_Bank(5, ((data & 0x40) >> 6) * 4 + 8 + 1); + SetPROM_8K_Bank(6, ((data & 0x40) >> 6) * 4 + 8 + 2); + SetPROM_8K_Bank(7, ((data & 0x40) >> 6) * 4 + 8 + 3); + } + else + { + SetPROM_8K_Bank(4, ((data & 0x60) >> 5) * 2 + 0); + SetPROM_8K_Bank(5, ((data & 0x60) >> 5) * 2 + 1); + SetPROM_8K_Bank(6, ((data & 0x60) >> 5) * 2 + 0); + SetPROM_8K_Bank(7, ((data & 0x60) >> 5) * 2 + 1); + } + + SetVROM_8K_Bank((data & 0x07) + ((data & 0x10) >> 1)); + + if ((data & 0x08) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + + break; + } + } + + //void Mapper057::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg; + } + + //void Mapper057::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg = p[0]; + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper057.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper057.cs.meta new file mode 100644 index 0000000..070fcb2 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper057.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4e308cd2cba2bd046b2174191bd85e40 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper058.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper058.cs new file mode 100644 index 0000000..4412749 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper058.cs @@ -0,0 +1,53 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper058 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper058 : Mapper + { + public Mapper058(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, 0, 1); + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper058::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if ((addr & 0x40) != 0) + { + SetPROM_16K_Bank(4, addr & 0x07); + SetPROM_16K_Bank(6, addr & 0x07); + } + else + { + SetPROM_32K_Bank((addr & 0x06) >> 1); + } + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank((addr & 0x38) >> 3); + } + + if ((data & 0x02) != 0) SetVRAM_Mirror(VRAM_VMIRROR); + else SetVRAM_Mirror(VRAM_HMIRROR); + } + + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper058.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper058.cs.meta new file mode 100644 index 0000000..eb626ae --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper058.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1aa707df3277a794ca6410f942a25620 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper060.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper060.cs new file mode 100644 index 0000000..27ab69c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper060.cs @@ -0,0 +1,66 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper060 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper060 : Mapper + { + BYTE patch; + BYTE game_sel; + public Mapper060(NES parent) : base(parent) + { + } + + public override void Reset() + { + patch = 0; + + uint crc = nes.rom.GetPROM_CRC(); + if (crc == 0xf9c484a0) + { // Reset Based 4-in-1(Unl) + SetPROM_16K_Bank(4, game_sel); + SetPROM_16K_Bank(6, game_sel); + SetVROM_8K_Bank(game_sel); + game_sel++; + game_sel &= 3; + } + else + { + patch = 1; + SetPROM_32K_Bank(0); + SetVROM_8K_Bank(0); + } + } + + //void Mapper060::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if (patch != 0) + { + if ((addr & 0x80) != 0) + { + SetPROM_16K_Bank(4, (addr & 0x70) >> 4); + SetPROM_16K_Bank(6, (addr & 0x70) >> 4); + } + else + { + SetPROM_32K_Bank((addr & 0x70) >> 5); + } + + SetVROM_8K_Bank(addr & 0x07); + + if ((data & 0x08) != 0) SetVRAM_Mirror(VRAM_VMIRROR); + else SetVRAM_Mirror(VRAM_HMIRROR); + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper060.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper060.cs.meta new file mode 100644 index 0000000..cbcd5d3 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper060.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ec235304463428e49bf1df24c3e82799 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper061.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper061.cs new file mode 100644 index 0000000..0432a5e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper061.cs @@ -0,0 +1,47 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper061 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper061 : Mapper + { + public Mapper061(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + + //void Mapper061::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0x30) + { + case 0x00: + case 0x30: + SetPROM_32K_Bank(addr & 0x0F); + break; + case 0x10: + case 0x20: + SetPROM_16K_Bank(4, ((addr & 0x0F) << 1) | ((addr & 0x20) >> 4)); + SetPROM_16K_Bank(6, ((addr & 0x0F) << 1) | ((addr & 0x20) >> 4)); + break; + } + + if ((addr & 0x80) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper061.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper061.cs.meta new file mode 100644 index 0000000..2ab1bde --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper061.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 99e17dde8c75db54f9ece9eeb0767f7a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper062.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper062.cs new file mode 100644 index 0000000..edd772c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper062.cs @@ -0,0 +1,53 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper062 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper062 : Mapper + { + public Mapper062(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0); + SetVROM_8K_Bank(0); + } + + //void Mapper062::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xFF00) + { + case 0x8100: + SetPROM_8K_Bank(4, data); + SetPROM_8K_Bank(5, data + 1); + break; + case 0x8500: + SetPROM_8K_Bank(4, data); + break; + case 0x8700: + SetPROM_8K_Bank(5, data); + break; + SetVROM_1K_Bank(0, data + 0); + SetVROM_1K_Bank(1, data + 1); + SetVROM_1K_Bank(2, data + 2); + SetVROM_1K_Bank(3, data + 3); + SetVROM_1K_Bank(4, data + 4); + SetVROM_1K_Bank(5, data + 5); + SetVROM_1K_Bank(6, data + 6); + SetVROM_1K_Bank(7, data + 7); + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper062.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper062.cs.meta new file mode 100644 index 0000000..ef227aa --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper062.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 939ee4b96ee5c424bba241dc62b5f6d4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper064.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper064.cs new file mode 100644 index 0000000..6d02bf2 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper064.cs @@ -0,0 +1,283 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper064 Tengen Rambo-1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper064 : Mapper + { + BYTE[] reg = new byte[3]; + BYTE irq_enable; + BYTE irq_mode; + INT irq_counter; + INT irq_counter2; + BYTE irq_latch; + BYTE irq_reset; + public Mapper064(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(PROM_8K_SIZE - 1, PROM_8K_SIZE - 1, PROM_8K_SIZE - 1, PROM_8K_SIZE - 1); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + + reg[0] = reg[1] = reg[2] = 0; + + irq_enable = 0; + irq_mode = 0; + irq_counter = 0; + irq_counter2 = 0; + irq_latch = 0; + irq_reset = 0; + } + + //void Mapper064::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + //DEBUGOUT( "$%04X:$%02X\n", addr, data ); + switch (addr & 0xF003) + { + case 0x8000: + reg[0] = (byte)(data & 0x0F); + reg[1] = (byte)(data & 0x40); + reg[2] = (byte)(data & 0x80); + break; + + case 0x8001: + switch (reg[0]) + { + case 0x00: + if (reg[2] != 0) + { + SetVROM_1K_Bank(4, data + 0); + SetVROM_1K_Bank(5, data + 1); + } + else + { + SetVROM_1K_Bank(0, data + 0); + SetVROM_1K_Bank(1, data + 1); + } + break; + case 0x01: + if (reg[2] != 0) + { + SetVROM_1K_Bank(6, data + 0); + SetVROM_1K_Bank(7, data + 1); + } + else + { + SetVROM_1K_Bank(2, data + 0); + SetVROM_1K_Bank(3, data + 1); + } + break; + case 0x02: + if (reg[2] != 0) + { + SetVROM_1K_Bank(0, data); + } + else + { + SetVROM_1K_Bank(4, data); + } + break; + case 0x03: + if (reg[2] != 0) + { + SetVROM_1K_Bank(1, data); + } + else + { + SetVROM_1K_Bank(5, data); + } + break; + case 0x04: + if (reg[2] != 0) + { + SetVROM_1K_Bank(2, data); + } + else + { + SetVROM_1K_Bank(6, data); + } + break; + case 0x05: + if (reg[2] != 0) + { + SetVROM_1K_Bank(3, data); + } + else + { + SetVROM_1K_Bank(7, data); + } + break; + case 0x06: + if (reg[1] != 0) + { + SetPROM_8K_Bank(5, data); + } + else + { + SetPROM_8K_Bank(4, data); + } + break; + case 0x07: + if (reg[1] != 0) + { + SetPROM_8K_Bank(6, data); + } + else + { + SetPROM_8K_Bank(5, data); + } + break; + case 0x08: + SetVROM_1K_Bank(1, data); + break; + case 0x09: + SetVROM_1K_Bank(3, data); + break; + case 0x0F: + if (reg[1] != 0) + { + SetPROM_8K_Bank(4, data); + } + else + { + SetPROM_8K_Bank(6, data); + } + break; + } + break; + + case 0xA000: + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + break; + + case 0xC000: + irq_latch = data; + if (irq_reset != 0) + { + irq_counter = irq_latch; + } + break; + case 0xC001: + irq_reset = 0xFF; + irq_counter = irq_latch; + irq_mode = (byte)(data & 0x01); + break; + case 0xE000: + irq_enable = 0; + if (irq_reset != 0) + { + irq_counter = irq_latch; + } + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + irq_enable = 0xFF; + if (irq_reset != 0) + { + irq_counter = irq_latch; + } + break; + } + } + + //void Mapper064::Clock(INT cycles) + public override void Clock(int cycles) + { + if (irq_mode == 0) + return; + + irq_counter2 += cycles; + while (irq_counter2 >= 4) + { + irq_counter2 -= 4; + if (irq_counter >= 0) + { + irq_counter--; + if (irq_counter < 0) + { + if (irq_enable != 0) + { + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + } + + //void Mapper064::HSync(INT scanline) + public override void HSync(int scanline) + { + if (irq_mode != 0) + return; + + irq_reset = 0; + + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_counter >= 0) + { + irq_counter--; + if (irq_counter < 0) + { + if (irq_enable != 0) + { + irq_reset = 1; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + } + } + + //void Mapper064::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //p[0] = reg[0]; + //p[1] = reg[1]; + //p[2] = reg[2]; + //p[3] = irq_enable; + //p[4] = irq_mode; + //p[5] = irq_latch; + //p[6] = irq_reset; + //*((INT*)&p[8]) = irq_counter; + //*((INT*)&p[12]) = irq_counter2; + } + + //void Mapper064::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //reg[0] = p[0]; + //reg[1] = p[1]; + //reg[2] = p[2]; + //irq_enable = p[3]; + //irq_mode = p[4]; + //irq_latch = p[5]; + //irq_reset = p[6]; + //irq_counter = *((INT*)&p[8]); + //irq_counter2 = *((INT*)&p[12]); + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper064.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper064.cs.meta new file mode 100644 index 0000000..523c548 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper064.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e265ca28ccd66d948996bae491315162 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper065.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper065.cs new file mode 100644 index 0000000..e81fde1 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper065.cs @@ -0,0 +1,189 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper065 Irem H3001 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper065 : Mapper + { + BYTE patch; + + BYTE irq_enable; + INT irq_counter; + INT irq_latch; + public Mapper065(NES parent) : base(parent) + { + } + + public override void Reset() + { + patch = 0; + + // Kaiketsu Yanchamaru 3(J) + if (nes.rom.GetPROM_CRC() == 0xe30b7f64) + { + patch = 1; + } + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_8K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + + irq_enable = 0; + irq_counter = 0; + } + + //void Mapper065::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr) + { + case 0x8000: + SetPROM_8K_Bank(4, data); + break; + + case 0x9000: + if (patch == 0) + { + if ((data & 0x40) != 0) SetVRAM_Mirror(VRAM_VMIRROR); + else SetVRAM_Mirror(VRAM_HMIRROR); + } + break; + + case 0x9001: + if (patch != 0) + { + if ((data & 0x80) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + break; + + case 0x9003: + if (patch == 0) + { + irq_enable = (byte)(data & 0x8); + nes.cpu.ClrIRQ(IRQ_MAPPER); + } + break; + case 0x9004: + if (patch == 0) + { + irq_counter = irq_latch; + } + break; + case 0x9005: + if (patch != 0) + { + irq_counter = (BYTE)(data << 1); + irq_enable = data; + nes.cpu.ClrIRQ(IRQ_MAPPER); + } + else + { + irq_latch = (irq_latch & 0x00FF) | ((INT)data << 8); + } + break; + + case 0x9006: + if (patch != 0) + { + irq_enable = 1; + } + else + { + irq_latch = (irq_latch & 0xFF00) | data; + } + break; + + case 0xB000: + case 0xB001: + case 0xB002: + case 0xB003: + case 0xB004: + case 0xB005: + case 0xB006: + case 0xB007: + SetVROM_1K_Bank((byte)(addr & 0x0007), data); + break; + + case 0xA000: + SetPROM_8K_Bank(5, data); + break; + case 0xC000: + SetPROM_8K_Bank(6, data); + break; + } + } + + //void Mapper065::HSync(INT scanline) + public override void HSync(int scanline) + { + if (patch != 0) + { + if (irq_enable != 0) + { + if (irq_counter == 0) + { + // nes.cpu.IRQ_NotPending(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + else + { + irq_counter--; + } + } + } + } + + //void Mapper065::Clock(INT cycles) + public override void Clock(int cycles) + { + if (patch == 0) + { + if (irq_enable != 0) + { + if (irq_counter <= 0) + { + // nes.cpu.IRQ_NotPending(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + else + { + irq_counter -= cycles; + } + } + } + } + + //void Mapper065::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //p[0] = irq_enable; + //*(INT*)&p[1] = irq_counter; + //*(INT*)&p[5] = irq_latch; + } + + //void Mapper065::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //irq_enable = p[0]; + //irq_counter = *(INT*)&p[1]; + //irq_latch = *(INT*)&p[5]; + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper065.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper065.cs.meta new file mode 100644 index 0000000..b40f5f3 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper065.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 953f2e26ba82ff64b9aac6ad4476afb5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper066.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper066.cs new file mode 100644 index 0000000..ed17be0 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper066.cs @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper066 Bandai 74161 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper066 : Mapper + { + public Mapper066(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + SetVROM_8K_Bank(0); + + // if( nes->rom->GetPROM_CRC() == 0xe30552db ) { // Paris-Dakar Rally Special + // nes->SetFrameIRQmode( FALSE ); + // } + } + + //void Mapper066::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr >= 0x6000) + { + SetPROM_32K_Bank((data & 0xF0) >> 4); + SetVROM_8K_Bank(data & 0x0F); + } + } + + //void Mapper066::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + SetPROM_32K_Bank((data & 0xF0) >> 4); + SetVROM_8K_Bank(data & 0x0F); + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper066.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper066.cs.meta new file mode 100644 index 0000000..ff72f90 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper066.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: de0206b3dc89c224b89aa969c373434c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper067.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper067.cs new file mode 100644 index 0000000..cd92034 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper067.cs @@ -0,0 +1,140 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper067 SunSoft Mapper 3 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper067 : Mapper + { + BYTE irq_enable; + BYTE irq_occur; + BYTE irq_toggle; + INT irq_counter; + public Mapper067(NES parent) : base(parent) + { + } + + public override void Reset() + + { + irq_enable = 0; + irq_toggle = 0; + irq_counter = 0; + irq_occur = 0; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + SetVROM_4K_Bank(0, 0); + SetVROM_4K_Bank(4, VROM_4K_SIZE - 1); + + uint crc = nes.rom.GetPROM_CRC(); + + if (crc == 0x7f2a04bf) + { // For Fantasy Zone 2(J) + nes.SetRenderMethod(EnumRenderMethod.PRE_ALL_RENDER); + } + } + + //void Mapper067::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xF800) + { + case 0x8800: + SetVROM_2K_Bank(0, data); + break; + case 0x9800: + SetVROM_2K_Bank(2, data); + break; + case 0xA800: + SetVROM_2K_Bank(4, data); + break; + case 0xB800: + SetVROM_2K_Bank(6, data); + break; + + case 0xC800: + if (irq_toggle == 0) + { + irq_counter = (irq_counter & 0x00FF) | ((INT)data << 8); + } + else + { + irq_counter = (irq_counter & 0xFF00) | ((INT)data & 0xFF); + } + irq_toggle ^= 1; + irq_occur = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xD800: + irq_enable = (byte)(data & 0x10); + irq_toggle = 0; + irq_occur = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + + case 0xE800: + data &= 0x03; + if (data == 0) SetVRAM_Mirror(VRAM_VMIRROR); + else if (data == 1) SetVRAM_Mirror(VRAM_HMIRROR); + else if (data == 2) SetVRAM_Mirror(VRAM_MIRROR4L); + else SetVRAM_Mirror(VRAM_MIRROR4H); + break; + + case 0xF800: + SetPROM_16K_Bank(4, data); + break; + } + } + + //void Mapper067::Clock(INT cycles) + public override void Clock(int cycles) + { + if (irq_enable != 0) + { + if ((irq_counter -= cycles) <= 0) + { + irq_enable = 0; + irq_occur = 0xFF; + irq_counter = 0xFFFF; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + + // if( irq_occur ) { + // nes.cpu.IRQ_NotPending(); + // } + } + + //void Mapper067::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //p[0] = irq_enable; + //p[1] = irq_occur; + //p[2] = irq_toggle; + //*((INT*)&p[3]) = irq_counter; + } + + //void Mapper067::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //irq_enable = p[0]; + //irq_occur = p[1]; + //irq_toggle = p[2]; + //irq_counter = *((INT*)&p[3]); + } + + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper067.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper067.cs.meta new file mode 100644 index 0000000..8757815 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper067.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5a6da4cd8de113e4c915b45d95b21e48 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper068.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper068.cs new file mode 100644 index 0000000..9c6cf09 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper068.cs @@ -0,0 +1,164 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper068 SunSoft Mapper 4 (After Burner II) // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper068 : Mapper + { + BYTE[] reg = new byte[4]; + BYTE coin; + public Mapper068(NES parent) : base(parent) + { + } + + public override void Reset() + { + reg[0] = reg[1] = reg[2] = reg[3] = 0; + coin = 0; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + + +#if FALSE //0 +BYTE Mapper068::ExRead( WORD addr ) +{ + if( addr == 0x4020 ) { +DEBUGOUT( "RD $4020:%02X\n", coin ); + return coin; + } + + return addr>>8; +} + +void Mapper068::ExWrite( WORD addr, BYTE data ) +{ + if( addr == 0x4020 ) { +DEBUGOUT( "WR $4020:%02X\n", data ); + coin = data; + } +} +#endif + + //void Mapper068::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xF000) + { + case 0x8000: + SetVROM_2K_Bank(0, data); + break; + case 0x9000: + SetVROM_2K_Bank(2, data); + break; + case 0xA000: + SetVROM_2K_Bank(4, data); + break; + case 0xB000: + SetVROM_2K_Bank(6, data); + break; + + case 0xC000: + reg[2] = data; + SetBank(); + break; + case 0xD000: + reg[3] = data; + SetBank(); + break; + case 0xE000: + reg[0] = (byte)((data & 0x10) >> 4); + reg[1] = (byte)(data & 0x03); + SetBank(); + break; + + case 0xF000: + SetPROM_16K_Bank(4, data); + break; + } + } + + void SetBank() + { + if (reg[0] != 0) + { + switch (reg[1]) + { + case 0: + SetVROM_1K_Bank(8, (INT)reg[2] + 0x80); + SetVROM_1K_Bank(9, (INT)reg[3] + 0x80); + SetVROM_1K_Bank(10, (INT)reg[2] + 0x80); + SetVROM_1K_Bank(11, (INT)reg[3] + 0x80); + break; + case 1: + SetVROM_1K_Bank(8, (INT)reg[2] + 0x80); + SetVROM_1K_Bank(9, (INT)reg[2] + 0x80); + SetVROM_1K_Bank(10, (INT)reg[3] + 0x80); + SetVROM_1K_Bank(11, (INT)reg[3] + 0x80); + break; + case 2: + SetVROM_1K_Bank(8, (INT)reg[2] + 0x80); + SetVROM_1K_Bank(9, (INT)reg[2] + 0x80); + SetVROM_1K_Bank(10, (INT)reg[2] + 0x80); + SetVROM_1K_Bank(11, (INT)reg[2] + 0x80); + break; + case 3: + SetVROM_1K_Bank(8, (INT)reg[3] + 0x80); + SetVROM_1K_Bank(9, (INT)reg[3] + 0x80); + SetVROM_1K_Bank(10, (INT)reg[3] + 0x80); + SetVROM_1K_Bank(11, (INT)reg[3] + 0x80); + break; + } + } + else + { + switch (reg[1]) + { + case 0: + SetVRAM_Mirror(VRAM_VMIRROR); + break; + case 1: + SetVRAM_Mirror(VRAM_HMIRROR); + break; + case 2: + SetVRAM_Mirror(VRAM_MIRROR4L); + break; + case 3: + SetVRAM_Mirror(VRAM_MIRROR4H); + break; + } + } + } + + //void Mapper068::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg[0]; + p[1] = reg[1]; + p[2] = reg[2]; + p[3] = reg[3]; + } + + //void Mapper068::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg[0] = p[0]; + reg[1] = p[1]; + reg[2] = p[2]; + reg[3] = p[3]; + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper068.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper068.cs.meta new file mode 100644 index 0000000..7033718 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper068.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d94fb8248e814774caf84e3c8e2c508d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper069.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper069.cs new file mode 100644 index 0000000..e228a50 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper069.cs @@ -0,0 +1,177 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper069 SunSoft FME-7 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper069 : Mapper + { + BYTE patch; + + BYTE reg; + BYTE irq_enable; + INT irq_counter; + public Mapper069(NES parent) : base(parent) + { + } + + public override void Reset() + + { + reg = 0; + irq_enable = 0; + irq_counter = 0; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + + nes.apu.SelectExSound(32); + nes.SetIrqType(NES.IRQMETHOD.IRQ_CLOCK); + patch = 0; + + uint crc = nes.rom.GetPROM_CRC(); + + if (crc == 0xfeac6916) + { // Honoo no Toukyuuji - Dodge Danpei 2(J) + // nes.SetIrqType( NES::IRQ_HSYNC ); + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + + if (crc == 0xad28aef6) + { // Dynamite Batman(J) / Dynamite Batman - Return of the Joker(U) + patch = 1; + } + } + + //void Mapper069::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE000) + { + case 0x8000: + reg = data; + break; + + case 0xA000: + switch (reg & 0x0F) + { + case 0x00: + case 0x01: + case 0x02: + case 0x03: + case 0x04: + case 0x05: + case 0x06: + case 0x07: + SetVROM_1K_Bank((byte)(reg & 0x07), data); + break; + case 0x08: + if (patch == 0 && (data & 0x40) == 0) + { + SetPROM_8K_Bank(3, data); + } + break; + case 0x09: + SetPROM_8K_Bank(4, data); + break; + case 0x0A: + SetPROM_8K_Bank(5, data); + break; + case 0x0B: + SetPROM_8K_Bank(6, data); + break; + + case 0x0C: + data &= 0x03; + if (data == 0) SetVRAM_Mirror(VRAM_VMIRROR); + else if (data == 1) SetVRAM_Mirror(VRAM_HMIRROR); + else if (data == 2) SetVRAM_Mirror(VRAM_MIRROR4L); + else SetVRAM_Mirror(VRAM_MIRROR4H); + break; + + case 0x0D: + irq_enable = data; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + + case 0x0E: + irq_counter = (irq_counter & 0xFF00) | data; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + + case 0x0F: + irq_counter = (irq_counter & 0x00FF) | (data << 8); + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + } + break; + + case 0xC000: + case 0xE000: + nes.apu.ExWrite(addr, data); + break; + } + } + + //void Mapper069::Clock(INT cycles) + public override void Clock(int cycles) + { + //if (irq_enable && (nes.GetIrqType() == NES::IRQ_CLOCK)) + if (irq_enable != 0 && (nes.GetIrqType() == (int)NES.IRQMETHOD.IRQ_HSYNC)) + { + irq_counter -= cycles; + if (irq_counter <= 0) + { + nes.cpu.SetIRQ(IRQ_MAPPER); + irq_enable = 0; + irq_counter = 0xFFFF; + } + } + } + + //void Mapper069::HSync(INT scanline) + public override void HSync(int scanline) + { + if (irq_enable != 0 && (nes.GetIrqType() == (int)NES.IRQMETHOD.IRQ_HSYNC)) + { + irq_counter -= 114; + if (irq_counter <= 0) + { + nes.cpu.SetIRQ(IRQ_MAPPER); + irq_enable = 0; + irq_counter = 0xFFFF; + } + } + } + + //void Mapper069::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //p[0] = reg; + //p[1] = irq_enable; + //*(INT*)&p[2] = irq_counter; + } + + //void Mapper069::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //reg = p[0]; + //irq_enable = p[1]; + //irq_counter = *(INT*)&p[2]; + } + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper069.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper069.cs.meta new file mode 100644 index 0000000..2b2cb79 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper069.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 280c64d4deb538a448bba3eb071b3aef +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper070.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper070.cs new file mode 100644 index 0000000..6459237 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper070.cs @@ -0,0 +1,64 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper070 Bandai 74161 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper070 : Mapper + { + BYTE patch; + public Mapper070(NES parent) : base(parent) + { + } + + public override void Reset() + { + patch = 0; + + uint crc = nes.rom.GetPROM_CRC(); + + if (crc == 0xa59ca2ef) + { // Kamen Rider Club(J) + patch = 1; + nes.SetRenderMethod(EnumRenderMethod.POST_ALL_RENDER); + } + if (crc == 0x10bb8f9a) + { // Family Trainer - Manhattan Police(J) + patch = 1; + } + if (crc == 0x0cd00488) + { // Space Shadow(J) + patch = 1; + } + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + SetVROM_8K_Bank(0); + } + + //void Mapper070::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + SetPROM_16K_Bank(4, (data & 0x70) >> 4); + SetVROM_8K_Bank(data & 0x0F); + + if (patch != 0) + { + if ((data & 0x80) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + else + { + if ((data & 0x80) != 0) SetVRAM_Mirror(VRAM_MIRROR4H); + else SetVRAM_Mirror(VRAM_MIRROR4L); + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper070.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper070.cs.meta new file mode 100644 index 0000000..393d52c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper070.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0202c8b68faec5a4ea96ec3fc07aebae +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper071.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper071.cs new file mode 100644 index 0000000..7965f47 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper071.cs @@ -0,0 +1,54 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper071 Camerica // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper071 : Mapper + { + public Mapper071(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + + //void Mapper071::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if ((addr & 0xE000) == 0x6000) + { + SetPROM_16K_Bank(4, data); + } + } + + //void Mapper071::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xF000) + { + case 0x9000: + if ((data & 0x10) != 0) SetVRAM_Mirror(VRAM_MIRROR4H); + else SetVRAM_Mirror(VRAM_MIRROR4L); + break; + + case 0xC000: + case 0xD000: + case 0xE000: + case 0xF000: + SetPROM_16K_Bank(4, data); + break; + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper071.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper071.cs.meta new file mode 100644 index 0000000..e173f6f --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper071.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 379a8d27ad5b5854ba2bc0db093734f2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper072.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper072.cs new file mode 100644 index 0000000..9ef81d7 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper072.cs @@ -0,0 +1,60 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper072 Jaleco/Type1 lower bank switch // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; +using VirtualNes.Core.Debug; + +namespace VirtualNes.Core +{ + public class Mapper072 : Mapper + { + public Mapper072(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_8K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper072::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if ((data & 0x80) != 0) + { + SetPROM_16K_Bank(4, data & 0x0F); + } + else if ((data & 0x40) != 0) + { + SetVROM_8K_Bank(data & 0x0F); + } + else + { + if (addr >= 0xC100 && addr <= 0xC11F && data == 0x20) + { + Debuger.Log($"SOUND CODE:{addr & 0x1F:X2}"); + + // OSDにするべきか… + if (Supporter.Config.sound.bExtraSoundEnable) + { + //TODO : 似乎VirtuaNES有直接播放某个音频文件的功能 + //DirectSound.EsfAllStop(); + //DirectSound.EsfPlay(ESF_MOETENNIS_00 + (addr & 0x1F)); + } + } + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper072.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper072.cs.meta new file mode 100644 index 0000000..27c73ba --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper072.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 556683ab44781ae41b79420d171afb0d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper073.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper073.cs new file mode 100644 index 0000000..8cf487a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper073.cs @@ -0,0 +1,94 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper073 Konami VRC3 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper073 : Mapper + { + BYTE irq_enable; + INT irq_counter; + public Mapper073(NES parent) : base(parent) + { + } + + public override void Reset() + { + irq_enable = 0; + irq_counter = 0; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + + //void Mapper073::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr) + { + case 0xF000: + SetPROM_16K_Bank(4, data); + break; + + case 0x8000: + irq_counter = (irq_counter & 0xFFF0) | (data & 0x0F); + break; + case 0x9000: + irq_counter = (irq_counter & 0xFF0F) | ((data & 0x0F) << 4); + break; + case 0xA000: + irq_counter = (irq_counter & 0xF0FF) | ((data & 0x0F) << 8); + break; + case 0xB000: + irq_counter = (irq_counter & 0x0FFF) | ((data & 0x0F) << 12); + break; + case 0xC000: + irq_enable = (byte)(data & 0x02); + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xD000: + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + } + } + + //void Mapper073::Clock(INT cycles) + public override void Clock(int cycles) + { + if (irq_enable != 0) + { + if ((irq_counter += cycles) >= 0xFFFF) + { + irq_enable = 0; + irq_counter &= 0xFFFF; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + + //void Mapper073::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //p[0] = irq_enable; + //*(INT*)&p[1] = irq_counter; + } + + //void Mapper073::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //irq_enable = p[0]; + //irq_counter = *(INT*)&p[1]; + } + + public override bool IsStateSave() + { + return true; + } + } +} + diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper073.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper073.cs.meta new file mode 100644 index 0000000..f90c467 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper073.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 47872c8286a0123479efa9809f188d62 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper074.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper074.cs new file mode 100644 index 0000000..2b9e8f0 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper074.cs @@ -0,0 +1,312 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper074 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper074 : Mapper + { + BYTE[] reg = new byte[8]; + BYTE prg0, prg1; + BYTE chr01, chr23, chr4, chr5, chr6, chr7; + BYTE we_sram; + + BYTE irq_type; + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + BYTE irq_request; + + BYTE patch; + public Mapper074(NES parent) : base(parent) + { + } + + public override void Reset() + + { + for (INT i = 0; i < 8; i++) + { + reg[i] = 0x00; + } + prg0 = 0; + prg1 = 1; + SetBank_CPU(); + + chr01 = 0; + chr23 = 2; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + SetBank_PPU(); + + we_sram = 0; // Disable + irq_enable = 0; // Disable + irq_counter = 0; + irq_latch = 0; + irq_request = 0; + uint crc = nes.rom.GetPROM_CRC(); + + patch = 0; + if (crc == 0x37ae04a8) + { + patch = 1; + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + } + + //void Mapper074::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + //DEBUGOUT( "MPRWR A=%04X D=%02X L=%3d CYC=%d\n", addr&0xFFFF, data&0xFF, nes.GetScanline(), nes.cpu.GetTotalCycles() ); + + switch (addr & 0xE001) + { + case 0x8000: + reg[0] = data; + SetBank_CPU(); + SetBank_PPU(); + break; + case 0x8001: + reg[1] = data; + + switch (reg[0] & 0x07) + { + case 0x00: + chr01 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x01: + chr23 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x02: + chr4 = data; + SetBank_PPU(); + break; + case 0x03: + chr5 = data; + SetBank_PPU(); + break; + case 0x04: + chr6 = data; + SetBank_PPU(); + break; + case 0x05: + chr7 = data; + SetBank_PPU(); + break; + case 0x06: + prg0 = data; + SetBank_CPU(); + break; + case 0x07: + prg1 = data; + SetBank_CPU(); + break; + } + break; + case 0xA000: + reg[2] = data; + if (!nes.rom.Is4SCREEN()) + { + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + break; + case 0xA001: + reg[3] = data; + break; + case 0xC000: + reg[4] = data; + irq_counter = data; + irq_request = 0; + break; + case 0xC001: + reg[5] = data; + irq_latch = data; + irq_request = 0; + break; + case 0xE000: + reg[6] = data; + irq_enable = 0; + irq_request = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + reg[7] = data; + irq_enable = 1; + irq_request = 0; + break; + } + + } + + //void Mapper074::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable != 0 && irq_request == 0) + { + if (scanline == 0) + { + if (irq_counter != 0) + { + irq_counter--; + } + } + if ((irq_counter--) == 0) + { + irq_request = 0xFF; + irq_counter = irq_latch; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + } + + void SetBank_CPU() + { + if ((reg[0] & 0x40) != 0) + { + SetPROM_32K_Bank(PROM_8K_SIZE - 2, prg1, prg0, PROM_8K_SIZE - 1); + } + else + { + SetPROM_32K_Bank(prg0, prg1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + } + + void SetBank_PPU() + { + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x80) != 0) + { + // SetVROM_8K_Bank( chr4, chr5, chr6, chr7, + // chr01, chr01+1, chr23, chr23+1 ); + SetBank_PPUSUB(4, chr01 + 0); + SetBank_PPUSUB(5, chr01 + 1); + SetBank_PPUSUB(6, chr23 + 0); + SetBank_PPUSUB(7, chr23 + 1); + SetBank_PPUSUB(0, chr4); + SetBank_PPUSUB(1, chr5); + SetBank_PPUSUB(2, chr6); + SetBank_PPUSUB(3, chr7); + } + else + { + // SetVROM_8K_Bank( chr01, chr01+1, chr23, chr23+1, + // chr4, chr5, chr6, chr7 ); + SetBank_PPUSUB(0, chr01 + 0); + SetBank_PPUSUB(1, chr01 + 1); + SetBank_PPUSUB(2, chr23 + 0); + SetBank_PPUSUB(3, chr23 + 1); + SetBank_PPUSUB(4, chr4); + SetBank_PPUSUB(5, chr5); + SetBank_PPUSUB(6, chr6); + SetBank_PPUSUB(7, chr7); + } + } + else + { + if ((reg[0] & 0x80) != 0) + { + SetCRAM_1K_Bank(4, (chr01 + 0) & 0x07); + SetCRAM_1K_Bank(5, (chr01 + 1) & 0x07); + SetCRAM_1K_Bank(6, (chr23 + 0) & 0x07); + SetCRAM_1K_Bank(7, (chr23 + 1) & 0x07); + SetCRAM_1K_Bank(0, chr4 & 0x07); + SetCRAM_1K_Bank(1, chr5 & 0x07); + SetCRAM_1K_Bank(2, chr6 & 0x07); + SetCRAM_1K_Bank(3, chr7 & 0x07); + } + else + { + SetCRAM_1K_Bank(0, (chr01 + 0) & 0x07); + SetCRAM_1K_Bank(1, (chr01 + 1) & 0x07); + SetCRAM_1K_Bank(2, (chr23 + 0) & 0x07); + SetCRAM_1K_Bank(3, (chr23 + 1) & 0x07); + SetCRAM_1K_Bank(4, chr4 & 0x07); + SetCRAM_1K_Bank(5, chr5 & 0x07); + SetCRAM_1K_Bank(6, chr6 & 0x07); + SetCRAM_1K_Bank(7, chr7 & 0x07); + } + } + } + + void SetBank_PPUSUB(int bank, int page) + { + if (patch == 0 && (page == 8 || page == 9)) + { + SetCRAM_1K_Bank((byte)bank, page & 7); + } + else if (patch == 1 && page >= 128) + { + SetCRAM_1K_Bank((byte)bank, page & 7); + } + else + { + SetVROM_1K_Bank((byte)bank, page); + } + } + + //void Mapper074::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + for (INT i = 0; i < 8; i++) + { + p[i] = reg[i]; + } + p[8] = prg0; + p[9] = prg1; + p[10] = chr01; + p[11] = chr23; + p[12] = chr4; + p[13] = chr5; + p[14] = chr6; + p[15] = chr7; + p[16] = irq_enable; + p[17] = irq_counter; + p[18] = irq_latch; + p[19] = irq_request; + } + + //void Mapper074::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + for (INT i = 0; i < 8; i++) + { + reg[i] = p[i]; + } + prg0 = p[8]; + prg1 = p[9]; + chr01 = p[10]; + chr23 = p[11]; + chr4 = p[12]; + chr5 = p[13]; + chr6 = p[14]; + chr7 = p[15]; + irq_enable = p[16]; + irq_counter = p[17]; + irq_latch = p[18]; + irq_request = p[19]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper074.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper074.cs.meta new file mode 100644 index 0000000..751c217 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper074.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 45d37052d02fe374d8ba3c4e2a631cfd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper075.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper075.cs new file mode 100644 index 0000000..b18e915 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper075.cs @@ -0,0 +1,90 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper075 Konami VRC1/Jaleco D65005 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper075 : Mapper + { + BYTE[] reg = new byte[2]; + public Mapper075(NES parent) : base(parent) + { + } + + public override void Reset() + + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_8K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + reg[0] = 0; + reg[1] = 1; + } + + //void Mapper075::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xF000) + { + case 0x8000: + SetPROM_8K_Bank(4, data); + break; + + case 0x9000: + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + + reg[0] = (byte)((reg[0] & 0x0F) | ((data & 0x02) << 3)); + reg[1] = (byte)((reg[1] & 0x0F) | ((data & 0x04) << 2)); + SetVROM_4K_Bank(0, reg[0]); + SetVROM_4K_Bank(4, reg[1]); + break; + + case 0xA000: + SetPROM_8K_Bank(5, data); + break; + case 0xC000: + SetPROM_8K_Bank(6, data); + break; + + case 0xE000: + reg[0] = (byte)((reg[0] & 0x10) | (data & 0x0F)); + SetVROM_4K_Bank(0, reg[0]); + break; + + case 0xF000: + reg[1] = (byte)((reg[1] & 0x10) | (data & 0x0F)); + SetVROM_4K_Bank(4, reg[1]); + break; + } + } + + //void Mapper075::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg[0]; + p[1] = reg[1]; + } + + //void Mapper075::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg[0] = p[0]; + reg[1] = p[1]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper075.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper075.cs.meta new file mode 100644 index 0000000..1107729 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper075.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a9e28ba92f769664690091c1434038a6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper076.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper076.cs new file mode 100644 index 0000000..27d5581 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper076.cs @@ -0,0 +1,82 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper076 Namcot 109 (女神転生) // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper076 : Mapper + { + BYTE reg; + public Mapper076(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_1K_SIZE >= 8) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper076::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr) + { + case 0x8000: + reg = data; + break; + case 0x8001: + switch (reg & 0x07) + { + case 2: + SetVROM_2K_Bank(0, data); + break; + case 3: + SetVROM_2K_Bank(2, data); + break; + case 4: + SetVROM_2K_Bank(4, data); + break; + case 5: + SetVROM_2K_Bank(6, data); + break; + case 6: + SetPROM_8K_Bank(4, data); + break; + case 7: + SetPROM_8K_Bank(5, data); + break; + } + break; + } + } + + //void Mapper076::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg; + } + + //void Mapper076::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg = p[0]; + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper076.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper076.cs.meta new file mode 100644 index 0000000..5cc1aab --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper076.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 672c100cc4c4c70448bb51f3a9b62d5b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper077.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper077.cs new file mode 100644 index 0000000..7208fb5 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper077.cs @@ -0,0 +1,39 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper077 Irem Early Mapper #0 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper077 : Mapper + { + public Mapper077(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0); + + SetVROM_2K_Bank(0, 0); + SetCRAM_2K_Bank(2, 1); + SetCRAM_2K_Bank(4, 2); + SetCRAM_2K_Bank(6, 3); + } + + //void Mapper077::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + SetPROM_32K_Bank(data & 0x07); + + SetVROM_2K_Bank(0, (data & 0xF0) >> 4); + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper077.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper077.cs.meta new file mode 100644 index 0000000..5b15e65 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper077.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7ad6987edcff779409890da9965d4891 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper078.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper078.cs new file mode 100644 index 0000000..3ded1f8 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper078.cs @@ -0,0 +1,45 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper078 Jaleco(Cosmo Carrier) // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper078 : Mapper + { + public Mapper078(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_8K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper078::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + //DEBUGOUT( "MAP78 WR $%04X=$%02X L=%d\n", addr, data, nes->GetScanline() ); + SetPROM_16K_Bank(4, data & 0x0F); + SetVROM_8K_Bank((data & 0xF0) >> 4); + + if ((addr & 0xFE00) != 0xFE00) + { + if ((data & 0x08) != 0) SetVRAM_Mirror(VRAM_MIRROR4H); + else SetVRAM_Mirror(VRAM_MIRROR4L); + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper078.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper078.cs.meta new file mode 100644 index 0000000..d9c5bda --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper078.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5be432aeb39d2d24e98b2bb52e85cbe9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper079.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper079.cs new file mode 100644 index 0000000..f70154c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper079.cs @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper079 Nina-3 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper079 : Mapper + { + public Mapper079(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper079::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if ((addr & 0x0100) != 0) + { + SetPROM_32K_Bank((data >> 3) & 0x01); + SetVROM_8K_Bank(data & 0x07); + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper079.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper079.cs.meta new file mode 100644 index 0000000..b023f72 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper079.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c81e9813295f4434aa6e54baec3e0752 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper080.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper080.cs new file mode 100644 index 0000000..0357ddd --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper080.cs @@ -0,0 +1,106 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper080 Taito X1-005 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper080 : Mapper + { + public Mapper080(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_8K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper080::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + switch (addr) + { + case 0x7EF0: + SetVROM_2K_Bank(0, (data >> 1) & 0x3F); + if (PROM_8K_SIZE == 32) + { + if ((data & 0x80) != 0) + { + SetVRAM_1K_Bank(8, 1); + SetVRAM_1K_Bank(9, 1); + } + else + { + SetVRAM_1K_Bank(8, 0); + SetVRAM_1K_Bank(9, 0); + } + } + break; + + case 0x7EF1: + SetVROM_2K_Bank(2, (data >> 1) & 0x3F); + if (PROM_8K_SIZE == 32) + { + if ((data & 0x80) != 0) + { + SetVRAM_1K_Bank(10, 1); + SetVRAM_1K_Bank(11, 1); + } + else + { + SetVRAM_1K_Bank(10, 0); + SetVRAM_1K_Bank(11, 0); + } + } + break; + + case 0x7EF2: + SetVROM_1K_Bank(4, data); + break; + case 0x7EF3: + SetVROM_1K_Bank(5, data); + break; + case 0x7EF4: + SetVROM_1K_Bank(6, data); + break; + case 0x7EF5: + SetVROM_1K_Bank(7, data); + break; + + case 0x7EF6: + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_VMIRROR); + else SetVRAM_Mirror(VRAM_HMIRROR); + break; + + case 0x7EFA: + case 0x7EFB: + SetPROM_8K_Bank(4, data); + break; + case 0x7EFC: + case 0x7EFD: + SetPROM_8K_Bank(5, data); + break; + case 0x7EFE: + case 0x7EFF: + SetPROM_8K_Bank(6, data); + break; + default: + base.WriteLow(addr, data); + break; + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper080.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper080.cs.meta new file mode 100644 index 0000000..bb697cf --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper080.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 233bc8a8511fd30458e7e8c01e43f9fe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper082.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper082.cs new file mode 100644 index 0000000..30dbb9d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper082.cs @@ -0,0 +1,119 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper082 Taito C075 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper082 : Mapper + { + BYTE reg; + + public Mapper082(NES parent) : base(parent) + { + } + + public override void Reset() + + { + reg = 0; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_8K_SIZE!=0) + { + SetVROM_8K_Bank(0); + } + + SetVRAM_Mirror(VRAM_VMIRROR); + } + + //void Mapper082::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + switch (addr) + { + case 0x7EF0: + if (reg!=0) + { + SetVROM_2K_Bank(4, data >> 1); + } + else + { + SetVROM_2K_Bank(0, data >> 1); + } + break; + + case 0x7EF1: + if (reg!=0) + { + SetVROM_2K_Bank(6, data >> 1); + } + else + { + SetVROM_2K_Bank(2, data >> 1); + } + break; + + case 0x7EF2: + if (reg!=0) SetVROM_1K_Bank(0, data); + else SetVROM_1K_Bank(4, data); + break; + case 0x7EF3: + if (reg!=0) SetVROM_1K_Bank(1, data); + else SetVROM_1K_Bank(5, data); + break; + case 0x7EF4: + if (reg!=0) SetVROM_1K_Bank(2, data); + else SetVROM_1K_Bank(6, data); + break; + case 0x7EF5: + if (reg!=0) SetVROM_1K_Bank(3, data); + else SetVROM_1K_Bank(7, data); + break; + + case 0x7EF6: + reg = (byte)(data & 0x02); + if ((data & 0x01)!=0) SetVRAM_Mirror(VRAM_VMIRROR); + else SetVRAM_Mirror(VRAM_HMIRROR); + break; + + case 0x7EFA: + SetPROM_8K_Bank(4, data >> 2); + break; + case 0x7EFB: + SetPROM_8K_Bank(5, data >> 2); + break; + case 0x7EFC: + SetPROM_8K_Bank(6, data >> 2); + break; + default: + base.WriteLow(addr, data); + break; + } + } + + //void Mapper082::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg; + } + + //void Mapper082::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg = p[0]; + } + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper082.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper082.cs.meta new file mode 100644 index 0000000..4b02e06 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper082.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 826a6bd0c5ff43b4e907171f2a901343 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper083.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper083.cs new file mode 100644 index 0000000..fbc76e6 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper083.cs @@ -0,0 +1,243 @@ +///////////////////////////// +// Mapper083 Cony // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper083 : Mapper + { + BYTE[] reg = new byte[3]; + INT chr_bank; + BYTE irq_enable; + INT irq_counter; + + BYTE patch; + public Mapper083(NES parent) : base(parent) + { + } + + public override void Reset() + + { + for (INT i = 0; i < 3; i++) + { + reg[i] = 0x00; + } + + if (PROM_8K_SIZE >= 32) + { + SetPROM_32K_Bank(0, 1, 30, 31); + reg[1] = 0x30; + } + else + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + + chr_bank = 0; + + irq_enable = 0; // Disable + irq_counter = 0; + + patch = 0; + if (nes.rom.GetPROM_CRC() == 0x1461D1F8) + { + patch = 1; + } + } + + //BYTE Mapper083::ReadLow(WORD addr) + public override byte ReadLow(ushort addr) + { + if ((addr & 0x5100) == 0x5100) + { + return reg[2]; + } + else if (addr >= 0x6000) + { + return base.ReadLow(addr); + } + return (BYTE)(addr >> 8); + } + + //void Mapper083::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + //DEBUGOUT( "MPRWR A=%04X D=%02X L=%3d CYC=%d\n", addr&0xFFFF, data&0xFF, nes.GetScanline(), nes.cpu.GetTotalCycles() ); + switch (addr) + { + case 0x5101: + case 0x5102: + case 0x5103: + reg[2] = data; + break; + } + + if (addr >= 0x6000) + { + base.WriteLow(addr, data); + } + } + + //void Mapper083::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + //DEBUGOUT( "MPRWR A=%04X D=%02X L=%3d CYC=%d\n", addr&0xFFFF, data&0xFF, nes.GetScanline(), nes.cpu.GetTotalCycles() ); + switch (addr) + { + case 0x8000: + case 0xB000: + case 0xB0FF: + case 0xB1FF: + reg[0] = data; + chr_bank = (data & 0x30) << 4; + SetPROM_16K_Bank(4, data); + SetPROM_16K_Bank(6, (data & 0x30) | 0x0F); + break; + + case 0x8100: + reg[1] = (byte)(data & 0x80); + data &= 0x03; + if (data == 0) SetVRAM_Mirror(VRAM_VMIRROR); + else if (data == 1) SetVRAM_Mirror(VRAM_HMIRROR); + else if (data == 2) SetVRAM_Mirror(VRAM_MIRROR4L); + else SetVRAM_Mirror(VRAM_MIRROR4H); + break; + + case 0x8200: + irq_counter = (irq_counter & 0xFF00) | (INT)data; + // nes.cpu.ClrIRQ( IRQ_MAPPER ); + break; + case 0x8201: + irq_counter = (irq_counter & 0x00FF) | ((INT)data << 8); + irq_enable = reg[1]; + // nes.cpu.ClrIRQ( IRQ_MAPPER ); + break; + + case 0x8300: + SetPROM_8K_Bank(4, data); + break; + case 0x8301: + SetPROM_8K_Bank(5, data); + break; + case 0x8302: + SetPROM_8K_Bank(6, data); + break; + + case 0x8310: + if (patch != 0) + { + SetVROM_2K_Bank(0, chr_bank | data); + } + else + { + SetVROM_1K_Bank(0, chr_bank | data); + } + break; + case 0x8311: + if (patch != 0) + { + SetVROM_2K_Bank(2, chr_bank | data); + } + else + { + SetVROM_1K_Bank(1, chr_bank | data); + } + break; + case 0x8312: + SetVROM_1K_Bank(2, chr_bank | data); + break; + case 0x8313: + SetVROM_1K_Bank(3, chr_bank | data); + break; + case 0x8314: + SetVROM_1K_Bank(4, chr_bank | data); + break; + case 0x8315: + SetVROM_1K_Bank(5, chr_bank | data); + break; + case 0x8316: + if (patch != 0) + { + SetVROM_2K_Bank(4, chr_bank | data); + } + else + { + SetVROM_1K_Bank(6, chr_bank | data); + } + break; + case 0x8317: + if (patch != 0) + { + SetVROM_2K_Bank(6, chr_bank | data); + } + else + { + SetVROM_1K_Bank(7, chr_bank | data); + } + break; + + case 0x8318: + SetPROM_16K_Bank(4, (reg[0] & 0x30) | data); + break; + } + } + + //void Mapper083::HSync(INT scanline) + public override void HSync(int scanline) + { + if (irq_enable != 0) + { + if (irq_counter <= 113) + { + // nes.cpu.IRQ(); + irq_enable = 0; + // nes.cpu.SetIRQ( IRQ_MAPPER ); + nes.cpu.SetIRQ(IRQ_TRIGGER); + } + else + { + irq_counter -= 113; + } + } + } + + //void Mapper083::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //p[0] = reg[0]; + //p[1] = reg[1]; + //p[2] = reg[2]; + //*(INT*)&p[3] = chr_bank; + //p[7] = irq_enable; + //*(INT*)&p[8] = irq_counter; + } + + //void Mapper083::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //reg[0] = p[0]; + //reg[1] = p[1]; + //reg[2] = p[2]; + //chr_bank = *(INT*)&p[3]; + //irq_enable = p[7]; + //irq_counter = *(INT*)&p[8]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper083.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper083.cs.meta new file mode 100644 index 0000000..39796bd --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper083.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a5c413bf733d7fa4d96862f1324ff4ef +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper085.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper085.cs new file mode 100644 index 0000000..d68a4b1 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper085.cs @@ -0,0 +1,238 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper085 Konami VRC7 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper085 : Mapper + { + + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + INT irq_clock; + public Mapper085(NES parent) : base(parent) + { + } + + public override void Reset() + + { + irq_enable = 0; + irq_counter = 0; + irq_latch = 0; + irq_clock = 0; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + else + { + SetCRAM_8K_Bank(0); + } + +#if FALSE//0 +// DWORD crc = nes.rom.GetPROM_CRC(); +// if( crc == 0x1aa0479c ) { // For Tiny Toon Adventures 2 - Montana Land he Youkoso(J) +// nes.SetRenderMethod( NES::PRE_RENDER ); +// } +// if( crc == 0x33ce3ff0 ) { // For Lagrange Point(J) +// nes.SetRenderMethod( NES::TILE_RENDER ); +// } +#endif + nes.apu.SelectExSound(2); + } + + //void Mapper085::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xF038) + { + case 0x8000: + SetPROM_8K_Bank(4, data); + break; + case 0x8008: + case 0x8010: + SetPROM_8K_Bank(5, data); + break; + case 0x9000: + SetPROM_8K_Bank(6, data); + break; + + case 0x9010: + case 0x9030: + nes.apu.ExWrite(addr, data); + break; + + case 0xA000: + if (VROM_1K_SIZE != 0) + { + SetVROM_1K_Bank(0, data); + } + else + { + SetCRAM_1K_Bank(0, data); + } + break; + + case 0xA008: + case 0xA010: + if (VROM_1K_SIZE != 0) + { + SetVROM_1K_Bank(1, data); + } + else + { + SetCRAM_1K_Bank(1, data); + } + break; + + case 0xB000: + if (VROM_1K_SIZE != 0) + { + SetVROM_1K_Bank(2, data); + } + else + { + SetCRAM_1K_Bank(2, data); + } + break; + + case 0xB008: + case 0xB010: + if (VROM_1K_SIZE != 0) + { + SetVROM_1K_Bank(3, data); + } + else + { + SetCRAM_1K_Bank(3, data); + } + break; + + case 0xC000: + if (VROM_1K_SIZE != 0) + { + SetVROM_1K_Bank(4, data); + } + else + { + SetCRAM_1K_Bank(4, data); + } + break; + + case 0xC008: + case 0xC010: + if (VROM_1K_SIZE != 0) + { + SetVROM_1K_Bank(5, data); + } + else + { + SetCRAM_1K_Bank(5, data); + } + break; + + case 0xD000: + if (VROM_1K_SIZE != 0) + { + SetVROM_1K_Bank(6, data); + } + else + { + SetCRAM_1K_Bank(6, data); + } + break; + + case 0xD008: + case 0xD010: + if (VROM_1K_SIZE != 0) + { + SetVROM_1K_Bank(7, data); + } + else + { + SetCRAM_1K_Bank(7, data); + } + break; + + case 0xE000: + data &= 0x03; + if (data == 0) SetVRAM_Mirror(VRAM_VMIRROR); + else if (data == 1) SetVRAM_Mirror(VRAM_HMIRROR); + else if (data == 2) SetVRAM_Mirror(VRAM_MIRROR4L); + else SetVRAM_Mirror(VRAM_MIRROR4H); + break; + + case 0xE008: + case 0xE010: + irq_latch = data; + break; + + case 0xF000: + irq_enable = (byte)(data & 0x03); + irq_counter = irq_latch; + irq_clock = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + + case 0xF008: + case 0xF010: + irq_enable = (byte)((irq_enable & 0x01) * 3); + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + } + } + + //void Mapper085::Clock(INT cycles) + public override void Clock(int cycles) + { + if ((irq_enable & 0x02) != 0) + { + irq_clock += cycles * 4; + while (irq_clock >= 455) + { + irq_clock -= 455; + irq_counter++; + if (irq_counter == 0) + { + irq_counter = irq_latch; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + + //void Mapper085::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //p[0] = irq_enable; + //p[1] = irq_counter; + //p[2] = irq_latch; + //*((INT*)&p[4]) = irq_clock; + } + + //void Mapper085::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //irq_enable = p[0]; + //irq_counter = p[1]; + //irq_latch = p[2]; + //irq_clock = *((INT*)&p[4]); + } + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper085.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper085.cs.meta new file mode 100644 index 0000000..bd6681a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper085.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 18265e8a35d3835459de279c318124ce +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper086.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper086.cs new file mode 100644 index 0000000..0c8413e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper086.cs @@ -0,0 +1,72 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper086 Jaleco Early Mapper #2 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper086 : Mapper + { + BYTE reg, cnt; + public Mapper086(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, 2, 3); + SetVROM_8K_Bank(0); + reg = 0xFF; + cnt = 0; + } + + //void Mapper086::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr == 0x6000) + { + SetPROM_32K_Bank((data & 0x30) >> 4); + + SetVROM_8K_Bank((data & 0x03) | ((data & 0x40) >> 4)); + } + if (addr == 0x7000) + { + if ((reg & 0x10) == 0 && ((data & 0x10) != 0) && cnt == 0) + { + //DEBUGOUT( "WR:$%02X\n", data ); + if ((data & 0x0F) == 0 // Strike + || (data & 0x0F) == 5) + { // Foul + cnt = 60; // 次の発声を1秒程禁止する + } + + // OSDにするべきか… + if (Supporter.Config.sound.bExtraSoundEnable) + { + //TODO : 似乎VirtuaNES有直接播放某个音频文件的功能 + //DirectSound.EsfAllStop(); + //DirectSound.EsfPlay(ESF_MOEPRO_STRIKE + (data & 0x0F)); + } + } + reg = data; + } + } + + //void Mapper086::VSync() + public override void VSync() + { + if (cnt != 0) + { + cnt--; + } + } + + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper086.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper086.cs.meta new file mode 100644 index 0000000..1dfe14f --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper086.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8ffee57db5575d740b29c509d43d90bf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper087.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper087.cs new file mode 100644 index 0000000..f285a29 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper087.cs @@ -0,0 +1,36 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper087 Konami 74161/32 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper087 : Mapper + { + public Mapper087(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, 2, 3); + SetVROM_8K_Bank(0); + } + + //void Mapper087::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr == 0x6000) + { + SetVROM_8K_Bank((data & 0x02) >> 1); + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper087.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper087.cs.meta new file mode 100644 index 0000000..7fdd8e7 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper087.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e1e9e68d405123c42a2abb920690d4f5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper088.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper088.cs new file mode 100644 index 0000000..d3f834c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper088.cs @@ -0,0 +1,107 @@ +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper088 : Mapper + { + BYTE reg; + BYTE patch; + public Mapper088(NES parent) : base(parent) + { + } + + public override void Reset() + + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_1K_SIZE >= 8) + { + SetVROM_8K_Bank(0); + } + patch = 0; + + uint crc = nes.rom.GetPROM_CRC(); + if (crc == 0xc1b6b2a6) + { // Devil Man(J) + patch = 1; + nes.SetRenderMethod(EnumRenderMethod.POST_RENDER); + } + if (crc == 0xd9803a35) + { // Quinty(J) + nes.SetRenderMethod(EnumRenderMethod.POST_RENDER); + } + } + + //void Mapper088::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr) + { + case 0x8000: + reg = data; + if (patch != 0) + { + if ((data & 0x40) != 0) SetVRAM_Mirror(VRAM_MIRROR4H); + else SetVRAM_Mirror(VRAM_MIRROR4L); + } + break; + case 0x8001: + switch (reg & 0x07) + { + case 0: + SetVROM_2K_Bank(0, data >> 1); + break; + case 1: + SetVROM_2K_Bank(2, data >> 1); + break; + case 2: + SetVROM_1K_Bank(4, data + 0x40); + break; + case 3: + SetVROM_1K_Bank(5, data + 0x40); + break; + case 4: + SetVROM_1K_Bank(6, data + 0x40); + break; + case 5: + SetVROM_1K_Bank(7, data + 0x40); + break; + case 6: + SetPROM_8K_Bank(4, data); + break; + case 7: + SetPROM_8K_Bank(5, data); + break; + } + break; + case 0xC000: + if (data != 0) SetVRAM_Mirror(VRAM_MIRROR4H); + else SetVRAM_Mirror(VRAM_MIRROR4L); + break; + } + } + + //void Mapper088::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg; + } + + //void Mapper088::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg = p[0]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper088.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper088.cs.meta new file mode 100644 index 0000000..ddb7e2b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper088.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 10a2fd49bb318d348842e3c6f339ce96 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper089.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper089.cs new file mode 100644 index 0000000..4f0a823 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper089.cs @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper089 SunSoft (水戸黄門) // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper089 : Mapper + { + public Mapper089(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + SetVROM_8K_Bank(0); + } + + //void Mapper089::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if ((addr & 0xFF00) == 0xC000) + { + SetPROM_16K_Bank(4, (data & 0x70) >> 4); + + SetVROM_8K_Bank(((data & 0x80) >> 4) | (data & 0x07)); + + if ((data & 0x08) != 0) SetVRAM_Mirror(VRAM_MIRROR4H); + else SetVRAM_Mirror(VRAM_MIRROR4L); + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper089.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper089.cs.meta new file mode 100644 index 0000000..02f1a7f --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper089.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 233ec761824cdf442ababb569ced547d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper090.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper090.cs new file mode 100644 index 0000000..f93649b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper090.cs @@ -0,0 +1,483 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper090 PC-JY-?? // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; +using VirtualNes.Core.Debug; + +namespace VirtualNes.Core +{ + public class Mapper090 : Mapper + { + BYTE patch; + + BYTE[] prg_reg = new byte[4]; + BYTE[] nth_reg = new byte[4]; + BYTE[] ntl_reg = new byte[4]; + BYTE[] chh_reg = new byte[8]; + BYTE[] chl_reg = new byte[8]; + + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + BYTE irq_occur; + BYTE irq_preset; + BYTE irq_offset; + + BYTE prg_6000, prg_E000; + BYTE prg_size, chr_size; + BYTE mir_mode, mir_type; + + BYTE key_val; + BYTE mul_val1, mul_val2; + BYTE sw_val; + public Mapper090(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(PROM_8K_SIZE - 4, PROM_8K_SIZE - 3, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + SetVROM_8K_Bank(0); + patch = 0; + + uint crc = nes.rom.GetPROM_CRC(); + + if (crc == 0x2a268152) + { + patch = 1; + } + if (crc == 0x2224b882) + { + nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER); + } + + irq_enable = 0; // Disable + irq_counter = 0; + irq_latch = 0; + irq_occur = 0; + irq_preset = 0; + irq_offset = 0; + + prg_6000 = 0; + prg_E000 = 0; + prg_size = 0; + chr_size = 0; + mir_mode = 0; + mir_type = 0; + + key_val = 0; + mul_val1 = mul_val2 = 0; + + for (byte i = 0; i < 4; i++) + { + prg_reg[i] = (byte)(PROM_8K_SIZE - 4 + i); + ntl_reg[i] = 0; + nth_reg[i] = 0; + chl_reg[i] = i; + chh_reg[i] = 0; + chl_reg[i + 4] = (byte)(i + 4); + chh_reg[i + 4] = 0; + } + + if (sw_val != 0) + sw_val = 0x00; + else + sw_val = 0xFF; + + // nes.SetRenderMethod( NES::PRE_ALL_RENDER ); + } + + //BYTE Mapper090::ReadLow(WORD addr) + public override byte ReadLow(ushort addr) + { + Debuger.Log($"RD:{addr:X4}"); + + switch (addr) + { + case 0x5000: + return (byte)((sw_val != 0) ? 0x00 : 0xFF); + case 0x5800: + return (BYTE)(mul_val1 * mul_val2); + case 0x5801: + return (BYTE)((mul_val1 * mul_val2) >> 8); + case 0x5803: + return key_val; + } + + if (addr >= 0x6000) + { + return base.ReadLow(addr); + } + + // return sw_val?0x00:0xFF; + return (BYTE)(addr >> 8); + } + + //void Mapper090::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + Debuger.Log($"WR:{addr:X4} {data:X2}"); + + if (addr == 0x5800) + { + mul_val1 = data; + } + else + if (addr == 0x5801) + { + mul_val2 = data; + } + else + if (addr == 0x5803) + { + key_val = data; + } + } + + //void Mapper090::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xF007) + { + case 0x8000: + case 0x8001: + case 0x8002: + case 0x8003: + prg_reg[addr & 3] = data; + SetBank_CPU(); + break; + + case 0x9000: + case 0x9001: + case 0x9002: + case 0x9003: + case 0x9004: + case 0x9005: + case 0x9006: + case 0x9007: + chl_reg[addr & 7] = data; + SetBank_PPU(); + break; + + case 0xA000: + case 0xA001: + case 0xA002: + case 0xA003: + case 0xA004: + case 0xA005: + case 0xA006: + case 0xA007: + chh_reg[addr & 7] = data; + SetBank_PPU(); + break; + + case 0xB000: + case 0xB001: + case 0xB002: + case 0xB003: + ntl_reg[addr & 3] = data; + SetBank_VRAM(); + break; + + case 0xB004: + case 0xB005: + case 0xB006: + case 0xB007: + nth_reg[addr & 3] = data; + SetBank_VRAM(); + break; + + case 0xC002: + irq_enable = 0; + irq_occur = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xC003: + irq_enable = 0xFF; + irq_preset = 0xFF; + break; + case 0xC004: + break; + case 0xC005: + if ((irq_offset & 0x80) != 0) + { + irq_latch = (byte)(data ^ (irq_offset | 1)); + } + else + { + irq_latch = (byte)(data | (irq_offset & 0x27)); + } + irq_preset = 0xFF; + break; + case 0xC006: + if (patch != 0) + { + irq_offset = data; + } + break; + + case 0xD000: + prg_6000 = (byte)(data & 0x80); + prg_E000 = (byte)(data & 0x04); + prg_size = (byte)(data & 0x03); + chr_size = (byte)((data & 0x18) >> 3); + mir_mode = (byte)(data & 0x20); + SetBank_CPU(); + SetBank_PPU(); + SetBank_VRAM(); + break; + + case 0xD001: + mir_type = (byte)(data & 0x03); + SetBank_VRAM(); + break; + + case 0xD003: + break; + } + } + + //void Mapper090::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_preset != 0) + { + irq_counter = irq_latch; + irq_preset = 0; + } + if (irq_counter != 0) + { + irq_counter--; + } + if (irq_counter == 0) + { + if (irq_enable != 0) + { + // irq_occur = 0xFF; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + } + + //void Mapper090::Clock(INT cycles) + public override void Clock(int cycles) + { + // if( irq_occur ) { + // nes.cpu.IRQ_NotPending(); + // } + } + + void SetBank_CPU() + { + if (prg_size == 0) + { + SetPROM_32K_Bank(PROM_8K_SIZE - 4, PROM_8K_SIZE - 3, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + else + if (prg_size == 1) + { + SetPROM_32K_Bank(prg_reg[1] * 2, prg_reg[1] * 2 + 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + else + if (prg_size == 2) + { + if (prg_E000 != 0) + { + SetPROM_32K_Bank(prg_reg[0], prg_reg[1], prg_reg[2], prg_reg[3]); + } + else + { + if (prg_6000 != 0) + { + SetPROM_8K_Bank(3, prg_reg[3]); + } + SetPROM_32K_Bank(prg_reg[0], prg_reg[1], prg_reg[2], PROM_8K_SIZE - 1); + } + } + else + { + SetPROM_32K_Bank(prg_reg[3], prg_reg[2], prg_reg[1], prg_reg[0]); + } + } + + void SetBank_PPU() + { + INT[] bank = new int[8]; + + for (INT i = 0; i < 8; i++) + { + bank[i] = ((INT)chh_reg[i] << 8) | ((INT)chl_reg[i]); + } + + if (chr_size == 0) + { + SetVROM_8K_Bank(bank[0]); + } + else + if (chr_size == 1) + { + SetVROM_4K_Bank(0, bank[0]); + SetVROM_4K_Bank(4, bank[4]); + } + else + if (chr_size == 2) + { + SetVROM_2K_Bank(0, bank[0]); + SetVROM_2K_Bank(2, bank[2]); + SetVROM_2K_Bank(4, bank[4]); + SetVROM_2K_Bank(6, bank[6]); + } + else + { + SetVROM_8K_Bank(bank[0], bank[1], bank[2], bank[3], bank[4], bank[5], bank[6], bank[7]); + } + } + + void SetBank_VRAM() + { + INT[] bank = new int[4]; + + for (INT i = 0; i < 4; i++) + { + bank[i] = ((INT)nth_reg[i] << 8) | ((INT)ntl_reg[i]); + } + + if (patch == 0 && mir_mode != 0) + { + for (INT i = 0; i < 4; i++) + { + if (nth_reg[i] == 0 && (ntl_reg[i] == (BYTE)i)) + { + mir_mode = 0; + } + } + + if (mir_mode != 0) + { + SetVROM_1K_Bank(8, bank[0]); + SetVROM_1K_Bank(9, bank[1]); + SetVROM_1K_Bank(10, bank[2]); + SetVROM_1K_Bank(11, bank[3]); + } + } + else + { + if (mir_type == 0) + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + else + if (mir_type == 1) + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_MIRROR4L); + } + } + } + + //void Mapper090::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + INT i; + + for (i = 0; i < 4; i++) + { + p[i] = prg_reg[i]; + } + for (i = 0; i < 8; i++) + { + p[i + 4] = chh_reg[i]; + } + for (i = 0; i < 8; i++) + { + p[i + 12] = chl_reg[i]; + } + for (i = 0; i < 4; i++) + { + p[i + 20] = nth_reg[i]; + } + for (i = 0; i < 4; i++) + { + p[i + 24] = ntl_reg[i]; + } + p[28] = irq_enable; + p[29] = irq_counter; + p[30] = irq_latch; + p[31] = prg_6000; + p[32] = prg_E000; + p[33] = prg_size; + p[34] = chr_size; + p[35] = mir_mode; + p[36] = mir_type; + p[37] = mul_val1; + p[38] = mul_val2; + p[39] = key_val; + p[40] = irq_occur; + p[41] = irq_preset; + p[42] = irq_offset; + } + + //void Mapper090::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + INT i; + + for (i = 0; i < 4; i++) + { + prg_reg[i] = p[i]; + } + for (i = 0; i < 8; i++) + { + chh_reg[i] = p[i + 4]; + } + for (i = 0; i < 8; i++) + { + chl_reg[i] = p[i + 12]; + } + for (i = 0; i < 4; i++) + { + nth_reg[i] = p[i + 20]; + } + for (i = 0; i < 4; i++) + { + ntl_reg[i] = p[i + 24]; + } + irq_enable = p[28]; + irq_counter = p[29]; + irq_latch = p[30]; + prg_6000 = p[31]; + prg_E000 = p[32]; + prg_size = p[33]; + chr_size = p[34]; + mir_mode = p[35]; + mir_type = p[36]; + mul_val1 = p[37]; + mul_val2 = p[38]; + key_val = p[39]; + irq_occur = p[40]; + irq_preset = p[41]; + irq_offset = p[42]; + } + + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper090.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper090.cs.meta new file mode 100644 index 0000000..0baee07 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper090.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7c47f962868af9846bc36250b5054775 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper091.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper091.cs new file mode 100644 index 0000000..df59d95 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper091.cs @@ -0,0 +1,104 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper091 PC-HK-SF3 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper091 : Mapper + { + BYTE irq_enable; + BYTE irq_counter; + public Mapper091(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(PROM_8K_SIZE - 2, PROM_8K_SIZE - 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_8K_SIZE != 0) + { + SetVROM_8K_Bank(0, 0, 0, 0, 0, 0, 0, 0); + } + + irq_enable = 0; + irq_counter = 0; + + nes.SetRenderMethod(EnumRenderMethod.POST_ALL_RENDER); + } + + //void Mapper091::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + //DEBUGOUT( "$%04X:$%02X(%3d) L=%3d\n", addr, data, data, nes.GetScanline() ); + switch (addr & 0xF003) + { + case 0x6000: + case 0x6001: + case 0x6002: + case 0x6003: + SetVROM_2K_Bank((byte)((addr & 0x03) * 2), data); + break; + + case 0x7000: + SetPROM_8K_Bank(4, data); + break; + case 0x7001: + SetPROM_8K_Bank(5, data); + break; + + case 0x7002: + irq_enable = 0; + irq_counter = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0x7003: + irq_enable = 1; + break; + } + } + + //void Mapper091::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline < 240) && nes.ppu.IsDispON()) + { + if (irq_enable != 0) + { + irq_counter++; + } + if (irq_counter >= 8) + { + // nes.cpu.IRQ_NotPending(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + + //void Mapper091::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = irq_enable; + p[1] = irq_counter; + } + + //void Mapper091::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + irq_enable = p[0]; + irq_counter = p[1]; + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper091.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper091.cs.meta new file mode 100644 index 0000000..631cf42 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper091.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 202340dc4e291a243913879c4b71f605 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper092.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper092.cs new file mode 100644 index 0000000..7e9f228 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper092.cs @@ -0,0 +1,76 @@ +///////////////////////////////// +// Mapper092 Jaleco/Type1 Higher bank switch // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; +using VirtualNes.Core.Debug; + +namespace VirtualNes.Core +{ + public class Mapper092 : Mapper + { + public Mapper092(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_8K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper092::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + //DEBUGOUT( "A:%04X D:%02X\n", addr, data ); + + data = (byte)(addr & 0xFF); + + if (addr >= 0x9000) + { + if ((data & 0xF0) == 0xD0) + { + SetPROM_16K_Bank(6, data & 0x0F); + } + else if ((data & 0xF0) == 0xE0) + { + SetVROM_8K_Bank(data & 0x0F); + } + } + else + { + if ((data & 0xF0) == 0xB0) + { + SetPROM_16K_Bank(6, data & 0x0F); + } + else if ((data & 0xF0) == 0x70) + { + SetVROM_8K_Bank(data & 0x0F); + } + else if ((data & 0xF0) == 0xC0) + { + INT[] tbl = new int[]{ 3, 4, 5, 6, 0, 1, 2, 7, + 9,10, 8,11,13,12,14,15 }; + + // OSDにするべきか… + if (Supporter.Config.sound.bExtraSoundEnable) + { + //TODO : 似乎VirtuaNES有直接播放某个音频文件的功能 + Debuger.Log($"CODE {data:X2}"); + //DirectSound.EsfAllStop(); + //DirectSound.EsfPlay(ESF_MOEPRO_STRIKE + tbl[data & 0x0F]); + } + } + } + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper092.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper092.cs.meta new file mode 100644 index 0000000..5d0496a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper092.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3a75e11e5e1665042bee73c29ecde0b0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper093.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper093.cs new file mode 100644 index 0000000..a470c35 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper093.cs @@ -0,0 +1,38 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper093 SunSoft (Fantasy Zone) // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper093 : Mapper + { + public Mapper093(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + if (VROM_8K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper093::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr == 0x6000) + { + SetPROM_16K_Bank(4, data); + } + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper093.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper093.cs.meta new file mode 100644 index 0000000..1ba2d28 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper093.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d549f23df22aaca4c9196d08c290507d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper094.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper094.cs new file mode 100644 index 0000000..408441a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper094.cs @@ -0,0 +1,35 @@ +///////////////////////////////// +// Mapper094 Capcom 74161/32 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper094 : Mapper + { + public Mapper094(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + + //void Mapper094::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if ((addr & 0xFFF0) == 0xFF00) + { + SetPROM_16K_Bank(4, (data >> 2) & 0x7); + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper094.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper094.cs.meta new file mode 100644 index 0000000..91ca906 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper094.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1a39d5e2c4fc6324ca1a4a1f085052d9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper095.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper095.cs new file mode 100644 index 0000000..0c2581e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper095.cs @@ -0,0 +1,186 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper095 Namcot 106M (Dragon Buster) // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper095 : Mapper + { + BYTE reg; + BYTE prg0, prg1; + BYTE chr01, chr23, chr4, chr5, chr6, chr7; + public Mapper095(NES parent) : base(parent) + { + } + + public override void Reset() + { + reg = 0x00; + prg0 = 0; + prg1 = 1; + SetBank_CPU(); + + if (VROM_1K_SIZE != 0) + { + chr01 = 0; + chr23 = 2; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + } + else + { + chr01 = chr23 = chr4 = chr5 = chr6 = chr7 = 0; + } + + SetBank_PPU(); + + nes.SetRenderMethod(EnumRenderMethod.POST_RENDER); + } + + //void Mapper095::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE001) + { + case 0x8000: + reg = data; + SetBank_CPU(); + SetBank_PPU(); + break; + case 0x8001: + if (reg <= 0x05) + { + if ((data & 0x20) != 0) SetVRAM_Mirror(VRAM_MIRROR4H); + else SetVRAM_Mirror(VRAM_MIRROR4L); + data &= 0x1F; + } + + switch (reg & 0x07) + { + case 0x00: + if (VROM_1K_SIZE != 0) + { + chr01 = (byte)(data & 0xFE); + SetBank_PPU(); + } + break; + case 0x01: + if (VROM_1K_SIZE != 0) + { + chr23 = (byte)(data & 0xFE); + SetBank_PPU(); + } + break; + case 0x02: + if (VROM_1K_SIZE != 0) + { + chr4 = data; + SetBank_PPU(); + } + break; + case 0x03: + if (VROM_1K_SIZE != 0) + { + chr5 = data; + SetBank_PPU(); + } + break; + case 0x04: + if (VROM_1K_SIZE != 0) + { + chr6 = data; + SetBank_PPU(); + } + break; + case 0x05: + if (VROM_1K_SIZE != 0) + { + chr7 = data; + SetBank_PPU(); + } + break; + case 0x06: + prg0 = data; + SetBank_CPU(); + break; + case 0x07: + prg1 = data; + SetBank_CPU(); + break; + } + break; + } + } + + void SetBank_CPU() + { + if ((reg & 0x40) != 0) + { + SetPROM_32K_Bank(PROM_8K_SIZE - 2, prg1, prg0, PROM_8K_SIZE - 1); + } + else + { + SetPROM_32K_Bank(prg0, prg1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + } + + void SetBank_PPU() + { + if (VROM_1K_SIZE != 0) + { + if ((reg & 0x80) != 0) + { + SetVROM_8K_Bank(chr4, chr5, chr6, chr7, + chr01, chr01 + 1, chr23, chr23 + 1); + } + else + { + SetVROM_8K_Bank(chr01, chr01 + 1, chr23, chr23 + 1, + chr4, chr5, chr6, chr7); + } + } + } + + //void Mapper095::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg; + p[1] = prg0; + p[2] = prg1; + p[3] = chr01; + p[4] = chr23; + p[5] = chr4; + p[6] = chr5; + p[7] = chr6; + p[8] = chr7; + } + + //void Mapper095::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg = p[0]; + prg0 = p[1]; + prg1 = p[2]; + chr01 = p[3]; + chr23 = p[4]; + chr4 = p[5]; + chr5 = p[6]; + chr6 = p[7]; + chr7 = p[8]; + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper095.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper095.cs.meta new file mode 100644 index 0000000..25db414 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper095.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9dc2dfb88e4df2a48a83078267a3499e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper096.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper096.cs new file mode 100644 index 0000000..32f5634 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper096.cs @@ -0,0 +1,75 @@ +//////////////////////////////// +// Mapper096 Bandai 74161 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper096 : Mapper + { + BYTE[] reg = new byte[2]; + public Mapper096(NES parent) : base(parent) + { + } + + public override void Reset() + { + reg[0] = reg[1] = 0; + + SetPROM_32K_Bank(0, 1, 2, 3); + SetBank(); + + SetVRAM_Mirror(VRAM_MIRROR4L); + } + + //void Mapper096::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + SetPROM_32K_Bank(data & 0x03); + + reg[0] = (byte)((data & 0x04) >> 2); + SetBank(); + } + + public override void PPU_Latch(ushort addr) + { + if ((addr & 0xF000) == 0x2000) + { + reg[1] = (byte)((addr >> 8) & 0x03); + SetBank(); + } + } + + void SetBank() + { + SetCRAM_4K_Bank(0, reg[0] * 4 + reg[1]); + SetCRAM_4K_Bank(4, reg[0] * 4 + 0x03); + } + + //void Mapper096::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg[0]; + p[1] = reg[1]; + } + + //void Mapper096::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg[0] = p[0]; + reg[1] = p[1]; + } + + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper096.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper096.cs.meta new file mode 100644 index 0000000..ab002b3 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper096.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3e4ba3003173d9543aa8e29ae8802e93 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper097.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper097.cs new file mode 100644 index 0000000..8774d12 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper097.cs @@ -0,0 +1,43 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper097 Irem 74161 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper097 : Mapper + { + public Mapper097(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(PROM_8K_SIZE - 2, PROM_8K_SIZE - 1, 0, 1); + + if (VROM_8K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper097::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if (addr < 0xC000) + { + SetPROM_16K_Bank(6, data & 0x0F); + + if ((data & 0x80) != 0) SetVRAM_Mirror(VRAM_VMIRROR); + else SetVRAM_Mirror(VRAM_HMIRROR); + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper097.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper097.cs.meta new file mode 100644 index 0000000..058691b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper097.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 42c12f8d10ca7b649a0dac124eff2f7a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper099.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper099.cs new file mode 100644 index 0000000..8574a50 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper099.cs @@ -0,0 +1,91 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper099 VS-Unisystem // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper099 : Mapper + { + BYTE coin; + public Mapper099(NES parent) : base(parent) + { + } + + public override void Reset() + { + // set CPU bank pointers + if (PROM_8K_SIZE > 2) + { + SetPROM_32K_Bank(0, 1, 2, 3); + } + else if (PROM_8K_SIZE > 1) + { + SetPROM_32K_Bank(0, 1, 0, 1); + } + else + { + SetPROM_32K_Bank(0, 0, 0, 0); + } + + // set VROM bank + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + + coin = 0; + } + + //BYTE Mapper099::ExRead(WORD addr) + public override byte ExRead(ushort addr) + { + if (addr == 0x4020) + { + return coin; + } + + return (byte)(addr >> 8); + } + + //void Mapper099::ExWrite(WORD addr, BYTE data) + public override void ExWrite(ushort addr, byte data) + { + if (addr == 0x4016) + { + if ((data & 0x04) != 0) + { + SetVROM_8K_Bank(1); + } + else + { + SetVROM_8K_Bank(0); + } + + if (nes.rom.GetPROM_CRC() == 0xC99EC059) + { // VS Raid on Bungeling Bay(J) + if ((data & 0x02) != 0) + { + nes.cpu.SetIRQ(IRQ_MAPPER); + } + else + { + nes.cpu.ClrIRQ(IRQ_MAPPER); + } + } + } + + if (addr == 0x4020) + { + coin = data; + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper099.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper099.cs.meta new file mode 100644 index 0000000..a7d910f --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper099.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 39649dfbcf1f91d42bdcff43e912b650 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper100.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper100.cs new file mode 100644 index 0000000..8993115 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper100.cs @@ -0,0 +1,301 @@ +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper100 : Mapper + { + + BYTE[] reg = new byte[8]; + BYTE prg0, prg1, prg2, prg3; + BYTE chr0, chr1, chr2, chr3, chr4, chr5, chr6, chr7; + + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + public Mapper100(NES parent) : base(parent) + { + } + + public override void Reset() + { + for (INT i = 0; i < 8; i++) + { + reg[i] = 0x00; + } + + prg0 = 0; + prg1 = 1; + prg2 = (byte)(PROM_8K_SIZE - 2); + prg3 = (byte)(PROM_8K_SIZE - 1); + SetBank_CPU(); + + if (VROM_1K_SIZE != 0) + { + chr0 = 0; + chr1 = 1; + chr2 = 2; + chr3 = 3; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + SetBank_PPU(); + } + else + { + chr0 = chr2 = chr4 = chr5 = chr6 = chr7 = 0; + chr1 = chr3 = 1; + } + + irq_enable = 0; // Disable + irq_counter = 0; + irq_latch = 0; + } + + //void Mapper100::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE001) + { + case 0x8000: + reg[0] = data; + break; + case 0x8001: + reg[1] = data; + + switch (reg[0] & 0xC7) + { + case 0x00: + if (VROM_1K_SIZE != 0) + { + chr0 = (byte)(data & 0xFE); + chr1 = (byte)(chr0 + 1); + SetBank_PPU(); + } + break; + case 0x01: + if (VROM_1K_SIZE != 0) + { + chr2 = (byte)(data & 0xFE); + chr3 = (byte)(chr2 + 1); + SetBank_PPU(); + } + break; + case 0x02: + if (VROM_1K_SIZE != 0) + { + chr4 = data; + SetBank_PPU(); + } + break; + case 0x03: + if (VROM_1K_SIZE != 0) + { + chr5 = data; + SetBank_PPU(); + } + break; + case 0x04: + if (VROM_1K_SIZE != 0) + { + chr6 = data; + SetBank_PPU(); + } + break; + case 0x05: + if (VROM_1K_SIZE != 0) + { + chr7 = data; + SetBank_PPU(); + } + break; + + case 0x06: + prg0 = data; + SetBank_CPU(); + break; + case 0x07: + prg1 = data; + SetBank_CPU(); + break; + case 0x46: + prg2 = data; + SetBank_CPU(); + break; + case 0x47: + prg3 = data; + SetBank_CPU(); + break; + + case 0x80: + if (VROM_1K_SIZE != 0) + { + chr4 = (byte)(data & 0xFE); + chr5 = (byte)(chr4 + 1); + SetBank_PPU(); + } + break; + case 0x81: + if (VROM_1K_SIZE != 0) + { + chr6 = (byte)(data & 0xFE); + chr7 = (byte)(chr6 + 1); + SetBank_PPU(); + } + break; + case 0x82: + if (VROM_1K_SIZE != 0) + { + chr0 = data; + SetBank_PPU(); + } + break; + case 0x83: + if (VROM_1K_SIZE != 0) + { + chr1 = data; + SetBank_PPU(); + } + break; + case 0x84: + if (VROM_1K_SIZE != 0) + { + chr2 = data; + SetBank_PPU(); + } + break; + case 0x85: + if (VROM_1K_SIZE != 0) + { + chr3 = data; + SetBank_PPU(); + } + break; + + } + break; + case 0xA000: + reg[2] = data; + if (!nes.rom.Is4SCREEN()) + { + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + break; + case 0xA001: + reg[3] = data; + break; + case 0xC000: + reg[4] = data; + irq_counter = data; + break; + case 0xC001: + reg[5] = data; + irq_latch = data; + break; + case 0xE000: + reg[6] = data; + irq_enable = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + reg[7] = data; + irq_enable = 0xFF; + break; + } + } + + //void Mapper100::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable != 0) + { + if ((irq_counter--) == 0) + { + irq_counter = irq_latch; + // nes.cpu.IRQ(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + } + + void SetBank_CPU() + { + SetPROM_32K_Bank(prg0, prg1, prg2, prg3); + } + + void SetBank_PPU() + { + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(chr0, chr1, chr2, chr3, chr4, chr5, chr6, chr7); + } + } + + //void Mapper100::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + for (byte i = 0; i < 8; i++) + { + p[i] = reg[i]; + } + p[8] = prg0; + p[9] = prg1; + p[10] = prg2; + p[11] = prg3; + p[12] = chr0; + p[13] = chr1; + p[14] = chr2; + p[15] = chr3; + p[16] = chr4; + p[17] = chr5; + p[18] = chr6; + p[19] = chr7; + p[20] = irq_enable; + p[21] = irq_counter; + p[22] = irq_latch; + } + + //void Mapper100::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + for (byte i = 0; i < 8; i++) + { + reg[i] = p[i]; + } + prg0 = p[8]; + prg1 = p[9]; + prg2 = p[10]; + prg3 = p[11]; + chr0 = p[12]; + chr1 = p[13]; + chr2 = p[14]; + chr3 = p[15]; + chr4 = p[16]; + chr5 = p[17]; + chr6 = p[18]; + chr7 = p[19]; + irq_enable = p[20]; + irq_counter = p[21]; + irq_latch = p[22]; + } + + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper100.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper100.cs.meta new file mode 100644 index 0000000..42a1be5 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper100.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 64390927ea29e004e9acff1931eefa3d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper101.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper101.cs new file mode 100644 index 0000000..7125052 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper101.cs @@ -0,0 +1,42 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper101 Jaleco(Urusei Yatsura) // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper101 : Mapper + { + public Mapper101(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, 2, 3); + SetVROM_8K_Bank(0); + } + + //void Mapper101::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr >= 0x6000) + { + SetVROM_8K_Bank(data & 0x03); + } + } + + //void Mapper101::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + SetVROM_8K_Bank(data & 0x03); + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper101.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper101.cs.meta new file mode 100644 index 0000000..8d63a2f --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper101.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2285acef4dc998340b6c5668f01662fd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper105.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper105.cs new file mode 100644 index 0000000..c57fd21 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper105.cs @@ -0,0 +1,202 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper105 Nintendo World Championship // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper105 : Mapper + { + BYTE init_state; + BYTE write_count; + BYTE bits; + BYTE[] reg = new byte[4]; + + BYTE irq_enable; + INT irq_counter; + public Mapper105(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0); + + reg[0] = 0x0C; + reg[1] = 0x00; + reg[2] = 0x00; + reg[3] = 0x10; + + bits = 0; + write_count = 0; + + irq_counter = 0; + irq_enable = 0; + init_state = 0; + } + + //void Mapper105::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + //WORD reg_num = (addr & 0x7FFF) >> 13; + uint reg_num = (byte)((addr & 0x7FFF) >> 13); + + if ((data & 0x80) != 0) + { + bits = write_count = 0; + if (reg_num == 0) + { + reg[reg_num] |= 0x0C; + } + } + else + { + //bits |= (data & 1) << write_count++; + bits |= (byte)((data & 1) << write_count++); + if (write_count == 5) + { + reg[reg_num] = (byte)(bits & 0x1F); + bits = write_count = 0; + } + } + + if ((reg[0] & 0x02) != 0) + { + if ((reg[0] & 0x01) != 0) + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + } + else + { + if ((reg[0] & 0x01) != 0) + { + SetVRAM_Mirror(VRAM_MIRROR4H); + } + else + { + SetVRAM_Mirror(VRAM_MIRROR4L); + } + } + + switch (init_state) + { + case 0: + case 1: + init_state++; + break; + case 2: + if ((reg[1] & 0x08) != 0) + { + if ((reg[0] & 0x08) != 0) + { + if ((reg[0] & 0x04) != 0) + { + SetPROM_8K_Bank(4, ((reg[3] & 0x07) * 2 + 16)); + SetPROM_8K_Bank(5, ((reg[3] & 0x07) * 2 + 17)); + SetPROM_8K_Bank(6, 30); + SetPROM_8K_Bank(7, 31); + } + else + { + SetPROM_8K_Bank(4, 16); + SetPROM_8K_Bank(5, 17); + SetPROM_8K_Bank(6, ((reg[3] & 0x07) * 2 + 16)); + SetPROM_8K_Bank(7, ((reg[3] & 0x07) * 2 + 17)); + } + } + else + { + SetPROM_8K_Bank(4, ((reg[3] & 0x06) * 2 + 16)); + SetPROM_8K_Bank(5, ((reg[3] & 0x06) * 2 + 17)); + SetPROM_8K_Bank(6, ((reg[3] & 0x06) * 2 + 18)); + SetPROM_8K_Bank(7, ((reg[3] & 0x06) * 2 + 19)); + } + } + else + { + SetPROM_8K_Bank(4, ((reg[1] & 0x06) * 2 + 0)); + SetPROM_8K_Bank(5, ((reg[1] & 0x06) * 2 + 1)); + SetPROM_8K_Bank(6, ((reg[1] & 0x06) * 2 + 2)); + SetPROM_8K_Bank(7, ((reg[1] & 0x06) * 2 + 3)); + } + + if ((reg[1] & 0x10) != 0) + { + irq_counter = 0; + irq_enable = 0; + } + else + { + irq_enable = 1; + } + // nes.cpu.ClrIRQ( IRQ_MAPPER ); + break; + default: + break; + } + } + + //void Mapper105::HSync(INT scanline) + public override void HSync(int scanline) + { + if (scanline != 0) + { + if (irq_enable != 0) + { + irq_counter += 29781; + } + if (((irq_counter | 0x21FFFFFF) & 0x3E000000) == 0x3E000000) + { + // nes.cpu.IRQ_NotPending(); + // nes.cpu.SetIRQ( IRQ_MAPPER ); + nes.cpu.SetIRQ(IRQ_TRIGGER2); + } + } + } + + //void Mapper105::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //for (INT i = 0; i < 4; i++) + //{ + // p[i] = reg[i]; + //} + //p[8] = init_state; + //p[9] = write_count; + //p[10] = bits; + //p[11] = irq_enable; + //*((INT*)&p[12]) = irq_counter; + } + + //void Mapper105::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //for (INT i = 0; i < 4; i++) + //{ + // reg[i] = p[i]; + //} + //init_state = p[8]; + //write_count = p[9]; + //bits = p[10]; + //irq_enable = p[11]; + //irq_counter = *((INT*)&p[12]); + } + + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper105.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper105.cs.meta new file mode 100644 index 0000000..14a38ea --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper105.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0833f87b77121f346aceaffc5e05bb1b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper107.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper107.cs new file mode 100644 index 0000000..4a673cc --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper107.cs @@ -0,0 +1,33 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper107 Magic Dragon Mapper // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; + +namespace VirtualNes.Core +{ + public class Mapper107 : Mapper + { + public Mapper107(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + SetVROM_8K_Bank(0); + } + + //void Mapper107::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + SetPROM_32K_Bank((data >> 1) & 0x03); + SetVROM_8K_Bank(data & 0x07); + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper107.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper107.cs.meta new file mode 100644 index 0000000..934add7 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper107.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4e2d607dcc753e64a91d080c3ec557ff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper108.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper108.cs new file mode 100644 index 0000000..222e06b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper108.cs @@ -0,0 +1,31 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper108 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; + +namespace VirtualNes.Core +{ + public class Mapper108 : Mapper + { + public Mapper108(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0xC, 0xD, 0xE, 0xF); + SetPROM_8K_Bank(3, 0); + } + + //void Mapper108::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + SetPROM_8K_Bank(3, data); + } + + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper108.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper108.cs.meta new file mode 100644 index 0000000..1b74c68 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper108.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: adb29a0608617bf4a927dd3334bfc23e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper109.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper109.cs new file mode 100644 index 0000000..8585b71 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper109.cs @@ -0,0 +1,131 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper109 SACHEN The Great Wall SA-019 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper109 : Mapper + { + + BYTE reg; + BYTE chr0, chr1, chr2, chr3; + BYTE chrmode0, chrmode1; + public Mapper109(NES parent) : base(parent) + { + } + + public override void Reset() + { + reg = 0; + SetPROM_32K_Bank(0); + + chr0 = 0; + chr1 = 0; + chr2 = 0; + chr3 = 0; + SetBank_PPU(); + chrmode0 = 0; + chrmode1 = 0; + } + + //void Mapper109::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + switch (addr) + { + case 0x4100: + reg = data; + break; + case 0x4101: + switch (reg) + { + case 0: + chr0 = data; + SetBank_PPU(); + break; + case 1: + chr1 = data; + SetBank_PPU(); + break; + case 2: + chr2 = data; + SetBank_PPU(); + break; + case 3: + chr3 = data; + SetBank_PPU(); + break; + case 4: + chrmode0 = (byte)(data & 0x01); + SetBank_PPU(); + break; + case 5: + SetPROM_32K_Bank(data & 0x07); + break; + case 6: + chrmode1 = (byte)(data & 0x07); + SetBank_PPU(); + break; + case 7: + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + break; + } + break; + } + + } + + void SetBank_PPU() + { + if (VROM_1K_SIZE != 0) + { + SetVROM_1K_Bank(0, chr0); + SetVROM_1K_Bank(1, chr1 | ((chrmode1 << 3) & 0x8)); + SetVROM_1K_Bank(2, chr2 | ((chrmode1 << 2) & 0x8)); + SetVROM_1K_Bank(3, chr3 | ((chrmode1 << 1) & 0x8) | (chrmode0 * 0x10)); + SetVROM_1K_Bank(4, VROM_1K_SIZE - 4); + SetVROM_1K_Bank(5, VROM_1K_SIZE - 3); + SetVROM_1K_Bank(6, VROM_1K_SIZE - 2); + SetVROM_1K_Bank(7, VROM_1K_SIZE - 1); + } + } + + //void Mapper109::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg; + p[1] = chr0; + p[2] = chr1; + p[3] = chr2; + p[4] = chr3; + p[5] = chrmode0; + p[6] = chrmode1; + } + + //void Mapper109::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg = p[0]; + chr0 = p[1]; + chr1 = p[2]; + chr2 = p[3]; + chr3 = p[4]; + chrmode0 = p[5]; + chrmode1 = p[6]; + } + + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper109.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper109.cs.meta new file mode 100644 index 0000000..1edada2 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper109.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 577f4eaa36fb1324d8ab031f613625e9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper110.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper110.cs new file mode 100644 index 0000000..1706f74 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper110.cs @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper110 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper110 : Mapper + { + BYTE reg0, reg1; + public Mapper110(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0); + SetVROM_8K_Bank(0); + + reg0 = 0; + reg1 = 0; + } + //void Mapper110::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + switch (addr) + { + case 0x4100: + reg1 = (byte)(data & 0x07); + break; + case 0x4101: + switch (reg1) + { + case 5: + SetPROM_32K_Bank(data); + break; + case 0: + reg0 = (byte)(data & 0x01); + SetVROM_8K_Bank(reg0); + break; + case 2: + reg0 = data; + SetVROM_8K_Bank(reg0); + break; + case 4: + reg0 = (byte)(reg0 | (data << 1)); + SetVROM_8K_Bank(reg0); + break; + case 6: + reg0 = (byte)(reg0 | (data << 2)); + SetVROM_8K_Bank(reg0); + break; + default: + break; + } + break; + default: + break; + } + } + + //void Mapper110::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg0; + p[1] = reg1; + } + + //void Mapper110::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg0 = p[0]; + reg1 = p[1]; + } + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper110.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper110.cs.meta new file mode 100644 index 0000000..243b73d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper110.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: baa9bd69c9a0e1e469de6492ca525199 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper111.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper111.cs new file mode 100644 index 0000000..18c4f92 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper111.cs @@ -0,0 +1,291 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper111 Nintendo MMC1 Hack // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper111 : Mapper + { + + ushort last_addr; + + BYTE patch; + BYTE wram_patch; + BYTE wram_bank; + BYTE wram_count; + + BYTE[] reg = new byte[4]; + BYTE shift, regbuf; + + public Mapper111(NES parent) : base(parent) + { + } + + public override void Reset() + { + reg[0] = 0x0C; // D3=1,D2=1 + reg[1] = reg[2] = reg[3] = 0; + shift = regbuf = 0; + + patch = 0; + wram_patch = 0; + + if (PROM_16K_SIZE < 32) + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + else + { + // For 512K/1M byte Cartridge + SetPROM_16K_Bank(4, 0); + SetPROM_16K_Bank(6, 16 - 1); + + patch = 1; + } + + if (VROM_8K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + + // Ninja Ryukenden(J) + nes.SetRenderMethod(EnumRenderMethod.POST_ALL_RENDER); + } + + //void Mapper111::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + // DEBUGOUT( "MMC1 %04X=%02X\n", addr&0xFFFF,data&0xFF ); + + if ((data & 0x80) != 0) + { + shift = regbuf = 0; + reg[0] |= 0x0C; // D3=1,D2=1 残りはリセットされない + return; + } + + addr = (ushort)((addr & 0x7FFF) >> 13); + reg[addr] = data; + + // DEBUGOUT( "MMC1 %d=%02X\n", addr&0xFFFF,regbuf&0xFF ); + + if (patch != 1) + { + // For Normal Cartridge + switch (addr) + { + case 0: + if ((reg[0] & 0x02) != 0) + { + if ((reg[0] & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + else + { + if ((reg[0] & 0x01) != 0) SetVRAM_Mirror(VRAM_MIRROR4H); + else SetVRAM_Mirror(VRAM_MIRROR4L); + } + break; + case 1: + // Register #1 + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x10) != 0) + { + // CHR 4K bank lower($0000-$0FFF) + SetVROM_4K_Bank(0, reg[1]); + // CHR 4K bank higher($1000-$1FFF) + SetVROM_4K_Bank(4, reg[2]); + } + else + { + // CHR 8K bank($0000-$1FFF) + SetVROM_8K_Bank(reg[1] >> 1); + } + } + else + { + // For Romancia + if ((reg[0] & 0x10) != 0) + { + SetCRAM_4K_Bank(0, reg[1]); + } + } + break; + case 2: + // Register #2 + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x10) != 0) + { + // CHR 4K bank lower($0000-$0FFF) + SetVROM_4K_Bank(0, reg[1]); + // CHR 4K bank higher($1000-$1FFF) + SetVROM_4K_Bank(4, reg[2]); + } + else + { + // CHR 8K bank($0000-$1FFF) + SetVROM_8K_Bank(reg[1] >> 1); + } + } + else + { + // For Romancia + if ((reg[0] & 0x10) != 0) + { + SetCRAM_4K_Bank(4, reg[2]); + } + } + break; + case 3: + if ((reg[0] & 0x08) == 0) + { + // PRG 32K bank ($8000-$FFFF) + SetPROM_32K_Bank(reg[3] >> 1); + } + else + { + if ((reg[0] & 0x04) != 0) + { + // PRG 16K bank ($8000-$BFFF) + SetPROM_16K_Bank(4, reg[3]); + SetPROM_16K_Bank(6, PROM_16K_SIZE - 1); + } + else + { + // PRG 16K bank ($C000-$FFFF) + SetPROM_16K_Bank(6, reg[3]); + SetPROM_16K_Bank(4, 0); + } + } + break; + } + } + else + { + // For 512K/1M byte Cartridge + INT PROM_BASE = 0; + if (PROM_16K_SIZE >= 32) + { + PROM_BASE = reg[1] & 0x10; + } + + // Register #0 + if (addr == 0) + { + if ((reg[0] & 0x02) != 0) + { + if ((reg[0] & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + else + { + if ((reg[0] & 0x01) != 0) SetVRAM_Mirror(VRAM_MIRROR4H); + else SetVRAM_Mirror(VRAM_MIRROR4L); + } + } + // Register #1 + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x10) != 0) + { + // CHR 4K bank lower($0000-$0FFF) + SetVROM_4K_Bank(0, reg[1]); + } + else + { + // CHR 8K bank($0000-$1FFF) + SetVROM_8K_Bank(reg[1] >> 1); + } + } + else + { + // For Romancia + if ((reg[0] & 0x10) != 0) + { + SetCRAM_4K_Bank(0, reg[1]); + } + } + // Register #2 + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x10) != 0) + { + // CHR 4K bank higher($1000-$1FFF) + SetVROM_4K_Bank(4, reg[2]); + } + } + else + { + // For Romancia + if ((reg[0] & 0x10) != 0) + { + SetCRAM_4K_Bank(4, reg[2]); + } + } + // Register #3 + if ((reg[0] & 0x08) == 0) + { + // PRG 32K bank ($8000-$FFFF) + SetPROM_32K_Bank((reg[3] & (0xF + PROM_BASE)) >> 1); + } + else + { + if ((reg[0] & 0x04) != 0) + { + // PRG 16K bank ($8000-$BFFF) + SetPROM_16K_Bank(4, PROM_BASE + (reg[3] & 0x0F)); + if (PROM_16K_SIZE >= 32) SetPROM_16K_Bank(6, PROM_BASE + 16 - 1); + } + else + { + // PRG 16K bank ($C000-$FFFF) + SetPROM_16K_Bank(6, PROM_BASE + (reg[3] & 0x0F)); + if (PROM_16K_SIZE >= 32) SetPROM_16K_Bank(4, PROM_BASE); + } + } + } + } + + //void Mapper111::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg[0]; + p[1] = reg[1]; + p[2] = reg[2]; + p[3] = reg[3]; + p[4] = shift; + p[5] = regbuf; + + p[6] = wram_bank; + p[7] = wram_count; + } + + //void Mapper111::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg[0] = p[0]; + reg[1] = p[1]; + reg[2] = p[2]; + reg[3] = p[3]; + shift = p[4]; + regbuf = p[5]; + + wram_bank = p[6]; + wram_count = p[7]; + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper111.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper111.cs.meta new file mode 100644 index 0000000..8828a9a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper111.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 554591bf0683358478fb48fe49a84697 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper112.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper112.cs new file mode 100644 index 0000000..dd72242 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper112.cs @@ -0,0 +1,167 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper112 Nintendo MMC3 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper112 : Mapper + { + BYTE[] reg = new byte[4]; + BYTE prg0, prg1; + BYTE chr01, chr23, chr4, chr5, chr6, chr7; + public Mapper112(NES parent) : base(parent) + { + } + + public override void Reset() + { + for (INT i = 0; i < 4; i++) + { + reg[i] = 0x00; + } + + prg0 = 0; + prg1 = 1; + SetBank_CPU(); + + chr01 = 0; + chr23 = 2; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + SetBank_PPU(); + } + + //void Mapper112::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr) + { + case 0x8000: + reg[0] = data; + SetBank_CPU(); + SetBank_PPU(); + break; + case 0xA000: + reg[1] = data; + switch (reg[0] & 0x07) + { + case 0x00: + prg0 = (byte)((data & (PROM_8K_SIZE - 1))); + SetBank_CPU(); + break; + case 0x01: + prg1 = (byte)((data & (PROM_8K_SIZE - 1))); + SetBank_CPU(); + break; + case 0x02: + chr01 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x03: + chr23 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x04: + chr4 = data; + SetBank_PPU(); + break; + case 0x05: + chr5 = data; + SetBank_PPU(); + break; + case 0x06: + chr6 = data; + SetBank_PPU(); + break; + case 0x07: + chr7 = data; + SetBank_PPU(); + break; + } + break; + + case 0xC000: + reg[3] = data; + SetBank_PPU(); + break;//hum 源码居然没有break 语法差异呗 + case 0xE000: + reg[2] = data; + if (!nes.rom.Is4SCREEN()) + { + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + SetBank_PPU(); + break; + } + } + + void SetBank_CPU() + { + SetPROM_32K_Bank(prg0, prg1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + + void SetBank_PPU() + { + if ((reg[2] & 0x02) != 0) + { + SetVROM_8K_Bank(chr01, chr01 + 1, chr23, chr23 + 1, chr4, chr5, chr6, chr7); + } + else + { + SetVROM_8K_Bank(((reg[3] << 6) & 0x100) + chr01, + ((reg[3] << 6) & 0x100) + chr01 + 1, + ((reg[3] << 5) & 0x100) + chr23, + ((reg[3] << 5) & 0x100) + chr23 + 1, + ((reg[3] << 4) & 0x100) + chr4, + ((reg[3] << 3) & 0x100) + chr5, + ((reg[3] << 2) & 0x100) + chr6, + ((reg[3] << 1) & 0x100) + chr7); + } + } + + //void Mapper112::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + for (INT i = 0; i < 4; i++) + { + p[i] = reg[i]; + } + p[4] = chr01; + p[5] = chr23; + p[6] = chr4; + p[7] = chr5; + p[8] = chr6; + p[9] = chr7; + } + + //void Mapper112::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + for (byte i = 0; i < 4; i++) + { + reg[i] = p[i]; + } + + chr01 = p[4]; + chr23 = p[5]; + chr4 = p[6]; + chr5 = p[7]; + chr6 = p[8]; + chr7 = p[9]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper112.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper112.cs.meta new file mode 100644 index 0000000..c70eea6 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper112.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aef8742ac61ff474783909cf33b928f5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper113.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper113.cs new file mode 100644 index 0000000..3edf819 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper113.cs @@ -0,0 +1,79 @@ +//////////////////////////// +// Mapper113 PC-Sachen/Hacker // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper113 : Mapper + { + public Mapper113(NES parent) : base(parent) + { + } + + public override void Reset() + { + // SetPROM_32K_Bank( 0, 1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); + SetPROM_32K_Bank(0); + SetVROM_8K_Bank(0); + } + + //void Mapper113::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + //DEBUGOUT( "$%04X:$%02X L=%3d\n", addr, data, nes.GetScanline() ); + switch (addr) + { + case 0x4100: + case 0x4111: + case 0x4120: + case 0x4194: + case 0x4195: + case 0x4900: + if (nes.rom.GetPROM_CRC() == 0xA75AEDE5) + { // HES 6-in-1 + if ((data & 0x80) != 0) + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + } + SetPROM_32K_Bank(data >> 3); + SetVROM_8K_Bank(((data >> 3) & 0x08) + (data & 0x07)); + break; + } + } + + //void Mapper113::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + //DEBUGOUT( "$%04X:$%02X L=%3d\n", addr, data, nes.GetScanline() ); + switch (addr) + { + case 0x8008: + case 0x8009: + SetPROM_32K_Bank(data >> 3); + SetVROM_8K_Bank(((data >> 3) & 0x08) + (data & 0x07)); + break; + case 0x8E66: + case 0x8E67: + //SetVROM_8K_Bank((data & 0x07) ? 0 : 1); + SetVROM_8K_Bank((data & 0x07) != 0 ? 0 : 1); + break; + case 0xE00A: + SetVRAM_Mirror(VRAM_MIRROR4L); + break; + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper113.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper113.cs.meta new file mode 100644 index 0000000..1d9bf4b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper113.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6e8958c2cccbe9d46805e08e394967f1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper114.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper114.cs new file mode 100644 index 0000000..4feafe0 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper114.cs @@ -0,0 +1,186 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper114 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +using System.Text.RegularExpressions; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper114 : Mapper + { + BYTE reg_m, reg_a; + BYTE[] reg_b = new BYTE[8]; + BYTE reg_c; + BYTE irq_counter; + BYTE irq_occur; + public Mapper114(NES parent) : base(parent) + { + } + + public override void Reset() + + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + + reg_a = reg_c = reg_m = 0; + for (INT i = 0; i < 8; i++) + { + reg_b[i] = 0; + } + irq_counter = 0; + irq_occur = 0; + nes.SetRenderMethod(EnumRenderMethod.POST_RENDER); + } + + //void Mapper114::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + reg_m = data; + SetBank_CPU(); + } + + //void Mapper114::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if (addr == 0xE003) + { + irq_counter = data; + } + else + if (addr == 0xE002) + { + irq_occur = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + } + else + { + switch (addr & 0xE000) + { + case 0x8000: + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + break; + case 0xA000: + reg_c = 1; + reg_a = data; + break; + case 0xC000: + if (reg_c == 0) + { + break; + } + reg_b[reg_a & 0x07] = data; + switch (reg_a & 0x07) + { + case 0: + case 1: + case 2: + case 3: + case 6: + case 7: + SetBank_PPU(); + break; + case 4: + case 5: + SetBank_CPU(); + break; + } + reg_c = 0; + break; + } + } + } + + //void Mapper114::Clock(INT scanline) + public override void Clock(int cycles) + { + // if( irq_occur ) { + // nes.cpu.IRQ_NotPending(); + // } + } + + //void Mapper114::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239) && nes.ppu.IsDispON()) + { + if (irq_counter != 0) + { + irq_counter--; + if (irq_counter == 0) + { + irq_occur = 0xFF; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + + void SetBank_CPU() + { + if ((reg_m & 0x80) != 0) + { + SetPROM_16K_Bank(4, reg_m & 0x1F); + } + else + { + SetPROM_8K_Bank(4, reg_b[4]); + SetPROM_8K_Bank(5, reg_b[5]); + } + } + + void SetBank_PPU() + { + SetVROM_2K_Bank(0, reg_b[0] >> 1); + SetVROM_2K_Bank(2, reg_b[2] >> 1); + SetVROM_1K_Bank(4, reg_b[6]); + SetVROM_1K_Bank(5, reg_b[1]); + SetVROM_1K_Bank(6, reg_b[7]); + SetVROM_1K_Bank(7, reg_b[3]); + } + + //void Mapper114::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + for (int i = 0; i < 8; i++) + { + p[i] = reg_b[i]; + } + + p[8] = reg_m; + p[9] = reg_a; + p[10] = reg_c; + p[11] = irq_counter; + p[12] = irq_occur; + } + + //void Mapper114::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + for (int i = 0; i < 8; i++) + { + reg_b[i] = p[i]; + } + reg_m = p[8]; + reg_a = p[9]; + reg_c = p[10]; + irq_counter = p[11]; + irq_occur = p[12]; + } + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper114.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper114.cs.meta new file mode 100644 index 0000000..60ae6c6 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper114.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 51657beea06191a41b34933f48417d57 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper115.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper115.cs new file mode 100644 index 0000000..896b28e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper115.cs @@ -0,0 +1,302 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper115 CartSaint : Yuu Yuu Hakusho Final // +// JusticePao(?) // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper115 : Mapper + { + BYTE[] reg = new byte[8]; + BYTE prg0, prg1, prg2, prg3; + BYTE prg0L, prg1L; + BYTE chr0, chr1, chr2, chr3, chr4, chr5, chr6, chr7; + + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + + BYTE ExPrgSwitch; + BYTE ExChrSwitch; + public Mapper115(NES parent) : base(parent) + { + } + + public override void Reset() + + { + for (INT i = 0; i < 8; i++) + { + reg[i] = 0x00; + } + + prg0 = prg0L = 0; + prg1 = prg1L = 1; + prg2 = (byte)(PROM_8K_SIZE - 2); + prg3 = (byte)(PROM_8K_SIZE - 1); + + ExPrgSwitch = 0; + ExChrSwitch = 0; + + SetBank_CPU(); + + if (VROM_1K_SIZE!=0) + { + chr0 = 0; + chr1 = 1; + chr2 = 2; + chr3 = 3; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + SetBank_PPU(); + } + else + { + chr0 = chr2 = chr4 = chr5 = chr6 = chr7 = 0; + chr1 = chr3 = 1; + } + + irq_enable = 0; // Disable + irq_counter = 0; + irq_latch = 0; + } + + + //void Mapper115::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + switch (addr) + { + case 0x6000: + ExPrgSwitch = data; //data + SetBank_CPU(); + break; + case 0x6001: + ExChrSwitch = (byte)(data & 0x1); + SetBank_PPU(); + break; + } + //Mapper::WriteLow(addr, data); + base.WriteLow(addr, data); + } + + + //void Mapper115::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE001) + { + case 0x8000: + reg[0] = data; + SetBank_CPU(); + SetBank_PPU(); + break; + case 0x8001: + reg[1] = data; + switch (reg[0] & 0x07) + { + case 0x00: + chr0 = (byte)(data & 0xFE); + chr1 = (byte)(chr0 + 1); + SetBank_PPU(); + break; + case 0x01: + chr2 = (byte)(data & 0xFE); + chr3 = (byte)(chr2 + 1); + SetBank_PPU(); + break; + case 0x02: + chr4 = data; + SetBank_PPU(); + break; + case 0x03: + chr5 = data; + SetBank_PPU(); + break; + case 0x04: + chr6 = data; + SetBank_PPU(); + break; + case 0x05: + chr7 = data; + SetBank_PPU(); + break; + case 0x06: + prg0 = prg0L = data; + SetBank_CPU(); + break; + case 0x07: + prg1 = prg1L = data; + SetBank_CPU(); + break; + } + break; + case 0xA000: + reg[2] = data; + if (!nes.rom.Is4SCREEN()) + { + if ((data & 0x01)!=0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + break; + case 0xA001: + reg[3] = data; + break; + case 0xC000: + reg[4] = data; + irq_counter = data; + irq_enable = 0xFF; + break; + case 0xC001: + reg[5] = data; + irq_latch = data; + break; + case 0xE000: + reg[6] = data; + irq_enable = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + reg[7] = data; + irq_enable = 0xFF; + break; + } + } + + //void Mapper115::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable!=0) + { + if ((irq_counter--)==0) + { + irq_counter = irq_latch; + // nes.cpu.IRQ_NotPending(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + } + + + void SetBank_CPU() + { + if ((ExPrgSwitch & 0x80)!=0) + { + prg0 = (byte)(((ExPrgSwitch << 1) & 0x1e)); + prg1 = (byte)(prg0 + 1); + + SetPROM_32K_Bank(prg0, prg1, prg0 + 2, prg1 + 2); + } + else + { + prg0 = prg0L; + prg1 = prg1L; + if ((reg[0] & 0x40)!=0) + { + SetPROM_32K_Bank(PROM_8K_SIZE - 2, prg1, prg0, PROM_8K_SIZE - 1); + } + else + { + SetPROM_32K_Bank(prg0, prg1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + } + } + + void SetBank_PPU() + { + if (VROM_1K_SIZE!=0) + { + if ((reg[0] & 0x80)!=0) + { + SetVROM_8K_Bank((ExChrSwitch << 8) + chr4, (ExChrSwitch << 8) + chr5, + (ExChrSwitch << 8) + chr6, (ExChrSwitch << 8) + chr7, + (ExChrSwitch << 8) + chr0, (ExChrSwitch << 8) + chr1, + (ExChrSwitch << 8) + chr2, (ExChrSwitch << 8) + chr3); + } + else + { + SetVROM_8K_Bank((ExChrSwitch << 8) + chr0, (ExChrSwitch << 8) + chr1, + (ExChrSwitch << 8) + chr2, (ExChrSwitch << 8) + chr3, + (ExChrSwitch << 8) + chr4, (ExChrSwitch << 8) + chr5, + (ExChrSwitch << 8) + chr6, (ExChrSwitch << 8) + chr7); + } + } + } + + //void Mapper115::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + for (byte i = 0; i < 8; i++) + { + p[i] = reg[i]; + } + p[8] = prg0; + p[9] = prg1; + p[10] = prg2; + p[11] = prg3; + p[12] = chr0; + p[13] = chr1; + p[14] = chr2; + p[15] = chr3; + p[16] = chr4; + p[17] = chr5; + p[18] = chr6; + p[19] = chr7; + p[20] = irq_enable; + p[21] = irq_counter; + p[22] = irq_latch; + p[23] = ExPrgSwitch; + p[24] = prg0L; + p[25] = prg1L; + p[26] = ExChrSwitch; + + } + + //void Mapper115::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + for (byte i = 0; i < 8; i++) + { + reg[i] = p[i]; + } + prg0 = p[8]; + prg1 = p[9]; + prg2 = p[10]; + prg3 = p[11]; + chr0 = p[12]; + chr1 = p[13]; + chr2 = p[14]; + chr3 = p[15]; + chr4 = p[16]; + chr5 = p[17]; + chr6 = p[18]; + chr7 = p[19]; + irq_enable = p[20]; + irq_counter = p[21]; + irq_latch = p[22]; + ExPrgSwitch = p[23]; + prg0L = p[24]; + prg1L = p[25]; + ExChrSwitch = p[26]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper115.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper115.cs.meta new file mode 100644 index 0000000..d9432ac --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper115.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 27c78096fe71294488eed0e869047d1c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper116.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper116.cs new file mode 100644 index 0000000..00b1869 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper116.cs @@ -0,0 +1,333 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper116 CartSaint : 幽遊AV強列伝 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; +using VirtualNes.Core.Debug; + +namespace VirtualNes.Core +{ + public class Mapper116 : Mapper + { + BYTE[] reg = new byte[8]; + BYTE prg0, prg1, prg2, prg3; + BYTE prg0L, prg1L; + BYTE chr0, chr1, chr2, chr3, chr4, chr5, chr6, chr7; + + BYTE irq_enable; + INT irq_counter; + BYTE irq_latch; + + BYTE ExPrgSwitch; + BYTE ExChrSwitch; + public Mapper116(NES parent) : base(parent) + { + } + + public override void Reset() + + { + for (INT i = 0; i < 8; i++) + { + reg[i] = 0x00; + } + + prg0 = prg0L = 0; + prg1 = prg1L = 1; + prg2 = (byte)(PROM_8K_SIZE - 2); + prg3 = (byte)(PROM_8K_SIZE - 1); + + ExPrgSwitch = 0; + ExChrSwitch = 0; + + SetBank_CPU(); + + if (VROM_1K_SIZE != 0) + { + chr0 = 0; + chr1 = 1; + chr2 = 2; + chr3 = 3; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + SetBank_PPU(); + } + else + { + chr0 = chr2 = chr4 = chr5 = chr6 = chr7 = 0; + chr1 = chr3 = 1; + } + + irq_enable = 0; // Disable + irq_counter = 0; + irq_latch = 0; + + // nes.SetFrameIRQmode( FALSE ); + } + + //void Mapper116::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + Debuger.Log($"MPRWR A={addr & 0xFFFF:X4} D={data & 0xFF:X2} L={nes.GetScanline(),3} CYC={nes.cpu.GetTotalCycles()}"); + if ((addr & 0x4100) == 0x4100) + { + ExChrSwitch = data; + SetBank_PPU(); + } + } + + //void Mapper116::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + Debuger.Log($"MPRWR A={addr & 0xFFFF:X4} D={data & 0xFF:X2} L={nes.GetScanline(),3} CYC={nes.cpu.GetTotalCycles()}"); + + switch (addr & 0xE001) + { + case 0x8000: + reg[0] = data; + SetBank_CPU(); + SetBank_PPU(); + break; + case 0x8001: + reg[1] = data; + switch (reg[0] & 0x07) + { + case 0x00: + chr0 = (byte)(data & 0xFE); + chr1 = (byte)(chr0 + 1); + SetBank_PPU(); + break; + case 0x01: + chr2 = (byte)(data & 0xFE); + chr3 = (byte)(chr2 + 1); + SetBank_PPU(); + break; + case 0x02: + chr4 = data; + SetBank_PPU(); + break; + case 0x03: + chr5 = data; + SetBank_PPU(); + break; + case 0x04: + chr6 = data; + SetBank_PPU(); + break; + case 0x05: + chr7 = data; + SetBank_PPU(); + break; + case 0x06: + prg0 = data; + SetBank_CPU(); + break; + case 0x07: + prg1 = data; + SetBank_CPU(); + break; + } + break; + case 0xA000: + reg[2] = data; + if (!nes.rom.Is4SCREEN()) + { + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + break; + case 0xA001: + reg[3] = data; + break; + case 0xC000: + reg[4] = data; + irq_counter = data; + // irq_enable = 0xFF; + break; + case 0xC001: + reg[5] = data; + irq_latch = data; + break; + case 0xE000: + reg[6] = data; + irq_counter = irq_latch; + irq_enable = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + reg[7] = data; + irq_enable = 0xFF; + break; + } + } + + //void Mapper116::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (irq_counter <= 0) + { + if (irq_enable != 0) + { + // nes.cpu.IRQ_NotPending(); + nes.cpu.SetIRQ(IRQ_MAPPER); + +#if FALSE //0 +DEBUGOUT( "IRQ L=%3d\n", scanline ); +{ +LPBYTE lpScn = nes.ppu.GetScreenPtr(); + + lpScn = lpScn+(256+16)*scanline; + + for( INT i = 0; i < 64; i++ ) { + lpScn[i] = 22; + } +} +#endif + return; + } + } + + if (nes.ppu.IsDispON()) + { + irq_counter--; + } + } + +#if FALSE //0 + if( (scanline >= 0 && scanline <= 239) ) { + if( nes.ppu.IsDispON() ) { + if( irq_enable ) { + if( !(irq_counter--) ) { +// irq_counter = irq_latch; + nes.cpu.IRQ_NotPending(); + } + } + } + } +#endif + } + + + void SetBank_CPU() + { + if ((reg[0] & 0x40) != 0) + { + SetPROM_32K_Bank(PROM_8K_SIZE - 2, prg1, prg0, PROM_8K_SIZE - 1); + } + else + { + SetPROM_32K_Bank(prg0, prg1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + } + + void SetBank_PPU() + { + if (VROM_1K_SIZE != 0) + { + if ((ExChrSwitch & 0x04) != 0) + { + INT chrbank = 256; + SetVROM_8K_Bank(chrbank + chr4, chrbank + chr5, + chrbank + chr6, chrbank + chr7, + chr0, chr1, + chr2, chr3); + } + else + { + INT chrbank = 0; + SetVROM_8K_Bank(chrbank + chr4, chrbank + chr5, + chrbank + chr6, chrbank + chr7, + chr0, chr1, + chr2, chr3); + } + +#if FALSE //0 + if( reg[0] & 0x80 ) { +// SetVROM_8K_Bank( chrbank+chr4, chrbank+chr5, +// chrbank+chr6, chrbank+chr7, +// chrbank+chr0, chrbank+chr1, +// chrbank+chr2, chrbank+chr3 ); + SetVROM_8K_Bank( chrbank+chr4, chrbank+chr5, + chrbank+chr6, chrbank+chr7, + chr0, chr1, + chr2, chr3 ); + } else { + SetVROM_8K_Bank( chr0, chr1, + chr2, chr3, + chrbank+chr4, chrbank+chr5, + chrbank+chr6, chrbank+chr7 ); + } +#endif + } + } + + //void Mapper116::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + for (INT i = 0; i < 8; i++) + { + p[i] = reg[i]; + } + p[8] = prg0; + p[9] = prg1; + p[10] = prg2; + p[11] = prg3; + p[12] = chr0; + p[13] = chr1; + p[14] = chr2; + p[15] = chr3; + p[16] = chr4; + p[17] = chr5; + p[18] = chr6; + p[19] = chr7; + p[20] = irq_enable; + p[21] = (byte)irq_counter; + p[22] = irq_latch; + p[23] = ExPrgSwitch; + p[24] = prg0L; + p[25] = prg1L; + p[26] = ExChrSwitch; + } + + //void Mapper116::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + for (INT i = 0; i < 8; i++) + { + reg[i] = p[i]; + } + prg0 = p[8]; + prg1 = p[9]; + prg2 = p[10]; + prg3 = p[11]; + chr0 = p[12]; + chr1 = p[13]; + chr2 = p[14]; + chr3 = p[15]; + chr4 = p[16]; + chr5 = p[17]; + chr6 = p[18]; + chr7 = p[19]; + irq_enable = p[20]; + irq_counter = p[21]; + irq_latch = p[22]; + ExPrgSwitch = p[23]; + prg0L = p[24]; + prg1L = p[25]; + ExChrSwitch = p[26]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper116.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper116.cs.meta new file mode 100644 index 0000000..18c699e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper116.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a958c4651f82c204fa1f88e7f59c97da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper117.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper117.cs new file mode 100644 index 0000000..63de7d6 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper117.cs @@ -0,0 +1,120 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper117 Sanko Gu(Tw) // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper117 : Mapper + { + BYTE irq_enable; + BYTE irq_counter; + public Mapper117(NES parent) : base(parent) + { + } + + public override void Reset() + + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper117::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr) + { + case 0x8000: + SetPROM_8K_Bank(4, data); + break; + case 0x8001: + SetPROM_8K_Bank(5, data); + break; + case 0x8002: + SetPROM_8K_Bank(6, data); + break; + case 0xA000: + SetVROM_1K_Bank(0, data); + break; + case 0xA001: + SetVROM_1K_Bank(1, data); + break; + case 0xA002: + SetVROM_1K_Bank(2, data); + break; + case 0xA003: + SetVROM_1K_Bank(3, data); + break; + case 0xA004: + SetVROM_1K_Bank(4, data); + break; + case 0xA005: + SetVROM_1K_Bank(5, data); + break; + case 0xA006: + SetVROM_1K_Bank(6, data); + break; + case 0xA007: + SetVROM_1K_Bank(7, data); + break; + case 0xC001: + case 0xC002: + case 0xC003: + irq_counter = data; + break; + case 0xE000: + irq_enable = (byte)(data & 1); + // nes.cpu.ClrIRQ( IRQ_MAPPER ); + break; + } + } + //void Mapper117::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable != 0) + { + if (irq_counter == scanline) + { + irq_counter = 0; + // nes.cpu.IRQ(); + // nes.cpu.SetIRQ( IRQ_MAPPER ); + nes.cpu.SetIRQ(IRQ_TRIGGER); + } + } + } + } + } + + //void Mapper117::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = irq_counter; + p[1] = irq_enable; + } + + //void Mapper117::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + irq_counter = p[0]; + irq_enable = p[1]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper117.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper117.cs.meta new file mode 100644 index 0000000..c59d63e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper117.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 01bde0a4f3f20d84d961068ed452d93f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper118.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper118.cs new file mode 100644 index 0000000..3ee9164 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper118.cs @@ -0,0 +1,262 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper118 IQS MMC3 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper118 : Mapper + { + BYTE[] reg = new byte[8]; + BYTE prg0, prg1; + BYTE chr01, chr23, chr4, chr5, chr6, chr7; + BYTE we_sram; + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + public Mapper118(NES parent) : base(parent) + { + } + + public override void Reset() + { + INT i; + + for (i = 0; i < 8; i++) + { + reg[i] = 0x00; + } + + prg0 = 0; + prg1 = 1; + SetBank_CPU(); + + if (VROM_1K_SIZE != 0) + { + chr01 = 0; + chr23 = 2; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + + SetBank_PPU(); + } + else + { + chr01 = 0; + chr23 = 0; + chr4 = 0; + chr5 = 0; + chr6 = 0; + chr7 = 0; + } + + we_sram = 0; // Disable + irq_enable = 0; // Disable + irq_counter = 0; + irq_latch = 0; + } + + //void Mapper118::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE001) + { + case 0x8000: + reg[0] = data; + SetBank_CPU(); + SetBank_PPU(); + break; + case 0x8001: + reg[1] = data; + + if ((reg[0] & 0x80) != 0) + { + if ((reg[0] & 0x07) == 2) + { + if ((data & 0x80) != 0) SetVRAM_Mirror(VRAM_MIRROR4L); + else SetVRAM_Mirror(VRAM_MIRROR4H); + } + } + else + { + if ((reg[0] & 0x07) == 0) + { + if ((data & 0x80) != 0) SetVRAM_Mirror(VRAM_MIRROR4L); + else SetVRAM_Mirror(VRAM_MIRROR4H); + } + } + + switch (reg[0] & 0x07) + { + case 0x00: + if (VROM_1K_SIZE != 0) + { + chr01 = (byte)(data & 0xFE); + SetBank_PPU(); + } + break; + case 0x01: + if (VROM_1K_SIZE != 0) + { + chr23 = (byte)(data & 0xFE); + SetBank_PPU(); + } + break; + case 0x02: + if (VROM_1K_SIZE != 0) + { + chr4 = data; + SetBank_PPU(); + } + break; + case 0x03: + if (VROM_1K_SIZE != 0) + { + chr5 = data; + SetBank_PPU(); + } + break; + case 0x04: + if (VROM_1K_SIZE != 0) + { + chr6 = data; + SetBank_PPU(); + } + break; + case 0x05: + if (VROM_1K_SIZE != 0) + { + chr7 = data; + SetBank_PPU(); + } + break; + case 0x06: + prg0 = data; + SetBank_CPU(); + break; + case 0x07: + prg1 = data; + SetBank_CPU(); + break; + } + break; + + case 0xC000: + reg[4] = data; + irq_counter = data; + break; + case 0xC001: + reg[5] = data; + irq_latch = data; + break; + case 0xE000: + reg[6] = data; + irq_enable = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + reg[7] = data; + irq_enable = 1; + break; + } + } + + //void Mapper118::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable != 0) + { + if ((irq_counter--) == 0) + { + irq_counter = irq_latch; + // nes.cpu.IRQ(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + } + + void SetBank_CPU() + { + if ((reg[0] & 0x40) != 0) + { + SetPROM_32K_Bank(PROM_8K_SIZE - 2, prg1, prg0, PROM_8K_SIZE - 1); + } + else + { + SetPROM_32K_Bank(prg0, prg1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + } + + void SetBank_PPU() + { + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x80) != 0) + { + SetVROM_8K_Bank(chr4, chr5, chr6, chr7, + chr01, chr01 + 1, chr23, chr23 + 1); + } + else + { + SetVROM_8K_Bank(chr01, chr01 + 1, chr23, chr23 + 1, + chr4, chr5, chr6, chr7); + } + } + } + + //void Mapper118::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + for (INT i = 0; i < 8; i++) + { + p[i] = reg[i]; + } + p[8] = prg0; + p[9] = prg1; + p[10] = chr01; + p[11] = chr23; + p[12] = chr4; + p[13] = chr5; + p[14] = chr6; + p[15] = chr7; + p[16] = irq_enable; + p[17] = irq_counter; + p[18] = irq_latch; + } + + //void Mapper118::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + for (INT i = 0; i < 8; i++) + { + reg[i] = p[i]; + } + prg0 = p[8]; + prg1 = p[9]; + chr01 = p[10]; + chr23 = p[11]; + chr4 = p[12]; + chr5 = p[13]; + chr6 = p[14]; + chr7 = p[15]; + irq_enable = p[16]; + irq_counter = p[17]; + irq_latch = p[18]; + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper118.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper118.cs.meta new file mode 100644 index 0000000..711e870 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper118.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a52f7dcc530347a4d828eb0e09829a16 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper119.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper119.cs new file mode 100644 index 0000000..daaa460 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper119.cs @@ -0,0 +1,263 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper119 Nintendo MMC3 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper119 : Mapper + { + BYTE patch; + + BYTE[] reg = new byte[8]; + BYTE prg0, prg1; + BYTE chr01, chr23, chr4, chr5, chr6, chr7; + BYTE we_sram; + + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + public Mapper119(NES parent) : base(parent) + { + } + + public override void Reset() + + { + patch = 0; + + for (INT i = 0; i < 8; i++) + { + reg[i] = 0x00; + } + + prg0 = 0; + prg1 = 1; + SetBank_CPU(); + + chr01 = 0; + chr23 = 2; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + SetBank_PPU(); + + we_sram = 0; // Disable + irq_enable = 0; // Disable + irq_counter = 0; + irq_latch = 0; + } + + //void Mapper119::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE001) + { + case 0x8000: + reg[0] = data; + SetBank_CPU(); + SetBank_PPU(); + break; + case 0x8001: + reg[1] = data; + + switch (reg[0] & 0x07) + { + case 0x00: + if (VROM_1K_SIZE != 0) + { + chr01 = (byte)(data & 0xFE); + SetBank_PPU(); + } + break; + case 0x01: + if (VROM_1K_SIZE != 0) + { + chr23 = (byte)(data & 0xFE); + SetBank_PPU(); + } + break; + case 0x02: + if (VROM_1K_SIZE != 0) + { + chr4 = data; + SetBank_PPU(); + } + break; + case 0x03: + if (VROM_1K_SIZE != 0) + { + chr5 = data; + SetBank_PPU(); + } + break; + case 0x04: + if (VROM_1K_SIZE != 0) + { + chr6 = data; + SetBank_PPU(); + } + break; + case 0x05: + if (VROM_1K_SIZE != 0) + { + chr7 = data; + SetBank_PPU(); + } + break; + case 0x06: + prg0 = data; + SetBank_CPU(); + break; + case 0x07: + prg1 = data; + SetBank_CPU(); + break; + } + break; + case 0xA000: + reg[2] = data; + if (!nes.rom.Is4SCREEN()) + { + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + break; + case 0xA001: + reg[3] = data; + break; + case 0xC000: + reg[4] = data; + irq_counter = data; + break; + case 0xC001: + reg[5] = data; + irq_latch = data; + break; + case 0xE000: + reg[6] = data; + irq_enable = 0; + irq_counter = irq_latch; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + reg[7] = data; + irq_enable = 1; + break; + } + } + + //void Mapper119::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable != 0) + { + if ((irq_counter--) == 0) + { + irq_counter = irq_latch; + // nes.cpu.IRQ(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + } + + void SetBank_CPU() + { + if ((reg[0] & 0x40) != 0) + { + SetPROM_32K_Bank(PROM_8K_SIZE - 2, prg1, prg0, PROM_8K_SIZE - 1); + } + else + { + SetPROM_32K_Bank(prg0, prg1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + } + + void SetBank_PPU() + { + if ((reg[0] & 0x80) != 0) + { + if ((chr4 & 0x40) != 0) SetCRAM_1K_Bank(0, chr4 & 0x07); else SetVROM_1K_Bank(0, chr4); + if ((chr5 & 0x40) != 0) SetCRAM_1K_Bank(1, chr5 & 0x07); else SetVROM_1K_Bank(1, chr5); + if ((chr6 & 0x40) != 0) SetCRAM_1K_Bank(2, chr6 & 0x07); else SetVROM_1K_Bank(2, chr6); + if ((chr7 & 0x40) != 0) SetCRAM_1K_Bank(3, chr7 & 0x07); else SetVROM_1K_Bank(3, chr7); + + if (((chr01 + 0) & 0x40) != 0) SetCRAM_1K_Bank(4, (chr01 + 0) & 0x07); else SetVROM_1K_Bank(4, (chr01 + 0)); + if (((chr01 + 1) & 0x40) != 0) SetCRAM_1K_Bank(5, (chr01 + 1) & 0x07); else SetVROM_1K_Bank(5, (chr01 + 1)); + if (((chr23 + 0) & 0x40) != 0) SetCRAM_1K_Bank(6, (chr23 + 0) & 0x07); else SetVROM_1K_Bank(6, (chr23 + 0)); + if (((chr23 + 1) & 0x40) != 0) SetCRAM_1K_Bank(7, (chr23 + 1) & 0x07); else SetVROM_1K_Bank(7, (chr23 + 1)); + } + else + { + if (((chr01 + 0) & 0x40) != 0) SetCRAM_1K_Bank(0, (chr01 + 0) & 0x07); else SetVROM_1K_Bank(0, (chr01 + 0)); + if (((chr01 + 1) & 0x40) != 0) SetCRAM_1K_Bank(1, (chr01 + 1) & 0x07); else SetVROM_1K_Bank(1, (chr01 + 1)); + if (((chr23 + 0) & 0x40) != 0) SetCRAM_1K_Bank(2, (chr23 + 0) & 0x07); else SetVROM_1K_Bank(2, (chr23 + 0)); + if (((chr23 + 1) & 0x40) != 0) SetCRAM_1K_Bank(3, (chr23 + 1) & 0x07); else SetVROM_1K_Bank(3, (chr23 + 1)); + + if ((chr4 & 0x40) != 0) SetCRAM_1K_Bank(4, chr4 & 0x07); else SetVROM_1K_Bank(4, chr4); + if ((chr5 & 0x40) != 0) SetCRAM_1K_Bank(5, chr5 & 0x07); else SetVROM_1K_Bank(5, chr5); + if ((chr6 & 0x40) != 0) SetCRAM_1K_Bank(6, chr6 & 0x07); else SetVROM_1K_Bank(6, chr6); + if ((chr7 & 0x40) != 0) SetCRAM_1K_Bank(7, chr7 & 0x07); else SetVROM_1K_Bank(7, chr7); + } + } + + ///void Mapper119::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + for (INT i = 0; i < 8; i++) + { + p[i] = reg[i]; + } + p[8] = prg0; + p[9] = prg1; + p[10] = chr01; + p[11] = chr23; + p[12] = chr4; + p[13] = chr5; + p[14] = chr6; + p[15] = chr7; + p[16] = irq_enable; + p[17] = irq_counter; + p[18] = irq_latch; + } + + //void Mapper119::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + for (INT i = 0; i < 8; i++) + { + reg[i] = p[i]; + } + prg0 = p[8]; + prg1 = p[9]; + chr01 = p[10]; + chr23 = p[11]; + chr4 = p[12]; + chr5 = p[13]; + chr6 = p[14]; + chr7 = p[15]; + irq_enable = p[16]; + irq_counter = p[17]; + irq_latch = p[18]; + } + + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper119.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper119.cs.meta new file mode 100644 index 0000000..27fd811 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper119.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b64ef6cdbe294e94b9bab584acd56e9b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper122.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper122.cs new file mode 100644 index 0000000..f707fe2 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper122.cs @@ -0,0 +1,36 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper122/184 SunSoft-1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper122 : Mapper + { + public Mapper122(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, 2, 3); + } + + //void Mapper122::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr == 0x6000) + { + SetVROM_4K_Bank(0, data & 0x07); + SetVROM_4K_Bank(4, (data & 0x70) >> 4); + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper122.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper122.cs.meta new file mode 100644 index 0000000..6d093e6 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper122.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b1cbf770cbd99df4fb728b2a73992c3f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper133.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper133.cs new file mode 100644 index 0000000..4d686de --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper133.cs @@ -0,0 +1,38 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper133 SACHEN CHEN // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper133 : Mapper + { + public Mapper133(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0); + SetVROM_8K_Bank(0); + } + + //void Mapper133::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr == 0x4120) + { + SetPROM_32K_Bank((data & 0x04) >> 2); + SetVROM_8K_Bank(data & 0x03); + } + CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper133.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper133.cs.meta new file mode 100644 index 0000000..0f43a73 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper133.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e3161fceb02a7c545a1fa5a655c0c489 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper134.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper134.cs new file mode 100644 index 0000000..46d8722 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper134.cs @@ -0,0 +1,86 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper133 SACHEN CHEN // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper134 : Mapper + { + BYTE cmd, prg, chr; + public Mapper134(NES parent) : base(parent) + { + } + + public override void Reset() + + { + SetPROM_32K_Bank(0); + // SetPROM_16K_Bank( 6, 0 ); + // SetPROM_16K_Bank( 6, 1 ); + SetVROM_8K_Bank(0); + } + + //void Mapper134::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + switch (addr & 0x4101) + { + case 0x4100: + cmd = (byte)(data & 0x07); + break; + case 0x4101: + switch (cmd) + { + case 0: + prg = 0; + chr = 3; + break; + case 4: + chr &= 0x3; + chr |= (byte)((data & 0x07) << 2); + break; + case 5: + prg = (byte)(data & 0x07); + break; + case 6: + chr &= 0x1C; + chr |= (byte)(data & 0x3); + break; + case 7: + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + break; + } + break; + } + SetPROM_32K_Bank(prg); + // SetPROM_16K_Bank( 4, (prg<<1)|0 ); + // SetPROM_16K_Bank( 6, (prg<<1)|1 ); + SetVROM_8K_Bank(chr); + CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + } + + //void Mapper134::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = cmd; + p[1] = prg; + p[2] = chr; + } + + //void Mapper134::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + cmd = p[0]; + prg = p[1]; + chr = p[2]; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper134.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper134.cs.meta new file mode 100644 index 0000000..72b8f68 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper134.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d7c97443a7607d740913038bae633d03 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper135.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper135.cs new file mode 100644 index 0000000..10a104e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper135.cs @@ -0,0 +1,113 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper135 SACHEN CHEN // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper135 : Mapper + { + BYTE cmd; + BYTE chr0l, chr1l, chr0h, chr1h, chrch; + public Mapper135(NES parent) : base(parent) + { + } + + public override void Reset() + { + cmd = 0; + chr0l = chr1l = chr0h = chr1h = chrch = 0; + + SetPROM_32K_Bank(0); + SetBank_PPU(); + } + + //void Mapper135::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + switch (addr & 0x4101) + { + case 0x4100: + cmd = (byte)(data & 0x07); + break; + case 0x4101: + switch (cmd) + { + case 0: + chr0l = (byte)(data & 0x07); + SetBank_PPU(); + break; + case 1: + chr0h = (byte)(data & 0x07); + SetBank_PPU(); + break; + case 2: + chr1l = (byte)(data & 0x07); + SetBank_PPU(); + break; + case 3: + chr1h = (byte)(data & 0x07); + SetBank_PPU(); + break; + case 4: + chrch = (byte)(data & 0x07); + SetBank_PPU(); + break; + case 5: + SetPROM_32K_Bank((byte)(data & 0x07)); + break; + case 6: + break; + case 7: + switch ((data >> 1) & 0x03) + { + case 0: SetVRAM_Mirror(VRAM_MIRROR4L); break; + case 1: SetVRAM_Mirror(VRAM_HMIRROR); break; + case 2: SetVRAM_Mirror(VRAM_VMIRROR); break; + case 3: SetVRAM_Mirror(VRAM_MIRROR4L); break; + } + break; + } + break; + } + + CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + } + + void SetBank_PPU() + { + SetVROM_2K_Bank(0, 0 | (chr0l << 1) | (chrch << 4)); + SetVROM_2K_Bank(2, 1 | (chr0h << 1) | (chrch << 4)); + SetVROM_2K_Bank(4, 0 | (chr1l << 1) | (chrch << 4)); + SetVROM_2K_Bank(6, 1 | (chr1h << 1) | (chrch << 4)); + } + + //void Mapper135::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = cmd; + p[1] = chr0l; + p[2] = chr0h; + p[3] = chr1l; + p[4] = chr1h; + p[5] = chrch; + } + + //void Mapper135::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + cmd = p[0]; + chr0l = p[1]; + chr0h = p[2]; + chr0l = p[3]; + chr0h = p[4]; + chrch = p[5]; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper135.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper135.cs.meta new file mode 100644 index 0000000..2780ef7 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper135.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: abc08edc7381db447a58cb32a9d062b5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper140.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper140.cs new file mode 100644 index 0000000..b99ff46 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper140.cs @@ -0,0 +1,36 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper140 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper140 : Mapper + { + public Mapper140(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0); + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper140::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + SetPROM_32K_Bank((data & 0xF0) >> 4); + SetVROM_8K_Bank(data & 0x0F); + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper140.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper140.cs.meta new file mode 100644 index 0000000..3e2b6ad --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper140.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b316b95bf91e5684390dde5856a878cc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper142.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper142.cs new file mode 100644 index 0000000..207460d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper142.cs @@ -0,0 +1,113 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper142 SMB2J // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper142 : Mapper + { + BYTE prg_sel; + BYTE irq_enable; + INT irq_counter; + public Mapper142(NES parent) : base(parent) + { + } + + public override void Reset() + + { + prg_sel = 0; + irq_enable = 0; + irq_counter = 0; + + SetPROM_8K_Bank(3, 0); + SetPROM_8K_Bank(7, 0x0F); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper142::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xF000) + { + case 0x8000: + irq_counter = (irq_counter & 0xFFF0) | ((data & 0x0F) << 0); + break; + case 0x9000: + irq_counter = (irq_counter & 0xFF0F) | ((data & 0x0F) << 4); + break; + case 0xA000: + irq_counter = (irq_counter & 0xF0FF) | ((data & 0x0F) << 8); + break; + case 0xB000: + irq_counter = (irq_counter & 0x0FFF) | ((data & 0x0F) << 12); + break; + case 0xC000: + irq_enable = (byte)(data & 0x0F); + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE000: + prg_sel = (byte)(data & 0x0F); + break; + case 0xF000: + switch (prg_sel) + { + case 1: SetPROM_8K_Bank(4, data & 0x0F); break; + case 2: SetPROM_8K_Bank(5, data & 0x0F); break; + case 3: SetPROM_8K_Bank(6, data & 0x0F); break; + case 4: SetPROM_8K_Bank(3, data & 0x0F); break; + } + break; + } + } + + //void Mapper142::HSync(INT scanline) + public override void HSync(int scanline) + { + if (irq_enable != 0) + { + if (irq_counter > (0xFFFF - 113)) + { + irq_counter = 0; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + else + { + irq_counter += 113; + } + } + } + + //void Mapper142::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //p[0] = prg_sel; + //p[0] = irq_enable; + //*(INT*)&p[2] = irq_counter; + } + + //void Mapper142::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //prg_sel = p[0]; + //irq_enable = p[1]; + //irq_counter = *(INT*)&p[2]; + } + public override bool IsStateSave() + { + return true; + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper142.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper142.cs.meta new file mode 100644 index 0000000..96b98f4 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper142.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6c2a6e8164fd3e64b9e4390d1a36a86d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper151.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper151.cs new file mode 100644 index 0000000..bc147f3 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper151.cs @@ -0,0 +1,59 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper151 VS-Unisystem // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper151 : Mapper + { + public Mapper151(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); +#if FALSE//0 //hum + uint crc = nes.rom.GetPROM_CRC(); + if (crc == 0x1E438D52) + { + DirectDraw.SetVsPalette(7); //VS_Goonies + } + if (crc == 0xD99A2087) + { + DirectDraw.SetVsPalette(6); //VS_Gradius + } +#endif + } + + //void Mapper151::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr) + { + case 0x8000: + SetPROM_8K_Bank(4, data); + break; + case 0xA000: + SetPROM_8K_Bank(5, data); + break; + case 0xC000: + SetPROM_8K_Bank(6, data); + break; + case 0xE000: + SetVROM_4K_Bank(0, data); + break; + case 0xF000: + SetVROM_4K_Bank(4, data); + break; + } + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper151.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper151.cs.meta new file mode 100644 index 0000000..d6592b7 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper151.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b6ad09a5fe20cdb4689f3f2ac2deaf06 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper160.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper160.cs new file mode 100644 index 0000000..96244cc --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper160.cs @@ -0,0 +1,232 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper160 PC-Aladdin // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper160 : Mapper + { + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + BYTE refresh_type; + public Mapper160(NES parent) : base(parent) + { + } + + public override void Reset() + + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + irq_enable = 0; + irq_counter = 0; + irq_latch = 0; + refresh_type = 0; + } + + //void Mapper160::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr) + { + case 0x8000: + SetPROM_8K_Bank(4, data); + break; + case 0x8001: + SetPROM_8K_Bank(5, data); + break; + case 0x8002: + SetPROM_8K_Bank(6, data); + break; + + case 0x9000: + if (data == 0x2B) + { + refresh_type = 1; + } + else if (data == 0xA8) + { + refresh_type = 2; + } + else if (data == 0x1F) + { + refresh_type = 3; + } + else if (data == 0x7C) + { + refresh_type = 4; + } + else if (data == 0x18) + { + refresh_type = 5; + } + else if (data == 0x60) + { + refresh_type = 6; + } + else + { + refresh_type = 0; + } + SetVROM_1K_Bank(0, data); + break; + case 0x9001: + SetVROM_1K_Bank(1, data); + break; + + case 0x9002: + if (refresh_type == 2 && data != 0xE8) + { + refresh_type = 0; + } + SetVROM_1K_Bank(2, data); + break; + + case 0x9003: + SetVROM_1K_Bank(3, data); + break; + case 0x9004: + SetVROM_1K_Bank(4, data); + break; + case 0x9005: + SetVROM_1K_Bank(5, data); + break; + case 0x9006: + SetVROM_1K_Bank(6, data); + break; + case 0x9007: + SetVROM_1K_Bank(7, data); + break; + + case 0xC000: + irq_counter = irq_latch; + irq_enable = irq_latch; + break; + case 0xC001: + irq_latch = data; + break; + case 0xC002: + irq_enable = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xC003: + irq_counter = data; + break; + } + } + + //void Mapper160::HSync(INT scanline) + public override void HSync(int scanline) + { + if (scanline == 0 || scanline == 239) + { + switch (refresh_type) + { + case 1: + SetVROM_8K_Bank(0x58, 0x59, 0x5A, 0x5B, 0x58, 0x59, 0x5A, 0x5B); + break; + case 2: + SetVROM_8K_Bank(0x78, 0x79, 0x7A, 0x7B, 0x78, 0x79, 0x7A, 0x7B); + break; + case 3: + SetVROM_8K_Bank(0x7C, 0x7D, 0x7E, 0x7F, 0x7C, 0x7D, 0x7E, 0x7F); + break; + case 5: + SetVROM_8K_Bank(0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77); + break; + case 6: + SetVROM_8K_Bank(0x5C, 0x5D, 0x5E, 0x5F, 0x7C, 0x7D, 0x7E, 0x7F); + break; + } + } + if (scanline == 64) + { + if (refresh_type == 4) + { + if (PPU_MEM_BANK[8][32 * 10 + 16] == 0x0A) + { + SetVROM_1K_Bank(0, 0x68); + SetVROM_1K_Bank(1, 0x69); + SetVROM_1K_Bank(2, 0x6A); + SetVROM_1K_Bank(3, 0x6B); + } + else + { + SetVROM_1K_Bank(0, 0x6C); + SetVROM_1K_Bank(1, 0x6D); + SetVROM_1K_Bank(2, 0x6E); + SetVROM_1K_Bank(3, 0x6F); + } + } + } + if (scanline == 128) + { + if (refresh_type == 4) + { + SetVROM_1K_Bank(0, 0x68); + SetVROM_1K_Bank(1, 0x69); + SetVROM_1K_Bank(2, 0x6A); + SetVROM_1K_Bank(3, 0x6B); + } + else if (refresh_type == 5) + { + SetVROM_8K_Bank(0x74, 0x75, 0x76, 0x77, 0x74, 0x75, 0x76, 0x77); + } + } + if (scanline == 160) + { + if (refresh_type == 6) + { + SetVROM_8K_Bank(0x60, 0x61, 0x5E, 0x5F, 0x7C, 0x7D, 0x7E, 0x7F); + } + } + + if (irq_enable != 0) + { + if (irq_counter == 0xFF) + { + // nes.cpu.IRQ_NotPending(); + irq_enable = 0; + irq_counter = 0; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + else + { + irq_counter++; + } + } + } + + //void Mapper160::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = irq_enable; + p[1] = irq_counter; + p[2] = irq_latch; + p[3] = refresh_type; + } + + // + //void Mapper160::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + irq_enable = p[0]; + irq_counter = p[1]; + irq_latch = p[2]; + refresh_type = p[3]; + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper160.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper160.cs.meta new file mode 100644 index 0000000..911e3b4 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper160.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 37cf6c466c59c7a42a7e1697cfc2ad5c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper162.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper162.cs new file mode 100644 index 0000000..05cf408 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper162.cs @@ -0,0 +1,132 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper162 Pocket Monster Gold // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; +using VirtualNes.Core.Debug; + +namespace VirtualNes.Core +{ + public class Mapper162 : Mapper + { + BYTE reg5000; + BYTE reg5100; + BYTE reg5200; + BYTE reg5300; + public Mapper162(NES parent) : base(parent) + { + } + + public override void Reset() + { + reg5000 = 0; + reg5100 = 0; + reg5200 = 0; + reg5300 = 7; + SetBank_CPU(); + SetBank_PPU(); + } + + //void Mapper162::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr == 0x5000) + { + reg5000 = data; + SetBank_CPU(); + SetBank_PPU(); + } + else if (addr == 0x5100) + { + reg5100 = data; + SetBank_CPU(); + SetBank_PPU(); + } + else if (addr == 0x5200) + { + reg5200 = data; + SetBank_CPU(); + SetBank_PPU(); + } + else if (addr == 0x5300) + { + reg5300 = data; + } + else if (addr >= 0x6000) + { + CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + } + else + { + Debuger.Log($"write to {addr:X4}:{data:X2}"); + } + + } + + void SetBank_CPU() + { + BYTE bank = 0; + switch (reg5300) + { + case 4: + bank = (byte)((((reg5000 & 0xF) + ((reg5100 & 3) >> 1)) | ((reg5200 & 1) << 4))); + break; + case 7: + bank = (byte)(((reg5000 & 0xF) | ((reg5200 & 1) << 4))); + break; + } + SetPROM_32K_Bank((byte)bank); + } + + void SetBank_PPU() + { + SetCRAM_8K_Bank(0); + } + + //void Mapper162::HSync(int scanline) + public override void HSync(int scanline) + { + if ((reg5000 & 0x80) != 0 && nes.ppu.IsDispON()) + { + if (scanline < 127) + { + // SetCRAM_4K_Bank(0, 0); + SetCRAM_4K_Bank(4, 0); + } + else if (scanline < 240) + { + // SetCRAM_4K_Bank(0, 1); + SetCRAM_4K_Bank(4, 1); + } + } + } + + + //void Mapper162::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg5000; + p[1] = reg5100; + p[2] = reg5200; + p[3] = reg5300; + } + + //void Mapper162::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg5000 = p[0]; + reg5100 = p[1]; + reg5200 = p[2]; + reg5300 = p[3]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper162.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper162.cs.meta new file mode 100644 index 0000000..c62cc2a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper162.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2817bc9b8d92a134795cf9f72eff80bb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper163.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper163.cs new file mode 100644 index 0000000..b88b534 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper163.cs @@ -0,0 +1,239 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper163 NanJing Games // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper163 : Mapper + { + //BYTE strobe; + //BYTE security; + //BYTE trigger; + //BYTE rom_type; + + //BYTE reg[2]; + BYTE[] reg = new byte[3]; + BYTE strobe, trigger; + ushort security; + BYTE rom_type; + + INT www, index; + public Mapper163(NES parent) : base(parent) + { + } + + static Int32[] index_adjust = new Int32[]{ -1, -1, -1, -1, 2, 4, 6, 8 }; + static Int16[] step_table = new Int16[] { +7,8,9,10,11,12,13,14,16,17,19,21,23,25,28,31,34,37,41,45,50,55, +60,66,73,80,88,97,107,118,130,143,157,173,190,209,230,253,279, +307,337,371,408,449,494,544,598,658,724,796,876,963,1060, +1166,1282,1411,1552,1707,1878,2066,2272,2499,2749,3024,3327, +3660,4026,4428,4871,5358,5894,6484,7132,7845,8630,9493,10442, +11487,12635,13899,15289,16818,18500,20350,22385,24623,27086,29794,32767 +}; + + BYTE adpcm_decoder(BYTE data) + { + int sb, delta; + int cur_sample = 0; + if ((data & 8) != 0) sb = 1; else sb = 0; + data &= 7; + delta = (step_table[index] * data) / 4 + step_table[index] / 8; + if (sb == 1) delta = -delta; + cur_sample += delta; + if (cur_sample > 32767) cur_sample = 32767; + else if (cur_sample < -32768) cur_sample = -32768; + else cur_sample = cur_sample; + index += index_adjust[data]; + if (index < 0) index = 0; + if (index > 88) index = 88; + return (byte)(cur_sample & 0xff); + } + + //void Mapper163::Reset() + public override void Reset() + { + + index = 0; + + reg[1] = 0xFF; + strobe = 1; + security = trigger = reg[0] = 0x00; + rom_type = 0; + SetPROM_32K_Bank(15); + + // jedi_table_init(); + + uint crc = nes.rom.GetPROM_CRC(); + if (crc == 0xb6a10d5d) + { // Hu Lu Jin Gang (NJ039) (Ch) [dump] + SetPROM_32K_Bank(0); + } + if (crc == 0xf52468e7 // San Guo Wu Shuang - Meng Jiang Zhuan (NJ047) (Ch) [dump] + || crc == 0x696D98E3) + { // San Guo Zhi Lv Bu Zhuan (NJ040) (Ch) [dump] + rom_type = 1; + } + if (crc == 0xEFF96E8A) + { // Mo Shou Shi Jie E Mo Lie Ren (NJ097) (Ch) [dump] + rom_type = 2; + } + + www = 0; + } + + ///BYTE Mapper163::ReadLow(WORD addr) + public override byte ReadLow(ushort addr) + { + // DEBUGOUT( "ReadLow - addr= %04x\n", addr ); + + if ((addr >= 0x5000 && addr < 0x6000)) + { + switch (addr & 0x7700) + { + case 0x5100: + return (byte)security; + break; + case 0x5500: + if (trigger!=0) + return (byte)security; + else + return 0; + break; + } + return 4; + } + else if (addr >= 0x6000) + { + return CPU_MEM_BANK[addr >> 13][addr & 0x1FFF]; + } + return base.ReadLow(addr); + } + + //void Mapper163::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + // if(addr==0x5200) DEBUGOUT( "WriteLow - addr= %04x ; dat= %03x\n", addr, data ); + + if ((addr >= 0x4020 && addr < 0x6000)) + { + if (addr == 0x5101) + { + if (strobe !=0 && data == 0) + { + trigger ^= 1; + // trigger ^= 0xFF; + } + strobe = data; + } + else if (addr == 0x5100 && data == 6) + { + SetPROM_32K_Bank(3); + } + else + { + switch (addr & 0x7300) + { + case 0x5000: + reg[1] = data; + SetPROM_32K_Bank((reg[1] & 0xF) | (reg[0] << 4)); + if ((reg[1] & 0x80) == 0 && (nes.ppu.GetScanlineNo() < 128)) + SetCRAM_8K_Bank(0); + if (rom_type == 1) SetCRAM_8K_Bank(0); + break; + case 0x5100: + reg[2] = data; + // nes.apu.Write(0x4011,(decode(reg[0]&0xf)<<3)); + break; + case 0x5200: + reg[0] = data; + SetPROM_32K_Bank((reg[1] & 0xF) | (reg[0] << 4)); + break; + case 0x5300: + security = data; + break; + } + } + } + else if (addr >= 0x6000) + { + CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + if ((addr >= 0x7900 && addr <= 0x79FF)) + { + // WAVRAM[addr&0xFF] = data; + // if(addr==0x79FF){ + // memcpy( YWRAM+(www*256), WAVRAM, 256); + // www++; + // } + // nes.apu.Write(0x4011,(adpcm_decoder(data))); + nes.apu.Write(0x4011, data); + } + } + } + + //void Mapper163::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + // DEBUGOUT( "Write - addr= %04x ; dat= %03x\n", addr, data ); + } + + //void Mapper163::HSync(int scanline) + public override void HSync(int scanline) + { + if ((reg[1] & 0x80) !=0 && nes.ppu.IsDispON()) + { + if (scanline == 127) + { + SetCRAM_4K_Bank(0, 1); + SetCRAM_4K_Bank(4, 1); + } + if (rom_type == 1) + { + if (scanline < 127) + { + SetCRAM_4K_Bank(0, 0); + SetCRAM_4K_Bank(4, 0); + } + } + else + { + if (scanline == 239) + { + SetCRAM_4K_Bank(0, 0); + SetCRAM_4K_Bank(4, 0); + if (rom_type == 2) SetCRAM_4K_Bank(4, 1); + } + } + } + } + + ///void Mapper163::PPU_Latch(WORD addr) + //{ + // if (DirectInput.m_Sw[DIK_PAUSE]) + // { + // nes.Dump_YWRAM(); + // } + //} + + //void Mapper163::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg[0]; + p[1] = reg[1]; + } + + //void Mapper163::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg[0] = p[0]; + reg[1] = p[1]; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper163.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper163.cs.meta new file mode 100644 index 0000000..5da4021 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper163.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 843d6eb1b2987f94ea295eda54522756 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper164.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper164.cs new file mode 100644 index 0000000..9c2e50b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper164.cs @@ -0,0 +1,167 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper164 Pocket Monster Gold // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; +using VirtualNes.Core.Debug; + +namespace VirtualNes.Core +{ + public class Mapper164 : Mapper + { + BYTE reg5000; + BYTE reg5100; + BYTE a3, p_mode; + public Mapper164(NES parent) : base(parent) + { + } + + public override void Reset() + { + reg5000 = 0; + reg5100 = 0; + SetBank_CPU(); + SetBank_PPU(); + nes.ppu.SetExtLatchMode(true); + } + + //void Mapper164::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr == 0x5000) + { + p_mode = (byte)(data >> 7); + reg5000 = data; + SetBank_CPU(); + SetBank_PPU(); + } + else if (addr == 0x5100) + { + reg5100 = data; + SetBank_CPU(); + SetBank_PPU(); + } + else if (addr >= 0x6000) + { + CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + } + else + { + Debuger.Log($"write to {addr:X4}:{data:X2}"); + } + + } + + + void SetBank_CPU() + { + int mode, @base, bank; + + @base = (reg5100 & 1) << 5; + mode = (reg5000 >> 4) & 0x07; + + switch (mode) + { + case 0: + case 2: + case 4: + case 6: /* NORMAL MODE */ + bank = (reg5000 & 0x0f); + bank += (reg5000 & 0x20) >> 1; + SetPROM_16K_Bank(4, bank + @base); + SetPROM_16K_Bank(6, @base + 0x1f); + Debuger.Log($"-- normal mode: mode={mode}, bank={bank} --"); + break; + case 1: + case 3: /* REG MODE */ + Debuger.Log("-- reg mode --"); + break; + case 5: /* 32K MODE */ + bank = (reg5000 & 0x0f); + SetPROM_32K_Bank(bank + (@base >> 1)); + // DEBUGOUT("-- 32K MODE: bank=%02x --\n", bank); + break; + case 7: /* HALF MODE */ + bank = (reg5000 & 0x0f); + bank += (bank & 0x08) << 1; + SetPROM_16K_Bank(4, bank + @base); + bank = (bank & 0x10) + 0x0f; + SetPROM_16K_Bank(6, @base + 0x1f); + Debuger.Log("-- half mode --"); + break; + default: + break; + }; + + } + + void SetBank_PPU() + { + SetCRAM_8K_Bank(0); + } + + + //void Mapper164::PPU_ExtLatchX(INT x) + public override void PPU_ExtLatchX(int x) + { + a3 = (byte)((x & 1) << 3); + } + + //void Mapper164::PPU_ExtLatch(WORD ntbladr, BYTE& chr_l, BYTE& chr_h, BYTE& attr ) + public override void PPU_ExtLatch(ushort ntbladr, ref byte chr_l, ref byte chr_h, ref byte attr) + { + INT loopy_v = nes.ppu.GetPPUADDR(); + INT loopy_y = nes.ppu.GetTILEY(); + INT tileofs = (PPUREG[0] & PPU.PPU_BGTBL_BIT) << 8; + INT attradr = 0x23C0 + (loopy_v & 0x0C00) + ((loopy_v & 0x0380) >> 4); + INT attrsft = (ntbladr & 0x0040) >> 4; + Span pNTBL = PPU_MEM_BANK[ntbladr >> 10]; + + INT ntbl_x = ntbladr & 0x001F; + INT tileadr; + + attradr &= 0x3FF; + attr = (byte)(((pNTBL[attradr + (ntbl_x >> 2)] >> ((ntbl_x & 2) + attrsft)) & 3) << 2); + tileadr = tileofs + pNTBL[ntbladr & 0x03FF] * 0x10 + loopy_y; + + if (p_mode != 0) + { + tileadr = (tileadr & 0xfff7) | a3; + chr_l = chr_h = PPU_MEM_BANK[tileadr >> 10][tileadr & 0x03FF]; + } + else + { + chr_l = PPU_MEM_BANK[tileadr >> 10][tileadr & 0x03FF]; + chr_h = PPU_MEM_BANK[tileadr >> 10][(tileadr & 0x03FF) + 8]; + } + + } + + //void Mapper164::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg5000; + p[1] = reg5100; + p[2] = a3; + p[3] = p_mode; + } + + //void Mapper164::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg5000 = p[0]; + reg5100 = p[1]; + a3 = p[2]; + p_mode = p[3]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper164.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper164.cs.meta new file mode 100644 index 0000000..576564d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper164.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5e78f3a9cb5d7dd41a19b35004ec7e56 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper165.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper165.cs new file mode 100644 index 0000000..8dd9069 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper165.cs @@ -0,0 +1,197 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper165 Fire Emblem Chinese version // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper165 : Mapper + { + BYTE[] reg = new byte[8]; + BYTE prg0, prg1; + BYTE chr0, chr1, chr2, chr3; + BYTE we_sram; + BYTE latch; + public Mapper165(NES parent) : base(parent) + { + } + + public override void Reset() + + { + for (INT i = 0; i < 8; i++) + { + reg[i] = 0x00; + } + prg0 = 0; + prg1 = 1; + SetBank_CPU(); + + chr0 = 0; + chr1 = 0; + chr2 = 4; + chr3 = 4; + latch = 0xFD; + SetBank_PPU(); + + we_sram = 0; // Disable + + nes.ppu.SetChrLatchMode(true); + } + + //void Mapper165::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + + switch (addr & 0xE001) + { + case 0x8000: + reg[0] = data; + SetBank_CPU(); + SetBank_PPU(); + break; + case 0x8001: + reg[1] = data; + + switch (reg[0] & 0x07) + { + case 0x00: + chr0 = (byte)(data & 0xFC); + if (latch == 0xFD) + SetBank_PPU(); + break; + case 0x01: + chr1 = (byte)(data & 0xFC); + if (latch == 0xFE) + SetBank_PPU(); + break; + + case 0x02: + chr2 = (byte)(data & 0xFC); + if (latch == 0xFD) + SetBank_PPU(); + break; + case 0x04: + chr3 = (byte)(data & 0xFC); + if (latch == 0xFE) + SetBank_PPU(); + break; + + case 0x06: + prg0 = data; + SetBank_CPU(); + break; + case 0x07: + prg1 = data; + SetBank_CPU(); + break; + } + break; + case 0xA000: + reg[2] = data; + if ((data & 0x01)!= 0) + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + break; + case 0xA001: + reg[3] = data; + break; + default: + break; + } + + } + + void SetBank_CPU() + { + SetPROM_32K_Bank(prg0, prg1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + + void SetBank_PPU() + { + if (latch == 0xFD) + { + SetBank_PPUSUB(0, chr0); + SetBank_PPUSUB(4, chr2); + } + else + { + SetBank_PPUSUB(0, chr1); + SetBank_PPUSUB(4, chr3); + } + } + + void SetBank_PPUSUB(int bank, int page) + { + if (page == 0) + { + SetCRAM_4K_Bank((byte)bank, page >> 2); + } + else + { + SetVROM_4K_Bank((byte)bank, page >> 2); + } + } + + //void Mapper165::PPU_ChrLatch(WORD addr) + public override void PPU_ChrLatch(ushort addr) + { + ushort mask = (ushort)(addr & 0x1FF0); + + if (mask == 0x1FD0) + { + latch = 0xFD; + SetBank_PPU(); + } + else if (mask == 0x1FE0) + { + latch = 0xFE; + SetBank_PPU(); + } + + } + + //void Mapper165::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + for (INT i = 0; i < 8; i++) + { + p[i] = reg[i]; + } + p[8] = prg0; + p[9] = prg1; + p[10] = chr0; + p[11] = chr1; + p[12] = chr2; + p[13] = chr3; + p[14] = latch; + } + + //void Mapper165::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + for (INT i = 0; i < 8; i++) + { + reg[i] = p[i]; + } + prg0 = p[8]; + prg1 = p[9]; + chr0 = p[10]; + chr1 = p[11]; + chr2 = p[12]; + chr3 = p[13]; + latch = p[14]; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper165.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper165.cs.meta new file mode 100644 index 0000000..371fc1b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper165.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bbfe308ca0a341f439b9c6772903cde4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper167.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper167.cs new file mode 100644 index 0000000..927b45d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper167.cs @@ -0,0 +1,137 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper004 Supor Computer V4.0 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper167 : Mapper + { + BYTE[] regs = new byte[4]; + BYTE rom_type; + public Mapper167(NES parent) : base(parent) + { + } + + public override void Reset() + { + uint crc; + + regs[0] = 0; + regs[1] = 0; + regs[2] = 0; + regs[3] = 0; + + crc = nes.rom.GetPROM_CRC(); + if (crc == 0x82F1Fb96) + { + // Subor Computer(Russia) + rom_type = 1; + } + else + { + // Subor Computer(Chinese) + rom_type = 0; + } + + SetBank_CPU(); + SetBank_PPU(); + } + + //void Mapper167::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + int idx; + + idx = (addr >> 13) & 0x03; + regs[idx] = data; + SetBank_CPU(); + SetBank_PPU(); + // DEBUGOUT("write to %04x:%02x\n", addr, data); + } + + + void SetBank_CPU() + { + int @base, bank; + + @base = ((regs[0] ^ regs[1]) & 0x10) << 1; + bank = (regs[2] ^ regs[3]) & 0x1f; + + if ((regs[1] & 0x08) != 0) + { + bank &= 0xfe; + if (rom_type == 0) + { + SetPROM_16K_Bank(4, @base + bank + 1); + SetPROM_16K_Bank(6, @base + bank + 0); + } + else + { + SetPROM_16K_Bank(6, @base + bank + 1); + SetPROM_16K_Bank(4, @base + bank + 0); + } + // DEBUGOUT("32K MODE!\n"); + } + else + { + if ((regs[1] & 0x04) != 0) + { + SetPROM_16K_Bank(4, 0x1f); + SetPROM_16K_Bank(6, @base + bank); + // DEBUGOUT("HIGH 16K MODE!\n"); + } + else + { + SetPROM_16K_Bank(4, @base + bank); + if (rom_type == 0) + { + SetPROM_16K_Bank(6, 0x20); + } + else + { + SetPROM_16K_Bank(6, 0x07); + } + // DEBUGOUT("LOW 16K MODE!\n"); + } + } + + + } + + void SetBank_PPU() + { + SetCRAM_8K_Bank(0); + } + + //void Mapper167::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = regs[0]; + p[1] = regs[1]; + p[2] = regs[2]; + p[3] = regs[3]; + p[4] = rom_type; + } + + //void Mapper167::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + regs[0] = p[0]; + regs[1] = p[1]; + regs[2] = p[2]; + regs[3] = p[3]; + rom_type = p[4]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper167.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper167.cs.meta new file mode 100644 index 0000000..bf96ff8 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper167.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd018661871c8d34ab9fd790666e5b75 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper175.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper175.cs new file mode 100644 index 0000000..16ea8e8 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper175.cs @@ -0,0 +1,71 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper175 15-in-1 (Kaiser) // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper175 : Mapper + { + BYTE reg_dat; + public Mapper175(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_16K_Bank(4, 0); + SetPROM_16K_Bank(6, 0); + reg_dat = 0; + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //BYTE Mapper175::Read(WORD addr) + public override void Read(ushort addr, byte data) + { + if (addr == 0xFFFC) + { + SetPROM_16K_Bank(4, reg_dat & 0x0F); + SetPROM_8K_Bank(6, (reg_dat & 0x0F) * 2); + } + } + + //void Mapper175::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr) + { + case 0x8000: + if ((data & 0x04)!=0) + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + break; + case 0xA000: + reg_dat = data; + SetPROM_8K_Bank(7, (reg_dat & 0x0F) * 2 + 1); + SetVROM_8K_Bank(reg_dat & 0x0F); + break; + } + } + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper175.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper175.cs.meta new file mode 100644 index 0000000..fb2ed5f --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper175.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 68d93abdcd8d7774ababf7b66976ee49 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper176.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper176.cs new file mode 100644 index 0000000..970e8ee --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper176.cs @@ -0,0 +1,238 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper176 ShuQiYu / HengGe / WaiXing // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; + +namespace VirtualNes.Core +{ + public class Mapper176 : Mapper + { + BYTE reg5000; + BYTE reg5001; + BYTE reg5010; + BYTE reg5011; + BYTE reg5013; + BYTE reg5FF1; + BYTE reg5FF2; + BYTE we_sram; + BYTE SBW, sp_rom; + public Mapper176(NES parent) : base(parent) + { + } + + public override void Reset() + { + if (PROM_16K_SIZE > 32) + { + SetPROM_32K_Bank(0, 1, (PROM_8K_SIZE / 2) - 2, (PROM_8K_SIZE / 2) - 1); //For 1M byte Cartridge + } + else + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + // SetPROM_32K_Bank( PROM_8K_SIZE-4, PROM_8K_SIZE-3, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); + if (VROM_1K_SIZE!=0) SetVROM_8K_Bank(0); + + reg5000 = 0; + reg5001 = 0; + reg5010 = 0; + reg5011 = 0; + reg5013 = 0; + reg5FF1 = 0; + reg5FF2 = 0; + we_sram = 0; + SBW = 0; + sp_rom = 0; + + uint crc = nes.rom.GetPROM_CRC(); + + if (crc == 0x095D8678 //[ES-0122] Shuang Yue Zhuan (C) + || crc == 0xD5F7AAEF) + { //[ES-XXXX] Shen Feng Jian (C) + sp_rom = 1; + nes.SetSAVERAM_SIZE(32 * 1024); + } + + /* + crc == 0x416C07A1 //[ES-1006] Meng Huan Zhi Xing IV (C) & WXN-梦幻之星 √ + crc == 0x94782FBD //[ES-1057] San Guo Zhi - Xiong Ba Tian Xia (C) + crc == 0xF9863ADF //[ES-1066] Xi Chu Ba Wang (C) + crc == 0xB511C04B //[ES-1071] San Xia Wu Yi (C) + crc == 0x1923A8C5 //[ES-1087] Shui Hu Shen Shou (C) & WXN-水浒神兽(fix) √ + crc == 0x095D8678 //[ES-0122] Shuang Yue Zhuan (C) + crc == 0x8f6ab5ac //WXN-三国忠烈传 √ + crc == 0x99051cb5 //WXN-雄霸天下 √ + crc == 0xf29c8186 //WXN-大富翁2-上海大亨 √ + crc == 0xc768098b //WXN-三侠五义 √ + crc == 0x49f22159 //WXN-超级大富翁 √ + crc == 0xf354d847 //WXN-格兰帝亚 √ + crc == 0x5ee2ef97 //WXN-帝国时代(fix) √ + crc == 0x977d22c3 //WXN-破釜沉舟(fix) √ + crc == 0xf1d803f3 //WXN-西楚霸王(fix) √ + crc == 0x85dd49b6 //WXN-口袋金(fix) √ + crc == 0x97b82f53 //WXN-爆笑三国(fix) √ + crc == 0xce2ea530 //WXN-宠物翡翠(fix) √ + */ + } + + //BYTE Mapper176::ReadLow(WORD addr) + public override byte ReadLow(ushort addr) + { + if (sp_rom == 1) + { + if (addr >= 0x6000) + { + switch (we_sram) + { + case 0xE4: + case 0xEC: return WRAM[(addr & 0x1FFF) + 0x0000]; + case 0xE5: + case 0xED: return WRAM[(addr & 0x1FFF) + 0x2000]; + case 0xE6: + case 0xEE: return WRAM[(addr & 0x1FFF) + 0x4000]; + case 0xE7: + case 0xEF: return WRAM[(addr & 0x1FFF) + 0x6000]; + default: return CPU_MEM_BANK[addr >> 13][addr & 0x1FFF]; + } + } + } + return base.ReadLow(addr); + } + + //void Mapper176::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + // DEBUGOUT("Address=%04X Data=%02X\n", addr&0xFFFF, data&0xFF ); + + switch (addr) + { + case 0x5000: + reg5000 = data; + break; + case 0x5001: //[ES-1006] Meng Huan Zhi Xing IV (C) + reg5001 = data; + if (SBW!=0) SetPROM_32K_Bank(reg5001); + break; + case 0x5010: + reg5010 = data; + if (reg5010 == 0x24) SBW = 1; + break; + case 0x5011: + reg5011 = (byte)(data >> 1); + if (SBW!=0) SetPROM_32K_Bank(reg5011); + break; + case 0x5013: + reg5013 = data; + break; + case 0x5ff1: + reg5FF1 = (byte)(data >> 1); + SetPROM_32K_Bank(reg5FF1); + break; + case 0x5ff2: + reg5FF2 = data; + SetVROM_8K_Bank(reg5FF2); + break; + } + + if (sp_rom == 1) + { + if (addr >= 0x6000) + { + switch (we_sram) + { + case 0xE4: //CPU_MEM_BANK + case 0xEC: //CPU_MEM_BANK + WRAM[(addr & 0x1FFF) + 0x0000] = data; + CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + break; + case 0xE5: //SRAM + case 0xED: //SRAM + WRAM[(addr & 0x1FFF) + 0x2000] = data; + break; + case 0xE6: + case 0xEE: + WRAM[(addr & 0x1FFF) + 0x4000] = data; + break; + case 0xE7: + case 0xEF: + WRAM[(addr & 0x1FFF) + 0x6000] = data; + break; + default: + CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + break; + } + } + } + else + { + if (addr >= 0x6000) + { + // if ( we_sram == 0 ){ + CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + // } + } + } + + + } + + //void Mapper176::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + // DEBUGOUT("Address=%04X Data=%02X\n", addr&0xFFFF, data&0xFF ); + + if (addr == 0xa000) + { + data &= 0x03; + if (data == 0) SetVRAM_Mirror(VRAM_VMIRROR); + else if (data == 1) SetVRAM_Mirror(VRAM_HMIRROR); + else if (data == 2) SetVRAM_Mirror(VRAM_MIRROR4L); + else SetVRAM_Mirror(VRAM_MIRROR4H); + } + if (addr == 0xa001) + { + // we_sram = data & 0x03; + we_sram = data; + } + } + + //void Mapper176::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg5000; + p[1] = reg5001; + p[2] = reg5010; + p[3] = reg5011; + p[4] = reg5013; + p[5] = reg5FF1; + p[6] = reg5FF2; + p[7] = we_sram; + p[8] = SBW; + p[9] = sp_rom; + } + + //void Mapper176::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg5000 = p[0]; + reg5001 = p[1]; + reg5010 = p[2]; + reg5011 = p[3]; + reg5013 = p[4]; + reg5FF1 = p[5]; + reg5FF2 = p[6]; + we_sram = p[7]; + SBW = p[8]; + sp_rom = p[9]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper176.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper176.cs.meta new file mode 100644 index 0000000..1ef5f1b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper176.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c9551cda80f1ab24993914b62a660fac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper178.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper178.cs new file mode 100644 index 0000000..aab1e08 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper178.cs @@ -0,0 +1,77 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper178 Education / WaiXing_FS305 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper178 : Mapper + { + BYTE[] reg = new byte[3]; + BYTE banknum; + BYTE OP_rom; + public Mapper178(NES parent) : base(parent) + { + } + + public override void Reset() + { + reg[0] = 0; + reg[1] = 0; + reg[2] = 0; + banknum = 0; + SetBank_CPU(); + OP_rom = 0; + + uint crc = nes.rom.GetPROM_CRC(); + if (crc == 0x925926BC //[ES-XXXX] Kou Dai Zuan Shi Zhi Chong Wu Xiao Jing Ling 2 (C) + || crc == 0xB0B13DBD) //[ES-XXXX] Chong Wu Fei Cui Zhi Chong Wu Xiao Jing Ling IV (C) + { + OP_rom = 1; + } + } + + //void Mapper178::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + // if( addr >= 0x4000 && addr <= 0x5FFF ) DEBUGOUT("Address=%04X Data=%02X\n", addr&0xFFFF, data&0xFF ); + if (addr == 0x4800) + { + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + else if (addr == 0x4801) + { + reg[0] = (byte)((data >> 1) & 0x0F); + if (OP_rom!=0) reg[0] = (byte)(data << 2); + SetBank_CPU(); + } + else if (addr == 0x4802) + { + reg[1] = (byte)(data << 2); + if (OP_rom!=0) reg[1] = data; + SetBank_CPU(); + } + else if (addr == 0x4803) + { + //unknown + reg[2] = data; + } + else if (addr >= 0x6000) + { + CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + } + } + + void SetBank_CPU() + { + banknum = (byte)(reg[0] | reg[1]); + // DEBUGOUT("Bank=%02X\n", banknum&0xFF ); + SetPROM_32K_Bank(banknum); + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper178.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper178.cs.meta new file mode 100644 index 0000000..ec45d92 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper178.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d281debb02f40d648b6b2d7355eec34b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper180.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper180.cs new file mode 100644 index 0000000..2c97009 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper180.cs @@ -0,0 +1,37 @@ +////////////////////////////////////////////// +// Mapper180 Nichibutsu // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper180 : Mapper + { + public Mapper180(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper180::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + SetPROM_16K_Bank(6, data & 0x07); + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper180.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper180.cs.meta new file mode 100644 index 0000000..84cf64b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper180.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0690d23936f8e3a42ad2ea112dbfb3f2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper181.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper181.cs new file mode 100644 index 0000000..767bc3f --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper181.cs @@ -0,0 +1,38 @@ +/////////////////////////////////////////////////////// +// Mapper181 Hacker International Type2 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper181 : Mapper + { + public Mapper181(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0); + SetVROM_8K_Bank(0); + } + + //void Mapper181::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + //DEBUGOUT( "$%04X:$%02X\n", addr, data ); + if (addr == 0x4120) + { + SetPROM_32K_Bank((data & 0x08) >> 3); + SetVROM_8K_Bank(data & 0x07); + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper181.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper181.cs.meta new file mode 100644 index 0000000..01d975a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper181.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 62cd0f9e43adec242bc4f1ff7f2cae4f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper182.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper182.cs new file mode 100644 index 0000000..52a4beb --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper182.cs @@ -0,0 +1,123 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper182 PC-SuperDonkeyKong // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper182 : Mapper + { + BYTE reg; + BYTE irq_enable; + BYTE irq_counter; + public Mapper182(NES parent) : base(parent) + { + } + + public override void Reset() + + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + SetVROM_8K_Bank(0); + + reg = 0; + irq_enable = 0; + irq_counter = 0; + } + + //void Mapper182::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xF003) + { + case 0x8001: + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + break; + case 0xA000: + reg = (byte)(data & 0x07); + break; + case 0xC000: + switch (reg) + { + case 0: + SetVROM_1K_Bank(0, (data & 0xFE) + 0); + SetVROM_1K_Bank(1, (data & 0xFE) + 1); + break; + case 1: + SetVROM_1K_Bank(5, data); + break; + case 2: + SetVROM_1K_Bank(2, (data & 0xFE) + 0); + SetVROM_1K_Bank(3, (data & 0xFE) + 1); + break; + case 3: + SetVROM_1K_Bank(7, data); + break; + case 4: + SetPROM_8K_Bank(4, data); + break; + case 5: + SetPROM_8K_Bank(5, data); + break; + case 6: + SetVROM_1K_Bank(4, data); + break; + case 7: + SetVROM_1K_Bank(6, data); + break; + } + break; + case 0xE003: + irq_enable = data; + irq_counter = data; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + } + } + + //void Mapper182::HSync(INT scanline) + public override void HSync(int scanline) + { + if (irq_enable != 0) + { + if ((scanline >= 0 && scanline <= 239) && nes.ppu.IsDispON()) + { + if ((--irq_counter) == 0) + { + irq_enable = 0; + irq_counter = 0; + // nes.cpu.IRQ_NotPending(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + + //void Mapper182::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg; + p[1] = irq_enable; + p[2] = irq_counter; + } + + //void Mapper182::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg = p[0]; + irq_enable = p[1]; + irq_counter = p[2]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper182.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper182.cs.meta new file mode 100644 index 0000000..c78ed0c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper182.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5b5348cd0dcfc7949b576b96ee04dee9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper183.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper183.cs new file mode 100644 index 0000000..a2ec35c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper183.cs @@ -0,0 +1,197 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper183 Gimmick (Bootleg) // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper183 : Mapper + { + BYTE[] reg = new byte[8]; + BYTE irq_enable; + INT irq_counter; + public Mapper183(NES parent) : base(parent) + { + } + + public override void Reset() + + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + SetVROM_8K_Bank(0); + + for (byte i = 0; i < 8; i++) + { + reg[i] = i; + } + irq_enable = 0; + irq_counter = 0; + } + + //void Mapper183::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr) + { + case 0x8800: + SetPROM_8K_Bank(4, data); + break; + case 0xA800: + SetPROM_8K_Bank(5, data); + break; + case 0xA000: + SetPROM_8K_Bank(6, data); + break; + + case 0xB000: + reg[0] = (byte)((reg[0] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(0, reg[0]); + break; + case 0xB004: + reg[0] = (byte)((reg[0] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(0, reg[0]); + break; + case 0xB008: + reg[1] = (byte)((reg[1] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(1, reg[1]); + break; + case 0xB00C: + reg[1] = (byte)((reg[1] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(1, reg[1]); + break; + + case 0xC000: + reg[2] = (byte)((reg[2] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(2, reg[2]); + break; + case 0xC004: + reg[2] = (byte)((reg[2] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(2, reg[2]); + break; + case 0xC008: + reg[3] = (byte)((reg[3] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(3, reg[3]); + break; + case 0xC00C: + reg[3] = (byte)((reg[3] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(3, reg[3]); + break; + + case 0xD000: + reg[4] = (byte)((reg[4] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(4, reg[4]); + break; + case 0xD004: + reg[4] = (byte)((reg[4] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(4, reg[4]); + break; + case 0xD008: + reg[5] = (byte)((reg[5] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(5, reg[5]); + break; + case 0xD00C: + reg[5] = (byte)((reg[5] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(5, reg[5]); + break; + + case 0xE000: + reg[6] = (byte)((reg[6] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(6, reg[6]); + break; + case 0xE004: + reg[6] = (byte)((reg[6] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(6, reg[6]); + break; + case 0xE008: + reg[7] = (byte)((reg[3] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(7, reg[7]); + break; + case 0xE00C: + reg[7] = (byte)((reg[3] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(7, reg[7]); + break; + + case 0x9008: + if (data == 1) + { + for (byte i = 0; i < 8; i++) + { + reg[i] = i; + } + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + SetVROM_8K_Bank(0); + } + break; + + case 0x9800: + if (data == 0) SetVRAM_Mirror(VRAM_VMIRROR); + else if (data == 1) SetVRAM_Mirror(VRAM_HMIRROR); + else if (data == 2) SetVRAM_Mirror(VRAM_MIRROR4L); + else if (data == 3) SetVRAM_Mirror(VRAM_MIRROR4H); + break; + + case 0xF000: + irq_counter = (irq_counter & 0xFF00) | data; + break; + case 0xF004: + irq_counter = (irq_counter & 0x00FF) | (data << 8); + break; + case 0xF008: + irq_enable = data; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + } + } + + //void Mapper183::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((irq_enable & 0x02) != 0) + { + if (irq_counter <= 113) + { + irq_counter = 0; + // nes.cpu.IRQ_NotPending(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + else + { + irq_counter -= 113; + } + } + } + + //void Mapper183::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //for (INT i = 0; i < 8; i++) + //{ + // p[i] = reg[i]; + //} + //p[8] = irq_enable; + //*((INT*)&p[9]) = irq_counter; + } + + //void Mapper183::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + // for (INT i = 0; i < 8; i++) + // { + // reg[i] = p[i]; + // } + // irq_enable = p[8]; + // irq_counter = *((INT*)&p[9]); + } + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper183.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper183.cs.meta new file mode 100644 index 0000000..8f1e604 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper183.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a30c259cae622e40a3ffe2da26883c8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper185.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper185.cs new file mode 100644 index 0000000..e5e2d0f --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper185.cs @@ -0,0 +1,68 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper185 Character disable protect // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper185 : Mapper + { + BYTE patch; + public Mapper185(NES parent) : base(parent) + { + } + + public override void Reset() + + { + switch (PROM_16K_SIZE) + { + case 1: // 16K only + SetPROM_16K_Bank(4, 0); + SetPROM_16K_Bank(6, 0); + break; + case 2: // 32K + SetPROM_32K_Bank(0); + break; + } + + for (INT i = 0; i < 0x400; i++) + { + VRAM[0x800 + i] = 0xFF; + } + patch = 0; + + uint crc = nes.rom.GetPROM_CRC(); + if (crc == 0xb36457c7) + { // Spy vs Spy(J) + patch = 1; + } + } + + //void Mapper185::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if (((patch == 0) && ((data & 0x03) != 0)) || ((patch != 0) && data == 0x21)) + { + SetVROM_8K_Bank(0); + } + else + { + SetVRAM_1K_Bank(0, 2); // use vram bank 2 + SetVRAM_1K_Bank(1, 2); + SetVRAM_1K_Bank(2, 2); + SetVRAM_1K_Bank(3, 2); + SetVRAM_1K_Bank(4, 2); + SetVRAM_1K_Bank(5, 2); + SetVRAM_1K_Bank(6, 2); + SetVRAM_1K_Bank(7, 2); + } + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper185.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper185.cs.meta new file mode 100644 index 0000000..c32aa01 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper185.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5172897463091b440aa762737b586b67 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper187.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper187.cs new file mode 100644 index 0000000..b9672d9 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper187.cs @@ -0,0 +1,371 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper187 Street Fighter Zero 2 97 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper187 : Mapper + { + + BYTE[] prg = new byte[4]; + INT[] chr = new int[8]; + BYTE[] bank = new byte[8]; + + BYTE ext_mode; + BYTE chr_mode; + BYTE ext_enable; + + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + BYTE irq_occur; + BYTE last_write; + public Mapper187(NES parent) : base(parent) + { + } + + public override void Reset() + + { + INT i; + + for (i = 0; i < 8; i++) + { + chr[i] = 0x00; + bank[i] = 0x00; + } + + prg[0] = (byte)(PROM_8K_SIZE - 4); + prg[1] = (byte)(PROM_8K_SIZE - 3); + prg[2] = (byte)(PROM_8K_SIZE - 2); + prg[3] = (byte)(PROM_8K_SIZE - 1); + SetBank_CPU(); + + ext_mode = 0; + chr_mode = 0; + ext_enable = 0; + + irq_enable = 0; + irq_counter = 0; + irq_latch = 0; + + last_write = 0; + + nes.SetRenderMethod(EnumRenderMethod.POST_ALL_RENDER); + } + + //BYTE Mapper187::ReadLow(WORD addr) + public override byte ReadLow(ushort addr) + { + switch (last_write & 0x03) + { + case 0: + return 0x83; + case 1: + return 0x83; + case 2: + return 0x42; + case 3: + return 0x00; + } + return 0; + } + + //void Mapper187::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + last_write = data; + if (addr == 0x5000) + { + ext_mode = data; + if ((data & 0x80) != 0) + { + if ((data & 0x20) != 0) + { + prg[0] = (byte)(((data & 0x1E) << 1) + 0); + prg[1] = (byte)(((data & 0x1E) << 1) + 1); + prg[2] = (byte)(((data & 0x1E) << 1) + 2); + prg[3] = (byte)(((data & 0x1E) << 1) + 3); + } + else + { + prg[2] = (byte)(((data & 0x1F) << 1) + 0); + prg[3] = (byte)(((data & 0x1F) << 1) + 1); + } + } + else + { + prg[0] = bank[6]; + prg[1] = bank[7]; + prg[2] = (byte)(PROM_8K_SIZE - 2); + prg[3] = (byte)(PROM_8K_SIZE - 1); + } + SetBank_CPU(); + } + } + + //void Mapper187::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + last_write = data; + switch (addr) + { + case 0x8003: + ext_enable = 0xFF; + // if( (data&0x80) != (chr_mode&0x80) ) { + // for( INT i = 0; i < 4; i++ ) { + // INT temp = chr[i]; + // chr[i] = chr[i+4]; + // chr[i+4] = temp; + // } + // SetBank_PPU(); + // } + chr_mode = data; + if ((data & 0xF0) == 0) + { + prg[2] = (byte)(PROM_8K_SIZE - 2); + SetBank_CPU(); + } + break; + + case 0x8000: + ext_enable = 0; + // if( (data&0x80) != (chr_mode&0x80) ) { + // for( INT i = 0; i < 4; i++ ) { + // INT temp = chr[i]; + // chr[i] = chr[i+4]; + // chr[i+4] = temp; + // } + // SetBank_PPU(); + // } + chr_mode = data; + break; + + case 0x8001: + if (ext_enable == 0) + { + switch (chr_mode & 7) + { + case 0: + data &= 0xFE; + chr[4] = (INT)data + 0x100; + chr[5] = (INT)data + 0x100 + 1; + // chr[0+((chr_mode&0x80)?4:0)] = data; + // chr[1+((chr_mode&0x80)?4:0)] = data+1; + SetBank_PPU(); + break; + case 1: + data &= 0xFE; + chr[6] = (INT)data + 0x100; + chr[7] = (INT)data + 0x100 + 1; + // chr[2+((chr_mode&0x80)?4:0)] = data; + // chr[3+((chr_mode&0x80)?4:0)] = data+1; + SetBank_PPU(); + break; + case 2: + chr[0] = data; + // chr[0+((chr_mode&0x80)?0:4)] = data; + SetBank_PPU(); + break; + case 3: + chr[1] = data; + // chr[1+((chr_mode&0x80)?0:4)] = data; + SetBank_PPU(); + break; + case 4: + chr[2] = data; + // chr[2+((chr_mode&0x80)?0:4)] = data; + SetBank_PPU(); + break; + case 5: + chr[3] = data; + // chr[3+((chr_mode&0x80)?0:4)] = data; + SetBank_PPU(); + break; + case 6: + if ((ext_mode & 0xA0) != 0xA0) + { + prg[0] = data; + SetBank_CPU(); + } + break; + case 7: + if ((ext_mode & 0xA0) != 0xA0) + { + prg[1] = data; + SetBank_CPU(); + } + break; + default: + break; + } + } + else + { + switch (chr_mode) + { + case 0x2A: + prg[1] = 0x0F; + break; + case 0x28: + prg[2] = 0x17; + break; + case 0x26: + break; + default: + break; + } + SetBank_CPU(); + } + bank[chr_mode & 7] = data; + break; + + case 0xA000: + if ((data & 0x01) != 0) + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + break; + case 0xA001: + break; + + case 0xC000: + irq_counter = data; + irq_occur = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xC001: + irq_latch = data; + irq_occur = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE000: + case 0xE002: + irq_enable = 0; + irq_occur = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + case 0xE003: + irq_enable = 1; + irq_occur = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + } + } + + //void Mapper187::Clock(INT cycles) + public override void Clock(int cycles) + { + // if( irq_occur ) { + // nes.cpu.IRQ_NotPending(); + // } + } + + // void Mapper187::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable != 0) + { + if (irq_counter == 0) + { + irq_counter--; + irq_enable = 0; + irq_occur = 0xFF; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + else + { + irq_counter--; + } + } + } + } + } + + void SetBank_CPU() + { + SetPROM_32K_Bank(prg[0], prg[1], prg[2], prg[3]); + } + + void SetBank_PPU() + { + SetVROM_8K_Bank(chr[0], chr[1], chr[2], chr[3], + chr[4], chr[5], chr[6], chr[7]); + } + + //void Mapper187::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //INT i; + + //for (i = 0; i < 4; i++) + //{ + // p[i] = prg[i]; + //} + //for (i = 0; i < 8; i++) + //{ + // p[4 + i] = bank[i]; + //} + //for (i = 0; i < 8; i++) + //{ + // *((INT*)&p[12 + i * sizeof(INT)]) = chr[i]; + //} + + //p[44] = ext_mode; + //p[45] = chr_mode; + //p[46] = ext_enable; + //p[47] = irq_enable; + //p[48] = irq_counter; + //p[49] = irq_latch; + //p[50] = irq_occur; + //p[51] = last_write; + } + + //void Mapper187::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //INT i; + + //for (i = 0; i < 4; i++) + //{ + // prg[i] = p[i]; + //} + //for (i = 0; i < 8; i++) + //{ + // bank[i] = p[4 + i]; + //} + //for (i = 0; i < 8; i++) + //{ + // chr[i] = *((INT*)&p[12 + i * sizeof(INT)]); + //} + //ext_mode = p[44]; + //chr_mode = p[45]; + //ext_enable = p[46]; + //irq_enable = p[47]; + //irq_counter = p[48]; + //irq_latch = p[49]; + //irq_occur = p[50]; + //last_write = p[51]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper187.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper187.cs.meta new file mode 100644 index 0000000..24c87de --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper187.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: defdc0bc39e45624b958e7d2d3a40430 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper188.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper188.cs new file mode 100644 index 0000000..fb80760 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper188.cs @@ -0,0 +1,60 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper188 Bandai Karaoke Studio // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper188 : Mapper + { + public Mapper188(NES parent) : base(parent) + { + } + public override void Reset() + { + if (PROM_8K_SIZE > 16) + { + SetPROM_32K_Bank(0, 1, 14, 15); + } + else + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + } + + //void Mapper188::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if (data != 0) + { + if ((data & 0x10) != 0) + { + data &= 0x07; + SetPROM_16K_Bank(4, data); + } + else + { + SetPROM_16K_Bank(4, data + 8); + } + } + else + { + if (PROM_8K_SIZE == 0x10) + { + SetPROM_16K_Bank(4, 7); + } + else + { + SetPROM_16K_Bank(4, 8); + } + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper188.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper188.cs.meta new file mode 100644 index 0000000..44ff8b7 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper188.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 30eeef1e68b38eb42b07dcb03d6f5e00 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper189.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper189.cs new file mode 100644 index 0000000..abe591d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper189.cs @@ -0,0 +1,320 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper189 Street Fighter 2/Yoko version // +// 快打傅説 Street Fighter IV (GOUDER) // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper189 : Mapper + { + BYTE patch; + + BYTE[] reg = new BYTE[2]; + BYTE chr01, chr23, chr4, chr5, chr6, chr7; + + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + + // SF4 + BYTE[] protect_dat = new byte[4]; + BYTE lwd; + public Mapper189(NES parent) : base(parent) + { + } + + public override void Reset() + + { + SetPROM_32K_Bank(PROM_8K_SIZE - 4, PROM_8K_SIZE - 3, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + + reg[0] = reg[1] = 0; + + chr01 = 0; + chr23 = 2; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + SetBank_PPU(); + + irq_enable = 0; + irq_counter = 0; + irq_latch = 0; + + for (INT i = 0; i < 4; i++) + { + protect_dat[i] = 0; + } + lwd = 0xFF; + + patch = 0; + uint crc = nes.rom.GetPROM_CRC(); + if (crc == 0x20ca2ad3) + { // Street Fighter IV (GOUDER) + patch = 1; + SetPROM_32K_Bank(0); + + // $4000-$5FFF + SetPROM_Bank(2, XRAM, BANKTYPE_ROM); + } + } + + //void Mapper189::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if ((addr & 0xFF00) == 0x4100) + { + // Street Fighter 2 YOKO + SetPROM_32K_Bank((data & 0x30) >> 4); + } + else if ((addr & 0xFF00) == 0x6100) + { + // Master Fighter 2 + SetPROM_32K_Bank(data & 0x03); + } + + if (patch != 0) + { + // Street Fighter IV (GOUDER) + BYTE[] a5000xordat = new byte[256]{ + 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x49, 0x19, 0x09, 0x59, 0x49, 0x19, 0x09, + 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x51, 0x41, 0x11, 0x01, 0x51, 0x41, 0x11, 0x01, + 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x49, 0x19, 0x09, 0x59, 0x49, 0x19, 0x09, + 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x51, 0x41, 0x11, 0x01, 0x51, 0x41, 0x11, 0x01, + 0x00, 0x10, 0x40, 0x50, 0x00, 0x10, 0x40, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x18, 0x48, 0x58, 0x08, 0x18, 0x48, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x40, 0x50, 0x00, 0x10, 0x40, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x18, 0x48, 0x58, 0x08, 0x18, 0x48, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x58, 0x48, 0x18, 0x08, 0x58, 0x48, 0x18, 0x08, + 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x50, 0x40, 0x10, 0x00, 0x50, 0x40, 0x10, 0x00, + 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x58, 0x48, 0x18, 0x08, 0x58, 0x48, 0x18, 0x08, + 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x50, 0x40, 0x10, 0x00, 0x50, 0x40, 0x10, 0x00, + 0x01, 0x11, 0x41, 0x51, 0x01, 0x11, 0x41, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x09, 0x19, 0x49, 0x59, 0x09, 0x19, 0x49, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x11, 0x41, 0x51, 0x01, 0x11, 0x41, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x09, 0x19, 0x49, 0x59, 0x09, 0x19, 0x49, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + if ((addr >= 0x4800) && (addr <= 0x4FFF)) + { + SetPROM_32K_Bank(((data & 0x10) >> 3) + (data & 0x1)); + + if (!nes.rom.Is4SCREEN()) + { + if ((data & 0x20) != 0) + SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + } + if ((addr >= 0x5000) && (addr <= 0x57FF)) + { + lwd = data; + } + if ((addr >= 0x5800) && (addr <= 0x5FFF)) + { + // XRAM[0x1000+(addr & 3)] = + // $5800 "JMP $xxxx" write + XRAM[0x1800 + (addr & 3)] = + protect_dat[addr & 3] = (byte)(data ^ a5000xordat[lwd]); + } + } + } + + //void Mapper189::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE001) + { + case 0x8000: + reg[0] = data; + SetBank_PPU(); + break; + + case 0x8001: + reg[1] = data; + SetBank_PPU(); + switch (reg[0] & 0x07) + { + case 0x00: + chr01 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x01: + chr23 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x02: + chr4 = data; + SetBank_PPU(); + break; + case 0x03: + chr5 = data; + SetBank_PPU(); + break; + case 0x04: + chr6 = data; + SetBank_PPU(); + break; + case 0x05: + chr7 = data; + SetBank_PPU(); + break; + } + break; + + case 0xA000: + if ((data & 0x01) != 0) + SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + break; + + case 0xC000: + irq_counter = data; + break; + case 0xC001: + irq_latch = data; + break; + case 0xE000: + irq_enable = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + irq_enable = 0xFF; + break; + } + } + + //void Mapper189::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable != 0) + { + if ((--irq_counter) == 0) + { + // if( !(irq_counter--) ) { + irq_counter = irq_latch; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + } + + void SetBank_PPU() + { + if (patch != 0) + { + SetVROM_8K_Bank(chr01, chr01 + 1, chr23, chr23 + 1, + chr4, chr5, chr6, chr7); + } + else + { + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x80) != 0) + { + SetVROM_8K_Bank(chr4, chr5, chr6, chr7, + chr01, chr01 + 1, chr23, chr23 + 1); + } + else + { + SetVROM_8K_Bank(chr01, chr01 + 1, chr23, chr23 + 1, + chr4, chr5, chr6, chr7); + } + } + else + { + if ((reg[0] & 0x80) != 0) + { + SetCRAM_1K_Bank(4, (chr01 + 0) & 0x07); + SetCRAM_1K_Bank(5, (chr01 + 1) & 0x07); + SetCRAM_1K_Bank(6, (chr23 + 0) & 0x07); + SetCRAM_1K_Bank(7, (chr23 + 1) & 0x07); + SetCRAM_1K_Bank(0, chr4 & 0x07); + SetCRAM_1K_Bank(1, chr5 & 0x07); + SetCRAM_1K_Bank(2, chr6 & 0x07); + SetCRAM_1K_Bank(3, chr7 & 0x07); + } + else + { + SetCRAM_1K_Bank(0, (chr01 + 0) & 0x07); + SetCRAM_1K_Bank(1, (chr01 + 1) & 0x07); + SetCRAM_1K_Bank(2, (chr23 + 0) & 0x07); + SetCRAM_1K_Bank(3, (chr23 + 1) & 0x07); + SetCRAM_1K_Bank(4, chr4 & 0x07); + SetCRAM_1K_Bank(5, chr5 & 0x07); + SetCRAM_1K_Bank(6, chr6 & 0x07); + SetCRAM_1K_Bank(7, chr7 & 0x07); + } + } + } + } + + //void Mapper189::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg[0]; + p[1] = reg[1]; + p[2] = chr01; + p[3] = chr23; + p[4] = chr4; + p[5] = chr5; + p[6] = chr6; + p[7] = chr7; + p[8] = irq_enable; + p[9] = irq_counter; + p[10] = irq_latch; + + p[16] = protect_dat[0]; + p[17] = protect_dat[1]; + p[18] = protect_dat[2]; + p[19] = protect_dat[3]; + p[20] = lwd; + } + + //void Mapper189::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg[0] = p[0]; + reg[1] = p[1]; + chr01 = p[2]; + chr23 = p[3]; + chr4 = p[4]; + chr5 = p[5]; + chr6 = p[6]; + chr7 = p[7]; + + irq_enable = p[8]; + irq_counter = p[9]; + irq_latch = p[10]; + + protect_dat[0] = p[16]; + protect_dat[1] = p[17]; + protect_dat[2] = p[18]; + protect_dat[3] = p[19]; + lwd = p[20]; + } + + public override bool IsStateSave() + { + return true; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper189.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper189.cs.meta new file mode 100644 index 0000000..e131e1e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper189.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6cbb30a02157e92478f51fb4b8ec13e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper190.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper190.cs new file mode 100644 index 0000000..25b7899 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper190.cs @@ -0,0 +1,317 @@ +////////////////////////////////////////////////////////////// +// Mapper190 Nintendo MMC3 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper190 : Mapper + { + BYTE cbase; /* PowerOn OR RESET : cbase=0 */ + BYTE mp190_lcchk; /* PowerOn OR RESET */ + BYTE mp190_lcmd; + BYTE mp190_cmd; + + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + BYTE lowoutdata; + public Mapper190(NES parent) : base(parent) + { + } + + public override void Reset() + + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + // DWORD crc = nes.rom.GetPROM_CRC(); + // if( crc == 0x6F3D187A ) { + // Temp_Buf=0; //Kof96 + // } else { + // Temp_Buf=1; //ST97 + // } + + irq_enable = 0; + irq_counter = 0; + cbase = 0; /* PowerOn OR RESET : cbase=0 */ + mp190_lcchk = 0; /* PowerOn OR RESET */ + mp190_lcmd = 1; + } + + //void Mapper190::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + /* For Initial Copy Protect check (KOF'96) */ + if (addr == 0x5000) + { + mp190_lcmd = data; + switch (data) + { + case 0xE0: + SetPROM_32K_Bank(0); + break; + case 0xEE: + SetPROM_32K_Bank(3); + break; + } + } + if ((addr == 0x5001) && (mp190_lcmd == 0x00)) + { + SetPROM_32K_Bank(7); + } + if (addr == 0x5080) + { + switch (data) + { + case 0x1: lowoutdata = 0x83; break; + case 0x2: lowoutdata = 0x42; break; + case 0x3: lowoutdata = 0x00; break; + } + } + CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + } + + //BYTE Mapper190::ReadLow(WORD addr) + public override byte ReadLow(ushort addr) + { + switch (addr) + { + case 0x5000: + return lowoutdata; + default: + return CPU_MEM_BANK[addr >> 13][addr & 0x1FFF]; + } + } + + //void Mapper190::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE003) + { + case 0x8000: + mp190_cmd = data; + if ((mp190_cmd & 0x80) != 0) + cbase = 1; + else + cbase = 0; + break; + case 0x8003: /* for Street Fighter Zero 2 '97 */ + mp190_lcchk = data; + switch (data) + { + case 0x28: + SetPROM_8K_Bank(4, 0x1F); + SetPROM_8K_Bank(5, 0x1F); + SetPROM_8K_Bank(6, 0x17); + SetPROM_8K_Bank(7, 0x1F); + break; + case 0x2A: + SetPROM_8K_Bank(4, 0x1F); + SetPROM_8K_Bank(5, 0x0F); + SetPROM_8K_Bank(6, 0x17); + SetPROM_8K_Bank(7, 0x1F); + break; + case 0x06: + SetPROM_8K_Bank(4, 0x1E); + SetPROM_8K_Bank(5, 0x1F); + SetPROM_8K_Bank(6, 0x1F); + SetPROM_8K_Bank(7, 0x1F); + break; + } + break; + case 0x8001: + if ((mp190_lcchk == 0x6) || (mp190_lcmd == 0x0)) + { + switch (mp190_cmd & 0x07) + { + case 0: + if (cbase == 0) + { + SetVROM_1K_Bank(0, data + 0x100); + SetVROM_1K_Bank(1, data + 0x101); + } + else + { + SetVROM_1K_Bank(4, data + 0x100); + SetVROM_1K_Bank(5, data + 0x101); + } + break; + case 1: + if (cbase == 0) + { + SetVROM_1K_Bank(2, data + 0x100); + SetVROM_1K_Bank(3, data + 0x101); + } + else + { + SetVROM_1K_Bank(6, data + 0x100); + SetVROM_1K_Bank(7, data + 0x101); + } + break; + case 2: + if (cbase == 0) + { + SetVROM_1K_Bank(4, data); + } + else + { + SetVROM_1K_Bank(0, data); + } + break; + case 3: + if (cbase == 0) + { + SetVROM_1K_Bank(5, data); + } + else + { + SetVROM_1K_Bank(1, data); + } + break; + case 4: + if (cbase == 0) + { + SetVROM_1K_Bank(6, data); + } + else + { + SetVROM_1K_Bank(2, data); + } + break; + case 5: + if (cbase == 0) + { + SetVROM_1K_Bank(7, data); + } + else + { + SetVROM_1K_Bank(3, data); + } + break; + case 6: + data = (byte)(data & ((PROM_8K_SIZE * 2) - 1)); + if ((mp190_lcmd & 0x40) != 0) + { + SetPROM_8K_Bank(6, data); + SetPROM_8K_Bank(4, (PROM_8K_SIZE - 1) * 2); + } + else + { + SetPROM_8K_Bank(4, data); + SetPROM_8K_Bank(6, (PROM_8K_SIZE - 1) * 2); + } + break; + case 7: + data = (byte)(data & ((PROM_8K_SIZE * 2) - 1)); + if ((mp190_lcmd & 0x40) != 0) + { + SetPROM_8K_Bank(5, data); + SetPROM_8K_Bank(4, (PROM_8K_SIZE - 1) * 2); + } + else + { + SetPROM_8K_Bank(5, data); + SetPROM_8K_Bank(6, (PROM_8K_SIZE - 1) * 2); + } + break; + } + } + break; + case 0xA000: + if ((data & 0x1) == 0x1) + SetVRAM_Mirror(VRAM_HMIRROR); + else + SetVRAM_Mirror(VRAM_VMIRROR); + break; + case 0xA001: + break; + case 0xC000: + irq_counter = (byte)(data - 1); + break; + case 0xC001: + irq_latch = (byte)(data - 1); + break; + case 0xC002: + irq_counter = data; + break; + case 0xC003: + irq_latch = data; + break; + case 0xE000: + irq_counter = irq_latch; + irq_enable = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + irq_enable = 1; + break; + case 0xE002: + irq_counter = irq_latch; + irq_enable = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE003: + irq_enable = 1; + irq_counter = irq_counter; + break; + } + } + + //void Mapper190::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable != 0) + { + if ((irq_counter--) == 0) + { + // nes.cpu.IRQ_NotPending(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + } + + //void Mapper190::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = irq_enable; + p[1] = irq_counter; + p[2] = irq_latch; + + p[3] = cbase; + p[4] = mp190_lcchk; + p[5] = mp190_lcmd; + p[6] = mp190_cmd; + p[7] = lowoutdata; + } + + //void Mapper190::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + irq_enable = p[0]; + irq_counter = p[1]; + irq_latch = p[2]; + + cbase = p[3]; + mp190_lcchk = p[4]; + mp190_lcmd = p[5]; + mp190_cmd = p[6]; + lowoutdata = p[7]; + } + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper190.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper190.cs.meta new file mode 100644 index 0000000..55dcc61 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper190.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1bdbb26f8b8de51448a9703b2a9b5884 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper191.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper191.cs new file mode 100644 index 0000000..e319392 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper191.cs @@ -0,0 +1,138 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper191 SACHEN Super Cartridge Xin1 (Ver.1-9) // +// SACHEN Q-BOY Support // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper191 : Mapper + { + BYTE[] reg = new BYTE[8]; + BYTE prg0, prg1; + BYTE chr0, chr1, chr2, chr3; + BYTE highbank; + public Mapper191(NES parent) : base(parent) + { + } + + public override void Reset() + + { + for (INT i = 0; i < 8; i++) + { + reg[i] = 0x00; + } + + prg0 = 0; + // prg1 = 1; + SetBank_CPU(); + + chr0 = 0; + chr1 = 0; + chr2 = 0; + chr3 = 0; + highbank = 0; + SetBank_PPU(); + } + + //void Mapper191::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + switch (addr) + { + case 0x4100: + reg[0] = data; + break; + case 0x4101: + reg[1] = data; + switch (reg[0]) + { + case 0: + chr0 = (byte)(data & 7); + SetBank_PPU(); + break; + case 1: + chr1 = (byte)(data & 7); + SetBank_PPU(); + break; + case 2: + chr2 = (byte)(data & 7); + SetBank_PPU(); + break; + case 3: + chr3 = (byte)(data & 7); + SetBank_PPU(); + break; + case 4: + highbank = (byte)(data & 7); + SetBank_PPU(); + break; + case 5: + prg0 = (byte)(data & 7); + SetBank_CPU(); + break; + case 7: + if ((data & 0x02) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + break; + } + break; + } + } + + void SetBank_CPU() + { + SetPROM_32K_Bank(prg0); + } + + void SetBank_PPU() + { + if (VROM_1K_SIZE != 0) + { + SetVROM_1K_Bank(0, (((highbank << 3) + chr0) << 2) + 0); + SetVROM_1K_Bank(1, (((highbank << 3) + chr0) << 2) + 1); + SetVROM_1K_Bank(2, (((highbank << 3) + chr1) << 2) + 2); + SetVROM_1K_Bank(3, (((highbank << 3) + chr1) << 2) + 3); + SetVROM_1K_Bank(4, (((highbank << 3) + chr2) << 2) + 0); + SetVROM_1K_Bank(5, (((highbank << 3) + chr2) << 2) + 1); + SetVROM_1K_Bank(6, (((highbank << 3) + chr3) << 2) + 2); + SetVROM_1K_Bank(7, (((highbank << 3) + chr3) << 2) + 3); + } + } + + public override bool IsStateSave() + { + return true; + } + + + + //void Mapper191::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = prg0; + p[1] = chr0; + p[2] = chr1; + p[3] = chr2; + p[4] = chr3; + p[5] = highbank; + } + + //void Mapper191::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + prg0 = p[0]; + chr0 = p[1]; + chr1 = p[2]; + chr2 = p[3]; + chr3 = p[4]; + highbank = p[5]; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper191.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper191.cs.meta new file mode 100644 index 0000000..9d5caf4 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper191.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ae81a8958c1eb3f46a960c6319412523 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper192.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper192.cs new file mode 100644 index 0000000..2bf2046 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper192.cs @@ -0,0 +1,324 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper192 WaiXingTypeC Base ON Nintendo MMC3 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper192 : Mapper + { + BYTE[] reg = new byte[8]; + BYTE prg0, prg1; + BYTE chr01, chr23, chr4, chr5, chr6, chr7; + BYTE we_sram; + + BYTE irq_type; + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + BYTE irq_request; + public Mapper192(NES parent) : base(parent) + { + } + + public override void Reset() + { + for (byte i = 0; i < 8; i++) + { + reg[i] = 0x00; + } + prg0 = 0; + prg1 = 1; + SetBank_CPU(); + + chr01 = 0; + chr23 = 2; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + SetBank_PPU(); + + we_sram = 0; // Disable + irq_enable = 0; // Disable + irq_counter = 0; + irq_latch = 0; + irq_request = 0; + } + + + //BYTE Mapper192::ReadLow(WORD addr) + public override byte ReadLow(ushort addr) + { + if (addr >= 0x5000 && addr <= 0x5FFF) + { + return XRAM[addr - 0x4000]; + } + else + { + return base.ReadLow(addr); + } + } + + //void Mapper192::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr >= 0x5000 && addr <= 0x5FFF) + { + XRAM[addr - 0x4000] = data; + } + else + { + base.WriteLow(addr, data); + } + } + + //void Mapper192::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + //DEBUGOUT( "MPRWR A=%04X D=%02X L=%3d CYC=%d\n", addr&0xFFFF, data&0xFF, nes.GetScanline(), nes.cpu.GetTotalCycles() ); + + switch (addr & 0xE001) + { + case 0x8000: + reg[0] = data; + SetBank_CPU(); + SetBank_PPU(); + break; + case 0x8001: + reg[1] = data; + + switch (reg[0] & 0x07) + { + case 0x00: + chr01 = data; + SetBank_PPU(); + break; + case 0x01: + chr23 = data; + SetBank_PPU(); + break; + case 0x02: + chr4 = data; + SetBank_PPU(); + break; + case 0x03: + chr5 = data; + SetBank_PPU(); + break; + case 0x04: + chr6 = data; + SetBank_PPU(); + break; + case 0x05: + chr7 = data; + SetBank_PPU(); + break; + case 0x06: + prg0 = data; + SetBank_CPU(); + break; + case 0x07: + prg1 = data; + SetBank_CPU(); + break; + } + break; + case 0xA000: + reg[2] = data; + if (!nes.rom.Is4SCREEN()) + { + if ((data & 0x01)!=0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + break; + case 0xA001: + reg[3] = data; + break; + case 0xC000: + reg[4] = data; + irq_counter = data; + irq_request = 0; + break; + case 0xC001: + reg[5] = data; + irq_latch = data; + irq_request = 0; + break; + case 0xE000: + reg[6] = data; + irq_enable = 0; + irq_request = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + reg[7] = data; + irq_enable = 1; + irq_request = 0; + break; + } + + } + + //void Mapper192::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable!=0 && irq_request == 0) + { + if (scanline == 0) + { + if (irq_counter!=0) + { + irq_counter--; + } + } + if ((irq_counter--)==0) + { + irq_request = 0xFF; + irq_counter = irq_latch; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + } + + void SetBank_CPU() + { + if ((reg[0] & 0x40) != 0) + { + SetPROM_32K_Bank(PROM_8K_SIZE - 2, prg1, prg0, PROM_8K_SIZE - 1); + } + else + { + SetPROM_32K_Bank(prg0, prg1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + } + + void SetBank_PPU() + { + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x80) != 0) + { + // SetVROM_8K_Bank( chr4, chr5, chr6, chr7, + // chr01, chr01+1, chr23, chr23+1 ); + SetBank_PPUSUB(4, chr01 + 0); + SetBank_PPUSUB(5, chr01 + 1); + SetBank_PPUSUB(6, chr23 + 0); + SetBank_PPUSUB(7, chr23 + 1); + SetBank_PPUSUB(0, chr4); + SetBank_PPUSUB(1, chr5); + SetBank_PPUSUB(2, chr6); + SetBank_PPUSUB(3, chr7); + } + else + { + // SetVROM_8K_Bank( chr01, chr01+1, chr23, chr23+1, + // chr4, chr5, chr6, chr7 ); + SetBank_PPUSUB(0, chr01 + 0); + SetBank_PPUSUB(1, chr01 + 1); + SetBank_PPUSUB(2, chr23 + 0); + SetBank_PPUSUB(3, chr23 + 1); + SetBank_PPUSUB(4, chr4); + SetBank_PPUSUB(5, chr5); + SetBank_PPUSUB(6, chr6); + SetBank_PPUSUB(7, chr7); + } + } + else + { + if ((reg[0] & 0x80) != 0) + { + SetCRAM_1K_Bank(4, (chr01 + 0)); + SetCRAM_1K_Bank(5, (chr01 + 1)); + SetCRAM_1K_Bank(6, (chr23 + 0)); + SetCRAM_1K_Bank(7, (chr23 + 1)); + SetCRAM_1K_Bank(0, chr4); + SetCRAM_1K_Bank(1, chr5); + SetCRAM_1K_Bank(2, chr6); + SetCRAM_1K_Bank(3, chr7); + } + else + { + SetCRAM_1K_Bank(0, (chr01 + 0)); + SetCRAM_1K_Bank(1, (chr01 + 1)); + SetCRAM_1K_Bank(2, (chr23 + 0)); + SetCRAM_1K_Bank(3, (chr23 + 1)); + SetCRAM_1K_Bank(4, chr4); + SetCRAM_1K_Bank(5, chr5); + SetCRAM_1K_Bank(6, chr6); + SetCRAM_1K_Bank(7, chr7); + } + } + } + + void SetBank_PPUSUB(int bank, int page) + { + if ((page & 0xFC) == 0x08) + { + SetCRAM_1K_Bank((byte)bank, page); + } + else + { + SetVROM_1K_Bank((byte)bank, page); + } + } + + //void Mapper192::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + for (byte i = 0; i < 8; i++) + { + p[i] = reg[i]; + } + p[8] = prg0; + p[9] = prg1; + p[10] = chr01; + p[11] = chr23; + p[12] = chr4; + p[13] = chr5; + p[14] = chr6; + p[15] = chr7; + p[16] = irq_enable; + p[17] = irq_counter; + p[18] = irq_latch; + p[19] = irq_request; + } + + //void Mapper192::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + for (byte i = 0; i < 8; i++) + { + reg[i] = p[i]; + } + prg0 = p[8]; + prg1 = p[9]; + chr01 = p[10]; + chr23 = p[11]; + chr4 = p[12]; + chr5 = p[13]; + chr6 = p[14]; + chr7 = p[15]; + irq_enable = p[16]; + irq_counter = p[17]; + irq_latch = p[18]; + irq_request = p[19]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper192.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper192.cs.meta new file mode 100644 index 0000000..70839d4 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper192.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ebb5af01672a4364ab26bd0ce4543f07 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper193.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper193.cs new file mode 100644 index 0000000..dbe695b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper193.cs @@ -0,0 +1,49 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper193 MEGA SOFT (NTDEC) : Fighting Hero // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; + +namespace VirtualNes.Core +{ + public class Mapper193 : Mapper + { + public Mapper193(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(PROM_32K_SIZE - 1); + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper193::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + switch (addr) + { + case 0x6000: + SetVROM_2K_Bank(0, ((data >> 1) & 0x7e) + 0); + SetVROM_2K_Bank(2, ((data >> 1) & 0x7e) + 1); + break; + case 0x6001: + SetVROM_2K_Bank(4, data >> 1); + break; + case 0x6002: + SetVROM_2K_Bank(6, data >> 1); + break; + case 0x6003: + SetPROM_32K_Bank(data); + break; + } + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper193.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper193.cs.meta new file mode 100644 index 0000000..4014115 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper193.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e56eadb9647b3b74a9267fbb5fea29d6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper194.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper194.cs new file mode 100644 index 0000000..3d1e7dc --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper194.cs @@ -0,0 +1,31 @@ +//////////////////////////////////////////// +// Mapper194 迷宮寺院ダババ // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper194 : Mapper + { + public Mapper194(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(PROM_32K_SIZE - 1); + } + + //void Mapper194::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + SetPROM_8K_Bank(3, data); + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper194.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper194.cs.meta new file mode 100644 index 0000000..94c2bf3 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper194.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5ac8a64a71bbbfd4db4a4dca1f57883d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper195.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper195.cs new file mode 100644 index 0000000..5382d22 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper195.cs @@ -0,0 +1,324 @@ +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper195 : Mapper + { + + BYTE[] reg = new BYTE[8]; + BYTE prg0, prg1; + BYTE chr01, chr23, chr4, chr5, chr6, chr7; + BYTE we_sram; + + BYTE irq_type; + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + BYTE irq_request; + public Mapper195(NES parent) : base(parent) + { + } + + public override void Reset() + { + for (INT i = 0; i < 8; i++) + { + reg[i] = 0x00; + } + prg0 = 0; + prg1 = 1; + SetBank_CPU(); + + chr01 = 0; + chr23 = 2; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + SetBank_PPU(); + + we_sram = 0; // Disable + irq_enable = 0; // Disable + irq_counter = 0; + irq_latch = 0; + irq_request = 0; + } + + + //BYTE Mapper195::ReadLow(WORD addr) + public override byte ReadLow(ushort addr) + { + if (addr >= 0x5000 && addr <= 0x5FFF) + { + return XRAM[addr - 0x4000]; + } + else + { + return base.ReadLow(addr); + } + } + + //void Mapper195::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr >= 0x5000 && addr <= 0x5FFF) + { + XRAM[addr - 0x4000] = data; + } + else + { + base.WriteLow(addr, data); + } + } + + //void Mapper195::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + //DEBUGOUT( "MPRWR A=%04X D=%02X L=%3d CYC=%d\n", addr&0xFFFF, data&0xFF, nes.GetScanline(), nes.cpu.GetTotalCycles() ); + + switch (addr & 0xE001) + { + case 0x8000: + reg[0] = data; + SetBank_CPU(); + SetBank_PPU(); + break; + case 0x8001: + reg[1] = data; + + switch (reg[0] & 0x07) + { + case 0x00: + chr01 = data; + SetBank_PPU(); + break; + case 0x01: + chr23 = data; + SetBank_PPU(); + break; + case 0x02: + chr4 = data; + SetBank_PPU(); + break; + case 0x03: + chr5 = data; + SetBank_PPU(); + break; + case 0x04: + chr6 = data; + SetBank_PPU(); + break; + case 0x05: + chr7 = data; + SetBank_PPU(); + break; + case 0x06: + prg0 = data; + SetBank_CPU(); + break; + case 0x07: + prg1 = data; + SetBank_CPU(); + break; + } + break; + case 0xA000: + reg[2] = data; + if (!nes.rom.Is4SCREEN()) + { + if (data == 0) SetVRAM_Mirror(VRAM_VMIRROR); + else if (data == 1) SetVRAM_Mirror(VRAM_HMIRROR); + else if (data == 2) SetVRAM_Mirror(VRAM_MIRROR4L); + else SetVRAM_Mirror(VRAM_MIRROR4H); + } + break; + case 0xA001: + reg[3] = data; + break; + case 0xC000: + reg[4] = data; + irq_counter = data; + irq_request = 0; + break; + case 0xC001: + reg[5] = data; + irq_latch = data; + irq_request = 0; + break; + case 0xE000: + reg[6] = data; + irq_enable = 0; + irq_request = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + reg[7] = data; + irq_enable = 1; + irq_request = 0; + break; + } + + } + + //void Mapper195::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable != 0 && irq_request == 0) + { + if (scanline == 0) + { + if (irq_counter != 0) + { + irq_counter--; + } + } + if ((irq_counter--) == 0) + { + irq_request = 0xFF; + irq_counter = irq_latch; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + } + + void SetBank_CPU() + { + if ((reg[0] & 0x40) != 0) + { + SetPROM_32K_Bank(PROM_8K_SIZE - 2, prg1, prg0, PROM_8K_SIZE - 1); + } + else + { + SetPROM_32K_Bank(prg0, prg1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + } + + void SetBank_PPU() + { + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x80) != 0) + { + // SetVROM_8K_Bank( chr4, chr5, chr6, chr7, + // chr01, chr01+1, chr23, chr23+1 ); + SetBank_PPUSUB(4, chr01 + 0); + SetBank_PPUSUB(5, chr01 + 1); + SetBank_PPUSUB(6, chr23 + 0); + SetBank_PPUSUB(7, chr23 + 1); + SetBank_PPUSUB(0, chr4); + SetBank_PPUSUB(1, chr5); + SetBank_PPUSUB(2, chr6); + SetBank_PPUSUB(3, chr7); + } + else + { + // SetVROM_8K_Bank( chr01, chr01+1, chr23, chr23+1, + // chr4, chr5, chr6, chr7 ); + SetBank_PPUSUB(0, chr01 + 0); + SetBank_PPUSUB(1, chr01 + 1); + SetBank_PPUSUB(2, chr23 + 0); + SetBank_PPUSUB(3, chr23 + 1); + SetBank_PPUSUB(4, chr4); + SetBank_PPUSUB(5, chr5); + SetBank_PPUSUB(6, chr6); + SetBank_PPUSUB(7, chr7); + } + } + else + { + if ((reg[0] & 0x80) != 0) + { + SetCRAM_1K_Bank(4, (chr01 + 0)); + SetCRAM_1K_Bank(5, (chr01 + 1)); + SetCRAM_1K_Bank(6, (chr23 + 0)); + SetCRAM_1K_Bank(7, (chr23 + 1)); + SetCRAM_1K_Bank(0, chr4); + SetCRAM_1K_Bank(1, chr5); + SetCRAM_1K_Bank(2, chr6); + SetCRAM_1K_Bank(3, chr7); + } + else + { + SetCRAM_1K_Bank(0, (chr01 + 0)); + SetCRAM_1K_Bank(1, (chr01 + 1)); + SetCRAM_1K_Bank(2, (chr23 + 0)); + SetCRAM_1K_Bank(3, (chr23 + 1)); + SetCRAM_1K_Bank(4, chr4); + SetCRAM_1K_Bank(5, chr5); + SetCRAM_1K_Bank(6, chr6); + SetCRAM_1K_Bank(7, chr7); + } + } + } + + void SetBank_PPUSUB(int bank, int page) + { + if (page <= 3) + { + SetCRAM_1K_Bank((byte)bank, page); + } + else + { + SetVROM_1K_Bank((byte)bank, page); + } + } + + //void Mapper195::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + for (byte i = 0; i < 8; i++) + { + p[i] = reg[i]; + } + p[8] = prg0; + p[9] = prg1; + p[10] = chr01; + p[11] = chr23; + p[12] = chr4; + p[13] = chr5; + p[14] = chr6; + p[15] = chr7; + p[16] = irq_enable; + p[17] = irq_counter; + p[18] = irq_latch; + p[19] = irq_request; + } + + //void Mapper195::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + for (byte i = 0; i < 8; i++) + { + reg[i] = p[i]; + } + prg0 = p[8]; + prg1 = p[9]; + chr01 = p[10]; + chr23 = p[11]; + chr4 = p[12]; + chr5 = p[13]; + chr6 = p[14]; + chr7 = p[15]; + irq_enable = p[16]; + irq_counter = p[17]; + irq_latch = p[18]; + irq_request = p[19]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper195.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper195.cs.meta new file mode 100644 index 0000000..c8d1cb8 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper195.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9eac30ce838ece940b11ae5d5e5d6cfb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper198.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper198.cs new file mode 100644 index 0000000..e9a2116 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper198.cs @@ -0,0 +1,207 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper198 Nintendo MMC3 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; + +namespace VirtualNes.Core +{ + public class Mapper198 : Mapper + { + BYTE[] reg = new byte[8]; + BYTE prg0, prg1; + BYTE chr01, chr23, chr4, chr5, chr6, chr7; + + BYTE[] adr5000buf = new BYTE[1024 * 4]; + public Mapper198(NES parent) : base(parent) + { + } + + public override void Reset() + + { + for (INT i = 0; i < 8; i++) + { + reg[i] = 0x00; + } + + prg0 = 0; + prg1 = 1; + SetBank_CPU(); + + chr01 = 0; + chr23 = 2; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + SetBank_PPU(); + } + + //void Mapper198::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr > 0x4018 && addr < 0x6000) + CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + else + adr5000buf[addr & 0xFFF] = data; + } + //BYTE Mapper198::ReadLow(WORD addr) + public override byte ReadLow(ushort addr) + { + if (addr > 0x4018 && addr < 0x6000) + return CPU_MEM_BANK[addr >> 13][addr & 0x1FFF]; + else + return adr5000buf[addr & 0xFFF]; + } + + //void Mapper198::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE001) + { + case 0x8000: + reg[0] = data; + SetBank_CPU(); + SetBank_PPU(); + break; + case 0x8001: + reg[1] = data; + + switch (reg[0] & 0x07) + { + case 0x00: + chr01 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x01: + chr23 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x02: + chr4 = data; + SetBank_PPU(); + break; + case 0x03: + chr5 = data; + SetBank_PPU(); + break; + case 0x04: + chr6 = data; + SetBank_PPU(); + break; + case 0x05: + chr7 = data; + SetBank_PPU(); + break; + case 0x06: + if (data >= 0x50) data &= 0x4F; + prg0 = data; + SetBank_CPU(); + break; + case 0x07: + prg1 = data; + SetBank_CPU(); + break; + } + break; + case 0xA000: + reg[2] = data; + if (!nes.rom.Is4SCREEN()) + { + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + break; + case 0xA001: + reg[3] = data; + break; + case 0xC000: + reg[4] = data; + break; + case 0xC001: + reg[5] = data; + break; + case 0xE000: + reg[6] = data; + break; + case 0xE001: + reg[7] = data; + break; + } + } + + void SetBank_CPU() + { + if ((reg[0] & 0x40) != 0) + { + SetPROM_32K_Bank(PROM_8K_SIZE - 2, prg1, prg0, PROM_8K_SIZE - 1); + } + else + { + SetPROM_32K_Bank(prg0, prg1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + } + + void SetBank_PPU() + { + + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x80) != 0) + { + SetVROM_8K_Bank(chr4, chr5, chr6, chr7, + chr01, chr01 + 1, chr23, chr23 + 1); + } + else + { + SetVROM_8K_Bank(chr01, chr01 + 1, chr23, chr23 + 1, + chr4, chr5, chr6, chr7); + } + } + } + + //void Mapper198::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + for (INT i = 0; i < 8; i++) + { + p[i] = reg[i]; + } + p[8] = prg0; + p[9] = prg1; + p[10] = chr01; + p[11] = chr23; + p[12] = chr4; + p[13] = chr5; + p[14] = chr6; + p[15] = chr7; + } + + //void Mapper198::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + for (INT i = 0; i < 8; i++) + { + reg[i] = p[i]; + } + prg0 = p[8]; + prg1 = p[9]; + chr01 = p[10]; + chr23 = p[11]; + chr4 = p[12]; + chr5 = p[13]; + chr6 = p[14]; + chr7 = p[15]; + } + + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper198.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper198.cs.meta new file mode 100644 index 0000000..91ae360 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper198.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f6c148d721a4eed4599b4c4e535f9f21 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper199.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper199.cs new file mode 100644 index 0000000..76e317e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper199.cs @@ -0,0 +1,318 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper199 WaiXingTypeG Base ON Nintendo MMC3 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper199 : Mapper + { + BYTE[] reg = new byte[8]; + BYTE[] prg = new byte[4]; + BYTE[] chr = new byte[8]; + BYTE we_sram; + + BYTE JMaddr; + BYTE[] JMaddrDAT = new BYTE[3]; + + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + BYTE irq_request; + + public Mapper199(NES parent) : base(parent) + { + } + + public override void Reset() + { + for (byte i = 0; i < 8; i++) + { + reg[i] = 0x00; + chr[i] = i; + } + prg[0] = 0x00; + prg[1] = 0x01; + prg[2] = (byte)(PROM_8K_SIZE - 2); + prg[3] = (byte)(PROM_8K_SIZE - 1); + SetBank_CPU(); + SetBank_PPU(); + + irq_enable = irq_counter = irq_latch = irq_request = 0; + + JMaddr = 0; + JMaddrDAT[0] = JMaddrDAT[1] = JMaddrDAT[2] = 0; + + we_sram = 0; + nes.SetSAVERAM_SIZE(32 * 1024); + nes.SetVideoMode(true); + } + + + //BYTE Mapper199::ReadLow(WORD addr) + public override byte ReadLow(ushort addr) + { + if (addr >= 0x5000 && addr <= 0x5FFF) + { + return XRAM[addr - 0x4000]; + } + else if (addr >= 0x6000 && addr <= 0x7FFF) + { + if (JMaddr != 0) + { + switch (addr) + { + case 0x6000: return JMaddrDAT[0]; + case 0x6010: return JMaddrDAT[1]; + case 0x6013: JMaddr = 0; return JMaddrDAT[2]; + } + } + + switch (we_sram) + { + case 0xE4: + case 0xEC: return WRAM[(addr & 0x1FFF) + 0x0000]; + case 0xE5: + case 0xED: return WRAM[(addr & 0x1FFF) + 0x2000]; + case 0xE6: + case 0xEE: return WRAM[(addr & 0x1FFF) + 0x4000]; + case 0xE7: + case 0xEF: return WRAM[(addr & 0x1FFF) + 0x6000]; + default: return CPU_MEM_BANK[addr >> 13][addr & 0x1FFF]; + } + + } + else + { + return base.ReadLow(addr); + } + } + + //void Mapper199::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr >= 0x5000 && addr <= 0x5FFF) + { + XRAM[addr - 0x4000] = data; + if ((we_sram == 0xA1) || (we_sram == 0xA5) || (we_sram == 0xA9)) + { + JMaddr = 1; + switch (addr) + { + case 0x5000: JMaddrDAT[0] = data; break; + case 0x5010: JMaddrDAT[1] = data; break; + case 0x5013: JMaddrDAT[2] = data; break; + } + } + } + else if (addr >= 0x6000 && addr <= 0x7FFF) + { + + switch (we_sram) + { + case 0xE4: //CPU_MEM_BANK + case 0xEC: //CPU_MEM_BANK + WRAM[(addr & 0x1FFF) + 0x0000] = data; + CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + break; + case 0xE5: //SRAM + case 0xED: //SRAM + WRAM[(addr & 0x1FFF) + 0x2000] = data; + break; + case 0xE6: + case 0xEE: + WRAM[(addr & 0x1FFF) + 0x4000] = data; + break; + case 0xE7: + case 0xEF: + WRAM[(addr & 0x1FFF) + 0x6000] = data; + break; + default: + CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + break; + } + + } + else + { + base.WriteLow(addr, data); + } + } + + //void Mapper199::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE001) + { + case 0x8000: + reg[0] = data; + SetBank_CPU(); + SetBank_PPU(); + break; + case 0x8001: + reg[1] = data; + switch (reg[0] & 0x0f) + { + case 0x00: chr[0] = data; SetBank_PPU(); break; + case 0x01: chr[2] = data; SetBank_PPU(); break; + case 0x02: + case 0x03: + case 0x04: + case 0x05: chr[(reg[0] & 0x07) + 2] = data; SetBank_PPU(); break; + case 0x06: + case 0x07: + case 0x08: + case 0x09: prg[(reg[0] & 0x0f) - 6] = data; SetBank_CPU(); break; + case 0x0A: chr[1] = data; SetBank_PPU(); break; + case 0x0B: chr[3] = data; SetBank_PPU(); break; + } + break; + case 0xA000: + reg[2] = data; + data &= 0x03; + if (data == 0) SetVRAM_Mirror(VRAM_VMIRROR); + else if (data == 1) SetVRAM_Mirror(VRAM_HMIRROR); + else if (data == 2) SetVRAM_Mirror(VRAM_MIRROR4L); + else SetVRAM_Mirror(VRAM_MIRROR4H); + break; + case 0xA001: + // DEBUGOUT( "MPRWR A=%04X D=%02X L=%3d CYC=%d\n", addr&0xFFFF, data&0xFF, nes->GetScanline(), nes->cpu->GetTotalCycles() ); + reg[3] = data; + we_sram = data; + break; + case 0xC000: + reg[4] = data; + irq_counter = data; + irq_request = 0; + break; + case 0xC001: + reg[5] = data; + irq_latch = data; + irq_request = 0; + break; + case 0xE000: + reg[6] = data; + irq_enable = 0; + irq_request = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + reg[7] = data; + irq_enable = 1; + irq_request = 0; + break; + } + + } + + //void Mapper199::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable != 0 && irq_request == 0) + { + if (scanline == 0) + { + if (irq_counter != 0) + { + irq_counter -= 1; + } + } + if (irq_counter == 0) + { + irq_request = 0xFF; + irq_counter = irq_latch; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + irq_counter--; + } + } + } + } + + void SetBank_CPU() + { + SetPROM_8K_Bank(4, prg[0 ^ (reg[0] >> 5 & ~(0 << 1) & 2)]); + SetPROM_8K_Bank(5, prg[1 ^ (reg[0] >> 5 & ~(1 << 1) & 2)]); + SetPROM_8K_Bank(6, prg[2 ^ (reg[0] >> 5 & ~(2 << 1) & 2)]); + SetPROM_8K_Bank(7, prg[3 ^ (reg[0] >> 5 & ~(3 << 1) & 2)]); + } + + void SetBank_PPU() + { + uint bank = (uint)((reg[0] & 0x80) >> 5); + for (int x = 0; x < 8; x++) + { + if (chr[x] <= 7) + SetCRAM_1K_Bank((byte)(x ^ bank), chr[x]); + else + SetVROM_1K_Bank((byte)(x ^ bank), chr[x]); + } + } + + //void Mapper199::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //for (INT i = 0; i < 8; i++) + //{ + // p[i] = reg[i]; + //} + //for (i = 8; i < 12; i++) + //{ + // p[i] = prg[i]; + //} + //for (i = 8; i < 20; i++) + //{ + // p[i] = chr[i]; + //} + //p[20] = we_sram; + //p[21] = JMaddr; + //p[22] = JMaddrDAT[0]; + //p[23] = JMaddrDAT[1]; + //p[24] = JMaddrDAT[2]; + //p[25] = irq_enable; + //p[26] = irq_counter; + //p[27] = irq_latch; + //p[28] = irq_request; + } + + //void Mapper199::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //for (INT i = 0; i < 8; i++) + //{ + // reg[i] = p[i]; + //} + //for (i = 8; i < 12; i++) + //{ + // prg[i] = p[i]; + //} + //for (i = 8; i < 20; i++) + //{ + // chr[i] = p[i]; + //} + //we_sram = p[20]; + //JMaddr = p[21]; + //JMaddrDAT[0] = p[22]; + //JMaddrDAT[1] = p[23]; + //JMaddrDAT[2] = p[24]; + //irq_enable = p[25]; + //irq_counter = p[26]; + //irq_latch = p[27]; + //irq_request = p[28]; + } + + public override bool IsStateSave() + { + return true; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper199.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper199.cs.meta new file mode 100644 index 0000000..7603c91 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper199.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ef80437f6f5f07b42882cf860f0b2de6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper200.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper200.cs new file mode 100644 index 0000000..ab0ceed --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper200.cs @@ -0,0 +1,48 @@ +////////////////////////////////////////////// +// Mapper200 1200-in-1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper200 : Mapper + { + public Mapper200(NES parent) : base(parent) + { + } + + public override void Reset() + { + // SetPROM_32K_Bank( 0, 1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); + SetPROM_16K_Bank(4, 0); + SetPROM_16K_Bank(6, 0); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper200::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + SetPROM_16K_Bank(4, addr & 0x07); + SetPROM_16K_Bank(6, addr & 0x07); + SetVROM_8K_Bank(addr & 0x07); + + if ((addr & 0x01) != 0) + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper200.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper200.cs.meta new file mode 100644 index 0000000..598e1e1 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper200.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b3d368691b1d7bb44967126b6082a921 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper201.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper201.cs new file mode 100644 index 0000000..23e677a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper201.cs @@ -0,0 +1,43 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper201 21-in-1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper201 : Mapper + { + public Mapper201(NES parent) : base(parent) + { + } + + public override void Reset() + { + // SetPROM_32K_Bank( 0, 1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 ); + SetPROM_16K_Bank(4, 0); + SetPROM_16K_Bank(6, 0); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper201::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + BYTE bank = (byte)((BYTE)addr & 0x03); + if (!((addr & 0x08) != 0)) + bank = 0; + SetPROM_32K_Bank(bank); + SetVROM_8K_Bank(bank); + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper201.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper201.cs.meta new file mode 100644 index 0000000..30a6ac6 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper201.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 03513dbd4c1b907409e89d56b227afee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper202.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper202.cs new file mode 100644 index 0000000..1a6b849 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper202.cs @@ -0,0 +1,77 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper202 150-in-1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper202 : Mapper + { + public Mapper202(NES parent) : base(parent) + { + } + + public override void Reset() + + { + SetPROM_16K_Bank(4, 6); + SetPROM_16K_Bank(6, 7); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper202::ExWrite(WORD addr, BYTE data) + public override void ExWrite(ushort addr, byte data) + { + if (addr >= 0x4020) + { + WriteSub(addr, data); + } + } + + //void Mapper202::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + WriteSub(addr, data); + } + + //void Mapper202::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + WriteSub(addr, data); + } + + void WriteSub(ushort addr, BYTE data) + { + INT bank = (addr >> 1) & 0x07; + + SetPROM_16K_Bank(4, bank); + if ((addr & 0x0C) == 0x0C) + { + SetPROM_16K_Bank(6, bank + 1); + } + else + { + SetPROM_16K_Bank(6, bank); + } + SetVROM_8K_Bank(bank); + + if ((addr & 0x01) != 0) + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper202.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper202.cs.meta new file mode 100644 index 0000000..c2d49b7 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper202.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 82ca6d213345fed4fa2be208d9a96fce +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper216.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper216.cs new file mode 100644 index 0000000..d027787 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper216.cs @@ -0,0 +1,33 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper216 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper216 : Mapper + { + public Mapper216(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetVROM_8K_Bank(0); + SetPROM_32K_Bank(0); + } + + //void Mapper216::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + SetVROM_8K_Bank((addr & 0x0E) >> 1); + SetPROM_32K_Bank(addr & 1); + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper216.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper216.cs.meta new file mode 100644 index 0000000..20844c2 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper216.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ad42621060166644b8a3d544df5dc2ae +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper222.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper222.cs new file mode 100644 index 0000000..9e14261 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper222.cs @@ -0,0 +1,70 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper222 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper222 : Mapper + { + public Mapper222(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + SetVRAM_Mirror(VRAM_VMIRROR); + } + + //void Mapper222::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xF003) + { + case 0x8000: + SetPROM_8K_Bank(4, data); + break; + case 0xA000: + SetPROM_8K_Bank(5, data); + break; + case 0xB000: + SetVROM_1K_Bank(0, data); + break; + case 0xB002: + SetVROM_1K_Bank(1, data); + break; + case 0xC000: + SetVROM_1K_Bank(2, data); + break; + case 0xC002: + SetVROM_1K_Bank(3, data); + break; + case 0xD000: + SetVROM_1K_Bank(4, data); + break; + case 0xD002: + SetVROM_1K_Bank(5, data); + break; + case 0xE000: + SetVROM_1K_Bank(6, data); + break; + case 0xE002: + SetVROM_1K_Bank(7, data); + break; + } + } + + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper222.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper222.cs.meta new file mode 100644 index 0000000..80ae54b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper222.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a3a7e4991a3ddae4cace8ed86de9fc46 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper225.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper225.cs new file mode 100644 index 0000000..71fd17b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper225.cs @@ -0,0 +1,82 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper225 72-in-1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper225 : Mapper + { + public Mapper225(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, 2, 3); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper225::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + BYTE prg_bank = (byte)((addr & 0x0F80) >> 7); + BYTE chr_bank = (byte)(addr & 0x003F); + + SetVROM_1K_Bank(0, (chr_bank * 8 + 0)); + SetVROM_1K_Bank(1, (chr_bank * 8 + 1)); + SetVROM_1K_Bank(2, (chr_bank * 8 + 2)); + SetVROM_1K_Bank(3, (chr_bank * 8 + 3)); + SetVROM_1K_Bank(4, (chr_bank * 8 + 4)); + SetVROM_1K_Bank(5, (chr_bank * 8 + 5)); + SetVROM_1K_Bank(6, (chr_bank * 8 + 6)); + SetVROM_1K_Bank(7, (chr_bank * 8 + 7)); + + if ((addr & 0x2000) != 0) + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + + if ((addr & 0x1000) != 0) + { + // 16KBbank + if ((addr & 0x0040) != 0) + { + SetPROM_8K_Bank(4, (prg_bank * 4 + 2)); + SetPROM_8K_Bank(5, (prg_bank * 4 + 3)); + SetPROM_8K_Bank(6, (prg_bank * 4 + 2)); + SetPROM_8K_Bank(7, (prg_bank * 4 + 3)); + } + else + { + SetPROM_8K_Bank(4, (prg_bank * 4 + 0)); + SetPROM_8K_Bank(5, (prg_bank * 4 + 1)); + SetPROM_8K_Bank(6, (prg_bank * 4 + 0)); + SetPROM_8K_Bank(7, (prg_bank * 4 + 1)); + } + } + else + { + SetPROM_8K_Bank(4, (prg_bank * 4 + 0)); + SetPROM_8K_Bank(5, (prg_bank * 4 + 1)); + SetPROM_8K_Bank(6, (prg_bank * 4 + 2)); + SetPROM_8K_Bank(7, (prg_bank * 4 + 3)); + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper225.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper225.cs.meta new file mode 100644 index 0000000..ddbbc30 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper225.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 01c358a2d8c225a4bb371969197e95ee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper226.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper226.cs new file mode 100644 index 0000000..977a874 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper226.cs @@ -0,0 +1,97 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper226 76-in-1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper226 : Mapper + { + BYTE[] reg = new byte[2]; + public Mapper226(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0); + + reg[0] = 0; + reg[1] = 0; + } + + //void Mapper226::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if ((addr & 0x001) != 0) + { + reg[1] = data; + } + else + { + reg[0] = data; + } + + if ((reg[0] & 0x40) != 0) + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + + BYTE bank = (byte)(((reg[0] & 0x1E) >> 1) | ((reg[0] & 0x80) >> 3) | ((reg[1] & 0x01) << 5)); + + if ((reg[0] & 0x20) != 0) + { + if ((reg[0] & 0x01) != 0) + { + SetPROM_8K_Bank(4, bank * 4 + 2); + SetPROM_8K_Bank(5, bank * 4 + 3); + SetPROM_8K_Bank(6, bank * 4 + 2); + SetPROM_8K_Bank(7, bank * 4 + 3); + } + else + { + SetPROM_8K_Bank(4, bank * 4 + 0); + SetPROM_8K_Bank(5, bank * 4 + 1); + SetPROM_8K_Bank(6, bank * 4 + 0); + SetPROM_8K_Bank(7, bank * 4 + 1); + } + } + else + { + SetPROM_8K_Bank(4, bank * 4 + 0); + SetPROM_8K_Bank(5, bank * 4 + 1); + SetPROM_8K_Bank(6, bank * 4 + 2); + SetPROM_8K_Bank(7, bank * 4 + 3); + } + } + + public override bool IsStateSave() + { + return true; + } + + //void Mapper226::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg[0]; + p[1] = reg[1]; + } + + //void Mapper226::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg[0] = p[0]; + reg[1] = p[1]; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper226.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper226.cs.meta new file mode 100644 index 0000000..760d445 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper226.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 195fc458164c6b444b120cf6c4fe9ee0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper227.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper227.cs new file mode 100644 index 0000000..ab97916 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper227.cs @@ -0,0 +1,74 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper227 1200-in-1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper227 : Mapper + { + public Mapper227(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, 0, 1); + } + + //void Mapper227::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + BYTE bank = (byte)(((addr & 0x0100) >> 4) | ((addr & 0x0078) >> 3)); + + if ((addr & 0x0001) != 0) + { + SetPROM_32K_Bank(bank); + } + else + { + if ((addr & 0x0004) != 0) + { + SetPROM_8K_Bank(4, bank * 4 + 2); + SetPROM_8K_Bank(5, bank * 4 + 3); + SetPROM_8K_Bank(6, bank * 4 + 2); + SetPROM_8K_Bank(7, bank * 4 + 3); + } + else + { + SetPROM_8K_Bank(4, bank * 4 + 0); + SetPROM_8K_Bank(5, bank * 4 + 1); + SetPROM_8K_Bank(6, bank * 4 + 0); + SetPROM_8K_Bank(7, bank * 4 + 1); + } + } + + if (!((addr & 0x0080) != 0)) + { + if ((addr & 0x0200) != 0) + { + SetPROM_8K_Bank(6, (bank & 0x1C) * 4 + 14); + SetPROM_8K_Bank(7, (bank & 0x1C) * 4 + 15); + } + else + { + SetPROM_8K_Bank(6, (bank & 0x1C) * 4 + 0); + SetPROM_8K_Bank(7, (bank & 0x1C) * 4 + 1); + } + } + if ((addr & 0x0002) != 0) + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper227.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper227.cs.meta new file mode 100644 index 0000000..0cf6cef --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper227.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e1131d8c69893f6438e3fe144cfb057b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper228.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper228.cs new file mode 100644 index 0000000..5b9bd72 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper228.cs @@ -0,0 +1,74 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper228 Action 52 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper228 : Mapper + { + public Mapper228(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0); + SetVROM_8K_Bank(0); + } + + //void Mapper228::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + BYTE prg = (byte)((addr & 0x0780) >> 7); + + switch ((addr & 0x1800) >> 11) + { + case 1: + prg |= 0x10; + break; + case 3: + prg |= 0x20; + break; + } + + if ((addr & 0x0020) != 0) + { + prg <<= 1; + if ((addr & 0x0040) != 0) + { + prg++; + } + SetPROM_8K_Bank(4, prg * 4 + 0); + SetPROM_8K_Bank(5, prg * 4 + 1); + SetPROM_8K_Bank(6, prg * 4 + 0); + SetPROM_8K_Bank(7, prg * 4 + 1); + } + else + { + SetPROM_8K_Bank(4, prg * 4 + 0); + SetPROM_8K_Bank(5, prg * 4 + 1); + SetPROM_8K_Bank(6, prg * 4 + 2); + SetPROM_8K_Bank(7, prg * 4 + 3); + } + + SetVROM_8K_Bank(((addr & 0x000F) << 2) | (data & 0x03)); + + if ((addr & 0x2000) != 0) + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper228.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper228.cs.meta new file mode 100644 index 0000000..6e8ccef --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper228.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cdc061b408113c241b22d6c641ce13be +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper229.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper229.cs new file mode 100644 index 0000000..874e5b8 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper229.cs @@ -0,0 +1,56 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper229 31-in-1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper229 : Mapper + { + public Mapper229(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0); + SetVROM_8K_Bank(0); + } + + //void Mapper229::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if ((addr & 0x001E) != 0) + { + BYTE prg = (byte)(addr & 0x001F); + + SetPROM_8K_Bank(4, prg * 2 + 0); + SetPROM_8K_Bank(5, prg * 2 + 1); + SetPROM_8K_Bank(6, prg * 2 + 0); + SetPROM_8K_Bank(7, prg * 2 + 1); + + SetVROM_8K_Bank(addr & 0x0FFF); + } + else + { + SetPROM_32K_Bank(0); + SetVROM_8K_Bank(0); + } + + if ((addr & 0x0020) != 0) + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper229.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper229.cs.meta new file mode 100644 index 0000000..a59c4e1 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper229.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 17a9f0d48f444e2429aec4d1d8f9db4d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper230.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper230.cs new file mode 100644 index 0000000..86fdb2f --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper230.cs @@ -0,0 +1,76 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper230 22-in-1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper230 : Mapper + { + BYTE rom_sw; + public Mapper230(NES parent) : base(parent) + { + } + + public override void Reset() + { + if (rom_sw != 0) + { + rom_sw = 0; + } + else + { + rom_sw = 1; + } + if (rom_sw != 0) + { + SetPROM_32K_Bank(0, 1, 14, 15); + } + else + { + SetPROM_32K_Bank(16, 17, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + } + + //void Mapper230::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if (rom_sw != 0) + { + SetPROM_8K_Bank(4, (data & 0x07) * 2 + 0); + SetPROM_8K_Bank(5, (data & 0x07) * 2 + 1); + } + else + { + if ((data & 0x20) != 0) + { + SetPROM_8K_Bank(4, (data & 0x1F) * 2 + 16); + SetPROM_8K_Bank(5, (data & 0x1F) * 2 + 17); + SetPROM_8K_Bank(6, (data & 0x1F) * 2 + 16); + SetPROM_8K_Bank(7, (data & 0x1F) * 2 + 17); + } + else + { + SetPROM_8K_Bank(4, (data & 0x1E) * 2 + 16); + SetPROM_8K_Bank(5, (data & 0x1E) * 2 + 17); + SetPROM_8K_Bank(6, (data & 0x1E) * 2 + 18); + SetPROM_8K_Bank(7, (data & 0x1E) * 2 + 19); + } + if ((data & 0x40) != 0) + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + } + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper230.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper230.cs.meta new file mode 100644 index 0000000..415a6ad --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper230.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2aa15f3ed12b3a44882d440dc597d6fa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper231.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper231.cs new file mode 100644 index 0000000..5c9771a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper231.cs @@ -0,0 +1,56 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper231 20-in-1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper231 : Mapper + { + public Mapper231(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper231::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if ((addr & 0x0020) != 0) + { + SetPROM_32K_Bank((BYTE)(addr >> 1)); + } + else + { + BYTE bank = (byte)(addr & 0x1E); + SetPROM_8K_Bank(4, bank * 2 + 0); + SetPROM_8K_Bank(5, bank * 2 + 1); + SetPROM_8K_Bank(6, bank * 2 + 0); + SetPROM_8K_Bank(7, bank * 2 + 1); + } + + if ((addr & 0x0080) != 0) + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper231.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper231.cs.meta new file mode 100644 index 0000000..cf17bb5 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper231.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4c7681ab70d7d884280e28147c311d35 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper232.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper232.cs new file mode 100644 index 0000000..adee4d6 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper232.cs @@ -0,0 +1,81 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper232 Quattro Games // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper232 : Mapper + { + BYTE[] reg = new byte[2]; + public Mapper232(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + reg[0] = 0x0C; + reg[1] = 0x00; + } + + //void Mapper232::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr >= 0x6000) + { + Write(addr, data); + } + } + + //void Mapper232::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + // if( addr == 0x9000 ) { + // reg[0] = (data & 0x18)>>1; + // } else if( addr >= 0xA000 && addr <= 0xFFFF ) { + // reg[1] = data & 0x03; + // } + if (addr <= 0x9FFF) + { + reg[0] = (byte)((data & 0x18) >> 1); + } + else + { + reg[1] = (byte)(data & 0x03); + } + + SetPROM_8K_Bank(4, (reg[0] | reg[1]) * 2 + 0); + SetPROM_8K_Bank(5, (reg[0] | reg[1]) * 2 + 1); + SetPROM_8K_Bank(6, (reg[0] | 0x03) * 2 + 0); + SetPROM_8K_Bank(7, (reg[0] | 0x03) * 2 + 1); + } + + public override bool IsStateSave() + { + return true; + } + + + + //void Mapper232::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg[0]; + p[1] = reg[1]; + } + + //void Mapper232::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg[0] = p[0]; + reg[1] = p[1]; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper232.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper232.cs.meta new file mode 100644 index 0000000..f5bc16a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper232.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fa6b23b030cd9524b974d522cd560855 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper233.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper233.cs new file mode 100644 index 0000000..9e6d7af --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper233.cs @@ -0,0 +1,62 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper233 42-in-1 // +//////////////////////////////////////////////////////////////////////////using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using static VirtualNes.MMU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; + +namespace VirtualNes.Core +{ + public class Mapper233 : Mapper + { + public Mapper233(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, 2, 3); + } + + //void Mapper233::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if ((data & 0x20) != 0) + { + SetPROM_8K_Bank(4, (data & 0x1F) * 2 + 0); + SetPROM_8K_Bank(5, (data & 0x1F) * 2 + 1); + SetPROM_8K_Bank(6, (data & 0x1F) * 2 + 0); + SetPROM_8K_Bank(7, (data & 0x1F) * 2 + 1); + } + else + { + BYTE bank = (byte)((data & 0x1E) >> 1); + + SetPROM_8K_Bank(4, bank * 4 + 0); + SetPROM_8K_Bank(5, bank * 4 + 1); + SetPROM_8K_Bank(6, bank * 4 + 2); + SetPROM_8K_Bank(7, bank * 4 + 3); + } + + if ((data & 0xC0) == 0x00) + { + SetVRAM_Mirror(0, 0, 0, 1); + } + else if ((data & 0xC0) == 0x40) + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + else if ((data & 0xC0) == 0x80) + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_MIRROR4H); + } + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper233.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper233.cs.meta new file mode 100644 index 0000000..d7026dc --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper233.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5600496657b06bc4a96f701cd3c7062b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper234.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper234.cs new file mode 100644 index 0000000..6b12005 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper234.cs @@ -0,0 +1,107 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper234 Maxi-15 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + + public class Mapper234 : Mapper + { + BYTE[] reg = new byte[2]; + public Mapper234(NES parent) : base(parent) + { + } + + public override void Reset() + + { + SetPROM_32K_Bank(0, 1, 2, 3); + + reg[0] = 0; + reg[1] = 0; + } + + //void Mapper234::Read(WORD addr, BYTE data) + public override void Read(ushort addr, byte data) + { + if (addr >= 0xFF80 && addr <= 0xFF9F) + { + if (reg[0] != 0) + { + reg[0] = data; + SetBank(); + } + } + + if (addr >= 0xFFE8 && addr <= 0xFFF7) + { + reg[1] = data; + SetBank(); + } + } + + //void Mapper234::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if (addr >= 0xFF80 && addr <= 0xFF9F) + { + if (reg[0] == 0) + { + reg[0] = data; + SetBank(); + } + } + + if (addr >= 0xFFE8 && addr <= 0xFFF7) + { + reg[1] = data; + SetBank(); + } + } + + void SetBank() + { + if ((reg[0] & 0x80) != 0) + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + if ((reg[0] & 0x40) != 0) + { + SetPROM_32K_Bank((reg[0] & 0x0E) | (reg[1] & 0x01)); + SetVROM_8K_Bank(((reg[0] & 0x0E) << 2) | ((reg[1] >> 4) & 0x07)); + } + else + { + SetPROM_32K_Bank(reg[0] & 0x0F); + SetVROM_8K_Bank(((reg[0] & 0x0F) << 2) | ((reg[1] >> 4) & 0x03)); + } + } + public override bool IsStateSave() + { + return true; + } + //void Mapper234::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = reg[0]; + p[1] = reg[1]; + } + + //void Mapper234::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + reg[0] = p[0]; + reg[1] = p[1]; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper234.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper234.cs.meta new file mode 100644 index 0000000..3714ace --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper234.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 935c2470f18c7864eb895d9684d545c4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper235.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper235.cs new file mode 100644 index 0000000..5dd06c6 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper235.cs @@ -0,0 +1,118 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper235 150-in-1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper235 : Mapper + { + public Mapper235(NES parent) : base(parent) + { + } + + public override void Reset() + { + for (INT i = 0; i < 0x2000; i++) + { + DRAM[i] = 0xFF; + } + + SetPROM_32K_Bank(0); + } + + //void Mapper235::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + { + BYTE prg = (byte)(((addr & 0x0300) >> 3) | (addr & 0x001F)); + BYTE bus = 0; + + if (PROM_8K_SIZE == 64 * 2) + { + // 100-in-1 + switch (addr & 0x0300) + { + case 0x0000: break; + case 0x0100: bus = 1; break; + case 0x0200: bus = 1; break; + case 0x0300: bus = 1; break; + } + } + else if (PROM_8K_SIZE == 128 * 2) + { + // 150-in-1 + switch (addr & 0x0300) + { + case 0x0000: break; + case 0x0100: bus = 1; break; + case 0x0200: prg = (byte)((prg & 0x1F) | 0x20); break; + case 0x0300: bus = 1; break; + } + } + else if (PROM_8K_SIZE == 192 * 2) + { + // 150-in-1 + switch (addr & 0x0300) + { + case 0x0000: break; + case 0x0100: bus = 1; break; + case 0x0200: prg = (byte)((prg & 0x1F) | 0x20); break; + case 0x0300: prg = (byte)((prg & 0x1F) | 0x40); break; + } + } + else if (PROM_8K_SIZE == 256 * 2) + { + } + + if ((addr & 0x0800) != 0) + { + if ((addr & 0x1000) != 0) + { + SetPROM_8K_Bank(4, prg * 4 + 2); + SetPROM_8K_Bank(5, prg * 4 + 3); + SetPROM_8K_Bank(6, prg * 4 + 2); + SetPROM_8K_Bank(7, prg * 4 + 3); + } + else + { + SetPROM_8K_Bank(4, prg * 4 + 0); + SetPROM_8K_Bank(5, prg * 4 + 1); + SetPROM_8K_Bank(6, prg * 4 + 0); + SetPROM_8K_Bank(7, prg * 4 + 1); + } + } + else + { + SetPROM_32K_Bank(prg); + } + + if (bus != 0) + { + SetPROM_Bank(4, DRAM, BANKTYPE_ROM); + SetPROM_Bank(5, DRAM, BANKTYPE_ROM); + SetPROM_Bank(6, DRAM, BANKTYPE_ROM); + SetPROM_Bank(7, DRAM, BANKTYPE_ROM); + } + + if ((addr & 0x0400) != 0) + { + SetVRAM_Mirror(VRAM_MIRROR4L); + } + else if ((addr & 0x2000) != 0) + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + } + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper235.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper235.cs.meta new file mode 100644 index 0000000..a1faaf5 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper235.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f4af0cae483798c41992b53cbf976237 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper236.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper236.cs new file mode 100644 index 0000000..bc8f44c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper236.cs @@ -0,0 +1,98 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper236 800-in-1 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper236 : Mapper + { + BYTE bank, mode; + public Mapper236(NES parent) : base(parent) + { + } + + public override void Reset() + + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + bank = mode = 0; + } + + //void Mapper236::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if (addr >= 0x8000 && addr <= 0xBFFF) + { + bank = (byte)(((addr & 0x03) << 4) | (bank & 0x07)); + } + else + { + bank = (byte)((addr & 0x07) | (bank & 0x30)); + mode = (byte)(addr & 0x30); + } + + if ((addr & 0x20) != 0) + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + + switch (mode) + { + case 0x00: + bank |= 0x08; + SetPROM_8K_Bank(4, bank * 2 + 0); + SetPROM_8K_Bank(5, bank * 2 + 1); + SetPROM_8K_Bank(6, (bank | 0x07) * 2 + 0); + SetPROM_8K_Bank(7, (bank | 0x07) * 2 + 1); + break; + case 0x10: + bank |= 0x37; + SetPROM_8K_Bank(4, bank * 2 + 0); + SetPROM_8K_Bank(5, bank * 2 + 1); + SetPROM_8K_Bank(6, (bank | 0x07) * 2 + 0); + SetPROM_8K_Bank(7, (bank | 0x07) * 2 + 1); + break; + case 0x20: + bank |= 0x08; + SetPROM_8K_Bank(4, (bank & 0xFE) * 2 + 0); + SetPROM_8K_Bank(5, (bank & 0xFE) * 2 + 1); + SetPROM_8K_Bank(6, (bank & 0xFE) * 2 + 2); + SetPROM_8K_Bank(7, (bank & 0xFE) * 2 + 3); + break; + case 0x30: + bank |= 0x08; + SetPROM_8K_Bank(4, bank * 2 + 0); + SetPROM_8K_Bank(5, bank * 2 + 1); + SetPROM_8K_Bank(6, bank * 2 + 0); + SetPROM_8K_Bank(7, bank * 2 + 1); + break; + } + } + + + //void Mapper236::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + p[0] = bank; + p[1] = mode; + } + + //void Mapper236::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + bank = p[0]; + mode = p[1]; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper236.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper236.cs.meta new file mode 100644 index 0000000..db8f986 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper236.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 50be4abc74346ca48864a3bcb43a94b6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper240.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper240.cs new file mode 100644 index 0000000..cb0648c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper240.cs @@ -0,0 +1,40 @@ +////////////////////////////// +// Mapper240 Gen Ke Le Zhuan // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper240 : Mapper + { + public Mapper240(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper240::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr >= 0x4020 && addr < 0x6000) + { + SetPROM_32K_Bank((data & 0xF0) >> 4); + SetVROM_8K_Bank(data & 0xF); + } + } + + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper240.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper240.cs.meta new file mode 100644 index 0000000..6d847ab --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper240.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: da14e08bfcffc214ca9bea59eeb38d0a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper241.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper241.cs new file mode 100644 index 0000000..75be5b5 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper241.cs @@ -0,0 +1,39 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper241 Fon Serm Bon // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper241 : Mapper + { + public Mapper241(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + } + + //void Mapper241::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if (addr == 0x8000) + { + SetPROM_32K_Bank(data); + } + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper241.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper241.cs.meta new file mode 100644 index 0000000..5097453 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper241.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 17ebf1bde1c31bd4d838a0297a28c5d0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper242.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper242.cs new file mode 100644 index 0000000..96a142d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper242.cs @@ -0,0 +1,34 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper242 Wai Xing Zhan Shi // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper242 : Mapper + { + public Mapper242(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0); + } + + //void Mapper242::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if ((addr & 0x01) != 0) + { + SetPROM_32K_Bank((addr & 0xF8) >> 3); + } + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper242.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper242.cs.meta new file mode 100644 index 0000000..ba5daed --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper242.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a37f7351801308a4e9b78625c82aa95a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper243.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper243.cs new file mode 100644 index 0000000..242c058 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper243.cs @@ -0,0 +1,114 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper243 PC-Sachen/Hacker // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + + public class Mapper243 : Mapper + { + BYTE[] reg = new byte[4]; + public Mapper243(NES parent) : base(parent) + { + } + + //void Mapper243::Reset() + public override void Reset() + { + SetPROM_32K_Bank(0); + if (VROM_8K_SIZE > 4) + { + SetVROM_8K_Bank(4); + } + else if (VROM_8K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + + SetVRAM_Mirror(VRAM_HMIRROR); + + reg[0] = 0; + reg[1] = 0; + reg[2] = 3; + reg[3] = 0; + } + + //void Mapper243::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if ((addr & 0x4101) == 0x4100) + { + reg[0] = data; + } + else if ((addr & 0x4101) == 0x4101) + { + switch (reg[0] & 0x07) + { + case 0: + reg[1] = 0; + reg[2] = 3; + break; + case 4: + reg[2] = (byte)((reg[2] & 0x06) | (data & 0x01)); + break; + case 5: + reg[1] = (byte)(data & 0x01); + break; + case 6: + reg[2] = (byte)((reg[2] & 0x01) | ((data & 0x03) << 1)); + break; + case 7: + reg[3] = (byte)(data & 0x01); + break; + default: + break; + } + + SetPROM_32K_Bank(reg[1]); + SetVROM_8K_Bank(reg[2] * 8 + 0, reg[2] * 8 + 1, reg[2] * 8 + 2, reg[2] * 8 + 3, + reg[2] * 8 + 4, reg[2] * 8 + 5, reg[2] * 8 + 6, reg[2] * 8 + 7); + + if (reg[3] != 0) + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + } + } + + public override bool IsStateSave() + { + return true; + } + + + + //void Mapper243::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //p[0] = reg[0]; + //p[1] = reg[1]; + //p[2] = reg[2]; + //p[3] = reg[3]; + } + + //void Mapper243::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //reg[0] = p[0]; + //reg[1] = p[1]; + //reg[2] = p[2]; + //reg[3] = p[3]; + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper243.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper243.cs.meta new file mode 100644 index 0000000..8382bdd --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper243.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b726927f98443184aa25c67151da6646 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper244.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper244.cs new file mode 100644 index 0000000..098de59 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper244.cs @@ -0,0 +1,40 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper244 // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper244 : Mapper + { + public Mapper244(NES parent) : base(parent) + { + } + + //void Mapper244::Reset() + public override void Reset() + { + SetPROM_32K_Bank(0); + } + + //void Mapper244::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + if (addr >= 0x8065 && addr <= 0x80A4) + { + SetPROM_32K_Bank((addr - 0x8065) & 0x3); + } + + if (addr >= 0x80A5 && addr <= 0x80E4) + { + SetVROM_8K_Bank((addr - 0x80A5) & 0x7); + } + } + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper244.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper244.cs.meta new file mode 100644 index 0000000..43fa830 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper244.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a87f223fb44ff5f4f95d1e5096eee666 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper245.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper245.cs new file mode 100644 index 0000000..90234d2 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper245.cs @@ -0,0 +1,256 @@ +////////////////////////////////////////////////////////////// +// Mapper245 Yong Zhe Dou E Long // +////////////////////////////////////////////////////////////////////////// +using static VirtualNes.Core.CPU; +using static VirtualNes.MMU; +using BYTE = System.Byte; +using INT = System.Int32; + +namespace VirtualNes.Core +{ + public class Mapper245 : Mapper + { + + BYTE[] reg = new byte[8]; + BYTE prg0, prg1; + BYTE chr01, chr23, chr4, chr5, chr6, chr7; + BYTE we_sram; + + BYTE irq_type; + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + BYTE irq_request; + int MMC4prg, MMC4chr; + + public Mapper245(NES parent) : base(parent) + { + } + + + //void Mapper245::Reset() + public override void Reset() + { + for (INT i = 0; i < 8; i++) + { + reg[i] = 0x00; + } + + prg0 = 0; + prg1 = 1; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + if (VROM_1K_SIZE != 0) + { + SetVROM_8K_Bank(0); + } + + we_sram = 0; // Disable + irq_enable = 0; // Disable + irq_counter = 0; + irq_latch = 0; + irq_request = 0; + + nes.SetIrqType(NES.IRQMETHOD.IRQ_CLOCK); + } + + //void Mapper245::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xF7FF) + { + case 0x8000: + reg[0] = data; + break; + case 0x8001: + reg[1] = data; + switch (reg[0]) + { + case 0x00: + reg[3] = (byte)((data & 2) << 5); + SetPROM_8K_Bank(6, 0x3E | reg[3]); + SetPROM_8K_Bank(7, 0x3F | reg[3]); + break; + case 0x06: + prg0 = data; + break; + case 0x07: + prg1 = data; + break; + } + SetPROM_8K_Bank(4, prg0 | reg[3]); + SetPROM_8K_Bank(5, prg1 | reg[3]); + break; + case 0xA000: + reg[2] = data; + if (!nes.rom.Is4SCREEN()) + { + if ((data & 0x01) != 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + break; + case 0xA001: + + break; + case 0xC000: + reg[4] = data; + irq_counter = data; + irq_request = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xC001: + reg[5] = data; + irq_latch = data; + irq_request = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE000: + reg[6] = data; + irq_enable = 0; + irq_request = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + reg[7] = data; + irq_enable = 1; + irq_request = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + } + } + + //void Mapper245::Clock(INT cycles) + public override void Clock(int cycles) + { + // if( irq_request && (nes.GetIrqType() == NES::IRQ_CLOCK) ) { + // nes.cpu.IRQ_NotPending(); + // } + } + + //void Mapper245::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable != 0 && irq_request == 0) + { + if (scanline == 0) + { + if (irq_counter != 0) + { + irq_counter--; + } + } + if ((irq_counter--) == 0) + { + irq_request = 0xFF; + irq_counter = irq_latch; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + // if( irq_request && (nes.GetIrqType() == NES::IRQ_HSYNC) ) { + // nes.cpu.IRQ_NotPending(); + // } + } + + void SetBank_CPU() + { + SetPROM_32K_Bank(prg0, prg1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + + void SetBank_PPU() + { + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x80) != 0) + { + SetVROM_8K_Bank(chr4, chr5, chr6, chr7, + chr23 + 1, chr23, chr01 + 1, chr01); + } + else + { + SetVROM_8K_Bank(chr01, chr01 + 1, chr23, chr23 + 1, + chr4, chr5, chr6, chr7); + } + } + else + { + if ((reg[0] & 0x80) != 0) + { + SetCRAM_1K_Bank(4, (chr01 + 0) & 0x07); + SetCRAM_1K_Bank(5, (chr01 + 1) & 0x07); + SetCRAM_1K_Bank(6, (chr23 + 0) & 0x07); + SetCRAM_1K_Bank(7, (chr23 + 1) & 0x07); + SetCRAM_1K_Bank(0, chr4 & 0x07); + SetCRAM_1K_Bank(1, chr5 & 0x07); + SetCRAM_1K_Bank(2, chr6 & 0x07); + SetCRAM_1K_Bank(3, chr7 & 0x07); + } + else + { + SetCRAM_1K_Bank(0, (chr01 + 0) & 0x07); + SetCRAM_1K_Bank(1, (chr01 + 1) & 0x07); + SetCRAM_1K_Bank(2, (chr23 + 0) & 0x07); + SetCRAM_1K_Bank(3, (chr23 + 1) & 0x07); + SetCRAM_1K_Bank(4, chr4 & 0x07); + SetCRAM_1K_Bank(5, chr5 & 0x07); + SetCRAM_1K_Bank(6, chr6 & 0x07); + SetCRAM_1K_Bank(7, chr7 & 0x07); + } + } + } + + public override bool IsStateSave() + { + return true; + } + + + //void Mapper245::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //for (INT i = 0; i < 8; i++) + //{ + // p[i] = reg[i]; + //} + //p[8] = prg0; + //p[9] = prg1; + //p[10] = chr01; + //p[11] = chr23; + //p[12] = chr4; + //p[13] = chr5; + //p[14] = chr6; + //p[15] = chr7; + //p[16] = irq_enable; + //p[17] = (BYTE)irq_counter; + //p[18] = irq_latch; + //p[19] = irq_request; + } + + //void Mapper245::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //for (INT i = 0; i < 8; i++) + //{ + // reg[i] = p[i]; + //} + //prg0 = p[8]; + //prg1 = p[9]; + //chr01 = p[10]; + //chr23 = p[11]; + //chr4 = p[12]; + //chr5 = p[13]; + //chr6 = p[14]; + //chr7 = p[15]; + //irq_enable = p[16]; + //irq_counter = (INT)p[17]; + //irq_latch = p[18]; + //irq_request = p[19]; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper245.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper245.cs.meta new file mode 100644 index 0000000..088933d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper245.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cb93375a5f2207e41af81add88dd6b61 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper246.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper246.cs new file mode 100644 index 0000000..eea9eda --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper246.cs @@ -0,0 +1,66 @@ +////////////////////////////////////////////////////////////////////////// +// Mapper246 Phone Serm Berm // +////////////////////////////////////////////////////////////////////////// + +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper246 : Mapper + { + public Mapper246(NES parent) : base(parent) + { + } + + + //void Mapper246::Reset() + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + + //void Mapper246::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr >= 0x6000 && addr < 0x8000) + { + switch (addr) + { + case 0x6000: + SetPROM_8K_Bank(4, data); + break; + case 0x6001: + SetPROM_8K_Bank(5, data); + break; + case 0x6002: + SetPROM_8K_Bank(6, data); + break; + case 0x6003: + SetPROM_8K_Bank(7, data); + break; + case 0x6004: + SetVROM_2K_Bank(0, data); + break; + case 0x6005: + SetVROM_2K_Bank(2, data); + break; + case 0x6006: + SetVROM_2K_Bank(4, data); + break; + case 0x6007: + SetVROM_2K_Bank(6, data); + break; + default: + CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + break; + } + } + + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper246.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper246.cs.meta new file mode 100644 index 0000000..1d01eea --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper246.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 32c1242dd4ea66f4184cce314fbc958c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper248.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper248.cs new file mode 100644 index 0000000..05c11e1 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper248.cs @@ -0,0 +1,232 @@ +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; + +namespace VirtualNes.Core +{ + public class Mapper248 : Mapper + { + BYTE[] reg = new BYTE[8]; + BYTE prg0, prg1; + BYTE chr01, chr23, chr4, chr5, chr6, chr7; + BYTE we_sram; + + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + BYTE irq_request; + public Mapper248(NES parent) : base(parent) + { + } + + public override void Reset() + { + for (INT i = 0; i < 8; i++) + { + reg[i] = 0x00; + } + + prg0 = 0; + prg1 = 1; + SetBank_CPU(); + + chr01 = 0; + chr23 = 2; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + SetBank_PPU(); + + we_sram = 0; // Disable + irq_enable = 0; // Disable + irq_counter = 0; + irq_latch = 0; + irq_request = 0; + } + + + + //void Mapper248::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + SetPROM_32K_Bank(2 * data, 2 * data + 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + + //void Mapper248::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE001) + { + case 0x8000: + reg[0] = data; + SetBank_CPU(); + SetBank_PPU(); + break; + case 0x8001: + reg[1] = data; + + switch (reg[0] & 0x07) + { + case 0x00: + chr01 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x01: + chr23 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x02: + chr4 = data; + SetBank_PPU(); + break; + case 0x03: + chr5 = data; + SetBank_PPU(); + break; + case 0x04: + chr6 = data; + SetBank_PPU(); + break; + case 0x05: + chr7 = data; + SetBank_PPU(); + break; + case 0x06: + prg0 = data; + SetBank_CPU(); + break; + case 0x07: + prg1 = data; + SetBank_CPU(); + break; + } + break; + case 0xA000: + reg[2] = data; + if (!nes.rom.Is4SCREEN()) + { + if ((data & 0x01) != 0) + { + SetVRAM_Mirror(VRAM_HMIRROR); + } + else + { + SetVRAM_Mirror(VRAM_VMIRROR); + } + } + break; + case 0xC000: + irq_enable = 0; + irq_latch = 0xBE; + irq_counter = 0xBE; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xC001: + irq_enable = 1; + irq_latch = 0xBE; + irq_counter = 0xBE; + break; + } + + } + + //void Mapper248::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable != 0) + { + if ((irq_counter--) == 0) + { + irq_counter = irq_latch; + // nes->cpu->IRQ_NotPending(); + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + } + + void SetBank_CPU() + { + if ((reg[0] & 0x40) != 0) + { + SetPROM_32K_Bank(PROM_8K_SIZE - 2, prg1, prg0, PROM_8K_SIZE - 1); + } + else + { + SetPROM_32K_Bank(prg0, prg1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + } + + + void SetBank_PPU() + { + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x80) != 0) + { + SetVROM_8K_Bank(chr4, chr5, chr6, chr7, + chr01, chr01 + 1, chr23, chr23 + 1); + } + else + { + SetVROM_8K_Bank(chr01, chr01 + 1, chr23, chr23 + 1, + chr4, chr5, chr6, chr7); + } + } + } + + public override bool IsStateSave() + { + return true; + } + + //void Mapper248::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //for (INT i = 0; i < 8; i++) + //{ + // p[i] = reg[i]; + //} + //p[8] = prg0; + //p[9] = prg1; + //p[10] = chr01; + //p[11] = chr23; + //p[12] = chr4; + //p[13] = chr5; + //p[14] = chr6; + //p[15] = chr7; + //p[16] = irq_enable; + //p[17] = (BYTE)irq_counter; + //p[18] = irq_latch; + //p[19] = irq_request; + } + + //void Mapper248::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //for (INT i = 0; i < 8; i++) + //{ + // reg[i] = p[i]; + //} + //prg0 = p[8]; + //prg1 = p[9]; + //chr01 = p[10]; + //chr23 = p[11]; + //chr4 = p[12]; + //chr5 = p[13]; + //chr6 = p[14]; + //chr7 = p[15]; + //irq_enable = p[16]; + //irq_counter = (INT)p[17]; + //irq_latch = p[18]; + //irq_request = p[19]; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper248.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper248.cs.meta new file mode 100644 index 0000000..d686737 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper248.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f7d8dac2353b4dd488d814cfd36016e5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper249.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper249.cs new file mode 100644 index 0000000..07a8116 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper249.cs @@ -0,0 +1,383 @@ +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper249 : Mapper + { + int MMC4prg, MMC4chr; + BYTE spdata; + BYTE[] reg = new BYTE[8]; + BYTE prg0, prg1; + BYTE chr01, chr23, chr4, chr5, chr6, chr7; + BYTE we_sram; + BYTE patch; + BYTE irq_type; + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + BYTE irq_request; + public Mapper249(NES parent) : base(parent) + { + } + + public override void Reset() + { + for (INT i = 0; i < 8; i++) + { + reg[i] = 0x00; + } + prg0 = 0; + prg1 = 1; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + chr01 = 0; + chr23 = 2; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + + SetVROM_8K_Bank(0); + + we_sram = 0; // Disable + irq_enable = 0; // Disable + irq_counter = 0; + irq_latch = 0; + irq_request = 0; + + // IRQタイプ設定 + nes.SetIrqType(NES.IRQMETHOD.IRQ_CLOCK); + spdata = 0; + } + + //void Mapper249::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if (addr == 0x5000) + { + switch (data) + { + case 0x00: + spdata = 0; + break; + case 0x02: + spdata = 1; + break; + } + } + + if (addr >= 0x6000 && addr < 0x8000) + { + CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + } + } + + //void Mapper249::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + BYTE m0, m1, m2, m3, m4, m5, m6, m7; + + switch (addr & 0xFF01) + { + case 0x8000: + case 0x8800: + reg[0] = data; + break; + case 0x8001: + case 0x8801: + switch (reg[0] & 0x07) + { + case 0x00: + if (spdata == 1) + { + m0 = (byte)(data & 0x1); + m1 = (byte)((data & 0x02) >> 1); + m2 = (byte)((data & 0x04) >> 2); + m3 = (byte)((data & 0x08) >> 3); + m4 = (byte)((data & 0x10) >> 4); + m5 = (byte)((data & 0x20) >> 5); + m6 = (byte)((data & 0x40) >> 6); + m7 = (byte)((data & 0x80) >> 7); + data = (byte)((m5 << 7) | (m4 << 6) | (m2 << 5) | (m6 << 4) | (m7 << 3) | (m3 << 2) | (m1 << 1) | m0); + } + SetVROM_1K_Bank(0, data & 0xFE); + SetVROM_1K_Bank(1, data | 0x01); + break; + case 0x01: + if (spdata == 1) + { + m0 = (byte)(data & 0x1); + m1 = (byte)((data & 0x02) >> 1); + m2 = (byte)((data & 0x04) >> 2); + m3 = (byte)((data & 0x08) >> 3); + m4 = (byte)((data & 0x10) >> 4); + m5 = (byte)((data & 0x20) >> 5); + m6 = (byte)((data & 0x40) >> 6); + m7 = (byte)((data & 0x80) >> 7); + data = (byte)((m5 << 7) | (m4 << 6) | (m2 << 5) | (m6 << 4) | (m7 << 3) | (m3 << 2) | (m1 << 1) | m0); + } + SetVROM_1K_Bank(2, data & 0xFE); + SetVROM_1K_Bank(3, data | 0x01); + break; + case 0x02: + if (spdata == 1) + { + m0 = (byte)(data & 0x1); + m1 = (byte)((data & 0x02) >> 1); + m2 = (byte)((data & 0x04) >> 2); + m3 = (byte)((data & 0x08) >> 3); + m4 = (byte)((data & 0x10) >> 4); + m5 = (byte)((data & 0x20) >> 5); + m6 = (byte)((data & 0x40) >> 6); + m7 = (byte)((data & 0x80) >> 7); + data = (byte)((m5 << 7) | (m4 << 6) | (m2 << 5) | (m6 << 4) | (m7 << 3) | (m3 << 2) | (m1 << 1) | m0); + } + SetVROM_1K_Bank(4, data); + break; + case 0x03: + if (spdata == 1) + { + m0 = (byte)(data & 0x1); + m1 = (byte)((data & 0x02) >> 1); + m2 = (byte)((data & 0x04) >> 2); + m3 = (byte)((data & 0x08) >> 3); + m4 = (byte)((data & 0x10) >> 4); + m5 = (byte)((data & 0x20) >> 5); + m6 = (byte)((data & 0x40) >> 6); + m7 = (byte)((data & 0x80) >> 7); + data = (byte)((m5 << 7) | (m4 << 6) | (m2 << 5) | (m6 << 4) | (m7 << 3) | (m3 << 2) | (m1 << 1) | m0); + } + SetVROM_1K_Bank(5, data); + break; + case 0x04: + if (spdata == 1) + { + m0 = (byte)(data & 0x1); + m1 = (byte)((data & 0x02) >> 1); + m2 = (byte)((data & 0x04) >> 2); + m3 = (byte)((data & 0x08) >> 3); + m4 = (byte)((data & 0x10) >> 4); + m5 = (byte)((data & 0x20) >> 5); + m6 = (byte)((data & 0x40) >> 6); + m7 = (byte)((data & 0x80) >> 7); + data = (byte)((m5 << 7) | (m4 << 6) | (m2 << 5) | (m6 << 4) | (m7 << 3) | (m3 << 2) | (m1 << 1) | m0); + } + SetVROM_1K_Bank(6, data); + break; + case 0x05: + if (spdata == 1) + { + m0 = (byte)(data & 0x1); + m1 = (byte)((data & 0x02) >> 1); + m2 = (byte)((data & 0x04) >> 2); + m3 = (byte)((data & 0x08) >> 3); + m4 = (byte)((data & 0x10) >> 4); + m5 = (byte)((data & 0x20) >> 5); + m6 = (byte)((data & 0x40) >> 6); + m7 = (byte)((data & 0x80) >> 7); + data = (byte)((m5 << 7) | (m4 << 6) | (m2 << 5) | (m6 << 4) | (m7 << 3) | (m3 << 2) | (m1 << 1) | m0); + } + SetVROM_1K_Bank(7, data); + break; + case 0x06: + if (spdata == 1) + { + if (data < 0x20) + { + m0 = (byte)(data & 0x1); + m1 = (byte)((data & 0x02) >> 1); + m2 = (byte)((data & 0x04) >> 2); + m3 = (byte)((data & 0x08) >> 3); + m4 = (byte)((data & 0x10) >> 4); + m5 = 0; + m6 = 0; + m7 = 0; + data = (byte)((m7 << 7) | (m6 << 6) | (m5 << 5) | (m2 << 4) | (m1 << 3) | (m3 << 2) | (m4 << 1) | m0); + } + else + { + data = (byte)(data - 0x20); + m0 = (byte)(data & 0x1); + m1 = (byte)((data & 0x02) >> 1); + m2 = (byte)((data & 0x04) >> 2); + m3 = (byte)((data & 0x08) >> 3); + m4 = (byte)((data & 0x10) >> 4); + m5 = (byte)((data & 0x20) >> 5); + m6 = (byte)((data & 0x40) >> 6); + m7 = (byte)((data & 0x80) >> 7); + data = (byte)((m5 << 7) | (m4 << 6) | (m2 << 5) | (m6 << 4) | (m7 << 3) | (m3 << 2) | (m1 << 1) | m0); + } + } + SetPROM_8K_Bank(4, data); + break; + case 0x07: + if (spdata == 1) + { + if (data < 0x20) + { + m0 = (byte)(data & 0x1); + m1 = (byte)((data & 0x02) >> 1); + m2 = (byte)((data & 0x04) >> 2); + m3 = (byte)((data & 0x08) >> 3); + m4 = (byte)((data & 0x10) >> 4); + m5 = 0; + m6 = 0; + m7 = 0; + data = (byte)((m7 << 7) | (m6 << 6) | (m5 << 5) | (m2 << 4) | (m1 << 3) | (m3 << 2) | (m4 << 1) | m0); + } + else + { + data = (byte)(data - 0x20); + m0 = (byte)(data & 0x1); + m1 = (byte)((data & 0x02) >> 1); + m2 = (byte)((data & 0x04) >> 2); + m3 = (byte)((data & 0x08) >> 3); + m4 = (byte)((data & 0x10) >> 4); + m5 = (byte)((data & 0x20) >> 5); + m6 = (byte)((data & 0x40) >> 6); + m7 = (byte)((data & 0x80) >> 7); + data = (byte)((m5 << 7) | (m4 << 6) | (m2 << 5) | (m6 << 4) | (m7 << 3) | (m3 << 2) | (m1 << 1) | m0); + } + } + SetPROM_8K_Bank(5, data); + break; + } + break; + case 0xA000: + case 0xA800: + reg[2] = data; + if (!nes.rom.Is4SCREEN()) + { + if ((data & 0x01)!= 0) SetVRAM_Mirror(VRAM_HMIRROR); + else SetVRAM_Mirror(VRAM_VMIRROR); + } + break; + case 0xA001: + case 0xA801: + reg[3] = data; + break; + case 0xC000: + case 0xC800: + reg[4] = data; + irq_counter = data; + irq_request = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xC001: + case 0xC801: + reg[5] = data; + irq_latch = data; + irq_request = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE000: + case 0xE800: + reg[6] = data; + irq_enable = 0; + irq_request = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + case 0xE001: + case 0xE801: + reg[7] = data; + irq_enable = 1; + irq_request = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + } + } + + //void Mapper249::Clock(INT cycles) + public override void Clock(int cycles) + { + // if( irq_request && (nes->GetIrqType() == NES::IRQ_CLOCK) ) { + // nes->cpu->IRQ_NotPending(); + // } + } + + //void Mapper249::HSync(INT scanline) + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable !=0 && irq_request == 0) + { + if (scanline == 0) + { + if (irq_counter != 0) + { + irq_counter--; + } + } + if ((irq_counter--) == 0) + { + irq_request = 0xFF; + irq_counter = irq_latch; + nes.cpu.SetIRQ(IRQ_MAPPER); + } + } + } + } + // if( irq_request && (nes->GetIrqType() == NES::IRQ_HSYNC) ) { + // nes->cpu->IRQ_NotPending(); + // } + } + + public override bool IsStateSave() + { + return true; + } + + //void Mapper249::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //for (INT i = 0; i < 8; i++) + //{ + // p[i] = reg[i]; + //} + //p[8] = prg0; + //p[9] = prg1; + //p[10] = chr01; + //p[11] = chr23; + //p[12] = chr4; + //p[13] = chr5; + //p[14] = chr6; + //p[15] = chr7; + //p[16] = irq_enable; + //p[17] = irq_counter; + //p[18] = irq_latch; + //p[19] = irq_request; + //p[20] = spdata; + } + + //void Mapper249::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //for (INT i = 0; i < 8; i++) + //{ + // reg[i] = p[i]; + //} + //prg0 = p[8]; + //prg1 = p[9]; + //chr01 = p[10]; + //chr23 = p[11]; + //chr4 = p[12]; + //chr5 = p[13]; + //chr6 = p[14]; + //chr7 = p[15]; + //irq_enable = p[16]; + //irq_counter = p[17]; + //irq_latch = p[18]; + //irq_request = p[19]; + //spdata = p[20]; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper249.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper249.cs.meta new file mode 100644 index 0000000..f5f9eb9 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper249.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 41a9bc9945845ad479223ef030929e05 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper251.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper251.cs new file mode 100644 index 0000000..7379c03 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper251.cs @@ -0,0 +1,143 @@ +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class Mapper251 : Mapper + { + BYTE[] reg = new BYTE[11]; + BYTE[] breg = new BYTE[4]; + public Mapper251(NES parent) : base(parent) + { + } + + public override void Reset() + { + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + + SetVRAM_Mirror(VRAM_VMIRROR); + + INT i; + for (i = 0; i < 11; i++) + reg[i] = 0; + for (i = 0; i < 4; i++) + breg[i] = 0; + } + + //void Mapper251::WriteLow(WORD addr, BYTE data) + public override void WriteLow(ushort addr, byte data) + { + if ((addr & 0xE001) == 0x6000) + { + if (reg[9] != null) + { + breg[reg[10]++] = data; + if (reg[10] == 4) + { + reg[10] = 0; + SetBank(); + } + } + } + } + + //void Mapper251::Write(WORD addr, BYTE data) + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE001) + { + case 0x8000: + reg[8] = data; + SetBank(); + break; + case 0x8001: + reg[reg[8] & 0x07] = data; + SetBank(); + break; + case 0xA001: + if ((data & 0x80)!= 0) + { + reg[9] = 1; + reg[10] = 0; + } + else + { + reg[9] = 0; + } + break; + } + } + + //void Mapper251::SetBank() + public void SetBank() + { + INT[] chr = new INT[6]; + INT[] prg = new int[4]; + + for (INT i = 0; i < 6; i++) + { + chr[i] = (reg[i] | (breg[1] << 4)) & ((breg[2] << 4) | 0x0F); + } + + if ((reg[8] & 0x80) != 0) + { + SetVROM_8K_Bank(chr[2], chr[3], chr[4], chr[5], chr[0], chr[0] + 1, chr[1], chr[1] + 1); + } + else + { + SetVROM_8K_Bank(chr[0], chr[0] + 1, chr[1], chr[1] + 1, chr[2], chr[3], chr[4], chr[5]); + } + + prg[0] = (reg[6] & ((breg[3] & 0x3F) ^ 0x3F)) | (breg[1]); + prg[1] = (reg[7] & ((breg[3] & 0x3F) ^ 0x3F)) | (breg[1]); + prg[2] = prg[3] = ((breg[3] & 0x3F) ^ 0x3F) | (breg[1]); + prg[2] &= PROM_8K_SIZE - 1; + + if ((reg[8] & 0x40) != 0) + { + SetPROM_32K_Bank(prg[2], prg[1], prg[0], prg[3]); + } + else + { + SetPROM_32K_Bank(prg[0], prg[1], prg[2], prg[3]); + } + } + public override bool IsStateSave() + { + return true; + } + + //void Mapper251::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + //INT i; + + //for (i = 0; i < 11; i++) + //{ + // p[i] = reg[i]; + //} + //for (i = 0; i < 4; i++) + //{ + // p[i + 11] = breg[i]; + //} + } + + //void Mapper251::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + //INT i; + //for (i = 0; i < 11; i++) + //{ + // reg[i] = p[i]; + //} + //for (i = 0; i < 4; i++) + //{ + // reg[i] = p[i + 11]; + //} + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper251.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper251.cs.meta new file mode 100644 index 0000000..00e5eee --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper251.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 51cb43228abfedc43b3ada072b386e8c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper252.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper252.cs new file mode 100644 index 0000000..fba69a5 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper252.cs @@ -0,0 +1,213 @@ +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +using System; + +namespace VirtualNes.Core +{ + public class Mapper252 : Mapper + { + BYTE[] reg = new BYTE[9]; + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + BYTE irq_occur; + INT irq_clock; + + public Mapper252(NES parent) : base(parent) + { + } + + public override void Reset() + { + for (byte i = 0; i < 8; i++) + { + reg[i] = i; + } + + reg[8] = 0; + + irq_enable = 0; + irq_counter = 0; + irq_latch = 0; + irq_clock = 0; + irq_occur = 0; + + SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + SetVROM_8K_Bank(0); + + nes.SetRenderMethod(EnumRenderMethod.POST_RENDER); + } + + public override void Write(ushort addr, byte data) + { + + if ((addr & 0xF000) == 0x8000) + { + SetPROM_8K_Bank(4, data); + return; + } + if ((addr & 0xF000) == 0xA000) + { + SetPROM_8K_Bank(5, data); + return; + } + switch (addr & 0xF00C) + { + case 0xB000: + reg[0] = (byte)((reg[0] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(0, reg[0]); + break; + case 0xB004: + reg[0] = (byte)((reg[0] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(0, reg[0]); + break; + case 0xB008: + reg[1] = (byte)((reg[1] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(1, reg[1]); + break; + case 0xB00C: + reg[1] = (byte)((reg[1] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(1, reg[1]); + break; + + case 0xC000: + reg[2] = (byte)((reg[2] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(2, reg[2]); + break; + case 0xC004: + reg[2] = (byte)(((reg[2] & 0x0F) | ((data & 0x0F) << 4))); + SetVROM_1K_Bank(2, reg[2]); + break; + case 0xC008: + reg[3] = (byte)((reg[3] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(3, reg[3]); + break; + case 0xC00C: + reg[3] = (byte)((reg[3] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(3, reg[3]); + break; + + case 0xD000: + reg[4] = (byte)((reg[4] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(4, reg[4]); + break; + case 0xD004: + reg[4] = (byte)((reg[4] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(4, reg[4]); + break; + case 0xD008: + reg[5] = (byte)((reg[5] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(5, reg[5]); + break; + case 0xD00C: + reg[5] = (byte)((reg[5] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(5, reg[5]); + break; + + case 0xE000: + reg[6] = (byte)((reg[6] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(6, reg[6]); + break; + case 0xE004: + reg[6] = (byte)((reg[6] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(6, reg[6]); + break; + case 0xE008: + reg[7] = (byte)((reg[7] & 0xF0) | (data & 0x0F)); + SetVROM_1K_Bank(7, reg[7]); + break; + case 0xE00C: + reg[7] = (byte)((reg[7] & 0x0F) | ((data & 0x0F) << 4)); + SetVROM_1K_Bank(7, reg[7]); + break; + + case 0xF000: + irq_latch = (byte)((irq_latch & 0xF0) | (data & 0x0F)); + irq_occur = 0; + break; + case 0xF004: + irq_latch = (byte)((irq_latch & 0x0F) | ((data & 0x0F) << 4)); + irq_occur = 0; + break; + + case 0xF008: + irq_enable = (byte)(data & 0x03); + if ((irq_enable & 0x02) != 0) + { + irq_counter = irq_latch; + irq_clock = 0; + } + irq_occur = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + + case 0xF00C: + irq_enable = (byte)((irq_enable & 0x01) * 3); + irq_occur = 0; + nes.cpu.ClrIRQ(IRQ_MAPPER); + break; + } + } + + //void Mapper252::Clock(INT cycles) + public override void Clock(int cycles) + { + if ((irq_enable & 0x02) != 0) + { + if ((irq_clock += cycles) >= 0x72) + { + irq_clock -= 0x72; + if (irq_counter == 0xFF) + { + irq_occur = 0xFF; + irq_counter = irq_latch; + irq_enable = (byte)((irq_enable & 0x01) * 3); + + nes.cpu.SetIRQ(IRQ_MAPPER); + } + else + { + irq_counter++; + } + } + // if( irq_occur ) { + // nes->cpu->IRQ_NotPending(); + // } + } + } + public override bool IsStateSave() + { + return true; + } + //void Mapper252::SaveState(LPBYTE p) + public override void SaveState(byte[] p) + { + for (INT i = 0; i < 9; i++) + { + p[i] = reg[i]; + } + p[9] = irq_enable; + p[10] = irq_counter; + p[11] = irq_latch; + + //*(INT*)&p[12] = irq_clock; + Array.Copy(p, 12, BitConverter.GetBytes(irq_clock), 0, 4); + } + + //void Mapper252::LoadState(LPBYTE p) + public override void LoadState(byte[] p) + { + for (INT i = 0; i < 9; i++) + { + reg[i] = p[i]; + } + irq_enable = p[9]; + irq_counter = p[10]; + irq_latch = p[11]; + //irq_clock = *(INT*)&p[12]; + irq_clock = BitConverter.ToInt32(p,12); + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper252.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper252.cs.meta new file mode 100644 index 0000000..f415194 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper252.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7b7a41c2ee41c1a4f9410d5243c67196 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper254.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper254.cs new file mode 100644 index 0000000..e4e20a6 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper254.cs @@ -0,0 +1,306 @@ +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; + +namespace VirtualNes.Core +{ + public class Mapper254 : Mapper + { + BYTE[] reg = new BYTE[8]; + BYTE prg0, prg1; + BYTE chr01, chr23, chr4, chr5, chr6, chr7; + + BYTE irq_type; + BYTE irq_enable; + BYTE irq_counter; + BYTE irq_latch; + BYTE irq_request; + BYTE protectflag; + public Mapper254(NES parent) : base(parent) + { + } + + public override void Reset() + { + for (int i = 0; i < 8; i++) + { + reg[i] = 0x00; + } + + protectflag = 0; + + prg0 = 0; + prg1 = 1; + SetBank_CPU(); + + chr01 = 0; + chr23 = 2; + chr4 = 4; + chr5 = 5; + chr6 = 6; + chr7 = 7; + SetBank_PPU(); + + irq_enable = 0; // Disable + irq_counter = 0; + irq_latch = 0; + irq_request = 0; + } + + public override void WriteLow(ushort addr, byte data) + { + switch (addr & 0xF000) + { + case 0x6000: + case 0x7000: + MMU.CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data; + break; + } + } + + + public override byte ReadLow(ushort addr) + { + if (addr >= 0x6000) + { + if (protectflag != 0) + { + return (MMU.CPU_MEM_BANK[addr >> 13][addr & 0x1FFF]); + } + else + { + return (byte)((MMU.CPU_MEM_BANK[addr >> 13][addr & 0x1FFF]) ^ 0x1); + } + } + return base.ReadLow(addr); + } + + + public override void Write(ushort addr, byte data) + { + switch (addr & 0xE001) + { + case 0x8000: + protectflag = 0xFF; + reg[0] = data; + SetBank_CPU(); + SetBank_PPU(); + break; + case 0x8001: + reg[1] = data; + + switch (reg[0] & 0x07) + { + case 0x00: + chr01 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x01: + chr23 = (byte)(data & 0xFE); + SetBank_PPU(); + break; + case 0x02: + chr4 = data; + SetBank_PPU(); + break; + case 0x03: + chr5 = data; + SetBank_PPU(); + break; + case 0x04: + chr6 = data; + SetBank_PPU(); + break; + case 0x05: + chr7 = data; + SetBank_PPU(); + break; + case 0x06: + prg0 = data; + SetBank_CPU(); + break; + case 0x07: + prg1 = data; + SetBank_CPU(); + break; + } + break; + case 0xA000: + reg[2] = data; + if (!nes.rom.Is4SCREEN()) + { + if ((data & 0x01) != 0) MMU.SetVRAM_Mirror(MMU.VRAM_HMIRROR); + else MMU.SetVRAM_Mirror(MMU.VRAM_VMIRROR); + } + break; + case 0xA001: + reg[3] = data; + break; + case 0xC000: + reg[4] = data; + irq_counter = data; + irq_request = 0; + nes.cpu.ClrIRQ(CPU.IRQ_MAPPER); + break; + case 0xC001: + reg[5] = data; + irq_latch = data; + irq_request = 0; + nes.cpu.ClrIRQ(CPU.IRQ_MAPPER); + break; + case 0xE000: + reg[6] = data; + irq_enable = 0; + irq_request = 0; + nes.cpu.ClrIRQ(CPU.IRQ_MAPPER); + break; + case 0xE001: + reg[7] = data; + irq_enable = 1; + irq_request = 0; + nes.cpu.ClrIRQ(CPU.IRQ_MAPPER); + break; + } + } + + + public override void Clock(int cycles) + { + // if( irq_request && (nes->GetIrqType() == NES::IRQ_CLOCK) ) { + // nes->cpu->IRQ_NotPending(); + // } + } + + + public override void HSync(int scanline) + { + if ((scanline >= 0 && scanline <= 239)) + { + if (nes.ppu.IsDispON()) + { + if (irq_enable != 0 && irq_request == 0) + { + if (scanline == 0) + { + if (irq_counter != 0) + { + irq_counter--; + } + } + if ((irq_counter--) == 0) + { + irq_request = 0xFF; + irq_counter = irq_latch; + nes.cpu.SetIRQ(CPU.IRQ_MAPPER); + } + } + } + } + // if( irq_request && (nes->GetIrqType() == NES::IRQ_HSYNC) ) { + // nes->cpu->IRQ_NotPending(); + // } + } + + + public void SetBank_CPU() + { + if ((reg[0] & 0x40)!=0) + { + SetPROM_32K_Bank(PROM_8K_SIZE - 2, prg1, prg0, PROM_8K_SIZE - 1); + } + else + { + SetPROM_32K_Bank(prg0, prg1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1); + } + } + + public void SetBank_PPU() + { + if (VROM_1K_SIZE != 0) + { + if ((reg[0] & 0x80)!= 0) + { + SetVROM_8K_Bank(chr4, chr5, chr6, chr7, + chr01, chr01 + 1, chr23, chr23 + 1); + } + else + { + SetVROM_8K_Bank(chr01, chr01 + 1, chr23, chr23 + 1, + chr4, chr5, chr6, chr7); + } + } + else + { + if ((reg[0] & 0x80) != 0) + { + SetCRAM_1K_Bank(4, (chr01 + 0) & 0x07); + SetCRAM_1K_Bank(5, (chr01 + 1) & 0x07); + SetCRAM_1K_Bank(6, (chr23 + 0) & 0x07); + SetCRAM_1K_Bank(7, (chr23 + 1) & 0x07); + SetCRAM_1K_Bank(0, chr4 & 0x07); + SetCRAM_1K_Bank(1, chr5 & 0x07); + SetCRAM_1K_Bank(2, chr6 & 0x07); + SetCRAM_1K_Bank(3, chr7 & 0x07); + } + else + { + SetCRAM_1K_Bank(0, (chr01 + 0) & 0x07); + SetCRAM_1K_Bank(1, (chr01 + 1) & 0x07); + SetCRAM_1K_Bank(2, (chr23 + 0) & 0x07); + SetCRAM_1K_Bank(3, (chr23 + 1) & 0x07); + SetCRAM_1K_Bank(4, chr4 & 0x07); + SetCRAM_1K_Bank(5, chr5 & 0x07); + SetCRAM_1K_Bank(6, chr6 & 0x07); + SetCRAM_1K_Bank(7, chr7 & 0x07); + } + } + } + public override bool IsStateSave() + { + return true; + } + + public override void SaveState(byte[] p) + { + for (int i = 0; i < 8; i++) + { + p[i] = reg[i]; + } + p[8] = prg0; + p[9] = prg1; + p[10] = chr01; + p[11] = chr23; + p[12] = chr4; + p[13] = chr5; + p[14] = chr6; + p[15] = chr7; + p[16] = irq_enable; + p[17] = irq_counter; + p[18] = irq_latch; + p[19] = irq_request; + p[20] = protectflag; + } + + public override void LoadState(byte[] p) + { + for (int i = 0; i < 8; i++) + { + reg[i] = p[i]; + } + prg0 = p[8]; + prg1 = p[9]; + chr01 = p[10]; + chr23 = p[11]; + chr4 = p[12]; + chr5 = p[13]; + chr6 = p[14]; + chr7 = p[15]; + irq_enable = p[16]; + irq_counter = p[17]; + irq_latch = p[18]; + irq_request = p[19]; + protectflag = p[20]; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper254.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper254.cs.meta new file mode 100644 index 0000000..6413c43 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper254.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9e8b780ffcd95804684aaf2c421f1602 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper255.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper255.cs new file mode 100644 index 0000000..0f30df8 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper255.cs @@ -0,0 +1,129 @@ +//using Codice.CM.Client.Differences; +using System; + +namespace VirtualNes.Core +{ + public class Mapper255 : Mapper + { + byte[] reg = new byte[4]; + public Mapper255(NES parent) : base(parent) + { + } + + public override void Reset() + { + MMU.SetPROM_32K_Bank(0); + MMU.SetVROM_8K_Bank(0); + MMU.SetVRAM_Mirror(MMU.VRAM_VMIRROR); + + reg[0] = 0; + reg[1] = 0; + reg[2] = 0; + reg[3] = 0; + } + + //BYTE Mapper255::ReadLow(WORD addr, BYTE data) + //{ + // if (addr >= 0x5800) + // { + // return reg[addr & 0x0003] & 0x0F; + // } + // else + // { + // return addr >> 8; + // } + //} + public override byte ReadLow(ushort addr) + { + if (addr >= 0x5800) + { + return (byte)(reg[addr & 0x0003] & 0x0F); + } + else + { + return (byte)(addr >> 8); + } + } + + + public override void WriteLow(ushort addr, byte data) + { + if (addr >= 0x5800) + { + reg[addr & 0x0003] = (byte)(data & 0x0F); + } + } + public override void Write(ushort addr, byte data) + { + byte prg = (byte)((addr & 0x0F80) >> 7); + int chr = (byte)((addr & 0x003F)); + int bank = (byte)((addr & 0x4000) >> 14); + + if ((addr & 0x2000) != 0 ) + { + MMU.SetVRAM_Mirror(MMU.VRAM_HMIRROR); + } + else + { + MMU.SetVRAM_Mirror(MMU.VRAM_VMIRROR); + } + + if ((addr & 0x1000) !=0) + { + if ((addr & 0x0040) != 0) + { + MMU.SetPROM_8K_Bank(4, 0x80 * bank + prg * 4 + 2); + MMU.SetPROM_8K_Bank(5, 0x80 * bank + prg * 4 + 3); + MMU.SetPROM_8K_Bank(6, 0x80 * bank + prg * 4 + 2); + MMU.SetPROM_8K_Bank(7, 0x80 * bank + prg * 4 + 3); + } + else + { + MMU.SetPROM_8K_Bank(4, 0x80 * bank + prg * 4 + 0); + MMU.SetPROM_8K_Bank(5, 0x80 * bank + prg * 4 + 1); + MMU.SetPROM_8K_Bank(6, 0x80 * bank + prg * 4 + 0); + MMU.SetPROM_8K_Bank(7, 0x80 * bank + prg * 4 + 1); + } + } + else + { + MMU.SetPROM_8K_Bank(4, 0x80 * bank + prg * 4 + 0); + MMU.SetPROM_8K_Bank(5, 0x80 * bank + prg * 4 + 1); + MMU.SetPROM_8K_Bank(6, 0x80 * bank + prg * 4 + 2); + MMU.SetPROM_8K_Bank(7, 0x80 * bank + prg * 4 + 3); + } + + MMU.SetVROM_1K_Bank(0, 0x200 * bank + chr * 8 + 0); + MMU.SetVROM_1K_Bank(1, 0x200 * bank + chr * 8 + 1); + MMU.SetVROM_1K_Bank(2, 0x200 * bank + chr * 8 + 2); + MMU.SetVROM_1K_Bank(3, 0x200 * bank + chr * 8 + 3); + MMU.SetVROM_1K_Bank(4, 0x200 * bank + chr * 8 + 4); + MMU.SetVROM_1K_Bank(5, 0x200 * bank + chr * 8 + 5); + MMU.SetVROM_1K_Bank(6, 0x200 * bank + chr * 8 + 6); + MMU.SetVROM_1K_Bank(7, 0x200 * bank + chr * 8 + 7); + } + + // For state save + public override bool IsStateSave() + { + return true; + } + + + public override void SaveState(byte[] p) + { + p[0] = reg[0]; + p[1] = reg[1]; + p[2] = reg[2]; + p[3] = reg[3]; + } + + public override void LoadState(byte[] p) + { + reg[0] = p[0]; + reg[1] = p[1]; + reg[2] = p[2]; + reg[3] = p[3]; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper255.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper255.cs.meta new file mode 100644 index 0000000..bfcb419 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/Mapper255.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b32da776b8028bd41baee629f49fa379 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/_Mapper.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/_Mapper.cs new file mode 100644 index 0000000..16a15d2 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/_Mapper.cs @@ -0,0 +1,18 @@ +using static VirtualNes.MMU; +using static VirtualNes.Core.CPU; +using INT = System.Int32; +using BYTE = System.Byte; +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class _Mapper : Mapper + { + + public _Mapper(NES parent) : base(parent) { } + + public override void Reset() + { + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/_Mapper.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/_Mapper.cs.meta new file mode 100644 index 0000000..098e193 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Mapper/_Mapper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5886971893af9a84581da5bc1ff575e9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/NES.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/NES.cs new file mode 100644 index 0000000..4c8e328 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/NES.cs @@ -0,0 +1,1682 @@ +//using Codice.CM.Client.Differences; +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using VirtualNes.Core.Debug; + +namespace VirtualNes.Core +{ + public class NES + { + public const int FETCH_CYCLES = 8; + + public CPU cpu; + public PPU ppu; + public APU apu; + public ROM rom; + public PAD pad; + public Mapper mapper; + public NesConfig nescfg; + + private List m_CheatCode = new List(); + private List m_GenieCode = new List(); + private bool m_bDiskThrottle; + private int m_CommandRequest; + private int m_nSnapNo; + private bool m_bNsfPlaying; + private bool m_bNsfInit; + private int m_nNsfSongNo; + private int m_nNsfSongMode; + private bool m_bMoviePlay; + private bool m_bMovieRec; + private Stream m_fpMovie; + private uint m_MovieControl; + private int m_MovieStepTotal; + private int m_MovieStep; + private bool m_bTapePlay; + private bool m_bTapeRec; + private Stream m_fpTape; + private double m_TapeCycles; + private byte m_TapeIn; + private byte m_TapeOut; + + // For Barcode + private bool m_bBarcode; + private byte m_BarcodeOut; + private byte m_BarcodePtr; + private int m_BarcodeCycles; + private byte[] m_BarcodeData = new byte[256]; + + // For Barcode + private bool m_bBarcode2; + private int m_Barcode2seq; + private int m_Barcode2ptr; + private int m_Barcode2cnt; + private byte m_Barcode2bit; + private byte[] m_Barcode2data = new byte[32]; + + private int m_TurboFileBank; + private int SAVERAM_SIZE; + private int nIRQtype; + private bool bFrameIRQ; + private bool bVideoMode; + private int NES_scanline; + private EnumRenderMethod RenderMethod; + private bool bZapper; + private int ZapperX; + private int ZapperY; + private long base_cycles; + private long emul_cycles; + + // For VS-Unisystem + byte m_VSDipValue; + VSDIPSWITCH[] m_VSDipTable; + + private byte[] m_PadImg = new byte[226] + { + 28, 8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, + 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, + 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x0F, + 0x0F, 0x0F, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, + 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x0F, + 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + + private byte[] m_KeyImg0 = new byte[6] + { + 2, 2, + 0x2A, 0x2A, + 0x2A, 0x2A, + }; + + private byte[] m_KeyImg1 = new byte[8] + { + 3, 3, + 0x2A, 0x2A, 0x2A, + 0x2A, 0x2A, 0x2A, + }; + + private byte[] m_KeyImg2 = new byte[18] + { + 4, 4, + 0xFF, 0x2A, 0x2A, 0xFF, + 0x2A, 0x2A, 0x2A, 0x2A, + 0x2A, 0x2A, 0x2A, 0x2A, + 0xFF, 0x2A, 0x2A, 0xFF, + }; + + private byte[] Font6x8 = new byte[768] + { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00, + 0x50,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x50,0xF8,0x50,0xF8,0x50,0x50,0x00, + 0x20,0x78,0xA0,0x70,0x28,0xF0,0x20,0x00,0x48,0xB0,0x50,0x20,0x50,0x68,0x90,0x00, + 0x40,0xA0,0xA8,0x68,0x90,0x90,0x68,0x00,0x30,0x20,0x00,0x00,0x00,0x00,0x00,0x00, + 0x10,0x20,0x40,0x40,0x40,0x20,0x10,0x00,0x40,0x20,0x10,0x10,0x10,0x20,0x40,0x00, + 0x00,0x88,0x50,0x20,0x50,0x88,0x00,0x00,0x00,0x20,0x20,0xF8,0x20,0x20,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x20,0x40,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x08,0x10,0x10,0x20,0x40,0x40,0x80,0x00, + 0x70,0x88,0x98,0xA8,0xC8,0x88,0x70,0x00,0x20,0x60,0x20,0x20,0x20,0x20,0xF8,0x00, + 0x70,0x88,0x08,0x30,0x40,0x80,0xF8,0x00,0x70,0x88,0x08,0x30,0x08,0x88,0x70,0x00, + 0x30,0x50,0x90,0x90,0xF8,0x10,0x10,0x00,0xF8,0x80,0x80,0xF0,0x08,0x08,0xF0,0x00, + 0x70,0x88,0x80,0xF0,0x88,0x88,0x70,0x00,0xF8,0x08,0x10,0x10,0x20,0x20,0x20,0x00, + 0x70,0x88,0x88,0x70,0x88,0x88,0x70,0x00,0x70,0x88,0x88,0x78,0x08,0x88,0x70,0x00, + 0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x40,0x00, + 0x10,0x20,0x40,0x80,0x40,0x20,0x10,0x00,0x00,0x00,0xF8,0x00,0xF8,0x00,0x00,0x00, + 0x40,0x20,0x10,0x08,0x10,0x20,0x40,0x00,0x70,0x88,0x08,0x10,0x20,0x00,0x20,0x00, + 0x30,0x48,0x88,0x98,0xA8,0xA8,0x78,0x00,0x20,0x50,0x50,0x88,0xF8,0x88,0x88,0x00, + 0xF0,0x88,0x88,0xF0,0x88,0x88,0xF0,0x00,0x70,0x88,0x80,0x80,0x80,0x88,0x70,0x00, + 0xF0,0x88,0x88,0x88,0x88,0x88,0xF0,0x00,0xF8,0x80,0x80,0xF0,0x80,0x80,0xF8,0x00, + 0xF8,0x80,0x80,0xF0,0x80,0x80,0x80,0x00,0x70,0x88,0x80,0xB8,0x88,0x88,0x70,0x00, + 0x88,0x88,0x88,0xF8,0x88,0x88,0x88,0x00,0xF8,0x20,0x20,0x20,0x20,0x20,0xF8,0x00, + 0x38,0x08,0x08,0x08,0x08,0x88,0x70,0x00,0x88,0x88,0x90,0xE0,0x90,0x88,0x88,0x00, + 0x80,0x80,0x80,0x80,0x80,0x80,0xF8,0x00,0x88,0xD8,0xA8,0xA8,0xA8,0xA8,0xA8,0x00, + 0x88,0xC8,0xA8,0xA8,0xA8,0x98,0x88,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x00, + 0xF0,0x88,0x88,0xF0,0x80,0x80,0x80,0x00,0x70,0x88,0x88,0x88,0xA8,0x90,0x68,0x00, + 0xF0,0x88,0x88,0xF0,0x88,0x88,0x88,0x00,0x70,0x88,0x80,0x70,0x08,0x88,0x70,0x00, + 0xF8,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00, + 0x88,0x88,0x88,0x50,0x50,0x50,0x20,0x00,0x88,0xA8,0xA8,0xA8,0xA8,0xD8,0x88,0x00, + 0x88,0x88,0x50,0x20,0x50,0x88,0x88,0x00,0x88,0x88,0x88,0x70,0x20,0x20,0x20,0x00, + 0xF8,0x08,0x10,0x20,0x40,0x80,0xF8,0x00,0x70,0x40,0x40,0x40,0x40,0x40,0x70,0x00, + 0x88,0x50,0xF8,0x20,0xF8,0x20,0x20,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x70,0x00, + 0x20,0x50,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00, + 0x80,0xC0,0xE0,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x70,0x08,0x78,0x88,0xF8,0x00, + 0x80,0x80,0x80,0xF0,0x88,0x88,0xF0,0x00,0x00,0x00,0x78,0x80,0x80,0x80,0x78,0x00, + 0x08,0x08,0x08,0x78,0x88,0x88,0x78,0x00,0x00,0x00,0x70,0x88,0xF8,0x80,0x78,0x00, + 0x18,0x20,0xF8,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x78,0x88,0x78,0x08,0xF0,0x00, + 0x80,0x80,0x80,0xF0,0x88,0x88,0x88,0x00,0x20,0x00,0x20,0x20,0x20,0x20,0x20,0x00, + 0x20,0x00,0x20,0x20,0x20,0x20,0xC0,0x00,0x80,0x80,0x88,0x90,0xE0,0x90,0x88,0x00, + 0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x00,0x00,0x00,0xF0,0xA8,0xA8,0xA8,0xA8,0x00, + 0x00,0x00,0xF0,0x88,0x88,0x88,0x88,0x00,0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x00, + 0x00,0x00,0xF0,0x88,0xF0,0x80,0x80,0x00,0x00,0x00,0x78,0x88,0x78,0x08,0x08,0x00, + 0x00,0x00,0xB8,0xC0,0x80,0x80,0x80,0x00,0x00,0x00,0x78,0x80,0x70,0x08,0xF0,0x00, + 0x20,0x20,0xF8,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x88,0x88,0x88,0x88,0x70,0x00, + 0x00,0x00,0x88,0x88,0x50,0x50,0x20,0x00,0x00,0x00,0x88,0xA8,0xA8,0xD8,0x88,0x00, + 0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x00,0x00,0x00,0x88,0x88,0x78,0x08,0xF0,0x00, + 0x00,0x00,0xF8,0x08,0x70,0x80,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + }; + + public NES(string fname) + { + Debuger.Log("VirtuaNES - CSharpCore\n"); + + m_bDiskThrottle = false; + m_CommandRequest = 0; + + m_nSnapNo = 0; + + m_bNsfPlaying = false; + + m_bMoviePlay = m_bMovieRec = false; + m_fpMovie = null; + + m_bTapePlay = m_bTapeRec = false; + m_fpTape = null; + m_TapeCycles = 0d; + m_TapeIn = m_TapeOut = 0; + + m_bBarcode2 = false; + + m_TurboFileBank = 0; + + cpu = null; + ppu = null; + apu = null; + rom = null; + pad = null; + mapper = null; + + SAVERAM_SIZE = 8 * 1024; + + nIRQtype = 0; + + bFrameIRQ = true; + + bVideoMode = false; + + nescfg = NesConfig.NESCONFIG_NTSC; + + CheatInitial(); + + try + { + Debuger.Log("Allocating CPU..."); + cpu = new CPU(this); + + Debuger.Log("Allocating PPU..."); + ppu = new PPU(this); + + var screenBuffer = new uint[PPU.SCREEN_WIDTH * PPU.SCREEN_HEIGHT]; + var colormode = new byte[PPU.SCREEN_HEIGHT]; + + ppu.SetScreenPtr(screenBuffer, colormode); + + Debuger.Log("Allocating APU..."); + apu = new APU(this); + + Debuger.Log("Allocating PAD..."); + pad = new PAD(this); + + Debuger.Log("Loading ROM Image..."); + rom = new ROM(fname); + + mapper = Mapper.CreateMapper(this, rom.GetMapperNo()); + + Debuger.Log("OK"); + + Debuger.Log($"{rom.GetRomName()}"); + 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($"V MIRROR :{rom.IsVMIRROR()}"); + Debuger.Log($"4 SCREEN :{rom.Is4SCREEN()}"); + Debuger.Log($"SAVE RAM :{rom.IsSAVERAM()}"); + Debuger.Log($"TRAINER :{rom.IsTRAINER()}"); + Debuger.Log($"VS-Unisystem :{rom.IsVSUNISYSTEM()}"); + + NesSub_MemoryInitial(); + LoadSRAM(); + LoadDISK(); + + { + // Pad饹ڤȳڻߥ󥰤WΤǤ + uint crc = rom.GetPROM_CRC(); + if ( + crc == 0xe792de94 // Best Play - Pro Yakyuu (New) (J) + || crc == 0xf79d684a // Best Play - Pro Yakyuu (Old) (J) + || crc == 0xc2ef3422 // Best Play - Pro Yakyuu 2 (J) + || crc == 0x974e8840 // Best Play - Pro Yakyuu '90 (J) + || crc == 0xb8747abf // Best Play - Pro Yakyuu Special (J) + || crc == 0x9fa1c11f // Castle Excellent (J) + || crc == 0x0b0d4d1b // Derby Stallion - Zenkoku Ban (J) + || crc == 0x728c3d98 // Downtown - Nekketsu Monogatari (J) + || crc == 0xd68a6f33 // Dungeon Kid (J) + || crc == 0x3a51eb04 // Fleet Commander (J) + || crc == 0x7c46998b // Haja no Fuuin (J) + || crc == 0x7e5d2f1a // Itadaki Street - Watashi no Mise ni Yottette (J) + || crc == 0xcee5857b // Ninjara Hoi! (J) + || crc == 0x50ec5e8b // Wizardry - Legacy of Llylgamyn (J) + || crc == 0x343e9146 // Wizardry - Proving Grounds of the Mad Overlord (J) + || crc == 0x33d07e45) + { // Wizardry - The Knight of Diamonds (J) + pad.SetExController(EXCONTROLLER.EXCONTROLLER_TURBOFILE); + } + } + + LoadTurboFile(); + + // VS-UnisystemΥǥեO + if (rom.IsVSUNISYSTEM()) + { + uint crc = rom.GetPROM_CRC(); + + m_VSDipValue = 0; + m_VSDipTable = VsUnisystem.vsdip_default; + } + + Reset(); + + // `ФΥǥեȥץO(Orʹ) + GameOption.defRenderMethod = (int)GetRenderMethod(); + GameOption.defIRQtype = GetIrqType(); + GameOption.defFrameIRQ = GetFrameIRQmode(); + GameOption.defVideoMode = GetVideoMode(); + + // O`ɤO(ȥ꤬oХǥեȤ) + if (rom.GetMapperNo() != 20) + { + GameOption.Load(rom.GetPROM_CRC()); + } + else + { + GameOption.Load(rom.GetGameID(), rom.GetMakerID()); + } + + SetRenderMethod((EnumRenderMethod)GameOption.nRenderMethod); + SetIrqType((IRQMETHOD)GameOption.nIRQtype); + SetFrameIRQmode(GameOption.bFrameIRQ); + SetVideoMode(GameOption.bVideoMode); + } + catch (Exception ex) + { + Debuger.LogError(ex.ToString()); + throw ex; + } + } + + internal int GetIrqType() + { + return nIRQtype; + } + + private void LoadTurboFile() + { + MemoryUtility.ZEROMEMORY(MMU.ERAM, MMU.ERAM.Length); + + if (pad.GetExController() != (int)EXCONTROLLER.EXCONTROLLER_TURBOFILE) + return; + + var fp = Supporter.OpenFile(Supporter.Config.path.szSavePath, "TurboFile.vtf"); + try + { + if (fp == null) + { + // xxx ե_ޤ + throw new Exception($"Can Not Open File [TurboFile.vtf]"); + } + + long size = fp.Length; + // ե륵ȡ + if (size > 32 * 1024) + { + size = 32 * 1024; + } + + fp.Read(MMU.ERAM, 0, MMU.ERAM.Length); + fp.Close(); + } + catch (Exception ex) + { + fp?.Close(); + Debuger.LogError($"Loading TurboFile Error.\n{ex}"); + } + } + + private void LoadDISK() + { + //todo : ŵȡ֧ + } + + private void LoadSRAM() + { + if (rom.IsNSF()) + return; + + MemoryUtility.ZEROMEMORY(MMU.WRAM, MMU.WRAM.Length); + + if (!rom.IsSAVERAM()) + return; + + var saveFileDir = Supporter.Config.path.szSavePath; + var saveFileName = $"{rom.GetRomName()}.sav"; + + var fp = Supporter.OpenFile(saveFileDir, saveFileName); + + try + { + if (fp == null) + { + throw new Exception("not find ram file to read"); + } + + Debuger.Log("Loading SAVERAM..."); + + int size = (int)fp.Length; + if (size <= 128 * 1024) + { + fp.Read(MMU.WRAM, 0, size); + } + Debuger.Log("OK."); + fp.Close(); + } + catch (Exception ex) + { + fp?.Close(); + fp = null; + } + } + + private void NesSub_MemoryInitial() + { + int i; + + // NA + MemoryUtility.ZEROMEMORY(MMU.RAM, MMU.RAM.Length); + MemoryUtility.ZEROMEMORY(MMU.WRAM, MMU.WRAM.Length); + MemoryUtility.ZEROMEMORY(MMU.DRAM, MMU.DRAM.Length); + MemoryUtility.ZEROMEMORY(MMU.ERAM, MMU.ERAM.Length); + MemoryUtility.ZEROMEMORY(MMU.XRAM, MMU.XRAM.Length); + MemoryUtility.ZEROMEMORY(MMU.CRAM, MMU.CRAM.Length); + MemoryUtility.ZEROMEMORY(MMU.VRAM, MMU.VRAM.Length); + + MemoryUtility.ZEROMEMORY(MMU.SPRAM, MMU.SPRAM.Length); + MemoryUtility.ZEROMEMORY(MMU.BGPAL, MMU.BGPAL.Length); + MemoryUtility.ZEROMEMORY(MMU.SPPAL, MMU.SPPAL.Length); + + MemoryUtility.ZEROMEMORY(MMU.CPUREG, MMU.CPUREG.Length); + MemoryUtility.ZEROMEMORY(MMU.PPUREG, MMU.PPUREG.Length); + + MMU.FrameIRQ = 0xC0; + + MMU.PROM = MMU.VROM = null; + + // 0 Zh~΍ + MMU.PROM_8K_SIZE = MMU.PROM_16K_SIZE = MMU.PROM_32K_SIZE = 1; + MMU.VROM_1K_SIZE = MMU.VROM_2K_SIZE = MMU.VROM_4K_SIZE = MMU.VROM_8K_SIZE = 1; + + // ftHgoNݒ + for (i = 0; i < 8; i++) + { + MMU.CPU_MEM_BANK[i] = null; + MMU.CPU_MEM_TYPE[i] = MMU.BANKTYPE_ROM; + MMU.CPU_MEM_PAGE[i] = 0; + } + + // RAM/WRAM + MMU.SetPROM_Bank(0, MMU.RAM, MMU.BANKTYPE_RAM); + MMU.SetPROM_Bank(3, MMU.WRAM, MMU.BANKTYPE_RAM); + + // _~[ + MMU.SetPROM_Bank(1, MMU.XRAM, MMU.BANKTYPE_ROM); + MMU.SetPROM_Bank(2, MMU.XRAM, MMU.BANKTYPE_ROM); + + for (i = 0; i < 8; i++) + { + MMU.CRAM_USED[i] = 0; + } + } + + public void Command(NESCOMMAND cmd) + { + CommandParam(cmd, 0); + } + + public bool CommandParam(NESCOMMAND cmd, int param) + { + switch (cmd) + { + case NESCOMMAND.NESCMD_NONE: break; + case NESCOMMAND.NESCMD_HWRESET: + Reset(); + m_CommandRequest = (int)cmd; + break; + case NESCOMMAND.NESCMD_SWRESET: + SoftReset(); + m_CommandRequest = (int)cmd; + break; + default: + throw new NotImplementedException($"{cmd} not impl right now"); + } + + return true; + } + + public void CheatInitial() + { + m_CheatCode.Clear(); + } + + private int FrameCount = 0; + public void EmulateFrame(bool bDraw) + { + FrameCount++; + + int scanline = 0; + if (rom.IsNSF()) + { + EmulateNSF(); + return; + } + + CheatCodeProcess(); + + NES_scanline = scanline; + bool NotTile = RenderMethod != EnumRenderMethod.TILE_RENDER; + + if (RenderMethod != EnumRenderMethod.TILE_RENDER) + { + bZapper = false; + while (true) + { + ppu.SetRenderScanline(scanline); + + if (scanline == 0) + { + if (RenderMethod < EnumRenderMethod.POST_RENDER) + { + EmulationCPU(nescfg.ScanlineCycles); + ppu.FrameStart(); + ppu.ScanlineNext(); + mapper.HSync(scanline); + ppu.ScanlineStart(); + } + else + { + EmulationCPU(nescfg.HDrawCycles); + ppu.FrameStart(); + ppu.ScanlineNext(); + mapper.HSync(scanline); + EmulationCPU(FETCH_CYCLES * 32); + ppu.ScanlineStart(); + EmulationCPU(FETCH_CYCLES * 10 + nescfg.ScanlineEndCycles); + } + } + else if (scanline < 240) + { + if (RenderMethod < EnumRenderMethod.POST_RENDER) + { + if (RenderMethod == EnumRenderMethod.POST_ALL_RENDER) + EmulationCPU(nescfg.ScanlineCycles); + if (bDraw) + { + ppu.Scanline(scanline, Supporter.Config.graphics.bAllSprite, Supporter.Config.graphics.bLeftClip); + } + else + { + if (pad.IsZapperMode() && scanline == ZapperY) + { + ppu.Scanline(scanline, Supporter.Config.graphics.bAllSprite, Supporter.Config.graphics.bLeftClip); + } + else + { + if (!ppu.IsSprite0(scanline)) + { + ppu.DummyScanline(scanline); + } + else + { + ppu.Scanline(scanline, Supporter.Config.graphics.bAllSprite, Supporter.Config.graphics.bLeftClip); + } + } + } + ppu.ScanlineNext(); // ̈ʒuŃX^[n͉ʂႤ + if (RenderMethod == EnumRenderMethod.PRE_ALL_RENDER) + EmulationCPU(nescfg.ScanlineCycles); + + mapper.HSync(scanline); + ppu.ScanlineStart(); + } + else + { + if (RenderMethod == EnumRenderMethod.POST_RENDER) + EmulationCPU(nescfg.HDrawCycles); + if (bDraw) + { + ppu.Scanline(scanline, Supporter.Config.graphics.bAllSprite, Supporter.Config.graphics.bLeftClip); + } + else + { + if (pad.IsZapperMode() && scanline == ZapperY) + { + ppu.Scanline(scanline, Supporter.Config.graphics.bAllSprite, Supporter.Config.graphics.bLeftClip); + } + else + { + if (!ppu.IsSprite0(scanline)) + { + ppu.DummyScanline(scanline); + } + else + { + ppu.Scanline(scanline, Supporter.Config.graphics.bAllSprite, Supporter.Config.graphics.bLeftClip); + } + } + } + if (RenderMethod == EnumRenderMethod.PRE_RENDER) + EmulationCPU(nescfg.HDrawCycles); + ppu.ScanlineNext(); + mapper.HSync(scanline); + EmulationCPU(FETCH_CYCLES * 32); + ppu.ScanlineStart(); + EmulationCPU(FETCH_CYCLES * 10 + nescfg.ScanlineEndCycles); + } + } + else if (scanline == 240) + { + mapper.VSync(); + if (RenderMethod < EnumRenderMethod.POST_RENDER) + { + EmulationCPU(nescfg.ScanlineCycles); + mapper.HSync(scanline); + } + else + { + EmulationCPU(nescfg.HDrawCycles); + mapper.HSync(scanline); + EmulationCPU(nescfg.HBlankCycles); + } + } + else if (scanline <= nescfg.TotalScanlines - 1) + { + pad.VSync(); + + // VBLANK + if (scanline == nescfg.TotalScanlines - 1) + { + ppu.VBlankEnd(); + } + if (RenderMethod < EnumRenderMethod.POST_RENDER) + { + if (scanline == 241) + { + ppu.VBlankStart(); + if ((MMU.PPUREG[0] & PPU.PPU_VBLANK_BIT) != 0) + { + cpu.NMI(); + } + } + EmulationCPU(nescfg.ScanlineCycles); + mapper.HSync(scanline); + } + else + { + if (scanline == 241) + { + ppu.VBlankStart(); + if ((MMU.PPUREG[0] & PPU.PPU_VBLANK_BIT) != 0) + { + cpu.NMI(); + } + } + EmulationCPU(nescfg.HDrawCycles); + mapper.HSync(scanline); + EmulationCPU(nescfg.HBlankCycles); + } + + if (scanline == nescfg.TotalScanlines - 1) + { + break; + } + } + if (pad.IsZapperMode()) + { + if (scanline == ZapperY) + bZapper = true; + else + bZapper = false; + } + + scanline++; + NES_scanline = scanline; + } + } + else + { + bZapper = false; + while (true) + { + ppu.SetRenderScanline(scanline); + + if (scanline == 0) + { + // _~[XLC + // H-Draw (4fetches*32) + EmulationCPU(FETCH_CYCLES * 128); + ppu.FrameStart(); + ppu.ScanlineNext(); + EmulationCPU(FETCH_CYCLES * 10); + mapper.HSync(scanline); + EmulationCPU(FETCH_CYCLES * 22); + ppu.ScanlineStart(); + EmulationCPU(FETCH_CYCLES * 10 + nescfg.ScanlineEndCycles); + } + else if (scanline < 240) + { + // XN[`(Scanline 1`239) + if (bDraw) + { + ppu.Scanline(scanline, Supporter.Config.graphics.bAllSprite, Supporter.Config.graphics.bLeftClip); + ppu.ScanlineNext(); + EmulationCPU(FETCH_CYCLES * 10); + mapper.HSync(scanline); + EmulationCPU(FETCH_CYCLES * 22); + ppu.ScanlineStart(); + EmulationCPU(FETCH_CYCLES * 10 + nescfg.ScanlineEndCycles); + } + else + { + if (pad.IsZapperMode() && scanline == ZapperY) + { + ppu.Scanline(scanline, Supporter.Config.graphics.bAllSprite, Supporter.Config.graphics.bLeftClip); + ppu.ScanlineNext(); + EmulationCPU(FETCH_CYCLES * 10); + mapper.HSync(scanline); + EmulationCPU(FETCH_CYCLES * 22); + ppu.ScanlineStart(); + EmulationCPU(FETCH_CYCLES * 10 + nescfg.ScanlineEndCycles); + } + else + { + if (!ppu.IsSprite0(scanline)) + { + // H-Draw (4fetches*32) + EmulationCPU(FETCH_CYCLES * 128); + ppu.DummyScanline(scanline); + ppu.ScanlineNext(); + EmulationCPU(FETCH_CYCLES * 10); + mapper.HSync(scanline); + EmulationCPU(FETCH_CYCLES * 22); + ppu.ScanlineStart(); + EmulationCPU(FETCH_CYCLES * 10 + nescfg.ScanlineEndCycles); + } + else + { + ppu.Scanline(scanline, Supporter.Config.graphics.bAllSprite, Supporter.Config.graphics.bLeftClip); + ppu.ScanlineNext(); + EmulationCPU(FETCH_CYCLES * 10); + mapper.HSync(scanline); + EmulationCPU(FETCH_CYCLES * 22); + ppu.ScanlineStart(); + EmulationCPU(FETCH_CYCLES * 10 + nescfg.ScanlineEndCycles); + } + } + } + } + else if (scanline == 240) + { + // _~[XLC (Scanline 240) + mapper.VSync(); + + EmulationCPU(nescfg.HDrawCycles); + // H-Sync + mapper.HSync(scanline); + + EmulationCPU(nescfg.HBlankCycles); + } + else if (scanline <= nescfg.TotalScanlines - 1) + { + pad.VSync(); + + // VBLANK + if (scanline == nescfg.TotalScanlines - 1) + { + ppu.VBlankEnd(); + } + if (scanline == 241) + { + ppu.VBlankStart(); + if ((MMU.PPUREG[0] & PPU.PPU_VBLANK_BIT) != 0) + { + cpu.NMI(); + } + } + EmulationCPU(nescfg.HDrawCycles); + + // H-Sync + mapper.HSync(scanline); + + EmulationCPU(nescfg.HBlankCycles); + + if (scanline == nescfg.TotalScanlines - 1) + { + break; + } + } + if (pad.IsZapperMode()) + { + if (scanline == ZapperY) + bZapper = true; + else + bZapper = false; + } + + scanline++; + NES_scanline = scanline; + } + } + + if (bDraw) + { + DrawPad(); + } + } + + private void DrawPad() + { + if (m_bMoviePlay) + { + int offset_h = 12; + int offset_v = Supporter.Config.graphics.bAllLine ? (240 - 18) : (240 - 22); + + if (Supporter.Config.movie.bPadDisplay) + { + uint dwData = pad.GetSyncData(); + for (int i = 0; i < 4; i++) + { + byte Data = (byte)(dwData >> (i * 8)); + if ((m_MovieControl & (1 << i)) != 0) + { + DrawBitmap(offset_h, offset_v, m_PadImg); + + // KEY + if ((Data & (1 << 4)) != 0) DrawBitmap(offset_h + 3, offset_v + 1, m_KeyImg0); // U + if ((Data & (1 << 5)) != 0) DrawBitmap(offset_h + 3, offset_v + 5, m_KeyImg0); // D + if ((Data & (1 << 6)) != 0) DrawBitmap(offset_h + 1, offset_v + 3, m_KeyImg0); // L + if ((Data & (1 << 7)) != 0) DrawBitmap(offset_h + 5, offset_v + 3, m_KeyImg0); // R + + // START,SELECT + if ((Data & (1 << 2)) != 0) DrawBitmap(offset_h + 9, offset_v + 5, m_KeyImg1); // SELECT + if ((Data & (1 << 3)) != 0) DrawBitmap(offset_h + 13, offset_v + 5, m_KeyImg1); // START + + // A,B + if ((Data & (1 << 0)) != 0) DrawBitmap(offset_h + 23, offset_v + 3, m_KeyImg2); // A + if ((Data & (1 << 1)) != 0) DrawBitmap(offset_h + 18, offset_v + 3, m_KeyImg2); // B + + offset_h += 30; + } + } + } + + if (Supporter.Config.movie.bTimeDisplay) + { + // Time display + int t = m_MovieStep; + int h = t / 216000; + t -= h * 216000; + int m = t / 3600; + t -= m * 3600; + int s = t / 60; + t -= s * 60; + + string szTemp = $"{h:00}:{m:00}:{s:00}.{t * 100 / 60:00}"; + DrawString(256 - 80 + 0, offset_v - 1, szTemp, 0x1F); + DrawString(256 - 80 + 0, offset_v + 1, szTemp, 0x1F); + DrawString(256 - 80 - 1, offset_v + 0, szTemp, 0x1F); + DrawString(256 - 80 + 1, offset_v + 0, szTemp, 0x1F); + DrawString(256 - 80, offset_v, szTemp, 0x30); + } + } + } + + internal void DrawString(int x, int y, string str, byte col) + { + foreach (var @char in str) + { + DrawFont(x, y, (byte)@char, col); + x += 6; + } + } + + internal void DrawFont(int x, int y, byte chr, byte col) + { + int i; + int pFnt; + int pPtr; + var Scn = ppu.GetScreenPtr(); + int pScn = 8; + + + if (chr < 0x20 || chr > 0x7F) + return; + chr -= 0x20; + pFnt = chr * 8; + pPtr = pScn + (256 + 16) * y + x; + for (i = 0; i < 8; i++) + { + if ((Font6x8[pFnt + i] & 0x80) != 0) Scn[pPtr + 0] = col; + if ((Font6x8[pFnt + i] & 0x40) != 0) Scn[pPtr + 1] = col; + if ((Font6x8[pFnt + i] & 0x20) != 0) Scn[pPtr + 2] = col; + if ((Font6x8[pFnt + i] & 0x10) != 0) Scn[pPtr + 3] = col; + if ((Font6x8[pFnt + i] & 0x08) != 0) Scn[pPtr + 4] = col; + if ((Font6x8[pFnt + i] & 0x04) != 0) Scn[pPtr + 5] = col; + pPtr += (256 + 16); + } + } + + private void DrawBitmap(int x, int y, byte[] bitMap) + { + int i, j; + int h, v; + var Scn = ppu.GetScreenPtr(); + int pScn = 8 + (256 + 16) * y + x; + int pPtr; + + int lpBitmap = 0; + h = bitMap[lpBitmap++]; + v = bitMap[lpBitmap++]; + + for (j = 0; j < v; j++) + { + pPtr = pScn; + for (i = 0; i < h; i++) + { + if (bitMap[lpBitmap] != 0xFF) + { + Scn[pPtr] = bitMap[lpBitmap]; + } + lpBitmap++; + pPtr++; + } + pScn += 256 + 16; + } + } + + int CPU_CALL_COUNT = 0; + internal void EmulationCPU(int basecycles) + { + int cycles; + + base_cycles += basecycles; + cycles = (int)((base_cycles / 12) - emul_cycles); + + if (cycles > 0) + { + var cycleAdd = cpu.EXEC(cycles); + emul_cycles += cycleAdd; + } + + CPU_CALL_COUNT++; + } + + internal void Reset() + { + SaveSRAM(); + SaveDISK(); + SaveTurboFile(); + + // RAM Clear + MemoryUtility.ZEROMEMORY(MMU.RAM, MMU.RAM.Length); + if (rom.GetPROM_CRC() == 0x29401686) + { // Minna no Taabou no Nakayoshi Dai Sakusen(J) + MemoryUtility.memset(MMU.RAM, 0xFF, MMU.RAM.Length); + } + + // RAM set + if (!rom.IsSAVERAM() && rom.GetMapperNo() != 20) + { + MemoryUtility.memset(MMU.WRAM, 0xFF, MMU.WRAM.Length); + } + + MemoryUtility.ZEROMEMORY(MMU.CRAM, MMU.CRAM.Length); + MemoryUtility.ZEROMEMORY(MMU.VRAM, MMU.VRAM.Length); + + MemoryUtility.ZEROMEMORY(MMU.SPRAM, MMU.SPRAM.Length); + MemoryUtility.ZEROMEMORY(MMU.BGPAL, MMU.BGPAL.Length); + MemoryUtility.ZEROMEMORY(MMU.SPPAL, MMU.SPPAL.Length); + + MemoryUtility.ZEROMEMORY(MMU.CPUREG, MMU.CPUREG.Length); + MemoryUtility.ZEROMEMORY(MMU.PPUREG, MMU.PPUREG.Length); + + m_bDiskThrottle = false; + + SetRenderMethod(EnumRenderMethod.PRE_RENDER); + + if (rom.IsPAL()) + { + SetVideoMode(true); + } + + MMU.PROM = rom.GetPROM(); + MMU.VROM = rom.GetVROM(); + + MMU.PROM_8K_SIZE = rom.GetPROM_SIZE() * 2; + MMU.PROM_16K_SIZE = rom.GetPROM_SIZE(); + MMU.PROM_32K_SIZE = rom.GetPROM_SIZE() / 2; + + MMU.VROM_1K_SIZE = rom.GetVROM_SIZE() * 8; + MMU.VROM_2K_SIZE = rom.GetVROM_SIZE() * 4; + MMU.VROM_4K_SIZE = rom.GetVROM_SIZE() * 2; + MMU.VROM_8K_SIZE = rom.GetVROM_SIZE(); + + // ftHgoN + if (MMU.VROM_8K_SIZE != 0) + { + MMU.SetVROM_8K_Bank(0); + } + else + { + MMU.SetCRAM_8K_Bank(0); + } + + // ~[ + if (rom.Is4SCREEN()) + { + MMU.SetVRAM_Mirror(MMU.VRAM_MIRROR4); + } + else if (rom.IsVMIRROR()) + { + MMU.SetVRAM_Mirror(MMU.VRAM_VMIRROR); + } + else + { + MMU.SetVRAM_Mirror(MMU.VRAM_HMIRROR); + } + + apu.SelectExSound(0); + + ppu.Reset(); + mapper.Reset(); + + // Trainer + if (rom.IsTRAINER()) + { + Array.Copy(rom.GetTRAINER(), 0, MMU.WRAM, 0x1000, 512); + } + + pad.Reset(); + cpu.Reset(); + apu.Reset(); + + if (rom.IsNSF()) + { + mapper.Reset(); + } + + base_cycles = emul_cycles = 0; + } + + internal void SetVideoMode(bool bMode) + { + bVideoMode = bMode; + if (!bVideoMode) + { + nescfg = NesConfig.NESCONFIG_NTSC; + } + else + { + nescfg = NesConfig.NESCONFIG_PAL; + } + apu.SoundSetup(); + } + + + + internal void SoftReset() + { + pad.Reset(); + cpu.Reset(); + apu.Reset(); + + if (rom.IsNSF()) + { + mapper.Reset(); + } + + m_bDiskThrottle = false; + + base_cycles = emul_cycles = 0; + } + + internal void EmulateNSF() + { + R6502 reg = null; + + ppu.Reset(); + mapper.VSync(); + + //DEBUGOUT( "Frame\n" ); + + if (m_bNsfPlaying) + { + if (m_bNsfInit) + { + MemoryUtility.ZEROMEMORY(MMU.RAM, MMU.RAM.Length); + if ((rom.GetNsfHeader().ExtraChipSelect & 0x04) == 0) + { + MemoryUtility.ZEROMEMORY(MMU.RAM, 0x2000); + } + + apu.Reset(); + apu.Write(0x4015, 0x0F); + apu.Write(0x4017, 0xC0); + apu.ExWrite(0x4080, 0x80); // FDS Volume 0 + apu.ExWrite(0x408A, 0xE8); // FDS Envelope Speed + + cpu.GetContext(ref reg); + reg.PC = 0x4710; // Init Address + reg.A = (byte)m_nNsfSongNo; + reg.X = (byte)m_nNsfSongMode; + reg.Y = 0; + reg.S = 0xFF; + reg.P = CPU.Z_FLAG | CPU.R_FLAG | CPU.I_FLAG; + + // S΍˂Ăă[v(1b) + for (int i = 0; i < nescfg.TotalScanlines * 60; i++) + { + EmulationCPU(nescfg.ScanlineCycles); + cpu.GetContext(ref reg); + + // [vɓƂmF甲 + if (reg.PC == 0x4700) + { + break; + } + } + + m_bNsfInit = false; + } + + cpu.GetContext(ref reg); + // [vɓĂĐݒ肷 + if (reg.PC == 0x4700) + { + reg.PC = 0x4720; // Play Address + reg.A = 0; + reg.S = 0xFF; + } + + for (int i = 0; i < nescfg.TotalScanlines; i++) + { + EmulationCPU(nescfg.ScanlineCycles); + } + } + else + { + cpu.GetContext(ref reg); + reg.PC = 0x4700; // [v + reg.S = 0xFF; + + EmulationCPU(nescfg.ScanlineCycles * nescfg.TotalScanlines); + } + } + + internal void CheatCodeProcess() + { + foreach (var it in m_CheatCode) + { + if ((it.enable & CHEATCODE.CHEAT_ENABLE) == 0) + continue; + + switch (it.type) + { + case CHEATCODE.CHEAT_TYPE_ALWAYS: + CheatWrite(it.length, it.address, it.data); + break; + case CHEATCODE.CHEAT_TYPE_ONCE: + CheatWrite(it.length, it.address, it.data); + it.enable = 0; + break; + case CHEATCODE.CHEAT_TYPE_GREATER: + if (CheatRead(it.length, it.address) > it.data) + { + CheatWrite(it.length, it.address, it.data); + } + break; + case CHEATCODE.CHEAT_TYPE_LESS: + if (CheatRead(it.length, it.address) < it.data) + { + CheatWrite(it.length, it.address, it.data); + } + break; + } + } + } + + private uint CheatRead(byte length, ushort addr) + { + uint data = 0; + for (int i = 0; i <= length; i++) + { + data |= (uint)(Read((ushort)(addr + i)) * (1 << (i * 8))); + } + + return data; + } + + private void CheatWrite(int length, ushort addr, uint data) + { + for (int i = 0; i <= length; i++) + { + Write((ushort)(addr + i), (byte)(data & 0xFF)); + data >>= 8; + } + } + + public void Dispose() + { + cpu?.Dispose(); + ppu?.Dispose(); + apu?.Dispose(); + pad?.Dispose(); + rom?.Dispose(); + } + + private void SaveSRAM() + { + int i; + if (rom.IsNSF()) return; + if (rom.IsSAVERAM()) return; + + for (i = 0; i < SAVERAM_SIZE; i++) + { + if (MMU.WRAM[i] != 0x00) + break; + } + + if (i < SAVERAM_SIZE) + { + var romName = rom.GetRomName(); + + Debuger.Log($"Saving SAVERAM...[{romName}]"); + + Supporter.SaveSRAMToFile(MMU.WRAM, romName); + } + } + + private void SaveDISK() + { + if (rom.GetMapperNo() != 20) + return; + + int i = 0; + Stream fp = null; + DISKFILEHDR ifh; + byte[] lpDisk = rom.GetPROM(); + byte[] lpWrite = rom.GetDISK(); + long DiskSize = 16 + 65500 * rom.GetDiskNo(); + ulong data; + + try + { + ifh = new DISKFILEHDR(); + ifh.ID = ASCIIEncoding.ASCII.GetBytes("VirtuaNES DI"); + ifh.BlockVersion = 0x0210; + ifh.ProgID = rom.GetGameID(); + ifh.MakerID = (ushort)rom.GetMakerID(); + ifh.DiskNo = (ushort)rom.GetDiskNo(); + + for (i = 16; i < DiskSize; i++) + { + if (lpWrite[i] > 0) + ifh.DifferentSize++; + } + + if (ifh.DifferentSize == 0) + return; + + List contents = new List(); + contents.AddRange(ifh.ToBytes()); + + for (i = 16; i < DiskSize; i++) + { + if (lpWrite[i] > 0) + { + data = (ulong)(i & 0x00FFFFFF); + data |= ((ulong)lpDisk[i] & 0xFF) << 24; + contents.AddRange(BitConverter.GetBytes(data)); + } + } + + Supporter.SaveDISKToFile(contents.ToArray(), rom.GetRomName()); + } + catch (Exception ex) + { + Debuger.LogError(ex.ToString()); + } + } + + private void SaveTurboFile() + { + int i; + + if (pad.GetExController() != (int)EXCONTROLLER.EXCONTROLLER_TURBOFILE) + return; + + for (i = 0; i < MMU.ERAM.Length; i++) + { + if (MMU.ERAM[i] != 0x00) + break; + } + + if (i < MMU.ERAM.Length) + { + Debuger.Log("Saving TURBOFILE..."); + + Supporter.SaveFile(MMU.ERAM, Supporter.Config.path.szSavePath, "TurboFile.vtf"); + } + } + + internal void Clock(int cycles) + { + Tape(cycles); + Barcode(cycles); + } + + private void Barcode(int cycles) + { + if (m_bBarcode) + { + m_BarcodeCycles += cycles; + if (m_BarcodeCycles > 1000) + { + m_BarcodeCycles = 0; + // ~H + if (m_BarcodeData[m_BarcodePtr] != 0xFF) + { + m_BarcodeOut = m_BarcodeData[m_BarcodePtr++]; + } + else + { + m_bBarcode = false; + m_BarcodeOut = 0; + Debuger.Log("Barcode data trasnfer complete!!"); + + if (!(IsTapePlay() || IsTapeRec())) + { + cpu.SetClockProcess(false); + } + } + } + } + } + + public bool IsTapeRec() + { + return m_bTapeRec; + } + + public bool IsTapePlay() + { + return m_bTapePlay; + } + + internal void Tape(int cycles) + { + if (!(IsTapePlay() || IsTapeRec())) + { + return; + } + + if ((m_TapeCycles -= (double)cycles) > 0) + return; + + m_TapeCycles += (nescfg.CpuClock / 32000.0); + // m_TapeCycles += (nescfg.CpuClock / 22050.0); // xă_ۂ + + if (m_bTapePlay) + { + int data = m_fpTape.ReadByte(); + if (data != -1) //EOF + { + if ((data & 0xFF) >= 0x8C) + { + m_TapeOut = 0x02; + } + else + if ((data & 0xFF) <= 0x74) + { + m_TapeOut = 0x00; + } + } + else + { + TapeStop(); + } + } + if (m_bTapeRec) + { + m_fpTape.WriteByte((m_TapeIn & 7) == 7 ? (byte)0x90 : (byte)0x70); + } + } + + private void TapeStop() + { + if (!m_bBarcode) + { + cpu.SetClockProcess(false); + } + + m_bTapePlay = m_bTapeRec = false; + m_fpTape?.Dispose(); + m_fpTape = null; + } + + internal byte Read(ushort addr) + { + switch (addr >> 13) + { + case 0x00: // $0000-$1FFF + return MMU.RAM[addr & 0x07FF]; + case 0x01: // $2000-$3FFF + return ppu.Read((ushort)(addr & 0xE007)); + case 0x02: // $4000-$5FFF + if (addr < 0x4100) + { + return ReadReg(addr); + } + else + { + return mapper.ReadLow(addr); + } + case 0x03: // $6000-$7FFF + return mapper.ReadLow(addr); + case 0x04: // $8000-$9FFF + case 0x05: // $A000-$BFFF + case 0x06: // $C000-$DFFF + case 0x07: // $E000-$FFFF + return MMU.CPU_MEM_BANK[addr >> 13][addr & 0x1FFF]; + } + + return 0x00; // Warning\h + } + + private byte ReadReg(ushort addr) + { + switch (addr & 0xFF) + { + case 0x00: + case 0x01: + case 0x02: + case 0x03: + case 0x04: + case 0x05: + case 0x06: + case 0x07: + case 0x08: + case 0x09: + case 0x0A: + case 0x0B: + case 0x0C: + case 0x0D: + case 0x0E: + case 0x0F: + case 0x10: + case 0x11: + case 0x12: + case 0x13: + return apu.Read(addr); + case 0x15: + return apu.Read(addr); + case 0x14: + return (byte)(addr & 0xFF); + case 0x16: + if (rom.IsVSUNISYSTEM()) + { + return pad.Read(addr); + } + else + { + return (byte)(pad.Read(addr) | 0x40 | m_TapeOut); + } + case 0x17: + if (rom.IsVSUNISYSTEM()) + { + return pad.Read(addr); + } + else + { + return (byte)(pad.Read(addr) | apu.Read(addr)); + } + default: + return mapper.ExRead(addr); + } + } + + internal byte Barcode2() + { + byte ret = 0x00; + + if (!m_bBarcode2 || m_Barcode2seq < 0) + return ret; + + switch (m_Barcode2seq) + { + case 0: + m_Barcode2seq++; + m_Barcode2ptr = 0; + ret = 0x04; // d3 + break; + + case 1: + m_Barcode2seq++; + m_Barcode2bit = m_Barcode2data[m_Barcode2ptr]; + m_Barcode2cnt = 0; + ret = 0x04; // d3 + break; + + case 2: + ret = (byte)((m_Barcode2bit & 0x01) != 0 ? 0x00 : 0x04); // Bit rev. + m_Barcode2bit >>= 1; + if (++m_Barcode2cnt > 7) + { + m_Barcode2seq++; + } + break; + case 3: + if (++m_Barcode2ptr > 19) + { + m_bBarcode2 = false; + m_Barcode2seq = -1; + } + else + { + m_Barcode2seq = 1; + } + break; + default: + break; + } + + return ret; + } + public void SetRenderMethod(EnumRenderMethod type) + { + RenderMethod = type; + } + internal void Write(ushort addr, byte data) + { + switch (addr >> 13) + { + case 0x00: // $0000-$1FFF + MMU.RAM[addr & 0x07FF] = data; + break; + case 0x01: // $2000-$3FFF + if (!rom.IsNSF()) + { + ppu.Write((ushort)(addr & 0xE007), data); + } + break; + case 0x02: // $4000-$5FFF + if (addr < 0x4100) + { + WriteReg(addr, data); + } + else + { + mapper.WriteLow(addr, data); + } + break; + case 0x03: // $6000-$7FFF + mapper.WriteLow(addr, data); + break; + case 0x04: // $8000-$9FFF + case 0x05: // $A000-$BFFF + case 0x06: // $C000-$DFFF + case 0x07: // $E000-$FFFF + mapper.Write(addr, data); + + GenieCodeProcess(); + break; + } + } + + private void GenieCodeProcess() + { + ushort addr; + + for (int i = 0; i < m_GenieCode.Count; i++) + { + addr = m_GenieCode[i].address; + if ((addr & 0x8000) != 0) + { + // 8character codes + if (MMU.CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] == m_GenieCode[i].cmp) + { + MMU.CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = m_GenieCode[i].data; + } + } + else + { + // 6character codes + addr |= 0x8000; + MMU.CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = m_GenieCode[i].data; + } + } + } + + private void WriteReg(ushort addr, byte data) + { + switch (addr & 0xFF) + { + case 0x00: + case 0x01: + case 0x02: + case 0x03: + case 0x04: + case 0x05: + case 0x06: + case 0x07: + case 0x08: + case 0x09: + case 0x0A: + case 0x0B: + case 0x0C: + case 0x0D: + case 0x0E: + case 0x0F: + case 0x10: + case 0x11: + case 0x12: + case 0x13: + case 0x15: + apu.Write(addr, data); + MMU.CPUREG[addr & 0xFF] = data; + break; + case 0x14: + ppu.DMA(data); + cpu.DMA(514); // DMA Pending cycle + MMU.CPUREG[addr & 0xFF] = data; + break; + case 0x16: + mapper.ExWrite(addr, data); // For VS-Unisystem + pad.Write(addr, data); + MMU.CPUREG[addr & 0xFF] = data; + m_TapeIn = data; + break; + case 0x17: + MMU.CPUREG[addr & 0xFF] = data; + pad.Write(addr, data); + apu.Write(addr, data); + break; + // VirtuaNESŗL|[g + case 0x18: + apu.Write(addr, data); + break; + default: + mapper.ExWrite(addr, data); + break; + } + } + + internal bool GetVideoMode() + { + return bVideoMode; + } + + internal void SetFrameIRQmode(bool bMode) + { + bFrameIRQ = bMode; + } + + internal bool GetFrameIRQmode() + { + return bFrameIRQ; + } + + internal EnumRenderMethod GetRenderMethod() + { + return RenderMethod; + } + + internal void SetIrqType(IRQMETHOD nType) + { + nIRQtype = (int)nType; + } + + internal int GetScanline() + { + return NES_scanline; + } + + internal void SetSAVERAM_SIZE(int size) + { + SAVERAM_SIZE = size; + } + + internal byte GetBarcodeStatus() + { + return m_BarcodeOut; + } + + public enum IRQMETHOD + { + IRQ_HSYNC = 0, IRQ_CLOCK = 1 + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/NES.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/NES.cs.meta new file mode 100644 index 0000000..291ca81 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/NES.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 91459a62d37e6c049b384af2e8e6a47d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PAD.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PAD.cs new file mode 100644 index 0000000..b27ee58 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PAD.cs @@ -0,0 +1,595 @@ +//using Codice.CM.Client.Differences; +using System; +using System.Collections.Generic; + +namespace VirtualNes.Core +{ + public class PAD + { + private NES nes; + private int excontroller_select; + private EXPAD expad; + private bool bStrobe; + private bool bSwapButton; + private bool bSwapPlayer; + private bool bZapperMode; + private VSType nVSSwapType; + private byte[] padbit = new byte[4]; + private byte micbit; + private byte[] padbitsync = new byte[4]; + private byte micbitsync; + private bool bBarcodeWorld; + private int[][] padcnt = new int[4][] + { + new int[2],new int[2],new int[2],new int[2], + }; + + public uint pad1bit, pad2bit, pad3bit, pad4bit; + + private static int[] ren10fps = new int[6] { 1, 1, 1, 0, 0, 0 }; + private static int[] ren15fps = new int[4] { 1, 1, 0, 0 }; + private static int[] ren20fps = new int[3] { 1, 1, 0 }; + private static int[] ren30fps = new int[2] { 1, 0 }; + private static int[] renmask = new int[4] { 6, 4, 3, 2 }; + public static Dictionary rentbl = new Dictionary() + { + {0,ren10fps }, + {1,ren15fps }, + {2,ren20fps }, + {3,ren30fps }, + }; + + public PAD(NES parent) + { + nes = parent; + excontroller_select = 0; + expad = null; + bStrobe = false; + bSwapButton = false; + bSwapPlayer = false; + bZapperMode = false; + nVSSwapType = VSType.VS_TYPE0; + + padbit[0] = padbit[1] = padbit[2] = padbit[3] = 0; + micbit = 0; + + padbitsync[0] = padbitsync[1] = padbitsync[2] = padbitsync[3] = 0; + micbitsync = 0; + } + + internal byte Read(ushort addr) + { + byte data = 0x00; + + if (addr == 0x4016) + { + data = (byte)(pad1bit & 1); + pad1bit >>= 1; + data |= (byte)(((pad3bit & 1)) << 1); + pad3bit >>= 1; + // Mic + if (!nes.rom.IsVSUNISYSTEM()) + { + data |= micbitsync; + } + if (expad != null) + { + data |= expad.Read4016(); + } + } + if (addr == 0x4017) + { + data = (byte)(pad2bit & 1); + pad2bit >>= 1; + data |= (byte)((pad4bit & 1) << 1); + pad4bit >>= 1; + + if (expad != null) + { + data |= expad.Read4017(); + } + + if (bBarcodeWorld) + { + data |= nes.Barcode2(); + } + } + + return data; + } + public void Dispose() { } + + internal void Write(ushort addr, byte data) + { + if (addr == 0x4016) + { + if ((data & 0x01) != 0) + { + bStrobe = true; + } + else if (bStrobe) + { + bStrobe = false; + + Strobe(); + if (expad != null) + { + expad.Strobe(); + } + } + + if (expad != null) + { + expad.Write4016(data); + } + } + if (addr == 0x4017) + { + if (expad != null) + { + expad.Write4017(data); + } + } + } + + private void Strobe() + { + // For VS-Unisystem + if (nes.rom.IsVSUNISYSTEM()) + { + uint pad1 = (uint)(padbitsync[0] & 0xF3); + uint pad2 = (uint)(padbitsync[1] & 0xF3); + uint st1 = (uint)(padbitsync[0] & 0x08) >> 3; + uint st2 = (uint)(padbitsync[1] & 0x08) >> 3; + + switch (nVSSwapType) + { + case VSType.VS_TYPE0: + pad1bit = pad1 | (st1 << 2); + pad2bit = pad2 | (st2 << 2); + break; + case VSType.VS_TYPE1: + pad1bit = pad2 | (st1 << 2); + pad2bit = pad1 | (st2 << 2); + break; + case VSType.VS_TYPE2: + pad1bit = pad1 | (st1 << 2) | (st2 << 3); + pad2bit = pad2; + break; + case VSType.VS_TYPE3: + pad1bit = pad2 | (st1 << 2) | (st2 << 3); + pad2bit = pad1; + break; + case VSType.VS_TYPE4: + pad1bit = pad1 | (st1 << 2) | 0x08; // 0x08=Start Protect + pad2bit = pad2 | (st2 << 2) | 0x08; // 0x08=Start Protect + break; + case VSType.VS_TYPE5: + pad1bit = pad2 | (st1 << 2) | 0x08; // 0x08=Start Protect + pad2bit = pad1 | (st2 << 2) | 0x08; // 0x08=Start Protect + break; + case VSType.VS_TYPE6: + pad1bit = pad1 | (st1 << 2) | (((uint)padbitsync[0] & 0x04) << 1); + pad2bit = pad2 | (st2 << 2) | (((uint)padbitsync[1] & 0x04) << 1); + break; + case VSType.VS_TYPEZ: + pad1bit = 0; + pad2bit = 0; + break; + } + + // Coin 2偲旐傞堊偵徚偡 + micbit = 0; + } + else + { + if (Supporter.Config.emulator.bFourPlayer) + { + // NES type + pad1bit = padbitsync[0] | ((uint)padbitsync[2] << 8) | 0x00080000; + pad2bit = padbitsync[1] | ((uint)padbitsync[3] << 8) | 0x00040000; + } + else + { + // Famicom type + pad1bit = padbitsync[0]; + pad2bit = padbitsync[1]; + } + } + pad3bit = padbitsync[2]; + pad4bit = padbitsync[3]; + } + + internal void Reset() + { + pad1bit = pad2bit = 0; + bStrobe = false; + + bBarcodeWorld = false; + + for (int x = 0; x < 4; x++) + { + for (int y = 0; y < 2; y++) + { + padcnt[x][y] = 0; + } + } + + // Select Extension Devices + uint crc = nes.rom.GetPROM_CRC(); + + if (crc == 0xfbfc6a6c // Adventures of Bayou Billy, The(E) + || crc == 0xcb275051 // Adventures of Bayou Billy, The(U) + || crc == 0xfb69c131 // Baby Boomer(Unl)(U) + || crc == 0xf2641ad0 // Barker Bill's Trick Shooting(U) + || crc == 0xbc1dce96 // Chiller (Unl)(U) + || crc == 0x90ca616d // Duck Hunt(JUE) + || crc == 0x59e3343f // Freedom Force(U) + || crc == 0x242a270c // Gotcha!(U) + || crc == 0x7b5bd2de // Gumshoe(UE) + || crc == 0x255b129c // Gun Sight(J) + || crc == 0x8963ae6e // Hogan's Alley(JU) + || crc == 0x51d2112f // Laser Invasion(U) + || crc == 0x0a866c94 // Lone Ranger, The(U) + // || crc == 0xe4c04eea // Mad City(J) + || crc == 0x9eef47aa // Mechanized Attack(U) + || crc == 0xc2db7551 // Shooting Range(U) + || crc == 0x163e86c0 // To The Earth(U) + || crc == 0x42d893e4 // Operation Wolf(J) + || crc == 0x1388aeb9 // Operation Wolf(U) + || crc == 0x0d3cf705 // Wild Gunman(J) + || crc == 0x389960db) + { // Wild Gunman(JUE) + SetExController(EXCONTROLLER.EXCONTROLLER_ZAPPER); + } + if (crc == 0x35893b67 // Arkanoid(J) + || crc == 0x6267fbd1) + { // Arkanoid 2(J) + SetExController(EXCONTROLLER.EXCONTROLLER_PADDLE); + } + if (crc == 0xff6621ce // Hyper Olympic(J) + || crc == 0xdb9418e8 // Hyper Olympic(Tonosama Ban)(J) + || crc == 0xac98cd70) + { // Hyper Sports(J) + SetExController(EXCONTROLLER.EXCONTROLLER_HYPERSHOT); + } + if (crc == 0xf9def527 // Family BASIC(Ver2.0) + || crc == 0xde34526e // Family BASIC(Ver2.1a) + || crc == 0xf050b611 // Family BASIC(Ver3) + || crc == 0x3aaeed3f // Family BASIC(Ver3)(Alt) + || crc == 0x868FCD89 // Family BASIC(Ver1.0) + || crc == 0x2D6B7E5A // PLAYBOX BASIC(J) (Prototype_v0.0) + || crc == 0xDA03D908) + { // PLAYBOX BASIC (J) + SetExController(EXCONTROLLER.EXCONTROLLER_KEYBOARD); + } + if (crc == 0x589b6b0d // Supor Computer V3.0 + || crc == 0x8b265862 // Supor English + || crc == 0x41401c6d // Supor Computer V4.0 + || crc == 0x82F1Fb96 // Supor Computer(Russia) V1.0 + || crc == 0xd5d6eac4) + { // EDU(C) Computer + SetExController(EXCONTROLLER.EXCONTROLLER_SUPOR_KEYBOARD); + nes.SetVideoMode(true); + } + if (crc == 0xc68363f6 // Crazy Climber(J) + || crc == 0x2989ead6 // Smash TV(U) [!] + || crc == 0x0b8f8128) + { // Smash TV(E) [!] + SetExController(EXCONTROLLER.EXCONTROLLER_CRAZYCLIMBER); + } + if (crc == 0x20d22251) + { // Top rider(J) + SetExController(EXCONTROLLER.EXCONTROLLER_TOPRIDER); + } + if (crc == 0x0cd00488) + { // Space Shadow(J) + SetExController(EXCONTROLLER.EXCONTROLLER_SPACESHADOWGUN); + } + + if (crc == 0x8c8fa83b // Family Trainer - Athletic World (J) + || crc == 0x7e704a14 // Family Trainer - Jogging Race (J) + || crc == 0x2330a5d3) + { // Family Trainer - Rairai Kyonshiizu (J) + SetExController(EXCONTROLLER.EXCONTROLLER_FAMILYTRAINER_A); + } + if (crc == 0xf8da2506 // Family Trainer - Aerobics Studio (J) + || crc == 0xca26a0f1 // Family Trainer - Dai Undoukai (J) + || crc == 0x28068b8c // Family Trainer - Fuuun Takeshi Jou 2 (J) + || crc == 0x10bb8f9a // Family Trainer - Manhattan Police (J) + || crc == 0xad3df455 // Family Trainer - Meiro Dai Sakusen (J) + || crc == 0x8a5b72c0 // Family Trainer - Running Stadium (J) + || crc == 0x59794f2d) + { // Family Trainer - Totsugeki Fuuun Takeshi Jou (J) + SetExController(EXCONTROLLER.EXCONTROLLER_FAMILYTRAINER_B); + } + if (crc == 0x9fae4d46 // Ide Yousuke Meijin no Jissen Mahjong (J) + || crc == 0x7b44fb2a) + { // Ide Yousuke Meijin no Jissen Mahjong 2 (J) + SetExController(EXCONTROLLER.EXCONTROLLER_MAHJANG); + } + if (crc == 0x786148b6) + { // Exciting Boxing (J) + SetExController(EXCONTROLLER.EXCONTROLLER_EXCITINGBOXING); + } + if (crc == 0xc3c0811d // Oeka Kids - Anpanman no Hiragana Daisuki (J) + || crc == 0x9d048ea4) + { // Oeka Kids - Anpanman to Oekaki Shiyou!! (J) + SetExController(EXCONTROLLER.EXCONTROLLER_OEKAKIDS_TABLET); + } + + if (crc == 0x67898319) + { // Barcode World (J) + bBarcodeWorld = true; + } + + // VS-Unisystem + if (nes.rom.IsVSUNISYSTEM()) + { + if (crc == 0xff5135a3 // VS Hogan's Alley + || crc == 0xed588f00 // VS Duck Hunt + || crc == 0x17ae56be) + { // VS Freedom Force + SetExController(EXCONTROLLER.EXCONTROLLER_VSZAPPER); + } + else + { + SetExController(EXCONTROLLER.EXCONTROLLER_VSUNISYSTEM); + } + } + + if (crc == 0x21b099f3) + { // Gyromite (JUE) + SetExController(EXCONTROLLER.EXCONTROLLER_GYROMITE); + } + } + + internal void SetExController(EXCONTROLLER type) + { + excontroller_select = (int)type; + + expad?.Dispose(); + expad = null; + + bZapperMode = false; + + // ExPad Instance create + switch (type) + { + case EXCONTROLLER.EXCONTROLLER_ZAPPER: + expad = new EXPAD_Zapper(nes); + bZapperMode = true; + break; + case EXCONTROLLER.EXCONTROLLER_PADDLE: + expad = new EXPAD_Paddle(nes); + break; + case EXCONTROLLER.EXCONTROLLER_HYPERSHOT: + expad = new EXPAD_HyperShot(nes); + break; + case EXCONTROLLER.EXCONTROLLER_KEYBOARD: + expad = new EXPAD_Keyboard(nes); + break; + case EXCONTROLLER.EXCONTROLLER_SUPOR_KEYBOARD: + expad = new EXPAD_Supor_Keyboard(nes); + break; + case EXCONTROLLER.EXCONTROLLER_CRAZYCLIMBER: + expad = new EXPAD_CrazyClimber(nes); + break; + case EXCONTROLLER.EXCONTROLLER_TOPRIDER: + expad = new EXPAD_Toprider(nes); + break; + case EXCONTROLLER.EXCONTROLLER_SPACESHADOWGUN: + expad = new EXPAD_SpaceShadowGun(nes); + bZapperMode = true; + break; + case EXCONTROLLER.EXCONTROLLER_FAMILYTRAINER_A: + case EXCONTROLLER.EXCONTROLLER_FAMILYTRAINER_B: + expad = new EXPAD_FamlyTrainer(nes); + break; + case EXCONTROLLER.EXCONTROLLER_EXCITINGBOXING: + expad = new EXPAD_ExcitingBoxing(nes); + break; + case EXCONTROLLER.EXCONTROLLER_MAHJANG: + expad = new EXPAD_Mahjang(nes); + break; + case EXCONTROLLER.EXCONTROLLER_OEKAKIDS_TABLET: + expad = new EXPAD_OekakidsTablet(nes); + break; + case EXCONTROLLER.EXCONTROLLER_TURBOFILE: + expad = new EXPAD_TurboFile(nes); + break; + case EXCONTROLLER.EXCONTROLLER_VSUNISYSTEM: + expad = new EXPAD_VSUnisystem(nes); + break; + case EXCONTROLLER.EXCONTROLLER_VSZAPPER: + expad = new EXPAD_VSZapper(nes); + bZapperMode = true; + break; + + case EXCONTROLLER.EXCONTROLLER_GYROMITE: + expad = new EXPAD_Gyromite(nes); + break; + default: + break; + } + + if (expad != null) + { + expad.Reset(); + } + } + + public void Sync(ControllerState state) + { + padbit[0] = SyncSub(0, state); + padbit[1] = SyncSub(1, state); + padbit[2] = SyncSub(2, state); + padbit[3] = SyncSub(3, state); + + // Mic + micbit = 0; + if (state.HasButton(1, EnumButtonType.MIC)) micbit |= 4; + + // For Excontroller + if (expad != null) + { + expad.Sync(); + } + } + + private byte SyncSub(int no, ControllerState state) + { + ushort bit = 0; + + // Up + if (state.HasButton(no, EnumButtonType.UP)) + bit |= 1 << 4; + // Down + if (state.HasButton(no, EnumButtonType.DOWN)) + bit |= 1 << 5; + // Left + if (state.HasButton(no, EnumButtonType.LEFT)) + bit |= 1 << 6; + // Right + if (state.HasButton(no, EnumButtonType.RIGHT)) + bit |= 1 << 7; + + // 同時入力を禁止する + // if( (bit&((1<<4)|(1<<5))) == ((1<<4)|(1<<5)) ) + // bit &= ~((1<<4)|(1<<5)); + if ((bit & ((1 << 6) | (1 << 7))) == ((1 << 6) | (1 << 7))) + bit = (byte)(bit & ~((1 << 6) | (1 << 7))); + + // A + if (state.HasButton(no, EnumButtonType.A)) bit |= 1 << 0; + // B + if (state.HasButton(no, EnumButtonType.B)) bit |= 1 << 1; + + // Select + if (state.HasButton(no, EnumButtonType.SELECT)) bit |= 1 << 2; + // Start + if (state.HasButton(no, EnumButtonType.START)) bit |= 1 << 3; + + // A rapid setup + if ((bit & (1 << 8)) != 0) + { + int spd = Supporter.Config.controller.nRapid[no][0]; + if (spd >= 3) spd = 3; + + int[] tbl = rentbl[spd]; + + if (padcnt[no][0] >= renmask[spd]) + padcnt[no][0] = 0; + + if ((tbl[padcnt[no][0]]) != 0) + bit |= (1 << 0); + else + bit = (byte)(bit & ~(1 << 0)); + + padcnt[no][0]++; + } + else + { + padcnt[no][0] = 0; + } + // B rapid setup + if ((bit & (1 << 9)) != 0) + { + int spd = Supporter.Config.controller.nRapid[no][1]; + if (spd >= 3) spd = 3; + int[] tbl = rentbl[spd]; + + if (padcnt[no][1] >= renmask[spd]) + padcnt[no][1] = 0; + + if ((tbl[padcnt[no][1]]) != 0) + bit |= (1 << 1); + else + bit = (byte)(bit & ~(1 << 1)); + + padcnt[no][1]++; + } + else + { + padcnt[no][1] = 0; + } + + return (byte)(bit & 0xFF); + } + + internal bool IsZapperMode() + { + return bZapperMode; + } + + internal void VSync() + { + padbitsync[0] = padbit[0]; + padbitsync[1] = padbit[1]; + padbitsync[2] = padbit[2]; + padbitsync[3] = padbit[3]; + micbitsync = micbit; + } + + internal uint GetSyncData() + { + uint ret; + ret = (uint)(padbit[0] | (padbit[1] << 8) | (padbit[2] << 16) | (padbit[3] << 24)); + ret |= (uint)(micbit << 8); + return ret; + } + + internal void SetSyncData(uint data) + { + micbit = (byte)((data & 0x00000400) >> 8); + padbit[0] = (byte)data; + padbit[1] = (byte)(data >> 8); + padbit[2] = (byte)(data >> 16); + padbit[3] = (byte)(data >> 24); + } + + internal int GetExController() + { + return excontroller_select; + } + } + + public enum VSType + { + VS_TYPE0 = 0, // SELECT1P=START1P/SELECT2P=START2P 1P/2P No reverse + VS_TYPE1, // SELECT1P=START1P/SELECT2P=START2P 1P/2P Reverse + VS_TYPE2, // SELECT1P=START1P/START1P =START2P 1P/2P No reverse + VS_TYPE3, // SELECT1P=START1P/START1P =START2P 1P/2P Reverse + VS_TYPE4, // SELECT1P=START1P/SELECT2P=START2P 1P/2P No reverse (Protection) + VS_TYPE5, // SELECT1P=START1P/SELECT2P=START2P 1P/2P Reverse (Protection) + VS_TYPE6, // SELECT1P=START1P/SELECT2P=START2P 1P/2P Reverse (For Golf) + VS_TYPEZ, // ZAPPER + } + + public enum EXCONTROLLER + { + EXCONTROLLER_NONE = 0, + EXCONTROLLER_PADDLE, + EXCONTROLLER_HYPERSHOT, + EXCONTROLLER_ZAPPER, + EXCONTROLLER_KEYBOARD, + EXCONTROLLER_CRAZYCLIMBER, + EXCONTROLLER_TOPRIDER, + EXCONTROLLER_SPACESHADOWGUN, + + EXCONTROLLER_FAMILYTRAINER_A, + EXCONTROLLER_FAMILYTRAINER_B, + EXCONTROLLER_EXCITINGBOXING, + EXCONTROLLER_MAHJANG, + EXCONTROLLER_OEKAKIDS_TABLET, + EXCONTROLLER_TURBOFILE, + + EXCONTROLLER_VSUNISYSTEM, + EXCONTROLLER_VSZAPPER, + + EXCONTROLLER_GYROMITE, + EXCONTROLLER_STACKUP, + + EXCONTROLLER_SUPOR_KEYBOARD, + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PAD.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PAD.cs.meta new file mode 100644 index 0000000..5186f79 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PAD.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 82d5b1d9eb428ca45838e3a46515044d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PPU.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PPU.cs new file mode 100644 index 0000000..66fcbb2 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PPU.cs @@ -0,0 +1,1204 @@ +using System; + +namespace VirtualNes.Core +{ + public class PPU + { + public const int SCREEN_WIDTH = 256 + 16; + public const int SCREEN_HEIGHT = 240; + + private static byte[][] CreateCOLORMAP() + { + byte[][] res = new byte[5][]; + res[0] = new byte[64] + { 0x35, 0xFF, 0x16, 0x22, 0x1C, 0xFF, 0xFF, 0x15, + 0xFF, 0x00, 0x27, 0x05, 0x04, 0x27, 0x08, 0x30, + 0x21, 0xFF, 0xFF, 0x29, 0x3C, 0xFF, 0x36, 0x12, + 0xFF, 0x2B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, + 0xFF, 0x31, 0xFF, 0x2A, 0x2C, 0x0C, 0xFF, 0xFF, + 0xFF, 0x07, 0x34, 0x06, 0x13, 0xFF, 0x26, 0x0F, + 0xFF, 0x19, 0x10, 0x0A, 0xFF, 0xFF, 0xFF, 0x17, + 0xFF, 0x11, 0x09, 0xFF, 0xFF, 0x25, 0x18, 0xFF + }; + res[1] = new byte[64] + { 0xFF, 0x27, 0x18, 0xFF, 0x3A, 0x25, 0xFF, 0x31, + 0x16, 0x13, 0x38, 0x34, 0x20, 0x23, 0x31, 0x1A, + 0xFF, 0x21, 0x06, 0xFF, 0x1B, 0x29, 0xFF, 0x22, + 0xFF, 0x24, 0xFF, 0xFF, 0xFF, 0x08, 0xFF, 0x03, + 0xFF, 0x36, 0x26, 0x33, 0x11, 0xFF, 0x10, 0x02, + 0x14, 0xFF, 0x00, 0x09, 0x12, 0x0F, 0xFF, 0x30, + 0xFF, 0xFF, 0x2A, 0x17, 0x0C, 0x01, 0x15, 0x19, + 0xFF, 0x2C, 0x07, 0x37, 0xFF, 0x05, 0xFF, 0xFF + }; + res[2] = new byte[64] + { 0xFF, 0xFF, 0xFF, 0x10, 0x1A, 0x30, 0x31, 0x09, + 0x01, 0x0F, 0x36, 0x08, 0x15, 0xFF, 0xFF, 0xF0, + 0x22, 0x1C, 0xFF, 0x12, 0x19, 0x18, 0x17, 0xFF, + 0x00, 0xFF, 0xFF, 0x02, 0x16, 0x06, 0xFF, 0x35, + 0x23, 0xFF, 0x8B, 0xF7, 0xFF, 0x27, 0x26, 0x20, + 0x29, 0xFF, 0x21, 0x24, 0x11, 0xFF, 0xEF, 0xFF, + 0x2C, 0xFF, 0xFF, 0xFF, 0x07, 0xF9, 0x28, 0xFF, + 0x0A, 0xFF, 0x32, 0x37, 0x13, 0xFF, 0xFF, 0x0C + }; + res[3] = new byte[64] + { 0x18, 0xFF, 0x1C, 0x89, 0x0F, 0xFF, 0x01, 0x17, // 00-07 + 0x10, 0x0F, 0x2A, 0xFF, 0x36, 0x37, 0x1A, 0xFF, // 08-0F + 0x25, 0xFF, 0x12, 0xFF, 0x0F, 0xFF, 0xFF, 0x26, // 10-17 + 0xFF, 0xFF, 0x22, 0xFF, 0xFF, 0x0F, 0x3A, 0x21, // 18-1F + 0x05, 0x0A, 0x07, 0xC2, 0x13, 0xFF, 0x00, 0x15, // 20-27 + 0x0C, 0xFF, 0x11, 0xFF, 0xFF, 0x38, 0xFF, 0xFF, // 28-2F + 0xFF, 0xFF, 0x08, 0x16, 0xFF, 0xFF, 0x30, 0x3C, // 30-37 + 0x0F, 0x27, 0xFF, 0x60, 0x29, 0xFF, 0x30, 0x09 // 38-3F + }; + res[4] = new byte[64] + { + // Super Xevious/Gradius + 0x35, 0xFF, 0x16, 0x22, 0x1C, 0x09, 0xFF, 0x15, // 00-07 + 0x20, 0x00, 0x27, 0x05, 0x04, 0x28, 0x08, 0x30, // 08-0F + 0x21, 0xFF, 0xFF, 0x29, 0x3C, 0xFF, 0x36, 0x12, // 10-17 + 0xFF, 0x2B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, // 18-1F + 0xFF, 0x31, 0xFF, 0x2A, 0x2C, 0x0C, 0x1B, 0xFF, // 20-27 + 0xFF, 0x07, 0x34, 0x06, 0xFF, 0x25, 0x26, 0x0F, // 28-2F + 0xFF, 0x19, 0x10, 0x0A, 0xFF, 0xFF, 0xFF, 0x17, // 30-37 + 0xFF, 0x11, 0x1A, 0xFF, 0x38, 0xFF, 0x18, 0x3A, // 38-3F + }; + + return res; + } + private static byte[][] VSColorMap = CreateCOLORMAP(); + + // PPU Control Register #1 PPU #0 + public const byte PPU_VBLANK_BIT = 0x80; + public const byte PPU_SPHIT_BIT = 0x40; // 堘偆丠 + public const byte PPU_SP16_BIT = 0x20; + public const byte PPU_BGTBL_BIT = 0x10; + public const byte PPU_SPTBL_BIT = 0x08; + public const byte PPU_INC32_BIT = 0x04; + public const byte PPU_NAMETBL_BIT = 0x03; + + // PPU Control Register #2 PPU #1 + public const byte PPU_BGCOLOR_BIT = 0xE0; + public const byte PPU_SPDISP_BIT = 0x10; + public const byte PPU_BGDISP_BIT = 0x08; + public const byte PPU_SPCLIP_BIT = 0x04; + public const byte PPU_BGCLIP_BIT = 0x02; + public const byte PPU_COLORMODE_BIT = 0x01; + + // PPU Status Register PPU #2 + public const byte PPU_VBLANK_FLAG = 0x80; + public const byte PPU_SPHIT_FLAG = 0x40; + public const byte PPU_SPMAX_FLAG = 0x20; + public const byte PPU_WENABLE_FLAG = 0x10; + + // SPRITE Attribute + public const byte SP_VMIRROR_BIT = 0x80; + public const byte SP_HMIRROR_BIT = 0x40; + public const byte SP_PRIORITY_BIT = 0x20; + public const byte SP_COLOR_BIT = 0x03; + + private NES nes; + + private bool bExtLatch; // For MMC5 + private bool bChrLatch; // For MMC2/MMC4 + private bool bExtNameTable; // For Super Monkey no Dai Bouken + private bool bExtMono; // For Final Fantasy + + private ushort loopy_y; + private ushort loopy_shift; + + private uint[] lpScreen; + /// 作为lpScreen数组的索引 + private int lpScanline; + private int ScanlineNo; + private byte[] lpColormode; + + private bool bVSMode; + private int nVSColorMap; + private byte VSSecurityData; + private byte[] Bit2Rev = new byte[256]; + + + public PPU(NES nes) + { + this.nes = nes; + lpScreen = null; + lpColormode = null; + + bVSMode = false; + nVSColorMap = -1; + VSSecurityData = 0; + + for (int i = 0; i < 256; i++) + { + byte m = 0x80; + byte c = 0; + for (int j = 0; j < 8; j++) + { + if ((i & (1 << j)) > 0) c |= m; + m >>= 1; + } + Bit2Rev[i] = c; + } + } + + public void Dispose() { } + + internal byte Read(ushort addr) + { + byte data = 0x00; + + switch (addr) + { + // Write only Register + case 0x2000: // PPU Control Register #1(W) + case 0x2001: // PPU Control Register #2(W) + case 0x2003: // SPR-RAM Address Register(W) + case 0x2005: // PPU Scroll Register(W2) + case 0x2006: // VRAM Address Register(W2) + data = MMU.PPU7_Temp; // 懡暘 + break; + // Read/Write Register + case 0x2002: // PPU Status Register(R) + //DEBUGOUT( "2002 RD L:%3d C:%8d\n", ScanlineNo, nes->cpu->GetTotalCycles() ); + data = (byte)(MMU.PPUREG[2] | VSSecurityData); + MMU.PPU56Toggle = 0; + byte temp = unchecked((byte)~PPU_VBLANK_FLAG); + MMU.PPUREG[2] &= temp; + break; + case 0x2004: // SPR_RAM I/O Register(RW) + data = MMU.SPRAM[MMU.PPUREG[3]++]; + break; + case 0x2007: // VRAM I/O Register(RW) + addr = (ushort)(MMU.loopy_v & 0x3FFF); + data = MMU.PPU7_Temp; + if ((MMU.PPUREG[0] & PPU_INC32_BIT) != 0) MMU.loopy_v += 32; + else MMU.loopy_v++; + if (addr >= 0x3000) + { + if (addr >= 0x3F00) + { + // data &= 0x3F; + if ((addr & 0x0010) == 0) + { + return MMU.BGPAL[addr & 0x000F]; + } + else + { + return MMU.SPPAL[addr & 0x000F]; + } + } + addr &= 0xEFFF; + } + MMU.PPU7_Temp = MMU.PPU_MEM_BANK[addr >> 10][addr & 0x03FF]; + break; + } + + return data; + } + + internal void SetRenderScanline(int scanline) + { + ScanlineNo = scanline; + if (scanline < 240) + { + lpScanline = (SCREEN_WIDTH) * scanline; + } + } + + internal void Write(ushort addr, byte data) + { + if (bVSMode && VSSecurityData != 0) + { + if (addr == 0x2000) + { + addr = 0x2001; + } + else if (addr == 0x2001) + { + addr = 0x2000; + } + } + + switch (addr) + { + // Read only Register + case 0x2002: // PPU Status register(R) + break; + // Write Register + case 0x2000: // PPU Control Register #1(W) + // NameTable select + // t:0000110000000000=d:00000011 + MMU.loopy_t = (ushort)((MMU.loopy_t & 0xF3FF) | ((data & 0x03) << 10)); + + if ((data & 0x80) != 0 && (MMU.PPUREG[0] & 0x80) == 0 && (MMU.PPUREG[2] & 0x80) != 0) + { + nes.cpu.NMI(); // hmm... + } + + MMU.PPUREG[0] = data; + break; + case 0x2001: // PPU Control Register #2(W) + MMU.PPUREG[1] = data; + break; + case 0x2003: // SPR-RAM Address Register(W) + MMU.PPUREG[3] = data; + break; + case 0x2004: // SPR_RAM I/O Register(RW) + MMU.SPRAM[MMU.PPUREG[3]++] = data; + break; + + case 0x2005: // PPU Scroll Register(W2) + //DEBUGOUT( "SCR WRT L:%3d C:%8d\n", ScanlineNo, nes->cpu->GetTotalCycles() ); + if (MMU.PPU56Toggle == 0) + { + // First write + // tile X t:0000000000011111=d:11111000 + MMU.loopy_t = (ushort)((MMU.loopy_t & 0xFFE0) | ((data) >> 3)); + // scroll offset X x=d:00000111 + MMU.loopy_x = (ushort)(data & 0x07); + } + else + { + // Second write + // tile Y t:0000001111100000=d:11111000 + MMU.loopy_t = (ushort)((MMU.loopy_t & 0xFC1F) | (((data) & 0xF8) << 2)); + // scroll offset Y t:0111000000000000=d:00000111 + MMU.loopy_t = (ushort)((MMU.loopy_t & 0x8FFF) | (((data) & 0x07) << 12)); + } + MMU.PPU56Toggle = (byte)(MMU.PPU56Toggle == 0 ? 1 : 0); + break; + case 0x2006: // VRAM Address Register(W2) + if (MMU.PPU56Toggle == 0) + { + // First write + // t:0011111100000000=d:00111111 + // t:1100000000000000=0 + MMU.loopy_t = (ushort)((MMU.loopy_t & 0x00FF) | (((data) & 0x3F) << 8)); + } + else + { + // Second write + // t:0000000011111111=d:11111111 + MMU.loopy_t = (ushort)((MMU.loopy_t & 0xFF00) | data); + // v=t + MMU.loopy_v = MMU.loopy_t; + nes.mapper.PPU_Latch(MMU.loopy_v); + } + MMU.PPU56Toggle = (byte)(MMU.PPU56Toggle == 0 ? 1 : 0); + break; + case 0x2007: // VRAM I/O Register(RW) + ushort vaddr = (ushort)(MMU.loopy_v & 0x3FFF); + if ((MMU.PPUREG[0] & PPU_INC32_BIT) != 0) MMU.loopy_v += 32; + else MMU.loopy_v++; + + if (vaddr >= 0x3000) + { + if (vaddr >= 0x3F00) + { + data &= 0x3F; + if (bVSMode && nVSColorMap != -1) + { + byte temp = VSColorMap[nVSColorMap][data]; + if (temp != 0xFF) + { + data = (byte)(temp & 0x3F); + } + } + + if ((vaddr & 0x000F) == 0) + { + MMU.BGPAL[0] = MMU.SPPAL[0] = data; + } + else if ((vaddr & 0x0010) == 0) + { + MMU.BGPAL[vaddr & 0x000F] = data; + } + else + { + MMU.SPPAL[vaddr & 0x000F] = data; + } + MMU.BGPAL[0x04] = MMU.BGPAL[0x08] = MMU.BGPAL[0x0C] = MMU.BGPAL[0x00]; + MMU.SPPAL[0x00] = MMU.SPPAL[0x04] = MMU.SPPAL[0x08] = MMU.SPPAL[0x0C] = MMU.BGPAL[0x00]; + return; + } + vaddr &= 0xEFFF; + } + if (MMU.PPU_MEM_TYPE[vaddr >> 10] != MMU.BANKTYPE_VROM) + { + MMU.PPU_MEM_BANK[vaddr >> 10][vaddr & 0x03FF] = data; + } + break; + } + } + + internal void DMA(byte data) + { + ushort addr = (ushort)(data << 8); + + for (ushort i = 0; i < 256; i++) + { + MMU.SPRAM[i] = nes.Read((ushort)(addr + i)); + } + } + + internal void Reset() + { + bExtLatch = false; + bChrLatch = false; + bExtNameTable = false; + bExtMono = false; + + MMU.PPUREG[0] = MMU.PPUREG[1] = 0; + + MMU.PPU56Toggle = 0; + + MMU.PPU7_Temp = 0xFF; // VS Excitebike偱偍偐偟偔側傞($2006傪撉傒偵峴偔僶僌偑偁傞) + // PPU7_Temp = 0; + + MMU.loopy_v = MMU.loopy_t = 0; + MMU.loopy_x = loopy_y = 0; + loopy_shift = 0; + + if (lpScreen != null) + MemoryUtility.memset(lpScreen, 0x3F, SCREEN_WIDTH * SCREEN_HEIGHT); + if (lpColormode != null) + MemoryUtility.memset(lpColormode, 0, SCREEN_HEIGHT); + } + + internal void FrameStart() + { + if ((MMU.PPUREG[1] & (PPU_SPDISP_BIT | PPU_BGDISP_BIT)) != 0) + { + MMU.loopy_v = MMU.loopy_t; + loopy_shift = MMU.loopy_x; + loopy_y = (ushort)((MMU.loopy_v & 0x7000) >> 12); + } + + if (lpScreen != null) + { + MemoryUtility.memset(lpScreen, 0x3F, SCREEN_WIDTH); + } + if (lpColormode != null) + { + lpColormode[0] = 0; + } + } + + internal void ScanlineNext() + { + if ((MMU.PPUREG[1] & (PPU_BGDISP_BIT | PPU_SPDISP_BIT)) != 0) + { + if ((MMU.loopy_v & 0x7000) == 0x7000) + { + MMU.loopy_v &= 0x8FFF; + if ((MMU.loopy_v & 0x03E0) == 0x03A0) + { + MMU.loopy_v ^= 0x0800; + MMU.loopy_v &= 0xFC1F; + } + else + { + if ((MMU.loopy_v & 0x03E0) == 0x03E0) + { + MMU.loopy_v &= 0xFC1F; + } + else + { + MMU.loopy_v += 0x0020; + } + } + } + else + { + MMU.loopy_v += 0x1000; + } + loopy_y = (ushort)((MMU.loopy_v & 0x7000) >> 12); + } + } + + internal void ScanlineStart() + { + if ((MMU.PPUREG[1] & (PPU_BGDISP_BIT | PPU_SPDISP_BIT)) != 0) + { + MMU.loopy_v = (ushort)((MMU.loopy_v & 0xFBE0) | (MMU.loopy_t & 0x041F)); + loopy_shift = MMU.loopy_x; + loopy_y = (ushort)((MMU.loopy_v & 0x7000) >> 12); + nes.mapper.PPU_Latch((ushort)(0x2000 + (MMU.loopy_v & 0x0FFF))); + } + } + + private byte[] BGwrite = new byte[33 + 1]; + private byte[] BGmono = new byte[33 + 1]; + private byte[] SPwrite = new byte[33 + 1]; + + internal void Scanline(int scanline, bool bMax, bool bLeftClip) + { + int pScn = 0; + int pBGw = 0; + byte chr_h = 0, chr_l = 0, attr = 0; + + MemoryUtility.ZEROMEMORY(BGwrite, BGwrite.Length); + MemoryUtility.ZEROMEMORY(BGmono, BGmono.Length); + + // Linecolor mode + lpColormode[scanline] = (byte)(((MMU.PPUREG[1] & PPU_BGCOLOR_BIT) >> 5) | ((MMU.PPUREG[1] & PPU_COLORMODE_BIT) << 7)); + + // Render BG + if ((MMU.PPUREG[1] & PPU_BGDISP_BIT) == 0) + { + MemoryUtility.memset(lpScreen, lpScanline, MMU.BGPAL[0], SCREEN_WIDTH); + if (nes.GetRenderMethod() == EnumRenderMethod.TILE_RENDER) + { + nes.EmulationCPU(NES.FETCH_CYCLES * 4 * 32); + } + } + else + { + if (nes.GetRenderMethod() != EnumRenderMethod.TILE_RENDER) + { + if (!bExtLatch) + { + // Without Extension Latch + pScn = lpScanline + (8 - loopy_shift); + pBGw = 0; + + int tileofs = (MMU.PPUREG[0] & PPU_BGTBL_BIT) << 8; + int ntbladr = 0x2000 + (MMU.loopy_v & 0x0FFF); + int attradr = 0x23C0 + (MMU.loopy_v & 0x0C00) + ((MMU.loopy_v & 0x0380) >> 4); + int ntbl_x = ntbladr & 0x001F; + int attrsft = (ntbladr & 0x0040) >> 4; + var pNTBL = MMU.PPU_MEM_BANK[ntbladr >> 10]; + + int tileadr; + int cache_tile = unchecked((int)(0xFFFF0000)); + byte cache_attr = 0xFF; + + chr_h = chr_l = attr = 0; + + attradr &= 0x3FF; + + + for (int i = 0; i < 33; i++) + { + tileadr = tileofs + pNTBL[ntbladr & 0x03FF] * 0x10 + loopy_y; + attr = (byte)(((pNTBL[attradr + (ntbl_x >> 2)] >> ((ntbl_x & 2) + attrsft)) & 3) << 2); + + if (cache_tile == tileadr && cache_attr == attr) + { + lpScreen[pScn + 0] = lpScreen[pScn - 8]; + lpScreen[pScn + 0 + 1] = lpScreen[pScn - 8 + 1]; + lpScreen[pScn + 0 + 2] = lpScreen[pScn - 8 + 2]; + lpScreen[pScn + 0 + 3] = lpScreen[pScn - 8 + 3]; + + lpScreen[pScn + 4] = lpScreen[pScn - 4]; + lpScreen[pScn + 4 + 1] = lpScreen[pScn - 4 + 1]; + lpScreen[pScn + 4 + 2] = lpScreen[pScn - 4 + 2]; + lpScreen[pScn + 4 + 3] = lpScreen[pScn - 4 + 3]; + + BGwrite[pBGw + 0] = BGwrite[pBGw - 1]; + } + else + { + cache_tile = tileadr; + cache_attr = attr; + chr_l = MMU.PPU_MEM_BANK[tileadr >> 10][tileadr & 0x03FF]; + chr_h = MMU.PPU_MEM_BANK[tileadr >> 10][(tileadr & 0x03FF) + 8]; + BGwrite[pBGw] = (byte)(chr_h | chr_l); + + int pBGPAL = attr; + { + int c1 = ((chr_l >> 1) & 0x55) | (chr_h & 0xAA); + int c2 = (chr_l & 0x55) | ((chr_h << 1) & 0xAA); + lpScreen[pScn + 0] = MMU.BGPAL[pBGPAL + (c1 >> 6)]; + lpScreen[pScn + 4] = MMU.BGPAL[pBGPAL + ((c1 >> 2) & 3)]; + lpScreen[pScn + 1] = MMU.BGPAL[pBGPAL + ((c1 >> 6))]; + lpScreen[pScn + 5] = MMU.BGPAL[pBGPAL + ((c2 >> 2) & 3)]; + lpScreen[pScn + 2] = MMU.BGPAL[pBGPAL + ((c1 >> 4) & 3)]; + lpScreen[pScn + 6] = MMU.BGPAL[pBGPAL + (c1 & 3)]; + lpScreen[pScn + 3] = MMU.BGPAL[pBGPAL + ((c2 >> 4) & 3)]; + lpScreen[pScn + 7] = MMU.BGPAL[pBGPAL + (c2 & 3)]; + } + } + pScn += 8; + pBGw++; + + // Character latch(For MMC2/MMC4) + if (bChrLatch) + { + nes.mapper.PPU_ChrLatch((ushort)(tileadr)); + } + + if (++ntbl_x == 32) + { + ntbl_x = 0; + ntbladr ^= 0x41F; + attradr = 0x03C0 + ((ntbladr & 0x0380) >> 4); + pNTBL = MMU.PPU_MEM_BANK[ntbladr >> 10]; + } + else + { + ntbladr++; + } + } + } + else + { + // With Extension Latch(For MMC5) + pScn = lpScanline + (8 - loopy_shift); + pBGw = 0; + + int ntbladr = 0x2000 + (MMU.loopy_v & 0x0FFF); + int ntbl_x = ntbladr & 0x1F; + + int cache_tile = unchecked((int)(0xFFFF0000)); + byte cache_attr = 0xFF; + + byte exattr = 0; + chr_h = chr_l = attr = 0; + + for (int i = 0; i < 33; i++) + { + nes.mapper.PPU_ExtLatchX(i); + nes.mapper.PPU_ExtLatch((ushort)ntbladr, ref chr_l, ref chr_h, ref exattr); + attr = (byte)(exattr & 0x0C); + + if (cache_tile != ((chr_h << 8) + chr_l) || cache_attr != attr) + { + cache_tile = ((chr_h << 8) + chr_l); + cache_attr = attr; + BGwrite[pBGw] = (byte)(chr_h | chr_l); + + int pBGPAL = attr; + { + int c1 = ((chr_l >> 1) & 0x55) | (chr_h & 0xAA); + int c2 = (chr_l & 0x55) | ((chr_h << 1) & 0xAA); + lpScreen[pScn + 0] = MMU.BGPAL[pBGPAL + (c1 >> 6)]; + lpScreen[pScn + 4] = MMU.BGPAL[pBGPAL + ((c1 >> 2) & 3)]; + lpScreen[pScn + 1] = MMU.BGPAL[pBGPAL + (c2 >> 6)]; + lpScreen[pScn + 5] = MMU.BGPAL[pBGPAL + ((c2 >> 2) & 3)]; + lpScreen[pScn + 2] = MMU.BGPAL[pBGPAL + ((c1 >> 4) & 3)]; + lpScreen[pScn + 6] = MMU.BGPAL[pBGPAL + (c1 & 3)]; + lpScreen[pScn + 3] = MMU.BGPAL[pBGPAL + ((c2 >> 4) & 3)]; + lpScreen[pScn + 7] = MMU.BGPAL[pBGPAL + (c2 & 3)]; + } + } + else + { + lpScreen[pScn + 0] = lpScreen[pScn - 8]; + lpScreen[pScn + 0 + 1] = lpScreen[pScn - 8 + 1]; + lpScreen[pScn + 0 + 2] = lpScreen[pScn - 8 + 2]; + lpScreen[pScn + 0 + 3] = lpScreen[pScn - 8 + 3]; + + lpScreen[pScn + 4] = lpScreen[pScn - 4]; + lpScreen[pScn + 4 + 1] = lpScreen[pScn - 4 + 1]; + lpScreen[pScn + 4 + 2] = lpScreen[pScn - 4 + 2]; + lpScreen[pScn + 4 + 3] = lpScreen[pScn - 4 + 3]; + + BGwrite[pBGw + 0] = BGwrite[pBGw - 1]; + } + pScn += 8; + pBGw++; + + if (++ntbl_x == 32) + { + ntbl_x = 0; + ntbladr ^= 0x41F; + } + else + { + ntbladr++; + } + } + } + } + else + { + if (!bExtLatch) + { + // Without Extension Latch + if (!bExtNameTable) + { + pScn = lpScanline + (8 - loopy_shift); + pBGw = 0; + + int ntbladr = 0x2000 + (MMU.loopy_v & 0x0FFF); + int attradr = 0x03C0 + ((MMU.loopy_v & 0x0380) >> 4); + int ntbl_x = ntbladr & 0x001F; + int attrsft = (ntbladr & 0x0040) >> 4; + var pNTBL = MMU.PPU_MEM_BANK[ntbladr >> 10]; + + int tileadr = 0; + int cache_tile = unchecked((int)(0xFFFF0000)); + byte cache_attr = 0xFF; + + chr_h = chr_l = attr = 0; + + for (int i = 0; i < 33; i++) + { + tileadr = ((MMU.PPUREG[0] & PPU_BGTBL_BIT) << 8) + pNTBL[ntbladr & 0x03FF] * 0x10 + loopy_y; + + if (i != 0) + { + nes.EmulationCPU(NES.FETCH_CYCLES * 4); + } + + attr = (byte)(((pNTBL[attradr + (ntbl_x >> 2)] >> ((ntbl_x & 2) + attrsft)) & 3) << 2); + + if (cache_tile != tileadr || cache_attr != attr) + { + cache_tile = tileadr; + cache_attr = attr; + + chr_l = MMU.PPU_MEM_BANK[tileadr >> 10][tileadr & 0x03FF]; + chr_h = MMU.PPU_MEM_BANK[tileadr >> 10][(tileadr & 0x03FF) + 8]; + lpScreen[pBGw] = (byte)(chr_l | chr_h); + + int pBGPAL = attr; + { + int c1 = ((chr_l >> 1) & 0x55) | (chr_h & 0xAA); + int c2 = (chr_l & 0x55) | ((chr_h << 1) & 0xAA); + lpScreen[pScn + 0] = MMU.BGPAL[pBGPAL + (c1 >> 6)]; + lpScreen[pScn + 4] = MMU.BGPAL[pBGPAL + ((c1 >> 2) & 3)]; + lpScreen[pScn + 1] = MMU.BGPAL[pBGPAL + ((c2 >> 6))]; + lpScreen[pScn + 5] = MMU.BGPAL[pBGPAL + ((c2 >> 2) & 3)]; + lpScreen[pScn + 2] = MMU.BGPAL[pBGPAL + ((c1 >> 4) & 3)]; + lpScreen[pScn + 6] = MMU.BGPAL[pBGPAL + (c1 & 3)]; + lpScreen[pScn + 3] = MMU.BGPAL[pBGPAL + ((c2 >> 4) & 3)]; + lpScreen[pScn + 7] = MMU.BGPAL[pBGPAL + (c2 & 3)]; + } + } + else + { + lpScreen[pScn + 0] = lpScreen[pScn - 8]; + lpScreen[pScn + 0 + 1] = lpScreen[pScn - 8 + 1]; + lpScreen[pScn + 0 + 2] = lpScreen[pScn - 8 + 2]; + lpScreen[pScn + 0 + 3] = lpScreen[pScn - 8 + 3]; + + lpScreen[pScn + 4] = lpScreen[pScn - 4]; + lpScreen[pScn + 4 + 1] = lpScreen[pScn - 4 + 1]; + lpScreen[pScn + 4 + 2] = lpScreen[pScn - 4 + 2]; + lpScreen[pScn + 4 + 3] = lpScreen[pScn - 4 + 3]; + + BGwrite[pBGw + 0] = BGwrite[pBGw - 1]; + } + pScn += 8; + pBGw++; + + // Character latch(For MMC2/MMC4) + if (bChrLatch) + { + nes.mapper.PPU_ChrLatch((ushort)(tileadr)); + } + + if (++ntbl_x == 32) + { + ntbl_x = 0; + ntbladr ^= 0x41F; + attradr = 0x03C0 + ((ntbladr & 0x0380) >> 4); + pNTBL = MMU.PPU_MEM_BANK[ntbladr >> 10]; + } + else + { + ntbladr++; + } + } + } + else + { + pScn = lpScanline + (8 - loopy_shift); + pBGw = 0; + + int ntbladr; + int tileadr; + int cache_tile = unchecked((int)(0xFFFF0000)); + byte cache_attr = 0xFF; + + chr_h = chr_l = attr = 0; + + ushort loopy_v_tmp = MMU.loopy_v; + + for (int i = 0; i < 33; i++) + { + if (i != 0) + { + nes.EmulationCPU(NES.FETCH_CYCLES * 4); + } + + ntbladr = 0x2000 + (MMU.loopy_v & 0x0FFF); + tileadr = ((MMU.PPUREG[0] & PPU_BGTBL_BIT) << 8) + MMU.PPU_MEM_BANK[ntbladr >> 10][ntbladr & 0x03FF] * 0x10 + ((MMU.loopy_v & 0x7000) >> 12); + attr = (byte)(((MMU.PPU_MEM_BANK[ntbladr >> 10][0x03C0 + ((ntbladr & 0x0380) >> 4) + ((ntbladr & 0x001C) >> 2)] >> (((ntbladr & 0x40) >> 4) + (ntbladr & 0x02))) & 3) << 2); + + if (cache_tile != tileadr || cache_attr != attr) + { + cache_tile = tileadr; + cache_attr = attr; + + chr_l = MMU.PPU_MEM_BANK[tileadr >> 10][tileadr & 0x03FF]; + chr_h = MMU.PPU_MEM_BANK[tileadr >> 10][(tileadr & 0x03FF) + 8]; + BGwrite[pBGw] = (byte)(chr_l | chr_h); + + int pBGPAL = attr; + { + int c1 = ((chr_l >> 1) & 0x55) | (chr_h & 0xAA); + int c2 = (chr_l & 0x55) | ((chr_h << 1) & 0xAA); + lpScreen[pScn + 0] = MMU.BGPAL[pBGPAL + (c1 >> 6)]; + lpScreen[pScn + 4] = MMU.BGPAL[pBGPAL + ((c1 >> 2) & 3)]; + lpScreen[pScn + 1] = MMU.BGPAL[pBGPAL + (c2 >> 6)]; + lpScreen[pScn + 5] = MMU.BGPAL[pBGPAL + ((c2 >> 2) & 3)]; + lpScreen[pScn + 2] = MMU.BGPAL[pBGPAL + ((c1 >> 4) & 3)]; + lpScreen[pScn + 6] = MMU.BGPAL[pBGPAL + (c1 & 3)]; + lpScreen[pScn + 3] = MMU.BGPAL[pBGPAL + ((c2 >> 4) & 3)]; + lpScreen[pScn + 7] = MMU.BGPAL[pBGPAL + (c2 & 3)]; + } + } + else + { + lpScreen[pScn + 0] = lpScreen[pScn - 8]; + lpScreen[pScn + 0 + 1] = lpScreen[pScn - 8 + 1]; + lpScreen[pScn + 0 + 2] = lpScreen[pScn - 8 + 2]; + lpScreen[pScn + 0 + 3] = lpScreen[pScn - 8 + 3]; + + lpScreen[pScn + 4] = lpScreen[pScn - 4]; + lpScreen[pScn + 4 + 1] = lpScreen[pScn - 4 + 1]; + lpScreen[pScn + 4 + 2] = lpScreen[pScn - 4 + 2]; + lpScreen[pScn + 4 + 3] = lpScreen[pScn - 4 + 3]; + + BGwrite[pBGw + 0] = BGwrite[pBGw - 1]; + } + pScn += 8; + pBGw++; + + // Character latch(For MMC2/MMC4) + if (bChrLatch) + { + nes.mapper.PPU_ChrLatch((ushort)tileadr); + } + + if ((MMU.loopy_v & 0x1F) == 0x1F) + { + MMU.loopy_v ^= 0x041F; + } + else + { + MMU.loopy_v++; + } + } + MMU.loopy_v = loopy_v_tmp; + } + } + else + { + // With Extension Latch(For MMC5) + pScn = lpScanline + (8 - loopy_shift); + pBGw = 0; + + int ntbladr = 0x2000 + (MMU.loopy_v & 0x0FFF); + int ntbl_x = ntbladr & 0x1F; + + int cache_tile = unchecked((int)0xFFFF0000); + byte cache_attr = 0xFF; + + byte exattr = 0; + chr_h = chr_l = attr = 0; + + for (int i = 0; i < 33; i++) + { + if (i != 0) + { + nes.EmulationCPU(NES.FETCH_CYCLES * 4); + } + nes.mapper.PPU_ExtLatchX(i); + nes.mapper.PPU_ExtLatch((ushort)ntbladr, ref chr_l, ref chr_h, ref exattr); + attr = (byte)(exattr & 0x0C); + + if (cache_tile != ((chr_h << 8) + chr_l) || cache_attr != attr) + { + cache_tile = ((chr_h << 8) + chr_l); + cache_attr = attr; + BGwrite[pBGw] = (byte)(chr_l | chr_h); + + int pBGPAL = attr; + { + int c1 = ((chr_l >> 1) & 0x55) | (chr_h & 0xAA); + int c2 = (chr_l & 0x55) | ((chr_h << 1) & 0xAA); + lpScreen[pScn + 0] = MMU.BGPAL[pBGPAL + ((c1 >> 6))]; + lpScreen[pScn + 4] = MMU.BGPAL[pBGPAL + ((c1 >> 2) & 3)]; + lpScreen[pScn + 1] = MMU.BGPAL[pBGPAL + ((c2 >> 6))]; + lpScreen[pScn + 5] = MMU.BGPAL[pBGPAL + ((c2 >> 2) & 3)]; + lpScreen[pScn + 2] = MMU.BGPAL[pBGPAL + ((c1 >> 4) & 3)]; + lpScreen[pScn + 6] = MMU.BGPAL[pBGPAL + (c1 & 3)]; + lpScreen[pScn + 3] = MMU.BGPAL[pBGPAL + ((c2 >> 4) & 3)]; + lpScreen[pScn + 7] = MMU.BGPAL[pBGPAL + (c2 & 3)]; + } + } + else + { + lpScreen[pScn + 0] = lpScreen[pScn - 8]; + lpScreen[pScn + 0 + 1] = lpScreen[pScn - 8 + 1]; + lpScreen[pScn + 0 + 2] = lpScreen[pScn - 8 + 2]; + lpScreen[pScn + 0 + 3] = lpScreen[pScn - 8 + 3]; + + lpScreen[pScn + 4] = lpScreen[pScn - 4]; + lpScreen[pScn + 4 + 1] = lpScreen[pScn - 4 + 1]; + lpScreen[pScn + 4 + 2] = lpScreen[pScn - 4 + 2]; + lpScreen[pScn + 4 + 3] = lpScreen[pScn - 4 + 3]; + + BGwrite[pBGw + 0] = BGwrite[pBGw - 1]; + } + pScn += 8; + pBGw++; + + if (++ntbl_x == 32) + { + ntbl_x = 0; + ntbladr ^= 0x41F; + } + else + { + ntbladr++; + } + } + } + } + if ((MMU.PPUREG[1] & PPU_BGCLIP_BIT) == 0 && bLeftClip) + { + pScn = lpScanline + 8; + for (int i = 0; i < 8; i++) + { + lpScreen[i] = MMU.BGPAL[0]; + } + } + } + + // Render sprites + var temp = ~PPU_SPMAX_FLAG; + MMU.PPUREG[2] = (byte)(MMU.PPUREG[2] & temp); + + // 昞帵婜娫奜偱偁傟偽僉儍儞僙儖 + if (scanline > 239) + return; + + if ((MMU.PPUREG[1] & PPU_SPDISP_BIT) == 0) + { + return; + } + + int spmax = 0; + int spraddr = 0, sp_y = 0, sp_h = 0; + chr_h = chr_l = 0; + + + pBGw = 0; + int pSPw = 0; + int pBit2Rev = 0; + + MemoryUtility.ZEROMEMORY(SPwrite, SPwrite.Length); + + spmax = 0; + Sprite sp = new Sprite(MMU.SPRAM, 0); + sp_h = (MMU.PPUREG[0] & PPU_SP16_BIT) != 0 ? 15 : 7; + + // Left clip + if (bLeftClip && ((MMU.PPUREG[1] & PPU_SPCLIP_BIT) == 0)) + { + SPwrite[0] = 0xFF; + } + + for (int i = 0; i < 64; i++, sp.AddOffset(1)) + { + sp_y = scanline - (sp.y + 1); + // 僗僉儍儞儔僀儞撪偵SPRITE偑懚嵼偡傞偐傪僠僃僢僋 + if (sp_y != (sp_y & sp_h)) + continue; + + if ((MMU.PPUREG[0] & PPU_SP16_BIT) == 0) + { + // 8x8 Sprite + spraddr = ((MMU.PPUREG[0] & PPU_SPTBL_BIT) << 9) + (sp.tile << 4); + if ((sp.attr & SP_VMIRROR_BIT) == 0) + spraddr += sp_y; + else + spraddr += 7 - sp_y; + } + else + { + // 8x16 Sprite + spraddr = ((sp.tile & 1) << 12) + ((sp.tile & 0xFE) << 4); + if ((sp.attr & SP_VMIRROR_BIT) == 0) + spraddr += ((sp_y & 8) << 1) + (sp_y & 7); + else + spraddr += ((~sp_y & 8) << 1) + (7 - (sp_y & 7)); + } + // Character pattern + chr_l = MMU.PPU_MEM_BANK[spraddr >> 10][spraddr & 0x3FF]; + chr_h = MMU.PPU_MEM_BANK[spraddr >> 10][(spraddr & 0x3FF) + 8]; + + // Character latch(For MMC2/MMC4) + if (bChrLatch) + { + nes.mapper.PPU_ChrLatch((ushort)spraddr); + } + + // pattern mask + if ((sp.attr & SP_HMIRROR_BIT) != 0) + { + chr_l = Bit2Rev[pBit2Rev + chr_l]; + chr_h = Bit2Rev[pBit2Rev + chr_h]; + } + byte SPpat = (byte)(chr_l | chr_h); + + // Sprite hitcheck + if (i == 0 && (MMU.PPUREG[2] & PPU_SPHIT_FLAG) == 0) + { + int BGpos = ((sp.x & 0xF8) + ((loopy_shift + (sp.x & 7)) & 8)) >> 3; + int BGsft = 8 - ((loopy_shift + sp.x) & 7); + + var temp1 = BGwrite[pBGw + BGpos + 0] << 8; + var temp2 = BGwrite[pBGw + BGpos + 1]; + byte BGmsk = (byte)((temp1 | temp2) >> BGsft); + + if ((SPpat & BGmsk) != 0) + { + MMU.PPUREG[2] |= PPU_SPHIT_FLAG; + } + } + + // Sprite mask + int SPpos = sp.x / 8; + int SPsft = 8 - (sp.x & 7); + byte SPmsk = (byte)((SPwrite[pSPw + SPpos + 0] << 8 | SPwrite[pSPw + SPpos + 1]) >> SPsft); + ushort SPwrt = (ushort)(SPpat << SPsft); + SPwrite[pSPw + SPpos + 0] = (byte)(SPwrite[pSPw + SPpos + 0] | SPwrt >> 8); + SPwrite[pSPw + SPpos + 1] = (byte)(SPwrite[pSPw + SPpos + 1] | SPwrt & 0xFF); + SPpat = (byte)(SPpat & ~SPmsk); + + if ((sp.attr & SP_PRIORITY_BIT) != 0) + { + // BG > SP priority + int BGpos = ((sp.x & 0xF8) + ((loopy_shift + (sp.x & 7)) & 8)) >> 3; + int BGsft = 8 - ((loopy_shift + sp.x) & 7); + byte BGmsk = (byte)(((BGwrite[pBGw + BGpos + 0] << 8) | BGwrite[pBGw + BGpos + 1]) >> BGsft); + + SPpat = (byte)(SPpat & ~BGmsk); + } + + // Attribute + int pSPPAL = (sp.attr & SP_COLOR_BIT) << 2; + // Ptr + pScn = lpScanline + sp.x + 8; + + if (!bExtMono) + { + int c1 = ((chr_l >> 1) & 0x55) | (chr_h & 0xAA); + int c2 = (chr_l & 0x55) | ((chr_h << 1) & 0xAA); + if ((SPpat & 0x80) != 0) lpScreen[pScn + 0] = MMU.SPPAL[pSPPAL + (c1 >> 6)]; + if ((SPpat & 0x08) != 0) lpScreen[pScn + 4] = MMU.SPPAL[pSPPAL + ((c1 >> 2) & 3)]; + if ((SPpat & 0x40) != 0) lpScreen[pScn + 1] = MMU.SPPAL[pSPPAL + ((c2 >> 6))]; + if ((SPpat & 0x04) != 0) lpScreen[pScn + 5] = MMU.SPPAL[pSPPAL + ((c2 >> 2) & 3)]; + if ((SPpat & 0x20) != 0) lpScreen[pScn + 2] = MMU.SPPAL[pSPPAL + ((c1 >> 4) & 3)]; + if ((SPpat & 0x02) != 0) lpScreen[pScn + 6] = MMU.SPPAL[pSPPAL + (c1 & 3)]; + if ((SPpat & 0x10) != 0) lpScreen[pScn + 3] = MMU.SPPAL[pSPPAL + ((c2 >> 4) & 3)]; + if ((SPpat & 0x01) != 0) lpScreen[pScn + 7] = MMU.SPPAL[pSPPAL + (c2 & 3)]; + } + else + { + // Monocrome effect (for Final Fantasy) + byte mono = BGmono[((sp.x & 0xF8) + ((loopy_shift + (sp.x & 7)) & 8)) >> 3]; + + int c1 = ((chr_l >> 1) & 0x55) | (chr_h & 0xAA); + int c2 = (chr_l & 0x55) | ((chr_h << 1) & 0xAA); + if ((SPpat & 0x80) != 0) lpScreen[pScn + 0] = (byte)(MMU.SPPAL[pSPPAL + (c1 >> 6)] | mono); + if ((SPpat & 0x08) != 0) lpScreen[pScn + 4] = (byte)(MMU.SPPAL[pSPPAL + ((c1 >> 2) & 3)] | mono); + if ((SPpat & 0x40) != 0) lpScreen[pScn + 1] = (byte)(MMU.SPPAL[pSPPAL + (c2 >> 6)] | mono); + if ((SPpat & 0x04) != 0) lpScreen[pScn + 5] = (byte)(MMU.SPPAL[pSPPAL + ((c2 >> 2) & 3)] | mono); + if ((SPpat & 0x20) != 0) lpScreen[pScn + 2] = (byte)(MMU.SPPAL[pSPPAL + ((c1 >> 4) & 3)] | mono); + if ((SPpat & 0x02) != 0) lpScreen[pScn + 6] = (byte)(MMU.SPPAL[pSPPAL + (c1 & 3)] | mono); + if ((SPpat & 0x10) != 0) lpScreen[pScn + 3] = (byte)(MMU.SPPAL[pSPPAL + ((c2 >> 4) & 3)] | mono); + if ((SPpat & 0x01) != 0) lpScreen[pScn + 7] = (byte)(MMU.SPPAL[pSPPAL + (c2 & 3)] | mono); + } + + if (++spmax > 8 - 1) + { + if (!bMax) + break; + } + } + if (spmax > 8 - 1) + { + MMU.PPUREG[2] |= PPU_SPMAX_FLAG; + } + } + + internal bool IsSprite0(int scanline) + { + // 僗僾儔僀僩orBG旕昞帵偼僉儍儞僙儖(僸僢僩偟側偄) + if ((MMU.PPUREG[1] & (PPU_SPDISP_BIT | PPU_BGDISP_BIT)) != (PPU_SPDISP_BIT | PPU_BGDISP_BIT)) + return false; + + // 婛偵僸僢僩偟偰偄偨傜僉儍儞僙儖 + if ((MMU.PPUREG[2] & PPU_SPHIT_FLAG) != 0) + return false; + + if ((MMU.PPUREG[0] & PPU_SP16_BIT) == 0) + { + // 8x8 + if ((scanline < MMU.SPRAM[0] + 1) || (scanline > (MMU.SPRAM[0] + 7 + 1))) + return false; + } + else + { + // 8x16 + if ((scanline < MMU.SPRAM[0] + 1) || (scanline > (MMU.SPRAM[0] + 15 + 1))) + return false; + } + + return true; + } + + internal void DummyScanline(int scanline) + { + int i; + int spmax; + int sp_h; + + MMU.PPUREG[2] = (byte)(MMU.PPUREG[2] & ~PPU_SPMAX_FLAG); + + // 僗僾儔僀僩旕昞帵偼僉儍儞僙儖 + if ((MMU.PPUREG[1] & PPU_SPDISP_BIT) == 0) + return; + + // 昞帵婜娫奜偱偁傟偽僉儍儞僙儖 + if (scanline < 0 || scanline > 239) + return; + + Sprite sp = new Sprite(MMU.SPRAM, 0); + sp_h = (MMU.PPUREG[0] & PPU_SP16_BIT) != 0 ? 15 : 7; + + spmax = 0; + // Sprite Max check + for (i = 0; i < 64; i++, sp.AddOffset(1)) + { + // 僗僉儍儞儔僀儞撪偵SPRITE偑懚嵼偡傞偐傪僠僃僢僋 + if ((scanline < sp.y + 1) || (scanline > (sp.y + sp_h + 1))) + { + continue; + } + + if (++spmax > 8 - 1) + { + MMU.PPUREG[2] |= PPU_SPMAX_FLAG; + break; + } + } + } + + internal void VBlankEnd() + { + MMU.PPUREG[2] = (byte)(MMU.PPUREG[2] & ~PPU_VBLANK_FLAG); + // VBlank扙弌帪偵僋儕傾偝傟傞 + // 僄僉僒僀僩僶僀僋偱廳梫 + MMU.PPUREG[2] = (byte)(MMU.PPUREG[2] & ~PPU_SPHIT_FLAG); + } + + internal void VBlankStart() + { + MMU.PPUREG[2] |= PPU_VBLANK_FLAG; + } + + public uint[] GetScreenPtr() + { + return lpScreen; + } + + public byte[] GetLineColorMode() + { + return lpColormode; + } + + internal void SetScreenPtr(uint[] screenBuffer, byte[] colormode) + { + lpScreen = screenBuffer; + lpColormode = colormode; + } + + + internal bool IsDispON() + { + return (MMU.PPUREG[1] & (PPU_BGDISP_BIT | PPU_SPDISP_BIT)) != 0; + } + + internal void SetExtLatchMode(bool bMode) + { + bExtLatch = bMode; + } + + internal ushort GetPPUADDR() + { + return MMU.loopy_v; + } + + internal ushort GetTILEY() + { + return loopy_y; + } + + internal void SetChrLatchMode(bool bMode) + { + bChrLatch = bMode; + } + + internal void SetExtNameTableMode(bool bMode) + { + bExtNameTable = bMode; + } + + internal void SetExtMonoMode(bool bMode) + { + bExtMono = bMode; + } + + internal int GetScanlineNo() + { + return ScanlineNo; + } + + public struct Sprite + { + public byte y + { + get => raw[offset + 0]; + set => raw[offset + 0] = value; + } + + public byte tile + { + get => raw[offset + 1]; + set => raw[offset + 1] = value; + } + public byte attr + { + get => raw[offset + 2]; + set => raw[offset + 2] = value; + } + public byte x + { + get => raw[offset + 3]; + set => raw[offset + 3] = value; + } + + private byte[] raw; + private int offset; + + public Sprite(byte[] raw, int offset) + { + this.raw = raw; + this.offset = offset * 4; + } + + public void AddOffset(int offset) + { + this.offset += offset * 4; + } + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PPU.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PPU.cs.meta new file mode 100644 index 0000000..69b6056 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PPU.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2a695378c1666b7458e1be6efe468433 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX.meta new file mode 100644 index 0000000..c9a6921 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 69e7ee7384266604db7cac0b95c6f836 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD.cs new file mode 100644 index 0000000..24468c6 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD.cs @@ -0,0 +1,24 @@ +namespace VirtualNes.Core +{ + public class EXPAD + { + protected NES nes; + + public EXPAD(NES parent) + { + nes = parent; + } + + public virtual void Dispose() { } + + public virtual void Reset() { } + public virtual void Strobe() { } + public virtual byte Read4016() { return 0x00; } + public virtual byte Read4017() { return 0x00; } + public virtual void Write4016(byte data) { } + public virtual void Write4017(byte data) { } + public virtual void Sync() { } + public virtual void SetSyncData(int type, int data) { } + public virtual int GetSyncData(int type) { return 0x00; } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD.cs.meta new file mode 100644 index 0000000..cd111ca --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 93b9e4ea918e52a45aab8f87b9dc17c5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_CrazyClimber.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_CrazyClimber.cs new file mode 100644 index 0000000..83b288e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_CrazyClimber.cs @@ -0,0 +1,9 @@ +namespace VirtualNes.Core +{ + internal class EXPAD_CrazyClimber : EXPAD + { + public EXPAD_CrazyClimber(NES parent) : base(parent) + { + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_CrazyClimber.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_CrazyClimber.cs.meta new file mode 100644 index 0000000..e3a9670 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_CrazyClimber.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2d7ac655210edb74ea198ad8802cb545 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_ExcitingBoxing.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_ExcitingBoxing.cs new file mode 100644 index 0000000..99e5a1d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_ExcitingBoxing.cs @@ -0,0 +1,9 @@ +namespace VirtualNes.Core +{ + internal class EXPAD_ExcitingBoxing : EXPAD + { + public EXPAD_ExcitingBoxing(NES parent) : base(parent) + { + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_ExcitingBoxing.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_ExcitingBoxing.cs.meta new file mode 100644 index 0000000..8e05b0c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_ExcitingBoxing.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2ac6f1c51a9c1b64e970bc5fe5e00b9a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_FamlyTrainer.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_FamlyTrainer.cs new file mode 100644 index 0000000..5fe5815 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_FamlyTrainer.cs @@ -0,0 +1,9 @@ +namespace VirtualNes.Core +{ + internal class EXPAD_FamlyTrainer : EXPAD + { + public EXPAD_FamlyTrainer(NES parent) : base(parent) + { + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_FamlyTrainer.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_FamlyTrainer.cs.meta new file mode 100644 index 0000000..7e30479 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_FamlyTrainer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5a2cfbbbe2b90bd4ba754bc9a8f014af +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Gyromite.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Gyromite.cs new file mode 100644 index 0000000..4b62af2 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Gyromite.cs @@ -0,0 +1,9 @@ +namespace VirtualNes.Core +{ + internal class EXPAD_Gyromite : EXPAD + { + public EXPAD_Gyromite(NES parent) : base(parent) + { + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Gyromite.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Gyromite.cs.meta new file mode 100644 index 0000000..50334ac --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Gyromite.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c49edbe29e34f0245b621a7920d4981e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_HyperShot.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_HyperShot.cs new file mode 100644 index 0000000..ac2e89e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_HyperShot.cs @@ -0,0 +1,9 @@ +namespace VirtualNes.Core +{ + internal class EXPAD_HyperShot : EXPAD + { + public EXPAD_HyperShot(NES parent) : base(parent) + { + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_HyperShot.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_HyperShot.cs.meta new file mode 100644 index 0000000..cded73b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_HyperShot.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ac43bf6e282394c46b8ea717595d8664 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Keyboard.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Keyboard.cs new file mode 100644 index 0000000..64585c8 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Keyboard.cs @@ -0,0 +1,9 @@ +namespace VirtualNes.Core +{ + internal class EXPAD_Keyboard : EXPAD + { + public EXPAD_Keyboard(NES parent) : base(parent) + { + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Keyboard.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Keyboard.cs.meta new file mode 100644 index 0000000..c894781 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Keyboard.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1f56b9a9d01afad4b967b5d606f7ef11 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Mahjang.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Mahjang.cs new file mode 100644 index 0000000..841f5d5 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Mahjang.cs @@ -0,0 +1,9 @@ +namespace VirtualNes.Core +{ + internal class EXPAD_Mahjang : EXPAD + { + public EXPAD_Mahjang(NES parent) : base(parent) + { + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Mahjang.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Mahjang.cs.meta new file mode 100644 index 0000000..b1541a1 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Mahjang.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 146c88b5d0fab5b43ba7e570f0ff116b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_OekakidsTablet.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_OekakidsTablet.cs new file mode 100644 index 0000000..50c7560 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_OekakidsTablet.cs @@ -0,0 +1,9 @@ +namespace VirtualNes.Core +{ + internal class EXPAD_OekakidsTablet : EXPAD + { + public EXPAD_OekakidsTablet(NES parent) : base(parent) + { + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_OekakidsTablet.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_OekakidsTablet.cs.meta new file mode 100644 index 0000000..bdc8d51 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_OekakidsTablet.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 47337ac29c001d047a911c028e305b43 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Paddle.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Paddle.cs new file mode 100644 index 0000000..3536731 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Paddle.cs @@ -0,0 +1,9 @@ +namespace VirtualNes.Core +{ + public class EXPAD_Paddle : EXPAD + { + public EXPAD_Paddle(NES parent) : base(parent) + { + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Paddle.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Paddle.cs.meta new file mode 100644 index 0000000..ab492a0 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Paddle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8e48f82e9b202e64fa7ebe3816804ae9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_SpaceShadowGun.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_SpaceShadowGun.cs new file mode 100644 index 0000000..1d8d370 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_SpaceShadowGun.cs @@ -0,0 +1,9 @@ +namespace VirtualNes.Core +{ + internal class EXPAD_SpaceShadowGun : EXPAD + { + public EXPAD_SpaceShadowGun(NES parent) : base(parent) + { + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_SpaceShadowGun.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_SpaceShadowGun.cs.meta new file mode 100644 index 0000000..a0bd98c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_SpaceShadowGun.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 01ac1bc69454b414cb5a9db1d12f1aac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Supor_Keyboard.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Supor_Keyboard.cs new file mode 100644 index 0000000..f93347a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Supor_Keyboard.cs @@ -0,0 +1,9 @@ +namespace VirtualNes.Core +{ + internal class EXPAD_Supor_Keyboard : EXPAD + { + public EXPAD_Supor_Keyboard(NES parent) : base(parent) + { + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Supor_Keyboard.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Supor_Keyboard.cs.meta new file mode 100644 index 0000000..0060455 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Supor_Keyboard.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5adc370589ec4bf42b7ea0c20acb2a48 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Toprider.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Toprider.cs new file mode 100644 index 0000000..3a58afb --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Toprider.cs @@ -0,0 +1,9 @@ +namespace VirtualNes.Core +{ + internal class EXPAD_Toprider : EXPAD + { + public EXPAD_Toprider(NES parent) : base(parent) + { + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Toprider.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Toprider.cs.meta new file mode 100644 index 0000000..8ec93a3 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Toprider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b0b1053511d6f224a840b0e9df4f9889 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_TurboFile.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_TurboFile.cs new file mode 100644 index 0000000..f124e65 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_TurboFile.cs @@ -0,0 +1,9 @@ +namespace VirtualNes.Core +{ + internal class EXPAD_TurboFile : EXPAD + { + public EXPAD_TurboFile(NES parent) : base(parent) + { + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_TurboFile.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_TurboFile.cs.meta new file mode 100644 index 0000000..ac3ba2e --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_TurboFile.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7b6b41e81a80079489f60eaa5be220cd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_VSUnisystem.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_VSUnisystem.cs new file mode 100644 index 0000000..e4dff20 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_VSUnisystem.cs @@ -0,0 +1,9 @@ +namespace VirtualNes.Core +{ + internal class EXPAD_VSUnisystem : EXPAD + { + public EXPAD_VSUnisystem(NES parent) : base(parent) + { + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_VSUnisystem.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_VSUnisystem.cs.meta new file mode 100644 index 0000000..5f0b371 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_VSUnisystem.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d343a07cca05ea642be6db80607ea23a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_VSZapper.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_VSZapper.cs new file mode 100644 index 0000000..8a1480b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_VSZapper.cs @@ -0,0 +1,9 @@ +namespace VirtualNes.Core +{ + internal class EXPAD_VSZapper : EXPAD + { + public EXPAD_VSZapper(NES parent) : base(parent) + { + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_VSZapper.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_VSZapper.cs.meta new file mode 100644 index 0000000..34798b6 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_VSZapper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6803ff5b7be6edc49ba2b71256aa16a3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Zapper.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Zapper.cs new file mode 100644 index 0000000..cec643c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Zapper.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VirtualNes.Core +{ + /// + /// 光枪 + /// + public class EXPAD_Zapper : EXPAD + { + public EXPAD_Zapper(NES parent) : base(parent) + { + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Zapper.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Zapper.cs.meta new file mode 100644 index 0000000..75db078 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/PadEX/EXPAD_Zapper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c378fd8c53bb8084f979b05d2405bb9c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ROM.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ROM.cs new file mode 100644 index 0000000..776ede0 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ROM.cs @@ -0,0 +1,419 @@ +using System; +using System.IO; +using VirtualNes.Core.Debug; + +namespace VirtualNes.Core +{ + public class ROM + { + protected NESHEADER header; + protected NSFHEADER nsfheader; + protected string path; + protected string name; + protected string fullpath; + protected bool bPAL; + protected bool bNSF; + protected int NSF_PAGE_SIZE; + protected byte[] lpPRG; + protected byte[] lpCHR; + protected byte[] lpTrainer; + protected byte[] lpDiskBios; + protected byte[] lpDisk; + protected uint crc; + protected uint crcall; + protected uint crcvrom; + protected int mapper; + protected int diskno; + protected uint fdsmakerID; + protected uint fdsgameID; + + public ROM(string fname) + { + Stream fp = null; + byte[] temp = null; + byte[] bios = null; + long FileSize = 0; + + header = NESHEADER.GetDefault(); + path = string.Empty; + name = string.Empty; + + bPAL = false; + bNSF = false; + NSF_PAGE_SIZE = 0; + + lpPRG = lpCHR = lpTrainer = lpDiskBios = lpDisk = null; + + crc = crcall = 0; + mapper = 0; + diskno = 0; + + try + { + fp = Supporter.OpenRom(fname); + if (fp == null) + { + throw new System.Exception($"Open Rom Failed:[{fname}]"); + } + + FileSize = fp.Length; + if (FileSize < 17) + { + throw new System.Exception($"File too small:[{fname}]"); + } + + temp = new byte[FileSize]; + fp.Read(temp, 0, temp.Length); + + fp.Dispose(); + + header = NESHEADER.Read(temp); + + if (!header.CheckValid()) + throw new Exception($"rom file is not valid:[{fname}]"); + + ulong PRGoffset, CHRoffset; + long PRGsize = 0, CHRsize = 0; + + var romType = header.GetRomType(); + if (romType == EnumRomType.NES) + { + PRGsize = (long)header.PRG_PAGE_SIZE * 0x4000; + CHRsize = (long)header.CHR_PAGE_SIZE * 0x2000; + PRGoffset = (ulong)NESHEADER.SizeOf(); + CHRoffset = PRGoffset + (ulong)PRGsize; + + if (IsTRAINER()) + { + PRGoffset += 512; + CHRoffset += 512; + } + + if (PRGsize <= 0 || (PRGsize + CHRsize) > FileSize) + { + throw new Exception($"Invalid NesHeader:[{fname}]"); + } + + //PRG BANK + lpPRG = new byte[PRGsize]; + Array.Copy(temp, (int)PRGoffset, lpPRG, 0, PRGsize); + + //CHR BANK + if (CHRsize > 0) + { + lpCHR = new byte[CHRsize]; + if (FileSize >= (long)CHRoffset + CHRsize) + { + Array.Copy(temp, (int)CHRoffset, lpCHR, 0, CHRsize); + } + else + { + //CHR Bank太少... + CHRsize -= ((long)CHRoffset + CHRsize - FileSize); + Array.Copy(temp, (int)CHRoffset, lpCHR, 0, CHRsize); + } + } + else + { + lpCHR = null; + } + + if (IsTRAINER()) + { + lpTrainer = new byte[512]; + Array.Copy(temp, NESHEADER.SizeOf(), lpTrainer, 0, 512); + } + else + { + lpTrainer = null; + } + } + else if (romType == EnumRomType.FDS) + { + diskno = header.PRG_PAGE_SIZE; + + if (FileSize < (16 + 65500 * diskno)) + { + throw new Exception($"Illegal Disk Size:[{fname}]"); + } + if (diskno > 8) + { + throw new Exception($"Unsupport disk:[{fname}]"); + } + + header = NESHEADER.GetDefault(); + header.ID[0] = (byte)'N'; + header.ID[1] = (byte)'E'; + header.ID[2] = (byte)'S'; + header.ID[3] = 0x1A; + header.PRG_PAGE_SIZE = (byte)(diskno * 4); + header.CHR_PAGE_SIZE = 0; + header.control1 = 0x40; + header.control2 = 0x10; + + PRGsize = NESHEADER.SizeOf() + 65500 * diskno; + //PRG BANK + lpPRG = new byte[PRGsize]; + lpDisk = new byte[PRGsize]; + lpCHR = null; + + var headerBuffer = header.DataToBytes(); + Array.Copy(headerBuffer, lpPRG, headerBuffer.Length); + Array.Copy(temp, NESHEADER.SizeOf(), lpPRG, NESHEADER.SizeOf(), 65500 * diskno); + + lpPRG[0] = (byte)'F'; + lpPRG[1] = (byte)'D'; + lpPRG[2] = (byte)'S'; + lpPRG[3] = 0x1A; + lpPRG[4] = (byte)diskno; + + fp = Supporter.OpenFile_DISKSYS(); + if (fp == null) + { + throw new Exception($"Not found DISKSYS.ROM for [{fname}]"); + } + + FileSize = fp.Length; + if (FileSize < 17) + { + throw new Exception($"Small File Of DISKSYS.ROM"); + } + + bios = new byte[FileSize]; + fp.Read(bios, 0, (int)FileSize); + fp.Dispose(); + + lpDiskBios = new byte[8 * 1024]; + if (bios[0] == 'N' && bios[1] == 'E' && bios[2] == 'S' && bios[3] == 0x1A) + { + Array.Copy(bios, 0x6010, lpDiskBios, 0, lpDiskBios.Length); + } + else + { + Array.Copy(bios, lpDiskBios, lpDiskBios.Length); + } + bios = null; + } + else if (romType == EnumRomType.NSF) + { + bNSF = true; + header = NESHEADER.GetDefault(); + + nsfheader = NSFHEADER.GetDefault(); + + PRGsize = FileSize - NSFHEADER.SizeOf(); + Debuger.Log($"PRGSIZE:{PRGsize}"); + PRGsize = (PRGsize + 0x0FFF) & ~0x0FFF; + Debuger.Log($"PRGSIZE:{PRGsize}"); + + lpPRG = new byte[PRGsize]; + Array.Copy(temp, NSFHEADER.SizeOf(), lpPRG, 0, FileSize - NSFHEADER.SizeOf()); + + NSF_PAGE_SIZE = (int)(PRGsize >> 12); + Debuger.Log($"PAGESIZE:{NSF_PAGE_SIZE}"); + } + else + { + throw new Exception($"Unsupport format:[{fname}]"); + } + + Supporter.GetFilePathInfo(fname, out fullpath, out path); + name = Path.GetFileNameWithoutExtension(fullpath); + if (!bNSF) + { + mapper = (header.control1 >> 4) | (header.control2 & 0xF0); + crc = crcall = crcvrom = 0; + + if (mapper != 20) + { + Span sTemp = temp; + if (IsTRAINER()) + { + crcall = CRC.CrcRev((int)(512 + PRGsize + CHRsize), sTemp.Slice(NESHEADER.SizeOf())); + crc = CRC.CrcRev((int)(512 + PRGsize), sTemp); + if (CHRsize > 0) + crcvrom = CRC.CrcRev((int)CHRsize, sTemp.Slice((int)(PRGsize + 512 + NESHEADER.SizeOf()))); + } + else + { + crcall = CRC.CrcRev((int)(PRGsize + CHRsize), sTemp.Slice(NESHEADER.SizeOf())); + crc = CRC.CrcRev((int)(PRGsize), sTemp.Slice(NESHEADER.SizeOf())); + if (CHRsize > 0) + crcvrom = CRC.CrcRev((int)CHRsize, sTemp.Slice((int)(PRGsize + NESHEADER.SizeOf()))); + } + + FileNameCheck(fname); + int mapperNo; + + if (Supporter.TryGetMapperNo(this, out mapperNo)) + { + Debuger.Log($"ROMDB Set Mapper #{mapper:000} to #{mapperNo:000}"); + mapper = mapperNo; + } + + RomPatch.DoPatch(ref crc, ref lpPRG, ref lpCHR, ref mapper, ref header); + + fdsmakerID = fdsgameID = 0; + } + else //mapper==20 + { + crc = crcall = crcvrom = 0; + + fdsmakerID = lpPRG[0x1F]; + fdsgameID = (uint)((lpPRG[0x20] << 24) | (lpPRG[0x21] << 16) | (lpPRG[0x22] << 8) | (lpPRG[0x23] << 0)); + } + } + else //NSF + { + mapper = 0x0100; // Private mapper + crc = crcall = crcvrom = 0; + fdsmakerID = fdsgameID = 0; + } + + temp = null; + } + catch (Exception ex) + { + fp?.Dispose(); + temp = null; + bios = null; + lpPRG = null; + lpCHR = null; + lpTrainer = null; + lpDiskBios = null; + lpDisk = null; + + throw ex; + } + } + + public void Dispose() + { + lpPRG = null; + lpCHR = null; + lpTrainer = null; + lpDiskBios = null; + lpDisk = null; + } + + public bool IsTRAINER() + { + return (header.control1 & (byte)EnumRomControlByte1.ROM_TRAINER) > 0; + } + + public bool IsNSF() + { + return bNSF; + } + public bool IsPAL() + { + return bPAL; + } + + public bool IsSAVERAM() + { + return (header.control1 & (byte)EnumRomControlByte1.ROM_SAVERAM) > 0; + } + + protected void FileNameCheck(string fname) + { + if (fname.Contains("(E)")) + { + bPAL = true; + return; + } + } + + internal string GetRomName() + { + return name; + } + + internal int GetMapperNo() + { + return mapper; + } + + internal byte[] GetPROM() + { + return lpPRG; + } + + internal byte[] GetVROM() + { + return lpCHR; + } + + internal byte[] GetDISK() + { + return lpDisk; + } + + internal int GetDiskNo() + { + return diskno; + } + + internal uint GetGameID() + { + return fdsgameID; + } + + internal uint GetMakerID() + { + return fdsmakerID; + } + + internal bool IsVSUNISYSTEM() + { + return (header.control2 & (byte)EnumRomControlByte2.ROM_VSUNISYSTEM) != 0; + } + + public uint GetPROM_CRC() + { + return crc; + } + + internal byte GetPROM_SIZE() + { + return header.PRG_PAGE_SIZE; + } + + internal byte GetVROM_SIZE() + { + return header.CHR_PAGE_SIZE; + } + + internal bool Is4SCREEN() + { + return (header.control1 & (byte)EnumRomControlByte1.ROM_4SCREEN) != 0; + } + + internal bool IsVMIRROR() + { + return (header.control1 & (byte)EnumRomControlByte1.ROM_VMIRROR) != 0; + } + + internal byte[] GetTRAINER() + { + return lpTrainer; + } + + internal NSFHEADER GetNsfHeader() + { + return nsfheader; + } + + internal string GetRomPath() + { + return path; + } + + internal uint GetVROM_CRC() + { + return crcvrom; + } + } + + +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ROM.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ROM.cs.meta new file mode 100644 index 0000000..3f79db9 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/ROM.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 391d943ceba1fa0459c3991e11bd3921 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter.meta new file mode 100644 index 0000000..1120450 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 78036d3e96a27e441b4989bb8ec174e9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/ControllerState.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/ControllerState.cs new file mode 100644 index 0000000..f2223d3 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/ControllerState.cs @@ -0,0 +1,51 @@ +using System; + +namespace VirtualNes.Core +{ + public struct ControllerState + { + private uint raw0; + private uint raw1; + private uint raw2; + private uint raw3; + + public ControllerState( + EnumButtonType player0_buttons, + EnumButtonType player1_buttons, + EnumButtonType player2_buttons, + EnumButtonType player3_buttons) + { + raw0 = (uint)player0_buttons; + raw1 = (uint)player1_buttons; + raw2 = (uint)player2_buttons; + raw3 = (uint)player3_buttons; + } + + public bool HasButton(int player, EnumButtonType button) + { + uint raw = 0; + switch (player) + { + case 0: raw = raw0; break; + case 1: raw = raw1; break; + case 2: raw = raw2; break; + case 3: raw = raw3; break; + } + return (raw & (uint)button) == (uint)button; + } + } + + [Flags] + public enum EnumButtonType + { + UP = 1, + DOWN = 2, + LEFT = 4, + RIGHT = 8, + A = 16, + B = 32, + SELECT = 64, + START = 128, + MIC = 256 + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/ControllerState.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/ControllerState.cs.meta new file mode 100644 index 0000000..aa3411a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/ControllerState.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 88eb13b75812fc040ad7eb146af2bb80 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig.meta new file mode 100644 index 0000000..8a060f7 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fd0714f580724604da063207fe69e274 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgController.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgController.cs new file mode 100644 index 0000000..106aea1 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgController.cs @@ -0,0 +1,27 @@ +//using Codice.CM.Client.Differences; + +namespace VirtualNes.Core +{ + public class CfgController + { + public ushort[][] nButton = new ushort[4][] + { + new ushort[64],new ushort[64], new ushort[64], new ushort[64], + }; + public ushort[][] nRapid = new ushort[4][] + { + new ushort[2],new ushort[2],new ushort[2],new ushort[2], + }; + + // 0:Crazy Climber + // 1:Famly Trainer + // 2:Exciting Boxing + // 3:Mahjang + public ushort[][] nExButton = new ushort[4][] + { + new ushort[64],new ushort[64], new ushort[64], new ushort[64], + }; + + public ushort[] nVSUnisystem = new ushort[64]; + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgController.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgController.cs.meta new file mode 100644 index 0000000..750d782 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3328948cdc73baa4fb90c995f39f454f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgEmulator.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgEmulator.cs new file mode 100644 index 0000000..d4eca6c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgEmulator.cs @@ -0,0 +1,18 @@ +namespace VirtualNes.Core +{ + public class CfgEmulator + { + public bool bIllegalOp { get; set; } = false; + public bool bAutoFrameSkip { get; set; } = true; + public bool bThrottle { get; set; } = true; + public int nThrottleFPS { get; set; } = 120; + public bool bBackground { get; set; } = false; + public int nPriority { get; set; } = 3; + public bool bFourPlayer { get; set; } = true; + public bool bCrcCheck { get; set; } = true; + public bool bDiskThrottle { get; set; } = true; + public bool bLoadFullscreen { get; set; } = false; + public bool bPNGsnapshot { get; set; } = false; + public bool bAutoIPS { get; set; } = false; + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgEmulator.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgEmulator.cs.meta new file mode 100644 index 0000000..1a5035c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgEmulator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aae682cf38878ae40a449ab1a13fc7fc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgExtraSound.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgExtraSound.cs new file mode 100644 index 0000000..10aeec9 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgExtraSound.cs @@ -0,0 +1,6 @@ +namespace VirtualNes.Core +{ + public class CfgExtraSound + { + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgExtraSound.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgExtraSound.cs.meta new file mode 100644 index 0000000..3a37df9 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgExtraSound.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c707e4c8c38fa2e40a884047d0582b7e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgGeneral.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgGeneral.cs new file mode 100644 index 0000000..496887c --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgGeneral.cs @@ -0,0 +1,7 @@ +namespace VirtualNes.Core +{ + public class CfgGeneral + { + + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgGeneral.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgGeneral.cs.meta new file mode 100644 index 0000000..84efe80 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgGeneral.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 797171ffbac5b8748923ba914141781d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgGraphics.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgGraphics.cs new file mode 100644 index 0000000..5b9817d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgGraphics.cs @@ -0,0 +1,39 @@ +namespace VirtualNes.Core +{ + public class CfgGraphics + { + public bool bAspect = false; + public bool bAllSprite = true; + public bool bAllLine = false; + public bool bFPSDisp = false; + public bool bTVFrame = false; + public bool bScanline = false; + public int nScanlineColor = 75; + public bool bSyncDraw = false; + public bool bFitZoom = false; + + public bool bLeftClip = true; + + public bool bWindowVSync = false; + + public bool bSyncNoSleep = false; + + public bool bDiskAccessLamp = false; + + public bool bDoubleSize = false; + public bool bSystemMemory = false; + public bool bUseHEL = false; + + public bool bNoSquareList = false; + + public int nGraphicsFilter = 0; + + public uint dwDisplayWidth = 640; + public uint dwDisplayHeight = 480; + public uint dwDisplayDepth = 16; + public uint dwDisplayRate = 0; + + public bool bPaletteFile = false; + public char[] szPaletteFile = new char[260]; + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgGraphics.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgGraphics.cs.meta new file mode 100644 index 0000000..73cbd53 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgGraphics.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c5d72263cee06c74e94d67af00befbdf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgLanguage.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgLanguage.cs new file mode 100644 index 0000000..64b3018 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgLanguage.cs @@ -0,0 +1,6 @@ +namespace VirtualNes.Core +{ + public class CfgLanguage + { + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgLanguage.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgLanguage.cs.meta new file mode 100644 index 0000000..71f37e3 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgLanguage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c23af0b4dd8a4e04a89d1a380c54688f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgLauncher.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgLauncher.cs new file mode 100644 index 0000000..e20de84 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgLauncher.cs @@ -0,0 +1,6 @@ +namespace VirtualNes.Core +{ + public class CfgLauncher + { + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgLauncher.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgLauncher.cs.meta new file mode 100644 index 0000000..e752de0 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgLauncher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a033c816849b204c8cda167cd1fddb0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgMovie.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgMovie.cs new file mode 100644 index 0000000..b04fb25 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgMovie.cs @@ -0,0 +1,14 @@ +using System; + +namespace VirtualNes.Core +{ + public class CfgMovie + { + public byte[] bUsePlayer = new byte[4] { 0xFF, 0x00, 0x00, 0x00 }; + public bool bRerecord = true; + public bool bLoopPlay = false; + public bool bResetRec = false; + public bool bPadDisplay = false; + public bool bTimeDisplay = false; + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgMovie.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgMovie.cs.meta new file mode 100644 index 0000000..cb49734 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgMovie.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fdbdc9850f494ad44a16ec1ec82157cc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgNetPlay.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgNetPlay.cs new file mode 100644 index 0000000..55f70e2 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgNetPlay.cs @@ -0,0 +1,6 @@ +namespace VirtualNes.Core +{ + public class CfgNetPlay + { + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgNetPlay.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgNetPlay.cs.meta new file mode 100644 index 0000000..f781314 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgNetPlay.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6a81c95a03cbc4f4298e034f2b5cab7c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgPath.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgPath.cs new file mode 100644 index 0000000..d5b62b1 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgPath.cs @@ -0,0 +1,25 @@ +using System; + +namespace VirtualNes.Core +{ + public class CfgPath + { + public bool bRomPath = true; + public bool bSavePath = true; + public bool bStatePath = true; + public bool bSnapshotPath = true; + public bool bMoviePath = true; + public bool bWavePath = true; + public bool bCheatPath = true; + public bool bIpsPath = true; + + public string szRomPath = "roms"; + public string szSavePath = "save"; + public string szStatePath = "state"; + public string szSnapshotPath = "snapshot"; + public string szMoviePath = "movie"; + public string szWavePath = "wave"; + public string szCheatPath = "cheatcode"; + public string szIpsPath = "ips"; + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgPath.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgPath.cs.meta new file mode 100644 index 0000000..c9bd97a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgPath.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c9368c1964e431040a469e2fb7b1c710 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgShortCut.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgShortCut.cs new file mode 100644 index 0000000..1ce7e75 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgShortCut.cs @@ -0,0 +1,6 @@ +namespace VirtualNes.Core +{ + public class CfgShortCut + { + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgShortCut.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgShortCut.cs.meta new file mode 100644 index 0000000..8af3ee4 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgShortCut.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b4bc2f955a549544e9f03a73b98455fb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgSound.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgSound.cs new file mode 100644 index 0000000..ddeb3cb --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgSound.cs @@ -0,0 +1,19 @@ +namespace VirtualNes.Core +{ + public class CfgSound + { + public bool bEnable { get; set; } = true; + public int nRate { get; set; } = 48000; + public int nBits { get; set; } = 8; + public int nBufferSize { get; set; } = 4; + public int nFilterType { get; set; } = 0; + public bool bChangeTone { get; set; } = false; + public bool bDisableVolumeEffect { get; set; } = false; + public bool bExtraSoundEnable { get; set; } = true; + public short[] nVolume { get; set; } = new short[16] + { + 100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100, + }; + + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgSound.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgSound.cs.meta new file mode 100644 index 0000000..1ac8256 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/CfgSound.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f13850718ff124445ad8696ef491313d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/EmulatorConfig.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/EmulatorConfig.cs new file mode 100644 index 0000000..2150f35 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/EmulatorConfig.cs @@ -0,0 +1,53 @@ +using System; + +namespace VirtualNes.Core +{ + public class EmulatorConfig + { + private bool m_bKeyboardDisable; + + public CfgGeneral general { get; private set; } = new CfgGeneral(); + public CfgPath path { get; private set; } = new CfgPath(); + public CfgEmulator emulator { get; private set; } = new CfgEmulator(); + public CfgGraphics graphics { get; private set; } = new CfgGraphics(); + public CfgSound sound { get; private set; } = new CfgSound(); + public CfgShortCut shortcut { get; private set; } = new CfgShortCut(); + public CfgLanguage language { get; private set; } = new CfgLanguage(); + public CfgController controller { get; private set; } = new CfgController(); + public CfgMovie movie { get; private set; } = new CfgMovie(); + public CfgLauncher launcher { get; private set; } = new CfgLauncher(); + public CfgExtraSound extsound { get; private set; } = new CfgExtraSound(); + public CfgNetPlay netplay { get; private set; } = new CfgNetPlay(); + } + + public static class GameOption + { + // Default保存 + public static int defRenderMethod; + public static int defIRQtype; + public static bool defFrameIRQ; + public static bool defVideoMode; + + // データ + public static int nRenderMethod; + public static int nIRQtype; + public static bool bFrameIRQ; + public static bool bVideoMode; + + public static void Load(uint crc) + { + nRenderMethod = defRenderMethod; + nIRQtype = defIRQtype; + bFrameIRQ = defFrameIRQ; + bVideoMode = defVideoMode; + } + + public static void Load(uint gid, uint mid) + { + nRenderMethod = defRenderMethod; + nIRQtype = defIRQtype; + bFrameIRQ = defFrameIRQ; + bVideoMode = defVideoMode; + } + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/EmulatorConfig.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/EmulatorConfig.cs.meta new file mode 100644 index 0000000..897ae92 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/EmulatorConfig/EmulatorConfig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8e0eb25b08646f64eaf7930288788c68 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/Supporter.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/Supporter.cs new file mode 100644 index 0000000..525bae5 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/Supporter.cs @@ -0,0 +1,80 @@ +using System.IO; + +namespace VirtualNes.Core +{ + public static class Supporter + { + private static ISupporterImpl s_support; + public static void Setup(ISupporterImpl supporter) + { + s_support = supporter; + } + + public static Stream OpenRom(string fname) + { + return s_support.OpenRom(fname); + } + + public static void GetFilePathInfo(string fname, out string fullPath, out string directPath) + { + s_support.GetRomPathInfo(fname, out fullPath, out directPath); + } + + public static Stream OpenFile_DISKSYS() + { + return s_support.OpenFile_DISKSYS(); + } + + public static void SaveSRAMToFile(byte[] sramContent, string romName) + { + s_support.SaveSRAMToFile(sramContent, romName); + } + + public static void SaveDISKToFile(byte[] diskFileContent, string romName) + { + s_support.SaveDISKToFile(diskFileContent, romName); + } + + public static void PrepareDirectory(string directPath) + { + s_support.PrepareDirectory(directPath); + } + + public static void SaveFile(byte[] fileData, string directPath, string fileName) + { + s_support.SaveFile(fileData, directPath, fileName); + } + public static Stream OpenFile(string directPath, string fileName) + { + return s_support.OpenFile(directPath, fileName); + } + + public static bool TryGetMapperNo(ROM rom, out int mapperNo) + { + return s_support.TryGetMapperNo(rom, out mapperNo); + } + + public static ControllerState GetControllerState() + { + return s_support.GetControllerState(); + } + + public static EmulatorConfig Config => s_support.Config; + } + + public interface ISupporterImpl + { + Stream OpenRom(string fname); + void GetRomPathInfo(string fname, out string fullPath, out string directPath); + Stream OpenFile_DISKSYS(); + void SaveSRAMToFile(byte[] sramContent, string romName); + void SaveDISKToFile(byte[] diskFileContent, string romName); + EmulatorConfig Config { get; } + + 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); + ControllerState GetControllerState(); + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/Supporter.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/Supporter.cs.meta new file mode 100644 index 0000000..7f64c93 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/Supporter/Supporter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ebaf8e516ae82d647bb19ffff17fd03d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/VirtualNes.Core.asmdef b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/VirtualNes.Core.asmdef new file mode 100644 index 0000000..6c20606 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/VirtualNes.Core.asmdef @@ -0,0 +1,3 @@ +{ + "name": "VirtualNes.Core" +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/VirtualNes.Core.asmdef.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/VirtualNes.Core.asmdef.meta new file mode 100644 index 0000000..9892237 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/VirtualNes.Core.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 390a2c4058e5c304a87e8be70c84d80b +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/VsUnisystem.cs b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/VsUnisystem.cs new file mode 100644 index 0000000..c7ff3fc --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/VsUnisystem.cs @@ -0,0 +1,49 @@ +namespace VirtualNes.Core +{ + public class VSDIPSWITCH + { + public string name; + public ushort value; + } + + + public static class VsUnisystem + { + public static VSDIPSWITCH[] vsdip_default = new VSDIPSWITCH[] + { + new VSDIPSWITCH{name="Unknown", value= 0x0100}, + new VSDIPSWITCH{name="Off", value= 0x00}, + new VSDIPSWITCH{name="On", value= 0x01}, + new VSDIPSWITCH{name=null, value= 0xFF}, + new VSDIPSWITCH{name="Unknown", value= 0x0200}, + new VSDIPSWITCH{name="Off", value= 0x00}, + new VSDIPSWITCH{name="On", value= 0x02}, + new VSDIPSWITCH{name=null, value= 0xFF}, + new VSDIPSWITCH{name="Unknown", value= 0x0400}, + new VSDIPSWITCH{name="Off", value= 0x00}, + new VSDIPSWITCH{name="On", value= 0x04}, + new VSDIPSWITCH{name=null, value= 0xFF}, + new VSDIPSWITCH{name="Unknown", value= 0x0800}, + new VSDIPSWITCH{name="Off", value= 0x00}, + new VSDIPSWITCH{name="On", value= 0x08}, + new VSDIPSWITCH{name=null, value= 0xFF}, + new VSDIPSWITCH{name="Unknown", value= 0x1000}, + new VSDIPSWITCH{name="Off", value= 0x00}, + new VSDIPSWITCH{name="On", value= 0x10}, + new VSDIPSWITCH{name=null, value= 0xFF}, + new VSDIPSWITCH{name="Unknown", value= 0x2000}, + new VSDIPSWITCH{name="Off", value= 0x00}, + new VSDIPSWITCH{name="On", value= 0x20}, + new VSDIPSWITCH{name=null, value= 0xFF}, + new VSDIPSWITCH{name="Unknown", value= 0x4000}, + new VSDIPSWITCH{name="Off", value= 0x00}, + new VSDIPSWITCH{name="On", value= 0x40}, + new VSDIPSWITCH{name=null, value= 0xFF}, + new VSDIPSWITCH{name="Unknown", value= 0x8000}, + new VSDIPSWITCH{name="Off", value= 0x00}, + new VSDIPSWITCH{name="On", value= 0x80}, + new VSDIPSWITCH{name=null, value= 0xFF}, + new VSDIPSWITCH{name=null, value= 0 }, + }; + } +} diff --git a/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/VsUnisystem.cs.meta b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/VsUnisystem.cs.meta new file mode 100644 index 0000000..3d06276 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Assets/VirtualNes.Core/VsUnisystem.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: db82d3b2d60f2c14fa3c5582acc439c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client.PSVita/Packages/manifest.json b/AxibugEmuOnline.Client.PSVita/Packages/manifest.json new file mode 100644 index 0000000..1342d0a --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/Packages/manifest.json @@ -0,0 +1,39 @@ +{ + "dependencies": { + "com.unity.ads": "2.0.8", + "com.unity.analytics": "2.0.16", + "com.unity.package-manager-ui": "1.9.11", + "com.unity.purchasing": "2.0.3", + "com.unity.textmeshpro": "1.2.4", + "com.unity.modules.ai": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.cloth": "1.0.0", + "com.unity.modules.director": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.particlesystem": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.physics2d": "1.0.0", + "com.unity.modules.screencapture": "1.0.0", + "com.unity.modules.terrain": "1.0.0", + "com.unity.modules.terrainphysics": "1.0.0", + "com.unity.modules.tilemap": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.uielements": "1.0.0", + "com.unity.modules.umbra": "1.0.0", + "com.unity.modules.unityanalytics": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.unitywebrequesttexture": "1.0.0", + "com.unity.modules.unitywebrequestwww": "1.0.0", + "com.unity.modules.vehicles": "1.0.0", + "com.unity.modules.video": "1.0.0", + "com.unity.modules.vr": "1.0.0", + "com.unity.modules.wind": "1.0.0", + "com.unity.modules.xr": "1.0.0" + } +} diff --git a/AxibugEmuOnline.Client.PSVita/ProjectSettings/AudioManager.asset b/AxibugEmuOnline.Client.PSVita/ProjectSettings/AudioManager.asset new file mode 100644 index 0000000..4f31e74 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/ProjectSettings/AudioManager.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!11 &1 +AudioManager: + m_ObjectHideFlags: 0 + m_Volume: 1 + Rolloff Scale: 1 + Doppler Factor: 1 + Default Speaker Mode: 2 + m_SampleRate: 0 + m_DSPBufferSize: 1024 + m_VirtualVoiceCount: 512 + m_RealVoiceCount: 32 + m_SpatializerPlugin: + m_AmbisonicDecoderPlugin: + m_DisableAudio: 0 + m_VirtualizeEffects: 1 diff --git a/AxibugEmuOnline.Client.PSVita/ProjectSettings/ClusterInputManager.asset b/AxibugEmuOnline.Client.PSVita/ProjectSettings/ClusterInputManager.asset new file mode 100644 index 0000000..e7886b2 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/ProjectSettings/ClusterInputManager.asset @@ -0,0 +1,6 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!236 &1 +ClusterInputManager: + m_ObjectHideFlags: 0 + m_Inputs: [] diff --git a/AxibugEmuOnline.Client.PSVita/ProjectSettings/DynamicsManager.asset b/AxibugEmuOnline.Client.PSVita/ProjectSettings/DynamicsManager.asset new file mode 100644 index 0000000..78992f0 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/ProjectSettings/DynamicsManager.asset @@ -0,0 +1,29 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!55 &1 +PhysicsManager: + m_ObjectHideFlags: 0 + serializedVersion: 7 + m_Gravity: {x: 0, y: -9.81, z: 0} + m_DefaultMaterial: {fileID: 0} + m_BounceThreshold: 2 + m_SleepThreshold: 0.005 + m_DefaultContactOffset: 0.01 + m_DefaultSolverIterations: 6 + m_DefaultSolverVelocityIterations: 1 + m_QueriesHitBackfaces: 0 + m_QueriesHitTriggers: 1 + m_EnableAdaptiveForce: 0 + m_ClothInterCollisionDistance: 0 + m_ClothInterCollisionStiffness: 0 + m_ContactsGeneration: 1 + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + m_AutoSimulation: 1 + m_AutoSyncTransforms: 1 + m_ClothInterCollisionSettingsToggle: 0 + m_ContactPairsMode: 0 + m_BroadphaseType: 0 + m_WorldBounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 250, y: 250, z: 250} + m_WorldSubdivisions: 8 diff --git a/AxibugEmuOnline.Client.PSVita/ProjectSettings/EditorBuildSettings.asset b/AxibugEmuOnline.Client.PSVita/ProjectSettings/EditorBuildSettings.asset new file mode 100644 index 0000000..ea88784 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/ProjectSettings/EditorBuildSettings.asset @@ -0,0 +1,11 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1045 &1 +EditorBuildSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Scenes: + - enabled: 1 + path: Assets/Scenes/SampleScene.unity + guid: 99c9720ab356a0642a771bea13969a05 + m_configObjects: {} diff --git a/AxibugEmuOnline.Client.PSVita/ProjectSettings/EditorSettings.asset b/AxibugEmuOnline.Client.PSVita/ProjectSettings/EditorSettings.asset new file mode 100644 index 0000000..29dea52 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/ProjectSettings/EditorSettings.asset @@ -0,0 +1,21 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!159 &1 +EditorSettings: + m_ObjectHideFlags: 0 + serializedVersion: 7 + m_ExternalVersionControlSupport: Visible Meta Files + m_SerializationMode: 2 + m_LineEndingsForNewScripts: 2 + m_DefaultBehaviorMode: 0 + m_SpritePackerMode: 0 + m_SpritePackerPaddingPower: 1 + m_EtcTextureCompressorBehavior: 1 + m_EtcTextureFastCompressor: 1 + m_EtcTextureNormalCompressor: 2 + m_EtcTextureBestCompressor: 4 + m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd + m_ProjectGenerationRootNamespace: + m_UserGeneratedProjectSuffix: + m_CollabEditorSettings: + inProgressEnabled: 1 diff --git a/AxibugEmuOnline.Client.PSVita/ProjectSettings/GraphicsSettings.asset b/AxibugEmuOnline.Client.PSVita/ProjectSettings/GraphicsSettings.asset new file mode 100644 index 0000000..1a6b7d1 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/ProjectSettings/GraphicsSettings.asset @@ -0,0 +1,64 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!30 &1 +GraphicsSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_Deferred: + m_Mode: 1 + m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} + m_DeferredReflections: + m_Mode: 1 + m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} + m_ScreenSpaceShadows: + m_Mode: 1 + m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} + m_LegacyDeferred: + m_Mode: 1 + m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} + m_DepthNormals: + m_Mode: 1 + m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} + m_MotionVectors: + m_Mode: 1 + m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} + m_LightHalo: + m_Mode: 1 + m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} + m_LensFlare: + m_Mode: 1 + m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} + m_AlwaysIncludedShaders: + - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} + m_PreloadedShaders: [] + m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, + type: 0} + m_CustomRenderPipeline: {fileID: 0} + m_TransparencySortMode: 0 + m_TransparencySortAxis: {x: 0, y: 0, z: 1} + m_DefaultRenderingPath: 1 + m_DefaultMobileRenderingPath: 1 + m_TierSettings: [] + m_LightmapStripping: 0 + m_FogStripping: 0 + m_InstancingStripping: 0 + m_LightmapKeepPlain: 1 + m_LightmapKeepDirCombined: 1 + m_LightmapKeepDynamicPlain: 1 + m_LightmapKeepDynamicDirCombined: 1 + m_LightmapKeepShadowMask: 1 + m_LightmapKeepSubtractive: 1 + m_FogKeepLinear: 1 + m_FogKeepExp: 1 + m_FogKeepExp2: 1 + m_AlbedoSwatchInfos: [] + m_LightsUseLinearIntensity: 0 + m_LightsUseColorTemperature: 0 diff --git a/AxibugEmuOnline.Client.PSVita/ProjectSettings/InputManager.asset b/AxibugEmuOnline.Client.PSVita/ProjectSettings/InputManager.asset new file mode 100644 index 0000000..17c8f53 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/ProjectSettings/InputManager.asset @@ -0,0 +1,295 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!13 &1 +InputManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Axes: + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: left + positiveButton: right + altNegativeButton: a + altPositiveButton: d + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: down + positiveButton: up + altNegativeButton: s + altPositiveButton: w + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left ctrl + altNegativeButton: + altPositiveButton: mouse 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left alt + altNegativeButton: + altPositiveButton: mouse 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left shift + altNegativeButton: + altPositiveButton: mouse 2 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: space + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse X + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse Y + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse ScrollWheel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 2 + joyNum: 0 + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 1 + type: 2 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 0 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 1 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 2 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 3 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: return + altNegativeButton: + altPositiveButton: joystick button 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: enter + altNegativeButton: + altPositiveButton: space + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Cancel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: escape + altNegativeButton: + altPositiveButton: joystick button 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 diff --git a/AxibugEmuOnline.Client.PSVita/ProjectSettings/NavMeshAreas.asset b/AxibugEmuOnline.Client.PSVita/ProjectSettings/NavMeshAreas.asset new file mode 100644 index 0000000..3b0b7c3 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/ProjectSettings/NavMeshAreas.asset @@ -0,0 +1,91 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!126 &1 +NavMeshProjectSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + areas: + - name: Walkable + cost: 1 + - name: Not Walkable + cost: 1 + - name: Jump + cost: 2 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + m_LastAgentTypeID: -887442657 + m_Settings: + - serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.75 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_SettingNames: + - Humanoid diff --git a/AxibugEmuOnline.Client.PSVita/ProjectSettings/NetworkManager.asset b/AxibugEmuOnline.Client.PSVita/ProjectSettings/NetworkManager.asset new file mode 100644 index 0000000..5dc6a83 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/ProjectSettings/NetworkManager.asset @@ -0,0 +1,8 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!149 &1 +NetworkManager: + m_ObjectHideFlags: 0 + m_DebugLevel: 0 + m_Sendrate: 15 + m_AssetToPrefab: {} diff --git a/AxibugEmuOnline.Client.PSVita/ProjectSettings/Physics2DSettings.asset b/AxibugEmuOnline.Client.PSVita/ProjectSettings/Physics2DSettings.asset new file mode 100644 index 0000000..132ee6b --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/ProjectSettings/Physics2DSettings.asset @@ -0,0 +1,37 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!19 &1 +Physics2DSettings: + m_ObjectHideFlags: 0 + serializedVersion: 3 + m_Gravity: {x: 0, y: -9.81} + m_DefaultMaterial: {fileID: 0} + m_VelocityIterations: 8 + m_PositionIterations: 3 + m_VelocityThreshold: 1 + m_MaxLinearCorrection: 0.2 + m_MaxAngularCorrection: 8 + m_MaxTranslationSpeed: 100 + m_MaxRotationSpeed: 360 + m_BaumgarteScale: 0.2 + m_BaumgarteTimeOfImpactScale: 0.75 + m_TimeToSleep: 0.5 + m_LinearSleepTolerance: 0.01 + m_AngularSleepTolerance: 2 + m_DefaultContactOffset: 0.01 + m_AutoSimulation: 1 + m_QueriesHitTriggers: 1 + m_QueriesStartInColliders: 1 + m_ChangeStopsCallbacks: 0 + m_CallbacksOnDisable: 1 + m_AutoSyncTransforms: 1 + m_AlwaysShowColliders: 0 + m_ShowColliderSleep: 1 + m_ShowColliderContacts: 0 + m_ShowColliderAABB: 0 + m_ContactArrowScale: 0.2 + m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} + m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} + m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} + m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/AxibugEmuOnline.Client.PSVita/ProjectSettings/PresetManager.asset b/AxibugEmuOnline.Client.PSVita/ProjectSettings/PresetManager.asset new file mode 100644 index 0000000..820e662 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/ProjectSettings/PresetManager.asset @@ -0,0 +1,27 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1386491679 &1 +PresetManager: + m_ObjectHideFlags: 0 + m_DefaultList: + - type: + m_NativeTypeID: 108 + m_ManagedTypePPtr: {fileID: 0} + m_ManagedTypeFallback: + defaultPresets: + - m_Preset: {fileID: 2655988077585873504, guid: c1cf8506f04ef2c4a88b64b6c4202eea, + type: 2} + - type: + m_NativeTypeID: 1020 + m_ManagedTypePPtr: {fileID: 0} + m_ManagedTypeFallback: + defaultPresets: + - m_Preset: {fileID: 2655988077585873504, guid: 0cd792cc87e492d43b4e95b205fc5cc6, + type: 2} + - type: + m_NativeTypeID: 1006 + m_ManagedTypePPtr: {fileID: 0} + m_ManagedTypeFallback: + defaultPresets: + - m_Preset: {fileID: 2655988077585873504, guid: 7a99f8aa944efe94cb9bd74562b7d5f9, + type: 2} diff --git a/AxibugEmuOnline.Client.PSVita/ProjectSettings/ProjectSettings.asset b/AxibugEmuOnline.Client.PSVita/ProjectSettings/ProjectSettings.asset new file mode 100644 index 0000000..d025cc8 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/ProjectSettings/ProjectSettings.asset @@ -0,0 +1,660 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!129 &1 +PlayerSettings: + m_ObjectHideFlags: 0 + serializedVersion: 15 + productGUID: 678e30b69e43ecb4fbec33dca06a6c97 + AndroidProfiler: 0 + AndroidFilterTouchesWhenObscured: 0 + AndroidEnableSustainedPerformanceMode: 0 + defaultScreenOrientation: 4 + targetDevice: 2 + useOnDemandResources: 0 + accelerometerFrequency: 60 + companyName: DefaultCompany + productName: VirtualNes.VIta + defaultCursor: {fileID: 0} + cursorHotspot: {x: 0, y: 0} + m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} + m_ShowUnitySplashScreen: 1 + m_ShowUnitySplashLogo: 1 + m_SplashScreenOverlayOpacity: 1 + m_SplashScreenAnimation: 1 + m_SplashScreenLogoStyle: 1 + m_SplashScreenDrawMode: 0 + m_SplashScreenBackgroundAnimationZoom: 1 + m_SplashScreenLogoAnimationZoom: 1 + m_SplashScreenBackgroundLandscapeAspect: 1 + m_SplashScreenBackgroundPortraitAspect: 1 + m_SplashScreenBackgroundLandscapeUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenBackgroundPortraitUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenLogos: [] + m_VirtualRealitySplashScreen: {fileID: 0} + m_HolographicTrackingLossScreen: {fileID: 0} + defaultScreenWidth: 1024 + defaultScreenHeight: 768 + defaultScreenWidthWeb: 960 + defaultScreenHeightWeb: 600 + m_StereoRenderingPath: 0 + m_ActiveColorSpace: 0 + m_MTRendering: 1 + m_StackTraceTypes: 010000000100000001000000010000000100000001000000 + iosShowActivityIndicatorOnLoading: -1 + androidShowActivityIndicatorOnLoading: -1 + iosAppInBackgroundBehavior: 0 + displayResolutionDialog: 1 + iosAllowHTTPDownload: 1 + allowedAutorotateToPortrait: 1 + allowedAutorotateToPortraitUpsideDown: 1 + allowedAutorotateToLandscapeRight: 1 + allowedAutorotateToLandscapeLeft: 1 + useOSAutorotation: 1 + use32BitDisplayBuffer: 1 + preserveFramebufferAlpha: 0 + disableDepthAndStencilBuffers: 0 + androidBlitType: 0 + defaultIsNativeResolution: 1 + macRetinaSupport: 1 + runInBackground: 1 + captureSingleScreen: 0 + muteOtherAudioSources: 0 + Prepare IOS For Recording: 0 + Force IOS Speakers When Recording: 0 + deferSystemGesturesMode: 0 + hideHomeButton: 0 + submitAnalytics: 1 + usePlayerLog: 1 + bakeCollisionMeshes: 0 + forceSingleInstance: 0 + resizableWindow: 0 + useMacAppStoreValidation: 0 + macAppStoreCategory: public.app-category.games + gpuSkinning: 1 + graphicsJobs: 0 + xboxPIXTextureCapture: 0 + xboxEnableAvatar: 0 + xboxEnableKinect: 0 + xboxEnableKinectAutoTracking: 0 + xboxEnableFitness: 0 + visibleInBackground: 1 + allowFullscreenSwitch: 1 + graphicsJobMode: 0 + fullscreenMode: 1 + xboxSpeechDB: 0 + xboxEnableHeadOrientation: 0 + xboxEnableGuest: 0 + xboxEnablePIXSampling: 0 + metalFramebufferOnly: 0 + n3dsDisableStereoscopicView: 0 + n3dsEnableSharedListOpt: 1 + n3dsEnableVSync: 0 + xboxOneResolution: 0 + xboxOneSResolution: 0 + xboxOneXResolution: 3 + xboxOneMonoLoggingLevel: 0 + xboxOneLoggingLevel: 1 + xboxOneDisableEsram: 0 + xboxOnePresentImmediateThreshold: 0 + switchQueueCommandMemory: 0 + videoMemoryForVertexBuffers: 0 + psp2PowerMode: 2 + psp2AcquireBGM: 1 + vulkanEnableSetSRGBWrite: 0 + vulkanUseSWCommandBuffers: 0 + m_SupportedAspectRatios: + 4:3: 1 + 5:4: 1 + 16:10: 1 + 16:9: 1 + Others: 1 + bundleVersion: 0.1 + preloadedAssets: [] + metroInputSource: 0 + wsaTransparentSwapchain: 0 + m_HolographicPauseOnTrackingLoss: 1 + xboxOneDisableKinectGpuReservation: 0 + xboxOneEnable7thCore: 0 + isWsaHolographicRemotingEnabled: 0 + vrSettings: + cardboard: + depthFormat: 0 + enableTransitionView: 0 + daydream: + depthFormat: 0 + useSustainedPerformanceMode: 0 + enableVideoLayer: 0 + useProtectedVideoMemory: 0 + minimumSupportedHeadTracking: 0 + maximumSupportedHeadTracking: 1 + hololens: + depthFormat: 1 + depthBufferSharingEnabled: 0 + oculus: + sharedDepthBuffer: 0 + dashSupport: 0 + enable360StereoCapture: 0 + protectGraphicsMemory: 0 + useHDRDisplay: 0 + m_ColorGamuts: 00000000 + targetPixelDensity: 30 + resolutionScalingMode: 0 + androidSupportedAspectRatio: 1 + androidMaxAspectRatio: 2.1 + applicationIdentifier: {} + buildNumber: {} + AndroidBundleVersionCode: 1 + AndroidMinSdkVersion: 16 + AndroidTargetSdkVersion: 0 + AndroidPreferredInstallLocation: 1 + aotOptions: + stripEngineCode: 1 + iPhoneStrippingLevel: 0 + iPhoneScriptCallOptimization: 0 + ForceInternetPermission: 0 + ForceSDCardPermission: 0 + CreateWallpaper: 0 + APKExpansionFiles: 0 + keepLoadedShadersAlive: 0 + StripUnusedMeshComponents: 1 + VertexChannelCompressionMask: 4054 + iPhoneSdkVersion: 988 + iOSTargetOSVersionString: 8.0 + tvOSSdkVersion: 0 + tvOSRequireExtendedGameController: 0 + tvOSTargetOSVersionString: 9.0 + uIPrerenderedIcon: 0 + uIRequiresPersistentWiFi: 0 + uIRequiresFullScreen: 1 + uIStatusBarHidden: 1 + uIExitOnSuspend: 0 + uIStatusBarStyle: 0 + iPhoneSplashScreen: {fileID: 0} + iPhoneHighResSplashScreen: {fileID: 0} + iPhoneTallHighResSplashScreen: {fileID: 0} + iPhone47inSplashScreen: {fileID: 0} + iPhone55inPortraitSplashScreen: {fileID: 0} + iPhone55inLandscapeSplashScreen: {fileID: 0} + iPhone58inPortraitSplashScreen: {fileID: 0} + iPhone58inLandscapeSplashScreen: {fileID: 0} + iPadPortraitSplashScreen: {fileID: 0} + iPadHighResPortraitSplashScreen: {fileID: 0} + iPadLandscapeSplashScreen: {fileID: 0} + iPadHighResLandscapeSplashScreen: {fileID: 0} + appleTVSplashScreen: {fileID: 0} + appleTVSplashScreen2x: {fileID: 0} + tvOSSmallIconLayers: [] + tvOSSmallIconLayers2x: [] + tvOSLargeIconLayers: [] + tvOSLargeIconLayers2x: [] + tvOSTopShelfImageLayers: [] + tvOSTopShelfImageLayers2x: [] + tvOSTopShelfImageWideLayers: [] + tvOSTopShelfImageWideLayers2x: [] + iOSLaunchScreenType: 0 + iOSLaunchScreenPortrait: {fileID: 0} + iOSLaunchScreenLandscape: {fileID: 0} + iOSLaunchScreenBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreenFillPct: 100 + iOSLaunchScreenSize: 100 + iOSLaunchScreenCustomXibPath: + iOSLaunchScreeniPadType: 0 + iOSLaunchScreeniPadImage: {fileID: 0} + iOSLaunchScreeniPadBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreeniPadFillPct: 100 + iOSLaunchScreeniPadSize: 100 + iOSLaunchScreeniPadCustomXibPath: + iOSUseLaunchScreenStoryboard: 0 + iOSLaunchScreenCustomStoryboardPath: + iOSDeviceRequirements: [] + iOSURLSchemes: [] + iOSBackgroundModes: 0 + iOSMetalForceHardShadows: 0 + metalEditorSupport: 1 + metalAPIValidation: 1 + iOSRenderExtraFrameOnPause: 0 + appleDeveloperTeamID: + iOSManualSigningProvisioningProfileID: + tvOSManualSigningProvisioningProfileID: + iOSManualSigningProvisioningProfileType: 0 + tvOSManualSigningProvisioningProfileType: 0 + appleEnableAutomaticSigning: 0 + iOSRequireARKit: 0 + appleEnableProMotion: 0 + vulkanEditorSupport: 0 + clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea + templatePackageId: com.unity.3d@1.0.2 + templateDefaultScene: Assets/Scenes/SampleScene.unity + AndroidTargetArchitectures: 5 + AndroidSplashScreenScale: 0 + androidSplashScreen: {fileID: 0} + AndroidKeystoreName: + AndroidKeyaliasName: + AndroidBuildApkPerCpuArchitecture: 0 + AndroidTVCompatibility: 1 + AndroidIsGame: 1 + AndroidEnableTango: 0 + androidEnableBanner: 1 + androidUseLowAccuracyLocation: 0 + m_AndroidBanners: + - width: 320 + height: 180 + banner: {fileID: 0} + androidGamepadSupportLevel: 0 + resolutionDialogBanner: {fileID: 0} + m_BuildTargetIcons: [] + m_BuildTargetPlatformIcons: [] + m_BuildTargetBatching: + - m_BuildTarget: Standalone + m_StaticBatching: 1 + m_DynamicBatching: 0 + - m_BuildTarget: tvOS + m_StaticBatching: 1 + m_DynamicBatching: 0 + - m_BuildTarget: Android + m_StaticBatching: 1 + m_DynamicBatching: 0 + - m_BuildTarget: iPhone + m_StaticBatching: 1 + m_DynamicBatching: 0 + - m_BuildTarget: WebGL + m_StaticBatching: 0 + m_DynamicBatching: 0 + m_BuildTargetGraphicsAPIs: + - m_BuildTarget: AndroidPlayer + m_APIs: 0b00000015000000 + m_Automatic: 1 + - m_BuildTarget: iOSSupport + m_APIs: 10000000 + m_Automatic: 1 + - m_BuildTarget: AppleTVSupport + m_APIs: 10000000 + m_Automatic: 0 + - m_BuildTarget: WebGLSupport + m_APIs: 0b000000 + m_Automatic: 1 + m_BuildTargetVRSettings: + - m_BuildTarget: Standalone + m_Enabled: 0 + m_Devices: + - Oculus + - OpenVR + m_BuildTargetEnableVuforiaSettings: [] + openGLRequireES31: 0 + openGLRequireES31AEP: 0 + m_TemplateCustomTags: {} + mobileMTRendering: + Android: 1 + iPhone: 1 + tvOS: 1 + m_BuildTargetGroupLightmapEncodingQuality: [] + m_BuildTargetGroupLightmapSettings: [] + playModeTestRunnerEnabled: 0 + runPlayModeTestAsEditModeTest: 0 + actionOnDotNetUnhandledException: 1 + enableInternalProfiler: 0 + logObjCUncaughtExceptions: 1 + enableCrashReportAPI: 0 + cameraUsageDescription: + locationUsageDescription: + microphoneUsageDescription: + switchNetLibKey: + switchSocketMemoryPoolSize: 6144 + switchSocketAllocatorPoolSize: 128 + switchSocketConcurrencyLimit: 14 + switchScreenResolutionBehavior: 2 + switchUseCPUProfiler: 0 + switchApplicationID: 0x01004b9000490000 + switchNSODependencies: + switchTitleNames_0: + switchTitleNames_1: + switchTitleNames_2: + switchTitleNames_3: + switchTitleNames_4: + switchTitleNames_5: + switchTitleNames_6: + switchTitleNames_7: + switchTitleNames_8: + switchTitleNames_9: + switchTitleNames_10: + switchTitleNames_11: + switchTitleNames_12: + switchTitleNames_13: + switchTitleNames_14: + switchPublisherNames_0: + switchPublisherNames_1: + switchPublisherNames_2: + switchPublisherNames_3: + switchPublisherNames_4: + switchPublisherNames_5: + switchPublisherNames_6: + switchPublisherNames_7: + switchPublisherNames_8: + switchPublisherNames_9: + switchPublisherNames_10: + switchPublisherNames_11: + switchPublisherNames_12: + switchPublisherNames_13: + switchPublisherNames_14: + switchIcons_0: {fileID: 0} + switchIcons_1: {fileID: 0} + switchIcons_2: {fileID: 0} + switchIcons_3: {fileID: 0} + switchIcons_4: {fileID: 0} + switchIcons_5: {fileID: 0} + switchIcons_6: {fileID: 0} + switchIcons_7: {fileID: 0} + switchIcons_8: {fileID: 0} + switchIcons_9: {fileID: 0} + switchIcons_10: {fileID: 0} + switchIcons_11: {fileID: 0} + switchIcons_12: {fileID: 0} + switchIcons_13: {fileID: 0} + switchIcons_14: {fileID: 0} + switchSmallIcons_0: {fileID: 0} + switchSmallIcons_1: {fileID: 0} + switchSmallIcons_2: {fileID: 0} + switchSmallIcons_3: {fileID: 0} + switchSmallIcons_4: {fileID: 0} + switchSmallIcons_5: {fileID: 0} + switchSmallIcons_6: {fileID: 0} + switchSmallIcons_7: {fileID: 0} + switchSmallIcons_8: {fileID: 0} + switchSmallIcons_9: {fileID: 0} + switchSmallIcons_10: {fileID: 0} + switchSmallIcons_11: {fileID: 0} + switchSmallIcons_12: {fileID: 0} + switchSmallIcons_13: {fileID: 0} + switchSmallIcons_14: {fileID: 0} + switchManualHTML: + switchAccessibleURLs: + switchLegalInformation: + switchMainThreadStackSize: 1048576 + switchPresenceGroupId: + switchLogoHandling: 0 + switchReleaseVersion: 0 + switchDisplayVersion: 1.0.0 + switchStartupUserAccount: 0 + switchTouchScreenUsage: 0 + switchSupportedLanguagesMask: 0 + switchLogoType: 0 + switchApplicationErrorCodeCategory: + switchUserAccountSaveDataSize: 0 + switchUserAccountSaveDataJournalSize: 0 + switchApplicationAttribute: 0 + switchCardSpecSize: -1 + switchCardSpecClock: -1 + switchRatingsMask: 0 + switchRatingsInt_0: 0 + switchRatingsInt_1: 0 + switchRatingsInt_2: 0 + switchRatingsInt_3: 0 + switchRatingsInt_4: 0 + switchRatingsInt_5: 0 + switchRatingsInt_6: 0 + switchRatingsInt_7: 0 + switchRatingsInt_8: 0 + switchRatingsInt_9: 0 + switchRatingsInt_10: 0 + switchRatingsInt_11: 0 + switchLocalCommunicationIds_0: + switchLocalCommunicationIds_1: + switchLocalCommunicationIds_2: + switchLocalCommunicationIds_3: + switchLocalCommunicationIds_4: + switchLocalCommunicationIds_5: + switchLocalCommunicationIds_6: + switchLocalCommunicationIds_7: + switchParentalControl: 0 + switchAllowsScreenshot: 1 + switchAllowsVideoCapturing: 1 + switchAllowsRuntimeAddOnContentInstall: 0 + switchDataLossConfirmation: 0 + switchUserAccountLockEnabled: 0 + switchSupportedNpadStyles: 3 + switchNativeFsCacheSize: 32 + switchIsHoldTypeHorizontal: 0 + switchSupportedNpadCount: 8 + switchSocketConfigEnabled: 0 + switchTcpInitialSendBufferSize: 32 + switchTcpInitialReceiveBufferSize: 64 + switchTcpAutoSendBufferSizeMax: 256 + switchTcpAutoReceiveBufferSizeMax: 256 + switchUdpSendBufferSize: 9 + switchUdpReceiveBufferSize: 42 + switchSocketBufferEfficiency: 4 + switchSocketInitializeEnabled: 1 + switchNetworkInterfaceManagerInitializeEnabled: 1 + switchPlayerConnectionEnabled: 1 + ps4NPAgeRating: 12 + ps4NPTitleSecret: + ps4NPTrophyPackPath: + ps4ParentalLevel: 11 + ps4ContentID: ED1633-NPXX51362_00-0000000000000000 + ps4Category: 0 + ps4MasterVersion: 01.00 + ps4AppVersion: 01.00 + ps4AppType: 0 + ps4ParamSfxPath: + ps4VideoOutPixelFormat: 0 + ps4VideoOutInitialWidth: 1920 + ps4VideoOutBaseModeInitialWidth: 1920 + ps4VideoOutReprojectionRate: 60 + ps4PronunciationXMLPath: + ps4PronunciationSIGPath: + ps4BackgroundImagePath: + ps4StartupImagePath: + ps4StartupImagesFolder: + ps4IconImagesFolder: + ps4SaveDataImagePath: + ps4SdkOverride: + ps4BGMPath: + ps4ShareFilePath: + ps4ShareOverlayImagePath: + ps4PrivacyGuardImagePath: + ps4NPtitleDatPath: + ps4RemotePlayKeyAssignment: -1 + ps4RemotePlayKeyMappingDir: + ps4PlayTogetherPlayerCount: 0 + ps4EnterButtonAssignment: 1 + ps4ApplicationParam1: 0 + ps4ApplicationParam2: 0 + ps4ApplicationParam3: 0 + ps4ApplicationParam4: 0 + ps4DownloadDataSize: 0 + ps4GarlicHeapSize: 2048 + ps4ProGarlicHeapSize: 2560 + ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ + ps4pnSessions: 1 + ps4pnPresence: 1 + ps4pnFriends: 1 + ps4pnGameCustomData: 1 + playerPrefsSupport: 0 + enableApplicationExit: 0 + restrictedAudioUsageRights: 0 + ps4UseResolutionFallback: 0 + ps4ReprojectionSupport: 0 + ps4UseAudio3dBackend: 0 + ps4SocialScreenEnabled: 0 + ps4ScriptOptimizationLevel: 0 + ps4Audio3dVirtualSpeakerCount: 14 + ps4attribCpuUsage: 0 + ps4PatchPkgPath: + ps4PatchLatestPkgPath: + ps4PatchChangeinfoPath: + ps4PatchDayOne: 0 + ps4attribUserManagement: 0 + ps4attribMoveSupport: 0 + ps4attrib3DSupport: 0 + ps4attribShareSupport: 0 + ps4attribExclusiveVR: 0 + ps4disableAutoHideSplash: 0 + ps4videoRecordingFeaturesUsed: 0 + ps4contentSearchFeaturesUsed: 0 + ps4attribEyeToEyeDistanceSettingVR: 0 + ps4IncludedModules: [] + monoEnv: + psp2Splashimage: {fileID: 0} + psp2NPTrophyPackPath: + psp2NPSupportGBMorGJP: 0 + psp2NPAgeRating: 12 + psp2NPTitleDatPath: + psp2NPCommsID: + psp2NPCommunicationsID: + psp2NPCommsPassphrase: + psp2NPCommsSig: + psp2ParamSfxPath: + psp2ManualPath: + psp2LiveAreaGatePath: + psp2LiveAreaBackroundPath: + psp2LiveAreaPath: + psp2LiveAreaTrialPath: + psp2PatchChangeInfoPath: + psp2PatchOriginalPackage: + psp2PackagePassword: F69AzBlax3CF3EDNhm3soLBPh71Yexui + psp2KeystoneFile: + psp2MemoryExpansionMode: 0 + psp2DRMType: 0 + psp2StorageType: 0 + psp2MediaCapacity: 0 + psp2DLCConfigPath: + psp2ThumbnailPath: + psp2BackgroundPath: + psp2SoundPath: + psp2TrophyCommId: + psp2TrophyPackagePath: + psp2PackagedResourcesPath: + psp2SaveDataQuota: 10240 + psp2ParentalLevel: 1 + psp2ShortTitle: VirtualNes.Vita + psp2ContentID: IV0000-AXBG19810_00-0123456789ABCDEF + psp2Category: 0 + psp2MasterVersion: 01.00 + psp2AppVersion: 01.00 + psp2TVBootMode: 0 + psp2EnterButtonAssignment: 2 + psp2TVDisableEmu: 0 + psp2AllowTwitterDialog: 1 + psp2Upgradable: 0 + psp2HealthWarning: 0 + psp2UseLibLocation: 0 + psp2InfoBarOnStartup: 0 + psp2InfoBarColor: 0 + psp2ScriptOptimizationLevel: 2 + splashScreenBackgroundSourceLandscape: {fileID: 0} + splashScreenBackgroundSourcePortrait: {fileID: 0} + spritePackerPolicy: + webGLMemorySize: 256 + webGLExceptionSupport: 1 + webGLNameFilesAsHashes: 0 + webGLDataCaching: 1 + webGLDebugSymbols: 0 + webGLEmscriptenArgs: + webGLModulesDirectory: + webGLTemplate: APPLICATION:Default + webGLAnalyzeBuildSize: 0 + webGLUseEmbeddedResources: 0 + webGLCompressionFormat: 1 + webGLLinkerTarget: 1 + scriptingDefineSymbols: {} + platformArchitecture: {} + scriptingBackend: + PSP2: 1 + il2cppCompilerConfiguration: {} + incrementalIl2cppBuild: {} + allowUnsafeCode: 0 + additionalIl2CppArgs: + scriptingRuntimeVersion: 1 + apiCompatibilityLevelPerPlatform: + PSP2: 6 + m_RenderingPath: 1 + m_MobileRenderingPath: 1 + metroPackageName: Template_3D + metroPackageVersion: + metroCertificatePath: + metroCertificatePassword: + metroCertificateSubject: + metroCertificateIssuer: + metroCertificateNotAfter: 0000000000000000 + metroApplicationDescription: Template_3D + wsaImages: {} + metroTileShortName: + metroTileShowName: 0 + metroMediumTileShowName: 0 + metroLargeTileShowName: 0 + metroWideTileShowName: 0 + metroDefaultTileSize: 1 + metroTileForegroundText: 2 + metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} + metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, + a: 1} + metroSplashScreenUseBackgroundColor: 0 + platformCapabilities: {} + metroFTAName: + metroFTAFileTypes: [] + metroProtocolName: + metroCompilationOverrides: 1 + n3dsUseExtSaveData: 0 + n3dsCompressStaticMem: 1 + n3dsExtSaveDataNumber: 0x12345 + n3dsStackSize: 131072 + n3dsTargetPlatform: 2 + n3dsRegion: 7 + n3dsMediaSize: 0 + n3dsLogoStyle: 3 + n3dsTitle: GameName + n3dsProductCode: + n3dsApplicationId: 0xFF3FF + XboxOneProductId: + XboxOneUpdateKey: + XboxOneSandboxId: + XboxOneContentId: + XboxOneTitleId: + XboxOneSCId: + XboxOneGameOsOverridePath: + XboxOnePackagingOverridePath: + XboxOneAppManifestOverridePath: + XboxOneVersion: 1.0.0.0 + XboxOnePackageEncryption: 0 + XboxOnePackageUpdateGranularity: 2 + XboxOneDescription: + XboxOneLanguage: + - enus + XboxOneCapability: [] + XboxOneGameRating: {} + XboxOneIsContentPackage: 0 + XboxOneEnableGPUVariability: 0 + XboxOneSockets: {} + XboxOneSplashScreen: {fileID: 0} + XboxOneAllowedProductIds: [] + XboxOnePersistentLocalStorageSize: 0 + XboxOneXTitleMemory: 8 + xboxOneScriptCompiler: 0 + vrEditorSettings: + daydream: + daydreamIconForeground: {fileID: 0} + daydreamIconBackground: {fileID: 0} + cloudServicesEnabled: + UNet: 1 + facebookSdkVersion: 7.9.4 + apiCompatibilityLevel: 3 + cloudProjectId: + projectName: + organizationId: + cloudEnabled: 0 + enableNativePlatformBackendsForNewInputSystem: 0 + disableOldInputManagerSupport: 0 diff --git a/AxibugEmuOnline.Client.PSVita/ProjectSettings/ProjectVersion.txt b/AxibugEmuOnline.Client.PSVita/ProjectSettings/ProjectVersion.txt new file mode 100644 index 0000000..9703fd2 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/ProjectSettings/ProjectVersion.txt @@ -0,0 +1 @@ +m_EditorVersion: 2018.2.19f1 diff --git a/AxibugEmuOnline.Client.PSVita/ProjectSettings/QualitySettings.asset b/AxibugEmuOnline.Client.PSVita/ProjectSettings/QualitySettings.asset new file mode 100644 index 0000000..cd972f5 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/ProjectSettings/QualitySettings.asset @@ -0,0 +1,226 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!47 &1 +QualitySettings: + m_ObjectHideFlags: 0 + serializedVersion: 5 + m_CurrentQuality: 0 + m_QualitySettings: + - serializedVersion: 2 + name: Very Low + pixelLightCount: 0 + shadows: 0 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 1 + shadowNearPlaneOffset: 1 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + blendWeights: 1 + textureQuality: 0 + anisotropicTextures: 0 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 0 + lodBias: 0.3 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 4 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 4 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Low + pixelLightCount: 0 + shadows: 0 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 20 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + blendWeights: 2 + textureQuality: 0 + anisotropicTextures: 0 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 0 + lodBias: 0.4 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 16 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 4 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Medium + pixelLightCount: 1 + shadows: 1 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 20 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + blendWeights: 2 + textureQuality: 0 + anisotropicTextures: 1 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 1 + lodBias: 0.7 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 64 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 4 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: High + pixelLightCount: 2 + shadows: 2 + shadowResolution: 1 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 40 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + blendWeights: 2 + textureQuality: 0 + anisotropicTextures: 1 + antiAliasing: 2 + softParticles: 0 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + vSyncCount: 1 + lodBias: 1 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 256 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 4 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Very High + pixelLightCount: 3 + shadows: 2 + shadowResolution: 2 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 40 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + blendWeights: 4 + textureQuality: 0 + anisotropicTextures: 1 + antiAliasing: 4 + softParticles: 1 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + vSyncCount: 1 + lodBias: 1.5 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 1024 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 4 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Ultra + pixelLightCount: 4 + shadows: 2 + shadowResolution: 2 + shadowProjection: 1 + shadowCascades: 4 + shadowDistance: 150 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + blendWeights: 4 + textureQuality: 0 + anisotropicTextures: 1 + antiAliasing: 4 + softParticles: 1 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + vSyncCount: 1 + lodBias: 2 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 4096 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 4 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + m_PerPlatformDefaultQuality: + Android: 2 + Nintendo 3DS: 5 + Nintendo Switch: 5 + PS4: 5 + PSP2: 2 + Standalone: 5 + Tizen: 2 + WebGL: 3 + WiiU: 5 + Windows Store Apps: 5 + XboxOne: 5 + iPhone: 2 + tvOS: 2 diff --git a/AxibugEmuOnline.Client.PSVita/ProjectSettings/TagManager.asset b/AxibugEmuOnline.Client.PSVita/ProjectSettings/TagManager.asset new file mode 100644 index 0000000..17cb803 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/ProjectSettings/TagManager.asset @@ -0,0 +1,43 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!78 &1 +TagManager: + serializedVersion: 2 + tags: [] + layers: + - Default + - TransparentFX + - Ignore Raycast + - + - Water + - UI + - + - + - PostProcessing + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + m_SortingLayers: + - name: Default + uniqueID: 0 + locked: 0 diff --git a/AxibugEmuOnline.Client.PSVita/ProjectSettings/TimeManager.asset b/AxibugEmuOnline.Client.PSVita/ProjectSettings/TimeManager.asset new file mode 100644 index 0000000..06bcc6d --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/ProjectSettings/TimeManager.asset @@ -0,0 +1,9 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!5 &1 +TimeManager: + m_ObjectHideFlags: 0 + Fixed Timestep: 0.02 + Maximum Allowed Timestep: 0.1 + m_TimeScale: 1 + Maximum Particle Timestep: 0.03 diff --git a/AxibugEmuOnline.Client.PSVita/ProjectSettings/UnityConnectSettings.asset b/AxibugEmuOnline.Client.PSVita/ProjectSettings/UnityConnectSettings.asset new file mode 100644 index 0000000..1be4600 --- /dev/null +++ b/AxibugEmuOnline.Client.PSVita/ProjectSettings/UnityConnectSettings.asset @@ -0,0 +1,34 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!310 &1 +UnityConnectSettings: + m_ObjectHideFlags: 0 + m_Enabled: 1 + m_TestMode: 0 + m_TestEventUrl: + m_TestConfigUrl: + m_TestInitMode: 0 + CrashReportingSettings: + m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes + m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate + m_Enabled: 0 + m_CaptureEditorExceptions: 1 + UnityPurchasingSettings: + m_Enabled: 0 + m_TestMode: 0 + UnityAnalyticsSettings: + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_TestEventUrl: + m_TestConfigUrl: + UnityAdsSettings: + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_IosGameId: + m_AndroidGameId: + m_GameIds: {} + m_GameId: + PerformanceReportingSettings: + m_Enabled: 0 diff --git a/AxibugEmuOnline.Client.PSVita/UnityTools.exe b/AxibugEmuOnline.Client.PSVita/UnityTools.exe new file mode 100644 index 0000000..a0b8062 Binary files /dev/null and b/AxibugEmuOnline.Client.PSVita/UnityTools.exe differ