aboutsummaryrefslogtreecommitdiffstats
path: root/src/osk.asm
diff options
context:
space:
mode:
authoruser <user@clank>2026-07-18 20:41:27 +0200
committeruser <user@clank>2026-07-18 20:41:27 +0200
commit9e7d5f6e5e01b7473b84bc3449d7f8e0f78e7045 (patch)
tree5dcde624f3b366cc9244e08b0d2ca4ab35b338e2 /src/osk.asm
parentkernel: a real timer source (64 Hz tick IRQ) + uptime(1) (diff)
downloadgbos-9e7d5f6e5e01b7473b84bc3449d7f8e0f78e7045.tar.gz
gbos-9e7d5f6e5e01b7473b84bc3449d7f8e0f78e7045.tar.xz
gbos-9e7d5f6e5e01b7473b84bc3449d7f8e0f78e7045.zip
term: 7-color terminal (per-glyph fg+bg) + ANSI escapes; colorize irc
Fano-plane palette scheme: the 7 colors map onto 7 CGB BG palettes so any color pair shares one palette; a tile's palette is picked from the set of colors its two cells need (tables generated by tools/gencolor.py). Per cell a packed (bg<<4)|fg byte lives alongside the char shadow, and the glyph blitter steers glyph/empty pixels to each cell's fg/bg color slots via plane masks. An ANSI-ish CSI parser (ESC [ .. m) drives it; usr/ansi.c demos it and the irc client now renders hashed nick colors, status dimming and a channel-activity bar.
Diffstat (limited to '')
-rw-r--r--src/osk.asm8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/osk.asm b/src/osk.asm
index f5d99ac..d5edad7 100644
--- a/src/osk.asm
+++ b/src/osk.asm
@@ -80,10 +80,16 @@ osk_init::
ld [rBCPD], a
ld [rBCPD], a ; c1 = $0000 black
- ; build the key tiles (no cursor underline)
+ ; build the key tiles (no cursor underline). Glyph pixels -> color-id 1
+ ; (palette slot 1: white normal / black inverted); empty pixels -> id 0.
xor a
ld [wCurMask], a
ld [wOskBuild], a
+ ld [wFGP1], a
+ ld [wBGP0], a
+ ld [wBGP1], a
+ ld a, $FF
+ ld [wFGP0], a
.build
ld a, [wOskBuild]
ld e, a