aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authoruser <user@clank>2026-09-23 16:29:47 +0200
committeruser <user@clank>2026-09-23 16:29:47 +0200
commit364ecdd32f0cecb83983ca3e4a2acaac4c3251c7 (patch)
tree137d746f1f6a53db600a1321285f1eb64acbef77 /include
parentusr: ircd - an IRC server running on the Game Boy (diff)
downloadgbos-364ecdd32f0cecb83983ca3e4a2acaac4c3251c7.tar.gz
gbos-364ecdd32f0cecb83983ca3e4a2acaac4c3251c7.tar.xz
gbos-364ecdd32f0cecb83983ca3e4a2acaac4c3251c7.zip
term: write the palette attribute for every re-rendered tile, not just the cursor's
Reported as "the nickname w00t renders with its first and last letter a different colour". It was neither the nick hash nor the Fano palette tables: the colour buffer was right, the tile pixels were right, and the tilemap ATTRIBUTE - which selects the palette - was stale. render_tile writes pixels and refreshes the attr cache, but only update_cursor_attr ever pushed an attribute into the tilemap, for the tile under the cursor. A batched write (sys_write, i.e. every puts()) renders its whole dirty span through render_tile and then updates exactly one attribute, so the rest of the line kept whatever palette its row was created with - palette 0, whose colours are white, red and cyan. Hence: ordinary white text was always fine, red and cyan were fine by luck, and green/yellow/blue/ magenta silently rendered as red or cyan. In "<w00t>" the brackets are putc'd (attribute written, w and t correct) while the nick is puts'd, so the middle "00" kept the stale palette and came out red. update_tile_attr now does that work for any (row, tile col) and term_write_end calls it for every tile it renders. update_cursor_attr is a thin wrapper. NB the wrapper MUST stay immediately after render_cursor_tile: that path falls through rather than calling, and render_tile clobbers B/C, so the row/column have to be re-read from wCurRow/wCurCol. Putting update_tile_attr there first had it inherit garbage and scribble attributes over unrelated rows - visible as yellow text in the boot log. Verified by decoding recorded frames (control-socket "record", which needs a display run - --headless produces no frames): ansi(1)'s word line now renders red/green/yellow/blue/magenta/cyan/white instead of red/red/cyan/red/cyan/ cyan/white, the per-character bar and RAINBOW! still cycle correctly, and <w00t> is uniformly blue between white brackets (was blue/red/red/blue). Pre-existing: the same capture reproduces on c9f61fc, before this session.
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions