Ejemplo n.º 1
0
Archivo: coin.c Proyecto: hydra/freewpc
/** Add a credit. */
void add_credit (void)
{
	pinio_nvram_unlock ();
	increment_credit_count ();
	csum_area_update (&coin_csum_info);
	pinio_nvram_lock ();
}
Ejemplo n.º 2
0
/** Assign an audit value directly */
void audit_assign (audit_t *aud, audit_t val)
{
	pinio_nvram_unlock ();
	(*aud) = val;
	csum_area_update (&audit_csum_info);
	pinio_nvram_lock ();
}
Ejemplo n.º 3
0
/** Resets all audits to zero */
void audit_reset (void)
{
	pinio_nvram_unlock ();
	memset (&system_audits, 0, sizeof (system_audits));
	if (sizeof (feature_audits) > 0)
		memset (&feature_audits, 0, sizeof (feature_audits));
	csum_area_update (&audit_csum_info);
	pinio_nvram_lock ();
}
Ejemplo n.º 4
0
/** Increment an audit by an arbitrary value */
void audit_add (audit_t *aud, U8 val)
{
	if (*aud < 0xFFFF - (val - 1))
	{
		pinio_nvram_unlock ();
		(*aud) += val;
		csum_area_update (&audit_csum_info);
		pinio_nvram_lock ();
	}
}
Ejemplo n.º 5
0
/** Increment an audit by 1 */
void audit_increment (audit_t *aud)
{
	if (*aud < 0xFFFF)
	{
		pinio_nvram_unlock ();
		(*aud)++;
		csum_area_update (&audit_csum_info);
		pinio_nvram_lock ();
	}
}
Ejemplo n.º 6
0
/**
 * At the end of each player's game, take the total game time for that
 * player and add it to the total game time audit.
 */
CALLSET_ENTRY (timestamp, end_player)
{
	extern U16 game_time;

	/* TODO - don't do this if the player's game was
	 * aborted early */
	pinio_nvram_unlock ();
	timestamp_add_sec (&system_audits.total_game_time, game_time);
	csum_area_update (&audit_csum_info);
	pinio_nvram_lock ();
}
Ejemplo n.º 7
0
Archivo: coin.c Proyecto: hydra/freewpc
/** Decrement the credit count by 1. */
void remove_credit (void)
{
#ifndef FREE_ONLY
	csum_area_check (&coin_csum_info);
	if (credit_count > 0)
	{
		pinio_nvram_unlock ();
		credit_count--;
		csum_area_update (&coin_csum_info);
		pinio_nvram_lock ();
	}
#endif
}
Ejemplo n.º 8
0
void preset_install (struct preset_component *comps)
{
	/* Modify all of the adjustments affected by the preset */
	pinio_nvram_unlock ();
	while (comps->nvram != NULL)
	{
		*(comps->nvram) = comps->value;
		comps++;
	}
	pinio_nvram_lock ();

	/* Update the checksums to match the new values */
	adj_modified (NULL);
}
Ejemplo n.º 9
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 ();
}