summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Curt Coder <curtcoder@mail.com>2013-02-06 14:34:13 +0000
committerGravatarGravatar Curt Coder <curtcoder@mail.com>2013-02-06 14:34:13 +0000
commit5f9462af076d23acb740d29529d0377da4271d5c (patch)
treef624c200e0064fadf069acc1e8a71a457aefdaeb
parent5948ae089309499aea3599dba5b65ed7e816bae2 (diff)
downloadmame-5f9462af076d23acb740d29529d0377da4271d5c.tar.xz
mame-5f9462af076d23acb740d29529d0377da4271d5c.zip
(MESS) devcb2 conversions. (nw)
-rw-r--r--.gitattributes2
-rw-r--r--src/emu/emu.mak1
-rw-r--r--src/emu/machine/ds75160a.c34
-rw-r--r--src/emu/machine/ds75160a.h30
-rw-r--r--src/emu/machine/mos6529.c40
-rw-r--r--src/emu/machine/mos6529.h31
-rw-r--r--src/emu/machine/mos6551.c277
-rw-r--r--src/emu/machine/mos6551.h166
-rw-r--r--src/mess/drivers/c128.c65
-rw-r--r--src/mess/drivers/c64.c39
-rw-r--r--src/mess/drivers/cbm2.c141
-rw-r--r--src/mess/drivers/pet2001.c48
-rw-r--r--src/mess/drivers/plus4.c64
-rw-r--r--src/mess/drivers/vic10.c14
-rw-r--r--src/mess/drivers/vic20.c21
-rw-r--r--src/mess/includes/c128.h2
-rw-r--r--src/mess/includes/c64.h10
-rw-r--r--src/mess/includes/cbm2.h10
-rw-r--r--src/mess/includes/plus4.h17
-rw-r--r--src/mess/machine/petcass.c32
-rw-r--r--src/mess/machine/petcass.h25
-rw-r--r--src/mess/machine/petexp.c36
-rw-r--r--src/mess/machine/petexp.h33
-rw-r--r--src/mess/machine/superpet.c14
-rw-r--r--src/mess/machine/superpet.h5
-rw-r--r--src/mess/machine/vcs_lightpen.c5
-rw-r--r--src/mess/machine/vcsctrl.c10
-rw-r--r--src/mess/machine/vcsctrl.h12
28 files changed, 678 insertions, 506 deletions
diff --git a/.gitattributes b/.gitattributes
index 9e0f3428865..101870ee26b 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1271,6 +1271,8 @@ src/emu/machine/mos6526.c svneol=native#text/plain
src/emu/machine/mos6526.h svneol=native#text/plain
src/emu/machine/mos6529.c svneol=native#text/plain
src/emu/machine/mos6529.h svneol=native#text/plain
+src/emu/machine/mos6551.c svneol=native#text/plain
+src/emu/machine/mos6551.h svneol=native#text/plain
src/emu/machine/msm5832.c svneol=native#text/plain
src/emu/machine/msm5832.h svneol=native#text/plain
src/emu/machine/msm58321.c svneol=native#text/plain
diff --git a/src/emu/emu.mak b/src/emu/emu.mak
index 7158fac1ead..3e62d08b914 100644
--- a/src/emu/emu.mak
+++ b/src/emu/emu.mak
@@ -226,6 +226,7 @@ EMUMACHINEOBJS = \
$(EMUMACHINE)/microtch.o \
$(EMUMACHINE)/mos6526.o \
$(EMUMACHINE)/mos6529.o \
+ $(EMUMACHINE)/mos6551.o \
$(EMUMACHINE)/msm5832.o \
$(EMUMACHINE)/msm58321.o \
$(EMUMACHINE)/msm6242.o \
diff --git a/src/emu/machine/ds75160a.c b/src/emu/machine/ds75160a.c
index f265316678a..9e12c66d3c2 100644
--- a/src/emu/machine/ds75160a.c
+++ b/src/emu/machine/ds75160a.c
@@ -29,6 +29,8 @@ const device_type DS75160A = &device_creator<ds75160a_device>;
ds75160a_device::ds75160a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, DS75160A, "DS75160A", tag, owner, clock),
+ m_read(*this),
+ m_write(*this),
m_data(0xff),
m_te(0),
m_pe(0)
@@ -37,36 +39,14 @@ ds75160a_device::ds75160a_device(const machine_config &mconfig, const char *tag,
//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void ds75160a_device::device_config_complete()
-{
- // inherit a copy of the static data
- const ds75160a_interface *intf = reinterpret_cast<const ds75160a_interface *>(static_config());
- if (intf != NULL)
- *static_cast<ds75160a_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_in_bus_cb, 0, sizeof(m_in_bus_cb));
- memset(&m_out_bus_cb, 0, sizeof(m_out_bus_cb));
- }
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ds75160a_device::device_start()
{
// resolve callbacks
- m_in_bus_func.resolve(m_in_bus_cb, *this);
- m_out_bus_func.resolve(m_out_bus_cb, *this);
+ m_read.resolve_safe(0);
+ m_write.resolve_safe();
// register for state saving
save_item(NAME(m_data));
@@ -85,7 +65,7 @@ READ8_MEMBER( ds75160a_device::read )
if (!m_te)
{
- data = m_in_bus_func(0);
+ data = m_read(0);
}
return data;
@@ -102,7 +82,7 @@ WRITE8_MEMBER( ds75160a_device::write )
if (m_te)
{
- m_out_bus_func(0, m_data);
+ m_write((offs_t)0, m_data);
}
}
@@ -115,7 +95,7 @@ WRITE_LINE_MEMBER( ds75160a_device::te_w )
{
if (m_te != state)
{
- m_out_bus_func(0, m_te ? m_data : 0xff);
+ m_write((offs_t)0, m_te ? m_data : 0xff);
}
m_te = state;
diff --git a/src/emu/machine/ds75160a.h b/src/emu/machine/ds75160a.h
index eb246ab02dc..46916c9f6d9 100644
--- a/src/emu/machine/ds75160a.h
+++ b/src/emu/machine/ds75160a.h
@@ -33,13 +33,9 @@
// INTERFACE CONFIGURATION MACROS
///*************************************************************************
-#define MCFG_DS75160A_ADD(_tag, _config) \
+#define MCFG_DS75160A_ADD(_tag, _read, _write) \
MCFG_DEVICE_ADD(_tag, DS75160A, 0) \
- MCFG_DEVICE_CONFIG(_config)
-
-
-#define DS75160A_INTERFACE(name) \
- const ds75160a_interface (name) =
+ downcast<ds75160a_device *>(device)->set_callbacks(DEVCB2_##_read, DEVCB2_##_write);
@@ -47,24 +43,19 @@
// TYPE DEFINITIONS
///*************************************************************************
-// ======================> ds75160a_interface
-
-struct ds75160a_interface
-{
- devcb_read8 m_in_bus_cb;
- devcb_write8 m_out_bus_cb;
-};
-
-
// ======================> ds75160a_device
-class ds75160a_device : public device_t,
- public ds75160a_interface
+class ds75160a_device : public device_t
{
public:
// construction/destruction
ds75160a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ template<class _read, class _write> void set_callbacks(_read rd, _write wr) {
+ m_read.set_callback(rd);
+ m_write.set_callback(wr);
+ }
+
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -73,12 +64,11 @@ public:
protected:
// device-level overrides
- virtual void device_config_complete();
virtual void device_start();
private:
- devcb_resolved_read8 m_in_bus_func;
- devcb_resolved_write8 m_out_bus_func;
+ devcb2_read8 m_read;
+ devcb2_write8 m_write;
UINT8 m_data;
diff --git a/src/emu/machine/mos6529.c b/src/emu/machine/mos6529.c
index f81f6b42a77..7a6db300541 100644
--- a/src/emu/machine/mos6529.c
+++ b/src/emu/machine/mos6529.c
@@ -20,41 +20,27 @@
//**************************************************************************
-// LIVE DEVICE
+// DEVICE DEFINITIONS
//**************************************************************************
// device type definition
const device_type MOS6529 = &device_creator<mos6529_device>;
-//-------------------------------------------------
-// mos6529_device - constructor
-//-------------------------------------------------
-mos6529_device::mos6529_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, MOS6529, "MOS6529", tag, owner, clock)
-{
-}
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
+// mos6529_device - constructor
//-------------------------------------------------
-void mos6529_device::device_config_complete()
+mos6529_device::mos6529_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MOS6529, "MOS6529", tag, owner, clock),
+ m_read_port(*this),
+ m_write_port(*this)
{
- // inherit a copy of the static data
- const mos6529_interface *intf = reinterpret_cast<const mos6529_interface *>(static_config());
- if (intf != NULL)
- *static_cast<mos6529_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_in_p_cb, 0, sizeof(m_in_p_cb));
- memset(&m_out_p_cb, 0, sizeof(m_out_p_cb));
- }
}
@@ -65,8 +51,8 @@ void mos6529_device::device_config_complete()
void mos6529_device::device_start()
{
// resolve callbacks
- m_in_p_func.resolve(m_in_p_cb, *this);
- m_out_p_func.resolve(m_out_p_cb, *this);
+ m_read_port.resolve_safe(0);
+ m_write_port.resolve_safe();
}
@@ -76,7 +62,7 @@ void mos6529_device::device_start()
READ8_MEMBER( mos6529_device::read )
{
- return m_in_p_func(0);
+ return m_read_port(0);
}
@@ -86,5 +72,5 @@ READ8_MEMBER( mos6529_device::read )
WRITE8_MEMBER( mos6529_device::write )
{
- m_out_p_func(0, data);
+ m_write_port((offs_t)0, data);
}
diff --git a/src/emu/machine/mos6529.h b/src/emu/machine/mos6529.h
index d81da3fe108..352dedc2849 100644
--- a/src/emu/machine/mos6529.h
+++ b/src/emu/machine/mos6529.h
@@ -33,12 +33,9 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_MOS6529_ADD(_tag, _config) \
- MCFG_DEVICE_ADD(_tag, MOS6529, 0) \
- MCFG_DEVICE_CONFIG(_config)
-
-#define MOS6529_INTERFACE(name) \
- const mos6529_interface (name) =
+#define MCFG_MOS6529_ADD(_tag, _read, _write) \
+ MCFG_DEVICE_ADD(_tag, MOS6529, 0) \
+ downcast<mos6529_device *>(device)->set_callbacks(DEVCB2_##_read, DEVCB2_##_write);
@@ -46,35 +43,29 @@
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> mos6529_interface
-
-struct mos6529_interface
-{
- devcb_read8 m_in_p_cb;
- devcb_write8 m_out_p_cb;
-};
-
-
// ======================> mos6529_device
-class mos6529_device : public device_t,
- public mos6529_interface
+class mos6529_device : public device_t
{
public:
// construction/destruction
mos6529_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ template<class _read, class _write> void set_callbacks(_read rd, _write wr) {
+ m_read_port.set_callback(rd);
+ m_write_port.set_callback(wr);
+ }
+
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
protected:
// device-level overrides
- virtual void device_config_complete();
virtual void device_start();
private:
- devcb_resolved_read8 m_in_p_func;
- devcb_resolved_write8 m_out_p_func;
+ devcb2_read8 m_read_port;
+ devcb2_write8 m_write_port;
};
diff --git a/src/emu/machine/mos6551.c b/src/emu/machine/mos6551.c
new file mode 100644
index 00000000000..9f09ebee54b
--- /dev/null
+++ b/src/emu/machine/mos6551.c
@@ -0,0 +1,277 @@
+/**********************************************************************
+
+ MOS Technology 6551 Asynchronous Communication Interface Adapter
+
+ Copyright MESS Team.
+ Visit http://mamedev.org for licensing and usage restrictions.
+
+**********************************************************************/
+
+#include "mos6551.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define LOG 0
+
+
+const int mos6551_device::brg_divider[] = {
+ 0, 2304, 1536, 1048, 856, 768, 384, 192, 96, 64, 48, 32, 24, 16, 12, 6
+};
+
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+// device type definition
+const device_type MOS6551 = &device_creator<mos6551_device>;
+
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// mos6551_device - constructor
+//-------------------------------------------------
+
+mos6551_device::mos6551_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MOS6551, "MOS6551", tag, owner, clock),
+ device_serial_interface(mconfig, *this),
+ m_irq_handler(*this),
+ m_ctrl(0),
+ m_cmd(CMD_RIE),
+ m_st(ST_TDRE),
+ m_ext_rxc(0)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void mos6551_device::device_start()
+{
+ m_irq_handler.resolve_safe();
+
+ transmit_register_reset();
+ receive_register_reset();
+}
+
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void mos6551_device::device_reset()
+{
+ m_ctrl = 0;
+ m_cmd = CMD_RIE;
+
+ update_serial();
+}
+
+
+//-------------------------------------------------
+// tra_complete -
+//-------------------------------------------------
+
+void mos6551_device::tra_complete()
+{
+ if ((m_cmd & CMD_TC_MASK) == CMD_TC_TIE_RTS_LO)
+ {
+ m_st |= ST_IRQ;
+ m_irq_handler(ASSERT_LINE);
+ }
+
+ if (!(m_st & ST_TDRE))
+ {
+ transmit_register_setup(m_tdr);
+ m_st |= ST_TDRE;
+ }
+}
+
+
+//-------------------------------------------------
+// rcv_complete -
+//-------------------------------------------------
+
+void mos6551_device::rcv_complete()
+{
+ if (m_st & ST_RDRF)
+ {
+ m_st |= ST_OR;
+ }
+ else
+ {
+ m_st |= ST_RDRF;
+
+ if (!(m_cmd & CMD_RIE))
+ {
+ m_st |= ST_IRQ;
+ m_irq_handler(ASSERT_LINE);
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// input_callback -
+//-------------------------------------------------
+
+void mos6551_device::input_callback(UINT8 state)
+{
+ m_input_state = state;
+}
+
+
+//-------------------------------------------------
+// update_serial -
+//-------------------------------------------------
+
+void mos6551_device::update_serial()
+{
+ int brg = m_ctrl & CTRL_BRG_MASK;
+
+ if (brg == CTRL_BRG_16X_EXTCLK)
+ {
+ set_rcv_rate(m_ext_rxc / 16);
+ set_tra_rate(m_ext_rxc / 16);
+ }
+ else
+ {
+ int baud = clock() / brg_divider[brg] / 16;
+
+ set_tra_rate(baud);
+
+ if (m_ctrl & CTRL_RXC_BRG)
+ {
+ set_rcv_rate(baud);
+ }
+ else
+ {
+ set_rcv_rate(m_ext_rxc / 16);
+ }
+
+ int num_data_bits = 8;
+ int stop_bit_count = 1;
+ int parity_code = SERIAL_PARITY_NONE;
+
+ switch (m_ctrl & CTRL_WL_MASK)
+ {
+ case CTRL_WL_8: num_data_bits = 8; break;
+ case CTRL_WL_7: num_data_bits = 7; break;
+ case CTRL_WL_6: num_data_bits = 6; break;
+ case CTRL_WL_5: num_data_bits = 5; break;
+ }
+
+ set_data_frame(num_data_bits, stop_bit_count, parity_code);
+ }
+
+ if (m_cmd & CMD_DTR)
+ m_connection_state |= SERIAL_STATE_DTR;
+ else
+ m_connection_state &= ~SERIAL_STATE_DTR;
+
+ if ((m_cmd & CMD_TC_MASK) == CMD_TC_RTS_HI)
+ m_connection_state &= ~SERIAL_STATE_RTS;
+ else
+ m_connection_state |= SERIAL_STATE_RTS;
+
+ serial_connection_out();
+}
+
+
+//-------------------------------------------------
+// read -
+//-------------------------------------------------
+
+READ8_MEMBER( mos6551_device::read )
+{
+ UINT8 data = 0;
+
+ switch (offset & 0x03)
+ {
+ case 0:
+ if (is_receive_register_full())
+ {
+ receive_register_extract();
+ data = get_received_char();
+ }
+
+ m_st &= ~(ST_RDRF | ST_OR | ST_FE | ST_PE);
+ break;
+
+ case 1:
+ data = m_st;
+ m_st &= ~ST_IRQ;
+ m_irq_handler(CLEAR_LINE);
+ break;
+
+ case 2:
+ data = m_cmd;
+ break;
+
+ case 3:
+ data = m_ctrl;
+ break;
+ }
+
+ return data;
+}
+
+
+//-------------------------------------------------
+// write -
+//-------------------------------------------------
+
+WRITE8_MEMBER( mos6551_device::write )
+{
+ switch (offset & 0x03)
+ {
+ case 0:
+ m_tdr = data;
+ m_st &= ~ST_TDRE;
+
+ if (is_transmit_register_empty())
+ {
+ transmit_register_setup(m_tdr);
+ m_st |= ST_TDRE;
+ }
+ break;
+
+ case 1:
+ // programmed reset
+ m_cmd = (m_cmd & 0xe0) | CMD_RIE;
+ m_st &= ~ST_OR;
+ update_serial();
+ break;
+
+ case 2:
+ m_cmd = data;
+ update_serial();
+ break;
+
+ case 3:
+ m_ctrl = data;
+ update_serial();
+ break;
+ }
+}
+
+
+//-------------------------------------------------
+// set_rxc - set external receiver clock
+//-------------------------------------------------
+
+void mos6551_device::set_rxc(int clock)
+{
+ m_ext_rxc = clock;
+}
diff --git a/src/emu/machine/mos6551.h b/src/emu/machine/mos6551.h
new file mode 100644
index 00000000000..b3b1367461a
--- /dev/null
+++ b/src/emu/machine/mos6551.h
@@ -0,0 +1,166 @@
+/**********************************************************************
+
+ MOS Technology 6551 Asynchronous Communication Interface Adapter
+
+ Copyright MESS Team.
+ Visit http://mamedev.org for licensing and usage restrictions.
+
+**********************************************************************
+ _____ _____
+ GND 1 |* \_/ | 28 R/_W
+ CS0 2 | | 27 phi2
+ _CS1 3 | | 26 _IRQ
+ _RES 4 | | 25 DB7
+ RxC 5 | | 24 DB6
+ XTAL1 6 | | 23 DB5
+ XTAL2 7 | MOS6551 | 22 DB4
+ _RTS 8 | | 21 DB3
+ _CTS 9 | | 20 DB2
+ TxD 10 | | 19 DB1
+ _DTR 11 | | 18 DB0
+ RxD 12 | | 17 _DBR
+ RS0 13 | | 16 _DCD
+ RS1 14 |_____________| 15 Vcc
+
+**********************************************************************/
+
+#pragma once
+
+#ifndef __MOS6551__
+#define __MOS6551__
+
+#include "emu.h"
+
+
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_MOS6551_ADD(_tag, _clock, _irq) \
+ MCFG_DEVICE_ADD(_tag, MOS6551, _clock) \
+ devcb = &mos6551_device::set_irq_handler(*device, DEVCB2_##_irq);
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> mos6551_device
+
+class mos6551_device : public device_t,
+ public device_serial_interface
+{
+public:
+ // construction/destruction
+ mos6551_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // static configuration helpers
+ template<class _Object> static devcb2_base &set_irq_handler(device_t &device, _Object object) { return downcast<mos6551_device &>(device).m_irq_handler.set_callback(object); }
+
+ DECLARE_READ8_MEMBER( read );
+ DECLARE_WRITE8_MEMBER( write );
+
+ void set_rxc(int clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+
+ // device_serial_interface overrides
+ virtual void tra_complete();
+ virtual void rcv_complete();
+ virtual void input_callback(UINT8 state);
+
+ enum
+ {
+ CTRL_BRG_16X_EXTCLK = 0,
+ CTRL_BRG_50,
+ CTRL_BRG_75,
+ CTRL_BRG_109_92,
+ CTRL_BRG_134_58,
+ CTRL_BRG_150,
+ CTRL_BRG_300,
+ CTRL_BRG_600,
+ CTRL_BRG_1200,
+ CTRL_BRG_1800,
+ CTRL_BRG_2400,
+ CTRL_BRG_3600,
+ CTRL_BRG_4800,
+ CTRL_BRG_7200,
+ CTRL_BRG_9600,
+ CTRL_BRG_19200,
+ CTRL_BRG_MASK = 0x0f,
+
+ CTRL_RXC_EXT = 0x00,
+ CTRL_RXC_BRG = 0x10,
+ CTRL_RXC_MASK = 0x10,
+
+ CTRL_WL_8 = 0x00,
+ CTRL_WL_7 = 0x20,
+ CTRL_WL_6 = 0x40,
+ CTRL_WL_5 = 0x60,
+ CTRL_WL_MASK = 0x60,
+
+ CTRL_SB_1 = 0x00,
+ CTRL_SB_2 = 0x80,
+ CTRL_SB_MASK = 0x80
+ };
+
+ enum
+ {
+ CMD_DTR = 0x01,
+
+ CMD_RIE = 0x02,
+
+ CMD_TC_RTS_HI = 0x00,
+ CMD_TC_TIE_RTS_LO = 0x04,
+ CMD_TC_RTS_LO = 0x08,
+ CMD_TC_BRK = 0x0c,
+ CMD_TC_MASK = 0x0c,
+
+ CMD_ECHO = 0x10,
+
+ CMD_PARITY = 0x20,
+ CMD_PARITY_ODD = 0x00,
+ CMD_PARITY_EVEN = 0x40,
+ CMD_PARITY_MARK = 0x80,
+ CMD_PARITY_SPACE = 0xc0,
+ CMD_PARITY_MASK = 0xc0
+ };
+
+ enum
+ {
+ ST_PE = 0x01,
+ ST_FE = 0x02,
+ ST_OR = 0x04,
+ ST_RDRF = 0x08,
+ ST_TDRE = 0x10,
+ ST_DCD = 0x20,
+ ST_DSR = 0x40,
+ ST_IRQ = 0x80
+ };
+
+ void update_serial();
+
+ devcb2_write_line m_irq_handler;
+
+ UINT8 m_ctrl;
+ UINT8 m_cmd;
+ UINT8 m_st;
+ UINT8 m_tdr;
+
+ int m_ext_rxc;
+
+ static const int brg_divider[16];
+};
+
+
+// device type definition
+extern const device_type MOS6551;
+
+
+
+#endif
diff --git a/src/mess/drivers/c128.c b/src/mess/drivers/c128.c
index 2caef85cff5..2454ce1e68d 100644
--- a/src/mess/drivers/c128.c
+++ b/src/mess/drivers/c128.c
@@ -50,10 +50,6 @@ inline void c128_state::check_interrupts()
m_subcpu->set_input_line(M8502_IRQ_LINE, irq);
m_subcpu->set_input_line(INPUT_LINE_NMI, nmi);
-
- int flag = m_cass_rd && m_iec_srq;
-
- m_cia1->flag_w(flag);
}
@@ -1328,23 +1324,6 @@ static CBM_IEC_INTERFACE( cbm_iec_intf )
//-------------------------------------------------
-// PET_DATASSETTE_PORT_INTERFACE( datassette_intf )
-//-------------------------------------------------
-
-WRITE_LINE_MEMBER( c128_state::tape_read_w )
-{
- m_cass_rd = state;
-
- check_interrupts();
-}
-
-static PET_DATASSETTE_PORT_INTERFACE( datassette_intf )
-{
- DEVCB_DRIVER_LINE_MEMBER(c128_state, tape_read_w),
-};
-
-
-//-------------------------------------------------
// C64_EXPANSION_INTERFACE( expansion_intf )
//-------------------------------------------------
@@ -1462,8 +1441,6 @@ void c128_state::machine_start()
save_item(NAME(m_exp_irq));
save_item(NAME(m_exp_nmi));
save_item(NAME(m_exp_dma));
- save_item(NAME(m_cass_rd));
- save_item(NAME(m_iec_srq));
save_item(NAME(m_vic_k));
save_item(NAME(m_caps_lock));
}
@@ -1531,24 +1508,27 @@ static MACHINE_CONFIG_START( ntsc, c128_state )
MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6567_CLOCK, 60, cia1_intf)
MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, cia2_intf)
MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
- MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, "c1530", NULL)
+ MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", NULL, DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
+ MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS8564_TAG, mos8564_device, lp_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy", NULL)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6567_CLOCK, expansion_intf, c64_expansion_cards, NULL, NULL)
MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, user_intf, c64_user_port_cards, NULL, NULL)
// software list
MCFG_SOFTWARE_LIST_ADD("cart_list_vic10", "vic10")
- MCFG_SOFTWARE_LIST_FILTER("cart_list_vic10", "NTSC")
MCFG_SOFTWARE_LIST_ADD("cart_list_c64", "c64_cart")
- MCFG_SOFTWARE_LIST_FILTER("cart_list_c64", "NTSC")
- MCFG_SOFTWARE_LIST_ADD("cart_list_c128", "c128_cart")
- MCFG_SOFTWARE_LIST_FILTER("cart_list_c128", "NTSC")
- MCFG_SOFTWARE_LIST_ADD("disk_list_c64", "c64_flop")
- MCFG_SOFTWARE_LIST_FILTER("disk_list_c64", "NTSC")
- MCFG_SOFTWARE_LIST_ADD("disk_list_c128", "c128_flop")
- MCFG_SOFTWARE_LIST_FILTER("disk_list_c128", "NTSC")
+ MCFG_SOFTWARE_LIST_ADD("cart_list", "c128_cart")
+ MCFG_SOFTWARE_LIST_ADD("cass_list_c64", "c64_cass")
+ MCFG_SOFTWARE_LIST_ADD("flop_list_c64", "c64_flop")
+ MCFG_SOFTWARE_LIST_ADD("flop_list", "c128_flop")
MCFG_SOFTWARE_LIST_ADD("from_list", "c128_rom")
+ MCFG_SOFTWARE_LIST_FILTER("cart_list_vic10", "NTSC")
+ MCFG_SOFTWARE_LIST_FILTER("cart_list_c64", "NTSC")
+ MCFG_SOFTWARE_LIST_FILTER("cart_list", "NTSC")
+ MCFG_SOFTWARE_LIST_FILTER("cass_list_c64", "NTSC")
+ MCFG_SOFTWARE_LIST_FILTER("flop_list_c64", "NTSC")
+ MCFG_SOFTWARE_LIST_FILTER("flop_list", "NTSC")
MCFG_SOFTWARE_LIST_FILTER("from_list", "NTSC")
// function ROM
@@ -1635,24 +1615,27 @@ static MACHINE_CONFIG_START( pal, c128_state )
MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6569_CLOCK, 50, cia1_intf)
MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6569_CLOCK, 50, cia2_intf)
MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
- MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, "c1530", NULL)
+ MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", NULL, DEVWRITELINE(MOS6526_2_TAG, mos6526_device, flag_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
+ MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS8566_TAG, mos8566_device, lp_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy", NULL)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, expansion_intf, c64_expansion_cards, NULL, NULL)
MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, user_intf, c64_user_port_cards, NULL, NULL)
// software list
MCFG_SOFTWARE_LIST_ADD("cart_list_vic10", "vic10")
- MCFG_SOFTWARE_LIST_FILTER("cart_list_vic10", "PAL")
MCFG_SOFTWARE_LIST_ADD("cart_list_c64", "c64_cart")
- MCFG_SOFTWARE_LIST_FILTER("cart_list_c64", "PAL")
- MCFG_SOFTWARE_LIST_ADD("cart_list_c128", "c128_cart")
- MCFG_SOFTWARE_LIST_FILTER("cart_list_c128", "PAL")
- MCFG_SOFTWARE_LIST_ADD("disk_list_c64", "c64_flop")
- MCFG_SOFTWARE_LIST_FILTER("disk_list_c64", "PAL")
- MCFG_SOFTWARE_LIST_ADD("disk_list_c128", "c128_flop")
- MCFG_SOFTWARE_LIST_FILTER("disk_list_c128", "PAL")
+ MCFG_SOFTWARE_LIST_ADD("cart_list", "c128_cart")
+ MCFG_SOFTWARE_LIST_ADD("cass_list_c64", "c64_cass")
+ MCFG_SOFTWARE_LIST_ADD("flop_list_c64", "c64_flop")
+ MCFG_SOFTWARE_LIST_ADD("flop_list", "c128_flop")
MCFG_SOFTWARE_LIST_ADD("from_list", "c128_rom")
+ MCFG_SOFTWARE_LIST_FILTER("cart_list_vic10", "PAL")
+ MCFG_SOFTWARE_LIST_FILTER("cart_list_c64", "PAL")
+ MCFG_SOFTWARE_LIST_FILTER("cart_list", "PAL")
+ MCFG_SOFTWARE_LIST_FILTER("cass_list_c64", "PAL")
+ MCFG_SOFTWARE_LIST_FILTER("flop_list_c64", "PAL")
+ MCFG_SOFTWARE_LIST_FILTER("flop_list", "PAL")
MCFG_SOFTWARE_LIST_FILTER("from_list", "PAL")
// function ROM
diff --git a/src/mess/drivers/c64.c b/src/mess/drivers/c64.c
index 28a8f2bd748..1dab7f4ab2c 100644
--- a/src/mess/drivers/c64.c
+++ b/src/mess/drivers/c64.c
@@ -48,10 +48,6 @@ void c64_state::check_interrupts()
m_maincpu->set_input_line(M6510_IRQ_LINE, irq);
m_maincpu->set_input_line(INPUT_LINE_NMI, nmi);
-
- int flag = m_cass_rd && m_iec_srq;
-
- m_cia1->flag_w(flag);
}
@@ -999,36 +995,12 @@ WRITE8_MEMBER( c64gs_state::cpu_w )
//-------------------------------------------------
-// PET_DATASSETTE_PORT_INTERFACE( datassette_intf )
-//-------------------------------------------------
-
-WRITE_LINE_MEMBER( c64_state::tape_read_w )
-{
- m_cass_rd = state;
-
- check_interrupts();
-}
-
-static PET_DATASSETTE_PORT_INTERFACE( datassette_intf )
-{
- DEVCB_DRIVER_LINE_MEMBER(c64_state, tape_read_w),
-};
-
-
-//-------------------------------------------------
// CBM_IEC_INTERFACE( iec_intf )
//-------------------------------------------------
-WRITE_LINE_MEMBER( c64_state::iec_srq_w )
-{
- m_iec_srq = state;
-
- check_interrupts();
-}
-
static CBM_IEC_INTERFACE( iec_intf )
{
- DEVCB_DRIVER_LINE_MEMBER(c64_state, iec_srq_w),
+ DEVCB_DEVICE_LINE_MEMBER(MOS6526_1_TAG, mos6526_device, flag_w),
DEVCB_DEVICE_LINE_MEMBER(C64_USER_PORT_TAG, c64_user_port_device, atn_w),
DEVCB_NULL,
DEVCB_NULL,
@@ -1143,8 +1115,6 @@ void c64_state::machine_start()
save_item(NAME(m_exp_irq));
save_item(NAME(m_exp_nmi));
save_item(NAME(m_exp_dma));
- save_item(NAME(m_cass_rd));
- save_item(NAME(m_iec_srq));
}
@@ -1194,9 +1164,10 @@ static MACHINE_CONFIG_START( ntsc, c64_state )
MCFG_PLS100_ADD(PLA_TAG)
MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6567_CLOCK, 60, cia1_intf)
MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, cia2_intf)
- MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, "c1530", NULL)
+ MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", NULL, DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w))
MCFG_CBM_IEC_ADD(iec_intf, "c1541")
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
+ MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6567_TAG, mos6567_device, lp_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy", NULL)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6567_CLOCK, expansion_intf, c64_expansion_cards, NULL, NULL)
MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, user_intf, c64_user_port_cards, NULL, NULL)
@@ -1294,9 +1265,10 @@ static MACHINE_CONFIG_START( pal, c64_state )
MCFG_PLS100_ADD(PLA_TAG)
MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6569_CLOCK, 50, cia1_intf)
MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6569_CLOCK, 50, cia2_intf)
- MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, "c1530", NULL)
+ MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", NULL, DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w))
MCFG_CBM_IEC_ADD(iec_intf, "c1541")
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
+ MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6569_TAG, mos6569_device, lp_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy", NULL)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, expansion_intf, c64_expansion_cards, NULL, NULL)
MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, user_intf, c64_user_port_cards, NULL, NULL)
@@ -1374,6 +1346,7 @@ static MACHINE_CONFIG_START( pal_gs, c64gs_state )
MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6569_CLOCK, 50, cia2_intf)
MCFG_CBM_IEC_BUS_ADD(iec_intf)
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
+ MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6569_TAG, mos6569_device, lp_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy", NULL)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, VIC6569_CLOCK, expansion_intf, c64_expansion_cards, NULL, NULL)
MCFG_C64_USER_PORT_ADD(C64_USER_PORT_TAG, user_intf, c64_user_port_cards, NULL, NULL)
diff --git a/src/mess/drivers/cbm2.c b/src/mess/drivers/cbm2.c
index 7747a80b0df..87c3f2b3225 100644
--- a/src/mess/drivers/cbm2.c
+++ b/src/mess/drivers/cbm2.c
@@ -1663,34 +1663,6 @@ static MOS6526_INTERFACE( cia_intf )
//-------------------------------------------------
-// PET_DATASSETTE_PORT_INTERFACE( datassette_intf )
-//-------------------------------------------------
-
-WRITE_LINE_MEMBER( cbm2_state::tape_read_w )
-{
- m_cass_rd = state;
-
- m_cia->flag_w(m_cass_rd && m_user_flag);
-}
-
-static PET_DATASSETTE_PORT_INTERFACE( datassette_intf )
-{
- DEVCB_DRIVER_LINE_MEMBER(cbm2_state, tape_read_w)
-};
-
-
-//-------------------------------------------------
-// DS75160A_INTERFACE( ds75160a_intf )
-//-------------------------------------------------
-
-static DS75160A_INTERFACE( ds75160a_intf )
-{
- DEVCB_DEVICE_MEMBER(IEEE488_TAG, ieee488_device, dio_r),
- DEVCB_DEVICE_MEMBER(IEEE488_TAG, ieee488_device, dio_w)
-};
-
-
-//-------------------------------------------------
// DS75161A_INTERFACE( ds75161a_intf )
//-------------------------------------------------
@@ -2012,8 +1984,6 @@ MACHINE_START_MEMBER( cbm2_state, cbm2 )
save_item(NAME(m_ntsc));
save_item(NAME(m_todclk));
save_item(NAME(m_tpi1_irq));
- save_item(NAME(m_cass_rd));
- save_item(NAME(m_user_flag));
save_item(NAME(m_tpi2_pa));
save_item(NAME(m_tpi2_pb));
save_item(NAME(m_cia_pa));
@@ -2132,7 +2102,6 @@ MACHINE_RESET_MEMBER( cbm2_state, cbm2 )
m_busy2 = 1;
m_graphics = 1;
m_tpi1_irq = CLEAR_LINE;
- m_cass_rd = 1;
m_user_irq = CLEAR_LINE;
m_maincpu->reset();
@@ -2214,13 +2183,14 @@ static MACHINE_CONFIG_START( p500_ntsc, p500_state )
MCFG_PLS100_ADD(PLA2_TAG)
MCFG_TPI6525_ADD(MOS6525_1_TAG, p500_tpi1_intf)
MCFG_TPI6525_ADD(MOS6525_2_TAG, p500_tpi2_intf)
- MCFG_ACIA6551_ADD(MOS6551A_TAG)
+ MCFG_MOS6551_ADD(MOS6551A_TAG, XTAL_1_8432MHz, DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i4_w))
MCFG_MOS6526_ADD(MOS6526_TAG, VIC6567_CLOCK, 60, cia_intf)
- MCFG_DS75160A_ADD(DS75160A_TAG, ds75160a_intf)
+ MCFG_DS75160A_ADD(DS75160A_TAG, DEVREAD8(IEEE488_TAG, ieee488_device, dio_r), DEVWRITE8(IEEE488_TAG, ieee488_device, dio_w))
MCFG_DS75161A_ADD(DS75161A_TAG, ds75161a_intf)
MCFG_CBM_IEEE488_ADD(ieee488_intf, "c8050")
- MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, NULL, NULL)
+ MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, NULL, NULL, DEVWRITELINE(MOS6526_TAG, mos6526_device, flag_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
+ MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6567_TAG, mos6567_device, lp_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL, NULL)
MCFG_CBM2_EXPANSION_SLOT_ADD(CBM2_EXPANSION_SLOT_TAG, VIC6567_CLOCK, cbm2_expansion_cards, NULL, NULL)
MCFG_CBM2_USER_PORT_ADD(CBM2_USER_PORT_TAG, p500_user_intf, cbm2_user_port_cards, NULL, NULL)
@@ -2264,13 +2234,14 @@ static MACHINE_CONFIG_START( p500_pal, p500_state )
MCFG_PLS100_ADD(PLA2_TAG)
MCFG_TPI6525_ADD(MOS6525_1_TAG, p500_tpi1_intf)
MCFG_TPI6525_ADD(MOS6525_2_TAG, p500_tpi2_intf)
- MCFG_ACIA6551_ADD(MOS6551A_TAG)
+ MCFG_MOS6551_ADD(MOS6551A_TAG, XTAL_1_8432MHz, DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i4_w))
MCFG_MOS6526_ADD(MOS6526_TAG, VIC6569_CLOCK, 50, cia_intf)
- MCFG_DS75160A_ADD(DS75160A_TAG, ds75160a_intf)
+ MCFG_DS75160A_ADD(DS75160A_TAG, DEVREAD8(IEEE488_TAG, ieee488_device, dio_r), DEVWRITE8(IEEE488_TAG, ieee488_device, dio_w))
MCFG_DS75161A_ADD(DS75161A_TAG, ds75161a_intf)
MCFG_CBM_IEEE488_ADD(ieee488_intf, "c8050")
- MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, NULL, NULL)
+ MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, NULL, NULL, DEVWRITELINE(MOS6526_TAG, mos6526_device, flag_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
+ MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6569_TAG, mos6569_device, lp_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL, NULL)
MCFG_CBM2_EXPANSION_SLOT_ADD(CBM2_EXPANSION_SLOT_TAG, VIC6569_CLOCK, cbm2_expansion_cards, NULL, NULL)
MCFG_CBM2_USER_PORT_ADD(CBM2_USER_PORT_TAG, p500_user_intf, cbm2_user_port_cards, NULL, NULL)
@@ -2321,12 +2292,12 @@ static MACHINE_CONFIG_START( cbm2lp_ntsc, cbm2_state )
MCFG_PLS100_ADD(PLA1_TAG)
MCFG_TPI6525_ADD(MOS6525_1_TAG, tpi1_intf)
MCFG_TPI6525_ADD(MOS6525_2_TAG, tpi2_intf)
- MCFG_ACIA6551_ADD(MOS6551A_TAG)
+ MCFG_MOS6551_ADD(MOS6551A_TAG, XTAL_1_8432MHz, DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i4_w))
MCFG_MOS6526_ADD(MOS6526_TAG, XTAL_18MHz/9, 60, cia_intf)
- MCFG_DS75160A_ADD(DS75160A_TAG, ds75160a_intf)
+ MCFG_DS75160A_ADD(DS75160A_TAG, DEVREAD8(IEEE488_TAG, ieee488_device, dio_r), DEVWRITE8(IEEE488_TAG, ieee488_device, dio_w))
MCFG_DS75161A_ADD(DS75161A_TAG, ds75161a_intf)
MCFG_CBM_IEEE488_ADD(ieee488_intf, "c8050")
- MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, NULL, NULL)
+ MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, NULL, NULL, DEVWRITELINE(MOS6526_TAG, mos6526_device, flag_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL, NULL)
MCFG_CBM2_EXPANSION_SLOT_ADD(CBM2_EXPANSION_SLOT_TAG, XTAL_18MHz/9, cbm2_expansion_cards, NULL, NULL)
@@ -2345,8 +2316,7 @@ MACHINE_CONFIG_END
// MACHINE_CONFIG( b128 )
//-------------------------------------------------
-static MACHINE_CONFIG_START( b128, cbm2_state )
- MCFG_FRAGMENT_ADD(cbm2lp_ntsc)
+static MACHINE_CONFIG_DERIVED( b128, cbm2lp_ntsc )
MCFG_FRAGMENT_ADD(128k)
MACHINE_CONFIG_END
@@ -2355,8 +2325,7 @@ MACHINE_CONFIG_END
// MACHINE_CONFIG( b256 )
//-------------------------------------------------
-static MACHINE_CONFIG_START( b256, cbm2_state )
- MCFG_FRAGMENT_ADD(cbm2lp_ntsc)
+static MACHINE_CONFIG_DERIVED( b256, cbm2lp_ntsc )
MCFG_FRAGMENT_ADD(256k)
MACHINE_CONFIG_END
@@ -2365,9 +2334,7 @@ MACHINE_CONFIG_END
// MACHINE_CONFIG( cbm2lp_pal )
//-------------------------------------------------
-static MACHINE_CONFIG_START( cbm2lp_pal, cbm2_state )
- MCFG_FRAGMENT_ADD(cbm2lp_ntsc)
-
+static MACHINE_CONFIG_DERIVED( cbm2lp_pal, cbm2lp_ntsc )
MCFG_MACHINE_START_OVERRIDE(cbm2_state, cbm2_pal)
MCFG_DEVICE_REMOVE(MOS6526_TAG)
@@ -2379,8 +2346,7 @@ MACHINE_CONFIG_END
// MACHINE_CONFIG( cbm610 )
//-------------------------------------------------
-static MACHINE_CONFIG_START( cbm610, cbm2_state )
- MCFG_FRAGMENT_ADD(cbm2lp_pal)
+static MACHINE_CONFIG_DERIVED( cbm610, cbm2lp_pal )
MCFG_FRAGMENT_ADD(128k)
MACHINE_CONFIG_END
@@ -2389,8 +2355,7 @@ MACHINE_CONFIG_END
// MACHINE_CONFIG( cbm620 )
//-------------------------------------------------
-static MACHINE_CONFIG_START( cbm620, cbm2_state )
- MCFG_FRAGMENT_ADD(cbm2lp_pal)
+static MACHINE_CONFIG_DERIVED( cbm620, cbm2lp_pal )
MCFG_FRAGMENT_ADD(256k)
MACHINE_CONFIG_END
@@ -2399,10 +2364,7 @@ MACHINE_CONFIG_END
// MACHINE_CONFIG( cbm2hp_ntsc )
//-------------------------------------------------
-static MACHINE_CONFIG_START( cbm2hp_ntsc, cbm2hp_state )
- MCFG_FRAGMENT_ADD(cbm2lp_ntsc)
-
- // devices
+static MACHINE_CONFIG_DERIVED_CLASS( cbm2hp_ntsc, cbm2lp_ntsc, cbm2hp_state )
MCFG_DEVICE_REMOVE(MOS6525_2_TAG)
MCFG_TPI6525_ADD(MOS6525_2_TAG, hp_tpi2_intf)
MACHINE_CONFIG_END
@@ -2412,8 +2374,7 @@ MACHINE_CONFIG_END
// MACHINE_CONFIG( b128hp )
//-------------------------------------------------
-static MACHINE_CONFIG_START( b128hp, cbm2hp_state )
- MCFG_FRAGMENT_ADD(cbm2hp_ntsc)
+static MACHINE_CONFIG_DERIVED( b128hp, cbm2hp_ntsc )
MCFG_FRAGMENT_ADD(128k)
MACHINE_CONFIG_END
@@ -2422,8 +2383,7 @@ MACHINE_CONFIG_END
// MACHINE_CONFIG( b256hp )
//-------------------------------------------------
-static MACHINE_CONFIG_START( b256hp, cbm2hp_state )
- MCFG_FRAGMENT_ADD(cbm2hp_ntsc)
+static MACHINE_CONFIG_DERIVED( b256hp, cbm2hp_ntsc )
MCFG_FRAGMENT_ADD(256k)
MACHINE_CONFIG_END
@@ -2432,9 +2392,7 @@ MACHINE_CONFIG_END
// MACHINE_CONFIG( bx256hp )
//-------------------------------------------------
-static MACHINE_CONFIG_START( bx256hp, cbm2hp_state )
- MCFG_FRAGMENT_ADD(b256hp)
-
+static MACHINE_CONFIG_DERIVED( bx256hp, b256hp )
MCFG_MACHINE_START_OVERRIDE(cbm2_state, cbm2x_ntsc)
MCFG_CPU_ADD(EXT_I8088_TAG, I8088, XTAL_12MHz)
@@ -2451,9 +2409,7 @@ MACHINE_CONFIG_END
// MACHINE_CONFIG( cbm2hp_pal )
//-------------------------------------------------
-static MACHINE_CONFIG_START( cbm2hp_pal, cbm2hp_state )
- MCFG_FRAGMENT_ADD(cbm2hp_ntsc)
-
+static MACHINE_CONFIG_DERIVED( cbm2hp_pal, cbm2hp_ntsc )
MCFG_MACHINE_START_OVERRIDE(cbm2_state, cbm2_pal)
// devices
@@ -2469,8 +2425,7 @@ MACHINE_CONFIG_END
// MACHINE_CONFIG( cbm710 )
//-------------------------------------------------
-static MACHINE_CONFIG_START( cbm710, cbm2hp_state )
- MCFG_FRAGMENT_ADD(cbm2hp_pal)
+static MACHINE_CONFIG_DERIVED( cbm710, cbm2hp_pal )
MCFG_FRAGMENT_ADD(128k)
MACHINE_CONFIG_END
@@ -2479,8 +2434,7 @@ MACHINE_CONFIG_END
// MACHINE_CONFIG( cbm720 )
//-------------------------------------------------
-static MACHINE_CONFIG_START( cbm720, cbm2hp_state )
- MCFG_FRAGMENT_ADD(cbm2hp_pal)
+static MACHINE_CONFIG_DERIVED( cbm720, cbm2hp_pal )
MCFG_FRAGMENT_ADD(256k)
MACHINE_CONFIG_END
@@ -2489,9 +2443,7 @@ MACHINE_CONFIG_END
// MACHINE_CONFIG( cbm730 )
//-------------------------------------------------
-static MACHINE_CONFIG_START( cbm730, cbm2hp_state )
- MCFG_FRAGMENT_ADD(cbm720)
-
+static MACHINE_CONFIG_DERIVED( cbm730, cbm720 )
MCFG_MACHINE_START_OVERRIDE(cbm2_state, cbm2x_pal)
MCFG_CPU_ADD(EXT_I8088_TAG, I8088, XTAL_12MHz)
@@ -2537,11 +2489,6 @@ ROM_START( p500 )
ROM_LOAD( "906114-03.u88", 0x00, 0xf5, CRC(668c073e) SHA1(1115858bb2dc91ea9e2016ba2e23ec94239358b4) )
ROM_END
-
-//-------------------------------------------------
-// ROM( p500p )
-//-------------------------------------------------
-
#define rom_p500p rom_p500
@@ -2590,6 +2537,9 @@ ROM_START( b128 )
ROM_LOAD( "906114-04.u18", 0x00, 0xf5, CRC(ae3ec265) SHA1(334e0bc4b2c957ecb240c051d84372f7b47efba3) )
ROM_END
+#define rom_cbm610 rom_b128
+#define rom_cbm620 rom_b256
+
//-------------------------------------------------
// ROM( b256 )
@@ -2616,20 +2566,6 @@ ROM_END
//-------------------------------------------------
-// ROM( cbm610 )
-//-------------------------------------------------
-
-#define rom_cbm610 rom_b128
-
-
-//-------------------------------------------------
-// ROM( cbm620 )
-//-------------------------------------------------
-
-#define rom_cbm620 rom_b256
-
-
-//-------------------------------------------------
// ROM( cbm620_hu )
//-------------------------------------------------
@@ -2673,6 +2609,8 @@ ROM_START( b128hp )
ROM_LOAD( "906114-05.u75", 0x00, 0xf5, CRC(ff6ba6b6) SHA1(45808c570eb2eda7091c51591b3dbd2db1ac646a) )
ROM_END
+#define rom_cbm710 rom_b128hp
+
//-------------------------------------------------
// ROM( b256hp )
@@ -2697,6 +2635,8 @@ ROM_START( b256hp )
ROM_LOAD( "906114-05.u75", 0x00, 0xf5, CRC(ff6ba6b6) SHA1(45808c570eb2eda7091c51591b3dbd2db1ac646a) )
ROM_END
+#define rom_cbm720 rom_b256hp
+
//-------------------------------------------------
// ROM( bx256hp )
@@ -2724,25 +2664,6 @@ ROM_START( bx256hp )
ROM_LOAD( "906114-05.u75", 0x00, 0xf5, CRC(ff6ba6b6) SHA1(45808c570eb2eda7091c51591b3dbd2db1ac646a) )
ROM_END
-
-//-------------------------------------------------
-// ROM( cbm710 )
-//-------------------------------------------------
-
-#define rom_cbm710 rom_b128hp
-
-
-//-------------------------------------------------
-// ROM( cbm720 )
-//-------------------------------------------------
-
-#define rom_cbm720 rom_b256hp
-
-
-//-------------------------------------------------
-// ROM( cbm730 )
-//-------------------------------------------------
-
#define rom_cbm730 rom_bx256hp
diff --git a/src/mess/drivers/pet2001.c b/src/mess/drivers/pet2001.c
index 1ae8cef1566..6a1eca61ff7 100644
--- a/src/mess/drivers/pet2001.c
+++ b/src/mess/drivers/pet2001.c
@@ -881,37 +881,6 @@ static IEEE488_INTERFACE( ieee488_intf )
//-------------------------------------------------
-// PET_DATASSETTE_PORT_INTERFACE( datassette_intf )
-//-------------------------------------------------
-
-static PET_DATASSETTE_PORT_INTERFACE( datassette_intf )
-{
- DEVCB_DEVICE_LINE_MEMBER(M6520_1_TAG, pia6821_device, ca1_w)
-};
-
-
-//-------------------------------------------------
-// PET_DATASSETTE_PORT_INTERFACE( datassette2_intf )
-//-------------------------------------------------
-
-static PET_DATASSETTE_PORT_INTERFACE( datassette2_intf )
-{
- DEVCB_DEVICE_LINE_MEMBER(M6522_TAG, via6522_device, write_cb1)
-};
-
-
-//-------------------------------------------------
-// PET_EXPANSION_INTERFACE( exp_intf )
-//-------------------------------------------------
-
-static PET_EXPANSION_INTERFACE( exp_intf )
-{
- DEVCB_DRIVER_MEMBER(pet_state, read),
- DEVCB_DRIVER_MEMBER(pet_state, write)
-};
-
-
-//-------------------------------------------------
// PET_USER_PORT_INTERFACE( user_intf )
//-------------------------------------------------
@@ -1202,9 +1171,10 @@ static MACHINE_CONFIG_START( pet, pet_state )
MCFG_PIA6821_ADD(M6520_1_TAG, pia1_intf)
MCFG_PIA6821_ADD(M6520_2_TAG, pia2_intf)
MCFG_CBM_IEEE488_ADD(ieee488_intf, "c4040")
- MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, "c2n", NULL)
- MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT2_TAG, datassette2_intf, cbm_datassette_devices, NULL, NULL)
- MCFG_PET_EXPANSION_SLOT_ADD(PET_EXPANSION_SLOT_TAG, XTAL_8MHz/8, exp_intf, pet_expansion_cards, NULL, NULL)
+ MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c2n", NULL, DEVWRITELINE(M6520_1_TAG, pia6821_device, ca1_w))
+ MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT2_TAG, cbm_datassette_devices, NULL, NULL, DEVWRITELINE(M6522_TAG, via6522_device, write_cb1))
+ MCFG_PET_EXPANSION_SLOT_ADD(PET_EXPANSION_SLOT_TAG, XTAL_8MHz/8, pet_expansion_cards, NULL, NULL)
+ MCFG_PET_EXPANSION_SLOT_DMA_CALLBACKS(READ8(pet_state, read), WRITE8(pet_state, write))
MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, user_intf, pet_user_port_cards, NULL, NULL)
MCFG_QUICKLOAD_ADD("quickload", cbm_pet, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
@@ -1478,9 +1448,10 @@ static MACHINE_CONFIG_START( pet80, pet80_state )
MCFG_PIA6821_ADD(M6520_1_TAG, pia1_intf)
MCFG_PIA6821_ADD(M6520_2_TAG, pia2_intf)
MCFG_CBM_IEEE488_ADD(ieee488_intf, "c8050")
- MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, "c2n", NULL)
- MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT2_TAG, datassette2_intf, cbm_datassette_devices, NULL, NULL)
- MCFG_PET_EXPANSION_SLOT_ADD(PET_EXPANSION_SLOT_TAG, XTAL_16MHz/16, exp_intf, pet_expansion_cards, NULL, NULL)
+ MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c2n", NULL, DEVWRITELINE(M6520_1_TAG, pia6821_device, ca1_w))
+ MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT2_TAG, cbm_datassette_devices, NULL, NULL, DEVWRITELINE(M6522_TAG, via6522_device, write_cb1))
+ MCFG_PET_EXPANSION_SLOT_ADD(PET_EXPANSION_SLOT_TAG, XTAL_16MHz/16, pet_expansion_cards, NULL, NULL)
+ MCFG_PET_EXPANSION_SLOT_DMA_CALLBACKS(READ8(pet_state, read), WRITE8(pet_state, write))
MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, user_intf, pet_user_port_cards, NULL, NULL)
MCFG_QUICKLOAD_ADD("quickload", cbm_pet, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
@@ -1505,7 +1476,8 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED_CLASS( superpet, pet8032, superpet_state )
MCFG_DEVICE_REMOVE(PET_EXPANSION_SLOT_TAG)
- MCFG_PET_EXPANSION_SLOT_ADD(PET_EXPANSION_SLOT_TAG, XTAL_16MHz/16, exp_intf, pet_expansion_cards, "superpet", NULL)
+ MCFG_PET_EXPANSION_SLOT_ADD(PET_EXPANSION_SLOT_TAG, XTAL_16MHz/16, pet_expansion_cards, "superpet", NULL)
+ MCFG_PET_EXPANSION_SLOT_DMA_CALLBACKS(READ8(pet_state, read), WRITE8(pet_state, write))
MCFG_SOFTWARE_LIST_ADD("flop_list2", "superpet_flop")
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/plus4.c b/src/mess/drivers/plus4.c
index df53832f4e1..f5ae1e5074f 100644
--- a/src/mess/drivers/plus4.c
+++ b/src/mess/drivers/plus4.c
@@ -503,7 +503,7 @@ READ8_MEMBER( plus4_state::cpu_r )
return data;
}
-READ8_MEMBER( plus4_state::c16_cpu_r )
+READ8_MEMBER( c16_state::cpu_r )
{
/*
@@ -650,45 +650,25 @@ static MOS7360_INTERFACE( ted_intf )
//-------------------------------------------------
-// MOS6529_INTERFACE( spi_user_intf )
-//-------------------------------------------------
-
-static MOS6529_INTERFACE( spi_user_intf )
-{
- DEVCB_DEVICE_MEMBER(PLUS4_USER_PORT_TAG, plus4_user_port_device, p_r),
- DEVCB_DEVICE_MEMBER(PLUS4_USER_PORT_TAG, plus4_user_port_device, p_w)
-};
-
-
-//-------------------------------------------------
// MOS6529_INTERFACE( spi_kb_intf )
//-------------------------------------------------
-READ8_MEMBER( plus4_state::spi_kb_r )
-{
- return 0xff;
-}
-
WRITE8_MEMBER( plus4_state::spi_kb_w )
{
m_kb = data;
}
-static MOS6529_INTERFACE( spi_kb_intf )
-{
- DEVCB_DRIVER_MEMBER(plus4_state, spi_kb_r),
- DEVCB_DRIVER_MEMBER(plus4_state, spi_kb_w)
-};
-
//-------------------------------------------------
-// PET_DATASSETTE_PORT_INTERFACE( datassette_intf )
+// MOS6551_INTERFACE( acia_intf )
//-------------------------------------------------
-static PET_DATASSETTE_PORT_INTERFACE( datassette_intf )
+WRITE_LINE_MEMBER( plus4_state::acia_irq_w )
{
- DEVCB_NULL
-};
+ m_acia_irq = state;
+
+ check_interrupts();
+}
//-------------------------------------------------
@@ -821,7 +801,7 @@ static MACHINE_CONFIG_START( ntsc, plus4_state )
MCFG_M7501_PORT_PULLS(0x00, 0xc0)
MCFG_CPU_VBLANK_INT_DRIVER(SCREEN_TAG, plus4_state, c16_frame_interrupt)
MCFG_CPU_PERIODIC_INT_DRIVER(plus4_state, c16_raster_interrupt, TED7360_HRETRACERATE)
- MCFG_QUANTUM_TIME(attotime::from_hz(60))
+ MCFG_QUANTUM_PERFECT_CPU(MOS7501_TAG)
// video and sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -830,10 +810,10 @@ static MACHINE_CONFIG_START( ntsc, plus4_state )
// devices
MCFG_PLS100_ADD(PLA_TAG)
- MCFG_ACIA6551_ADD(MOS6551_TAG)
- MCFG_MOS6529_ADD(MOS6529_USER_TAG, spi_user_intf)
- MCFG_MOS6529_ADD(MOS6529_KB_TAG, spi_kb_intf)
- MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, plus4_datassette_devices, "c1531", NULL)
+ MCFG_MOS6551_ADD(MOS6551_TAG, XTAL_1_8432MHz, DEVWRITELINE(DEVICE_SELF, plus4_state, acia_irq_w))
+ MCFG_MOS6529_ADD(MOS6529_USER_TAG, DEVREAD8(PLUS4_USER_PORT_TAG, plus4_user_port_device, p_r), DEVWRITE8(PLUS4_USER_PORT_TAG, plus4_user_port_device, p_w))
+ MCFG_MOS6529_ADD(MOS6529_KB_TAG, CONSTANT(0xff), DEVWRITE8(DEVICE_SELF, plus4_state, spi_kb_w))
+ MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, plus4_datassette_devices, "c1531", NULL, NULL)
MCFG_CBM_IEC_ADD(iec_intf, NULL)
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy", NULL)
@@ -867,7 +847,7 @@ static MACHINE_CONFIG_START( pal, plus4_state )
MCFG_M7501_PORT_PULLS(0x00, 0xc0)
MCFG_CPU_VBLANK_INT_DRIVER(SCREEN_TAG, plus4_state, c16_frame_interrupt)
MCFG_CPU_PERIODIC_INT_DRIVER(plus4_state, c16_raster_interrupt, TED7360_HRETRACERATE)
- MCFG_QUANTUM_TIME(attotime::from_hz(60))
+ MCFG_QUANTUM_PERFECT_CPU(MOS7501_TAG)
// video and sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -876,16 +856,16 @@ static MACHINE_CONFIG_START( pal, plus4_state )
// devices
MCFG_PLS100_ADD(PLA_TAG)
- MCFG_ACIA6551_ADD(MOS6551_TAG)
- MCFG_MOS6529_ADD(MOS6529_USER_TAG, spi_user_intf)
- MCFG_MOS6529_ADD(MOS6529_KB_TAG, spi_kb_intf)
- MCFG_QUICKLOAD_ADD("quickload", cbm_c16, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
- MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, plus4_datassette_devices, "c1531", NULL)
+ MCFG_MOS6551_ADD(MOS6551_TAG, XTAL_1_8432MHz, DEVWRITELINE(DEVICE_SELF, plus4_state, acia_irq_w))
+ MCFG_MOS6529_ADD(MOS6529_USER_TAG, DEVREAD8(PLUS4_USER_PORT_TAG, plus4_user_port_device, p_r), DEVWRITE8(PLUS4_USER_PORT_TAG, plus4_user_port_device, p_w))
+ MCFG_MOS6529_ADD(MOS6529_KB_TAG, CONSTANT(0xff), DEVWRITE8(DEVICE_SELF, plus4_state, spi_kb_w))
+ MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, plus4_datassette_devices, "c1531", NULL, NULL)
MCFG_CBM_IEC_ADD(iec_intf, NULL)
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy", NULL)
MCFG_PLUS4_EXPANSION_SLOT_ADD(PLUS4_EXPANSION_SLOT_TAG, XTAL_17_73447MHz/20, expansion_intf, plus4_expansion_cards, "c1551", NULL)
MCFG_PLUS4_USER_PORT_ADD(PLUS4_USER_PORT_TAG, plus4_user_port_cards, NULL, NULL)
+ MCFG_QUICKLOAD_ADD("quickload", cbm_c16, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
// internal ram
MCFG_RAM_ADD(RAM_TAG)
@@ -905,9 +885,9 @@ MACHINE_CONFIG_END
// MACHINE_CONFIG( c16n )
//-------------------------------------------------
-static MACHINE_CONFIG_DERIVED( c16n, ntsc )
+static MACHINE_CONFIG_DERIVED_CLASS( c16n, ntsc, c16_state )
MCFG_CPU_MODIFY(MOS7501_TAG)
- MCFG_M7501_PORT_CALLBACKS(READ8(plus4_state, c16_cpu_r), WRITE8(plus4_state, cpu_w))
+ MCFG_M7501_PORT_CALLBACKS(READ8(c16_state, cpu_r), WRITE8(plus4_state, cpu_w))
MCFG_M7501_PORT_PULLS(0x00, 0xc0)
MCFG_DEVICE_REMOVE(MOS6551_TAG)
@@ -927,9 +907,9 @@ MACHINE_CONFIG_END
// MACHINE_CONFIG( c16p )
//-------------------------------------------------
-static MACHINE_CONFIG_DERIVED( c16p, pal )
+static MACHINE_CONFIG_DERIVED_CLASS( c16p, pal, c16_state )
MCFG_CPU_MODIFY(MOS7501_TAG)
- MCFG_M7501_PORT_CALLBACKS(READ8(plus4_state, c16_cpu_r), WRITE8(plus4_state, cpu_w))
+ MCFG_M7501_PORT_CALLBACKS(READ8(c16_state, cpu_r), WRITE8(plus4_state, cpu_w))
MCFG_M7501_PORT_PULLS(0x00, 0xc0)
MCFG_DEVICE_REMOVE(MOS6551_TAG)
diff --git a/src/mess/drivers/vic10.c b/src/mess/drivers/vic10.c
index a4e93e24017..e94d7c31518 100644
--- a/src/mess/drivers/vic10.c
+++ b/src/mess/drivers/vic10.c
@@ -555,15 +555,6 @@ WRITE8_MEMBER( vic10_state::cpu_w )
m_cassette->motor_w(BIT(data, 5));
}
-//-------------------------------------------------
-// PET_DATASSETTE_PORT_INTERFACE( datassette_intf )
-//-------------------------------------------------
-
-static PET_DATASSETTE_PORT_INTERFACE( datassette_intf )
-{
- DEVCB_DEVICE_LINE_MEMBER(MOS6526_TAG, mos6526_device, flag_w)
-};
-
//-------------------------------------------------
// C64_EXPANSION_INTERFACE( expansion_intf )
@@ -652,13 +643,12 @@ static MACHINE_CONFIG_START( vic10, vic10_state )
MCFG_SOUND_ADD(MOS6581_TAG, SID6581, VIC6566_CLOCK)
MCFG_SOUND_CONFIG(sid_intf)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
// devices
MCFG_MOS6526_ADD(MOS6526_TAG, VIC6566_CLOCK, 60, cia_intf)
- MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, NULL, NULL)
+ MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", NULL, DEVWRITELINE(MOS6526_TAG, mos6526_device, flag_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
+ MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(MOS6566_TAG, mos6566_device, lp_w))
MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy", NULL)
MCFG_VIC10_EXPANSION_SLOT_ADD(VIC10_EXPANSION_SLOT_TAG, VIC6566_CLOCK, expansion_intf, vic10_expansion_cards, NULL, NULL)
diff --git a/src/mess/drivers/vic20.c b/src/mess/drivers/vic20.c
index 865be41ba60..b5b34530d5b 100644
--- a/src/mess/drivers/vic20.c
+++ b/src/mess/drivers/vic20.c
@@ -702,16 +702,6 @@ static const via6522_interface via1_intf =
//-------------------------------------------------
-// PET_DATASSETTE_PORT_INTERFACE( datassette_intf )
-//-------------------------------------------------
-
-static PET_DATASSETTE_PORT_INTERFACE( datassette_intf )
-{
- DEVCB_DEVICE_LINE_MEMBER(M6522_1_TAG, via6522_device, write_ca1),
-};
-
-
-//-------------------------------------------------
// CBM_IEC_INTERFACE( cbm_iec_intf )
//-------------------------------------------------
@@ -822,9 +812,8 @@ static MACHINE_CONFIG_START( vic20, vic20_state )
// devices
MCFG_VIA6522_ADD(M6522_0_TAG, 0, via0_intf)
MCFG_VIA6522_ADD(M6522_1_TAG, 0, via1_intf)
- MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, "c1530", NULL)
+ MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, cbm_datassette_devices, "c1530", NULL, DEVWRITELINE(M6522_1_TAG, via6522_device, write_ca1))
MCFG_CBM_IEC_ADD(cbm_iec_intf, "c1541")
- MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, "joy", NULL)
MCFG_VIC20_USER_PORT_ADD(VIC20_USER_PORT_TAG, user_intf, vic20_user_port_cards, NULL, NULL)
MCFG_QUICKLOAD_ADD("quickload", cbm_vc20, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
@@ -853,11 +842,11 @@ static MACHINE_CONFIG_DERIVED( ntsc, vic20 )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_MOS6560_ADD(M6560_TAG, SCREEN_TAG, MOS6560_CLOCK, vic_intf, vic_videoram_map, vic_colorram_map)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
// devices
MCFG_VIC20_EXPANSION_SLOT_ADD(VIC20_EXPANSION_SLOT_TAG, MOS6560_CLOCK, expansion_intf, vic20_expansion_cards, NULL, NULL)
+ MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, "joy", NULL)
+ MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(M6560_TAG, mos6560_device, lp_w))
// software lists
MCFG_SOFTWARE_LIST_FILTER("cart_list", "NTSC")
@@ -880,11 +869,11 @@ static MACHINE_CONFIG_DERIVED( pal, vic20 )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_MOS6561_ADD(M6560_TAG, SCREEN_TAG, MOS6561_CLOCK, vic_intf, vic_videoram_map, vic_colorram_map)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
// devices
MCFG_VIC20_EXPANSION_SLOT_ADD(VIC20_EXPANSION_SLOT_TAG, MOS6561_CLOCK, expansion_intf, vic20_expansion_cards, NULL, NULL)
+ MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, "joy", NULL)
+ MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(DEVWRITELINE(M6561_TAG, mos6561_device, lp_w))
// software lists
MCFG_SOFTWARE_LIST_FILTER("cart_list", "PAL")
diff --git a/src/mess/includes/c128.h b/src/mess/includes/c128.h
index 1220dc438eb..bcc632205f7 100644
--- a/src/mess/includes/c128.h
+++ b/src/mess/includes/c128.h
@@ -181,8 +181,6 @@ public:
DECLARE_READ8_MEMBER( cpu_r );
DECLARE_WRITE8_MEMBER( cpu_w );
- DECLARE_WRITE_LINE_MEMBER( tape_read_w );
-
DECLARE_WRITE_LINE_MEMBER( iec_srq_w );
DECLARE_WRITE_LINE_MEMBER( iec_data_w );
diff --git a/src/mess/includes/c64.h b/src/mess/includes/c64.h
index deccbbc4637..aaab110519d 100644
--- a/src/mess/includes/c64.h
+++ b/src/mess/includes/c64.h
@@ -71,9 +71,7 @@ public:
m_cia2_irq(CLEAR_LINE),
m_vic_irq(CLEAR_LINE),
m_exp_irq(CLEAR_LINE),
- m_exp_nmi(CLEAR_LINE),
- m_cass_rd(1),
- m_iec_srq(1)
+ m_exp_nmi(CLEAR_LINE)
{ }
required_device<m6510_device> m_maincpu;
@@ -134,10 +132,6 @@ public:
DECLARE_READ8_MEMBER( cpu_r );
DECLARE_WRITE8_MEMBER( cpu_w );
- DECLARE_WRITE_LINE_MEMBER( tape_read_w );
-
- DECLARE_WRITE_LINE_MEMBER( iec_srq_w );
-
DECLARE_READ8_MEMBER( exp_dma_r );
DECLARE_WRITE8_MEMBER( exp_dma_w );
DECLARE_WRITE_LINE_MEMBER( exp_irq_w );
@@ -161,8 +155,6 @@ public:
int m_exp_irq;
int m_exp_nmi;
int m_exp_dma;
- int m_cass_rd;
- int m_iec_srq;
};
diff --git a/src/mess/includes/cbm2.h b/src/mess/includes/cbm2.h
index abda82ca54b..7ca9afea486 100644
--- a/src/mess/includes/cbm2.h
+++ b/src/mess/includes/cbm2.h
@@ -9,7 +9,6 @@
#include "formats/cbm_snqk.h"
#include "includes/cbm.h"
#include "machine/6525tpi.h"
-#include "machine/6551acia.h"
#include "machine/cbm2exp.h"
#include "machine/cbm2user.h"
#include "machine/cbmipt.h"
@@ -17,6 +16,7 @@
#include "machine/ds75161a.h"
#include "machine/ieee488.h"
#include "machine/mos6526.h"
+#include "machine/mos6551.h"
#include "machine/petcass.h"
#include "machine/pic8259.h"
#include "machine/pla.h"
@@ -104,8 +104,7 @@ public:
m_graphics(1),
m_todclk(0),
m_tpi1_irq(CLEAR_LINE),
- m_cass_rd(1),
- m_user_flag(0),
+ m_acia_irq(CLEAR_LINE),
m_user_irq(CLEAR_LINE),
m_tpi2_pa(0),
m_tpi2_pb(0)
@@ -117,7 +116,7 @@ public:
required_device<sid6581_device> m_sid;
required_device<tpi6525_device> m_tpi1;
required_device<tpi6525_device> m_tpi2;
- required_device<acia6551_device> m_acia;
+ required_device<mos6551_device> m_acia;
required_device<mos6526_device> m_cia;
required_device<ds75160a_device> m_ieee1;
required_device<ds75161a_device> m_ieee2;
@@ -225,8 +224,7 @@ public:
// interrupt state
int m_todclk;
int m_tpi1_irq;
- int m_cass_rd;
- int m_user_flag;
+ int m_acia_irq;
int m_user_irq;
// keyboard state;
diff --git a/src/mess/includes/plus4.h b/src/mess/includes/plus4.h
index b3de53367af..5b1e15d54f9 100644
--- a/src/mess/includes/plus4.h
+++ b/src/mess/includes/plus4.h
@@ -69,7 +69,7 @@ public:
required_device<m7501_device> m_maincpu;
required_device<pls100_device> m_pla;
required_device<mos7360_device> m_ted;
- optional_device<acia6551_device> m_acia;
+ optional_device<mos6551_device> m_acia;
optional_device<mos6529_device> m_spi_user;
required_device<mos6529_device> m_spi_kb;
optional_device<t6721_device> m_t6721;
@@ -106,7 +106,6 @@ public:
DECLARE_READ8_MEMBER( ted_videoram_r );
DECLARE_READ8_MEMBER( cpu_r );
- DECLARE_READ8_MEMBER( c16_cpu_r );
DECLARE_WRITE8_MEMBER( cpu_w );
DECLARE_WRITE_LINE_MEMBER( ted_irq_w );
@@ -114,9 +113,10 @@ public:
DECLARE_READ8_MEMBER( ted_rom_r );
DECLARE_READ8_MEMBER( ted_k_r );
- DECLARE_READ8_MEMBER( spi_kb_r );
DECLARE_WRITE8_MEMBER( spi_kb_w );
+ DECLARE_WRITE_LINE_MEMBER( acia_irq_w );
+
DECLARE_READ8_MEMBER( exp_dma_r );
DECLARE_WRITE8_MEMBER( exp_dma_w );
DECLARE_WRITE_LINE_MEMBER( exp_irq_w );
@@ -153,5 +153,16 @@ public:
};
+class c16_state : public plus4_state
+{
+public:
+ c16_state(const machine_config &mconfig, device_type type, const char *tag)
+ : plus4_state(mconfig, type, tag)
+ { }
+
+ DECLARE_READ8_MEMBER( cpu_r );
+};
+
+
#endif
diff --git a/src/mess/machine/petcass.c b/src/mess/machine/petcass.c
index 6ebe89e6bb0..bfe065a6d48 100644
--- a/src/mess/machine/petcass.c
+++ b/src/mess/machine/petcass.c
@@ -53,8 +53,9 @@ device_pet_datassette_port_interface::~device_pet_datassette_port_interface()
//-------------------------------------------------
pet_datassette_port_device::pet_datassette_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- device_t(mconfig, PET_DATASSETTE_PORT, "Datassette Port", tag, owner, clock),
- device_slot_interface(mconfig, *this)
+ device_t(mconfig, PET_DATASSETTE_PORT, "Datassette Port", tag, owner, clock),
+ device_slot_interface(mconfig, *this),
+ m_read_handler(*this)
{
}
@@ -69,29 +70,6 @@ pet_datassette_port_device::~pet_datassette_port_device()
//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void pet_datassette_port_device::device_config_complete()
-{
- // inherit a copy of the static data
- const pet_datassette_port_interface *intf = reinterpret_cast<const pet_datassette_port_interface *>(static_config());
- if (intf != NULL)
- {
- *static_cast<pet_datassette_port_interface *>(this) = *intf;
- }
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_out_read_cb, 0, sizeof(m_out_read_cb));
- }
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -100,7 +78,7 @@ void pet_datassette_port_device::device_start()
m_cart = dynamic_cast<device_pet_datassette_port_interface *>(get_card_device());
// resolve callbacks
- m_out_read_func.resolve(m_out_read_cb, *this);
+ m_read_handler.resolve_safe();
}
@@ -109,4 +87,4 @@ WRITE_LINE_MEMBER( pet_datassette_port_device::write ) { if (m_cart != NULL) m_c
READ_LINE_MEMBER( pet_datassette_port_device::sense_r ) { int state = 1; if (m_cart != NULL) state = m_cart->datassette_sense(); return state; }
WRITE_LINE_MEMBER( pet_datassette_port_device::motor_w ) { if (m_cart != NULL) m_cart->datassette_motor(state); }
-WRITE_LINE_MEMBER( pet_datassette_port_device::read_w ) { m_out_read_func(state); }
+WRITE_LINE_MEMBER( pet_datassette_port_device::read_w ) { m_read_handler(state); }
diff --git a/src/mess/machine/petcass.h b/src/mess/machine/petcass.h
index 99353ea657b..f8d0316b4ad 100644
--- a/src/mess/machine/petcass.h
+++ b/src/mess/machine/petcass.h
@@ -38,14 +38,10 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
-#define PET_DATASSETTE_PORT_INTERFACE(_name) \
- const pet_datassette_port_interface (_name) =
-
-
-#define MCFG_PET_DATASSETTE_PORT_ADD(_tag, _config, _slot_intf, _def_slot, _def_inp) \
+#define MCFG_PET_DATASSETTE_PORT_ADD(_tag, _slot_intf, _def_slot, _def_inp, _devcb) \
MCFG_DEVICE_ADD(_tag, PET_DATASSETTE_PORT, 0) \
- MCFG_DEVICE_CONFIG(_config) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false)
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) \
+ devcb = &pet_datassette_port_device::set_read_handler(*device, DEVCB2_##_devcb);
@@ -53,20 +49,11 @@
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> pet_datassette_port_interface
-
-struct pet_datassette_port_interface
-{
- devcb_write_line m_out_read_cb;
-};
-
-
// ======================> pet_datassette_port_device
class device_pet_datassette_port_interface;
class pet_datassette_port_device : public device_t,
- public pet_datassette_port_interface,
public device_slot_interface
{
public:
@@ -74,6 +61,9 @@ public:
pet_datassette_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~pet_datassette_port_device();
+ // static configuration helpers
+ template<class _Object> static devcb2_base &set_read_handler(device_t &device, _Object object) { return downcast<pet_datassette_port_device &>(device).m_read_handler.set_callback(object); }
+
// computer interface
DECLARE_READ_LINE_MEMBER( read );
DECLARE_WRITE_LINE_MEMBER( write );
@@ -85,10 +75,9 @@ public:
protected:
// device-level overrides
- virtual void device_config_complete();
virtual void device_start();
- devcb_resolved_write_line m_out_read_func;
+ devcb2_write_line m_read_handler;
device_pet_datassette_port_interface *m_cart;
};
diff --git a/src/mess/machine/petexp.c b/src/mess/machine/petexp.c
index 63dd877dd29..04f9c7fdcc4 100644
--- a/src/mess/machine/petexp.c
+++ b/src/mess/machine/petexp.c
@@ -37,7 +37,9 @@ const device_type PET_EXPANSION_SLOT = &device_creator<pet_expansion_slot_device
pet_expansion_slot_device::pet_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, PET_EXPANSION_SLOT, "PET memory expansion port", tag, owner, clock),
- device_slot_interface(mconfig, *this)
+ device_slot_interface(mconfig, *this),
+ m_read_dma(*this),
+ m_write_dma(*this)
{
}
@@ -72,30 +74,6 @@ device_pet_expansion_card_interface::~device_pet_expansion_card_interface()
//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void pet_expansion_slot_device::device_config_complete()
-{
- // inherit a copy of the static data
- const pet_expansion_slot_interface *intf = reinterpret_cast<const pet_expansion_slot_interface *>(static_config());
- if (intf != NULL)
- {
- *static_cast<pet_expansion_slot_interface *>(this) = *intf;
- }
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_in_dma_bd_cb, 0, sizeof(m_in_dma_bd_cb));
- memset(&m_out_dma_bd_cb, 0, sizeof(m_out_dma_bd_cb));
- }
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -104,8 +82,8 @@ void pet_expansion_slot_device::device_start()
m_card = dynamic_cast<device_pet_expansion_card_interface *>(get_card_device());
// resolve callbacks
- m_in_dma_bd_func.resolve(m_in_dma_bd_cb, *this);
- m_out_dma_bd_func.resolve(m_out_dma_bd_cb, *this);
+ m_read_dma.resolve_safe(0);
+ m_write_dma.resolve_safe();
}
@@ -186,7 +164,7 @@ WRITE_LINE_MEMBER( pet_expansion_slot_device::irq_w )
UINT8 pet_expansion_slot_device::dma_bd_r(offs_t offset)
{
- return m_in_dma_bd_func(offset);
+ return m_read_dma(offset);
}
@@ -196,7 +174,7 @@ UINT8 pet_expansion_slot_device::dma_bd_r(offs_t offset)
void pet_expansion_slot_device::dma_bd_w(offs_t offset, UINT8 data)
{
- m_out_dma_bd_func(offset, data);
+ m_write_dma(offset, data);
}
diff --git a/src/mess/machine/petexp.h b/src/mess/machine/petexp.h
index a02ff2fa655..fcf263a8077 100644
--- a/src/mess/machine/petexp.h
+++ b/src/mess/machine/petexp.h
@@ -30,43 +30,37 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
-#define PET_EXPANSION_INTERFACE(_name) \
- const pet_expansion_slot_interface (_name) =
-
-
-#define MCFG_PET_EXPANSION_SLOT_ADD(_tag, _clock, _config, _slot_intf, _def_slot, _def_inp) \
+#define MCFG_PET_EXPANSION_SLOT_ADD(_tag, _clock, _slot_intf, _def_slot, _def_inp) \
MCFG_DEVICE_ADD(_tag, PET_EXPANSION_SLOT, _clock) \
- MCFG_DEVICE_CONFIG(_config) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false)
+#define MCFG_PET_EXPANSION_SLOT_DMA_CALLBACKS(_read, _write) \
+ downcast<pet_expansion_slot_device *>(device)->set_callbacks(DEVCB2_##_read, DEVCB2_##_write);
+
+
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> pet_expansion_slot_interface
-
-struct pet_expansion_slot_interface
-{
- devcb_read8 m_in_dma_bd_cb;
- devcb_write8 m_out_dma_bd_cb;
-};
-
-
// ======================> pet_expansion_slot_device
class device_pet_expansion_card_interface;
class pet_expansion_slot_device : public device_t,
- public device_slot_interface,
- public pet_expansion_slot_interface
+ public device_slot_interface
{
public:
// construction/destruction
pet_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~pet_expansion_slot_device();
+ template<class _read, class _write> void set_callbacks(_read rd, _write wr) {
+ m_read_dma.set_callback(rd);
+ m_write_dma.set_callback(wr);
+ }
+
// computer interface
int norom_r(address_space &space, offs_t offset, int sel);
UINT8 read(address_space &space, offs_t offset, UINT8 data, int sel);
@@ -81,14 +75,13 @@ public:
protected:
// device-level overrides
- virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
device_pet_expansion_card_interface *m_card;
- devcb_resolved_read8 m_in_dma_bd_func;
- devcb_resolved_write8 m_out_dma_bd_func;
+ devcb2_read8 m_read_dma;
+ devcb2_write8 m_write_dma;
};
diff --git a/src/mess/machine/superpet.c b/src/mess/machine/superpet.c
index b9e6e131a6c..99dac336444 100644
--- a/src/mess/machine/superpet.c
+++ b/src/mess/machine/superpet.c
@@ -70,7 +70,7 @@ static MACHINE_CONFIG_FRAGMENT( superpet )
MCFG_CPU_ADD(M6809_TAG, M6809, XTAL_16MHz/16)
MCFG_CPU_PROGRAM_MAP(superpet_mem)
- MCFG_ACIA6551_ADD(M6551_TAG) // XTAL_1_8432MHz
+ MCFG_MOS6551_ADD(M6551_TAG, XTAL_1_8432MHz, DEVWRITELINE(DEVICE_SELF, superpet_device, acia_irq_w))
MCFG_MOS6702_ADD(MOS6702_TAG, XTAL_16MHz/16)
MACHINE_CONFIG_END
@@ -384,3 +384,15 @@ WRITE8_MEMBER( superpet_device::write )
{
m_slot->dma_bd_w(offset, data);
}
+
+
+//-------------------------------------------------
+// acia_irq_w -
+//-------------------------------------------------
+
+WRITE_LINE_MEMBER( superpet_device::acia_irq_w )
+{
+ m_acia_irq = state;
+
+ //m_maincpu->set_input_line(M6809_IRQ_LINE, m_pet_irq || m_acia_irq);
+}
diff --git a/src/mess/machine/superpet.h b/src/mess/machine/superpet.h
index 738228bea95..acb1e3bd1ae 100644
--- a/src/mess/machine/superpet.h
+++ b/src/mess/machine/superpet.h
@@ -15,7 +15,7 @@
#include "emu.h"
#include "cpu/m6809/m6809.h"
-#include "machine/6551acia.h"
+#include "machine/mos6551.h"
#include "machine/mos6702.h"
#include "machine/petexp.h"
@@ -41,6 +41,7 @@ public:
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
+ DECLARE_WRITE_LINE_MEMBER( acia_irq_w );
protected:
// device-level overrides
@@ -77,7 +78,7 @@ protected:
private:
required_device<cpu_device> m_maincpu;
- required_device<acia6551_device> m_acia;
+ required_device<mos6551_device> m_acia;
required_device<mos6702_device> m_dongle;
required_memory_region m_rom;
optional_shared_ptr<UINT8> m_ram;
diff --git a/src/mess/machine/vcs_lightpen.c b/src/mess/machine/vcs_lightpen.c
index c9ec39a4383..1a84bb94fa0 100644
--- a/src/mess/machine/vcs_lightpen.c
+++ b/src/mess/machine/vcs_lightpen.c
@@ -21,6 +21,7 @@ const device_type VCS_LIGHTPEN = &device_creator<vcs_lightpen_device>;
INPUT_CHANGED_MEMBER( vcs_lightpen_device::trigger )
{
// TODO trigger timer at correct screen position
+ m_port->trigger_w(newval);
}
@@ -30,10 +31,10 @@ static INPUT_PORTS_START( vcs_lightpen )
PORT_BIT( 0xdf, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("LIGHTX")
- PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X) PORT_NAME("Lightpen X Axis") PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_PLAYER(1)
+ PORT_BIT( 0xff, 0x00, IPT_LIGHTGUN_X) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(45) PORT_KEYDELTA(15)
PORT_START("LIGHTY")
- PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y) PORT_NAME("Lightpen Y Axis") PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_PLAYER(1)
+ PORT_BIT( 0xff, 0x00, IPT_LIGHTGUN_Y) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(45) PORT_KEYDELTA(15)
INPUT_PORTS_END
diff --git a/src/mess/machine/vcsctrl.c b/src/mess/machine/vcsctrl.c
index 8b7158b0cde..60bb1e14b4c 100644
--- a/src/mess/machine/vcsctrl.c
+++ b/src/mess/machine/vcsctrl.c
@@ -54,7 +54,8 @@ device_vcs_control_port_interface::~device_vcs_control_port_interface()
vcs_control_port_device::vcs_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, VCS_CONTROL_PORT, "Atari VCS control port", tag, owner, clock),
- device_slot_interface(mconfig, *this)
+ device_slot_interface(mconfig, *this),
+ m_trigger_handler(*this)
{
}
@@ -75,6 +76,8 @@ vcs_control_port_device::~vcs_control_port_device()
void vcs_control_port_device::device_start()
{
m_device = dynamic_cast<device_vcs_control_port_interface *>(get_card_device());
+
+ m_trigger_handler.resolve_safe();
}
@@ -90,6 +93,11 @@ bool vcs_control_port_device::exists() { return m_device != NULL; }
bool vcs_control_port_device::has_pot_x() { return exists() && m_device->has_pot_x(); }
bool vcs_control_port_device::has_pot_y() { return exists() && m_device->has_pot_y(); }
+void vcs_control_port_device::trigger_w(int state)
+{
+ m_trigger_handler(state);
+}
+
//-------------------------------------------------
// SLOT_INTERFACE( vcs_control_port_devices )
//-------------------------------------------------
diff --git a/src/mess/machine/vcsctrl.h b/src/mess/machine/vcsctrl.h
index 004c3c54210..9fbc932fb9d 100644
--- a/src/mess/machine/vcsctrl.h
+++ b/src/mess/machine/vcsctrl.h
@@ -28,6 +28,10 @@
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false)
+#define MCFG_VCS_CONTROL_PORT_TRIGGER_HANDLER(_devcb) \
+ devcb = &vcs_control_port_device::set_trigger_handler(*device, DEVCB2_##_devcb);
+
+
//**************************************************************************
// TYPE DEFINITIONS
@@ -45,6 +49,9 @@ public:
vcs_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~vcs_control_port_device();
+ // static configuration helpers
+ template<class _Object> static devcb2_base &set_trigger_handler(device_t &device, _Object object) { return downcast<vcs_control_port_device &>(device).m_trigger_handler.set_callback(object); }
+
// computer interface
// Data returned by the joy_r methods:
@@ -72,11 +79,16 @@ public:
bool has_pot_x();
bool has_pot_y();
+ void trigger_w(int state);
+
protected:
// device-level overrides
virtual void device_start();
device_vcs_control_port_interface *m_device;
+
+private:
+ devcb2_write_line m_trigger_handler;
};