OOStuBS - Technische Informatik II (TI-II)  2.4
cgascr.h
gehe zur Dokumentation dieser Datei
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2  * Technische Informatik II *
3  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
4  * *
5  * C G A _ S C R E E N *
6  * *
7 \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
8 
9 #ifndef __screen_include__
10 #define __screen_include__
11 
12 /* INCLUDES */
13 
14 #include <machine/io_port.h>
15 
16 /* CLASSES */
17 
23 class CGA_Screen {
24  private:
25 
29  struct ScreenChar{
30  char c;
31  unsigned char attrib;
32  };
33 
34 
38  enum Ports{
39  indexPortNum=0x3d4,
40  dataPortNum=0x3d5,
41  memoryBase=0xb8000
42  };
43 
47  enum Constants{
48  COLUMNS=80,
49  ROWS=25
50  };
51 
55 
56  protected:
67  unsigned char attribute;
68 
69  public:
70 
74  CGA_Screen();
75 
79  ~CGA_Screen();
80 
86  void setpos(unsigned short x, unsigned short y);
87 
93  void getpos(unsigned short& x, unsigned short& y) const;
94 
102  void show(unsigned short x, unsigned short y, char c, unsigned char attrib);
103 
124  void print(const char* string, unsigned int n);
125 
139  void scrollup();
140 
151  void clear();
152 
184  void setAttributes(int fgColor, int bgColor, bool blink);
185 };
186 
187 #endif