summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/deco32.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/includes/deco32.h')
-rw-r--r--src/mame/includes/deco32.h95
1 files changed, 35 insertions, 60 deletions
diff --git a/src/mame/includes/deco32.h b/src/mame/includes/deco32.h
index 403199805e9..4dcec7301db 100644
--- a/src/mame/includes/deco32.h
+++ b/src/mame/includes/deco32.h
@@ -26,26 +26,17 @@ public:
m_ioprot(*this, "ioprot"),
m_deco_irq(*this, "irq"),
m_decobsmt(*this, "decobsmt"),
- m_spriteram(*this, "spriteram"),
- m_sprgen(*this, "spritegen"),
- m_sprgen1(*this, "spritegen1"),
- m_sprgen2(*this, "spritegen2"),
+ m_sprgen(*this, "spritegen%u", 1),
m_sprgenzoom(*this, "spritegen_zoom"),
m_eeprom(*this, "eeprom"),
m_ym2151(*this, "ymsnd"),
- m_oki1(*this, "oki1"),
- m_oki2(*this, "oki2"),
- m_deco_tilegen1(*this, "tilegen1"),
- m_deco_tilegen2(*this, "tilegen2"),
+ m_oki(*this, "oki%u", 1),
+ m_deco_tilegen(*this, "tilegen%u", 1),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch"),
- m_ram(*this, "ram"),
- m_pf1_rowscroll32(*this, "pf1_rowscroll32"),
- m_pf2_rowscroll32(*this, "pf2_rowscroll32"),
- m_pf3_rowscroll32(*this, "pf3_rowscroll32"),
- m_pf4_rowscroll32(*this, "pf4_rowscroll32"),
+ m_pf_rowscroll32(*this, "pf%u_rowscroll32", 1),
m_generic_paletteram_32(*this, "paletteram")
{ }
@@ -54,38 +45,26 @@ public:
required_device<deco_146_base_device> m_ioprot;
optional_device<deco_irq_device> m_deco_irq;
optional_device<decobsmt_device> m_decobsmt;
- optional_device<buffered_spriteram32_device> m_spriteram;
- optional_device<decospr_device> m_sprgen;
- optional_device<decospr_device> m_sprgen1;
- optional_device<decospr_device> m_sprgen2;
+ optional_device_array<decospr_device, 2> m_sprgen;
optional_device<deco_zoomspr_device> m_sprgenzoom;
optional_device<eeprom_serial_93cxx_device> m_eeprom;
optional_device<ym2151_device> m_ym2151;
- optional_device<okim6295_device> m_oki1;
- optional_device<okim6295_device> m_oki2;
- required_device<deco16ic_device> m_deco_tilegen1;
- required_device<deco16ic_device> m_deco_tilegen2;
+ optional_device_array<okim6295_device, 3> m_oki;
+ required_device_array<deco16ic_device, 2> m_deco_tilegen;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
optional_device<generic_latch_8_device> m_soundlatch;
- required_shared_ptr<uint32_t> m_ram;
// we use the pointers below to store a 32-bit copy..
- required_shared_ptr<uint32_t> m_pf1_rowscroll32;
- required_shared_ptr<uint32_t> m_pf2_rowscroll32;
- required_shared_ptr<uint32_t> m_pf3_rowscroll32;
- required_shared_ptr<uint32_t> m_pf4_rowscroll32;
+ required_shared_ptr_array<uint32_t, 4> m_pf_rowscroll32;
optional_shared_ptr<uint32_t> m_generic_paletteram_32;
std::unique_ptr<uint8_t[]> m_dirty_palette; // all but captaven
int m_pri; // captaven, fghthist, nslasher and tattass
- uint16_t m_spriteram16[0x1000]; // captaven, fghthist, nslasher and tattass
- uint16_t m_spriteram16_buffered[0x1000]; // captaven, fghthist, nslasher and tattass
- uint16_t m_pf1_rowscroll[0x1000]; // common
- uint16_t m_pf2_rowscroll[0x1000]; // common
- uint16_t m_pf3_rowscroll[0x1000]; // common
- uint16_t m_pf4_rowscroll[0x1000]; // common
+ std::unique_ptr<uint16_t[]> m_spriteram16[2]; // captaven, fghthist, nslasher and tattass
+ std::unique_ptr<uint16_t[]> m_spriteram16_buffered[2]; // captaven, fghthist, nslasher and tattass
+ std::unique_ptr<uint16_t[]> m_pf_rowscroll[4]; // common
// common
DECLARE_READ16_MEMBER(ioprot_r);
@@ -95,28 +74,29 @@ public:
DECLARE_WRITE8_MEMBER(volume_w);
DECLARE_WRITE32_MEMBER(vblank_ack_w);
- DECLARE_WRITE32_MEMBER(pf1_rowscroll_w);
- DECLARE_WRITE32_MEMBER(pf2_rowscroll_w);
- DECLARE_WRITE32_MEMBER(pf3_rowscroll_w);
- DECLARE_WRITE32_MEMBER(pf4_rowscroll_w);
+ template<int Chip> DECLARE_WRITE32_MEMBER(pf_rowscroll_w);
DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
// captaven, fghthist, nslasher and tattass
- DECLARE_READ32_MEMBER(spriteram_r);
- DECLARE_WRITE32_MEMBER(spriteram_w);
- DECLARE_WRITE32_MEMBER(buffer_spriteram_w);
+ template<int Chip> DECLARE_READ32_MEMBER(spriteram_r);
+ template<int Chip> DECLARE_WRITE32_MEMBER(spriteram_w);
+ template<int Chip> DECLARE_WRITE32_MEMBER(buffer_spriteram_w);
DECLARE_WRITE32_MEMBER(pri_w);
// all but captaven
DECLARE_WRITE32_MEMBER(buffered_palette_w);
DECLARE_WRITE32_MEMBER(palette_dma_w);
-
+
void h6280_sound_custom_latch_map(address_map &map);
void h6280_sound_map(address_map &map);
void z80_sound_io(address_map &map);
- void z80_sound_mem(address_map &map);
+ void z80_sound_map(address_map &map);
protected:
virtual void video_start() override;
+
+ void allocate_spriteram(int chip);
+ void allocate_buffered_palette();
+ void allocate_rowscroll(int size1, int size2, int size3, int size4);
};
@@ -186,9 +166,6 @@ public:
DECLARE_WRITE32_MEMBER(tattass_control_w);
DECLARE_WRITE_LINE_MEMBER(tattass_sound_irq_w);
DECLARE_READ16_MEMBER(nslasher_debug_r);
- DECLARE_READ32_MEMBER(spriteram2_r);
- DECLARE_WRITE32_MEMBER(spriteram2_w);
- DECLARE_WRITE32_MEMBER(buffer_spriteram2_w);
DECLARE_DRIVER_INIT(tattass);
DECLARE_DRIVER_INIT(nslasher);
@@ -209,9 +186,6 @@ private:
std::unique_ptr<bitmap_ind16> m_tilemap_alpha_bitmap;
- uint16_t m_spriteram16_2[0x1000];
- uint16_t m_spriteram16_2_buffered[0x1000];
-
int m_tattass_eprom_bit;
int m_lastClock;
char m_buffer[32];
@@ -226,26 +200,24 @@ class dragngun_state : public deco32_state
public:
dragngun_state(const machine_config &mconfig, device_type type, const char *tag)
: deco32_state(mconfig, type, tag),
- m_sprite_layout_0_ram(*this, "lay0"),
- m_sprite_layout_1_ram(*this, "lay1"),
- m_sprite_lookup_0_ram(*this, "look0"),
- m_sprite_lookup_1_ram(*this, "look1"),
- m_oki3(*this, "oki3"),
+ m_spriteram(*this, "spriteram"),
+ m_sprite_layout_ram(*this, "lay%u", 0),
+ m_sprite_lookup_ram(*this, "look%u", 0),
m_vol_main(*this, "vol_main"),
m_vol_gun(*this, "vol_gun"),
m_gun_speaker_disabled(true)
{ }
+
+ required_device<buffered_spriteram32_device> m_spriteram;
- required_shared_ptr<uint32_t> m_sprite_layout_0_ram;
- required_shared_ptr<uint32_t> m_sprite_layout_1_ram;
- required_shared_ptr<uint32_t> m_sprite_lookup_0_ram;
- required_shared_ptr<uint32_t> m_sprite_lookup_1_ram;
- optional_device<okim6295_device> m_oki3;
+ required_shared_ptr_array<uint32_t, 2> m_sprite_layout_ram;
+ required_shared_ptr_array<uint32_t, 2> m_sprite_lookup_ram;
required_device<lc7535_device> m_vol_main;
- required_device<lc7535_device> m_vol_gun;
+ optional_device<lc7535_device> m_vol_gun;
uint32_t m_sprite_ctrl;
int m_lightgun_port;
+ int m_oki2_bank; // lockload
bitmap_rgb32 m_temp_render_bitmap;
DECLARE_READ32_MEMBER(lightgun_r);
@@ -261,13 +233,14 @@ public:
DECLARE_WRITE32_MEMBER(speaker_switch_w);
LC7535_VOLUME_CHANGED(volume_main_changed);
LC7535_VOLUME_CHANGED(volume_gun_changed);
+
+ DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
+ DECLARE_WRITE8_MEMBER(lockload_okibank_w); // lockload
- virtual void video_start() override;
DECLARE_DRIVER_INIT(dragngun);
DECLARE_DRIVER_INIT(dragngunj);
DECLARE_DRIVER_INIT(lockload);
DECLARE_VIDEO_START(dragngun);
- DECLARE_VIDEO_START(lockload);
void dragngun_init_common();
DECLARE_INPUT_CHANGED_MEMBER(lockload_gun_trigger);
@@ -282,6 +255,8 @@ public:
void dragngun_map(address_map &map);
void lockload_map(address_map &map);
void lockloadu_map(address_map &map);
+ void lockload_sound_map(address_map &map);
+ void lockloadu_sound_map(address_map &map);
private:
bool m_gun_speaker_disabled;
};