Previous 199869 Revisions Next

r39978 Monday 27th July, 2015 at 16:20:23 UTC by Dirk Best
kangaroo: use standard 3-bit rgb palette
[src/mame/drivers]kangaroo.c
[src/mame/includes]kangaroo.h
[src/mame/video]kangaroo.c

trunk/src/mame/drivers/kangaroo.c
r248489r248490
443443   MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK, 320*2, 0*2, 256*2, 260, 8, 248)
444444   MCFG_SCREEN_UPDATE_DRIVER(kangaroo_state, screen_update_kangaroo)
445445
446   MCFG_PALETTE_ADD_3BIT_BGR("palette")
447
446448   /* sound hardware */
447449   MCFG_SPEAKER_STANDARD_MONO("mono")
448450   MCFG_SOUND_ADD("aysnd", AY8910, MASTER_CLOCK/8)
trunk/src/mame/includes/kangaroo.h
r248489r248490
1414   kangaroo_state(const machine_config &mconfig, device_type type, const char *tag)
1515      : driver_device(mconfig, type, tag),
1616      m_video_control(*this, "video_control"),
17      m_maincpu(*this, "maincpu") { }
17      m_maincpu(*this, "maincpu"),
18      m_palette(*this, "palette") { }
1819
1920   /* memory pointers */
2021   required_shared_ptr<UINT8> m_video_control;
r248489r248490
3738   void videoram_write( UINT16 offset, UINT8 data, UINT8 mask );
3839   void blitter_execute(  );
3940   required_device<cpu_device> m_maincpu;
41   required_device<palette_device> m_palette;
4042};
trunk/src/mame/video/kangaroo.c
r248489r248490
141141   UINT8 enab = (m_video_control[9] & 0x04);
142142   UINT8 pria = (~m_video_control[9] & 0x02);
143143   UINT8 prib = (~m_video_control[9] & 0x01);
144   rgb_t pens[8];
145144   int x, y;
146145
147   /* build up the pens arrays */
148   for (x = 0; x < 8; x++)
149      pens[x] = rgb_t(pal1bit(x >> 2), pal1bit(x >> 1), pal1bit(x >> 0));
150
151146   /* iterate over pixels */
152147   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
153148   {
r248489r248490
171166            finalpens |= pixb;
172167
173168         /* store the first of two pixels, which is always full brightness */
174         dest[x + 0] = pens[finalpens & 7];
169         dest[x + 0] = m_palette->pen_color(finalpens & 7);
175170
176171         /* KOS1 alternates at 5MHz, offset from the pixel clock by 1/2 clock */
177172         /* when 0, it enables the color mask for pixels with Z = 0 */
r248489r248490
188183         }
189184
190185         /* store the second of two pixels, which is affected by KOS1 and the A/B masks */
191         dest[x + 1] = pens[finalpens & 7];
186         dest[x + 1] = m_palette->pen_color(finalpens & 7);
192187      }
193188   }
194189


Previous 199869 Revisions Next


© 1997-2024 The MAME Team