Exemplo n.º 1
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.º 2
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);
	timer_restart_free (GID_DEADEND_TO_SLOT, TIME_4S);
	//event_can_follow (camera_or_piano, slot_prox, TIME_5S);

	if (lamp_test (LM_DEAD_END))
	{
		leff_start (LEFF_RIGHT_LOOP);
		dead_end_count++;
		deff_start_sync (DEFF_DEAD_END);
		if (!flag_test (FLAG_SNAKE_READY) && single_ball_play ())
		{
			flag_on (FLAG_SNAKE_READY);
			deff_start_sync (DEFF_SNAKE_READY);
		}
		switch (dead_end_count)
		{
			case 1:
				score (SC_250K);
				timed_game_extend (15);
				break;
			case 2:
				score (SC_500K);
				timed_game_extend (20);
				break;
			case 3:
				timed_game_extend (30);
				if (extra_ball_lit_from_deadend == FALSE 
					&& can_award_extra_ball ())
				{
					score (SC_1M);
					light_easy_extra_ball ();
					extra_ball_lit_from_deadend = TRUE;
				}
				else
				{
					score (SC_10M);
				}
				dead_end_count = 0;
				break;
			default:
				score (SC_2M);
				timed_game_extend (30);
				break;
		}
		lamp_off (LM_DEAD_END);
	}
	else
	{
		deff_start (DEFF_INLANE_LIGHTS_DEAD_END);
		award_unlit_shot (SW_DEAD_END);
		score (SC_100K);
		sound_send (SND_TOWN_SQUARE_AWARD);
		timed_game_pause (TIME_3S);
	}
}
Exemplo n.º 3
0
CALLSET_ENTRY (shot, sw_right_outer_loop)
{
	if (!single_ball_play ())
		return;

	if (task_kill_gid (GID_LEFT_ORBIT_MADE)) {
		callset_invoke (left_orbit_shot);
		return;
	}

	task_create_gid1 (GID_RIGHT_ORBIT_MADE, right_orbit_task);
}
Exemplo n.º 4
0
CALLSET_ENTRY (ballsave, sw_left_outlane, sw_right_outlane, sw_outhole)
{
	if (single_ball_play () && ballsave_test_active ())
	{
		/* Here, we start a separate hidden timer to indicate
		that ballsave should occur once the ball reaches the
		trough.  It should have a long expiry time just in case
		something goes wrong.  But the ballsave lamp should not
		be forced on during this period. */
		timer_restart_free (GID_BALLSAVE_EXTENDED, TIME_7S);
	}
}
Exemplo n.º 5
0
inline static bool right_inlane_combo_check (void)
{
	if (!single_ball_play ())
		return FALSE;

	if (task_kill_gid (GID_TNF_READY))
	{
		//event_can_follow (left_ramp_exit, tnf, TIME_4S);
		timer_restart_free (GID_TNF_APPROACHING, TIME_4S);
		deff_start (DEFF_GET_READY_TO_DOINK);
		return TRUE;
	}
	else
		return FALSE;

}
Exemplo n.º 6
0
/*
 * Check if timers should be paused.
 *
 * Returns TRUE if timers should not run for some reason.
 * Returns FALSE if timers should continue to run.
 */
bool system_timer_pause (void)
{
	if (!in_game || in_bonus || !valid_playfield)
		return TRUE;

	if (timer_lock_count)
		return TRUE;

	if (global_flag_test (GLOBAL_FLAG_BALL_AT_PLUNGER) && single_ball_play ())
		return TRUE;

	if (global_flag_test (GLOBAL_FLAG_COIN_DOOR_OPENED))
		return TRUE;

	if (config_timed_game)
	{
		extern U8 timed_game_suspend_count;

		if (timer_find_gid (GID_TIMED_GAME_PAUSED))
			return TRUE;

		if (timed_game_suspend_count)
			return TRUE;
	}

	if (device_holdup_count ())
		return TRUE;

	if (ball_search_timed_out ())
		return TRUE;

	if (timer_find_gid (GID_BALLSAVE_EXTENDED))
		return TRUE;

	/* Machines can extend the meaning of timer pause by defining an
	'allow timers' event.  It should return FALSE if timers should be
	paused for some reason. */
	if (!callset_invoke_boolean (allow_timers))
		return TRUE;

#ifdef MACHINE_TZ
	if (mpf_active)
		return TRUE;
#endif

	return FALSE;
}