From 238d341c328075454b6b82dc8348a335dc04254d Mon Sep 17 00:00:00 2001 From: DrNuget Date: Thu, 30 Oct 2025 09:08:41 +0200 Subject: some broken stuff, will fix later --- brailleboi.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'brailleboi.c') diff --git a/brailleboi.c b/brailleboi.c index e04d17c..9bc6b8b 100644 --- a/brailleboi.c +++ b/brailleboi.c @@ -22,6 +22,7 @@ int brailleStop(image_buffer* buf) int brailleReorganizeBits(int old) { + //Reorganizes bits because the unicode standard for 8 dotted braille is weird int new = (old&0b10000111) | (old&0b01110000)>>1 | (old&0b00001000)<<3; @@ -32,3 +33,22 @@ void braillePrint(int data) { wprintf(L"%lc", (0x2800|data)); } + +int braillePlot(int x, int y, image_buffer* buf) +{ + //Check if plot is within bounds + if (x>buf->width | y>buf->height) + return 1; + buf->contents[y * buf->width + x] |= 1<<((1+x%2)*y); + return 0; +} + +void brailleUpdateScreen(image_buffer* buf) +{ + for (int x=0;xwidth;x++) { + for (int y=0;yheight;y++) { + printf("\e[%d;%dH", y, x); + braillePrint(buf->contents[y * buf->width + x]); + } + } +} -- cgit v1.2.3