コード例 #1
0
ファイル: search.c プロジェクト: Dave2084/freewpc
/** Run through all solenoids to try to find a ball. */
void ball_search_run (void)
{
	U8 sol;

	ball_search_count++;
	dbprintf ("Ball search %d\n", ball_search_count);

	/* Fire all solenoids.  Skip over solenoids known not to be
	pertinent to ball search.  Before starting, throw an event
	so machines can do special handling on their own. */
	callset_invoke (ball_search);
	task_sleep (TIME_200MS);

	for (sol = 0; sol < NUM_POWER_DRIVES; sol++)
	{
		if (ball_search_solenoid_ok (sol))
		{
			sol_request_async (sol);
			task_sleep (TIME_200MS);
		}

		/* If a switch triggered, stop the ball search immediately */
		if (ball_search_timer == 0)
			break;
	}
	callset_invoke (ball_search_end);
}
コード例 #2
0
ファイル: shots.c プロジェクト: CardonaPinball/freewpc
CALLSET_ENTRY (shot, sw_left_rollover, sw_middle_rollover, sw_right_rollover)
{
	if (task_kill_gid (GID_LEFT_ORBIT))
		callset_invoke (left_orbit_to_rollover_shot);
	else if (task_kill_gid (GID_RIGHT_ORBIT))
		callset_invoke (right_orbit_to_rollover_shot);
}
コード例 #3
0
ファイル: jets.c プロジェクト: SonnyJim/freewpc
CALLSET_ENTRY (jet, sw_jet)
{
	
	task_create_gid1 (GID_JET_SOUND, sw_jet_sound);
	if (global_flag_test(GLOBAL_FLAG_POWERBALL_IN_PLAY))
		jets_scored += 2;
	else
		jets_scored++;
	
	if (jets_scored >= jets_for_bonus)
	{	
		jets_level_up ();
	}

	if (timed_mode_running_p (&tsm_mode))
	{
		score (SC_500K);
		score_add (tsm_mode_total, score_table[SC_500K]);
		callset_invoke (respawn_dollar);
	}
	else
	{	
		score (SC_150K);
		/* Stop deff from restarting whilst we
		 * are showing the level up deff
		 * or when the hitch anim is running */
		if (!timer_find_gid (GID_HITCHHIKER) && !task_find_gid (GID_JETS_LEVEL_UP))
			deff_restart (DEFF_JETS_HIT);
	}
	/* Hack for when mpf_exit switch breaks */
	if (!multi_ball_play () && mpf_timer > 0)
		callset_invoke (sw_mpf_exit);
}
コード例 #4
0
ファイル: slot.c プロジェクト: SonnyJim/freewpc
static void shot_slot_door (void)
{
	flag_off (FLAG_SLOT_DOOR_LIT);
	flag_on (FLAG_PIANO_DOOR_LIT);
	callset_invoke (select_mode);
	callset_invoke (award_door_panel);
}
コード例 #5
0
ファイル: coin.c プロジェクト: hydra/freewpc
/** Increment the units counter for a particular slot. */
void add_units (U8 n)
{
	csum_area_check (&coin_csum_info);
	if (credit_count >= price_config.max_credits)
		return;

	nvram_add (unit_count, n);
	if (unit_count >= price_config.units_per_credit)
	{
		while (unit_count >= price_config.units_per_credit)
		{
			nvram_subtract (unit_count, price_config.units_per_credit);
			add_credit ();
			audit_increment (&system_audits.paid_credits);
		}
		callset_invoke (add_credits);
	}
	else
	{
#ifdef MACHINE_ADD_COIN_SOUND
		sound_send (MACHINE_ADD_COIN_SOUND);
#endif
		callset_invoke (add_partial_credits);
		announce_credits ();
	}
	csum_area_update (&coin_csum_info);
	pinio_nvram_lock ();
}
コード例 #6
0
ファイル: vmode_dragrace.c プロジェクト: hydra/freewpc
void dragrace_task( void ) {
	deff_start_sync(DEFF_DRAGRACE);
	// fire off appropriate events
	// must be done outside of the deff otherwise other deffs won't start due to deff priorities
	if (player_car_position == 100 && computer_car_position < 100) {
		callset_invoke(vmode_dragrace_won);
	} else {
		callset_invoke(vmode_dragrace_lost);
	}
	dragrace_stop();
	task_exit();
}
コード例 #7
0
ファイル: device.c プロジェクト: Dmilo/freewpc
/** Called by the trough when a ball has entered it.
 * The intent is to signal that there is one less live ball than before.
 */
