Stop chapter 18 contradicting itself about FILLROW and DRAWHUD
Some checks failed
akbasic CI Build / cmake_build (push) Failing after 3m23s
akbasic CI Build / sanitizers (push) Failing after 4m32s
akbasic CI Build / coverage (push) Failing after 3m41s
akbasic CI Build / akgl_build (push) Failing after 22s
akbasic CI Build / mutation_test (push) Failing after 3m29s

The assembly step still carried the pre-conversion FILLROW, without the
SOLID registration Step 8 spends a section teaching -- a reader following
the assembly order got a wall the ball passes straight through.

DRAWHUD cleared the graphics layer and never stamped the HBL$ eraser Step 6
tells you to make. Both together took the field down every time a digit in
the HUD changed. It is GRAPHIC 1, 0 and a GSHAPE of HBL$ at 0, 0, and the
difference between that and the routines that draw the field is now stated
rather than left to be discovered.

Also say where HUDTEXT is called from, which nothing did.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EwxGB6TdoVvZ11KQQME9cL
This commit is contained in:
2026-08-02 13:35:14 -04:00
parent 851b03bcf6
commit f8fc086df3

View File

@@ -531,10 +531,12 @@ with the deadline:
```basic norun
LABEL DRAWHUD
GRAPHIC 1, 1
GRAPHIC 1, 0
WIDTH 1
COLOR 0, 1 : COLOR 1, 4 : COLOR 2, 8 : COLOR 3, 5
COLOR 4, 11 : COLOR 5, 16 : COLOR 6, 6
Z$ = HBL$
GSHAPE Z$, 0, 0
BOX 5, 0, 56, 799, 57
IF HN# = 1 THEN DRAW HC#(0), HX1#(0), HY1#(0) TO HX2#(0), HY2#(0)
IF HN# < 2 THEN GOTO HUDONE
@@ -545,6 +547,16 @@ LABEL HUDONE
RETURN
```
**`GRAPHIC 1, 0` selects the graphics mode without clearing it**, and that is the whole
difference between this routine and the ones that draw the field. Clearing here would take
the field down with the old digits, so the strip is covered by Step 6's `HBL$` eraser at
`0, 0` instead — the drawing stays, so the only way to remove something is to draw over it.
`GRAPHIC 1, 1` is right in a routine that is about to redraw everything anyway.
**`HUDTEXT` builds the stroke list and `DRAWHUD` replays it**, on different frames. Call
`HUDTEXT` wherever a number in the HUD changes — level setup, a broken brick, a lost life,
a caught gem — and it sets `DHUD# = 1`, which is all it takes to get the strip drawn.
`HX1#()` to `HY2#()` are the stroke endpoints and `HC#()` is the colour source each stroke
wants, so one pass over the list draws in as many colours as it likes: labels cyan, the
score yellow, the lives green, the level red. **Seven colour sources is the ceiling**,
@@ -1793,6 +1805,10 @@ LABEL FILLROW
FOR C# = 0 TO 9
BRK#(R# * 10 + C#) = 1
BRN# = BRN# + 1
SLX# = BRKX# + C# * 72
SLY# = BRKY# + R# * 24
SLI# = (R# * 10 + C#) + 1
SOLID SLI#, SLX#, SLY#, SLX# + 68, SLY# + 16
NEXT C#
RETURN