summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author Ted Green <tedgreen99@protonmail.com>2017-09-11 17:41:50 -0600
committer Ted Green <tedgreen99@protonmail.com>2017-09-11 17:42:14 -0600
commite9bfbc7a268818c23a96e8bd12861a24744febde (patch)
treeb86e22f3669bfce73e5c33d920a2613bf89b34f3 /src/devices
parentd3cd2c35aec5a4220683df15f56bab0b4f902bdc (diff)
voodoo: Fixed subtle casting bug. The uncasted depth in the expanded variable calculation was causing a possible sign extension into the top 32 bits of expanded. Allows obsidian manufacturing test in calspeed to pass. (nw)
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/video/voodoo.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp
index cc25e658d1d..3d717221d0d 100644
--- a/src/devices/video/voodoo.cpp
+++ b/src/devices/video/voodoo.cpp
@@ -5906,16 +5906,16 @@ void voodoo_device::raster_fastfill(void *destbase, int32_t y, const poly_extent
/* fill this dest buffer row */
if (FBZMODE_AUX_BUFFER_MASK(vd->reg[fbzMode].u) && vd->fbi.auxoffs != ~0)
{
- uint16_t depth = vd->reg[zaColor].u;
- uint64_t expanded = ((uint64_t)depth << 48) | ((uint64_t)depth << 32) | (depth << 16) | depth;
+ uint32_t depth = vd->reg[zaColor].u;
+ uint64_t expanded = ((uint64_t)depth << 32) | (uint64_t)depth;
uint16_t *dest = (uint16_t *)(vd->fbi.ram + vd->fbi.auxoffs) + scry * vd->fbi.rowpixels;
for (x = startx; x < stopx && (x & 3) != 0; x++)
- dest[x] = depth;
+ dest[x] = (uint16_t) depth;
for ( ; x < (stopx & ~3); x += 4)
*(uint64_t *)&dest[x] = expanded;
for ( ; x < stopx; x++)
- dest[x] = depth;
+ dest[x] = (uint16_t) depth;
}
}