summaryrefslogtreecommitdiff
path: root/Source/Kernel/DisplayManager/Disp.ns.cpp
blob: 75344f89e44555d515dad6da984c3446324f1d6b (plain) (blame)
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
#include "Disp.ns.h"

namespace Disp {

mode_t mode;

u16int textCols() {
	return mode.textCols;
}

u16int textRows() {
	return mode.textRows;
}

void putChar(u16int line, u16int col, char c, char color) {
	if (line >= mode.textRows or col >= mode.textCols) return;
	mode.device->putChar(line, col, c, color);
}

void moveCursor(u16int line, u16int col) {
	if (line >= mode.textRows or col >= mode.textCols) return;
	mode.device->moveCursor(line, col);
}

void clear() {
	mode.device->clear();
}

void setDisplay(Display* disp) {
	mode.device = disp;
	disp->clear();
	mode.textCols = disp->textCols();
	mode.textRows = disp->textRows();
}

}