📄 cgascr.h.svn-base
字号:
#ifndef __screen_include__#define __screen_include__/*****************************************************************************//* Betriebssysteme *//*---------------------------------------------------------------------------*//* *//* C G A _ S C R E E N *//* *//*---------------------------------------------------------------------------*//* Mit Hilfe dieser Klasse kann man auf den Bildschirm des PCs zugreifen. *//* Der Zugriff erfolgt direkt auf der Hardwareebene, d.h. ueber den Bild- *//* schirmspeicher bzw. die I/O-Ports der Grafikkarte. *//*****************************************************************************/#include "machine/io_port.h"class CGA_Screen{public: struct CGA_Attrib { enum { screen_width = 80, screen_height = 24, fg_black = 0x0, fg_blue = 0x1, fg_green = 0x2, fg_cyan = 0x3, fg_red = 0x4, fg_magenta = 0x5, fg_bown = 0x6, fg_hellgray = 0x7, fg_darkgray = 0x8, fg_hellblue = 0x9, fg_hellgreen = 0xa, fg_hellcyan = 0xb, fg_hellred = 0xc, fg_hellmagenta = 0xd, fg_yellow = 0xe, fg_white = 0xf, bg_black = 0x00, bg_blue = 0x10, bg_green = 0x20, bg_cyan = 0x30, bg_red = 0x40, bg_magenta = 0x50, bg_bown = 0x60, bg_hellgray = 0x70, noblink = 0x0, blink = 0x80 }; }; CGA_Screen(); CGA_Screen(CGA_Screen &scr); virtual ~CGA_Screen(); void show (int x, int y, char c, unsigned char attrib); void setpos (int x, int y); void getpos (int &x, int &y); void print (char* text, int length, unsigned char attrib); void print (char c, unsigned char attrib); void println (); void clear(); void scroll(int line); int offset(int x, int y) const; void incpos(); void decpos(); void goto_head(); void goto_end(); void set_fg_color(int color); void set_bg_color(int color); void set_blink(bool on); void set_color(int color); int get_fg_color(); int get_bg_color(); bool is_blink(); int get_color(); protected: char *m_screen; IO_Port m_index; IO_Port m_data; int m_curX; int m_curY; unsigned int m_color;};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -