diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs index 7de0858b80..1610b0dd46 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs @@ -177,6 +177,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx return LibGPGX.INPUT_SYSTEM.SYSTEM_WAYPLAY; case ControlType.Mouse: return LibGPGX.INPUT_SYSTEM.SYSTEM_MOUSE; + case ControlType.Paddle: + return LibGPGX.INPUT_SYSTEM.SYSTEM_PADDLE; } } @@ -206,7 +208,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx Activator, Teamplayer, Wayplay, - Mouse + Mouse, + Paddle, } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGXControlConverter.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGXControlConverter.cs index f439a20d38..84877f2205 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGXControlConverter.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGXControlConverter.cs @@ -118,6 +118,11 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx new CName("XE E2", LibGPGX.INPUT_KEYS.INPUT_XE_E2), }; + private static readonly CName[] Paddle = + { + new("B1", LibGPGX.INPUT_KEYS.INPUT_BUTTON1) + }; + private LibGPGX.InputData _target; private IController _source; @@ -190,6 +195,16 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx }); } + private void DoPaddleAnalog(int idx, int player) + { + ControllerDef.AddAxis($"P{player} Paddle", 0.RangeTo(255), 128); + + _converts.Add(() => + { + _target.analog[2 * idx] = (byte)_source.AxisValue($"P{player} Paddle"); + }); + } + public GPGXControlConverter(LibGPGX.InputData input, string systemId, bool cdButtons) { Console.WriteLine("Genesis Controller report:"); @@ -240,6 +255,10 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx player++; break; case LibGPGX.INPUT_DEVICE.DEVICE_PADDLE: + AddToController(i, player, Paddle); + DoPaddleAnalog(i, player); + player++; + break; case LibGPGX.INPUT_DEVICE.DEVICE_SPORTSPAD: case LibGPGX.INPUT_DEVICE.DEVICE_TEREBI: throw new NotImplementedException();