control: support interlaced modes.

This commit is contained in:
Maxim Poliakovski 2024-02-09 09:42:55 +01:00
parent d0b0b8070c
commit 44b1d34cc7
2 changed files with 7 additions and 2 deletions

View File

@ -388,7 +388,9 @@ void ControlVideo::enable_display()
new_height = swatch_params[ControlRegs::VFP-1] - swatch_params[ControlRegs::VAL-1];
new_width *= clk_divisor;
new_height >>= 1; // FIXME: assume non-interlaced mode for now
if (this->enables & SCAN_CONTROL) {
new_height >>= 1;
}
this->active_width = new_width;
this->active_height = new_height;
@ -431,7 +433,9 @@ void ControlVideo::enable_display()
this->vert_blank = swatch_params[ControlRegs::VAL-1] +
(swatch_params[ControlRegs::VSYNC-1] - swatch_params[ControlRegs::VFP-1]);
this->vert_blank >>= 1;
if (this->enables & SCAN_CONTROL) {
this->vert_blank >>= 1;
}
this->hori_total = this->hori_blank + new_width;
this->vert_total = this->vert_blank + new_height;

View File

@ -78,6 +78,7 @@ enum {
// Bit definitions for MISC_ENABLES register.
enum {
SCAN_CONTROL = 1 << 0, // 0 - interlaced, 1 - progressive
FB_ENDIAN_LITTLE = 1 << 1, // framebuffer endianness: 0 - big, 1 - little
VRAM_WIDE_MODE = 1 << 6, // VRAM bus width: 1 - 128bit, 0 - 64bit
BLANK_DISABLE = 1 << 11, // 0 - enable blanking, 1 - disable it