[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bochs-cvs
Subject:    [Bochs-cvs] [13401] trunk/bochs/iodev/display
From:       vruppert--- via Bochs-cvs <bochs-cvs () lists ! sourceforge ! net>
Date:       2017-12-17 22:23:20
Message-ID: 1513549400.845421.9922 () sfp-scm-4 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 13401
Author:   vruppert
Date:     2017-12-17 22:23:20 +0000 (Sun, 17 Dec 2017)
Log Message:
-----------
Some work on the Voodoo Banshee emulation.
- Only continue bitblt operation if width and height is > 0 after clipping.
- Temporary hack: Processing CMDFIFO packets directly after completion fixes
  some display issues (FIXME: 3D mode should work like Voodoo2).

Modified Paths:
--------------
    trunk/bochs/iodev/display/voodoo.cc
    trunk/bochs/iodev/display/voodoo.h

Modified: trunk/bochs/iodev/display/voodoo.cc
===================================================================
--- trunk/bochs/iodev/display/voodoo.cc	2017-12-17 18:55:03 UTC (rev 13400)
+++ trunk/bochs/iodev/display/voodoo.cc	2017-12-17 22:23:20 UTC (rev 13401)
@@ -755,6 +755,7 @@
       vertical_timer_handler(NULL);
     }
     BX_INFO(("Voodoo output %dx%d@%uHz", v->fbi.width, v->fbi.height, \
(unsigned)v->vertfreq)); +    v->vtimer_running = 1;
   } else {
     BX_VVGA_THIS get_crtc_params(&crtcp);
     hfreq = v->vidclk / (float)(crtcp.htotal * 8);
@@ -765,7 +766,6 @@
     vertical_timer_handler(NULL);
   }
   bx_virt_timer.activate_timer(BX_VOODOO_THIS s.vertical_timer_id, \
                (Bit32u)BX_VOODOO_THIS s.vdraw.vtotal_usec, 1);
-  v->vtimer_running = 1;
   return 1;
 }
 
@@ -2290,7 +2290,7 @@
   BLT.busy = 0;
 }
 
-void bx_voodoo_c::banshee_blt_apply_clipwindow(int *x0, int *y0, int *x1, int *y1, \
int *w, int *h) +bx_bool bx_voodoo_c::banshee_blt_apply_clipwindow(int *x0, int *y0, \
int *x1, int *y1, int *w, int *h)  {
   int cx0, cx1, cy0, cy1, xd, yd;
 
@@ -2344,6 +2344,7 @@
       *h -= yd;
     }
   }
+  return ((*w > 0) && (*h > 0));
 }
 
 void bx_voodoo_c::banshee_blt_rectangle_fill()
@@ -2360,7 +2361,11 @@
   w = BLT.dst_w;
   h = BLT.dst_h;
   BX_DEBUG(("Rectangle fill: %d x %d  ROP %02X", w, h, BLT.rop0));