void device_remove_live (void)
{
	/* If any balls were missing, and now one is rediscovered in the
	 * trough, then just hold onto it.  This condition was seen when
	 * the game thought 1 ball was in play, but 2 were on the playfield. */
	if (missing_balls > live_balls)
	{
		callset_invoke (missing_ball_found);
		missing_balls--;
	}
	else if (live_balls > 0)
	{
		/* Decrement the count of balls in play.  Now what? */
		live_balls--;
		if (in_game && !in_bonus)
		{
			/* Notify that the ball count changed */
			callset_invoke (ball_count_change);

			/* See if this qualifies as a ball drain.  Any event receiver
			can return FALSE here if it is not to be treated as a drain;
			e.g., when a ballsaver is active.  In these cases, the
			event function is also responsible for putting the ball
			back into play. */
			if (!callset_invoke_boolean (ball_drain))
				return;

			/* OK, at this point, it is a true ball drain event.
			See how many balls are in play now. */
			switch (live_balls
#ifdef DEVNO_TROUGH
				 + device_entry (DEVNO_TROUGH)->kicks_needed
#endif
				)
			{
				case 0:
					/* With zero balls in play, this is end of ball.
					This function usually does not return; it will stop just about
					every task running to reset for the next ball. */
					end_ball ();
					return;

				case 1:
					/* Multiball modes like to know when single ball play resumes. */
					callset_invoke (single_ball_play);
					break;
				default:
					break;
			}
		}
	}
}
コード例 #8
0
ファイル: db.c プロジェクト: Curbfeeler/freewpc
/**
 * Handle a breakpoint.  The system is stopped until the user forces it
 * to continue, either by pressing 'p' in the debug console, or presses
 * the Escape Button.  Interrupt-level functions continue to run while
 * paused; only regular task scheduling is paused.  In order to poll for
 * the continue, we have to invoke the switch and debugger periodic
 * functions.
 */
