Phase 7: DRAW screen + 3-digit counter

Add draw.c/draw.h with draw_render_counter(value): renders a 0..999
counter as 3 seven-segment-style digits, each 3 cells wide x 8 cells
tall (1 cell per segment), centered on the white DRAW screen at row 8,
columns 15-23. On segments write 0xFF bitmap + color RAM 0 (black);
off segments write 0x00 bitmap (white from $D021).

Wire into game.c:
- game_enter_draw resets draw_counter = 0 and calls draw_render_counter(0).
- game_step_draw increments draw_counter (cap 999) and re-renders each
  frame, before the existing fire-detection and fault logic.
- Flash effect: for the first 4 frames of DRAW, $D020 strobes between
  black and white, then settles to white (matches the white screen).

No audio or other behavior changes.
This commit is contained in:
ballz
2026-07-17 02:30:43 +02:00
parent a621494a21
commit a8ce56464d
4 changed files with 162 additions and 2 deletions
+20
View File
@@ -0,0 +1,20 @@
#ifndef WHACK_HARE_DRAW_H
#define WHACK_HARE_DRAW_H
// draw.h — DRAW screen counter rendering.
//
// The DRAW screen is solid white (set up by show_white_screen).
// This header exposes the per-frame counter renderer, which writes
// 3 seven-segment-style digits (each 3 cells wide × 8 cells tall,
// 1 cell per segment) into the bitmap at row 8, columns 15-23.
//
// Public API:
// draw_render_counter(value) — render the 0..999 value as a
// 3-digit counter on the white screen. Values outside 0..999
// are clamped.
void draw_render_counter(int value);
#pragma compile("draw.c")
#endif