summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video
diff options
context:
space:
mode:
author Ted Green <tedgreen99@protonmail.com>2018-05-29 13:11:01 -0600
committer Ted Green <tedgreen99@protonmail.com>2018-05-29 19:26:24 -0600
commit7582515cedfb2964e9454f18af95edaa84fe4348 (patch)
tree1eee6c60fb8f50df7baf0bb80e707b943aec8396 /src/devices/video
parent2ea751e0289780bfc81ed244f1f8d4a98f9c12eb (diff)
voodoo: Reinstate texture address masking. Fixes segmentation fault in warfa.
Diffstat (limited to 'src/devices/video')
-rw-r--r--src/devices/video/vooddefs.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/devices/video/vooddefs.h b/src/devices/video/vooddefs.h
index cad79c3d7f2..dccda7696f7 100644
--- a/src/devices/video/vooddefs.h
+++ b/src/devices/video/vooddefs.h
@@ -2971,10 +2971,10 @@ inline rgbaint_t ATTR_FORCE_INLINE voodoo_device::tmu_state::genTexture(int32_t
/* fetch texel data */
if (TEXMODE_FORMAT(TEXMODE) < 8)
{
- texel0 = *(uint8_t *)&ram[(texbase + t + s)];
- texel1 = *(uint8_t *)&ram[(texbase + t + s1)];
- texel2 = *(uint8_t *)&ram[(texbase + t1 + s)];
- texel3 = *(uint8_t *)&ram[(texbase + t1 + s1)];
+ texel0 = *(uint8_t *)&ram[(texbase + t + s) & mask];
+ texel1 = *(uint8_t *)&ram[(texbase + t + s1) & mask];
+ texel2 = *(uint8_t *)&ram[(texbase + t1 + s) & mask];
+ texel3 = *(uint8_t *)&ram[(texbase + t1 + s1) & mask];
texel0 = (LOOKUP)[texel0];
texel1 = (LOOKUP)[texel1];
texel2 = (LOOKUP)[texel2];
@@ -2982,10 +2982,10 @@ inline rgbaint_t ATTR_FORCE_INLINE voodoo_device::tmu_state::genTexture(int32_t
}
else
{
- texel0 = *(uint16_t *)&ram[(texbase + 2*(t + s))];
- texel1 = *(uint16_t *)&ram[(texbase + 2*(t + s1))];
- texel2 = *(uint16_t *)&ram[(texbase + 2*(t1 + s))];
- texel3 = *(uint16_t *)&ram[(texbase + 2*(t1 + s1))];
+ texel0 = *(uint16_t *)&ram[(texbase + 2*(t + s)) & mask];
+ texel1 = *(uint16_t *)&ram[(texbase + 2*(t + s1)) & mask];
+ texel2 = *(uint16_t *)&ram[(texbase + 2*(t1 + s)) & mask];
+ texel3 = *(uint16_t *)&ram[(texbase + 2*(t1 + s1)) & mask];
if (TEXMODE_FORMAT(TEXMODE) >= 10 && TEXMODE_FORMAT(TEXMODE) <= 12)
{
texel0 = (LOOKUP)[texel0];