mirror of
https://github.com/holub/mame
synced 2025-04-22 08:22:15 +03:00
thepit.c - change sprite handling a bit.
This commit is contained in:
parent
34847974eb
commit
babb6dea4d
@ -322,9 +322,9 @@ static INPUT_PORTS_START( desertdn )
|
||||
PORT_DIPSETTING( 0x04, "4" )
|
||||
PORT_DIPSETTING( 0x08, "5" )
|
||||
PORT_DIPSETTING( 0x0c, "6" )
|
||||
PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) /* Cabinet Type or Bonus ?? */
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) )
|
||||
PORT_DIPSETTING( 0x10, DEF_STR( Cocktail ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
|
||||
PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) /* Cabinet Type or Bonus ?? */
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x20, DEF_STR( On ) )
|
||||
|
@ -4,6 +4,9 @@
|
||||
|
||||
Functions to emulate the video hardware of the machine.
|
||||
|
||||
I have a feeling sprite area masking should be done based on tile
|
||||
attributes, not a custom cliprect.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
@ -228,8 +231,6 @@ static void draw_sprites(running_machine &machine,
|
||||
const rectangle &cliprect,
|
||||
int priority_to_draw)
|
||||
{
|
||||
const rectangle spritevisiblearea(2*8+1, 32*8-1, 2*8, 30*8-1);
|
||||
const rectangle spritevisibleareaflipx(0*8, 30*8-2, 2*8, 30*8-1);
|
||||
|
||||
thepit_state *state = machine.driver_data<thepit_state>();
|
||||
int offs;
|
||||
@ -266,11 +267,18 @@ static void draw_sprites(running_machine &machine,
|
||||
/* sprites 0-3 are drawn one pixel down */
|
||||
if (offs < 16) y++;
|
||||
|
||||
drawgfx_transpen(bitmap, state->m_flip_screen_x ? spritevisibleareaflipx : spritevisiblearea,
|
||||
drawgfx_transpen(bitmap, cliprect,
|
||||
machine.gfx[2 * state->m_graphics_bank + 1],
|
||||
state->m_spriteram[offs + 1] & 0x3f,
|
||||
state->m_spriteram[offs + 2],
|
||||
flipx, flipy, x, y, 0);
|
||||
|
||||
drawgfx_transpen(bitmap, cliprect,
|
||||
machine.gfx[2 * state->m_graphics_bank + 1],
|
||||
state->m_spriteram[offs + 1] & 0x3f,
|
||||
state->m_spriteram[offs + 2],
|
||||
flipx, flipy, x-256, y, 0);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -278,6 +286,9 @@ static void draw_sprites(running_machine &machine,
|
||||
|
||||
UINT32 thepit_state::screen_update_thepit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
const rectangle spritevisiblearea(2*8+1, 32*8-1, 2*8, 30*8-1);
|
||||
const rectangle spritevisibleareaflipx(0*8, 30*8-2, 2*8, 30*8-1);
|
||||
|
||||
offs_t offs;
|
||||
|
||||
for (offs = 0; offs < 32; offs++)
|
||||
@ -297,13 +308,13 @@ UINT32 thepit_state::screen_update_thepit(screen_device &screen, bitmap_ind16 &b
|
||||
m_tilemap->draw(bitmap, cliprect, 0, 0);
|
||||
|
||||
/* low priority sprites */
|
||||
draw_sprites(machine(), bitmap, cliprect, 0);
|
||||
draw_sprites(machine(), bitmap, m_flip_screen_x ? spritevisibleareaflipx : spritevisiblearea, 0);
|
||||
|
||||
/* high priority tiles */
|
||||
m_solid_tilemap->draw(bitmap, cliprect, 1, 1);
|
||||
|
||||
/* high priority sprites */
|
||||
draw_sprites(machine(), bitmap, cliprect, 1);
|
||||
draw_sprites(machine(), bitmap, m_flip_screen_x ? spritevisibleareaflipx : spritevisiblearea, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -311,7 +322,8 @@ UINT32 thepit_state::screen_update_thepit(screen_device &screen, bitmap_ind16 &b
|
||||
UINT32 thepit_state::screen_update_desertdan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
offs_t offs;
|
||||
|
||||
const rectangle spritevisiblearea(0*8+1, 24*8-1, 2*8, 30*8-1);
|
||||
const rectangle spritevisibleareaflipx(8*8, 32*8-2, 2*8, 30*8-1);
|
||||
|
||||
for (offs = 0; offs < 32; offs++)
|
||||
{
|
||||
@ -332,15 +344,15 @@ UINT32 thepit_state::screen_update_desertdan(screen_device &screen, bitmap_ind16
|
||||
|
||||
/* low priority sprites */
|
||||
m_graphics_bank = 1;
|
||||
draw_sprites(machine(), bitmap, cliprect, 0);
|
||||
draw_sprites(machine(), bitmap, m_flip_screen_y ? spritevisibleareaflipx : spritevisiblearea, 0);
|
||||
|
||||
/* high priority tiles */
|
||||
/* high priority tiles */ // not sure about this, draws a white block over the title logo sprite, looks like it should be behind?
|
||||
m_graphics_bank = 0;
|
||||
m_solid_tilemap->draw(bitmap, cliprect, 1, 1);
|
||||
|
||||
/* high priority sprites */
|
||||
m_graphics_bank = 1;
|
||||
draw_sprites(machine(), bitmap, cliprect, 1);
|
||||
draw_sprites(machine(), bitmap, m_flip_screen_y ? spritevisibleareaflipx : spritevisiblearea, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user