void bpt_hit (void)
{
	U8 key;

	db_paused = 1 - db_paused;
	if (db_paused == 1)
	{
		callset_invoke (debug_enter);
		db_tilt_flag = in_tilt;
		in_tilt = FALSE;
		bpt_display ();
	}
	else
	{
		in_tilt = db_tilt_flag;
		callset_invoke (debug_exit);
	}

	while (db_paused == 1)
	{
		if ((key = button_check (SW_ENTER)))
		{
			/* Enter = change active field */
			bpt_display ();
		}
		else if ((key = button_check (SW_UP)))
		{
			/* Up = increase field value */
			bpt_mem_addr += key * 4;
			bpt_mem_addr = (void *) (((U16)bpt_mem_addr) & 0x1FFFUL);
			bpt_display ();
		}
		else if ((key = button_check (SW_DOWN)))
		{
			/* Down = decrease field value */
			bpt_mem_addr -= key * 4;
			bpt_mem_addr = (void *) (((U16)bpt_mem_addr) & 0x1FFFUL);
			bpt_display ();
		}
		else
		{
			switch_periodic ();
			db_periodic ();
			task_runs_long ();
		}
	}
#ifdef CONFIG_DMD_OR_ALPHA
	dmd_alloc_low_clean ();
	dmd_show_low ();
#endif
}
コード例 #9
0
ファイル: autofire.c プロジェクト: Curbfeeler/freewpc
CALLSET_ENTRY (autofire, ball_search)
{
	/* The shooter divertor/autofire are both kicked here
	since there is a dependency between the two.  The main
	ball search routine is told not to kick either one of them. */
	if (switch_poll_logical (SW_AUTOFIRE2) || switch_poll_logical (SW_AUTOFIRE1))
	{
		callset_invoke (clear_autofire);
	}
	else if (feature_config.fire_when_detected_empty == YES)
	{
		callset_invoke (clear_autofire);
	}
}
コード例 #10
0
ファイル: slot.c プロジェクト: SonnyJim/freewpc
CALLSET_ENTRY (slot, dev_slot_enter)
{
	if (task_kill_gid (GID_CAMERA_SLOT_PROX_DETECT)
		 || task_kill_gid (GID_PIANO_SLOT_PROX_DETECT))
	{
		/* Proximity sensor did not trip ; must be the powerball */
		pb_detect_event (PF_PB_DETECTED);
		pb_announce ();
	}

	if (!in_live_game)
		return;
	else if (task_find_or_kill_gid (GID_DEADEND_TO_SLOT)
	 	|| task_find_or_kill_gid (GID_GUMBALL_TO_SLOT)
		|| task_find_or_kill_gid (GID_PIANO_TO_SLOT)
		|| task_find_or_kill_gid (GID_CAMERA_TO_SLOT))
	{
		/* dead end was recently hit, so ignore slot */
		/* piano was recently hit, so ignore slot */
		/* camera was recently hit, so ignore slot */
	}
	else if (event_did_follow (skill_shot, slot)
		|| skill_shot_enabled
		|| global_flag_test (GLOBAL_FLAG_SSSMB_RUNNING))
	{
		/* TODO, this may be buggy during sssmb */
		/* skill shot has been missed or ball landed in plunger lane*/
		if (timer_kill_gid (GID_SDSS_APPROACHING)) 
			callset_invoke (sdss_ready);
		callset_invoke (skill_missed);
	}
	else if (timed_mode_running_p (&sslot_mode))
	{
		//TODO If shot from lite slot lane, allow player to choose award
		shot_sslot ();
	}
	else if (can_award_door_panel () && flag_test (FLAG_SLOT_DOOR_LIT))
	{
		shot_slot_door ();
	}
	else 
	{
		shot_slot_oddchange ();
	}
	/* Sleep so the deffs can get a chance to start and stop it
	 * kicking out too early */
	task_sleep (TIME_400MS);
	
}
コード例 #11
0
ファイル: gumball.c プロジェクト: SonnyJim/freewpc
CALLSET_ENTRY (gumball, sw_gumball_enter)
{
	/* Ball has entered the gumball machine. */
	dbprintf ("Gumball entered.\n");
	gumball_enable_from_trough = FALSE;
	gumball_count++;
	if (in_live_game)
	{
		if (!multi_ball_play ())
			leff_start (LEFF_GUMBALL_STROBE);
		gumball_running = TRUE;
		gumball_collected_count++;
		award_gumball_score ();
		gumball_release ();

		if (powerball_loaded_into_gumball == TRUE)
		{
			powerball_loaded_into_gumball = FALSE;
			leff_start (LEFF_FLASH_GI2);
			callset_invoke (mball_start);
			callset_invoke (mball_start_3_ball);
			callset_invoke (powerball_in_gumball);	
			/* Do a dodgy multiball combo */
			global_flag_on (GLOBAL_FLAG_SUPER_MB_RUNNING);
			ballsave_add_time (5);
			
			if (!global_flag_test (GLOBAL_FLAG_CHAOSMB_RUNNING)
				&& !global_flag_test (GLOBAL_FLAG_SSSMB_RUNNING))
			{
				/* random_scaled (N) returns from 0 - N-1 */
				switch (random_scaled (2))
				{
					case 0:
						callset_invoke (sssmb_start);
						break;
					case 1:
						callset_invoke (chaosmb_start);
						break;
				}
			}
		}
		else
		{
			bounded_decrement (gumball_enable_count, 0);
		}
		if (!global_flag_test (GLOBAL_FLAG_SUPER_MB_RUNNING))
			deff_start (DEFF_GUMBALL);
	}
}
コード例 #12
0
ファイル: tnf.c プロジェクト: SonnyJim/freewpc
void tnf_deff (void)
{
	bool blink_on = TRUE;
	tnf_x = 0;
	tnf_y = 0;
	timer_restart_free (GID_TNF_TIMER, TIME_4S);
	while (tnf_buttons_pressed < 100 && task_find_gid (GID_TNF_TIMER))
	{
		dmd_alloc_pair_clean ();
		if (blink_on)
		{
			font_render_string_center (&font_mono5, 64, 4, "HIT FLIPPER BUTTONS");
			blink_on = FALSE;
		}
		else
			blink_on = TRUE;
		psprintf ("%d DOINK", "%d DOINKS", tnf_buttons_pressed);
		font_render_string_center (&font_term6, 60 + tnf_x, 12 + tnf_y, sprintf_buffer);
		dmd_copy_low_to_high ();
		callset_invoke (score_overlay);
		draw_progress_bar (&tnf_progress_bar);
		dmd_show2 ();
		task_sleep (TIME_66MS);
	}
	deff_exit ();
}
コード例 #13
0
CALLSET_ENTRY (clock_millions, sw_clock_target)
{
	
	if (timed_mode_running_p (&clock_millions_mode))
	{
		leff_start (LEFF_CLOCK_TARGET);
		/* Award bonus if hit 6 times */
		if (++clock_mode_hits > 5)
		{
			sound_send (SND_EXPLOSION_3);
			score (SC_20M);
			score_add (clock_mode_score, score_table[SC_20M]);
			deff_start (DEFF_CLOCK_MILLIONS_EXPLODE);
			timed_mode_end (&clock_millions_mode);
		}
		else
		{
			sound_send (SND_CLOCK_BELL);
			score (SC_5M);
			score_add (clock_mode_score, score_table[SC_5M]);	
			deff_start (DEFF_CLOCK_MILLIONS_HIT);
		}
		if (!global_flag_test (GLOBAL_FLAG_CHAOSMB_RUNNING))
			tz_clock_reverse_direction ();
		tz_clock_set_speed (clock_mode_hits);
	}
	else if (!global_flag_test (GLOBAL_FLAG_CHAOSMB_RUNNING))
	{
		callset_invoke (sw_jet_noflash);
		score (SC_50K);
		sound_send (SND_NO_CREDITS);
	}
}
コード例 #14
0
ファイル: deff.c プロジェクト: Mole23/freewpc
/**
 * Request that the background display effect be updated.
 *
 * This finds a display effect to run when nothing has been explicitly
 * started or is in the queue.  It ensures that something is always running.
 */
