X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fvga.c;h=1cf1179ee10fdaade9334c466faab294513fd858;hb=6d3926e16dc1ba6ca0144e65b737e432c48aaa91;hp=d09d692a0c6c4a473ec43c15547bd5a7dcd82d6e;hpb=97126b352ec28abf6c6d8ec3883f0179a7d431c1;p=palacios.git diff --git a/palacios/src/devices/vga.c b/palacios/src/devices/vga.c index d09d692..1cf1179 100644 --- a/palacios/src/devices/vga.c +++ b/palacios/src/devices/vga.c @@ -710,7 +710,6 @@ static void render_graphics(struct vga_internal *vga, void *fb) db[2] <<= 2; db[0] <<= 2; } - break; // next 4 pixels use planes 1 and 3 for (p=4;p<8;p++) { @@ -1828,6 +1827,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 +2121,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); @@ -2843,7 +2869,7 @@ static int vga_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { for (i=0;i