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).col.bytes new file mode 100644 index 0000000..ba4b278 Binary files /dev/null and b/Assets/Resources/Essgee.Unity/Dat/Bootstrap/[BIOS] ColecoVision (USA, Europe).col.bytes differ 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}"); }