diff options
-rw-r--r-- | src/mame/includes/shadfrce.h | 2 | ||||
-rw-r--r-- | src/mame/video/shadfrce.cpp | 56 |
2 files changed, 22 insertions, 36 deletions
diff --git a/src/mame/includes/shadfrce.h b/src/mame/includes/shadfrce.h index 652979dd13d..33dcff4409f 100644 --- a/src/mame/includes/shadfrce.h +++ b/src/mame/includes/shadfrce.h @@ -83,5 +83,5 @@ public: UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof(screen_device &screen, bool state); - void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offset ); + void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/video/shadfrce.cpp b/src/mame/video/shadfrce.cpp index c492790efb5..8b68a623b61 100644 --- a/src/mame/video/shadfrce.cpp +++ b/src/mame/video/shadfrce.cpp @@ -101,7 +101,7 @@ WRITE16_MEMBER(shadfrce_state::bg1scrolly_w) -void shadfrce_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offset ) +void shadfrce_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { /* | ---- ---- hhhf Fe-Y | ---- ---- yyyy yyyy | ---- ---- TTTT TTTT | ---- ---- tttt tttt | | ---- ---- -pCc cccX | ---- ---- xxxx xxxx | ---- ---- ---- ---- | ---- ---- ---- ---- | */ @@ -121,42 +121,29 @@ void shadfrce_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, c UINT16 *finish = m_spvideoram_old; UINT16 *source = finish + 0x2000/2 - 8; int hcount; - while (source >= finish) + while( source>=finish ) { + int ypos = 0x100 - (((source[0] & 0x0003) << 8) | (source[1] & 0x00ff)); + int xpos = (((source[4] & 0x0001) << 8) | (source[5] & 0x00ff)) + 1; + int tile = ((source[2] & 0x00ff) << 8) | (source[3] & 0x00ff); + int height = (source[0] & 0x00e0) >> 5; int enable = ((source[0] & 0x0004)); - - if (enable) - { - int ypos = 0x100 - (((source[0] & 0x0003) << 8) | (source[1] & 0x00ff)); - int height = ((source[0] & 0x00e0) >> 5) ; - height += 1; - - int bottom = ypos + y_offset; - int top = bottom - height * 16; - - if (top > cliprect.max_y || bottom <= cliprect.min_y) - { - source -= 8; - continue; - } - - int xpos = (((source[4] & 0x0001) << 8) | (source[5] & 0x00ff)) + 1; - int tile = ((source[2] & 0x00ff) << 8) | (source[3] & 0x00ff); - int flipx = ((source[0] & 0x0010) >> 4); - int flipy = ((source[0] & 0x0008) >> 3); - int pal = ((source[4] & 0x003e)); - int pri_mask = (source[4] & 0x0040) ? 0x02 : 0x00; - - if (pal & 0x20) pal ^= 0x60; /* skip hole */ - - - for (hcount = 0; hcount < height; hcount++) { - gfx->prio_transpen(bitmap, cliprect, tile + hcount, pal, flipx, flipy, xpos, bottom-16, screen.priority(), pri_mask, 0); - gfx->prio_transpen(bitmap, cliprect, tile + hcount, pal, flipx, flipy, xpos - 0x200, bottom-16, screen.priority(), pri_mask, 0); // x wraparound - bottom -= 16; + int flipx = ((source[0] & 0x0010) >> 4); + int flipy = ((source[0] & 0x0008) >> 3); + int pal = ((source[4] & 0x003e)); + int pri_mask = (source[4] & 0x0040) ? 0x02 : 0x00; + + if (pal & 0x20) pal ^= 0x60; /* skip hole */ + + height++; + if (enable) { + for (hcount=0;hcount<height;hcount++) { + gfx->prio_transpen(bitmap,cliprect,tile+hcount,pal,flipx,flipy,xpos,ypos-hcount*16-16,screen.priority(),pri_mask,0); + gfx->prio_transpen(bitmap,cliprect,tile+hcount,pal,flipx,flipy,xpos-0x200,ypos-hcount*16-16,screen.priority(),pri_mask,0); + gfx->prio_transpen(bitmap,cliprect,tile+hcount,pal,flipx,flipy,xpos,ypos-hcount*16-16+0x200,screen.priority(),pri_mask,0); + gfx->prio_transpen(bitmap,cliprect,tile+hcount,pal,flipx,flipy,xpos-0x200,ypos-hcount*16-16+0x200,screen.priority(),pri_mask,0); } } - source-=8; } } @@ -169,8 +156,7 @@ UINT32 shadfrce_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap { m_bg1tilemap->draw(screen, bitmap, cliprect, 0,0); m_bg0tilemap->draw(screen, bitmap, cliprect, 0,1); - draw_sprites(screen,bitmap,cliprect, 0); - draw_sprites(screen,bitmap,cliprect, 0x200); // y-wrap + draw_sprites(screen,bitmap,cliprect); m_fgtilemap->draw(screen, bitmap, cliprect, 0,0); } else |