You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
693 B
C++

#include "cga.h"
#include "arch/ioport.h"
namespace CGA {
IOPort index_port = IOPort(0x3d4);
IOPort data_port = IOPort(0x3d5);
void writeCGAReg(int reg, int data){
index_port.outb(reg);
data_port.outb(data);
}
void setCursor(unsigned abs_x, unsigned abs_y) {
uint16_t pos = abs_y * COLUMNS + abs_x;
writeCGAReg(RegisterIndex::CURSOR_LOW, pos & 0xFF);
writeCGAReg(RegisterIndex::CURSOR_HIGH, ((pos >> 8) & 0xFF));
}
void getCursor(unsigned& abs_x, unsigned& abs_y) {
(void)abs_x;
(void)abs_y;
}
void show(unsigned abs_x, unsigned abs_y, char character, Attribute attrib) {
(void)abs_x;
(void)abs_y;
(void)character;
(void)attrib;
}
}; // namespace CGA