aboutsummaryrefslogtreecommitdiff
path: root/brailleboi.c
diff options
context:
space:
mode:
Diffstat (limited to 'brailleboi.c')
-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]);
}
}