Virtualpads - fix up vectrex - add console buttons, fix analog logic
This commit is contained in:
parent
7f2e1438ba
commit
49b57bbb22
|
@ -16,25 +16,27 @@ namespace BizHawk.Client.EmuHawk
|
||||||
var port1 = vecSyncSettings.Port1;
|
var port1 = vecSyncSettings.Port1;
|
||||||
var port2 = vecSyncSettings.Port2;
|
var port2 = vecSyncSettings.Port2;
|
||||||
|
|
||||||
if (port1 == "Vectrex Digital Controller")
|
switch (port1)
|
||||||
{
|
{
|
||||||
yield return StandardController(1);
|
case "Vectrex Digital Controller":
|
||||||
|
yield return StandardController(1);
|
||||||
|
break;
|
||||||
|
case "Vectrex Analog Controller":
|
||||||
|
yield return AnalogController(1);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (port2 == "Vectrex Digital Controller")
|
switch (port2)
|
||||||
{
|
{
|
||||||
yield return StandardController(2);
|
case "Vectrex Digital Controller":
|
||||||
|
yield return StandardController(2);
|
||||||
|
break;
|
||||||
|
case "Vectrex Analog Controller":
|
||||||
|
yield return AnalogController(2);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (port1 == "Vectrex Analog Controller")
|
yield return ConsoleButtons();
|
||||||
{
|
|
||||||
yield return AnalogController(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (port2 == "Vectrex Analog Controller")
|
|
||||||
{
|
|
||||||
yield return AnalogController(2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static PadSchema StandardController(int controller)
|
private static PadSchema StandardController(int controller)
|
||||||
|
@ -48,22 +50,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
ButtonSchema.Down(14, 56, controller),
|
ButtonSchema.Down(14, 56, controller),
|
||||||
ButtonSchema.Left(2, 34, controller),
|
ButtonSchema.Left(2, 34, controller),
|
||||||
ButtonSchema.Right(24, 34, controller),
|
ButtonSchema.Right(24, 34, controller),
|
||||||
new ButtonSchema(74, 34, controller, "Button 1")
|
Button(74, 34, controller, 1),
|
||||||
{
|
Button(98, 34, controller, 2),
|
||||||
DisplayName = "1"
|
Button(122, 34, controller, 3),
|
||||||
},
|
Button(146, 34, controller, 4)
|
||||||
new ButtonSchema(98, 34, controller, "Button 2")
|
|
||||||
{
|
|
||||||
DisplayName = "2"
|
|
||||||
},
|
|
||||||
new ButtonSchema(122, 34, controller, "Button 3")
|
|
||||||
{
|
|
||||||
DisplayName = "3"
|
|
||||||
},
|
|
||||||
new ButtonSchema(146, 34, controller, "Button 4")
|
|
||||||
{
|
|
||||||
DisplayName = "4"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -73,25 +63,13 @@ namespace BizHawk.Client.EmuHawk
|
||||||
var controllerDefRanges = new AnalogControls(controller).Definition.FloatRanges;
|
var controllerDefRanges = new AnalogControls(controller).Definition.FloatRanges;
|
||||||
return new PadSchema
|
return new PadSchema
|
||||||
{
|
{
|
||||||
Size = new Size(280, 380),
|
Size = new Size(280, 300),
|
||||||
Buttons = new[]
|
Buttons = new[]
|
||||||
{
|
{
|
||||||
new ButtonSchema(74, 34, controller, "Button 1")
|
Button(74, 34, controller, 1),
|
||||||
{
|
Button(98, 34, controller, 2),
|
||||||
DisplayName = "1"
|
Button(122, 34, controller, 3),
|
||||||
},
|
Button(146, 34, controller, 4),
|
||||||
new ButtonSchema(98, 34, controller, "Button 2")
|
|
||||||
{
|
|
||||||
DisplayName = "2"
|
|
||||||
},
|
|
||||||
new ButtonSchema(122, 34, controller, "Button 3")
|
|
||||||
{
|
|
||||||
DisplayName = "3"
|
|
||||||
},
|
|
||||||
new ButtonSchema(146, 34, controller, "Button 4")
|
|
||||||
{
|
|
||||||
DisplayName = "4"
|
|
||||||
},
|
|
||||||
new AnalogSchema(2, 80, $"P{controller} Stick X")
|
new AnalogSchema(2, 80, $"P{controller} Stick X")
|
||||||
{
|
{
|
||||||
AxisRange = controllerDefRanges[0],
|
AxisRange = controllerDefRanges[0],
|
||||||
|
@ -100,5 +78,26 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static ButtonSchema Button(int x, int y, int controller, int button)
|
||||||
|
{
|
||||||
|
return new ButtonSchema(x, y, controller, $"Button {button}")
|
||||||
|
{
|
||||||
|
DisplayName = button.ToString()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static PadSchema ConsoleButtons()
|
||||||
|
{
|
||||||
|
return new ConsoleSchema
|
||||||
|
{
|
||||||
|
Size = new Size(150, 50),
|
||||||
|
Buttons = new[]
|
||||||
|
{
|
||||||
|
new ButtonSchema(10, 15, "Reset"),
|
||||||
|
new ButtonSchema(58, 15, "Power")
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue