ref: ae2384b1273840d7633812d793895dace0d79683
parent: 3cc6c38f1347e3a9d61f27d28dbafad7fe4cae7b
author: mkf <mkf@cloud9p.org>
date: Mon Nov 20 02:00:40 EST 2023
fix build (and some bugs in the way)
--- a/include/bitcons.h
+++ b/include/bitcons.h
@@ -4,9 +4,9 @@
#include <ps2.h>
#include <bitmap.h>
-consdev_t bitcon =
+consdev_t bitcons =
{
- .name = "bitcon",
+ .name = "bitcons",
.init = vga_init,
.clear = vga_clear,
.puts = bitputs,
--- a/include/bitmap.h
+++ b/include/bitmap.h
@@ -1,6 +1,7 @@
#pragma once
+
/* font is taken from https://github.com/dhepper/font8x8 */
-char blockfont[128][8] =
+static char bitfont[128][8] =
{
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0000 (nul)
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0001
--- a/pc/bitmap.c
+++ b/pc/bitmap.c
@@ -1,5 +1,7 @@
-#include <cons.h>
-#include <pccons.h>
+#include <u.h>
+#include <libc.h>
+#include <vga.h>
+#include <bitmap.h>
void
bitputs(char *s)
@@ -13,13 +15,13 @@
{
for(bit = 0; bit < 8 ; bit++)
{
- set = blockfont[s[chr]][line] & 1 << bit;
- consputc(pccons, (set ? 178 : ' '));
+ set = bitfont[s[chr]][line] & 1 << bit;
+ vga_putc(set ? 178 : ' ');
}
}
- consputc(pccons, '\n');
+ vga_putc('\n');
}
- consputc(pccons, '\n');
+ vga_putc('\n');
}
void
@@ -32,9 +34,9 @@
{
for(bit = 0 ; bit < 8 ; bit++)
{
- set = blockfont[s[chr]][line] & 1 << bit;
- consputc(pccons, (set ? 178 : ' '));
+ set = bitfont[c][line] & 1 << bit;
+ vga_putc(set ? 178 : ' ');
}
- consputc(pccons, '\n');
+ vga_putc('\n');
}
-}
\ No newline at end of file
+}