Exposes vesa resolution

This commit is contained in:
Baptiste Wicht 2016-08-06 22:09:24 +02:00
parent c7cf87569e
commit 50a64d7e40
2 changed files with 13 additions and 0 deletions

View File

@ -35,6 +35,9 @@ void draw_char(size_t x, size_t y, char c, uint8_t r, uint8_t g, uint8_t b);
void move_lines_up(size_t y, size_t x, size_t w, size_t lines, size_t n); void move_lines_up(size_t y, size_t x, size_t w, size_t lines, size_t n);
uint64_t width();
uint64_t height();
} //end of vesa namespace } //end of vesa namespace
#endif #endif

View File

@ -92,6 +92,16 @@ bool vesa::init(){
return true; return true;
} }
uint64_t vesa::width(){
auto& block = *reinterpret_cast<vesa::mode_info_block_t*>(early::vesa_mode_info_address);
return block.width;
}
uint64_t vesa::height(){
auto& block = *reinterpret_cast<vesa::mode_info_block_t*>(early::vesa_mode_info_address);
return block.height;
}
uint32_t vesa::make_color(uint8_t r, uint8_t g, uint8_t b){ uint32_t vesa::make_color(uint8_t r, uint8_t g, uint8_t b){
return (r << red_shift) + (g << green_shift) + (b << blue_shift); return (r << red_shift) + (g << green_shift) + (b << blue_shift);
} }