initial reformat, still has misformats
This commit is contained in:
@ -17,60 +17,73 @@
|
||||
#include "kernel/IOport.h"
|
||||
|
||||
class CGA {
|
||||
|
||||
|
||||
private:
|
||||
IOport index_port; // Auswahl eines Register der Grafikkarte
|
||||
IOport data_port; // Lese-/Schreib-Zugriff auf Register der Grafikk.
|
||||
|
||||
IOport index_port; // Auswahl eines Register der Grafikkarte
|
||||
IOport data_port; // Lese-/Schreib-Zugriff auf Register der Grafikk.
|
||||
|
||||
// Copy Konstrutkor unterbinden
|
||||
CGA(const CGA ©);
|
||||
|
||||
CGA(const CGA& copy);
|
||||
|
||||
public:
|
||||
const char *CGA_START; // Startadresse des Buldschirmspeichers
|
||||
|
||||
const char* CGA_START; // Startadresse des Buldschirmspeichers
|
||||
|
||||
// Konstruktur mit Initialisierung der Ports
|
||||
CGA () : index_port (0x3d4), data_port (0x3d5) {
|
||||
CGA() : index_port(0x3d4), data_port(0x3d5) {
|
||||
CGA_START = (const char*)0xb8000;
|
||||
|
||||
// NOTE: I added this
|
||||
this->setpos(0, 0);
|
||||
}
|
||||
|
||||
|
||||
// Konstanten fuer die moeglichen Farben im Attribut-Byte.
|
||||
typedef enum {
|
||||
BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, LIGHT_GREY,
|
||||
DARK_GREY, LIGHT_BLUE, LIGHT_GREEN, LIGHT_CYAN, LIGHT_RED,
|
||||
LIGHT_MAGENTA, YELLOW, WHITE
|
||||
BLACK,
|
||||
BLUE,
|
||||
GREEN,
|
||||
CYAN,
|
||||
RED,
|
||||
MAGENTA,
|
||||
BROWN,
|
||||
LIGHT_GREY,
|
||||
DARK_GREY,
|
||||
LIGHT_BLUE,
|
||||
LIGHT_GREEN,
|
||||
LIGHT_CYAN,
|
||||
LIGHT_RED,
|
||||
LIGHT_MAGENTA,
|
||||
YELLOW,
|
||||
WHITE
|
||||
} color;
|
||||
|
||||
|
||||
// Standardzeichenfarbe
|
||||
enum { STD_ATTR = BLACK << 4 | LIGHT_GREY };
|
||||
|
||||
|
||||
// Groesse des Bildschirms (25 Zeilen, 80 Spalten)
|
||||
enum { ROWS = 25, COLUMNS = 80 };
|
||||
|
||||
enum { ROWS = 25,
|
||||
COLUMNS = 80 };
|
||||
|
||||
// Setzen des Cursors in Spalte x und Zeile y.
|
||||
void setpos (int x, int y);
|
||||
|
||||
void setpos(int x, int y);
|
||||
|
||||
// Abfragen der Cursorpostion
|
||||
void getpos (int& x, int& y);
|
||||
|
||||
void getpos(int& x, int& y);
|
||||
|
||||
// Anzeige eines Zeichens mit Attribut an einer bestimmten Stelle
|
||||
void show (int x, int y, char character, unsigned char attrib = STD_ATTR);
|
||||
|
||||
void show(int x, int y, char character, unsigned char attrib = STD_ATTR);
|
||||
|
||||
// Anzeige mehrerer Zeichen ab der aktuellen Cursorposition
|
||||
void print (char* string, int n, unsigned char attrib = STD_ATTR);
|
||||
|
||||
void print(char* string, int n, unsigned char attrib = STD_ATTR);
|
||||
|
||||
// Verschiebt den Bildschirminhalt um eine Zeile nach oben.
|
||||
// Neue Zeile am unteren Bildrand mit Leerzeichen fuellen
|
||||
void scrollup ();
|
||||
|
||||
void scrollup();
|
||||
|
||||
// Lösche den Textbildschirm
|
||||
void clear ();
|
||||
|
||||
void clear();
|
||||
|
||||
// Hilfsfunktion zur Erzeugung eines Attribut-Bytes
|
||||
unsigned char attribute (CGA::color bg, CGA::color fg, bool blink);
|
||||
unsigned char attribute(CGA::color bg, CGA::color fg, bool blink);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user