replaced non-working astrof fix with pen access clamping (nw)

This commit is contained in:
Oliver Stöneberg 2014-03-20 09:33:48 +00:00
parent 7139fa970c
commit 4a4044e10c
2 changed files with 13 additions and 13 deletions

View File

@ -192,7 +192,7 @@ rgb_t astrof_state::make_pen( UINT8 data )
} }
void astrof_state::astrof_get_pens( rgb_t *pens ) void astrof_state::astrof_get_pens( pen_t *pens )
{ {
offs_t i; offs_t i;
UINT8 bank = (m_astrof_palette_bank ? 0x10 : 0x00); UINT8 bank = (m_astrof_palette_bank ? 0x10 : 0x00);
@ -228,7 +228,7 @@ void astrof_state::astrof_get_pens( rgb_t *pens )
} }
void astrof_state::tomahawk_get_pens( rgb_t *pens ) void astrof_state::tomahawk_get_pens( pen_t *pens )
{ {
offs_t i; offs_t i;
UINT8 *prom = memregion("proms")->base(); UINT8 *prom = memregion("proms")->base();
@ -352,7 +352,7 @@ WRITE8_MEMBER(astrof_state::tomahawk_video_control_2_w)
} }
void astrof_state::video_update_common( bitmap_rgb32 &bitmap, const rectangle &cliprect, rgb_t *pens ) void astrof_state::video_update_common( bitmap_rgb32 &bitmap, const rectangle &cliprect, pen_t *pens, int num_pens )
{ {
offs_t offs; offs_t offs;
@ -363,8 +363,8 @@ void astrof_state::video_update_common( bitmap_rgb32 &bitmap, const rectangle &c
UINT8 color = m_colorram[offs >> 1]; UINT8 color = m_colorram[offs >> 1];
rgb_t back_pen = pens[color | 0x00]; pen_t back_pen = pens[(color & (num_pens-1)) | 0x00];
rgb_t fore_pen = pens[color | 0x01]; pen_t fore_pen = pens[(color & (num_pens-1)) | 0x01];
UINT8 y = offs; UINT8 y = offs;
UINT8 x = offs >> 8 << 3; UINT8 x = offs >> 8 << 3;
@ -382,7 +382,7 @@ void astrof_state::video_update_common( bitmap_rgb32 &bitmap, const rectangle &c
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
{ {
rgb_t pen = (data & 0x01) ? fore_pen : back_pen; pen_t pen = (data & 0x01) ? fore_pen : back_pen;
if (m_flipscreen) if (m_flipscreen)
bitmap.pix32(y, 255 - x) = pen; bitmap.pix32(y, 255 - x) = pen;
@ -398,11 +398,11 @@ void astrof_state::video_update_common( bitmap_rgb32 &bitmap, const rectangle &c
UINT32 astrof_state::screen_update_astrof(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) UINT32 astrof_state::screen_update_astrof(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{ {
rgb_t pens[ASTROF_NUM_PENS]; pen_t pens[ASTROF_NUM_PENS];
astrof_get_pens(pens); astrof_get_pens(pens);
video_update_common(bitmap, cliprect, pens); video_update_common(bitmap, cliprect, pens, ASTROF_NUM_PENS);
return 0; return 0;
} }
@ -410,11 +410,11 @@ UINT32 astrof_state::screen_update_astrof(screen_device &screen, bitmap_rgb32 &b
UINT32 astrof_state::screen_update_tomahawk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) UINT32 astrof_state::screen_update_tomahawk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{ {
rgb_t pens[TOMAHAWK_NUM_PENS]; pen_t pens[TOMAHAWK_NUM_PENS];
tomahawk_get_pens(pens); tomahawk_get_pens(pens);
video_update_common(bitmap, cliprect, pens); video_update_common(bitmap, cliprect, pens, TOMAHAWK_NUM_PENS);
return 0; return 0;
} }

View File

@ -79,12 +79,12 @@ public:
UINT32 screen_update_tomahawk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_tomahawk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(irq_callback); TIMER_DEVICE_CALLBACK_MEMBER(irq_callback);
rgb_t make_pen( UINT8 data ); rgb_t make_pen( UINT8 data );
void astrof_get_pens( rgb_t *pens ); void astrof_get_pens( pen_t *pens );
void tomahawk_get_pens( rgb_t *pens ); void tomahawk_get_pens( pen_t *pens );
void astrof_set_video_control_2( UINT8 data ); void astrof_set_video_control_2( UINT8 data );
void spfghmk2_set_video_control_2( UINT8 data ); void spfghmk2_set_video_control_2( UINT8 data );
void tomahawk_set_video_control_2( UINT8 data ); void tomahawk_set_video_control_2( UINT8 data );
void video_update_common( bitmap_rgb32 &bitmap, const rectangle &cliprect, rgb_t *pens ); void video_update_common( bitmap_rgb32 &bitmap, const rectangle &cliprect, pen_t *pens, int num_pens );
}; };
/*----------- defined in audio/astrof.c -----------*/ /*----------- defined in audio/astrof.c -----------*/