aboutsummaryrefslogtreecommitdiff
path: root/game/src/helpers.c
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2021-01-03 09:23:25 +0000
committerJuan J. Martinez <jjm@usebox.net>2021-01-03 10:14:32 +0000
commitd49c62663b6a2229e9849769591873005c762618 (patch)
tree96929394d36f129d72c0d3c56bd269dbfa8c2132 /game/src/helpers.c
parentbd4647a79e13f4a6ada8a86754d889fcddd758d4 (diff)
downloadubox-msx-lib-d49c62663b6a2229e9849769591873005c762618.tar.gz
ubox-msx-lib-d49c62663b6a2229e9849769591873005c762618.zip
Renamed aux to helpers to be windows compatible
Diffstat (limited to 'game/src/helpers.c')
-rw-r--r--game/src/helpers.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/game/src/helpers.c b/game/src/helpers.c
new file mode 100644
index 0000000..9aa4785
--- /dev/null
+++ b/game/src/helpers.c
@@ -0,0 +1,18 @@
+#include <stdint.h>
+
+#include "ubox.h"
+
+#include "helpers.h"
+
+/**
+ * Put a zero terminated string on the screen using tiles.
+ *
+ * The font starts on the tileset on tile 128 and the fist char in our has
+ * ASCII value 31, so it is adjusted so we can use ASCII *uppercase* directly
+ * in our C code.
+ */
+void put_text(uint8_t x, uint8_t y, const uint8_t *text)
+{
+ while (*text)
+ ubox_put_tile(x++, y, *text++ + 128 - 31);
+}