From 1e07325fed7f3e5b0354a977da0fc1739c0b2a3c Mon Sep 17 00:00:00 2001 From: DrNuget Date: Fri, 31 Oct 2025 20:51:54 +0200 Subject: something slightly less broken shit --- brailleboi.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'brailleboi.c') diff --git a/brailleboi.c b/brailleboi.c index 9bc6b8b..d8ff8e9 100644 --- a/brailleboi.c +++ b/brailleboi.c @@ -37,9 +37,11 @@ void braillePrint(int 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); + //TODO: fix boundary check +// if (x>buf->width | y>buf->height) +// return 1; + buf->contents[y/4 * buf->width + x/2] |= 128>>y%4+x%2*4; + //printf("%#08x\n", buf->contents[y/4 * buf->width + x/2]); return 0; } @@ -47,7 +49,7 @@ void brailleUpdateScreen(image_buffer* buf) { for (int x=0;xwidth;x++) { for (int y=0;yheight;y++) { - printf("\e[%d;%dH", y, x); + wprintf(L"\e[%d;%dH", y, x); braillePrint(buf->contents[y * buf->width + x]); } } -- cgit v1.2.3