From 68151f3433e9fe3f6a26e6eeb78ef396dc66c657 Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Mon, 31 Mar 2025 14:06:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3ColecoVision=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E8=A7=A3=E5=86=B3GameGear=E5=88=86=E8=BE=A8?= =?UTF-8?q?=E7=8E=87=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Emulation/Machines/ColecoVision.cs | 6 +- .../Essgee.Unity/Emulation/Video/SegaGGVDP.cs | 14 +- .../Metadata/GameMetadataHandler.cs | 11 +- .../Utilities/XInput/Controller.cs | 178 ------------------ .../Utilities/XInput/Controller.cs.meta | 2 - .../Utilities/XInput/ControllerManager.cs | 30 --- .../XInput/ControllerManager.cs.meta | 2 - .../Utilities/XInput/ControllerState.cs | 116 ------------ .../Utilities/XInput/ControllerState.cs.meta | 2 - .../Utilities/XInput/NativeMethods.cs | 25 --- .../Utilities/XInput/NativeMethods.cs.meta | 2 - .../Utilities/XInput/XInputCapabilities.cs | 47 ----- .../XInput/XInputCapabilities.cs.meta | 2 - .../Utilities/XInput/XInputGamepad.cs | 51 ----- .../Utilities/XInput/XInputGamepad.cs.meta | 2 - .../Utilities/XInput/XInputState.cs | 14 -- .../Utilities/XInput/XInputState.cs.meta | 2 - .../Utilities/XInput/XInputVibration.cs | 14 -- .../Utilities/XInput/XInputVibration.cs.meta | 2 - .../Essgee.Unity/Dat/Bootstrap.meta} | 2 +- ...BIOS] ColecoVision (USA, Europe).col.bytes | Bin 0 -> 8192 bytes ... ColecoVision (USA, Europe).col.bytes.meta | 7 + Assets/Scripts/UEssgee.cs | 10 +- .../UEssgeeInterface/UEGVideoPlayer.cs | 5 + 24 files changed, 35 insertions(+), 511 deletions(-) delete mode 100644 Assets/Plugins/Essgee.Unity/Utilities/XInput/Controller.cs delete mode 100644 Assets/Plugins/Essgee.Unity/Utilities/XInput/Controller.cs.meta delete mode 100644 Assets/Plugins/Essgee.Unity/Utilities/XInput/ControllerManager.cs delete mode 100644 Assets/Plugins/Essgee.Unity/Utilities/XInput/ControllerManager.cs.meta delete mode 100644 Assets/Plugins/Essgee.Unity/Utilities/XInput/ControllerState.cs delete mode 100644 Assets/Plugins/Essgee.Unity/Utilities/XInput/ControllerState.cs.meta delete mode 100644 Assets/Plugins/Essgee.Unity/Utilities/XInput/NativeMethods.cs delete mode 100644 Assets/Plugins/Essgee.Unity/Utilities/XInput/NativeMethods.cs.meta delete mode 100644 Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputCapabilities.cs delete mode 100644 Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputCapabilities.cs.meta delete mode 100644 Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputGamepad.cs delete mode 100644 Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputGamepad.cs.meta delete mode 100644 Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputState.cs delete mode 100644 Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputState.cs.meta delete mode 100644 Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputVibration.cs delete mode 100644 Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputVibration.cs.meta rename Assets/{Plugins/Essgee.Unity/Utilities/XInput.meta => Resources/Essgee.Unity/Dat/Bootstrap.meta} (77%) create mode 100644 Assets/Resources/Essgee.Unity/Dat/Bootstrap/[BIOS] ColecoVision (USA, Europe).col.bytes create mode 100644 Assets/Resources/Essgee.Unity/Dat/Bootstrap/[BIOS] ColecoVision (USA, Europe).col.bytes.meta diff --git a/Assets/Plugins/Essgee.Unity/Emulation/Machines/ColecoVision.cs b/Assets/Plugins/Essgee.Unity/Emulation/Machines/ColecoVision.cs index fab8dd1..b700e3b 100644 --- a/Assets/Plugins/Essgee.Unity/Emulation/Machines/ColecoVision.cs +++ b/Assets/Plugins/Essgee.Unity/Emulation/Machines/ColecoVision.cs @@ -5,6 +5,7 @@ using Essgee.Emulation.Configuration; using Essgee.Emulation.CPU; using Essgee.Emulation.Video; using Essgee.EventArguments; +using Essgee.Metadata; using Essgee.Utilities; using System; using System.Collections.Generic; @@ -182,7 +183,10 @@ namespace Essgee.Emulation.Machines private void LoadBios() { - var (type, bootstrapRomData) = CartridgeLoader.Load(configuration.BiosRom, "ColecoVision BIOS"); + + //var (type, bootstrapRomData) = CartridgeLoader.Load(configuration.BiosRom, "ColecoVision BIOS"); + //直接加载BootStrap + GameMetadataHandler.instance.gameMetaReources.GetDatBytes("Bootstrap/[BIOS] ColecoVision (USA, Europe).col", out byte[] bootstrapRomData); bios = new ColecoCartridge(bootstrapRomData.Length, 0); bios.LoadRom(bootstrapRomData); } diff --git a/Assets/Plugins/Essgee.Unity/Emulation/Video/SegaGGVDP.cs b/Assets/Plugins/Essgee.Unity/Emulation/Video/SegaGGVDP.cs index 3986fab..d3b08b0 100644 --- a/Assets/Plugins/Essgee.Unity/Emulation/Video/SegaGGVDP.cs +++ b/Assets/Plugins/Essgee.Unity/Emulation/Video/SegaGGVDP.cs @@ -51,19 +51,11 @@ namespace Essgee.Emulation.Video //GCHandle? lasyRenderHandle; protected override void PrepareRenderScreen() { - //// 固定数组,防止垃圾回收器移动它 - //var bitmapcolorRect_handle = GCHandle.Alloc(outputFramebuffer.Clone() as byte[], GCHandleType.Pinned); - //// 获取数组的指针 - //IntPtr mFrameDataPtr = bitmapcolorRect_handle.AddrOfPinnedObject(); - - var eventArgs = RenderScreenEventArgs.Create(numVisiblePixels, numVisibleScanlines, outputFramebuffer_Ptr); + //var eventArgs = RenderScreenEventArgs.Create(numVisiblePixels, numVisibleScanlines, outputFramebuffer_Ptr); + //这里要改成viewport的中间区域的分辨率 + var eventArgs = RenderScreenEventArgs.Create(Viewport.Width, Viewport.Height, outputFramebuffer_Ptr); OnRenderScreen(eventArgs); eventArgs.Release(); - //if (lasyRenderHandle != null) - // lasyRenderHandle.Value.Free(); - //lasyRenderHandle = bitmapcolorRect_handle; - - //OnRenderScreen(new RenderScreenEventArgs(Viewport.Width, Viewport.Height, outputFramebuffer.Clone() as byte[])); } private bool ModifyAndVerifyCoordinates(ref int x, ref int y) diff --git a/Assets/Plugins/Essgee.Unity/Metadata/GameMetadataHandler.cs b/Assets/Plugins/Essgee.Unity/Metadata/GameMetadataHandler.cs index 995d081..75a630d 100644 --- a/Assets/Plugins/Essgee.Unity/Metadata/GameMetadataHandler.cs +++ b/Assets/Plugins/Essgee.Unity/Metadata/GameMetadataHandler.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Xml.Serialization; -using UnityEngine.Timeline; namespace Essgee.Metadata { @@ -20,10 +19,11 @@ namespace Essgee.Metadata public class GameMetadataHandler { + public static GameMetadataHandler instance; //static string datDirectoryPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Assets", "No-Intro"); //static string metadataDatabaseFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Assets", "MetadataDatabase.json"); - IGameMetaReources gameMetaReources; + public IGameMetaReources gameMetaReources; //readonly Dictionary datFiles; readonly List cartMetadataDatabase; @@ -32,6 +32,7 @@ namespace Essgee.Metadata public GameMetadataHandler(IGameMetaReources metaresources) { + instance = this; gameMetaReources = metaresources; //if (!gameMetaReources.GetCartMetadataDatabase(out string loadedData)) @@ -357,6 +358,12 @@ namespace Essgee.Metadata ////EssgeeLogger.EnqueueMessageSuccess($"Metadata initialized; {NumKnownGames} game(s) known across {NumKnownSystems} system(s)."); } + ~GameMetadataHandler() + { + if(instance == this) + instance = null; + } + public GameMetadata GetGameMetadata(string datFilename, string romFilename, uint romCrc32, int romSize) { /* Sanity checks */ diff --git a/Assets/Plugins/Essgee.Unity/Utilities/XInput/Controller.cs b/Assets/Plugins/Essgee.Unity/Utilities/XInput/Controller.cs deleted file mode 100644 index be0ade9..0000000 --- a/Assets/Plugins/Essgee.Unity/Utilities/XInput/Controller.cs +++ /dev/null @@ -1,178 +0,0 @@ -using System; - -namespace Essgee.Utilities.XInput -{ - public class Controller - { - XInputState inputStatesCurrent, inputStatesPrev; - bool timedVibrationEnabled; - DateTime vibrationStopTime; - - public bool IsConnected { get; private set; } - public int UserIndex { get; private set; } - - public Controller(int index) - { - inputStatesCurrent = inputStatesPrev = new XInputState(); - timedVibrationEnabled = false; - vibrationStopTime = DateTime.Now; - - IsConnected = false; - UserIndex = index; - } - - public void Update() - { - XInputState newInputState = new XInputState(); - Errors result = (Errors)NativeMethods.GetState(UserIndex, ref newInputState); - if (result == Errors.Success) - { - IsConnected = true; - inputStatesPrev = inputStatesCurrent; - inputStatesCurrent = newInputState; - - if ((inputStatesCurrent.Gamepad.sThumbLX < XInputGamepad.LeftThumbDeadzone && inputStatesCurrent.Gamepad.sThumbLX > -XInputGamepad.LeftThumbDeadzone) && - (inputStatesCurrent.Gamepad.sThumbLY < XInputGamepad.LeftThumbDeadzone && inputStatesCurrent.Gamepad.sThumbLY > -XInputGamepad.LeftThumbDeadzone)) - { - inputStatesCurrent.Gamepad.sThumbLX = inputStatesCurrent.Gamepad.sThumbLY = 0; - } - - if ((inputStatesCurrent.Gamepad.sThumbRX < XInputGamepad.RightThumbDeadzone && inputStatesCurrent.Gamepad.sThumbRX > -XInputGamepad.RightThumbDeadzone) && - (inputStatesCurrent.Gamepad.sThumbRY < XInputGamepad.RightThumbDeadzone && inputStatesCurrent.Gamepad.sThumbRY > -XInputGamepad.RightThumbDeadzone)) - { - inputStatesCurrent.Gamepad.sThumbRX = inputStatesCurrent.Gamepad.sThumbRY = 0; - } - - if (inputStatesCurrent.Gamepad.bLeftTrigger < XInputGamepad.TriggerThreshold) inputStatesCurrent.Gamepad.bLeftTrigger = 0; - if (inputStatesCurrent.Gamepad.bRightTrigger < XInputGamepad.TriggerThreshold) inputStatesCurrent.Gamepad.bRightTrigger = 0; - - if (timedVibrationEnabled && DateTime.Now >= vibrationStopTime) - { - timedVibrationEnabled = false; - Vibrate(0.0f, 0.0f); - } - } - else if (result == Errors.DeviceNotConnected) - { - IsConnected = false; - } - else - throw new Exception(string.Format("Error code {0}", (int)result)); - } - - //public ControllerState GetControllerState() - //{ - // return new ControllerState - // { - // Buttons = inputStatesCurrent.Gamepad.Buttons, - // LeftThumbstick = new ThumbstickPosition(inputStatesCurrent.Gamepad.sThumbLX / 32768.0f, inputStatesCurrent.Gamepad.sThumbLY / 32768.0f), - // RightThumbstick = new ThumbstickPosition(inputStatesCurrent.Gamepad.sThumbRX / 32768.0f, inputStatesCurrent.Gamepad.sThumbRY / 32768.0f), - // LeftTrigger = (inputStatesCurrent.Gamepad.bLeftTrigger / 255.0f), - // RightTrigger = (inputStatesCurrent.Gamepad.bRightTrigger / 255.0f) - // }; - //} - - public bool IsDPadUpPressed() - { - return inputStatesCurrent.Gamepad.Buttons.HasFlag(Buttons.DPadUp); - } - - public bool IsDPadDownPressed() - { - return inputStatesCurrent.Gamepad.Buttons.HasFlag(Buttons.DPadDown); - } - - public bool IsDPadLeftPressed() - { - return inputStatesCurrent.Gamepad.Buttons.HasFlag(Buttons.DPadLeft); - } - - public bool IsDPadRightPressed() - { - return inputStatesCurrent.Gamepad.Buttons.HasFlag(Buttons.DPadRight); - } - - public bool IsStartPressed() - { - return inputStatesCurrent.Gamepad.Buttons.HasFlag(Buttons.Start); - } - - public bool IsBackPressed() - { - return inputStatesCurrent.Gamepad.Buttons.HasFlag(Buttons.Back); - } - - public bool IsLeftThumbPressed() - { - return inputStatesCurrent.Gamepad.Buttons.HasFlag(Buttons.LeftThumb); - } - - public bool IsRightThumbPressed() - { - return inputStatesCurrent.Gamepad.Buttons.HasFlag(Buttons.RightThumb); - } - - public bool IsLeftShoulderPressed() - { - return inputStatesCurrent.Gamepad.Buttons.HasFlag(Buttons.LeftShoulder); - } - - public bool IsRightShoulderPressed() - { - return inputStatesCurrent.Gamepad.Buttons.HasFlag(Buttons.RightShoulder); - } - - public bool IsAPressed() - { - return inputStatesCurrent.Gamepad.Buttons.HasFlag(Buttons.A); - } - - public bool IsBPressed() - { - return inputStatesCurrent.Gamepad.Buttons.HasFlag(Buttons.B); - } - - public bool IsXPressed() - { - return inputStatesCurrent.Gamepad.Buttons.HasFlag(Buttons.X); - } - - public bool IsYPressed() - { - return inputStatesCurrent.Gamepad.Buttons.HasFlag(Buttons.Y); - } - - public void Vibrate(float leftMotor, float rightMotor) - { - XInputVibration vibrationState = new XInputVibration(); - vibrationState.wLeftMotorSpeed = (ushort)(leftMotor * 65535.0f); - vibrationState.wRightMotorSpeed = (ushort)(rightMotor * 65535.0f); - NativeMethods.SetState(UserIndex, ref vibrationState); - } - - public void Vibrate(float leftMotor, float rightMotor, TimeSpan duration) - { - Vibrate(leftMotor, rightMotor); - - vibrationStopTime = DateTime.Now.Add(duration); - timedVibrationEnabled = true; - } - } - - public class ThumbstickPosition - { - public float X { get; private set; } - public float Y { get; private set; } - - public ThumbstickPosition(float x, float y) - { - X = x; - Y = y; - } - - public override string ToString() - { - return string.Format(System.Globalization.CultureInfo.InvariantCulture, "({0}, {1})", X, Y); - } - } -} diff --git a/Assets/Plugins/Essgee.Unity/Utilities/XInput/Controller.cs.meta b/Assets/Plugins/Essgee.Unity/Utilities/XInput/Controller.cs.meta deleted file mode 100644 index 146f2f1..0000000 --- a/Assets/Plugins/Essgee.Unity/Utilities/XInput/Controller.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 208c78465e149914e92390762f768a04 \ No newline at end of file diff --git a/Assets/Plugins/Essgee.Unity/Utilities/XInput/ControllerManager.cs b/Assets/Plugins/Essgee.Unity/Utilities/XInput/ControllerManager.cs deleted file mode 100644 index ea562e9..0000000 --- a/Assets/Plugins/Essgee.Unity/Utilities/XInput/ControllerManager.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; - -namespace Essgee.Utilities.XInput -{ - public static class ControllerManager - { - const int maxControllers = 4; - - static Controller[] controllers; - - static ControllerManager() - { - controllers = new Controller[maxControllers]; - for (int i = 0; i < controllers.Length; i++) - controllers[i] = new Controller(i); - } - - public static Controller GetController(int index) - { - if (index < 0 || index >= maxControllers) throw new Exception("Controller index out of range"); - return controllers[index]; - } - - public static void Update() - { - for (int i = 0; i < controllers.Length; i++) - controllers[i].Update(); - } - } -} diff --git a/Assets/Plugins/Essgee.Unity/Utilities/XInput/ControllerManager.cs.meta b/Assets/Plugins/Essgee.Unity/Utilities/XInput/ControllerManager.cs.meta deleted file mode 100644 index e0cc01e..0000000 --- a/Assets/Plugins/Essgee.Unity/Utilities/XInput/ControllerManager.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: d3b109e035af2d0488fee85624c9a90b \ No newline at end of file diff --git a/Assets/Plugins/Essgee.Unity/Utilities/XInput/ControllerState.cs b/Assets/Plugins/Essgee.Unity/Utilities/XInput/ControllerState.cs deleted file mode 100644 index 57c2cba..0000000 --- a/Assets/Plugins/Essgee.Unity/Utilities/XInput/ControllerState.cs +++ /dev/null @@ -1,116 +0,0 @@ -//namespace Essgee.Utilities.XInput -//{ -// public class ControllerState -// { -// public Buttons Buttons { get; set; } -// public ThumbstickPosition LeftThumbstick { get; set; } -// public ThumbstickPosition RightThumbstick { get; set; } -// public float LeftTrigger { get; set; } -// public float RightTrigger { get; set; } - -// public bool IsConnected { get; set; } -// public int UserIndex { get; set; } - -// public ControllerState() -// { -// Buttons = Buttons.None; -// LeftThumbstick = new ThumbstickPosition(0.0f, 0.0f); -// RightThumbstick = new ThumbstickPosition(0.0f, 0.0f); -// LeftTrigger = 0.0f; -// RightTrigger = 0.0f; - -// IsConnected = false; -// UserIndex = -1; -// } - -// public bool IsAnyUpDirectionPressed() -// { -// return IsDPadUpPressed() || LeftThumbstick.Y > 0.5f; -// } - -// public bool IsAnyDownDirectionPressed() -// { -// return IsDPadDownPressed() || LeftThumbstick.Y < -0.5f; -// } - -// public bool IsAnyLeftDirectionPressed() -// { -// return IsDPadLeftPressed() || LeftThumbstick.X < -0.5f; -// } - -// public bool IsAnyRightDirectionPressed() -// { -// return IsDPadRightPressed() || LeftThumbstick.X > 0.5f; -// } - -// public bool IsDPadUpPressed() -// { -// return Buttons.HasFlag(Buttons.DPadUp); -// } - -// public bool IsDPadDownPressed() -// { -// return Buttons.HasFlag(Buttons.DPadDown); -// } - -// public bool IsDPadLeftPressed() -// { -// return Buttons.HasFlag(Buttons.DPadLeft); -// } - -// public bool IsDPadRightPressed() -// { -// return Buttons.HasFlag(Buttons.DPadRight); -// } - -// public bool IsStartPressed() -// { -// return Buttons.HasFlag(Buttons.Start); -// } - -// public bool IsBackPressed() -// { -// return Buttons.HasFlag(Buttons.Back); -// } - -// public bool IsLeftThumbPressed() -// { -// return Buttons.HasFlag(Buttons.LeftThumb); -// } - -// public bool IsRightThumbPressed() -// { -// return Buttons.HasFlag(Buttons.RightThumb); -// } - -// public bool IsLeftShoulderPressed() -// { -// return Buttons.HasFlag(Buttons.LeftShoulder); -// } - -// public bool IsRightShoulderPressed() -// { -// return Buttons.HasFlag(Buttons.RightShoulder); -// } - -// public bool IsAPressed() -// { -// return Buttons.HasFlag(Buttons.A); -// } - -// public bool IsBPressed() -// { -// return Buttons.HasFlag(Buttons.B); -// } - -// public bool IsXPressed() -// { -// return Buttons.HasFlag(Buttons.X); -// } - -// public bool IsYPressed() -// { -// return Buttons.HasFlag(Buttons.Y); -// } -// } -//} diff --git a/Assets/Plugins/Essgee.Unity/Utilities/XInput/ControllerState.cs.meta b/Assets/Plugins/Essgee.Unity/Utilities/XInput/ControllerState.cs.meta deleted file mode 100644 index da9a3ae..0000000 --- a/Assets/Plugins/Essgee.Unity/Utilities/XInput/ControllerState.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 62cf2ece5ee5c44458ac5646bb2f8af8 \ No newline at end of file diff --git a/Assets/Plugins/Essgee.Unity/Utilities/XInput/NativeMethods.cs b/Assets/Plugins/Essgee.Unity/Utilities/XInput/NativeMethods.cs deleted file mode 100644 index c7dc807..0000000 --- a/Assets/Plugins/Essgee.Unity/Utilities/XInput/NativeMethods.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Essgee.Utilities.XInput -{ - static class NativeMethods - { - const string dllName = "xinput9_1_0.dll"; - - public const int FlagGamepad = 0x00000001; - - [DllImport(dllName, EntryPoint = "XInputGetState")] - public static extern int GetState(int dwUserIndex, ref XInputState pState); - [DllImport(dllName, EntryPoint = "XInputSetState")] - public static extern int SetState(int dwUserIndex, ref XInputVibration pVibration); - [DllImport(dllName, EntryPoint = "XInputGetCapabilities")] - public static extern int GetCapabilities(int dwUserIndex, int dwFlags, ref XInputCapabilities pCapabilities); - } - - public enum Errors - { - Success = 0x00000000, - BadArguments = 0x000000A0, - DeviceNotConnected = 0x0000048F - } -} diff --git a/Assets/Plugins/Essgee.Unity/Utilities/XInput/NativeMethods.cs.meta b/Assets/Plugins/Essgee.Unity/Utilities/XInput/NativeMethods.cs.meta deleted file mode 100644 index 3f0a5cf..0000000 --- a/Assets/Plugins/Essgee.Unity/Utilities/XInput/NativeMethods.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 2f4639905082c50448ca8a1477b55057 \ No newline at end of file diff --git a/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputCapabilities.cs b/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputCapabilities.cs deleted file mode 100644 index 08da7a8..0000000 --- a/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputCapabilities.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace Essgee.Utilities.XInput -{ - /* https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinput_capabilities%28v=vs.85%29.aspx */ - [StructLayout(LayoutKind.Explicit)] - public struct XInputCapabilities - { - [FieldOffset(0)] - byte type; - [FieldOffset(1)] - byte subType; - [FieldOffset(2)] - ushort flags; - [FieldOffset(4)] - public XInputGamepad Gamepad; - [FieldOffset(16)] - public XInputVibration Vibration; - - public DeviceType Type { get { return (DeviceType)type; } } - public DeviceSubType SubType { get { return (DeviceSubType)subType; } } - public DeviceFlags Flags { get { return (DeviceFlags)flags; } } - } - - public enum DeviceType - { - Gamepad = 0x01 - } - - public enum DeviceSubType - { - Gamepad = 0x01, - Wheel = 0x02, - ArcadeStick = 0x03, - FlightStick = 0x04, - DancePad = 0x05, - Guitar = 0x06, - DrumKit = 0x08 - } - - [Flags] - public enum DeviceFlags - { - VoiceSupported = 0x0004 - } -} diff --git a/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputCapabilities.cs.meta b/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputCapabilities.cs.meta deleted file mode 100644 index c916d61..0000000 --- a/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputCapabilities.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 400677b412126194caf14f5d627b34a2 \ No newline at end of file diff --git a/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputGamepad.cs b/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputGamepad.cs deleted file mode 100644 index 4ebf55b..0000000 --- a/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputGamepad.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace Essgee.Utilities.XInput -{ - /* https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinput_gamepad%28v=vs.85%29.aspx */ - [StructLayout(LayoutKind.Explicit)] - public struct XInputGamepad - { - [FieldOffset(0)] - ushort wButtons; - [FieldOffset(2)] - public byte bLeftTrigger; - [FieldOffset(3)] - public byte bRightTrigger; - [FieldOffset(4)] - public short sThumbLX; - [FieldOffset(6)] - public short sThumbLY; - [FieldOffset(8)] - public short sThumbRX; - [FieldOffset(10)] - public short sThumbRY; - - public const int LeftThumbDeadzone = 7849; - public const int RightThumbDeadzone = 8689; - public const int TriggerThreshold = 30; - - public Buttons Buttons { get { return (Buttons)wButtons; } } - } - - [Flags] - public enum Buttons - { - None = 0x0000, - DPadUp = 0x0001, - DPadDown = 0x0002, - DPadLeft = 0x0004, - DPadRight = 0x0008, - Start = 0x0010, - Back = 0x0020, - LeftThumb = 0x0040, - RightThumb = 0x0080, - LeftShoulder = 0x0100, - RightShoulder = 0x0200, - A = 0x1000, - B = 0x2000, - X = 0x4000, - Y = 0x8000 - } -} diff --git a/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputGamepad.cs.meta b/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputGamepad.cs.meta deleted file mode 100644 index 86f6d2b..0000000 --- a/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputGamepad.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: dee5c4630dd189049abf4d41bd4348d8 \ No newline at end of file diff --git a/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputState.cs b/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputState.cs deleted file mode 100644 index fb5dd6b..0000000 --- a/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputState.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Essgee.Utilities.XInput -{ - /* https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinput_state%28v=vs.85%29.aspx */ - [StructLayout(LayoutKind.Explicit)] - public struct XInputState - { - [FieldOffset(0)] - public uint dwPacketNumber; - [FieldOffset(4)] - public XInputGamepad Gamepad; - } -} diff --git a/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputState.cs.meta b/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputState.cs.meta deleted file mode 100644 index 64bb742..0000000 --- a/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputState.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: b18170cd37fc33d4ba897ffbe7198deb \ No newline at end of file diff --git a/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputVibration.cs b/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputVibration.cs deleted file mode 100644 index f48be3d..0000000 --- a/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputVibration.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Essgee.Utilities.XInput -{ - /* https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinput_vibration%28v=vs.85%29.aspx */ - [StructLayout(LayoutKind.Explicit)] - public struct XInputVibration - { - [FieldOffset(0)] - public ushort wLeftMotorSpeed; - [FieldOffset(2)] - public ushort wRightMotorSpeed; - } -} diff --git a/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputVibration.cs.meta b/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputVibration.cs.meta deleted file mode 100644 index c25fa98..0000000 --- a/Assets/Plugins/Essgee.Unity/Utilities/XInput/XInputVibration.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 66e6171736477a944b9299a66469f407 \ No newline at end of file diff --git a/Assets/Plugins/Essgee.Unity/Utilities/XInput.meta b/Assets/Resources/Essgee.Unity/Dat/Bootstrap.meta similarity index 77% rename from Assets/Plugins/Essgee.Unity/Utilities/XInput.meta rename to Assets/Resources/Essgee.Unity/Dat/Bootstrap.meta index 0e74294..e2f2c87 100644 --- a/Assets/Plugins/Essgee.Unity/Utilities/XInput.meta +++ b/Assets/Resources/Essgee.Unity/Dat/Bootstrap.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 37b3e1d7093e0f545807ab54c1209c8b +guid: ca91f4d917d2a354b97e24c5a2ce35b4 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Resources/Essgee.Unity/Dat/Bootstrap/[BIOS] ColecoVision (USA, Europe).col.bytes b/Assets/Resources/Essgee.Unity/Dat/Bootstrap/[BIOS] ColecoVision (USA, Europe).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LN(fFYqUpewC@JB<3Vj@NIM zHCkh>w!y1$toCVEtF6`!RcrHWw5>JT<2BkdLG9(BwmzikA?=ev?KW0BU!!fR)tFi> eR;%6b)%v_zTF@$3t%ue2vf3eDd&8^UM*auGv(-2N literal 0 HcmV?d00001 diff --git a/Assets/Resources/Essgee.Unity/Dat/Bootstrap/[BIOS] ColecoVision (USA, Europe).col.bytes.meta b/Assets/Resources/Essgee.Unity/Dat/Bootstrap/[BIOS] ColecoVision (USA, Europe).col.bytes.meta new file mode 100644 index 0000000..9ef2c8c --- /dev/null +++ b/Assets/Resources/Essgee.Unity/Dat/Bootstrap/[BIOS] ColecoVision (USA, Europe).col.bytes.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: efcafc093c10d4b46823dab15640a334 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/UEssgee.cs b/Assets/Scripts/UEssgee.cs index c6246f5..cf17e6b 100644 --- a/Assets/Scripts/UEssgee.cs +++ b/Assets/Scripts/UEssgee.cs @@ -6,7 +6,6 @@ using Essgee.Exceptions; using Essgee.Extensions; using Essgee.Metadata; using Essgee.Utilities; -using Essgee.Utilities.XInput; using System; using System.Collections.Generic; using System.IO; @@ -50,7 +49,8 @@ public class Essgeeinit : MonoBehaviour //LoadAndRunCartridge("G:/Phantasy Star (USA, Europe) (Rev A).zip"); //LoadAndRunCartridge("G:/Ninja_Gaiden_(UE)_type_A_[!].sms"); //LoadAndRunCartridge("G:/SML2.gb"); - LoadAndRunCartridge("G:/BaiduNetdiskDownload/ս-Թս[]1.11.gbc"); + LoadAndRunCartridge("G:/SonicTheHedgehog(Japan).zip"); + //LoadAndRunCartridge("G:/BaiduNetdiskDownload/ս-Թս[]1.11.gbc"); } void OnDisable() @@ -601,7 +601,7 @@ public class Essgeeinit : MonoBehaviour graphicsHandler.SubmitVideo(e.Width, e.Height, e.FrameDataPtr, 0); // TODO: create emulation "EndOfFrame" event for this? - ControllerManager.Update(); + //ControllerManager.Update(); //}); } @@ -697,8 +697,8 @@ public class Essgeeinit : MonoBehaviour private void EmulatorHandler_EnableRumble(object sender, EventArgs e) { - if (EmuStandInfo.Configuration.EnableXInput && EmuStandInfo.Configuration.EnableRumble) - ControllerManager.GetController(0).Vibrate(0.0f, 0.5f, TimeSpan.FromSeconds(0.1f)); + //if (EmuStandInfo.Configuration.EnableXInput && EmuStandInfo.Configuration.EnableRumble) + // ControllerManager.GetController(0).Vibrate(0.0f, 0.5f, TimeSpan.FromSeconds(0.1f)); } private void EmulatorHandler_PauseChanged(object sender, EventArgs e) diff --git a/Assets/Scripts/UEssgeeInterface/UEGVideoPlayer.cs b/Assets/Scripts/UEssgeeInterface/UEGVideoPlayer.cs index b939945..4e3205f 100644 --- a/Assets/Scripts/UEssgeeInterface/UEGVideoPlayer.cs +++ b/Assets/Scripts/UEssgeeInterface/UEGVideoPlayer.cs @@ -98,6 +98,11 @@ public class UEGVideoPlayer : MonoBehaviour mWidth = width; mHeight = height; bHadData = true; + } + + if (mWidth != width && mHeight != height) + { + } //Debug.Log($"frame_number -> {frame_number}"); }