Atari 2600 - vritual pad and mnemonics for paddles

This commit is contained in:
adelikat 2017-06-28 14:27:15 -05:00
parent 82d03dc3e9
commit f5cb35a862
3 changed files with 39 additions and 10 deletions

View File

@ -79,6 +79,8 @@ namespace BizHawk.Client.Common
["R3"] = '>', ["R3"] = '>',
["Button"] = 'B', ["Button"] = 'B',
["Button 1"] = '1',
["Button 2"] = '2',
["B1"] = '1', ["B1"] = '1',
["B2"] = '2', ["B2"] = '2',

View File

@ -101,17 +101,44 @@ namespace BizHawk.Client.EmuHawk
{ {
DisplayName = "Player " + controller, DisplayName = "Player " + controller,
IsConsole = false, IsConsole = false,
DefaultSize = new Size(174, 74), DefaultSize = new Size(334, 94),
MaxSize = new Size(174, 74), MaxSize = new Size(334, 94),
Buttons = new[] Buttons = new[]
{ {
new PadSchema.ButtonSchema new PadSchema.ButtonSchema
{ {
Name = "P" + controller + " Button", Name = "P" + controller + " Button 1",
DisplayName = "B", DisplayName = "B1",
Location = new Point(124, 24), Location = new Point(5, 24),
Type = PadSchema.PadInputType.Boolean Type = PadSchema.PadInputType.Boolean
} },
new PadSchema.ButtonSchema
{
Name = "P" + controller + " Button 2",
DisplayName = "B2",
Location = new Point(5, 48),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonSchema
{
Name = "P" + controller + " Paddle X 1",
DisplayName = "Paddle X 1",
Location = new Point(55, 17),
Type = PadSchema.PadInputType.FloatSingle,
TargetSize = new Size(128, 69),
MaxValue = 16266,
MinValue = 0
},
new PadSchema.ButtonSchema
{
Name = "P" + controller + " Paddle X 2",
DisplayName = "Paddle X 2",
Location = new Point(193, 17),
Type = PadSchema.PadInputType.FloatSingle,
TargetSize = new Size(128, 69),
MaxValue = 16266,
MinValue = 0
},
} }
}; };
} }

View File

@ -134,16 +134,16 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
private static readonly string[] BaseDefinition = private static readonly string[] BaseDefinition =
{ {
"Button 0", "Button 1",
"Button 1" "Button 2"
}; };
public byte Read(IController c) public byte Read(IController c)
{ {
byte result = 0xF0; byte result = 0xF0;
if (c.IsPressed($"P{PortNum} Button 0")) { result &= 0x70; } if (c.IsPressed($"P{PortNum} Button 1")) { result &= 0x70; }
if (c.IsPressed($"P{PortNum} Button 1")) { result &= 0xB0; } if (c.IsPressed($"P{PortNum} Button 2")) { result &= 0xB0; }
return result; return result;
} }