summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author cam900 <dbtlrchl@naver.com>2018-08-06 04:54:21 +0900
committer ajrhacker <ajrhacker@users.noreply.github.com>2018-08-05 15:54:21 -0400
commit4052fb7ebeb04c28cd1b1dfc96c53d24091b45fb (patch)
treed73da70f3df16ceb39f17ccd046e0adb1ed0f840
parent69dc3965bda93486e49ef8477e7ea9e369d82c89 (diff)
h6280.cpp : Internalize peripherals, Sound (#3792)
* h6280.cpp : Internalize peripherals, Sound c6280.cpp : Add notes battlera.cpp : Remove unnecessary handlers, bankrws, Add notes dec0.cpp, actfancr.cpp : Reduce duplicates ggconnie.cpp : Fix smf metadata ((C)Capcom at title) vgmplay.cpp : Add notes Remove some MCFGs * c6280.cpp : Add info
-rw-r--r--src/devices/cpu/h6280/h6280.cpp54
-rw-r--r--src/devices/cpu/h6280/h6280.h31
-rw-r--r--src/devices/sound/c6280.cpp16
-rw-r--r--src/devices/sound/c6280.h8
-rw-r--r--src/mame/drivers/actfancr.cpp60
-rw-r--r--src/mame/drivers/battlera.cpp55
-rw-r--r--src/mame/drivers/boogwing.cpp8
-rw-r--r--src/mame/drivers/cbuster.cpp7
-rw-r--r--src/mame/drivers/cninja.cpp24
-rw-r--r--src/mame/drivers/darkseal.cpp8
-rw-r--r--src/mame/drivers/dassault.cpp8
-rw-r--r--src/mame/drivers/dec0.cpp238
-rw-r--r--src/mame/drivers/deco32.cpp27
-rw-r--r--src/mame/drivers/dietgo.cpp9
-rw-r--r--src/mame/drivers/funkyjet.cpp8
-rw-r--r--src/mame/drivers/ggconnie.cpp27
-rw-r--r--src/mame/drivers/madmotor.cpp7
-rw-r--r--src/mame/drivers/paranoia.cpp21
-rw-r--r--src/mame/drivers/pce.cpp39
-rw-r--r--src/mame/drivers/rohga.cpp26
-rw-r--r--src/mame/drivers/supbtime.cpp7
-rw-r--r--src/mame/drivers/tourvis.cpp20
-rw-r--r--src/mame/drivers/uapce.cpp19
-rw-r--r--src/mame/drivers/vaportra.cpp8
-rw-r--r--src/mame/drivers/vgmplay.cpp2
-rw-r--r--src/mame/drivers/x1twin.cpp22
-rw-r--r--src/mame/includes/actfancr.h19
-rw-r--r--src/mame/includes/battlera.h17
-rw-r--r--src/mame/includes/dec0.h37
-rw-r--r--src/mame/includes/deco32.h4
-rw-r--r--src/mame/machine/dec0.cpp7
-rw-r--r--src/mame/machine/pce.cpp2
-rw-r--r--src/mame/machine/pcecommn.cpp1
-rw-r--r--src/mame/video/actfancr.cpp20
-rw-r--r--src/mame/video/dec0.cpp226
35 files changed, 554 insertions, 538 deletions
diff --git a/src/devices/cpu/h6280/h6280.cpp b/src/devices/cpu/h6280/h6280.cpp
index 4fb069d5390..001305f619b 100644
--- a/src/devices/cpu/h6280/h6280.cpp
+++ b/src/devices/cpu/h6280/h6280.cpp
@@ -150,6 +150,14 @@ enum
#define PCW m_pc.w.l
#define PCD m_pc.d
+void h6280_device::internal_map(address_map &map)
+{
+ map(0x1fe800, 0x1fe80f).mirror(0x3f0).rw(FUNC(h6280_device::io_buffer_r), FUNC(h6280_device::psg_w));
+ map(0x1fec00, 0x1fec01).mirror(0x3fe).rw(FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w));
+ map(0x1ff000, 0x1ff000).mirror(0x3ff).rw(FUNC(h6280_device::port_r), FUNC(h6280_device::port_w));
+ map(0x1ff400, 0x1ff403).mirror(0x3fc).rw(FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w));
+}
+
//**************************************************************************
// DEVICE INTERFACE
//**************************************************************************
@@ -162,8 +170,12 @@ DEFINE_DEVICE_TYPE(H6280, h6280_device, "h6280", "Hudson Soft HuC6280")
h6280_device::h6280_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: cpu_device(mconfig, H6280, tag, owner, clock)
- , m_program_config("program", ENDIANNESS_LITTLE, 8, 21)
+ , device_mixer_interface(mconfig, *this, 2)
+ , m_program_config("program", ENDIANNESS_LITTLE, 8, 21, 0, address_map_constructor(FUNC(h6280_device::internal_map), this))
, m_io_config("io", ENDIANNESS_LITTLE, 8, 2)
+ , m_port_in_cb(*this)
+ , m_port_out_cb(*this)
+ , m_psg(*this, "psg")
{
// build the opcode table
for (int op = 0; op < 256; op++)
@@ -214,8 +226,21 @@ const h6280_device::ophandler h6280_device::s_opcodetable[256] =
&h6280_device::op_f8, &h6280_device::op_f9, &h6280_device::op_fa, &h6280_device::op_fb, &h6280_device::op_fc, &h6280_device::op_fd, &h6280_device::op_fe, &h6280_device::op_ff
};
+//-------------------------------------------------
+// device_add_mconfig - add machine configuration
+//-------------------------------------------------
+void h6280_device::device_add_mconfig(machine_config &config)
+{
+ C6280(config, m_psg, DERIVED_CLOCK(1,2));
+ m_psg->add_route(0, *this, 1.0, AUTO_ALLOC_INPUT, 0);
+ m_psg->add_route(1, *this, 1.0, AUTO_ALLOC_INPUT, 1);
+}
+
void h6280_device::device_start()
{
+ m_port_in_cb.resolve_safe(0xff);
+ m_port_out_cb.resolve_safe();
+
// register our state for the debugger
state_add(STATE_GENPC, "GENPC", m_pc.w.l).noshow();
state_add(STATE_GENPCBASE, "CURPC", m_pc.w.l).noshow();
@@ -2560,6 +2585,33 @@ WRITE8_MEMBER( h6280_device::timer_w )
}
}
+READ8_MEMBER( h6280_device::port_r )
+{
+ if (!m_port_in_cb.isnull())
+ return m_port_in_cb();
+
+ return m_io_buffer;
+}
+
+WRITE8_MEMBER( h6280_device::port_w )
+{
+ m_io_buffer = data;
+
+ if (!m_port_out_cb.isnull())
+ m_port_out_cb(data);
+}
+
+READ8_MEMBER( h6280_device::io_buffer_r )
+{
+ return m_io_buffer;
+}
+
+WRITE8_MEMBER( h6280_device::psg_w )
+{
+ m_io_buffer = data;
+ m_psg->c6280_w(space,offset,data,mem_mask);
+}
+
bool h6280_device::memory_translate(int spacenum, int intention, offs_t &address)
{
if (spacenum == AS_PROGRAM)
diff --git a/src/devices/cpu/h6280/h6280.h b/src/devices/cpu/h6280/h6280.h
index 7c73187ab36..5e45a0fe7b9 100644
--- a/src/devices/cpu/h6280/h6280.h
+++ b/src/devices/cpu/h6280/h6280.h
@@ -17,6 +17,7 @@
#pragma once
+#include "sound/c6280.h"
#define H6280_LAZY_FLAGS 0
@@ -27,7 +28,7 @@
// ======================> h6280_device
// Used by core CPU interface
-class h6280_device : public cpu_device
+class h6280_device : public cpu_device, public device_mixer_interface
{
public:
// construction/destruction
@@ -36,11 +37,9 @@ public:
// public interfaces
void set_irq_line(int irqline, int state);
- DECLARE_READ8_MEMBER( irq_status_r );
- DECLARE_WRITE8_MEMBER( irq_status_w );
-
- DECLARE_READ8_MEMBER( timer_r );
- DECLARE_WRITE8_MEMBER( timer_w );
+ // configuration
+ auto port_in_cb() { return m_port_in_cb.bind(); } // K0-7 at Pinout
+ auto port_out_cb() { return m_port_out_cb.bind(); } // O0-7 at Pinout
/* functions for use by the PSG and joypad port only! */
uint8_t io_get_buffer();
@@ -73,6 +72,7 @@ protected:
};
// device-level overrides
+ virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_stop() override;
@@ -352,6 +352,25 @@ protected:
#endif
uint8_t m_io_buffer; /* last value written to the PSG, timer, and interrupt pages */
+ // internal registers
+ void internal_map(address_map &map);
+ DECLARE_READ8_MEMBER( irq_status_r );
+ DECLARE_WRITE8_MEMBER( irq_status_w );
+
+ DECLARE_READ8_MEMBER( timer_r );
+ DECLARE_WRITE8_MEMBER( timer_w );
+
+ DECLARE_READ8_MEMBER( port_r );
+ DECLARE_WRITE8_MEMBER( port_w );
+
+ DECLARE_READ8_MEMBER( io_buffer_r );
+ DECLARE_WRITE8_MEMBER( psg_w );
+
+ devcb_read8 m_port_in_cb;
+ devcb_write8 m_port_out_cb;
+
+ required_device<c6280_device> m_psg;
+
// other internal states
int m_icount;
diff --git a/src/devices/sound/c6280.cpp b/src/devices/sound/c6280.cpp
index 53ac35ede3d..1b3665d40f8 100644
--- a/src/devices/sound/c6280.cpp
+++ b/src/devices/sound/c6280.cpp
@@ -1,7 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Charles MacDonald
/*
- HuC6280 sound chip emulator
+ Hudson PSG emulator
by Charles MacDonald
E-mail: cgfm2@hotmail.com
WWW: http://cgfm2.emuviews.com
@@ -36,6 +36,10 @@
- http://www.hudsonsoft.net/ww/about/about.html
- http://www.hudson.co.jp/corp/eng/coinfo/history.html
+ Integrated on:
+ HuC6280 CPU (PC Engine/TurboGrafx 16)
+ HuC6230 Sound Chip (PC-FX, with OKI ADPCM)
+
*/
#include "emu.h"
@@ -167,15 +171,8 @@ void c6280_device::sound_stream_update(sound_stream &stream, stream_sample_t **i
/* MAME specific code */
/*--------------------------------------------------------------------------*/
-READ8_MEMBER( c6280_device::c6280_r )
-{
- return m_cpudevice->io_get_buffer();
-}
-
WRITE8_MEMBER( c6280_device::c6280_w )
{
- m_cpudevice->io_set_buffer(data);
-
channel *chan = &m_channel[m_select];
/* Update stream */
@@ -256,12 +253,11 @@ WRITE8_MEMBER( c6280_device::c6280_w )
}
}
-DEFINE_DEVICE_TYPE(C6280, c6280_device, "c6280", "Hudson HuC6280")
+DEFINE_DEVICE_TYPE(C6280, c6280_device, "c6280", "Hudson Soft HuC6280 PSG")
c6280_device::c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, C6280, tag, owner, clock)
, device_sound_interface(mconfig, *this)
- , m_cpudevice(*this, finder_base::DUMMY_TAG)
{
}
diff --git a/src/devices/sound/c6280.h b/src/devices/sound/c6280.h
index 1c5474e3adf..ea54ad17188 100644
--- a/src/devices/sound/c6280.h
+++ b/src/devices/sound/c6280.h
@@ -5,17 +5,12 @@
#pragma once
-#include "cpu/h6280/h6280.h"
-
class c6280_device : public device_t, public device_sound_interface
{
public:
c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- void set_devicecpu_tag(const char *tag) { m_cpudevice.set_tag(tag); }
-
- // read/write
- DECLARE_READ8_MEMBER( c6280_r );
+ // write only
DECLARE_WRITE8_MEMBER( c6280_w );
protected:
@@ -43,7 +38,6 @@ private:
// internal state
sound_stream *m_stream;
- required_device<h6280_device> m_cpudevice;
uint8_t m_select;
uint8_t m_balance;
uint8_t m_lfo_frequency;
diff --git a/src/mame/drivers/actfancr.cpp b/src/mame/drivers/actfancr.cpp
index 5ab8720cfe0..ce9644417c9 100644
--- a/src/mame/drivers/actfancr.cpp
+++ b/src/mame/drivers/actfancr.cpp
@@ -58,7 +58,7 @@ READ8_MEMBER(actfancr_state::triothep_control_r)
/******************************************************************************/
-WRITE8_MEMBER(actfancr_state::actfancr_buffer_spriteram_w)
+WRITE8_MEMBER(actfancr_state::buffer_spriteram_w)
{
uint8_t *src = reinterpret_cast<uint8_t *>(memshare("spriteram")->ptr());
// copy to a 16-bit region for our sprite draw code too
@@ -71,14 +71,14 @@ WRITE8_MEMBER(actfancr_state::actfancr_buffer_spriteram_w)
void actfancr_state::actfan_map(address_map &map)
{
map(0x000000, 0x02ffff).rom();
- map(0x060000, 0x060007).w(m_tilegen1, FUNC(deco_bac06_device::pf_control0_8bit_w));
- map(0x060010, 0x06001f).w(m_tilegen1, FUNC(deco_bac06_device::pf_control1_8bit_swap_w));
- map(0x062000, 0x063fff).rw(m_tilegen1, FUNC(deco_bac06_device::pf_data_8bit_swap_r), FUNC(deco_bac06_device::pf_data_8bit_swap_w));
- map(0x070000, 0x070007).w(m_tilegen2, FUNC(deco_bac06_device::pf_control0_8bit_w));
- map(0x070010, 0x07001f).w(m_tilegen2, FUNC(deco_bac06_device::pf_control1_8bit_swap_w));
- map(0x072000, 0x0727ff).rw(m_tilegen2, FUNC(deco_bac06_device::pf_data_8bit_swap_r), FUNC(deco_bac06_device::pf_data_8bit_swap_w));
+ map(0x060000, 0x060007).w(m_tilegen[0], FUNC(deco_bac06_device::pf_control0_8bit_w));
+ map(0x060010, 0x06001f).w(m_tilegen[0], FUNC(deco_bac06_device::pf_control1_8bit_swap_w));
+ map(0x062000, 0x063fff).rw(m_tilegen[0], FUNC(deco_bac06_device::pf_data_8bit_swap_r), FUNC(deco_bac06_device::pf_data_8bit_swap_w));
+ map(0x070000, 0x070007).w(m_tilegen[1], FUNC(deco_bac06_device::pf_control0_8bit_w));
+ map(0x070010, 0x07001f).w(m_tilegen[1], FUNC(deco_bac06_device::pf_control1_8bit_swap_w));
+ map(0x072000, 0x0727ff).rw(m_tilegen[1], FUNC(deco_bac06_device::pf_data_8bit_swap_r), FUNC(deco_bac06_device::pf_data_8bit_swap_w));
map(0x100000, 0x1007ff).ram().share("spriteram");
- map(0x110000, 0x110001).w(FUNC(actfancr_state::actfancr_buffer_spriteram_w));
+ map(0x110000, 0x110001).w(FUNC(actfancr_state::buffer_spriteram_w));
map(0x120000, 0x1205ff).ram().w("palette", FUNC(palette_device::write8)).share("palette");
map(0x130000, 0x130000).portr("P1");
map(0x130001, 0x130001).portr("P2");
@@ -86,28 +86,26 @@ void actfancr_state::actfan_map(address_map &map)
map(0x130003, 0x130003).portr("DSW2");
map(0x140000, 0x140001).portr("SYSTEM"); /* VBL */
map(0x150000, 0x150000).w(m_soundlatch, FUNC(generic_latch_8_device::write));
- map(0x1f0000, 0x1f3fff).ram().share("main_ram"); /* Main ram */
+ map(0x1f0000, 0x1f3fff).ram(); /* Main ram */
}
void actfancr_state::triothep_map(address_map &map)
{
map(0x000000, 0x03ffff).rom();
- map(0x040000, 0x040007).w(m_tilegen2, FUNC(deco_bac06_device::pf_control0_8bit_w));
- map(0x040010, 0x04001f).w(m_tilegen2, FUNC(deco_bac06_device::pf_control1_8bit_swap_w));
- map(0x044000, 0x045fff).rw(m_tilegen2, FUNC(deco_bac06_device::pf_data_8bit_swap_r), FUNC(deco_bac06_device::pf_data_8bit_swap_w));
- map(0x046400, 0x0467ff).rw(m_tilegen2, FUNC(deco_bac06_device::pf_rowscroll_8bit_swap_r), FUNC(deco_bac06_device::pf_rowscroll_8bit_swap_w));
- map(0x060000, 0x060007).w(m_tilegen1, FUNC(deco_bac06_device::pf_control0_8bit_w));
- map(0x060010, 0x06001f).w(m_tilegen1, FUNC(deco_bac06_device::pf_control1_8bit_swap_w));
- map(0x064000, 0x0647ff).rw(m_tilegen1, FUNC(deco_bac06_device::pf_data_8bit_swap_r), FUNC(deco_bac06_device::pf_data_8bit_swap_w));
- map(0x066400, 0x0667ff).rw(m_tilegen1, FUNC(deco_bac06_device::pf_rowscroll_8bit_swap_r), FUNC(deco_bac06_device::pf_rowscroll_8bit_swap_w));
+ map(0x040000, 0x040007).w(m_tilegen[1], FUNC(deco_bac06_device::pf_control0_8bit_w));
+ map(0x040010, 0x04001f).w(m_tilegen[1], FUNC(deco_bac06_device::pf_control1_8bit_swap_w));
+ map(0x044000, 0x045fff).rw(m_tilegen[1], FUNC(deco_bac06_device::pf_data_8bit_swap_r), FUNC(deco_bac06_device::pf_data_8bit_swap_w));
+ map(0x046400, 0x0467ff).rw(m_tilegen[1], FUNC(deco_bac06_device::pf_rowscroll_8bit_swap_r), FUNC(deco_bac06_device::pf_rowscroll_8bit_swap_w));
+ map(0x060000, 0x060007).w(m_tilegen[0], FUNC(deco_bac06_device::pf_control0_8bit_w));
+ map(0x060010, 0x06001f).w(m_tilegen[0], FUNC(deco_bac06_device::pf_control1_8bit_swap_w));
+ map(0x064000, 0x0647ff).rw(m_tilegen[0], FUNC(deco_bac06_device::pf_data_8bit_swap_r), FUNC(deco_bac06_device::pf_data_8bit_swap_w));
+ map(0x066400, 0x0667ff).rw(m_tilegen[0], FUNC(deco_bac06_device::pf_rowscroll_8bit_swap_r), FUNC(deco_bac06_device::pf_rowscroll_8bit_swap_w));
map(0x100000, 0x100000).w(m_soundlatch, FUNC(generic_latch_8_device::write));
- map(0x110000, 0x110001).w(FUNC(actfancr_state::actfancr_buffer_spriteram_w));
+ map(0x110000, 0x110001).w(FUNC(actfancr_state::buffer_spriteram_w));
map(0x120000, 0x1207ff).ram().share("spriteram");
map(0x130000, 0x1305ff).ram().w("palette", FUNC(palette_device::write8)).share("palette");
map(0x140000, 0x140001).nopr(); /* Value doesn't matter */
- map(0x1f0000, 0x1f3fff).ram().share("main_ram"); /* Main ram */
- map(0x1ff000, 0x1ff001).rw(FUNC(actfancr_state::triothep_control_r), FUNC(actfancr_state::triothep_control_select_w));
- map(0x1ff400, 0x1ff403).w(m_maincpu, FUNC(h6280_device::irq_status_w));
+ map(0x1f0000, 0x1f3fff).ram(); /* Main ram */
}
/******************************************************************************/
@@ -290,9 +288,9 @@ MACHINE_RESET_MEMBER(actfancr_state,triothep)
MACHINE_CONFIG_START(actfancr_state::actfancr)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", H6280, 21477200/3) /* Should be accurate */
- MCFG_DEVICE_PROGRAM_MAP(actfan_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", actfancr_state, irq0_line_hold) /* VBL */
+ H6280(config, m_maincpu, 21477200/3); /* Should be accurate */
+ m_maincpu->set_addrmap(AS_PROGRAM, actfan_map);
+ m_maincpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
MCFG_DEVICE_ADD("audiocpu",M6502, 1500000) /* Should be accurate */
MCFG_DEVICE_PROGRAM_MAP(dec0_s_map)
@@ -303,7 +301,8 @@ MACHINE_CONFIG_START(actfancr_state::actfancr)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(529))
MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(actfancr_state, screen_update_actfancr)
+ MCFG_SCREEN_UPDATE_DRIVER(actfancr_state, screen_update)
+ MCFG_SCREEN_VBLANK_CALLBACK(HOLDLINE("maincpu", 0)) /* VBL */
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_actfan)
@@ -345,9 +344,11 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(actfancr_state::triothep)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",H6280,XTAL(21'477'272)/3) /* XIN=21.4772Mhz, verified on pcb */
- MCFG_DEVICE_PROGRAM_MAP(triothep_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", actfancr_state, irq0_line_hold) /* VBL */
+ H6280(config, m_maincpu, XTAL(21'477'272)/3); /* XIN=21.4772Mhz, verified on pcb */
+ m_maincpu->set_addrmap(AS_PROGRAM, triothep_map);
+ m_maincpu->port_in_cb().set(FUNC(actfancr_state::triothep_control_r));
+ m_maincpu->port_out_cb().set(FUNC(actfancr_state::triothep_control_select_w));
+ m_maincpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
MCFG_DEVICE_ADD("audiocpu",M6502, XTAL(12'000'000)/8) /* verified on pcb */
MCFG_DEVICE_PROGRAM_MAP(dec0_s_map)
@@ -361,7 +362,8 @@ MACHINE_CONFIG_START(actfancr_state::triothep)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(529))
MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(actfancr_state, screen_update_actfancr)
+ MCFG_SCREEN_UPDATE_DRIVER(actfancr_state, screen_update)
+ MCFG_SCREEN_VBLANK_CALLBACK(HOLDLINE("maincpu", 0)) /* VBL */
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_triothep)
diff --git a/src/mame/drivers/battlera.cpp b/src/mame/drivers/battlera.cpp
index 55f940fd384..9521a575a23 100644
--- a/src/mame/drivers/battlera.cpp
+++ b/src/mame/drivers/battlera.cpp
@@ -95,7 +95,6 @@ Notes:
#include "emu.h"
#include "includes/battlera.h"
#include "sound/2203intf.h"
-#include "sound/c6280.h"
#include "speaker.h"
@@ -108,17 +107,6 @@ void battlera_state::machine_start()
/******************************************************************************/
-WRITE8_MEMBER(battlera_state::sound_w)
-{
- if (offset == 0)
- {
- m_soundlatch->write(space, 0, data);
- m_audiocpu->set_input_line(0, HOLD_LINE);
- }
-}
-
-/******************************************************************************/
-
WRITE8_MEMBER(battlera_state::control_data_w)
{
m_control_port_select=data;
@@ -143,16 +131,11 @@ READ8_MEMBER(battlera_state::control_data_r)
void battlera_state::battlera_map(address_map &map)
{
map(0x000000, 0x0fffff).rom();
- map(0x1e0800, 0x1e0801).w(FUNC(battlera_state::sound_w));
+ map(0x1e0800, 0x1e0800).w(m_soundlatch, FUNC(generic_latch_8_device::write));
map(0x1e1000, 0x1e13ff).rw(m_huc6260, FUNC(huc6260_device::palette_direct_read), FUNC(huc6260_device::palette_direct_write)).share("paletteram");
- map(0x1f0000, 0x1f1fff).bankrw("bank8"); /* Main ram */
- map(0x1ff000, 0x1ff001).rw(FUNC(battlera_state::control_data_r), FUNC(battlera_state::control_data_w));
-
- map(0x1FE000, 0x1FE3FF).rw("huc6270", FUNC(huc6270_device::read), FUNC(huc6270_device::write));
- map(0x1FE400, 0x1FE7FF).rw(m_huc6260, FUNC(huc6260_device::read), FUNC(huc6260_device::write));
- map(0x1FEC00, 0x1FEFFF).rw(m_maincpu, FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w));
- map(0x1FF400, 0x1FF7FF).rw(m_maincpu, FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w));
-
+ map(0x1f0000, 0x1f1fff).ram(); /* Main ram */
+ map(0x1fe000, 0x1fe3ff).rw("huc6270", FUNC(huc6270_device::read), FUNC(huc6270_device::write));
+ map(0x1fe400, 0x1fe7ff).rw(m_huc6260, FUNC(huc6260_device::read), FUNC(huc6260_device::write));
}
void battlera_state::battlera_portmap(address_map &map)
@@ -188,10 +171,7 @@ void battlera_state::sound_map(address_map &map)
map(0x000000, 0x00ffff).rom();
map(0x040000, 0x040001).w("ymsnd", FUNC(ym2203_device::write));
map(0x080000, 0x080001).w(FUNC(battlera_state::adpcm_data_w));
- map(0x1fe800, 0x1fe80f).w("c6280", FUNC(c6280_device::c6280_w));
- map(0x1f0000, 0x1f1fff).bankrw("bank7"); /* Main ram */
- map(0x1ff000, 0x1ff001).r(m_soundlatch, FUNC(generic_latch_8_device::read)).w(FUNC(battlera_state::adpcm_reset_w));
- map(0x1ff400, 0x1ff403).w(m_audiocpu, FUNC(h6280_device::irq_status_w));
+ map(0x1f0000, 0x1f1fff).ram(); /* Main ram */
}
/******************************************************************************/
@@ -273,12 +253,18 @@ uint32_t battlera_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
MACHINE_CONFIG_START(battlera_state::battlera)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", H6280,21477200/3)
- MCFG_DEVICE_PROGRAM_MAP(battlera_map)
- MCFG_DEVICE_IO_MAP(battlera_portmap)
-
- MCFG_DEVICE_ADD("audiocpu", H6280,21477200/3)
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ H6280(config, m_maincpu, 21477200/3);
+ m_maincpu->set_addrmap(AS_PROGRAM, battlera_map);
+ m_maincpu->set_addrmap(AS_IO, battlera_portmap);
+ m_maincpu->port_in_cb().set(FUNC(battlera_state::control_data_r));
+ m_maincpu->port_out_cb().set(FUNC(battlera_state::control_data_w));
+ m_maincpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
+
+ H6280(config, m_audiocpu, 21477200/3);
+ m_audiocpu->set_addrmap(AS_PROGRAM, sound_map);
+ m_audiocpu->port_in_cb().set(m_soundlatch, FUNC(generic_latch_8_device::read));
+ m_audiocpu->port_out_cb().set(FUNC(battlera_state::adpcm_reset_w));
+ m_audiocpu->add_route(ALL_OUTPUTS, "mono", 0.60); // music data is stereo, but hardware isn't
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -299,7 +285,8 @@ MACHINE_CONFIG_START(battlera_state::battlera)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ GENERIC_LATCH_8(config, m_soundlatch);
+ m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
MCFG_DEVICE_ADD("ymsnd", YM2203, 12000000 / 8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
@@ -308,10 +295,6 @@ MACHINE_CONFIG_START(battlera_state::battlera)
MCFG_MSM5205_VCLK_CB(WRITELINE(*this, battlera_state, adpcm_int)) /* interrupt function */
MCFG_MSM5205_PRESCALER_SELECTOR(S48_4B) /* 8KHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.85)
-
- MCFG_DEVICE_ADD("c6280", C6280, 21477270/6)
- MCFG_C6280_CPU("audiocpu")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
MACHINE_CONFIG_END
/******************************************************************************/
diff --git a/src/mame/drivers/boogwing.cpp b/src/mame/drivers/boogwing.cpp
index 0d207317bdf..41c093f162f 100644
--- a/src/mame/drivers/boogwing.cpp
+++ b/src/mame/drivers/boogwing.cpp
@@ -174,8 +174,6 @@ void boogwing_state::audio_map(address_map &map)
map(0x130000, 0x130001).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x140000, 0x140000).r(m_deco104, FUNC(deco104_device::soundlatch_r));
map(0x1f0000, 0x1f1fff).ram();
- map(0x1fec00, 0x1fec01).rw(m_audiocpu, FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w)).mirror(0x3fe);
- map(0x1ff400, 0x1ff403).rw(m_audiocpu, FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w)).mirror(0x3fc);
}
@@ -346,8 +344,10 @@ MACHINE_CONFIG_START(boogwing_state::boogwing)
MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", boogwing_state, irq6_line_hold)
- MCFG_DEVICE_ADD("audiocpu", H6280, SOUND_XTAL/4)
- MCFG_DEVICE_PROGRAM_MAP(audio_map)
+ H6280(config, m_audiocpu, SOUND_XTAL/4);
+ m_audiocpu->set_addrmap(AS_PROGRAM, audio_map);
+ m_audiocpu->add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused
+ m_audiocpu->add_route(ALL_OUTPUTS, "rspeaker", 0);
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/cbuster.cpp b/src/mame/drivers/cbuster.cpp
index 65619763907..1d71dfc3cca 100644
--- a/src/mame/drivers/cbuster.cpp
+++ b/src/mame/drivers/cbuster.cpp
@@ -161,8 +161,6 @@ void cbuster_state::sound_map(address_map &map)
map(0x130000, 0x130001).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x140000, 0x140001).r(m_soundlatch, FUNC(generic_latch_8_device::read));
map(0x1f0000, 0x1f1fff).ram();
- map(0x1fec00, 0x1fec01).rw(m_audiocpu, FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w)).mirror(0x3fe);
- map(0x1ff400, 0x1ff403).rw(m_audiocpu, FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w)).mirror(0x3fc);
}
/******************************************************************************/
@@ -308,8 +306,9 @@ MACHINE_CONFIG_START(cbuster_state::twocrude)
MCFG_DEVICE_PROGRAM_MAP(twocrude_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cbuster_state, irq4_line_assert)/* VBL */
- MCFG_DEVICE_ADD("audiocpu", H6280, XTAL(24'000'000)/4) /* Custom chip 45, 6MHz Verified */
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ H6280(config, m_audiocpu, XTAL(24'000'000)/4); /* Custom chip 45, 6MHz Verified */
+ m_audiocpu->set_addrmap(AS_PROGRAM, sound_map);
+ m_audiocpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(58)
diff --git a/src/mame/drivers/cninja.cpp b/src/mame/drivers/cninja.cpp
index 1384308e5f1..d2857da5d8e 100644
--- a/src/mame/drivers/cninja.cpp
+++ b/src/mame/drivers/cninja.cpp
@@ -315,8 +315,6 @@ void cninja_state::sound_map(address_map &map)
map(0x130000, 0x130001).rw(m_oki2, FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x140000, 0x140000).r(m_ioprot, FUNC(deco_146_base_device::soundlatch_r));
map(0x1f0000, 0x1f1fff).ram();
- map(0x1fec00, 0x1fec01).rw("audiocpu", FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w)).mirror(0x3fe);
- map(0x1ff400, 0x1ff403).rw("audiocpu", FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w)).mirror(0x3fc);
}
void cninja_state::sound_map_mutantf(address_map &map)
@@ -328,8 +326,6 @@ void cninja_state::sound_map_mutantf(address_map &map)
map(0x130000, 0x130001).rw(m_oki2, FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x140000, 0x140001).r(m_ioprot, FUNC(deco_146_base_device::soundlatch_r));
map(0x1f0000, 0x1f1fff).ram();
- map(0x1fec00, 0x1fec01).rw("audiocpu", FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w)).mirror(0x3fe);
- map(0x1ff400, 0x1ff403).rw("audiocpu", FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w)).mirror(0x3fc);
}
void cninja_state::stoneage_s_map(address_map &map)
@@ -801,8 +797,9 @@ MACHINE_CONFIG_START(cninja_state::cninja)
MCFG_DEVICE_ADD("maincpu", M68000, XTAL(24'000'000) / 2)
MCFG_DEVICE_PROGRAM_MAP(cninja_map)
- MCFG_DEVICE_ADD("audiocpu", H6280, XTAL(32'220'000) / 8)
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ h6280_device &audiocpu(H6280(config, m_audiocpu, XTAL(32'220'000) / 8);
+ audiocpu.set_addrmap(AS_PROGRAM, sound_map);
+ audiocpu.add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
MCFG_DECO_IRQ_ADD("irq", "screen")
MCFG_DECO_IRQ_RASTER1_IRQ_CB(INPUTLINE("maincpu", 3))
@@ -1061,8 +1058,9 @@ MACHINE_CONFIG_START(cninja_state::edrandy)
MCFG_DEVICE_ADD("maincpu", M68000, XTAL(24'000'000) / 2)
MCFG_DEVICE_PROGRAM_MAP(edrandy_map)
- MCFG_DEVICE_ADD("audiocpu", H6280, XTAL(32'220'000) / 8)
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ h6280_device &audiocpu(H6280(config, m_audiocpu, XTAL(32'220'000) / 8);
+ audiocpu.set_addrmap(AS_PROGRAM, sound_map);
+ audiocpu.add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
MCFG_DECO_IRQ_ADD("irq", "screen")
MCFG_DECO_IRQ_RASTER1_IRQ_CB(INPUTLINE("maincpu", 3))
@@ -1148,8 +1146,9 @@ MACHINE_CONFIG_START(cninja_state::robocop2)
MCFG_DEVICE_ADD("maincpu", M68000, XTAL(28'000'000) / 2)
MCFG_DEVICE_PROGRAM_MAP(robocop2_map)
- MCFG_DEVICE_ADD("audiocpu", H6280, XTAL(32'220'000) / 8)
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ h6280_device &audiocpu(H6280(config, m_audiocpu, XTAL(32'220'000) / 8);
+ audiocpu.set_addrmap(AS_PROGRAM, sound_map);
+ audiocpu.add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
MCFG_DECO_IRQ_ADD("irq", "screen")
MCFG_DECO_IRQ_RASTER1_IRQ_CB(INPUTLINE("maincpu", 3))
@@ -1246,8 +1245,9 @@ MACHINE_CONFIG_START(cninja_state::mutantf)
MCFG_DEVICE_PROGRAM_MAP(mutantf_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cninja_state, irq6_line_hold)
- MCFG_DEVICE_ADD("audiocpu", H6280, XTAL(32'220'000) / 8)
- MCFG_DEVICE_PROGRAM_MAP(sound_map_mutantf)
+ h6280_device &audiocpu(H6280(config, m_audiocpu, XTAL(32'220'000) / 8);
+ audiocpu.set_addrmap(AS_PROGRAM, sound_map_mutantf);
+ audiocpu.add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/darkseal.cpp b/src/mame/drivers/darkseal.cpp
index 636785a7103..8cf09f067af 100644
--- a/src/mame/drivers/darkseal.cpp
+++ b/src/mame/drivers/darkseal.cpp
@@ -76,8 +76,6 @@ void darkseal_state::sound_map(address_map &map)
map(0x130000, 0x130001).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x140000, 0x140001).r(m_soundlatch, FUNC(generic_latch_8_device::read));
map(0x1f0000, 0x1f1fff).ram();
- map(0x1fec00, 0x1fec01).rw(m_audiocpu, FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w)).mirror(0x3fe);
- map(0x1ff400, 0x1ff403).rw(m_audiocpu, FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w)).mirror(0x3fc);
}
/******************************************************************************/
@@ -210,8 +208,9 @@ MACHINE_CONFIG_START(darkseal_state::darkseal)
MCFG_DEVICE_PROGRAM_MAP(darkseal_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", darkseal_state, irq6_line_assert)/* VBL */
- MCFG_DEVICE_ADD(m_audiocpu, H6280, XTAL(32'220'000)/4) /* Custom chip 45, Audio section crystal is 32.220 MHz */
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ H6280(config, m_audiocpu, XTAL(32'220'000)/4); /* Custom chip 45, Audio section crystal is 32.220 MHz */
+ m_audiocpu->set_addrmap(AS_PROGRAM, sound_map);
+ m_audiocpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -259,7 +258,6 @@ MACHINE_CONFIG_START(darkseal_state::darkseal)
MCFG_DECO_SPRITE_GFX_REGION(3)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
-
/* sound hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/dassault.cpp b/src/mame/drivers/dassault.cpp
index b1465b1f94b..9c2392b4665 100644
--- a/src/mame/drivers/dassault.cpp
+++ b/src/mame/drivers/dassault.cpp
@@ -330,8 +330,6 @@ void dassault_state::sound_map(address_map &map)
map(0x130000, 0x130001).rw(m_oki2, FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x140000, 0x140001).r(m_soundlatch, FUNC(generic_latch_8_device::read));
map(0x1f0000, 0x1f1fff).ram();
- map(0x1fec00, 0x1fec01).rw(m_audiocpu, FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w)).mirror(0x3fe);
- map(0x1ff400, 0x1ff403).rw(m_audiocpu, FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w)).mirror(0x3fc);
}
/**********************************************************************************/
@@ -535,8 +533,10 @@ MACHINE_CONFIG_START(dassault_state::dassault)
MCFG_DEVICE_PROGRAM_MAP(dassault_sub_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", dassault_state, irq5_line_assert)
- MCFG_DEVICE_ADD("audiocpu", H6280, XTAL(32'220'000)/8) /* Accurate */
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ H6280(config, m_audiocpu, XTAL(32'220'000)/8); /* Accurate */
+ m_audiocpu->set_addrmap(AS_PROGRAM, sound_map);
+ m_audiocpu->add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused
+ m_audiocpu->add_route(ALL_OUTPUTS, "rspeaker", 0);
// MCFG_QUANTUM_TIME(attotime::from_hz(8400)) /* 140 CPU slices per frame */
MCFG_QUANTUM_PERFECT_CPU("maincpu") // I was seeing random lockups.. let's see if this helps
diff --git a/src/mame/drivers/dec0.cpp b/src/mame/drivers/dec0.cpp
index aa7d433fe06..942b5b24a40 100644
--- a/src/mame/drivers/dec0.cpp
+++ b/src/mame/drivers/dec0.cpp
@@ -430,24 +430,24 @@ WRITE16_MEMBER(dec0_state::midres_sound_w)
void dec0_state::dec0_map(address_map &map)
{
map(0x000000, 0x05ffff).rom();
- map(0x240000, 0x240007).w(m_tilegen1, FUNC(deco_bac06_device::pf_control_0_w)); /* text layer */
- map(0x240010, 0x240017).w(m_tilegen1, FUNC(deco_bac06_device::pf_control_1_w));
- map(0x242000, 0x24207f).rw(m_tilegen1, FUNC(deco_bac06_device::pf_colscroll_r), FUNC(deco_bac06_device::pf_colscroll_w));
- map(0x242400, 0x2427ff).rw(m_tilegen1, FUNC(deco_bac06_device::pf_rowscroll_r), FUNC(deco_bac06_device::pf_rowscroll_w));
+ map(0x240000, 0x240007).w(m_tilegen[0], FUNC(deco_bac06_device::pf_control_0_w)); /* text layer */
+ map(0x240010, 0x240017).w(m_tilegen[0], FUNC(deco_bac06_device::pf_control_1_w));
+ map(0x242000, 0x24207f).rw(m_tilegen[0], FUNC(deco_bac06_device::pf_colscroll_r), FUNC(deco_bac06_device::pf_colscroll_w));
+ map(0x242400, 0x2427ff).rw(m_tilegen[0], FUNC(deco_bac06_device::pf_rowscroll_r), FUNC(deco_bac06_device::pf_rowscroll_w));
map(0x242800, 0x243fff).ram(); /* Robocop only */
- map(0x244000, 0x245fff).rw(m_tilegen1, FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
+ map(0x244000, 0x245fff).rw(m_tilegen[0], FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
- map(0x246000, 0x246007).w(m_tilegen2, FUNC(deco_bac06_device::pf_control_0_w)); /* first tile layer */
- map(0x246010, 0x246017).w(m_tilegen2, FUNC(deco_bac06_device::pf_control_1_w));
- map(0x248000, 0x24807f).rw(m_tilegen2, FUNC(deco_bac06_device::pf_colscroll_r), FUNC(deco_bac06_device::pf_colscroll_w));
- map(0x248400, 0x2487ff).rw(m_tilegen2, FUNC(deco_bac06_device::pf_rowscroll_r), FUNC(deco_bac06_device::pf_rowscroll_w));
- map(0x24a000, 0x24a7ff).rw(m_tilegen2, FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
+ map(0x246000, 0x246007).w(m_tilegen[1], FUNC(deco_bac06_device::pf_control_0_w)); /* first tile layer */
+ map(0x246010, 0x246017).w(m_tilegen[1], FUNC(deco_bac06_device::pf_control_1_w));
+ map(0x248000, 0x24807f).rw(m_tilegen[1], FUNC(deco_bac06_device::pf_colscroll_r), FUNC(deco_bac06_device::pf_colscroll_w));
+ map(0x248400, 0x2487ff).rw(m_tilegen[1], FUNC(deco_bac06_device::pf_rowscroll_r), FUNC(deco_bac06_device::pf_rowscroll_w));
+ map(0x24a000, 0x24a7ff).rw(m_tilegen[1], FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
- map(0x24c000, 0x24c007).w(m_tilegen3, FUNC(deco_bac06_device::pf_control_0_w)); /* second tile layer */
- map(0x24c010, 0x24c017).w(m_tilegen3, FUNC(deco_bac06_device::pf_control_1_w));
- map(0x24c800, 0x24c87f).rw(m_tilegen3, FUNC(deco_bac06_device::pf_colscroll_r), FUNC(deco_bac06_device::pf_colscroll_w));
- map(0x24cc00, 0x24cfff).rw(m_tilegen3, FUNC(deco_bac06_device::pf_rowscroll_r), FUNC(deco_bac06_device::pf_rowscroll_w));
- map(0x24d000, 0x24d7ff).rw(m_tilegen3, FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
+ map(0x24c000, 0x24c007).w(m_tilegen[2], FUNC(deco_bac06_device::pf_control_0_w)); /* second tile layer */
+ map(0x24c010, 0x24c017).w(m_tilegen[2], FUNC(deco_bac06_device::pf_control_1_w));
+ map(0x24c800, 0x24c87f).rw(m_tilegen[2], FUNC(deco_bac06_device::pf_colscroll_r), FUNC(deco_bac06_device::pf_colscroll_w));
+ map(0x24cc00, 0x24cfff).rw(m_tilegen[2], FUNC(deco_bac06_device::pf_rowscroll_r), FUNC(deco_bac06_device::pf_rowscroll_w));
+ map(0x24d000, 0x24d7ff).rw(m_tilegen[2], FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
map(0x300000, 0x300001).portr("AN0");
map(0x300008, 0x300009).portr("AN1");
@@ -461,29 +461,38 @@ void dec0_state::dec0_map(address_map &map)
map(0xffc000, 0xffc7ff).ram().share("spriteram"); /* Sprites */
}
+void dec0_state::robocop_map(address_map &map)
+{
+ dec0_map(map);
+ map(0x180000, 0x180fff).rw(FUNC(dec0_state::robocop_68000_share_r), FUNC(dec0_state::robocop_68000_share_w));
+}
+
void dec0_state::robocop_sub_map(address_map &map)
{
map(0x000000, 0x00ffff).rom();
map(0x1f0000, 0x1f1fff).ram(); /* Main ram */
map(0x1f2000, 0x1f3fff).ram().share("robocop_shared"); /* Shared ram */
- map(0x1ff400, 0x1ff403).w(m_subcpu, FUNC(h6280_device::irq_status_w));
+}
+
+void dec0_state::hippodrm_map(address_map &map)
+{
+ dec0_map(map);
+ map(0x180000, 0x18003f).rw(FUNC(dec0_state::hippodrm_68000_share_r), FUNC(dec0_state::hippodrm_68000_share_w));
+ map(0xffc800, 0xffcfff).w(FUNC(dec0_state::sprite_mirror_w));
}
void dec0_state::hippodrm_sub_map(address_map &map)
{
map(0x000000, 0x00ffff).rom();
map(0x180000, 0x18001f).ram().share("hippodrm_shared");
- map(0x1a0000, 0x1a0007).w(m_tilegen3, FUNC(deco_bac06_device::pf_control0_8bit_packed_w));
- map(0x1a0010, 0x1a001f).w(m_tilegen3, FUNC(deco_bac06_device::pf_control1_8bit_swap_w));
- map(0x1a1000, 0x1a17ff).rw(m_tilegen3, FUNC(deco_bac06_device::pf_data_8bit_swap_r), FUNC(deco_bac06_device::pf_data_8bit_swap_w));
+ map(0x1a0000, 0x1a0007).w(m_tilegen[2], FUNC(deco_bac06_device::pf_control0_8bit_packed_w));
+ map(0x1a0010, 0x1a001f).w(m_tilegen[2], FUNC(deco_bac06_device::pf_control1_8bit_swap_w));
+ map(0x1a1000, 0x1a17ff).rw(m_tilegen[2], FUNC(deco_bac06_device::pf_data_8bit_swap_r), FUNC(deco_bac06_device::pf_data_8bit_swap_w));
map(0x1d0000, 0x1d00ff).rw(FUNC(dec0_state::hippodrm_prot_r), FUNC(dec0_state::hippodrm_prot_w));
- map(0x1f0000, 0x1f1fff).bankrw("bank8"); /* Main ram */
- map(0x1ff400, 0x1ff403).w(m_subcpu, FUNC(h6280_device::irq_status_w));
- map(0x1ff402, 0x1ff403).portr("VBLANK");
+ map(0x1f0000, 0x1f1fff).ram(); /* Main ram */
}
-
READ16_MEMBER(dec0_state::slyspy_controls_r)
{
switch (offset<<1)
@@ -576,26 +585,26 @@ void dec0_state::slyspy_protection_map(address_map &map)
map(0x04000, 0x04001).mirror(0x30000).r(FUNC(dec0_state::slyspy_state_r)).nopw();
map(0x0a000, 0x0a001).mirror(0x30000).w(FUNC(dec0_state::slyspy_state_w));
// Default state (called by Traps 1, 3, 4, 7, C)
- map(0x00000, 0x00007).w(m_tilegen2, FUNC(deco_bac06_device::pf_control_0_w));
- map(0x00010, 0x00017).w(m_tilegen2, FUNC(deco_bac06_device::pf_control_1_w));
- map(0x02000, 0x0207f).w(m_tilegen2, FUNC(deco_bac06_device::pf_colscroll_w));
- map(0x02400, 0x027ff).w(m_tilegen2, FUNC(deco_bac06_device::pf_rowscroll_w));
- map(0x06000, 0x07fff).w(m_tilegen2, FUNC(deco_bac06_device::pf_data_w));
- map(0x08000, 0x08007).w(m_tilegen1, FUNC(deco_bac06_device::pf_control_0_w));
- map(0x08010, 0x08017).w(m_tilegen1, FUNC(deco_bac06_device::pf_control_1_w));
- map(0x0c000, 0x0c07f).w(m_tilegen1, FUNC(deco_bac06_device::pf_colscroll_w));
- map(0x0c400, 0x0c7ff).w(m_tilegen1, FUNC(deco_bac06_device::pf_rowscroll_w));
- map(0x0e000, 0x0ffff).w(m_tilegen1, FUNC(deco_bac06_device::pf_data_w));
+ map(0x00000, 0x00007).w(m_tilegen[1], FUNC(deco_bac06_device::pf_control_0_w));
+ map(0x00010, 0x00017).w(m_tilegen[1], FUNC(deco_bac06_device::pf_control_1_w));
+ map(0x02000, 0x0207f).w(m_tilegen[1], FUNC(deco_bac06_device::pf_colscroll_w));
+ map(0x02400, 0x027ff).w(m_tilegen[1], FUNC(deco_bac06_device::pf_rowscroll_w));
+ map(0x06000, 0x07fff).w(m_tilegen[1], FUNC(deco_bac06_device::pf_data_w));
+ map(0x08000, 0x08007).w(m_tilegen[0], FUNC(deco_bac06_device::pf_control_0_w));
+ map(0x08010, 0x08017).w(m_tilegen[0], FUNC(deco_bac06_device::pf_control_1_w));
+ map(0x0c000, 0x0c07f).w(m_tilegen[0], FUNC(deco_bac06_device::pf_colscroll_w));
+ map(0x0c400, 0x0c7ff).w(m_tilegen[0], FUNC(deco_bac06_device::pf_rowscroll_w));
+ map(0x0e000, 0x0ffff).w(m_tilegen[0], FUNC(deco_bac06_device::pf_data_w));
// State 1 (Called by Trap 9)
- map(0x18000, 0x19fff).w(m_tilegen1, FUNC(deco_bac06_device::pf_data_w));
- map(0x1c000, 0x1dfff).w(m_tilegen2, FUNC(deco_bac06_device::pf_data_w));
+ map(0x18000, 0x19fff).w(m_tilegen[0], FUNC(deco_bac06_device::pf_data_w));
+ map(0x1c000, 0x1dfff).w(m_tilegen[1], FUNC(deco_bac06_device::pf_data_w));
// State 2 (Called by Trap A)
- map(0x20000, 0x21fff).w(m_tilegen2, FUNC(deco_bac06_device::pf_data_w));
- map(0x22000, 0x23fff).w(m_tilegen1, FUNC(deco_bac06_device::pf_data_w));
- map(0x2e000, 0x2ffff).w(m_tilegen1, FUNC(deco_bac06_device::pf_data_w));
+ map(0x20000, 0x21fff).w(m_tilegen[1], FUNC(deco_bac06_device::pf_data_w));
+ map(0x22000, 0x23fff).w(m_tilegen[0], FUNC(deco_bac06_device::pf_data_w));
+ map(0x2e000, 0x2ffff).w(m_tilegen[0], FUNC(deco_bac06_device::pf_data_w));
// State 3 (Called by Trap B)
- map(0x30000, 0x31fff).w(m_tilegen1, FUNC(deco_bac06_device::pf_data_w));
- map(0x38000, 0x39fff).w(m_tilegen2, FUNC(deco_bac06_device::pf_data_w));
+ map(0x30000, 0x31fff).w(m_tilegen[0], FUNC(deco_bac06_device::pf_data_w));
+ map(0x38000, 0x39fff).w(m_tilegen[1], FUNC(deco_bac06_device::pf_data_w));
}
void dec0_state::slyspy_map(address_map &map)
@@ -606,11 +615,11 @@ void dec0_state::slyspy_map(address_map &map)
map(0x240000, 0x24ffff).m(m_pfprotect, FUNC(address_map_bank_device::amap16));
/* Pf3 is unaffected by protection */
- map(0x300000, 0x300007).w(m_tilegen3, FUNC(deco_bac06_device::pf_control_0_w));
- map(0x300010, 0x300017).w(m_tilegen3, FUNC(deco_bac06_device::pf_control_1_w));
- map(0x300800, 0x30087f).rw(m_tilegen3, FUNC(deco_bac06_device::pf_colscroll_r), FUNC(deco_bac06_device::pf_colscroll_w));
- map(0x300c00, 0x300fff).rw(m_tilegen3, FUNC(deco_bac06_device::pf_rowscroll_r), FUNC(deco_bac06_device::pf_rowscroll_w));
- map(0x301000, 0x3017ff).rw(m_tilegen3, FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
+ map(0x300000, 0x300007).w(m_tilegen[2], FUNC(deco_bac06_device::pf_control_0_w));
+ map(0x300010, 0x300017).w(m_tilegen[2], FUNC(deco_bac06_device::pf_control_1_w));
+ map(0x300800, 0x30087f).rw(m_tilegen[2], FUNC(deco_bac06_device::pf_colscroll_r), FUNC(deco_bac06_device::pf_colscroll_w));
+ map(0x300c00, 0x300fff).rw(m_tilegen[2], FUNC(deco_bac06_device::pf_rowscroll_r), FUNC(deco_bac06_device::pf_rowscroll_w));
+ map(0x301000, 0x3017ff).rw(m_tilegen[2], FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
map(0x304000, 0x307fff).ram().share("ram"); /* Sly spy main ram */
map(0x308000, 0x3087ff).ram().share("spriteram"); /* Sprites */
@@ -633,24 +642,24 @@ void dec0_state::midres_map(address_map &map)
map(0x180008, 0x18000f).nopw(); /* ?? watchdog ?? */
map(0x1a0001, 0x1a0001).w(m_soundlatch, FUNC(generic_latch_8_device::write));
- map(0x200000, 0x200007).w(m_tilegen2, FUNC(deco_bac06_device::pf_control_0_w));
- map(0x200010, 0x200017).w(m_tilegen2, FUNC(deco_bac06_device::pf_control_1_w));
- map(0x220000, 0x2207ff).rw(m_tilegen2, FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
- map(0x220800, 0x220fff).rw(m_tilegen2, FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w)); /* mirror address used in end sequence */
- map(0x240000, 0x24007f).rw(m_tilegen2, FUNC(deco_bac06_device::pf_colscroll_r), FUNC(deco_bac06_device::pf_colscroll_w));
- map(0x240400, 0x2407ff).rw(m_tilegen2, FUNC(deco_bac06_device::pf_rowscroll_r), FUNC(deco_bac06_device::pf_rowscroll_w));
-
- map(0x280000, 0x280007).w(m_tilegen3, FUNC(deco_bac06_device::pf_control_0_w));
- map(0x280010, 0x280017).w(m_tilegen3, FUNC(deco_bac06_device::pf_control_1_w));
- map(0x2a0000, 0x2a07ff).rw(m_tilegen3, FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
- map(0x2c0000, 0x2c007f).rw(m_tilegen3, FUNC(deco_bac06_device::pf_colscroll_r), FUNC(deco_bac06_device::pf_colscroll_w));
- map(0x2c0400, 0x2c07ff).rw(m_tilegen3, FUNC(deco_bac06_device::pf_rowscroll_r), FUNC(deco_bac06_device::pf_rowscroll_w));
-
- map(0x300000, 0x300007).w(m_tilegen1, FUNC(deco_bac06_device::pf_control_0_w));
- map(0x300010, 0x300017).w(m_tilegen1, FUNC(deco_bac06_device::pf_control_1_w));
- map(0x320000, 0x321fff).rw(m_tilegen1, FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
- map(0x340000, 0x34007f).rw(m_tilegen1, FUNC(deco_bac06_device::pf_colscroll_r), FUNC(deco_bac06_device::pf_colscroll_w));
- map(0x340400, 0x3407ff).rw(m_tilegen1, FUNC(deco_bac06_device::pf_rowscroll_r), FUNC(deco_bac06_device::pf_rowscroll_w));
+ map(0x200000, 0x200007).w(m_tilegen[1], FUNC(deco_bac06_device::pf_control_0_w));
+ map(0x200010, 0x200017).w(m_tilegen[1], FUNC(deco_bac06_device::pf_control_1_w));
+ map(0x220000, 0x2207ff).rw(m_tilegen[1], FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
+ map(0x220800, 0x220fff).rw(m_tilegen[1], FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w)); /* mirror address used in end sequence */
+ map(0x240000, 0x24007f).rw(m_tilegen[1], FUNC(deco_bac06_device::pf_colscroll_r), FUNC(deco_bac06_device::pf_colscroll_w));
+ map(0x240400, 0x2407ff).rw(m_tilegen[1], FUNC(deco_bac06_device::pf_rowscroll_r), FUNC(deco_bac06_device::pf_rowscroll_w));
+
+ map(0x280000, 0x280007).w(m_tilegen[2], FUNC(deco_bac06_device::pf_control_0_w));
+ map(0x280010, 0x280017).w(m_tilegen[2], FUNC(deco_bac06_device::pf_control_1_w));
+ map(0x2a0000, 0x2a07ff).rw(m_tilegen[2], FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
+ map(0x2c0000, 0x2c007f).rw(m_tilegen[2], FUNC(deco_bac06_device::pf_colscroll_r), FUNC(deco_bac06_device::pf_colscroll_w));
+ map(0x2c0400, 0x2c07ff).rw(m_tilegen[2], FUNC(deco_bac06_device::pf_rowscroll_r), FUNC(deco_bac06_device::pf_rowscroll_w));
+
+ map(0x300000, 0x300007).w(m_tilegen[0], FUNC(deco_bac06_device::pf_control_0_w));
+ map(0x300010, 0x300017).w(m_tilegen[0], FUNC(deco_bac06_device::pf_control_1_w));
+ map(0x320000, 0x321fff).rw(m_tilegen[0], FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
+ map(0x340000, 0x34007f).rw(m_tilegen[0], FUNC(deco_bac06_device::pf_colscroll_r), FUNC(deco_bac06_device::pf_colscroll_w));
+ map(0x340400, 0x3407ff).rw(m_tilegen[0], FUNC(deco_bac06_device::pf_rowscroll_r), FUNC(deco_bac06_device::pf_rowscroll_w));
}
void dec0_state::midresb_map(address_map &map)
@@ -682,8 +691,7 @@ void dec0_state::slyspy_s_map(address_map &map)
{
map(0x000000, 0x00ffff).rom();
map(0x080000, 0x0fffff).m(m_sndprotect, FUNC(address_map_bank_device::amap8));
- map(0x1f0000, 0x1f1fff).bankrw("bank8");
- map(0x1ff400, 0x1ff403).w("audiocpu", FUNC(h6280_device::irq_status_w));
+ map(0x1f0000, 0x1f1fff).ram();
}
// sly spy sound state protection machine emulation
@@ -742,18 +750,16 @@ void dec0_state::midres_s_map(address_map &map)
map(0x118000, 0x118001).w("ym1", FUNC(ym2203_device::write));
map(0x130000, 0x130001).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x138000, 0x138001).r(m_soundlatch, FUNC(generic_latch_8_device::read));
- map(0x1f0000, 0x1f1fff).bankrw("bank8");
- map(0x1ff400, 0x1ff403).w("audiocpu", FUNC(h6280_device::irq_status_w));
+ map(0x1f0000, 0x1f1fff).ram();
}
void dec0_automat_state::machine_start()
{
- m_adpcm_toggle1 = false;
- m_adpcm_toggle2 = false;
- save_item(NAME(m_adpcm_toggle1));
- save_item(NAME(m_adpcm_toggle2));
+ m_adpcm_toggle[0] = false;
+ m_adpcm_toggle[1] = false;
+ save_item(NAME(m_adpcm_toggle));
save_item(NAME(m_automat_scroll_regs));
m_soundbank->configure_entries(0, 8, memregion("audiocpu")->base(), 0x4000);
@@ -785,19 +791,19 @@ void dec0_automat_state::automat_map(address_map &map)
map(0x242000, 0x24207f).ram();
map(0x242400, 0x2427ff).ram();
map(0x242800, 0x243fff).ram();
- map(0x244000, 0x245fff).ram().rw(m_tilegen1, FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
+ map(0x244000, 0x245fff).ram().rw(m_tilegen[0], FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
map(0x246000, 0x246007).ram(); /* first tile layer */
map(0x246010, 0x246017).ram();
map(0x248000, 0x24807f).ram();
map(0x248400, 0x2487ff).ram();
- map(0x24a000, 0x24a7ff).ram().rw(m_tilegen2, FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
+ map(0x24a000, 0x24a7ff).ram().rw(m_tilegen[1], FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
map(0x24c000, 0x24c007).ram(); /* second tile layer */
map(0x24c010, 0x24c017).ram();
map(0x24c800, 0x24c87f).ram();
map(0x24cc00, 0x24cfff).ram();
- map(0x24d000, 0x24d7ff).ram().rw(m_tilegen3, FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
+ map(0x24d000, 0x24d7ff).ram().rw(m_tilegen[2], FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
map(0x300000, 0x300001).portr("AN0");
map(0x300008, 0x300009).portr("AN1");
@@ -821,13 +827,13 @@ void dec0_automat_state::secretab_map(address_map &map)
map(0x000000, 0x05ffff).rom();
// AM_RANGE(0x240000, 0x240007) AM_DEVWRITE("tilegen2", deco_bac06_device, pf_control_0_w)
// AM_RANGE(0x240010, 0x240017) AM_DEVWRITE("tilegen2", deco_bac06_device, pf_control_1_w)
- map(0x246000, 0x247fff).rw(m_tilegen2, FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
+ map(0x246000, 0x247fff).rw(m_tilegen[1], FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
// AM_RANGE(0x240000, 0x24007f) AM_DEVREADWRITE("tilegen2", deco_bac06_device, pf_colscroll_r, pf_colscroll_w)
// AM_RANGE(0x240400, 0x2407ff) AM_DEVREADWRITE("tilegen2", deco_bac06_device, pf_rowscroll_r, pf_rowscroll_w)
// AM_RANGE(0x200000, 0x300007) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control_0_w)
// AM_RANGE(0x300010, 0x300017) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control_1_w)
- map(0x24e000, 0x24ffff).rw(m_tilegen1, FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
+ map(0x24e000, 0x24ffff).rw(m_tilegen[0], FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
// AM_RANGE(0x340000, 0x34007f) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_colscroll_r, pf_colscroll_w)
// AM_RANGE(0x340400, 0x3407ff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_rowscroll_r, pf_rowscroll_w)
@@ -838,7 +844,7 @@ void dec0_automat_state::secretab_map(address_map &map)
map(0x300010, 0x300017).ram();
map(0x300800, 0x30087f).ram();
map(0x300c00, 0x300fff).ram();
- map(0x301000, 0x3017ff).rw(m_tilegen3, FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
+ map(0x301000, 0x3017ff).rw(m_tilegen[2], FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
map(0x301800, 0x307fff).ram().share("ram"); /* Sly spy main ram */
map(0x310000, 0x3107ff).rw(FUNC(dec0_automat_state::automat_palette_r), FUNC(dec0_automat_state::automat_palette_w)).share("palette");
map(0xb08000, 0xb08fff).ram().share("spriteram"); /* Sprites */
@@ -853,9 +859,9 @@ void dec0_automat_state::automat_s_map(address_map &map)
map(0xc800, 0xc801).rw("2203a", FUNC(ym2203_device::read), FUNC(ym2203_device::write));
map(0xd000, 0xd001).rw("2203b", FUNC(ym2203_device::read), FUNC(ym2203_device::write));
map(0xd800, 0xd800).r(m_soundlatch, FUNC(generic_latch_8_device::read));
- map(0xe000, 0xe000).w(m_adpcm_select2, FUNC(ls157_device::ba_w));
+ map(0xe000, 0xe000).w(m_adpcm_select[1], FUNC(ls157_device::ba_w));
map(0xe800, 0xe800).w(FUNC(dec0_automat_state::sound_bankswitch_w));
- map(0xf000, 0xf000).w(m_adpcm_select1, FUNC(ls157_device::ba_w));
+ map(0xf000, 0xf000).w(m_adpcm_select[0], FUNC(ls157_device::ba_w));
}
void dec0_automat_state::secretab_s_map(address_map &map)
@@ -866,9 +872,9 @@ void dec0_automat_state::secretab_s_map(address_map &map)
map(0xc800, 0xc801).rw("2203a", FUNC(ym2203_device::read), FUNC(ym2203_device::write));
map(0xd000, 0xd001).rw("ym3812", FUNC(ym3812_device::read), FUNC(ym3812_device::write));
map(0xd800, 0xd800).r(m_soundlatch, FUNC(generic_latch_8_device::read));
- map(0xe000, 0xe000).w(m_adpcm_select2, FUNC(ls157_device::ba_w));
+ map(0xe000, 0xe000).w(m_adpcm_select[1], FUNC(ls157_device::ba_w));
map(0xe800, 0xe800).w(FUNC(dec0_automat_state::sound_bankswitch_w));
- map(0xf000, 0xf000).w(m_adpcm_select1, FUNC(ls157_device::ba_w));
+ map(0xf000, 0xf000).w(m_adpcm_select[0], FUNC(ls157_device::ba_w));
}
/******************************************************************************/
@@ -1252,9 +1258,6 @@ static INPUT_PORTS_START( hippodrm )
PORT_DIPSETTING( 0x0000, "3 Dots" ) // 3 Dots less
PORT_DIPUNUSED_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW2:8" ) // Always OFF
- PORT_START("VBLANK")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
-
PORT_INCLUDE( rotary_null )
INPUT_PORTS_END
@@ -1275,6 +1278,9 @@ static INPUT_PORTS_START( ffantasybl )
PORT_DIPSETTING( 0x4000, "2 Dots" ) // 2 Dots less
PORT_DIPSETTING( 0x0000, DEF_STR( None ) ) // 0 Dot less
+ PORT_START("VBLANK")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
+
PORT_MODIFY("SYSTEM")
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Game does not want vblank here
INPUT_PORTS_END
@@ -1578,10 +1584,6 @@ static GFXDECODE_START( gfx_midres )
GFXDECODE_ENTRY( "gfx4", 0, tilelayout, 0, 16 ) /* Sprites 16x16 */
GFXDECODE_END
-
-
-
-
static GFXDECODE_START( gfx_automat )
GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) /* Characters 8x8 */
GFXDECODE_ENTRY( "gfx2", 0, automat_tilelayout3, 512, 16 ) /* Tiles 16x16 */
@@ -1705,8 +1707,8 @@ MACHINE_CONFIG_END
WRITE8_MEMBER(dec0_automat_state::sound_bankswitch_w)
{
- m_msm1->reset_w(BIT(data, 3));
- m_msm2->reset_w(BIT(data, 4));
+ m_msm[0]->reset_w(BIT(data, 3));
+ m_msm[1]->reset_w(BIT(data, 4));
m_soundbank->set_entry(data & 7);
}
@@ -1716,9 +1718,9 @@ WRITE_LINE_MEMBER(dec0_automat_state::msm1_vclk_cb)
if (!state)
return;
- m_adpcm_toggle1 = !m_adpcm_toggle1;
- m_adpcm_select1->select_w(m_adpcm_toggle1);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, m_adpcm_toggle1);
+ m_adpcm_toggle[0] = !m_adpcm_toggle[0];
+ m_adpcm_select[0]->select_w(m_adpcm_toggle[0]);
+ m_audiocpu->set_input_line(INPUT_LINE_NMI, m_adpcm_toggle[0]);
}
WRITE_LINE_MEMBER(dec0_automat_state::msm2_vclk_cb)
@@ -1726,8 +1728,8 @@ WRITE_LINE_MEMBER(dec0_automat_state::msm2_vclk_cb)
if (!state)
return;
- m_adpcm_toggle2 = !m_adpcm_toggle2;
- m_adpcm_select2->select_w(m_adpcm_toggle2);
+ m_adpcm_toggle[1] = !m_adpcm_toggle[1];
+ m_adpcm_select[1]->select_w(m_adpcm_toggle[1]);
}
@@ -1927,8 +1929,12 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(dec0_state::robocop)
dec0(config);
- MCFG_DEVICE_ADD("sub", H6280, XTAL(21'477'272) / 16)
- MCFG_DEVICE_PROGRAM_MAP(robocop_sub_map)
+ MCFG_DEVICE_MODIFY("maincpu")
+ MCFG_DEVICE_PROGRAM_MAP(robocop_map)
+
+ H6280(config, m_subcpu, XTAL(21'477'272) / 16);
+ m_subcpu->set_addrmap(AS_PROGRAM, robocop_sub_map);
+ m_subcpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
MCFG_QUANTUM_TIME(attotime::from_hz(3000)) /* Interleave between HuC6280 & 68000 */
@@ -1948,21 +1954,27 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(dec0_state::hippodrm)
dec0(config);
- MCFG_DEVICE_ADD("sub", H6280, XTAL(21'477'272) / 16)
- MCFG_DEVICE_PROGRAM_MAP(hippodrm_sub_map)
+ MCFG_DEVICE_MODIFY("maincpu")
+ MCFG_DEVICE_PROGRAM_MAP(hippodrm_map)
+
+ H6280(config, m_subcpu, XTAL(21'477'272) / 16);
+ m_subcpu->set_addrmap(AS_PROGRAM, hippodrm_sub_map);
+ m_subcpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
MCFG_QUANTUM_TIME(attotime::from_hz(300)) /* Interleave between H6280 & 68000 */
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(dec0_state, screen_update_hippodrm)
+ MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("sub", 1)) /* VBL */
MACHINE_CONFIG_END
MACHINE_CONFIG_START(dec0_state::ffantasybl)
dec0(config);
-// MCFG_DEVICE_ADD("sub", H6280, XTAL(21'477'272) / 16)
-// MCFG_DEVICE_PROGRAM_MAP(hippodrm_sub_map)
+// H6280(config, m_subcpu, XTAL(21'477'272) / 16);
+// m_subcpu->set_addrmap(AS_PROGRAM, hippodrm_sub_map);
+// m_subcpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
// MCFG_QUANTUM_TIME(attotime::from_hz(300)) /* Interleave between H6280 & 68000 */
@@ -1989,8 +2001,9 @@ MACHINE_CONFIG_START(dec0_state::slyspy)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", dec0_state, irq6_line_hold) /* VBL, apparently it auto-acks */
// TODO: both games doesn't like /3 here, MT #06740
- MCFG_DEVICE_ADD("audiocpu", H6280, XTAL(12'000'000)/2/2) /* verified on pcb (6Mhz is XIN on pin 10 of H6280) */
- MCFG_DEVICE_PROGRAM_MAP(slyspy_s_map)
+ h6280_device &audiocpu(H6280(config, m_audiocpu, XTAL(12'000'000)/2/2)); /* verified on pcb (6Mhz is XIN on pin 10 of H6280) */
+ audiocpu.set_addrmap(AS_PROGRAM, slyspy_s_map);
+ audiocpu.add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
MCFG_DEVICE_ADD("pfprotect", ADDRESS_MAP_BANK, 0)
MCFG_DEVICE_PROGRAM_MAP(slyspy_protection_map)
@@ -2022,8 +2035,9 @@ MACHINE_CONFIG_START(dec0_state::midres)
MCFG_DEVICE_PROGRAM_MAP(midres_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", dec0_state, irq6_line_hold)/* VBL */
- MCFG_DEVICE_ADD("audiocpu", H6280, XTAL(24'000'000)/4/3) /* verified on pcb (6Mhz is XIN on pin 10 of H6280, verified on pcb */
- MCFG_DEVICE_PROGRAM_MAP(midres_s_map)
+ h6280_device &audiocpu(H6280(config, m_audiocpu, XTAL(24'000'000)/4/3)); /* verified on pcb (6Mhz is XIN on pin 10 of H6280, verified on pcb */
+ audiocpu.set_addrmap(AS_PROGRAM, midres_s_map);
+ audiocpu.add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
@@ -3763,11 +3777,11 @@ GAME( 1987, hbarrelw, hbarrel, hbarrel, hbarrel, dec0_state, init_hbarr
GAME( 1988, baddudes, 0, baddudes, baddudes, dec0_state, init_hbarrel, ROT0, "Data East USA", "Bad Dudes vs. Dragonninja (US)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, drgninja, baddudes, baddudes, drgninja, dec0_state, init_hbarrel, ROT0, "Data East Corporation", "Dragonninja (Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, birdtry, 0, birdtry, birdtry, dec0_state, init_birdtry, ROT270, "Data East Corporation", "Birdie Try (Japan)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // protection controls game related data, impossible to emulate without a working PCB
-GAME( 1988, robocop, 0, robocop, robocop, dec0_state, init_robocop, ROT0, "Data East Corporation", "Robocop (World revision 4)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, robocopw, robocop, robocop, robocop, dec0_state, init_robocop, ROT0, "Data East Corporation", "Robocop (World revision 3)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, robocopj, robocop, robocop, robocop, dec0_state, init_robocop, ROT0, "Data East Corporation", "Robocop (Japan)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, robocopu, robocop, robocop, robocop, dec0_state, init_robocop, ROT0, "Data East USA", "Robocop (US revision 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, robocopu0, robocop, robocop, robocop, dec0_state, init_robocop, ROT0, "Data East USA", "Robocop (US revision 0)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, robocop, 0, robocop, robocop, dec0_state, empty_init, ROT0, "Data East Corporation", "Robocop (World revision 4)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, robocopw, robocop, robocop, robocop, dec0_state, empty_init, ROT0, "Data East Corporation", "Robocop (World revision 3)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, robocopj, robocop, robocop, robocop, dec0_state, empty_init, ROT0, "Data East Corporation", "Robocop (Japan)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, robocopu, robocop, robocop, robocop, dec0_state, empty_init, ROT0, "Data East USA", "Robocop (US revision 1)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, robocopu0, robocop, robocop, robocop, dec0_state, empty_init, ROT0, "Data East USA", "Robocop (US revision 0)", MACHINE_SUPPORTS_SAVE )
GAME( 1989, hippodrm, 0, hippodrm, hippodrm, dec0_state, init_hippodrm, ROT0, "Data East USA", "Hippodrome (US)", MACHINE_SUPPORTS_SAVE )
GAME( 1989, ffantasy, hippodrm, hippodrm, ffantasy, dec0_state, init_hippodrm, ROT0, "Data East Corporation", "Fighting Fantasy (Japan revision 3)", MACHINE_SUPPORTS_SAVE )
GAME( 1989, ffantasyj, hippodrm, hippodrm, ffantasy, dec0_state, init_hippodrm, ROT0, "Data East Corporation", "Fighting Fantasy (Japan revision 2)", MACHINE_SUPPORTS_SAVE )
@@ -3787,7 +3801,7 @@ GAME( 1990, bouldashj, bouldash, slyspy, bouldash, dec0_state, init_slysp
// bootlegs
// more or less just an unprotected versions of the game, everything intact
-GAME( 1988, robocopb, robocop, robocopb, robocop, dec0_state, init_robocop, ROT0, "bootleg", "Robocop (World bootleg)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, robocopb, robocop, robocopb, robocop, dec0_state, empty_init, ROT0, "bootleg", "Robocop (World bootleg)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, drgninjab, baddudes, drgninjab, drgninja, dec0_state, init_drgninja, ROT0, "bootleg", "Dragonninja (bootleg)", MACHINE_SUPPORTS_SAVE )
@@ -3798,5 +3812,5 @@ GAME( 1989, ffantasybl, hippodrm, ffantasybl, ffantasybl, dec0_state, init_ffant
GAME( 1988, drgninjab2, baddudes, drgninjab, drgninja, dec0_state, init_drgninja, ROT0, "bootleg", "Dragonninja (bootleg with 68705)", MACHINE_SUPPORTS_SAVE ) // is this the same board as above? (region warning hacked to World, but still shows Japanese text)
// these are different to the above but quite similar to each other
-GAME( 1988, automat, robocop, automat, robocop, dec0_automat_state, init_robocop, ROT0, "bootleg", "Automat (bootleg of Robocop)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // sound rom / music from section z with mods for ADPCM?
+GAME( 1988, automat, robocop, automat, robocop, dec0_automat_state, empty_init, ROT0, "bootleg", "Automat (bootleg of Robocop)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // sound rom / music from section z with mods for ADPCM?
GAME( 1989, secretab, secretag, secretab, slyspy, dec0_automat_state, empty_init, ROT0, "bootleg", "Secret Agent (bootleg)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/deco32.cpp b/src/mame/drivers/deco32.cpp
index e182c7bcd40..504f35ed748 100644
--- a/src/mame/drivers/deco32.cpp
+++ b/src/mame/drivers/deco32.cpp
@@ -650,8 +650,6 @@ void deco32_state::h6280_sound_map(address_map &map)
map(0x130000, 0x130001).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x140000, 0x140000).r(m_ioprot, FUNC(deco_146_base_device::soundlatch_r));
map(0x1f0000, 0x1f1fff).ram();
- map(0x1fec00, 0x1fec01).rw("audiocpu", FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w)).mirror(0x3fe);
- map(0x1ff400, 0x1ff403).rw("audiocpu", FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w)).mirror(0x3fc);
}
void deco32_state::h6280_sound_custom_latch_map(address_map &map)
@@ -1869,8 +1867,10 @@ MACHINE_CONFIG_START(captaven_state::captaven)
MCFG_DEVICE_ADD("maincpu", ARM, XTAL(28'000'000)/4) /* verified on pcb (Data East 101 custom)*/
MCFG_DEVICE_PROGRAM_MAP(captaven_map)
- MCFG_DEVICE_ADD("audiocpu", H6280, XTAL(32'220'000)/4/3) /* pin 10 is 32mhz/4, pin 14 is High so internal divisor is 3 (verified on pcb) */
- MCFG_DEVICE_PROGRAM_MAP(h6280_sound_map)
+ h6280_device &audiocpu(H6280(config, m_audiocpu, XTAL(32'220'000)/4/3)); /* pin 10 is 32mhz/4, pin 14 is High so internal divisor is 3 (verified on pcb) */
+ audiocpu.set_addrmap(AS_PROGRAM, h6280_sound_map);
+ audiocpu.add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused
+ audiocpu.add_route(ALL_OUTPUTS, "rspeaker", 0);
MCFG_INPUT_MERGER_ANY_HIGH("irq_merger")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", ARM_IRQ_LINE))
@@ -1956,8 +1956,10 @@ MACHINE_CONFIG_START(fghthist_state::fghthist)
MCFG_DEVICE_PROGRAM_MAP(fghthist_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", deco32_state, irq0_line_assert)
- MCFG_DEVICE_ADD("audiocpu", H6280, XTAL(32'220'000) / 8)
- MCFG_DEVICE_PROGRAM_MAP(h6280_sound_custom_latch_map)
+ h6280_device &audiocpu(H6280(config, m_audiocpu, XTAL(32'220'000) / 8));
+ audiocpu.set_addrmap(AS_PROGRAM, h6280_sound_custom_latch_map);
+ audiocpu.add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused
+ audiocpu.add_route(ALL_OUTPUTS, "rspeaker", 0);
MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT)
@@ -2079,8 +2081,10 @@ MACHINE_CONFIG_START(dragngun_state::dragngun)
MCFG_DEVICE_ADD("maincpu", ARM, XTAL(28'000'000) / 4)
MCFG_DEVICE_PROGRAM_MAP(dragngun_map)
- MCFG_DEVICE_ADD("audiocpu", H6280, 32220000/8)
- MCFG_DEVICE_PROGRAM_MAP(h6280_sound_map)
+ h6280_device &audiocpu(H6280(config, m_audiocpu, 32220000/8));
+ audiocpu.set_addrmap(AS_PROGRAM, h6280_sound_map);
+ audiocpu.add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused
+ audiocpu.add_route(ALL_OUTPUTS, "rspeaker", 0);
MCFG_INPUT_MERGER_ANY_HIGH("irq_merger")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", ARM_IRQ_LINE))
@@ -2469,9 +2473,12 @@ MACHINE_CONFIG_END
// the US release uses a H6280 instead of a Z80, much like Lock 'n' Loaded
MACHINE_CONFIG_START(nslasher_state::nslasheru)
nslasher(config);
+ MCFG_DEVICE_REMOVE("audiocpu")
- MCFG_DEVICE_REPLACE("audiocpu", H6280, 32220000/8)
- MCFG_DEVICE_PROGRAM_MAP(h6280_sound_map)
+ h6280_device &audiocpu(H6280(config, m_audiocpu, 32220000/8));
+ audiocpu.set_addrmap(AS_PROGRAM, h6280_sound_map);
+ audiocpu.add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused
+ audiocpu.add_route(ALL_OUTPUTS, "rspeaker", 0);
MCFG_DEVICE_REMOVE("sound_irq_merger")
diff --git a/src/mame/drivers/dietgo.cpp b/src/mame/drivers/dietgo.cpp
index 9ce2b3f3273..6f1076ee6ca 100644
--- a/src/mame/drivers/dietgo.cpp
+++ b/src/mame/drivers/dietgo.cpp
@@ -82,8 +82,6 @@ void dietgo_state::sound_map(address_map &map)
map(0x130000, 0x130001).noprw(); /* This board only has 1 oki chip */
map(0x140000, 0x140000).r(m_deco104, FUNC(deco104_device::soundlatch_r));
map(0x1f0000, 0x1f1fff).ram();
- map(0x1fec00, 0x1fec01).rw(m_audiocpu, FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w)).mirror(0x3fe);
- map(0x1ff400, 0x1ff403).rw(m_audiocpu, FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w)).mirror(0x3fc);
}
@@ -204,7 +202,7 @@ GFXDECODE_END
DECO16IC_BANK_CB_MEMBER(dietgo_state::bank_callback)
{
- return ((bank >> 4) & 0x7) * 0x1000;
+ return (bank & 0x70) << 8;
}
MACHINE_CONFIG_START(dietgo_state::dietgo)
@@ -215,8 +213,9 @@ MACHINE_CONFIG_START(dietgo_state::dietgo)
MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", dietgo_state, irq6_line_hold)
- MCFG_DEVICE_ADD("audiocpu", H6280, XTAL(32'220'000)/4/3) /* Custom chip 45; XIN is 32.220MHZ/4, verified on pcb */
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ H6280(config, m_audiocpu, XTAL(32'220'000)/4/3); /* Custom chip 45; XIN is 32.220MHZ/4, verified on pcb */
+ m_audiocpu->set_addrmap(AS_PROGRAM, sound_map);
+ m_audiocpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/funkyjet.cpp b/src/mame/drivers/funkyjet.cpp
index bd52ed1bcfd..3f95be92f50 100644
--- a/src/mame/drivers/funkyjet.cpp
+++ b/src/mame/drivers/funkyjet.cpp
@@ -157,8 +157,6 @@ void funkyjet_state::sound_map(address_map &map)
map(0x130000, 0x130001).noprw(); /* This board only has 1 oki chip */
map(0x140000, 0x140000).r(m_deco146, FUNC(deco146_device::soundlatch_r));
map(0x1f0000, 0x1f1fff).ram();
- map(0x1fec00, 0x1fec01).rw(m_audiocpu, FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w)).mirror(0x3fe);
- map(0x1ff400, 0x1ff403).rw(m_audiocpu, FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w)).mirror(0x3fc);
}
/******************************************************************************/
@@ -311,8 +309,10 @@ MACHINE_CONFIG_START(funkyjet_state::funkyjet)
MCFG_DEVICE_PROGRAM_MAP(funkyjet_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", funkyjet_state, irq6_line_hold)
- MCFG_DEVICE_ADD("audiocpu", H6280, XTAL(32'220'000)/4) /* Custom chip 45, Audio section crystal is 32.220 MHz */
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ H6280(config, m_audiocpu, XTAL(32'220'000)/4); /* Custom chip 45, Audio section crystal is 32.220 MHz */
+ m_audiocpu->set_addrmap(AS_PROGRAM, sound_map);
+ m_audiocpu->add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused
+ m_audiocpu->add_route(ALL_OUTPUTS, "rspeaker", 0);
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/ggconnie.cpp b/src/mame/drivers/ggconnie.cpp
index 94ddd0f3338..f3204a1fdba 100644
--- a/src/mame/drivers/ggconnie.cpp
+++ b/src/mame/drivers/ggconnie.cpp
@@ -24,7 +24,6 @@
#include "video/huc6270.h"
#include "video/huc6260.h"
#include "video/huc6202.h"
-#include "sound/c6280.h"
#include "sound/okim6295.h"
#include "machine/msm6242.h"
#include "screen.h"
@@ -78,19 +77,15 @@ void ggconnie_state::sgx_mem(address_map &map)
map(0x1f7000, 0x1f7000).portr("SWA");
map(0x1f7100, 0x1f7100).portr("SWB");
map(0x1f7200, 0x1f7200).portr("SWC");
+ map(0x1f7300, 0x1f7300).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write));
+ map(0x1f7400, 0x1f74ff).w(FUNC(ggconnie_state::oki_bank_w));
+ map(0x1f7500, 0x1f750f).rw(m_rtc, FUNC(msm6242_device::read), FUNC(msm6242_device::write));
map(0x1f7700, 0x1f7700).portr("IN1");
map(0x1f7800, 0x1f7800).w(FUNC(ggconnie_state::output_w));
map(0x1fe000, 0x1fe007).rw("huc6270_0", FUNC(huc6270_device::read), FUNC(huc6270_device::write)).mirror(0x03E0);
map(0x1fe008, 0x1fe00f).rw("huc6202", FUNC(huc6202_device::read), FUNC(huc6202_device::write)).mirror(0x03E0);
map(0x1fe010, 0x1fe017).rw("huc6270_1", FUNC(huc6270_device::read), FUNC(huc6270_device::write)).mirror(0x03E0);
map(0x1fe400, 0x1fe7ff).rw(m_huc6260, FUNC(huc6260_device::read), FUNC(huc6260_device::write));
- map(0x1fe800, 0x1febff).rw("c6280", FUNC(c6280_device::c6280_r), FUNC(c6280_device::c6280_w));
- map(0x1fec00, 0x1fefff).rw(m_maincpu, FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w));
- map(0x1f7300, 0x1f7300).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write));
- map(0x1f7400, 0x1f74ff).w(FUNC(ggconnie_state::oki_bank_w));
- map(0x1f7500, 0x1f750f).rw(m_rtc, FUNC(msm6242_device::read), FUNC(msm6242_device::write));
- map(0x1ff000, 0x1ff000).portr("IN0").w(FUNC(ggconnie_state::lamp_w));
- map(0x1ff400, 0x1ff7ff).rw(m_maincpu, FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w));
}
void ggconnie_state::sgx_io(address_map &map)
@@ -269,9 +264,13 @@ INPUT_PORTS_END
MACHINE_CONFIG_START(ggconnie_state::ggconnie)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", H6280, PCE_MAIN_CLOCK/3)
- MCFG_DEVICE_PROGRAM_MAP(sgx_mem)
- MCFG_DEVICE_IO_MAP(sgx_io)
+ H6280(config, m_maincpu, PCE_MAIN_CLOCK/3);
+ m_maincpu->set_addrmap(AS_PROGRAM, sgx_mem);
+ m_maincpu->set_addrmap(AS_IO, sgx_io);
+ m_maincpu->port_in_cb().set_ioport("IN0");
+ m_maincpu->port_out_cb().set(FUNC(ggconnie_state::lamp_w));
+ m_maincpu->add_route(0, "lspeaker", 1.00);
+ m_maincpu->add_route(1, "rspeaker", 1.00);
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -308,10 +307,6 @@ MACHINE_CONFIG_START(ggconnie_state::ggconnie)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("c6280", C6280, PCE_MAIN_CLOCK/6)
- MCFG_C6280_CPU("maincpu")
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.00)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.00)
MCFG_DEVICE_ADD("oki", OKIM6295, PCE_MAIN_CLOCK/12, okim6295_device::PIN7_HIGH) /* unknown clock / pin 7 */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.00)
@@ -345,4 +340,4 @@ ROM_START(smf)
ROM_END
GAME( 1996, ggconnie, 0, ggconnie, ggconnie, ggconnie_state, init_pce_common, ROT0, "Eighting", "Go! Go! Connie chan Jaka Jaka Janken", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING )
-GAME( 1997, smf, 0, ggconnie, smf, ggconnie_state, init_pce_common, ROT0, "Eighting", "Super Medal Fighters (Japan 970228)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING )
+GAME( 1997, smf, 0, ggconnie, smf, ggconnie_state, init_pce_common, ROT0, "Eighting (Capcom license)", "Super Medal Fighters (Japan 970228)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING )
diff --git a/src/mame/drivers/madmotor.cpp b/src/mame/drivers/madmotor.cpp
index 51877c3130b..5c12d2eded7 100644
--- a/src/mame/drivers/madmotor.cpp
+++ b/src/mame/drivers/madmotor.cpp
@@ -104,8 +104,6 @@ void madmotor_state::sound_map(address_map &map)
map(0x130000, 0x130001).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x140000, 0x140001).r("soundlatch", FUNC(generic_latch_8_device::read));
map(0x1f0000, 0x1f1fff).ram();
- map(0x1fec00, 0x1fec01).rw(m_audiocpu, FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w)).mirror(0x3fe);
- map(0x1ff400, 0x1ff403).rw(m_audiocpu, FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w)).mirror(0x3fc);
}
/******************************************************************************/
@@ -267,8 +265,9 @@ MACHINE_CONFIG_START(madmotor_state::madmotor)
MCFG_DEVICE_PROGRAM_MAP(madmotor_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", madmotor_state, irq6_line_hold)/* VBL */
- MCFG_DEVICE_ADD("audiocpu", H6280, 8053000/2) /* Custom chip 45, Crystal near CPU is 8.053 MHz */
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ H6280(config, m_audiocpu, 8053000/2); /* Custom chip 45, Crystal near CPU is 8.053 MHz */
+ m_audiocpu->set_addrmap(AS_PROGRAM, sound_map);
+ m_audiocpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/paranoia.cpp b/src/mame/drivers/paranoia.cpp
index cf1bcd51027..12dac0ee646 100644
--- a/src/mame/drivers/paranoia.cpp
+++ b/src/mame/drivers/paranoia.cpp
@@ -44,7 +44,6 @@ HuC6280A (Hudson)
#include "video/huc6260.h"
#include "video/huc6270.h"
#include "cpu/h6280/h6280.h"
-#include "sound/c6280.h"
#include "screen.h"
#include "speaker.h"
@@ -86,10 +85,6 @@ void paranoia_state::pce_mem(address_map &map)
map(0x1F0000, 0x1F1FFF).ram().mirror(0x6000);
map(0x1FE000, 0x1FE3FF).rw("huc6270", FUNC(huc6270_device::read), FUNC(huc6270_device::write));
map(0x1FE400, 0x1FE7FF).rw(m_huc6260, FUNC(huc6260_device::read), FUNC(huc6260_device::write));
- map(0x1FE800, 0x1FEBFF).rw("c6280", FUNC(c6280_device::c6280_r), FUNC(c6280_device::c6280_w));
- map(0x1FEC00, 0x1FEFFF).rw(m_maincpu, FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w));
- map(0x1FF000, 0x1FF3FF).rw(FUNC(paranoia_state::pce_joystick_r), FUNC(paranoia_state::pce_joystick_w));
- map(0x1FF400, 0x1FF7FF).rw(m_maincpu, FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w));
}
void paranoia_state::pce_io(address_map &map)
@@ -172,9 +167,14 @@ WRITE_LINE_MEMBER(paranoia_state::i8155_timer_out)
MACHINE_CONFIG_START(paranoia_state::paranoia)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", H6280, PCE_MAIN_CLOCK/3)
- MCFG_DEVICE_PROGRAM_MAP(pce_mem)
- MCFG_DEVICE_IO_MAP(pce_io)
+ H6280(config, m_maincpu, PCE_MAIN_CLOCK/3);
+ m_maincpu->set_addrmap(AS_PROGRAM, pce_mem);
+ m_maincpu->set_addrmap(AS_IO, pce_io);
+ m_maincpu->port_in_cb().set(FUNC(paranoia_state::pce_joystick_r));
+ m_maincpu->port_out_cb().set(FUNC(paranoia_state::pce_joystick_w));
+ m_maincpu->add_route(0, "lspeaker", 1.00);
+ m_maincpu->add_route(1, "rspeaker", 1.00);
+
MCFG_QUANTUM_TIME(attotime::from_hz(60))
MCFG_DEVICE_ADD("sub", I8085A, 18000000/3)
@@ -208,11 +208,6 @@ MACHINE_CONFIG_START(paranoia_state::paranoia)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("c6280", C6280, PCE_MAIN_CLOCK/6)
- MCFG_C6280_CPU("maincpu")
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.00)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.00)
-
MACHINE_CONFIG_END
ROM_START(paranoia)
diff --git a/src/mame/drivers/pce.cpp b/src/mame/drivers/pce.cpp
index 81fa170ec2c..2b322c7287d 100644
--- a/src/mame/drivers/pce.cpp
+++ b/src/mame/drivers/pce.cpp
@@ -61,7 +61,6 @@ Super System Card:
#include "bus/pce/pce_rom.h"
#include "cpu/h6280/h6280.h"
-#include "sound/c6280.h"
#include "sound/cdda.h"
#include "sound/msm5205.h"
#include "video/huc6202.h"
@@ -259,10 +258,6 @@ void pce_state::pce_mem(address_map &map)
map(0x1F0000, 0x1F1FFF).ram().mirror(0x6000).share("user_ram");
map(0x1FE000, 0x1FE3FF).rw("huc6270", FUNC(huc6270_device::read), FUNC(huc6270_device::write));
map(0x1FE400, 0x1FE7FF).rw(m_huc6260, FUNC(huc6260_device::read), FUNC(huc6260_device::write));
- map(0x1FE800, 0x1FEBFF).rw(C6280_TAG, FUNC(c6280_device::c6280_r), FUNC(c6280_device::c6280_w));
- map(0x1FEC00, 0x1FEFFF).rw(m_maincpu, FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w));
- map(0x1FF000, 0x1FF3FF).rw(FUNC(pce_state::mess_pce_joystick_r), FUNC(pce_state::mess_pce_joystick_w));
- map(0x1FF400, 0x1FF7FF).rw(m_maincpu, FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w));
map(0x1FF800, 0x1FFBFF).rw(FUNC(pce_state::pce_cd_intf_r), FUNC(pce_state::pce_cd_intf_w));
}
@@ -284,10 +279,6 @@ void pce_state::sgx_mem(address_map &map)
map(0x1FE008, 0x1FE00F).rw("huc6202", FUNC(huc6202_device::read), FUNC(huc6202_device::write)).mirror(0x03E0);
map(0x1FE010, 0x1FE017).rw("huc6270_1", FUNC(huc6270_device::read), FUNC(huc6270_device::write)).mirror(0x03E0);
map(0x1FE400, 0x1FE7FF).rw(m_huc6260, FUNC(huc6260_device::read), FUNC(huc6260_device::write));
- map(0x1FE800, 0x1FEBFF).rw(C6280_TAG, FUNC(c6280_device::c6280_r), FUNC(c6280_device::c6280_w));
- map(0x1FEC00, 0x1FEFFF).rw(m_maincpu, FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w));
- map(0x1FF000, 0x1FF3FF).rw(FUNC(pce_state::mess_pce_joystick_r), FUNC(pce_state::mess_pce_joystick_w));
- map(0x1FF400, 0x1FF7FF).rw(m_maincpu, FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w));
map(0x1FF800, 0x1FFBFF).rw(FUNC(pce_state::pce_cd_intf_r), FUNC(pce_state::pce_cd_intf_w));
}
@@ -316,9 +307,14 @@ static void pce_cart(device_slot_interface &device)
MACHINE_CONFIG_START(pce_state::pce_common)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", H6280, MAIN_CLOCK/3)
- MCFG_DEVICE_PROGRAM_MAP(pce_mem)
- MCFG_DEVICE_IO_MAP(pce_io)
+ H6280(config, m_maincpu, MAIN_CLOCK/3);
+ m_maincpu->set_addrmap(AS_PROGRAM, pce_mem);
+ m_maincpu->set_addrmap(AS_IO, pce_io);
+ m_maincpu->port_in_cb().set(FUNC(pce_state::mess_pce_joystick_r));
+ m_maincpu->port_out_cb().set(FUNC(pce_state::mess_pce_joystick_w));
+ m_maincpu->add_route(0, "lspeaker", 1.00);
+ m_maincpu->add_route(1, "rspeaker", 1.00);
+
MCFG_QUANTUM_TIME(attotime::from_hz(60))
MCFG_MACHINE_START_OVERRIDE(pce_state, pce )
@@ -342,10 +338,6 @@ MACHINE_CONFIG_START(pce_state::pce_common)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD(C6280_TAG, C6280, MAIN_CLOCK/6)
- MCFG_C6280_CPU("maincpu")
- MCFG_SOUND_ROUTE( 0, "lspeaker", 1.00 )
- MCFG_SOUND_ROUTE( 1, "rspeaker", 1.00 )
MCFG_PCE_CD_ADD("pce_cd")
@@ -369,9 +361,14 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(pce_state::sgx)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", H6280, MAIN_CLOCK/3)
- MCFG_DEVICE_PROGRAM_MAP(sgx_mem)
- MCFG_DEVICE_IO_MAP(sgx_io)
+ H6280(config, m_maincpu, MAIN_CLOCK/3);
+ m_maincpu->set_addrmap(AS_PROGRAM, sgx_mem);
+ m_maincpu->set_addrmap(AS_IO, sgx_io);
+ m_maincpu->port_in_cb().set(FUNC(pce_state::mess_pce_joystick_r));
+ m_maincpu->port_out_cb().set(FUNC(pce_state::mess_pce_joystick_w));
+ m_maincpu->add_route(0, "lspeaker", 1.00);
+ m_maincpu->add_route(1, "rspeaker", 1.00);
+
MCFG_QUANTUM_TIME(attotime::from_hz(60))
MCFG_MACHINE_START_OVERRIDE(pce_state, pce )
@@ -410,10 +407,6 @@ MACHINE_CONFIG_START(pce_state::sgx)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD(C6280_TAG, C6280, MAIN_CLOCK/6)
- MCFG_C6280_CPU("maincpu")
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.00)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.00)
MCFG_PCE_CARTRIDGE_ADD("cartslot", pce_cart, nullptr)
MCFG_SOFTWARE_LIST_ADD("cart_list","sgx")
diff --git a/src/mame/drivers/rohga.cpp b/src/mame/drivers/rohga.cpp
index 4a99049c2f1..2cc20950377 100644
--- a/src/mame/drivers/rohga.cpp
+++ b/src/mame/drivers/rohga.cpp
@@ -314,8 +314,6 @@ void rohga_state::sound_map(address_map &map)
map(0x130000, 0x130001).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x140000, 0x140000).r(m_ioprot, FUNC(deco_146_base_device::soundlatch_r));
map(0x1f0000, 0x1f1fff).ram();
- map(0x1fec00, 0x1fec01).rw(m_audiocpu, FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w)).mirror(0x3fe);
- map(0x1ff400, 0x1ff403).rw(m_audiocpu, FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w)).mirror(0x3fc);
}
@@ -880,8 +878,10 @@ MACHINE_CONFIG_START(rohga_state::rohga)
MCFG_DEVICE_PROGRAM_MAP(rohga_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", rohga_state, irq6_line_assert)
- MCFG_DEVICE_ADD("audiocpu", H6280, 32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ H6280(config, m_audiocpu, 32220000/4/3); /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */
+ m_audiocpu->set_addrmap(AS_PROGRAM, sound_map);
+ m_audiocpu->add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused
+ m_audiocpu->add_route(ALL_OUTPUTS, "rspeaker", 0);
/* video hardware */
MCFG_DEVICE_ADD("spriteram1", BUFFERED_SPRITERAM16)
@@ -970,8 +970,10 @@ MACHINE_CONFIG_START(rohga_state::wizdfire)
MCFG_DEVICE_PROGRAM_MAP(wizdfire_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", rohga_state, irq6_line_assert)
- MCFG_DEVICE_ADD("audiocpu", H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ H6280(config, m_audiocpu, 32220000/4/3); /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */
+ m_audiocpu->set_addrmap(AS_PROGRAM, sound_map);
+ m_audiocpu->add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused
+ m_audiocpu->add_route(ALL_OUTPUTS, "rspeaker", 0);
/* video hardware */
MCFG_DEVICE_ADD("spriteram1", BUFFERED_SPRITERAM16)
@@ -1065,8 +1067,10 @@ MACHINE_CONFIG_START(rohga_state::nitrobal)
MCFG_DEVICE_PROGRAM_MAP(nitrobal_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", rohga_state, irq6_line_assert)
- MCFG_DEVICE_ADD("audiocpu", H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ H6280(config, m_audiocpu, 32220000/4/3); /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */
+ m_audiocpu->set_addrmap(AS_PROGRAM, sound_map);
+ m_audiocpu->add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused
+ m_audiocpu->add_route(ALL_OUTPUTS, "rspeaker", 0);
/* video hardware */
MCFG_DEVICE_ADD("spriteram1", BUFFERED_SPRITERAM16)
@@ -1161,8 +1165,10 @@ MACHINE_CONFIG_START(rohga_state::schmeisr)
MCFG_DEVICE_PROGRAM_MAP(schmeisr_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", rohga_state, irq6_line_assert)
- MCFG_DEVICE_ADD("audiocpu", H6280,32220000/4/3) /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ H6280(config, m_audiocpu, 32220000/4/3); /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */
+ m_audiocpu->set_addrmap(AS_PROGRAM, sound_map);
+ m_audiocpu->add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused
+ m_audiocpu->add_route(ALL_OUTPUTS, "rspeaker", 0);
/* video hardware */
MCFG_DEVICE_ADD("spriteram1", BUFFERED_SPRITERAM16)
diff --git a/src/mame/drivers/supbtime.cpp b/src/mame/drivers/supbtime.cpp
index 8f8df46fd98..bf9c14be2f5 100644
--- a/src/mame/drivers/supbtime.cpp
+++ b/src/mame/drivers/supbtime.cpp
@@ -143,8 +143,6 @@ void supbtime_state::sound_map(address_map &map)
map(0x130000, 0x130001).noprw(); // This board only has 1 oki chip
map(0x140000, 0x140001).r("soundlatch", FUNC(generic_latch_8_device::read));
map(0x1f0000, 0x1f1fff).ram();
- map(0x1fec00, 0x1fec01).rw(m_audiocpu, FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w)).mirror(0x3fe);
- map(0x1ff400, 0x1ff403).rw(m_audiocpu, FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w)).mirror(0x3fc);
}
@@ -343,8 +341,9 @@ MACHINE_CONFIG_START(supbtime_state::supbtime)
MCFG_DEVICE_ADD("maincpu", M68000, XTAL(28'000'000) / 2)
MCFG_DEVICE_PROGRAM_MAP(supbtime_map)
- MCFG_DEVICE_ADD("audiocpu", H6280, XTAL(32'220'000) / 8)
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ H6280(config, m_audiocpu, XTAL(32'220'000) / 8);
+ m_audiocpu->set_addrmap(AS_PROGRAM, sound_map);
+ m_audiocpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
// video hardware
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/tourvis.cpp b/src/mame/drivers/tourvis.cpp
index d34046908d2..77e0df9c929 100644
--- a/src/mame/drivers/tourvis.cpp
+++ b/src/mame/drivers/tourvis.cpp
@@ -180,7 +180,6 @@ http://blog.system11.org/?p=1943
#include "cpu/i8085/i8085.h"
#include "video/huc6260.h"
#include "video/huc6270.h"
-#include "sound/c6280.h"
#include "machine/i8155.h"
#include "bus/generic/slot.h"
@@ -341,10 +340,6 @@ void tourvision_state::pce_mem(address_map &map)
map(0x1F0000, 0x1F1FFF).ram().mirror(0x6000);
map(0x1FE000, 0x1FE3FF).rw("huc6270", FUNC(huc6270_device::read), FUNC(huc6270_device::write));
map(0x1FE400, 0x1FE7FF).rw(m_huc6260, FUNC(huc6260_device::read), FUNC(huc6260_device::write));
- map(0x1FE800, 0x1FEBFF).rw("c6280", FUNC(c6280_device::c6280_r), FUNC(c6280_device::c6280_w));
- map(0x1FEC00, 0x1FEFFF).rw(m_maincpu, FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w));
- map(0x1FF000, 0x1FF3FF).rw(FUNC(tourvision_state::pce_joystick_r), FUNC(tourvision_state::pce_joystick_w));
- map(0x1FF400, 0x1FF7FF).rw(m_maincpu, FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w));
}
void tourvision_state::pce_io(address_map &map)
@@ -396,9 +391,14 @@ WRITE_LINE_MEMBER(tourvision_state::tourvision_timer_out)
MACHINE_CONFIG_START(tourvision_state::tourvision)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", H6280, PCE_MAIN_CLOCK/3)
- MCFG_DEVICE_PROGRAM_MAP(pce_mem)
- MCFG_DEVICE_IO_MAP(pce_io)
+ H6280(config, m_maincpu, PCE_MAIN_CLOCK/3);
+ m_maincpu->set_addrmap(AS_PROGRAM, pce_mem);
+ m_maincpu->set_addrmap(AS_IO, pce_io);
+ m_maincpu->port_in_cb().set(FUNC(tourvision_state::pce_joystick_r));
+ m_maincpu->port_out_cb().set(FUNC(tourvision_state::pce_joystick_w));
+ m_maincpu->add_route(0, "lspeaker", 1.00);
+ m_maincpu->add_route(1, "rspeaker", 1.00);
+
MCFG_QUANTUM_TIME(attotime::from_hz(60))
MCFG_DEVICE_ADD("subcpu", I8085A, 18000000/3 /*?*/)
@@ -427,10 +427,6 @@ MACHINE_CONFIG_START(tourvision_state::tourvision)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("c6280", C6280, PCE_MAIN_CLOCK/6)
- MCFG_C6280_CPU("maincpu")
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.00)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.00)
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "tourvision_cart")
MCFG_GENERIC_EXTENSIONS("bin")
diff --git a/src/mame/drivers/uapce.cpp b/src/mame/drivers/uapce.cpp
index 44dc5315740..5fbf2ceb453 100644
--- a/src/mame/drivers/uapce.cpp
+++ b/src/mame/drivers/uapce.cpp
@@ -99,7 +99,6 @@ Alien Crush & Pac_Land: dumps made from PC-Engine dumps of JP versions
#include "cpu/z80/z80.h"
#include "video/huc6260.h"
#include "video/huc6270.h"
-#include "sound/c6280.h"
#include "sound/discrete.h"
#include "screen.h"
@@ -296,10 +295,6 @@ void uapce_state::pce_mem(address_map &map)
map(0x1F0000, 0x1F1FFF).ram().mirror(0x6000);
map(0x1FE000, 0x1FE3FF).rw("huc6270", FUNC(huc6270_device::read), FUNC(huc6270_device::write));
map(0x1FE400, 0x1FE7FF).rw(m_huc6260, FUNC(huc6260_device::read), FUNC(huc6260_device::write));
- map(0x1FE800, 0x1FEBFF).rw("c6280", FUNC(c6280_device::c6280_r), FUNC(c6280_device::c6280_w));
- map(0x1FEC00, 0x1FEFFF).rw(m_maincpu, FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w));
- map(0x1FF000, 0x1FF3FF).rw(FUNC(uapce_state::pce_joystick_r), FUNC(uapce_state::pce_joystick_w));
- map(0x1FF400, 0x1FF7FF).rw(m_maincpu, FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w));
}
void uapce_state::pce_io(address_map &map)
@@ -310,9 +305,13 @@ void uapce_state::pce_io(address_map &map)
MACHINE_CONFIG_START(uapce_state::uapce)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", H6280, PCE_MAIN_CLOCK/3)
- MCFG_DEVICE_PROGRAM_MAP(pce_mem)
- MCFG_DEVICE_IO_MAP(pce_io)
+ H6280(config, m_maincpu, PCE_MAIN_CLOCK/3);
+ m_maincpu->set_addrmap(AS_PROGRAM, pce_mem);
+ m_maincpu->set_addrmap(AS_IO, pce_io);
+ m_maincpu->port_in_cb().set(FUNC(uapce_state::pce_joystick_r));
+ m_maincpu->port_out_cb().set(FUNC(uapce_state::pce_joystick_w));
+ m_maincpu->add_route(0, "lspeaker", 0.5);
+ m_maincpu->add_route(1, "rspeaker", 0.5);
MCFG_DEVICE_ADD("sub", Z80, 1400000)
MCFG_DEVICE_PROGRAM_MAP(z80_map)
@@ -336,10 +335,6 @@ MACHINE_CONFIG_START(uapce_state::uapce)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("c6280", C6280, PCE_MAIN_CLOCK/6)
- MCFG_C6280_CPU("maincpu")
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.5)
- MCFG_SOUND_ROUTE(1, "rspeaker", 0.5)
MCFG_DEVICE_ADD("discrete", DISCRETE, uapce_discrete)
MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
diff --git a/src/mame/drivers/vaportra.cpp b/src/mame/drivers/vaportra.cpp
index 6b6700ae286..2e57ee02733 100644
--- a/src/mame/drivers/vaportra.cpp
+++ b/src/mame/drivers/vaportra.cpp
@@ -77,8 +77,6 @@ void vaportra_state::sound_map(address_map &map)
map(0x130000, 0x130001).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x140000, 0x140001).r(m_soundlatch, FUNC(generic_latch_8_device::read));
map(0x1f0000, 0x1f1fff).ram();
- map(0x1fec00, 0x1fec01).rw(m_audiocpu, FUNC(h6280_device::timer_r), FUNC(h6280_device::timer_w)).mirror(0x3fe);
- map(0x1ff400, 0x1ff403).rw(m_audiocpu, FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w)).mirror(0x3fc);
}
/******************************************************************************/
@@ -216,9 +214,9 @@ MACHINE_CONFIG_START(vaportra_state::vaportra)
MCFG_DEVICE_PROGRAM_MAP(main_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", vaportra_state, irq6_line_assert)
- MCFG_DEVICE_ADD(m_audiocpu, H6280, XTAL(24'000'000)/4) /* Custom chip 45; Audio section crystal is 32.220 MHz but CPU clock is confirmed as coming from the 24MHz crystal (6Mhz exactly on the CPU) */
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
-
+ H6280(config, m_audiocpu, XTAL(24'000'000)/4); /* Custom chip 45; Audio section crystal is 32.220 MHz but CPU clock is confirmed as coming from the 24MHz crystal (6Mhz exactly on the CPU) */
+ m_audiocpu->set_addrmap(AS_PROGRAM, sound_map);
+ m_audiocpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
/* video hardware */
MCFG_DEVICE_ADD(m_spriteram, BUFFERED_SPRITERAM16)
diff --git a/src/mame/drivers/vgmplay.cpp b/src/mame/drivers/vgmplay.cpp
index 8b288034d25..008171f621b 100644
--- a/src/mame/drivers/vgmplay.cpp
+++ b/src/mame/drivers/vgmplay.cpp
@@ -3033,7 +3033,6 @@ MACHINE_CONFIG_START(vgmplay_state::vgmplay)
m_h6280[0]->set_disable();
C6280(config, m_c6280[0], 0);
- m_c6280[0]->set_devicecpu_tag("h6280.0");
m_c6280[0]->add_route(0, "lspeaker", 1);
m_c6280[0]->add_route(1, "rspeaker", 1);
@@ -3041,7 +3040,6 @@ MACHINE_CONFIG_START(vgmplay_state::vgmplay)
m_h6280[1]->set_disable();
C6280(config, m_c6280[1], 0);
- m_c6280[1]->set_devicecpu_tag("h6280.1");
m_c6280[1]->add_route(0, "lspeaker", 1);
m_c6280[1]->add_route(1, "rspeaker", 1);
diff --git a/src/mame/drivers/x1twin.cpp b/src/mame/drivers/x1twin.cpp
index 8c2eec0fd30..50ad22bb3b7 100644
--- a/src/mame/drivers/x1twin.cpp
+++ b/src/mame/drivers/x1twin.cpp
@@ -74,10 +74,6 @@ void x1twin_state::pce_mem(address_map &map)
map(0x1F0000, 0x1F1FFF).ram().mirror(0x6000);
map(0x1FE000, 0x1FE3FF).rw(FUNC(x1twin_state::vdc_r), FUNC(x1twin_state::vdc_w));
map(0x1FE400, 0x1FE7FF).rw(FUNC(x1twin_state::vce_r), FUNC(x1twin_state::vce_w));
- map(0x1FE800, 0x1FEBFF).rw("c6280", FUNC(c6280_device::c6280_r), FUNC(c6280_device::c6280_w));
- map(0x1FEC00, 0x1FEFFF).rw(FUNC(x1twin_state::h6280_timer_r), FUNC(x1twin_state::h6280_timer_w));
- map(0x1FF000, 0x1FF3FF).rw(FUNC(x1twin_state::pce_joystick_r), FUNC(x1twin_state::pce_joystick_w));
- map(0x1FF400, 0x1FF7FF).rw("maincpu", FUNC(h6280_device::irq_status_r), FUNC(h6280_device::irq_status_w));
}
void x1twin_state::pce_io(address_map &map)
@@ -448,9 +444,14 @@ MACHINE_CONFIG_START(x1twin_state::x1twin)
MCFG_MACHINE_RESET_OVERRIDE(x1twin_state,x1)
#if 0
- MCFG_DEVICE_ADD("pce_cpu", H6280, PCE_MAIN_CLOCK/3)
- MCFG_DEVICE_PROGRAM_MAP(pce_mem)
- MCFG_DEVICE_IO_MAP(pce_io)
+ H6280(config, m_maincpu, PCE_MAIN_CLOCK/3);
+ m_maincpu->set_addrmap(AS_PROGRAM, pce_mem);
+ m_maincpu->set_addrmap(AS_IO, pce_io);
+ m_maincpu->port_in_cb().set(FUNC(x1twin_state::pce_joystick_r));
+ m_maincpu->port_out_cb().set(FUNC(x1twin_state::pce_joystick_w));
+ m_maincpu->add_route(0, "pce_l", 0.5);
+ m_maincpu->add_route(1, "pce_r", 0.5);
+
MCFG_TIMER_ADD_SCANLINE("scantimer", pce_interrupt, "pce_screen", 0, 1)
#endif
@@ -519,13 +520,6 @@ MACHINE_CONFIG_START(x1twin_state::x1twin)
MCFG_SOFTWARE_LIST_ADD("cass_list","x1_cass")
-#if 0
- MCFG_DEVICE_ADD("c6280", C6280, PCE_MAIN_CLOCK/6)
- MCFG_C6280_CPU("pce_cpu")
- MCFG_SOUND_ROUTE(0, "pce_l", 0.5)
- MCFG_SOUND_ROUTE(1, "pce_r", 0.5)
-#endif
-
MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", x1twin_state, x1_keyboard_callback, attotime::from_hz(250))
MCFG_TIMER_DRIVER_ADD_PERIODIC("cmt_wind_timer", x1twin_state, x1_cmt_wind_timer, attotime::from_hz(16))
MACHINE_CONFIG_END
diff --git a/src/mame/includes/actfancr.h b/src/mame/includes/actfancr.h
index 470306f3d4e..0907eb9e12b 100644
--- a/src/mame/includes/actfancr.h
+++ b/src/mame/includes/actfancr.h
@@ -15,19 +15,16 @@
class actfancr_state : public driver_device
{
public:
- actfancr_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_main_ram(*this, "main_ram"),
+ actfancr_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
- m_tilegen1(*this, "tilegen1"),
- m_tilegen2(*this, "tilegen2"),
+ m_tilegen(*this, "tilegen%u", 1U),
m_spritegen(*this, "spritegen"),
m_soundlatch(*this, "soundlatch") { }
/* memory pointers */
- required_shared_ptr<uint8_t> m_main_ram;
- uint16_t m_spriteram16[0x800/2]; // a 16-bit copy of spriteram for use with the MXC06 code
+ std::unique_ptr<uint16_t[]> m_spriteram16; // a 16-bit copy of spriteram for use with the MXC06 code
/* misc */
int m_trio_control_select;
@@ -35,17 +32,17 @@ public:
/* devices */
required_device<h6280_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
- required_device<deco_bac06_device> m_tilegen1;
- required_device<deco_bac06_device> m_tilegen2;
+ required_device_array<deco_bac06_device, 2> m_tilegen;
required_device<deco_mxc06_device> m_spritegen;
required_device<generic_latch_8_device> m_soundlatch;
DECLARE_WRITE8_MEMBER(triothep_control_select_w);
DECLARE_READ8_MEMBER(triothep_control_r);
- DECLARE_WRITE8_MEMBER(actfancr_buffer_spriteram_w);
+ DECLARE_WRITE8_MEMBER(buffer_spriteram_w);
DECLARE_MACHINE_START(triothep);
DECLARE_MACHINE_RESET(triothep);
- uint32_t screen_update_actfancr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ virtual void video_start() override;
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void triothep(machine_config &config);
void actfancr(machine_config &config);
void actfan_map(address_map &map);
diff --git a/src/mame/includes/battlera.h b/src/mame/includes/battlera.h
index e346c434618..f1bf7a6baa0 100644
--- a/src/mame/includes/battlera.h
+++ b/src/mame/includes/battlera.h
@@ -14,14 +14,14 @@ class battlera_state : public driver_device
{
public:
battlera_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu"),
- m_audiocpu(*this, "audiocpu"),
- m_msm(*this, "msm"),
- m_screen(*this, "screen"),
- m_huc6260(*this, "huc6260"),
- m_soundlatch(*this, "soundlatch")
- { }
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_audiocpu(*this, "audiocpu")
+ , m_msm(*this, "msm")
+ , m_screen(*this, "screen")
+ , m_huc6260(*this, "huc6260")
+ , m_soundlatch(*this, "soundlatch")
+ { }
required_device<h6280_device> m_maincpu;
required_device<h6280_device> m_audiocpu;
@@ -34,7 +34,6 @@ public:
int m_msm5205next;
int m_toggle;
- DECLARE_WRITE8_MEMBER(sound_w);
DECLARE_WRITE8_MEMBER(control_data_w);
DECLARE_READ8_MEMBER(control_data_r);
DECLARE_WRITE8_MEMBER(adpcm_data_w);
diff --git a/src/mame/includes/dec0.h b/src/mame/includes/dec0.h
index 35fd39abe44..7992836f726 100644
--- a/src/mame/includes/dec0.h
+++ b/src/mame/includes/dec0.h
@@ -12,14 +12,12 @@
class dec0_state : public driver_device
{
public:
- dec0_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ dec0_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_soundlatch(*this, "soundlatch"),
- m_tilegen1(*this, "tilegen1"),
- m_tilegen2(*this, "tilegen2"),
- m_tilegen3(*this, "tilegen3"),
+ m_tilegen(*this, "tilegen%u", 1U),
m_spritegen(*this, "spritegen"),
m_palette(*this, "palette"),
m_paletteram(*this, "palette"),
@@ -30,7 +28,8 @@ public:
m_ram(*this, "ram"),
m_spriteram(*this, "spriteram"),
m_robocop_shared_ram(*this, "robocop_shared"),
- m_hippodrm_shared_ram(*this, "hippodrm_shared") { }
+ m_hippodrm_shared_ram(*this, "hippodrm_shared")
+ { }
void dec0_base(machine_config &config);
void dec0(machine_config &config);
@@ -48,7 +47,6 @@ public:
void robocopb(machine_config &config);
void hippodrm(machine_config &config);
- void init_robocop();
void init_hippodrm();
void init_hbarrel();
void init_slyspy();
@@ -63,9 +61,7 @@ protected:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<generic_latch_8_device> m_soundlatch;
- optional_device<deco_bac06_device> m_tilegen1;
- optional_device<deco_bac06_device> m_tilegen2;
- optional_device<deco_bac06_device> m_tilegen3;
+ optional_device_array<deco_bac06_device, 3> m_tilegen;
optional_device<deco_mxc06_device> m_spritegen;
required_device<palette_device> m_palette;
required_shared_ptr<uint16_t> m_paletteram;
@@ -145,10 +141,12 @@ private:
void h6280_decrypt(const char *cputag);
void dec0_map(address_map &map);
void dec0_s_map(address_map &map);
+ void hippodrm_map(address_map &map);
void hippodrm_sub_map(address_map &map);
void midres_map(address_map &map);
void midres_s_map(address_map &map);
void midresb_map(address_map &map);
+ void robocop_map(address_map &map);
void robocop_sub_map(address_map &map);
void slyspy_map(address_map &map);
void slyspy_protection_map(address_map &map);
@@ -160,12 +158,10 @@ private:
class dec0_automat_state : public dec0_state
{
public:
- dec0_automat_state(const machine_config &mconfig, device_type type, const char *tag)
- : dec0_state(mconfig, type, tag),
- m_msm1(*this, "msm1"),
- m_msm2(*this, "msm2"),
- m_adpcm_select1(*this, "adpcm_select1"),
- m_adpcm_select2(*this, "adpcm_select2"),
+ dec0_automat_state(const machine_config &mconfig, device_type type, const char *tag) :
+ dec0_state(mconfig, type, tag),
+ m_msm(*this, "msm%u", 1U),
+ m_adpcm_select(*this, "adpcm_select%u", 1U),
m_soundbank(*this, "soundbank")
{
}
@@ -174,14 +170,11 @@ public:
void automat(machine_config &config);
private:
- required_device<msm5205_device> m_msm1;
- required_device<msm5205_device> m_msm2;
- required_device<ls157_device> m_adpcm_select1;
- required_device<ls157_device> m_adpcm_select2;
+ required_device_array<msm5205_device, 2> m_msm;
+ required_device_array<ls157_device, 2> m_adpcm_select;
required_memory_bank m_soundbank;
- bool m_adpcm_toggle1;
- bool m_adpcm_toggle2;
+ bool m_adpcm_toggle[2];
uint16_t m_automat_scroll_regs[4];
DECLARE_WRITE16_MEMBER(automat_control_w);
diff --git a/src/mame/includes/deco32.h b/src/mame/includes/deco32.h
index 745a0b478de..a97f1f1ae91 100644
--- a/src/mame/includes/deco32.h
+++ b/src/mame/includes/deco32.h
@@ -23,6 +23,7 @@ class deco32_state : public driver_device
public:
deco32_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
+ , m_audiocpu(*this, "audiocpu")
, m_sprgen(*this, "spritegen%u", 1)
, m_deco_tilegen(*this, "tilegen%u", 1)
, m_gfxdecode(*this, "gfxdecode")
@@ -36,7 +37,6 @@ public:
, m_oki(*this, "oki%u", 1)
, m_soundlatch(*this, "soundlatch")
, m_maincpu(*this, "maincpu")
- , m_audiocpu(*this, "audiocpu")
, m_pf_rowscroll32(*this, "pf%u_rowscroll32", 1)
, m_generic_paletteram_32(*this, "paletteram")
{ }
@@ -69,6 +69,7 @@ protected:
DECLARE_WRITE32_MEMBER(buffered_palette_w);
DECLARE_WRITE32_MEMBER(palette_dma_w);
+ optional_device<cpu_device> m_audiocpu;
optional_device_array<decospr_device, 2> m_sprgen;
required_device_array<deco16ic_device, 2> m_deco_tilegen;
required_device<gfxdecode_device> m_gfxdecode;
@@ -96,7 +97,6 @@ protected:
private:
required_device<cpu_device> m_maincpu;
- optional_device<cpu_device> m_audiocpu;
// we use the pointers below to store a 32-bit copy..
required_shared_ptr_array<uint32_t, 4> m_pf_rowscroll32;
diff --git a/src/mame/machine/dec0.cpp b/src/mame/machine/dec0.cpp
index f6abe83305b..38def5ae983 100644
--- a/src/mame/machine/dec0.cpp
+++ b/src/mame/machine/dec0.cpp
@@ -358,8 +358,6 @@ void dec0_state::h6280_decrypt(const char *cputag)
void dec0_state::init_hippodrm()
{
uint8_t *RAM = memregion("sub")->base();
- m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x180000, 0x18003f, read16_delegate(FUNC(dec0_state::hippodrm_68000_share_r),this), write16_delegate(FUNC(dec0_state::hippodrm_68000_share_w),this));
- m_maincpu->space(AS_PROGRAM).install_write_handler(0xffc800, 0xffcfff, write16_delegate(FUNC(dec0_state::sprite_mirror_w),this));
h6280_decrypt("sub");
@@ -381,11 +379,6 @@ void dec0_state::init_slyspy()
save_item(NAME(m_slyspy_sound_state));
}
-void dec0_state::init_robocop()
-{
- m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x180000, 0x180fff, read16_delegate(FUNC(dec0_state::robocop_68000_share_r),this), write16_delegate(FUNC(dec0_state::robocop_68000_share_w),this));
-}
-
void dec0_state::init_drgninja()
{
m_game = mcu_type::BADDUDES_SIM;
diff --git a/src/mame/machine/pce.cpp b/src/mame/machine/pce.cpp
index f68d185e81f..5550ab5d2e7 100644
--- a/src/mame/machine/pce.cpp
+++ b/src/mame/machine/pce.cpp
@@ -136,8 +136,6 @@ WRITE8_MEMBER(pce_state::mess_pce_joystick_w)
int joy_i;
uint8_t joy_type = m_joy_type->read();
- m_maincpu->io_set_buffer(data);
-
/* bump counter on a low-to-high transition of bit 1 */
if ((!m_joystick_data_select) && (data & JOY_CLOCK))
{
diff --git a/src/mame/machine/pcecommn.cpp b/src/mame/machine/pcecommn.cpp
index d24ef961712..4ef9a1150c7 100644
--- a/src/mame/machine/pcecommn.cpp
+++ b/src/mame/machine/pcecommn.cpp
@@ -20,7 +20,6 @@
/* todo: how many input ports does the PCE have? */
WRITE8_MEMBER(pce_common_state::pce_joystick_w)
{
- m_maincpu->io_set_buffer(data);
/* bump counter on a low-to-high transition of bit 1 */
if((!m_joystick_data_select) && (data & JOY_CLOCK))
{
diff --git a/src/mame/video/actfancr.cpp b/src/mame/video/actfancr.cpp
index 22cd983b776..22f471ec454 100644
--- a/src/mame/video/actfancr.cpp
+++ b/src/mame/video/actfancr.cpp
@@ -11,17 +11,23 @@
/******************************************************************************/
-uint32_t actfancr_state::screen_update_actfancr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void actfancr_state::video_start()
+{
+ m_spriteram16 = make_unique_clear<uint16_t[]>(0x800/2);
+ save_pointer(NAME(m_spriteram16),0x800/2);
+}
+
+uint32_t actfancr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
/* Draw playfield */
- bool flip = m_tilegen2->get_flip_state();
- m_tilegen1->set_flip_screen(flip);
- m_tilegen2->set_flip_screen(flip);
+ bool flip = m_tilegen[1]->get_flip_state();
+ m_tilegen[0]->set_flip_screen(flip);
+ m_tilegen[1]->set_flip_screen(flip);
m_spritegen->set_flip_screen(flip);
- m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- m_spritegen->draw_sprites(bitmap, cliprect, m_spriteram16, 0x00, 0x00, 0x0f);
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[0]->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ m_spritegen->draw_sprites(bitmap, cliprect, m_spriteram16.get(), 0x00, 0x00, 0x0f);
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}
diff --git a/src/mame/video/dec0.cpp b/src/mame/video/dec0.cpp
index f89f85c3148..5f0d15740af 100644
--- a/src/mame/video/dec0.cpp
+++ b/src/mame/video/dec0.cpp
@@ -23,20 +23,20 @@ WRITE16_MEMBER(dec0_state::dec0_update_sprites_w)
uint32_t dec0_state::screen_update_hbarrel(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- bool flip = m_tilegen1->get_flip_state();
- m_tilegen1->set_flip_screen(flip);
- m_tilegen2->set_flip_screen(flip);
- m_tilegen3->set_flip_screen(flip);
+ bool flip = m_tilegen[0]->get_flip_state();
+ m_tilegen[0]->set_flip_screen(flip);
+ m_tilegen[1]->set_flip_screen(flip);
+ m_tilegen[2]->set_flip_screen(flip);
m_spritegen->set_flip_screen(flip);
- m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[2]->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, 0x08, 0x0f);
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
/* HB always keeps pf2 on top of pf3, no need explicitly support priority register */
m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, 0x00, 0x0f);
- m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[0]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}
@@ -44,41 +44,41 @@ uint32_t dec0_state::screen_update_hbarrel(screen_device &screen, bitmap_ind16 &
uint32_t dec0_state::screen_update_baddudes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- bool flip = m_tilegen1->get_flip_state();
- m_tilegen1->set_flip_screen(flip);
- m_tilegen2->set_flip_screen(flip);
- m_tilegen3->set_flip_screen(flip);
+ bool flip = m_tilegen[0]->get_flip_state();
+ m_tilegen[0]->set_flip_screen(flip);
+ m_tilegen[1]->set_flip_screen(flip);
+ m_tilegen[2]->set_flip_screen(flip);
m_spritegen->set_flip_screen(flip);
/* WARNING: inverted wrt Midnight Resistance */
if ((m_pri & 0x01) == 0)
{
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[2]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
if (m_pri & 2)
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
if (m_pri & 4)
- m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
+ m_tilegen[2]->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
}
else
{
- m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[2]->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
if (m_pri & 2)
- m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
+ m_tilegen[2]->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
if (m_pri & 4)
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
}
- m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[0]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}
@@ -88,10 +88,10 @@ uint32_t dec0_state::screen_update_robocop(screen_device &screen, bitmap_ind16 &
{
int trans;
- bool flip = m_tilegen1->get_flip_state();
- m_tilegen1->set_flip_screen(flip);
- m_tilegen2->set_flip_screen(flip);
- m_tilegen3->set_flip_screen(flip);
+ bool flip = m_tilegen[0]->get_flip_state();
+ m_tilegen[0]->set_flip_screen(flip);
+ m_tilegen[1]->set_flip_screen(flip);
+ m_tilegen[2]->set_flip_screen(flip);
m_spritegen->set_flip_screen(flip);
if (m_pri & 0x04)
@@ -105,21 +105,21 @@ uint32_t dec0_state::screen_update_robocop(screen_device &screen, bitmap_ind16 &
/* Robocop uses it only for the title screen, so this might be just */
/* completely wrong. The top 8 bits of the register might mean */
/* something (they are 0x80 in midres, 0x00 here) */
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
if (m_pri & 0x02)
m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
- m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[2]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
}
else
{
- m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[2]->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
if (m_pri & 0x02)
m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
}
if (m_pri & 0x02)
@@ -127,7 +127,7 @@ uint32_t dec0_state::screen_update_robocop(screen_device &screen, bitmap_ind16 &
else
m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
- m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[0]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}
@@ -140,36 +140,36 @@ uint32_t dec0_automat_state::screen_update_automat(screen_device &screen, bitmap
// the bootleg doesn't write these registers, I think they're hardcoded?, so fake them for compatibility with our implementation..
address_space &space = machine().dummy_space();
- m_tilegen1->pf_control_0_w(space,0,0x0003, 0x00ff); // 8x8
- m_tilegen1->pf_control_0_w(space,1,0x0003, 0x00ff);
- m_tilegen1->pf_control_0_w(space,2,0x0000, 0x00ff);
- m_tilegen1->pf_control_0_w(space,3,0x0001, 0x00ff); // dimensions
+ m_tilegen[0]->pf_control_0_w(space,0,0x0003, 0x00ff); // 8x8
+ m_tilegen[0]->pf_control_0_w(space,1,0x0003, 0x00ff);
+ m_tilegen[0]->pf_control_0_w(space,2,0x0000, 0x00ff);
+ m_tilegen[0]->pf_control_0_w(space,3,0x0001, 0x00ff); // dimensions
- m_tilegen2->pf_control_0_w(space,0,0x0082, 0x00ff); // 16x16
- m_tilegen2->pf_control_0_w(space,1,0x0000, 0x00ff);
- m_tilegen2->pf_control_0_w(space,2,0x0000, 0x00ff);
- m_tilegen2->pf_control_0_w(space,3,0x0001, 0x00ff); // dimensions
+ m_tilegen[1]->pf_control_0_w(space,0,0x0082, 0x00ff); // 16x16
+ m_tilegen[1]->pf_control_0_w(space,1,0x0000, 0x00ff);
+ m_tilegen[1]->pf_control_0_w(space,2,0x0000, 0x00ff);
+ m_tilegen[1]->pf_control_0_w(space,3,0x0001, 0x00ff); // dimensions
- m_tilegen3->pf_control_0_w(space,0,0x0082, 0x00ff); // 16x16
- m_tilegen3->pf_control_0_w(space,1,0x0003, 0x00ff);
- m_tilegen3->pf_control_0_w(space,2,0x0000, 0x00ff);
- m_tilegen3->pf_control_0_w(space,3,0x0001, 0x00ff); // dimensions
+ m_tilegen[2]->pf_control_0_w(space,0,0x0082, 0x00ff); // 16x16
+ m_tilegen[2]->pf_control_0_w(space,1,0x0003, 0x00ff);
+ m_tilegen[2]->pf_control_0_w(space,2,0x0000, 0x00ff);
+ m_tilegen[2]->pf_control_0_w(space,3,0x0001, 0x00ff); // dimensions
// scroll registers got written elsewhere, copy them across
- m_tilegen1->pf_control_1_w(space,0,0x0000, 0xffff); // no scroll?
- m_tilegen1->pf_control_1_w(space,1,0x0000, 0xffff); // no scroll?
+ m_tilegen[0]->pf_control_1_w(space,0,0x0000, 0xffff); // no scroll?
+ m_tilegen[0]->pf_control_1_w(space,1,0x0000, 0xffff); // no scroll?
- m_tilegen2->pf_control_1_w(space,0,m_automat_scroll_regs[3] - 0x010a, 0xffff);
- m_tilegen2->pf_control_1_w(space,1,m_automat_scroll_regs[2], 0xffff);
+ m_tilegen[1]->pf_control_1_w(space,0,m_automat_scroll_regs[3] - 0x010a, 0xffff);
+ m_tilegen[1]->pf_control_1_w(space,1,m_automat_scroll_regs[2], 0xffff);
- m_tilegen3->pf_control_1_w(space,0,m_automat_scroll_regs[1] - 0x0108, 0xffff);
- m_tilegen3->pf_control_1_w(space,1,m_automat_scroll_regs[0], 0xffff);
+ m_tilegen[2]->pf_control_1_w(space,0,m_automat_scroll_regs[1] - 0x0108, 0xffff);
+ m_tilegen[2]->pf_control_1_w(space,1,m_automat_scroll_regs[0], 0xffff);
- bool flip = m_tilegen1->get_flip_state();
- m_tilegen1->set_flip_screen(flip);
- m_tilegen2->set_flip_screen(flip);
- m_tilegen3->set_flip_screen(flip);
+ bool flip = m_tilegen[0]->get_flip_state();
+ m_tilegen[0]->set_flip_screen(flip);
+ m_tilegen[1]->set_flip_screen(flip);
+ m_tilegen[2]->set_flip_screen(flip);
m_spritegen->set_flip_screen(flip);
if (m_pri & 0x04)
@@ -179,21 +179,21 @@ uint32_t dec0_automat_state::screen_update_automat(screen_device &screen, bitmap
if (m_pri & 0x01)
{
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
if (m_pri & 0x02)
m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
- m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[2]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
}
else
{
- m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[2]->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
if (m_pri & 0x02)
m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
}
if (m_pri & 0x02)
@@ -201,7 +201,7 @@ uint32_t dec0_automat_state::screen_update_automat(screen_device &screen, bitmap
else
m_spritegen->draw_sprites_bootleg(bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
- m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[0]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}
@@ -211,47 +211,47 @@ uint32_t dec0_automat_state::screen_update_secretab(screen_device &screen, bitma
// the bootleg doesn't write these registers, I think they're hardcoded?, so fake them for compatibility with our implementation..
address_space &space = machine().dummy_space();
- m_tilegen1->pf_control_0_w(space,0,0x0003, 0x00ff); // 8x8
- m_tilegen1->pf_control_0_w(space,1,0x0003, 0x00ff);
- m_tilegen1->pf_control_0_w(space,2,0x0000, 0x00ff);
- m_tilegen1->pf_control_0_w(space,3,0x0001, 0x00ff); // dimensions
+ m_tilegen[0]->pf_control_0_w(space,0,0x0003, 0x00ff); // 8x8
+ m_tilegen[0]->pf_control_0_w(space,1,0x0003, 0x00ff);
+ m_tilegen[0]->pf_control_0_w(space,2,0x0000, 0x00ff);
+ m_tilegen[0]->pf_control_0_w(space,3,0x0001, 0x00ff); // dimensions
- m_tilegen2->pf_control_0_w(space,0,0x0082, 0x00ff); // 16x16
- m_tilegen2->pf_control_0_w(space,1,0x0000, 0x00ff);
- m_tilegen2->pf_control_0_w(space,2,0x0000, 0x00ff);
- m_tilegen2->pf_control_0_w(space,3,0x0001, 0x00ff); // dimensions
+ m_tilegen[1]->pf_control_0_w(space,0,0x0082, 0x00ff); // 16x16
+ m_tilegen[1]->pf_control_0_w(space,1,0x0000, 0x00ff);
+ m_tilegen[1]->pf_control_0_w(space,2,0x0000, 0x00ff);
+ m_tilegen[1]->pf_control_0_w(space,3,0x0001, 0x00ff); // dimensions
- m_tilegen3->pf_control_0_w(space,0,0x0082, 0x00ff); // 16x16
- m_tilegen3->pf_control_0_w(space,1,0x0003, 0x00ff);
- m_tilegen3->pf_control_0_w(space,2,0x0000, 0x00ff);
- m_tilegen3->pf_control_0_w(space,3,0x0001, 0x00ff); // dimensions
+ m_tilegen[2]->pf_control_0_w(space,0,0x0082, 0x00ff); // 16x16
+ m_tilegen[2]->pf_control_0_w(space,1,0x0003, 0x00ff);
+ m_tilegen[2]->pf_control_0_w(space,2,0x0000, 0x00ff);
+ m_tilegen[2]->pf_control_0_w(space,3,0x0001, 0x00ff); // dimensions
// scroll registers got written elsewhere, copy them across
- m_tilegen1->pf_control_1_w(space,0,0x0000, 0xffff); // no scroll?
- m_tilegen1->pf_control_1_w(space,1,0x0000, 0xffff); // no scroll?
+ m_tilegen[0]->pf_control_1_w(space,0,0x0000, 0xffff); // no scroll?
+ m_tilegen[0]->pf_control_1_w(space,1,0x0000, 0xffff); // no scroll?
- m_tilegen2->pf_control_1_w(space,0,m_automat_scroll_regs[3] - 0x010a, 0xffff);
- m_tilegen2->pf_control_1_w(space,1,m_automat_scroll_regs[2], 0xffff);
+ m_tilegen[1]->pf_control_1_w(space,0,m_automat_scroll_regs[3] - 0x010a, 0xffff);
+ m_tilegen[1]->pf_control_1_w(space,1,m_automat_scroll_regs[2], 0xffff);
- m_tilegen3->pf_control_1_w(space,0,m_automat_scroll_regs[1] - 0x0108, 0xffff);
- m_tilegen3->pf_control_1_w(space,1,m_automat_scroll_regs[0], 0xffff);
+ m_tilegen[2]->pf_control_1_w(space,0,m_automat_scroll_regs[1] - 0x0108, 0xffff);
+ m_tilegen[2]->pf_control_1_w(space,1,m_automat_scroll_regs[0], 0xffff);
- bool flip = m_tilegen1->get_flip_state();
- m_tilegen1->set_flip_screen(flip);
- m_tilegen2->set_flip_screen(flip);
- m_tilegen3->set_flip_screen(flip);
+ bool flip = m_tilegen[0]->get_flip_state();
+ m_tilegen[0]->set_flip_screen(flip);
+ m_tilegen[1]->set_flip_screen(flip);
+ m_tilegen[2]->set_flip_screen(flip);
m_spritegen->set_flip_screen(flip);
- m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[2]->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
m_spritegen->draw_sprites_bootleg(bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
/* Redraw top 8 pens of top 8 palettes over sprites */
if (m_pri&0x80)
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles
- m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[0]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}
@@ -260,17 +260,17 @@ uint32_t dec0_automat_state::screen_update_secretab(screen_device &screen, bitma
uint32_t dec0_state::screen_update_birdtry(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- bool flip = m_tilegen1->get_flip_state();
- m_tilegen1->set_flip_screen(flip);
- m_tilegen2->set_flip_screen(flip);
+ bool flip = m_tilegen[0]->get_flip_state();
+ m_tilegen[0]->set_flip_screen(flip);
+ m_tilegen[1]->set_flip_screen(flip);
m_spritegen->set_flip_screen(flip);
/* This game doesn't have the extra playfield chip on the game board, but
the palette does show through. */
bitmap.fill(m_palette->pen(768), cliprect);
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
- m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[0]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}
@@ -278,25 +278,25 @@ uint32_t dec0_state::screen_update_birdtry(screen_device &screen, bitmap_ind16 &
uint32_t dec0_state::screen_update_hippodrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- bool flip = m_tilegen1->get_flip_state();
- m_tilegen1->set_flip_screen(flip);
- m_tilegen2->set_flip_screen(flip);
- m_tilegen3->set_flip_screen(flip);
+ bool flip = m_tilegen[0]->get_flip_state();
+ m_tilegen[0]->set_flip_screen(flip);
+ m_tilegen[1]->set_flip_screen(flip);
+ m_tilegen[2]->set_flip_screen(flip);
m_spritegen->set_flip_screen(flip);
if (m_pri & 0x01)
{
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[2]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
}
else
{
- m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[2]->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
}
m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
- m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[0]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}
@@ -304,22 +304,22 @@ uint32_t dec0_state::screen_update_hippodrm(screen_device &screen, bitmap_ind16
uint32_t dec0_state::screen_update_slyspy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- bool flip = m_tilegen1->get_flip_state();
- m_tilegen1->set_flip_screen(flip);
- m_tilegen2->set_flip_screen(flip);
- m_tilegen3->set_flip_screen(flip);
+ bool flip = m_tilegen[0]->get_flip_state();
+ m_tilegen[0]->set_flip_screen(flip);
+ m_tilegen[1]->set_flip_screen(flip);
+ m_tilegen[2]->set_flip_screen(flip);
m_spritegen->set_flip_screen(flip);
- m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[2]->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
/* Redraw top 8 pens of top 8 palettes over sprites */
if (m_pri&0x80)
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles
- m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[0]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}
@@ -329,10 +329,10 @@ uint32_t dec0_state::screen_update_midres(screen_device &screen, bitmap_ind16 &b
{
int trans;
- bool flip = m_tilegen1->get_flip_state();
- m_tilegen1->set_flip_screen(flip);
- m_tilegen2->set_flip_screen(flip);
- m_tilegen3->set_flip_screen(flip);
+ bool flip = m_tilegen[0]->get_flip_state();
+ m_tilegen[0]->set_flip_screen(flip);
+ m_tilegen[1]->set_flip_screen(flip);
+ m_tilegen[2]->set_flip_screen(flip);
m_spritegen->set_flip_screen(flip);
if (m_pri & 0x04)
@@ -341,21 +341,21 @@ uint32_t dec0_state::screen_update_midres(screen_device &screen, bitmap_ind16 &b
if (m_pri & 0x01)
{
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
if (m_pri & 0x02)
m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
- m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[2]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
}
else
{
- m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[2]->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
if (m_pri & 0x02)
m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
- m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[1]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
}
if (m_pri & 0x02)
@@ -363,7 +363,7 @@ uint32_t dec0_state::screen_update_midres(screen_device &screen, bitmap_ind16 &b
else
m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
- m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[0]->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}