MentOS
0.8.0
The Mentoring Operating System
|
Video functions and costants. More...
Classes | |
struct | ansi_color_map_t |
Stores the association between ANSI colors and pure VIDEO colors. More... | |
Macros | |
#define | HEIGHT 25 |
The height of the. | |
#define | WIDTH 80 |
The width of the. | |
#define | W2 (WIDTH * 2) |
The width of the. | |
#define | TOTAL_SIZE (HEIGHT * WIDTH * 2) |
The total size of the screen. | |
#define | ADDR (char *)0xB8000U |
The address of the. | |
#define | STORED_PAGES 3 |
The number of stored pages. | |
Functions | |
static unsigned | __get_x (void) |
Get the current column number. More... | |
static unsigned | __get_y (void) |
Get the current row number. More... | |
static void | __draw_char (char c) |
Draws the given character. More... | |
static void | __set_color (uint8_t ansi_code) |
Sets the provided ansi code. More... | |
static void | __move_cursor_backward (int erase, int amount) |
Moves the cursor backward. More... | |
static void | __move_cursor_forward (int erase, int amount) |
Moves the cursor forward. More... | |
static void | __video_set_cursor (unsigned int x, unsigned int y) |
Issue the vide to move the cursor to the given position. More... | |
void | video_init (void) |
Initialize the video. | |
void | video_update (void) |
Updates the video. | |
void | video_putc (int c) |
Print the given character on the screen. More... | |
void | video_puts (const char *str) |
Prints the given string on the screen. More... | |
void | video_set_cursor_auto (void) |
When something is written in another position, update the cursor. | |
void | video_move_cursor (unsigned int x, unsigned int y) |
Move the cursor at the position x, y on the screen. More... | |
void | video_get_cursor_position (unsigned int *x, unsigned int *y) |
Returns cursor's position on the screen. More... | |
void | video_get_screen_size (unsigned int *width, unsigned int *height) |
Returns screen size. More... | |
void | video_clear (void) |
Clears the screen. | |
void | video_new_line (void) |
Move to the following line (the effect of character). | |
void | video_cartridge_return (void) |
Move to the up line (the effect of character). | |
void | video_shift_one_line_up (void) |
The whole screen is shifted up by one line. Used when the cursor reaches the last position of the screen. | |
void | video_shift_one_page_up (void) |
The whole screen is shifted up by one page. | |
void | video_shift_one_page_down (void) |
The whole screen is shifted down by one page. | |
Variables | |
struct ansi_color_map_t | ansi_color_map [] |
The mapping. | |
char * | pointer = ADDR |
Pointer to a position of the screen writer. | |
unsigned char | color = 7 |
The current color. | |
int | escape_index = -1 |
Used to write on the escape_buffer. If -1, we are not parsing an escape sequence. | |
char | escape_buffer [256] |
Used to store an escape sequence. | |
char | upper_buffer [STORED_PAGES *TOTAL_SIZE] = { 0 } |
Buffer where we store the upper scroll history. | |
char | original_page [TOTAL_SIZE] = { 0 } |
Buffer where we store the lower scroll history. | |
int | scrolled_page = 0 |
Determines if the screen is currently scrolled. | |
Video functions and costants.
|
inlinestatic |
Draws the given character.
c | The character to draw. |
|
inlinestatic |
Get the current column number.
|
inlinestatic |
Get the current row number.
|
inlinestatic |
Moves the cursor backward.
erase | If 1 also erase the character. |
amount | How many times we move backward. |
|
inlinestatic |
Moves the cursor forward.
erase | If 1 also erase the character. |
amount | How many times we move forward. |
|
inlinestatic |
Sets the provided ansi code.
ansi_code | The ansi code describing background and foreground color. |
|
inlinestatic |
Issue the vide to move the cursor to the given position.
x | The x coordinate. |
y | The y coordinate. |
void video_get_cursor_position | ( | unsigned int * | x, |
unsigned int * | y | ||
) |
Returns cursor's position on the screen.
x | The output x coordinate. |
y | The output y coordinate. |
void video_get_screen_size | ( | unsigned int * | width, |
unsigned int * | height | ||
) |
Returns screen size.
width | The screen width. |
height | The screen height. |
void video_move_cursor | ( | unsigned int | x, |
unsigned int | y | ||
) |
Move the cursor at the position x, y on the screen.
x | The x coordinate. |
y | The y coordinate. |
void video_putc | ( | int | c | ) |
Print the given character on the screen.
c | The character to print. |
void video_puts | ( | const char * | str | ) |
Prints the given string on the screen.
str | The string to print. |