(From AtariAce)

While investigating alternate gfx layout schemes, I stumbled across
the fact that some drivers are allocating graphics with one layout and
then decoding them with another (!).  There's no guarantee this will
work, but for the drivers that do so (all Konami games), the layouts
are similar enough that it does.  A related potential bug is that many
drivers are decoding using the layout provided to allocgfx, not the
layout attached the element returned from allocgfx.  If the element
had scaling applied to it, this would be incorrect, but since scaling
is rare these are also benign.  It would also be a problem if the
layout data had a different internal representation (which is
something I'm experimenting with), so to reduce the possibility of
coding errors and allow for future changes, I'd like to remove the
layout parameter from decodechar.

So here's two patches, the first fixes the affected Konami drivers to
allocate and decode using the same layouts.  It changes the notion of
plane_order and bpp in the functions somewhat to let the start
routines select the appropriate layout, but acceptably so IMHO (I can
clean this up further if there are loud objections).  The second patch
then removes the layout parameter from all the decodechar() calls.

I also reviewed MESS to see if it had similar problems and didn't find
any.
This commit is contained in:
Aaron Giles 2008-01-11 06:31:19 +00:00
parent d0c7416adf
commit c96a3b766a
60 changed files with 206 additions and 250 deletions

View File

@ -161,8 +161,9 @@ static void calc_penusage(gfx_element *gfx, int num)
on a specified layout
-------------------------------------------------*/
void decodechar(gfx_element *gfx, int num, const UINT8 *src, const gfx_layout *gl)
void decodechar(gfx_element *gfx, int num, const UINT8 *src)
{
const gfx_layout *gl = &gfx->layout;
int israw = (gl->planeoffset[0] == GFX_RAW);
int planes = gl->planes;
UINT32 charincrement = gl->charincrement;
@ -332,7 +333,7 @@ void decodegfx(gfx_element *gfx, const UINT8 *src, UINT32 first, UINT32 count)
else
{
for (c = first; c <= last; c++)
decodechar(gfx, c, src, &gfx->layout);
decodechar(gfx, c, src);
}
}

View File

@ -197,7 +197,7 @@ extern int pdrawgfx_shadow_lowpri;
void drawgfx_init(running_machine *machine);
void decodechar(gfx_element *gfx,int num,const unsigned char *src,const gfx_layout *gl);
void decodechar(gfx_element *gfx,int num,const unsigned char *src);
gfx_element *allocgfx(const gfx_layout *gl);
void decodegfx(gfx_element *gfx, const UINT8 *src, UINT32 first, UINT32 count);
void freegfx(gfx_element *gfx);

View File

@ -227,7 +227,7 @@ void s2636_update_bitmap(running_machine *machine,mame_bitmap *bitmap,UINT8 *wor
colour = (colour & 7) + 7;
decodechar(machine->gfx[Graphics_Bank],charno,workram,machine->drv->gfxdecodeinfo[Graphics_Bank].gfxlayout);
decodechar(machine->gfx[Graphics_Bank],charno,workram);
drawgfxzoom(bitmap,machine->gfx[Graphics_Bank],
charno,

View File

@ -83,7 +83,7 @@ static VIDEO_UPDATE( drill )
for (i=0; i<256; i++)
{
decodechar(machine->gfx[1],i,(UINT8*)&charram[0],machine->drv->gfxdecodeinfo[1].gfxlayout);
decodechar(machine->gfx[1],i,(UINT8*)&charram[0]);
}
DRAW_MAP(map1ram,0)

View File

@ -63,13 +63,13 @@ static VIDEO_UPDATE( ace )
{
int offs;
decodechar(machine->gfx[1], 0, ace_characterram, machine->drv->gfxdecodeinfo[1].gfxlayout);
decodechar(machine->gfx[2], 0, ace_characterram, machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(machine->gfx[3], 0, ace_characterram, machine->drv->gfxdecodeinfo[3].gfxlayout);
decodechar(machine->gfx[1], 0, ace_characterram);
decodechar(machine->gfx[2], 0, ace_characterram);
decodechar(machine->gfx[3], 0, ace_characterram);
for (offs = 0; offs < 8; offs++)
{
decodechar(machine->gfx[4], offs, ace_scoreram, machine->drv->gfxdecodeinfo[4].gfxlayout);
decodechar(machine->gfx[4], offs, ace_scoreram);
}
/* first of all, fill the screen with the background color */

View File

@ -859,7 +859,7 @@ static void decode_ssram(void)
{
if (cps3_ss_ram_dirty[i])
{
decodechar(Machine->gfx[0], i, (UINT8*)cps3_ss_ram, &cps3_tiles8x8_layout);
decodechar(Machine->gfx[0], i, (UINT8*)cps3_ss_ram);
cps3_ss_ram_dirty[i] = 0;
}
}
@ -879,7 +879,7 @@ static void decode_charram(void)
{
if (cps3_char_ram_dirty[i])
{
decodechar(Machine->gfx[1], i, (UINT8*)cps3_char_ram, &cps3_tiles16x16_layout);
decodechar(Machine->gfx[1], i, (UINT8*)cps3_char_ram);
cps3_char_ram_dirty[i] = 0;
}
}
@ -1019,7 +1019,7 @@ static void cps3_draw_tilemapsprite_line(int tmnum, int drawline, mame_bitmap *b
if (cps3_char_ram_dirty[tileno])
{
decodechar(Machine->gfx[1], tileno, (UINT8*)cps3_char_ram, &cps3_tiles16x16_layout);
decodechar(Machine->gfx[1], tileno, (UINT8*)cps3_char_ram);
cps3_char_ram_dirty[tileno] = 0;
}
cps3_drawgfxzoom(bitmap, Machine->gfx[1],tileno,colour,xflip,yflip,(x*16)-scrollx%16,drawline-tilesubline,&clip,CPS3_TRANSPARENCY_PEN_INDEX,0, 0x10000, 0x10000, NULL, 0);
@ -1269,7 +1269,7 @@ static VIDEO_UPDATE(cps3)
if (cps3_char_ram_dirty[realtileno])
{
decodechar(machine->gfx[1], realtileno, (UINT8*)cps3_char_ram, &cps3_tiles16x16_layout);
decodechar(machine->gfx[1], realtileno, (UINT8*)cps3_char_ram);
cps3_char_ram_dirty[realtileno] = 0;
}
@ -1348,7 +1348,7 @@ static VIDEO_UPDATE(cps3)
if (cps3_ss_ram_dirty[tile])
{
decodechar(machine->gfx[0], tile, (UINT8*)cps3_ss_ram, &cps3_tiles8x8_layout);
decodechar(machine->gfx[0], tile, (UINT8*)cps3_ss_ram);
cps3_ss_ram_dirty[tile] = 0;
}

View File

@ -502,6 +502,24 @@ static const gfx_layout tilelayout =
64*16
};
static const gfx_layout tilelayout2 =
{
16,16,
0x800,
4,
{ 0, 1, 2, 3 },
#ifdef LSB_FIRST
{ 2*4, 3*4, 0*4, 1*4, 6*4, 7*4, 4*4, 5*4,
10*4, 11*4, 8*4, 9*4, 14*4, 15*4, 12*4, 13*4 },
#else
{ 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4 },
#endif
{ 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64,
8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 },
64*16
};
static const gfx_layout spritelayout =
{
16,16,
@ -519,7 +537,7 @@ static GFXDECODE_START( f1gp )
GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0x000, 1 )
GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0x100, 16 )
GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout, 0x200, 16 )
GFXDECODE_ENTRY( REGION_GFX4, 0, tilelayout, 0x300, 16 ) /* changed at runtime */
GFXDECODE_ENTRY( REGION_GFX4, 0, tilelayout2, 0x300, 16 )
GFXDECODE_END
static GFXDECODE_START( f1gp2 )

View File

@ -360,7 +360,7 @@ static void K037122_tile_update(running_machine *machine, int chip)
if (K037122_dirty_map[chip][i])
{
K037122_dirty_map[chip][i] = 0;
decodechar(machine->gfx[K037122_gfx_index[chip]], i, (UINT8 *)K037122_char_ram[chip], &K037122_char_layout);
decodechar(machine->gfx[K037122_gfx_index[chip]], i, (UINT8 *)K037122_char_ram[chip]);
}
}
tilemap_mark_all_tiles_dirty(K037122_layer[chip][0]);

View File

@ -248,8 +248,7 @@ static VIDEO_UPDATE( madalien )
for (i = 0; i < 256; i++)
{
decodechar(machine->gfx[0], i, madalien_charram,
machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[0], i, madalien_charram);
}
tilemap_mark_all_tiles_dirty(tilemap_fg);

View File

@ -562,7 +562,7 @@ static WRITE8_HANDLER( banked_ram_w )
mastboy_vram[offs] = data^0xff;
/* Decode the new tile */
decodechar(Machine->gfx[0], offs/32, mastboy_vram, Machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(Machine->gfx[0], offs/32, mastboy_vram);
}
}
else

View File

@ -37,7 +37,7 @@ static void updateChars(running_machine *machine)
if(dirtychar[i])
{
dirtychar[i]=0;
decodechar(machine->gfx[0], i,(UINT8 *) ml_tileram, machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[0], i,(UINT8 *) ml_tileram);
}
}
}

