Previous 199869 Revisions Next

r28750 Thursday 20th March, 2014 at 09:33:48 UTC by Oliver Stöneberg
replaced non-working astrof fix with pen access clamping (nw)
[src/mame/drivers]astrof.c
[src/mame/includes]astrof.h

trunk/src/mame/drivers/astrof.c
r28749r28750
192192}
193193
194194
195void astrof_state::astrof_get_pens( rgb_t *pens )
195void astrof_state::astrof_get_pens( pen_t *pens )
196196{
197197   offs_t i;
198198   UINT8 bank = (m_astrof_palette_bank ? 0x10 : 0x00);
r28749r28750
228228}
229229
230230
231void astrof_state::tomahawk_get_pens( rgb_t *pens )
231void astrof_state::tomahawk_get_pens( pen_t *pens )
232232{
233233   offs_t i;
234234   UINT8 *prom = memregion("proms")->base();
r28749r28750
352352}
353353
354354
355void astrof_state::video_update_common( bitmap_rgb32 &bitmap, const rectangle &cliprect, rgb_t *pens )
355void astrof_state::video_update_common( bitmap_rgb32 &bitmap, const rectangle &cliprect, pen_t *pens, int num_pens )
356356{
357357   offs_t offs;
358358
r28749r28750
363363
364364      UINT8 color = m_colorram[offs >> 1];
365365
366      rgb_t back_pen = pens[color | 0x00];
367      rgb_t fore_pen = pens[color | 0x01];
366      pen_t back_pen = pens[(color & (num_pens-1)) | 0x00];
367      pen_t fore_pen = pens[(color & (num_pens-1)) | 0x01];
368368
369369      UINT8 y = offs;
370370      UINT8 x = offs >> 8 << 3;
r28749r28750
382382
383383      for (i = 0; i < 8; i++)
384384      {
385         rgb_t pen = (data & 0x01) ? fore_pen : back_pen;
385         pen_t pen = (data & 0x01) ? fore_pen : back_pen;
386386
387387         if (m_flipscreen)
388388            bitmap.pix32(y, 255 - x) = pen;
r28749r28750
398398
399399UINT32 astrof_state::screen_update_astrof(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
400400{
401   rgb_t pens[ASTROF_NUM_PENS];
401   pen_t pens[ASTROF_NUM_PENS];
402402
403403   astrof_get_pens(pens);
404404
405   video_update_common(bitmap, cliprect, pens);
405   video_update_common(bitmap, cliprect, pens, ASTROF_NUM_PENS);
406406
407407   return 0;
408408}
r28749r28750
410410
411411UINT32 astrof_state::screen_update_tomahawk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
412412{
413   rgb_t pens[TOMAHAWK_NUM_PENS];
413   pen_t pens[TOMAHAWK_NUM_PENS];
414414
415415   tomahawk_get_pens(pens);
416416
417   video_update_common(bitmap, cliprect, pens);
417   video_update_common(bitmap, cliprect, pens, TOMAHAWK_NUM_PENS);
418418
419419   return 0;
420420}
trunk/src/mame/includes/astrof.h
r28749r28750
7979   UINT32 screen_update_tomahawk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
8080   TIMER_DEVICE_CALLBACK_MEMBER(irq_callback);
8181   rgb_t make_pen( UINT8 data );
82   void astrof_get_pens( rgb_t *pens );
83   void tomahawk_get_pens( rgb_t *pens );
82   void astrof_get_pens( pen_t *pens );
83   void tomahawk_get_pens( pen_t *pens );
8484   void astrof_set_video_control_2( UINT8 data );
8585   void spfghmk2_set_video_control_2( UINT8 data );
8686   void tomahawk_set_video_control_2( UINT8 data );
87   void video_update_common( bitmap_rgb32 &bitmap, const rectangle &cliprect, rgb_t *pens );
87   void video_update_common( bitmap_rgb32 &bitmap, const rectangle &cliprect, pen_t *pens, int num_pens );
8888};
8989
9090/*----------- defined in audio/astrof.c -----------*/

Previous 199869 Revisions Next


© 1997-2024 The MAME Team