From 2950f78b4588f33410a1bcb2322ad363d870bfc1 Mon Sep 17 00:00:00 2001 From: Zsolt Vasvari Date: Mon, 28 Jan 2008 13:28:07 +0000 Subject: [PATCH] Removed the color table from a couple of drivers. Just want to make sure this is the right way before continuing. --- src/mame/drivers/gotya.c | 3 +-- src/mame/drivers/gyruss.c | 3 +-- src/mame/video/ampoker.c | 2 -- src/mame/video/gotya.c | 34 ++++++++++------------------------ src/mame/video/gyruss.c | 39 +++++++++++++++++---------------------- 5 files changed, 29 insertions(+), 52 deletions(-) diff --git a/src/mame/drivers/gotya.c b/src/mame/drivers/gotya.c index 59dc9f78474..6b822e9b0dc 100644 --- a/src/mame/drivers/gotya.c +++ b/src/mame/drivers/gotya.c @@ -211,8 +211,7 @@ static MACHINE_DRIVER_START( gotya ) MDRV_SCREEN_SIZE(36*8, 32*8) MDRV_SCREEN_VISIBLE_AREA(0, 36*8-1, 2*8, 30*8-1) MDRV_GFXDECODE(gotya) - MDRV_PALETTE_LENGTH(8) - MDRV_COLORTABLE_LENGTH(16*4) + MDRV_PALETTE_LENGTH(16*4) MDRV_PALETTE_INIT(gotya) MDRV_VIDEO_START(gotya) diff --git a/src/mame/drivers/gyruss.c b/src/mame/drivers/gyruss.c index ca8262da389..4002ee511cf 100644 --- a/src/mame/drivers/gyruss.c +++ b/src/mame/drivers/gyruss.c @@ -391,8 +391,7 @@ static MACHINE_DRIVER_START( gyruss ) MDRV_SCREEN_SIZE(32*8, 32*8) MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) MDRV_GFXDECODE(gyruss) - MDRV_PALETTE_LENGTH(32) - MDRV_COLORTABLE_LENGTH(16*4+16*16) + MDRV_PALETTE_LENGTH(16*4+16*16) MDRV_PALETTE_INIT(gyruss) MDRV_VIDEO_START(gyruss) diff --git a/src/mame/video/ampoker.c b/src/mame/video/ampoker.c index f0ae3e9bc0c..499f98cf7d6 100644 --- a/src/mame/video/ampoker.c +++ b/src/mame/video/ampoker.c @@ -35,8 +35,6 @@ static tilemap *bg_tilemap; PALETTE_INIT( ampoker2 ) { - #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs]) - int i; /* - bits - diff --git a/src/mame/video/gotya.c b/src/mame/video/gotya.c index c3642881980..4087562b3ee 100644 --- a/src/mame/video/gotya.c +++ b/src/mame/video/gotya.c @@ -18,51 +18,37 @@ PALETTE_INIT( gotya ) { 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++) { int bit0, bit1, bit2, r, g, b; + UINT8 data = color_prom[color_prom[0x20 + i]]; + /* red component */ - bit0 = (*color_prom >> 0) & 0x01; - bit1 = (*color_prom >> 1) & 0x01; - bit2 = (*color_prom >> 2) & 0x01; + bit0 = (data >> 0) & 0x01; + bit1 = (data >> 1) & 0x01; + bit2 = (data >> 2) & 0x01; r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; /* green component */ - bit0 = (*color_prom >> 3) & 0x01; - bit1 = (*color_prom >> 4) & 0x01; - bit2 = (*color_prom >> 5) & 0x01; + bit0 = (data >> 3) & 0x01; + bit1 = (data >> 4) & 0x01; + bit2 = (data >> 5) & 0x01; g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; /* blue component */ bit0 = 0; - bit1 = (*color_prom >> 6) & 0x01; - bit2 = (*color_prom >> 7) & 0x01; + bit1 = (data >> 6) & 0x01; + bit2 = (data >> 7) & 0x01; b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; 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; } } diff --git a/src/mame/video/gyruss.c b/src/mame/video/gyruss.c index ca64c2cb97d..a6174d03956 100644 --- a/src/mame/video/gyruss.c +++ b/src/mame/video/gyruss.c @@ -40,44 +40,39 @@ static UINT32 scanline; PALETTE_INIT( gyruss ) { 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++) { + UINT8 data; 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 */ - bit0 = (*color_prom >> 0) & 0x01; - bit1 = (*color_prom >> 1) & 0x01; - bit2 = (*color_prom >> 2) & 0x01; + bit0 = (data >> 0) & 0x01; + bit1 = (data >> 1) & 0x01; + bit2 = (data >> 2) & 0x01; r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + /* green component */ - bit0 = (*color_prom >> 3) & 0x01; - bit1 = (*color_prom >> 4) & 0x01; - bit2 = (*color_prom >> 5) & 0x01; + bit0 = (data >> 3) & 0x01; + bit1 = (data >> 4) & 0x01; + bit2 = (data >> 5) & 0x01; g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + /* blue component */ bit0 = 0; - bit1 = (*color_prom >> 6) & 0x01; - bit2 = (*color_prom >> 7) & 0x01; + bit1 = (data >> 6) & 0x01; + bit2 = (data >> 7) & 0x01; b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; 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; }