diff options
| author | Alexey Gavrilov <rebovas@yahoo.com> | 2023-08-20 20:12:36 +0700 |
|---|---|---|
| committer | Alexey Gavrilov <rebovas@yahoo.com> | 2023-08-20 20:12:36 +0700 |
| commit | b82ccebd3a0cce28177b5fac046139e2de7737fa (patch) | |
| tree | b4e048eb7bed81a726340fb98690dce62eed7475 /arch/x86/io/VGADisplay.h | |
| parent | a601dbb1dd5569243fd3006a27e914491fc3f35e (diff) | |
Getting started with print on display + some fixes
Diffstat (limited to 'arch/x86/io/VGADisplay.h')
| -rw-r--r-- | arch/x86/io/VGADisplay.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/x86/io/VGADisplay.h b/arch/x86/io/VGADisplay.h new file mode 100644 index 0000000..67f28b3 --- /dev/null +++ b/arch/x86/io/VGADisplay.h @@ -0,0 +1,36 @@ +#ifndef VGAGRAPHICS_H +#define VGAGRAPHICS_H + +#include "VGADisplayInfo.h" + +typedef unsigned short dchar; + +class VGADisplay +{ + private: + uint16 xCurr; + uint16 yCurr; + dchar *videoMem; + bool shift; + char color; + bool isBlink; + bool isBright; + + void doShift(); + // 0 if passed char isn't escape sequence, else 1 + bool printChar(const char &c); + void goNewLine(); + void goHorizontalTab(); + + public: + VGADisplay(); + VGADisplay(uint16 x, uint16 y); + VGADisplay& operator<<(const char &c); + VGADisplay& operator<<(const char *c); + VGADisplay& operator++(int); + void setShift(bool status); + void setColor(char colorAttr); + void setBlink(bool blinkAttr); + void setBright(bool brigthAttr); +}; +#endif |
