Fill the entire framebuffer with color instead of a random corner

This commit is contained in:
Tony Kuker 2022-01-23 03:56:39 +00:00
parent 4332c6db6a
commit 5fb1dbcdb6
1 changed files with 7 additions and 10 deletions

View File

@ -157,21 +157,18 @@ void SCSIPowerView::AddCommand(SCSIDEV::scsi_command opcode, const char* name, v
void SCSIPowerView::ClearFrameBuffer(DWORD blank_color){
// For each row
for (DWORD idx_row_y = 0; idx_row_y < 768; idx_row_y++){
for (DWORD idx_row_y = 0; idx_row_y < fbinfo.yres-1; idx_row_y++){
// For each column
for (DWORD idx_col_x = 0; idx_col_x < 1024; idx_col_x++){
for (DWORD idx_col_x = 0; idx_col_x < fbinfo.xres-1; idx_col_x++){
uint32_t loc = ((idx_col_x) * (this->fbbpp / 8)) + ((idx_row_y) * fblinelen);
uint8_t temp_color = blank_color;
*(this->fb + loc + 0) = (blank_color & 0xFF);
*(this->fb + loc + 1) = (blank_color >> 8) & 0xFF;
// TODO: This should dynamically set the framebuffer memory, based upon the
// color depth.
*(this->fb + loc + 2) = (blank_color >> 16) & 0xFF;
for(uint32_t i=0; i < fbinfo.bits_per_pixel/8; i++){
temp_color = (blank_color >> 8*i) & 0xFF;
*(this->fb + loc + i) = temp_color;
}
}
}