diff options
Diffstat (limited to 'src/devices/video/voodoo.cpp')
-rw-r--r-- | src/devices/video/voodoo.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp index 0881a1aa9a9..259e24899e5 100644 --- a/src/devices/video/voodoo.cpp +++ b/src/devices/video/voodoo.cpp @@ -1431,8 +1431,8 @@ inline int32_t voodoo_device::tmu_state::prepare() return (-lodbase + (12 << 8)) / 2; #else double tmpTex = texdx; - lodbase = new_log2(tmpTex); - return (lodbase + (12 << 8) - (56 << 8)) / 2; + lodbase = new_log2(tmpTex, 0); + return (lodbase + (12 << 8)) / 2; #endif } @@ -2588,8 +2588,8 @@ int32_t voodoo_device::register_w(voodoo_device *vd, offs_t offset, uint32_t dat visarea.set(hbp, hbp + hvis - 1, vbp, vbp + vvis - 1); /* keep within bounds */ - visarea.max_x = std::min(visarea.max_x, htotal - 1); - visarea.max_y = std::min(visarea.max_y, vtotal - 1); + visarea.max_x = (std::min)(visarea.max_x, htotal - 1); + visarea.max_y = (std::min)(visarea.max_y, vtotal - 1); /* compute the new period for standard res, medium res, and VGA res */ stdperiod = HZ_TO_ATTOSECONDS(15750) * vtotal; @@ -3376,17 +3376,23 @@ int32_t voodoo_device::lfb_w(voodoo_device* vd, offs_t offset, uint32_t data, ui goto nextpixel; /* handle alpha test */ if (ALPHAMODE_ALPHATEST(vd->reg[alphaMode].u)) - if (!alphaTest(vd, stats, vd->reg[alphaMode].u, color.get_a())) + if (!alphaTest(vd->reg[alphaMode].rgb.a, stats, vd->reg[alphaMode].u, color.get_a())) goto nextpixel; + /* perform fogging */ + preFog.set(color); + if (FOGMODE_ENABLE_FOG(vd->reg[fogMode].u)) + applyFogging(vd, vd->reg[fbzMode].u, vd->reg[fogMode].u, vd->reg[fbzColorPath].u, x, dither4, biasdepth, color, iterz, iterw, iterargb); /* wait for any outstanding work to finish */ poly_wait(vd->poly, "LFB Write"); - /* pixel pipeline part 2 handles color blending, fog, alpha, and final output */ - PIXEL_PIPELINE_END(vd, stats, dither, dither4, dither_lookup, x, dest, depth, - vd->reg[fbzMode].u, vd->reg[fbzColorPath].u, vd->reg[alphaMode].u, vd->reg[fogMode].u, - iterz, iterw, iterargb, biasdepth) { }; + /* perform alpha blending */ + if (ALPHAMODE_ALPHABLEND(vd->reg[alphaMode].u)) + alphaBlend(vd->reg[fbzMode].u, vd->reg[alphaMode].u, x, dither, dest[x], depth, preFog, color, vd->fbi.rgb565); + + /* pixel pipeline part 2 handles final output */ + PIXEL_PIPELINE_END(stats, dither_lookup, x, dest, depth, vd->reg[fbzMode].u) { }; nextpixel: /* advance our pointers */ x++; @@ -5252,7 +5258,7 @@ int32_t voodoo_device::fastfill(voodoo_device *vd) for (y = sy; y < ey; y += ARRAY_LENGTH(extents)) { poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(vd->poly); - int count = std::min(ey - y, int(ARRAY_LENGTH(extents))); + int count = (std::min)(ey - y, int(ARRAY_LENGTH(extents))); extra->device = vd; memcpy(extra->dither, dithermatrix, sizeof(extra->dither)); |