diff --git a/src/devices/video/vooddefs.h b/src/devices/video/vooddefs.h index a9e653dc93d..734100e43a5 100644 --- a/src/devices/video/vooddefs.h +++ b/src/devices/video/vooddefs.h @@ -336,13 +336,14 @@ inline uint32_t voodoo_device::raster_info::compute_hash() const const uint8_t *dither = nullptr #define DECLARE_DITHER_POINTERS_NO_DITHER_VAR \ const uint8_t *dither_lookup = nullptr; -#define COMPUTE_DITHER_POINTERS(FBZMODE, YY) \ +#define COMPUTE_DITHER_POINTERS(FBZMODE, YY, FOGMODE) \ do \ { \ + if (FBZMODE_ENABLE_DITHERING(FBZMODE) || FOGMODE_FOG_DITHER(FOGMODE)) \ + dither4 = &dither_matrix_4x4[((YY) & 3) * 4]; \ /* compute the dithering pointers */ \ if (FBZMODE_ENABLE_DITHERING(FBZMODE)) \ { \ - dither4 = &dither_matrix_4x4[((YY) & 3) * 4]; \ if (FBZMODE_DITHER_TYPE(FBZMODE) == 0) \ { \ dither = dither4; \ @@ -2653,7 +2654,7 @@ void voodoo_device::raster_##name(void *destbase, int32_t y, const poly_extent * scry = (vd->fbi.yorigin - y) & 0x3ff; \ \ /* compute dithering */ \ - COMPUTE_DITHER_POINTERS(FBZMODE, y); \ + COMPUTE_DITHER_POINTERS(FBZMODE, y, FOGMODE); \ \ /* apply clipping */ \ if (FBZMODE_ENABLE_CLIPPING(FBZMODE)) \ diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp index 2d2d3fd4fed..e0aaccf152d 100644 --- a/src/devices/video/voodoo.cpp +++ b/src/devices/video/voodoo.cpp @@ -3247,7 +3247,7 @@ int32_t voodoo_device::lfb_w(voodoo_device* vd, offs_t offset, uint32_t data, ui depth += scry * vd->fbi.rowpixels; /* compute dithering */ - COMPUTE_DITHER_POINTERS(vd->reg[fbzMode].u, y); + COMPUTE_DITHER_POINTERS(vd->reg[fbzMode].u, y, vd->reg[fogMode].u); /* loop over up to two pixels */ for (pix = 0; mask; pix++)