| Previous | 199869 Revisions | Next |
| r40074 Thursday 30th July, 2015 at 10:10:47 UTC by Dirk Best |
|---|
| dai3wksi: use standard 3-bit brg palette |
| [src/mame/drivers] | dai3wksi.c |
| r248585 | r248586 | |
|---|---|---|
| 58 | 58 | m_ic79(*this, "ic79"), |
| 59 | 59 | m_ic80(*this, "ic80"), |
| 60 | 60 | m_ic81(*this, "ic81"), |
| 61 | m_palette(*this, "palette"), | |
| 61 | 62 | m_dai3wksi_videoram(*this, "videoram"), |
| 62 | 63 | m_in2(*this, "IN2") { } |
| 63 | 64 | |
| r248585 | r248586 | |
| 69 | 70 | optional_device<sn76477_device> m_ic79; |
| 70 | 71 | optional_device<sn76477_device> m_ic80; |
| 71 | 72 | optional_device<sn76477_device> m_ic81; |
| 73 | required_device<palette_device> m_palette; | |
| 72 | 74 | |
| 73 | 75 | /* video */ |
| 74 | 76 | required_shared_ptr<UINT8> m_dai3wksi_videoram; |
| r248585 | r248586 | |
| 140 | 142 | 3, 3,3,2,2,6,6,6,6, 6,6,6,6,6,6,6,6, 3,3,3,3,3,3,3,3, 7,7,7,7,7,7,7,7, 3,3,3,3,3,3,3,3, 2,2,2,2,2,2,2,2, 6,6,6,6,6,6,6,6, 4,4,4,4,4,4,4, |
| 141 | 143 | }; |
| 142 | 144 | |
| 143 | ||
| 144 | static void dai3wksi_get_pens(pen_t *pens) | |
| 145 | { | |
| 146 | offs_t i; | |
| 147 | ||
| 148 | for (i = 0; i <= 7; i++) | |
| 149 | { | |
| 150 | pens[i] = rgb_t(pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0)); | |
| 151 | } | |
| 152 | } | |
| 153 | ||
| 154 | ||
| 155 | 145 | UINT32 dai3wksi_state::screen_update_dai3wksi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 156 | 146 | { |
| 157 | offs_t offs; | |
| 158 | pen_t pens[8]; | |
| 159 | ||
| 160 | dai3wksi_get_pens(pens); | |
| 161 | ||
| 162 | for (offs = 0; offs < m_dai3wksi_videoram.bytes(); offs++) | |
| 147 | for (offs_t offs = 0; offs < m_dai3wksi_videoram.bytes(); offs++) | |
| 163 | 148 | { |
| 164 | offs_t i; | |
| 165 | ||
| 166 | 149 | UINT8 x = offs << 2; |
| 167 | 150 | UINT8 y = offs >> 6; |
| 168 | 151 | UINT8 data = m_dai3wksi_videoram[offs]; |
| r248585 | r248586 | |
| 181 | 164 | color = vr_prom1[value]; |
| 182 | 165 | } |
| 183 | 166 | |
| 184 | for (i = 0; i <= 3; i++) | |
| 167 | for (int i = 0; i <= 3; i++) | |
| 185 | 168 | { |
| 186 | | |
| 169 | rgb_t pen = (data & (1 << i)) ? m_palette->pen_color(color) : rgb_t::black; | |
| 187 | 170 | |
| 188 | 171 | if (m_dai3wksi_flipscreen) |
| 189 | 172 | bitmap.pix32(255-y, 255-x) = pen; |
| r248585 | r248586 | |
| 428 | 411 | MCFG_SCREEN_REFRESH_RATE(60) |
| 429 | 412 | MCFG_SCREEN_UPDATE_DRIVER(dai3wksi_state, screen_update_dai3wksi) |
| 430 | 413 | |
| 414 | MCFG_PALETTE_ADD_3BIT_BRG("palette") | |
| 415 | ||
| 431 | 416 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 432 | 417 | |
| 433 | 418 | #if (USE_SAMPLES) |
| https://github.com/mamedev/mame/commit/ecd758016ce70f5c224d49f6a320391a0ad8e29a |
| Previous | 199869 Revisions | Next |