quick commit before wahlolly does anything

This commit is contained in:
d
2025-04-30 07:39:21 +03:00
parent 50b4d4e670
commit ae25ffdd09
2 changed files with 14 additions and 4 deletions
+2 -3
View File
@@ -1,6 +1,5 @@
local raster = import("raster")
local ANSIColorPallete = import("halyde.core.termlib.lua").ANSIColorPalette
raster.drawPixel(4, 3, ANSIColorPallete["bright"][3])
raster.drawPixel(40, 34, nil, ANSIColorPallete["bright"][4])
raster.drawPixel(4, 3, 0xFFFF00)
raster.drawPixel(40, 34, nil, 0xFF00FF)
raster.drawPixel(3, 3)
+12 -1
View File
@@ -7,9 +7,20 @@ function mergePixels(x, y, bg, fg)
local original = gpu.get(x, y)[0]
if bg ~= nil then gpu.setBackground(bg) end
if fg ~= nil then gpu.setForeground(fg) end
-- convert from braille to char code
-- convert from
-- 1 4 1 2
-- 2 5 -> 3 4
-- 3 6 5 6
-- 7 8 7 8 using complicate bit thingery
-- bitwise or
-- unconvert
-- print the thing
end
function XY2Braille(x, y)
return math.floor(x/2), math.floor(y/4)
end
function Braille2XY(x, y)
return math.floor(x*2), math.floor(y*4)
end