Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

Screen Class Reference

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

#include <screen.h>

List of all members.

Public Member Functions

void init ()
Size display (char *str, unsigned char x, unsigned char y)
Size display_line (char *str, unsigned char x, unsigned char y)
Size display (unsigned number, unsigned char x, unsigned char y)
Size display (void *pointer, unsigned char x, unsigned char y)
void print (char *str, bool newline=true)
void print (unsigned 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 ()

Static Public Attributes

const Size WIDTH = 80
const Size HEIGHT = 25

Protected Attributes

char * buffer
unsigned char print_pos

Static Protected Attributes

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.

Size 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 Screen::display unsigned  number,
unsigned char  x,
unsigned char  y
 

Display an unsigned as a hex string on screen.

Return a count of characters displayed.

Size 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.

Size Screen::display_line char *  str,
unsigned char  x,
unsigned char  y
 

Display the given character string at the given coordinates on screen, clearing the remainder of the line if it isn't WIDTH characters wide.

Return a count of characters displayed, not counting the line remainder.

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  number,
bool  newline = true
 

Print an unsigned 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 Size Screen::HEIGHT = 25 [static]
 

unsigned char Screen::print_pos [protected]
 

x position of print() "cursor"

const Size Screen::WIDTH = 80 [static]
 


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

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