mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
emupal.c: add support for RAM-based palettes with indirect lookups. Update various drivers to use it [Alex Jackson]
This commit is contained in:
parent
69e0d908a7
commit
93fe9d00c4
37 changed files with 95 additions and 268 deletions
|
@ -291,21 +291,27 @@ void palette_device::set_shadow_dRGB32(int mode, int dr, int dg, int db, bool no
|
|||
// potentially modified palette entries
|
||||
//-------------------------------------------------
|
||||
|
||||
inline void palette_device::update_for_write(offs_t byte_offset, int bytes_modified)
|
||||
inline void palette_device::update_for_write(offs_t byte_offset, int bytes_modified, bool indirect)
|
||||
{
|
||||
assert((m_indirect_entries != 0) == indirect);
|
||||
|
||||
// determine how many entries were modified
|
||||
int bpe = m_paletteram.bytes_per_entry();
|
||||
assert(bpe != 0);
|
||||
int count = (bytes_modified + bpe - 1) / bpe;
|
||||
|
||||
// for each entry modified, fetch the palette data and set the pen color
|
||||
// for each entry modified, fetch the palette data and set the pen color or indirect color
|
||||
offs_t base = byte_offset / bpe;
|
||||
for (int index = 0; index < count; index++)
|
||||
{
|
||||
UINT32 data = m_paletteram.read(base + index);
|
||||
if (m_paletteram_ext.base() != NULL)
|
||||
data |= m_paletteram_ext.read(base + index) << (8 * bpe);
|
||||
m_palette->entry_set_color(base + index, m_raw_to_rgb(data));
|
||||
|
||||
if (indirect)
|
||||
set_indirect_color(base + index, m_raw_to_rgb(data));
|
||||
else
|
||||
m_palette->entry_set_color(base + index, m_raw_to_rgb(data));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -367,6 +373,30 @@ WRITE16_MEMBER(palette_device::write_ext)
|
|||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// write_indirect - write a byte to the base
|
||||
// paletteram, updating indirect colors
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE8_MEMBER(palette_device::write_indirect)
|
||||
{
|
||||
m_paletteram.write8(offset, data);
|
||||
update_for_write(offset, 1, true);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// write_ext - write a byte to the extended
|
||||
// paletteram, updating indirect colors
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE8_MEMBER(palette_device::write_indirect_ext)
|
||||
{
|
||||
m_paletteram_ext.write8(offset, data);
|
||||
update_for_write(offset, 1, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE MANAGEMENT
|
||||
|
|
|
@ -369,6 +369,8 @@ public:
|
|||
DECLARE_READ8_MEMBER(read);
|
||||
DECLARE_WRITE8_MEMBER(write);
|
||||
DECLARE_WRITE8_MEMBER(write_ext);
|
||||
DECLARE_WRITE8_MEMBER(write_indirect);
|
||||
DECLARE_WRITE8_MEMBER(write_indirect_ext);
|
||||
DECLARE_READ16_MEMBER(read);
|
||||
DECLARE_WRITE16_MEMBER(write);
|
||||
DECLARE_WRITE16_MEMBER(write_ext);
|
||||
|
@ -402,7 +404,7 @@ protected:
|
|||
void allocate_color_tables();
|
||||
void allocate_shadow_tables();
|
||||
|
||||
void update_for_write(offs_t byte_offset, int bytes_modified);
|
||||
void update_for_write(offs_t byte_offset, int bytes_modified, bool indirect = false);
|
||||
public: // needed by konamigx
|
||||
void set_shadow_dRGB32(int mode, int dr, int dg, int db, bool noclip);
|
||||
protected:
|
||||
|
|
|
@ -117,7 +117,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, bladestl_state )
|
|||
AM_RANGE(0x0000, 0x1fff) AM_DEVREADWRITE("k007342", k007342_device, read, write) /* Color RAM + Video RAM */
|
||||
AM_RANGE(0x2000, 0x21ff) AM_DEVREADWRITE("k007420", k007420_device, read, write) /* Sprite RAM */
|
||||
AM_RANGE(0x2200, 0x23ff) AM_DEVREADWRITE("k007342", k007342_device, scroll_r, scroll_w) /* Scroll RAM */
|
||||
AM_RANGE(0x2400, 0x245f) AM_RAM AM_SHARE("paletteram") /* palette */
|
||||
AM_RANGE(0x2400, 0x245f) AM_RAM_DEVWRITE("palette", palette_device, write_indirect) AM_SHARE("palette") /* palette */
|
||||
AM_RANGE(0x2600, 0x2607) AM_DEVWRITE("k007342", k007342_device, vreg_w) /* Video Registers */
|
||||
AM_RANGE(0x2e00, 0x2e00) AM_READ_PORT("COINSW") /* DIPSW #3, coinsw, startsw */
|
||||
AM_RANGE(0x2e01, 0x2e01) AM_READ_PORT("P1") /* 1P controls */
|
||||
|
@ -326,6 +326,7 @@ static MACHINE_CONFIG_START( bladestl, bladestl_state )
|
|||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", bladestl)
|
||||
MCFG_PALETTE_ADD("palette", 32 + 16*16)
|
||||
MCFG_PALETTE_INDIRECT_ENTRIES(32+16)
|
||||
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
|
||||
MCFG_PALETTE_INIT_OWNER(bladestl_state, bladestl)
|
||||
|
||||
MCFG_K007342_ADD("k007342")
|
||||
|
|
|
@ -364,7 +364,7 @@ static ADDRESS_MAP_START( combatsc_map, AS_PROGRAM, 8, combatsc_state )
|
|||
AM_RANGE(0x0418, 0x0418) AM_WRITE(combatsc_sh_irqtrigger_w)
|
||||
AM_RANGE(0x041c, 0x041c) AM_WRITE(watchdog_reset_w) /* watchdog reset? */
|
||||
|
||||
AM_RANGE(0x0600, 0x06ff) AM_RAM AM_SHARE("paletteram") /* palette */
|
||||
AM_RANGE(0x0600, 0x06ff) AM_RAM_DEVWRITE("palette", palette_device, write_indirect) AM_SHARE("palette")
|
||||
AM_RANGE(0x0800, 0x1fff) AM_RAM /* RAM */
|
||||
AM_RANGE(0x2000, 0x3fff) AM_READWRITE(combatsc_video_r, combatsc_video_w)
|
||||
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") /* banked ROM area */
|
||||
|
@ -374,7 +374,7 @@ ADDRESS_MAP_END
|
|||
static ADDRESS_MAP_START( combatscb_map, AS_PROGRAM, 8, combatsc_state )
|
||||
AM_RANGE(0x0000, 0x04ff) AM_RAM
|
||||
AM_RANGE(0x0500, 0x0500) AM_WRITE(combatscb_bankselect_w)
|
||||
AM_RANGE(0x0600, 0x06ff) AM_RAM AM_SHARE("paletteram") /* palette */
|
||||
AM_RANGE(0x0600, 0x06ff) AM_RAM_DEVWRITE("palette", palette_device, write_indirect) AM_SHARE("palette")
|
||||
AM_RANGE(0x0800, 0x1fff) AM_RAM
|
||||
AM_RANGE(0x2000, 0x3fff) AM_READWRITE(combatsc_video_r, combatsc_video_w)
|
||||
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") /* banked ROM/RAM area */
|
||||
|
@ -734,6 +734,8 @@ static MACHINE_CONFIG_START( combatsc, combatsc_state )
|
|||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", combatsc)
|
||||
MCFG_PALETTE_ADD("palette", 8*16*16)
|
||||
MCFG_PALETTE_INDIRECT_ENTRIES(128)
|
||||
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
|
||||
MCFG_PALETTE_ENDIANNESS(ENDIANNESS_LITTLE)
|
||||
MCFG_PALETTE_INIT_OWNER(combatsc_state,combatsc)
|
||||
MCFG_VIDEO_START_OVERRIDE(combatsc_state,combatsc)
|
||||
|
||||
|
@ -782,6 +784,8 @@ static MACHINE_CONFIG_START( combatscb, combatsc_state )
|
|||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", combatscb)
|
||||
MCFG_PALETTE_ADD("palette", 8*16*16)
|
||||
MCFG_PALETTE_INDIRECT_ENTRIES(128)
|
||||
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
|
||||
MCFG_PALETTE_ENDIANNESS(ENDIANNESS_LITTLE)
|
||||
MCFG_PALETTE_INIT_OWNER(combatsc_state,combatscb)
|
||||
MCFG_VIDEO_START_OVERRIDE(combatsc_state,combatscb)
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ static ADDRESS_MAP_START( contra_map, AS_PROGRAM, 8, contra_state )
|
|||
AM_RANGE(0x001e, 0x001e) AM_WRITENOP /* ? */
|
||||
AM_RANGE(0x0060, 0x0067) AM_WRITE(contra_K007121_ctrl_1_w)
|
||||
|
||||
AM_RANGE(0x0c00, 0x0cff) AM_RAM AM_SHARE("paletteram")
|
||||
AM_RANGE(0x0c00, 0x0cff) AM_RAM_DEVWRITE("palette", palette_device, write_indirect) AM_SHARE("palette")
|
||||
|
||||
AM_RANGE(0x1000, 0x1fff) AM_RAM
|
||||
|
||||
|
@ -204,8 +204,11 @@ static MACHINE_CONFIG_START( contra, contra_state )
|
|||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", contra)
|
||||
|
||||
MCFG_PALETTE_ADD("palette", 2*8*16*16)
|
||||
MCFG_PALETTE_INDIRECT_ENTRIES(128)
|
||||
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
|
||||
MCFG_PALETTE_ENDIANNESS(ENDIANNESS_LITTLE)
|
||||
MCFG_PALETTE_INIT_OWNER(contra_state, contra)
|
||||
|
||||
MCFG_K007121_ADD("k007121_1")
|
||||
|
|
|
@ -45,7 +45,8 @@ static ADDRESS_MAP_START( memmap, AS_PROGRAM, 8, darkmist_state )
|
|||
AM_RANGE(0xc806, 0xc806) AM_READ_PORT("DSW1")
|
||||
AM_RANGE(0xc807, 0xc807) AM_READ_PORT("DSW2")
|
||||
AM_RANGE(0xc808, 0xc808) AM_READ_PORT("UNK")
|
||||
AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_SHARE("paletteram")
|
||||
AM_RANGE(0xd000, 0xd0ff) AM_RAM_DEVWRITE("palette", palette_device, write_indirect) AM_SHARE("palette")
|
||||
AM_RANGE(0xd200, 0xd2ff) AM_RAM_DEVWRITE("palette", palette_device, write_indirect_ext) AM_SHARE("palette_ext")
|
||||
AM_RANGE(0xd400, 0xd41f) AM_RAM AM_SHARE("scroll")
|
||||
AM_RANGE(0xd600, 0xd67f) AM_DEVREADWRITE("t5182", t5182_device, sharedram_r, sharedram_w)
|
||||
AM_RANGE(0xd680, 0xd680) AM_DEVWRITE("t5182", t5182_device, sound_irq_w)
|
||||
|
@ -246,6 +247,7 @@ static MACHINE_CONFIG_START( darkmist, darkmist_state )
|
|||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", darkmist)
|
||||
MCFG_PALETTE_ADD("palette", 0x100*4)
|
||||
MCFG_PALETTE_INDIRECT_ENTRIES(256+1)
|
||||
MCFG_PALETTE_FORMAT(xxxxRRRRGGGGBBBB)
|
||||
MCFG_PALETTE_INIT_OWNER(darkmist_state, darkmist)
|
||||
|
||||
/* sound hardware */
|
||||
|
|
|
@ -107,7 +107,7 @@ WRITE8_MEMBER(ddribble_state::ddribble_vlm5030_ctrl_w)
|
|||
static ADDRESS_MAP_START( cpu0_map, AS_PROGRAM, 8, ddribble_state )
|
||||
AM_RANGE(0x0000, 0x0004) AM_WRITE(K005885_0_w) /* video registers (005885 #1) */
|
||||
AM_RANGE(0x0800, 0x0804) AM_WRITE(K005885_1_w) /* video registers (005885 #2) */
|
||||
AM_RANGE(0x1800, 0x187f) AM_RAM AM_SHARE("paletteram") /* palette */
|
||||
AM_RANGE(0x1800, 0x187f) AM_RAM_DEVWRITE("palette", palette_device, write_indirect) AM_SHARE("palette") /* palette */
|
||||
AM_RANGE(0x2000, 0x2fff) AM_RAM_WRITE(ddribble_fg_videoram_w) AM_SHARE("fg_videoram") /* Video RAM 1 */
|
||||
AM_RANGE(0x3000, 0x3fff) AM_RAM AM_SHARE("spriteram_1") /* Object RAM 1 */
|
||||
AM_RANGE(0x4000, 0x5fff) AM_RAM AM_SHARE("sharedram") /* shared RAM with CPU #1 */
|
||||
|
@ -289,6 +289,7 @@ static MACHINE_CONFIG_START( ddribble, ddribble_state )
|
|||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", ddribble)
|
||||
MCFG_PALETTE_ADD("palette", 64 + 256)
|
||||
MCFG_PALETTE_INDIRECT_ENTRIES(64)
|
||||
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
|
||||
MCFG_PALETTE_INIT_OWNER(ddribble_state, ddribble)
|
||||
|
||||
/* sound hardware */
|
||||
|
|
|
@ -84,7 +84,7 @@ static ADDRESS_MAP_START( fastlane_map, AS_PROGRAM, 8, fastlane_state )
|
|||
AM_RANGE(0x0d00, 0x0d0d) AM_READWRITE(fastlane_k1_k007232_r, fastlane_k1_k007232_w) /* 007232 registers (chip 1) */
|
||||
AM_RANGE(0x0e00, 0x0e0d) AM_READWRITE(fastlane_k2_k007232_r, fastlane_k2_k007232_w) /* 007232 registers (chip 2) */
|
||||
AM_RANGE(0x0f00, 0x0f1f) AM_DEVREADWRITE("k051733", k051733_device, read, write) /* 051733 (protection) */
|
||||
AM_RANGE(0x1000, 0x17ff) AM_RAM AM_SHARE("paletteram") /* Palette RAM */
|
||||
AM_RANGE(0x1000, 0x17ff) AM_RAM_DEVWRITE("palette", palette_device, write_indirect) AM_SHARE("palette")
|
||||
AM_RANGE(0x1800, 0x1fff) AM_RAM /* Work RAM */
|
||||
AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(fastlane_vram1_w) AM_SHARE("videoram1") /* Video RAM (chip 1) */
|
||||
AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(fastlane_vram2_w) AM_SHARE("videoram2") /* Video RAM (chip 2) */
|
||||
|
@ -211,6 +211,7 @@ static MACHINE_CONFIG_START( fastlane, fastlane_state )
|
|||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", fastlane)
|
||||
MCFG_PALETTE_ADD("palette", 1024*16)
|
||||
MCFG_PALETTE_INDIRECT_ENTRIES(0x400)
|
||||
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
|
||||
MCFG_PALETTE_INIT_OWNER(fastlane_state, fastlane)
|
||||
|
||||
MCFG_K007121_ADD("k007121")
|
||||
|
|
|
@ -49,7 +49,7 @@ static ADDRESS_MAP_START( hcastle_map, AS_PROGRAM, 8, hcastle_state )
|
|||
AM_RANGE(0x0414, 0x0414) AM_READ_PORT("DSW1")
|
||||
AM_RANGE(0x0415, 0x0415) AM_READ_PORT("DSW2")
|
||||
AM_RANGE(0x0418, 0x0418) AM_READWRITE(hcastle_gfxbank_r, hcastle_gfxbank_w)
|
||||
AM_RANGE(0x0600, 0x06ff) AM_RAM AM_SHARE("paletteram")
|
||||
AM_RANGE(0x0600, 0x06ff) AM_RAM_DEVWRITE("palette", palette_device, write_indirect) AM_SHARE("palette")
|
||||
AM_RANGE(0x0700, 0x1fff) AM_RAM
|
||||
AM_RANGE(0x2000, 0x2fff) AM_RAM_WRITE(hcastle_pf1_video_w) AM_SHARE("pf1_videoram")
|
||||
AM_RANGE(0x3000, 0x3fff) AM_RAM AM_SHARE("spriteram")
|
||||
|
@ -211,6 +211,7 @@ static MACHINE_CONFIG_START( hcastle, hcastle_state )
|
|||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", hcastle)
|
||||
MCFG_PALETTE_ADD("palette", 2*8*16*16)
|
||||
MCFG_PALETTE_INDIRECT_ENTRIES(128)
|
||||
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
|
||||
MCFG_PALETTE_INIT_OWNER(hcastle_state, hcastle)
|
||||
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ ADDRESS_MAP_END
|
|||
|
||||
static ADDRESS_MAP_START( slave_map, AS_PROGRAM, 8, jackal_state )
|
||||
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
|
||||
AM_RANGE(0x4000, 0x43ff) AM_RAM AM_SHARE("paletteram") // self test only checks 0x4000-0x423f, 007327 should actually go up to 4fff
|
||||
AM_RANGE(0x4000, 0x43ff) AM_RAM_DEVWRITE("palette", palette_device, write_indirect) AM_SHARE("palette") // self test only checks 0x4000-0x423f, 007327 should actually go up to 4fff
|
||||
AM_RANGE(0x6000, 0x605f) AM_RAM // SOUND RAM (Self test check 0x6000-605f, 0x7c00-0x7fff)
|
||||
AM_RANGE(0x6060, 0x7fff) AM_RAM AM_SHARE("share1")
|
||||
AM_RANGE(0x8000, 0xffff) AM_ROM
|
||||
|
@ -372,6 +372,8 @@ static MACHINE_CONFIG_START( jackal, jackal_state )
|
|||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", jackal)
|
||||
MCFG_PALETTE_ADD("palette", 0x300)
|
||||
MCFG_PALETTE_INDIRECT_ENTRIES(0x200)
|
||||
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
|
||||
MCFG_PALETTE_ENDIANNESS(ENDIANNESS_LITTLE)
|
||||
MCFG_PALETTE_INIT_OWNER(jackal_state, jackal)
|
||||
|
||||
/* sound hardware */
|
||||
|
|
|
@ -56,7 +56,7 @@ static ADDRESS_MAP_START( labyrunr_map, AS_PROGRAM, 8, labyrunr_state )
|
|||
AM_RANGE(0x0c00, 0x0c00) AM_WRITE(labyrunr_bankswitch_w)
|
||||
AM_RANGE(0x0d00, 0x0d1f) AM_DEVREADWRITE("k051733", k051733_device, read, write)
|
||||
AM_RANGE(0x0e00, 0x0e00) AM_WRITE(watchdog_reset_w)
|
||||
AM_RANGE(0x1000, 0x10ff) AM_RAM AM_SHARE("paletteram")
|
||||
AM_RANGE(0x1000, 0x10ff) AM_RAM_DEVWRITE("palette", palette_device, write_indirect) AM_SHARE("palette")
|
||||
AM_RANGE(0x1800, 0x1fff) AM_RAM
|
||||
AM_RANGE(0x2000, 0x2fff) AM_RAM AM_SHARE("spriteram")
|
||||
AM_RANGE(0x3000, 0x37ff) AM_RAM_WRITE(labyrunr_vram1_w) AM_SHARE("videoram1")
|
||||
|
@ -203,6 +203,7 @@ static MACHINE_CONFIG_START( labyrunr, labyrunr_state )
|
|||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", labyrunr)
|
||||
MCFG_PALETTE_ADD("palette", 2*8*16*16)
|
||||
MCFG_PALETTE_INDIRECT_ENTRIES(128)
|
||||
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
|
||||
MCFG_PALETTE_INIT_OWNER(labyrunr_state, labyrunr)
|
||||
|
||||
MCFG_K007121_ADD("k007121")
|
||||
|
|
|
@ -95,7 +95,7 @@ static ADDRESS_MAP_START( rockrage_map, AS_PROGRAM, 8, rockrage_state )
|
|||
AM_RANGE(0x0000, 0x1fff) AM_DEVREADWRITE("k007342", k007342_device, read, write) /* Color RAM + Video RAM */
|
||||
AM_RANGE(0x2000, 0x21ff) AM_DEVREADWRITE("k007420", k007420_device, read, write) /* Sprite RAM */
|
||||
AM_RANGE(0x2200, 0x23ff) AM_DEVREADWRITE("k007342", k007342_device, scroll_r, scroll_w) /* Scroll RAM */
|
||||
AM_RANGE(0x2400, 0x247f) AM_RAM AM_SHARE("paletteram") /* Palette */
|
||||
AM_RANGE(0x2400, 0x247f) AM_RAM_DEVWRITE("palette", palette_device, write_indirect) AM_SHARE("palette")
|
||||
AM_RANGE(0x2600, 0x2607) AM_DEVWRITE("k007342", k007342_device, vreg_w) /* Video Registers */
|
||||
AM_RANGE(0x2e00, 0x2e00) AM_READ_PORT("SYSTEM")
|
||||
AM_RANGE(0x2e01, 0x2e01) AM_READ_PORT("P1")
|
||||
|
@ -270,6 +270,8 @@ static MACHINE_CONFIG_START( rockrage, rockrage_state )
|
|||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", rockrage)
|
||||
MCFG_PALETTE_ADD("palette", 64 + 2*16*16)
|
||||
MCFG_PALETTE_INDIRECT_ENTRIES(64)
|
||||
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
|
||||
MCFG_PALETTE_ENDIANNESS(ENDIANNESS_LITTLE)
|
||||
MCFG_PALETTE_INIT_OWNER(rockrage_state, rockrage)
|
||||
|
||||
/* sound hardware */
|
||||
|
|
|
@ -253,8 +253,8 @@ TODO:
|
|||
static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM, 8, stfight_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") /* sf02.bin */
|
||||
AM_RANGE(0xc000, 0xc0ff) AM_RAM AM_SHARE("paletteram")
|
||||
AM_RANGE(0xc100, 0xc1ff) AM_RAM AM_SHARE("paletteram2")
|
||||
AM_RANGE(0xc000, 0xc0ff) AM_RAM_DEVWRITE("palette", palette_device, write_indirect) AM_SHARE("palette")
|
||||
AM_RANGE(0xc100, 0xc1ff) AM_RAM_DEVWRITE("palette", palette_device, write_indirect_ext) AM_SHARE("palette_ext")
|
||||
AM_RANGE(0xc200, 0xc200) AM_READ_PORT("P1")
|
||||
AM_RANGE(0xc201, 0xc201) AM_READ_PORT("P2")
|
||||
AM_RANGE(0xc202, 0xc202) AM_READ_PORT("START")
|
||||
|
@ -559,6 +559,7 @@ static MACHINE_CONFIG_START( stfight, stfight_state )
|
|||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", stfight)
|
||||
MCFG_PALETTE_ADD("palette", 16*4+16*16+16*16+16*16)
|
||||
MCFG_PALETTE_INDIRECT_ENTRIES(256)
|
||||
MCFG_PALETTE_FORMAT(xxxxBBBBRRRRGGGG)
|
||||
MCFG_PALETTE_INIT_OWNER(stfight_state, stfight)
|
||||
|
||||
/* sound hardware */
|
||||
|
|
|
@ -20,9 +20,7 @@ public:
|
|||
m_k007420(*this, "k007420"),
|
||||
m_upd7759(*this, "upd"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette"),
|
||||
m_rombank(*this, "rombank"),
|
||||
m_paletteram(*this, "paletteram") { }
|
||||
m_rombank(*this, "rombank") { }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
|
@ -30,11 +28,9 @@ public:
|
|||
required_device<k007420_device> m_k007420;
|
||||
required_device<upd7759_device> m_upd7759;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
|
||||
/* memory pointers */
|
||||
required_memory_bank m_rombank;
|
||||
required_shared_ptr<UINT8> m_paletteram;
|
||||
|
||||
/* video-related */
|
||||
int m_spritebank;
|
||||
|
@ -55,7 +51,6 @@ public:
|
|||
DECLARE_PALETTE_INIT(bladestl);
|
||||
UINT32 screen_update_bladestl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(bladestl_scanline);
|
||||
void set_pens();
|
||||
K007342_CALLBACK_MEMBER(bladestl_tile_callback);
|
||||
K007420_CALLBACK_MEMBER(bladestl_sprite_callback);
|
||||
};
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
TILE_GET_INFO_MEMBER(get_bg_tile_info);
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_cloak(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void set_pens();
|
||||
void set_pen(int i);
|
||||
void draw_bitmap(bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
|
|
|
@ -12,7 +12,6 @@ class combatsc_state : public driver_device
|
|||
public:
|
||||
combatsc_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_paletteram(*this, "paletteram"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_k007121_1(*this, "k007121_1"),
|
||||
m_k007121_2(*this, "k007121_2"),
|
||||
|
@ -26,7 +25,6 @@ public:
|
|||
UINT8 * m_videoram;
|
||||
UINT8 * m_scrollram;
|
||||
UINT8 * m_io_ram;
|
||||
required_shared_ptr<UINT8> m_paletteram;
|
||||
UINT8 * m_spriteram[2];
|
||||
|
||||
/* video-related */
|
||||
|
@ -98,7 +96,6 @@ public:
|
|||
DECLARE_PALETTE_INIT(combatscb);
|
||||
UINT32 screen_update_combatsc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update_combatscb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void set_pens( );
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *source, int circuit, bitmap_ind8 &priority_bitmap, UINT32 pri_mask );
|
||||
void bootleg_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *source, int circuit );
|
||||
};
|
||||
|
|
|
@ -11,7 +11,6 @@ class contra_state : public driver_device
|
|||
public:
|
||||
contra_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_paletteram(*this, "paletteram"),
|
||||
m_fg_cram(*this, "fg_cram"),
|
||||
m_fg_vram(*this, "fg_vram"),
|
||||
m_tx_cram(*this, "tx_cram"),
|
||||
|
@ -30,7 +29,6 @@ public:
|
|||
/* memory pointers */
|
||||
UINT8 * m_buffered_spriteram;
|
||||
UINT8 * m_buffered_spriteram_2;
|
||||
required_shared_ptr<UINT8> m_paletteram;
|
||||
required_shared_ptr<UINT8> m_fg_cram;
|
||||
required_shared_ptr<UINT8> m_fg_vram;
|
||||
required_shared_ptr<UINT8> m_tx_cram;
|
||||
|
@ -71,7 +69,6 @@ public:
|
|||
DECLARE_PALETTE_INIT(contra);
|
||||
UINT32 screen_update_contra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(contra_interrupt);
|
||||
void set_pens( );
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int bank );
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
|
|
|
@ -40,7 +40,6 @@ public:
|
|||
DECLARE_PALETTE_INIT(darkmist);
|
||||
UINT32 screen_update_darkmist(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(darkmist_scanline);
|
||||
void set_pens();
|
||||
void decrypt_gfx();
|
||||
void decrypt_snd();
|
||||
};
|
||||
|
|
|
@ -12,7 +12,6 @@ class ddribble_state : public driver_device
|
|||
public:
|
||||
ddribble_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_paletteram(*this, "paletteram"),
|
||||
m_fg_videoram(*this, "fg_videoram"),
|
||||
m_spriteram_1(*this, "spriteram_1"),
|
||||
m_sharedram(*this, "sharedram"),
|
||||
|
@ -24,11 +23,9 @@ public:
|
|||
m_filter1(*this, "filter1"),
|
||||
m_filter2(*this, "filter2"),
|
||||
m_filter3(*this, "filter3"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette") { }
|
||||
m_gfxdecode(*this, "gfxdecode") { }
|
||||
|
||||
/* memory pointers */
|
||||
required_shared_ptr<UINT8> m_paletteram;
|
||||
required_shared_ptr<UINT8> m_fg_videoram;
|
||||
required_shared_ptr<UINT8> m_spriteram_1;
|
||||
required_shared_ptr<UINT8> m_sharedram;
|
||||
|
@ -53,7 +50,6 @@ public:
|
|||
required_device<filter_rc_device> m_filter2;
|
||||
required_device<filter_rc_device> m_filter3;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
|
||||
DECLARE_WRITE8_MEMBER(ddribble_bankswitch_w);
|
||||
DECLARE_READ8_MEMBER(ddribble_sharedram_r);
|
||||
|
@ -77,6 +73,5 @@ public:
|
|||
UINT32 screen_update_ddribble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(ddribble_interrupt_0);
|
||||
INTERRUPT_GEN_MEMBER(ddribble_interrupt_1);
|
||||
void set_pens( );
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8* source, int lenght, int gfxset, int flipscreen );
|
||||
};
|
||||
|
|
|
@ -14,7 +14,6 @@ public:
|
|||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this,"maincpu"),
|
||||
m_k007121_regs(*this, "k007121_regs"),
|
||||
m_paletteram(*this, "paletteram"),
|
||||
m_videoram1(*this, "videoram1"),
|
||||
m_videoram2(*this, "videoram2"),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
|
@ -29,7 +28,6 @@ public:
|
|||
|
||||
/* memory pointers */
|
||||
required_shared_ptr<UINT8> m_k007121_regs;
|
||||
required_shared_ptr<UINT8> m_paletteram;
|
||||
required_shared_ptr<UINT8> m_videoram1;
|
||||
required_shared_ptr<UINT8> m_videoram2;
|
||||
required_shared_ptr<UINT8> m_spriteram;
|
||||
|
@ -63,7 +61,6 @@ public:
|
|||
DECLARE_PALETTE_INIT(fastlane);
|
||||
UINT32 screen_update_fastlane(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(fastlane_scanline);
|
||||
void set_pens( );
|
||||
DECLARE_WRITE8_MEMBER(volume_callback0);
|
||||
DECLARE_WRITE8_MEMBER(volume_callback1);
|
||||
};
|
||||
|
|
|
@ -15,7 +15,6 @@ public:
|
|||
: driver_device(mconfig, type, tag),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_spriteram2(*this, "spriteram2") ,
|
||||
m_paletteram(*this, "paletteram"),
|
||||
m_pf1_videoram(*this, "pf1_videoram"),
|
||||
m_pf2_videoram(*this, "pf2_videoram"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
|
@ -29,7 +28,6 @@ public:
|
|||
required_device<buffered_spriteram8_device> m_spriteram;
|
||||
required_device<buffered_spriteram8_device> m_spriteram2;
|
||||
/* memory pointers */
|
||||
required_shared_ptr<UINT8> m_paletteram;
|
||||
required_shared_ptr<UINT8> m_pf1_videoram;
|
||||
required_shared_ptr<UINT8> m_pf2_videoram;
|
||||
|
||||
|
@ -66,7 +64,6 @@ public:
|
|||
virtual void video_start();
|
||||
DECLARE_PALETTE_INIT(hcastle);
|
||||
UINT32 screen_update_hcastle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void set_pens();
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT8 *sbank, int bank );
|
||||
DECLARE_WRITE_LINE_MEMBER(irqhandler);
|
||||
DECLARE_WRITE8_MEMBER(volume_callback);
|
||||
|
|
|
@ -10,7 +10,6 @@ public:
|
|||
jackal_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_videoctrl(*this, "videoctrl"),
|
||||
m_paletteram(*this, "paletteram"),
|
||||
m_mastercpu(*this, "master"),
|
||||
m_slavecpu(*this, "slave"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
|
@ -19,7 +18,6 @@ public:
|
|||
/* memory pointers */
|
||||
required_shared_ptr<UINT8> m_videoctrl;
|
||||
UINT8 * m_scrollram;
|
||||
required_shared_ptr<UINT8> m_paletteram;
|
||||
|
||||
/* video-related */
|
||||
tilemap_t *m_bg_tilemap;
|
||||
|
@ -51,7 +49,6 @@ public:
|
|||
DECLARE_PALETTE_INIT(jackal);
|
||||
UINT32 screen_update_jackal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(jackal_interrupt);
|
||||
void set_pens( );
|
||||
void jackal_mark_tile_dirty( int offset );
|
||||
void draw_background( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
void draw_sprites_region( bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *sram, int length, int bank );
|
||||
|
|
|
@ -15,7 +15,6 @@ public:
|
|||
m_k007121(*this, "k007121"),
|
||||
m_maincpu(*this,"maincpu"),
|
||||
m_scrollram(*this, "scrollram"),
|
||||
m_paletteram(*this, "paletteram"),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_videoram1(*this, "videoram1"),
|
||||
m_videoram2(*this, "videoram2"),
|
||||
|
@ -29,7 +28,6 @@ public:
|
|||
required_device<cpu_device> m_maincpu;
|
||||
/* memory pointers */
|
||||
required_shared_ptr<UINT8> m_scrollram;
|
||||
required_shared_ptr<UINT8> m_paletteram;
|
||||
required_shared_ptr<UINT8> m_spriteram;
|
||||
required_shared_ptr<UINT8> m_videoram1;
|
||||
required_shared_ptr<UINT8> m_videoram2;
|
||||
|
@ -55,5 +53,4 @@ public:
|
|||
UINT32 screen_update_labyrunr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(labyrunr_vblank_interrupt);
|
||||
INTERRUPT_GEN_MEMBER(labyrunr_timer_interrupt);
|
||||
void set_pens( );
|
||||
};
|
||||
|
|
|
@ -20,8 +20,7 @@ public:
|
|||
m_vlm(*this, "vlm"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette"),
|
||||
m_rombank(*this, "rombank"),
|
||||
m_paletteram(*this, "paletteram") { }
|
||||
m_rombank(*this, "rombank") { }
|
||||
|
||||
/* devices */
|
||||
required_device<cpu_device> m_maincpu;
|
||||
|
@ -34,7 +33,6 @@ public:
|
|||
|
||||
/* memory pointers */
|
||||
required_memory_bank m_rombank;
|
||||
required_shared_ptr<UINT8> m_paletteram;
|
||||
|
||||
/* video-related */
|
||||
int m_layer_colorbase[2];
|
||||
|
@ -50,7 +48,6 @@ public:
|
|||
DECLARE_PALETTE_INIT(rockrage);
|
||||
UINT32 screen_update_rockrage(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(rockrage_interrupt);
|
||||
void set_pens();
|
||||
K007342_CALLBACK_MEMBER(rockrage_tile_callback);
|
||||
K007420_CALLBACK_MEMBER(rockrage_sprite_callback);
|
||||
|
||||
|
|
|
@ -84,7 +84,6 @@ public:
|
|||
UINT32 screen_update_stfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update_cshooter(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(stfight_vb_interrupt);
|
||||
void set_pens();
|
||||
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void cshooter_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
|
|
|
@ -20,21 +20,6 @@ PALETTE_INIT_MEMBER(bladestl_state, bladestl)
|
|||
}
|
||||
|
||||
|
||||
void bladestl_state::set_pens()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0x00; i < 0x60; i += 2)
|
||||
{
|
||||
UINT16 data = m_paletteram[i | 1] | (m_paletteram[i] << 8);
|
||||
|
||||
rgb_t color = rgb_t(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
|
||||
|
||||
m_palette->set_indirect_color(i >> 1, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
|
@ -70,8 +55,6 @@ K007420_CALLBACK_MEMBER(bladestl_state::bladestl_sprite_callback)
|
|||
|
||||
UINT32 bladestl_state::screen_update_bladestl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
set_pens();
|
||||
|
||||
m_k007342->tilemap_update();
|
||||
|
||||
m_k007342->tilemap_draw(screen, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE ,0);
|
||||
|
|
|
@ -41,15 +41,15 @@
|
|||
WRITE8_MEMBER(cloak_state::cloak_paletteram_w)
|
||||
{
|
||||
m_palette_ram[offset & 0x3f] = ((offset & 0x40) << 2) | data;
|
||||
set_pen(offset & 0x3f);
|
||||
}
|
||||
|
||||
|
||||
void cloak_state::set_pens()
|
||||
void cloak_state::set_pen(int i)
|
||||
{
|
||||
UINT16 *palette_ram = m_palette_ram;
|
||||
static const int resistances[3] = { 10000, 4700, 2200 };
|
||||
double weights[3];
|
||||
int i;
|
||||
|
||||
/* compute the color output resistor weights */
|
||||
compute_resistor_weights(0, 255, -1.0,
|
||||
|
@ -57,31 +57,28 @@ void cloak_state::set_pens()
|
|||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0);
|
||||
|
||||
for (i = 0; i < NUM_PENS; i++)
|
||||
{
|
||||
int r, g, b;
|
||||
int bit0, bit1, bit2;
|
||||
int r, g, b;
|
||||
int bit0, bit1, bit2;
|
||||
|
||||
/* red component */
|
||||
bit0 = (~palette_ram[i] >> 6) & 0x01;
|
||||
bit1 = (~palette_ram[i] >> 7) & 0x01;
|
||||
bit2 = (~palette_ram[i] >> 8) & 0x01;
|
||||
r = combine_3_weights(weights, bit0, bit1, bit2);
|
||||
/* red component */
|
||||
bit0 = (~palette_ram[i] >> 6) & 0x01;
|
||||
bit1 = (~palette_ram[i] >> 7) & 0x01;
|
||||
bit2 = (~palette_ram[i] >> 8) & 0x01;
|
||||
r = combine_3_weights(weights, bit0, bit1, bit2);
|
||||
|
||||
/* green component */
|
||||
bit0 = (~palette_ram[i] >> 3) & 0x01;
|
||||
bit1 = (~palette_ram[i] >> 4) & 0x01;
|
||||
bit2 = (~palette_ram[i] >> 5) & 0x01;
|
||||
g = combine_3_weights(weights, bit0, bit1, bit2);
|
||||
/* green component */
|
||||
bit0 = (~palette_ram[i] >> 3) & 0x01;
|
||||
bit1 = (~palette_ram[i] >> 4) & 0x01;
|
||||
bit2 = (~palette_ram[i] >> 5) & 0x01;
|
||||
g = combine_3_weights(weights, bit0, bit1, bit2);
|
||||
|
||||
/* blue component */
|
||||
bit0 = (~palette_ram[i] >> 0) & 0x01;
|
||||
bit1 = (~palette_ram[i] >> 1) & 0x01;
|
||||
bit2 = (~palette_ram[i] >> 2) & 0x01;
|
||||
b = combine_3_weights(weights, bit0, bit1, bit2);
|
||||
/* blue component */
|
||||
bit0 = (~palette_ram[i] >> 0) & 0x01;
|
||||
bit1 = (~palette_ram[i] >> 1) & 0x01;
|
||||
bit2 = (~palette_ram[i] >> 2) & 0x01;
|
||||
b = combine_3_weights(weights, bit0, bit1, bit2);
|
||||
|
||||
m_palette->set_pen_color(i, rgb_t(r, g, b));
|
||||
}
|
||||
m_palette->set_pen_color(i, rgb_t(r, g, b));
|
||||
}
|
||||
|
||||
|
||||
|
@ -218,7 +215,6 @@ void cloak_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
|
|||
|
||||
UINT32 cloak_state::screen_update_cloak(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
set_pens();
|
||||
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
|
||||
draw_bitmap(bitmap, cliprect);
|
||||
draw_sprites(bitmap, cliprect);
|
||||
|
|
|
@ -84,21 +84,6 @@ PALETTE_INIT_MEMBER(combatsc_state,combatscb)
|
|||
}
|
||||
|
||||
|
||||
void combatsc_state::set_pens( )
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0x00; i < 0x100; i += 2)
|
||||
{
|
||||
UINT16 data = m_paletteram[i] | (m_paletteram[i | 1] << 8);
|
||||
|
||||
rgb_t color = rgb_t(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
|
||||
|
||||
m_palette->set_indirect_color(i >> 1, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
|
@ -381,8 +366,6 @@ UINT32 combatsc_state::screen_update_combatsc(screen_device &screen, bitmap_ind1
|
|||
{
|
||||
int i;
|
||||
|
||||
set_pens();
|
||||
|
||||
address_space &space = machine().driver_data()->generic_space();
|
||||
if (m_k007121_1->ctrlram_r(space, 1) & 0x02)
|
||||
{
|
||||
|
@ -539,8 +522,6 @@ UINT32 combatsc_state::screen_update_combatscb(screen_device &screen, bitmap_ind
|
|||
{
|
||||
int i;
|
||||
|
||||
set_pens();
|
||||
|
||||
for (i = 0; i < 32; i++)
|
||||
{
|
||||
m_bg_tilemap[0]->set_scrollx(i, m_io_ram[0x040 + i] + 5);
|
||||
|
|
|
@ -49,21 +49,6 @@ PALETTE_INIT_MEMBER(contra_state, contra)
|
|||
}
|
||||
|
||||
|
||||
void contra_state::set_pens( )
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0x00; i < 0x100; i += 2)
|
||||
{
|
||||
UINT16 data = m_paletteram[i] | (m_paletteram[i | 1] << 8);
|
||||
|
||||
rgb_t color = rgb_t(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
|
||||
|
||||
m_palette->set_indirect_color(i >> 1, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
|
@ -305,8 +290,6 @@ UINT32 contra_state::screen_update_contra(screen_device &screen, bitmap_ind16 &b
|
|||
fg_finalclip &= cliprect;
|
||||
tx_finalclip &= cliprect;
|
||||
|
||||
set_pens();
|
||||
|
||||
m_fg_tilemap->set_scrollx(0, ctrl_1_0 - 40);
|
||||
m_fg_tilemap->set_scrolly(0, ctrl_1_2);
|
||||
m_bg_tilemap->set_scrollx(0, ctrl_2_0 - 40);
|
||||
|
|
|
@ -68,9 +68,10 @@ TILE_GET_INFO_MEMBER(darkmist_state::get_txttile_info)
|
|||
PALETTE_INIT_MEMBER(darkmist_state, darkmist)
|
||||
{
|
||||
const UINT8 *color_prom = memregion("proms")->base();
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 0x400; i++)
|
||||
palette.set_indirect_color(0x100, rgb_t::black);
|
||||
|
||||
for (int i = 0; i < 0x400; i++)
|
||||
{
|
||||
int ctabentry;
|
||||
|
||||
|
@ -94,23 +95,6 @@ PALETTE_INIT_MEMBER(darkmist_state, darkmist)
|
|||
}
|
||||
|
||||
|
||||
void darkmist_state::set_pens()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 0x100; i++)
|
||||
{
|
||||
int r = pal4bit(m_generic_paletteram_8[i | 0x200] >> 0);
|
||||
int g = pal4bit(m_generic_paletteram_8[i | 0x000] >> 4);
|
||||
int b = pal4bit(m_generic_paletteram_8[i | 0x000] >> 0);
|
||||
|
||||
m_palette->set_indirect_color(i, rgb_t(r, g, b));
|
||||
}
|
||||
|
||||
m_palette->set_indirect_color(0x100, rgb_t::black);
|
||||
}
|
||||
|
||||
|
||||
void darkmist_state::video_start()
|
||||
{
|
||||
m_bgtilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(darkmist_state::get_bgtile_info),this),TILEMAP_SCAN_ROWS,16,16,512,64 );
|
||||
|
@ -126,8 +110,6 @@ UINT32 darkmist_state::screen_update_darkmist(screen_device &screen, bitmap_ind1
|
|||
|
||||
#define DM_GETSCROLL(n) (((m_scroll[(n)]<<1)&0xff) + ((m_scroll[(n)]&0x80)?1:0) +( ((m_scroll[(n)-1]<<4) | (m_scroll[(n)-1]<<12) )&0xff00))
|
||||
|
||||
set_pens();
|
||||
|
||||
m_bgtilemap->set_scrollx(0, DM_GETSCROLL(0x2));
|
||||
m_bgtilemap->set_scrolly(0, DM_GETSCROLL(0x6));
|
||||
m_fgtilemap->set_scrollx(0, DM_GETSCROLL(0xa));
|
||||
|
|
|
@ -27,20 +27,6 @@ PALETTE_INIT_MEMBER(ddribble_state, ddribble)
|
|||
}
|
||||
|
||||
|
||||
void ddribble_state::set_pens( )
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0x00; i < 0x80; i += 2)
|
||||
{
|
||||
UINT16 data = m_paletteram[i | 1] | (m_paletteram[i] << 8);
|
||||
|
||||
rgb_t color = rgb_t(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
|
||||
m_palette->set_indirect_color(i >> 1, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(ddribble_state::K005885_0_w)
|
||||
{
|
||||
switch (offset)
|
||||
|
@ -239,8 +225,6 @@ void ddribble_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipr
|
|||
|
||||
UINT32 ddribble_state::screen_update_ddribble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
set_pens();
|
||||
|
||||
m_fg_tilemap->set_flip((m_vregs[0][4] & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
|
||||
m_bg_tilemap->set_flip((m_vregs[1][4] & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
|
||||
|
||||
|
|
|
@ -20,21 +20,6 @@ PALETTE_INIT_MEMBER(fastlane_state, fastlane)
|
|||
}
|
||||
|
||||
|
||||
void fastlane_state::set_pens( )
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0x00; i < 0x800; i += 2)
|
||||
{
|
||||
UINT16 data = m_paletteram[i | 1] | (m_paletteram[i] << 8);
|
||||
|
||||
rgb_t color = rgb_t(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
|
||||
|
||||
m_palette->set_indirect_color(i >> 1, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
|
@ -151,8 +136,6 @@ UINT32 fastlane_state::screen_update_fastlane(screen_device &screen, bitmap_ind1
|
|||
finalclip0 &= cliprect;
|
||||
finalclip1 &= cliprect;
|
||||
|
||||
set_pens();
|
||||
|
||||
/* set scroll registers */
|
||||
address_space &space = machine().driver_data()->generic_space();
|
||||
xoffs = m_k007121->ctrlram_r(space, 0);
|
||||
|
|
|
@ -38,21 +38,6 @@ PALETTE_INIT_MEMBER(hcastle_state, hcastle)
|
|||
}
|
||||
|
||||
|
||||
void hcastle_state::set_pens()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0x00; i < 0x100; i += 2)
|
||||
{
|
||||
UINT16 data = m_paletteram[i | 1] | (m_paletteram[i] << 8);
|
||||
|
||||
rgb_t color = rgb_t(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
|
||||
|
||||
m_palette->set_indirect_color(i >> 1, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
|
@ -217,8 +202,6 @@ UINT32 hcastle_state::screen_update_hcastle(screen_device &screen, bitmap_ind16
|
|||
UINT8 ctrl_2_2 = m_k007121_2->ctrlram_r(space, 2);
|
||||
UINT8 ctrl_2_3 = m_k007121_2->ctrlram_r(space, 3);
|
||||
|
||||
set_pens();
|
||||
|
||||
m_pf1_bankbase = 0x0000;
|
||||
m_pf2_bankbase = 0x4000 * ((m_gfx_bank & 2) >> 1);
|
||||
|
||||
|
|
|
@ -37,21 +37,6 @@ PALETTE_INIT_MEMBER(jackal_state, jackal)
|
|||
}
|
||||
|
||||
|
||||
void jackal_state::set_pens( )
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 0x400; i += 2)
|
||||
{
|
||||
UINT16 data = m_paletteram[i] | (m_paletteram[i | 1] << 8);
|
||||
|
||||
rgb_t color = rgb_t(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
|
||||
|
||||
m_palette->set_indirect_color(i >> 1, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void jackal_state::jackal_mark_tile_dirty( int offset )
|
||||
{
|
||||
m_bg_tilemap->mark_tile_dirty(offset);
|
||||
|
@ -217,7 +202,6 @@ void jackal_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect
|
|||
|
||||
UINT32 jackal_state::screen_update_jackal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
set_pens();
|
||||
draw_background(screen, bitmap, cliprect);
|
||||
draw_sprites(bitmap, cliprect);
|
||||
return 0;
|
||||
|
|
|
@ -38,21 +38,6 @@ PALETTE_INIT_MEMBER(labyrunr_state, labyrunr)
|
|||
}
|
||||
|
||||
|
||||
void labyrunr_state::set_pens( )
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0x00; i < 0x100; i += 2)
|
||||
{
|
||||
UINT16 data = m_paletteram[i | 1] | (m_paletteram[i] << 8);
|
||||
|
||||
rgb_t color = rgb_t(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
|
||||
|
||||
m_palette->set_indirect_color(i >> 1, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
|
@ -175,8 +160,6 @@ UINT32 labyrunr_state::screen_update_labyrunr(screen_device &screen, bitmap_ind1
|
|||
UINT8 ctrl_0 = m_k007121->ctrlram_r(space, 0);
|
||||
rectangle finalclip0, finalclip1;
|
||||
|
||||
set_pens();
|
||||
|
||||
screen.priority().fill(0, cliprect);
|
||||
bitmap.fill(m_palette->black_pen(), cliprect);
|
||||
|
||||
|
|
|
@ -24,20 +24,6 @@ PALETTE_INIT_MEMBER(rockrage_state, rockrage)
|
|||
}
|
||||
|
||||
|
||||
void rockrage_state::set_pens()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0x00; i < 0x80; i += 2)
|
||||
{
|
||||
UINT16 data = m_paletteram[i] | (m_paletteram[i | 1] << 8);
|
||||
|
||||
rgb_t color = rgb_t(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
|
||||
|
||||
m_palette->set_indirect_color(i >> 1, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
|
@ -89,8 +75,6 @@ WRITE8_MEMBER(rockrage_state::rockrage_vreg_w)
|
|||
|
||||
UINT32 rockrage_state::screen_update_rockrage(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
set_pens();
|
||||
|
||||
m_k007342->tilemap_update();
|
||||
|
||||
m_k007342->tilemap_draw(screen, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0);
|
||||
|
|
|
@ -65,19 +65,6 @@ PALETTE_INIT_MEMBER(stfight_state, stfight)
|
|||
}
|
||||
|
||||
|
||||
void stfight_state::set_pens()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 0x100; i++)
|
||||
{
|
||||
UINT16 data = m_generic_paletteram_8[i] | (m_generic_paletteram2_8[i] << 8);
|
||||
rgb_t color = rgb_t(pal4bit(data >> 4), pal4bit(data >> 0), pal4bit(data >> 8));
|
||||
|
||||
m_palette->set_indirect_color(i, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
|
@ -313,8 +300,6 @@ void stfight_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co
|
|||
|
||||
UINT32 stfight_state::screen_update_stfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
set_pens();
|
||||
|
||||
screen.priority().fill(0, cliprect);
|
||||
|
||||
bitmap.fill(0, cliprect); /* in case m_bg_tilemap is disabled */
|
||||
|
@ -357,8 +342,6 @@ void stfight_state::cshooter_draw_sprites(screen_device &screen, bitmap_ind16 &b
|
|||
|
||||
UINT32 stfight_state::screen_update_cshooter(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
set_pens();
|
||||
|
||||
screen.priority().fill(0, cliprect);
|
||||
|
||||
bitmap.fill(0, cliprect); /* in case m_bg_tilemap is disabled */
|
||||
|
|
Loading…
Reference in a new issue