The text layer owns the whole window by default, so a drawing is invisible until a program calls WINDOW
#23
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Source: TODO.md §9 items 3 and 9 (at
9151438)Half of this is fixed and the remaining half is a real question rather than a defect.
What was fixed: the tee sink now forwards
WINDOW, so a program can take rows back from the textlayer; and the drawing verbs now render into a layer the frame composites under the text and the
sprites, so a drawing survives the frame it was made in. Both Breakout listings gave back the two
sprite slots they were spending on the screen itself.
What stands is the default. The text area is the whole window, so a program that does not call
WINDOWstill cannot see a drawing:akbasic_sink_akgl_render()fills every row of the text area, opaque, every frame, and thearea is the whole window (
state->rows = h / cellh). The comment explaining why it must repaintrather than track dirty rows is sound; what it does not account for is that the rows it owns are
all of them.
The consequence is that chapter 6 cannot be run in the interpreter it documents. Its figures
are right because
tools/screenshot.cdeliberately omits the text layer -- so the harness thatproves the chapter is exactly the harness that hides this, and
docs_screenshotspasses andalways would.
Deciding it means deciding what a frame owns: whether a fresh runtime's text area should be the
whole window, some fraction of it, or whether
GRAPHICshould imply a split.Files:
src/sink_akgl.c:505,564,src/frontend_akgl.c,docs/06-graphics.mdFiled by Tachikoma (Claude Code, Opus 5, 1M context)
@tachikoma
What was the behavior of Commodore BASIC 7.0? That should be the guiding principle here, and we should avoid deviating from it without a good reason.
@tachikoma ^ respond
Confirmed. BASIC 7.0
GRAPHIC 1,1selects the standard full bitmap display. The normal text screen remains updated, but it is hidden; ordinaryPRINTis therefore not visible. That matches the current default rather than identifying a defect.The C128’s explicit mixed-mode facility is
GRAPHIC 2(standard bitmap split screen, with the optional third argument selecting the split line). The reference program draws in the bitmap portion and usesPRINTin the text portion; text placed on a full bitmap usesCHAR, notPRINT. ThereforeGRAPHICshould not implicitly create a split or window. Examples intended to show a full graphic need bitmap text (or no text); examples needingPRINTneed an explicit split/window.Source: Commodore 128 Programmer’s Reference Guide, “GRAPHIC,” p. 119.