Max OS 0.3
Loading...
Searching...
No Matches
textmode.h
Go to the documentation of this file.
1
9#ifndef MAXOS_DRIVERS_CONSOLE_TEXTMODECONSOLE_H
10#define MAXOS_DRIVERS_CONSOLE_TEXTMODECONSOLE_H
11
12#include <cstdint>
13#include <drivers/driver.h>
15
16
17namespace MaxOS::drivers::console {
18
23 class TextModeConsole : public Driver, public Console {
24 private:
25 uint16_t* m_video_memory { (uint16_t*) 0xB8000 };
26
27 public:
30
31 uint16_t width() final;
32 uint16_t height() final;
33
34 void put_character(uint16_t x, uint16_t y, char c) final;
35 void set_foreground_color(uint16_t x, uint16_t y, common::ConsoleColour) final;
36 void set_background_color(uint16_t x, uint16_t y, common::ConsoleColour) final;
37
38 char get_character(uint16_t x, uint16_t y) final;
39 common::ConsoleColour get_foreground_color(uint16_t x, uint16_t y) final;
40 common::ConsoleColour get_background_color(uint16_t x, uint16_t y) final;
41 };
42
43}
44
45
46#endif //MAXOS_DRIVERS_CONSOLE_TEXTMODECONSOLE_H
base class for all drivers, handles the activation, deactivation, initialisation and reset of the dri...
Definition driver.h:27
Abstract class for a console, allows for the printing of characters and strings with colours.
Definition console.h:24
Driver for the text mode console, handles the printing of characters and strings to the screen using ...
Definition textmode.h:23
void put_character(uint16_t x, uint16_t y, char c) final
Places a character at the specified location if it is in bounds.
Definition textmode.cpp:45
common::ConsoleColour get_background_color(uint16_t x, uint16_t y) final
Gets the background color at the specified location.
Definition textmode.cpp:145
void set_background_color(uint16_t x, uint16_t y, common::ConsoleColour) final
Sets the background color at the specified location.
Definition textmode.cpp:85
common::ConsoleColour get_foreground_color(uint16_t x, uint16_t y) final
Gets the foreground color at the specified location.
Definition textmode.cpp:125
uint16_t width() final
Gets the width of the console.
Definition textmode.cpp:25
uint16_t height() final
Gets the height of the console.
Definition textmode.cpp:34
void set_foreground_color(uint16_t x, uint16_t y, common::ConsoleColour) final
Sets the foreground color at the specified location.
Definition textmode.cpp:65
char get_character(uint16_t x, uint16_t y) final
Gets the character at the specified location.
Definition textmode.cpp:105
ConsoleColour
Enumeration of console colour codes.
Definition colour.h:67
Defines a Console class for handling text-based console output with colour support.
Defines a base Driver class and DriverManager for managing drivers.