void clock_millions_hit_deff (void) { U16 fno; U16 img_start = 0; U16 img_end = 0; dmd_alloc_pair_clean (); switch (random_scaled (3)) { case 0: img_start = IMG_FLASH_START; img_end = IMG_FLASH_END; break; case 1: img_start = IMG_FLASHCENTRE_START; img_end = IMG_FLASHCENTRE_END; break; case 2: img_start = IMG_FLASHLEFT_START; img_end = IMG_FLASHLEFT_END; break; } for (fno = img_start; fno < img_end; fno += 2) { U8 x = random_scaled (4); U8 y = random_scaled (4); dmd_map_overlay (); dmd_clean_page_low (); psprintf ("CLOCK HIT %d TIME", "CLOCK HIT %d TIMES", clock_mode_hits); font_render_string_center (&font_fixed6, 64 + x, 10 + y, sprintf_buffer); sprintf_score (clock_mode_score); font_render_string_center (&font_var5, 64, 21, sprintf_buffer); dmd_text_outline (); dmd_alloc_pair (); frame_draw (fno); dmd_overlay_outline (); dmd_show2 (); task_sleep (TIME_33MS); } /* Redraw it so the 'HITS' text is centred */ dmd_clean_page_low (); dmd_clean_page_high (); dmd_alloc_low (); psprintf ("CLOCK HIT %d TIME", "CLOCK HIT %d TIMES", clock_mode_hits); font_render_string_center (&font_fixed6, 64, 10, sprintf_buffer); sprintf_score (clock_mode_score); font_render_string_center (&font_var5, 64, 21, sprintf_buffer); dmd_show_low (); task_sleep_sec (2); deff_exit (); }
void dmd_alloc_low_clean (void) { dmd_alloc_low (); dmd_clean_page (dmd_low_buffer); }