From d2e1c8ba686d7d4ab32eda91c2f532676e9b8acf Mon Sep 17 00:00:00 2001 From: TheSoeren Date: Sun, 29 Sep 2024 14:03:39 +0000 Subject: create write_number function --- arch/x86_64/src/video/vga/text.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'arch/x86_64/src/video/vga') diff --git a/arch/x86_64/src/video/vga/text.cpp b/arch/x86_64/src/video/vga/text.cpp index f1e7412..bf60410 100644 --- a/arch/x86_64/src/video/vga/text.cpp +++ b/arch/x86_64/src/video/vga/text.cpp @@ -17,12 +17,6 @@ namespace teachos::arch::video::vga::text extern "C" std::pair * vga_buffer_pointer; auto constinit text_buffer = teachos::memory::asm_pointer{vga_buffer_pointer}; - - auto write(char code_point, attribute attribute) -> void - { - auto & p = *text_buffer; - (*p++) = std::pair{code_point, attribute}; - }; } // namespace auto clear(attribute attribute) -> void @@ -39,9 +33,14 @@ namespace teachos::arch::video::vga::text crtc::data_port::write(vga::crtc::data_port::read() | cursor_disable_byte); } + auto write_char(char code_point, attribute attribute) -> void + { + auto & p = *text_buffer; + (*p++) = std::pair{code_point, attribute}; + }; + auto write(std::string_view code_points, attribute attribute) -> void { - std::ranges::for_each(code_points, [&](auto code_point) { write(code_point, attribute); }); + std::ranges::for_each(code_points, [&](auto code_point) { write_char(code_point, attribute); }); } - } // namespace teachos::arch::video::vga::text -- cgit v1.2.3