2014-06-23 14:13:07 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
2016-12-06 01:33:21 +00:00
|
|
|
|
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
|
|
|
|
|
{
|
2017-07-12 19:40:10 +00:00
|
|
|
|
[Schema("SMS")]
|
2014-06-23 14:13:07 +00:00
|
|
|
|
public class SmsSchema : IVirtualPadSchema
|
2014-06-22 15:43:45 +00:00
|
|
|
|
{
|
2016-12-06 01:33:21 +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
|
|
|
|
{
|
2014-06-27 17:02:46 +00:00
|
|
|
|
yield return GGController(1);
|
2014-06-29 13:31:56 +00:00
|
|
|
|
yield return GGConsoleButtons();
|
2014-06-27 02:45:27 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
2014-06-23 14:13:07 +00:00
|
|
|
|
{
|
2014-06-27 17:02:46 +00:00
|
|
|
|
yield return StandardController(1);
|
|
|
|
|
yield return StandardController(2);
|
2014-06-29 13:31:56 +00:00
|
|
|
|
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
|
|
|
|
{
|
2019-03-18 14:06:37 +00:00
|
|
|
|
Name = $"P{controller} Up",
|
2014-06-23 01:43:33 +00:00
|
|
|
|
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
|
|
|
|
{
|
2019-03-18 14:06:37 +00:00
|
|
|
|
Name = $"P{controller} Down",
|
2014-06-23 01:43:33 +00:00
|
|
|
|
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
|
|
|
|
{
|
2019-03-18 14:06:37 +00:00
|
|
|
|
Name = $"P{controller} Left",
|
2014-06-23 01:43:33 +00:00
|
|
|
|
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
|
|
|
|
{
|
2019-03-18 14:06:37 +00:00
|
|
|
|
Name = $"P{controller} Right",
|
2014-06-23 01:43:33 +00:00
|
|
|
|
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
|
|
|
|
{
|
2019-03-18 14:06:37 +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
|
|
|
|
{
|
2019-03-18 14:06:37 +00:00
|
|
|
|
Name = $"P{controller} B2",
|
2014-06-27 02:45:27 +00:00
|
|
|
|
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
|
|
|
|
{
|
2019-03-18 14:06:37 +00:00
|
|
|
|
Name = $"P{controller} Up",
|
2014-06-27 02:45:27 +00:00
|
|
|
|
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
|
|
|
|
{
|
2019-03-18 14:06:37 +00:00
|
|
|
|
Name = $"P{controller} Down",
|
2014-06-27 02:45:27 +00:00
|
|
|
|
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
|
|
|
|
{
|
2019-03-18 14:06:37 +00:00
|
|
|
|
Name = $"P{controller} Left",
|
2014-06-27 02:45:27 +00:00
|
|
|
|
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
|
|
|
|
{
|
2019-03-18 14:06:37 +00:00
|
|
|
|
Name = $"P{controller} Right",
|
2014-06-27 02:45:27 +00:00
|
|
|
|
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
|
|
|
|
{
|
2019-03-18 14:06:37 +00:00
|
|
|
|
Name = $"P{controller} Start",
|
2014-06-27 02:45:27 +00:00
|
|
|
|
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
|
|
|
|
{
|
2019-03-18 14:06:37 +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
|
|
|
|
{
|
2019-03-18 14:06:37 +00:00
|
|
|
|
Name = $"P{controller} B2",
|
2014-06-27 02:45:27 +00:00
|
|
|
|
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
|
|
|
|
};
|
|
|
|
|
}
|
2014-06-29 13:31:56 +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
|
2014-06-29 13:31:56 +00:00
|
|
|
|
{
|
|
|
|
|
Name = "Reset",
|
|
|
|
|
DisplayName = "Reset",
|
|
|
|
|
Location = new Point(10, 15),
|
|
|
|
|
Type = PadSchema.PadInputType.Boolean
|
|
|
|
|
},
|
2017-04-29 20:41:27 +00:00
|
|
|
|
new PadSchema.ButtonSchema
|
2014-06-29 13:31:56 +00:00
|
|
|
|
{
|
|
|
|
|
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
|
2014-06-29 13:31:56 +00:00
|
|
|
|
{
|
|
|
|
|
Name = "Reset",
|
|
|
|
|
DisplayName = "Reset",
|
|
|
|
|
Location = new Point(10, 15),
|
|
|
|
|
Type = PadSchema.PadInputType.Boolean
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
2014-06-22 15:43:45 +00:00
|
|
|
|
}
|
|
|
|
|
}
|