Exemplo n.º 1
0
void keyboard_init (void)
{
	task_create_gid_while (GID_LINUX_INTERFACE, sim_interface_thread,
		TASK_DURATION_INF);

	/* Install platform-specific key bindings */
#ifdef MACHINE_START_SWITCH
	sim_key_install ('1', MACHINE_START_SWITCH);
#endif
#ifdef MACHINE_BUYIN_SWITCH
	sim_key_install ('2', MACHINE_BUYIN_SWITCH);
#endif
	sim_key_install ('3', SW_LEFT_COIN);
	sim_key_install ('4', SW_CENTER_COIN);
	sim_key_install ('5', SW_RIGHT_COIN);
	sim_key_install ('6', SW_FOURTH_COIN);
	sim_key_install ('7', SW_ESCAPE);
	sim_key_install ('8', SW_DOWN);
	sim_key_install ('9', SW_UP);
	sim_key_install ('0', SW_ENTER);
	sim_key_install (',', SW_LEFT_BUTTON);
	sim_key_install ('.', SW_RIGHT_BUTTON);
#ifdef SW_COIN_DOOR_CLOSED
	sim_key_install ('-', SW_COIN_DOOR_CLOSED);
#endif
#ifdef MACHINE_TILT_SWITCH
	sim_key_install ('T', MACHINE_TILT_SWITCH);
#endif
#ifdef MACHINE_SLAM_TILT_SWITCH
	sim_key_install ('!', MACHINE_SLAM_TILT_SWITCH);
#endif
#ifdef MACHINE_LAUNCH_SWITCH
	sim_key_install (' ', MACHINE_LAUNCH_SWITCH);
#else
	sim_key_install_shooter (' ');
#endif
#if MAX_DEVICES > 1
	sim_key_install_node ('w', &device_nodes[1]);
#endif
#if MAX_DEVICES > 2
	sim_key_install_node ('e', &device_nodes[2]);
#endif
#if MAX_DEVICES > 3
	sim_key_install_node ('r', &device_nodes[3]);
#endif
#if MAX_DEVICES > 4
	sim_key_install_node ('t', &device_nodes[4]);
#endif

}
Exemplo n.º 2
0
/** Called just before the trough kicks a ball when it ought to
go to the autofire lane rather than the manual plunger. */
void autofire_open_for_trough (void)
{
    /* Do not proceed if another ball is in the process of
    being autofired. */
    while (task_find_gid (GID_AUTOFIRE_HANDLER))
    {
        dbprintf ("Autofire waiting for previous.\n");
        /* TODO : these sleeps should be done in the spawned task,
        not in the interface */
        task_sleep_sec (1);
    }
    dbprintf ("Shooter divertor open to catch\n");
    shooter_div_delay_time = 0;
    shooter_div_open_time = 2;
    task_create_gid_while (GID_AUTOFIRE_HANDLER, autofire_monitor, TASK_DURATION_INF);
    task_sleep (TIME_500MS);
}