Пример #1
0
		static void ConvertLightgun(IController c, InputState s)
		{
			s.ClearAllInput();
			ConvertConsoleButtons7800(c, s);
			ConvertTrigger(c, s, 0);
			ConvertTrigger(c, s, 1);
			s.RaiseLightgunPos(0, (int)c.GetFloat("P1 VPos"), (int)c.GetFloat("P1 HPos"));
			s.RaiseLightgunPos(1, (int)c.GetFloat("P2 VPos"), (int)c.GetFloat("P2 HPos"));
		}
Пример #2
0
		static void ConvertBoosterGrip(IController c, InputState s)
		{
			s.ClearAllInput();
			ConvertConsoleButtons(c, s);
			ConvertDirections(c, s, 0);
			ConvertDirections(c, s, 1);
			// weird mapping is intentional
			s.RaiseInput(0, MachineInput.Fire, c["P1 Trigger"]);
			s.RaiseInput(0, MachineInput.Fire2, c["P1 Trigger 2"]);
			s.RaiseInput(1, MachineInput.Fire2, c["P1 Trigger 3"]);
			s.RaiseInput(1, MachineInput.Fire, c["P2 Trigger"]);
			s.RaiseInput(2, MachineInput.Fire2, c["P2 Trigger 2"]);
			s.RaiseInput(3, MachineInput.Fire2, c["P2 Trigger 3"]);
		}
Пример #3
0
		static void ConvertProLineJoystick(IController c, InputState s)
		{
			s.ClearAllInput();
			ConvertConsoleButtons7800(c, s);
			ConvertDirections(c, s, 0);
			ConvertDirections(c, s, 1);
			s.RaiseInput(0, MachineInput.Fire, c["P1 Trigger"]);
			s.RaiseInput(0, MachineInput.Fire2, c["P1 Trigger 2"]);
			s.RaiseInput(1, MachineInput.Fire, c["P2 Trigger"]);
			s.RaiseInput(1, MachineInput.Fire2, c["P2 Trigger 2"]);
		}
Пример #4
0
		static void ConvertKeypad(IController c, InputState s)
		{
			s.ClearAllInput();
			ConvertConsoleButtons(c, s);
			for (int i = 0; i < 4; i++)
			{
				string ps = string.Format("P{0} ", i + 1);
				s.RaiseInput(i, MachineInput.NumPad1, c[ps + "Keypad1"]);
				s.RaiseInput(i, MachineInput.NumPad2, c[ps + "Keypad2"]);
				s.RaiseInput(i, MachineInput.NumPad3, c[ps + "Keypad3"]);
				s.RaiseInput(i, MachineInput.NumPad4, c[ps + "Keypad4"]);
				s.RaiseInput(i, MachineInput.NumPad5, c[ps + "Keypad5"]);
				s.RaiseInput(i, MachineInput.NumPad6, c[ps + "Keypad6"]);
				s.RaiseInput(i, MachineInput.NumPad7, c[ps + "Keypad7"]);
				s.RaiseInput(i, MachineInput.NumPad8, c[ps + "Keypad8"]);
				s.RaiseInput(i, MachineInput.NumPad9, c[ps + "Keypad9"]);
				s.RaiseInput(i, MachineInput.NumPadMult, c[ps + "KeypadA"]);
				s.RaiseInput(i, MachineInput.NumPad0, c[ps + "Keypad0"]);
				s.RaiseInput(i, MachineInput.NumPadHash, c[ps + "KeypadP"]);
			}
		}
Пример #5
0
		static void ConvertDriving(IController c, InputState s)
		{
			s.ClearAllInput();
			ConvertConsoleButtons(c, s);
			ConvertTrigger(c, s, 0);
			ConvertTrigger(c, s, 1);
			s.RaiseInput(0, drvlut[(int)c.GetFloat("P1 Driving")], true);
			s.RaiseInput(1, drvlut[(int)c.GetFloat("P2 Driving")], true);
		}
Пример #6
0
		static void ConvertJoystick(IController c, InputState s)
		{
			s.ClearAllInput();
			ConvertConsoleButtons(c, s);
			ConvertDirections(c, s, 0);
			ConvertDirections(c, s, 1);
			ConvertTrigger(c, s, 0);
			ConvertTrigger(c, s, 1);
		}
Пример #7
0
		static void ConvertPaddles(IController c, InputState s)
		{
			s.ClearAllInput();
			ConvertConsoleButtons(c, s);
			for (int i = 0; i < 4; i++)
			{
				string ps = string.Format("P{0} ", i + 1);
				ConvertTrigger(c, s, i);
				s.RaisePaddleInput(i, 700000, (int)c.GetFloat(ps + "Trigger"));
			}
		}
Пример #8
0
		static void ConvertDirections(IController c, InputState s, int p)
		{
			string ps = string.Format("P{0} ", p + 1);
			s.RaiseInput(p, MachineInput.Up, c[ps + "Up"]);
			s.RaiseInput(p, MachineInput.Down, c[ps + "Down"]);
			s.RaiseInput(p, MachineInput.Left, c[ps + "Left"]);
			s.RaiseInput(p, MachineInput.Right, c[ps + "Right"]);
		}
Пример #9
0
		static void ConvertTrigger(IController c, InputState s, int p)
		{
			string ps = string.Format("P{0} ", p + 1);
			s.RaiseInput(p, MachineInput.Fire, c[ps + "Trigger"]);
		}
Пример #10
0
		static void ConvertConsoleButtons7800(IController c, InputState s)
		{
			s.RaiseInput(0, MachineInput.Reset, c["Reset"]);
			s.RaiseInput(0, MachineInput.Select, c["Select"]);
			s.RaiseInput(0, MachineInput.Color, c["Pause"]);
		}
Пример #11
0
		static void ConvertConsoleButtons(IController c, InputState s)
		{
			s.RaiseInput(0, MachineInput.Reset, c["Reset"]);
			s.RaiseInput(0, MachineInput.Select, c["Select"]);
			s.RaiseInput(0, MachineInput.Color, c["BW"]);
			s.RaiseInput(0, MachineInput.LeftDifficulty, c["Left Difficulty"]);
			s.RaiseInput(0, MachineInput.RightDifficulty, c["Right Difficulty"]);
		}
Пример #12
0
 public InputState ReadInputState()
 {
     var inputState = new InputState(this);
     return inputState;
 }
Пример #13
0
 protected MachineBase(ILogger logger, int scanLines, int firstScanline, int fHZ, int soundSampleFreq, int[] palette, int vPitch) : this()
 {
     InputState = new InputState();
     Logger = logger;
     _Scanlines = scanLines;
     FirstScanline = firstScanline;
     FrameHZ = fHZ;
     SoundSampleFrequency = soundSampleFreq;
     Palette = palette;
     _VisiblePitch = vPitch;
 }
Пример #14
0
 public void Write(InputState inputState)
 {
     inputState.GetObjectData(this);
 }