mirror of
https://github.com/holub/mame
synced 2025-04-25 17:56:43 +03:00
Removed the color table from a couple of drivers. Just want to make sure this is the right way before continuing.
This commit is contained in:
parent
354acd5f1b
commit
2950f78b45
@ -211,8 +211,7 @@ static MACHINE_DRIVER_START( gotya )
|
|||||||
MDRV_SCREEN_SIZE(36*8, 32*8)
|
MDRV_SCREEN_SIZE(36*8, 32*8)
|
||||||
MDRV_SCREEN_VISIBLE_AREA(0, 36*8-1, 2*8, 30*8-1)
|
MDRV_SCREEN_VISIBLE_AREA(0, 36*8-1, 2*8, 30*8-1)
|
||||||
MDRV_GFXDECODE(gotya)
|
MDRV_GFXDECODE(gotya)
|
||||||
MDRV_PALETTE_LENGTH(8)
|
MDRV_PALETTE_LENGTH(16*4)
|
||||||
MDRV_COLORTABLE_LENGTH(16*4)
|
|
||||||
|
|
||||||
MDRV_PALETTE_INIT(gotya)
|
MDRV_PALETTE_INIT(gotya)
|
||||||
MDRV_VIDEO_START(gotya)
|
MDRV_VIDEO_START(gotya)
|
||||||
|
@ -391,8 +391,7 @@ static MACHINE_DRIVER_START( gyruss )
|
|||||||
MDRV_SCREEN_SIZE(32*8, 32*8)
|
MDRV_SCREEN_SIZE(32*8, 32*8)
|
||||||
MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
|
MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
|
||||||
MDRV_GFXDECODE(gyruss)
|
MDRV_GFXDECODE(gyruss)
|
||||||
MDRV_PALETTE_LENGTH(32)
|
MDRV_PALETTE_LENGTH(16*4+16*16)
|
||||||
MDRV_COLORTABLE_LENGTH(16*4+16*16)
|
|
||||||
|
|
||||||
MDRV_PALETTE_INIT(gyruss)
|
MDRV_PALETTE_INIT(gyruss)
|
||||||
MDRV_VIDEO_START(gyruss)
|
MDRV_VIDEO_START(gyruss)
|
||||||
|
@ -35,8 +35,6 @@ static tilemap *bg_tilemap;
|
|||||||
|
|
||||||
PALETTE_INIT( ampoker2 )
|
PALETTE_INIT( ampoker2 )
|
||||||
{
|
{
|
||||||
#define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
|
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* - bits -
|
/* - bits -
|
||||||
|
@ -18,51 +18,37 @@ PALETTE_INIT( gotya )
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
#define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
|
|
||||||
#define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
|
|
||||||
|
|
||||||
for (i = 0; i < machine->drv->total_colors; i++)
|
for (i = 0; i < machine->drv->total_colors; i++)
|
||||||
{
|
{
|
||||||
int bit0, bit1, bit2, r, g, b;
|
int bit0, bit1, bit2, r, g, b;
|
||||||
|
|
||||||
|
UINT8 data = color_prom[color_prom[0x20 + i]];
|
||||||
|
|
||||||
/* red component */
|
/* red component */
|
||||||
|
|
||||||
bit0 = (*color_prom >> 0) & 0x01;
|
bit0 = (data >> 0) & 0x01;
|
||||||
bit1 = (*color_prom >> 1) & 0x01;
|
bit1 = (data >> 1) & 0x01;
|
||||||
bit2 = (*color_prom >> 2) & 0x01;
|
bit2 = (data >> 2) & 0x01;
|
||||||
|
|
||||||
r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||||
|
|
||||||
/* green component */
|
/* green component */
|
||||||
|
|
||||||
bit0 = (*color_prom >> 3) & 0x01;
|
bit0 = (data >> 3) & 0x01;
|
||||||
bit1 = (*color_prom >> 4) & 0x01;
|
bit1 = (data >> 4) & 0x01;
|
||||||
bit2 = (*color_prom >> 5) & 0x01;
|
bit2 = (data >> 5) & 0x01;
|
||||||
|
|
||||||
g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||||
|
|
||||||
/* blue component */
|
/* blue component */
|
||||||
|
|
||||||
bit0 = 0;
|
bit0 = 0;
|
||||||
bit1 = (*color_prom >> 6) & 0x01;
|
bit1 = (data >> 6) & 0x01;
|
||||||
bit2 = (*color_prom >> 7) & 0x01;
|
bit2 = (data >> 7) & 0x01;
|
||||||
|
|
||||||
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||||
|
|
||||||
palette_set_color(machine, i, MAKE_RGB(r, g, b));
|
palette_set_color(machine, i, MAKE_RGB(r, g, b));
|
||||||
|
|
||||||
color_prom++;
|
|
||||||
}
|
|
||||||
|
|
||||||
color_prom += 0x18;
|
|
||||||
/* color_prom now points to the beginning of the lookup table */
|
|
||||||
|
|
||||||
/* character lookup table */
|
|
||||||
/* sprites use the same color lookup table as characters */
|
|
||||||
|
|
||||||
for (i = 0; i < TOTAL_COLORS(0); i++)
|
|
||||||
{
|
|
||||||
COLOR(0, i) = *(color_prom++) & 0x07;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,44 +40,39 @@ static UINT32 scanline;
|
|||||||
PALETTE_INIT( gyruss )
|
PALETTE_INIT( gyruss )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
#define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
|
|
||||||
#define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
|
|
||||||
|
|
||||||
|
|
||||||
for (i = 0;i < machine->drv->total_colors;i++)
|
for (i = 0;i < machine->drv->total_colors;i++)
|
||||||
{
|
{
|
||||||
|
UINT8 data;
|
||||||
int bit0,bit1,bit2,r,g,b;
|
int bit0,bit1,bit2,r,g,b;
|
||||||
|
|
||||||
|
if (i < 0x40)
|
||||||
|
/* characters */
|
||||||
|
data = color_prom[(color_prom[0x120 + i] & 0x0f) | 0x10];
|
||||||
|
else
|
||||||
|
/* sprites */
|
||||||
|
data = color_prom[color_prom[0x20 + (i - 0x40)] & 0x0f];
|
||||||
|
|
||||||
/* red component */
|
/* red component */
|
||||||
bit0 = (*color_prom >> 0) & 0x01;
|
bit0 = (data >> 0) & 0x01;
|
||||||
bit1 = (*color_prom >> 1) & 0x01;
|
bit1 = (data >> 1) & 0x01;
|
||||||
bit2 = (*color_prom >> 2) & 0x01;
|
bit2 = (data >> 2) & 0x01;
|
||||||
r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||||
|
|
||||||
/* green component */
|
/* green component */
|
||||||
bit0 = (*color_prom >> 3) & 0x01;
|
bit0 = (data >> 3) & 0x01;
|
||||||
bit1 = (*color_prom >> 4) & 0x01;
|
bit1 = (data >> 4) & 0x01;
|
||||||
bit2 = (*color_prom >> 5) & 0x01;
|
bit2 = (data >> 5) & 0x01;
|
||||||
g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||||
|
|
||||||
/* blue component */
|
/* blue component */
|
||||||
bit0 = 0;
|
bit0 = 0;
|
||||||
bit1 = (*color_prom >> 6) & 0x01;
|
bit1 = (data >> 6) & 0x01;
|
||||||
bit2 = (*color_prom >> 7) & 0x01;
|
bit2 = (data >> 7) & 0x01;
|
||||||
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||||
|
|
||||||
palette_set_color(machine,i,MAKE_RGB(r,g,b));
|
palette_set_color(machine,i,MAKE_RGB(r,g,b));
|
||||||
color_prom++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* color_prom now points to the beginning of the sprite lookup table */
|
|
||||||
|
|
||||||
/* sprites */
|
|
||||||
for (i = 0;i < TOTAL_COLORS(1);i++)
|
|
||||||
COLOR(1,i) = *(color_prom++) & 0x0f;
|
|
||||||
|
|
||||||
/* characters */
|
|
||||||
for (i = 0;i < TOTAL_COLORS(0);i++)
|
|
||||||
COLOR(0,i) = (*(color_prom++) & 0x0f) + 0x10;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user