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

147 lines
3.9 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;
using BizHawk.Emulation.Cores.Nintendo.N64;
2014-06-22 15:43:45 +00:00
namespace BizHawk.Client.EmuHawk
{
[SchemaAttributes("N64")]
2014-06-23 14:13:07 +00:00
public class N64Schema : IVirtualPadSchema
2014-06-22 15:43:45 +00:00
{
public IEnumerable<PadSchema> GetPadSchemas()
2014-06-23 14:13:07 +00:00
{
var ss = ((N64)Global.Emulator).GetSyncSettings();
2014-06-29 03:14:40 +00:00
for (var i = 0; i < 4; i++)
2014-06-23 14:13:07 +00:00
{
if (ss.Controllers[i].IsConnected)
{
yield return StandardController(i + 1);
}
}
2014-06-23 14:13:07 +00:00
}
2014-06-22 15:43:45 +00:00
public static PadSchema StandardController(int controller)
{
return new PadSchema
{
IsConsole = false,
DefaultSize = new Size(220, 316),
2014-06-22 15:43:45 +00:00
Buttons = new[]
{
new PadSchema.ButtonScema
{
Name = "P" + controller + " DPad U",
2014-06-22 15:43:45 +00:00
DisplayName = "",
Icon = Properties.Resources.BlueUp,
Location = new Point(24, 195),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " DPad D",
2014-06-22 15:43:45 +00:00
DisplayName = "",
Icon = Properties.Resources.BlueDown,
Location = new Point(24, 216),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " DPad L",
2014-06-22 15:43:45 +00:00
DisplayName = "",
Icon = Properties.Resources.Back,
Location = new Point(3, 207),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " DPad R",
2014-06-22 15:43:45 +00:00
DisplayName = "",
Icon = Properties.Resources.Forward,
Location = new Point(45, 207),
Type = PadSchema.PadInputType.Boolean
2014-06-23 01:43:33 +00:00
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " L",
DisplayName = "L",
Location = new Point(3, 150),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " R",
DisplayName = "R",
Location = new Point(191, 150),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Z",
DisplayName = "Z",
Location = new Point(81, 234),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Start",
DisplayName = "S",
Location = new Point(81, 211),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " B",
DisplayName = "B",
Location = new Point(127, 211),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " A",
DisplayName = "A",
Location = new Point(138, 234),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " C Up",
Icon = Properties.Resources.YellowUp,
Location = new Point(173, 175),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " C Down",
Icon = Properties.Resources.YellowDown,
Location = new Point(173, 196),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " C Left",
Icon = Properties.Resources.YellowLeft,
Location = new Point(152, 189),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " C Right",
Icon = Properties.Resources.YellowRight,
Location = new Point(194, 189),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " X Axis",
MaxValue = 127,
DisplayName = "",
Location = new Point(6, 14),
Type = PadSchema.PadInputType.AnalogStick
2014-06-22 15:43:45 +00:00
}
}
};
}
}
}