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

Screen Class Reference

Screen is the VGA color screen buffer. More...

#include <screen.h>

List of all members.

Public Methods

void init ()
unsigned int display (char *str, unsigned char x, unsigned char y)
unsigned int display (unsigned int number, unsigned char x, unsigned char y)
unsigned int display (void *pointer, unsigned char x, unsigned char y)
void print (char *str, bool newline=true)
void print (unsigned int number, bool newline=true)
void print (void *pointer, bool newline=true)
void print ()
void clear ()
void move_cursor (unsigned char x, unsigned char y)
void disable_cursor ()
void scroll ()

Protected Attributes

char * buffer
unsigned char print_pos

Static Protected Attributes

const unsigned int WIDTH = 80
const unsigned int HEIGHT = 25
const unsigned char DEFAULT_COLOR = 11


Detailed Description

Screen is the VGA color screen buffer.

Each screen character is two bytes: One for the character itself and one for its color code.


Member Function Documentation

void Screen::clear  
 

Fill the screen buffer with spaces.

void Screen::disable_cursor  
 

Turn off the hardware cursor.

unsigned int Screen::display void *    pointer,
unsigned char    x,
unsigned char    y
[inline]
 

Display a pointer as a hex string on screen. Return a count of characters displayed.

unsigned int Screen::display unsigned int    number,
unsigned char    x,
unsigned char    y
 

Display an unsigned int as a hex string on screen. Return a count of characters displayed.

unsigned int Screen::display char *    str,
unsigned char    x,
unsigned char    y
 

Display the given character string at the given coordinates on screen. x is 0 to WIDTH-1, y is 0 to HEIGHT-1. Origin is the upper left of screen. Return a count of characters displayed.

void Screen::init   [inline]
 

Initialize the screen buffer.

void Screen::move_cursor unsigned char    x,
unsigned char    y
 

Move the hardware cursor to the given location. This cursor is completely independent of any string display functions.

void Screen::print   [inline]
 

Print a newline.

void Screen::print void *    pointer,
bool    newline = true
[inline]
 

Print a pointer on the bottom line of the screen, scrolling if newline is true.

void Screen::print unsigned int    number,
bool    newline = true
 

Print an unsigned int as a hex string on the bottom line of the screen, scrolling if newline is true.

void Screen::print char *    str,
bool    newline = true
 

Print the given character string on the bottom line of the screen, scrolling if newline is true.

void Screen::scroll  
 

Scroll the entire screen up one line.


Member Data Documentation

char* Screen::buffer [protected]
 

actual VGA buffer.

const unsigned char Screen::DEFAULT_COLOR = 11 [static, protected]
 

const unsigned int Screen::HEIGHT = 25 [static, protected]
 

unsigned char Screen::print_pos [protected]
 

x position of print() "cursor".

const unsigned int Screen::WIDTH = 80 [static, protected]
 


The documentation for this class was generated from the following files:

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