示例#1
0
//sw_top_popper
CALLSET_ENTRY (top_popper, dev_top_sol_enter) {
	ball_search_monitor_stop ();

				//BACK IN FRIDGE WIZARD MODE
				if (flag_test(FLAG_BACK_IN_THE_FRIDGE_ACTIVATED)) {
					start_back_in_the_fridge ();
					task_sleep_sec(1);
					leff_start (LEFF_TOP_POPPER);
					sol_request_async(SOL_TOP_POPPER);
				}

				//EXTRABALL AWARD OR MULTIBALL START OR BOTH
				else if (flag_test(FLAG_IS_EXTRABALL_LIT)
						|| (!flag_test(FLAG_BACK_IN_THE_FRIDGE_RUNNING)
								&&	flag_test (FLAG_IS_MULTIBALL_ENABLED) )) {

						//EXTRABALL AWARD
							if (flag_test(FLAG_IS_EXTRABALL_LIT) ) {
								increment_extra_balls();
								end_extraball();
								leff_start (LEFF_EXTRABALL);
								deff_start_sync (DEFF_EXTRA_BALL_EFFECT);
								task_sleep_sec(1);
							}//end of EB

						//START MULTIBALL
							if (	!flag_test(FLAG_BACK_IN_THE_FRIDGE_RUNNING)
								&&	flag_test (FLAG_IS_MULTIBALL_ENABLED) ) {
								multiball_start();
								task_sleep_sec(1);
							}//end of multiball start

						//do for both
							leff_start (LEFF_TOP_POPPER);
							sol_request_async(SOL_TOP_POPPER);
				}//END of EB or MB

				//START VIDEO MODE
				else if (  !flag_test(FLAG_BACK_IN_THE_FRIDGE_RUNNING)
						&& !flag_test(FLAG_IS_FORTRESS_MB_RUNNING)
						&& !flag_test(FLAG_IS_MUSEUM_MB_RUNNING)
						&& !flag_test(FLAG_IS_CRYOPRISON_MB_RUNNING)
						&& !flag_test(FLAG_IS_WASTELAND_MB_RUNNING)
						&& !flag_test(FLAG_IS_DEMOTIME_RUNNING)
						&&	flag_test (FLAG_VIDEO_MODE_ENABLED) )//this is set at combos
												start_video_mode(1);

				//NOTHING SPECIAL
				else {
					score (TOP_POP_SCORE);//located in kernal/score.c
					//LIGHTING EFFECTS
					//	leff_start (LEFF_UNDERGROUND_KICKOUT);
					deff_start_sync (DEFF_TOP_POPPER_EFFECT); //if nothing special, do normal display effects
					leff_start (LEFF_TOP_POPPER);
					sol_request_async(SOL_TOP_POPPER);
				}//end of else NOTHING SPECIAL

	ball_search_monitor_start ();
}//end of function
示例#2
0
static void set_ball_count_task (void) {
	device_t *dev = device_entry (DEVNO_TROUGH);
	U8 max_live_balls;
	U8 retries;
	U8 	temp_live_balls_wanted;

	max_live_balls = live_balls;
	temp_live_balls_wanted = live_balls_wanted - live_balls;
	retries = 2;

	//first pass - quick fire balls
	MB_SERVING = TRUE;
	while (temp_live_balls_wanted) {
		temp_live_balls_wanted--;
		sol_request_async (SOL_BALLSERVE);
		task_sleep (TIME_500MS); //worked good at 700 - just giving a little margin here
		task_sleep (TIME_400MS);
		sol_request_async (MACHINE_LAUNCH_SOLENOID);
		task_sleep (TIME_500MS);//worked good at 300 - just giving a little margin here
	}//end of rapid fire serving
	MB_SERVING = FALSE;

	//check trough to see if live balls is accurate
			task_sleep (TIME_1S);
			live_balls = (5 - device_recount(device_entry (DEVNO_TROUGH)) );
			max_live_balls = live_balls;

	//if still not all balls out there, retry slower - 2 times
	// we will usually arrive at this place on a ball-saving type multiball
	//where balls are constantly draining and refiring
	//this is okay, since the refiring will slow down which is sort of a punishment to
	//the player for allowing the balls to drain so fast
	while (max_live_balls < live_balls_wanted && retries) {
		retries--;

		/* Are there enough balls in the trough to satisfy another kick request?
		 * If not, then we need to add the balls from somewhere else.*/
		if (dev->actual_count < dev->kicks_needed)	callset_invoke (trough_rescue);
		else										serve_ball_auto ();

		task_sleep (SET_BALL_COUNT_TASK_DELAY);

		/* As long as there is a ball on the shooter, wait before trying
		to continue.  This flag will clear once the shooter switch
		has cleared for a few seconds. */
		while (global_flag_test (GLOBAL_FLAG_BALL_AT_PLUNGER))
			task_sleep (TIME_133MS);

		/* See if the ball count went up, indicating success */
		if (live_balls > max_live_balls)
			max_live_balls = live_balls;
	}//end of retry section

	task_exit ();
} //end of function
示例#3
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);
}
示例#4
0
void huxley_mode_init (void) {
	huxley_suspend = FALSE;
	ball_search_monitor_stop ();
	flag_off (FLAG_IS_HUXLEY_ENABLED);
	task_kill_gid(GID_HUXLEY_REMINDER);
	huxley_mode_shots_made = 0;

	score_zero(huxley_mode_score);
	score_zero(huxley_mode_last_score);
	score_zero(huxley_mode_next_score);

	score(HUXLEY_START_SCORE);
	score_add(huxley_mode_score, score_table[HUXLEY_START_SCORE]);
	score_add(huxley_mode_next_score, score_table[HUXLEY_MODE_HIT_SCORE]);

	huxley_counter = 0; //reset for next time

	deff_start_sync (DEFF_HUXLEY_START_EFFECT);//under /kernel/deff.c
	ballsave_add_time (system_config.mode_ballsave);

	leff_start(LEFF_EYEBALL);

	sol_request_async (SOL_EJECT); //request to fire the eject sol
	task_sleep (TIME_300MS);
	set_normal_eject_killed_status (FALSE);
	ball_search_monitor_start ();

	set_dm_mode(HUXLEY_COMPLETED); //for BONUS
}//end of function
示例#5
0
void huxley_mode_init (void) {
	ball_search_monitor_stop ();
	task_kill_gid(GID_HUXLEY_REMINDER);
	flag_on (FLAG_IS_HUXLEY_RUNNING);
	huxley_mode_shots_made = 0;
	++huxley_modes_achieved;

	score_zero(huxley_mode_score);
	score_zero(huxley_mode_last_score);
	score_zero(huxley_mode_next_score);

	score(HUXLEY_START_SCORE);
	score_add(huxley_mode_score, score_table[HUXLEY_START_SCORE]);
	score_add(huxley_mode_next_score, score_table[HUXLEY_MODE_HIT_SCORE]);

	huxley_goal += (HUXLEY_EASY_GOAL * 2);
	flag_off(FLAG_IS_HUXLEY_ENABLED);

	deff_start_sync (DEFF_HUXLEY_START_EFFECT);//under /kernel/deff.c
	ballsave_add_time (5);


	leff_start(LEFF_HUXLEY);

	sol_request_async (SOL_EJECT); //request to fire the eject sol
	task_sleep (TIME_300MS);
	flag_off(FLAG_KILL_NORMAL_EJECT);
	ball_search_monitor_start ();
}//end of function
示例#6
0
CALLSET_ENTRY (plunger, sw_launch_button)
{
#ifdef INCLUDE_AUTOPLUNGER
    if (switch_poll (MACHINE_SHOOTER_SWITCH))
    {
        sol_request_async (MACHINE_LAUNCH_SOLENOID);
    }
#endif
}
示例#7
0
//Once huxley mode is enabled it is started by a huxley shot (backwards to retina scan)
void huxley_made(void){
	play_huxley_sounds();
	if (flag_test(FLAG_IS_HUXLEY_ENABLED) )		timed_mode_begin (&huxley_mode);//start mode
	else {
		score (HUXLEY_SCORE);

		deff_start_sync (DEFF_HUXLEY_INFO_EFFECT);
		sol_request_async (SOL_EJECT); //request to fire the eject sol
		task_sleep (TIME_300MS);
		flag_off(FLAG_KILL_NORMAL_EJECT);
	}//end of else
}//end of function
示例#8
0
文件: serve.c 项目: Dave2084/freewpc
/**
 * Activate the autolaunch mechanism.  A ball must already have
 * been served from the trough ; this just fires the launch
 * solenoid.
 */
static void launch_ball_task (void)
{
#ifdef HAVE_AUTO_SERVE
	if (!switch_poll_logical (MACHINE_SHOOTER_SWITCH))
		task_sleep (TIME_500MS);

	do {
		sol_request_async (MACHINE_LAUNCH_SOLENOID);
		task_sleep (LAUNCH_DELAY);
	} while (switch_poll_logical (MACHINE_SHOOTER_SWITCH));
#endif
	task_exit ();
}
示例#9
0
文件: burnin.c 项目: hydra/freewpc
void burnin_sol_thread (void)
{
	for (;;)
	{
		U8 sol;
		for (sol=0; sol < NUM_POWER_DRIVES; sol++)
		{
			if (!MACHINE_SOL_FLASHERP (sol))
			{
				sol_request_async (sol);
				task_sleep_sec (2);
			}
		}
	}
}
示例#10
0
void top_popper_video_mode_finished (void) {
	leff_start (LEFF_TOP_POPPER);
	sol_request_async(SOL_TOP_POPPER);
}//end of function