View File

@ -114,7 +114,7 @@ static WRITE8_HANDLER ( mogura_gfxram_w )
{
mogura_gfxram[offset] = data ;
decodechar(Machine->gfx[0], offset/16, mogura_gfxram, Machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(Machine->gfx[0], offset/16, mogura_gfxram);
tilemap_mark_all_tiles_dirty(mogura_tilemap);
}

View File

@ -446,10 +446,10 @@ VIDEO_UPDATE( mpu4_vid )
{
if (mpu4_vid_vidram_is_dirty[i]==1)
{
decodechar(machine->gfx[mpu4_gfx_index+0], i, (UINT8 *)mpu4_vid_vidram, &mpu4_vid_char_8x8_layout);
decodechar(machine->gfx[mpu4_gfx_index+1], i, (UINT8 *)mpu4_vid_vidram, &mpu4_vid_char_8x16_layout);
decodechar(machine->gfx[mpu4_gfx_index+2], i, (UINT8 *)mpu4_vid_vidram, &mpu4_vid_char_16x8_layout);
decodechar(machine->gfx[mpu4_gfx_index+3], i, (UINT8 *)mpu4_vid_vidram, &mpu4_vid_char_16x16_layout);
decodechar(machine->gfx[mpu4_gfx_index+0], i, (UINT8 *)mpu4_vid_vidram);
decodechar(machine->gfx[mpu4_gfx_index+1], i, (UINT8 *)mpu4_vid_vidram);
decodechar(machine->gfx[mpu4_gfx_index+2], i, (UINT8 *)mpu4_vid_vidram);
decodechar(machine->gfx[mpu4_gfx_index+3], i, (UINT8 *)mpu4_vid_vidram);
mpu4_vid_vidram_is_dirty[i]=0;
}
}

View File

@ -1589,8 +1589,7 @@ UpdateRoad(running_machine *machine)
decodechar(
machine->gfx[mRoadGfxBank],
i,
0x10000+(UINT8 *)mpRoadRAM,
&RoadTileLayout );
0x10000+(UINT8 *)mpRoadRAM);
mpRoadDirty[i] = 0;
}
}

View File

@ -523,13 +523,11 @@ static VIDEO_UPDATE( ss23 )
return 0;
}
static const gfx_layout namcos23_cg_layout;
static WRITE32_HANDLER( s23_txtchar_w )
{
COMBINE_DATA(&namcos23_charram[offset] );
decodechar( Machine->gfx[0],offset/32,(UINT8 *)namcos23_charram,&namcos23_cg_layout );
decodechar( Machine->gfx[0],offset/32,(UINT8 *)namcos23_charram );
tilemap_mark_all_tiles_dirty(bgtilemap);
}

View File

@ -302,8 +302,7 @@ void K001604_tile_update(running_machine *machine, int chip)
if(K001604_dirty_map[chip][0][i])
{
K001604_dirty_map[chip][0][i] = 0;
decodechar(machine->gfx[K001604_gfx_index[chip][0]], i,
(UINT8*)&K001604_char_ram[chip][0], &K001604_char_layout_layer_8x8);
decodechar(machine->gfx[K001604_gfx_index[chip][0]], i, (UINT8*)&K001604_char_ram[chip][0]);
}
}
tilemap_mark_all_tiles_dirty(K001604_layer_8x8[chip][0]);
@ -324,8 +323,7 @@ void K001604_tile_update(running_machine *machine, int chip)
if(K001604_dirty_map[chip][1][i])
{
K001604_dirty_map[chip][1][i] = 0;
decodechar(machine->gfx[K001604_gfx_index[chip][1]], i,
(UINT8*)&K001604_char_ram[chip][0], &K001604_char_layout_layer_16x16);
decodechar(machine->gfx[K001604_gfx_index[chip][1]], i, (UINT8*)&K001604_char_ram[chip][0]);
}
}

View File

@ -152,7 +152,7 @@ static void srmp6_decode_charram(void)
int i;
for (i=0;i<(0x100000*16)/0x40;i++)
{
decodechar(Machine->gfx[0], i, (UINT8*)tileram, &tiles8x8_layout);
decodechar(Machine->gfx[0], i, (UINT8*)tileram);
dirty_tileram[i] = 0;
}
}
@ -272,7 +272,7 @@ static VIDEO_UPDATE(srmp6)
if (dirty_tileram[tileno])
{
decodechar(machine->gfx[0], tileno, (UINT8*)tileram, &tiles8x8_layout);
decodechar(machine->gfx[0], tileno, (UINT8*)tileram);
dirty_tileram[tileno] = 0;
}

View File

