-
Notifications
You must be signed in to change notification settings - Fork 1
/
term.hpp
44 lines (31 loc) · 1.26 KB
/
term.hpp
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#pragma once
#include <stdarg.h>
namespace term {
static volatile char* const vmem_base = reinterpret_cast<volatile char*>(0xb8000);
constexpr int width = 80;
constexpr int height = 25;
void clear();
void clearLine();
void init(); // fixme: if not init will corrupt mem
int getX();
int getY();
void moveAbs(int x, int y);
void moveRel(int dx, int dy);
void nl();
void putch(const char x);
void puts(const char* str);
void putnum(signed char x, const signed char base /*= 10*/);
void putnum(short x, const short base /*= 10*/);
void putnum(int x, const int base /*= 10*/);
void putnum(long x, const long base /*= 10*/);
void putnum(long long x, const long long base /*= 10*/);
void putnum(unsigned char x, const unsigned char base /*= 10*/);
void putnum(unsigned short x, const unsigned short base /*= 10*/);
void putnum(unsigned int x, const unsigned int base /*= 10*/);
void putnum(unsigned long x, const unsigned long base /*= 10*/);
void putnum(unsigned long long x, const unsigned long long base /*= 10*/);
void putsln(const char* str);
[[gnu::format(printf, 1, 2)]]
void printf(const char* fmt...);
void panicln(const char* str);
}