diff options
| author | user <user@clank> | 2026-07-16 15:35:07 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-07-16 15:35:07 +0200 |
| commit | 61c9595901b86ca60eaeb9a65db6a7ddb1309976 (patch) | |
| tree | 4789a7c3478d36dce292996c2d120cc1eb860c16 /src/hram.asm | |
| parent | font: full mixed-case + punctuation glyph set (not uppercase-only) (diff) | |
| download | gbos-61c9595901b86ca60eaeb9a65db6a7ddb1309976.tar.gz gbos-61c9595901b86ca60eaeb9a65db6a7ddb1309976.tar.xz gbos-61c9595901b86ca60eaeb9a65db6a7ddb1309976.zip | |
term: cursor + O(1) line scrolling
Rework the terminal from a static one-tile-per-screen-position model to
LINE-BOUND tiles with an assign[] indirection, so scrolling is cheap:
- Each line-slot L owns the 20 VRAM tiles at positions [L*20..L*20+19].
- assign[screen_row] -> line-slot; the tilemap points each screen row at
its slot's tiles.
- Scroll = rotate assign[], blank+rebuild only the new bottom line (20
tiles), and rewrite the tilemap. O(1 line) instead of rebuilding all
360 tiles.
- term_putc: printable + \n \r \b, line wrap at col 40, cursor advance
with scroll-on-overflow.
- Cursor: an underline OR'd into the current cell's tile via wCurMask
(no sprites/OAM); moving it just re-renders the old and new tiles.
- term_demo drives 24 lines through term_putc to exercise scroll+cursor.
Also fixes a vicious bug this shook out: build_tile advanced its 16-bit
glyph pointers with `ld hl, wGlyphL+1 / inc [hl]`, which CLOBBERS HL --
and HL is the live VRAM destination pointer. Whenever a glyph's 8 bytes
straddled a page boundary (common with long/varied lines) the next tile
bytes were written into WRAM at $D580+, corrupting wGlyphL/wVram/wCurRow/
wCurCol and freezing the display. Now the pointers are bumped via A so HL
is preserved. (Note: the emulator build had also been silently failing on
an unrelated debug edit, masking this for a while.)
Verified by screenshot: 24 lines scroll to show the last 18 + a visible
cursor at the "ready$" prompt; serial shell and filesystem still work.
Diffstat (limited to 'src/hram.asm')
0 files changed, 0 insertions, 0 deletions
