From d49c62663b6a2229e9849769591873005c762618 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sun, 3 Jan 2021 09:23:25 +0000 Subject: Renamed aux to helpers to be windows compatible --- game/src/helpers.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 game/src/helpers.c (limited to 'game/src/helpers.c') 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 + +#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); +} -- cgit v1.2.3