#include "console.h"#include "font/font8x16.h"#include "hal.h"#include "color.h"#include "string.h"#include <ctype.h>Data Structures | |
| struct | cell |
| A single cell in the console. More... | |
Macros | |
| #define | SCREEN_X 255 |
| Screen X resolution. | |
| #define | SCREEN_Y 255 |
| Screen Y resolution. | |
Functions | |
| static void | cdrawchar (char c, int row, int col, color_t color) |
| Draws a character at a position, using the font specified in font8x16.h. | |
| static void | handle_cntrl_char (char c) |
| Handles a control character. | |
| void | credrawchar (uint32_t row, uint32_t col) |
| Redraws a character. | |
| void | crefresh (void) |
| Refreshes the console's screen. | |
| void | cclear (color_t color) |
| Clears the console's screen. | |
| void | cclearchar (uint32_t row, uint32_t col, color_t color) |
| Clears a cell. | |
| void | cclearcurchar (color_t color) |
| Clears the cell at the cursor's position. | |
| void | cprint (const char *str, color_t color) |
| Prints a string to the console, without a newline. | |
| void | cmovecursor (int32_t rows, int32_t cols) |
| Moves the cursor by an offset. | |
| void | cprintln (const char *str, color_t color) |
| Prints a string to the console followed by a newline. | |
| void | cputchar (char c, color_t color) |
| Prints a character at the cursor's position in the given color. | |
| void | cputint (int i, color_t color) |
| Writes an integer in base 10 at the cursor's position in the given color. | |
| void | crcursor (void) |
| Resets the cursor's position. | |
| void | csetcursor (uint32_t row, uint32_t col) |
| Sets the cursor's position. | |
| void | csetrow (int32_t r) |
| Sets the cursor's row. | |
| void | csetcol (int32_t c) |
| Sets the cursor's column. | |
| uint32_t | cgetcol (void) |
| Gets the cursor's column. | |
| uint32_t | cgetrow (void) |
| Gets the cursor's row. | |
Variables | |
| static struct cell | screen_buffer [SCREEN_Y][SCREEN_X] = { 0 } |
| The console's screen buffer. | |
| static uint8_t | row = 0 |
| static uint8_t | col = 0 |
| #define SCREEN_X 255 |
Screen X resolution.
| #define SCREEN_Y 255 |
Screen Y resolution.
| void cclear | ( | color_t | color | ) |
Clears the console's screen.
| color | Background color. |
Clears a cell.
| row | The row. |
| col | The column. |
| color | Background color. |
| void cclearcurchar | ( | color_t | color | ) |
Clears the cell at the cursor's position.
| color | Background color. |
|
static |
Draws a character at a position, using the font specified in font8x16.h.
| uint32_t cgetcol | ( | void | ) |
Gets the cursor's column.
| uint32_t cgetrow | ( | void | ) |
Gets the cursor's row.
Moves the cursor by an offset.
| rows | Number of rows. |
| cols | Number of columns. |
| void cprint | ( | const char * | str, |
| color_t | color | ||
| ) |
Prints a string to the console, without a newline.
| str | String to be printed. Must be null-terminated. |
| color | Foreground color. |
| void cprintln | ( | const char * | str, |
| color_t | color | ||
| ) |
Prints a string to the console followed by a newline.
| str | String to be printed. Must be null-terminated. |
| color | Foreground color of the text. |
| void cputchar | ( | char | c, |
| color_t | color | ||
| ) |
Prints a character at the cursor's position in the given color.
| c | Character to be written. |
| color | Foreground color of the text. |
| void cputint | ( | int | i, |
| color_t | color | ||
| ) |
Writes an integer in base 10 at the cursor's position in the given color.
| i | Integer to be written. |
| color | Foreground color of the text. |
| void crcursor | ( | void | ) |
Resets the cursor's position.
Redraws a character.
| row | The row. |
| col | The column. |
| void crefresh | ( | void | ) |
Refreshes the console's screen.
| void csetcol | ( | int32_t | col | ) |
Sets the cursor's column.
| col | Column |
Sets the cursor's position.
| row | The row. |
| col | The column. |
| void csetrow | ( | int32_t | row | ) |
Sets the cursor's row.
| row | Row. |
|
static |
Handles a control character.
|
static |
|
static |