From 79c0f7dfb063b5d29dc4547d37efbcb86a89fdac Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sun, 21 Feb 2021 13:39:12 +0200 Subject: Call global constructors --- drivers/cga.cc | 4 +++- drivers/cga.h | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/cga.cc b/drivers/cga.cc index 961d7e4..0646ff7 100644 --- a/drivers/cga.cc +++ b/drivers/cga.cc @@ -22,7 +22,9 @@ constexpr uint8_t cursor_addr_l = 15; // 0xf */ constexpr uint8_t cursor_hide = 0b00100000; -CGA::CGA(Colour fg, Colour bg, uint32_t address) : colour_fg(fg), colour_bg(bg) { +constexpr uint32_t address = 0xB8000; + +CGA::CGA() { buffer = reinterpret_cast(address); // clear buffer diff --git a/drivers/cga.h b/drivers/cga.h index f0ca412..f4dfb3c 100644 --- a/drivers/cga.h +++ b/drivers/cga.h @@ -35,7 +35,7 @@ public: CGA_COLOR_WHITE = 15, }; - CGA(Colour fg = CGA_COLOR_BLACK, Colour bg = CGA_COLOR_LIGHT_GREY, uint32_t address = 0xB8000); + CGA(); ~CGA() = default; void set_colour(Colour fg, Colour bg); @@ -58,8 +58,8 @@ private: const size_t max_columns = 80, max_rows = 25; size_t column = 0, row = 0; - Colour colour_fg; - Colour colour_bg; + Colour colour_fg = CGA_COLOR_BLACK; + Colour colour_bg = CGA_COLOR_LIGHT_GREY; Entry* buffer; -- cgit v1.2.1