summaryrefslogtreecommitdiff
path: root/dialog.c
blob: 814bbc17baa9eb0b658dbc48ec67b37786b385f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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);
}