Wonderswan - Mnemonics and Virtualpads, virtualpads are a bit clunky with Standard and Rotated showing at all times, perhaps at some point we should be smart about knowing the rotated state

This commit is contained in:
adelikat 2014-06-28 19:07:18 +00:00
parent 0f64fa9a8a
commit 90e95752e4
2 changed files with 167 additions and 56 deletions

View File

@ -88,15 +88,15 @@ namespace BizHawk.Client.Common
{ "Star", '*' }, { "Star", '*' },
{ "Pound", '#' }, { "Pound", '#' },
{ "P2 X1", '1' }, { "X1", '1' },
{ "P2 X2", '2' }, { "X2", '2' },
{ "P2 X3", '3' }, { "X3", '3' },
{ "P2 X4", '4' }, { "X4", '4' },
{ "P2 Y1", '1' }, { "Y1", '1' },
{ "P2 Y2", '2' }, { "Y2", '2' },
{ "P2 Y3", '3' }, { "Y3", '3' },
{ "P2 Y4", '4' }, { "Y4", '4' },
}; };
private readonly Dictionary<string, Dictionary<string, char>> SystemOverrides = new Dictionary<string, Dictionary<string, char>> private readonly Dictionary<string, Dictionary<string, char>> SystemOverrides = new Dictionary<string, Dictionary<string, char>>

View File

