Made deco32.c independent of deco16ic.c (it only needed a drawing routine) and removed deco16ic.c now that it is not needed anymore [Fabio Priuli]

This commit is contained in:
Fabio Priuli 2010-02-25 13:11:59 +00:00
parent e462954734
commit acf08c5b70
7 changed files with 93 additions and 1127 deletions

2
.gitattributes vendored
View File

@ -2474,7 +2474,6 @@ src/mame/includes/ddragon3.h svneol=native#text/plain
src/mame/includes/ddribble.h svneol=native#text/plain src/mame/includes/ddribble.h svneol=native#text/plain
src/mame/includes/dec0.h svneol=native#text/plain src/mame/includes/dec0.h svneol=native#text/plain
src/mame/includes/dec8.h svneol=native#text/plain src/mame/includes/dec8.h svneol=native#text/plain
src/mame/includes/deco16ic.h svneol=native#text/plain
src/mame/includes/deco32.h svneol=native#text/plain src/mame/includes/deco32.h svneol=native#text/plain
src/mame/includes/decocrpt.h svneol=native#text/plain src/mame/includes/decocrpt.h svneol=native#text/plain
src/mame/includes/decoprot.h svneol=native#text/plain src/mame/includes/decoprot.h svneol=native#text/plain
@ -3353,7 +3352,6 @@ src/mame/video/ddribble.c svneol=native#text/plain
src/mame/video/deadang.c svneol=native#text/plain src/mame/video/deadang.c svneol=native#text/plain
src/mame/video/dec0.c svneol=native#text/plain src/mame/video/dec0.c svneol=native#text/plain
src/mame/video/dec8.c svneol=native#text/plain src/mame/video/dec8.c svneol=native#text/plain
src/mame/video/deco16ic.c svneol=native#text/plain
src/mame/video/deco32.c svneol=native#text/plain src/mame/video/deco32.c svneol=native#text/plain
src/mame/video/deco_mlc.c svneol=native#text/plain src/mame/video/deco_mlc.c svneol=native#text/plain
src/mame/video/decocass.c svneol=native#text/plain src/mame/video/decocass.c svneol=native#text/plain

View File

@ -13,7 +13,6 @@
#define DE156CPU ARM #define DE156CPU ARM
#include "emu.h" #include "emu.h"
#include "includes/decocrpt.h" #include "includes/decocrpt.h"
#include "includes/deco32.h"
#include "machine/eeprom.h" #include "machine/eeprom.h"
#include "sound/okim6295.h" #include "sound/okim6295.h"
#include "sound/ymz280b.h" #include "sound/ymz280b.h"
@ -281,8 +280,8 @@ static ADDRESS_MAP_START( backfire_map, ADDRESS_SPACE_PROGRAM, 32 )
// AM_RANGE(0x180010, 0x180013) AM_RAM AM_BASE(&backfire_180010) // always 180010 ? // AM_RANGE(0x180010, 0x180013) AM_RAM AM_BASE(&backfire_180010) // always 180010 ?
// AM_RANGE(0x188010, 0x188013) AM_RAM AM_BASE(&backfire_188010) // always 188010 ? // AM_RANGE(0x188010, 0x188013) AM_RAM AM_BASE(&backfire_188010) // always 188010 ?
AM_RANGE(0x184000, 0x185fff) AM_RAM AM_BASE( &backfire_spriteram32_1 ) AM_RANGE(0x184000, 0x185fff) AM_RAM AM_BASE(&backfire_spriteram32_1)
AM_RANGE(0x18c000, 0x18dfff) AM_RAM AM_BASE( &backfire_spriteram32_2 ) AM_RANGE(0x18c000, 0x18dfff) AM_RAM AM_BASE(&backfire_spriteram32_2)
AM_RANGE(0x190000, 0x190003) AM_DEVREAD("eeprom", backfire_eeprom_r) AM_RANGE(0x190000, 0x190003) AM_DEVREAD("eeprom", backfire_eeprom_r)
AM_RANGE(0x194000, 0x194003) AM_READ(backfire_control2_r) AM_RANGE(0x194000, 0x194003) AM_READ(backfire_control2_r)
AM_RANGE(0x1a4000, 0x1a4003) AM_DEVWRITE("eeprom", backfire_eeprom_w) AM_RANGE(0x1a4000, 0x1a4003) AM_DEVWRITE("eeprom", backfire_eeprom_w)

View File

