summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Ted Green <tedgreen99@protonmail.com>2017-10-19 16:30:07 -0600
committer Ted Green <tedgreen99@protonmail.com>2017-10-19 16:30:29 -0600
commit85d253fcf54dc88de4d705dc0aff6c6123b264ac (patch)
treec6a16561ddb075ec574396400c89b96747afd74e
parent4debad7ba51db7bb32702c11bca24b9d797279cc (diff)
voodoo: Check for starting x outside of clipping rectangle and fix clipping xstop. (nw)
-rw-r--r--src/devices/video/vooddefs.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/devices/video/vooddefs.h b/src/devices/video/vooddefs.h
index ada34e0034e..0c925ea33c7 100644
--- a/src/devices/video/vooddefs.h
+++ b/src/devices/video/vooddefs.h
@@ -2673,6 +2673,20 @@ void voodoo_device::raster_##name(void *destbase, int32_t y, const poly_extent *
} \
\
/* X clipping */ \
+ tempclip = vd->reg[clipLeftRight].u & 0x3ff; \
+ /* Check for start outsize of clipping boundary */ \
+ if (startx >= tempclip) \
+ { \
+ stats->pixels_in += stopx - startx; \
+ vd->stats.total_clipped += stopx - startx; \
+ return; \
+ } \
+ if (stopx > tempclip) \
+ { \
+ stats->pixels_in += stopx - tempclip; \
+ vd->stats.total_clipped += stopx - tempclip; \
+ stopx = tempclip; \
+ } \
tempclip = (vd->reg[clipLeftRight].u >> 16) & 0x3ff; \
if (startx < tempclip) \
{ \
@@ -2680,13 +2694,6 @@ void voodoo_device::raster_##name(void *destbase, int32_t y, const poly_extent *
vd->stats.total_clipped += tempclip - startx; \
startx = tempclip; \
} \
- tempclip = vd->reg[clipLeftRight].u & 0x3ff; \
- if (stopx >= tempclip) \
- { \
- stats->pixels_in += stopx - tempclip; \
- vd->stats.total_clipped += stopx - tempclip; \
- stopx = tempclip - 1; \
- } \
} \
\
/* get pointers to the target buffer and depth buffer */ \