mirror of
https://github.com/holub/mame
synced 2025-10-07 17:27:06 +03:00
model2.cpp: fixed untextured path colors (Motor Raid, Daytona USA) [Angelo Salese]
This commit is contained in:
parent
54a87f0c0c
commit
05e851cc83
@ -62,15 +62,16 @@ void MODEL2_FUNC_NAME(int32_t scanline, const extent_t& extent, const m2_poly_ex
|
|||||||
model2_state *state = object.state;
|
model2_state *state = object.state;
|
||||||
bitmap_rgb32 *destmap = (bitmap_rgb32 *)&m_destmap;
|
bitmap_rgb32 *destmap = (bitmap_rgb32 *)&m_destmap;
|
||||||
uint32_t *p = &destmap->pix32(scanline);
|
uint32_t *p = &destmap->pix32(scanline);
|
||||||
|
// uint8_t *gamma_value = &state->m_gamma_table[0];
|
||||||
|
|
||||||
/* extract color information */
|
/* extract color information */
|
||||||
const uint16_t *colortable_r = &state->m_colorxlat[0x0000/2];
|
// const uint16_t *colortable_r = &state->m_colorxlat[0x0000/2];
|
||||||
const uint16_t *colortable_g = &state->m_colorxlat[0x4000/2];
|
// const uint16_t *colortable_g = &state->m_colorxlat[0x4000/2];
|
||||||
const uint16_t *colortable_b = &state->m_colorxlat[0x8000/2];
|
// const uint16_t *colortable_b = &state->m_colorxlat[0x8000/2];
|
||||||
const uint16_t *lumaram = &state->m_lumaram[0];
|
// const uint16_t *lumaram = &state->m_lumaram[0];
|
||||||
uint32_t lumabase = object.lumabase;
|
// uint32_t lumabase = object.lumabase;
|
||||||
uint32_t color = object.colorbase;
|
uint32_t color = object.colorbase;
|
||||||
uint8_t luma;
|
// uint8_t luma;
|
||||||
uint32_t tr, tg, tb;
|
uint32_t tr, tg, tb;
|
||||||
int x;
|
int x;
|
||||||
#endif
|
#endif
|
||||||
@ -79,24 +80,28 @@ void MODEL2_FUNC_NAME(int32_t scanline, const extent_t& extent, const m2_poly_ex
|
|||||||
return;
|
return;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
luma = lumaram[(lumabase + (0xf << 3))];
|
// luma = lumaram[(lumabase + (0xf << 3))];
|
||||||
|
|
||||||
// fix luma overflow
|
// fix luma overflow
|
||||||
luma = std::min((int)luma,0x3f);
|
// luma = std::min((int)luma,0x3f);
|
||||||
|
|
||||||
color = state->m_palram[(color + 0x1000)] & 0x7fff;
|
color = state->m_palram[(color + 0x1000)] & 0xffff;
|
||||||
|
|
||||||
colortable_r += ((color >> 0) & 0x1f) << 8;
|
// colortable_r += ((color >> 0) & 0x1f) << 8;
|
||||||
colortable_g += ((color >> 5) & 0x1f) << 8;
|
// colortable_g += ((color >> 5) & 0x1f) << 8;
|
||||||
colortable_b += ((color >> 10) & 0x1f) << 8;
|
// colortable_b += ((color >> 10) & 0x1f) << 8;
|
||||||
|
|
||||||
/* we have the 6 bits of luma information along with 5 bits per color component */
|
/* 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 */
|
/* now build and index into the master color lookup table and extract the raw RGB values */
|
||||||
|
|
||||||
tr = colortable_r[(luma)] & 0xff;
|
// untextured path doesn't use luma & color table, cfr. Daytona and Motor Raid
|
||||||
tg = colortable_g[(luma)] & 0xff;
|
tr = pal5bit((color >> 0) & 0x1f); //colortable_r[(luma)] & 0xff;
|
||||||
tb = colortable_b[(luma)] & 0xff;
|
tg = pal5bit((color >> 5) & 0x1f); //colortable_g[(luma)] & 0xff;
|
||||||
|
tb = pal5bit((color >> 10) & 0x1f); //colortable_b[(luma)] & 0xff;
|
||||||
|
// tr = gamma_value[tr];
|
||||||
|
// tg = gamma_value[tg];
|
||||||
|
// tb = gamma_value[tb];
|
||||||
|
|
||||||
/* build the final color */
|
/* build the final color */
|
||||||
color = rgb_t(tr, tg, tb);
|
color = rgb_t(tr, tg, tb);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user