void deff_update (void)
{
	deffnum_t previous;

	/* If there is a transient effect running, then
	don't try anything.  We'll update the background automatically
	when the foreground exits. */
	if (deff_running && (deff_running != deff_background))
		return;

	/* Recalculate which display effect should run in the
	background */
	previous = deff_running;
	deff_prio = PRI_NULL;
	deff_background = DEFF_NULL;
	if (!in_test)
		callset_invoke (display_update);

	/* Nothing to do if it's already running */
	if (deff_background == previous)
		return;

	/* Switch to the new effect */
	deff_debug ("deff_update: %d -> %d\n", previous, deff_background);
	if (previous != DEFF_NULL)
		deff_stop (previous);
	if (deff_background != DEFF_NULL)
	{
		const deff_t *bgdeff = &deff_table[deff_background];
		deff_running = deff_background;
		deff_start_task (bgdeff);
	}
}
コード例 #15
0
ファイル: slot.c プロジェクト: CardonaPinball/freewpc
CALLSET_ENTRY (slot, dev_slot_enter)
{
	if (event_did_follow (dead_end, slot)
	 	|| event_did_follow (gumball_exit, slot)
		|| event_did_follow (piano, slot)
		|| event_did_follow (camera, slot))
	{
		/* dead end was recently hit, so ignore slot */
		/* piano was recently hit, so ignore slot */
		/* camera was recently hit, so ignore slot */
	}
	else if (event_did_follow (skill_shot, slot))
	{
		/* skill shot has been missed */
		callset_invoke (skill_missed);
	}
	else if (timed_mode_running_p (&sslot_mode))
	{
		sslot_award ();
		score (SC_10M);
		timed_mode_end (&sslot_mode);
	}
	else
	{
		score (SC_50K);
		/* Tell door.c that the slot machine was hit */
		//callset_invoke (shot_slot_machine);
		task_create_anon (shot_slot_task);
		task_sleep (TIME_500MS);
	}
}
コード例 #16
0
ファイル: special.c プロジェクト: CardonaPinball/freewpc
void special_award (void)
{
	callset_invoke (special_award);
	switch (system_config.special_award)
	{
		case FREE_AWARD_CREDIT:
			add_credit ();
			break;

		case FREE_AWARD_EB:
			increment_extra_balls ();
			break;

		case FREE_AWARD_OFF:
			break;
	}

#ifdef DEFF_SPECIAL
	deff_start (DEFF_SPECIAL);
#endif
#ifdef LEFF_SPECIAL
	leff_start (LEFF_SPECIAL);
#endif
	knocker_fire ();
	audit_increment (&system_audits.specials);
}
コード例 #17
0
void clock_millions_mode_deff (void)
{
	//U16 fno;
	for (;;)
	{
//		for (fno = IMG_CLOCK_START; fno <= IMG_CLOCK_END; fno += 2)
//		{
			dmd_alloc_pair_clean ();
	//		dmd_map_overlay ();
	//		dmd_clean_page_low ();
	
			font_render_string_center (&font_nayupixel10, 64, 5, "CLOCK MILLIONS");
			sprintf_current_score ();
			font_render_string_center (&font_quadrit, 64, 16, sprintf_buffer);
			psprintf ("SHOOT CLOCK 1 MORE TIME", "SHOOT CLOCK %d MORE TIMES", 6 - clock_mode_hits);
			font_render_string_center (&font_var5, 64, 27, sprintf_buffer);
			sprintf ("%d", clock_millions_mode_timer);
			font_render_string (&font_var5, 2, 2, sprintf_buffer);
			font_render_string_right (&font_var5, 126, 2, sprintf_buffer);
	//		dmd_text_outline ();
		//	dmd_alloc_pair ();
			//frame_draw (fno);
			dmd_copy_low_to_high ();
			callset_invoke (score_overlay);
		//	dmd_overlay_outline ();
			dmd_show2 ();
			task_sleep (TIME_66MS);
//		}
	}
}
コード例 #18
0
ファイル: deadend.c プロジェクト: SonnyJim/freewpc
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);
}
コード例 #19
0
ファイル: mpf.c プロジェクト: SonnyJim/freewpc
CALLSET_ENTRY (mpf, lamp_update)
{
	lamplist_apply (LAMPLIST_MPF, lamp_off);
	lamplist_apply (LAMPLIST_MPF, lamp_flash_off);
	switch (mpf_level)
	{
		case 0:
			lamp_flash_on (LM_MPF_100K);
			break;
		case 1:
			lamp_on (LM_MPF_100K);
			lamp_flash_on (LM_MPF_200K);
			break;
		case 2:
			lamp_on (LM_MPF_100K);
			lamp_on (LM_MPF_200K);
			lamp_flash_on (LM_MPF_300K);
			break;
		case 3:
			lamp_flash_on (LM_MPF_100K);
			lamp_flash_on (LM_MPF_200K);
			lamp_flash_on (LM_MPF_300K);
			callset_invoke (head_enable_divert);
			break;
		default:
			break;
	}

}
コード例 #20
0
ファイル: reset.c プロジェクト: CardonaPinball/freewpc_DM
/**
 * Perform a full factory reset.
 * This can be triggered automatically at boot time if
 * certain sanity checks fail, or via a test mode option.
 */
