/** 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 (); }
/** 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 (); }
/** Add a credit. */ void add_credit (void) { pinio_nvram_unlock (); increment_credit_count (); csum_area_update (&coin_csum_info); pinio_nvram_lock (); }
/** 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 (); }
/** 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 (); } }
/** 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 (); } }
/** * 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 (); }
/** 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 }
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); }
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 (); }