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

190 lines
4.6 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;
2014-06-27 02:45:27 +00:00
using BizHawk.Emulation.Cores.Sega.MasterSystem;
2014-06-22 15:43:45 +00:00
namespace BizHawk.Client.EmuHawk
{
[SchemaAttributes("SMS")]
2014-06-23 14:13:07 +00:00
public class SmsSchema : IVirtualPadSchema
2014-06-22 15:43:45 +00:00
{
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
2014-06-23 14:13:07 +00:00
{
2017-05-24 14:07:03 +00:00
if (((SMS)core).IsGameGear)
2014-06-23 14:13:07 +00:00
{
yield return GGController(1);
yield return GGConsoleButtons();
2014-06-27 02:45:27 +00:00
}
else
2014-06-23 14:13:07 +00:00
{
yield return StandardController(1);
yield return StandardController(2);
yield return SmsConsoleButtons();
2014-06-27 02:45:27 +00:00
}
2014-06-23 14:13:07 +00:00
}
2014-06-27 02:45:27 +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
{
2014-06-23 01:43:33 +00:00
IsConsole = false,
2014-06-27 02:45:27 +00:00
DefaultSize = new Size(174, 90),
2014-06-23 01:43:33 +00:00
Buttons = new[]
{
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-23 01:43:33 +00:00
{
Name = "P" + controller + " Up",
Icon = Properties.Resources.BlueUp,
2014-06-27 02:45:27 +00:00
Location = new Point(14, 12),
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
{
Name = "P" + controller + " Down",
Icon = Properties.Resources.BlueDown,
2014-06-27 02:45:27 +00:00
Location = new Point(14, 56),
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
{
Name = "P" + controller + " Left",
Icon = Properties.Resources.Back,
2014-06-27 02:45:27 +00:00
Location = new Point(2, 34),
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
{
Name = "P" + controller + " Right",
Icon = Properties.Resources.Forward,
2014-06-27 02:45:27 +00:00
Location = new Point(24, 34),
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
{
2014-06-27 02:45:27 +00:00
Name = "P" + controller + " B1",
2014-06-23 01:43:33 +00:00
DisplayName = "1",
2014-06-27 02:45:27 +00:00
Location = new Point(122, 34),
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-27 02:45:27 +00:00
{
Name = "P" + controller + " B2",
DisplayName = "2",
Location = new Point(146, 34),
Type = PadSchema.PadInputType.Boolean
}
}
};
}
2017-05-24 14:07:03 +00:00
private static PadSchema GGController(int controller)
2014-06-27 02:45:27 +00:00
{
return new PadSchema
{
IsConsole = false,
DefaultSize = new Size(174, 90),
Buttons = new[]
{
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-27 02:45:27 +00:00
{
Name = "P" + controller + " Up",
Icon = Properties.Resources.BlueUp,
Location = new Point(14, 12),
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-27 02:45:27 +00:00
{
Name = "P" + controller + " Down",
Icon = Properties.Resources.BlueDown,
Location = new Point(14, 56),
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
{
2014-06-27 02:45:27 +00:00
Name = "P" + controller + " Left",
Icon = Properties.Resources.Back,
Location = new Point(2, 34),
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-27 02:45:27 +00:00
{
Name = "P" + controller + " Right",
Icon = Properties.Resources.Forward,
Location = new Point(24, 34),
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-27 02:45:27 +00:00
{
Name = "P" + controller + " Start",
DisplayName = "S",
Location = new Point(134, 12),
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-27 02:45:27 +00:00
{
Name = "P" + controller + " B1",
2014-06-23 01:43:33 +00:00
DisplayName = "1",
2014-06-27 02:45:27 +00:00
Location = new Point(122, 34),
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
2014-06-27 02:45:27 +00:00
{
Name = "P" + controller + " B2",
DisplayName = "2",
Location = new Point(146, 34),
2014-06-23 01:43:33 +00:00
Type = PadSchema.PadInputType.Boolean
}
}
2014-06-22 15:43:45 +00:00
};
}
private static PadSchema SmsConsoleButtons()
{
return new PadSchema
{
DisplayName = "Console",
IsConsole = true,
DefaultSize = new Size(150, 50),
Buttons = new[]
{
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
{
Name = "Reset",
DisplayName = "Reset",
Location = new Point(10, 15),
Type = PadSchema.PadInputType.Boolean
},
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
{
Name = "Pause",
DisplayName = "Pause",
Location = new Point(58, 15),
Type = PadSchema.PadInputType.Boolean
}
}
};
}
private static PadSchema GGConsoleButtons()
{
return new PadSchema
{
DisplayName = "Console",
IsConsole = true,
DefaultSize = new Size(150, 50),
Buttons = new[]
{
2017-04-29 20:41:27 +00:00
new PadSchema.ButtonSchema
{
Name = "Reset",
DisplayName = "Reset",
Location = new Point(10, 15),
Type = PadSchema.PadInputType.Boolean
}
}
};
}
2014-06-22 15:43:45 +00:00
}
}