Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

screen.h

Go to the documentation of this file.
00001 // See the end of this file for license information.
00002 
00003 #ifndef TORSION_SCREEN_H
00004 #define TORSION_SCREEN_H
00005 
00007 
00012 class Screen {
00013 protected:
00014   static const unsigned int WIDTH = 80;
00015   static const unsigned int HEIGHT = 25;
00016   static const unsigned char DEFAULT_COLOR = 11;
00017   char* buffer;                         
00018   unsigned char print_pos;              
00019 
00020 public:
00022   inline void
00023   init() {
00024     buffer = (char*)0xb8000;
00025     print_pos = 0;
00026   }
00027 
00031   unsigned int
00032   display(char* str, unsigned char x, unsigned char y);
00033 
00036   unsigned int
00037   display(unsigned int number, unsigned char x, unsigned char y);
00038 
00041   inline unsigned int
00042   display(void* pointer, unsigned char x, unsigned char y) {
00043     return display((unsigned int)pointer, x, y);
00044   }
00045 
00048   void
00049   print(char* str, bool newline = true);
00050 
00053   void
00054   print(unsigned int number, bool newline = true);
00055 
00058   inline void
00059   print(void* pointer, bool newline = true) {
00060     print((unsigned int)pointer, newline);
00061   }
00062 
00064   inline void
00065   print() {
00066     print_pos = 0;
00067     scroll();
00068   }
00069 
00071   void
00072   clear();
00073 
00076   void
00077   move_cursor(unsigned char x, unsigned char y);
00078 
00080   void
00081   disable_cursor();
00082 
00084   void
00085   scroll();
00086 };
00087 
00088 #endif
00089 
00090 /* Torsion Operating System, Copyright (C) 2000-2002 Dan Helfman
00091  *
00092  * This program is free software; you can redistribute it and/or modify it
00093  * under the terms of the GNU General Public License as published by the
00094  * Free Software Foundation; either version 2 of the License, or (at your
00095  * option) any later version.
00096  * 
00097  * This program is distributed in the hope that it will be useful, but
00098  * WITHOUT ANY WARRANTY; without even the implied warranty of
00099  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00100  * General Public License for more details (in the COPYING file).
00101  * 
00102  * You should have received a copy of the GNU General Public License along
00103  * with this program; if not, write to the Free Software Foundation, Inc.,
00104  * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00105  */

Torsion Operating System, Copyright (C) 2000-2002 Dan Helfman