Example #1
0
CALLSET_ENTRY (gumball, ball_search)
{
	/* TODO : when ball searching at game start, see if the
	extra balls are in the gumball and try to release 1. */
	//if (sw_gumball_enter = enabled for 2 seconds and trough + lock = 2, then empty
	task_recreate_gid (GID_FAR_LEFT_TROUGH_MONITOR, sw_far_left_trough_monitor);
}
Example #2
0
CALLSET_ENTRY (gumball, start_ball)
{
	task_recreate_gid (GID_FAR_LEFT_TROUGH_MONITOR, sw_far_left_trough_monitor);
	gumball_score = 0;
	gumball_collected_count = 0;
	gumball_enable_from_trough = FALSE;
	global_flag_off (GLOBAL_FLAG_SUPER_MB_RUNNING);
}
Example #3
0
CALLSET_ENTRY (trapdoor, device_update)
{
	enum trap_door_state decision = trap_door_decide ();
	if (decision != trap_door_state && trap_door_state != DISABLED)
	{
		trap_door_state = decision;
		task_recreate_gid (GID_TRAP_DOOR_PULSE, trap_door_pulse);
	}
}
Example #4
0
static void flipcode_lock_char (void)
{
    flipcode_value = (flipcode_value << 4) | (flipcode_digit & 0x0F);
    flipcode_digit = 0;
    if (flipcode_value)
    {
        task_recreate_gid (GID_FLIPCODE_ACTIVE, flipcode_active_task);
        callset_invoke (flipper_code_entered);
    }
}
Example #5
0
/**
 * Rerun all of the diagnostic tests.
 */
static void
diag_run (void)
{
	/* Create in a separate task context, to avoid
	 * stack overflow problems. */
	task_recreate_gid (GID_DIAG_RUNNING, diag_run_task);
	while (task_find_gid (GID_DIAG_RUNNING))
		task_sleep (TIME_100MS);
	barrier ();
}
Example #6
0
void flipcode_lock_char (void)
{
	if (flipcode_pos < MAX_FLIPCODE_CHARS)
	{
		flipcode_chars[flipcode_pos] = flipcode_value;
		flipcode_value = 0;
		++flipcode_pos;
		task_recreate_gid (GID_FLIPCODE_ACTIVE, flipcode_active_task);
	}
}
Example #7
0
CALLSET_ENTRY (kickback, sw_kickback)
{
	if (kickback_enabled ())
	{
		sound_start (ST_SAMPLE, SND_WHISTLE, SL_2S, PRI_GAME_QUICK3);
		task_recreate_gid (GID_KICKBACK_FINISH, kickback_finish);
	}
	else
	{
		callset_invoke (sw_left_outlane);
	}
}
Example #8
0
//called from computer award in underground.c
void comp_award_light_arrows(void) {
	flag_off (FLAG_IS_COMBOS_KILLED);
	flag_on 	(FLAG_IS_COMBO_SIDERAMP_ACTIVATED);
	flag_on 	(FLAG_IS_COMBO_LEFTRAMP_ACTIVATED);
	flag_on 	(FLAG_IS_COMBO_RIGHTRAMP_ACTIVATED);
	flag_on 	(FLAG_IS_COMBO_UNDER_ACTIVATED);
	flag_on 	(FLAG_IS_COMBO_CENTERRAMP_ACTIVATED);
	flag_on 	(FLAG_IS_COMBO_LEFTORB_ACTIVATED);
	flag_on 	(FLAG_IS_COMBO_RIGHTORB_ACTIVATED);
	all_arrow_update();
	task_recreate_gid (GID_COMBO, combo_task);
}//end of function
Example #9
0
void claw_bump_left (void) {
	if (claw_location != CLAW_LEFT){ 
				disable_interrupts ();
				claw_timer = 1;
				claw_state = CLAW_FORWARD;
				claw_location = CLAW_UNKNOWN;
				sol_disable (SOL_CLAW_RIGHT);
				sol_enable (SOL_CLAW_LEFT);
				task_recreate_gid (GID_CLAW_B_MONITOR, claw_bump_monitor);
				enable_interrupts ();
	}
}
Example #10
0
CALLSET_ENTRY (tnf, sw_left_button, sw_right_button)
{
	if (deff_get_active () == DEFF_TNF)
	{
		bounded_increment (tnf_buttons_pressed, 255);
		score_add (tnf_score, score_table[SC_100K + tnf_level]);
		tnf_x = random_scaled(10);
		tnf_y = random_scaled(3);
		task_recreate_gid (GID_TNF_SOUND, tnf_sound_task);
		if (tnf_buttons_pressed > tnf_target)
		{
			score_add (tnf_score, score_table[SC_5M]);
			task_kill_gid (GID_TNF_TIMER);
		}
	}
}
Example #11
0
void free_kick_award (void)
{
	if (free_kicks >= 250)
		return;

	free_kicks += free_kick_multiplier;
	/* TODO - adjust scoring here big time */
	score_multiple (SC_1M, free_kick_multiplier);
	if (free_kick_multiplier < 5)
	{
		free_kick_multiplier++;
		freekick_lamp_update ();
	}
	task_recreate_gid (GID_FREEKICK_TIMEOUT, free_kick_timeout_multiplier);
	sound_send (SND_KICK);
	deff_restart (DEFF_FREE_KICK);
}
Example #12
0
/** Called at game start time to see if it is OK to
 * start a game.  This routine should check that all
 * balls are accounted for, and at least 1 ball is
 * in the trough. */
