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

183 lines
4.4 KiB
C#
Raw Normal View History

2014-06-23 23:25:08 +00:00
using System.Collections.Generic;
using System.Drawing;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Nintendo.GBA;
2014-06-23 23:25:08 +00:00
namespace BizHawk.Client.EmuHawk
{
[SchemaAttributes("GBA")]
public class GBASchema : IVirtualPadSchema
2014-06-23 23:25:08 +00:00
{
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
2014-06-23 23:25:08 +00:00
{
2014-06-29 12:47:42 +00:00
yield return StandardController();
2014-06-28 16:13:58 +00:00
yield return ConsoleButtons();
if (core is MGBAHawk)
{
yield return TiltControls();
}
}
private static PadSchema TiltControls()
{
return new PadSchema
{
DisplayName = "Tilt Controls",
IsConsole = false,
DefaultSize = new Size(256, 240),
MaxSize = new Size(256, 326),
Buttons = new[]
{
new PadSchema.ButtonScema
{
Name = "Tilt X",
DisplayName = "Tilt X",
Location = new Point(10, 15),
Type = PadSchema.PadInputType.FloatSingle,
TargetSize = new Size(226, 69),
MinValue = short.MinValue,
MaxValue = short.MaxValue
},
new PadSchema.ButtonScema
{
Name = "Tilt Y",
DisplayName = "Tilt Y",
Location = new Point(10, 94),
Type = PadSchema.PadInputType.FloatSingle,
TargetSize = new Size(226, 69),
MinValue = short.MinValue,
MaxValue = short.MaxValue
},
new PadSchema.ButtonScema
{
Name = "Tilt Z",
DisplayName = "Tilt Z",
Location = new Point(10, 173),
Type = PadSchema.PadInputType.FloatSingle,
TargetSize = new Size(226, 69),
MinValue = short.MinValue,
MaxValue = short.MaxValue
},
new PadSchema.ButtonScema
{
Name = "Light Sensor",
DisplayName = "Light Sensor",
Location = new Point(10, 252),
Type = PadSchema.PadInputType.FloatSingle,
TargetSize = new Size(226, 69),
MaxValue = byte.MaxValue
}
}
};
2014-06-23 23:25:08 +00:00
}
2014-06-28 16:13:58 +00:00
private static PadSchema StandardController()
2014-06-23 23:25:08 +00:00
{
return new PadSchema
{
IsConsole = false,
2014-06-28 16:13:58 +00:00
DefaultSize = new Size(194, 90),
2014-06-23 23:25:08 +00:00
Buttons = new[]
{
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "Up",
2014-06-23 23:25:08 +00:00
DisplayName = "",
Icon = Properties.Resources.BlueUp,
2014-06-28 16:13:58 +00:00
Location = new Point(29, 17),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "Down",
2014-06-23 23:25:08 +00:00
DisplayName = "",
Icon = Properties.Resources.BlueDown,
2014-06-28 16:13:58 +00:00
Location = new Point(29, 61),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "Left",
2014-06-23 23:25:08 +00:00
DisplayName = "",
Icon = Properties.Resources.Back,
2014-06-28 16:13:58 +00:00
Location = new Point(17, 39),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "Right",
2014-06-23 23:25:08 +00:00
DisplayName = "",
Icon = Properties.Resources.Forward,
2014-06-28 16:13:58 +00:00
Location = new Point(39, 39),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "B",
2014-06-23 23:25:08 +00:00
DisplayName = "B",
2014-06-28 16:13:58 +00:00
Location = new Point(130, 39),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "A",
2014-06-23 23:25:08 +00:00
DisplayName = "A",
2014-06-28 16:13:58 +00:00
Location = new Point(154, 39),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "Select",
2014-06-23 23:25:08 +00:00
DisplayName = "s",
2014-06-28 16:13:58 +00:00
Location = new Point(64, 39),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "Start",
2014-06-23 23:25:08 +00:00
DisplayName = "S",
2014-06-28 16:13:58 +00:00
Location = new Point(86, 39),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "L",
2014-06-23 23:25:08 +00:00
DisplayName = "L",
2014-06-28 16:13:58 +00:00
Location = new Point(2, 12),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "R",
2014-06-23 23:25:08 +00:00
DisplayName = "R",
2014-06-28 16:13:58 +00:00
Location = new Point(166, 12),
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(10, 15),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
}
}
};
}
}
}