blob: 3a3888b824d83a810c0082930ef2d49e927420bf (
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
29
30
|
#include <sys.h>
#include "cursor.h"
#include "term.h"
void cursor_enable(void) {
cursor_setsize(13, 16);
}
void cursor_disable(void) {
outb(0x3D4, 0x0A);
outb(0x3D5, 0x20);
}
void cursor_setsize(uint8_t start, uint8_t end) {
outb(0x3D4, 0x0A);
outb(0x3D5, (inb(0x3D5) & 0xC0) | start);
outb(0x3D4, 0x0B);
outb(0x3D5, (inb(0x3D5) & 0xE0) | end);
}
void cursor_setpos(uint8_t x, uint8_t y) {
; uint16_t pos = y * TERM_W + x;
outb(0x3D4, 0x0F);
outb(0x3D5, (uint8_t) (pos & 0xFF));
outb(0x3D4, 0x0E);
outb(0x3D5, (uint8_t) ((pos >> 8) & 0xFF));
}
|