Virtualpads - fix buttons on GB, implement Dual GB

This commit is contained in:
adelikat 2014-06-29 12:42:44 +00:00
parent 01ba63dd09
commit c5f1174711
3 changed files with 102 additions and 10 deletions

View File

@ -914,6 +914,7 @@
<Compile Include="tools\VirtualPads\schema\A78Schema.cs" />
<Compile Include="tools\VirtualPads\schema\C64Schema.cs" />
<Compile Include="tools\VirtualPads\schema\ColecoSchema.cs" />
<Compile Include="tools\VirtualPads\schema\DualGBSchema.cs" />
<Compile Include="tools\VirtualPads\schema\GBASchema.cs" />
<Compile Include="tools\VirtualPads\schema\GBSchema.cs" />
<Compile Include="tools\VirtualPads\schema\GenSchema.cs" />

View File

@ -0,0 +1,89 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
namespace BizHawk.Client.EmuHawk.tools.VirtualPads.schema
{
[SchemaAttributes("DGB")]
public class DualGBSchema : IVirtualPadSchema
{
public IEnumerable<PadSchema> GetPadSchemas()
{
yield return StandardController(1);
yield return StandardController(2);
}
private static PadSchema StandardController(int controller)
{
return new PadSchema
{
IsConsole = false,
DefaultSize = new Size(174, 79),
Buttons = new[]
{
new PadSchema.ButtonScema
{
Name = "P" + controller + " Up",
DisplayName = "",
Icon = Properties.Resources.BlueUp,
Location = new Point(14, 12),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Down",
DisplayName = "",
Icon = Properties.Resources.BlueDown,
Location = new Point(14, 56),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Left",
DisplayName = "",
Icon = Properties.Resources.Back,
Location = new Point(2, 34),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Right",
DisplayName = "",
Icon = Properties.Resources.Forward,
Location = new Point(24, 34),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " B",
DisplayName = "B",
Location = new Point(122, 34),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " A",
DisplayName = "A",
Location = new Point(146, 34),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Select",
DisplayName = "s",
Location = new Point(52, 34),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Start",
DisplayName = "S",
Location = new Point(74, 34),
Type = PadSchema.PadInputType.Boolean
}
}
};
}
}
}

View File

@ -1,18 +1,20 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
namespace BizHawk.Client.EmuHawk
{
[SchemaAttributes("GB")]
public class GBSchema : IVirtualPadSchema
{
public IEnumerable<PadSchema> GetPadSchemas()
{
yield return StandardController(1);
yield return StandardController();
yield return ConsoleButtons();
}
public static PadSchema StandardController(int controller)
public static PadSchema StandardController()
{
return new PadSchema
{
@ -22,7 +24,7 @@ namespace BizHawk.Client.EmuHawk
{
new PadSchema.ButtonScema
{
Name = "P" + controller + " Up",
Name = "Up",
DisplayName = "",
Icon = Properties.Resources.BlueUp,
Location = new Point(14, 12),
@ -30,7 +32,7 @@ namespace BizHawk.Client.EmuHawk
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Down",
Name = "Down",
DisplayName = "",
Icon = Properties.Resources.BlueDown,
Location = new Point(14, 56),
@ -38,7 +40,7 @@ namespace BizHawk.Client.EmuHawk
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Left",
Name = "Left",
DisplayName = "",
Icon = Properties.Resources.Back,
Location = new Point(2, 34),
@ -46,7 +48,7 @@ namespace BizHawk.Client.EmuHawk
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Right",
Name = "Right",
DisplayName = "",
Icon = Properties.Resources.Forward,
Location = new Point(24, 34),
@ -54,28 +56,28 @@ namespace BizHawk.Client.EmuHawk
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " B",
Name = "B",
DisplayName = "B",
Location = new Point(122, 34),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " A",
Name = "A",
DisplayName = "A",
Location = new Point(146, 34),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Select",
Name = "Select",
DisplayName = "s",
Location = new Point(52, 34),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Start",
Name = "Start",
DisplayName = "S",
Location = new Point(74, 34),
Type = PadSchema.PadInputType.Boolean