diff --git a/halyde/apps/helpdb/rtest.txt b/halyde/apps/helpdb/rtest.txt new file mode 100644 index 0000000..04b4173 --- /dev/null +++ b/halyde/apps/helpdb/rtest.txt @@ -0,0 +1 @@ +Ergonomics \ No newline at end of file diff --git a/halyde/apps/rtest.lua b/halyde/apps/rtest.lua new file mode 100644 index 0000000..afc9993 --- /dev/null +++ b/halyde/apps/rtest.lua @@ -0,0 +1,6 @@ +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(3, 3) \ No newline at end of file diff --git a/halyde/core/boot.lua b/halyde/core/boot.lua index 50f2b63..bdf6166 100644 --- a/halyde/core/boot.lua +++ b/halyde/core/boot.lua @@ -1,7 +1,7 @@ local loadfile = ... local filesystem = loadfile("/halyde/lib/filesystem.lua")(loadfile) -_G._OSVERSION = "Halyde 0.8.2" +_G._OSVERSION = "Halyde 0.8.3" function _G.import(module, ...) local args = table.pack(...) diff --git a/halyde/lib/raster.lua b/halyde/lib/raster.lua index 8b13789..4d27acb 100644 --- a/halyde/lib/raster.lua +++ b/halyde/lib/raster.lua @@ -1 +1,15 @@ +function drawPixel(x, y, bg, fg) + mergePixels(x, y, bg, fg) +end +function mergePixels(x, y, bg, fg) + -- get original character for "merging" + local original = gpu.get(x, y)[0] + if bg ~= nil then gpu.setBackground(bg) end + if fg ~= nil then gpu.setForeground(fg) end + +end + +function XY2Braille(x, y) + return math.floor(x/2), math.floor(y/4) +end \ No newline at end of file