9 #define VGA_COLOR_BLACK 0x00 10 #define VGA_COLOR_BLUE 0x01 11 #define VGA_COLOR_GREEN 0x02 12 #define VGA_COLOR_CYAN 0x03 13 #define VGA_COLOR_RED 0x04 14 #define VGA_COLOR_MAGENTA 0x05 15 #define VGA_COLOR_BROWN 0x06 16 #define VGA_COLOR_LIGHT_GRAY 0x07 17 #define VGA_COLOR_DARK_GRAY 0x08 18 #define VGA_COLOR_LIGHT_BLUE 0x09 19 #define VGA_COLOR_LIGHT_GREEN 0x0A 20 #define VGA_COLOR_LIGHT_CYAN 0x0B 21 #define VGA_COLOR_LIGHT_RED 0x0C 22 #define VGA_COLOR_LIGHT_MAGENTA 0x0D 23 #define VGA_COLOR_YELLOW 0x0E 24 #define VGA_COLOR_WHITE 0x0F 25 #define VGA_NOT_BLINK 0x00 26 #define VGA_BLINK 0x01 41 #define VGA_MODE_00H_BASE_ADDR 0xC00B8000 42 #define VGA_MODE_00H_SCREEN_COLUMNS 40 44 #define VGA_MODE_00H_SCREEN_ROWS 25 47 #define VGA_MODE_00H_COLOR_BLACK 0x00 48 #define VGA_MODE_00H_COLOR_BLUE 0x01 49 #define VGA_MODE_00H_COLOR_GREEN 0x02 50 #define VGA_MODE_00H_COLOR_CYAN 0x03 51 #define VGA_MODE_00H_COLOR_RED 0x04 52 #define VGA_MODE_00H_COLOR_MAGENTA 0x05 53 #define VGA_MODE_00H_COLOR_BROWN 0x06 54 #define VGA_MODE_00H_COLOR_LIGHT_GRAY 0x07 55 #define VGA_MODE_00H_COLOR_DARK_GRAY 0x08 56 #define VGA_MODE_00H_COLOR_LIGHT_BLUE 0x09 57 #define VGA_MODE_00H_COLOR_LIGHT_GREEN 0x0A 58 #define VGA_MODE_00H_COLOR_LIGHT_CYAN 0x0B 59 #define VGA_MODE_00H_COLOR_LIGHT_RED 0x0C 60 #define VGA_MODE_00H_COLOR_LIGHT_MAGENTA 0x0D 61 #define VGA_MODE_00H_COLOR_YELLOW 0x0E 62 #define VGA_MODE_00H_COLOR_WHITE 0x0F 63 #define VGA_MODE_00H_NOT_BLINK 0x00 64 #define VGA_MODE_00H_BLINK 0x01 66 #define VGA_MODE_00H_MAX_SCREENS 8 67 #define VGA_MODE_00H_SCREEN_OFFSET 4000 72 #define VGA_MODE_01H_BASE_ADDR 0xC00B8000 73 #define VGA_MODE_01H_SCREEN_COLUMNS 40 75 #define VGA_MODE_01H_SCREEN_ROWS 25 78 #define VGA_MODE_01H_COLOR_BLACK 0x00 79 #define VGA_MODE_01H_COLOR_BLUE 0x01 80 #define VGA_MODE_01H_COLOR_GREEN 0x02 81 #define VGA_MODE_01H_COLOR_CYAN 0x03 82 #define VGA_MODE_01H_COLOR_RED 0x04 83 #define VGA_MODE_01H_COLOR_MAGENTA 0x05 84 #define VGA_MODE_01H_COLOR_BROWN 0x06 85 #define VGA_MODE_01H_COLOR_LIGHT_GRAY 0x07 86 #define VGA_MODE_01H_COLOR_DARK_GRAY 0x08 87 #define VGA_MODE_01H_COLOR_LIGHT_BLUE 0x09 88 #define VGA_MODE_01H_COLOR_LIGHT_GREEN 0x0A 89 #define VGA_MODE_01H_COLOR_LIGHT_CYAN 0x0B 90 #define VGA_MODE_01H_COLOR_LIGHT_RED 0x0C 91 #define VGA_MODE_01H_COLOR_LIGHT_MAGENTA 0x0D 92 #define VGA_MODE_01H_COLOR_YELLOW 0x0E 93 #define VGA_MODE_01H_COLOR_WHITE 0x0F 94 #define VGA_MODE_01H_NOT_BLINK 0x00 95 #define VGA_MODE_01H_BLINK 0x01 97 #define VGA_MODE_01H_MAX_SCREENS 8 98 #define VGA_MODE_01H_SCREEN_OFFSET 4000 103 #define VGA_MODE_02H_BASE_ADDR 0xC00B8000 104 #define VGA_MODE_02H_SCREEN_COLUMNS 80 106 #define VGA_MODE_02H_SCREEN_ROWS 25 109 #define VGA_MODE_02H_COLOR_BLACK 0x00 110 #define VGA_MODE_02H_COLOR_BLUE 0x01 111 #define VGA_MODE_02H_COLOR_GREEN 0x02 112 #define VGA_MODE_02H_COLOR_CYAN 0x03 113 #define VGA_MODE_02H_COLOR_RED 0x04 114 #define VGA_MODE_02H_COLOR_MAGENTA 0x05 115 #define VGA_MODE_02H_COLOR_BROWN 0x06 116 #define VGA_MODE_02H_COLOR_LIGHT_GRAY 0x07 117 #define VGA_MODE_02H_COLOR_DARK_GRAY 0x08 118 #define VGA_MODE_02H_COLOR_LIGHT_BLUE 0x09 119 #define VGA_MODE_02H_COLOR_LIGHT_GREEN 0x0A 120 #define VGA_MODE_02H_COLOR_LIGHT_CYAN 0x0B 121 #define VGA_MODE_02H_COLOR_LIGHT_RED 0x0C 122 #define VGA_MODE_02H_COLOR_LIGHT_MAGENTA 0x0D 123 #define VGA_MODE_02H_COLOR_YELLOW 0x0E 124 #define VGA_MODE_02H_COLOR_WHITE 0x0F 125 #define VGA_MODE_02H_NOT_BLINK 0x00 126 #define VGA_MODE_02H_BLINK 0x01 128 #define VGA_MODE_02H_MAX_SCREENS 8 129 #define VGA_MODE_02H_SCREEN_OFFSET 4000 134 #define VGA_MODE_03H_BASE_ADDR 0xC00B8000 135 #define VGA_MODE_03H_SCREEN_COLUMNS 80 137 #define VGA_MODE_03H_SCREEN_ROWS 25 140 #define VGA_MODE_03H_COLOR_BLACK 0x00 141 #define VGA_MODE_03H_COLOR_BLUE 0x01 142 #define VGA_MODE_03H_COLOR_GREEN 0x02 143 #define VGA_MODE_03H_COLOR_CYAN 0x03 144 #define VGA_MODE_03H_COLOR_RED 0x04 145 #define VGA_MODE_03H_COLOR_MAGENTA 0x05 146 #define VGA_MODE_03H_COLOR_BROWN 0x06 147 #define VGA_MODE_03H_COLOR_LIGHT_GRAY 0x07 148 #define VGA_MODE_03H_COLOR_DARK_GRAY 0x08 149 #define VGA_MODE_03H_COLOR_LIGHT_BLUE 0x09 150 #define VGA_MODE_03H_COLOR_LIGHT_GREEN 0x0A 151 #define VGA_MODE_03H_COLOR_LIGHT_CYAN 0x0B 152 #define VGA_MODE_03H_COLOR_LIGHT_RED 0x0C 153 #define VGA_MODE_03H_COLOR_LIGHT_MAGENTA 0x0D 154 #define VGA_MODE_03H_COLOR_YELLOW 0x0E 155 #define VGA_MODE_03H_COLOR_WHITE 0x0F 156 #define VGA_MODE_03H_NOT_BLINK 0x00 157 #define VGA_MODE_03H_BLINK 0x01 159 #define VGA_MODE_03H_MAX_SCREENS 8 160 #define VGA_MODE_03H_SCREEN_OFFSET 4000 165 #define VGA_MODE_07H_BASE_ADDR 0xC00B0000 166 #define VGA_MODE_07H_SCREEN_COLUMNS 80 168 #define VGA_MODE_07H_SCREEN_ROWS 25 171 #define VGA_MODE_07H_COLOR_BLACK 0x00 172 #define VGA_MODE_07H_COLOR_BLUE 0x01 173 #define VGA_MODE_07H_COLOR_GREEN 0x02 174 #define VGA_MODE_07H_COLOR_CYAN 0x03 175 #define VGA_MODE_07H_COLOR_RED 0x04 176 #define VGA_MODE_07H_COLOR_MAGENTA 0x05 177 #define VGA_MODE_07H_COLOR_BROWN 0x06 178 #define VGA_MODE_07H_COLOR_LIGHT_GRAY 0x07 179 #define VGA_MODE_07H_COLOR_DARK_GRAY 0x08 180 #define VGA_MODE_07H_COLOR_LIGHT_BLUE 0x09 181 #define VGA_MODE_07H_COLOR_LIGHT_GREEN 0x0A 182 #define VGA_MODE_07H_COLOR_LIGHT_CYAN 0x0B 183 #define VGA_MODE_07H_COLOR_LIGHT_RED 0x0C 184 #define VGA_MODE_07H_COLOR_LIGHT_MAGENTA 0x0D 185 #define VGA_MODE_07H_COLOR_YELLOW 0x0E 186 #define VGA_MODE_07H_COLOR_WHITE 0x0F 187 #define VGA_MODE_07H_NOT_BLINK 0x00 188 #define VGA_MODE_07H_BLINK 0x01 190 #define VGA_MODE_07H_MAX_SCREENS 1 191 #define VGA_MODE_07H_SCREEN_OFFSET 4000 Define one character on screen.
Definition: vga.h:251
VGA mode 02h.
Definition: vga.h:33
uint16_t __vga_calcualte_position_with_offset(uint16_t x, uint16_t y)
Calculate position with offset.
Definition: vga.c:394
vga_character vga_get_character(uint16_t x, uint16_t y)
Get character and character color color from given point on screen.
Definition: vga.c:230
void vga_printchar_color(char character, vga_color *color)
Print character on screen.
Definition: vga.c:129
void vga_set_color(uint16_t x, uint16_t y, vga_color col)
Set character color on given point on screen.
Definition: vga.c:197
vga_character character
Struct contains ASCII code and color data.
Definition: vga.h:255
void vga_set_char_struct(vga_screen_pos spos, char character)
Set character on given point on screen.
Definition: vga.c:181
void vga_printstring(const char *str)
Print string on screen.
Definition: vga.c:155
unsigned char letter
Color of letter.
Definition: vga.h:221
void vga_clear_screen()
Clear screen.
Definition: vga.c:270
void vga_newline()
Print new line.
Definition: vga.c:361
void vga_set_character(uint16_t x, uint16_t y, vga_character character)
Set character and character color on given point on screen.
Definition: vga.c:219
uint16_t x
Position x on screen.
Definition: vga.h:197
vga_screen_pos vga_get_cursor_pos()
Get cursor position.
Definition: vga.c:257
unsigned char blikning
Flag for enable blinking.
Definition: vga.h:212
VGA mode 01h.
Definition: vga.h:32
void __vga_enable_cursor(uint8_t cursor_start, uint8_t cursor_end)
Turn on cursor.
Definition: vga.c:404
vga_color_with_blink color_with_blink
Uses to define color in blinking mode.
Definition: vga.h:231
void vga_set_cursor_pos_struct(vga_screen_pos spos)
Set cursor position.
Definition: vga.c:251
vga_color_without_blink color_without_blink
Uses to define color in non blinking mode.
Definition: vga.h:233
uint16_t __vga_calcualte_position_without_offset(uint16_t x, uint16_t y)
Calculate position without offset.
Definition: vga.c:399
Struct that defines position on screen.
Definition: vga.h:194
uint8_t vga_init(uint8_t mode)
Initialization of VGA.
Definition: vga.c:33
void vga_printchar(char character)
Print character on screen.
Definition: vga.c:103
void vga_set_color_struct(vga_screen_pos spos, vga_color col)
Set character color on given point on screen.
Definition: vga.c:203
VGA mode 00h.
Definition: vga.h:31
vga_color __vga_get_default_terminal_color(uint8_t vga_current_mode)
Get default terminal color.
Definition: vga.c:419
VGA mode 07h.
Definition: vga.h:35
Color of one character without blinking bit.
Definition: vga.h:218
void vga_clear_given_screen(uint8_t screen)
Clear given screen.
Definition: vga.c:291
vga_character vga_get_character_struct(vga_screen_pos spos)
Get character and character color color from given point on screen.
Definition: vga.c:236
uint8_t value
Uses to define color as value.
Definition: vga.h:235
uint8_t vga_current_mode
Current text mode.
Definition: vga.c:19
Struct that define one character.
Definition: vga.h:240
void vga_set_char(uint16_t x, uint16_t y, char character)
Set character on given point on screen.
Definition: vga.c:175
void vga_cursor_on()
Turn on cursor.
Definition: vga.c:351
void vga_copy_screen(uint8_t from, uint8_t to)
Copy printing screen.
Definition: vga.c:330
void vga_set_character_struct(vga_screen_pos spos, vga_character character)
Set character and character color on given point on screen.
Definition: vga.c:225
void vga_printstring_color(const char *str, vga_color *color)
Print string on screen.
Definition: vga.c:165
unsigned char background
Color of background.
Definition: vga.h:223
void __vga_disable_cursor()
Disable cursor.
Definition: vga.c:413
uint16_t value
16 bit value of field.
Definition: vga.h:253
void vga_set_cursor_pos(uint16_t x, uint16_t y)
Set cursor position.
Definition: vga.c:241
void vga_clear_all_screens()
Clear all screen.
Definition: vga.c:312
char vga_get_char_struct(vga_screen_pos spos)
Get character from given point on screen.
Definition: vga.c:192
vga_color color
Color of letter and background. In blinking mode also include blinking flag.
Definition: vga.h:245
Color of one character.
Definition: vga.h:229
union vga_color vga_get_color_struct(vga_screen_pos spos)
Get character color from given point on screen.
Definition: vga.c:214
VGA mode 03h.
Definition: vga.h:34
Color of one character with blinking bit.
Definition: vga.h:205
void vga_change_printing_screen(uint8_t screen)
Change printing screen.
Definition: vga.c:321
union vga_color vga_get_color(uint16_t x, uint16_t y)
Get character color from given point on screen.
Definition: vga.c:208
unsigned char ascii_code
ASCII code of letter.
Definition: vga.h:243
unsigned char letter
Color of letter.
Definition: vga.h:208
char vga_get_char(uint16_t x, uint16_t y)
Get character from given point on screen.
Definition: vga.c:186
VGA_TEXT_MODES
Enum represent available VGA text modes.
Definition: vga.h:29
static char mode
Definition: vga_gmode.c:20
void vga_cursor_off()
Turn off cursor.
Definition: vga.c:356
uint16_t y
Position y on screen.
Definition: vga.h:199
unsigned char background
Color of background.
Definition: vga.h:210