Beispiel #1
0
/** 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 ();
}
Beispiel #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 ();
}
Beispiel #3
0
/** Add a credit. */
void add_credit (void)
{
	pinio_nvram_unlock ();
	increment_credit_count ();
	csum_area_update (&coin_csum_info);
	pinio_nvram_lock ();
}
Beispiel #4
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 ();
}
Beispiel #5
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 ();
	}
}
Beispiel #6
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 ();
	}
}
Beispiel #7
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 ();
}
Beispiel #8
0
/** 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
}