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

152 lines
4.0 KiB
C#
Raw Normal View History

2014-06-23 14:13:07 +00:00
using System.Collections.Generic;
using System.Drawing;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Nintendo.N64;
2014-06-22 15:43:45 +00:00
namespace BizHawk.Client.EmuHawk
{
2017-07-12 19:40:10 +00:00
[Schema("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(IEmulator core)
2014-06-23 14:13:07 +00:00
{
var ss = ((N64)core).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
}
2017-05-24 14:07:03 +00:00
private static PadSchema StandardController(int controller)
2014-06-22 15:43:45 +00:00
{
return new PadSchema
{
IsConsole = false,
DefaultSize = new Size(275, 316),
2014-06-22 15:43:45 +00:00
Buttons = new[]
{
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-22 15:43:45 +00:00
{
2019-03-18 14:06:37 +00:00
Name = $"P{controller} DPad U",
2014-06-22 15:43:45 +00:00
DisplayName = "",
Icon = Properties.Resources.BlueUp,
Location = new Point(24, 230),
2014-06-22 15:43:45 +00:00
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-22 15:43:45 +00:00
{
2019-03-18 14:06:37 +00:00
Name = $"P{controller} DPad D",
2014-06-22 15:43:45 +00:00
DisplayName = "",
Icon = Properties.Resources.BlueDown,
Location = new Point(24, 251),
2014-06-22 15:43:45 +00:00
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-22 15:43:45 +00:00
{
2019-03-18 14:06:37 +00:00
Name = $"P{controller} DPad L",
2014-06-22 15:43:45 +00:00
DisplayName = "",
Icon = Properties.Resources.Back,
Location = new Point(3, 242),
2014-06-22 15:43:45 +00:00
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-22 15:43:45 +00:00
{
2019-03-18 14:06:37 +00:00
Name = $"P{controller} DPad R",
2014-06-22 15:43:45 +00:00
DisplayName = "",
Icon = Properties.Resources.Forward,
Location = new Point(45, 242),
2014-06-22 15:43:45 +00:00
Type = PadSchema.PadInputType.Boolean
2014-06-23 01:43:33 +00:00
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-23 01:43:33 +00:00
{
2019-03-18 14:06:37 +00:00
Name = $"P{controller} L",
2014-06-23 01:43:33 +00:00
DisplayName = "L",
Location = new Point(3, 185),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-23 01:43:33 +00:00
{
2019-03-18 14:06:37 +00:00
Name = $"P{controller} R",
2014-06-23 01:43:33 +00:00
DisplayName = "R",
Location = new Point(191, 185),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-23 01:43:33 +00:00
{
2019-03-18 14:06:37 +00:00
Name = $"P{controller} Z",
2014-06-23 01:43:33 +00:00
DisplayName = "Z",
Location = new Point(81, 269),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-23 01:43:33 +00:00
{
2019-03-18 14:06:37 +00:00
Name = $"P{controller} Start",
2014-06-23 01:43:33 +00:00
DisplayName = "S",
Location = new Point(81, 246),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-23 01:43:33 +00:00
{
2019-03-18 14:06:37 +00:00
Name = $"P{controller} B",
2014-06-23 01:43:33 +00:00
DisplayName = "B",
Location = new Point(127, 246),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-23 01:43:33 +00:00
{
2019-03-18 14:06:37 +00:00
Name = $"P{controller} A",
2014-06-23 01:43:33 +00:00
DisplayName = "A",
Location = new Point(138, 269),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-23 01:43:33 +00:00
{
2019-03-18 14:06:37 +00:00
Name = $"P{controller} C Up",
Icon = Properties.Resources.YellowUp,
Location = new Point(173, 210),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-23 01:43:33 +00:00
{
2019-03-18 14:06:37 +00:00
Name = $"P{controller} C Down",
Icon = Properties.Resources.YellowDown,
Location = new Point(173, 231),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-23 01:43:33 +00:00
{
2019-03-18 14:06:37 +00:00
Name = $"P{controller} C Left",
Icon = Properties.Resources.YellowLeft,
Location = new Point(152, 221),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-23 01:43:33 +00:00
{
2019-03-18 14:06:37 +00:00
Name = $"P{controller} C Right",
Icon = Properties.Resources.YellowRight,
Location = new Point(194, 221),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
{
2019-03-18 14:06:37 +00:00
Name = $"P{controller} X Axis",
MinValue = -128,
MidValue = 0,
MaxValue = 127,
MinValueSec = 127,
MidValueSec = 0,
MaxValueSec = -128,
DisplayName = "",
Location = new Point(6, 14),
Type = PadSchema.PadInputType.AnalogStick
2014-06-22 15:43:45 +00:00
}
}
};
}
}
}