56,12 → 56,20 |
uint16_t vesa_bpp; |
uint16_t vesa_scanline; |
|
uint8_t vesa_red_mask; |
uint8_t vesa_red_pos; |
|
uint8_t vesa_green_mask; |
uint8_t vesa_green_pos; |
|
uint8_t vesa_blue_mask; |
uint8_t vesa_blue_pos; |
|
int vesa_present(void) |
{ |
if (vesa_width != 0xffff) |
if ((vesa_width != 0xffff) && (vesa_height != 0xffff)) |
return true; |
if (vesa_height != 0xffff) |
return true; |
|
return false; |
} |
|
74,7 → 82,12 |
visual = VISUAL_INDIRECT_8; |
break; |
case 16: |
visual = VISUAL_RGB_5_6_5; |
if ((vesa_red_mask == 5) && (vesa_red_pos == 10) |
&& (vesa_green_mask == 5) && (vesa_green_pos == 5) |
&& (vesa_blue_mask == 5) && (vesa_blue_pos == 0)) |
visual = VISUAL_RGB_5_5_5; |
else |
visual = VISUAL_RGB_5_6_5; |
break; |
case 24: |
visual = VISUAL_RGB_8_8_8; |
83,12 → 96,25 |
visual = VISUAL_RGB_0_8_8_8; |
break; |
default: |
panic("Unsupported bits per pixel"); |
panic("Unsupported bits per pixel."); |
} |
|
fb_init(vesa_ph_addr, vesa_width, vesa_height, vesa_scanline, visual); |
fb_properties_t vesa_props = { |
.addr = vesa_ph_addr, |
.offset = 0, |
.x = vesa_width, |
.y = vesa_height, |
.scan = vesa_scanline, |
.visual = visual, |
}; |
fb_init(&vesa_props); |
} |
|
void vesa_redraw(void) |
{ |
fb_redraw(); |
} |
|
#endif |
|
/** @} |