summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author angelosa <salese_corp_ltd@email.it>2017-09-16 21:40:42 +0200
committer angelosa <salese_corp_ltd@email.it>2017-09-16 21:41:38 +0200
commit6a4959292cbc6f27a699b9874a9a7d4ef749c2a8 (patch)
treee84632d2015ce0fe27a51e5dee8835e52201e813 /src
parent77c5c2db5fedc3f54dcec874a5ce5cbc54dc81c9 (diff)
model2.cpp: fix luma overflow (Virtua Striker flag colors) [Angelo Salese]
Diffstat (limited to 'src')
-rw-r--r--src/mame/video/model2rd.hxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mame/video/model2rd.hxx b/src/mame/video/model2rd.hxx
index 7f2754b4d21..22d9107fc56 100644
--- a/src/mame/video/model2rd.hxx
+++ b/src/mame/video/model2rd.hxx
@@ -79,8 +79,12 @@ void MODEL2_FUNC_NAME(int32_t scanline, const extent_t& extent, const m2_poly_ex
return;
#else
- luma = lumaram[BYTE_XOR_LE(lumabase + (0xf << 3))] & 0x3F;
+ luma = lumaram[BYTE_XOR_LE(lumabase + (0xf << 3))];
+ // fix luma overflow
+ if(luma > 0x3f)
+ luma = 0x3f;
+
color = state->m_palram[BYTE_XOR_LE(color + 0x1000)] & 0x7fff;
colortable_r += ((color >> 0) & 0x1f) << 8;
@@ -177,7 +181,11 @@ void MODEL2_FUNC_NAME(int32_t scanline, const extent_t& extent, const m2_poly_ex
if ( t == 0x0f )
continue;
#endif
- luma = lumaram[BYTE_XOR_LE(lumabase + (t << 3))] & 0x3f;
+ luma = lumaram[BYTE_XOR_LE(lumabase + (t << 3))];
+
+ // Virtua Striker sets up a luma of 0x40 for flags, fix here.
+ if(luma > 0x3f)
+ luma = 0x3f;
/* we have the 6 bits of luma information along with 5 bits per color component */
/* now build and index into the master color lookup table and extract the raw RGB values */