void factory_reset (void)
{
	file_reset ();
	memset (AREA_BASE (permanent), 0, AREA_SIZE (permanent));
	callset_invoke (factory_reset);
//	timestamp_update (&system_timestamps.factory_reset);
}
コード例 #21
0
ファイル: tz_amode.c プロジェクト: SonnyJim/freewpc
static void lock_and_outhole_monitor (void)
{
	/* Wait for balls to settle/amode to start before emptying
	 * locks/outhole */
	task_sleep_sec (3);
	while (!in_live_game)
	{
		if (switch_poll (SW_LOCK_LOWER))
		{
			device_request_kick (device_entry (DEVNO_LOCK));
		}

		if (switch_poll (SW_OUTHOLE))
		{
			sol_request (SOL_OUTHOLE);
		}
		if (!switch_poll (SW_AUTOFIRE2))
		{
			callset_invoke (clear_autofire);	
		}
		/* Wait for the balls to be cleared before starting again */
		task_sleep_sec (3);
	}
	task_exit ();
}
コード例 #22
0
ファイル: unlit.c プロジェクト: SonnyJim/freewpc
void award_unlit_shot (U8 unlit_called_from)
{
    if (can_award_unlit_shot (unlit_called_from))
    {
        unlit_shot_count++;
        /* Don't allow collecting from Hitchhiker or jets */
        if (unlit_shot_count > 4 && unlit_called_from != (SW_HITCHHIKER)
                && unlit_called_from != (SW_BOTTOM_JET))
        {
            sound_send (SND_JUST_TAKEN_A_DETOUR);
            deff_start (DEFF_BACKDOOR_AWARD);
            backdoor_award_collected = TRUE;
            unlit_shot_count = 0;
            callset_invoke (award_door_panel);
        }
        /* Reset if the player hits the same unlit shot twice */
        if (unlit_called_from == unlit_called_from_stored)
            unlit_shot_count = 0;
        if (unlit_shot_count == 4 )
        {
            //TODO Check for unlit shots
            /* Hint to the player that backdoor award is ready */
            sound_send (SND_TWILIGHT_ZONE_SHORT_SOUND);
        }
        /* Store where we were called from */
        unlit_called_from_stored = unlit_called_from;
    }
}
コード例 #23
0
ファイル: reset.c プロジェクト: Dave2084/freewpc
/**
 * Called when the system hardware is fully initialized.
 * This function performs final initialization.
 */
