diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-06-13 22:25:02 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-06-13 22:25:02 +0100 |
commit | e2f2cd904ff134b221a811c4b9dd5548789ff070 (patch) | |
tree | 46ca5c3b5909466e5f57d380bbe5cf0090d65010 /src/text.c | |
parent | 69faef284848fc9c0c52b4e9f7011f0f1b76ef2e (diff) | |
download | gold-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.c | 15 |
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; + } +} |