BizHawk/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SnesSchema.cs

152 lines
3.7 KiB
C#
Raw Normal View History

2014-06-23 14:13:07 +00:00
using System.Collections.Generic;
using System.Drawing;
using BizHawk.Client.Common;
2014-06-22 15:43:45 +00:00
namespace BizHawk.Client.EmuHawk
{
[SchemaAttributes("SNES")]
2014-06-23 14:13:07 +00:00
public class SnesSchema : IVirtualPadSchema
2014-06-22 15:43:45 +00:00
{
public IEnumerable<PadSchema> GetPadSchemas()
2014-06-23 14:13:07 +00:00
{
2014-06-29 03:14:40 +00:00
for (var i = 0; i < Global.Emulator.ControllerDefinition.PlayerCount; i++)
{
yield return StandardController(i + 1);
}
2014-06-28 16:52:31 +00:00
yield return ConsoleButtons();
2014-06-23 14:13:07 +00:00
}
2014-06-28 16:52:31 +00:00
private static PadSchema StandardController(int controller)
2014-06-22 15:43:45 +00:00
{
return new PadSchema
{
2014-06-23 01:43:33 +00:00
IsConsole = false,
2014-06-28 16:52:31 +00:00
DefaultSize = new Size(200, 90),
2014-06-23 01:43:33 +00:00
Buttons = new[]
{
new PadSchema.ButtonScema
{
Name = "P" + controller + " Up",
DisplayName = "",
Icon = Properties.Resources.BlueUp,
2014-06-28 16:52:31 +00:00
Location = new Point(34, 17),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Down",
DisplayName = "",
Icon = Properties.Resources.BlueDown,
2014-06-28 16:52:31 +00:00
Location = new Point(34, 61),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Left",
DisplayName = "",
Icon = Properties.Resources.Back,
2014-06-28 16:52:31 +00:00
Location = new Point(22, 39),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Right",
DisplayName = "",
Icon = Properties.Resources.Forward,
2014-06-28 16:52:31 +00:00
Location = new Point(44, 39),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-28 16:52:31 +00:00
Name = "P" + controller + " L",
DisplayName = "L",
Location = new Point(2, 10),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-28 16:52:31 +00:00
Name = "P" + controller + " R",
DisplayName = "R",
Location = new Point(174, 10),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
2014-06-28 16:52:31 +00:00
2014-06-23 01:43:33 +00:00
new PadSchema.ButtonScema
{
Name = "P" + controller + " Select",
DisplayName = "s",
2014-06-28 16:52:31 +00:00
Location = new Point(70, 39),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Start",
DisplayName = "S",
2014-06-28 16:52:31 +00:00
Location = new Point(92, 39),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Y",
DisplayName = "Y",
Location = new Point(121, 39),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " B",
DisplayName = "B",
Location = new Point(145, 52),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " X",
DisplayName = "X",
2014-06-28 16:52:31 +00:00
Location = new Point(122, 15),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-28 16:52:31 +00:00
Name = "P" + controller + " A",
DisplayName = "A",
Location = new Point(146, 25),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
2014-06-29 03:14:40 +00:00
}
2014-06-28 16:52:31 +00:00
}
};
}
private static PadSchema ConsoleButtons()
{
return new PadSchema
{
DisplayName = "Console",
IsConsole = true,
DefaultSize = new Size(150, 50),
Buttons = new[]
{
2014-06-23 01:43:33 +00:00
new PadSchema.ButtonScema
{
2014-06-28 16:52:31 +00:00
Name = "Reset",
DisplayName = "Reset",
Location = new Point(10, 15),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-28 16:52:31 +00:00
Name = "Power",
DisplayName = "Power",
Location = new Point(58, 15),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
2014-06-23 23:25:08 +00:00
}
2014-06-23 01:43:33 +00:00
}
2014-06-22 15:43:45 +00:00
};
}
}
}