trunk/src/mame/drivers/astrof.c
| r28749 | r28750 | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | |
| 195 | | void astrof_state::astrof_get_pens( rgb_t *pens ) |
| 195 | void astrof_state::astrof_get_pens( pen_t *pens ) |
| 196 | 196 | { |
| 197 | 197 | offs_t i; |
| 198 | 198 | UINT8 bank = (m_astrof_palette_bank ? 0x10 : 0x00); |
| r28749 | r28750 | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | |
| 231 | | void astrof_state::tomahawk_get_pens( rgb_t *pens ) |
| 231 | void astrof_state::tomahawk_get_pens( pen_t *pens ) |
| 232 | 232 | { |
| 233 | 233 | offs_t i; |
| 234 | 234 | UINT8 *prom = memregion("proms")->base(); |
| r28749 | r28750 | |
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | |
| 355 | | void astrof_state::video_update_common( bitmap_rgb32 &bitmap, const rectangle &cliprect, rgb_t *pens ) |
| 355 | void astrof_state::video_update_common( bitmap_rgb32 &bitmap, const rectangle &cliprect, pen_t *pens, int num_pens ) |
| 356 | 356 | { |
| 357 | 357 | offs_t offs; |
| 358 | 358 | |
| r28749 | r28750 | |
| 363 | 363 | |
| 364 | 364 | UINT8 color = m_colorram[offs >> 1]; |
| 365 | 365 | |
| 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]; |
| 368 | 368 | |
| 369 | 369 | UINT8 y = offs; |
| 370 | 370 | UINT8 x = offs >> 8 << 3; |
| r28749 | r28750 | |
| 382 | 382 | |
| 383 | 383 | for (i = 0; i < 8; i++) |
| 384 | 384 | { |
| 385 | | rgb_t pen = (data & 0x01) ? fore_pen : back_pen; |
| 385 | pen_t pen = (data & 0x01) ? fore_pen : back_pen; |
| 386 | 386 | |
| 387 | 387 | if (m_flipscreen) |
| 388 | 388 | bitmap.pix32(y, 255 - x) = pen; |
| r28749 | r28750 | |
| 398 | 398 | |
| 399 | 399 | UINT32 astrof_state::screen_update_astrof(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 400 | 400 | { |
| 401 | | rgb_t pens[ASTROF_NUM_PENS]; |
| 401 | pen_t pens[ASTROF_NUM_PENS]; |
| 402 | 402 | |
| 403 | 403 | astrof_get_pens(pens); |
| 404 | 404 | |
| 405 | | video_update_common(bitmap, cliprect, pens); |
| 405 | video_update_common(bitmap, cliprect, pens, ASTROF_NUM_PENS); |
| 406 | 406 | |
| 407 | 407 | return 0; |
| 408 | 408 | } |
| r28749 | r28750 | |
| 410 | 410 | |
| 411 | 411 | UINT32 astrof_state::screen_update_tomahawk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 412 | 412 | { |
| 413 | | rgb_t pens[TOMAHAWK_NUM_PENS]; |
| 413 | pen_t pens[TOMAHAWK_NUM_PENS]; |
| 414 | 414 | |
| 415 | 415 | tomahawk_get_pens(pens); |
| 416 | 416 | |
| 417 | | video_update_common(bitmap, cliprect, pens); |
| 417 | video_update_common(bitmap, cliprect, pens, TOMAHAWK_NUM_PENS); |
| 418 | 418 | |
| 419 | 419 | return 0; |
| 420 | 420 | } |
trunk/src/mame/includes/astrof.h
| r28749 | r28750 | |
| 79 | 79 | UINT32 screen_update_tomahawk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 80 | 80 | TIMER_DEVICE_CALLBACK_MEMBER(irq_callback); |
| 81 | 81 | 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 ); |
| 84 | 84 | void astrof_set_video_control_2( UINT8 data ); |
| 85 | 85 | void spfghmk2_set_video_control_2( UINT8 data ); |
| 86 | 86 | 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 ); |
| 88 | 88 | }; |
| 89 | 89 | |
| 90 | 90 | /*----------- defined in audio/astrof.c -----------*/ |