@ -155,10 +155,8 @@ static void machine_init(running_machine *machine)
for(i=0;i<512;i++)
{
decodechar(machine->gfx[2], i, taitol_rambanks,
machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(machine->gfx[2], i+512, taitol_rambanks + 0x4000,
machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(machine->gfx[2], i, taitol_rambanks);
decodechar(machine->gfx[2], i+512, taitol_rambanks + 0x4000);
}
}

View File

@ -141,7 +141,7 @@ static WRITE8_HANDLER( trvmadns_banking_w )
static WRITE8_HANDLER( trvmadns_gfxram_w )
{
trvmadns_gfxram[offset] = data;
decodechar(Machine->gfx[0], offset/16, trvmadns_gfxram, Machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(Machine->gfx[0], offset/16, trvmadns_gfxram);
tilemap_mark_all_tiles_dirty(bg_tilemap);
}

View File

@ -88,7 +88,7 @@ WRITE8_HANDLER( pacgal_charram_w )
{
pacgal_charram[offset] = data;
decodechar(Machine->gfx[0],offset/16,pacgal_charram,Machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(Machine->gfx[0],offset/16,pacgal_charram);
}
WRITE8_HANDLER( pacgal_sprram_w )
@ -96,7 +96,7 @@ WRITE8_HANDLER( pacgal_sprram_w )
offset = (offset & 0x1f83) | ((offset & 0x078) >> 1) | ((offset & 0x004) << 4);
pacgal_sprram[offset] = data;
decodechar(Machine->gfx[1],offset/64,pacgal_sprram,Machine->drv->gfxdecodeinfo[1].gfxlayout);
decodechar(Machine->gfx[1],offset/64,pacgal_sprram);
}

View File

@ -313,12 +313,12 @@ static void screenrefresh(running_machine *machine, mame_bitmap *bitmap,const re
/* Dynamically decode chars if dirty */
for (code = 0x0000;code < 0x1000;code++)
if (tile_dirty[code])
decodechar(machine->gfx[0],code,HuC6270_vram,machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[0],code,HuC6270_vram);
/* Dynamically decode sprites if dirty */
for (code = 0x0000;code < 0x400;code++)
if (sprite_dirty[code])
decodechar(machine->gfx[1],code,HuC6270_vram,machine->drv->gfxdecodeinfo[1].gfxlayout);
decodechar(machine->gfx[1],code,HuC6270_vram);
/* NB: If first 0x1000 byte is always tilemap, no need to decode the first batch of tiles/sprites */

View File

@ -453,7 +453,7 @@ static void decode_modified(running_machine *machine, UINT8 *sprite_ram, int int
if (char_dirty[code])
{
decodechar(machine->gfx[0],code,deco_charram,machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[0],code,deco_charram);
char_dirty[code] = 0;
}
@ -468,7 +468,7 @@ static void decode_modified(running_machine *machine, UINT8 *sprite_ram, int int
if (sprite_dirty[code])
{
decodechar(machine->gfx[1],code,deco_charram,machine->drv->gfxdecodeinfo[1].gfxlayout);
decodechar(machine->gfx[1],code,deco_charram);
sprite_dirty[code] = 0;
}

View File

@ -259,7 +259,7 @@ VIDEO_UPDATE( buggychl )
for (code = 0;code < 256;code++)
{
if (dirtychar[code])
decodechar(machine->gfx[0],code,buggychl_character_ram,machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[0],code,buggychl_character_ram);
}
if (bg_on)

View File

@ -108,10 +108,10 @@ WRITE8_HANDLER( bwing_scrollreg_w )
if (bp_ready == 7 && !srbank)
{
src = srbase[1];
for (i=0; i<BW_NTILES; i++) decodechar(fgfx, i, src, &bwing_tilelayout);
for (i=0; i<BW_NTILES; i++) decodechar(fgfx, i, src);
src += 0x1000;
for (i=0; i<BW_NTILES; i++) decodechar(bgfx, i, src, &bwing_tilelayout);
for (i=0; i<BW_NTILES; i++) decodechar(bgfx, i, src);
bp_ready = 0;
}

View File

@ -1130,7 +1130,7 @@ static void cps1_create_empty_8x8_tile(running_machine *machine)
};
machine->gfx[4] = allocgfx(&empty_layout8x8);
decodechar(machine->gfx[4], 0, (UINT8 *)empty_tile, &empty_layout8x8);
decodechar(machine->gfx[4], 0, (UINT8 *)empty_tile);
machine->gfx[4]->total_colors = 0x100;
}

View File

@ -233,13 +233,11 @@ VIDEO_UPDATE( cvs )
/* ROM based tiles first */
for (code = 0; code < ram_based_char_start_indecies[character_banking_mode]; code++)
decodechar(machine->gfx[0], code, memory_region(REGION_GFX1),
machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[0], code, memory_region(REGION_GFX1));
/* now the RAM based ones */
for (; code < 0x100; code++)
decodechar(machine->gfx[0], code, cvs_character_ram,
machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[0], code, cvs_character_ram);
/* draw the background */

View File

@ -519,7 +519,7 @@ static void decode_modified(running_machine* machine, UINT8 *sprite_ram, int int
switch (char_dirty[code])
{
case 1:
decodechar(machine->gfx[0],code,decocass_charram,machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[0],code,decocass_charram);
char_dirty[code] = 2;
/* fall through */
case 2:
@ -546,7 +546,7 @@ static void decode_modified(running_machine* machine, UINT8 *sprite_ram, int int
{
sprite_dirty[code] = 0;
decodechar(machine->gfx[1],code,decocass_charram,machine->drv->gfxdecodeinfo[1].gfxlayout);
decodechar(machine->gfx[1],code,decocass_charram);
}
}
@ -559,7 +559,7 @@ static void decode_modified(running_machine* machine, UINT8 *sprite_ram, int int
{
tile_dirty[code] = 0;
decodechar(machine->gfx[2],code,decocass_tileram,machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(machine->gfx[2],code,decocass_tileram);
/* mark all visible tiles dirty */
for (i = offs; i < decocass_bgvideoram_size; i++)
@ -571,8 +571,8 @@ static void decode_modified(running_machine* machine, UINT8 *sprite_ram, int int
/* decode object if it is dirty */
if (object_dirty)
{
decodechar(machine->gfx[3], 0, decocass_objectram, machine->drv->gfxdecodeinfo[3].gfxlayout);
decodechar(machine->gfx[3], 1, decocass_objectram, machine->drv->gfxdecodeinfo[3].gfxlayout);
decodechar(machine->gfx[3], 0, decocass_objectram);
decodechar(machine->gfx[3], 1, decocass_objectram);
object_dirty = 0;
}
}

View File

@ -330,25 +330,6 @@ static void f1gpb_draw_sprites(running_machine *machine, mame_bitmap *bitmap,con
VIDEO_UPDATE( f1gp )
{
static const gfx_layout tilelayout =
{
16,16,
TOTAL_CHARS,
4,
{ 0, 1, 2, 3 },
#ifdef LSB_FIRST
{ 2*4, 3*4, 0*4, 1*4, 6*4, 7*4, 4*4, 5*4,
10*4, 11*4, 8*4, 9*4, 14*4, 15*4, 12*4, 13*4 },
#else
{ 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4 },
#endif
{ 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64,
8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 },
64*16,
};
if (dirtygfx)
{
int i;
@ -360,7 +341,7 @@ VIDEO_UPDATE( f1gp )
if (dirtychar[i])
{
dirtychar[i] = 0;
decodechar(machine->gfx[3],i,(UINT8 *)zoomdata,&tilelayout);
decodechar(machine->gfx[3],i,(UINT8 *)zoomdata);
}
}
@ -394,25 +375,6 @@ VIDEO_UPDATE( f1gpb )
UINT32 startx,starty;
int incxx,incxy,incyx,incyy;
static const gfx_layout tilelayout =
{
16,16,
TOTAL_CHARS,
4,
{ 0, 1, 2, 3 },
#ifdef LSB_FIRST
{ 2*4, 3*4, 0*4, 1*4, 6*4, 7*4, 4*4, 5*4,
10*4, 11*4, 8*4, 9*4, 14*4, 15*4, 12*4, 13*4 },
#else
{ 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4 },
#endif
{ 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64,
8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 },
64*16,
};
if (dirtygfx)
{
int i;
@ -424,7 +386,7 @@ VIDEO_UPDATE( f1gpb )
if (dirtychar[i])
{
dirtychar[i] = 0;
decodechar(machine->gfx[3],i,(UINT8 *)zoomdata,&tilelayout);
decodechar(machine->gfx[3],i,(UINT8 *)zoomdata);
}
}

View File

@ -141,8 +141,7 @@ WRITE8_HANDLER( gottlieb_charram_w )
{
gottlieb_charram[offset] = data;
decodechar(Machine->gfx[0], offset / 32, gottlieb_charram,
Machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(Machine->gfx[0], offset / 32, gottlieb_charram);
tilemap_mark_all_tiles_dirty(bg_tilemap);
}

View File

@ -63,26 +63,13 @@ static void gradius3_sprite_callback(int *code,int *color,int *priority_mask,int
VIDEO_START( gradius3 )
{
int i;
static const gfx_layout spritelayout =
{
16,16,
TOTAL_SPRITES,
4,
{ 0, 1, 2, 3 },
{ 2*4, 3*4, 0*4, 1*4, 6*4, 7*4, 4*4, 5*4,
32*8+2*4, 32*8+3*4, 32*8+0*4, 32*8+1*4, 32*8+6*4, 32*8+7*4, 32*8+4*4, 32*8+5*4 },
{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
64*8+0*32, 64*8+1*32, 64*8+2*32, 64*8+3*32, 64*8+4*32, 64*8+5*32, 64*8+6*32, 64*8+7*32 },
128*8
};
layer_colorbase[0] = 0;
layer_colorbase[1] = 32;
layer_colorbase[2] = 48;
sprite_colorbase = 16;
K052109_vh_start(machine,REGION_GFX1,NORMAL_PLANE_ORDER,gradius3_tile_callback);
K051960_vh_start(machine,REGION_GFX2,REVERSE_PLANE_ORDER,gradius3_sprite_callback);
K052109_vh_start(machine,REGION_GFX1,GRADIUS3_PLANE_ORDER,gradius3_tile_callback);
K051960_vh_start(machine,REGION_GFX2,GRADIUS3_PLANE_ORDER,gradius3_sprite_callback);
K052109_set_layer_offsets(2, -2, 0);
K051960_set_sprite_offsets(2, 0);
@ -90,7 +77,7 @@ VIDEO_START( gradius3 )
/* re-decode the sprites because the ROMs are connected to the custom IC differently
from how they are connected to the CPU. */
for (i = 0;i < TOTAL_SPRITES;i++)
decodechar(machine->gfx[1],i,memory_region(REGION_GFX2),&spritelayout);
decodechar(machine->gfx[1],i,memory_region(REGION_GFX2));
dirtychar = auto_malloc(TOTAL_CHARS);
memset(dirtychar,1,TOTAL_CHARS);
@ -132,21 +119,6 @@ WRITE16_HANDLER( gradius3_gfxram_w )
VIDEO_UPDATE( gradius3 )
{
static const gfx_layout charlayout =
{
8,8,
TOTAL_CHARS,
4,
{ 0, 1, 2, 3 },
#ifdef LSB_FIRST
{ 2*4, 3*4, 0*4, 1*4, 6*4, 7*4, 4*4, 5*4 },
#else
{ 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 },
#endif
{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
32*8
};
/* TODO: this kludge enforces the char banks. For some reason, they don't work otherwise. */
K052109_w(0x1d80,0x10);
K052109_w(0x1f00,0x32);
@ -162,7 +134,7 @@ VIDEO_UPDATE( gradius3 )
if (dirtychar[i])
{
dirtychar[i] = 0;
decodechar(machine->gfx[0],i,(UINT8 *)gradius3_gfxram,&charlayout);
decodechar(machine->gfx[0],i,(UINT8 *)gradius3_gfxram);
}
}

View File

@ -1990,6 +1990,20 @@ void K052109_vh_start(running_machine *machine,int gfx_memory_region,int plane_o
{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
32*8
};
static const gfx_layout charlayout_gradius3 =
{
8,8,
0,
4,
{ 0, 1, 2, 3 },
#ifdef LSB_FIRST
{ 2*4, 3*4, 0*4, 1*4, 6*4, 7*4, 4*4, 5*4 },
#else
{ 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 },
#endif
{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
32*8
};
/* find first empty slot to decode gfx */
@ -2006,6 +2020,11 @@ void K052109_vh_start(running_machine *machine,int gfx_memory_region,int plane_o
decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &charlayout, 4);
break;
case GRADIUS3_PLANE_ORDER:
total = 0x1000;
decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &charlayout_gradius3, 4);
break;
default:
fatalerror("Unsupported plane_order");
}
@ -2475,6 +2494,18 @@ void K051960_vh_start(running_machine *machine,int gfx_memory_region,int plane_o
16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32 },
128*8
};
static const gfx_layout spritelayout_gradius3 =
{
16,16,
0,
4,
{ 0, 1, 2, 3 },
{ 2*4, 3*4, 0*4, 1*4, 6*4, 7*4, 4*4, 5*4,
32*8+2*4, 32*8+3*4, 32*8+0*4, 32*8+1*4, 32*8+6*4, 32*8+7*4, 32*8+4*4, 32*8+5*4 },
{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
64*8+0*32, 64*8+1*32, 64*8+2*32, 64*8+3*32, 64*8+4*32, 64*8+5*32, 64*8+6*32, 64*8+7*32 },
128*8
};
/* find first empty slot to decode gfx */
for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
@ -2496,6 +2527,11 @@ void K051960_vh_start(running_machine *machine,int gfx_memory_region,int plane_o
decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &spritelayout_reverse, 4);
break;
case GRADIUS3_PLANE_ORDER:
total = 0x4000;
decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &spritelayout_gradius3, 4);
break;
default:
fatalerror("Unknown plane_order");
}
@ -4597,6 +4633,23 @@ static void K051316_vh_start(running_machine *machine,int chip, int gfx_memory_r
8*128, 9*128, 10*128, 11*128, 12*128, 13*128, 14*128, 15*128 },
256*8
};
static const gfx_layout charlayout_tail2nos =
{
16,16,
0,
4,
{ 0, 1, 2, 3 },
#ifdef LSB_FIRST
{ 2*4, 3*4, 0*4, 1*4, 6*4, 7*4, 4*4, 5*4,
10*4, 11*4, 8*4, 9*4, 14*4, 15*4, 12*4, 13*4 },
#else
{ 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4 },
#endif
{ 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64,
8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 },
128*8
};
static const tile_get_info_callback get_tile_info[3] = { K051316_get_tile_info0,K051316_get_tile_info1,K051316_get_tile_info2 };
/* find first empty slot to decode gfx */
@ -4608,6 +4661,12 @@ static void K051316_vh_start(running_machine *machine,int chip, int gfx_memory_r
/* decode the graphics */
switch (bpp)
{
case -4:
total = 0x400;
bpp = 4;
decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &charlayout_tail2nos, 4);
break;
case 4:
total = memory_region_length(gfx_memory_region) / 128;
decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &charlayout4, 4);

View File

@ -46,6 +46,7 @@ permutations which may be required).
*/
#define NORMAL_PLANE_ORDER 0x0123
#define REVERSE_PLANE_ORDER 0x3210
#define GRADIUS3_PLANE_ORDER 0x1111
/*

View File

@ -171,7 +171,7 @@ VIDEO_UPDATE( lemmings )
/* Decode any characters that have changed in vram */
for (i=0; i<2048; i++) {
if (vram_dirty[i]) {
decodechar(machine->gfx[2],i,vram_buffer,machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(machine->gfx[2],i,vram_buffer);
tilemap_mark_tile_dirty(vram_tilemap,i);
vram_dirty[i]=0;
}

View File

@ -207,8 +207,8 @@ static void update_gfx(running_machine *machine)
if( dirtychar[i] )
{
dirtychar[i] = 0;
decodechar(machine->gfx[0],i,(UINT8 *)cgram,&cg_layout);
decodechar(machine->gfx[1],i,(UINT8 *)shaperam,&shape_layout);
decodechar(machine->gfx[0],i,(UINT8 *)cgram);
decodechar(machine->gfx[1],i,(UINT8 *)shaperam);
}
}
dirtygfx = 0;

View File

@ -1571,7 +1571,7 @@ static void DrawCharacterLayer(running_machine *machine, mame_bitmap *bitmap, co
{
if( cgdirty[i] )
{
decodechar( machine->gfx[GFX_CHAR],i,(UINT8 *)namcos22_cgram,&namcos22_cg_layout );
decodechar( machine->gfx[GFX_CHAR],i,(UINT8 *)namcos22_cgram );
cgdirty[i] = 0;
}
}

View File

@ -237,8 +237,7 @@ VIDEO_START( nemesis )
blank_characterdata = auto_malloc(32*8/8*(2048+1));
memset(blank_characterdata,0x00,32*8/8*(2048+1));
decodechar(machine->gfx[0],0x800,(UINT8 *)blank_characterdata,
machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[0],0x800,(UINT8 *)blank_characterdata);
flipscreen = 0;
tilemap_flip = 0;
@ -341,8 +340,7 @@ static void update_gfx(running_machine *machine)
{
if (sprite_dirty[4][offs])
{
decodechar(machine->gfx[0],offs,(UINT8 *)nemesis_characterram,
machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[0],offs,(UINT8 *)nemesis_characterram);
bAnyDirty = 1;
sprite_dirty[4][offs] = 0;
}
@ -376,8 +374,7 @@ static void update_gfx(running_machine *machine)
char_type = sprite_data[idx].char_type;
if (sprite_dirty[idx][code] == 1)
{
decodechar(machine->gfx[char_type],code,(UINT8 *)nemesis_characterram,
machine->drv->gfxdecodeinfo[char_type].gfxlayout);
decodechar(machine->gfx[char_type],code,(UINT8 *)nemesis_characterram);
sprite_dirty[idx][code] = 0;
}
}

View File

@ -57,7 +57,7 @@ VIDEO_UPDATE( polyplay )
if (dirtycharacter[code])
{
decodechar(machine->gfx[1], code & 0x7f, polyplay_characterram, machine->drv->gfxdecodeinfo[1].gfxlayout);
decodechar(machine->gfx[1], code & 0x7f, polyplay_characterram);
dirtycharacter[code] = 0;
}

View File

@ -895,7 +895,7 @@ logerror("vlbank starting\n");
{
if ( dirtyarray[i] )
{
decodechar( gfx, i, vram, &ppu_charlayout);
decodechar( gfx, i, vram );
dirtyarray[i] = 0;
}
}

View File

@ -184,8 +184,7 @@ VIDEO_UPDATE( redalert )
/* decode modified background */
if (redalert_dirtyback[offs] == 1)
{
decodechar(machine->gfx[0],offs,redalert_backram,
machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[0],offs,redalert_backram);
redalert_dirtyback[offs] = 2;
}
@ -193,18 +192,15 @@ VIDEO_UPDATE( redalert )
if (redalert_dirtycharacter[charcode] == 1)
{
if (charcode < 0x80)
decodechar(machine->gfx[1],charcode,redalert_characterram,
machine->drv->gfxdecodeinfo[1].gfxlayout);
decodechar(machine->gfx[1],charcode,redalert_characterram);
else
decodechar(machine->gfx[2],charcode-0x80,redalert_spriteram1,
machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(machine->gfx[2],charcode-0x80,redalert_spriteram1);
redalert_dirtycharacter[charcode] = 2;
}
if (redalert_dirtycharacter2[charcode] == 1)
{
decodechar(machine->gfx[3],charcode-0x80,redalert_spriteram3,
machine->drv->gfxdecodeinfo[3].gfxlayout);
decodechar(machine->gfx[3],charcode-0x80,redalert_spriteram3);
redalert_dirtycharacter2[charcode] = 2;
}

View File

@ -168,8 +168,7 @@ static TILE_GET_INFO( get_fg_tile_info )
int code = rockola_videoram2[tile_index];
int color = colorram[tile_index] & 0x07;
decodechar(machine->gfx[0], code, rockola_charram,
machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[0], code, rockola_charram);
SET_TILE_INFO(0, code, color, 0);
}
@ -292,8 +291,7 @@ static TILE_GET_INFO( satansat_get_fg_tile_info )
int code = rockola_videoram2[tile_index];
int color = colorram[tile_index] & 0x03;
decodechar(machine->gfx[0], code, rockola_charram,
machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[0], code, rockola_charram);
SET_TILE_INFO(0, code, color, 0);
}

View File

@ -661,7 +661,7 @@ static void draw_videoram(running_machine *machine, mame_bitmap *bitmap, const r
/* if the tile is dirty, decode it */
if (dirtychar[tile])
{
decodechar(machine->gfx[0], tile, &videoram[0x800], machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[0], tile, &videoram[0x800]);
dirtychar[tile] = 0;
}

View File

@ -182,7 +182,7 @@ void sys24_tile_update(running_machine *machine)
for(i=0; i<SYS24_TILES; i++) {
if(sys24_char_dirtymap[i]) {
sys24_char_dirtymap[i] = 0;
decodechar(machine->gfx[sys24_char_gfx_index], i, (UINT8 *)sys24_char_ram, &sys24_char_layout);
decodechar(machine->gfx[sys24_char_gfx_index], i, (UINT8 *)sys24_char_ram);
}
}
tilemap_mark_all_tiles_dirty(sys24_tile_layer[0]);

View File

@ -73,7 +73,7 @@ WRITE8_HANDLER( iremm15_chargen_w )
{
state->chargen[offset] = data;
/* not very effective ... dirty would be better */
decodechar(Machine->gfx[0],offset >> 3,state->chargen, &Machine->gfx[0]->layout);
decodechar(Machine->gfx[0],offset >> 3,state->chargen);
}
}

View File

@ -930,8 +930,8 @@ VIDEO_UPDATE( eaglshot )
{
eaglshot_dirty_tile[tile] = 0;
decodechar(machine->gfx[0], tile, (UINT8 *)eaglshot_gfxram, machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[1], tile, (UINT8 *)eaglshot_gfxram, machine->drv->gfxdecodeinfo[1].gfxlayout);
decodechar(machine->gfx[0], tile, (UINT8 *)eaglshot_gfxram);
decodechar(machine->gfx[1], tile, (UINT8 *)eaglshot_gfxram);
}
}
}
@ -1120,7 +1120,7 @@ VIDEO_UPDATE( gdfs )
{
eaglshot_dirty_tile[tile] = 0;
decodechar(machine->gfx[2], tile, (UINT8 *)eaglshot_gfxram, machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(machine->gfx[2], tile, (UINT8 *)eaglshot_gfxram);
}
}
}

View File

@ -116,7 +116,7 @@ READ8_HANDLER(st0016_character_ram_r)
WRITE8_HANDLER(st0016_character_ram_w)
{
st0016_charram[ST0016_CHAR_BANK_SIZE*st0016_char_bank+offset]=data;
decodechar(Machine->gfx[st0016_ramgfx], st0016_char_bank,(UINT8 *) st0016_charram, &charlayout);
decodechar(Machine->gfx[st0016_ramgfx], st0016_char_bank,(UINT8 *) st0016_charram);
}
READ8_HANDLER(st0016_vregs_r)
@ -422,7 +422,7 @@ static void st0016_postload(void)
int i;
st0016_rom_bank_w(0,st0016_rom_bank);
for(i=0;i<ST0016_MAX_CHAR_BANK;i++)
decodechar(Machine->gfx[st0016_ramgfx], i,(UINT8 *) st0016_charram, &charlayout);
decodechar(Machine->gfx[st0016_ramgfx], i,(UINT8 *) st0016_charram);
}

View File

@ -282,8 +282,7 @@ VIDEO_START( stactics )
{
decodechar(machine->gfx[4],
i,
firechar,
machine->drv->gfxdecodeinfo[4].gfxlayout);
firechar);
}
/* Decode the Fire Beam ROM for later */
@ -312,8 +311,7 @@ VIDEO_START( stactics )
{
decodechar(machine->gfx[5],
i,
stactics_special_chars,
machine->drv->gfxdecodeinfo[5].gfxlayout);
stactics_special_chars);
}
stactics_vblank_count = 0;
@ -517,8 +515,7 @@ VIDEO_UPDATE( stactics )
{
decodechar(machine->gfx[3],
char_number,
stactics_chardata_d,
machine->drv->gfxdecodeinfo[3].gfxlayout);
stactics_chardata_d);
dirty_chardata_d[char_number] = 2;
dirty_videoram_d[offs] = 1;
}
@ -546,8 +543,7 @@ VIDEO_UPDATE( stactics )
{
decodechar(machine->gfx[2],
char_number,
stactics_chardata_e,
machine->drv->gfxdecodeinfo[2].gfxlayout);
stactics_chardata_e);
dirty_chardata_e[char_number] = 2;
dirty_videoram_e[offs] = 1;
}
@ -575,8 +571,7 @@ VIDEO_UPDATE( stactics )
{
decodechar(machine->gfx[1],
char_number,
stactics_chardata_f,
machine->drv->gfxdecodeinfo[1].gfxlayout);
stactics_chardata_f);
dirty_chardata_f[char_number] = 2;
dirty_videoram_f[offs] = 1;
}
@ -604,8 +599,7 @@ VIDEO_UPDATE( stactics )
{
decodechar(machine->gfx[0],
char_number,
stactics_chardata_b,
machine->drv->gfxdecodeinfo[0].gfxlayout);
stactics_chardata_b);
dirty_chardata_b[char_number] = 2;
dirty_videoram_b[offs] = 1;
}