void system_reset (void)
{
	system_accept_freewpc ();

	/* Start the reset display effect, which shows
	 * the machine name, version, etc. */
	deff_start (DEFF_SYSTEM_RESET);

	/* Perform final checks on the switch matrix to make sure
	 * it is working properly. */
	/* TODO - poll certain switches that must be operational
	 * before allowing the system to complete init. */
	opto_check ();

	/* Check various persistent variables for sane values.
	 * If there are any incompatibilities, perform a factory
	 * reset to be safe. */
	factory_reset_if_required ();

	/* Mark hardware initialization complete.  This will
	 * allow switch scanning to start, so sleep briefly
	 * to allow that to happen once. */
	sys_init_complete++;
	task_sleep (TIME_66MS);

	/* Invoke other final initializations. */
	callset_invoke (init_complete);

	/* Bump the power-up audit */
	audit_increment (&system_audits.power_ups);
	log_event (SEV_INFO, MOD_SYSTEM, EV_SYSTEM_INIT, 0);

	/* Start the attract mode effects */
	amode_start ();

	/* In test-only mode, pretend ENTER was pressed
	 * and go straight to test mode. */
#ifdef CONFIG_STRESS_TEST
	extern U8 switch_stress_enable;
	switch_stress_enable = YES;
#endif
#ifdef MACHINE_TEST_ONLY
	while (sys_init_pending_tasks != 0)
		task_sleep (TIME_66MS);
	callset_invoke (sw_enter);
#endif
}
コード例 #24
0
ファイル: autofire.c プロジェクト: SonnyJim/freewpc
/** 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 ();
}
コード例 #25
0
ファイル: multiball.c プロジェクト: SonnyJim/freewpc
CALLSET_ENTRY (multiball, dev_wire_ball_lock_enter)
{
	if (!in_game)
		return;
	if (can_lock_ball)
	{
		if (device_recount (dev) < 2)
			device_lock_ball (dev);
		bounded_increment (balls_locked, 2);
		
		head_desired = FACE_2;
		callset_invoke (check_head_face);
		
		deff_start (DEFF_BALL_LOCKED);
		callset_invoke (ball_locked);
	}
}
コード例 #26
0
ファイル: serve.c プロジェクト: CardonaPinball/freewpc
/**
 * Serve a new ball to the manual shooter lane.
 * This function is the preferred method to serve a ball to a manual
 * plunger at the beginning of a ball and after a ball lock.
 * It is not used for autoplunges.
 */
