void pitstop_award_deff(void) { // must happen in the deff so it doesn't crash in test mode due to uninitialised list of items determine_allowable_pitstop_awards(); U8 pitstop_award_items_remaining; for (pitstop_award_items_remaining = PITSTOP_AWARD_ITEMS; pitstop_award_items_remaining >= 1 ; pitstop_award_items_remaining--) { dbprintf("remaining items: %d\n", pitstop_award_items_remaining); pitstop_award_draw(); task_sleep_sec(1); if (pitstop_award_items_remaining >= 3) { sample_start (SND_TRAFFIC_ZOOM_02, SL_4S); eliminate_pitstop_award(); } else if (pitstop_award_items_remaining == 2) { sample_start (SND_TRAFFIC_ZOOM_05, SL_4S); eliminate_pitstop_award(); } else if (pitstop_award_items_remaining == 1) { sample_start (SND_TRAFFIC_ZOOM_03, SL_4S); } dmd_invert_page (dmd_low_buffer); dmd_show_low(); task_sleep(TIME_100MS); } // find the one remaining award pitstop_award = DISABLED_AWARD; for (pitstop_award_index = 0; pitstop_award_index < PITSTOP_AWARD_ITEMS; pitstop_award_index++) { if (selected_pitstop_awards[pitstop_award_index] != DISABLED_AWARD) { pitstop_award = selected_pitstop_awards[pitstop_award_index]; } } dbprintf("%s\n", pitstop_award_options_titles[pitstop_award]); // flash the remaining award dmd_alloc_pair (); dmd_clean_page_low (); font_render_string_center (&font_var5, 64, 16, pitstop_award_options_titles[pitstop_award]); dmd_show_low (); dmd_copy_low_to_high (); dmd_invert_page (dmd_low_buffer); deff_swap_low_high (10, TIME_100MS); deff_exit (); // ball will be ejected from popper soon }
static inline void flash_and_exit_deff2 (U8 flash_count, task_ticks_t flash_delay) { dmd_alloc_pair (); dmd_clean_page_low (); font_render_string_center (&font_bitoutline, 64, 16, sprintf_buffer); dmd_show_low (); dmd_copy_low_to_high (); dmd_invert_page (dmd_low_buffer); deff_swap_low_high (flash_count, flash_delay); deff_exit (); }
void shoot_power_payoff_deff (void) { dmd_alloc_pair (); dmd_clean_page_low (); font_render_string_center (&font_fireball, 64, 9, "SHOOT"); font_render_string_center (&font_fireball, 64, 24, "POWER PAYOFF"); dmd_show_low (); dmd_copy_low_to_high (); dmd_invert_page (dmd_low_buffer); deff_swap_low_high (20, TIME_100MS); deff_exit (); }
static inline void show_sonny_jim (void) { amode_page_start (); dmd_alloc_pair_clean (); /* Draw a 'white' background for the transition */ dmd_invert_page (dmd_low_buffer); dmd_invert_page (dmd_high_buffer); dmd_show2 (); /* sonny_jim should emerge from the bottom */ dmd_sched_transition (&trans_scroll_up); dmd_alloc_pair (); frame_draw (IMG_SONNY_JIM); /* Start the transition */ dmd_show2 (); /* Paint the text on */ dmd_map_overlay (); dmd_clean_page_low (); font_render_string_right (&font_var5, 126, 7, "NOT AN ORDINARY DAY OR"); font_render_string_right (&font_var5, 122, 18, "AN ORDINARY PLAYER"); dmd_text_outline (); dmd_alloc_pair (); frame_draw (IMG_SONNY_JIM); dmd_overlay_outline (); dmd_show2 (); task_create_anon (amode_talking_task); amode_sleep_sec (4); /* Now just draw sonny_jim again */ dmd_alloc_pair (); frame_draw (IMG_SONNY_JIM); dmd_show2 (); /* Exit stage right */ dmd_sched_transition (&trans_scroll_down); /* Draw a 'white' background for the transition again */ dmd_alloc_pair_clean (); dmd_invert_page (dmd_low_buffer); dmd_invert_page (dmd_high_buffer); dmd_show2 (); dmd_sched_transition (&trans_bitfade_slow); }
static inline void show_bcd (void) { amode_page_start (); dmd_sched_transition (&trans_random_boxfade); dmd_alloc_pair_clean (); /* Draw a 'white' background for the transition */ dmd_invert_page (dmd_low_buffer); dmd_invert_page (dmd_high_buffer); dmd_show2 (); /* bcd should emerge from the right */ dmd_sched_transition (&trans_scroll_left); dmd_alloc_pair (); frame_draw (IMG_BCD); /* Start the transition */ dmd_show2 (); /* Paint the text on */ dmd_map_overlay (); dmd_clean_page_low (); font_render_string_center (&font_var5, 38, 10, "HEY ITS ONLY"); font_render_string_center (&font_steel, 38, 20, "PINBALL"); dmd_text_outline (); dmd_alloc_pair (); frame_draw (IMG_BCD); dmd_overlay_outline (); dmd_show2 (); sound_send (SND_HEY_ITS_ONLY_PINBALL); amode_sleep_sec (3); /* Now just draw bcd again */ dmd_alloc_pair (); frame_draw (IMG_BCD); dmd_show2 (); /* Exit stage right */ dmd_sched_transition (&trans_scroll_right); /* Draw a 'white' background for the transition again */ dmd_alloc_pair_clean (); dmd_invert_page (dmd_low_buffer); dmd_invert_page (dmd_high_buffer); dmd_show2 (); }
void shoot_again_deff (void) { sound_send (SND_EXTRA_BALL_BALLOON); dmd_alloc_pair (); dmd_clean_page_low (); font_render_string_center (&font_bitoutline, 64, 10, "SHOOT AGAIN"); sprintf ("PLAYER %d", player_up); font_render_string_center (&font_bitcube10, 64, 22, sprintf_buffer); dmd_show_low (); dmd_copy_low_to_high (); dmd_invert_page (dmd_low_buffer); deff_swap_low_high (30, TIME_100MS); deff_exit (); }
/** * Scroll two cars, one after the other, from left to right. * * Note: Car graphics use a white background. */ void corvette_amode_scroll_two_cars( void ) { dmd_alloc_pair(); dmd_clean_page_high(); dmd_clean_page_low(); dmd_invert_page (dmd_low_buffer); dmd_invert_page (dmd_high_buffer); dmd_show2(); task_sleep_sec(1); dmd_alloc_pair(); frame_draw (IMG_CORVETTE_1979); dmd_sched_transition (&trans_scroll_right); dmd_show2 (); dmd_alloc_pair(); dmd_clean_page_high(); dmd_clean_page_low(); dmd_invert_page (dmd_low_buffer); dmd_invert_page (dmd_high_buffer); dmd_sched_transition (&trans_scroll_right); dmd_show2(); task_sleep_sec(1); dmd_alloc_pair(); frame_draw (IMG_CORVETTE_1986); dmd_sched_transition (&trans_scroll_right); dmd_show2 (); dmd_alloc_pair(); dmd_clean_page_high(); dmd_clean_page_low(); dmd_invert_page (dmd_low_buffer); dmd_invert_page (dmd_high_buffer); dmd_sched_transition (&trans_scroll_right); dmd_show2(); task_sleep_sec(1); }
/** * Generate a text outline. * * On input, provide a mono DMD page in the low-mapped buffer. The * general use case is for this page to have only fonts on it. * * On output, the high mapped buffer will contain the outline mask. * This page can be ANDed to blacken the pixels needed to form * the outline. */ void dmd_text_outline (void) { dmd_shadow (); dmd_invert_page (dmd_high_buffer); dmd_flip_low_high (); }