From dab24fedf1f09fdf9f3f78fad69bc1f4f5d78037 Mon Sep 17 00:00:00 2001 From: d Date: Thu, 1 May 2025 09:41:43 +0300 Subject: [PATCH] fix a bunch of stuff --- halyde/lib/raster.lua | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/halyde/lib/raster.lua b/halyde/lib/raster.lua index 998b499..2184c35 100644 --- a/halyde/lib/raster.lua +++ b/halyde/lib/raster.lua @@ -3,20 +3,32 @@ local raster = {} local ocelot = component.proxy(component.list("ocelot")()) local gpu = component.proxy(component.list("gpu")()) -function raster.drawPixel(x, y, bg, fg) +function raster.drawPixel(x, y, newbg, newfg) -- get original character for "merging" local char, fg, bg = gpu.get(x, y) -- thx wah - if bg ~= nil then gpu.setBackground(bg) end - if fg ~= nil then gpu.setForeground(fg) end - -- convert from braille to char code - -- bitwise or - -- print the thing - -- i do NOT need to convert the thing. - char = utf8.codepoint(char) + ocelot.log(char) + char = string.byte(char) -- convert from char to char code + ocelot.log(tostring(char)) if char < 0x2800 or char > 0x28ff then -- check if char is not a braille character char = 0 -- yes end - -- now i just need to print the character + the new character but i forgot how to do it plus its late gn + ocelot.log(tostring(char)) + local newi = (x%2)+(y%4)*2 -- original unmodified location in the char + if x%2==1 and (newi>1 and newi<6) then -- modify it + newi = newi+1 -- trust me bro this works + elseif x%2==0 and (newi>1 and newi<6) then + newi = newi-1 + end + ocelot.log(tostring(newi)) + newchar = char|(1<