summaryrefslogtreecommitdiff
path: root/dialog.c
diff options
context:
space:
mode:
Diffstat (limited to 'dialog.c')
-rw-r--r--dialog.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/dialog.c b/dialog.c
new file mode 100644
index 0000000..814bbc1
--- /dev/null
+++ b/dialog.c
@@ -0,0 +1,28 @@
+#include "dialog.h"
+#include "font.h"
+#include "TZR.h"
+#include <stdio.h>
+
+static const char *___dialog;
+static int ___cursor;
+
+void dialog_set(const char *s)
+{
+ ___dialog = s;
+}
+
+void dialog_update(void)
+{
+ if (TZR_GetTick() % 8)
+ return;
+ if (___dialog[___cursor] == '\0')
+ return;
+ ___cursor += 1;
+ if (___dialog[___cursor] >= 'A' && ___dialog[___cursor] <= 'Z')
+ return dialog_update();
+}
+
+void dialog_draw(void)
+{
+ font_draw(0, 0, ___dialog, ___cursor);
+}