Exemplo n.º 1
0
CALLSET_ENTRY (deadend, sw_dead_end)
{
	device_switch_can_follow (dead_end, slot, TIME_2S + TIME_500MS);
	event_can_follow (dead_end, camera, TIME_2S);
	event_can_follow (camera_or_piano, slot_prox, TIME_5S);
	callset_invoke (shot_deadend);
}
Exemplo n.º 2
0
/* 'Light Spiral' Lane */
CALLSET_ENTRY (lanes, sw_left_inlane_1)
{
    event_can_follow (left_or_right_inlane, either_outlane, TIME_1S);
    /* Start the spiralaward timer only if the lane has
     * just been lit */
    if (!lamp_test (LM_LEFT_INLANE1) && spiralaward_set_completed == FALSE)
    {
        callset_invoke (start_spiralaward_timer);
    }
    lamp_on (LM_LEFT_INLANE1);
    check_rollover ();
    score (SC_1K);
    event_can_follow (left_inlane_1, right_loop, TIME_3S);
}
Exemplo n.º 3
0
/** A task that manages the autolaunching of balls.
Upon entry, the autofire divertor solenoid is already pulsing
and a ball is being kicked from the trough. */
void autofire_monitor (void)
{
    /* Open the divertor to catch the ball.  Because it may be
    coming from either the trough or a ramp divert, the
    timings are variable. */
    if (shooter_div_delay_time)
        task_sleep_sec (shooter_div_delay_time);

    autofire_busy = TRUE;
    //if (autofire_full ()
    //	don't open to catch
    shooter_div_start ();
    /* TODO - If the autofire switch trips during the 'open
    time', we can abort this delay early and go ahead and
    close the divertor.  This is safe because only one
    ball can appear here at a time. */
    //task_sleep_sec (shooter_div_open_time);
    autofire_ball_catch_wait ();
    shooter_div_stop ();

    /* Wait a little longer for the ball to settle */
    task_sleep (TIME_200MS);

    /* If Right inlane -> Left ramp combo, start tnf mode */
    if (event_did_follow (left_ramp_exit, tnf) && single_ball_play ())
    {
        callset_invoke (tnf_start);
    }

    /* Wait until allowed to kickout */
    while (kickout_locks > 0)
        task_sleep (TIME_100MS);

    /* Open diverter again */
    shooter_div_start ();
    /* Wait for the diverter to fully open before firing */
    U8 timeout = 20;
    while (--timeout != 0)
        task_sleep (TIME_100MS);

    if (in_live_game && single_ball_play ())
    {
        sound_send (SND_EXPLOSION_1);
        leff_start (LEFF_STROBE_UP);
    }
    /* Say that the ball is heading into the right loop */
    timer_restart_free (GID_BALL_LAUNCH, TIME_3S);
    event_can_follow (autolaunch, right_loop, TIME_4S);
    /* Clear the magnet so we can fire a ball */
    magnet_disable_catch (MAG_RIGHT);
    /* Launch the ball */
    sol_request (SOL_AUTOFIRE);
    /* Wait for the ball to clear the divertor
     * before closing*/
    task_sleep (TIME_700MS);
    shooter_div_stop ();
    autofire_busy = FALSE;
    task_exit ();
}
Exemplo n.º 4
0
static void handle_outlane (void)
{
    /* Start a timer to tell the difference between an outlane
     * drain and a center drain when the ball reaches the trough. */
    event_can_follow (any_outlane, center_drain, TIME_7S);
    deff_start (DEFF_BALL_DRAIN_OUTLANE);

    if (!multi_ball_play ())
        leff_start (LEFF_STROBE_DOWN);
}
Exemplo n.º 5
0
/* 'Light Slot Machine' Lane */
CALLSET_ENTRY (lanes, sw_left_inlane_2)
{
    if (!lamp_test (LM_LEFT_INLANE2) && spiralaward_set_completed == FALSE)
    {
        callset_invoke(start_spiralaward_timer);
    }
    lamp_on (LM_LEFT_INLANE2);
    check_rollover ();
    score (SC_1K);
    event_can_follow (left_inlane_2, right_loop, TIME_3S);
}
Exemplo n.º 6
0
CALLSET_ENTRY (coin_door, sw_coin_door_closed)
{
	/* Be kind and ignore slam tilt switch briefly after the
	coin door is opened/closed */
	event_can_follow (sw_coin_door_closed, sw_slam_tilt, TIME_5S);

	if (switch_poll_logical (SW_COIN_DOOR_CLOSED))
		coin_door_closed ();
	else
		coin_door_opened ();
}
Exemplo n.º 7
0
/* 'Dead End' Lane */
CALLSET_ENTRY (lanes, sw_right_inlane)
{
    event_can_follow (left_or_right_inlane, either_outlane, TIME_1S);
    lamp_on (LM_RIGHT_INLANE);
    check_rollover ();
    score (SC_1K);

    /* Light Dead end if not lit */
    lamp_on (LM_DEAD_END);
    timer_restart_free (GID_TNF_READY, TIME_4S);
    //event_can_follow (right_inlane, left_ramp, TIME_4S);
}
Exemplo n.º 8
0
Arquivo: loop.c Projeto: hydra/freewpc
CALLSET_ENTRY (loop, sw_right_loop_bottom)
{
	if (event_did_follow (right_loop_top, right_loop_bottom))
	{
		award_right_loop ();
	}
	else if (event_did_follow (right_loop_bottom, right_loop_bottom))
	{
		/* Ball came out the bottom, no loop */
	}
	event_should_follow (right_loop_bottom, right_loop_top, TIME_2S);
	event_can_follow (right_loop_bottom, right_loop_bottom, TIME_2S);
}
Exemplo n.º 9
0
CALLSET_ENTRY (leftramp, sw_left_ramp_enter)
{
	if (!event_did_follow (left_ramp, left_ramp_fail))
	{
		sound_send (SND_SHUTTLE_LAUNCH);
		deff_start (DEFF_SHUTTLE_LAUNCH);
		head_divert_to_mpf ();
	}
	else
	{
		sound_send (SND_ABORT_ABORT);
	}
	event_can_follow (left_ramp, left_ramp_fail, TIME_2S);
}
Exemplo n.º 10
0
CALLSET_ENTRY (slot, dev_slot_kick_attempt)
{
	if (in_live_game)
	{
		task_sleep (TIME_200MS);
		while (kickout_locks > 0)
			task_sleep (TIME_500MS);
		/* start Slot kick -> STDM timer for combo.c */
		sound_send (SND_SLOT_KICKOUT_1);
		leff_start (LEFF_SLOT_KICKOUT);
		task_sleep (TIME_500MS);
		task_create_gid (0, slot_kick_sound);
		event_can_follow (slot_kick, outhole, TIME_1S);
	}
}
Exemplo n.º 11
0
CALLSET_ENTRY (slot, dev_slot_kick_attempt)
{
	/* TODO Hack to hold ball due to the way shot_slot_task works */
	while (deff_get_active () == DEFF_DOOR_AWARD)
		task_sleep (TIME_500MS);

	while (kickout_locks != 0)
		task_sleep (TIME_500MS);
	
	if (in_live_game)
	{
		/* start Slot kick -> STDM timer for combo.c */
		event_can_follow (slot_kick, outhole, TIME_1S);
		sound_send (SND_SLOT_KICKOUT_1);
		leff_start (LEFF_SLOT_KICKOUT);
		task_sleep (TIME_500MS);
		task_create_gid (0, slot_kick_sound);
	}
}
Exemplo n.º 12
0
CALLSET_ENTRY (tilt, sw_slam_tilt)
{
	/* Ignore slam tilt switch entirely while coin door is open,
	and configured for tournament mode.  This is to avoid inadvertent slam tilts
	while dealing with problems. */
	if (system_config.tournament_mode && !switch_poll_logical (SW_COIN_DOOR_CLOSED))
		return;

	/* Ignore right after a coin door open/close */
	if (nonball_event_did_follow (sw_coin_door_closed, sw_slam_tilt))
		return;

	/* Kill the current game */
	stop_game ();

	/* Disable coins briefly, the whole point of the slam tilt */
	event_can_follow (sw_slam_tilt, sw_coin, TIME_5S);

	/* Start the slam tilt effect */
	callset_invoke (slam_tilt);
	deff_start (DEFF_SLAM_TILT);
	leff_restart (LEFF_TILT);

	/* Audit the event */
	audit_increment (&system_audits.slam_tilts);

	/* When slamtilt penalty adjustment is enabled, remove a credit. */
	if (price_config.slamtilt_penalty)
		remove_credit ();

	while (deff_get_active () == DEFF_SLAM_TILT)
		task_sleep (TIME_66MS);

	/* TODO: wait for slam switch to become stable, to avoid
	 * endless restarts */
	 warm_reboot ();
}
Exemplo n.º 13
0
CALLSET_ENTRY (skill, sw_skill_top)
{
	event_can_follow (skill, slot, TIME_3S);
	callset_invoke (any_skill_switch);
}