master #31

Merged
sin365 merged 9 commits from Alienjack/AxibugEmuOnline:master into master 2024-08-30 18:18:47 +08:00
10 changed files with 178 additions and 253 deletions
Showing only changes of commit fc94396dfa - Show all commits

View File

@ -389,6 +389,8 @@ GameObject:
- component: {fileID: 8789823129857705082} - component: {fileID: 8789823129857705082}
- component: {fileID: 3252398029444565139} - component: {fileID: 3252398029444565139}
- component: {fileID: 6788248266412682264} - component: {fileID: 6788248266412682264}
- component: {fileID: 8081109478688381999}
- component: {fileID: 6660646139021869069}
m_Layer: 5 m_Layer: 5
m_Name: InfoNode m_Name: InfoNode
m_TagString: Untagged m_TagString: Untagged
@ -414,8 +416,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 100, y: 0} m_AnchoredPosition: {x: 494.04688, y: 0}
m_SizeDelta: {x: -200, y: 0} m_SizeDelta: {x: 588.0938, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &3252398029444565139 --- !u!114 &3252398029444565139
MonoBehaviour: MonoBehaviour:
@ -455,6 +457,44 @@ CanvasGroup:
m_Interactable: 1 m_Interactable: 1
m_BlocksRaycasts: 1 m_BlocksRaycasts: 1
m_IgnoreParentGroups: 0 m_IgnoreParentGroups: 0
--- !u!222 &8081109478688381999
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3993825260653792697}
m_CullTransparentMesh: 1
--- !u!114 &6660646139021869069
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3993825260653792697}
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: 1, g: 1, b: 1, a: 0}
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 &4643603390456494410 --- !u!1 &4643603390456494410
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1 m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0} m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0} m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1}
m_UseRadianceAmbientProbe: 0 m_UseRadianceAmbientProbe: 0
--- !u!157 &3 --- !u!157 &3
LightmapSettings: LightmapSettings:
@ -216,106 +216,13 @@ RectTransform:
m_Children: m_Children:
- {fileID: 730698712} - {fileID: 730698712}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 4 m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0} m_Pivot: {x: 0, y: 0}
--- !u!1 &537454904
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 537454906}
- component: {fileID: 537454905}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &537454905
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 537454904}
m_Enabled: 1
serializedVersion: 10
m_Type: 1
m_Shape: 0
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &537454906
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 537454904}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &589359925 --- !u!1 &589359925
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -380,7 +287,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 2 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &730698711 --- !u!1001 &730698711
PrefabInstance: PrefabInstance:
@ -4976,5 +4883,5 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 3 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -123,155 +123,6 @@ NavMeshSettings:
debug: debug:
m_Flags: 0 m_Flags: 0
m_NavMeshData: {fileID: 0} m_NavMeshData: {fileID: 0}
--- !u!1 &1232273651
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1232273654}
- component: {fileID: 1232273653}
- component: {fileID: 1232273652}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &1232273652
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1232273651}
m_Enabled: 1
--- !u!20 &1232273653
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1232273651}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1232273654
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1232273651}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1359344831
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1359344834}
- component: {fileID: 1359344833}
- component: {fileID: 1359344832}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1359344832
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1359344831}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &1359344833
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1359344831}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10
--- !u!4 &1359344834
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1359344831}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &4232056520998800727 --- !u!1001 &4232056520998800727
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -281,7 +132,7 @@ PrefabInstance:
m_Modifications: m_Modifications:
- target: {fileID: 4232056521131536011, guid: f8bea3f8aa351bb46ada33b2274729ea, type: 3} - target: {fileID: 4232056521131536011, guid: f8bea3f8aa351bb46ada33b2274729ea, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 2 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4232056521131536011, guid: f8bea3f8aa351bb46ada33b2274729ea, type: 3} - target: {fileID: 4232056521131536011, guid: f8bea3f8aa351bb46ada33b2274729ea, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x

View File

@ -22,6 +22,7 @@ namespace AxibugEmuOnline.Client.ClientCore
public static RomLib nesRomLib; public static RomLib nesRomLib;
public static HttpAPI httpAPI; public static HttpAPI httpAPI;
public static CacheManager CacheMgr; public static CacheManager CacheMgr;
public static AppSceneLoader SceneLoader;
private static CoroutineRunner coRunner; private static CoroutineRunner coRunner;
@ -41,6 +42,7 @@ namespace AxibugEmuOnline.Client.ClientCore
httpAPI = new HttpAPI(); httpAPI = new HttpAPI();
nesRomLib = new RomLib(EnumPlatform.NES); nesRomLib = new RomLib(EnumPlatform.NES);
CacheMgr = new CacheManager(); CacheMgr = new CacheManager();
SceneLoader = new AppSceneLoader();
var go = new GameObject("[AppAxibugEmuOnline]"); var go = new GameObject("[AppAxibugEmuOnline]");
GameObject.DontDestroyOnLoad(go); GameObject.DontDestroyOnLoad(go);

View File

@ -0,0 +1,89 @@
using AxibugEmuOnline.Client.ClientCore;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace AxibugEmuOnline.Client
{
public class AppSceneLoader
{
public LoadTask CurrentTask { get; private set; }
Queue<LoadTask> m_tasks = new Queue<LoadTask>();
Coroutine m_coroutine;
public void BeginLoad(string scenePath, Action callback)
{
m_tasks.Enqueue(new LoadTask(scenePath, callback));
if (m_coroutine == null)
m_coroutine = AppAxibugEmuOnline.StartCoroutine(TaskFlow());
}
private IEnumerator TaskFlow()
{
while (m_tasks.Count > 0)
{
CurrentTask = m_tasks.Dequeue();
while (CurrentTask.MoveNext()) yield return null;
CurrentTask.Callback();
}
CurrentTask = null;
m_coroutine = null;
}
public class LoadTask
{
public EnumTaskState State { get; private set; } = EnumTaskState.Idle;
public float Progress => m_loadingOp != null ? m_loadingOp.progress : 0;
private AsyncOperation m_loadingOp;
private string m_scenePath;
private Action m_callback;
public LoadTask(string scenePath, Action callback)
{
m_scenePath = scenePath;
m_callback = callback;
}
public bool MoveNext()
{
if (State == EnumTaskState.Idle)
{
State = EnumTaskState.Running;
m_loadingOp = SceneManager.LoadSceneAsync(m_scenePath, LoadSceneMode.Additive);
return true;
}
else if (State == EnumTaskState.Running)
{
m_loadingOp.allowSceneActivation = true;
if (m_loadingOp.isDone)
{
State = EnumTaskState.Complete;
}
return true;
}
else
{
return false;
}
}
public void Callback()
{
m_callback?.Invoke();
}
}
public enum EnumTaskState
{
Idle,
Running,
Complete
}
}
}

View File

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

View File

@ -62,8 +62,8 @@ namespace AxibugEmuOnline.Client
} }
#if UNITY_EDITOR #if UNITY_EDITOR
[ContextMenu("IMPORT")] [ContextMenu("ImportNesDB")]
public void TTTA() public void ImportNesDB()
{ {
var db = Resources.Load<RomDB>("NES/ROMDB"); var db = Resources.Load<RomDB>("NES/ROMDB");
db.Clear(); db.Clear();
@ -85,6 +85,13 @@ namespace AxibugEmuOnline.Client
UnityEditor.EditorUtility.SetDirty(db); UnityEditor.EditorUtility.SetDirty(db);
UnityEditor.AssetDatabase.SaveAssets(); UnityEditor.AssetDatabase.SaveAssets();
} }
[ContextMenu("GetState")]
public void GetState()
{
var state = NesCore.GetState();
var bytes = state.ToBytes();
}
#endif #endif
} }
} }

