Vectrex: fix analog controller

This commit is contained in:
alyosha-tas 2019-12-30 17:59:19 -05:00
parent 6a68c7f521
commit 5fcc13f5ed
2 changed files with 3 additions and 3 deletions

View File

@ -43,9 +43,9 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex
if (ControllerDefinition.Name == "Vectrex Analog Controller")
{
// joystick position is based on pot reading
joy1_LR = (byte)(Math.Floor(controller.GetFloat("P1 Stick X")) + 128);
joy1_LR = (byte)(255 - (Math.Floor(controller.GetFloat("P1 Stick X")) + 128));
joy1_UD = (byte)(Math.Floor(controller.GetFloat("P1 Stick Y")) + 128);
joy2_LR = (byte)(Math.Floor(controller.GetFloat("P2 Stick X")) + 128);
joy2_LR = (byte)(255 - (Math.Floor(controller.GetFloat("P2 Stick X")) + 128));
joy2_UD = (byte)(Math.Floor(controller.GetFloat("P2 Stick Y")) + 128);
}
else

View File

@ -84,7 +84,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex
.Select(b => "P" + PortNum + " " + b)
.ToList(),
FloatControls = { "P" + PortNum + " Stick X", "P" + PortNum + " Stick Y" },
FloatRanges = { new[] { 127.0f, 0, -128.0f }, new[] { -128.0f, 0, 127.0f } }
FloatRanges = { new[] { -128.0f, 0, 127.0f }, new[] { -128.0f, 0, 127.0f } }
};
}