/** * Scan the display effect table to see if any pending requests * can now be satisfied. * * This is called anytime the running display effect exits or is * stopped. */ void deff_queue_service (void) { /* Find the highest priority effect in the queue. If there is such, start it if its priority exceeds that of the currently display effect. */ struct deff_queue_entry *dq = deff_queue_find_priority (); if (dq) { const deff_t *deff = &deff_table[dq->id]; if (deff_prio < deff->prio) { dbprintf ("deff_queue_service starting %d\n", dq->id); deff_running = dq->id; dq->id = dq->timeout = 0; deff_start_task (deff); return; } } /* Delay updating background effect briefly, to allow synchronous callers to do something else */ if (task_getgid () == GID_DEFF_EXITING) { dbprintf ("deff_update delayed on exit\n"); task_sleep (TIME_133MS); } /* No queued effect can run now, so try a background update */ deff_update (); }
/** * A background task that calls all of the update functions. * * The order of the updates here is done from most important to * least important. Note that if an update request is made while * this task is running, it can cause the task to be *restarted*, so * it is possible for the logic at the bottom of the function to * be starved temporarily. */ static void effect_update_task (void) { /* Display and music are always updated, including during attract mode */ deff_update (); music_update (); /* Lamp update is used for multiplexing different meanings to playfield lamps; this only makes sense in the context of a game. */ if (in_live_game) { /* Sleep a bit to avoid starving other tasks */ task_sleep (TIME_33MS); callset_invoke (lamp_update); } /* Update the start button lamp */ if (!in_test) lamp_start_update (); task_exit (); }
CALLSET_ENTRY (sssmb, sssmb_start) { if (!global_flag_test (GLOBAL_FLAG_SSSMB_RUNNING)) { magnet_reset (); callset_invoke (mball_restart_stop); mball_jackpot_uncollected = TRUE; unlit_shot_count = 0; deff_update (); music_refresh (); global_flag_on (GLOBAL_FLAG_SSSMB_RUNNING); global_flag_on (GLOBAL_FLAG_SSSMB_RED_JACKPOT); global_flag_on (GLOBAL_FLAG_SSSMB_ORANGE_JACKPOT); global_flag_on (GLOBAL_FLAG_SSSMB_YELLOW_JACKPOT); sssmb_initial_ramps_to_divert = 1; sssmb_ramps_to_divert = 0; sssmb_jackpot_value = 20; if (!global_flag_test (GLOBAL_FLAG_SUPER_MB_RUNNING)) { callset_invoke (mball_start_3_ball); } } }