Compare commits
No commits in common. "3ca7b6a0c7e027b0d32eb707b287f4e44f44f308" and "01c3aff056ea656b700e4ea956b7e99f25077734" have entirely different histories.
3ca7b6a0c7
...
01c3aff056
8
AxibugEmuOnline.Client/Assets/Prefabs.meta
Normal file
8
AxibugEmuOnline.Client/Assets/Prefabs.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8d7ded91aab4c0b42abba5042aaceb39
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
625
AxibugEmuOnline.Client/Assets/Prefabs/NesCoreProxy.prefab
Normal file
625
AxibugEmuOnline.Client/Assets/Prefabs/NesCoreProxy.prefab
Normal file
@ -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}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d75df7d1f5a2c824ab5013cbd79da7a4
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -359,7 +359,7 @@ namespace AxibugEmuOnline.Client.Manager
|
|||||||
void RecvHostSyn_RoomFrameAllInputData(byte[] reqData)
|
void RecvHostSyn_RoomFrameAllInputData(byte[] reqData)
|
||||||
{
|
{
|
||||||
Protobuf_Room_Syn_RoomFrameAllInputData msg = ProtoBufHelper.DeSerizlize<Protobuf_Room_Syn_RoomFrameAllInputData>(reqData);
|
Protobuf_Room_Syn_RoomFrameAllInputData msg = ProtoBufHelper.DeSerizlize<Protobuf_Room_Syn_RoomFrameAllInputData>(reqData);
|
||||||
//netReplay.InData(new ReplayStep() { FrameStartID = (int)msg.FrameID, InPut = msg.InputData }, (int)msg.ServerFrameID);
|
netReplay.InData(new ReplayStep() { FrameStartID = (int)msg.FrameID, InPut = msg.InputData }, (int)msg.ServerFrameID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendScreen(byte[] RenderBuffer)
|
public void SendScreen(byte[] RenderBuffer)
|
||||||
|
|||||||
@ -5,16 +5,15 @@ namespace AxibugEmuOnline.Client
|
|||||||
{
|
{
|
||||||
public class InGameUI : CommandExecuter
|
public class InGameUI : CommandExecuter
|
||||||
{
|
{
|
||||||
|
|
||||||
public static InGameUI Instance { get; private set; }
|
public static InGameUI Instance { get; private set; }
|
||||||
|
|
||||||
public RomFile RomFile => m_rom;
|
public RomFile RomFile => m_rom;
|
||||||
public override bool Enable => gameObject.activeInHierarchy;
|
public override bool Enable => gameObject.activeInHierarchy;
|
||||||
private RomFile m_rom;
|
private RomFile m_rom;
|
||||||
private object m_core;
|
private object m_core;
|
||||||
private object m_state;
|
|
||||||
|
|
||||||
private InGameUI_SaveState m_saveStateMenu;
|
private InGameUI_SaveState m_saveMenu;
|
||||||
private InGameUI_LoadState m_loadStateMenu;
|
|
||||||
|
|
||||||
protected override void Awake()
|
protected override void Awake()
|
||||||
{
|
{
|
||||||
@ -28,47 +27,15 @@ namespace AxibugEmuOnline.Client
|
|||||||
Instance = null;
|
Instance = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取模拟器核心对象
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="T">模拟器核心对象类型</typeparam>
|
|
||||||
public T GetCore<T>() => (T)m_core;
|
public T GetCore<T>() => (T)m_core;
|
||||||
/// <summary> 保存快速快照 </summary>
|
|
||||||
public void SaveQuickState(object state)
|
|
||||||
{
|
|
||||||
m_state = state;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 读取快速快照
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="T"></typeparam>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool GetQuickState<T>(out T state)
|
|
||||||
{
|
|
||||||
state = default(T);
|
|
||||||
|
|
||||||
if (m_state is T)
|
|
||||||
{
|
|
||||||
state = (T)m_state;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Show(RomFile currentRom, object core)
|
public void Show(RomFile currentRom, object core)
|
||||||
{
|
{
|
||||||
|
m_saveMenu = new InGameUI_SaveState(this);
|
||||||
CommandDispatcher.Instance.RegistController(this);
|
CommandDispatcher.Instance.RegistController(this);
|
||||||
|
|
||||||
m_saveStateMenu = new InGameUI_SaveState(this);
|
|
||||||
m_loadStateMenu = new InGameUI_LoadState(this);
|
|
||||||
|
|
||||||
m_rom = currentRom;
|
m_rom = currentRom;
|
||||||
m_core = core;
|
m_core = core;
|
||||||
|
|
||||||
gameObject.SetActiveEx(true);
|
gameObject.SetActiveEx(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,12 +43,14 @@ namespace AxibugEmuOnline.Client
|
|||||||
{
|
{
|
||||||
CommandDispatcher.Instance.UnRegistController(this);
|
CommandDispatcher.Instance.UnRegistController(this);
|
||||||
|
|
||||||
|
m_rom = null;
|
||||||
|
m_core = null;
|
||||||
gameObject.SetActiveEx(false);
|
gameObject.SetActiveEx(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnCmdOptionMenu()
|
protected override void OnCmdOptionMenu()
|
||||||
{
|
{
|
||||||
OptionUI.Instance.Pop(new List<OptionMenu> { m_saveStateMenu, m_loadStateMenu });
|
OptionUI.Instance.Pop(new List<OptionMenu> { m_saveMenu });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,32 +0,0 @@
|
|||||||
using AxibugEmuOnline.Client.ClientCore;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using VirtualNes.Core;
|
|
||||||
|
|
||||||
namespace AxibugEmuOnline.Client
|
|
||||||
{
|
|
||||||
public class InGameUI_LoadState : ExecuteMenu
|
|
||||||
{
|
|
||||||
private InGameUI m_gameUI;
|
|
||||||
|
|
||||||
public InGameUI_LoadState(InGameUI gameUI) : base("śÁČĄżěŐŐ", null)
|
|
||||||
{
|
|
||||||
m_gameUI = gameUI;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnExcute()
|
|
||||||
{
|
|
||||||
Stopwatch sw = Stopwatch.StartNew();
|
|
||||||
switch (m_gameUI.RomFile.Platform)
|
|
||||||
{
|
|
||||||
case EnumPlatform.NES:
|
|
||||||
if (m_gameUI.GetQuickState<State>(out var quickState))
|
|
||||||
{
|
|
||||||
m_gameUI.GetCore<NesEmulator>().NesCore.LoadState(quickState);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
sw.Stop();
|
|
||||||
App.log.Info($"{m_gameUI.RomFile.Platform}====>żěŐŐźÓÔŘşÄĘą:{sw.Elapsed.TotalMilliseconds}ms");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 522140a3272d84a40b1ff91a3ebdb1b0
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -19,7 +19,6 @@ namespace AxibugEmuOnline.Client
|
|||||||
{
|
{
|
||||||
case EnumPlatform.NES:
|
case EnumPlatform.NES:
|
||||||
var state = m_gameUI.GetCore<NesEmulator>().NesCore.GetState();
|
var state = m_gameUI.GetCore<NesEmulator>().NesCore.GetState();
|
||||||
m_gameUI.SaveQuickState(state);
|
|
||||||
App.log.Info($"{m_gameUI.RomFile.Platform}===>快照大小{state.ToBytes().Length}");
|
App.log.Info($"{m_gameUI.RomFile.Platform}===>快照大小{state.ToBytes().Length}");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -168,9 +168,6 @@ namespace AxibugEmuOnline.Client
|
|||||||
{
|
{
|
||||||
public string Name { get; protected set; }
|
public string Name { get; protected set; }
|
||||||
public Sprite Icon { get; protected set; }
|
public Sprite Icon { get; protected set; }
|
||||||
public virtual bool Visible => true;
|
|
||||||
public virtual bool Enable => true;
|
|
||||||
|
|
||||||
public OptionMenu(string name, Sprite icon = null)
|
public OptionMenu(string name, Sprite icon = null)
|
||||||
{
|
{
|
||||||
Name = name;
|
Name = name;
|
||||||
|
|||||||
@ -82,6 +82,10 @@
|
|||||||
float4 _MainTex_ST;
|
float4 _MainTex_ST;
|
||||||
float4 _MainTex_TexelSize;
|
float4 _MainTex_TexelSize;
|
||||||
|
|
||||||
|
float3 lerp(float3 color1, float3 color2, float value)
|
||||||
|
{
|
||||||
|
return value * (color2 - color1) + color1;
|
||||||
|
}
|
||||||
float wave(float x, float frequency, float speed, float midHeight, float maxHeight)
|
float wave(float x, float frequency, float speed, float midHeight, float maxHeight)
|
||||||
{
|
{
|
||||||
return (sin(frequency * (x + speed * (((1. - (pow(cos(0.002 * (_Time.y + 400.)), 2.) + 1.) / 2.) + .1) * 2048.))) * (maxHeight - midHeight)) + midHeight;
|
return (sin(frequency * (x + speed * (((1. - (pow(cos(0.002 * (_Time.y + 400.)), 2.) + 1.) / 2.) + .1) * 2048.))) * (maxHeight - midHeight)) + midHeight;
|
||||||
@ -119,7 +123,7 @@
|
|||||||
float3 blue2 = float3(0, 0.7, 1);
|
float3 blue2 = float3(0, 0.7, 1);
|
||||||
float amount = (uv.x + uv.y) / 2.0;
|
float amount = (uv.x + uv.y) / 2.0;
|
||||||
float3 bg = lerp(blue2, blue, amount);
|
float3 bg = lerp(blue2, blue, amount);
|
||||||
|
|
||||||
// Overlayed sine waves
|
// Overlayed sine waves
|
||||||
float midHeight1 = 0.4;
|
float midHeight1 = 0.4;
|
||||||
float maxHeight1 = 0.5 + wave(0.0, 4.0, 0.02, 0.0, 0.02);
|
float maxHeight1 = 0.5 + wave(0.0, 4.0, 0.02, 0.0, 0.02);
|
||||||
@ -138,8 +142,10 @@
|
|||||||
float waveCol2 = waveColor(uv, waveHeight2, maxHeight2, frequency2, power2);
|
float waveCol2 = waveColor(uv, waveHeight2, maxHeight2, frequency2, power2);
|
||||||
|
|
||||||
float3 col = bg;
|
float3 col = bg;
|
||||||
col = lerp(col, waveCol1 * col, step(uv.y, waveHeight1));
|
if (uv.y < waveHeight1)
|
||||||
col = lerp(col, waveCol2 * col, step(uv.y, waveHeight2));
|
col = waveCol1 * col;
|
||||||
|
if (uv.y < waveHeight2)
|
||||||
|
col = waveCol2 * col;
|
||||||
|
|
||||||
// Output to screen
|
// Output to screen
|
||||||
fixed4 fragColor = float4(col,1.0);
|
fixed4 fragColor = float4(col,1.0);
|
||||||
|
|||||||
@ -543,11 +543,6 @@ namespace VirtualNes.Core
|
|||||||
@internal.GetFrameIRQ(ref Cycle, ref Count, ref Type, ref IRQ, ref Occur);
|
@internal.GetFrameIRQ(ref Cycle, ref Count, ref Type, ref IRQ, ref Occur);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void SetFrameIRQ(int Cycle, byte Count, byte Type, byte IRQ, byte Occur)
|
|
||||||
{
|
|
||||||
@internal.SetFrameIRQ(Cycle, Count, Type, IRQ, Occur);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void SaveState(StateBuffer buffer)
|
internal void SaveState(StateBuffer buffer)
|
||||||
{
|
{
|
||||||
// 時間軸を同期させる為Flushする
|
// 時間軸を同期させる為Flushする
|
||||||
@ -584,7 +579,7 @@ namespace VirtualNes.Core
|
|||||||
// N106
|
// N106
|
||||||
if ((exsound_select & 0x10) != 0)
|
if ((exsound_select & 0x10) != 0)
|
||||||
{
|
{
|
||||||
n106.SaveState(buffer);
|
n106.SaveState(buffer);
|
||||||
buffer.Position += (n106.GetSize() + 15) & (~0x0F); // Padding
|
buffer.Position += (n106.GetSize() + 15) & (~0x0F); // Padding
|
||||||
}
|
}
|
||||||
// FME7
|
// FME7
|
||||||
@ -594,49 +589,6 @@ namespace VirtualNes.Core
|
|||||||
buffer.Position += (fme7.GetSize() + 15) & (~0x0F); // Padding
|
buffer.Position += (fme7.GetSize() + 15) & (~0x0F); // Padding
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
@internal.LoadState(buffer);
|
|
||||||
buffer.Skip((@internal.GetSize() + 15) & (~0x0F));
|
|
||||||
|
|
||||||
// VRC6
|
|
||||||
if ((exsound_select & 0x01) != 0)
|
|
||||||
{
|
|
||||||
vrc6.LoadState(buffer);
|
|
||||||
buffer.Skip((int)((vrc6.GetSize() + 15) & (~0x0F))); // Padding
|
|
||||||
}
|
|
||||||
// VRC7 (not support)
|
|
||||||
if ((exsound_select & 0x02) != 0)
|
|
||||||
{
|
|
||||||
vrc7.LoadState(buffer);
|
|
||||||
buffer.Skip((vrc7.GetSize() + 15) & (~0x0F)); // Padding
|
|
||||||
}
|
|
||||||
// FDS
|
|
||||||
if ((exsound_select & 0x04) != 0)
|
|
||||||
{
|
|
||||||
fds.LoadState(buffer);
|
|
||||||
buffer.Skip((fds.GetSize() + 15) & (~0x0F)); // Padding
|
|
||||||
}
|
|
||||||
// MMC5
|
|
||||||
if ((exsound_select & 0x08) != 0)
|
|
||||||
{
|
|
||||||
mmc5.LoadState(buffer);
|
|
||||||
buffer.Skip((mmc5.GetSize() + 15) & (~0x0F)); // Padding
|
|
||||||
}
|
|
||||||
// N106
|
|
||||||
if ((exsound_select & 0x10) != 0)
|
|
||||||
{
|
|
||||||
n106.LoadState(buffer);
|
|
||||||
buffer.Skip((n106.GetSize() + 15) & (~0x0F)); // Padding
|
|
||||||
}
|
|
||||||
// FME7
|
|
||||||
if ((exsound_select & 0x20) != 0)
|
|
||||||
{
|
|
||||||
fme7.LoadState(buffer);
|
|
||||||
buffer.Skip((fme7.GetSize() + 15) & (~0x0F)); // Padding
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct QUEUEDATA
|
public struct QUEUEDATA
|
||||||
|
|||||||
@ -514,36 +514,6 @@ namespace VirtualNes.Core
|
|||||||
buffer.Write(now_freq);
|
buffer.Write(now_freq);
|
||||||
buffer.Write(output);
|
buffer.Write(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
reg = buffer.Read_bytes(0x80);
|
|
||||||
volenv_mode = buffer.Read_byte();
|
|
||||||
volenv_gain = buffer.Read_byte();
|
|
||||||
volenv_decay = buffer.Read_byte();
|
|
||||||
volenv_phaseacc = buffer.Read_double();
|
|
||||||
swpenv_mode = buffer.Read_byte();
|
|
||||||
swpenv_gain = buffer.Read_byte();
|
|
||||||
swpenv_decay = buffer.Read_byte();
|
|
||||||
swpenv_phaseacc = buffer.Read_double();
|
|
||||||
envelope_enable = buffer.Read_byte();
|
|
||||||
envelope_speed = buffer.Read_byte();
|
|
||||||
wave_setup = buffer.Read_byte();
|
|
||||||
master_volume = buffer.Read_int();
|
|
||||||
main_wavetable = buffer.Read_ints(64);
|
|
||||||
main_enable = buffer.Read_byte();
|
|
||||||
main_frequency = buffer.Read_int();
|
|
||||||
main_addr = buffer.Read_int();
|
|
||||||
lfo_wavetable = buffer.Read_bytes(64);
|
|
||||||
lfo_enable = buffer.Read_byte();
|
|
||||||
lfo_frequency = buffer.Read_int();
|
|
||||||
lfo_addr = buffer.Read_int();
|
|
||||||
lfo_phaseacc = buffer.Read_double();
|
|
||||||
sweep_bias = buffer.Read_int();
|
|
||||||
now_volume = buffer.Read_int();
|
|
||||||
now_freq = buffer.Read_int();
|
|
||||||
output = buffer.Read_int();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -398,17 +398,6 @@ namespace VirtualNes.Core
|
|||||||
buffer.Write(envtbl_index);
|
buffer.Write(envtbl_index);
|
||||||
buffer.Write(envstep_index);
|
buffer.Write(envstep_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
reg = buffer.Read_bytes(3);
|
|
||||||
volume = buffer.Read_byte();
|
|
||||||
freq = buffer.Read_int();
|
|
||||||
phaseacc = buffer.Read_int();
|
|
||||||
envadr = buffer.Read_int();
|
|
||||||
envtbl_index = buffer.Read_byte();
|
|
||||||
envstep_index = buffer.Read_byte();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class NOISE : IStateBufferObject
|
public class NOISE : IStateBufferObject
|
||||||
@ -435,14 +424,6 @@ namespace VirtualNes.Core
|
|||||||
buffer.Write(noiserange);
|
buffer.Write(noiserange);
|
||||||
buffer.Write(noiseout);
|
buffer.Write(noiseout);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
freq = buffer.Read_int();
|
|
||||||
phaseacc = buffer.Read_int();
|
|
||||||
noiserange = buffer.Read_int();
|
|
||||||
noiseout = buffer.Read_byte();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CHANNEL : IStateBufferObject
|
public class CHANNEL : IStateBufferObject
|
||||||
@ -488,19 +469,6 @@ namespace VirtualNes.Core
|
|||||||
buffer.Write(phaseacc);
|
buffer.Write(phaseacc);
|
||||||
buffer.Write(output_vol);
|
buffer.Write(output_vol);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
reg = buffer.Read_bytes(3);
|
|
||||||
enable = buffer.Read_byte();
|
|
||||||
env_on = buffer.Read_byte();
|
|
||||||
noise_on = buffer.Read_byte();
|
|
||||||
adder = buffer.Read_byte();
|
|
||||||
volume = buffer.Read_byte();
|
|
||||||
freq = buffer.Read_int();
|
|
||||||
phaseacc = buffer.Read_int();
|
|
||||||
output_vol = buffer.Read_int();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ namespace VirtualNes.Core
|
|||||||
public virtual bool Sync(int cycles) { return false; }
|
public virtual bool Sync(int cycles) { return false; }
|
||||||
public virtual int GetFreq(int channel) { return 0; }
|
public virtual int GetFreq(int channel) { return 0; }
|
||||||
public virtual void SaveState(StateBuffer buffer) { }
|
public virtual void SaveState(StateBuffer buffer) { }
|
||||||
public virtual void LoadState(StateReader buffer) { }
|
public virtual void LoadState(byte[] p) { }
|
||||||
|
|
||||||
public static int INT2FIX(int x)
|
public static int INT2FIX(int x)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1203,15 +1203,6 @@ namespace VirtualNes.Core
|
|||||||
occur = FrameIRQoccur;
|
occur = FrameIRQoccur;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void SetFrameIRQ(int cycle, byte count, byte type, byte IRQ, byte occur)
|
|
||||||
{
|
|
||||||
FrameCycle = cycle;
|
|
||||||
FrameCount = count;
|
|
||||||
FrameType = type;
|
|
||||||
FrameIRQ = IRQ;
|
|
||||||
FrameIRQoccur = occur;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override uint GetSize()
|
public override uint GetSize()
|
||||||
{
|
{
|
||||||
return sizeof(byte) +
|
return sizeof(byte) +
|
||||||
@ -1228,7 +1219,7 @@ namespace VirtualNes.Core
|
|||||||
ch4.GetSize();
|
ch4.GetSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SaveState(StateBuffer p)
|
public unsafe override void SaveState(StateBuffer p)
|
||||||
{
|
{
|
||||||
p.Write(reg4015);
|
p.Write(reg4015);
|
||||||
p.Write(sync_reg4015);
|
p.Write(sync_reg4015);
|
||||||
@ -1361,39 +1352,6 @@ namespace VirtualNes.Core
|
|||||||
buffer.Write(dummy2);
|
buffer.Write(dummy2);
|
||||||
buffer.Write(sync_len_count);
|
buffer.Write(sync_len_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
reg = buffer.Read_bytes(4);
|
|
||||||
enable = buffer.Read_byte();
|
|
||||||
holdnote = buffer.Read_byte();
|
|
||||||
volume = buffer.Read_byte();
|
|
||||||
complement = buffer.Read_byte();
|
|
||||||
phaseacc = buffer.Read_int();
|
|
||||||
freq = buffer.Read_int();
|
|
||||||
freqlimit = buffer.Read_int();
|
|
||||||
adder = buffer.Read_int();
|
|
||||||
duty = buffer.Read_int();
|
|
||||||
len_count = buffer.Read_int();
|
|
||||||
nowvolume = buffer.Read_int();
|
|
||||||
env_fixed = buffer.Read_byte();
|
|
||||||
env_decay = buffer.Read_byte();
|
|
||||||
env_count = buffer.Read_byte();
|
|
||||||
dummy0 = buffer.Read_byte();
|
|
||||||
env_vol = buffer.Read_int();
|
|
||||||
swp_on = buffer.Read_byte();
|
|
||||||
swp_inc = buffer.Read_byte();
|
|
||||||
swp_shift = buffer.Read_byte();
|
|
||||||
swp_decay = buffer.Read_byte();
|
|
||||||
swp_count = buffer.Read_byte();
|
|
||||||
dummy1 = buffer.Read_bytes(3);
|
|
||||||
sync_reg = buffer.Read_bytes(4);
|
|
||||||
sync_output_enable = buffer.Read_byte();
|
|
||||||
sync_enable = buffer.Read_byte();
|
|
||||||
sync_holdnote = buffer.Read_byte();
|
|
||||||
dummy2 = buffer.Read_byte();
|
|
||||||
sync_len_count = buffer.Read_int();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public class TRIANGLE : IStateBufferObject
|
public class TRIANGLE : IStateBufferObject
|
||||||
{
|
{
|
||||||
@ -1470,27 +1428,6 @@ namespace VirtualNes.Core
|
|||||||
buffer.Write(sync_len_count);
|
buffer.Write(sync_len_count);
|
||||||
buffer.Write(sync_lin_count);
|
buffer.Write(sync_lin_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
reg = buffer.Read_bytes(4);
|
|
||||||
enable = buffer.Read_byte();
|
|
||||||
holdnote = buffer.Read_byte();
|
|
||||||
counter_start = buffer.Read_byte();
|
|
||||||
dummy0 = buffer.Read_byte();
|
|
||||||
phaseacc = buffer.Read_int();
|
|
||||||
freq = buffer.Read_int();
|
|
||||||
len_count = buffer.Read_int();
|
|
||||||
lin_count = buffer.Read_int();
|
|
||||||
adder = buffer.Read_int();
|
|
||||||
nowvolume = buffer.Read_int();
|
|
||||||
sync_reg = buffer.Read_bytes(4);
|
|
||||||
sync_enable = buffer.Read_byte();
|
|
||||||
sync_holdnote = buffer.Read_byte();
|
|
||||||
sync_counter_start = buffer.Read_byte();
|
|
||||||
sync_len_count = buffer.Read_int();
|
|
||||||
sync_lin_count = buffer.Read_int();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public class DPCM : IStateBufferObject
|
public class DPCM : IStateBufferObject
|
||||||
{
|
{
|
||||||
@ -1550,35 +1487,6 @@ namespace VirtualNes.Core
|
|||||||
buffer.Write(sync_dmalength);
|
buffer.Write(sync_dmalength);
|
||||||
buffer.Write(sync_cache_dmalength);
|
buffer.Write(sync_cache_dmalength);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
reg = buffer.Read_bytes(4);
|
|
||||||
enable = buffer.Read_byte();
|
|
||||||
looping = buffer.Read_byte();
|
|
||||||
cur_byte = buffer.Read_byte();
|
|
||||||
dpcm_value = buffer.Read_byte();
|
|
||||||
freq = buffer.Read_int();
|
|
||||||
phaseacc = buffer.Read_int();
|
|
||||||
output = buffer.Read_int();
|
|
||||||
address = buffer.Read_ushort();
|
|
||||||
cache_addr = buffer.Read_ushort();
|
|
||||||
dmalength = buffer.Read_int();
|
|
||||||
cache_dmalength = buffer.Read_int();
|
|
||||||
dpcm_output_real = buffer.Read_int();
|
|
||||||
dpcm_output_fake = buffer.Read_int();
|
|
||||||
dpcm_output_old = buffer.Read_int();
|
|
||||||
dpcm_output_offset = buffer.Read_int();
|
|
||||||
sync_reg = buffer.Read_bytes(4);
|
|
||||||
sync_enable = buffer.Read_byte();
|
|
||||||
sync_looping = buffer.Read_byte();
|
|
||||||
sync_irq_gen = buffer.Read_byte();
|
|
||||||
sync_irq_enable = buffer.Read_byte();
|
|
||||||
sync_cycles = buffer.Read_int();
|
|
||||||
sync_cache_cycles = buffer.Read_int();
|
|
||||||
sync_dmalength = buffer.Read_int();
|
|
||||||
sync_cache_dmalength = buffer.Read_int();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public class NOISE : IStateBufferObject
|
public class NOISE : IStateBufferObject
|
||||||
{
|
{
|
||||||
@ -1674,32 +1582,6 @@ namespace VirtualNes.Core
|
|||||||
buffer.Write(dummy1);
|
buffer.Write(dummy1);
|
||||||
buffer.Write(sync_len_count);
|
buffer.Write(sync_len_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
reg = buffer.Read_bytes(4);
|
|
||||||
enable = buffer.Read_byte();
|
|
||||||
holdnote = buffer.Read_byte();
|
|
||||||
volume = buffer.Read_byte();
|
|
||||||
xor_tap = buffer.Read_byte();
|
|
||||||
shift_reg = buffer.Read_int();
|
|
||||||
phaseacc = buffer.Read_int();
|
|
||||||
freq = buffer.Read_int();
|
|
||||||
len_count = buffer.Read_int();
|
|
||||||
nowvolume = buffer.Read_int();
|
|
||||||
output = buffer.Read_int();
|
|
||||||
env_fixed = buffer.Read_byte();
|
|
||||||
env_decay = buffer.Read_byte();
|
|
||||||
env_count = buffer.Read_byte();
|
|
||||||
dummy0 = buffer.Read_byte();
|
|
||||||
env_vol = buffer.Read_int();
|
|
||||||
sync_reg = buffer.Read_bytes(4);
|
|
||||||
sync_output_enable = buffer.Read_byte();
|
|
||||||
sync_enable = buffer.Read_byte();
|
|
||||||
sync_holdnote = buffer.Read_byte();
|
|
||||||
dummy1 = buffer.Read_byte();
|
|
||||||
sync_len_count = buffer.Read_int();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -421,15 +421,6 @@ namespace VirtualNes.Core
|
|||||||
buffer.Write(dummy);
|
buffer.Write(dummy);
|
||||||
buffer.Write(vbl_length);
|
buffer.Write(vbl_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
reg = buffer.Read_bytes(4);
|
|
||||||
enable = buffer.Read_byte();
|
|
||||||
holdnote = buffer.Read_byte();
|
|
||||||
dummy = buffer.Read_bytes(2);
|
|
||||||
vbl_length = buffer.Read_int();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class RECTANGLE : IStateBufferObject
|
public class RECTANGLE : IStateBufferObject
|
||||||
@ -476,24 +467,6 @@ namespace VirtualNes.Core
|
|||||||
buffer.Write(adder);
|
buffer.Write(adder);
|
||||||
buffer.Write(duty_flip);
|
buffer.Write(duty_flip);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
reg = buffer.Read_bytes(4);
|
|
||||||
enable = buffer.Read_byte();
|
|
||||||
vbl_length = buffer.Read_int();
|
|
||||||
phaseacc = buffer.Read_int();
|
|
||||||
freq = buffer.Read_int();
|
|
||||||
output_vol = buffer.Read_int();
|
|
||||||
fixed_envelope = buffer.Read_byte();
|
|
||||||
holdnote = buffer.Read_byte();
|
|
||||||
volume = buffer.Read_byte();
|
|
||||||
env_vol = buffer.Read_byte();
|
|
||||||
env_phase = buffer.Read_int();
|
|
||||||
env_decay = buffer.Read_int();
|
|
||||||
adder = buffer.Read_int();
|
|
||||||
duty_flip = buffer.Read_int();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -243,19 +243,6 @@ namespace VirtualNes.Core
|
|||||||
buffer.Write(vol);
|
buffer.Write(vol);
|
||||||
buffer.Write(databuf);
|
buffer.Write(databuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
phaseacc = buffer.Read_int();
|
|
||||||
freq = buffer.Read_uint();
|
|
||||||
phase = buffer.Read_uint();
|
|
||||||
tonelen = buffer.Read_uint();
|
|
||||||
output = buffer.Read_int();
|
|
||||||
toneadr = buffer.Read_byte();
|
|
||||||
volupdate = buffer.Read_byte();
|
|
||||||
vol = buffer.Read_byte();
|
|
||||||
databuf = buffer.Read_byte();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -304,19 +304,6 @@ namespace VirtualNes.Core
|
|||||||
buffer.Write(adder);
|
buffer.Write(adder);
|
||||||
buffer.Write(duty_pos);
|
buffer.Write(duty_pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
reg = buffer.Read_bytes(3);
|
|
||||||
enable = buffer.Read_byte();
|
|
||||||
gate = buffer.Read_byte();
|
|
||||||
volume = buffer.Read_byte();
|
|
||||||
phaseacc = buffer.Read_int();
|
|
||||||
freq = buffer.Read_int();
|
|
||||||
output_vol = buffer.Read_int();
|
|
||||||
adder = buffer.Read_byte();
|
|
||||||
duty_pos = buffer.Read_byte();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SAWTOOTH : IStateBufferObject
|
public class SAWTOOTH : IStateBufferObject
|
||||||
@ -366,19 +353,6 @@ namespace VirtualNes.Core
|
|||||||
buffer.Write(accum);
|
buffer.Write(accum);
|
||||||
buffer.Write(phaseaccum);
|
buffer.Write(phaseaccum);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
reg = buffer.Read_bytes(3);
|
|
||||||
enable = buffer.Read_byte();
|
|
||||||
volume = buffer.Read_byte();
|
|
||||||
phaseacc = buffer.Read_int();
|
|
||||||
freq = buffer.Read_int();
|
|
||||||
output_vol = buffer.Read_int();
|
|
||||||
adder = buffer.Read_byte();
|
|
||||||
accum = buffer.Read_byte();
|
|
||||||
phaseaccum = buffer.Read_byte();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2022,20 +2022,10 @@ namespace VirtualNes.Core
|
|||||||
r = R;
|
r = R;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void SetContext(R6502 r)
|
|
||||||
{
|
|
||||||
R = r;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal int GetDmaCycles()
|
internal int GetDmaCycles()
|
||||||
{
|
{
|
||||||
return DMA_cycles;
|
return DMA_cycles;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void SetDmaCycles(int cycles)
|
|
||||||
{
|
|
||||||
DMA_cycles = cycles;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum StatusFlag6502 : int
|
public enum StatusFlag6502 : int
|
||||||
|
|||||||
@ -53,11 +53,6 @@ namespace VirtualNes.Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void WriteTo(T[] source, int start, int length)
|
|
||||||
{
|
|
||||||
Array.Copy(source, 0, m_rawArray, Offset + start, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Span<T> Span(int start, int length)
|
public Span<T> Span(int start, int length)
|
||||||
{
|
{
|
||||||
return new Span<T>(m_rawArray, start + Offset, length);
|
return new Span<T>(m_rawArray, start + Offset, length);
|
||||||
|
|||||||
@ -1872,15 +1872,12 @@ namespace VirtualNes.Core
|
|||||||
state.dskBLOCK.BlockVersion = 0x0210;
|
state.dskBLOCK.BlockVersion = 0x0210;
|
||||||
state.dskBLOCK.BlockSize = 0;
|
state.dskBLOCK.BlockSize = 0;
|
||||||
|
|
||||||
state.dskdata = new List<uint>();
|
|
||||||
|
|
||||||
for (int i = 16; i < DiskSize; i++)
|
for (int i = 16; i < DiskSize; i++)
|
||||||
{
|
{
|
||||||
if (lpWrite[i] != 0)
|
if (lpWrite[i] != 0)
|
||||||
{
|
{
|
||||||
uint data = (uint)(i & 0x00FFFFFF);
|
state.dskdata = (uint)(i & 0x00FFFFFF);
|
||||||
data |= ((uint)lpDisk[i] & 0xFF) << 24;
|
state.dskdata |= ((uint)lpDisk[i] & 0xFF) << 24;
|
||||||
state.dskdata.Add(data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1901,191 +1898,7 @@ namespace VirtualNes.Core
|
|||||||
|
|
||||||
public void LoadState(State state)
|
public void LoadState(State state)
|
||||||
{
|
{
|
||||||
//HEADER
|
|
||||||
{
|
|
||||||
state.HEADER.ID = "VirtuaNES ST";
|
|
||||||
state.HEADER.BlockVersion = 0x0200;
|
|
||||||
|
|
||||||
if (rom.GetMapperNo() != 20)
|
|
||||||
rom.SetPROM_CRC(state.HEADER.Ext0);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
rom.SetGameID(state.HEADER.Ext0);
|
|
||||||
rom.SetMakerID(state.HEADER.Ext1);
|
|
||||||
rom.SetDiskNo(state.HEADER.Ext2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//REGISTER STATE
|
|
||||||
{
|
|
||||||
R6502 R = new R6502();
|
|
||||||
R.PC = state.reg.cpureg.PC;
|
|
||||||
R.A = state.reg.cpureg.A;
|
|
||||||
R.X = state.reg.cpureg.X;
|
|
||||||
R.Y = state.reg.cpureg.Y;
|
|
||||||
R.S = state.reg.cpureg.S;
|
|
||||||
R.P = state.reg.cpureg.P;
|
|
||||||
R.INT_pending = state.reg.cpureg.I;
|
|
||||||
cpu.SetContext(R);
|
|
||||||
|
|
||||||
apu.SetFrameIRQ(
|
|
||||||
state.reg.cpureg.FrameIRQ_cycles,
|
|
||||||
state.reg.cpureg.FrameIRQ_count,
|
|
||||||
state.reg.cpureg.FrameIRQ_type,
|
|
||||||
state.reg.cpureg.FrameIRQ,
|
|
||||||
state.reg.cpureg.FrameIRQ_occur
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
cpu.SetDmaCycles(state.reg.cpureg.DMA_cycles);
|
|
||||||
emul_cycles = state.reg.cpureg.emul_cycles;
|
|
||||||
base_cycles = state.reg.cpureg.base_cycles;
|
|
||||||
|
|
||||||
// LOAD PPU STATE
|
|
||||||
MMU.PPUREG[0] = state.reg.ppureg.reg0;
|
|
||||||
MMU.PPUREG[1] = state.reg.ppureg.reg1;
|
|
||||||
MMU.PPUREG[2] = state.reg.ppureg.reg2;
|
|
||||||
MMU.PPUREG[3] = state.reg.ppureg.reg3;
|
|
||||||
MMU.PPU7_Temp = state.reg.ppureg.reg7;
|
|
||||||
MMU.loopy_t = state.reg.ppureg.loopy_t;
|
|
||||||
MMU.loopy_v = state.reg.ppureg.loopy_v;
|
|
||||||
MMU.loopy_x = state.reg.ppureg.loopy_x;
|
|
||||||
MMU.PPU56Toggle = state.reg.ppureg.toggle56;
|
|
||||||
}
|
|
||||||
|
|
||||||
//RAM STATE
|
|
||||||
{
|
|
||||||
// SAVE RAM STATE
|
|
||||||
MemoryUtility.memcpy(MMU.RAM, state.ram.RAM, state.ram.RAM.Length);
|
|
||||||
MemoryUtility.memcpy(MMU.BGPAL, state.ram.BGPAL, state.ram.BGPAL.Length);
|
|
||||||
MemoryUtility.memcpy(MMU.SPPAL, state.ram.SPPAL, state.ram.SPPAL.Length);
|
|
||||||
MemoryUtility.memcpy(MMU.SPRAM, state.ram.SPRAM, state.ram.SPRAM.Length);
|
|
||||||
|
|
||||||
if (rom.IsSAVERAM())
|
|
||||||
{
|
|
||||||
Array.Copy(state.WRAM, MMU.WRAM, SAVERAM_SIZE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//BANK STATE
|
|
||||||
{
|
|
||||||
// SAVE CPU MEMORY BANK DATA
|
|
||||||
// BANK0,1,2はバンクセーブに関係なし
|
|
||||||
// VirtuaNES0.30から
|
|
||||||
// バンク3はSRAM使用に関わらずセーブ
|
|
||||||
for (int i = 3; i < 8; i++)
|
|
||||||
{
|
|
||||||
MMU.CPU_MEM_TYPE[i] = state.mmu.CPU_MEM_TYPE[i];
|
|
||||||
MMU.CPU_MEM_PAGE[i] = state.mmu.CPU_MEM_PAGE[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// SAVE VRAM MEMORY DATA
|
|
||||||
for (int i = 0; i < 12; i++)
|
|
||||||
{
|
|
||||||
MMU.PPU_MEM_TYPE[i] = state.mmu.PPU_MEM_TYPE[i];
|
|
||||||
MMU.PPU_MEM_PAGE[i] = state.mmu.PPU_MEM_PAGE[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < 8; i++)
|
|
||||||
{
|
|
||||||
MMU.CRAM_USED[i] = state.mmu.CRAM_USED[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// WRITE CPU RAM MEMORY BANK
|
|
||||||
|
|
||||||
int stateStep = 0;
|
|
||||||
var stateCPU_MEM_BANK = state.CPU_MEM_BANK.ToArray();
|
|
||||||
|
|
||||||
for (int i = 3; i < 8; i++)
|
|
||||||
{
|
|
||||||
if (state.mmu.CPU_MEM_TYPE[i] != MMU.BANKTYPE_ROM)
|
|
||||||
{
|
|
||||||
var sourceData = new Span<byte>(stateCPU_MEM_BANK, stateStep * 8 * 1024, 8 * 1024);
|
|
||||||
MMU.CPU_MEM_BANK[i].WriteTo(sourceData.ToArray(), 0, 8 * 1024);
|
|
||||||
stateStep++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Array.Copy(state.VRAM, MMU.VRAM, state.VRAM.Length);
|
|
||||||
|
|
||||||
stateStep = 0;
|
|
||||||
var stateCRAM = state.CRAM.ToArray();
|
|
||||||
// LOAD CRAM MEMORY
|
|
||||||
for (int i = 0; i < 8; i++)
|
|
||||||
{
|
|
||||||
if (MMU.CRAM_USED[i] != 0)
|
|
||||||
{
|
|
||||||
var sourceData = stateCRAM.AsSpan(stateStep * 4 * 1024, 4 * 1024).ToArray();
|
|
||||||
Array.Copy(sourceData, 0, MMU.CRAM, 0x1000 * i, 4 * 1024);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// MMC STATE
|
|
||||||
{
|
|
||||||
state.mmc = MMCSTAT.GetDefault();
|
|
||||||
|
|
||||||
// Create Header
|
|
||||||
state.mmcBLOCK.ID = "MMC DATA";
|
|
||||||
state.mmcBLOCK.BlockVersion = 0x0100;
|
|
||||||
state.mmcBLOCK.BlockSize = state.mmc.GetSize();
|
|
||||||
|
|
||||||
if (mapper.IsStateSave())
|
|
||||||
{
|
|
||||||
mapper.LoadState(state.mmc.mmcdata);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//CONTROLLER STATE
|
|
||||||
{
|
|
||||||
pad.pad1bit = state.ctr.pad1bit;
|
|
||||||
pad.pad2bit = state.ctr.pad2bit;
|
|
||||||
pad.pad3bit = state.ctr.pad3bit;
|
|
||||||
pad.pad4bit = state.ctr.pad4bit;
|
|
||||||
pad.SetStrobe(state.ctr.strobe == 0 ? false : true);
|
|
||||||
}
|
|
||||||
|
|
||||||
//SND STATE
|
|
||||||
{
|
|
||||||
state.snd = SNDSTAT.GetDefault();
|
|
||||||
|
|
||||||
var buffer = new StateReader(state.snd.snddata);
|
|
||||||
apu.LoadState(buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
// DISKIMAGE STATE
|
|
||||||
if (rom.GetMapperNo() == 20)
|
|
||||||
{
|
|
||||||
var lpDisk = rom.GetPROM();
|
|
||||||
var lpWrite = rom.GetDISK();
|
|
||||||
int DiskSize = 16 + 65500 * rom.GetDiskNo();
|
|
||||||
|
|
||||||
Array.Clear(lpWrite, 0, DiskSize);
|
|
||||||
|
|
||||||
for (int i = 0; i < state.dsk.DifferentSize; i++)
|
|
||||||
{
|
|
||||||
var pos = state.dskdata[i];
|
|
||||||
byte data = (byte)(pos >> 24);
|
|
||||||
pos &= 0x00FFFFFF;
|
|
||||||
|
|
||||||
if (pos >= 16 && pos < DiskSize)
|
|
||||||
{
|
|
||||||
lpDisk[pos] = data;
|
|
||||||
lpWrite[pos] = 0xFF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// EXCTR STATE
|
|
||||||
if (pad.GetExController() != 0)
|
|
||||||
{
|
|
||||||
pad.SetSyncExData(state.exctr.data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void SetZapperPos(int x, int y)
|
|
||||||
{
|
|
||||||
ZapperX = x; ZapperY = y;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum IRQMETHOD
|
public enum IRQMETHOD
|
||||||
|
|||||||
@ -515,11 +515,6 @@ namespace VirtualNes.Core
|
|||||||
return bStrobe;
|
return bStrobe;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void SetStrobe(bool v)
|
|
||||||
{
|
|
||||||
bStrobe = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal uint GetSyncExData()
|
internal uint GetSyncExData()
|
||||||
{
|
{
|
||||||
uint data = 0;
|
uint data = 0;
|
||||||
@ -576,63 +571,6 @@ namespace VirtualNes.Core
|
|||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
internal void SetSyncExData(uint data)
|
|
||||||
{
|
|
||||||
switch ((EXCONTROLLER)excontroller_select)
|
|
||||||
{
|
|
||||||
case EXCONTROLLER.EXCONTROLLER_ZAPPER:
|
|
||||||
case EXCONTROLLER.EXCONTROLLER_PADDLE:
|
|
||||||
case EXCONTROLLER.EXCONTROLLER_SPACESHADOWGUN:
|
|
||||||
case EXCONTROLLER.EXCONTROLLER_OEKAKIDS_TABLET:
|
|
||||||
case EXCONTROLLER.EXCONTROLLER_VSZAPPER:
|
|
||||||
{
|
|
||||||
int x, y;
|
|
||||||
if ((data & 0x80000000) != 0)
|
|
||||||
{
|
|
||||||
x = -1;
|
|
||||||
y = -1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
x = (int)(data & 0xFF);
|
|
||||||
y = (int)((data & 0xFF00) >> 8);
|
|
||||||
}
|
|
||||||
expad.SetSyncData(0, x);
|
|
||||||
expad.SetSyncData(1, y);
|
|
||||||
nes.SetZapperPos(x, y);
|
|
||||||
}
|
|
||||||
if (excontroller_select != (int)EXCONTROLLER.EXCONTROLLER_SPACESHADOWGUN)
|
|
||||||
{
|
|
||||||
if ((data & 0x0010000) != 0)
|
|
||||||
expad.SetSyncData(2, 1);
|
|
||||||
else
|
|
||||||
expad.SetSyncData(2, 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
expad.SetSyncData(2, (byte)(data >> 16));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case EXCONTROLLER.EXCONTROLLER_CRAZYCLIMBER:
|
|
||||||
expad.SetSyncData(0, (int)data);
|
|
||||||
break;
|
|
||||||
case EXCONTROLLER.EXCONTROLLER_TOPRIDER:
|
|
||||||
expad.SetSyncData(0, (int)data);
|
|
||||||
break;
|
|
||||||
case EXCONTROLLER.EXCONTROLLER_FAMILYTRAINER_A:
|
|
||||||
case EXCONTROLLER.EXCONTROLLER_FAMILYTRAINER_B:
|
|
||||||
expad.SetSyncData(0, (int)data);
|
|
||||||
break;
|
|
||||||
case EXCONTROLLER.EXCONTROLLER_EXCITINGBOXING:
|
|
||||||
expad.SetSyncData(0, (int)data);
|
|
||||||
break;
|
|
||||||
case EXCONTROLLER.EXCONTROLLER_MAHJANG:
|
|
||||||
expad.SetSyncData(0, (int)data);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum VSType
|
public enum VSType
|
||||||
|
|||||||
@ -353,31 +353,16 @@ namespace VirtualNes.Core
|
|||||||
return diskno;
|
return diskno;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void SetDiskNo(int v)
|
|
||||||
{
|
|
||||||
diskno = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal uint GetGameID()
|
internal uint GetGameID()
|
||||||
{
|
{
|
||||||
return fdsgameID;
|
return fdsgameID;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void SetGameID(uint id)
|
|
||||||
{
|
|
||||||
fdsgameID = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal uint GetMakerID()
|
internal uint GetMakerID()
|
||||||
{
|
{
|
||||||
return fdsmakerID;
|
return fdsmakerID;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void SetMakerID(uint id)
|
|
||||||
{
|
|
||||||
fdsmakerID = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal bool IsVSUNISYSTEM()
|
internal bool IsVSUNISYSTEM()
|
||||||
{
|
{
|
||||||
return (header.control2 & (byte)EnumRomControlByte2.ROM_VSUNISYSTEM) != 0;
|
return (header.control2 & (byte)EnumRomControlByte2.ROM_VSUNISYSTEM) != 0;
|
||||||
@ -388,11 +373,6 @@ namespace VirtualNes.Core
|
|||||||
return crc;
|
return crc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetPROM_CRC(uint v)
|
|
||||||
{
|
|
||||||
crc = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal byte GetPROM_SIZE()
|
internal byte GetPROM_SIZE()
|
||||||
{
|
{
|
||||||
return header.PRG_PAGE_SIZE;
|
return header.PRG_PAGE_SIZE;
|
||||||
|
|||||||
@ -3,19 +3,11 @@
|
|||||||
public struct BLOCKHDR : IStateBufferObject
|
public struct BLOCKHDR : IStateBufferObject
|
||||||
{
|
{
|
||||||
public readonly bool Valid => !string.IsNullOrEmpty(ID);
|
public readonly bool Valid => !string.IsNullOrEmpty(ID);
|
||||||
/// <summary> 总是8个字节 </summary>
|
|
||||||
public string ID;
|
public string ID;
|
||||||
public ushort Reserved;
|
public ushort Reserved;
|
||||||
public ushort BlockVersion;
|
public ushort BlockVersion;
|
||||||
public uint BlockSize;
|
public uint BlockSize;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public readonly uint GetSize()
|
|
||||||
{
|
|
||||||
return (uint)(8 + sizeof(ushort) + sizeof(ushort) + sizeof(uint));
|
|
||||||
}
|
|
||||||
|
|
||||||
public readonly void SaveState(StateBuffer buffer)
|
public readonly void SaveState(StateBuffer buffer)
|
||||||
{
|
{
|
||||||
if (Valid)
|
if (Valid)
|
||||||
@ -27,12 +19,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
public readonly uint GetSize()
|
||||||
{
|
{
|
||||||
ID = buffer.Read_string(8);
|
return (uint)(ID.Length + sizeof(ushort) + sizeof(ushort) + sizeof(uint));
|
||||||
Reserved = buffer.Read_ushort();
|
|
||||||
BlockVersion = buffer.Read_ushort();
|
|
||||||
BlockSize = buffer.Read_uint();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,14 +24,5 @@ namespace VirtualNes.Core
|
|||||||
buffer.Write(pad4bit);
|
buffer.Write(pad4bit);
|
||||||
buffer.Write(strobe);
|
buffer.Write(strobe);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
pad1bit = buffer.Read_uint();
|
|
||||||
pad2bit = buffer.Read_uint();
|
|
||||||
pad3bit = buffer.Read_uint();
|
|
||||||
pad4bit = buffer.Read_uint();
|
|
||||||
strobe = buffer.Read_byte();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,10 +13,5 @@
|
|||||||
{
|
{
|
||||||
buffer.Write(DifferentSize);
|
buffer.Write(DifferentSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
DifferentSize = buffer.Read_int();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,10 +13,5 @@
|
|||||||
{
|
{
|
||||||
buffer.Write(data);
|
buffer.Write(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
data = buffer.Read_uint();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,13 +16,6 @@ namespace VirtualNes.Core
|
|||||||
/// <summary> 2字节 </summary>
|
/// <summary> 2字节 </summary>
|
||||||
public ushort Ext2;
|
public ushort Ext2;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public readonly uint GetSize()
|
|
||||||
{
|
|
||||||
return (uint)(ID.Length + sizeof(ushort) + sizeof(uint) + sizeof(ushort) + sizeof(ushort));
|
|
||||||
}
|
|
||||||
|
|
||||||
public readonly void SaveState(StateBuffer buffer)
|
public readonly void SaveState(StateBuffer buffer)
|
||||||
{
|
{
|
||||||
buffer.Write(ID);
|
buffer.Write(ID);
|
||||||
@ -32,13 +25,9 @@ namespace VirtualNes.Core
|
|||||||
buffer.Write(Ext2);
|
buffer.Write(Ext2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
public readonly uint GetSize()
|
||||||
{
|
{
|
||||||
ID = buffer.Read_string(12);
|
return (uint)(ID.Length + sizeof(ushort) + sizeof(uint) + sizeof(ushort) + sizeof(ushort));
|
||||||
BlockVersion = buffer.Read_ushort();
|
|
||||||
Ext0 = buffer.Read_uint();
|
|
||||||
Ext1 = buffer.Read_ushort();
|
|
||||||
Ext2 = buffer.Read_ushort();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,19 +9,14 @@
|
|||||||
return new MMCSTAT() { mmcdata = new byte[256] };
|
return new MMCSTAT() { mmcdata = new byte[256] };
|
||||||
}
|
}
|
||||||
|
|
||||||
public readonly uint GetSize()
|
public uint GetSize()
|
||||||
{
|
{
|
||||||
return 256;
|
return (uint)mmcdata.Length;
|
||||||
}
|
}
|
||||||
|
|
||||||
public readonly void SaveState(StateBuffer buffer)
|
public void SaveState(StateBuffer buffer)
|
||||||
{
|
{
|
||||||
buffer.Write(mmcdata);
|
buffer.Write(mmcdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
mmcdata = buffer.Read_bytes(256);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,14 +34,5 @@
|
|||||||
buffer.Write(PPU_MEM_PAGE);
|
buffer.Write(PPU_MEM_PAGE);
|
||||||
buffer.Write(CRAM_USED);
|
buffer.Write(CRAM_USED);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
CPU_MEM_TYPE = buffer.Read_bytes(8);
|
|
||||||
CPU_MEM_PAGE = buffer.Read_ushorts(8);
|
|
||||||
PPU_MEM_TYPE = buffer.Read_bytes(12);
|
|
||||||
PPU_MEM_PAGE = buffer.Read_ushorts(12);
|
|
||||||
CRAM_USED = buffer.Read_bytes(8);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,13 +34,5 @@ namespace VirtualNes.Core
|
|||||||
buffer.Write(SPPAL);
|
buffer.Write(SPPAL);
|
||||||
buffer.Write(SPRAM);
|
buffer.Write(SPRAM);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
RAM = buffer.Read_bytes(2 * 1024);
|
|
||||||
BGPAL = buffer.Read_bytes(16);
|
|
||||||
SPPAL = buffer.Read_bytes(16);
|
|
||||||
SPRAM = buffer.Read_bytes(256);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,23 +5,15 @@
|
|||||||
public CPUSTAT cpureg;
|
public CPUSTAT cpureg;
|
||||||
public PPUSTAT ppureg;
|
public PPUSTAT ppureg;
|
||||||
|
|
||||||
|
public void SaveState(StateBuffer buffer)
|
||||||
|
|
||||||
public readonly uint GetSize()
|
|
||||||
{
|
|
||||||
return cpureg.GetSize() + ppureg.GetSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
public readonly void SaveState(StateBuffer buffer)
|
|
||||||
{
|
{
|
||||||
cpureg.SaveState(buffer);
|
cpureg.SaveState(buffer);
|
||||||
ppureg.SaveState(buffer);
|
ppureg.SaveState(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
public uint GetSize()
|
||||||
{
|
{
|
||||||
cpureg.LoadState(buffer);
|
return cpureg.GetSize() + ppureg.GetSize();
|
||||||
ppureg.LoadState(buffer);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,25 +60,6 @@
|
|||||||
buffer.Write(emul_cycles);
|
buffer.Write(emul_cycles);
|
||||||
buffer.Write(base_cycles);
|
buffer.Write(base_cycles);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
PC = buffer.Read_ushort();
|
|
||||||
A = buffer.Read_byte();
|
|
||||||
X = buffer.Read_byte();
|
|
||||||
Y = buffer.Read_byte();
|
|
||||||
S = buffer.Read_byte();
|
|
||||||
P = buffer.Read_byte();
|
|
||||||
I = buffer.Read_byte();
|
|
||||||
FrameIRQ = buffer.Read_byte();
|
|
||||||
FrameIRQ_occur = buffer.Read_byte();
|
|
||||||
FrameIRQ_count = buffer.Read_byte();
|
|
||||||
FrameIRQ_type = buffer.Read_byte();
|
|
||||||
FrameIRQ_cycles = buffer.Read_int();
|
|
||||||
DMA_cycles = buffer.Read_int();
|
|
||||||
emul_cycles = buffer.Read_long();
|
|
||||||
base_cycles = buffer.Read_long();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct PPUSTAT : IStateBufferObject
|
public struct PPUSTAT : IStateBufferObject
|
||||||
@ -119,18 +92,5 @@
|
|||||||
buffer.Write(loopy_v);
|
buffer.Write(loopy_v);
|
||||||
buffer.Write(loopy_x);
|
buffer.Write(loopy_x);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
reg0 = buffer.Read_byte();
|
|
||||||
reg1 = buffer.Read_byte();
|
|
||||||
reg2 = buffer.Read_byte();
|
|
||||||
reg3 = buffer.Read_byte();
|
|
||||||
reg7 = buffer.Read_byte();
|
|
||||||
toggle56 = buffer.Read_byte();
|
|
||||||
loopy_t = buffer.Read_ushort();
|
|
||||||
loopy_v = buffer.Read_ushort();
|
|
||||||
loopy_x = buffer.Read_ushort();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,19 +15,14 @@ namespace VirtualNes.Core
|
|||||||
return new SNDSTAT() { snddata = new byte[0x800] };
|
return new SNDSTAT() { snddata = new byte[0x800] };
|
||||||
}
|
}
|
||||||
|
|
||||||
public readonly uint GetSize()
|
public uint GetSize()
|
||||||
{
|
{
|
||||||
return (uint)snddata.Length;
|
return (uint)snddata.Length;
|
||||||
}
|
}
|
||||||
|
|
||||||
public readonly void SaveState(StateBuffer buffer)
|
public void SaveState(StateBuffer buffer)
|
||||||
{
|
{
|
||||||
buffer.Write(snddata);
|
buffer.Write(snddata);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(StateReader buffer)
|
|
||||||
{
|
|
||||||
snddata = buffer.Read_bytes(0x800);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,7 @@ namespace VirtualNes.Core
|
|||||||
|
|
||||||
public BLOCKHDR dskBLOCK;
|
public BLOCKHDR dskBLOCK;
|
||||||
public DISKDATA dsk;
|
public DISKDATA dsk;
|
||||||
public List<uint> dskdata;
|
public uint dskdata;
|
||||||
|
|
||||||
public BLOCKHDR exctrBLOCK;
|
public BLOCKHDR exctrBLOCK;
|
||||||
public EXCTRSTAT exctr;
|
public EXCTRSTAT exctr;
|
||||||
@ -87,10 +87,7 @@ namespace VirtualNes.Core
|
|||||||
{
|
{
|
||||||
dskBLOCK.SaveState(buffer);
|
dskBLOCK.SaveState(buffer);
|
||||||
dsk.SaveState(buffer);
|
dsk.SaveState(buffer);
|
||||||
foreach (var data in dskdata)
|
buffer.Write(dskdata);
|
||||||
{
|
|
||||||
buffer.Write(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exctrBLOCK.Valid)
|
if (exctrBLOCK.Valid)
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace VirtualNes.Core
|
namespace VirtualNes.Core
|
||||||
@ -32,11 +31,15 @@ namespace VirtualNes.Core
|
|||||||
}
|
}
|
||||||
public void Write(sbyte[] sbytes)
|
public void Write(sbyte[] sbytes)
|
||||||
{
|
{
|
||||||
foreach (var value in sbytes)
|
foreach(var value in sbytes)
|
||||||
{
|
{
|
||||||
Write(value);
|
Write(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void Write(byte[] bytes, int length)
|
||||||
|
{
|
||||||
|
Data.AddRange(bytes);
|
||||||
|
}
|
||||||
public void Write(byte value)
|
public void Write(byte value)
|
||||||
{
|
{
|
||||||
Data.Add(value);
|
Data.Add(value);
|
||||||
@ -77,134 +80,11 @@ namespace VirtualNes.Core
|
|||||||
{
|
{
|
||||||
Write(BitConverter.GetBytes(value));
|
Write(BitConverter.GetBytes(value));
|
||||||
}
|
}
|
||||||
public void Write(uint value)
|
|
||||||
{
|
|
||||||
Write(BitConverter.GetBytes(value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class StateReader
|
|
||||||
{
|
|
||||||
private MemoryStream m_dataStream;
|
|
||||||
public StateReader(byte[] bytes)
|
|
||||||
{
|
|
||||||
m_dataStream = new MemoryStream(bytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Skip(uint count)
|
|
||||||
{
|
|
||||||
m_dataStream.Seek(count, SeekOrigin.Current);
|
|
||||||
}
|
|
||||||
public void Skip(long count)
|
|
||||||
{
|
|
||||||
m_dataStream.Seek(count, SeekOrigin.Current);
|
|
||||||
}
|
|
||||||
|
|
||||||
public byte[] Read_bytes(int length)
|
|
||||||
{
|
|
||||||
var result = new byte[length];
|
|
||||||
m_dataStream.Read(result, 0, length);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
public sbyte[] Read_sbytes(int length)
|
|
||||||
{
|
|
||||||
var result = new sbyte[length];
|
|
||||||
for (int i = 0; i < length; i++)
|
|
||||||
{
|
|
||||||
result[i] = (sbyte)m_dataStream.ReadByte();
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public byte Read_byte()
|
|
||||||
{
|
|
||||||
return (byte)m_dataStream.ReadByte();
|
|
||||||
}
|
|
||||||
public ushort[] Read_ushorts(int length)
|
|
||||||
{
|
|
||||||
ushort[] result = new ushort[length];
|
|
||||||
for (int i = 0; i < length; i++)
|
|
||||||
{
|
|
||||||
int byte1 = m_dataStream.ReadByte();
|
|
||||||
int byte2 = m_dataStream.ReadByte();
|
|
||||||
|
|
||||||
result[i] = (ushort)(byte1 << 8 | byte2);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
public int[] Read_ints(int length)
|
|
||||||
{
|
|
||||||
int[] result = new int[length];
|
|
||||||
for (int i = 0; i < length; i++)
|
|
||||||
{
|
|
||||||
int byte1 = m_dataStream.ReadByte();
|
|
||||||
int byte2 = m_dataStream.ReadByte();
|
|
||||||
int byte3 = m_dataStream.ReadByte();
|
|
||||||
int byte4 = m_dataStream.ReadByte();
|
|
||||||
|
|
||||||
result[i] = byte1 << 24 | byte2 << 16 | byte3 << 8 | byte4;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public string Read_string(int length)
|
|
||||||
{
|
|
||||||
var result = Read_bytes(length);
|
|
||||||
return Encoding.ASCII.GetString(result);
|
|
||||||
}
|
|
||||||
public double Read_double()
|
|
||||||
{
|
|
||||||
var result = Read_bytes(4);
|
|
||||||
return BitConverter.ToDouble(result, 0);
|
|
||||||
}
|
|
||||||
public ushort Read_ushort()
|
|
||||||
{
|
|
||||||
var b1 = Read_byte();
|
|
||||||
var b2 = Read_byte();
|
|
||||||
return (ushort)(b1 << 8 | b2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int Read_int()
|
|
||||||
{
|
|
||||||
var b1 = Read_byte();
|
|
||||||
var b2 = Read_byte();
|
|
||||||
var b3 = Read_byte();
|
|
||||||
var b4 = Read_byte();
|
|
||||||
|
|
||||||
return b1 << 24 | b2 << 16 | b3 << 8 | b4;
|
|
||||||
}
|
|
||||||
|
|
||||||
public sbyte Read_sbyte(sbyte value)
|
|
||||||
{
|
|
||||||
return (sbyte)m_dataStream.ReadByte();
|
|
||||||
}
|
|
||||||
public long Read_long()
|
|
||||||
{
|
|
||||||
var b1 = Read_byte();
|
|
||||||
var b2 = Read_byte();
|
|
||||||
var b3 = Read_byte();
|
|
||||||
var b4 = Read_byte();
|
|
||||||
var b5 = Read_byte();
|
|
||||||
var b6 = Read_byte();
|
|
||||||
var b7 = Read_byte();
|
|
||||||
var b8 = Read_byte();
|
|
||||||
|
|
||||||
return b1 << 56 | b2 << 48 | b3 << 40 | b4 << 32 | b5 << 24 | b6 << 16 | b7 << 8 | b8;
|
|
||||||
}
|
|
||||||
|
|
||||||
public uint Read_uint()
|
|
||||||
{
|
|
||||||
return (uint)Read_int();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IStateBufferObject
|
public interface IStateBufferObject
|
||||||
{
|
{
|
||||||
uint GetSize();
|
uint GetSize();
|
||||||
void SaveState(StateBuffer buffer);
|
void SaveState(StateBuffer buffer);
|
||||||
void LoadState(StateReader buffer);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user