summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Zsolt Vasvari <zsoltvas@mamedev.org>2008-02-03 02:34:03 +0000
committer Zsolt Vasvari <zsoltvas@mamedev.org>2008-02-03 02:34:03 +0000
commit778628f7b316f71fb6f7054bf672bfc233e52751 (patch)
treed47f2c213c313afa5087e270aa55cf5937bfdf60
parent039ec1cbc70559f4a24e89527d6ad9ee951d772a (diff)
Color table removal
-rw-r--r--src/mame/drivers/cherrym2.c1
-rw-r--r--src/mame/drivers/combatsc.c10
-rw-r--r--src/mame/drivers/contra.c5
-rw-r--r--src/mame/drivers/fastlane.c5
-rw-r--r--src/mame/drivers/hcastle.c5
-rw-r--r--src/mame/drivers/labyrunr.c5
-rw-r--r--src/mame/video/combatsc.c79
-rw-r--r--src/mame/video/contra.c49
-rw-r--r--src/mame/video/fastlane.c33
-rw-r--r--src/mame/video/hcastle.c47
-rw-r--r--src/mame/video/konamiic.c16
-rw-r--r--src/mame/video/labyrunr.c51
12 files changed, 223 insertions, 83 deletions
diff --git a/src/mame/drivers/cherrym2.c b/src/mame/drivers/cherrym2.c
index 674144e9e2f..38dafd3d3b8 100644
--- a/src/mame/drivers/cherrym2.c
+++ b/src/mame/drivers/cherrym2.c
@@ -369,7 +369,6 @@ static MACHINE_DRIVER_START( cm2v841 )
MDRV_GFXDECODE(cherrym2)
MDRV_PALETTE_LENGTH(256)
- MDRV_COLORTABLE_LENGTH(256)
MDRV_VIDEO_START(cm2)
MDRV_VIDEO_UPDATE(cm2)
diff --git a/src/mame/drivers/combatsc.c b/src/mame/drivers/combatsc.c
index 7e878f5c399..cff235c544d 100644
--- a/src/mame/drivers/combatsc.c
+++ b/src/mame/drivers/combatsc.c
@@ -285,7 +285,7 @@ static ADDRESS_MAP_START( combasc_writemem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0414, 0x0414) AM_WRITE(soundlatch_w)
AM_RANGE(0x0418, 0x0418) AM_WRITE(combasc_sh_irqtrigger_w)
AM_RANGE(0x041c, 0x041c) AM_WRITE(watchdog_reset_w) /* watchdog reset? */
- AM_RANGE(0x0600, 0x06ff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_le_w) AM_BASE(&paletteram)
+ AM_RANGE(0x0600, 0x06ff) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)
AM_RANGE(0x0800, 0x1fff) AM_WRITE(MWA8_RAM) /* RAM */
AM_RANGE(0x2000, 0x3fff) AM_WRITE(combasc_video_w)
AM_RANGE(0x4000, 0x7fff) AM_WRITE(MWA8_ROM) /* banked ROM area */
@@ -304,7 +304,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( combascb_writemem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x04ff) AM_WRITE(MWA8_RAM)
AM_RANGE(0x0500, 0x0500) AM_WRITE(combascb_bankselect_w)
- AM_RANGE(0x0600, 0x06ff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_le_w) AM_BASE(&paletteram)
+ AM_RANGE(0x0600, 0x06ff) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)
AM_RANGE(0x0800, 0x1fff) AM_WRITE(MWA8_RAM)
AM_RANGE(0x2000, 0x3fff) AM_WRITE(combasc_video_w)
AM_RANGE(0x4000, 0x7fff) AM_WRITE(MWA8_BANK1) /* banked ROM/RAM area */
@@ -680,8 +680,7 @@ static MACHINE_DRIVER_START( combasc )
MDRV_SCREEN_SIZE(32*8, 32*8)
MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
MDRV_GFXDECODE(combasc)
- MDRV_PALETTE_LENGTH(128)
- MDRV_COLORTABLE_LENGTH(8*16*16)
+ MDRV_PALETTE_LENGTH(8*16*16)
MDRV_PALETTE_INIT(combasc)
MDRV_VIDEO_START(combasc)
@@ -723,8 +722,7 @@ static MACHINE_DRIVER_START( combascb )
MDRV_SCREEN_SIZE(32*8, 32*8)
MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
MDRV_GFXDECODE(combascb)
- MDRV_PALETTE_LENGTH(128)
- MDRV_COLORTABLE_LENGTH(8*16*16)
+ MDRV_PALETTE_LENGTH(8*16*16)
MDRV_PALETTE_INIT(combascb)
MDRV_VIDEO_START(combascb)
diff --git a/src/mame/drivers/contra.c b/src/mame/drivers/contra.c
index bb3cd7c5217..75ee52718d8 100644
--- a/src/mame/drivers/contra.c
+++ b/src/mame/drivers/contra.c
@@ -88,7 +88,7 @@ static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x001c, 0x001c) AM_WRITE(cpu_sound_command_w)
AM_RANGE(0x001e, 0x001e) AM_WRITE(MWA8_NOP) /* ? */
AM_RANGE(0x0060, 0x0067) AM_WRITE(contra_K007121_ctrl_1_w)
- AM_RANGE(0x0c00, 0x0cff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_le_w) AM_BASE(&paletteram)
+ AM_RANGE(0x0c00, 0x0cff) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)
AM_RANGE(0x1000, 0x1fff) AM_WRITE(MWA8_RAM)
AM_RANGE(0x2000, 0x23ff) AM_WRITE(contra_fg_cram_w) AM_BASE(&contra_fg_cram)
AM_RANGE(0x2400, 0x27ff) AM_WRITE(contra_fg_vram_w) AM_BASE(&contra_fg_vram)
@@ -265,8 +265,7 @@ static MACHINE_DRIVER_START( contra )
MDRV_SCREEN_SIZE(37*8, 32*8)
MDRV_SCREEN_VISIBLE_AREA(0*8, 35*8-1, 2*8, 30*8-1)
MDRV_GFXDECODE(contra)
- MDRV_PALETTE_LENGTH(128)
- MDRV_COLORTABLE_LENGTH(2*8*16*16)
+ MDRV_PALETTE_LENGTH(2*8*16*16)
MDRV_PALETTE_INIT(contra)
MDRV_VIDEO_START(contra)
diff --git a/src/mame/drivers/fastlane.c b/src/mame/drivers/fastlane.c
index 28668e6ba88..02fddc03aa7 100644
--- a/src/mame/drivers/fastlane.c
+++ b/src/mame/drivers/fastlane.c
@@ -112,7 +112,7 @@ static ADDRESS_MAP_START( fastlane_writemem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0d00, 0x0d0d) AM_WRITE(fastlane_K007232_write_port_0_w) /* 007232 registers (chip 1) */
AM_RANGE(0x0e00, 0x0e0d) AM_WRITE(fastlane_K007232_write_port_1_w) /* 007232 registers (chip 2) */
AM_RANGE(0x0f00, 0x0f1f) AM_WRITE(K051733_w) /* 051733 (protection) */
- AM_RANGE(0x1000, 0x17ff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_BASE(&paletteram)/* palette RAM */
+ AM_RANGE(0x1000, 0x17ff) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)/* palette RAM */
AM_RANGE(0x1800, 0x1fff) AM_WRITE(MWA8_RAM) /* Work RAM */
AM_RANGE(0x2000, 0x27ff) AM_WRITE(fastlane_vram1_w) AM_BASE(&fastlane_videoram1)
AM_RANGE(0x2800, 0x2fff) AM_WRITE(fastlane_vram2_w) AM_BASE(&fastlane_videoram2)
@@ -290,8 +290,7 @@ static MACHINE_DRIVER_START( fastlane )
MDRV_SCREEN_SIZE(37*8, 32*8)
MDRV_SCREEN_VISIBLE_AREA(0*8, 35*8-1, 2*8, 30*8-1)
MDRV_GFXDECODE(fastlane)
- MDRV_PALETTE_LENGTH(1024)
- MDRV_COLORTABLE_LENGTH(1024*16)
+ MDRV_PALETTE_LENGTH(1024*16)
MDRV_PALETTE_INIT(fastlane)
MDRV_VIDEO_START(fastlane)
diff --git a/src/mame/drivers/hcastle.c b/src/mame/drivers/hcastle.c
index 709103f7c54..9f30d607a0c 100644
--- a/src/mame/drivers/hcastle.c
+++ b/src/mame/drivers/hcastle.c
@@ -76,7 +76,7 @@ static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x040c, 0x040c) AM_WRITE(watchdog_reset_w)
AM_RANGE(0x0410, 0x0410) AM_WRITE(hcastle_coin_w)
AM_RANGE(0x0418, 0x0418) AM_WRITE(hcastle_gfxbank_w)
- AM_RANGE(0x0600, 0x06ff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_BASE(&paletteram)
+ AM_RANGE(0x0600, 0x06ff) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)
AM_RANGE(0x0700, 0x1fff) AM_WRITE(MWA8_RAM)
AM_RANGE(0x2000, 0x2fff) AM_WRITE(hcastle_pf1_video_w) AM_BASE(&hcastle_pf1_videoram)
AM_RANGE(0x3000, 0x3fff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
@@ -284,8 +284,7 @@ static MACHINE_DRIVER_START( hcastle )
MDRV_SCREEN_SIZE(32*8, 32*8)
MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
MDRV_GFXDECODE(hcastle)
- MDRV_PALETTE_LENGTH(128)
- MDRV_COLORTABLE_LENGTH(2*8*16*16)
+ MDRV_PALETTE_LENGTH(2*8*16*16)
MDRV_PALETTE_INIT(hcastle)
MDRV_VIDEO_START(hcastle)
diff --git a/src/mame/drivers/labyrunr.c b/src/mame/drivers/labyrunr.c
index 933481e9912..bbd7e48a1fc 100644
--- a/src/mame/drivers/labyrunr.c
+++ b/src/mame/drivers/labyrunr.c
@@ -80,7 +80,7 @@ static ADDRESS_MAP_START( labyrunr_writemem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0c00, 0x0c00) AM_WRITE(labyrunr_bankswitch_w)
AM_RANGE(0x0d00, 0x0d1f) AM_WRITE(K051733_w) /* 051733 (protection) */
AM_RANGE(0x0e00, 0x0e00) AM_WRITE(watchdog_reset_w)
- AM_RANGE(0x1000, 0x10ff) AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_BASE(&paletteram)
+ AM_RANGE(0x1000, 0x10ff) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)
AM_RANGE(0x1800, 0x1fff) AM_WRITE(MWA8_RAM)
AM_RANGE(0x2000, 0x2fff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) /* Sprite RAM */
AM_RANGE(0x3000, 0x37ff) AM_WRITE(labyrunr_vram1_w) AM_BASE(&labyrunr_videoram1)
@@ -252,8 +252,7 @@ static MACHINE_DRIVER_START( labyrunr )
MDRV_SCREEN_SIZE(37*8, 32*8)
MDRV_SCREEN_VISIBLE_AREA(0*8, 35*8-1, 2*8, 30*8-1)
MDRV_GFXDECODE(labyrunr)
- MDRV_PALETTE_LENGTH(128)
- MDRV_COLORTABLE_LENGTH(2*8*16*16)
+ MDRV_PALETTE_LENGTH(2*8*16*16)
MDRV_PALETTE_INIT(labyrunr)
MDRV_VIDEO_START(labyrunr)
diff --git a/src/mame/video/combatsc.c b/src/mame/video/combatsc.c
index 6d498eaed75..b32bdf57260 100644
--- a/src/mame/video/combatsc.c
+++ b/src/mame/video/combatsc.c
@@ -28,11 +28,18 @@ static UINT8 *combasc_scrollram;
PALETTE_INIT( combasc )
{
- int i,pal,clut = 0;
- for( pal=0; pal<8; pal++ )
+ int pal;
+
+ /* allocate the colortable */
+ machine->colortable = colortable_alloc(machine, 0x80);
+
+ for (pal = 0; pal < 8; pal++)
{
- switch( pal )
+ int i, clut;
+
+ switch (pal)
{
+ default:
case 0: /* other sprites */
case 2: /* other sprites(alt) */
clut = 1; /* 0 is wrong for Firing Range III targets */
@@ -54,36 +61,65 @@ PALETTE_INIT( combasc )
break;
}
- for( i=0; i<256; i++ )
+ for (i = 0; i < 0x100; i++)
{
- if ((pal & 1) == 0) /* sprites */
- {
- if (color_prom[256 * clut + i] == 0)
- *(colortable++) = 0;
- else
- *(colortable++) = 16 * pal + color_prom[256 * clut + i];
- }
- else /* chars */
- *(colortable++) = 16 * pal + color_prom[256 * clut + i];
+ UINT8 ctabentry;
+
+ if (((pal & 0x01) == 0) && (color_prom[(clut << 8) | i] == 0))
+ ctabentry = 0;
+ else
+ ctabentry = (pal << 4) | (color_prom[(clut << 8) | i] & 0x0f);
+
+ colortable_entry_set_value(machine->colortable, (pal << 8) | i, ctabentry);
}
}
}
+
PALETTE_INIT( combascb )
{
- int i,pal;
- for( pal=0; pal<8; pal++ )
+ int pal;
+
+ /* allocate the colortable */
+ machine->colortable = colortable_alloc(machine, 0x80);
+
+ for (pal = 0; pal < 8; pal++)
{
- for( i=0; i<256; i++ )
+ int i;
+
+ for (i = 0; i < 0x100; i++)
{
- if ((pal & 1) == 0) /* sprites */
- *(colortable++) = 16 * pal + (color_prom[i] ^ 0x0f);
- else /* chars */
- *(colortable++) = 16 * pal + (i & 0x0f); /* no lookup? */
+ UINT8 ctabentry;
+
+ if ((pal & 1) == 0)
+ /* sprites */
+ ctabentry = (pal << 4) | (~color_prom[i] & 0x0f);
+ else
+ /* chars - no lookup? */
+ ctabentry = (pal << 4) | (i & 0x0f); /* no lookup? */
+
+ colortable_entry_set_value(machine->colortable, (pal << 8) | i, ctabentry);
}
}
}
+
+static void set_pens(running_machine *machine)
+{
+ int i;
+
+ for (i = 0x00; i < 0x100; i += 2)
+ {
+ UINT16 data = paletteram[i] | (paletteram[i | 1] << 8);
+
+ rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
+
+ colortable_palette_set_color(machine->colortable, i >> 1, color);
+ }
+}
+
+
+
/***************************************************************************
Callbacks for the TileMap code
@@ -453,6 +489,7 @@ VIDEO_UPDATE( combasc )
{
int i;
+ set_pens(machine);
if (K007121_ctrlram[0][0x01] & 0x02)
{
@@ -612,6 +649,8 @@ VIDEO_UPDATE( combascb )
{
int i;
+ set_pens(machine);
+
for( i=0; i<32; i++ )
{
tilemap_set_scrollx( bg_tilemap[0],i, combasc_io_ram[0x040+i]+5 );
diff --git a/src/mame/video/contra.c b/src/mame/video/contra.c
index 8ef0b780c54..4ceb36ab305 100644
--- a/src/mame/video/contra.c
+++ b/src/mame/video/contra.c
@@ -30,30 +30,51 @@ static rectangle bg_clip, fg_clip, tx_clip;
PALETTE_INIT( contra )
{
- int i,chip,pal,clut;
+ int chip;
- for (chip = 0;chip < 2;chip++)
+ /* allocate the colortable */
+ machine->colortable = colortable_alloc(machine, 0x80);
+
+ for (chip = 0; chip < 2; chip++)
{
- for (pal = 0;pal < 8;pal++)
+ int pal;
+
+ for (pal = 0; pal < 8; pal++)
{
- clut = (pal & 1) + 2 * chip;
- for (i = 0;i < 256;i++)
+ int i;
+ int clut = (chip << 1) | (pal & 1);
+
+ for (i = 0; i < 0x100; i++)
{
- if ((pal & 1) == 0) /* sprites */
- {
- if (color_prom[256 * clut + i] == 0)
- *(colortable++) = 0;
- else
- *(colortable++) = 16 * pal + color_prom[256 * clut + i];
- }
+ UINT8 ctabentry;
+
+ if (((pal & 0x01) == 0) && (color_prom[(clut << 8) | i] == 0))
+ ctabentry = 0;
else
- *(colortable++) = 16 * pal + color_prom[256 * clut + i];
+ ctabentry = (pal << 4) | (color_prom[(clut << 8) | i] & 0x0f);
+
+ colortable_entry_set_value(machine->colortable, (chip << 11) | (pal << 8) | i, ctabentry);
}
}
}
}
+static void set_pens(running_machine *machine)
+{
+ int i;
+
+ for (i = 0x00; i < 0x100; i += 2)
+ {
+ UINT16 data = paletteram[i] | (paletteram[i | 1] << 8);
+
+ rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
+
+ colortable_palette_set_color(machine->colortable, i >> 1, color);
+ }
+}
+
+
/***************************************************************************
@@ -267,6 +288,8 @@ VIDEO_UPDATE( contra )
sect_rect(&fg_finalclip, cliprect);
sect_rect(&tx_finalclip, cliprect);
+ set_pens(machine);
+
tilemap_set_scrollx( fg_tilemap,0, K007121_ctrlram[0][0x00] - 40 );
tilemap_set_scrolly( fg_tilemap,0, K007121_ctrlram[0][0x02] );
tilemap_set_scrollx( bg_tilemap,0, K007121_ctrlram[1][0x00] - 40 );
diff --git a/src/mame/video/fastlane.c b/src/mame/video/fastlane.c
index 6408f8cacb3..a753f5d3376 100644
--- a/src/mame/video/fastlane.c
+++ b/src/mame/video/fastlane.c
@@ -8,17 +8,40 @@ static rectangle clip0, clip1;
PALETTE_INIT( fastlane )
{
- int pal,col;
+ int pal;
- for (pal = 0;pal < 16;pal++)
+ /* allocate the colortable */
+ machine->colortable = colortable_alloc(machine, 0x400);
+
+ for (pal = 0; pal < 0x10; pal++)
{
- for (col = 0;col < 1024;col++)
+ int i;
+
+ for (i = 0; i < 0x400; i++)
{
- *(colortable++) = (col & ~0x0f) | color_prom[16 * pal + (col & 0x0f)];
+ UINT8 ctabentry = (i & 0x3f0) | color_prom[(pal << 4) | (i & 0x0f)];
+ colortable_entry_set_value(machine->colortable, (pal << 10) | i, ctabentry);
}
}
}
+
+static void set_pens(running_machine *machine)
+{
+ int i;
+
+ for (i = 0x00; i < 0x800; i += 2)
+ {
+ UINT16 data = paletteram[i | 1] | (paletteram[i] << 8);
+
+ rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
+
+ colortable_palette_set_color(machine->colortable, i >> 1, color);
+ }
+}
+
+
+
/***************************************************************************
Callbacks for the TileMap code
@@ -130,6 +153,8 @@ VIDEO_UPDATE( fastlane )
sect_rect(&finalclip0, cliprect);
sect_rect(&finalclip1, cliprect);
+ set_pens(machine);
+
/* set scroll registers */
xoffs = K007121_ctrlram[0][0x00];
for( i=0; i<32; i++ ){
diff --git a/src/mame/video/hcastle.c b/src/mame/video/hcastle.c
index b06e133b735..e55bf333249 100644
--- a/src/mame/video/hcastle.c
+++ b/src/mame/video/hcastle.c
@@ -16,30 +16,50 @@ static int pf2_bankbase,pf1_bankbase;
PALETTE_INIT( hcastle )
{
- int i,chip,pal,clut;
+ int chip;
- for (chip = 0;chip < 2;chip++)
+ /* allocate the colortable */
+ machine->colortable = colortable_alloc(machine, 0x80);
+
+ for (chip = 0; chip < 2; chip++)
{
- for (pal = 0;pal < 8;pal++)
+ int pal;
+
+ for (pal = 0; pal < 8; pal++)
{
- clut = (pal & 1) + 2 * chip;
- for (i = 0;i < 256;i++)
+ int i;
+ int clut = (chip << 1) | (pal & 1);
+
+ for (i = 0; i < 0x100; i++)
{
- if ((pal & 1) == 0) /* sprites */
- {
- if (color_prom[256 * clut + i] == 0)
- *(colortable++) = 0;
- else
- *(colortable++) = 16 * pal + color_prom[256 * clut + i];
- }
+ UINT8 ctabentry;
+
+ if (((pal & 0x01) == 0) && (color_prom[(clut << 8) | i] == 0))
+ ctabentry = 0;
else
- *(colortable++) = 16 * pal + color_prom[256 * clut + i];
+ ctabentry = (pal << 4) | (color_prom[(clut << 8) | i] & 0x0f);
+
+ colortable_entry_set_value(machine->colortable, (chip << 11) | (pal << 8) | i, ctabentry);
}
}
}
}
+static void set_pens(running_machine *machine)
+{
+ int i;
+
+ for (i = 0x00; i < 0x100; i += 2)
+ {
+ UINT16 data = paletteram[i | 1] | (paletteram[i] << 8);
+
+ rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
+
+ colortable_palette_set_color(machine->colortable, i >> 1, color);
+ }
+}
+
/***************************************************************************
@@ -190,6 +210,7 @@ VIDEO_UPDATE( hcastle )
{
static int old_pf1,old_pf2;
+ set_pens(machine);
pf1_bankbase = 0x0000;
pf2_bankbase = 0x4000 * ((gfx_bank & 2) >> 1);
diff --git a/src/mame/video/konamiic.c b/src/mame/video/konamiic.c
index 934afa0b026..db1c9616fd4 100644
--- a/src/mame/video/konamiic.c
+++ b/src/mame/video/konamiic.c
@@ -1351,7 +1351,7 @@ if (input_code_pressed(KEYCODE_D))
offs[2] = 0x02;
offs[3] = 0x03;
offs[4] = 0x04;
- trans = TRANSPARENCY_COLOR;
+ trans = TRANSPARENCY_PENS;
/* when using priority buffer, draw front to back */
if (pri_mask != -1)
{
@@ -1371,6 +1371,7 @@ if (input_code_pressed(KEYCODE_D))
int yflip = source[offs[4]] & 0x20; /* flip y */
int color = base_color + ((source[offs[1]] & 0xf0) >> 4);
int width,height;
+ int transparent_color;
static const int x_offset[4] = {0x0,0x1,0x4,0x5};
static const int y_offset[4] = {0x0,0x2,0x8,0xa};
int x,y, ex, ey;
@@ -1382,6 +1383,11 @@ if (input_code_pressed(KEYCODE_D))
number = number << 2;
number += (sprite_bank >> 2) & 3;
+ if (trans == TRANSPARENCY_PEN)
+ transparent_color = 0;
+ else
+ transparent_color = colortable_get_transpen_mask(machine->colortable, gfx, color, 0);
+
if (!is_flakatck || source[0x00]) /* Flak Attack needs this */
{
number += bank_base;
@@ -1413,7 +1419,7 @@ if (input_code_pressed(KEYCODE_D))
color,
!xflip,!yflip,
248-(sx+x*8),248-(sy+y*8),
- cliprect,trans,0,
+ cliprect,trans,transparent_color,
pri_mask);
else
drawgfx(bitmap,gfx,
@@ -1421,7 +1427,7 @@ if (input_code_pressed(KEYCODE_D))
color,
!xflip,!yflip,
248-(sx+x*8),248-(sy+y*8),
- cliprect,trans,0);
+ cliprect,trans,transparent_color);
}
else
{
@@ -1431,7 +1437,7 @@ if (input_code_pressed(KEYCODE_D))
color,
xflip,yflip,
global_x_offset+sx+x*8,sy+y*8,
- cliprect,trans,0,
+ cliprect,trans,transparent_color,
pri_mask);
else
drawgfx(bitmap,gfx,
@@ -1439,7 +1445,7 @@ if (input_code_pressed(KEYCODE_D))
color,
xflip,yflip,
global_x_offset+sx+x*8,sy+y*8,
- cliprect,trans,0);
+ cliprect,trans,transparent_color);
}
}
}
diff --git a/src/mame/video/labyrunr.c b/src/mame/video/labyrunr.c
index c938f76c38b..019ac07195a 100644
--- a/src/mame/video/labyrunr.c
+++ b/src/mame/video/labyrunr.c
@@ -8,27 +8,58 @@ static rectangle clip0, clip1;
PALETTE_INIT( labyrunr )
{
- int i,pal;
+ int pal;
- for (pal = 0;pal < 8;pal++)
+ /* allocate the colortable */
+ machine->colortable = colortable_alloc(machine, 0x80);
+
+ for (pal = 0; pal < 8; pal++)
{
- if (pal & 1) /* chars, no lookup table */
+ /* chars, no lookup table */
+ if (pal & 1)
{
- for (i = 0;i < 256;i++)
- *(colortable++) = 16 * pal + (i & 0x0f);
+ int i;
+
+ for (i = 0; i < 0x100; i++)
+ colortable_entry_set_value(machine->colortable, (pal << 8) | i, (pal << 4) | (i & 0x0f));
}
- else /* sprites */
+ /* sprites */
+ else
{
- for (i = 0;i < 256;i++)
+ int i;
+
+ for (i = 0; i < 0x100; i++)
+ {
+ UINT8 ctabentry;
+
if (color_prom[i] == 0)
- *(colortable++) = 0;
+ ctabentry = 0;
else
- *(colortable++) = 16 * pal + color_prom[i];
+ ctabentry = (pal << 4) | (color_prom[i] & 0x0f);
+
+ colortable_entry_set_value(machine->colortable, (pal << 8) | i, ctabentry);
+ }
}
}
}
+static void set_pens(running_machine *machine)
+{
+ int i;
+
+ for (i = 0x00; i < 0x100; i += 2)
+ {
+ UINT16 data = paletteram[i | 1] | (paletteram[i] << 8);
+
+ rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
+
+ colortable_palette_set_color(machine->colortable, i >> 1, color);
+ }
+}
+
+
+
/***************************************************************************
Callbacks for the TileMap code
@@ -142,6 +173,8 @@ VIDEO_UPDATE( labyrunr )
{
rectangle finalclip0, finalclip1;
+ set_pens(machine);
+
fillbitmap(priority_bitmap,0,cliprect);
fillbitmap(bitmap,get_black_pen(machine),cliprect);