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
CP437 code for vertical bar
CP437 code for horizontal bar
CP437 code for lower-left corner symbol
CP437 code for upper-left corner symbol
CP437 code for lower-right corner symbol
CP437 code for upper-right corner symbol
Function Documentation
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_p | address 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:
-
ch | character to fill the screen with |
attr | attribute 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:
-
ch | character to print |
attr | attribute of character to print |
r | row where to print (row 0 is the first one) |
c | column 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:
-
str | string to print |
attr | attribute of character to print |
r | row where to print (row 0 is the first one) |
c | column 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:
-
n | integer number to print |
attr | attribute of character to print |
r | row where to print (row 0 is the first one) |
c | column 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:
-
width | frame width in number of columns |
height | frame heigth in number of lines |
attr | attribute of frame to draw |
r | row where to print top left corner (row 0 is the first one) |
c | column where to print top left corner (column 0 is the first one) |
- Returns:
- 0 upon success, non-zero upon failure