From b82ccebd3a0cce28177b5fac046139e2de7737fa Mon Sep 17 00:00:00 2001 From: Alexey Gavrilov Date: Sun, 20 Aug 2023 20:12:36 +0700 Subject: Getting started with print on display + some fixes --- arch/x86/io/VGADisplay.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 arch/x86/io/VGADisplay.h (limited to 'arch/x86/io/VGADisplay.h') 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 -- cgit v1.2.3