From e4134721df73ae71f4d17d5a41208ab15e50ad04 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Fri, 5 Aug 2022 23:28:29 +0100 Subject: betterness ? --- img/all.dat | 2 +- img/better_disp.lua | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 img/better_disp.lua (limited to 'img') diff --git a/img/all.dat b/img/all.dat index 42ce640..caa1988 100644 --- a/img/all.dat +++ b/img/all.dat @@ -1,2 +1,2 @@ -dep img/load_pnm img/shitty_disp img/driver +dep img/load_pnm img/shitty_disp img/driver img/better_disp file diff --git a/img/better_disp.lua b/img/better_disp.lua new file mode 100644 index 0000000..85fea3e --- /dev/null +++ b/img/better_disp.lua @@ -0,0 +1,24 @@ +-- a vlorb consists of six gromlings[A +-- 1 2 +-- 4 8 +-- 16 Q +-- these are characters 0x80 through 0x9f in the cc charset +-- which is only 2^5 characters though. for the sixth bit you flip the colours +-- of that vlorb. + +-- on colour, off colour, gromlings 1 through 6 (bools) +-- returns text colour, bg color, and vlorbchar +local function vlorb(onc,offc, g1,g2,g3,g4,g5,g6) + local textc,bgc = onc,offc + if g6 then textc,bgc=bgc,textc end + local vlorbchar = 0 + if g1 then vlorbchar=vlorbchar+1 end + if g2 then vlorbchar=vlorbchar+2 end + if g3 then vlorbchar=vlorbchar+4 end + if g4 then vlorbchar=vlorbchar+8 end + if g5 then vlorbchar=vlorbchar+16 end + return textc,bgc,string.char(vlorbchar) +end + + + -- cgit v1.2.3