@ -3,6 +3,7 @@ using System.ComponentModel;
using System.Drawing; using System.Drawing;
using BizHawk.Client.Common; using BizHawk.Client.Common;
using BizHawk.Emulation.Cores.WonderSwan;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Client.EmuHawk
{ {
@ -11,107 +12,217 @@ namespace BizHawk.Client.EmuHawk
{ {
public IEnumerable<PadSchema> GetPadSchemas() public IEnumerable<PadSchema> GetPadSchemas()
{ {
var core = Global.Emulator as WonderSwan;
var def = core.ControllerDefinition;
var ss = (WonderSwan.SyncSettings)core.GetSyncSettings();
yield return StandardController(1); yield return StandardController(1);
yield return RotatedController(2);
yield return ConsoleButtons();
} }
public static PadSchema StandardController(int controller)
private static PadSchema StandardController(int controller)
{ {
return new PadSchema return new PadSchema
{ {
DisplayName = "Standard",
IsConsole = false, IsConsole = false,
DefaultSize = new Size(174, 74), DefaultSize = new Size(174, 210),
Buttons = new[] Buttons = new[]
{ {
//TODO: Need All Locations and DisplayNames
new PadSchema.ButtonScema new PadSchema.ButtonScema
{ {
Name = "P" + controller + " Up X", Name = "P" + controller + " Y1",
DisplayName = "", DisplayName = "Y1",
Icon = Properties.Resources.BlueUp, Location = new Point(23, 12),
Location = new Point(14, 2),
Type = PadSchema.PadInputType.Boolean Type = PadSchema.PadInputType.Boolean
}, },
new PadSchema.ButtonScema new PadSchema.ButtonScema
{ {
Name = "P" + controller + " Down X", Name = "P" + controller + " Y4",
DisplayName = "", DisplayName = "Y4",
Icon = Properties.Resources.BlueDown, Location = new Point(9, 34),
Location = new Point(14, 46),
Type = PadSchema.PadInputType.Boolean Type = PadSchema.PadInputType.Boolean
}, },
new PadSchema.ButtonScema new PadSchema.ButtonScema
{ {
Name = "P" + controller + " Left X", Name = "P" + controller + " Y2",
DisplayName = "", DisplayName = "Y2",
Icon = Properties.Resources.Back, Location = new Point(38, 34),
Location = new Point(2, 24),
Type = PadSchema.PadInputType.Boolean Type = PadSchema.PadInputType.Boolean
}, },
new PadSchema.ButtonScema new PadSchema.ButtonScema
{ {
Name = "P" + controller + " Right X", Name = "P" + controller + " Y3",
DisplayName = "", DisplayName = "Y3",
Icon = Properties.Resources.Forward, Location = new Point(23, 56),
Location = new Point(24, 24), Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " X1",
DisplayName = "X1",
Location = new Point(23, 92),
Type = PadSchema.PadInputType.Boolean Type = PadSchema.PadInputType.Boolean
}, },
new PadSchema.ButtonScema new PadSchema.ButtonScema
{ {
Name = "P" + controller + " Up Y", Name = "P" + controller + " X4",
DisplayName = "", DisplayName = "X4",
Icon = Properties.Resources.BlueUp, Location = new Point(9, 114),
Location = new Point(14, 2),
Type = PadSchema.PadInputType.Boolean Type = PadSchema.PadInputType.Boolean
}, },
new PadSchema.ButtonScema new PadSchema.ButtonScema
{ {
Name = "P" + controller + " Down Y", Name = "P" + controller + " X2",
DisplayName = "", DisplayName = "X2",
Icon = Properties.Resources.BlueDown, Location = new Point(38, 114),
Location = new Point(14, 46),
Type = PadSchema.PadInputType.Boolean Type = PadSchema.PadInputType.Boolean
}, },
new PadSchema.ButtonScema new PadSchema.ButtonScema
{ {
Name = "P" + controller + " Left Y", Name = "P" + controller + " X3",
DisplayName = "", DisplayName = "X3",
Icon = Properties.Resources.Back, Location = new Point(23, 136),
Location = new Point(2, 24),
Type = PadSchema.PadInputType.Boolean Type = PadSchema.PadInputType.Boolean
}, },
new PadSchema.ButtonScema new PadSchema.ButtonScema
{ {
Name = "P" + controller + " Right Y", Name = "P" + controller + " Start",
DisplayName = "", DisplayName = "S",
Icon = Properties.Resources.Forward, Location = new Point(80, 114),
Location = new Point(24, 24), Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " B",
DisplayName = "B",
Location = new Point(110, 114),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " A",
DisplayName = "A",
Location = new Point(133, 103),
Type = PadSchema.PadInputType.Boolean
},
}
};
}
private static PadSchema RotatedController(int controller)
{
return new PadSchema
{
DisplayName = "Rotated",
IsConsole = false,
DefaultSize = new Size(174, 210),
Buttons = new[]
{
new PadSchema.ButtonScema
{
Name = "P" + controller + " A",
DisplayName = "A",
Location = new Point(23, 12),
Type = PadSchema.PadInputType.Boolean Type = PadSchema.PadInputType.Boolean
}, },
new PadSchema.ButtonScema new PadSchema.ButtonScema
{ {
Name = "P" + controller + " B", Name = "P" + controller + " B",
DisplayName = "B", DisplayName = "B",
Location = new Point(134, 48), Location = new Point(46, 22),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " A",
DisplayName = "A",
Location = new Point(146, 22),
Type = PadSchema.PadInputType.Boolean Type = PadSchema.PadInputType.Boolean
}, },
new PadSchema.ButtonScema new PadSchema.ButtonScema
{ {
Name = "P" + controller + " Start", Name = "P" + controller + " Start",
DisplayName = "S", DisplayName = "S",
Location = new Point(78, 42), Location = new Point(32, 58),
Type = PadSchema.PadInputType.Boolean Type = PadSchema.PadInputType.Boolean
}, },
new PadSchema.ButtonScema //Power
new PadSchema.ButtonScema
{ {
Name = "P" + controller + " P", Name = "P" + controller + " Y2",
DisplayName = "P", DisplayName = "Y2",
Location = new Point(110, 34), Location = new Point(23, 112),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Y1",
DisplayName = "Y1",
Location = new Point(9, 134),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Y3",
DisplayName = "Y3",
Location = new Point(38, 134),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Y4",
DisplayName = "Y4",
Location = new Point(23, 156),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " X2",
DisplayName = "X2",
Location = new Point(103, 112),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " X1",
DisplayName = "X1",
Location = new Point(89, 134),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " X3",
DisplayName = "X3",
Location = new Point(118, 134),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " X4",
DisplayName = "X4",
Location = new Point(103, 156),
Type = PadSchema.PadInputType.Boolean
},
}
};
}
private static PadSchema ConsoleButtons()
{
return new PadSchema
{
DisplayName = "Console",
IsConsole = true,
DefaultSize = new Size(75, 50),
Buttons = new[]
{
new PadSchema.ButtonScema
{
Name = "Power",
DisplayName = "Power",
Location = new Point(7, 15),
Type = PadSchema.PadInputType.Boolean Type = PadSchema.PadInputType.Boolean
} }
} }