View File

@ -3640,14 +3640,14 @@ static void stv_vdp2_draw_basic_tilemap(running_machine *machine, mame_bitmap *b
tilecode &=0x3fff;
if (stv2_current_tilemap.tile_size==1)
{ /* we're treating 16x16 tiles as 4 8x8's atm */
if (stv_vdp2_vram_dirty_8x8x8[tilecode] == 1) { stv_vdp2_vram_dirty_8x8x8[tilecode] = 0; decodechar(machine->gfx[2], tilecode, stv_vdp2_gfx_decode + gfx_mem_offset, machine->drv->gfxdecodeinfo[2].gfxlayout); };
if (stv_vdp2_vram_dirty_8x8x8[tilecode+1] == 1) { stv_vdp2_vram_dirty_8x8x8[tilecode+1] = 0; decodechar(machine->gfx[2], tilecode+1, stv_vdp2_gfx_decode + gfx_mem_offset, machine->drv->gfxdecodeinfo[2].gfxlayout); };
if (stv_vdp2_vram_dirty_8x8x8[tilecode+2] == 1) { stv_vdp2_vram_dirty_8x8x8[tilecode+2] = 0; decodechar(machine->gfx[2], tilecode+2, stv_vdp2_gfx_decode + gfx_mem_offset, machine->drv->gfxdecodeinfo[2].gfxlayout); };
if (stv_vdp2_vram_dirty_8x8x8[tilecode+3] == 1) { stv_vdp2_vram_dirty_8x8x8[tilecode+3] = 0; decodechar(machine->gfx[2], tilecode+3, stv_vdp2_gfx_decode + gfx_mem_offset, machine->drv->gfxdecodeinfo[2].gfxlayout); };
if (stv_vdp2_vram_dirty_8x8x8[tilecode] == 1) { stv_vdp2_vram_dirty_8x8x8[tilecode] = 0; decodechar(machine->gfx[2], tilecode, stv_vdp2_gfx_decode + gfx_mem_offset); };
if (stv_vdp2_vram_dirty_8x8x8[tilecode+1] == 1) { stv_vdp2_vram_dirty_8x8x8[tilecode+1] = 0; decodechar(machine->gfx[2], tilecode+1, stv_vdp2_gfx_decode + gfx_mem_offset); };
if (stv_vdp2_vram_dirty_8x8x8[tilecode+2] == 1) { stv_vdp2_vram_dirty_8x8x8[tilecode+2] = 0; decodechar(machine->gfx[2], tilecode+2, stv_vdp2_gfx_decode + gfx_mem_offset); };
if (stv_vdp2_vram_dirty_8x8x8[tilecode+3] == 1) { stv_vdp2_vram_dirty_8x8x8[tilecode+3] = 0; decodechar(machine->gfx[2], tilecode+3, stv_vdp2_gfx_decode + gfx_mem_offset); };
}
else
{
if (stv_vdp2_vram_dirty_8x8x8[tilecode] == 1) { stv_vdp2_vram_dirty_8x8x8[tilecode] = 0; decodechar(machine->gfx[2], tilecode, stv_vdp2_gfx_decode + gfx_mem_offset, machine->drv->gfxdecodeinfo[2].gfxlayout); };
if (stv_vdp2_vram_dirty_8x8x8[tilecode] == 1) { stv_vdp2_vram_dirty_8x8x8[tilecode] = 0; decodechar(machine->gfx[2], tilecode, stv_vdp2_gfx_decode + gfx_mem_offset); };
}
}
@ -3659,14 +3659,14 @@ static void stv_vdp2_draw_basic_tilemap(running_machine *machine, mame_bitmap *b
tilecode &=0x7fff;
if (stv2_current_tilemap.tile_size==1)
{ /* we're treating 16x16 tiles as 4 8x8's atm */
if (stv_vdp2_vram_dirty_8x8x4[tilecode] == 1) { stv_vdp2_vram_dirty_8x8x4[tilecode] = 0; decodechar(machine->gfx[0], tilecode, stv_vdp2_gfx_decode, machine->drv->gfxdecodeinfo[0].gfxlayout); };
if (stv_vdp2_vram_dirty_8x8x4[tilecode+1] == 1) { stv_vdp2_vram_dirty_8x8x4[tilecode+1] = 0; decodechar(machine->gfx[0], tilecode+1, stv_vdp2_gfx_decode, machine->drv->gfxdecodeinfo[0].gfxlayout); };
if (stv_vdp2_vram_dirty_8x8x4[tilecode+2] == 1) { stv_vdp2_vram_dirty_8x8x4[tilecode+2] = 0; decodechar(machine->gfx[0], tilecode+2, stv_vdp2_gfx_decode, machine->drv->gfxdecodeinfo[0].gfxlayout); };
if (stv_vdp2_vram_dirty_8x8x4[tilecode+3] == 1) { stv_vdp2_vram_dirty_8x8x4[tilecode+3] = 0; decodechar(machine->gfx[0], tilecode+3, stv_vdp2_gfx_decode, machine->drv->gfxdecodeinfo[0].gfxlayout); };
if (stv_vdp2_vram_dirty_8x8x4[tilecode] == 1) { stv_vdp2_vram_dirty_8x8x4[tilecode] = 0; decodechar(machine->gfx[0], tilecode, stv_vdp2_gfx_decode); };
if (stv_vdp2_vram_dirty_8x8x4[tilecode+1] == 1) { stv_vdp2_vram_dirty_8x8x4[tilecode+1] = 0; decodechar(machine->gfx[0], tilecode+1, stv_vdp2_gfx_decode); };
if (stv_vdp2_vram_dirty_8x8x4[tilecode+2] == 1) { stv_vdp2_vram_dirty_8x8x4[tilecode+2] = 0; decodechar(machine->gfx[0], tilecode+2, stv_vdp2_gfx_decode); };
if (stv_vdp2_vram_dirty_8x8x4[tilecode+3] == 1) { stv_vdp2_vram_dirty_8x8x4[tilecode+3] = 0; decodechar(machine->gfx[0], tilecode+3, stv_vdp2_gfx_decode); };
}
else
{
if (stv_vdp2_vram_dirty_8x8x4[tilecode] == 1) { stv_vdp2_vram_dirty_8x8x4[tilecode] = 0; decodechar(machine->gfx[0], tilecode, stv_vdp2_gfx_decode, machine->drv->gfxdecodeinfo[0].gfxlayout); };
if (stv_vdp2_vram_dirty_8x8x4[tilecode] == 1) { stv_vdp2_vram_dirty_8x8x4[tilecode] = 0; decodechar(machine->gfx[0], tilecode, stv_vdp2_gfx_decode); };
}
}
/* TILES ARE NOW DECODED */

