Store terminal characters.

This commit is contained in:
2024-01-21 10:49:11 +01:00
parent c41a9a1034
commit 847bf8c84b
2 changed files with 55 additions and 4 deletions

View File

@@ -34,12 +34,26 @@ struct VgaDoubleColor
{
VgaColor foreground : 4 = VgaColor::LIGHT_GREY;
VgaColor background : 4 = VgaColor::BLACK;
[[nodiscard]] VgaDoubleColor swapped() const noexcept
{
return VgaDoubleColor{.foreground = background, .background = foreground};
}
};
struct VgaCharacter
{
char character = '\0';
VgaDoubleColor color = {};
};
void initialize() noexcept;
void setColor(VgaDoubleColor color) noexcept;
const VgaDoubleColor& getColor() noexcept;
void putEntryAt(char chr, VgaDoubleColor color, size_t posX, size_t posY) noexcept;
VgaCharacter getEntryAt(size_t posX, size_t posY) noexcept;
void putChar(char chr) noexcept;
void putChar(char chr, VgaDoubleColor color) noexcept;
void deleteChar() noexcept;
void write(const char* data, size_t size) noexcept;
void write(const char* data) noexcept;