Fixed foreground tilemap colors in Diamond Derby [Angelo Salese]

This commit is contained in:
Angelo Salese 2009-01-26 13:55:02 +00:00
parent 8416b96dc2
commit 6640f6d8da

View File

@ -273,8 +273,8 @@ static const gfx_layout tiles8x8_layout =
{ {
8,8, 8,8,
RGN_FRAC(1,2), RGN_FRAC(1,2),
4, 3,
{ 0,4,RGN_FRAC(1,2)}, { RGN_FRAC(1,2),4,0 },
{ 0, 1, 2, 3,8,9,10,11 }, { 0, 1, 2, 3,8,9,10,11 },
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 }, { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
16*8 16*8
@ -304,7 +304,7 @@ static const gfx_layout tiles8x8_layout2 =
}; };
static GFXDECODE_START( dmndrby ) static GFXDECODE_START( dmndrby )
GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 32*16, 16 ) GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 32*16, 32 )
GFXDECODE_ENTRY( "gfx2", 0, tiles8x8_layout2, 0, 8) GFXDECODE_ENTRY( "gfx2", 0, tiles8x8_layout2, 0, 8)
GFXDECODE_ENTRY( "gfx3", 0, tiles16x16_layout, 16*16, 32 ) GFXDECODE_ENTRY( "gfx3", 0, tiles16x16_layout, 16*16, 32 )
GFXDECODE_END GFXDECODE_END
@ -338,7 +338,7 @@ static VIDEO_UPDATE(dderby)
{ {
int x,y,count; int x,y,count;
int off,scrolly; int off,scrolly;
static int bg=0; static int bg;
const gfx_element *gfx = screen->machine->gfx[0]; const gfx_element *gfx = screen->machine->gfx[0];
const gfx_element *sprites = screen->machine->gfx[1]; const gfx_element *sprites = screen->machine->gfx[1];
const gfx_element *track = screen->machine->gfx[2]; const gfx_element *track = screen->machine->gfx[2];
@ -409,26 +409,19 @@ wouldnt like to say its the most effective way though...
} }
/*TODO: Fix / understand how the transparency works properly. */
// char tiles. seems right - no idea about the palette
count=0; count=0;
for (y=0;y<32;y++) for (y=0;y<32;y++)
{ {
for(x=0;x<32;x++) for(x=0;x<32;x++)
{ {
int tileno,bank,color; int tileno,bank,color;
int trans = TRANSPARENCY_NONE;//((dderby_vidattribs[count]&0x10)==0x10)?TRANSPARENCY_PEN:TRANSPARENCY_NONE;
tileno=dderby_vidchars[count]; tileno=dderby_vidchars[count];
bank=dderby_vidattribs[count]&0x20; bank=(dderby_vidattribs[count]&0x20)>>5;
color=((dderby_vidattribs[count]+bg)&0x1f); tileno|=(bank<<8);
if(tileno!=0x38) { color=((dderby_vidattribs[count])&0x1f);
if (bank)
tileno+=0x100;
drawgfx(bitmap,gfx,tileno,color,0,0,x*8,y*8,cliprect,(tileno == 0x38) ? TRANSPARENCY_PEN : TRANSPARENCY_NONE,0);
drawgfx(bitmap,gfx,tileno,color,0,0,x*8,y*8,cliprect,trans,0);
}
count++; count++;
} }
@ -508,7 +501,7 @@ static MACHINE_DRIVER_START( dderby )
MDRV_CPU_ADD("main", Z80,4000000) /* ? MHz */ MDRV_CPU_ADD("main", Z80,4000000) /* ? MHz */
MDRV_CPU_PROGRAM_MAP(memmap,0) MDRV_CPU_PROGRAM_MAP(memmap,0)
MDRV_CPU_VBLANK_INT("main", dderby_irq) MDRV_CPU_VBLANK_INT("main", dderby_irq)
MDRV_CPU_PERIODIC_INT(dderby_timer_irq, 244) MDRV_CPU_PERIODIC_INT(dderby_timer_irq, 244/2)
MDRV_CPU_ADD("audio", Z80, 4000000) /* verified on schematics */ MDRV_CPU_ADD("audio", Z80, 4000000) /* verified on schematics */
MDRV_CPU_PROGRAM_MAP(dderby_sound_map,0) MDRV_CPU_PROGRAM_MAP(dderby_sound_map,0)