MicrOS
|
#include "vga.h"
Functions | |
uint8_t | vga_init (uint8_t mode) |
Initialization of VGA. More... | |
void | vga_printchar (char character) |
Print character on screen. More... | |
void | vga_printchar_color (char character, vga_color *color) |
Print character on screen. More... | |
void | vga_printstring (const char *str) |
Print string on screen. More... | |
void | vga_printstring_color (const char *str, vga_color *color) |
Print string on screen. More... | |
void | vga_set_char (uint16_t x, uint16_t y, char character) |
Set character on given point on screen. More... | |
void | vga_set_char_struct (vga_screen_pos spos, char c) |
Set character on given point on screen. More... | |
char | vga_get_char (uint16_t x, uint16_t y) |
Get character from given point on screen. More... | |
char | vga_get_char_struct (vga_screen_pos spos) |
Get character from given point on screen. More... | |
void | vga_set_color (uint16_t x, uint16_t y, vga_color col) |
Set character color on given point on screen. More... | |
void | vga_set_color_struct (vga_screen_pos spos, vga_color col) |
Set character color on given point on screen. More... | |
vga_color | vga_get_color (uint16_t x, uint16_t y) |
Get character color from given point on screen. More... | |
vga_color | vga_get_color_struct (vga_screen_pos spos) |
Get character color from given point on screen. More... | |
void | vga_set_character (uint16_t x, uint16_t y, vga_character character) |
Set character and character color on given point on screen. More... | |
void | vga_set_character_struct (vga_screen_pos spos, vga_character character) |
Set character and character color on given point on screen. More... | |
vga_character | vga_get_character (uint16_t x, uint16_t y) |
Get character and character color color from given point on screen. More... | |
vga_character | vga_get_character_struct (vga_screen_pos spos) |
Get character and character color color from given point on screen. More... | |
void | vga_set_cursor_pos (uint16_t x, uint16_t y) |
Set cursor position. More... | |
void | vga_set_cursor_pos_struct (vga_screen_pos spos) |
Set cursor position. More... | |
vga_screen_pos | vga_get_cursor_pos () |
Get cursor position. More... | |
void | vga_clear_screen () |
Clear screen. More... | |
void | vga_clear_given_screen (uint8_t screen) |
Clear given screen. More... | |
void | vga_clear_all_screens () |
Clear all screen. More... | |
void | vga_change_printing_screen (uint8_t screen) |
Change printing screen. More... | |
void | vga_copy_screen (uint8_t from, uint8_t to) |
Copy printing screen. More... | |
void | vga_cursor_on () |
Turn on cursor. More... | |
void | vga_cursor_off () |
Turn off cursor. More... | |
void | vga_newline () |
Print new line. More... | |
uint16_t | __vga_calcualte_position_with_offset (uint16_t x, uint16_t y) |
Calculate position with offset. More... | |
uint16_t | __vga_calcualte_position_without_offset (uint16_t x, uint16_t y) |
Calculate position without offset. More... | |
void | __vga_enable_cursor (uint8_t cursor_start, uint8_t cursor_end) |
Turn on cursor. More... | |
void | __vga_disable_cursor () |
Disable cursor. More... | |
vga_color | __vga_get_default_terminal_color (uint8_t vga_current_mode) |
Get default terminal color. More... | |
Variables | |
volatile screen_char * | vga_video |
Pointer to current screen. More... | |
uint8_t | vga_current_printing_screen = 0 |
Current video screen. More... | |
uint16_t | vga_screen_offset = 0 |
Current offset for screen. More... | |
uint8_t | vga_current_mode = 0 |
Current text mode. More... | |
uint16_t | vga_current_columns = 0 |
Number of columns screens for current text mode. More... | |
uint16_t | vga_current_rows = 0 |
Number of rows screens for current text mode. More... | |
uint16_t | vga_current_max_screens = 0 |
Number of max screens for current text mode. More... | |
uint16_t | vga_current_screen_offset = 0 |
Offset between screens for current text mode. More... | |
uint16_t __vga_calcualte_position_with_offset | ( | uint16_t | x, |
uint16_t | y | ||
) |
Calculate position with offset.
Calculate position on screen takes into account the current offset. Which means function return value that added to base address will give you position of current character on current screen in memory.
x | x coordinate. |
y | y coordinate. |
uint16_t __vga_calcualte_position_without_offset | ( | uint16_t | x, |
uint16_t | y | ||
) |
Calculate position without offset.
Calculate position on screen doesn't take into account the current offset. Which means function return value that added to base address will give you position of current character on first screen in memory.
x | x coordinate. |
y | y coordinate. |
void __vga_disable_cursor | ( | ) |
Disable cursor.
void __vga_enable_cursor | ( | uint8_t | cursor_start, |
uint8_t | cursor_end | ||
) |
Turn on cursor.
Turn on cursor with given size and position.
cursor_start | Scanline where cursor should start. |
cursor_end | Scanline where cursor should end. |
vga_color __vga_get_default_terminal_color | ( | uint8_t | vga_current_mode | ) |
Get default terminal color.
Get default terminal color for mode.
vga_mode | Current mode of graphic card. |
void vga_change_printing_screen | ( | uint8_t | screen | ) |
Change printing screen.
Change screen where text are printing. /param screen New screen for printing. Value valid for current text mode.
void vga_clear_all_screens | ( | ) |
Clear all screen.
Clears letters and colors from all screens. Set colors to default.
void vga_clear_given_screen | ( | uint8_t | screen | ) |
Clear given screen.
Clears letters and colors from given screen. Set colors to default.
screen | Screen to clear. Value valid for current text mode. |
void vga_clear_screen | ( | ) |
Clear screen.
Clears letters and colors. Set colors to default.
void vga_copy_screen | ( | uint8_t | from, |
uint8_t | to | ||
) |
Copy printing screen.
Copy screen from one to another. /param from Screen to copy. Value valid for current text mode. /param to Destination screen. Value valid for current text mode.
void vga_cursor_off | ( | ) |
Turn off cursor.
void vga_cursor_on | ( | ) |
Turn on cursor.
Turn on cursor with default size and position.
char vga_get_char | ( | uint16_t | x, |
uint16_t | y | ||
) |
Get character from given point on screen.
Get character on given point on screen.
x | x coordinate. |
y | y coordinate. |
char vga_get_char_struct | ( | vga_screen_pos | spos | ) |
Get character from given point on screen.
Get character on given point on screen.
spos | Position on screen. |
vga_character vga_get_character | ( | uint16_t | x, |
uint16_t | y | ||
) |
Get character and character color color from given point on screen.
Get character and character color color on given point on screen.
x | x coordinate. |
y | y coordinate. |
vga_character vga_get_character_struct | ( | vga_screen_pos | spos | ) |
Get character and character color color from given point on screen.
Get character and character color color on given point on screen.
spos | Position on screen. |
vga_color vga_get_color | ( | uint16_t | x, |
uint16_t | y | ||
) |
Get character color from given point on screen.
Get character color on given point on screen.
x | x coordinate. |
y | y coordinate. |
vga_color vga_get_color_struct | ( | vga_screen_pos | spos | ) |
Get character color from given point on screen.
Get character color on given point on screen.
spos | Position on screen. |
vga_screen_pos vga_get_cursor_pos | ( | ) |
Get cursor position.
Get cursor position on screen.
uint8_t vga_init | ( | uint8_t | mode | ) |
Initialization of VGA.
Sets internal variables to given text mode and clear all screens.
mode | Text mode you want to switch. |
void vga_newline | ( | ) |
Print new line.
void vga_printchar | ( | char | character | ) |
Print character on screen.
Print character on screen without changing color of character and background.
character | Character. |
void vga_printchar_color | ( | char | character, |
vga_color * | color | ||
) |
Print character on screen.
Print character on screen with given color of character and background.
character | Character. |
color | Color. |
void vga_printstring | ( | const char * | str | ) |
Print string on screen.
Print string on screen without changing color of characters and background.
str | String. |
void vga_printstring_color | ( | const char * | str, |
vga_color * | color | ||
) |
Print string on screen.
Print string on screen with given color of characters and background.
str | String. |
color | Color. |
void vga_set_char | ( | uint16_t | x, |
uint16_t | y, | ||
char | character | ||
) |
Set character on given point on screen.
Set character on given point on screen without changing color of character and background.
x | x coordinate. |
y | y coordinate. |
character | Character. |
void vga_set_char_struct | ( | vga_screen_pos | spos, |
char | character | ||
) |
Set character on given point on screen.
Set character on given point on screen without changing color of character and background.
spos | Position on screen. |
character | Character. |
void vga_set_character | ( | uint16_t | x, |
uint16_t | y, | ||
vga_character | character | ||
) |
Set character and character color on given point on screen.
Set character and character color on given point on screen.
x | x coordinate. |
y | y coordinate. |
character | Character and character color. |
void vga_set_character_struct | ( | vga_screen_pos | spos, |
vga_character | character | ||
) |
Set character and character color on given point on screen.
Set character and character color on given point on screen.
spos | Position on screen. |
character | Character and character color. |
void vga_set_color | ( | uint16_t | x, |
uint16_t | y, | ||
vga_color | col | ||
) |
Set character color on given point on screen.
Set character color on given point on screen without changing letter.
x | x coordinate. |
y | y coordinate. |
col | Color. |
void vga_set_color_struct | ( | vga_screen_pos | spos, |
vga_color | col | ||
) |
Set character color on given point on screen.
Set character color on given point on screen without changing letter.
spos | Position on screen. |
col | Color. |
void vga_set_cursor_pos | ( | uint16_t | x, |
uint16_t | y | ||
) |
Set cursor position.
Set cursor position on screen.
x | x coordinate. |
y | y coordinate. |
void vga_set_cursor_pos_struct | ( | vga_screen_pos | spos | ) |
Set cursor position.
Set cursor position on screen.
spos | Position on screen. |
uint16_t vga_current_columns = 0 |
Number of columns screens for current text mode.
uint16_t vga_current_max_screens = 0 |
Number of max screens for current text mode.
uint8_t vga_current_mode = 0 |
Current text mode.
uint8_t vga_current_printing_screen = 0 |
Current video screen.
uint16_t vga_current_rows = 0 |
Number of rows screens for current text mode.
uint16_t vga_current_screen_offset = 0 |
Offset between screens for current text mode.
uint16_t vga_screen_offset = 0 |
Current offset for screen.
When we add this to vga_video
we wil get address of screen we should work on.
volatile screen_char* vga_video |
Pointer to current screen.
Points to array of characters