Fixed clipping rectangle on Voodoo, Return Fire II now works.

This commit is contained in:
SarahW 2017-11-20 20:48:27 +00:00
commit a1fc8da064

View file

@ -2712,8 +2712,8 @@ static void voodoo_half_triangle(voodoo_t *voodoo, voodoo_params_t *params, vood
ystart = params->clipLowY;
}
if ((params->fbzMode & 1) && (yend > params->clipHighY))
yend = params->clipHighY;
if ((params->fbzMode & 1) && (yend >= params->clipHighY))
yend = params->clipHighY-1;
state->y = ystart;
// yend--;
@ -2856,14 +2856,14 @@ static void voodoo_half_triangle(voodoo_t *voodoo, voodoo_params_t *params, vood
x = params->clipLeft;
}
if (x2 > params->clipRight)
x2 = params->clipRight;
if (x2 >= params->clipRight)
x2 = params->clipRight-1;
}
else
{
if (x > params->clipRight)
if (x >= params->clipRight)
{
int dx = params->clipRight - x;
int dx = (params->clipRight-1) - x;
state->ir += params->dRdX*dx;
state->ig += params->dGdX*dx;
@ -2878,7 +2878,7 @@ static void voodoo_half_triangle(voodoo_t *voodoo, voodoo_params_t *params, vood
state->tmu1_w += params->tmu[1].dWdX*dx;
state->w += params->dWdX*dx;
x = params->clipRight;
x = params->clipRight-1;
}
if (x2 < params->clipLeft)
x2 = params->clipLeft;
@ -3995,8 +3995,8 @@ static void blit_start(voodoo_t *voodoo)
if (voodoo->bltCommand & BLIT_CLIPPING_ENABLED)
{
if (dst_x < voodoo->bltClipLeft || dst_x > voodoo->bltClipRight ||
dst_y < voodoo->bltClipLowY || dst_y > voodoo->bltClipHighY)
if (dst_x < voodoo->bltClipLeft || dst_x >= voodoo->bltClipRight ||
dst_y < voodoo->bltClipLowY || dst_y >= voodoo->bltClipHighY)
goto skip_pixel_blit;
}
@ -4067,8 +4067,8 @@ skip_pixel_blit:
{
if (voodoo->bltCommand & BLIT_CLIPPING_ENABLED)
{
if (dst_x < voodoo->bltClipLeft || dst_x > voodoo->bltClipRight ||
dst_y < voodoo->bltClipLowY || dst_y > voodoo->bltClipHighY)
if (dst_x < voodoo->bltClipLeft || dst_x >= voodoo->bltClipRight ||
dst_y < voodoo->bltClipLowY || dst_y >= voodoo->bltClipHighY)
goto skip_pixel_fill;
}
@ -4221,8 +4221,8 @@ static void blit_data(voodoo_t *voodoo, uint32_t data)
if (voodoo->bltCommand & BLIT_CLIPPING_ENABLED)
{
if (x < voodoo->bltClipLeft || x > voodoo->bltClipRight ||
voodoo->blt.dst_y < voodoo->bltClipLowY || voodoo->blt.dst_y > voodoo->bltClipHighY)
if (x < voodoo->bltClipLeft || x >= voodoo->bltClipRight ||
voodoo->blt.dst_y < voodoo->bltClipLowY || voodoo->blt.dst_y >= voodoo->bltClipHighY)
goto skip_pixel;
}