Main Page | Data Structures | File List | Globals | Related Pages

console.c File Reference

A console driver. More...

#include <console.h>
#include <string.h>
#include <x86/pio.h>
#include <x86/proc_reg.h>

Defines

#define CONSOLE_CELL(x, y)   ((char *) CONSOLE_MEM_BASE + 2 * ((y) * CONSOLE_WIDTH + (x)))

Functions

void console_erase (int row, int col, int w, int h, int overwrite)
 Erases a part of the console.

void console_scroll (unsigned lines)
 Scrolls the console.

void console_backspace (unsigned distance)
 Backs up the cursor.

int putbyte (char ch)
void putbytes (const char *s, int len)
void set_term_color (int color)
void get_term_color (int *color)
void crtc_set_cursor (unsigned short pos)
 Set the CRTC cursor position.

void set_cursor (int row, int col)
void get_cursor (int *row, int *col)
void hide_cursor ()
void show_cursor ()
void clear_console ()
void draw_char (int row, int col, int ch, int color)
char get_char (int row, int col)

Variables

int consoleColor = FGND_LGRAY | BGND_BLACK
int cursorX = 0
int cursorY = 0
int cursorHidden = 1


Detailed Description

A console driver.

This driver implements the console. The console maintains its own cursor position, term color, and cursor visibility, independent of the hardware cursor, so that the cursor can be freely moved despite the actual visibility status.

Author:
Lee Salzman (lsalzman)
Bug:
No known bugs.

Function Documentation

void console_backspace unsigned  distance  ) 
 

Backs up the cursor.

Move the cursor backward a specified distance and clear the characters along the way.

Parameters:
distance the number of characters to backspace
Returns:
Void

void console_erase int  row,
int  col,
int  w,
int  h,
int  overwrite
 

Erases a part of the console.

Overwrites the specified screen region with the current console color.

Parameters:
row the row of upper left corner of the region
col the column of the upper left corner of the region
w the width of the region
h the height of the region
overwrite whether or not to overwrite the color
Returns:
Void

void console_scroll unsigned  lines  ) 
 

Scrolls the console.

Scroll the console down a specified number of lines and clear the new space.

Parameters:
lines the number of lines to scroll
Returns:
Void

void crtc_set_cursor unsigned short  pos  )  [static]
 

Set the CRTC cursor position.

Outputs the position to the CRTC cursor register.

Parameters:
pos 16-bit cursor position
Returns:
Void


Generated on Fri Apr 9 21:59:16 2004 for 15-410 Project 3 by doxygen 1.3.2