mirror of
https://github.com/holub/mame
synced 2025-04-24 01:11:11 +03:00
Merge pull request #1379 from MASHinfo/master
Fixed palette in Battles (set 1)
This commit is contained in:
commit
09e007a939
@ -1862,10 +1862,6 @@ static MACHINE_CONFIG_DERIVED( battles, xevious )
|
||||
|
||||
MCFG_MACHINE_RESET_OVERRIDE(xevious_state,battles)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_PALETTE_MODIFY("palette")
|
||||
MCFG_PALETTE_INIT_OWNER(xevious_state,battles)
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_DEVICE_REMOVE("discrete")
|
||||
|
||||
|
@ -34,7 +34,6 @@ public:
|
||||
DECLARE_VIDEO_START(xevious);
|
||||
DECLARE_PALETTE_INIT(xevious);
|
||||
DECLARE_MACHINE_RESET(xevios);
|
||||
DECLARE_PALETTE_INIT(battles);
|
||||
DECLARE_MACHINE_RESET(battles);
|
||||
UINT32 screen_update_xevious(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(battles_interrupt_4);
|
||||
|
@ -97,78 +97,6 @@ PALETTE_INIT_MEMBER(xevious_state,xevious)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
PALETTE_INIT_MEMBER(xevious_state,battles)
|
||||
{
|
||||
const UINT8 *color_prom = memregion("proms")->base();
|
||||
int i;
|
||||
|
||||
for (i = 0;i < 128;i++)
|
||||
{
|
||||
int bit0,bit1,bit2,bit3,r,g,b;
|
||||
|
||||
/* red component */
|
||||
bit0 = (color_prom[0] >> 0) & 0x01;
|
||||
bit1 = (color_prom[0] >> 1) & 0x01;
|
||||
bit2 = (color_prom[0] >> 2) & 0x01;
|
||||
bit3 = (color_prom[0] >> 3) & 0x01;
|
||||
r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
|
||||
/* green component */
|
||||
bit0 = (color_prom[256] >> 0) & 0x01;
|
||||
bit1 = (color_prom[256] >> 1) & 0x01;
|
||||
bit2 = (color_prom[256] >> 2) & 0x01;
|
||||
bit3 = (color_prom[256] >> 3) & 0x01;
|
||||
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
|
||||
/* blue component */
|
||||
bit0 = (color_prom[2*256] >> 0) & 0x01;
|
||||
bit1 = (color_prom[2*256] >> 1) & 0x01;
|
||||
bit2 = (color_prom[2*256] >> 2) & 0x01;
|
||||
bit3 = (color_prom[2*256] >> 3) & 0x01;
|
||||
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
|
||||
|
||||
palette.set_indirect_color(i,rgb_t(r,g,b));
|
||||
color_prom++;
|
||||
}
|
||||
|
||||
/* color 0x80 is used by sprites to mark transparency */
|
||||
palette.set_indirect_color(0x80,rgb_t(0,0,0));
|
||||
|
||||
color_prom += 128; /* the bottom part of the PROM is unused */
|
||||
color_prom += 2*256;
|
||||
/* color_prom now points to the beginning of the lookup table */
|
||||
|
||||
/* background tiles */
|
||||
for (i = 0;i < TOTAL_COLORS(1);i++)
|
||||
{
|
||||
palette.set_pen_indirect(m_gfxdecode->gfx(1)->colorbase() + i,
|
||||
(color_prom[0] & 0x0f) | ((color_prom[0x400] & 0x0f) << 4));
|
||||
|
||||
color_prom++;
|
||||
}
|
||||
color_prom += 0x600;
|
||||
|
||||
/* sprites */
|
||||
for (i = 0;i < TOTAL_COLORS(2);i++)
|
||||
{
|
||||
int c = (color_prom[0] & 0x0f) | ((color_prom[0x400] & 0x0f) << 4);
|
||||
|
||||
palette.set_pen_indirect(m_gfxdecode->gfx(2)->colorbase() + i,
|
||||
(c & 0x80) ? (c & 0x7f) : 0x80);
|
||||
|
||||
color_prom++;
|
||||
}
|
||||
|
||||
/* foreground characters */
|
||||
for (i = 0;i < TOTAL_COLORS(0);i++)
|
||||
{
|
||||
palette.set_pen_indirect(m_gfxdecode->gfx(0)->colorbase() + i,
|
||||
(i % 2 != 0) ? (i / 2) : 0x80);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Callbacks for the TileMap code
|
||||
|
Loading…
Reference in New Issue
Block a user