View File

@ -2,11 +2,13 @@ using AxibugEmuOnline.Client.ClientCore;
using AxibugEmuOnline.Client.UI; using AxibugEmuOnline.Client.UI;
using System; using System;
using UnityEngine; using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.SceneManagement;
using UnityEngine.UI; using UnityEngine.UI;
namespace AxibugEmuOnline.Client namespace AxibugEmuOnline.Client
{ {
public class RomItem : MenuItem, IVirtualItem public class RomItem : MenuItem, IVirtualItem, IPointerClickHandler
{ {
[SerializeField] [SerializeField]
Image m_romImage; Image m_romImage;
@ -62,5 +64,18 @@ namespace AxibugEmuOnline.Client
}); });
} }
} }
public void OnPointerClick(PointerEventData eventData)
{
if (!m_romfile.RomReady)
m_romfile.BeginDownload();
else
{
AppAxibugEmuOnline.SceneLoader.BeginLoad("Scene/EmuTest", () =>
{
var nesEmu = GameObject.FindObjectOfType<NesEmulator>();
});
}
}
} }
} }

View File

@ -248,7 +248,7 @@ namespace VirtualNes.Core
chr6 = p[14]; chr6 = p[14];
chr7 = p[15]; chr7 = p[15];
irq_enable = p[16]; irq_enable = p[16];
irq_counter = (INT)p[17]; irq_counter = p[17];
irq_latch = p[18]; irq_latch = p[18];
irq_request = p[19]; irq_request = p[19];
} }

View File

@ -5,6 +5,9 @@ EditorBuildSettings:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
serializedVersion: 2 serializedVersion: 2
m_Scenes: m_Scenes:
- enabled: 1
path: Assets/Scene/AxibugEmuOnline.Client.unity
guid: eb0c18a619175384d95147898a43054b
- enabled: 1 - enabled: 1
path: Assets/Scene/EmuTest.unity path: Assets/Scene/EmuTest.unity
guid: 3dba71db67877594a9b5b77059205ec8 guid: 3dba71db67877594a9b5b77059205ec8