mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-17 00:26:44 -04:00
Exposes vesa resolution
This commit is contained in:
parent
c7cf87569e
commit
50a64d7e40
@ -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);
|
||||
|
||||
uint64_t width();
|
||||
uint64_t height();
|
||||
|
||||
} //end of vesa namespace
|
||||
|
||||
#endif
|
||||
|
@ -92,6 +92,16 @@ bool vesa::init(){
|
||||
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){
|
||||
return (r << red_shift) + (g << green_shift) + (b << blue_shift);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user