Merge pull request '123' (#13) from Alienjack/AxibugEmuOnline:master into master

Reviewed-on: #13
This commit is contained in:
sin365 2024-07-19 15:35:41 +08:00
commit f9f348f77f
3 changed files with 102 additions and 9 deletions

View File

@ -1,5 +1,84 @@
%YAML 1.1 %YAML 1.1
%TAG !u! tag:unity3d.com,2011: %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 --- !u!1 &319390252125274553
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -95,7 +174,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8662582774585465456} m_GameObject: {fileID: 8662582774585465456}
m_Enabled: 1 m_Enabled: 0
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
m_Name: m_Name:
@ -313,6 +392,7 @@ MonoBehaviour:
m_coreProxy: {fileID: 8662582775964487075} m_coreProxy: {fileID: 8662582775964487075}
m_drawCanvas: {fileID: 8662582774585465454} m_drawCanvas: {fileID: 8662582774585465454}
m_fpsText: {fileID: 8662582775359084754} m_fpsText: {fileID: 8662582775359084754}
m_nofity: {fileID: 1575933576}
--- !u!1 &8662582775359084756 --- !u!1 &8662582775359084756
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -424,6 +504,7 @@ RectTransform:
m_Children: m_Children:
- {fileID: 8662582774585465455} - {fileID: 8662582774585465455}
- {fileID: 8662582775359084755} - {fileID: 8662582775359084755}
- {fileID: 1575933575}
m_Father: {fileID: 7667066390141474019} m_Father: {fileID: 7667066390141474019}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -1,5 +1,4 @@
using MyNes.Core; using MyNes.Core;
using Unity.VisualScripting.YamlDotNet.Core.Tokens;
namespace AxibugEmuOnline.Client namespace AxibugEmuOnline.Client
{ {

View File

@ -22,12 +22,15 @@ namespace AxibugEmuOnline.Client
private RawImage m_drawCanvas; private RawImage m_drawCanvas;
[SerializeField] [SerializeField]
private Text m_fpsText; private Text m_fpsText;
[SerializeField]
private Text m_nofity;
private Color[] m_texRawBuffer = new Color[256 * 240]; private Color[] m_texRawBuffer = new Color[256 * 240];
private Texture2D m_rawBufferWarper; private Texture2D m_rawBufferWarper;
private RenderTexture m_drawRT; private RenderTexture m_drawRT;
private Color temp = Color.white; private Color temp = Color.white;
private bool toggleOn;
public void Initialize() public void Initialize()
{ {
@ -48,26 +51,35 @@ namespace AxibugEmuOnline.Client
public void Update() public void Update()
{ {
var colors = m_texRawBuffer; if (toggleOn)
m_rawBufferWarper.SetPixels(colors); {
m_rawBufferWarper.Apply(); if (!m_drawCanvas.enabled) m_drawCanvas.enabled = true;
Graphics.Blit(m_rawBufferWarper, m_drawCanvas.texture as RenderTexture); var colors = m_texRawBuffer;
m_rawBufferWarper.SetPixels(colors);
m_rawBufferWarper.Apply();
Graphics.Blit(m_rawBufferWarper, m_drawCanvas.texture as RenderTexture);
m_fpsText.text = $"fps:{m_coreProxy.AudioCom.FPS:00.00}"; m_fpsText.text = $"fps:{m_coreProxy.AudioCom.FPS:00.00}";
}
else
{
if (m_drawCanvas.enabled) m_drawCanvas.enabled = false;
}
} }
public void WriteErrorNotification(string message, bool instant) public void WriteErrorNotification(string message, bool instant)
{ {
m_nofity.text = message;
} }
public void WriteInfoNotification(string message, bool instant) public void WriteInfoNotification(string message, bool instant)
{ {
m_nofity.text = message;
} }
public void WriteWarningNotification(string message, bool instant) public void WriteWarningNotification(string message, bool instant)
{ {
m_nofity.text = message;
} }
public void TakeSnapshotAs(string path, string format) public void TakeSnapshotAs(string path, string format)
@ -86,6 +98,7 @@ namespace AxibugEmuOnline.Client
public void SignalToggle(bool started) public void SignalToggle(bool started)
{ {
toggleOn = started;
} }
public void SubmitFrame(ref int[] buffer) public void SubmitFrame(ref int[] buffer)