public static void loop_inputports_m72_common() { if (Keyboard.IsPressed(Key.D5)) { ushort1 &= unchecked ((ushort)~0x0004); } else { ushort1 |= 0x0004; } if (Keyboard.IsPressed(Key.D6)) { ushort1 &= unchecked ((ushort)~0x0008); } else { ushort1 |= 0x0008; } if (Keyboard.IsPressed(Key.D1)) { ushort1 &= unchecked ((ushort)~0x0001); } else { ushort1 |= 0x0001; } if (Keyboard.IsPressed(Key.D2)) { ushort1 &= unchecked ((ushort)~0x0002); } else { ushort1 |= 0x0002; } if (Keyboard.IsPressed(Key.D)) { ushort0 &= unchecked ((ushort)~0x0001); } else { ushort0 |= 0x0001; } if (Keyboard.IsPressed(Key.A)) { ushort0 &= unchecked ((ushort)~0x0002); } else { ushort0 |= 0x0002; } if (Keyboard.IsPressed(Key.S)) { ushort0 &= unchecked ((ushort)~0x0004); } else { ushort0 |= 0x0004; } if (Keyboard.IsPressed(Key.W)) { ushort0 &= unchecked ((ushort)~0x0008); } else { ushort0 |= 0x0008; } if (Keyboard.IsPressed(Key.J)) { ushort0 &= unchecked ((ushort)~0x0080); } else { ushort0 |= 0x0080; } if (Keyboard.IsPressed(Key.K)) { ushort0 &= unchecked ((ushort)~0x0040); } else { ushort0 |= 0x0040; } if (Keyboard.IsPressed(Key.U)) { ushort0 &= unchecked ((ushort)~0x0020); } else { ushort0 |= 0x0020; } if (Keyboard.IsPressed(Key.I)) { ushort0 &= unchecked ((ushort)~0x0010); } else { ushort0 |= 0x0010; } if (Keyboard.IsPressed(Key.Right)) { ushort0 &= unchecked ((ushort)~0x0100); } else { ushort0 |= 0x0100; } if (Keyboard.IsPressed(Key.Left)) { ushort0 &= unchecked ((ushort)~0x0200); } else { ushort0 |= 0x0200; } if (Keyboard.IsPressed(Key.Down)) { ushort0 &= unchecked ((ushort)~0x0400); } else { ushort0 |= 0x0400; } if (Keyboard.IsPressed(Key.Up)) { ushort0 &= unchecked ((ushort)~0x0800); } else { ushort0 |= 0x0800; } if (Keyboard.IsPressed(Key.NumPad1)) { ushort0 &= unchecked ((ushort)~0x8000); } else { ushort0 |= 0x8000; } if (Keyboard.IsPressed(Key.NumPad2)) { ushort0 &= unchecked ((ushort)~0x4000); } else { ushort0 |= 0x4000; } if (Keyboard.IsPressed(Key.NumPad4)) { ushort0 &= unchecked ((ushort)~0x2000); } else { ushort0 |= 0x2000; } if (Keyboard.IsPressed(Key.NumPad5)) { ushort0 &= unchecked ((ushort)~0x1000); } else { ushort0 |= 0x1000; } if (Keyboard.IsPressed(Key.R)) { ushort1 &= unchecked ((ushort)~0x0010); } else { ushort1 |= 0x0010; } if (Keyboard.IsPressed(Key.T)) { ushort1 &= unchecked ((ushort)~0x0020); } else { ushort1 |= 0x0020; } }
public static void handler_ingame() { Mame.sHandle2 = GetForegroundWindow().ToString(); if (Mame.sHandle1 == Mame.sHandle2) { Mame.is_foreground = true; } else { Mame.is_foreground = false; } bool is_paused = Mame.mame_is_paused(); if (single_step) { Mame.mame_pause(true); single_step = false; } if (Mame.is_foreground) { if (Keyboard.IsPressed(Key.F3)) { cpurun(); Mame.playState = Mame.PlayState.PLAY_RESET; } if (Keyboard.IsTriggered(Key.F7)) { cpurun(); if (Keyboard.IsPressed(Key.LeftShift) || Keyboard.IsPressed(Key.RightShift)) { Mame.playState = Mame.PlayState.PLAY_SAVE; } else { Mame.playState = Mame.PlayState.PLAY_LOAD; } return; } if (Keyboard.IsTriggered(Key.F8)) { cpurun(); if (Keyboard.IsPressed(Key.LeftShift) || Keyboard.IsPressed(Key.RightShift)) { if (Mame.playState == Mame.PlayState.PLAY_RECORDRUNNING) { Mame.playState = Mame.PlayState.PLAY_RECORDEND; } else { Mame.playState = Mame.PlayState.PLAY_RECORDSTART; } } else { Mame.playState = Mame.PlayState.PLAY_REPLAYSTART; } return; } if (Keyboard.IsTriggered(Key.P)) { if (is_paused && (Keyboard.IsPressed(Key.LeftShift) || Keyboard.IsPressed(Key.RightShift))) { single_step = true; Mame.mame_pause(false); } else { Mame.mame_pause(!Mame.mame_is_paused()); } } if (Keyboard.IsTriggered(Key.F10)) { Keyboard.bF10 = true; bool b1 = Video.global_throttle; Video.global_throttle = !b1; } } }
public static void loop_inputports_pgm_standard() { if (Keyboard.IsPressed(Key.D5)) { short2 &= ~0x0001; } else { short2 |= 0x0001; } if (Keyboard.IsPressed(Key.D6)) { short2 &= ~0x0002; } else { short2 |= 0x0002; } if (Keyboard.IsPressed(Key.D1)) { short0 &= ~0x0001; } else { short0 |= 0x0001; } if (Keyboard.IsPressed(Key.D2)) { short0 &= ~0x0100; } else { short0 |= 0x0100; } if (Keyboard.IsPressed(Key.D)) { short0 &= ~0x0010; } else { short0 |= 0x0010; } if (Keyboard.IsPressed(Key.A)) { short0 &= ~0x0008; } else { short0 |= 0x0008; } if (Keyboard.IsPressed(Key.S)) { short0 &= ~0x0004; } else { short0 |= 0x0004; } if (Keyboard.IsPressed(Key.W)) { short0 &= ~0x0002; } else { short0 |= 0x0002; } if (Keyboard.IsPressed(Key.J)) { short0 &= ~0x0020; } else { short0 |= 0x0020; } if (Keyboard.IsPressed(Key.K)) { short0 &= ~0x0040; } else { short0 |= 0x0040; } if (Keyboard.IsPressed(Key.L)) { short0 &= ~0x0080; } else { short0 |= 0x0080; } if (Keyboard.IsPressed(Key.U)) { short2 &= ~0x0100; } else { short2 |= 0x0100; } if (Keyboard.IsPressed(Key.I)) { } else { } if (Keyboard.IsPressed(Key.O)) { } else { } if (Keyboard.IsPressed(Key.Right)) { short0 &= ~0x1000; } else { short0 |= 0x1000; } if (Keyboard.IsPressed(Key.Left)) { short0 &= ~0x0800; } else { short0 |= 0x0800; } if (Keyboard.IsPressed(Key.Down)) { short0 &= ~0x0400; } else { short0 |= 0x0400; } if (Keyboard.IsPressed(Key.Up)) { short0 &= ~0x0200; } else { short0 |= 0x0200; } if (Keyboard.IsPressed(Key.NumPad1)) { short0 &= ~0x2000; } else { short0 |= 0x2000; } if (Keyboard.IsPressed(Key.NumPad2)) { short0 &= ~0x4000; } else { short0 |= 0x4000; } if (Keyboard.IsPressed(Key.NumPad3)) { short0 &= unchecked ((short)~0x8000); } else { short0 |= unchecked ((short)0x8000); } if (Keyboard.IsPressed(Key.NumPad4)) { short2 &= ~0x0200; } else { short2 |= 0x0200; } if (Keyboard.IsPressed(Key.NumPad5)) { } else { } if (Keyboard.IsPressed(Key.NumPad6)) { } else { } if (Keyboard.IsPressed(Key.R)) { short2 &= ~0x0020; } else { short2 |= 0x0020; } if (Keyboard.IsPressed(Key.T)) { short2 &= ~0x0080; } else { short2 |= 0x0080; } }