tnzs.c and related drivers: fix generic_paletteram regression (nw)

This commit is contained in:
Alex W. Jackson 2014-04-24 17:51:40 +00:00
parent 6f79738d7c
commit b112d3261d
4 changed files with 7 additions and 31 deletions

View File

@ -927,8 +927,8 @@ rgb_t raw_to_rgb_converter::RRRRGGGGBBBBRGBx_decoder(UINT32 raw)
rgb_t raw_to_rgb_converter::xRGBRRRRGGGGBBBB_decoder(UINT32 raw) rgb_t raw_to_rgb_converter::xRGBRRRRGGGGBBBB_decoder(UINT32 raw)
{ {
UINT8 r = pal5bit(((raw >> 8) & 0x1e) | ((raw >> 12) & 0x01)); UINT8 r = pal5bit(((raw >> 8) & 0x1e) | ((raw >> 14) & 0x01));
UINT8 g = pal5bit(((raw >> 4) & 0x1e) | ((raw >> 13) & 0x01)); UINT8 g = pal5bit(((raw >> 4) & 0x1e) | ((raw >> 13) & 0x01));
UINT8 b = pal5bit(((raw >> 0) & 0x1e) | ((raw >> 14) & 0x01)); UINT8 b = pal5bit(((raw >> 0) & 0x1e) | ((raw >> 12) & 0x01));
return rgb_t(r, g, b); return rgb_t(r, g, b);
} }

View File

@ -125,6 +125,7 @@
#define PALETTE_FORMAT_xxxxRRRRBBBBGGGG raw_to_rgb_converter(2, &raw_to_rgb_converter::standard_rgb_decoder<4,4,4, 8,0,4>) #define PALETTE_FORMAT_xxxxRRRRBBBBGGGG raw_to_rgb_converter(2, &raw_to_rgb_converter::standard_rgb_decoder<4,4,4, 8,0,4>)
#define PALETTE_FORMAT_xxxxRRRRGGGGBBBB raw_to_rgb_converter(2, &raw_to_rgb_converter::standard_rgb_decoder<4,4,4, 8,4,0>) #define PALETTE_FORMAT_xxxxRRRRGGGGBBBB raw_to_rgb_converter(2, &raw_to_rgb_converter::standard_rgb_decoder<4,4,4, 8,4,0>)
#define PALETTE_FORMAT_RRRRGGGGBBBBxxxx raw_to_rgb_converter(2, &raw_to_rgb_converter::standard_rgb_decoder<4,4,4, 12,8,4>) #define PALETTE_FORMAT_RRRRGGGGBBBBxxxx raw_to_rgb_converter(2, &raw_to_rgb_converter::standard_rgb_decoder<4,4,4, 12,8,4>)
#define PALETTE_FORMAT_GGGGBBBBRRRRxxxx raw_to_rgb_converter(2, &raw_to_rgb_converter::standard_rgb_decoder<4,4,4, 4,12,8>)
// standard 4-4-4-4 formats // standard 4-4-4-4 formats
#define PALETTE_FORMAT_IIIIRRRRGGGGBBBB raw_to_rgb_converter(2, &raw_to_rgb_converter::standard_irgb_decoder<4,4,4,4, 12,8,4,0>) #define PALETTE_FORMAT_IIIIRRRRGGGGBBBB raw_to_rgb_converter(2, &raw_to_rgb_converter::standard_irgb_decoder<4,4,4,4, 12,8,4,0>)

View File

