aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/video
diff options
context:
space:
mode:
authorTheSoeren <imhofabian@gmail.com>2024-09-29 14:03:39 +0000
committerTheSoeren <imhofabian@gmail.com>2024-09-29 14:03:39 +0000
commitd2e1c8ba686d7d4ab32eda91c2f532676e9b8acf (patch)
treecb2e414e297e6631825c5a9ce301337015980755 /arch/x86_64/src/video
parent8f91d0ef50e01440f7e6e9f4afa5887f6afefea1 (diff)
downloadteachos-d2e1c8ba686d7d4ab32eda91c2f532676e9b8acf.tar.xz
teachos-d2e1c8ba686d7d4ab32eda91c2f532676e9b8acf.zip
create write_number function
Diffstat (limited to 'arch/x86_64/src/video')
-rw-r--r--arch/x86_64/src/video/vga/text.cpp15
1 files changed, 7 insertions, 8 deletions
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<char, attribute> * 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