This commit is contained in:
ALIENJACK\alien 2025-01-24 13:24:56 +08:00
commit 285d9f4f65
79 changed files with 9957 additions and 130 deletions

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 799083da753bb1c4a906a6fbe48281d9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 271a8a6401146c04ab5fb754032a2dd5

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 61f0db825f947a34b8a0fbd5817485ae
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,557 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3471319444171359706
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3471319444171359701}
- component: {fileID: 3471319444171359703}
- component: {fileID: 3471319444171359700}
m_Layer: 5
m_Name: Game
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3471319444171359701
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319444171359706}
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:
- {fileID: 3471319446025011658}
- {fileID: 3471319444327146586}
m_Father: {fileID: 3471319444310732615}
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 &3471319444171359703
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319444171359706}
m_CullTransparentMesh: 1
--- !u!114 &3471319444171359700
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319444171359706}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, 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_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &3471319444260926850
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3471319444260926876}
- component: {fileID: 3471319444260926877}
m_Layer: 0
m_Name: UMAME
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3471319444260926876
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319444260926850}
serializedVersion: 2
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:
- {fileID: 3471319446102792544}
- {fileID: 3471319445075249870}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &3471319444260926877
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319444260926850}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 49349ac585d920c4f937c48232c8dfd7, type: 3}
m_Name:
m_EditorClassIdentifier:
mUniVideoPlayer: {fileID: 0}
mFPS: {fileID: 0}
bQuickTestRom: 0
mQuickTestRom:
--- !u!1 &3471319444310732612
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3471319444310732615}
- component: {fileID: 3471319444310732608}
- component: {fileID: 3471319444310732609}
- component: {fileID: 3471319444310732614}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3471319444310732615
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319444310732612}
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: 3471319444171359701}
m_Father: {fileID: 3471319446102792544}
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 &3471319444310732608
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319444310732612}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 1
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_VertexColorAlwaysGammaSpace: 0
m_AdditionalShaderChannelsFlag: 0
m_UpdateRectTransformForStandalone: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!114 &3471319444310732609
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319444310732612}
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 &3471319444310732614
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319444310732612}
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 &3471319444327146587
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3471319444327146586}
- component: {fileID: 3471319444327146580}
- component: {fileID: 3471319444327146581}
m_Layer: 5
m_Name: FPS
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3471319444327146586
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319444327146587}
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: 3471319444171359701}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 454.963, y: -46.19702}
m_SizeDelta: {x: 871.1646, y: 70.007}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3471319444327146580
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319444327146587}
m_CullTransparentMesh: 1
--- !u!114 &3471319444327146581
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319444327146587}
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: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
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: 41
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 107
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: fps
--- !u!1 &3471319445075249871
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3471319445075249870}
- component: {fileID: 3471319445075249864}
- component: {fileID: 3471319445075249865}
m_Layer: 0
m_Name: Audio
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3471319445075249870
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319445075249871}
serializedVersion: 2
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: 3471319444260926876}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &3471319445075249864
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319445075249871}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0}
m_Resource: {fileID: 0}
m_PlayOnAwake: 0
m_Volume: 1
m_Pitch: 1
Loop: 1
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 &3471319445075249865
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319445075249871}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 89abab1d3b1020340a147d74e60751ce, type: 3}
m_Name:
m_EditorClassIdentifier:
m_as: {fileID: 3471319445075249864}
--- !u!1 &3471319446025011659
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3471319446025011658}
- component: {fileID: 3471319446025011652}
- component: {fileID: 3471319446025011653}
m_Layer: 5
m_Name: GameRawImage
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3471319446025011658
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319446025011659}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3471319444171359701}
m_LocalEulerAnglesHint: {x: 180, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1862.1006, y: -20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3471319446025011652
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319446025011659}
m_CullTransparentMesh: 1
--- !u!114 &3471319446025011653
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319446025011659}
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: 0, g: 0, b: 0, a: 1}
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 0}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
--- !u!1 &3471319446102792545
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3471319446102792544}
m_Layer: 0
m_Name: Video
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3471319446102792544
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3471319446102792545}
serializedVersion: 2
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:
- {fileID: 3471319444310732615}
m_Father: {fileID: 3471319444260926876}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1cb6308e67105bf48aea153ebcdb2d76
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7288a5cba2eb779418cc490967d981b2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 65816e3cba19de446b225f8eead5ec1f
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8653d87eab52e6941a87038ef06a2dea
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 59fd575d698130a43a79dc166d4051d3
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 61b2fc8f46ed4f64da4d5f87cd7362c2
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: bb2d5e2ca3a42074897b32eb592df77c
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 422f76db48bff6940ae7ab6677628565
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d3a1ac26f228c844fbdabcdb4c2a5710
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d319336d09b4a184fbdd51107048ab45
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,10 @@
Detail: https://www.codeproject.com/Articles/1275365/MAME-NET
You should install Microsoft .NET Framework 3.5 or higher before running the program. You should download MAME.NET ROM files in roms directory.
Hotkey: F3 -- soft reset, F7 -- load state, Shift+F7 -- save state, F8 -- replay input, Shift+F8 -- record input (start and stop), 0-9 and A-Z after state related hotkey -- handle certain files, F10 -- toggle global throttle, P -- pause and continue, shift+P -- skip a frame.
Control key: 1 -- P1 start, 2 -- P2 start, 5 -- P1 coin, 6 -- P2 coin, R -- Service 1, T -- Service, W -- P1 up, S -- P1 down, A -- P1 left, D -- P1 right, J -- P1 button1, K -- P1 button 2, L -- P1 button 3, U -- P1 button 4, I -- P1 button 5, O -- P1 button 6, Up -- P2 up, Down -- P2 down, Left -- P2 left, Right -- P2 right, NumPad1 -- P2 button 1, NumPad2 -- P2 button 2, NumPad3 -- P2 button 3, NumPad4 -- P2 button 4, NumPad5 -- P2 button 5, NumPad6 -- P2 button 6.
Mouse supported games: Operation Wolf.
When the ROMs of a game are loaded, the emulator is auto paused. Press P to continue.
Occasionally GDI+ error occurs and a red cross is shown. You can click "File-Reset picturebox" to handle the error.
MAME.NET ROM files: https://pan.baidu.com/s/14bR2wEzU2Qqx5hM7hJXMZA https://drive.google.com/folderview?id=11brIxHTJ_M4yOkm08wR3LOibZyEitcAw
program reference: https://pan.baidu.com/s/1u9B9tBH0SNcJA3vIu75awA https://drive.google.com/folderview?id=1-BEXXjVYUK5s2zDAp4AfQzCbpcGrcItF
Email: shunninghuang@gmail.com

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0a511236317e4874594088e125a1a39c
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 60a7b0e5c8b772d409dcbec7b6695f74
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 6d2848c0a1e76cf49b3e091adc79da62
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b56c11278238d6c4e902a42ae6948279
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6019649657419e146ab2b4796835be14
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 99dcde864a2f2cd41a7fa7e6289820c9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,16 @@
using UnityEngine;
public class UniMAMESetting
{
public static UniMAMESetting instance
{
get
{
if (mInstance == null)
mInstance = new UniMAMESetting();
return mInstance;
}
}
private static UniMAMESetting mInstance;
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8e93a2fd757533948a43218e424841a7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,229 @@
using AxiReplay;
using MAME.Core;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using UnityEngine;
using UnityEngine.UI;
using AxibugEmuOnline.Client;
using AxibugEmuOnline.Client.ClientCore;
using AxibugProtobuf;
using static AxibugEmuOnline.Client.NesControllerMapper;
using VirtualNes.Core;
using System.Linq;
using AxibugEmuOnline.Client.Event;
public class UMAME : MonoBehaviour, IEmuCore
{
public static UMAME instance { get; private set; }
public MAMEEmu emu { get; private set; }
UniLog mUniLog;
UniMouse mUniMouse;
[HideInInspector]
public UniVideoPlayer mUniVideoPlayer;
UniSoundPlayer mUniSoundPlayer;
UniKeyboard mUniKeyboard;
UniResources mUniResources;
public Text mFPS;
private Canvas mCanvas;
public List<RomInfo> HadGameList = new List<RomInfo>();
string mChangeRomName = string.Empty;
public UniTimeSpan mTimeSpan;
public bool bQuickTestRom = false;
public string mQuickTestRom = string.Empty;
public ReplayWriter mReplayWriter;
public ReplayReader mReplayReader;
public long currEmuFrame => emu.currEmuFrame;
public static System.Diagnostics.Stopwatch sw = System.Diagnostics.Stopwatch.StartNew();
public static bool bInGame { get; private set; }
public static bool bLogicUpdatePause { get; private set; }
public string EmuDataPath { get { return App.PersistentDataPath(Platform); } }
public string RomPath => EmuDataPath + "/RemoteRoms/";
public string SavePath => EmuDataPath + "/sav/";
public RomPlatformType Platform { get { return mPlatform; } }
RomPlatformType mPlatform = RomPlatformType.Cps1;
public uint Frame => (uint)emu.currEmuFrame;
void Awake()
{
//设为60帧
Application.targetFrameRate = 60;
// 强制横屏
Screen.orientation = ScreenOrientation.LandscapeLeft;
instance = this;
mFPS = GameObject.Find("FPS").GetComponent<Text>();
mCanvas = GameObject.Find("Canvas").GetComponent<Canvas>();
mCanvas.worldCamera = Camera.main;
emu = new MAMEEmu();
mUniLog = new UniLog();
mUniMouse = this.gameObject.AddComponent<UniMouse>();
mUniVideoPlayer = this.gameObject.AddComponent<UniVideoPlayer>();
mUniSoundPlayer = GameObject.Find("Audio").transform.GetComponent<UniSoundPlayer>();
mUniKeyboard = this.gameObject.AddComponent<UniKeyboard>();
mUniResources = new UniResources();
mChangeRomName = string.Empty;
mTimeSpan = new UniTimeSpan();
emu.Init(RomPath, mUniLog, mUniResources, mUniVideoPlayer, mUniSoundPlayer, mUniKeyboard, mUniMouse, mTimeSpan);
}
void OnEnable()
{
}
void OnDisable()
{
StopGame();
}
#region
public object GetState()
{
return SaveState();
}
public byte[] GetStateBytes()
{
return SaveState();
}
public void LoadState(object state)
{
LoadState((byte[])state);
}
public void LoadStateFromBytes(byte[] data)
{
LoadState(data);
}
public void Pause()
{
bLogicUpdatePause = false;
}
public void Resume()
{
bLogicUpdatePause = true;
}
public MsgBool StartGame(RomFile romFile)
{
mPlatform = romFile.Platform;
mTimeSpan.InitStandTime();
if (LoadGame(romFile.FileName, false))
return true;
else
return "Rom加载失败";
}
public void Dispose()
{
StopGame();
}
public void DoReset()
{
StopGame();
LoadGame(mChangeRomName, false);
}
public IControllerSetuper GetControllerSetuper()
{
return mUniKeyboard.ControllerMapper;
}
#endregion
bool LoadGame(string loadRom, bool bReplay = false)
{
//Application.targetFrameRate = 60;
mReplayWriter = new ReplayWriter(mChangeRomName, "fuck", ReplayData.ReplayFormat.FM32IP64, Encoding.UTF8);
mChangeRomName = loadRom;
StopGame();
//读取ROM
emu.LoadRom(mChangeRomName);
//读取成功
if (emu.bRom)
{
if (bReplay)
{
string Path = SavePath + Machine.sName + ".rp";
mReplayReader = new ReplayReader(Path);
mUniKeyboard.SetRePlay(true);
}
//读取ROM之后获得宽高初始化画面
int _width; int _height; IntPtr _framePtr;
emu.GetGameScreenSize(out _width, out _height, out _framePtr);
App.log.Debug($"_width->{_width}, _height->{_height}, _framePtr->{_framePtr}");
mUniVideoPlayer.Initialize(_width, _height, _framePtr);
//初始化音频
mUniSoundPlayer.Initialize();
//开始游戏
emu.StartGame();
bInGame = true;
bLogicUpdatePause = true;
return true;
}
else
{
App.log.Debug($"ROM加载失败");
return false;
}
}
void Update()
{
mFPS.text = ($"fpsv {mUniVideoPlayer.videoFPS.ToString("F2")} fpsa {mUniSoundPlayer.audioFPS.ToString("F2")}");
if (!bInGame)
return;
if (bLogicUpdatePause)
{
//采集本帧Input
mUniKeyboard.UpdateInputKey();
//放行下一帧
//emu.UnlockNextFreme();
//推帧
emu.UpdateFrame();
}
mUniVideoPlayer.ApplyFilterEffect();
mUniVideoPlayer.ApplyScreenScaler();
}
public void SaveReplay()
{
string Path = SavePath + Machine.sName + ".rp";
string dbgPath = SavePath + Machine.sName + ".rpwrite";
mReplayWriter.SaveData(Path, true, dbgPath);
}
public void StopGame()
{
if (bInGame)
{
emu.StopGame();
mUniVideoPlayer.StopVideo();
mUniSoundPlayer.StopPlay();
bInGame = false;
bLogicUpdatePause = false;
}
}
byte[] SaveState()
{
if (!Directory.Exists(SavePath))
Directory.CreateDirectory(SavePath);
MemoryStream ms = new MemoryStream();
BinaryWriter bw = new BinaryWriter(ms);
emu.SaveState(bw);
byte[] data = ms.ToArray();
bw.Close();
ms.Close();
return data;
//byte[] screenData = UMAME.instance.mUniVideoPlayer.GetScreenImg();
//FileStream fsImg = new FileStream(SavePath + Machine.sName + ".jpg", FileMode.Create);
//fsImg.Write(screenData, 0, screenData.Length);
//fsImg.Close();
}
void LoadState(byte[] data)
{
MemoryStream fs = new MemoryStream(data);
BinaryReader br = new BinaryReader(fs);
emu.LoadState(br);
br.Close();
fs.Close();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 49349ac585d920c4f937c48232c8dfd7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9747519294fc9f04fbb6f1657c6d1dca
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,386 @@
using AxibugEmuOnline.Client.Event;
using MAME.Core;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
public class UniKeyboard : MonoBehaviour, IKeyboard
{
public MameControllerMapper ControllerMapper { get; private set; }
bool bReplayMode;
PlayMode mPlayMode;
ReplayMode mReplayMode;
void Awake()
{
ControllerMapper = new MameControllerMapper();
Init(false);
}
public ulong GetPressedKeys()
{
ulong InputData;
if (!bReplayMode)
InputData = mPlayMode.GetPressedKeys();
else
InputData = mReplayMode.GetPressedKeys();
return InputData;
}
public void UpdateInputKey()
{
UpdateLogic();
}
#region
public void SetRePlay(bool IsReplay)
{
bReplayMode = IsReplay;
}
public void Init(bool IsReplay)
{
bReplayMode = IsReplay;
mPlayMode = new PlayMode(this);
mReplayMode = new ReplayMode();
}
public void UpdateLogic()
{
if (bReplayMode) return;
mPlayMode.UpdateLogic();
}
public class PlayMode
{
UniKeyboard mUniKeyboard;
ulong tempInputAllData = 0;
public ulong CurryInpuAllData = 0;
public PlayMode(UniKeyboard uniKeyboard)
{
this.mUniKeyboard = uniKeyboard;
}
public void UpdateLogic()
{
tempInputAllData = 0;
tempInputAllData |= mUniKeyboard.ControllerMapper.Controller0.GetSingleAllInput();
tempInputAllData |= mUniKeyboard.ControllerMapper.Controller1.GetSingleAllInput();
tempInputAllData |= mUniKeyboard.ControllerMapper.Controller2.GetSingleAllInput();
tempInputAllData |= mUniKeyboard.ControllerMapper.Controller3.GetSingleAllInput();
CurryInpuAllData = tempInputAllData;
}
public ulong GetPressedKeys()
{
UMAME.instance.mReplayWriter.NextFramebyFrameIdx((int)UMAME.instance.mUniVideoPlayer.mFrame, CurryInpuAllData);
return CurryInpuAllData;
}
}
public class ReplayMode
{
ulong currInputData;
public ReplayMode()
{
}
public ulong GetPressedKeys()
{
int targetFrame = (int)UMAME.instance.mUniVideoPlayer.mFrame;
AxiReplay.ReplayStep stepData;
//有变化
if (UMAME.instance.mReplayReader.NextFramebyFrameIdx(targetFrame, out stepData))
{
currInputData = stepData.InPut;
}
return currInputData;
}
}
#endregion
}
public class MameControllerMapper : IControllerSetuper
{
public MameSingleConoller Controller0 { get; } = new MameSingleConoller(0);
public MameSingleConoller Controller1 { get; } = new MameSingleConoller(1);
public MameSingleConoller Controller2 { get; } = new MameSingleConoller(2);
public MameSingleConoller Controller3 { get; } = new MameSingleConoller(3);
ulong mCurrAllInput;
public void SetConnect(uint? con0ToSlot = null,
uint? con1ToSlot = null,
uint? con2ToSlot = null,
uint? con3ToSlot = null)
{
Controller0.ConnectSlot = con0ToSlot;
Controller1.ConnectSlot = con1ToSlot;
Controller2.ConnectSlot = con2ToSlot;
Controller3.ConnectSlot = con3ToSlot;
}
public int? GetSlotConnectingControllerIndex(int slotIndex)
{
if (Controller0.ConnectSlot.HasValue && Controller0.ConnectSlot.Value == slotIndex) return 0;
else if (Controller1.ConnectSlot.HasValue && Controller1.ConnectSlot.Value == slotIndex) return 1;
else if (Controller2.ConnectSlot.HasValue && Controller2.ConnectSlot.Value == slotIndex) return 2;
else if (Controller3.ConnectSlot.HasValue && Controller3.ConnectSlot.Value == slotIndex) return 3;
else return null;
}
public IController GetSlotConnectingController(int slotIndex)
{
if (Controller0.ConnectSlot.HasValue && Controller0.ConnectSlot.Value == slotIndex) return Controller0;
else if (Controller1.ConnectSlot.HasValue && Controller1.ConnectSlot.Value == slotIndex) return Controller1;
else if (Controller2.ConnectSlot.HasValue && Controller2.ConnectSlot.Value == slotIndex) return Controller2;
else if (Controller3.ConnectSlot.HasValue && Controller3.ConnectSlot.Value == slotIndex) return Controller3;
else return null;
}
static HashSet<uint> s_temp = new HashSet<uint>();
public uint? GetFreeSlotIndex()
{
s_temp.Clear();
s_temp.Add(0);
s_temp.Add(1);
s_temp.Add(2);
s_temp.Add(3);
if (Controller0.ConnectSlot.HasValue) s_temp.Remove(Controller0.ConnectSlot.Value);
if (Controller1.ConnectSlot.HasValue) s_temp.Remove(Controller1.ConnectSlot.Value);
if (Controller2.ConnectSlot.HasValue) s_temp.Remove(Controller2.ConnectSlot.Value);
if (Controller3.ConnectSlot.HasValue) s_temp.Remove(Controller3.ConnectSlot.Value);
if (s_temp.Count > 0) return s_temp.First();
else return null;
}
public void LetControllerConnect(int conIndex, uint slotIndex)
{
MameSingleConoller targetController;
switch (conIndex)
{
case 0: targetController = Controller0; break;
case 1: targetController = Controller1; break;
case 2: targetController = Controller2; break;
case 3: targetController = Controller3; break;
default:
throw new System.Exception($"Not Allowed conIndex Range: {conIndex}");
break;
}
if (targetController.ConnectSlot.HasValue) return;
targetController.ConnectSlot = slotIndex;
Eventer.Instance.PostEvent(EEvent.OnControllerConnectChanged);
}
}
/// <summary>
/// MAME控制器
/// </summary>
public class MameSingleConoller : IController
{
public KeyCode INSERT_COIN, GAMESTART,
UP, DOWN, LEFT, RIGHT,
BTN_A, BTN_B, BTN_C, BTN_D, BTN_E, BTN_F;
public MotionKey tg_INSERT_COIN, tg_GAMESTART,
tg_UP, tg_DOWN, tg_LEFT, tg_RIGHT,
tg_BTN_A, tg_BTN_B, tg_BTN_C, tg_BTN_D, tg_BTN_E, tg_BTN_F;
ulong mTempSingleAllInput;
int mControllerIndex;
uint? mConnectSlot;
/// <summary>
/// 指示该手柄连接的手柄插槽
/// <para><c>这个值代表了该手柄在实际游戏中控制的Player</c></para>
/// <value>[0,3] 例外:为空代表未连接</value>
/// </summary>
public uint? ConnectSlot
{
get { return mConnectSlot; }
set { mConnectSlot = value; this.ResetTargetMotionKey(); }
}
/// <summary>
/// 控制器编号
/// <para><c>此编号并非对应游戏中的player1,player2,player3,player4,仅仅作为本地4个手柄的实例</c></para>
/// <value>[0,3]</value>
/// </summary>
public int ControllerIndex
{
get { return mControllerIndex; }
set { mControllerIndex = value; this.LoadControlKeyForConfig(); }
}
public MameSingleConoller(int controllerIndex)
{
ControllerIndex = controllerIndex;
}
public bool AnyButtonDown()
{
//if (Input.GetKeyDown(INSERT_COIN)) return true;
//if (Input.GetKeyDown(GAMESTART)) return true;
//if (Input.GetKeyDown(UP)) return true;
//if (Input.GetKeyDown(DOWN)) return true;
//if (Input.GetKeyDown(LEFT)) return true;
//if (Input.GetKeyDown(RIGHT)) return true;
//if (Input.GetKeyDown(BTN_A)) return true;
//if (Input.GetKeyDown(BTN_B)) return true;
//if (Input.GetKeyDown(BTN_C)) return true;
//if (Input.GetKeyDown(BTN_D)) return true;
//if (Input.GetKeyDown(BTN_E)) return true;
//if (Input.GetKeyDown(BTN_F)) return true;
return mTempSingleAllInput > 0;
}
public ulong GetSingleAllInput()
{
if (!ConnectSlot.HasValue)
return 0;
mTempSingleAllInput = 0;
if (Input.GetKey(INSERT_COIN)) return mTempSingleAllInput |= (ulong)tg_INSERT_COIN;
if (Input.GetKey(GAMESTART)) return mTempSingleAllInput |= (ulong)tg_GAMESTART;
if (Input.GetKey(UP)) return mTempSingleAllInput |= (ulong)tg_UP;
if (Input.GetKey(DOWN)) return mTempSingleAllInput |= (ulong)tg_DOWN;
if (Input.GetKey(LEFT)) return mTempSingleAllInput |= (ulong)tg_LEFT;
if (Input.GetKey(RIGHT)) return mTempSingleAllInput |= (ulong)tg_RIGHT;
if (Input.GetKey(BTN_A)) return mTempSingleAllInput |= (ulong)tg_BTN_A;
if (Input.GetKey(BTN_B)) return mTempSingleAllInput |= (ulong)tg_BTN_B;
if (Input.GetKey(BTN_C)) return mTempSingleAllInput |= (ulong)tg_BTN_C;
if (Input.GetKey(BTN_D)) return mTempSingleAllInput |= (ulong)tg_BTN_D;
if (Input.GetKey(BTN_E)) return mTempSingleAllInput |= (ulong)tg_BTN_E;
if (Input.GetKey(BTN_F)) return mTempSingleAllInput |= (ulong)tg_BTN_F;
return mTempSingleAllInput;
}
}
public static class MameSingleControllSetter
{
public static void LoadControlKeyForConfig(this MameSingleConoller singlecontrol)
{
//TODO 等待支持配置,或统一
switch (singlecontrol.ControllerIndex)
{
case 0:
singlecontrol.INSERT_COIN = KeyCode.Alpha5;
singlecontrol.GAMESTART = KeyCode.Alpha1;
singlecontrol.UP = KeyCode.W;
singlecontrol.DOWN = KeyCode.S;
singlecontrol.LEFT = KeyCode.A;
singlecontrol.RIGHT = KeyCode.D;
singlecontrol.BTN_A = KeyCode.J;
singlecontrol.BTN_B = KeyCode.K;
singlecontrol.BTN_C = KeyCode.L;
singlecontrol.BTN_D = KeyCode.U;
singlecontrol.BTN_E = KeyCode.I;
singlecontrol.BTN_F = KeyCode.O;
break;
case 1:
singlecontrol.INSERT_COIN = KeyCode.KeypadMultiply;
singlecontrol.GAMESTART = KeyCode.KeypadDivide;
singlecontrol.UP = KeyCode.UpArrow;
singlecontrol.DOWN = KeyCode.DownArrow;
singlecontrol.LEFT = KeyCode.LeftArrow;
singlecontrol.RIGHT = KeyCode.RightArrow;
singlecontrol.BTN_A = KeyCode.Keypad1;
singlecontrol.BTN_B = KeyCode.Keypad2;
singlecontrol.BTN_C = KeyCode.Keypad3;
singlecontrol.BTN_D = KeyCode.Keypad4;
singlecontrol.BTN_E = KeyCode.Keypad5;
singlecontrol.BTN_F = KeyCode.Keypad6;
break;
case 2:
break;
case 3:
break;
}
}
public static void ResetTargetMotionKey(this MameSingleConoller singlecontrol)
{
if (!singlecontrol.ConnectSlot.HasValue)
{
singlecontrol.tg_INSERT_COIN
= singlecontrol.tg_GAMESTART
= singlecontrol.tg_UP
= singlecontrol.tg_DOWN
= singlecontrol.tg_LEFT
= singlecontrol.tg_RIGHT
= singlecontrol.tg_BTN_A
= singlecontrol.tg_BTN_B
= singlecontrol.tg_BTN_C
= singlecontrol.tg_BTN_D
= singlecontrol.tg_BTN_E
= singlecontrol.tg_BTN_F
= MotionKey.FinalKey;
return;
}
switch (singlecontrol.ConnectSlot.Value)
{
case 0:
singlecontrol.tg_INSERT_COIN = MotionKey.P1_INSERT_COIN;
singlecontrol.tg_GAMESTART = MotionKey.P1_GAMESTART;
singlecontrol.tg_UP = MotionKey.P1_UP;
singlecontrol.tg_DOWN = MotionKey.P1_DOWN;
singlecontrol.tg_LEFT = MotionKey.P1_LEFT;
singlecontrol.tg_RIGHT = MotionKey.P1_RIGHT;
singlecontrol.tg_BTN_A = MotionKey.P1_BTN_1;
singlecontrol.tg_BTN_B = MotionKey.P1_BTN_2;
singlecontrol.tg_BTN_C = MotionKey.P1_BTN_3;
singlecontrol.tg_BTN_D = MotionKey.P1_BTN_4;
singlecontrol.tg_BTN_E = MotionKey.P1_BTN_5;
singlecontrol.tg_BTN_F = MotionKey.P1_BTN_6;
break;
case 1:
singlecontrol.tg_INSERT_COIN = MotionKey.P2_INSERT_COIN;
singlecontrol.tg_GAMESTART = MotionKey.P2_GAMESTART;
singlecontrol.tg_UP = MotionKey.P2_UP;
singlecontrol.tg_DOWN = MotionKey.P2_DOWN;
singlecontrol.tg_LEFT = MotionKey.P2_LEFT;
singlecontrol.tg_RIGHT = MotionKey.P2_RIGHT;
singlecontrol.tg_BTN_A = MotionKey.P2_BTN_1;
singlecontrol.tg_BTN_B = MotionKey.P2_BTN_2;
singlecontrol.tg_BTN_C = MotionKey.P2_BTN_3;
singlecontrol.tg_BTN_D = MotionKey.P2_BTN_4;
singlecontrol.tg_BTN_E = MotionKey.P2_BTN_5;
singlecontrol.tg_BTN_F = MotionKey.P2_BTN_6;
break;
//后续修改后 支持P3 P4
case 2:
singlecontrol.tg_INSERT_COIN = MotionKey.FinalKey;
singlecontrol.tg_GAMESTART = MotionKey.FinalKey;
singlecontrol.tg_UP = MotionKey.FinalKey;
singlecontrol.tg_DOWN = MotionKey.FinalKey;
singlecontrol.tg_LEFT = MotionKey.FinalKey;
singlecontrol.tg_RIGHT = MotionKey.FinalKey;
singlecontrol.tg_BTN_A = MotionKey.FinalKey;
singlecontrol.tg_BTN_B = MotionKey.FinalKey;
singlecontrol.tg_BTN_C = MotionKey.FinalKey;
singlecontrol.tg_BTN_D = MotionKey.FinalKey;
singlecontrol.tg_BTN_E = MotionKey.FinalKey;
singlecontrol.tg_BTN_F = MotionKey.FinalKey;
break;
case 3:
singlecontrol.tg_INSERT_COIN = MotionKey.FinalKey;
singlecontrol.tg_GAMESTART = MotionKey.FinalKey;
singlecontrol.tg_UP = MotionKey.FinalKey;
singlecontrol.tg_DOWN = MotionKey.FinalKey;
singlecontrol.tg_LEFT = MotionKey.FinalKey;
singlecontrol.tg_RIGHT = MotionKey.FinalKey;
singlecontrol.tg_BTN_A = MotionKey.FinalKey;
singlecontrol.tg_BTN_B = MotionKey.FinalKey;
singlecontrol.tg_BTN_C = MotionKey.FinalKey;
singlecontrol.tg_BTN_D = MotionKey.FinalKey;
singlecontrol.tg_BTN_E = MotionKey.FinalKey;
singlecontrol.tg_BTN_F = MotionKey.FinalKey;
break;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 383edf8c0a98c9345849990416ef860f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,10 @@
using AxibugEmuOnline.Client.ClientCore;
using MAME.Core;
public class UniLog : ILog
{
public void Log(string msg)
{
App.log.Debug(msg);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 41107c5bd92323948a491a37e8760f3a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,23 @@
using MAME.Core;
using UnityEngine;
public class UniMouse : MonoBehaviour, IMouse
{
static int mX, mY;
public byte[] buttons = new byte[2];
void Update()
{
mX = (int)Input.mousePosition.x;
mY = (int)Input.mousePosition.y;
buttons[0] = Input.GetMouseButton(0) ? (byte)1 : (byte)0;
buttons[1] = Input.GetMouseButton(1) ? (byte)1 : (byte)0;
}
public void MouseXY(out int X, out int Y, out byte[] MouseButtons)
{
X = mX;
Y = mY * -1;
MouseButtons = buttons;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0e566345b50ca464fb8bd492a22c043b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,29 @@
using MAME.Core;
using UnityEngine;
public class UniResources : IResources
{
const string ResourceRoot = "MAME/emu/";
public byte[] mcu => Resources.Load<TextAsset>(ResourceRoot + "cus64-64a1.mcu").bytes;
public byte[] sfix => Resources.Load<TextAsset>(ResourceRoot + "sfix.sfix").bytes;
public byte[] _000_lo => Resources.Load<TextAsset>(ResourceRoot + "000-lo.lo").bytes;
public byte[] sm1 => Resources.Load<TextAsset>(ResourceRoot + "sm1.sm1").bytes;
public byte[] mainbios => Resources.Load<TextAsset>(ResourceRoot + "neogeo_mainbios.rom").bytes;
public byte[] pgmmainbios => Resources.Load<TextAsset>(ResourceRoot + "pgm_mainbios.rom").bytes;
public byte[] pgmvideobios => Resources.Load<TextAsset>(ResourceRoot + "pgm_t01s.rom").bytes;
public byte[] pgmaudiobios => Resources.Load<TextAsset>(ResourceRoot + "pgm_m01s.rom").bytes;
public byte[] _1 => Resources.Load<TextAsset>(ResourceRoot + "1.png").bytes;
public byte[] readme => Resources.Load<TextAsset>(ResourceRoot + "readme.txt").bytes;
public string mame => Resources.Load<TextAsset>(ResourceRoot + "mame.xml").text;//ok
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: badc6676adc52b34da8dbda2d4aa0aba
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,93 @@
using MAME.Core;
using System;
using UnityEngine;
public class UniSoundPlayer : MonoBehaviour, ISoundPlayer
{
[SerializeField]
private AudioSource m_as;
private RingBuffer<float> _buffer = new RingBuffer<float>(4096);
private TimeSpan lastElapsed;
public double audioFPS { get; private set; }
float lastData = 0;
void Awake()
{
AudioClip dummy = AudioClip.Create("dummy", 1, 2, AudioSettings.outputSampleRate, false);
dummy.SetData(new float[] { 1, 1 }, 0);
m_as.clip = dummy;
m_as.loop = true;
m_as.spatialBlend = 1;
}
public void Initialize()
{
if (!m_as.isPlaying)
{
m_as.Play();
}
}
public void StopPlay()
{
if (m_as.isPlaying)
{
m_as.Stop();
}
}
void OnAudioFilterRead(float[] data, int channels)
{
if (!UMAME.bInGame) return;
int step = channels;
for (int i = 0; i < data.Length; i += step)
{
float rawFloat = lastData;
float rawData;
if (_buffer.TryRead(out rawData))
{
rawFloat = rawData;
}
data[i] = rawFloat;
for (int fill = 1; fill < step; fill++)
data[i + fill] = rawFloat;
lastData = rawFloat;
}
}
public void SubmitSamples(byte[] buffer, int samples_a)
{
var current = UMAME.sw.Elapsed;
var delta = current - lastElapsed;
lastElapsed = current;
audioFPS = 1d / delta.TotalSeconds;
for (int i = 0; i < samples_a; i++)
{
short left = BitConverter.ToInt16(buffer, i * 2 * 2);
//short right = BitConverter.ToInt16(buffer, i * 2 * 2 + 2);
_buffer.Write(left / 32767.0f);
//_buffer.Write(right / 32767.0f);
}
}
public void BufferWirte(int Off, byte[] Data)
{
}
public void GetCurrentPosition(out int play_position, out int write_position)
{
play_position = 0;
write_position = 0;
}
public void SetVolume(int Vol)
{
if (m_as)
return;
m_as.volume = Vol;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 89abab1d3b1020340a147d74e60751ce
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,68 @@
using MAME.Core;
using System.Diagnostics;
public class UniTimeSpan : ITimeSpan
{
public ulong tick;
double startUs;
//double tickDetailus = 16666.666667;
double tickDetailus = 16.666667;//16微秒 越小越决定tick精度越小
object tickLock = new object();
public void InitStandTime()
{
startUs = GetCurrUs();
}
/// <summary>
/// 获取当前毫秒
/// </summary>
/// <returns></returns>
public double GetCurrUs()
{
return (double)UMAME.sw.ElapsedTicks * 1000000 / Stopwatch.Frequency;
}
/// <summary>
/// 获取当前毫秒
/// </summary>
/// <returns></returns>
public double GetRunUs()
{
return ((double)UMAME.sw.ElapsedTicks * 1000000 / Stopwatch.Frequency) - startUs;
}
public void SetTick(ulong nexttick)
{
//lock (tickLock)
{
tick = nexttick;
}
}
//这个函数无意义
public uint GetTickCount()
{
//lock (tickLock)
{
//return (uint)(tick * tickDetail);
return 0;
}
}
public bool QueryPerformanceCounter(ref long lpPerformanceCount)
{
lock (tickLock)
{
//lpPerformanceCount = (long)tick;
lpPerformanceCount = (long)(GetRunUs() / tickDetailus);
return true;
}
}
public bool QueryPerformanceFrequency(ref long PerformanceFrequency)
{
PerformanceFrequency = (long)(1000000 / tickDetailus);
return true;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a35bf49414a7b194eb8d359004336a8c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,100 @@
using AxibugEmuOnline.Client.ClientCore;
using AxibugProtobuf;
using MAME.Core;
using System;
using UnityEngine;
using UnityEngine.UI;
public class UniVideoPlayer : MonoBehaviour, IVideoPlayer
{
public Vector2Int mScreenSize { get; private set; }
[SerializeField]
private int mDataLenght;
[SerializeField]
private Texture2D m_rawBufferWarper;
[SerializeField]
private RawImage m_drawCanvas;
[SerializeField]
private RectTransform m_drawCanvasrect;
//int[] mFrameData;
IntPtr mFrameDataPtr;
private TimeSpan lastElapsed;
public double videoFPS { get; private set; }
public ulong mFrame { get; private set; }
bool bInit = false;
private void Awake()
{
mFrame = 0;
m_drawCanvas = GameObject.Find("GameRawImage").GetComponent<RawImage>();
m_drawCanvasrect = m_drawCanvas.GetComponent<RectTransform>();
}
public void Initialize(int width, int height,IntPtr framePtr)
{
m_drawCanvas.color = Color.white;
if (m_rawBufferWarper == null || mScreenSize.x != width || mScreenSize.y != height)
{
mScreenSize = new Vector2Int(width, height);
mDataLenght = width * height * 4;
//mFrameData = new int[mWidth * mHeight];
//MAMEÀ´µÄÊÇBGRA32£¬ºÃºÃºÃ BGRA->RGBA
m_rawBufferWarper = new Texture2D(mScreenSize.x, mScreenSize.y, TextureFormat.RGBA32, false);
m_rawBufferWarper.filterMode = FilterMode.Point;
}
mFrameDataPtr = framePtr;
m_drawCanvas.texture = m_rawBufferWarper;
bInit = true;
//float targetWidth = ((float)mScreenSize.x/ mScreenSize.y) * m_drawCanvasrect.rect.height ;
//m_drawCanvasrect.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, targetWidth);
}
public void StopVideo()
{
bInit = false;
m_drawCanvas.color = new Color(0,0,0,0);
}
//void Update()
//{
// if (!bInit) return;
// //m_rawBufferWarper.LoadRawTextureData(mFrameDataPtr, mDataLenght);
// //m_rawBufferWarper.Apply();
//}
public void SubmitVideo(int[] data, long frame_number)
{
mFrame = (ulong)frame_number;
UMAME.instance.mTimeSpan.SetTick(mFrame);
var current = UMAME.sw.Elapsed;
var delta = current - lastElapsed;
lastElapsed = current;
videoFPS = 1d / delta.TotalSeconds;
//mFrameData = data;
//Debug.Log($"frame_number -> {frame_number}");
m_rawBufferWarper.LoadRawTextureData(mFrameDataPtr, mDataLenght);
m_rawBufferWarper.Apply();
}
public byte[] GetScreenImg()
{
return (m_drawCanvas.texture as Texture2D).EncodeToJPG();
}
public void ApplyFilterEffect()
{
App.settings.Filter.ExecuteFilterRender(m_rawBufferWarper, m_drawCanvas);
}
public void ApplyScreenScaler()
{
App.settings.ScreenScaler.CalcScale(m_drawCanvas, UMAME.instance.Platform);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f675565b1f4ed7744a8ea9788c92429d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -55,6 +55,12 @@ namespace AxibugEmuOnline.Client.Manager
case RomPlatformType.Nes:
m_emuCore = GameObject.Instantiate(Resources.Load<GameObject>("NES/NesEmulator")).GetComponent<IEmuCore>();
break;
case RomPlatformType.Cps1:
case RomPlatformType.Cps2:
case RomPlatformType.Igs:
case RomPlatformType.Neogeo:
m_emuCore = GameObject.Instantiate(Resources.Load<GameObject>("MAME/UMAME")).GetComponent<IEmuCore>();
break;
}
var result = m_emuCore.StartGame(romFile);

View File

@ -106,6 +106,11 @@ namespace AxibugEmuOnline.Client
switch (platform)
{
case RomPlatformType.Nes: return new Vector2Int(256, 240);
case RomPlatformType.Cps1:
case RomPlatformType.Cps2:
case RomPlatformType.Neogeo:
case RomPlatformType.Igs:
return UMAME.instance.mUniVideoPlayer.mScreenSize;
default: throw new System.NotImplementedException($"未实现的平台:{platform}");
}
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ea791d3660bb49a4d94f1d824a488569
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -66,7 +66,7 @@ namespace AxibugEmuOnline.Web.Controllers
MySqlConnection conn = SQLPool.DequeueSQLConn("RomList");
{
string platformCond = "";
if (GType > (int)RomPlatformType.Invalid && GType < (int)RomPlatformType.All)
if (Ptype > (int)RomPlatformType.Invalid && Ptype < (int)RomPlatformType.All)
{
platformCond = $" and PlatformType = '{Ptype}' ";
}
@ -176,7 +176,7 @@ namespace AxibugEmuOnline.Web.Controllers
MySqlConnection conn = SQLPool.DequeueSQLConn("MarkList");
{
string platformCond = "";
if (GType > (int)RomPlatformType.Invalid && GType < (int)RomPlatformType.All)
if (Ptype > (int)RomPlatformType.Invalid && Ptype < (int)RomPlatformType.All)
{
platformCond = $" and romlist.PlatformType = '{Ptype}' ";
}
@ -288,7 +288,7 @@ LIMIT ?offset, ?pageSize;";
Resp_RomInfo resp = new Resp_RomInfo();
MySqlConnection conn = SQLPool.DequeueSQLConn("NesRomList");
{
string query = $"SELECT id,`Name`,GameType,Note,RomUrl,ImgUrl,`Hash`,`playcount`,`stars`,`PlatformType`,mlist.`parentids` FROM romlist where id = ?romid;";
string query = $"SELECT id,`Name`,GameType,Note,RomUrl,ImgUrl,`Hash`,`playcount`,`stars`,`PlatformType`,`parentids` FROM romlist where id = ?romid;";
using (var command = new MySqlCommand(query, conn))
{
// ÉèÖòÎÊýÖµ

View File

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project>
<PropertyGroup>
<_PublishTargetUrl>G:\Sin365\AxibugEmuOnline\AxibugEmuOnline.Web\bin\Release\net8.0\publish\</_PublishTargetUrl>
<History>True|2025-01-13T07:57:42.8554189Z||;True|2025-01-13T15:56:16.9992929+08:00||;True|2025-01-09T15:00:13.8691822+08:00||;True|2025-01-09T14:47:16.4993283+08:00||;True|2025-01-09T14:47:09.3814423+08:00||;True|2025-01-09T14:38:36.2730244+08:00||;True|2025-01-08T13:35:26.6793825+08:00||;True|2025-01-07T10:37:18.6461694+08:00||;True|2024-09-12T14:18:38.6992653+08:00||;True|2024-09-12T14:08:58.4526827+08:00||;True|2024-08-22T14:13:06.3067002+08:00||;True|2024-08-14T10:33:10.9180984+08:00||;True|2024-08-13T18:28:27.5050523+08:00||;True|2024-08-13T18:25:47.6591234+08:00||;True|2024-08-13T18:25:17.5344107+08:00||;True|2024-08-13T17:46:23.4523329+08:00||;</History>
<History>True|2025-01-23T06:10:54.0851574Z||;True|2025-01-23T13:21:13.2937446+08:00||;True|2025-01-23T13:15:40.1876887+08:00||;True|2025-01-13T15:57:42.8554189+08:00||;True|2025-01-13T15:56:16.9992929+08:00||;True|2025-01-09T15:00:13.8691822+08:00||;True|2025-01-09T14:47:16.4993283+08:00||;True|2025-01-09T14:47:09.3814423+08:00||;True|2025-01-09T14:38:36.2730244+08:00||;True|2025-01-08T13:35:26.6793825+08:00||;True|2025-01-07T10:37:18.6461694+08:00||;True|2024-09-12T14:18:38.6992653+08:00||;True|2024-09-12T14:08:58.4526827+08:00||;True|2024-08-22T14:13:06.3067002+08:00||;True|2024-08-14T10:33:10.9180984+08:00||;True|2024-08-13T18:28:27.5050523+08:00||;True|2024-08-13T18:25:47.6591234+08:00||;True|2024-08-13T18:25:17.5344107+08:00||;True|2024-08-13T17:46:23.4523329+08:00||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>