#include class VideoText { private: int page_num; struct pageInfo { unsigned int x, // cursor x coordinate y, // cursor y coordinate segment_addr, // video buf segment base_offset; // offset w/in video buf unsigned char previous_active_page, // prev active video page # active_page, // current active video page # previous_video_mode, // prev video mode video_mode; // current video mode unsigned int bytes_per_char, // video buf bytes per char chars_per_row, // video buf chars per row rows_per_screen; // video buf rows per screen unsigned char attribute; // current active attribute unsigned int *previous_buffer, // ptr to prev video buf // before VideoText *buffer; // ptr to current // VideoText buffer }; struct pageInfo page; void Array2Page // load VideoText buffer ( unsigned int *buffer ); // to video buf void Page2Array // load video buf to ( unsigned int *buffer ); // VideoText buffer unsigned int GetOffset // Calculate video buf offset ( unsigned int x, unsigned int y ); // for (x,y) pair void PopPage( void ); // restore prev video state void PushPage( void ); // store prev video state int peek(unsigned segment, unsigned offset); void poke(unsigned segment, unsigned offset, int value); public: VideoText() {} VideoText( int page_num ) // constructor { page_num = page_num; } ~VideoText( ) {}; // destructor unsigned char GetAttribute( void ); // Retrieve current attributes void SetAttribute // Set current attributes ( unsigned char attribute ); void GoToXY( int x, int y ); // move current video buf // cursor location to (x,y) void WriteChar( unsigned char ch ); // Write one char at video // buf cursor location (x,y) // using current attributes void WriteString // Write str at video ( unsigned char * str ); // buf cursor location (x,y) // using current attributes void ClearScreen( void ); // clear entire video buf void DrawLine( int x1, int y1, // Draw line to video buf int x2, int y2 ) // from (x1,y1) to (x2,y2) { cout << "**********" << endl; cout << "Made It~!!" << endl; cout << "**********" << endl; } void DrawBox( int x1, int y1, // Draw box to video buf int x2, int y2 ); // (x1,y1) top left corner // (x2,y2) bottom right corner void ShowPage( void ); // Writes current VideoText // buffer contents to video // buf void HidePage( void ); // Writes video buf // contents to current // VideoText buffer and then // clears entire video buf // Here are the text character attributes enum attributes { fgBlack = 0x00, // Foreground attributes fgBlue = 0x01, fgGreen = 0x02, fgRed = 0x04, fgWhite = 0x07, fgIntense = 0x08, bgBlack = 0x00, // Background attributes bgBlue = 0x10, bgGreen = 0x20, bgRed = 0x40, bgWhite = 0x70, Blinking = 0x80}; }; extern VideoText *VideoTest;