bool device_check_start_ok (void)
{
	U8 truly_missing_balls;

	/* Reset any kickout locks, just in case */
	kickout_unlock_all ();

	/* If any balls are missing, don't allow the game to start
	 * without first trying a device probe.
	 *
	 * If the device probe is already in progress, then just
	 * return right away. */
	if (task_find_gid (GID_DEVICE_PROBE))
		return FALSE;

	truly_missing_balls = missing_balls;
#ifdef MACHINE_SHOOTER_SWITCH
	if (switch_poll_logical (MACHINE_SHOOTER_SWITCH))
		truly_missing_balls--;
#endif

	/* If some balls are unaccounted for, and not on the shooter,
	 * then start a device probe and a ball search.  Alert the user
	 * by displaying a message.
	 *
	 * After 3 probes, allow the game to start anyway.  However,
	 * if no balls are accounted for anywhere, then don't do that.
	 */
	if (truly_missing_balls > 0)
	{
		dbprintf ("%d balls missing.\n", truly_missing_balls);
		if ((++device_game_start_errors <= 3) || (counted_balls == 0))
		{
			task_recreate_gid (GID_DEVICE_PROBE, device_probe);
			ball_search_now ();
			deff_start (DEFF_LOCATING_BALLS);
			return FALSE;
		}
		else
			return TRUE;
	}

	/* All checks pass : OK to start game now */
	return TRUE;
}
Example #13
0
void clock_add_min (U8 min)
{
	if (clock_can_be_awarded ())
	{
		clock_min += min;
		while (clock_min >= 60)
		{
			clock_min -= 60;
			clock_hour++;
			task_recreate_gid (GID_CLOCK_DISPLAY_UPDATE, clock_display_task);
		}
		if (clock_hour >= CLK_MIDNIGHT_HOUR)
		{
			clock_hour = 12;
			clock_min = 0;
			midnight_mb_light ();
		}
	}
}
Example #14
0
void combo_hit(void ) {
	//video mode
	if (++combo_counter >= combo_vm_goal  && !flag_test (FLAG_VIDEO_MODE_ENABLED) ) {
		if (IN_TEST) 	combo_vm_goal += 2;
		else {
			#ifdef CONFIG_DIFFICULTY_LEVEL
			if (system_config.difficulty == EASY) 	combo_vm_goal += COMBO_EASY_GOAL_STEP;
			else									combo_vm_goal += COMBO_HARD_GOAL_STEP;
			#elif
													combo_vm_goal += COMBO_EASY_GOAL_STEP;
			#endif
		}//end of else

		flag_on (FLAG_VIDEO_MODE_ENABLED);
		deff_start (DEFF_VM_EFFECT);
	}
	//computer award
	else if (combo_counter >= combo_goal  && !flag_test (FLAG_IS_COMPUTER_ACTIVATED) ) {
		if (IN_TEST) 	combo_goal += 2;
		else {
			#ifdef CONFIG_DIFFICULTY_LEVEL
			if (system_config.difficulty == EASY) 	combo_goal += COMBO_EASY_GOAL_STEP;
			else									combo_goal += COMBO_HARD_GOAL_STEP;
			#elif
													combo_goal += COMBO_EASY_GOAL_STEP;
			#endif
		}//end of else

		computer_light_on(); 	//at underground.c
		deff_start (DEFF_COMBO_EFFECT);
	}
	//not at a goal yet
	else deff_start (DEFF_COMBO_EFFECT);
	// reset the task timer
	choose_random_flag_set();
	all_arrow_update();
	task_recreate_gid (GID_COMBO, combo_task);
}//end of function
Example #15
0
void gumball_divertor_open (void)
{
	task_recreate_gid (GID_GUMBALL_DIV, gumball_divertor_open_task);
}
Example #16
0
/* Set the total number of balls in play to COUNT. */
void set_ball_count (U8 count) {
	if (count <= live_balls) return;
	live_balls_wanted = count;
	task_recreate_gid (GID_SET_BALL_COUNT, set_ball_count_task);
} //end of function
Example #17
0
/**
 * Set the total number of balls in play to COUNT.
 */
void set_ball_count (U8 count)
{
	live_balls_wanted = count;
	task_recreate_gid (GID_SET_BALL_COUNT, set_ball_count_task);
}
Example #18
0
CALLSET_ENTRY (rudy, init_complete)
{
	task_recreate_gid (GID_RUDY_UPDATE, rudy_eye_update);
}
Example #19
0
void sslot_mode_init (void)
{
	sslot_award_index = 0;
	task_recreate_gid (GID_SSLOT_AWARD_ROTATE, sslot_award_rotate);
	lamp_tristate_flash (LM_SLOT_MACHINE);
}
Example #20
0
task_pid_t timer_restart (task_gid_t gid, U16 ticks, task_function_t fn)
{
	task_pid_t tp = task_recreate_gid (gid, fn);
	task_set_arg (tp, ticks);
	return (tp);
}
Example #21
0
void flipcode_advance_char (void)
{
	flipcode_value++;
	task_recreate_gid (GID_FLIPCODE_ACTIVE, flipcode_active_task);
}
Example #22
0
CALLSET_ENTRY (gumball, start_far_left_trough_monitor)
{
	task_recreate_gid (GID_FAR_LEFT_TROUGH_MONITOR, sw_far_left_trough_monitor);
}
Example #23
0
CALLSET_ENTRY (abort, sw_left_button)
{
	task_recreate_gid (GID_FLIPPER_ABORT_MONITOR, abort_monitor_task);
}
Example #24
0
void mbsave_enable (U8 secs)
{
	mbsave_timer = secs;
	task_recreate_gid (GID_MBSAVE, mbsave_task);
}
Example #25
0
CALLSET_ENTRY (device, init_complete)
{
	task_recreate_gid (GID_DEVICE_PROBE, device_probe);
	task_sleep (TIME_500MS);
}