@ -863,26 +863,6 @@ static ADDRESS_MAP_START( i8742_io_map, AS_IO, 8, tnzs_state )
ADDRESS_MAP_END ADDRESS_MAP_END
WRITE8_MEMBER(tnzs_state::jpopnics_palette_w)
{
int r, g, b;
UINT16 paldata;
m_generic_paletteram_8[offset] = data;
offset = offset >> 1;
paldata = (m_generic_paletteram_8[offset * 2] << 8) | m_generic_paletteram_8[(offset * 2 + 1)];
g = (paldata >> 12) & 0x000f;
r = (paldata >> 4) & 0x000f;
b = (paldata >> 8) & 0x000f;
// the other bits seem to be used, and the colours are wrong..
m_palette->set_pen_color(offset, r << 4, g << 4, b << 4);
}
static ADDRESS_MAP_START( jpopnics_main_map, AS_PROGRAM, 8, tnzs_state ) static ADDRESS_MAP_START( jpopnics_main_map, AS_PROGRAM, 8, tnzs_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_READWRITE( tnzs_ramrom_bank_r, tnzs_ramrom_bank_w ) AM_RANGE(0x8000, 0xbfff) AM_READWRITE( tnzs_ramrom_bank_r, tnzs_ramrom_bank_w )
@ -893,7 +873,7 @@ static ADDRESS_MAP_START( jpopnics_main_map, AS_PROGRAM, 8, tnzs_state )
AM_RANGE(0xf300, 0xf303) AM_MIRROR(0xfc) AM_DEVWRITE("spritegen", seta001_device, spritectrl_w8) /* control registers (0x80 mirror used by Arkanoid 2) */ AM_RANGE(0xf300, 0xf303) AM_MIRROR(0xfc) AM_DEVWRITE("spritegen", seta001_device, spritectrl_w8) /* control registers (0x80 mirror used by Arkanoid 2) */
AM_RANGE(0xf400, 0xf400) AM_DEVWRITE("spritegen", seta001_device, spritebgflag_w8) /* enable / disable background transparency */ AM_RANGE(0xf400, 0xf400) AM_DEVWRITE("spritegen", seta001_device, spritebgflag_w8) /* enable / disable background transparency */
AM_RANGE(0xf600, 0xf600) AM_READNOP AM_WRITE(tnzs_ramrom_bankswitch_w) AM_RANGE(0xf600, 0xf600) AM_READNOP AM_WRITE(tnzs_ramrom_bankswitch_w)
AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(jpopnics_palette_w) AM_SHARE("paletteram") AM_RANGE(0xf800, 0xffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
ADDRESS_MAP_END ADDRESS_MAP_END
WRITE8_MEMBER(tnzs_state::jpopnics_subbankswitch_w) WRITE8_MEMBER(tnzs_state::jpopnics_subbankswitch_w)
@ -1926,7 +1906,8 @@ static MACHINE_CONFIG_START( jpopnics, tnzs_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", tnzs) MCFG_GFXDECODE_ADD("gfxdecode", "palette", tnzs)
MCFG_PALETTE_ADD("palette", 1024) MCFG_PALETTE_ADD("palette", 1024)
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) MCFG_PALETTE_FORMAT(GGGGBBBBRRRRxxxx) /* wrong, the other 4 bits seem to be used as well */
MCFG_PALETTE_ENDIANNESS(ENDIANNESS_BIG)
/* sound hardware */ /* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SPEAKER_STANDARD_MONO("mono")

View File

@ -31,11 +31,7 @@ public:
m_seta001(*this, "spritegen"), m_seta001(*this, "spritegen"),
m_dac(*this, "dac"), m_dac(*this, "dac"),
m_samples(*this, "samples"), m_samples(*this, "samples"),
m_palette(*this, "palette"), m_palette(*this, "palette") { }
m_generic_paletteram_8(*this, "paletteram") { }
/* memory pointers */
// UINT8 * m_paletteram; // currently this uses generic palette handling
/* video-related */ /* video-related */
int m_screenflip; int m_screenflip;
@ -69,7 +65,6 @@ public:
optional_device<cpu_device> m_subcpu; optional_device<cpu_device> m_subcpu;
optional_device<upi41_cpu_device> m_mcu; optional_device<upi41_cpu_device> m_mcu;
DECLARE_WRITE8_MEMBER(tnzsb_sound_command_w); DECLARE_WRITE8_MEMBER(tnzsb_sound_command_w);
DECLARE_WRITE8_MEMBER(jpopnics_palette_w);
DECLARE_WRITE8_MEMBER(jpopnics_subbankswitch_w); DECLARE_WRITE8_MEMBER(jpopnics_subbankswitch_w);
DECLARE_READ8_MEMBER(tnzs_port1_r); DECLARE_READ8_MEMBER(tnzs_port1_r);
DECLARE_READ8_MEMBER(tnzs_port2_r); DECLARE_READ8_MEMBER(tnzs_port2_r);
@ -122,5 +117,4 @@ public:
optional_device<dac_device> m_dac; optional_device<dac_device> m_dac;
optional_device<samples_device> m_samples; optional_device<samples_device> m_samples;
required_device<palette_device> m_palette; required_device<palette_device> m_palette;
required_shared_ptr<UINT8> m_generic_paletteram_8;
}; };