summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar angelosa <salese_corp_ltd@email.it>2018-03-08 15:38:02 +0100
committerGravatarGravatar angelosa <salese_corp_ltd@email.it>2018-03-08 16:11:22 +0100
commit05e851cc83beff696098a9e5edfdbf0d2eb7b11c (patch) (github)
treeea4c6a6628a5cd8624bd4fdda2cd996ad1c9eb94
parent54a87f0c0c95264ef04638d77589a323adb02ac2 (diff)
downloadmame-05e851cc83beff696098a9e5edfdbf0d2eb7b11c.zip
mame-05e851cc83beff696098a9e5edfdbf0d2eb7b11c.tar.bz2
model2.cpp: fixed untextured path colors (Motor Raid, Daytona USA) [Angelo Salese]
-rw-r--r--src/mame/video/model2rd.hxx37
1 files changed, 21 insertions, 16 deletions
diff --git a/src/mame/video/model2rd.hxx b/src/mame/video/model2rd.hxx
index f48d854e8e6..e8c13af9eb6 100644
--- a/src/mame/video/model2rd.hxx
+++ b/src/mame/video/model2rd.hxx
@@ -62,15 +62,16 @@ void MODEL2_FUNC_NAME(int32_t scanline, const extent_t& extent, const m2_poly_ex
model2_state *state = object.state;
bitmap_rgb32 *destmap = (bitmap_rgb32 *)&m_destmap;
uint32_t *p = &destmap->pix32(scanline);
+// uint8_t *gamma_value = &state->m_gamma_table[0];
/* extract color information */
- 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;
+// 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;
+// uint8_t luma;
uint32_t tr, tg, tb;
int x;
#endif
@@ -79,24 +80,28 @@ void MODEL2_FUNC_NAME(int32_t scanline, const extent_t& extent, const m2_poly_ex
return;
#else
- luma = lumaram[(lumabase + (0xf << 3))];
+// luma = lumaram[(lumabase + (0xf << 3))];
// 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_g += ((color >> 5) & 0x1f) << 8;
- colortable_b += ((color >> 10) & 0x1f) << 8;
+// colortable_r += ((color >> 0) & 0x1f) << 8;
+// colortable_g += ((color >> 5) & 0x1f) << 8;
+// colortable_b += ((color >> 10) & 0x1f) << 8;
/* 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[(luma)] & 0xff;
- tg = colortable_g[(luma)] & 0xff;
- tb = colortable_b[(luma)] & 0xff;
-
+ // untextured path doesn't use luma & color table, cfr. Daytona and Motor Raid
+ tr = pal5bit((color >> 0) & 0x1f); //colortable_r[(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 */
color = rgb_t(tr, tg, tb);