summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar mamehaze <mamehaze@users.noreply.github.com>2014-12-01 15:45:26 +0000
committerGravatarGravatar mamehaze <mamehaze@users.noreply.github.com>2014-12-01 15:45:26 +0000
commitd00d8db769db286e38406460ddb682ae779e0f10 (patch) (github)
treef4956946003ba01aeb8851677cae4987f14b4626
parentab9039f120082588a53ccc3ef266c6fedfdb1350 (diff)
downloadmame-d00d8db769db286e38406460ddb682ae779e0f10.tar.bz2
mame-d00d8db769db286e38406460ddb682ae779e0f10.zip
add supduck palette type to emupal.c and use that (nw)
-rw-r--r--src/emu/emupal.c10
-rw-r--r--src/emu/emupal.h6
-rw-r--r--src/mame/drivers/alpha68k.c8
-rw-r--r--src/mame/drivers/supduck.c23
4 files changed, 19 insertions, 28 deletions
diff --git a/src/emu/emupal.c b/src/emu/emupal.c
index b5712fa4b95..0831d50a712 100644
--- a/src/emu/emupal.c
+++ b/src/emu/emupal.c
@@ -927,10 +927,18 @@ rgb_t raw_to_rgb_converter::RRRRGGGGBBBBRGBx_decoder(UINT32 raw)
return rgb_t(r, g, b);
}
-rgb_t raw_to_rgb_converter::xRGBRRRRGGGGBBBB_decoder(UINT32 raw)
+rgb_t raw_to_rgb_converter::xRGBRRRRGGGGBBBB_bit0_decoder(UINT32 raw)
{
UINT8 r = pal5bit(((raw >> 7) & 0x1e) | ((raw >> 14) & 0x01));
UINT8 g = pal5bit(((raw >> 3) & 0x1e) | ((raw >> 13) & 0x01));
UINT8 b = pal5bit(((raw << 1) & 0x1e) | ((raw >> 12) & 0x01));
return rgb_t(r, g, b);
}
+
+rgb_t raw_to_rgb_converter::xRGBRRRRGGGGBBBB_bit4_decoder(UINT32 raw)
+{
+ UINT8 r = pal5bit(((raw >> 8) & 0x0f) | ((raw >> 10) & 0x10));
+ UINT8 g = pal5bit(((raw >> 4) & 0x0f) | ((raw >> 9) & 0x10));
+ UINT8 b = pal5bit(((raw >> 0) & 0x0f) | ((raw >> 8) & 0x10));
+ return rgb_t(r, g, b);
+}
diff --git a/src/emu/emupal.h b/src/emu/emupal.h
index e8e0ebaf3a5..e11510745b0 100644
--- a/src/emu/emupal.h
+++ b/src/emu/emupal.h
@@ -143,7 +143,8 @@
#define PALETTE_FORMAT_RRRRRGGGGGBBBBBx raw_to_rgb_converter(2, &raw_to_rgb_converter::standard_rgb_decoder<5,5,5, 11,6,1>)
#define PALETTE_FORMAT_GGGGGRRRRRBBBBBx raw_to_rgb_converter(2, &raw_to_rgb_converter::standard_rgb_decoder<5,5,5, 6,11,1>)
#define PALETTE_FORMAT_RRRRGGGGBBBBRGBx raw_to_rgb_converter(2, &raw_to_rgb_converter::RRRRGGGGBBBBRGBx_decoder)
-#define PALETTE_FORMAT_xRGBRRRRGGGGBBBB raw_to_rgb_converter(2, &raw_to_rgb_converter::xRGBRRRRGGGGBBBB_decoder)
+#define PALETTE_FORMAT_xRGBRRRRGGGGBBBB_bit0 raw_to_rgb_converter(2, &raw_to_rgb_converter::xRGBRRRRGGGGBBBB_bit0_decoder)
+#define PALETTE_FORMAT_xRGBRRRRGGGGBBBB_bit4 raw_to_rgb_converter(2, &raw_to_rgb_converter::xRGBRRRRGGGGBBBB_bit4_decoder)
// standard 5-6-5 formats
#define PALETTE_FORMAT_RRRRRGGGGGGBBBBB raw_to_rgb_converter(2, &raw_to_rgb_converter::standard_rgb_decoder<5,6,5, 11,5,0>)
@@ -307,7 +308,8 @@ public:
static rgb_t BBGGRRII_decoder(UINT32 raw);
static rgb_t IRRRRRGGGGGBBBBB_decoder(UINT32 raw);
static rgb_t RRRRGGGGBBBBRGBx_decoder(UINT32 raw); // bits 3/2/1 are LSb
- static rgb_t xRGBRRRRGGGGBBBB_decoder(UINT32 raw); // bits 14/13/12 are LSb
+ static rgb_t xRGBRRRRGGGGBBBB_bit0_decoder(UINT32 raw); // bits 14/13/12 are LSb
+ static rgb_t xRGBRRRRGGGGBBBB_bit4_decoder(UINT32 raw); // bits 14/13/12 are MSb
private:
// internal data
diff --git a/src/mame/drivers/alpha68k.c b/src/mame/drivers/alpha68k.c
index 74f5f6a4bcb..0cc70ee6b8a 100644
--- a/src/mame/drivers/alpha68k.c
+++ b/src/mame/drivers/alpha68k.c
@@ -2098,7 +2098,7 @@ static MACHINE_CONFIG_START( alpha68k_II, alpha68k_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", alpha68k_II)
MCFG_PALETTE_ADD("palette", 2048)
- MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB)
+ MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB_bit0)
MCFG_VIDEO_START_OVERRIDE(alpha68k_state,alpha68k)
@@ -2151,7 +2151,7 @@ static MACHINE_CONFIG_START( alpha68k_II_gm, alpha68k_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", alpha68k_II)
MCFG_PALETTE_ADD("palette", 2048)
- MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB)
+ MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB_bit0)
MCFG_VIDEO_START_OVERRIDE(alpha68k_state,alpha68k)
@@ -2197,7 +2197,7 @@ static MACHINE_CONFIG_START( alpha68k_V, alpha68k_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", alpha68k_V)
MCFG_PALETTE_ADD("palette", 4096)
- MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB)
+ MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB_bit0)
MCFG_VIDEO_START_OVERRIDE(alpha68k_state,alpha68k)
@@ -2243,7 +2243,7 @@ static MACHINE_CONFIG_START( alpha68k_V_sb, alpha68k_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", alpha68k_V)
MCFG_PALETTE_ADD("palette", 4096)
- MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB)
+ MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB_bit0)
MCFG_VIDEO_START_OVERRIDE(alpha68k_state,alpha68k)
diff --git a/src/mame/drivers/supduck.c b/src/mame/drivers/supduck.c
index 68e9a6fe6cb..d4c8d7486ac 100644
--- a/src/mame/drivers/supduck.c
+++ b/src/mame/drivers/supduck.c
@@ -36,7 +36,6 @@ public:
m_text_videoram(*this, "textvideoram"),
m_fore_videoram(*this, "forevideoram"),
m_back_videoram(*this, "backvideoram"),
- m_paletteram(*this, "paletteram"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette")
{ }
@@ -50,7 +49,6 @@ public:
required_shared_ptr<UINT16> m_text_videoram;
required_shared_ptr<UINT16> m_fore_videoram;
required_shared_ptr<UINT16> m_back_videoram;
- required_shared_ptr<UINT16> m_paletteram;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
@@ -68,7 +66,6 @@ public:
DECLARE_WRITE16_MEMBER(supduck_4000_w);
DECLARE_WRITE16_MEMBER(supduck_4002_w);
- DECLARE_WRITE16_MEMBER(supduck_paletteram_w);
TILEMAP_MAPPER_MEMBER(supduk_tilemap_scan);
@@ -245,22 +242,6 @@ WRITE16_MEMBER(supduck_state::supduck_4000_w)
{
}
-WRITE16_MEMBER(supduck_state::supduck_paletteram_w)
-{
- int r, g, b;
- data = COMBINE_DATA(&m_paletteram[offset]);
-
- r = ((data >> 8) & 0x0f);
- if (data & 0x4000) r |= 0x10;
-
- g = ((data >> 4 ) & 0x0f);
- if (data & 0x2000) g |= 0x10;
-
- b = ((data >> 0 ) & 0x0f);
- if (data & 0x1000) b |= 0x10;
-
- m_palette->set_pen_color (offset, rgb_t(r<<3, g<<3, b<<3));
-}
WRITE16_MEMBER(supduck_state::supduck_4002_w)
{
@@ -308,7 +289,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, supduck_state )
AM_RANGE(0xfec000, 0xfecfff) AM_RAM_WRITE(text_videoram_w) AM_SHARE("textvideoram")
AM_RANGE(0xff0000, 0xff3fff) AM_RAM_WRITE(back_videoram_w) AM_SHARE("backvideoram")
AM_RANGE(0xff4000, 0xff7fff) AM_RAM_WRITE(fore_videoram_w) AM_SHARE("forevideoram")
- AM_RANGE(0xff8000, 0xff87ff) AM_RAM_WRITE(supduck_paletteram_w) AM_SHARE("paletteram") // AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
+ AM_RANGE(0xff8000, 0xff87ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0xffc000, 0xffffff) AM_RAM /* working RAM */
ADDRESS_MAP_END
@@ -510,7 +491,7 @@ static MACHINE_CONFIG_START( supduck, supduck_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", supduck)
MCFG_PALETTE_ADD("palette", 0x800/2)
-// MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB) // can't use this, the RGB bits are the lowest bits with this format, for this game they're the highest bits
+ MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB_bit4)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")