00001 // See the end of this file for license information. 00002 00003 #ifndef TORSION_SCREEN_H 00004 #define TORSION_SCREEN_H 00005 00006 #include "types.h" 00007 00008 class Screen; 00009 extern Screen screen; 00010 00013 00014 class Screen { 00015 protected: 00016 static const unsigned char DEFAULT_COLOR = 11; 00017 char* buffer; 00018 unsigned char print_pos; 00019 00020 public: 00021 static const Size WIDTH = 80; 00022 static const Size HEIGHT = 25; 00023 00025 inline void 00026 init() { 00027 buffer = (char*)0xb8000; 00028 print_pos = 0; 00029 } 00030 00034 Size 00035 display(char* str, unsigned char x, unsigned char y); 00036 00040 Size 00041 display_line(char* str, unsigned char x, unsigned char y); 00042 00045 Size 00046 display(unsigned number, unsigned char x, unsigned char y); 00047 00050 inline Size 00051 display(void* pointer, unsigned char x, unsigned char y) { 00052 return display((unsigned)pointer, x, y); 00053 } 00054 00057 void 00058 print(char* str, bool newline = true); 00059 00062 void 00063 print(unsigned number, bool newline = true); 00064 00067 inline void 00068 print(void* pointer, bool newline = true) { 00069 print((unsigned)pointer, newline); 00070 } 00071 00073 inline void 00074 print() { 00075 print_pos = 0; 00076 scroll(); 00077 } 00078 00080 void 00081 clear(); 00082 00085 void 00086 move_cursor(unsigned char x, unsigned char y); 00087 00089 void 00090 disable_cursor(); 00091 00093 void 00094 scroll(); 00095 }; 00096 00097 #endif 00098 00099 /* Torsion Operating System, Copyright (C) 2000-2004 Dan Helfman 00100 * 00101 * This program is free software; you can redistribute it and/or modify it 00102 * under the terms of the GNU General Public License as published by the 00103 * Free Software Foundation; either version 2 of the License, or (at your 00104 * option) any later version. 00105 * 00106 * This program is distributed in the hope that it will be useful, but 00107 * WITHOUT ANY WARRANTY; without even the implied warranty of 00108 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00109 * General Public License for more details (in the COPYING file). 00110 * 00111 * You should have received a copy of the GNU General Public License along 00112 * with this program; if not, write to the Free Software Foundation, Inc., 00113 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00114 */
Torsion Operating System, Copyright (C) 2000-2004 Dan Helfman