void serve_ball (void) {
#ifdef DEVNO_TROUGH
	valid_playfield = FALSE;
	callset_invoke (serve_ball);
	effect_update_request ();
	device_request_kick (device_entry (DEVNO_TROUGH));
#endif /* DEVNO_TROUGH */
} //end of function
コード例 #27
0
ファイル: jets.c プロジェクト: hydra/freewpc
CALLSET_ENTRY (jet, sw_jet)
{
	/* Hack for when mpf_exit switch breaks */
	if (!multi_ball_play () && mpf_timer > 0)
		callset_invoke (sw_mpf_exit);
	
	if (global_flag_test(GLOBAL_FLAG_POWERBALL_IN_PLAY))
		jets_scored += 2;
	else
		jets_scored++;
	
	if (jets_scored >= jets_for_bonus)
	{	
		bounded_increment (jets_bonus_level, 50);
		jets_for_bonus += 5;
		award_unlit_shot (SW_BOTTOM_JET);
		sound_send (SND_GLASS_BREAKS);
		task_sleep (TIME_500MS);
		/* jetscore is used rather than score_deff_get 
		 * because it's likely another score would of
		 * happened */
		if (jets_bonus_level < 3)
		{
			score (SC_1M);
			jetscore = 1;
		}
		else if (jets_bonus_level < 5)
		{
			score (SC_5M);
			jetscore = 5;
		}
		else if (jets_bonus_level < 7)
		{
			score (SC_10M);
			jetscore = 10;
		}
		if (!timer_find_gid (GID_HITCHHIKER))
			deff_start (DEFF_JETS_LEVEL_UP);
	}

	if (timed_mode_running_p (&tsm_mode))
	{
		score (SC_500K);
		score_add (tsm_mode_total, score_table[SC_500K]);
	}
	else
	{	
		score (SC_150K);
		/* Stop deff from restarting whilst we
		 * are showing the level up deff
		 * or when the hitch anim is running */
		if ((jets_scored <= jets_for_bonus) 
			&& (!timer_find_gid (GID_HITCHHIKER)))
			deff_restart (DEFF_JETS_HIT);
	}
	
	task_create_gid1 (GID_JET_SOUND, sw_jet_sound);
}
コード例 #28
0
ファイル: pause.c プロジェクト: Curbfeeler/freewpc
void mute_and_pause_stop (void)
{
	task_kill_gid (GID_MUTE_AND_PAUSE);
	music_enable ();
	kickout_unlock (KLOCK_USER);
	lamp_off (LM_BUY_IN_BUTTON);
	flipper_hold_off ();
	callset_invoke (machine_unpaused);
}
コード例 #29
0
ファイル: trivial.c プロジェクト: CardonaPinball/freewpc
CALLSET_ENTRY (trivial, sw_plunger)
{
	if (!switch_poll_logical (SW_PLUNGER))
	{
		sample_start (SND_BURNOUT_01, SL_2S);
		// @TODO leff_start (LEFF_SHOOTER);
	}
	callset_invoke (sw_shooter);
}
コード例 #30
0
ファイル: trivial.c プロジェクト: Dave2084/freewpc
CALLSET_ENTRY (trivial, sw_right_plunger)
{
	if (!switch_poll_logical (SW_RIGHT_PLUNGER))
	{
		sample_start (SND_PLUNGE, SL_2S);
		leff_start (LEFF_SHOOTER);
	}
	callset_invoke (sw_shooter);
}