From: Peter Dinda Date: Sat, 21 Dec 2013 18:45:28 +0000 (-0600) Subject: Add logic to VGA for vertical/horizontal retrace X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=c5909621b389bb4a5a5f405168b25fdda4b0db35 Add logic to VGA for vertical/horizontal retrace --- diff --git a/palacios/src/devices/vga.c b/palacios/src/devices/vga.c index d09d692..8d21fa7 100644 --- a/palacios/src/devices/vga.c +++ b/palacios/src/devices/vga.c @@ -1828,6 +1828,28 @@ static int input_stat1_read(struct guest_info *core, *((uint8_t*)dest) = vga->vga_misc.vga_input_stat1.val; + // Pretend that horizontal and vertical blanking + // is occurring + if (!vga->vga_misc.vga_input_stat1.disp_en) { + + // if not blanking, start horizontal blanking + vga->vga_misc.vga_input_stat1.disp_en = 1; + vga->vga_misc.vga_input_stat1.vert_retrace = 0; + + } else { + + if (!vga->vga_misc.vga_input_stat1.vert_retrace) { + // if not vertical blanking, then now vertical blanking + vga->vga_misc.vga_input_stat1.disp_en = 1; + vga->vga_misc.vga_input_stat1.vert_retrace = 1; + } else { + // if vertical blanking, now not blanking + vga->vga_misc.vga_input_stat1.disp_en = 0; + vga->vga_misc.vga_input_stat1.vert_retrace = 0; + } + + } + // Stunningly, reading stat1 is also a way to reset // the state of attribute controller address/data flipflop // That is some mighty fine crack the designers were smoking. @@ -2100,9 +2122,14 @@ static int crt_controller_data_write(struct guest_info *core, PASSTHROUGH_IO_OUT(vga,port,src,len); if (index>=VGA_CRT_CONTROLLER_NUM) { - PrintError(core->vm_info, core, "vga; crt controller write is for illegal index %d, ignoring\n",index); + PrintError(core->vm_info, core, "vga; crt controller write is for illegal index %d, ignoring\n",index); } else { - vga->vga_crt_controller.vga_crt_controller_regs[index] = data; + vga->vga_crt_controller.vga_crt_controller_regs[index] = data; + if (index == 17) { + if (vga->vga_crt_controller.vga_vertical_retrace_end.enable_vertical_interrupt) { + PrintError(core->vm_info, core, "vga: vertical_retrace_interrupt_enabled is unsupported -- no interrupts will occur!\n"); + } + } } render(vga);