aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrNuget <drnuget@outlook.com>2025-10-31 20:51:54 +0200
committerDrNuget <drnuget@outlook.com>2025-10-31 20:51:54 +0200
commit1e07325fed7f3e5b0354a977da0fc1739c0b2a3c (patch)
tree56da4165e25acc694e3b932b7cedb5dcc890879c
parent238d341c328075454b6b82dc8348a335dc04254d (diff)
downloadbrailleboi-1e07325fed7f3e5b0354a977da0fc1739c0b2a3c.tar.gz
something slightly less broken shit
-rw-r--r--brailleboi.c10
1 files changed, 6 insertions, 4 deletions
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;x<buf->width;x++) {
for (int y=0;y<buf->height;y++) {
- printf("\e[%d;%dH", y, x);
+ wprintf(L"\e[%d;%dH", y, x);
braillePrint(buf->contents[y * buf->width + x]);
}
}