@ -1,60 +0,0 @@
/*----------- defined in video/deco16ic.c -----------*/
extern UINT16 *deco16_pf1_data,*deco16_pf2_data;
extern UINT16 *deco16_pf3_data,*deco16_pf4_data;
extern UINT16 *deco16_pf1_rowscroll,*deco16_pf2_rowscroll;
extern UINT16 *deco16_pf3_rowscroll,*deco16_pf4_rowscroll;
extern UINT16 *deco16_pf12_control,*deco16_pf34_control;
extern UINT16 deco16_priority;
extern UINT16 *deco16_raster_display_list;
extern int deco16_raster_display_position;
extern int deco16_pf1_colour_bank,deco16_pf2_colour_bank,deco16_pf3_colour_bank,deco16_pf4_colour_bank;
void deco16_1_video_init(running_machine *machine);
void deco16_2_video_init(running_machine *machine, int split);
void deco16_2_video_init_half_width(running_machine *machine);
void deco_allocate_sprite_bitmap(running_machine *machine);
void deco16_pf12_update(const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr);
void deco16_pf34_update(const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr);
void deco16_pf12_set_gfxbank(int small, int big);
void deco16_pf34_set_gfxbank(int small, int big);
void deco16_set_tilemap_bank_callback(int tmap, int (*callback)(const int bank));
void deco16_set_tilemap_colour_base(int tmap, int base);
void deco16_set_tilemap_colour_mask(int tmap, int mask);
void deco16_set_tilemap_transparency_mask(int tmap, int mask);
void deco16_tilemap_1_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority);
void deco16_tilemap_2_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority);
void deco16_tilemap_3_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority);
void deco16_tilemap_4_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority);
void deco16_tilemap_34_combine_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority);
void deco16_clear_sprite_priority_bitmap(void);
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);
tilemap_t *deco16_get_tilemap(int pf, int size);
WRITE16_HANDLER( deco16_pf1_data_w );
WRITE16_HANDLER( deco16_pf2_data_w );
WRITE16_HANDLER( deco16_pf3_data_w );
WRITE16_HANDLER( deco16_pf4_data_w );
WRITE16_HANDLER( deco16_nonbuffered_palette_w );
WRITE16_HANDLER( deco16_buffered_palette_w );
WRITE16_HANDLER( deco16_palette_dma_w );
WRITE16_HANDLER( deco16_priority_w );
READ16_HANDLER( deco16_71_r );
void deco16_print_debug_info(running_machine *machine, bitmap_t *bitmap);

View File

@ -592,7 +592,6 @@ $(MAMEOBJ)/dataeast.a: \
$(MACHINE)/deco102.o \ $(MACHINE)/deco102.o \
$(MACHINE)/decocrpt.o \ $(MACHINE)/decocrpt.o \
$(MACHINE)/decoprot.o \ $(MACHINE)/decoprot.o \
$(VIDEO)/deco16ic.o \
$(VIDEO)/decodev.o \ $(VIDEO)/decodev.o \
$(MAMEOBJ)/dooyong.a: \ $(MAMEOBJ)/dooyong.a: \

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,4 @@
#include "emu.h" #include "emu.h"
#include "includes/deco16ic.h"
#include "includes/deco32.h" #include "includes/deco32.h"
UINT32 *deco32_pf1_data,*deco32_pf2_data,*deco32_pf3_data,*deco32_pf4_data; UINT32 *deco32_pf1_data,*deco32_pf2_data,*deco32_pf3_data,*deco32_pf4_data;
@ -23,6 +22,85 @@ static int deco32_ace_ram_dirty, has_ace_ram;
int deco32_raster_display_position; int deco32_raster_display_position;
UINT16 *deco32_raster_display_list; UINT16 *deco32_raster_display_list;
/******************************************************************************
This sprite_priority_bitmap handling is the same as in deco16ic.c
******************************************************************************/
static bitmap_t *sprite_priority_bitmap;
static void deco16_clear_sprite_priority_bitmap(void)
{
if (sprite_priority_bitmap)
bitmap_fill(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)
{
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(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++;
}
}
/******************************************************************************/ /******************************************************************************/
WRITE32_HANDLER( deco32_pf1_data_w ) WRITE32_HANDLER( deco32_pf1_data_w )
@ -992,7 +1070,10 @@ VIDEO_START( fghthist )
pf1a_tilemap =0; pf1a_tilemap =0;
dirty_palette = auto_alloc_array(machine, UINT8, 4096); dirty_palette = auto_alloc_array(machine, UINT8, 4096);
deco_allocate_sprite_bitmap(machine); /* Allow sprite bitmap */
int width = video_screen_get_width(machine->primary_screen);
int height = video_screen_get_height(machine->primary_screen);
sprite_priority_bitmap = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16 );
tilemap_set_transparent_pen(pf1_tilemap,0); tilemap_set_transparent_pen(pf1_tilemap,0);
tilemap_set_transparent_pen(pf2_tilemap,0); tilemap_set_transparent_pen(pf2_tilemap,0);

View File

@ -137,6 +137,12 @@ Rowscroll style:
Column and rowscroll can both be applied at once. Column and rowscroll can both be applied at once.
2010-02: Converted to be a device.
TODO:
- properly support PCBs with two ICs (i.e. no pf3/pf4 because they actually belong to a 2nd chip)
- move here emulation of the sprite chips (currently replicated in each driver)?
***************************************************************************/ ***************************************************************************/
#include "emu.h" #include "emu.h"
@ -1368,8 +1374,8 @@ DEVICE_GET_INFO( deco16ic )
case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(deco16ic); break; case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(deco16ic); break;
/* --- the following bits of info are returned as NULL-terminated strings --- */ /* --- the following bits of info are returned as NULL-terminated strings --- */
case DEVINFO_STR_NAME: strcpy(info->s, "Data East Video Custom"); break; case DEVINFO_STR_NAME: strcpy(info->s, "Data East IC 55 / 56 / 74 / 141"); break;
case DEVINFO_STR_FAMILY: strcpy(info->s, "Data East Video Custom"); break; case DEVINFO_STR_FAMILY: strcpy(info->s, "Data East Video IC"); break;
case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break;
case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break;
case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MAME Team"); break; case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MAME Team"); break;