View File

@ -898,7 +898,7 @@ VIDEO_UPDATE(skns)
{
if (skns_v3t_dirty[i] == 1)
{
decodechar(machine->gfx[1], i, (UINT8*)btiles, machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[1], i, (UINT8*)btiles);
skns_v3t_dirty[i] = 0;
}
@ -924,7 +924,7 @@ VIDEO_UPDATE(skns)
{
if (skns_v3t_4bppdirty[i] == 1)
{
decodechar(machine->gfx[3], i, (UINT8*)btiles, machine->drv->gfxdecodeinfo[3].gfxlayout);
decodechar(machine->gfx[3], i, (UINT8*)btiles);
skns_v3t_4bppdirty[i] = 0;
}

View File

@ -54,7 +54,7 @@ VIDEO_START( tail2nos )
{
bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
K051316_vh_start_0(machine,REGION_GFX3,4,TRUE,0,zoom_callback);
K051316_vh_start_0(machine,REGION_GFX3,-4,TRUE,0,zoom_callback);
dirtychar = auto_malloc(TOTAL_CHARS);
memset(dirtychar,1,TOTAL_CHARS);
@ -164,25 +164,6 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rec
VIDEO_UPDATE( tail2nos )
{
static const gfx_layout tilelayout =
{
16,16,
TOTAL_CHARS,
4,
{ 0, 1, 2, 3 },
#ifdef LSB_FIRST
{ 2*4, 3*4, 0*4, 1*4, 6*4, 7*4, 4*4, 5*4,
10*4, 11*4, 8*4, 9*4, 14*4, 15*4, 12*4, 13*4 },
#else
{ 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4 },
#endif
{ 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64,
8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 },
128*8
};
if (dirtygfx)
{
int i;
@ -194,7 +175,7 @@ VIDEO_UPDATE( tail2nos )
if (dirtychar[i])
{
dirtychar[i] = 0;
decodechar(machine->gfx[2],i,(UINT8 *)zoomdata,&tilelayout);
decodechar(machine->gfx[2],i,(UINT8 *)zoomdata);
}
}

View File

@ -3246,7 +3246,7 @@ VIDEO_UPDATE( f3 )
if (vram_changed)
for (tile = 0;tile < 256;tile++)
if (vram_dirty[tile]) {
decodechar(machine->gfx[0],tile,(UINT8 *)f3_vram,machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[0],tile,(UINT8 *)f3_vram);
tilemap_mark_all_tiles_dirty(vram_layer); // TODO
//tilemap_mark_tile_dirty(vram_layer,tile);
vram_dirty[tile]=0;
@ -3256,7 +3256,7 @@ VIDEO_UPDATE( f3 )
if (pivot_changed)
for (tile = 0;tile < 2048;tile++)
if (pivot_dirty[tile]) {
decodechar(machine->gfx[3],tile,(UINT8 *)f3_pivot_ram,machine->drv->gfxdecodeinfo[3].gfxlayout);
decodechar(machine->gfx[3],tile,(UINT8 *)f3_pivot_ram);
tilemap_mark_tile_dirty(pixel_layer,tile);
pivot_dirty[tile]=0;
}

View File

@ -159,57 +159,49 @@ READ8_HANDLER( taitol_control_r )
void taitol_chardef14_m(int offset)
{
decodechar(Machine->gfx[2], offset/32, taitol_rambanks,
Machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(Machine->gfx[2], offset/32, taitol_rambanks);
tilemap_mark_all_tiles_dirty(ch1a_tilemap);
}
void taitol_chardef15_m(int offset)
{
decodechar(Machine->gfx[2], offset/32+128, taitol_rambanks,
Machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(Machine->gfx[2], offset/32+128, taitol_rambanks);
tilemap_mark_all_tiles_dirty(ch1a_tilemap);
}
void taitol_chardef16_m(int offset)
{
decodechar(Machine->gfx[2], offset/32+256, taitol_rambanks,
Machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(Machine->gfx[2], offset/32+256, taitol_rambanks);
tilemap_mark_all_tiles_dirty(ch1a_tilemap);
}
void taitol_chardef17_m(int offset)
{
decodechar(Machine->gfx[2], offset/32+384, taitol_rambanks,
Machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(Machine->gfx[2], offset/32+384, taitol_rambanks);
tilemap_mark_all_tiles_dirty(ch1a_tilemap);
}
void taitol_chardef1c_m(int offset)
{
decodechar(Machine->gfx[2], offset/32+512, taitol_rambanks + 0x4000,
Machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(Machine->gfx[2], offset/32+512, taitol_rambanks + 0x4000);
tilemap_mark_all_tiles_dirty(ch1a_tilemap);
}
void taitol_chardef1d_m(int offset)
{
decodechar(Machine->gfx[2], offset/32+640, taitol_rambanks + 0x4000,
Machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(Machine->gfx[2], offset/32+640, taitol_rambanks + 0x4000);
tilemap_mark_all_tiles_dirty(ch1a_tilemap);
}
void taitol_chardef1e_m(int offset)
{
decodechar(Machine->gfx[2], offset/32+768, taitol_rambanks + 0x4000,
Machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(Machine->gfx[2], offset/32+768, taitol_rambanks + 0x4000);
tilemap_mark_all_tiles_dirty(ch1a_tilemap);
}
void taitol_chardef1f_m(int offset)
{
decodechar(Machine->gfx[2], offset/32+896, taitol_rambanks + 0x4000,
Machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(Machine->gfx[2], offset/32+896, taitol_rambanks + 0x4000);
tilemap_mark_all_tiles_dirty(ch1a_tilemap);
}

View File

@ -1749,7 +1749,7 @@ void TC0080VCO_tilemap_update(running_machine *machine)
{
if (TC0080VCO_char_dirty[j])
decodechar(machine->gfx[TC0080VCO_tx_gfx],j,
(UINT8 *)TC0080VCO_char_ram,&TC0080VCO_charlayout);
(UINT8 *)TC0080VCO_char_ram);
TC0080VCO_char_dirty[j] = 0;
}
TC0080VCO_chars_dirty = 0;
@ -2677,7 +2677,7 @@ void TC0100SCN_tilemap_update(running_machine *machine)
{
if (TC0100SCN_char_dirty[chip][j])
decodechar(machine->gfx[TC0100SCN_tx_gfx[chip]],j,
(UINT8 *)TC0100SCN_char_ram[chip],&TC0100SCN_charlayout);
(UINT8 *)TC0100SCN_char_ram[chip]);
TC0100SCN_char_dirty[chip][j] = 0;
}
TC0100SCN_chars_dirty[chip] = 0;
@ -3545,7 +3545,7 @@ void TC0480SCP_tilemap_update(running_machine *machine)
{
if (TC0480SCP_char_dirty[j])
decodechar(machine->gfx[TC0480SCP_tx_gfx],j,
(UINT8 *)TC0480SCP_char_ram,&TC0480SCP_charlayout);
(UINT8 *)TC0480SCP_char_ram);
TC0480SCP_char_dirty[j] = 0;
}
TC0480SCP_chars_dirty = 0;

View File

@ -61,7 +61,7 @@ static void taitojc_tile_update(running_machine *machine)
if (taitojc_dirty_map[i])
{
taitojc_dirty_map[i] = 0;
decodechar(Machine->gfx[taitojc_gfx_index], i, (UINT8 *)taitojc_char_ram, &taitojc_char_layout);
decodechar(Machine->gfx[taitojc_gfx_index], i, (UINT8 *)taitojc_char_ram);
}
}
tilemap_mark_all_tiles_dirty(taitojc_tilemap);

View File

@ -813,13 +813,13 @@ VIDEO_UPDATE( taitosj )
{
if (dirtycharacter1[offs] == 1)
{
decodechar(machine->gfx[0],offs,taitosj_characterram,machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[0],offs,taitosj_characterram);
dirtycharacter1[offs] = 0;
alldirty = 1;
}
if (dirtycharacter2[offs] == 1)
{
decodechar(machine->gfx[2],offs,taitosj_characterram + 0x1800,machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(machine->gfx[2],offs,taitosj_characterram + 0x1800);
dirtycharacter2[offs] = 0;
alldirty = 1;
}
@ -838,12 +838,12 @@ VIDEO_UPDATE( taitosj )
{
if (dirtysprite1[offs] == 1)
{
decodechar(machine->gfx[1],offs,taitosj_characterram,machine->drv->gfxdecodeinfo[1].gfxlayout);
decodechar(machine->gfx[1],offs,taitosj_characterram);
dirtysprite1[offs] = 0;
}
if (dirtysprite2[offs] == 1)
{
decodechar(machine->gfx[3],offs,taitosj_characterram + 0x1800,machine->drv->gfxdecodeinfo[3].gfxlayout);
decodechar(machine->gfx[3],offs,taitosj_characterram + 0x1800);
dirtysprite2[offs] = 0;
}
}

View File

@ -51,8 +51,7 @@ WRITE16_HANDLER(roundup5_vram_w)
offset=offset%0xc000;
decodechar(Machine->gfx[1],offset/0x10,(UINT8 *)roundup5_vram,
Machine->drv->gfxdecodeinfo[1].gfxlayout);
decodechar(Machine->gfx[1],offset/0x10,(UINT8 *)roundup5_vram);
}

View File

@ -123,8 +123,7 @@ static TILE_GET_INFO( get_bg1_tile_info )
{
int code = tiamc1_tileram[tile_index];
decodechar(machine->gfx[0], code, tiamc1_charram,
machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[0], code, tiamc1_charram);
SET_TILE_INFO(0, code, 0, 0);
}
@ -133,8 +132,7 @@ static TILE_GET_INFO( get_bg2_tile_info )
{
int code = tiamc1_tileram[tile_index + 1024];
decodechar(machine->gfx[0], code, tiamc1_charram,
machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(machine->gfx[0], code, tiamc1_charram);
SET_TILE_INFO(0, code, 0, 0);
}

View File

@ -655,8 +655,7 @@ WRITE16_HANDLER( toaplan2_tx_gfxram16_w )
{
int code = offset/32;
COMBINE_DATA(&toaplan2_tx_gfxram16[offset]);
decodechar(Machine->gfx[2], code, toaplan2_tx_gfxram,
Machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(Machine->gfx[2], code, toaplan2_tx_gfxram);
tilemap_mark_all_tiles_dirty(tx_tilemap);
}
@ -699,7 +698,7 @@ WRITE16_HANDLER( batrider_textdata_decode )
/* Decode text characters */
for (code = 0; code < 1024; code++)
decodechar (Machine->gfx[2], code, raizing_tx_gfxram, Machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar (Machine->gfx[2], code, raizing_tx_gfxram);
tilemap_mark_all_tiles_dirty(tx_tilemap);
}

View File

@ -140,7 +140,7 @@ WRITE8_HANDLER( tryout_vram_w )
break;
}
decodechar(Machine->gfx[2],(offset-0x400/64)&0x7f,tryout_vram_gfx,Machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(Machine->gfx[2],(offset-0x400/64)&0x7f,tryout_vram_gfx);
tilemap_mark_all_tiles_dirty(bg_tilemap);
}

View File

@ -60,7 +60,7 @@ WRITE8_HANDLER( usg_charram_w )
{
usg_charram[offset] = data;
decodechar(Machine->gfx[0], offset/8, usg_charram, Machine->drv->gfxdecodeinfo[0].gfxlayout);
decodechar(Machine->gfx[0], offset/8, usg_charram);
tilemap_mark_all_tiles_dirty(usg_tilemap);
}

View File

@ -167,10 +167,10 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap)
int x,y;
/* 16x8 version */
decodechar(machine->gfx[1],spriteno,s2636_1_ram,machine->drv->gfxdecodeinfo[1].gfxlayout);
decodechar(machine->gfx[1],spriteno,s2636_1_ram);
/* 16x16 version */
decodechar(machine->gfx[2],spriteno,s2636_1_ram,machine->drv->gfxdecodeinfo[2].gfxlayout);
decodechar(machine->gfx[2],spriteno,s2636_1_ram);
/* Sprite->Background collision detection */
drawgfx(bitmap,machine->gfx[expand],