mirror of
https://github.com/holub/mame
synced 2025-07-01 00:09:18 +03:00
Removes color table from Centipede and related games
This commit is contained in:
parent
faa995111f
commit
bd18da7d71
@ -9,13 +9,9 @@
|
|||||||
* Maze Invaders (prototype)
|
* Maze Invaders (prototype)
|
||||||
* Bulls Eye Darts
|
* Bulls Eye Darts
|
||||||
|
|
||||||
Centipede sync-prom added by HIGHWAYMAN.
|
Known ROMs (listed in the manual) that need to be dumped/verified:
|
||||||
The prom pcb location is:P4 and is 256x4
|
|
||||||
(i need to update the dump, this one is read in 8bit-mode)
|
|
||||||
|
|
||||||
Known roms (listed in the manual) that need to be dumped/verified:
|
Centipede:
|
||||||
|
|
||||||
Centipede:
|
|
||||||
136001-203.d1 <-- Are these the proper labels for the timed version???
|
136001-203.d1 <-- Are these the proper labels for the timed version???
|
||||||
136001-204.e1
|
136001-204.e1
|
||||||
136001-205.fh1
|
136001-205.fh1
|
||||||
@ -26,7 +22,7 @@ Centipede:
|
|||||||
136001-305.fh1
|
136001-305.fh1
|
||||||
136001-306.j1
|
136001-306.j1
|
||||||
|
|
||||||
Milipede:
|
Milipede:
|
||||||
136013-109.5p
|
136013-109.5p
|
||||||
136013-110.5r
|
136013-110.5r
|
||||||
|
|
||||||
@ -1647,10 +1643,8 @@ static MACHINE_DRIVER_START( centiped )
|
|||||||
MDRV_SCREEN_SIZE(32*8, 32*8)
|
MDRV_SCREEN_SIZE(32*8, 32*8)
|
||||||
MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
|
MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
|
||||||
MDRV_GFXDECODE(centiped)
|
MDRV_GFXDECODE(centiped)
|
||||||
MDRV_PALETTE_LENGTH(4+4)
|
MDRV_PALETTE_LENGTH(4+4*4*4*4)
|
||||||
MDRV_COLORTABLE_LENGTH(4+4*4*4*4)
|
|
||||||
|
|
||||||
MDRV_PALETTE_INIT(centiped)
|
|
||||||
MDRV_VIDEO_START(centiped)
|
MDRV_VIDEO_START(centiped)
|
||||||
MDRV_VIDEO_UPDATE(centiped)
|
MDRV_VIDEO_UPDATE(centiped)
|
||||||
|
|
||||||
@ -1683,7 +1677,7 @@ static MACHINE_DRIVER_START( centipdb )
|
|||||||
/* sound hardware */
|
/* sound hardware */
|
||||||
MDRV_SOUND_REPLACE("pokey", AY8910, 12096000/8)
|
MDRV_SOUND_REPLACE("pokey", AY8910, 12096000/8)
|
||||||
MDRV_SOUND_CONFIG(centipdb_ay8910_interface)
|
MDRV_SOUND_CONFIG(centipdb_ay8910_interface)
|
||||||
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
|
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 10.0)
|
||||||
MACHINE_DRIVER_END
|
MACHINE_DRIVER_END
|
||||||
|
|
||||||
|
|
||||||
@ -1696,7 +1690,7 @@ static MACHINE_DRIVER_START( magworm )
|
|||||||
/* sound hardware */
|
/* sound hardware */
|
||||||
MDRV_SOUND_REPLACE("pokey", AY8910, 12096000/8)
|
MDRV_SOUND_REPLACE("pokey", AY8910, 12096000/8)
|
||||||
MDRV_SOUND_CONFIG(centipdb_ay8910_interface)
|
MDRV_SOUND_CONFIG(centipdb_ay8910_interface)
|
||||||
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
|
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 15.0)
|
||||||
MACHINE_DRIVER_END
|
MACHINE_DRIVER_END
|
||||||
|
|
||||||
|
|
||||||
@ -1709,10 +1703,8 @@ static MACHINE_DRIVER_START( milliped )
|
|||||||
|
|
||||||
/* video hardware */
|
/* video hardware */
|
||||||
MDRV_GFXDECODE(milliped)
|
MDRV_GFXDECODE(milliped)
|
||||||
MDRV_PALETTE_LENGTH(4*4+4*4)
|
MDRV_PALETTE_LENGTH(4*4+4*4*4*4*4)
|
||||||
MDRV_COLORTABLE_LENGTH(4*4+4*4*4*4*4)
|
|
||||||
|
|
||||||
MDRV_PALETTE_INIT(milliped)
|
|
||||||
MDRV_VIDEO_START(milliped)
|
MDRV_VIDEO_START(milliped)
|
||||||
MDRV_VIDEO_UPDATE(milliped)
|
MDRV_VIDEO_UPDATE(milliped)
|
||||||
|
|
||||||
@ -1736,8 +1728,7 @@ static MACHINE_DRIVER_START( warlords )
|
|||||||
|
|
||||||
/* video hardware */
|
/* video hardware */
|
||||||
MDRV_GFXDECODE(warlords)
|
MDRV_GFXDECODE(warlords)
|
||||||
MDRV_PALETTE_LENGTH(128)
|
MDRV_PALETTE_LENGTH(8*4+8*4)
|
||||||
MDRV_COLORTABLE_LENGTH(8*4+8*4)
|
|
||||||
|
|
||||||
MDRV_PALETTE_INIT(warlords)
|
MDRV_PALETTE_INIT(warlords)
|
||||||
MDRV_VIDEO_START(warlords)
|
MDRV_VIDEO_START(warlords)
|
||||||
@ -1777,9 +1768,7 @@ static MACHINE_DRIVER_START( bullsdrt )
|
|||||||
MDRV_SCREEN_SIZE(32*8, 32*8)
|
MDRV_SCREEN_SIZE(32*8, 32*8)
|
||||||
MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
|
MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
|
||||||
MDRV_GFXDECODE(centiped)
|
MDRV_GFXDECODE(centiped)
|
||||||
MDRV_PALETTE_LENGTH(4+4)
|
MDRV_PALETTE_LENGTH(4+4*4*4*4)
|
||||||
MDRV_COLORTABLE_LENGTH(4+4*4*4*4)
|
|
||||||
MDRV_PALETTE_INIT(centiped)
|
|
||||||
|
|
||||||
MDRV_VIDEO_START(bullsdrt)
|
MDRV_VIDEO_START(bullsdrt)
|
||||||
MDRV_VIDEO_UPDATE(bullsdrt)
|
MDRV_VIDEO_UPDATE(bullsdrt)
|
||||||
@ -1879,6 +1868,7 @@ ROM_START( centipdb )
|
|||||||
ROM_LOAD( "136001-213.p4", 0x0000, 0x0100, CRC(6fa3093a) SHA1(2b7aeca74c1ae4156bf1878453a047330f96f0a8) )
|
ROM_LOAD( "136001-213.p4", 0x0000, 0x0100, CRC(6fa3093a) SHA1(2b7aeca74c1ae4156bf1878453a047330f96f0a8) )
|
||||||
ROM_END
|
ROM_END
|
||||||
|
|
||||||
|
|
||||||
ROM_START( millpac )
|
ROM_START( millpac )
|
||||||
ROM_REGION( 0x10000, REGION_CPU1, 0 )
|
ROM_REGION( 0x10000, REGION_CPU1, 0 )
|
||||||
ROM_LOAD( "millpac1.1d", 0x2000, 0x0800, CRC(4dd6913d) SHA1(9eca634e1a827f9bbcf3c532d44e175ac4751755) )
|
ROM_LOAD( "millpac1.1d", 0x2000, 0x0800, CRC(4dd6913d) SHA1(9eca634e1a827f9bbcf3c532d44e175ac4751755) )
|
||||||
@ -1926,7 +1916,7 @@ ROM_END
|
|||||||
|
|
||||||
|
|
||||||
ROM_START( mazeinv )
|
ROM_START( mazeinv )
|
||||||
ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* 64k for code */
|
ROM_REGION( 0x10000, REGION_CPU1, 0 )
|
||||||
ROM_LOAD( "005.011", 0x3000, 0x1000, CRC(37129536) SHA1(356cb986a40b332100e00fb72194fd4dade2cba7) )
|
ROM_LOAD( "005.011", 0x3000, 0x1000, CRC(37129536) SHA1(356cb986a40b332100e00fb72194fd4dade2cba7) )
|
||||||
ROM_LOAD( "004.011", 0x4000, 0x1000, CRC(2d0fbf2f) SHA1(9d4c2bc9f80604d1ff5c5bf5a4a78378efdd8b33) )
|
ROM_LOAD( "004.011", 0x4000, 0x1000, CRC(2d0fbf2f) SHA1(9d4c2bc9f80604d1ff5c5bf5a4a78378efdd8b33) )
|
||||||
ROM_LOAD( "003.011", 0x5000, 0x1000, CRC(0ff3747c) SHA1(1a7e1c487c24875dada967fb3a9ceaca25b7e2a7) )
|
ROM_LOAD( "003.011", 0x5000, 0x1000, CRC(0ff3747c) SHA1(1a7e1c487c24875dada967fb3a9ceaca25b7e2a7) )
|
||||||
@ -2028,4 +2018,4 @@ GAME( 1982, milliped, 0, milliped, milliped, 0, ROT270, "Atari",
|
|||||||
GAME( 1980, warlords, 0, warlords, warlords, 0, ROT0, "Atari", "Warlords", GAME_SUPPORTS_SAVE )
|
GAME( 1980, warlords, 0, warlords, warlords, 0, ROT0, "Atari", "Warlords", GAME_SUPPORTS_SAVE )
|
||||||
GAME( 1981, mazeinv, 0, mazeinv, mazeinv, 0, ROT270, "Atari", "Maze Invaders (prototype)", 0 )
|
GAME( 1981, mazeinv, 0, mazeinv, mazeinv, 0, ROT270, "Atari", "Maze Invaders (prototype)", 0 )
|
||||||
|
|
||||||
GAME( 1985, bullsdrt, 0, bullsdrt, bullsdrt, bullsdrt, ROT270, "Shinkai Inc. (Magic Eletronics Inc. licence)", "Bulls Eye Darts", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE )
|
GAME( 1985, bullsdrt, 0, bullsdrt, bullsdrt, bullsdrt, ROT270, "Shinkai Inc. (Magic Eletronics Inc. licence)", "Bulls Eye Darts", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
|
||||||
|
@ -8,8 +8,6 @@
|
|||||||
|
|
||||||
extern UINT8 centiped_flipscreen, *bullsdrt_tiles_bankram;
|
extern UINT8 centiped_flipscreen, *bullsdrt_tiles_bankram;
|
||||||
|
|
||||||
PALETTE_INIT( centiped );
|
|
||||||
PALETTE_INIT( milliped );
|
|
||||||
PALETTE_INIT( warlords );
|
PALETTE_INIT( warlords );
|
||||||
|
|
||||||
VIDEO_START( centiped );
|
VIDEO_START( centiped );
|
||||||
|
@ -57,6 +57,28 @@ static TILE_GET_INFO( bullsdrt_get_tile_info )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************
|
||||||
|
*
|
||||||
|
* Palette init
|
||||||
|
*
|
||||||
|
*************************************/
|
||||||
|
|
||||||
|
static void init_penmask(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < 64; i++)
|
||||||
|
{
|
||||||
|
UINT8 mask = 1;
|
||||||
|
if (((i >> 0) & 3) == 0) mask |= 2;
|
||||||
|
if (((i >> 2) & 3) == 0) mask |= 4;
|
||||||
|
if (((i >> 4) & 3) == 0) mask |= 8;
|
||||||
|
penmask[i] = mask;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************
|
/*************************************
|
||||||
*
|
*
|
||||||
* Video system start
|
* Video system start
|
||||||
@ -67,6 +89,8 @@ VIDEO_START( centiped )
|
|||||||
{
|
{
|
||||||
bg_tilemap = tilemap_create(centiped_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
|
bg_tilemap = tilemap_create(centiped_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
|
||||||
|
|
||||||
|
init_penmask();
|
||||||
|
|
||||||
centiped_flipscreen = 0;
|
centiped_flipscreen = 0;
|
||||||
|
|
||||||
state_save_register_global(centiped_flipscreen);
|
state_save_register_global(centiped_flipscreen);
|
||||||
@ -88,7 +112,10 @@ VIDEO_START( milliped )
|
|||||||
{
|
{
|
||||||
bg_tilemap = tilemap_create(milliped_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
|
bg_tilemap = tilemap_create(milliped_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
|
||||||
|
|
||||||
|
init_penmask();
|
||||||
|
|
||||||
centiped_flipscreen = 0;
|
centiped_flipscreen = 0;
|
||||||
|
|
||||||
state_save_register_global(centiped_flipscreen);
|
state_save_register_global(centiped_flipscreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,6 +124,8 @@ VIDEO_START( bullsdrt )
|
|||||||
{
|
{
|
||||||
bg_tilemap = tilemap_create(bullsdrt_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
|
bg_tilemap = tilemap_create(bullsdrt_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
|
||||||
|
|
||||||
|
init_penmask();
|
||||||
|
|
||||||
centiped_flipscreen = 0;
|
centiped_flipscreen = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,28 +185,6 @@ WRITE8_HANDLER( bullsdrt_sprites_bank_w )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************
|
|
||||||
*
|
|
||||||
* Palette init
|
|
||||||
*
|
|
||||||
*************************************/
|
|
||||||
|
|
||||||
static void init_penmask(void)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 64; i++)
|
|
||||||
{
|
|
||||||
UINT8 mask = 1;
|
|
||||||
if (((i >> 0) & 3) == 0) mask |= 2;
|
|
||||||
if (((i >> 2) & 3) == 0) mask |= 4;
|
|
||||||
if (((i >> 4) & 3) == 0) mask |= 8;
|
|
||||||
penmask[i] = mask;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
|
|
||||||
Centipede doesn't have a color PROM. Eight RAM locations control
|
Centipede doesn't have a color PROM. Eight RAM locations control
|
||||||
@ -192,47 +199,29 @@ static void init_penmask(void)
|
|||||||
The alternate bit affects blue and green, not red. The way I weighted its
|
The alternate bit affects blue and green, not red. The way I weighted its
|
||||||
effect might not be perfectly accurate, but is reasonably close.
|
effect might not be perfectly accurate, but is reasonably close.
|
||||||
|
|
||||||
|
Centipede is unusual because the sprite color code specifies the
|
||||||
|
colors to use one by one, instead of a combination code.
|
||||||
|
bit 5-4 = color to use for pen 11
|
||||||
|
bit 3-2 = color to use for pen 10
|
||||||
|
bit 1-0 = color to use for pen 01
|
||||||
|
pen 00 is transparent
|
||||||
|
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#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])
|
|
||||||
|
|
||||||
PALETTE_INIT( centiped )
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
/* characters use colors 0-3 */
|
|
||||||
for (i = 0; i < TOTAL_COLORS(0); i++)
|
|
||||||
COLOR(0,i) = i;
|
|
||||||
|
|
||||||
/* Centipede is unusual because the sprite color code specifies the */
|
|
||||||
/* colors to use one by one, instead of a combination code. */
|
|
||||||
/* bit 5-4 = color to use for pen 11 */
|
|
||||||
/* bit 3-2 = color to use for pen 10 */
|
|
||||||
/* bit 1-0 = color to use for pen 01 */
|
|
||||||
/* pen 00 is transparent */
|
|
||||||
for (i = 0; i < TOTAL_COLORS(1); i += 4)
|
|
||||||
{
|
|
||||||
COLOR(1,i+0) = 0;
|
|
||||||
COLOR(1,i+1) = 4 + ((i >> 2) & 3);
|
|
||||||
COLOR(1,i+2) = 4 + ((i >> 4) & 3);
|
|
||||||
COLOR(1,i+3) = 4 + ((i >> 6) & 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* create a pen mask for sprite drawing */
|
|
||||||
init_penmask();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
WRITE8_HANDLER( centiped_paletteram_w )
|
WRITE8_HANDLER( centiped_paletteram_w )
|
||||||
{
|
{
|
||||||
int r, g, b;
|
|
||||||
|
|
||||||
paletteram[offset] = data;
|
paletteram[offset] = data;
|
||||||
|
|
||||||
r = 0xff * ((~data >> 0) & 1);
|
/* bit 2 of the output palette RAM is always pulled high, so we ignore */
|
||||||
g = 0xff * ((~data >> 1) & 1);
|
/* any palette changes unless the write is to a palette RAM address */
|
||||||
b = 0xff * ((~data >> 2) & 1);
|
/* that is actually used */
|
||||||
|
if (offset & 4)
|
||||||
|
{
|
||||||
|
rgb_t color;
|
||||||
|
|
||||||
|
int r = 0xff * ((~data >> 0) & 1);
|
||||||
|
int g = 0xff * ((~data >> 1) & 1);
|
||||||
|
int b = 0xff * ((~data >> 2) & 1);
|
||||||
|
|
||||||
if (~data & 0x08) /* alternate = 1 */
|
if (~data & 0x08) /* alternate = 1 */
|
||||||
{
|
{
|
||||||
@ -242,11 +231,32 @@ WRITE8_HANDLER( centiped_paletteram_w )
|
|||||||
else if (g) g = 0xc0;
|
else if (g) g = 0xc0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* bit 2 of the output palette RAM is always pulled high, so we ignore */
|
color = MAKE_RGB(r, g, b);
|
||||||
/* any palette changes unless the write is to a palette RAM address */
|
|
||||||
/* that is actually used */
|
/* character colors, set directly */
|
||||||
if (offset & 4)
|
if ((offset & 0x08) == 0)
|
||||||
palette_set_color(Machine, ((offset >> 1) & 4) | (offset & 3), MAKE_RGB(r, g, b));
|
palette_set_color(Machine, offset & 0x03, color);
|
||||||
|
|
||||||
|
/* sprite colors - set all the applicable ones */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
offset = offset & 0x03;
|
||||||
|
|
||||||
|
for (i = 0; i < 0x100; i += 4)
|
||||||
|
{
|
||||||
|
if (offset == ((i >> 2) & 0x03))
|
||||||
|
palette_set_color(Machine, i + 4 + 1, color);
|
||||||
|
|
||||||
|
if (offset == ((i >> 4) & 0x03))
|
||||||
|
palette_set_color(Machine, i + 4 + 2, color);
|
||||||
|
|
||||||
|
if (offset == ((i >> 6) & 0x03))
|
||||||
|
palette_set_color(Machine, i + 4 + 3, color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -265,31 +275,34 @@ WRITE8_HANDLER( centiped_paletteram_w )
|
|||||||
|
|
||||||
PALETTE_INIT( warlords )
|
PALETTE_INIT( warlords )
|
||||||
{
|
{
|
||||||
int i, j;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < machine->drv->total_colors; i++)
|
for (i = 0; i < machine->drv->total_colors; i++)
|
||||||
{
|
{
|
||||||
int r = ((*color_prom >> 2) & 0x01) * 0xff;
|
UINT8 pen;
|
||||||
int g = ((*color_prom >> 1) & 0x01) * 0xff;
|
int r, g, b;
|
||||||
int b = ((*color_prom >> 0) & 0x01) * 0xff;
|
|
||||||
|
|
||||||
/* Colors 0x40-0x7f are converted to grey scale as it's used on the
|
if (i < 0x20)
|
||||||
|
/* characters */
|
||||||
|
pen = (((i - 0x00) & 0x1c) << 2) | (((i - 0x00) & 0x03) << 0);
|
||||||
|
else
|
||||||
|
/* sprites */
|
||||||
|
pen = (((i - 0x20) & 0x1c) << 2) | (((i - 0x20) & 0x03) << 2);
|
||||||
|
|
||||||
|
r = ((color_prom[pen] >> 2) & 0x01) * 0xff;
|
||||||
|
g = ((color_prom[pen] >> 1) & 0x01) * 0xff;
|
||||||
|
b = ((color_prom[pen] >> 0) & 0x01) * 0xff;
|
||||||
|
|
||||||
|
/* colors 0x40-0x7f are converted to grey scale as it's used on the
|
||||||
upright version that had an overlay */
|
upright version that had an overlay */
|
||||||
if (i >= machine->drv->total_colors / 2)
|
if (pen >= 0x40)
|
||||||
{
|
{
|
||||||
/* Use the standard ratios: r = 30%, g = 59%, b = 11% */
|
/* use the standard ratios: r = 30%, g = 59%, b = 11% */
|
||||||
int grey = (r * 0x4d / 0xff) + (g * 0x96 / 0xff) + (b * 0x1c / 0xff);
|
int grey = (r * 0x4d / 0xff) + (g * 0x96 / 0xff) + (b * 0x1c / 0xff);
|
||||||
r = g = b = grey;
|
r = g = b = grey;
|
||||||
}
|
}
|
||||||
palette_set_color(machine,i,MAKE_RGB(r,g,b));
|
|
||||||
color_prom++;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 8; i++)
|
palette_set_color(machine, i, MAKE_RGB(r, g, b));
|
||||||
for (j = 0; j < 4; j++)
|
|
||||||
{
|
|
||||||
COLOR(0,i*4+j) = i*16+j;
|
|
||||||
COLOR(1,i*4+j) = i*16+j*4;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,43 +322,21 @@ PALETTE_INIT( warlords )
|
|||||||
blue
|
blue
|
||||||
bit 0 blue
|
bit 0 blue
|
||||||
|
|
||||||
|
Millipede is unusual because the sprite color code specifies the
|
||||||
|
colors to use one by one, instead of a combination code.
|
||||||
|
bit 7-6 = palette bank (there are 4 groups of 4 colors)
|
||||||
|
bit 5-4 = color to use for pen 11
|
||||||
|
bit 3-2 = color to use for pen 10
|
||||||
|
bit 1-0 = color to use for pen 01
|
||||||
|
pen 00 is transparent
|
||||||
|
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
PALETTE_INIT( milliped )
|
static void melliped_mazeinv_set_color(running_machine *machine, offs_t offset, UINT8 data)
|
||||||
{
|
{
|
||||||
int i;
|
rgb_t color;
|
||||||
|
int bit0, bit1, bit2;
|
||||||
/* characters use colors 0-15 */
|
int r, g, b;
|
||||||
for (i = 0; i < TOTAL_COLORS(0); i++)
|
|
||||||
COLOR(0,i) = i;
|
|
||||||
|
|
||||||
/* Millipede is unusual because the sprite color code specifies the */
|
|
||||||
/* colors to use one by one, instead of a combination code. */
|
|
||||||
/* bit 7-6 = palette bank (there are 4 groups of 4 colors) */
|
|
||||||
/* bit 5-4 = color to use for pen 11 */
|
|
||||||
/* bit 3-2 = color to use for pen 10 */
|
|
||||||
/* bit 1-0 = color to use for pen 01 */
|
|
||||||
/* pen 00 is transparent */
|
|
||||||
for (i = 0; i < TOTAL_COLORS(1); i += 4)
|
|
||||||
{
|
|
||||||
int base = 16 + 4 * ((i >> 8) & 3);
|
|
||||||
COLOR(1,i+0) = 0;
|
|
||||||
COLOR(1,i+1) = base + ((i >> 2) & 3);
|
|
||||||
COLOR(1,i+2) = base + ((i >> 4) & 3);
|
|
||||||
COLOR(1,i+3) = base + ((i >> 6) & 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* create a pen mask for sprite drawing */
|
|
||||||
init_penmask();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
WRITE8_HANDLER( milliped_paletteram_w )
|
|
||||||
{
|
|
||||||
int bit0,bit1,bit2;
|
|
||||||
int r,g,b;
|
|
||||||
|
|
||||||
paletteram[offset] = data;
|
|
||||||
|
|
||||||
/* red component */
|
/* red component */
|
||||||
bit0 = (~data >> 5) & 0x01;
|
bit0 = (~data >> 5) & 0x01;
|
||||||
@ -365,37 +356,50 @@ WRITE8_HANDLER( milliped_paletteram_w )
|
|||||||
bit2 = (~data >> 2) & 0x01;
|
bit2 = (~data >> 2) & 0x01;
|
||||||
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||||
|
|
||||||
palette_set_color(Machine, offset, MAKE_RGB(r, g, b));
|
color = MAKE_RGB(r, g, b);
|
||||||
|
|
||||||
|
/* character colors, set directly */
|
||||||
|
if (offset < 0x10)
|
||||||
|
palette_set_color(machine, offset, color);
|
||||||
|
|
||||||
|
/* sprite colors - set all the applicable ones */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
int base = offset & 0x0c;
|
||||||
|
|
||||||
|
offset = offset & 0x03;
|
||||||
|
|
||||||
|
for (i = (base << 6); i < (base << 6) + 0x100; i += 4)
|
||||||
|
{
|
||||||
|
if (offset == ((i >> 2) & 0x03))
|
||||||
|
palette_set_color(machine, i + 0x10 + 1, color);
|
||||||
|
|
||||||
|
if (offset == ((i >> 4) & 0x03))
|
||||||
|
palette_set_color(machine, i + 0x10 + 2, color);
|
||||||
|
|
||||||
|
if (offset == ((i >> 6) & 0x03))
|
||||||
|
palette_set_color(machine, i + 0x10 + 3, color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
WRITE8_HANDLER( milliped_paletteram_w )
|
||||||
|
{
|
||||||
|
paletteram[offset] = data;
|
||||||
|
|
||||||
|
melliped_mazeinv_set_color(Machine, offset, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WRITE8_HANDLER( mazeinv_paletteram_w )
|
WRITE8_HANDLER( mazeinv_paletteram_w )
|
||||||
{
|
{
|
||||||
int bit0,bit1,bit2;
|
|
||||||
int r,g,b;
|
|
||||||
|
|
||||||
paletteram[offset] = data;
|
paletteram[offset] = data;
|
||||||
data = memory_region(REGION_PROMS)[~data & 0x0f];
|
|
||||||
|
|
||||||
/* red component */
|
/* the value passed in is a look-up index into the color PROM */
|
||||||
bit0 = (data >> 5) & 0x01;
|
melliped_mazeinv_set_color(Machine, offset, ~memory_region(REGION_PROMS)[~data & 0x0f]);
|
||||||
bit1 = (data >> 6) & 0x01;
|
|
||||||
bit2 = (data >> 7) & 0x01;
|
|
||||||
r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
|
||||||
|
|
||||||
/* green component */
|
|
||||||
bit0 = 0;
|
|
||||||
bit1 = (data >> 3) & 0x01;
|
|
||||||
bit2 = (data >> 4) & 0x01;
|
|
||||||
g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
|
||||||
|
|
||||||
/* blue component */
|
|
||||||
bit0 = (data >> 0) & 0x01;
|
|
||||||
bit1 = (data >> 1) & 0x01;
|
|
||||||
bit2 = (data >> 2) & 0x01;
|
|
||||||
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
|
||||||
|
|
||||||
palette_set_color(Machine, offset, MAKE_RGB(r, g, b));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user