LAB1

video_txt

Defines for character codes to draw single border frames

#define VERT_BAR   0xB3
#define HOR_BAR   0xC4
#define LL_CORNER   0xC0
#define UL_CORNER   0xDA
#define LR_CORNER   0xD9
#define UR_CORNER   0xBF

Module's external functions

char * vt_init (vt_info_t *vi_p)
 Initializes the video module in text mode.
void vt_fill (char ch, char attr)
 Fills the screen with the input character, with the specified attribute.
void vt_blank ()
 Blanks screen.
int vt_print_char (char ch, char attr, int r, int c)
 Prints a character on the screen.
int vt_print_string (char *str, char attr, int r, int c)
 Prints a string on the screen.
int vt_print_int (int n, char attr, int r, int c)
 Prints an integer on the screen.
int vt_draw_frame (int width, int height, char attr, int r, int c)
 Draws a frame on the screen.

Detailed Description

Functions for outputing data to screen in text mode


Define Documentation

#define VERT_BAR   0xB3

CP437 code for vertical bar

#define HOR_BAR   0xC4

CP437 code for horizontal bar

#define LL_CORNER   0xC0

CP437 code for lower-left corner symbol

#define UL_CORNER   0xDA

CP437 code for upper-left corner symbol

#define LR_CORNER   0xD9

CP437 code for lower-right corner symbol

#define UR_CORNER   0xBF

CP437 code for upper-right corner symbol


Function Documentation

char* vt_init ( vt_info_t vi_p)

Initializes the video module in text mode.

Maps VRAM to the process' address space and initializes static global variables with the resolution of the screen

Parameters:
vi_paddress of vt_info_t structure with the necessary information
Returns:
Virtual address VRAM was mapped to. NULL, upon failure.
void vt_fill ( char  ch,
char  attr 
)

Fills the screen with the input character, with the specified attribute.

Parameters:
chcharacter to fill the screen with
attrattribute of character to fill the screen with
int vt_print_char ( char  ch,
char  attr,
int  r,
int  c 
)

Prints a character on the screen.

Prints a character, with the specified attribute, at the specified position on the screen in text mode, by writing to the corresponding location in VRAM

Parameters:
chcharacter to print
attrattribute of character to print
rrow where to print (row 0 is the first one)
ccolumn where to print (column 0 is the first one)
Returns:
0 upon success, non-zero upon failure
int vt_print_string ( char *  str,
char  attr,
int  r,
int  c 
)

Prints a string on the screen.

Prints a string, with the specified attribute, at the specified position in the screen in text mode, by writing to the corresponding location in VRAM

Parameters:
strstring to print
attrattribute of character to print
rrow where to print (row 0 is the first one)
ccolumn where to print (column 0 is the first one)
Returns:
0 upon success, non-zero upon failure
int vt_print_int ( int  n,
char  attr,
int  r,
int  c 
)

Prints an integer on the screen.

Prints an integer, with the specified attribute, at the specified position in the screen in text mode, by writing to the corresponding location in VRAM

Parameters:
ninteger number to print
attrattribute of character to print
rrow where to print (row 0 is the first one)
ccolumn where to print (column 0 is the first one)
Returns:
0 upon success, non-zero upon failure
int vt_draw_frame ( int  width,
int  height,
char  attr,
int  r,
int  c 
)

Draws a frame on the screen.

Draws a frame, with the specified dimensions and attribute, at the specified position in the screen in text mode, by writing to the corresponding location in VRAM

Parameters:
widthframe width in number of columns
heightframe heigth in number of lines
attrattribute of frame to draw
rrow where to print top left corner (row 0 is the first one)
ccolumn where to print top left corner (column 0 is the first one)
Returns:
0 upon success, non-zero upon failure
 All Data Structures Variables