// // Created by Stepan Usatiuk on 02.03.2025. // #ifndef DISP_TTY_HPP #define DISP_TTY_HPP #include #include #include "config.hpp" #include class FbTty { public: void putchar(char c); void putstr(const char* str); void reset(); template auto fmt(std::format_string fmt, Args&&... args) { auto str = std::format(fmt, std::forward(args)...); putstr(str.c_str()); } private: void draw_char(int col, int row); int _cur_col = 0; int _cur_row = 0; static constexpr size_t _max_col = DISP_WIDTH / 8; static constexpr size_t _max_row = DISP_HEIGHT / 16; std::array, _max_col> _buf = {}; void next_col(); void next_row(); }; #endif // DISP_TTY_HPP