-  banshee_blt_apply_clipwindow(NULL, NULL, &x1, &y1, &w, &h);
+  if (!banshee_blt_apply_clipwindow(NULL, NULL, &x1, &y1, &w, &h)) {
+    BLT.busy = 0;
+    BX_UNLOCK(render_mutex);
+    return;
+  }
   dst_ptr += (y1 * dpitch + x1 * dpxsize);
   nrows = h;
   do {
@@ -2397,7 +2402,11 @@
   BX_DEBUG(("Pattern fill mono: %d x %d  ROP %02X", w, h, BLT.rop0));
   x0 = 0;
   y0 = 0;
-  banshee_blt_apply_clipwindow(&x0, &y0, &x1, &y1, &w, &h);
+  if (!banshee_blt_apply_clipwindow(&x0, &y0, &x1, &y1, &w, &h)) {
+    BLT.busy = 0;
+    BX_UNLOCK(render_mutex);
+    return;
+  }
   dst_ptr += (y1 * dpitch + x1 * dpxsize);
   patcol = (x0 + BLT.patsx) & 7;
   patline = (y0 + BLT.patsy) & 7;
@@ -2456,7 +2465,11 @@
   BX_DEBUG(("Pattern fill color: %d x %d  ROP %02X", w, h, BLT.rop0));
   x0 = BLT.patsx;
   y0 = BLT.patsy;
-  banshee_blt_apply_clipwindow(&x0, &y0, &x1, &y1, &w, &h);
+  if (!banshee_blt_apply_clipwindow(&x0, &y0, &x1, &y1, &w, &h)) {
+    BLT.busy = 0;
+    BX_UNLOCK(render_mutex);
+    return;
+  }
   dst_ptr += (y1 * dpitch + x1 * dpxsize);
   patcol = (x0 + BLT.patsx) & 7;
   patline = (y0 + BLT.patsy) & 7;
@@ -2506,7 +2519,11 @@
   w = BLT.dst_w;
   h = BLT.dst_h;
   BX_DEBUG(("Screen to screen blt: %d x %d  ROP %02X", w, h, BLT.rop0));
-  banshee_blt_apply_clipwindow(&x0, &y0, &x1, &y1, &w, &h);
+  if (!banshee_blt_apply_clipwindow(&x0, &y0, &x1, &y1, &w, &h)) {
+    BLT.busy = 0;
+    BX_UNLOCK(render_mutex);
+    return;
+  }
   if (BLT.y_dir) {
     spitch *= -1;
     dpitch *= -1;
@@ -2544,7 +2561,11 @@
   h = BLT.dst_h;
   rop0 = BLT.rop0;
   BX_DEBUG(("Screen to screen pattern blt: %d x %d  ROP %02X", w, h, rop0));
-  banshee_blt_apply_clipwindow(&x0, &y0, &x1, &y1, &w, &h);
+  if (!banshee_blt_apply_clipwindow(&x0, &y0, &x1, &y1, &w, &h)) {
+    BLT.busy = 0;
+    BX_UNLOCK(render_mutex);
+    return;
+  }
   if (BLT.x_dir) {
     dpxsize *= -1;
   }
@@ -2649,7 +2670,11 @@
   BX_DEBUG(("Host to screen blt: %d x %d  ROP %02X", w, h, BLT.rop0));
   x0 = 0;
   y0 = 0;
-  banshee_blt_apply_clipwindow(&x0, &y0, &x1, &y1, &w, &h);
+  if (!banshee_blt_apply_clipwindow(&x0, &y0, &x1, &y1, &w, &h)) {
+    BLT.busy = 0;
+    BX_UNLOCK(render_mutex);
+    return;
+  }
   if (srcfmt == 0) {
     x0 += BLT.h2s_pxstart;
     src_ptr += (y0 * spitch + x0 / 8);
@@ -2731,7 +2756,11 @@
   BX_DEBUG(("Host to screen pattern blt: %d x %d  ROP %02X", w, h, rop0));
   x0 = 0;
   y0 = 0;
-  banshee_blt_apply_clipwindow(&x0, &y0, &x1, &y1, &w, &h);
+  if (!banshee_blt_apply_clipwindow(&x0, &y0, &x1, &y1, &w, &h)) {
+    BLT.busy = 0;
+    BX_UNLOCK(render_mutex);
+    return;
+  }
   if (srcfmt == 0) {
     x0 += BLT.h2s_pxstart;
     src_ptr += (y0 * spitch + x0 / 8);

Modified: trunk/bochs/iodev/display/voodoo.h
===================================================================
--- trunk/bochs/iodev/display/voodoo.h	2017-12-17 18:55:03 UTC (rev 13400)
+++ trunk/bochs/iodev/display/voodoo.h	2017-12-17 22:23:20 UTC (rev 13401)
@@ -110,7 +110,7 @@
   void   banshee_blt_launch_area_write(Bit32u value);
   void   banshee_blt_execute(void);
   void   banshee_blt_complete(void);
-  void   banshee_blt_apply_clipwindow(int *x0, int *y0, int *x1, int *y1, int *w, \
int *h); +  bx_bool banshee_blt_apply_clipwindow(int *x0, int *y0, int *x1, int *y1, \
int *w, int *h);  
   void   banshee_blt_rectangle_fill(void);
   void   banshee_blt_pattern_fill_mono(void);


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bochs-cvs mailing list
Bochs-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bochs-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic