Closed dansanderson closed 7 months ago
I did some experiments with the existing ESC M / ESC L feature to disable "scrolling" (scroll
bit 7) along with a new feature to disable "line pushing" (scroll
bit 6). I believe this is the right design. Enabling both of these allows PRINT to paint anywhere on the screen without pushing any text.
If we could redesign this from scratch, I'd just have ESC M / ESC L disable/enable both scrolling and line pushing together. I can't imagine wanting one and not the other. But I want this to be a backwards compatible change.
Note that PRINTing in the bottom right corner does not wrap the cursor to the top of the screen. It causes all subsequent printed characters to write to the bottom right corner. I believe this is fine: all that is needed here is predictable defined behavior, and an actual program will just locate the cursor wherever it wants to print something.
Is your feature request related to a problem? Please describe. When PRINT writes to the rightmost column, it pushes the lines below it downward. This is undesirable in cases where PRINT is being used to update text in a layout, such as in a BASIC full-screen game. It would be better in these cases to have a mode that treats the text screen more as a canvas than a terminal.
Commodore introduces the line pushing behavior in BASIC 3.5. It is not present on the C64.
As a workaround, this can currently be disabled by poking an undocumented KERNAL variable:
SETBIT $F8,6
There is not yet a published API for affecting this flag.Describe the solution you'd like Add printable escape sequences that set and unset this flag. We're almost out of available letters, but it looks like N and R are available, or we can use some punctuation characters like
,
and.
.N
: disables line pushingR
: enables line pushingEscape sequences are used to affect other editor feature bits, so this is consistent with those. For example, ESC
M
disables scrolling with cursor movement in the last row; ESCL
enables it.Describe alternatives you've considered
K@(id)
(read-write) orRKERNAL(id)
(read-only), which would be a low-profile extensible API surface for use cases for which C64 programmers are used to KERNAL variable hacking. Flags like this would be assigned an ID, documented, and made accessible through the accessor endpoint. E.g.K@(99)=1
to disable line pushing (where 99 is an arbitrary ID that we assign to the feature). We can add more feature registers as popular uses are discovered. A jump table entry would serve a similar purpose for machine code programs that integrate with the KERNAL.SETBIT $F8,6
the official way to do this, document it, add a unit test, etc.). I'm not yet inclined to consider KERNAL variables public in any way and would rather consider accessor APIs for all major tasks.In general, BASIC 10/65 does a good job of minimizing the need for PEEK/POKE tricks, and we need to continue to protect KERNAL internals while the system is still in development.
Additional context See this discussion.