blob: dae9818ca22ffa87ba9dfd5f491fc4dead57594a [file] [log] [blame]
Adrien Destugues69b1f062017-06-05 13:44:30 +02001/*
2 * Copyright 2017, Adrien Destugues, pulkomandy@pulkomandy.tk
3 * Distributed under terms of the MIT license.
4 */
5
6
7#include "ctk-arch.h"
8
9#include "lib/textmode/textmode.h"
10
11struct event e = {0};
12
13ctk_arch_key_t
14ctk_arch_getkey(void)
15{
16 while (e.type != evt_keyboard_press || e.kbd.sym < 8)
17 {
18 events_poll();
19 e = event_get();
20 }
21
22 return e.kbd.sym;
23}
24
25unsigned char kbhit(void)
26{
27 events_poll();
28 e = event_get();
29 return e.type == evt_keyboard_press && e.kbd.sym >= 8;
30}
31
32void
33ctk_arch_draw_char(char c,
34 unsigned char x, unsigned char y,
35 unsigned char reversed,
36 unsigned char color)
37{
38 vram[y][x] = c;
39 vram_attr[y][x] = color;
40}