Пример #1
0
/**
 * See if a factory reset is needed.  The 'init_ok' event is
 * thrown and any catchers can return FALSE if a factory reset
 * should occur.  The accept button must be pressed afterwards
 * to confirm.
 */
void factory_reset_if_required (void)
{
	if (!callset_invoke_boolean (init_ok))
	{
		dmd_alloc_low_clean ();
		font_render_string_center (&font_mono5, 64, 10, "FACTORY SETTINGS");
		font_render_string_center (&font_mono5, 64, 20, "RESTORED");
		dmd_show_low ();
		factory_reset ();
		task_sleep_sec (4);
		warm_reboot ();
	}
}
Пример #2
0
void system_accept_freewpc (void)
{
	if ((freewpc_accepted[0] == ACCEPT_1) &&
		 (freewpc_accepted[1] == ACCEPT_2) &&
		 (freewpc_accepted[2] == ACCEPT_3))
		return;

#ifdef CONFIG_DMD
	dmd_alloc_low_clean ();
	font_render_string_center (&font_mono5, 64, 3, "FREEWPC");
	font_render_string_center (&font_mono5, 64, 9, "WARNING... BALLY WMS");
	font_render_string_center (&font_mono5, 64, 15, "DOES NOT SUPPORT");
	font_render_string_center (&font_mono5, 64, 21, "THIS SOFTWARE");
	font_render_string_center (&font_mono5, 64, 27, "PRESS ENTER");
	dmd_show_low ();
	wait_for_button (SW_ENTER);

	dmd_alloc_low_clean ();
	font_render_string_center (&font_mono5, 64, 3, "FREEWPC");
	font_render_string_center (&font_mono5, 64, 9, "NO WARRANTY EXISTS");
	font_render_string_center (&font_mono5, 64, 15, "ROM MAY CAUSE DAMAGE");
	font_render_string_center (&font_mono5, 64, 21, "TO REAL MACHINE");
	font_render_string_center (&font_mono5, 64, 27, "PRESS ENTER");
	dmd_show_low ();
	wait_for_button (SW_ENTER);

	dmd_alloc_low_clean ();
	font_render_string_center (&font_mono5, 64, 3, "FREEWPC");
	font_render_string_center (&font_mono5, 64, 9, "IF YOU ARE SURE YOU");
	font_render_string_center (&font_mono5, 64, 15, "WANT TO CONTINUE");
	font_render_string_center (&font_mono5, 64, 21, "PRESS ENTER TWICE");
	dmd_show_low ();
	wait_for_button (SW_ENTER);
	wait_for_button (SW_ENTER);

	dmd_alloc_low_clean ();
	dmd_show_low ();
	task_sleep_sec (1);
#endif

	pinio_nvram_unlock ();
	freewpc_accepted[0] = ACCEPT_1;
	freewpc_accepted[1] = ACCEPT_2;
	freewpc_accepted[2] = ACCEPT_3;
	pinio_nvram_lock ();

	factory_reset ();
	warm_reboot ();
}
Пример #3
0
/**
 * See if a factory reset is needed.  The 'init_ok' event is
 * thrown and any catchers can return FALSE if a factory reset
 * should occur.  The accept button must be pressed afterwards
 * to confirm.
 */
void factory_reset_if_required (void)
{
	if (!callset_invoke_boolean (init_ok))
	{
		deff_stop (DEFF_SYSTEM_RESET);
#ifdef CONFIG_DMD_OR_ALPHA
		dmd_alloc_low_clean ();
		font_render_string_center (&font_mono5, 64, 10, "FACTORY SETTINGS");
		font_render_string_center (&font_mono5, 64, 20, "RESTORED");
		dmd_show_low ();
#endif
		factory_reset ();
		task_sleep_sec (4);
		warm_reboot ();
	}
}
Пример #4
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 ();
}
Пример #5
0
/**
 * Entry point for errors that are nonrecoverable.
 * error_code is one of the values in include/system/errno.h.
 */
__noreturn__
void fatal (errcode_t error_code)
{
	new_fatal_error = TRUE;
#ifdef __m6809__
	set_stack_pointer (6133);
#endif

	/* Don't allow any more interrupts, since they might be the
	source of the error.  Since FIRQ is disabled, we can only
	do mono display at this point.   Also note that idle
	cannot run anymore, because task scheduling can't proceed
	without the system clock moving. */
	periodic_ok = 0;
	disable_interrupts ();

	/* Reset hardware outputs */
#ifdef CONFIG_GI
	pinio_write_gi (0);
#endif

	/* TODO - this whole function needs porting to Whitestar */
	/* Maybe just call platform_init again? */
#ifdef CONFIG_PLATFORM_WPC
	if (WPC_HAS_CAP (WPC_CAP_FLIPTRONIC))
		wpc_write_flippers (0);
#endif
#ifdef CONFIG_TICKET
	pinio_write_ticket (0);
#endif
	pinio_disable_flippers ();
	pinio_write_solenoid_set (0, 0);
	pinio_write_solenoid_set (1, 0);
	pinio_write_solenoid_set (2, 0);
	pinio_write_solenoid_set (3, 0);
#ifdef MACHINE_SOL_EXTBOARD1
	pinio_write_solenoid_set (5, 0);
#endif

	/* Audit the error. */
	audit_increment (&system_audits.fatal_errors);
	audit_assign (&system_audits.lockup1_addr, error_code);
	audit_assign (&system_audits.lockup1_pid_lef, task_getgid ());
	log_event (SEV_ERROR, MOD_SYSTEM, EV_SYSTEM_FATAL, error_code);

	/* Dump all debugging information */
#ifdef DEBUGGER
	dbprintf ("Fatal error %d\n", error_code);
	db_dump_all ();
#endif

	/* In native mode, exit whenever a fatal occurs.  If the
	   simulator is compiled in, let it clean up first. */
#ifdef CONFIG_SIM
	sim_exit (error_code);
#else
#ifdef CONFIG_NATIVE
	native_exit ();
	exit (error_code);
#endif
#endif

	/* Defining STOP_ON_ERROR is helpful during debugging a problem.
	Having the machine reset makes it hard to debug after the fact. */
#ifdef STOP_ON_ERROR
	while (1);
#endif

	/* Restart the system */
	warm_reboot ();
}