diff --git a/src/mame/includes/twin16.h b/src/mame/includes/twin16.h index 2ebc77ae155..11e30772a8e 100644 --- a/src/mame/includes/twin16.h +++ b/src/mame/includes/twin16.h @@ -106,7 +106,7 @@ protected: int set_sprite_timer(); void spriteram_process(); - void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap ); + void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); int spriteram_process_enable(); void twin16_postload(); }; diff --git a/src/mame/video/twin16.cpp b/src/mame/video/twin16.cpp index 0d3fd3b20f7..a5bf2e24fa7 100644 --- a/src/mame/video/twin16.cpp +++ b/src/mame/video/twin16.cpp @@ -260,7 +260,7 @@ void twin16_state::spriteram_process( ) m_need_process_spriteram = 0; } -void twin16_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap ) +void twin16_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { const uint16_t *source = 0x1800+m_spriteram->buffer() + 0x800 - 4; const uint16_t *finish = 0x1800+m_spriteram->buffer(); @@ -331,14 +331,14 @@ void twin16_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap ) xpos = 320-xpos-width; flipx = !flipx; } - if( xpos>=320 ) xpos -= 65536; - if( ypos>=256 ) ypos -= 65536; + if( xpos>cliprect.max_x ) xpos -= 65536; + if( ypos>cliprect.max_y ) ypos -= 65536; /* slow slow slow, but it's ok for now */ for( y=0; y=16 && sy<256-16 ) + if( sy>=cliprect.min_y && sy<=cliprect.max_y ) { uint16_t *dest = &bitmap.pix16(sy); uint8_t *pdest = &screen.priority().pix8(sy); @@ -346,7 +346,7 @@ void twin16_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap ) for( x=0; x=0 && sx<320 ) + if( sx>=cliprect.min_x && sx<=cliprect.max_x ) { uint16_t pen = pen_data[x>>2]>>((~x&3)<<2)&0xf; @@ -538,7 +538,7 @@ uint32_t twin16_state::screen_update_twin16(screen_device &screen, bitmap_ind16 break; } - draw_sprites( screen, bitmap ); + draw_sprites( screen, bitmap, cliprect ); m_fixed_tmap->draw(screen, bitmap, cliprect, 0); return 0;