summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Dirk Best <mail@dirk-best.de>2017-09-22 13:19:01 +0200
committerGravatarGravatar Dirk Best <mail@dirk-best.de>2017-09-22 13:19:01 +0200
commitff82930d50611586228dd0bdb093ae5a51348e4a (patch)
tree42850bace54a15410a2d9ff1d72ac67ea009bc27
parent0b2603cd46743301cd801c7c24c3518ddca3d527 (diff)
downloadmame-ff82930d50611586228dd0bdb093ae5a51348e4a.zip
mame-ff82930d50611586228dd0bdb093ae5a51348e4a.tar.bz2
deco156: Palette cleanup
-rw-r--r--src/mame/drivers/deco156.cpp30
1 files changed, 5 insertions, 25 deletions
diff --git a/src/mame/drivers/deco156.cpp b/src/mame/drivers/deco156.cpp
index d909e9c..3cb1cdd 100644
--- a/src/mame/drivers/deco156.cpp
+++ b/src/mame/drivers/deco156.cpp
@@ -35,8 +35,7 @@ public:
m_oki1(*this, "oki1"),
m_oki2(*this, "oki2"),
m_sprgen(*this, "spritegen"),
- m_palette(*this, "palette"),
- m_generic_paletteram_32(*this, "paletteram")
+ m_palette(*this, "palette")
{ }
/* devices */
@@ -46,7 +45,6 @@ public:
optional_device<okim6295_device> m_oki2;
optional_device<decospr_device> m_sprgen;
required_device<palette_device> m_palette;
- required_shared_ptr<uint32_t> m_generic_paletteram_32;
/* memory */
uint16_t m_pf1_rowscroll[0x800/2];
@@ -116,26 +114,6 @@ WRITE32_MEMBER(deco156_state::hvysmsh_oki_0_bank_w)
m_oki1->set_rom_bank(data & 1);
}
-WRITE32_MEMBER(deco156_state::wcvol95_nonbuffered_palette_w)
-{
- COMBINE_DATA(&m_generic_paletteram_32[offset]);
- m_palette->set_pen_color(offset,pal5bit(m_generic_paletteram_32[offset] >> 0),pal5bit(m_generic_paletteram_32[offset] >> 5),pal5bit(m_generic_paletteram_32[offset] >> 10));
-}
-
-/* This is the same as deco32_nonbuffered_palette_w in video/deco32.c */
-WRITE32_MEMBER(deco156_state::deco156_nonbuffered_palette_w)
-{
- int r,g,b;
-
- COMBINE_DATA(&m_generic_paletteram_32[offset]);
-
- b = (m_generic_paletteram_32[offset] >>16) & 0xff;
- g = (m_generic_paletteram_32[offset] >> 8) & 0xff;
- r = (m_generic_paletteram_32[offset] >> 0) & 0xff;
-
- m_palette->set_pen_color(offset,rgb_t(r,g,b));
-}
-
READ32_MEMBER(deco156_state::wcvol95_pf1_rowscroll_r){ return m_pf1_rowscroll[offset] ^ 0xffff0000; }
READ32_MEMBER(deco156_state::wcvol95_pf2_rowscroll_r){ return m_pf2_rowscroll[offset] ^ 0xffff0000; }
READ32_MEMBER(deco156_state::wcvol95_spriteram_r){ return m_spriteram[offset] ^ 0xffff0000; }
@@ -159,7 +137,7 @@ static ADDRESS_MAP_START( hvysmsh_map, AS_PROGRAM, 32, deco156_state )
AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
AM_RANGE(0x1a0000, 0x1a0fff) AM_READWRITE(wcvol95_pf1_rowscroll_r, wcvol95_pf1_rowscroll_w)
AM_RANGE(0x1a4000, 0x1a4fff) AM_READWRITE(wcvol95_pf2_rowscroll_r, wcvol95_pf2_rowscroll_w)
- AM_RANGE(0x1c0000, 0x1c0fff) AM_RAM_WRITE(deco156_nonbuffered_palette_w) AM_SHARE("paletteram")
+ AM_RANGE(0x1c0000, 0x1c0fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x1d0010, 0x1d002f) AM_READNOP // Check for DMA complete?
AM_RANGE(0x1e0000, 0x1e1fff) AM_READWRITE(wcvol95_spriteram_r, wcvol95_spriteram_w)
ADDRESS_MAP_END
@@ -176,7 +154,7 @@ static ADDRESS_MAP_START( wcvol95_map, AS_PROGRAM, 32, deco156_state )
AM_RANGE(0x150000, 0x150003) AM_WRITE_PORT("EEPROMOUT")
AM_RANGE(0x160000, 0x161fff) AM_READWRITE(wcvol95_spriteram_r, wcvol95_spriteram_w)
AM_RANGE(0x170000, 0x170003) AM_NOP // Irq ack?
- AM_RANGE(0x180000, 0x180fff) AM_RAM_WRITE(wcvol95_nonbuffered_palette_w) AM_SHARE("paletteram")
+ AM_RANGE(0x180000, 0x180fff) AM_READONLY AM_DEVWRITE16("palette", palette_device, write, 0x0000ffff) AM_SHARE("palette")
AM_RANGE(0x1a0000, 0x1a0007) AM_DEVREADWRITE8("ymz", ymz280b_device, read, write, 0x000000ff)
ADDRESS_MAP_END
@@ -357,6 +335,7 @@ static MACHINE_CONFIG_START( hvysmsh )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", hvysmsh)
MCFG_PALETTE_ADD("palette", 1024)
+ MCFG_PALETTE_FORMAT(XBGR)
MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0)
MCFG_DECO16IC_SPLIT(0)
@@ -408,6 +387,7 @@ static MACHINE_CONFIG_START( wcvol95 )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", hvysmsh)
MCFG_PALETTE_ADD("palette", 1024)
+ MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0)
MCFG_DECO16IC_SPLIT(0)