public void Convert(IController source, LibGPGX.InputData target) { this.source = source; this.target = target; target.ClearAllBools(); foreach (var f in Converts) { f(); } this.source = null; this.target = null; }
public void Convert(IController source, LibGPGX.InputData target) { _source = source; _target = target; target.ClearAllBools(); foreach (var f in _converts) { f(); } _source = null; _target = null; }
public GPGXControlConverter(LibGPGX.InputData input, bool cdButtons) { Console.WriteLine("Genesis Controller report:"); foreach (var e in input.system) { Console.WriteLine("S:{0}", e); } foreach (var e in input.dev) { Console.WriteLine("D:{0}", e); } int player = 1; ControllerDef = new ControllerDefinition(); ControllerDef.BoolButtons.Add("Power"); ControllerDef.BoolButtons.Add("Reset"); if (cdButtons) { ControllerDef.BoolButtons.Add("Previous Disk"); ControllerDef.BoolButtons.Add("Next Disk"); } for (int i = 0; i < LibGPGX.MAX_DEVICES; i++) { switch (input.dev[i]) { case LibGPGX.INPUT_DEVICE.DEVICE_PAD3B: AddToController(i, player, Genesis3); player++; break; case LibGPGX.INPUT_DEVICE.DEVICE_PAD6B: AddToController(i, player, Genesis6); player++; break; case LibGPGX.INPUT_DEVICE.DEVICE_MOUSE: AddToController(i, player, Mouse); DoMouseAnalog(i, player); player++; break; case LibGPGX.INPUT_DEVICE.DEVICE_NONE: break; case LibGPGX.INPUT_DEVICE.DEVICE_LIGHTGUN: // supports menacers and justifiers AddToController(i, player, Lightgun); DoLightgunAnalog(i, player); player++; break; case LibGPGX.INPUT_DEVICE.DEVICE_PAD2B: case LibGPGX.INPUT_DEVICE.DEVICE_PADDLE: case LibGPGX.INPUT_DEVICE.DEVICE_SPORTSPAD: case LibGPGX.INPUT_DEVICE.DEVICE_TEREBI: throw new Exception("Master System only device? Something went wrong."); case LibGPGX.INPUT_DEVICE.DEVICE_ACTIVATOR: AddToController(i, player, Activator); player++; break; case LibGPGX.INPUT_DEVICE.DEVICE_XE_A1P: AddToController(i, player, XEA1P); DoXEA1PAnalog(i, player); player++; break; case LibGPGX.INPUT_DEVICE.DEVICE_PICO: // PICO isn't finished on the unmanaged side either throw new Exception("Sega PICO not implemented yet!"); default: throw new Exception("Unknown Genesis control device! Something went wrong."); } } ControllerDef.Name = "GPGX Genesis Controller"; }
public void Convert(IController source, LibGPGX.InputData target) { this.source = source; this.target = target; target.ClearAllBools(); foreach (var f in Converts) f(); this.source = null; this.target = null; }