summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Angelo Salese <angelosa@users.noreply.github.com>2011-03-23 01:36:49 +0000
committer Angelo Salese <angelosa@users.noreply.github.com>2011-03-23 01:36:49 +0000
commit79a74baa57063fd3ef01ad9bcfc7da6b20d47014 (patch)
treecabe96b945f64a02be04c1c3d8112e3f2cfe662b
parent4c512a46d6ace743fa3c99fb5f93862d4ac905c5 (diff)
Deco 56: Allow rendering to a bitmap, with priority data intact, for manual mixing [David Haywood]
-rw-r--r--src/mame/drivers/deco32.c50
-rw-r--r--src/mame/includes/deco32.h6
-rw-r--r--src/mame/video/deco32.c212
-rw-r--r--src/mame/video/decospr.c109
-rw-r--r--src/mame/video/decospr.h3
5 files changed, 184 insertions, 196 deletions
diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c
index 3c2239b0443..575e78d1157 100644
--- a/src/mame/drivers/deco32.c
+++ b/src/mame/drivers/deco32.c
@@ -236,7 +236,7 @@ Notes:
#include "sound/2151intf.h"
#include "sound/okim6295.h"
#include "sound/bsmt2000.h"
-
+#include "video/decospr.h"
/**********************************************************************************/
@@ -694,6 +694,26 @@ static ADDRESS_MAP_START( captaven_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0x1e0000, 0x1e1fff) AM_RAM AM_BASE_MEMBER(deco32_state, pf3_rowscroll)
ADDRESS_MAP_END
+static READ32_HANDLER( deco32_spriteram_r )
+{
+ deco32_state *state = space->machine->driver_data<deco32_state>();
+ return state->spriteram16[offset] ^ 0xffff0000;
+}
+
+static WRITE32_HANDLER( deco32_spriteram_w )
+{
+ deco32_state *state = space->machine->driver_data<deco32_state>();
+ data &= 0x0000ffff;
+ mem_mask &= 0x0000ffff;
+ COMBINE_DATA(&state->spriteram16[offset]);
+}
+
+static WRITE32_HANDLER( deco32_buffer_spriteram_w )
+{
+ deco32_state *state = space->machine->driver_data<deco32_state>();
+ memcpy(state->spriteram16_buffered, state->spriteram16, 0x1000);
+}
+
static ADDRESS_MAP_START( fghthist_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0x000000, 0x001fff) AM_ROM AM_WRITE(deco32_pf1_data_w)
AM_RANGE(0x000000, 0x0fffff) AM_ROM
@@ -707,9 +727,8 @@ static ADDRESS_MAP_START( fghthist_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0x168000, 0x169fff) AM_RAM_WRITE(deco32_buffered_palette_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0x16c008, 0x16c00b) AM_WRITE(deco32_palette_dma_w)
//
- AM_RANGE(0x178000, 0x178fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
- AM_RANGE(0x179000, 0x179fff) AM_RAM AM_BASE_GENERIC(spriteram2) // ?
- AM_RANGE(0x17c010, 0x17c013) AM_WRITE(buffer_spriteram32_w)
+ AM_RANGE(0x178000, 0x179fff) AM_READWRITE(deco32_spriteram_r, deco32_spriteram_w)
+ AM_RANGE(0x17c010, 0x17c013) AM_WRITE(deco32_buffer_spriteram_w)
AM_RANGE(0x182000, 0x183fff) AM_RAM_WRITE(deco32_pf1_data_w) AM_BASE_MEMBER(deco32_state, pf1_data)
AM_RANGE(0x184000, 0x185fff) AM_RAM_WRITE(deco32_pf2_data_w) AM_BASE_MEMBER(deco32_state, pf2_data)
@@ -740,8 +759,8 @@ static ADDRESS_MAP_START( fghthsta_memmap, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0x16c008, 0x16c00b) AM_WRITE(deco32_palette_dma_w)
AM_RANGE(0x16c010, 0x16c013) AM_READNOP
- AM_RANGE(0x178000, 0x179fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
- AM_RANGE(0x17c010, 0x17c013) AM_WRITE(buffer_spriteram32_w)
+ AM_RANGE(0x178000, 0x179fff) AM_READWRITE(deco32_spriteram_r, deco32_spriteram_w)
+ AM_RANGE(0x17c010, 0x17c013) AM_WRITE(deco32_buffer_spriteram_w)
AM_RANGE(0x17c020, 0x17c023) AM_READNOP
AM_RANGE(0x182000, 0x183fff) AM_RAM_WRITE(deco32_pf1_data_w) AM_BASE_MEMBER(deco32_state, pf1_data)
@@ -1710,6 +1729,7 @@ static MACHINE_CONFIG_START( captaven, deco32_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.35)
MACHINE_CONFIG_END
+
static MACHINE_CONFIG_START( fghthist, deco32_state )
/* basic machine hardware */
@@ -1722,8 +1742,6 @@ static MACHINE_CONFIG_START( fghthist, deco32_state )
MCFG_EEPROM_93C46_ADD("eeprom")
- /* video hardware */
- MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM )
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -1735,6 +1753,9 @@ static MACHINE_CONFIG_START( fghthist, deco32_state )
MCFG_GFXDECODE(fghthist)
MCFG_PALETTE_LENGTH(2048)
+ MCFG_DEVICE_ADD("spritegen", decospr_, 0)
+ decospr_device_config::set_gfx_region(device, 3);
+
MCFG_VIDEO_START(fghthist)
/* sound hardware */
@@ -1767,7 +1788,7 @@ static MACHINE_CONFIG_START( fghthsta, deco32_state )
MCFG_EEPROM_93C46_ADD("eeprom")
/* video hardware */
- MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM )
+ //MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM )
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -1779,6 +1800,9 @@ static MACHINE_CONFIG_START( fghthsta, deco32_state )
MCFG_GFXDECODE(fghthist)
MCFG_PALETTE_LENGTH(2048)
+ MCFG_DEVICE_ADD("spritegen", decospr_, 0)
+ decospr_device_config::set_gfx_region(device, 3);
+
MCFG_VIDEO_START(fghthist)
/* sound hardware */
@@ -3082,10 +3106,10 @@ GAME( 1991, captavenuu, captaven, captaven, captaven, captaven, ROT0, "Data East
GAME( 1991, captavenua, captaven, captaven, captaven, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (US Rev 1.4)", 0 )
GAME( 1991, captavenj, captaven, captaven, captaven, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (Japan Rev 0.2)", 0 )
GAME( 1993, dragngun, 0, dragngun, dragngun, dragngun, ROT0, "Data East Corporation", "Dragon Gun (US)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1993, fghthist, 0, fghthist, fghthist, fghthist, ROT0, "Data East Corporation", "Fighter's History (World ver 43-07)", 0 )
-GAME( 1993, fghthistu, fghthist, fghthist, fghthist, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-03)", 0 )
-GAME( 1993, fghthista, fghthist, fghthsta, fghthist, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-05, alternate hardware )", 0 )
-GAME( 1993, fghthistj, fghthist, fghthist, fghthist, fghthist, ROT0, "Data East Corporation", "Fighter's History (Japan ver 42-03)", 0 )
+GAME( 1993, fghthist, 0, fghthist, fghthist, fghthist, ROT0, "Data East Corporation", "Fighter's History (World ver 43-07)", GAME_UNEMULATED_PROTECTION )
+GAME( 1993, fghthistu, fghthist, fghthist, fghthist, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-03)", GAME_UNEMULATED_PROTECTION )
+GAME( 1993, fghthista, fghthist, fghthsta, fghthist, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-05, alternate hardware)", GAME_UNEMULATED_PROTECTION )
+GAME( 1993, fghthistj, fghthist, fghthist, fghthist, fghthist, ROT0, "Data East Corporation", "Fighter's History (Japan ver 42-03)", GAME_UNEMULATED_PROTECTION )
GAME( 1994, lockload, 0, lockload, lockload, lockload, ROT0, "Data East Corporation", "Locked 'n Loaded (World)", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
GAME( 1994, lockloadu, lockload, lockload, lockload, lockload, ROT0, "Data East Corporation", "Locked 'n Loaded (US)", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
GAME( 1994, tattass, 0, tattass, tattass, tattass, ROT0, "Data East Pinball", "Tattoo Assassins (US prototype)", GAME_IMPERFECT_GRAPHICS )
diff --git a/src/mame/includes/deco32.h b/src/mame/includes/deco32.h
index 74ef89b73f9..cd0e756ea6c 100644
--- a/src/mame/includes/deco32.h
+++ b/src/mame/includes/deco32.h
@@ -59,8 +59,12 @@ public:
UINT32 dragngun_sprite_ctrl;
int ace_ram_dirty;
int has_ace_ram;
- bitmap_t *sprite_priority_bitmap;
int last_pf3_bank;
+
+ bitmap_t* temp_bitmap_sprites;
+ UINT16 spriteram16[0x1000];
+ UINT16 spriteram16_buffered[0x1000];
+
};
diff --git a/src/mame/video/deco32.c b/src/mame/video/deco32.c
index 12917e2d821..aadf463de39 100644
--- a/src/mame/video/deco32.c
+++ b/src/mame/video/deco32.c
@@ -1,85 +1,8 @@
#include "emu.h"
#include "includes/deco32.h"
+#include "video/decospr.h"
-/******************************************************************************
-
- This sprite_priority_bitmap handling is the same as in deco16ic.c
-
-******************************************************************************/
-
-
-static void deco16_clear_sprite_priority_bitmap(deco32_state *state)
-{
- if (state->sprite_priority_bitmap)
- bitmap_fill(state->sprite_priority_bitmap,NULL,0);
-}
-
-/* A special pdrawgfx z-buffered sprite renderer that is needed to properly draw multiple sprite sources with alpha */
-static void deco16_pdrawgfx(
- bitmap_t *dest,const rectangle *clip,const gfx_element *gfx,
- UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
- int transparent_color,UINT32 pri_mask,UINT32 sprite_mask,UINT8 write_pri,UINT8 alpha)
-{
- deco32_state *state = gfx->machine->driver_data<deco32_state>();
- int ox,oy,cx,cy;
- int x_index,y_index,x,y;
- bitmap_t *priority_bitmap = gfx->machine->priority_bitmap;
- const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
- const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements);
-
- /* check bounds */
- ox = sx;
- oy = sy;
-
- if (sx>319 || sy>247 || sx<-15 || sy<-7)
- return;
-
- if (sy<0) sy=0;
- if (sx<0) sx=0;
- if (sx>319) cx=319;
- else cx=ox+16;
-
- cy=(sy-oy);
-
- if (flipy) y_index=15-cy; else y_index=cy;
-
- for( y=0; y<16-cy; y++ )
- {
- const UINT8 *source = code_base + (y_index * gfx->line_modulo);
- UINT32 *destb = BITMAP_ADDR32(dest, sy, 0);
- UINT8 *pri = BITMAP_ADDR8(priority_bitmap, sy, 0);
- UINT8 *spri = BITMAP_ADDR8(state->sprite_priority_bitmap, sy, 0);
-
- if (sy >= 0 && sy < 248)
- {
- if (flipx) { source+=15-(sx-ox); x_index=-1; } else { x_index=1; source+=(sx-ox); }
-
- for (x=sx; x<cx; x++)
- {
- int c = *source;
- if( c != transparent_color && x >= 0 && x < 320 )
- {
- if (pri_mask>pri[x] && sprite_mask>spri[x]) {
- if (alpha != 0xff)
- destb[x] = alpha_blend_r32(destb[x], pal[c], alpha);
- else
- destb[x] = pal[c];
- if (write_pri)
- pri[x] |= pri_mask;
- }
- spri[x]|=sprite_mask;
- }
- source+=x_index;
- }
- }
-
- sy++;
- if (sy>247)
- return;
- if (flipy) y_index--; else y_index++;
- }
-}
/******************************************************************************/
@@ -366,67 +289,6 @@ static void captaven_draw_sprites(running_machine* machine, bitmap_t *bitmap, co
}
}
-static void fghthist_draw_sprites(running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT32 *spritedata, int gfxbank, int mask, int colourmask)
-{
- int offs;
-
- for (offs = 0x400 - 4; offs >= 0; offs -=4)
- {
- int x,y,sprite,colour,multi,fx,fy,inc,flash,mult,pri=0;
- int alpha = 0xff;
-
- sprite = spritedata[offs+1] & 0xffff;
-
- y = spritedata[offs];
- flash=y&0x1000;
- if (flash && (machine->primary_screen->frame_number() & 1)) continue;
-
- x = spritedata[offs+2];
- colour = (x >>9) & colourmask;
-
- if ((y&0x8000))
- pri=1;
- else
- pri=4;
-
- fx = y & 0x2000;
- fy = y & 0x4000;
- multi = (1 << ((y & 0x0600) >> 9)) - 1; /* 1x, 2x, 4x, 8x height */
-
- x = x & 0x01ff;
- y = y & 0x01ff;
- if (x >= 320) x -= 512;
- if (y >= 256) y -= 512;
-
- sprite &= ~multi;
- if (fy)
- inc = -1;
- else
- {
- sprite += multi;
- inc = 1;
- }
-
- mult=+16;
-
- if (fx) fx=0; else fx=1;
- if (fy) fy=0; else fy=1;
-
- while (multi >= 0)
- {
- deco16_pdrawgfx(
- bitmap,cliprect,machine->gfx[gfxbank],
- sprite - multi * inc,
- colour,
- fx,fy,
- x,y + mult * multi,
- 0,pri,1<<gfxbank, 1, alpha);
-
- multi--;
- }
- }
-}
-
/*
This renders sprites to a 16 bit bitmap, for later mixing.
Bottom 8 bits per pixel is palettised sprite data, top 8 is
@@ -1071,10 +933,10 @@ VIDEO_START( fghthist )
state->pf1a_tilemap =0;
state->dirty_palette = auto_alloc_array(machine, UINT8, 4096);
- /* Allow sprite bitmap */
int width = machine->primary_screen->width();
int height = machine->primary_screen->height();
- state->sprite_priority_bitmap = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16 );
+ state->temp_bitmap_sprites = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
+ machine->device<decospr_device>("spritegen")->set_sprite_bitmap(state->temp_bitmap_sprites);
tilemap_set_transparent_pen(state->pf1_tilemap,0);
tilemap_set_transparent_pen(state->pf2_tilemap,0);
@@ -1426,9 +1288,56 @@ SCREEN_UPDATE( dragngun )
return 0;
}
+// inefficient, we should be able to mix in a single pass by comparing the existing priority bitmap from the tilemaps
+// mixing is also still wrong for some levels (it was before this rewrite of the code also)
+void fghthist_mix_sprites(running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect, bool hipriority)
+{
+ deco32_state *state = machine->driver_data<deco32_state>();
+
+ int y, x;
+ const pen_t *paldata = machine->pens;
+
+ UINT16* srcline;
+ UINT32* dstline;
+
+ for (y=cliprect->min_y;y<=cliprect->max_y;y++)
+ {
+ srcline= BITMAP_ADDR16(state->temp_bitmap_sprites, y, 0);
+ dstline= BITMAP_ADDR32(bitmap, y, 0);
+
+ for (x=cliprect->min_x;x<=cliprect->max_x;x++)
+ {
+ UINT16 pix = srcline[x];
+
+ if (pix&0xf)
+ {
+ if (hipriority)
+ {
+ if (!(pix&0x800))
+ dstline[x] = paldata[(pix&0x1ff) + 1024];
+ }
+ else
+ {
+ if ((pix&0x800))
+ dstline[x] = paldata[(pix&0x1ff) + 1024];
+ }
+
+ }
+ }
+ }
+
+}
+
SCREEN_UPDATE( fghthist )
{
deco32_state *state = screen->machine->driver_data<deco32_state>();
+
+ bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(state->temp_bitmap_sprites, cliprect, 0);
+ bitmap_fill(bitmap,cliprect,screen->machine->pens[0x000]); // Palette index not confirmed
+
+ screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram16_buffered, 0x800, true);
+
/* Dirty tilemaps if any globals change */
if (state->pf1_flip!=((state->pf12_control[6]>>0)&0x3))
tilemap_mark_all_tiles_dirty(state->pf1_tilemap);
@@ -1463,21 +1372,24 @@ SCREEN_UPDATE( fghthist )
deco32_setup_scroll(state->pf4_tilemap, 512,(state->pf34_control[5]>>8)&0xff,(state->pf34_control[6]>>8)&0xff,state->pf34_control[4],state->pf34_control[3],state->pf4_rowscroll,state->pf4_rowscroll+0x200);
/* Draw screen */
- deco16_clear_sprite_priority_bitmap(state);
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
- bitmap_fill(bitmap,cliprect,screen->machine->pens[0x000]); // Palette index not confirmed
- tilemap_draw(bitmap,cliprect,state->pf4_tilemap,0,0);
+ tilemap_draw(bitmap,cliprect,state->pf4_tilemap,0,1);
+
+
if(state->pri&1)
{
- tilemap_draw(bitmap,cliprect,state->pf2_tilemap,0,0);
- tilemap_draw(bitmap,cliprect,state->pf3_tilemap,0,2);
+ tilemap_draw(bitmap,cliprect,state->pf2_tilemap,0,2);
+ fghthist_mix_sprites(screen->machine, bitmap, cliprect, false); // lower pri sprites from bitmap
+ tilemap_draw(bitmap,cliprect,state->pf3_tilemap,0,4);
}
else
{
- tilemap_draw(bitmap,cliprect,state->pf3_tilemap,0,0);
- tilemap_draw(bitmap,cliprect,state->pf2_tilemap,0,2);
+ tilemap_draw(bitmap,cliprect,state->pf3_tilemap,0,2);
+ fghthist_mix_sprites(screen->machine, bitmap, cliprect, false); // lower pri sprites from bitmap
+ tilemap_draw(bitmap,cliprect,state->pf2_tilemap,0,4);
}
- fghthist_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u32,3,0, 0xf);
+
+ fghthist_mix_sprites(screen->machine, bitmap, cliprect, true); // hig pri sprites from bitmap
+
tilemap_draw(bitmap,cliprect,state->pf1_tilemap,0,0);
return 0;
}
diff --git a/src/mame/video/decospr.c b/src/mame/video/decospr.c
index 8acb04642de..e16e9d5c8a8 100644
--- a/src/mame/video/decospr.c
+++ b/src/mame/video/decospr.c
@@ -5,6 +5,7 @@
some games have different visible areas, but are confirmed as the same sprite chip.
games with alpha aren't supported here yet, in most cases they need better mixing anyway, probably rendering to screen buffers and manual mixing.
+ see m_sprite_bitmap...
used by:
@@ -80,6 +81,7 @@ void decospr_device::device_start()
{
// sprite_kludge_x = sprite_kludge_y = 0;
// printf("decospr_device::device_start()\n");
+ m_sprite_bitmap = 0;
}
void decospr_device::device_reset()
@@ -95,6 +97,11 @@ void decospr_device::decospr_sprite_kludge(int x, int y)
}
*/
+void decospr_device::set_sprite_bitmap(bitmap_t* bitmap)
+{
+ m_sprite_bitmap = bitmap;
+}
+
void decospr_device::set_pri_callback(decospr_priority_callback_func callback)
{
m_pricallback = callback;
@@ -105,14 +112,15 @@ void decospr_device::set_pri_callback(decospr_priority_callback_func callback)
offs +0
-------- --------
- fFbSssy yyyyyyyy
+efFbSssy yyyyyyyy
s = size (multipart)
-S = size (x?) (does any other game use this?)
+S = size (x?) (double wings)
f = flipy
b = flash
F = flipx
y = ypos
+e = extra priority bit (or at least externally detectable by mixer circuits)
offs +1
-------- --------
@@ -133,6 +141,10 @@ x = xpos
void decospr_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram, int sizewords, bool invert_flip )
{
+
+ if (m_sprite_bitmap && m_pricallback)
+ fatalerror("m_sprite_bitmap && m_pricallback is invalid");
+
int offs, end, incr;
int flipscreen = flip_screen_get(machine);
@@ -157,7 +169,7 @@ void decospr_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, c
while (offs!=end)
{
int x, y, sprite, colour, multi, mult2, fx, fy, inc, flash, mult, xsize, pri;
-
+
sprite = spriteram[offs + 1];
y = spriteram[offs];
@@ -167,8 +179,17 @@ void decospr_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, c
{
x = spriteram[offs + 2];
- colour = (x >> 9) & 0x1f;
+
+ if (!m_sprite_bitmap)
+ colour = (x >> 9) & 0x1f;
+ else
+ {
+ colour = (x >> 9) & 0x7f;
+ if (y&0x8000) colour |= 0x80; // fghthist uses this to mark priority
+ //colour *= 0x10; // for raw drawing
+ }
+
if (m_pricallback)
pri = m_pricallback(x);
else
@@ -230,40 +251,66 @@ void decospr_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, c
while (multi >= 0)
{
- if (m_pricallback)
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[m_gfxregion],
- sprite - multi * inc,
- colour,
- fx,fy,
- x,y + mult * multi,
- machine->priority_bitmap,pri,0);
- else
- drawgfx_transpen(bitmap,cliprect,machine->gfx[m_gfxregion],
- sprite - multi * inc,
- colour,
- fx,fy,
- x,y + mult * multi,
- 0);
-
- // double wing uses this flag
- if (xsize)
+ if(!m_sprite_bitmap)
{
+
if (m_pricallback)
pdrawgfx_transpen(bitmap,cliprect,machine->gfx[m_gfxregion],
- (sprite - multi * inc)-mult2,
- colour,
- fx,fy,
- x-16,y + mult * multi,
- machine->priority_bitmap,pri,0);
+ sprite - multi * inc,
+ colour,
+ fx,fy,
+ x,y + mult * multi,
+ machine->priority_bitmap,pri,0);
else
drawgfx_transpen(bitmap,cliprect,machine->gfx[m_gfxregion],
- (sprite - multi * inc)-mult2,
- colour,
- fx,fy,
- x-16,y + mult * multi,
- 0);
+ sprite - multi * inc,
+ colour,
+ fx,fy,
+ x,y + mult * multi,
+ 0);
+
+ // double wing uses this flag
+ if (xsize)
+ {
+ if (m_pricallback)
+ pdrawgfx_transpen(bitmap,cliprect,machine->gfx[m_gfxregion],
+ (sprite - multi * inc)-mult2,
+ colour,
+ fx,fy,
+ x-16,y + mult * multi,
+ machine->priority_bitmap,pri,0);
+ else
+ drawgfx_transpen(bitmap,cliprect,machine->gfx[m_gfxregion],
+ (sprite - multi * inc)-mult2,
+ colour,
+ fx,fy,
+ x-16,y + mult * multi,
+ 0);
+ }
+ }
+ else
+ {
+ // if we have a sprite bitmap draw raw data to it for manual mixing
+ drawgfx_transpen_raw(m_sprite_bitmap,cliprect,machine->gfx[m_gfxregion],
+ sprite - multi * inc,
+ colour*0x10,
+ fx,fy,
+ x,y + mult * multi,
+ 0);
+ if (xsize)
+ {
+ drawgfx_transpen_raw(m_sprite_bitmap,cliprect,machine->gfx[m_gfxregion],
+ (sprite - multi * inc)-mult2,
+ colour*0x10,
+ fx,fy,
+ x-16,y + mult * multi,
+ 0);
+ }
}
+
+
+
multi--;
}
}
diff --git a/src/mame/video/decospr.h b/src/mame/video/decospr.h
index 007ffc063de..42754824084 100644
--- a/src/mame/video/decospr.h
+++ b/src/mame/video/decospr.h
@@ -25,6 +25,7 @@ public:
void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram, int sizewords, bool invert_flip = false );
void set_pri_callback(decospr_priority_callback_func callback);
void set_gfxregion(int region) { m_gfxregion = region; };
+ void set_sprite_bitmap(bitmap_t* bitmap);
protected:
virtual void device_start();
@@ -32,7 +33,7 @@ protected:
const decospr_device_config &m_config;
UINT8 m_gfxregion;
decospr_priority_callback_func m_pricallback;
-
+ bitmap_t *m_sprite_bitmap;// optional sprite bitmap (should be INDEXED16)
private:
};