aboutsummaryrefslogtreecommitdiff
path: root/src/text.c
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-06-13 22:25:02 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-06-13 22:25:02 +0100
commite2f2cd904ff134b221a811c4b9dd5548789ff070 (patch)
tree46ca5c3b5909466e5f57d380bbe5cf0090d65010 /src/text.c
parent69faef284848fc9c0c52b4e9f7011f0f1b76ef2e (diff)
downloadgold-mine-run-e2f2cd904ff134b221a811c4b9dd5548789ff070.tar.gz
gold-mine-run-e2f2cd904ff134b221a811c4b9dd5548789ff070.zip
Add bitmap font's put_text
Diffstat (limited to 'src/text.c')
-rw-r--r--src/text.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/text.c b/src/text.c
new file mode 100644
index 0000000..c59b5e6
--- /dev/null
+++ b/src/text.c
@@ -0,0 +1,15 @@
+#include <stdint.h>
+
+#include "vga.h"
+#include "data.h"
+
+void put_text(uint16_t x, uint16_t y, const char *text)
+{
+ Rect dst = { x, y, 8, 8};
+
+ while (*text)
+ {
+ blit(binary_font_start + ((*text++ - ' ') << 6), &dst);
+ dst.x += 8;
+ }
+}