Virtualpads - fix 3 vs 6 button controller logic in genesis

This commit is contained in:
adelikat 2014-06-26 20:59:00 +00:00
parent 12cd706a69
commit 0fa75a5d77
5 changed files with 185 additions and 198 deletions

View File

@ -906,8 +906,7 @@
</Compile>
<Compile Include="tools\VirtualPads\schema\GBASchema.cs" />
<Compile Include="tools\VirtualPads\schema\GBSchema.cs" />
<Compile Include="tools\VirtualPads\schema\Gen6ButtonSchema.cs" />
<Compile Include="tools\VirtualPads\schema\Gen3ButtonSchema.cs" />
<Compile Include="tools\VirtualPads\schema\GenSchema.cs" />
<Compile Include="tools\VirtualPads\schema\SatSchema.cs" />
<Compile Include="tools\VirtualPads\schema\IVirtualPadSchema.cs" />
<Compile Include="tools\VirtualPads\schema\N64Schema.cs" />

View File

@ -134,7 +134,6 @@ namespace BizHawk.Client.EmuHawk
Pads.ForEach(p => p.SetReadOnly(false));
}
// TODO
if (!Readonly && !Global.Config.VirtualPadSticky)
{
Pads.ForEach(pad => pad.Clear());

View File

@ -1,97 +0,0 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using BizHawk.Client.Common;
namespace BizHawk.Client.EmuHawk
{
[SchemaAttributes("GEN")]
public class Gen3ButtonSchema : IVirtualPadSchema
{
public IEnumerable<VirtualPad> GetPads()
{
yield return new VirtualPad(StandardController(1))
{
Location = new Point(15, 15)
};
yield return new VirtualPad(StandardController(2))
{
Location = new Point(200, 15)
};
}
public static PadSchema StandardController(int controller)
{
return new PadSchema
{
IsConsole = false,
DefaultSize = new Size(174, 74),
Buttons = new[]
{
new PadSchema.ButtonScema
{
Name = "P" + controller + " Up",
DisplayName = "",
Icon = Properties.Resources.BlueUp,
Location = new Point(14, 2),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Down",
DisplayName = "",
Icon = Properties.Resources.BlueDown,
Location = new Point(14, 46),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Left",
DisplayName = "",
Icon = Properties.Resources.Back,
Location = new Point(2, 24),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Right",
DisplayName = "",
Icon = Properties.Resources.Forward,
Location = new Point(24, 24),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " B",
DisplayName = "B",
Location = new Point(122, 36),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " A",
DisplayName = "A",
Location = new Point(98, 36),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " C",
DisplayName = "C",
Location = new Point(146, 36),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Start",
DisplayName = "S",
Location = new Point(122, 2),
Type = PadSchema.PadInputType.Boolean
}
}
};
}
}
}

View File

@ -1,98 +0,0 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using BizHawk.Client.Common;
namespace BizHawk.Client.EmuHawk
{
[SchemaAttributes("GEN")]
public class Gen6ButtonSchema : IVirtualPadSchema
{
public IEnumerable<VirtualPad> GetPads()
{
yield return new VirtualPad(StandardController(1))
{
Location = new Point(15, 15)
};
yield return new VirtualPad(StandardController(2))
{
Location = new Point(200, 15)
};
}
public static PadSchema StandardController(int controller)
{
//TODO: Need X,Y,Z, M buttons
return new PadSchema
{
IsConsole = false,
DefaultSize = new Size(174, 74),
Buttons = new[]
{
new PadSchema.ButtonScema
{
Name = "P" + controller + " Up",
DisplayName = "",
Icon = Properties.Resources.BlueUp,
Location = new Point(14, 2),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Down",
DisplayName = "",
Icon = Properties.Resources.BlueDown,
Location = new Point(14, 46),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Left",
DisplayName = "",
Icon = Properties.Resources.Back,
Location = new Point(2, 24),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Right",
DisplayName = "",
Icon = Properties.Resources.Forward,
Location = new Point(24, 24),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " B",
DisplayName = "B",
Location = new Point(122, 36),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " A",
DisplayName = "A",
Location = new Point(98, 36),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " C",
DisplayName = "C",
Location = new Point(146, 36),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Start",
DisplayName = "S",
Location = new Point(122, 2),
Type = PadSchema.PadInputType.Boolean
}
}
};
}
}
}

View File

@ -0,0 +1,184 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using BizHawk.Client.Common;
namespace BizHawk.Client.EmuHawk
{
[SchemaAttributes("GEN")]
public class GenSchema : IVirtualPadSchema
{
public IEnumerable<VirtualPad> GetPads()
{
yield return new VirtualPad(ThreeButtonController(1));
yield return new VirtualPad(SixButtonController(2));
}
public static PadSchema ThreeButtonController(int controller)
{
return new PadSchema
{
IsConsole = false,
DefaultSize = new Size(174, 90),
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 + " A",
DisplayName = "A",
Location = new Point(98, 40),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " B",
DisplayName = "B",
Location = new Point(122, 40),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " C",
DisplayName = "C",
Location = new Point(146, 40),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Start",
DisplayName = "S",
Location = new Point(122, 12),
Type = PadSchema.PadInputType.Boolean
}
}
};
}
public static PadSchema SixButtonController(int controller)
{
return new PadSchema
{
IsConsole = false,
DefaultSize = new Size(174, 90),
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 + " A",
DisplayName = "A",
Location = new Point(98, 40),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " B",
DisplayName = "B",
Location = new Point(122, 40),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " C",
DisplayName = "C",
Location = new Point(146, 40),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " X",
DisplayName = "X",
Location = new Point(98, 65),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Y",
DisplayName = "Y",
Location = new Point(122, 65),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Z",
DisplayName = "Z",
Location = new Point(146, 65),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Start",
DisplayName = "S",
Location = new Point(122, 12),
Type = PadSchema.PadInputType.Boolean
}
}
};
}
}
}