diff --git a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj index e9b30fc4dc..af8c19b0bc 100644 --- a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj +++ b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj @@ -1002,6 +1002,7 @@ + @@ -1526,6 +1527,10 @@ + + + + diff --git a/BizHawk.Client.EmuHawk/Properties/Resources.Designer.cs b/BizHawk.Client.EmuHawk/Properties/Resources.Designer.cs index c0857685cd..bdb927c541 100644 --- a/BizHawk.Client.EmuHawk/Properties/Resources.Designer.cs +++ b/BizHawk.Client.EmuHawk/Properties/Resources.Designer.cs @@ -300,6 +300,16 @@ namespace BizHawk.Client.EmuHawk.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Circle { + get { + object obj = ResourceManager.GetObject("Circle", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -380,6 +390,16 @@ namespace BizHawk.Client.EmuHawk.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Cross { + get { + object obj = ResourceManager.GetObject("Cross", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -1219,6 +1239,16 @@ namespace BizHawk.Client.EmuHawk.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Square { + get { + object obj = ResourceManager.GetObject("Square", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -1299,6 +1329,16 @@ namespace BizHawk.Client.EmuHawk.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Triangle { + get { + object obj = ResourceManager.GetObject("Triangle", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/BizHawk.Client.EmuHawk/Properties/Resources.resx b/BizHawk.Client.EmuHawk/Properties/Resources.resx index 5489361bdf..5c8b9dd3f6 100644 --- a/BizHawk.Client.EmuHawk/Properties/Resources.resx +++ b/BizHawk.Client.EmuHawk/Properties/Resources.resx @@ -1473,4 +1473,16 @@ ..\images\add.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\Circle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\images\Cross.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\images\Square.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\images\Triangle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/images/Circle.png b/BizHawk.Client.EmuHawk/images/Circle.png new file mode 100644 index 0000000000..282b708f90 Binary files /dev/null and b/BizHawk.Client.EmuHawk/images/Circle.png differ diff --git a/BizHawk.Client.EmuHawk/images/Cross.png b/BizHawk.Client.EmuHawk/images/Cross.png new file mode 100644 index 0000000000..28a9c09f8d Binary files /dev/null and b/BizHawk.Client.EmuHawk/images/Cross.png differ diff --git a/BizHawk.Client.EmuHawk/images/Square.png b/BizHawk.Client.EmuHawk/images/Square.png new file mode 100644 index 0000000000..00c3ade7b3 Binary files /dev/null and b/BizHawk.Client.EmuHawk/images/Square.png differ diff --git a/BizHawk.Client.EmuHawk/images/Triangle.png b/BizHawk.Client.EmuHawk/images/Triangle.png new file mode 100644 index 0000000000..39562995ec Binary files /dev/null and b/BizHawk.Client.EmuHawk/images/Triangle.png differ diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs new file mode 100644 index 0000000000..0cd4d7eeae --- /dev/null +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs @@ -0,0 +1,200 @@ +using System.Collections.Generic; +using System.Drawing; + +using BizHawk.Client.Common; +using BizHawk.Emulation.Cores.Sony.PSX; + +namespace BizHawk.Client.EmuHawk +{ + [SchemaAttributes("PSX")] + public class PSXSchema : IVirtualPadSchema + { + public IEnumerable GetPadSchemas() + { + yield return DualShockController(1); + yield return ConsoleButtons(); + } + + public static PadSchema DualShockController(int controller) + { + return new PadSchema + { + IsConsole = false, + DefaultSize = new Size(420, 260), + Buttons = new[] + { + new PadSchema.ButtonScema + { + Name = "P" + controller + " Up", + DisplayName = "", + Icon = Properties.Resources.BlueUp, + Location = new Point(32, 50), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " Down", + DisplayName = "", + Icon = Properties.Resources.BlueDown, + Location = new Point(32, 71), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " Left", + DisplayName = "", + Icon = Properties.Resources.Back, + Location = new Point(11, 62), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " Right", + DisplayName = "", + Icon = Properties.Resources.Forward, + Location = new Point(53, 62), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " L1", + DisplayName = "L1", + Location = new Point(3, 32), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " R1", + DisplayName = "R1", + Location = new Point(191, 32), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " L2", + DisplayName = "L2", + Location = new Point(3, 10), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " R2", + DisplayName = "R2", + Location = new Point(191, 10), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " L3", + DisplayName = "L3", + Location = new Point(72, 90), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " R3", + DisplayName = "R3", + Location = new Point(130, 90), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " Square", + DisplayName = "", + Icon = Properties.Resources.Square, + Location = new Point(148, 62), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " Triangle", + DisplayName = "", + Icon = Properties.Resources.Triangle, + Location = new Point(169, 50), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " Circle", + DisplayName = "", + Icon = Properties.Resources.Circle, + Location = new Point(190, 62), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " Cross", + DisplayName = "", + Icon = Properties.Resources.Cross, + Location = new Point(169, 71), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " Start", + DisplayName = "S", + Location = new Point(112, 62), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " Select", + DisplayName = "s", + Location = new Point(90, 62), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " LStick X", + MaxValue = 127, + DisplayName = "", + Location = new Point(3, 120), + Type = PadSchema.PadInputType.AnalogStick + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " RStick X", + MaxValue = 127, + DisplayName = "", + Location = new Point(210, 120), + Type = PadSchema.PadInputType.AnalogStick + } + } + }; + } + private static PadSchema ConsoleButtons() + { + return new PadSchema + { + DisplayName = "Console", + IsConsole = true, + DefaultSize = new Size(360, 250), + Buttons = new[] + { + new PadSchema.ButtonScema + { + Name = "Eject", + DisplayName = "Eject", + Location = new Point(10, 15), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "Reset", + DisplayName = "Reset", + Location = new Point(60, 15), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "Disc Switch", + MaxValue = 50, + DisplayName = "", + Location = new Point(10, 40), + Type = PadSchema.PadInputType.AnalogStick + } + } + }; + } + } +} diff --git a/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs b/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs index 3d9d4ec6b0..b8b58aea6c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs @@ -32,16 +32,17 @@ namespace BizHawk.Emulation.Cores.Sony.PSX Name = "DualShock Controller", BoolButtons = { - "Up", "Down", "Left", "Right", - "Select", "Start", - "Square", "Triangle", "Circle", "Cross", - "L1", "R1", "L2", "R2", "L3", "R3", - "MODE", + "P1 Up", "P1 Down", "P1 Left", "P1 Right", "P1 Select", "P1 Start", "P1 Square", "P1 Triangle", "P1 Circle", "P1 Cross", "P1 L1", + "P1 R1", "P1 L2", "P1 R2", "P1 L3", "P1 R3", "P1 MODE", + //"P2 Up", "P2 Down", "P2 Left", "P2 Right", "P2 Select", "P2 Start", "P2 Square", "P2 Triangle", "P2 Circle", "P2 Cross", "P2 L1", + //"P2 R1", "P2 L2", "P2 R2", "P2 L3", "P2 R3", "P2 MODE", + "Eject", "Reset", }, FloatControls = { - "LStick X", "LStick Y", - "RStick X", "RStick Y", + "P1 LStick X", "P1 LStick Y", "P1 RStick X", "P1 RStick Y", + //"P2 LStick X", "P2 LStick Y", "P2 RStick X", "P2 RStick Y", + //TODO: Fix "Disc Switch", }, FloatRanges = {