diff options
Diffstat (limited to 'src/mame/video/model2rd.hxx')
-rw-r--r-- | src/mame/video/model2rd.hxx | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/mame/video/model2rd.hxx b/src/mame/video/model2rd.hxx index 4223d34bf89..46fc606d4c6 100644 --- a/src/mame/video/model2rd.hxx +++ b/src/mame/video/model2rd.hxx @@ -64,10 +64,10 @@ void MODEL2_FUNC_NAME(int32_t scanline, const extent_t& extent, const m2_poly_ex uint32_t *p = &destmap->pix32(scanline); /* extract color information */ - const uint16_t *colortable_r = (const uint16_t *)&state->m_colorxlat[0x0000/4]; - const uint16_t *colortable_g = (const uint16_t *)&state->m_colorxlat[0x4000/4]; - const uint16_t *colortable_b = (const uint16_t *)&state->m_colorxlat[0x8000/4]; - const uint16_t *lumaram = (const uint16_t *)state->m_lumaram.target(); + const uint16_t *colortable_r = &state->m_colorxlat[0x0000/2]; + const uint16_t *colortable_g = &state->m_colorxlat[0x4000/2]; + const uint16_t *colortable_b = &state->m_colorxlat[0x8000/2]; + const uint16_t *lumaram = &state->m_lumaram[0]; uint32_t lumabase = object.lumabase; uint32_t color = object.colorbase; uint8_t luma; @@ -79,13 +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))]; + luma = lumaram[(lumabase + (0xf << 3))]; // fix luma overflow - if(luma > 0x3f) - luma = 0x3f; - - color = state->m_palram[BYTE_XOR_LE(color + 0x1000)] & 0x7fff; + luma = std::min((int)luma,0x3f); + + color = state->m_palram[(color + 0x1000)] & 0x7fff; colortable_r += ((color >> 0) & 0x1f) << 8; colortable_g += ((color >> 5) & 0x1f) << 8; @@ -94,9 +93,9 @@ void MODEL2_FUNC_NAME(int32_t scanline, const extent_t& extent, const m2_poly_ex /* 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 */ - tr = colortable_r[BYTE_XOR_LE(luma)] & 0xff; - tg = colortable_g[BYTE_XOR_LE(luma)] & 0xff; - tb = colortable_b[BYTE_XOR_LE(luma)] & 0xff; + tr = colortable_r[(luma)] & 0xff; + tg = colortable_g[(luma)] & 0xff; + tb = colortable_b[(luma)] & 0xff; /* build the final color */ color = rgb_t(tr, tg, tb); @@ -122,10 +121,10 @@ void MODEL2_FUNC_NAME(int32_t scanline, const extent_t& extent, const m2_poly_ex uint32_t tex_height = object.texheight; /* extract color information */ - const uint16_t *colortable_r = (const uint16_t *)&state->m_colorxlat[0x0000/4]; - const uint16_t *colortable_g = (const uint16_t *)&state->m_colorxlat[0x4000/4]; - const uint16_t *colortable_b = (const uint16_t *)&state->m_colorxlat[0x8000/4]; - const uint16_t *lumaram = (const uint16_t *)state->m_lumaram.target(); + const uint16_t *colortable_r = &state->m_colorxlat[0x0000/2]; + const uint16_t *colortable_g = &state->m_colorxlat[0x4000/2]; + const uint16_t *colortable_b = &state->m_colorxlat[0x8000/2]; + const uint16_t *lumaram = &state->m_lumaram[0]; uint32_t colorbase = object.colorbase; uint32_t lumabase = object.lumabase; uint32_t tex_x = object.texx; @@ -145,7 +144,7 @@ void MODEL2_FUNC_NAME(int32_t scanline, const extent_t& extent, const m2_poly_ex tex_x_mask = tex_width - 1; tex_y_mask = tex_height - 1; - colorbase = state->m_palram[BYTE_XOR_LE(colorbase + 0x1000)] & 0x7fff; + colorbase = state->m_palram[(colorbase + 0x1000)] & 0x7fff; colortable_r += ((colorbase >> 0) & 0x1f) << 8; colortable_g += ((colorbase >> 5) & 0x1f) << 8; @@ -181,7 +180,7 @@ 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))]; + luma = lumaram[(lumabase + (t << 3))]; // Virtua Striker sets up a luma of 0x40 for national flags on bleachers, fix here. luma = std::min((int)luma,0x3f); @@ -189,9 +188,9 @@ void MODEL2_FUNC_NAME(int32_t scanline, const extent_t& extent, const m2_poly_ex /* 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 */ - tr = colortable_r[BYTE_XOR_LE(luma)] & 0xff; - tg = colortable_g[BYTE_XOR_LE(luma)] & 0xff; - tb = colortable_b[BYTE_XOR_LE(luma)] & 0xff; + tr = colortable_r[(luma)] & 0xff; + tg = colortable_g[(luma)] & 0xff; + tb = colortable_b[(luma)] & 0xff; p[x] = rgb_t(tr, tg, tb); } |