Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Cleanup and sanity-checking of endianness, dead code, unchecked returns (Coverity...
[palacios.git] / palacios / src / devices / vga.c
index d09d692..1cf1179 100644 (file)
@@ -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<MAP_NUM;i++) { 
        void *temp;
 
-       temp = (void*)V3_AllocShadowSafePages(vm,MAP_SIZE/4096);
+       temp = (void*)V3_AllocPages(MAP_SIZE/4096);
        if (!temp) { 
            PrintError(vm, VCORE_NONE, "vga: cannot allocate maps\n");
            free_vga(vga);