summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--.gitattributes8
-rw-r--r--src/emu/machine/mos6526.c106
-rw-r--r--src/emu/machine/mos6526.h90
-rw-r--r--src/emu/sound/mos6560.c69
-rw-r--r--src/emu/sound/mos6560.h56
-rw-r--r--src/emu/sound/mos6581.c137
-rw-r--r--src/emu/sound/mos6581.h108
-rw-r--r--src/emu/sound/mos7360.c (renamed from src/mess/audio/mos7360.c)363
-rw-r--r--src/emu/sound/mos7360.h (renamed from src/mess/audio/mos7360.h)66
-rw-r--r--src/emu/sound/sid.h3
-rw-r--r--src/emu/sound/sid6581.c165
-rw-r--r--src/emu/sound/sid6581.h78
-rw-r--r--src/emu/sound/sidvoice.c6
-rw-r--r--src/emu/sound/sidvoice.h4
-rw-r--r--src/emu/sound/sound.mak14
-rw-r--r--src/mame/drivers/attckufo.c18
-rw-r--r--src/mess/drivers/c128.c101
-rw-r--r--src/mess/drivers/c64.c135
-rw-r--r--src/mess/drivers/c65.c40
-rw-r--r--src/mess/drivers/cbm2.c117
-rw-r--r--src/mess/drivers/osborne1.c15
-rw-r--r--src/mess/drivers/pet2001.c25
-rw-r--r--src/mess/drivers/plus4.c110
-rw-r--r--src/mess/drivers/primo.c11
-rw-r--r--src/mess/drivers/sage2.c19
-rw-r--r--src/mess/drivers/tek405x.c20
-rw-r--r--src/mess/drivers/vic10.c39
-rw-r--r--src/mess/drivers/vic20.c46
-rw-r--r--src/mess/drivers/victor9k.c18
-rw-r--r--src/mess/drivers/vixen.c16
-rw-r--r--src/mess/includes/c128.h4
-rw-r--r--src/mess/includes/c64.h4
-rw-r--r--src/mess/includes/cbm2.h8
-rw-r--r--src/mess/includes/plus4.h9
-rw-r--r--src/mess/includes/vic10.h4
-rw-r--r--src/mess/includes/vic20.h1
-rw-r--r--src/mess/machine/c1571.c199
-rw-r--r--src/mess/machine/c1571.h25
-rw-r--r--src/mess/machine/c1581.c86
-rw-r--r--src/mess/machine/c1581.h21
-rw-r--r--src/mess/machine/c64_ieee488.c19
-rw-r--r--src/mess/machine/c64_legacy.c2
-rw-r--r--src/mess/machine/c65.c10
-rw-r--r--src/mess/machine/cbmiec.c57
-rw-r--r--src/mess/machine/cbmiec.h55
-rw-r--r--src/mess/machine/cbmipt.h12
-rw-r--r--src/mess/machine/ieee488.c74
-rw-r--r--src/mess/machine/ieee488.h74
-rw-r--r--src/mess/machine/interpod.c19
-rw-r--r--src/mess/machine/isa_ssi2001.c11
-rw-r--r--src/mess/machine/isa_ssi2001.h4
-rw-r--r--src/mess/machine/plus4_sid.c14
-rw-r--r--src/mess/machine/plus4_sid.h4
-rw-r--r--src/mess/machine/vic1112.c20
-rw-r--r--src/mess/mess.mak2
-rw-r--r--src/mess/video/mos6566.c84
-rw-r--r--src/mess/video/mos6566.h88
57 files changed, 1168 insertions, 1745 deletions
diff --git a/.gitattributes b/.gitattributes
index c4e64357df6..1461cb476b0 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1556,6 +1556,10 @@ src/emu/sound/mas3507d.c svneol=native#text/plain
src/emu/sound/mas3507d.h svneol=native#text/plain
src/emu/sound/mos6560.c svneol=native#text/plain
src/emu/sound/mos6560.h svneol=native#text/plain
+src/emu/sound/mos6581.c svneol=native#text/plain
+src/emu/sound/mos6581.h svneol=native#text/plain
+src/emu/sound/mos7360.c svneol=native#text/plain
+src/emu/sound/mos7360.h svneol=native#text/plain
src/emu/sound/mpeg_audio.c svneol=native#text/plain
src/emu/sound/mpeg_audio.h svneol=native#text/plain
src/emu/sound/msm5205.c svneol=native#text/plain
@@ -1611,8 +1615,6 @@ src/emu/sound/segapcm.c svneol=native#text/plain
src/emu/sound/segapcm.h svneol=native#text/plain
src/emu/sound/sid.c svneol=native#text/plain
src/emu/sound/sid.h svneol=native#text/plain
-src/emu/sound/sid6581.c svneol=native#text/plain
-src/emu/sound/sid6581.h svneol=native#text/plain
src/emu/sound/side6581.h svneol=native#text/plain
src/emu/sound/sidenvel.c svneol=native#text/plain
src/emu/sound/sidenvel.h svneol=native#text/plain
@@ -5797,8 +5799,6 @@ src/mess/audio/lynx.c svneol=native#text/plain
src/mess/audio/mac.c svneol=native#text/plain
src/mess/audio/mea8000.c svneol=native#text/plain
src/mess/audio/mea8000.h svneol=native#text/plain
-src/mess/audio/mos7360.c svneol=native#text/plain
-src/mess/audio/mos7360.h svneol=native#text/plain
src/mess/audio/socrates.c svneol=native#text/plain
src/mess/audio/socrates.h svneol=native#text/plain
src/mess/audio/spchroms.c svneol=native#text/plain
diff --git a/src/emu/machine/mos6526.c b/src/emu/machine/mos6526.c
index 03875ccb796..0b53630bd67 100644
--- a/src/emu/machine/mos6526.c
+++ b/src/emu/machine/mos6526.c
@@ -118,46 +118,6 @@ const device_type MOS8520 = &device_creator<mos8520_device>;
const device_type MOS5710 = &device_creator<mos5710_device>;
-//-------------------------------------------------
-// static_set_tod_clock -
-//-------------------------------------------------
-
-void mos6526_device::static_set_tod_clock(device_t &device, int tod_clock)
-{
- mos6526_device &cia = dynamic_cast<mos6526_device &>(device);
-
- cia.m_tod_clock = tod_clock;
-}
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void mos6526_device::device_config_complete()
-{
- // inherit a copy of the static data
- const mos6526_interface *intf = reinterpret_cast<const mos6526_interface *>(static_config());
- if (intf != NULL)
- *static_cast<mos6526_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_out_irq_cb, 0, sizeof(m_out_irq_cb));
- memset(&m_out_pc_cb, 0, sizeof(m_out_pc_cb));
- memset(&m_out_cnt_cb, 0, sizeof(m_out_cnt_cb));
- memset(&m_out_sp_cb, 0, sizeof(m_out_sp_cb));
- memset(&m_in_pa_cb, 0, sizeof(m_in_pa_cb));
- memset(&m_out_pa_cb, 0, sizeof(m_out_pa_cb));
- memset(&m_in_pb_cb, 0, sizeof(m_in_pb_cb));
- memset(&m_out_pb_cb, 0, sizeof(m_out_pb_cb));
- }
-}
-
-
//**************************************************************************
// INLINE HELPERS
@@ -174,7 +134,7 @@ inline void mos6526_device::update_pa()
if (m_pa != pa)
{
m_pa = pa;
- m_out_pa_func(0, pa);
+ m_write_pa((offs_t)0, pa);
}
}
@@ -205,7 +165,7 @@ inline void mos6526_device::update_pb()
if (m_pb != pb)
{
- m_out_pb_func(0, pb);
+ m_write_pb((offs_t)0, pb);
m_pb = pb;
}
}
@@ -438,7 +398,7 @@ inline void mos6526_device::serial_output()
}
m_sp = BIT(m_shift, 7);
- m_out_sp_func(m_sp);
+ m_write_sp(m_sp);
m_shift <<= 1;
m_bits++;
@@ -457,7 +417,7 @@ inline void mos6526_device::serial_output()
}
m_cnt = !m_cnt;
- m_out_cnt_func(m_cnt);
+ m_write_cnt(m_cnt);
}
}
}
@@ -505,7 +465,7 @@ inline void mos6526_device::update_interrupt()
{
if (!m_irq && m_ir1)
{
- m_out_irq_func(ASSERT_LINE);
+ m_write_irq(ASSERT_LINE);
m_irq = true;
}
@@ -602,7 +562,7 @@ inline void mos6526_device::synchronize()
if (!m_pc)
{
m_pc = 1;
- m_out_pc_func(m_pc);
+ m_write_pc(m_pc);
}
serial_input();
@@ -634,7 +594,15 @@ mos6526_device::mos6526_device(const machine_config &mconfig, device_type type,
: device_t(mconfig, type, name, tag, owner, clock),
device_execute_interface(mconfig, *this),
m_icount(0),
- m_variant(variant)
+ m_variant(variant),
+ m_write_irq(*this),
+ m_write_pc(*this),
+ m_write_cnt(*this),
+ m_write_sp(*this),
+ m_read_pa(*this),
+ m_write_pa(*this),
+ m_read_pb(*this),
+ m_write_pb(*this)
{
}
@@ -642,7 +610,15 @@ mos6526_device::mos6526_device(const machine_config &mconfig, const char *tag, d
: device_t(mconfig, MOS6526, "MOS6526", tag, owner, clock),
device_execute_interface(mconfig, *this),
m_icount(0),
- m_variant(TYPE_6526)
+ m_variant(TYPE_6526),
+ m_write_irq(*this),
+ m_write_pc(*this),
+ m_write_cnt(*this),
+ m_write_sp(*this),
+ m_read_pa(*this),
+ m_write_pa(*this),
+ m_read_pb(*this),
+ m_write_pb(*this)
{ }
mos6526a_device::mos6526a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
@@ -665,14 +641,14 @@ void mos6526_device::device_start()
m_icountptr = &m_icount;
// resolve callbacks
- m_out_irq_func.resolve(m_out_irq_cb, *this);
- m_out_pc_func.resolve(m_out_pc_cb, *this);
- m_out_cnt_func.resolve(m_out_cnt_cb, *this);
- m_out_sp_func.resolve(m_out_sp_cb, *this);
- m_in_pa_func.resolve(m_in_pa_cb, *this);
- m_out_pa_func.resolve(m_out_pa_cb, *this);
- m_in_pb_func.resolve(m_in_pb_cb, *this);
- m_out_pb_func.resolve(m_out_pb_cb, *this);
+ m_write_irq.resolve_safe();
+ m_write_pc.resolve_safe();
+ m_write_cnt.resolve_safe();
+ m_write_sp.resolve_safe();
+ m_read_pa.resolve_safe(0xff);
+ m_write_pa.resolve_safe();
+ m_read_pb.resolve_safe(0xff);
+ m_write_pb.resolve_safe();
// allocate timer
if (m_tod_clock > 0)
@@ -782,10 +758,10 @@ void mos6526_device::device_reset()
m_tod_stopped = true;
m_tod_latched = false;
- m_out_irq_func(CLEAR_LINE);
- m_out_pc_func(m_pc);
- m_out_sp_func(m_sp);
- m_out_cnt_func(m_cnt);
+ m_write_irq(CLEAR_LINE);
+ m_write_pc(m_pc);
+ m_write_sp(m_sp);
+ m_write_cnt(m_cnt);
}
@@ -833,11 +809,11 @@ READ8_MEMBER( mos6526_device::read )
switch (offset)
{
case PRA:
- data = (m_in_pa_func(0) & ~m_ddra) | (m_pra & m_ddra);
+ data = (m_read_pa(0) & ~m_ddra) | (m_pra & m_ddra);
break;
case PRB:
- data = (m_in_pb_func(0) & ~m_ddrb) | (m_prb & m_ddrb);
+ data = (m_read_pb(0) & ~m_ddrb) | (m_prb & m_ddrb);
if (CRA_PBON)
{
@@ -856,7 +832,7 @@ READ8_MEMBER( mos6526_device::read )
}
m_pc = 0;
- m_out_pc_func(m_pc);
+ m_write_pc(m_pc);
break;
case DDRA:
@@ -920,7 +896,7 @@ READ8_MEMBER( mos6526_device::read )
m_ir1 = 0;
m_icr = 0;
m_irq = false;
- m_out_irq_func(CLEAR_LINE);
+ m_write_irq(CLEAR_LINE);
break;
case CRA:
@@ -980,7 +956,7 @@ WRITE8_MEMBER( mos6526_device::write )
update_pb();
m_pc = 0;
- m_out_pc_func(m_pc);
+ m_write_pc(m_pc);
break;
case DDRA:
diff --git a/src/emu/machine/mos6526.h b/src/emu/machine/mos6526.h
index 84188907ff8..3670e7d5e96 100644
--- a/src/emu/machine/mos6526.h
+++ b/src/emu/machine/mos6526.h
@@ -69,32 +69,31 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_MOS6526_ADD(_tag, _clock, _tod_clock, _config) \
+#define MCFG_MOS6526_ADD(_tag, _clock, _tod_clock, _irq) \
MCFG_DEVICE_ADD(_tag, MOS6526, _clock) \
- MCFG_DEVICE_CONFIG(_config) \
- mos6526_device::static_set_tod_clock(*device, _tod_clock);
+ downcast<mos6526_device *>(device)->set_callbacks(_tod_clock, DEVCB2_##_irq);
-#define MCFG_MOS6526A_ADD(_tag, _clock, _tod_clock, _config) \
+#define MCFG_MOS6526A_ADD(_tag, _clock, _tod_clock, _irq) \
MCFG_DEVICE_ADD(_tag, MOS6526A, _clock) \
- MCFG_DEVICE_CONFIG(_config) \
- mos6526_device::static_set_tod_clock(*device, _tod_clock);
+ downcast<mos6526_device *>(device)->set_callbacks(_tod_clock, DEVCB2_##_irq);
-#define MCFG_MOS8520_ADD(_tag, _clock, _tod_clock, _config) \
+#define MCFG_MOS8520_ADD(_tag, _clock, _tod_clock, _irq) \
MCFG_DEVICE_ADD(_tag, MOS8520, _clock) \
- MCFG_DEVICE_CONFIG(_config) \
- mos6526_device::static_set_tod_clock(*device, _tod_clock);
+ downcast<mos6526_device *>(device)->set_callbacks(_tod_clock, DEVCB2_##_irq);
-#define MCFG_MOS5710_ADD(_tag, _clock, _tod_clock, _config) \
+#define MCFG_MOS5710_ADD(_tag, _clock, _tod_clock, _irq) \
MCFG_DEVICE_ADD(_tag, MOS5710, _clock) \
- MCFG_DEVICE_CONFIG(_config) \
- mos6526_device::static_set_tod_clock(*device, _tod_clock);
+ downcast<mos6526_device *>(device)->set_callbacks(_tod_clock, DEVCB2_##_irq);
-#define MOS6526_INTERFACE(name) \
- const mos6526_interface (name)=
+#define MCFG_MOS6526_SERIAL_CALLBACKS(_cnt, _sp) \
+ downcast<mos6526_device *>(device)->set_serial_callbacks(DEVCB2_##_cnt, DEVCB2_##_sp);
-#define MOS8520_INTERFACE(name) \
- const mos6526_interface (name)=
+#define MCFG_MOS6526_PORT_A_CALLBACKS(_read, _write) \
+ downcast<mos6526_device *>(device)->set_port_a_callbacks(DEVCB2_##_read, DEVCB2_##_write);
+
+#define MCFG_MOS6526_PORT_B_CALLBACKS(_read, _write, _pc) \
+ downcast<mos6526_device *>(device)->set_port_b_callbacks(DEVCB2_##_read, DEVCB2_##_write, DEVCB2_##_pc);
@@ -102,36 +101,36 @@
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> mos6526_interface
-
-struct mos6526_interface
-{
- devcb_write_line m_out_irq_cb;
- devcb_write_line m_out_pc_cb;
- devcb_write_line m_out_cnt_cb;
- devcb_write_line m_out_sp_cb;
-
- devcb_read8 m_in_pa_cb;
- devcb_write8 m_out_pa_cb;
-
- devcb_read8 m_in_pb_cb;
- devcb_write8 m_out_pb_cb;
-};
-
-
// ======================> mos6526_device
class mos6526_device : public device_t,
- public device_execute_interface,
- public mos6526_interface
+ public device_execute_interface
{
public:
// construction/destruction
mos6526_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant);
mos6526_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- // inline configuration
- static void static_set_tod_clock(device_t &device, int tod_clock);
+ template<class _irq> void set_callbacks(int tod_clock, _irq irq) {
+ m_tod_clock = tod_clock;
+ m_write_irq.set_callback(irq);
+ }
+
+ template<class _cnt, class _sp> void set_serial_callbacks(_cnt cnt, _sp sp) {
+ m_write_cnt.set_callback(cnt);
+ m_write_sp.set_callback(sp);
+ }
+
+ template<class _read, class _write> void set_port_a_callbacks(_read rd, _write wr) {
+ m_read_pa.set_callback(rd);
+ m_write_pa.set_callback(wr);
+ }
+
+ template<class _read, class _write, class _pc> void set_port_b_callbacks(_read rd, _write wr, _pc pc) {
+ m_read_pb.set_callback(rd);
+ m_write_pb.set_callback(wr);
+ m_write_pc.set_callback(pc);
+ }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -157,7 +156,6 @@ protected:
};
// device-level overrides
- virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -183,14 +181,14 @@ protected:
inline void write_tod(int offset, UINT8 data);
inline void synchronize();
- devcb_resolved_write_line m_out_irq_func;
- devcb_resolved_write_line m_out_pc_func;
- devcb_resolved_write_line m_out_cnt_func;
- devcb_resolved_write_line m_out_sp_func;
- devcb_resolved_read8 m_in_pa_func;
- devcb_resolved_write8 m_out_pa_func;
- devcb_resolved_read8 m_in_pb_func;
- devcb_resolved_write8 m_out_pb_func;
+ devcb2_write_line m_write_irq;
+ devcb2_write_line m_write_pc;
+ devcb2_write_line m_write_cnt;
+ devcb2_write_line m_write_sp;
+ devcb2_read8 m_read_pa;
+ devcb2_write8 m_write_pa;
+ devcb2_read8 m_read_pb;
+ devcb2_write8 m_write_pb;
// interrupts
bool m_irq;
diff --git a/src/emu/sound/mos6560.c b/src/emu/sound/mos6560.c
index f17201ef499..a183546c0f3 100644
--- a/src/emu/sound/mos6560.c
+++ b/src/emu/sound/mos6560.c
@@ -435,8 +435,10 @@ READ8_MEMBER( mos6560_device::read )
val = m_reg[offset];
break;
case 8: /* poti 1 */
+ val = m_read_potx(0);
+ break;
case 9: /* poti 2 */
- val = (!m_paddle_cb->isnull()) ? m_paddle_cb[offset - 8](0) : m_reg[offset];
+ val = m_read_poty(0);
break;
default:
val = m_reg[offset];
@@ -684,12 +686,15 @@ static ADDRESS_MAP_START( mos6560_colorram_map, AS_1, 8, mos6560_device )
AM_RANGE(0x000, 0x3ff) AM_RAM
ADDRESS_MAP_END
-mos6560_device::mos6560_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+mos6560_device::mos6560_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant)
: device_t(mconfig, type, name, tag, owner, clock),
device_memory_interface(mconfig, *this),
device_sound_interface(mconfig, *this),
+ m_variant(variant),
m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, NULL, *ADDRESS_MAP_NAME(mos6560_videoram_map)),
- m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, NULL, *ADDRESS_MAP_NAME(mos6560_colorram_map))
+ m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, NULL, *ADDRESS_MAP_NAME(mos6560_colorram_map)),
+ m_read_potx(*this),
+ m_read_poty(*this)
{
}
@@ -699,35 +704,17 @@ mos6560_device::mos6560_device(const machine_config &mconfig, const char *tag, d
device_sound_interface(mconfig, *this),
m_variant(TYPE_6560),
m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, NULL, *ADDRESS_MAP_NAME(mos6560_videoram_map)),
- m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, NULL, *ADDRESS_MAP_NAME(mos6560_colorram_map))
+ m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, NULL, *ADDRESS_MAP_NAME(mos6560_colorram_map)),
+ m_read_potx(*this),
+ m_read_poty(*this)
{
}
mos6561_device::mos6561_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- :mos6560_device(mconfig, MOS6561, "MOS6561", tag, owner, clock) { m_variant = TYPE_6561; }
+ :mos6560_device(mconfig, MOS6561, "MOS6561", tag, owner, clock, TYPE_6561) { }
mos656x_attack_ufo_device::mos656x_attack_ufo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- :mos6560_device(mconfig, MOS656X_ATTACK_UFO, "MOS656X", tag, owner, clock) { m_variant = TYPE_ATTACK_UFO; }
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void mos6560_device::device_config_complete()
-{
- // inherit a copy of the static data
- const mos6560_interface *intf = reinterpret_cast<const mos6560_interface *>(static_config());
- if (intf != NULL)
- *static_cast<mos6560_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- // TODO
- }
-}
+ :mos6560_device(mconfig, MOS656X_ATTACK_UFO, "MOS656X", tag, owner, clock, TYPE_ATTACK_UFO) { }
//-------------------------------------------------
@@ -745,6 +732,7 @@ const address_space_config *mos6560_device::memory_space_config(address_spacenum
}
}
+
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -753,10 +741,11 @@ void mos6560_device::device_start()
{
m_screen = machine().device<screen_device>(m_screen_tag);
m_screen->register_screen_bitmap(m_bitmap);
+ assert(m_screen);
// resolve callbacks
- m_paddle_cb[0].resolve(m_potx_cb, *this);
- m_paddle_cb[1].resolve(m_poty_cb, *this);
+ m_read_potx.resolve_safe(0xff);
+ m_read_poty.resolve_safe(0xff);
switch (m_variant)
{
@@ -766,12 +755,14 @@ void mos6560_device::device_start()
m_total_lines = MOS6560_LINES;
m_total_vretracerate = MOS6560_VRETRACERATE;
break;
+
case TYPE_ATTACK_UFO:
m_total_xsize = 23 * 8;
m_total_ysize = 22 * 8;
m_total_lines = MOS6560_LINES;
m_total_vretracerate = MOS6560_VRETRACERATE;
break;
+
case TYPE_6561:
m_total_xsize = MOS6561_XSIZE;
m_total_ysize = MOS6561_YSIZE;
@@ -780,8 +771,14 @@ void mos6560_device::device_start()
break;
}
+ // allocate timers
+ m_line_timer = timer_alloc(TIMER_LINE);
+ m_line_timer->adjust(m_screen->scan_period(), 0, m_screen->scan_period());
+
+ // initialize sound
sound_start();
+ // state saving
save_item(NAME(m_lightpenreadtime));
save_item(NAME(m_rasterline));
save_item(NAME(m_lastline));
@@ -821,6 +818,7 @@ void mos6560_device::device_start()
save_item(NAME(m_noisesamples));
}
+
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
@@ -872,6 +870,21 @@ void mos6560_device::device_reset()
m_noisesamples = 1;
}
+
+//-------------------------------------------------
+// device_timer - handler timer events
+//-------------------------------------------------
+
+void mos6560_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ switch (id)
+ {
+ case TIMER_LINE:
+ raster_interrupt_gen();
+ break;
+ }
+}
+
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
diff --git a/src/emu/sound/mos6560.h b/src/emu/sound/mos6560.h
index 057805e53cb..13cacb5d8ae 100644
--- a/src/emu/sound/mos6560.h
+++ b/src/emu/sound/mos6560.h
@@ -43,7 +43,7 @@
// DEVICE CONFIGURATION MACROS
//***************************************************************************
-#define MCFG_MOS6560_ADD(_tag, _screen_tag, _clock, _config, _videoram_map, _colorram_map) \
+#define MCFG_MOS6560_ADD(_tag, _screen_tag, _clock, _videoram_map, _colorram_map, _potx, _poty) \
MCFG_SCREEN_ADD(_screen_tag, RASTER) \
MCFG_SCREEN_REFRESH_RATE(MOS6560_VRETRACERATE) \
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) \
@@ -51,11 +51,11 @@
MCFG_SCREEN_VISIBLE_AREA(MOS6560_MAME_XPOS, MOS6560_MAME_XPOS + MOS6560_MAME_XSIZE - 1, MOS6560_MAME_YPOS, MOS6560_MAME_YPOS + MOS6560_MAME_YSIZE - 1) \
MCFG_SCREEN_UPDATE_DEVICE(_tag, mos6560_device, screen_update) \
MCFG_SOUND_ADD(_tag, MOS6560, _clock) \
- MCFG_DEVICE_CONFIG(_config) \
+ downcast<mos6560_device *>(device)->set_callbacks(_screen_tag, DEVCB2_##_potx, DEVCB2_##_poty); \
MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \
MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map)
-#define MCFG_MOS6561_ADD(_tag, _screen_tag, _clock, _config, _videoram_map, _colorram_map) \
+#define MCFG_MOS6561_ADD(_tag, _screen_tag, _clock, _videoram_map, _colorram_map, _potx, _poty) \
MCFG_SCREEN_ADD(_screen_tag, RASTER) \
MCFG_SCREEN_REFRESH_RATE(MOS6561_VRETRACERATE) \
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) \
@@ -63,11 +63,11 @@
MCFG_SCREEN_VISIBLE_AREA(MOS6561_MAME_XPOS, MOS6561_MAME_XPOS + MOS6561_MAME_XSIZE - 1, MOS6561_MAME_YPOS, MOS6561_MAME_YPOS + MOS6561_MAME_YSIZE - 1) \
MCFG_SCREEN_UPDATE_DEVICE(_tag, mos6560_device, screen_update) \
MCFG_SOUND_ADD(_tag, MOS6561, _clock) \
- MCFG_DEVICE_CONFIG(_config) \
+ downcast<mos6560_device *>(device)->set_callbacks(_screen_tag, DEVCB2_##_potx, DEVCB2_##_poty); \
MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \
MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map)
-#define MCFG_MOS656X_ATTACK_UFO_ADD(_tag, _screen_tag, _clock, _config, _videoram_map, _colorram_map) \
+#define MCFG_MOS656X_ATTACK_UFO_ADD(_tag, _screen_tag, _clock, _videoram_map, _colorram_map) \
MCFG_SCREEN_ADD(_screen_tag, RASTER) \
MCFG_SCREEN_REFRESH_RATE(MOS6560_VRETRACERATE) \
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) \
@@ -75,15 +75,11 @@
MCFG_SCREEN_VISIBLE_AREA(0, 23*8 - 1, 0, 22*8 - 1) \
MCFG_SCREEN_UPDATE_DEVICE(_tag, mos6560_device, screen_update) \
MCFG_SOUND_ADD(_tag, MOS656X_ATTACK_UFO, _clock) \
- MCFG_DEVICE_CONFIG(_config) \
+ downcast<mos6560_device *>(device)->set_callbacks(_screen_tag, DEVCB2_NULL, DEVCB2_NULL); \
MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \
MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map)
-#define MOS6560_INTERFACE(_name) \
- const mos6560_interface (_name) =
-
-
//**************************************************************************
// MACROS / CONSTANTS
@@ -126,28 +122,22 @@
// TYPE DEFINITIONS
//***************************************************************************
-// ======================> mos6560_interface
-
-struct mos6560_interface
-{
- const char *m_screen_tag;
-
- devcb_read8 m_potx_cb;
- devcb_read8 m_poty_cb;
-};
-
-
// ======================> mos6560_device
class mos6560_device : public device_t,
public device_memory_interface,
- public device_sound_interface,
- public mos6560_interface
+ public device_sound_interface
{
public:
- mos6560_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ mos6560_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant);
mos6560_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ template<class _potx, class _poty> void set_callbacks(const char *screen_tag, _potx potx, _poty poty) {
+ m_screen_tag = screen_tag;
+ m_read_potx.set_callback(potx);
+ m_read_poty.set_callback(poty);
+ }
+
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
DECLARE_READ8_MEMBER( read );
@@ -158,7 +148,6 @@ public:
DECLARE_WRITE_LINE_MEMBER( lp_w );
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
- void raster_interrupt_gen();
protected:
enum
@@ -168,10 +157,15 @@ protected:
TYPE_ATTACK_UFO // NTSC-M, less features
};
+ enum
+ {
+ TIMER_LINE
+ };
+
// device-level overrides
- virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
@@ -184,12 +178,17 @@ protected:
void drawlines( int first, int last );
void soundport_w( int offset, int data );
void sound_start();
+ void raster_interrupt_gen();
int m_variant;
const address_space_config m_videoram_space_config;
const address_space_config m_colorram_space_config;
+ devcb2_read8 m_read_potx;
+ devcb2_read8 m_read_poty;
+
+ const char *m_screen_tag;
screen_device *m_screen;
UINT8 m_reg[16];
@@ -216,9 +215,6 @@ protected:
/* DMA */
UINT8 m_last_data;
- /* paddles */
- devcb_resolved_read8 m_paddle_cb[2];
-
/* sound part */
int m_tone1pos, m_tone2pos, m_tone3pos,
m_tonesize, m_tone1samples, m_tone2samples, m_tone3samples,
@@ -229,6 +225,8 @@ protected:
sound_stream *m_channel;
INT16 *m_tone;
INT8 *m_noise;
+
+ emu_timer *m_line_timer;
};
diff --git a/src/emu/sound/mos6581.c b/src/emu/sound/mos6581.c
new file mode 100644
index 00000000000..ad73c6d9bb0
--- /dev/null
+++ b/src/emu/sound/mos6581.c
@@ -0,0 +1,137 @@
+/**********************************************************************
+
+ MOS 6581/8580 Sound Interface Device emulation
+
+ Copyright MESS Team.
+ Visit http://mamedev.org for licensing and usage restrictions.
+
+**********************************************************************/
+
+#include "mos6581.h"
+#include "sid.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define LOG 0
+
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+// device type definition
+const device_type MOS6581 = &device_creator<mos6581_device>;
+const device_type MOS8580 = &device_creator<mos8580_device>;
+
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// mos6581_device - constructor
+//-------------------------------------------------
+
+mos6581_device::mos6581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ device_sound_interface(mconfig, *this),
+ m_read_potx(*this),
+ m_read_poty(*this),
+ m_stream(NULL),
+ m_variant(variant)
+{
+ m_token = global_alloc_clear(SID6581_t);
+}
+
+mos6581_device::mos6581_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MOS6581, "MOS6581", tag, owner, clock),
+ device_sound_interface(mconfig, *this),
+ m_read_potx(*this),
+ m_read_poty(*this),
+ m_stream(NULL),
+ m_variant(TYPE_6581)
+{
+ m_token = global_alloc_clear(SID6581_t);
+}
+
+
+//-------------------------------------------------
+// mos8580_device - constructor
+//-------------------------------------------------
+
+mos8580_device::mos8580_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : mos6581_device(mconfig, MOS8580, "MOS8580", tag, owner, clock, TYPE_8580)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void mos6581_device::device_start()
+{
+ // resolve callbacks
+ m_read_potx.resolve_safe(0xff);
+ m_read_poty.resolve_safe(0xff);
+
+ // create sound stream
+ m_stream = machine().sound().stream_alloc(*this, 0, 1, machine().sample_rate());
+
+ // initialize SID engine
+ m_token->device = this;
+ m_token->mixer_channel = m_stream;
+ m_token->PCMfreq = machine().sample_rate();
+ m_token->clock = clock();
+ m_token->type = m_variant;
+
+ sid6581_init(m_token);
+ sidInitWaveformTables(m_variant);
+}
+
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void mos6581_device::device_reset()
+{
+ sidEmuReset(m_token);
+}
+
+
+//-------------------------------------------------
+// sound_stream_update - handle update requests for
+// our sound stream
+//-------------------------------------------------
+
+void mos6581_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ sidEmuFillBuffer(m_token, outputs[0], samples);
+}
+
+
+//-------------------------------------------------
+// read -
+//-------------------------------------------------
+
+READ8_MEMBER( mos6581_device::read )
+{
+ return sid6581_port_r(machine(), m_token, offset);
+}
+
+
+//-------------------------------------------------
+// write -
+//-------------------------------------------------
+
+WRITE8_MEMBER( mos6581_device::write )
+{
+ sid6581_port_w(m_token, offset, data);
+}
diff --git a/src/emu/sound/mos6581.h b/src/emu/sound/mos6581.h
new file mode 100644
index 00000000000..d5e93833ab9
--- /dev/null
+++ b/src/emu/sound/mos6581.h
@@ -0,0 +1,108 @@
+/**********************************************************************
+
+ MOS 6581/8580 Sound Interface Device emulation
+
+ Copyright MESS Team.
+ Visit http://mamedev.org for licensing and usage restrictions.
+
+**********************************************************************
+ _____ _____
+ CAP1A 1 |* \_/ | 28 Vdd
+ CAP1B 2 | | 27 AUDIO OUT
+ CAP2A 3 | | 26 EXT IN
+ CAP2B 4 | | 25 Vcc
+ _RES 5 | | 24 POTX
+ phi2 6 | | 23 POTY
+ R/_W 7 | MOS6581 | 22 D7
+ _CS 8 | MOS8580 | 21 D6
+ A0 9 | | 20 D5
+ A1 10 | | 19 D4
+ A2 11 | | 18 D3
+ A3 12 | | 17 D2
+ A4 13 | | 16 D1
+ GND 14 |_____________| 15 D0
+
+**********************************************************************/
+
+#pragma once
+
+#ifndef __MOS6581__
+#define __MOS6581__
+
+#include "emu.h"
+
+
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_MOS6581_POTXY_CALLBACKS(_potx, _poty) \
+ downcast<mos6581_device *>(device)->set_callbacks(DEVCB2_##_potx, DEVCB2_##_poty);
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> mos6581_device
+
+struct SID6581_t;
+
+class mos6581_device : public device_t,
+ public device_sound_interface
+{
+public:
+ mos6581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant);
+ mos6581_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ template<class _potx, class _poty> void set_callbacks(_potx potx, _poty poty) {
+ m_read_potx.set_callback(potx);
+ m_read_poty.set_callback(poty);
+ }
+
+ DECLARE_READ8_MEMBER( read );
+ DECLARE_WRITE8_MEMBER( write );
+
+ enum
+ {
+ TYPE_6581,
+ TYPE_8580
+ };
+
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+
+ // device_sound_interface overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+
+private:
+ devcb2_read8 m_read_potx;
+ devcb2_read8 m_read_poty;
+
+ sound_stream *m_stream;
+
+ int m_variant;
+
+ SID6581_t *m_token;
+};
+
+
+// ======================> mos8580_device
+
+class mos8580_device : public mos6581_device
+{
+public:
+ mos8580_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+
+// device type definition
+extern const device_type MOS6581;
+extern const device_type MOS8580;
+
+
+#endif
diff --git a/src/mess/audio/mos7360.c b/src/emu/sound/mos7360.c
index 4d4a9bc1cf0..6d768f7a10c 100644
--- a/src/mess/audio/mos7360.c
+++ b/src/emu/sound/mos7360.c
@@ -84,18 +84,6 @@
#define TED7360_VRETRACERATE ((m_clock == TED7360PAL_CLOCK) ? TED7360PAL_VRETRACERATE : TED7360NTSC_VRETRACERATE)
#define TED7360_LINES ((m_clock == TED7360PAL_CLOCK) ? TED7360PAL_LINES : TED7360NTSC_LINES)
-static attotime TEDTIME_IN_CYCLES(int cycles)
-{
- double d = (double)(cycles) / clock();
- return attotime::from_double(d);
-}
-
-static int TEDTIME_TO_CYCLES(attotime t)
-{
- double d = t.as_double();
- return (int)(d * clock());
-}
-
static const rgb_t PALETTE[] =
{
/* black, white, red, cyan */
@@ -210,7 +198,7 @@ inline void mos7360_device::set_interrupt(int mask)
{
//DBG_LOG(1, "ted7360", ("irq start %.2x\n", mask));
m_reg[9] |= 0x80;
- m_out_irq_func(ASSERT_LINE);
+ m_write_irq(ASSERT_LINE);
}
}
m_reg[9] |= mask;
@@ -223,7 +211,7 @@ inline void mos7360_device::clear_interrupt(int mask)
{
DBG_LOG(1, "ted7360", ("irq end %.2x\n", mask));
m_reg[9] &= ~0x80;
- m_out_irq_func(CLEAR_LINE);
+ m_write_irq(CLEAR_LINE);
}
}
@@ -271,34 +259,14 @@ mos7360_device::mos7360_device(const machine_config &mconfig, const char *tag, d
device_memory_interface(mconfig, *this),
device_sound_interface(mconfig, *this),
m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 16, 0, NULL, *ADDRESS_MAP_NAME(mos7360_videoram_map)),
+ m_write_irq(*this),
+ m_read_k(*this),
m_stream(NULL)
{
}
//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void mos7360_device::device_config_complete()
-{
- // inherit a copy of the static data
- const mos7360_interface *intf = reinterpret_cast<const mos7360_interface *>(static_config());
- if (intf != NULL)
- *static_cast<mos7360_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_out_irq_cb, 0, sizeof(m_out_irq_cb));
- memset(&m_in_k_cb, 0, sizeof(m_in_k_cb));
- }
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -313,13 +281,17 @@ void mos7360_device::device_start()
assert(m_cpu != NULL);
// resolve callbacks
- m_out_irq_func.resolve(m_out_irq_cb, *this);
- m_in_k_func.resolve(m_in_k_cb, *this);
+ m_write_irq.resolve_safe();
+ m_read_k.resolve_safe(0xff);
// allocate timers
m_timer1 = timer_alloc(TIMER_ID_1);
m_timer2 = timer_alloc(TIMER_ID_2);
m_timer3 = timer_alloc(TIMER_ID_3);
+ m_line_timer = timer_alloc(TIMER_LINE);
+ m_line_timer->adjust(m_screen->scan_period(), 0, m_screen->scan_period());
+ m_frame_timer = timer_alloc(TIMER_FRAME);
+ m_frame_timer->adjust(m_screen->frame_period(), 0, m_screen->frame_period());
// allocate screen bitmap
m_screen->register_screen_bitmap(m_bitmap);
@@ -421,22 +393,30 @@ void mos7360_device::device_timer(emu_timer &timer, device_timer_id id, int para
{
case TIMER_ID_1:
// proved by digisound of several intros like eoroidpro
- m_timer1->adjust(TEDTIME_IN_CYCLES(TIMER1), 1);
+ m_timer1->adjust(clocks_to_attotime(TIMER1), 1);
m_timer1_active = 1;
set_interrupt(0x08);
break;
case TIMER_ID_2:
- m_timer2->adjust(TEDTIME_IN_CYCLES(0x10000), 2);
+ m_timer2->adjust(clocks_to_attotime(0x10000), 2);
m_timer2_active = 1;
set_interrupt(0x10);
break;
case TIMER_ID_3:
- m_timer3->adjust(TEDTIME_IN_CYCLES(0x10000), 3);
+ m_timer3->adjust(clocks_to_attotime(0x10000), 3);
m_timer3_active = 1;
set_interrupt(0x40);
break;
+
+ case TIMER_LINE:
+ raster_interrupt_gen();
+ break;
+
+ case TIMER_FRAME:
+ frame_interrupt_gen();
+ break;
}
}
@@ -759,7 +739,7 @@ void mos7360_device::drawlines(int first, int last)
void mos7360_device::soundport_w(int offset, int data)
{
- // int old = m_reg[offset];
+ // int old = m_reg[offset & 0x1f];
m_stream->update();
switch (offset)
@@ -767,9 +747,9 @@ void mos7360_device::soundport_w(int offset, int data)
case 0x0e:
case 0x12:
if (offset == 0x12)
- m_reg[offset] = (m_reg[offset] & ~3) | (data & 3);
+ m_reg[offset & 0x1f] = (m_reg[offset & 0x1f] & ~3) | (data & 3);
else
- m_reg[offset] = data;
+ m_reg[offset & 0x1f] = data;
m_tone1samples = machine().sample_rate() / TONE_FREQUENCY (TONE1_VALUE);
DBG_LOG(1, "ted7360", ("tone1 %d %d sample:%d\n", TONE1_VALUE, TONE_FREQUENCY(TONE1_VALUE), m_tone1samples));
@@ -777,7 +757,7 @@ void mos7360_device::soundport_w(int offset, int data)
case 0xf:
case 0x10:
- m_reg[offset] = data;
+ m_reg[offset & 0x1f] = data;
m_tone2samples = machine().sample_rate() / TONE_FREQUENCY (TONE2_VALUE);
DBG_LOG (1, "ted7360", ("tone2 %d %d sample:%d\n", TONE2_VALUE, TONE_FREQUENCY(TONE2_VALUE), m_tone2samples));
@@ -790,7 +770,7 @@ void mos7360_device::soundport_w(int offset, int data)
break;
case 0x11:
- m_reg[offset] = data;
+ m_reg[offset & 0x1f] = data;
DBG_LOG(1, "ted7360", ("%s volume %d, %s %s %s\n", TONE_ON?"on":"off",
VOLUME, TONE1_ON?"tone1":"", TONE2_ON?"tone2":"", NOISE_ON?"noise":""));
@@ -806,95 +786,82 @@ void mos7360_device::soundport_w(int offset, int data)
// read - register read
//-------------------------------------------------
-READ8_MEMBER( mos7360_device::read )
+UINT8 mos7360_device::read(address_space &space, offs_t offset, int &cs0, int &cs1)
{
- int val = 0;
+ UINT8 val = m_last_data;
+
+ cs0 = cs0_r(offset);
+ cs1 = cs1_r(offset);
switch (offset)
{
- case 0:
- if (m_timer1)
- val = TEDTIME_TO_CYCLES(m_timer1->remaining()) & 0xff;
- else
- val = m_reg[offset];
+ case 0xff00:
+ val = attotime_to_clocks(m_timer1->remaining()) & 0xff;
break;
- case 1:
- if (m_timer1)
- val = TEDTIME_TO_CYCLES(m_timer1->remaining()) >> 8;
- else
- val = m_reg[offset];
+ case 0xff01:
+ val = attotime_to_clocks(m_timer1->remaining()) >> 8;
break;
- case 2:
- if (m_timer2)
- val = TEDTIME_TO_CYCLES(m_timer2->remaining()) & 0xff;
- else
- val = m_reg[offset];
+ case 0xff02:
+ val = attotime_to_clocks(m_timer2->remaining()) & 0xff;
break;
- case 3:
- if (m_timer2)
- val = TEDTIME_TO_CYCLES(m_timer2->remaining()) >> 8;
- else
- val = m_reg[offset];
+ case 0xff03:
+ val = attotime_to_clocks(m_timer2->remaining()) >> 8;
break;
- case 4:
- if (m_timer3)
- val = TEDTIME_TO_CYCLES(m_timer3->remaining()) & 0xff;
- else
- val = m_reg[offset];
+ case 0xff04:
+ val = attotime_to_clocks(m_timer3->remaining()) & 0xff;
break;
- case 5:
- if (m_timer3)
- val = TEDTIME_TO_CYCLES(m_timer3->remaining()) >> 8;
- else
- val = m_reg[offset];
+ case 0xff05:
+ val = attotime_to_clocks(m_timer3->remaining()) >> 8;
break;
- case 7:
- val = (m_reg[offset] & ~0x40);
+ case 0xff07:
+ val = (m_reg[offset & 0x1f] & ~0x40);
if (m_clock == TED7360NTSC_CLOCK)
val |= 0x40;
break;
- case 9:
- val = m_reg[offset] | 1;
- break;
- case 0xa:
- val = m_reg[offset];
- break;
- case 0xb:
- val = m_reg[offset];
- break;
- case 0x0c:
- val = m_reg[offset] |= 0xfc;
- break;
- case 0x13:
- val = m_reg[offset] & ~1;
+ case 0xff13:
+ val = m_reg[offset & 0x1f] & ~1;
if (m_rom)
val |= 1;
break;
- case 0x1c: /*rasterline */
+ case 0xff1c: /*rasterline */
drawlines(m_lastline, m_rasterline);
val = ((RASTERLINE_2_C16(m_rasterline) & 0x100) >> 8) | 0xfe; /* expected by matrix */
break;
- case 0x1d: /*rasterline */
+ case 0xff1d: /*rasterline */
drawlines(m_lastline, m_rasterline);
val = RASTERLINE_2_C16(m_rasterline) & 0xff;
break;
- case 0x1e: /*rastercolumn */
+ case 0xff1e: /*rastercolumn */
val = rastercolumn() / 2; /* pengo >=0x99 */
break;
- case 0x1f:
- val = ((m_rasterline & 7) << 4) | (m_reg[offset] & 0x0f);
+ case 0xff1f:
+ val = ((m_rasterline & 7) << 4) | (m_reg[offset & 0x1f] & 0x0f);
DBG_LOG(1, "port_w", ("read from cursorblink %.2x\n", val));
break;
- default:
- val = m_reg[offset];
+ case 0xff06:
+ case 0xff08:
+ case 0xff09:
+ case 0xff0a:
+ case 0xff0b:
+ case 0xff0c:
+ case 0xff0d:
+ case 0xff0e:
+ case 0xff0f:
+ case 0xff10:
+ case 0xff11:
+ case 0xff12:
+ case 0xff14:
+ case 0xff15:
+ case 0xff16:
+ case 0xff17:
+ case 0xff18:
+ case 0xff19:
+ case 0xff1a:
+ case 0xff1b:
+ val = m_reg[offset & 0x1f];
break;
}
- if ((offset != 8) && (offset >= 6) && (offset != 0x1c) && (offset != 0x1d) && (offset != 9) && ((offset < 0x15) || (offset > 0x19)))
- {
- DBG_LOG(1, "port_r", ("%.2x:%.2x\n", offset, val));
- }
-
return val;
}
@@ -903,75 +870,74 @@ READ8_MEMBER( mos7360_device::read )
// write - register write
//-------------------------------------------------
-WRITE8_MEMBER( mos7360_device::write )
+void mos7360_device::write(address_space &space, offs_t offset, UINT8 data, int &cs0, int &cs1)
{
int old;
- if ((offset != 8) && ((offset < 0x15) || (offset > 0x19)))
- {
- DBG_LOG(1, "port_w", ("%.2x:%.2x\n", offset, data));
- }
+ cs0 = cs0_r(offset);
+ cs1 = cs1_r(offset);
switch (offset)
{
- case 0xe:
- case 0xf:
- case 0x10:
- case 0x11:
- case 0x12:
- soundport_w(offset, data);
+ case 0xff0e:
+ case 0xff0f:
+ case 0xff10:
+ case 0xff11:
+ case 0xff12:
+ soundport_w(offset & 0x1f, data);
break;
}
+
switch (offset)
{
- case 0: /* stop timer 1 */
- m_reg[offset] = data;
+ case 0xff00: /* stop timer 1 */
+ m_reg[offset & 0x1f] = data;
if (m_timer1_active)
{
- m_reg[1] = TEDTIME_TO_CYCLES(m_timer1->remaining()) >> 8;
+ m_reg[1] = attotime_to_clocks(m_timer1->remaining()) >> 8;
m_timer1->reset();
m_timer1_active = 0;
}
break;
- case 1: /* start timer 1 */
- m_reg[offset] = data;
- m_timer1->adjust(TEDTIME_IN_CYCLES(TIMER1), 1);
+ case 0xff01: /* start timer 1 */
+ m_reg[offset & 0x1f] = data;
+ m_timer1->adjust(clocks_to_attotime(TIMER1), 1);
m_timer1_active = 1;
break;
- case 2: /* stop timer 2 */
- m_reg[offset] = data;
+ case 0xff02: /* stop timer 2 */
+ m_reg[offset & 0x1f] = data;
if (m_timer2_active)
{
- m_reg[3] = TEDTIME_TO_CYCLES(m_timer2->remaining()) >> 8;
+ m_reg[3] = attotime_to_clocks(m_timer2->remaining()) >> 8;
m_timer2->reset();
m_timer2_active = 0;
}
break;
- case 3: /* start timer 2 */
- m_reg[offset] = data;
- m_timer2->adjust(TEDTIME_IN_CYCLES(TIMER2), 2);
+ case 0xff03: /* start timer 2 */
+ m_reg[offset & 0x1f] = data;
+ m_timer2->adjust(clocks_to_attotime(TIMER2), 2);
m_timer2_active = 1;
break;
- case 4: /* stop timer 3 */
- m_reg[offset] = data;
+ case 0xff04: /* stop timer 3 */
+ m_reg[offset & 0x1f] = data;
if (m_timer3_active)
{
- m_reg[5] = TEDTIME_TO_CYCLES(m_timer3->remaining()) >> 8;
+ m_reg[5] = attotime_to_clocks(m_timer3->remaining()) >> 8;
m_timer3->reset();
m_timer3_active = 0;
}
break;
- case 5: /* start timer 3 */
- m_reg[offset] = data;
- m_timer3->adjust(TEDTIME_IN_CYCLES(TIMER3), 3);
+ case 0xff05: /* start timer 3 */
+ m_reg[offset & 0x1f] = data;
+ m_timer3->adjust(clocks_to_attotime(TIMER3), 3);
m_timer3_active = 1;
break;
- case 6:
- if (m_reg[offset] != data)
+ case 0xff06:
+ if (m_reg[offset & 0x1f] != data)
{
drawlines(m_lastline, m_rasterline);
- m_reg[offset] = data;
+ m_reg[offset & 0x1f] = data;
if (LINES25)
{
m_y_begin = 0;
@@ -985,11 +951,11 @@ WRITE8_MEMBER( mos7360_device::write )
m_chargenaddr = CHARGENADDR;
}
break;
- case 7:
- if (m_reg[offset] != data)
+ case 0xff07:
+ if (m_reg[offset & 0x1f] != data)
{
drawlines(m_lastline, m_rasterline);
- m_reg[offset] = data;
+ m_reg[offset & 0x1f] = data;
if (COLUMNS40)
{
m_x_begin = 0;
@@ -1004,10 +970,10 @@ WRITE8_MEMBER( mos7360_device::write )
m_chargenaddr = CHARGENADDR;
}
break;
- case 8:
- m_reg[offset] = m_in_k_func(data);
+ case 0xff08:
+ m_reg[offset & 0x1f] = m_read_k(data);
break;
- case 9:
+ case 0xff09:
if (data & 0x08)
clear_interrupt(8);
if (data & 0x10)
@@ -1017,9 +983,9 @@ WRITE8_MEMBER( mos7360_device::write )
if (data & 0x02)
clear_interrupt(2);
break;
- case 0xa:
+ case 0xff0a:
old = data;
- m_reg[offset] = data | 0xa0;
+ m_reg[offset & 0x1f] = data | 0xa0;
#if 0
m_reg[9] = (m_reg[9] & 0xa1) | (m_reg[9] & data & 0x5e);
if (m_reg[9] & 0x80)
@@ -1030,101 +996,110 @@ WRITE8_MEMBER( mos7360_device::write )
/* DBG_LOG(1,"set rasterline hi",("soll:%d\n",RASTERLINE)); */
}
break;
- case 0xb:
- if (data != m_reg[offset])
+ case 0xff0b:
+ if (data != m_reg[offset & 0x1f])
{
drawlines(m_lastline, m_rasterline);
- m_reg[offset] = data;
+ m_reg[offset & 0x1f] = data;
/* DBG_LOG(1,"set rasterline lo",("soll:%d\n",RASTERLINE)); */
}
break;
- case 0xc:
- case 0xd:
- if (m_reg[offset] != data)
+ case 0xff0c:
+ case 0xff0d:
+ if (m_reg[offset & 0x1f] != data)
{
drawlines(m_lastline, m_rasterline);
- m_reg[offset] = data;
+ m_reg[offset & 0x1f] = data;
}
break;
- case 0x12:
- if (m_reg[offset] != data)
+ case 0xff12:
+ if (m_reg[offset & 0x1f] != data)
{
drawlines(m_lastline, m_rasterline);
- m_reg[offset] = data;
+ m_reg[offset & 0x1f] = data;
m_bitmapaddr = BITMAPADDR;
m_chargenaddr = CHARGENADDR;
DBG_LOG(3, "port_w", ("bitmap %.4x %s\n", BITMAPADDR, INROM ? "rom" : "ram"));
}
break;
- case 0x13:
- if (m_reg[offset] != data)
+ case 0xff13:
+ if (m_reg[offset & 0x1f] != data)
{
drawlines(m_lastline, m_rasterline);
- m_reg[offset] = data;
+ m_reg[offset & 0x1f] = data;
m_chargenaddr = CHARGENADDR;
DBG_LOG(3, "port_w", ("chargen %.4x %s %d\n", CHARGENADDR, data & 2 ? "" : "doubleclock", data & 1));
}
break;
- case 0x14:
- if (m_reg[offset] != data)
+ case 0xff14:
+ if (m_reg[offset & 0x1f] != data)
{
drawlines(m_lastline, m_rasterline);
- m_reg[offset] = data;
+ m_reg[offset & 0x1f] = data;
m_videoaddr = VIDEOADDR;
DBG_LOG(3, "port_w", ("videoram %.4x\n", VIDEOADDR));
}
break;
- case 0x15: /* backgroundcolor */
- if (m_reg[offset] != data)
+ case 0xff15: /* backgroundcolor */
+ if (m_reg[offset & 0x1f] != data)
{
drawlines(m_lastline, m_rasterline);
- m_reg[offset] = data;
+ m_reg[offset & 0x1f] = data;
m_monoinversed[1] = m_mono[0] = m_bitmapmulti[0] = m_multi[0] = m_colors[0] = BACKGROUNDCOLOR;
}
break;
- case 0x16: /* foregroundcolor */
- if (m_reg[offset] != data)
+ case 0xff16: /* foregroundcolor */
+ if (m_reg[offset & 0x1f] != data)
{
drawlines(m_lastline, m_rasterline);
- m_reg[offset] = data;
+ m_reg[offset & 0x1f] = data;
m_bitmapmulti[3] = m_multi[1] = m_colors[1] = FOREGROUNDCOLOR;
}
break;
- case 0x17: /* multicolor 1 */
- if (m_reg[offset] != data)
+ case 0xff17: /* multicolor 1 */
+ if (m_reg[offset & 0x1f] != data)
{
drawlines(m_lastline, m_rasterline);
- m_reg[offset] = data;
+ m_reg[offset & 0x1f] = data;
m_multi[2] = m_colors[2] = MULTICOLOR1;
}
break;
- case 0x18: /* multicolor 2 */
- if (m_reg[offset] != data)
+ case 0xff18: /* multicolor 2 */
+ if (m_reg[offset & 0x1f] != data)
{
drawlines(m_lastline, m_rasterline);
- m_reg[offset] = data;
+ m_reg[offset & 0x1f] = data;
m_colors[3] = MULTICOLOR2;
}
break;
- case 0x19: /* framecolor */
- if (m_reg[offset] != data)
+ case 0xff19: /* framecolor */
+ if (m_reg[offset & 0x1f] != data)
{
drawlines(m_lastline, m_rasterline);
- m_reg[offset] = data;
+ m_reg[offset & 0x1f] = data;
m_colors[4] = FRAMECOLOR;
}
break;
- case 0x1c:
- m_reg[offset] = data; /*? */
+ case 0xff1c:
+ m_reg[offset & 0x1f] = data; /*? */
DBG_LOG(1, "port_w", ("write to rasterline high %.2x\n",
data));
break;
- case 0x1f:
- m_reg[offset] = data;
+ case 0xff1f:
+ m_reg[offset & 0x1f] = data;
DBG_LOG(1, "port_w", ("write to cursorblink %.2x\n", data));
break;
- default:
- m_reg[offset] = data;
+ case 0xff3e:
+ m_rom = 1;
+ break;
+ case 0xff3f:
+ m_rom = 0;
+ break;
+ case 0xff1a:
+ case 0xff1b:
+ case 0xff1d:
+ case 0xff1e:
+ m_reg[offset & 0x1f] = data;
break;
}
}
@@ -1141,16 +1116,6 @@ UINT32 mos7360_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap
return 0;
}
-WRITE_LINE_MEMBER( mos7360_device::rom_switch_w )
-{
- m_rom = state;
-}
-
-READ_LINE_MEMBER( mos7360_device::rom_switch_r )
-{
- return m_rom;
-}
-
void mos7360_device::frame_interrupt_gen()
{
if ((m_reg[0x1f] & 0xf) >= 0x0f)
@@ -1184,16 +1149,6 @@ void mos7360_device::raster_interrupt_gen()
//-------------------------------------------------
-// bus_r - data bus read
-//-------------------------------------------------
-
-UINT8 mos7360_device::bus_r()
-{
- return m_last_data;
-}
-
-
-//-------------------------------------------------
// cs0_r - chip select 0 read
//-------------------------------------------------
@@ -1209,7 +1164,7 @@ int mos7360_device::cs0_r(offs_t offset)
//-------------------------------------------------
-// cs0_r - chip select 1 read
+// cs1_r - chip select 1 read
//-------------------------------------------------
int mos7360_device::cs1_r(offs_t offset)
diff --git a/src/mess/audio/mos7360.h b/src/emu/sound/mos7360.h
index e908aa15915..1bb98e5710c 100644
--- a/src/mess/audio/mos7360.h
+++ b/src/emu/sound/mos7360.h
@@ -43,7 +43,7 @@
DEVICE CONFIGURATION MACROS
***************************************************************************/
-#define MCFG_MOS7360_ADD(_tag, _screen_tag, _clock, _config, _videoram_map) \
+#define MCFG_MOS7360_ADD(_tag, _screen_tag, _cpu_tag, _clock, _videoram_map, _irq, _k) \
MCFG_SCREEN_ADD(_screen_tag, RASTER) \
MCFG_SCREEN_REFRESH_RATE(TED7360PAL_VRETRACERATE) \
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) \
@@ -51,12 +51,8 @@
MCFG_SCREEN_VISIBLE_AREA(0, 336 - 1, 0, 216 - 1) \
MCFG_SCREEN_UPDATE_DEVICE(_tag, mos7360_device, screen_update) \
MCFG_DEVICE_ADD(_tag, MOS7360, _clock) \
- MCFG_DEVICE_CONFIG(_config) \
- MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map)
-
-
-#define MOS7360_INTERFACE(_name) \
- const mos7360_interface (_name) =
+ MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \
+ downcast<mos7360_device *>(device)->set_callbacks(_screen_tag, _cpu_tag, DEVCB2_##_irq, DEVCB2_##_k);
@@ -89,49 +85,31 @@
TYPE DEFINITIONS
***************************************************************************/
-// ======================> mos7360_interface
-
-struct mos7360_interface
-{
- const char *m_screen_tag;
- const char *m_cpu_tag;
-
- devcb_write_line m_out_irq_cb;
-
- devcb_read8 m_in_k_cb;
-};
-
-
// ======================> mos7360_device
class mos7360_device : public device_t,
public device_memory_interface,
- public device_sound_interface,
- public mos7360_interface
+ public device_sound_interface
{
public:
// construction/destruction
//mos7360_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
mos7360_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- DECLARE_READ8_MEMBER( read );
- DECLARE_WRITE8_MEMBER( write );
+ template<class _irq, class _k> void set_callbacks(const char *screen_tag, const char *cpu_tag, _irq irq, _k k) {
+ m_screen_tag = screen_tag;
+ m_cpu_tag = cpu_tag;
+ m_write_irq.set_callback(irq);
+ m_read_k.set_callback(k);
+ }
- int cs0_r(offs_t offset);
- int cs1_r(offs_t offset);
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
- UINT8 bus_r();
+ UINT8 read(address_space &space, offs_t offset, int &cs0, int &cs1);
+ void write(address_space &space, offs_t offset, UINT8 data, int &cs0, int &cs1);
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
- // horrible crap code
- DECLARE_WRITE_LINE_MEMBER( rom_switch_w );
- DECLARE_READ_LINE_MEMBER( rom_switch_r );
- void frame_interrupt_gen();
- void raster_interrupt_gen();
-
protected:
enum
{
@@ -142,11 +120,12 @@ protected:
{
TIMER_ID_1,
TIMER_ID_2,
- TIMER_ID_3
+ TIMER_ID_3,
+ TIMER_LINE,
+ TIMER_FRAME
};
// device-level overrides
- virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -167,12 +146,18 @@ protected:
void draw_cursor(int ybegin, int yend, int yoff, int xoff, int color);
void drawlines(int first, int last);
void soundport_w(int offset, int data);
+ void frame_interrupt_gen();
+ void raster_interrupt_gen();
+ int cs0_r(offs_t offset);
+ int cs1_r(offs_t offset);
const address_space_config m_videoram_space_config;
- devcb_resolved_write_line m_out_irq_func;
- devcb_resolved_read8 m_in_k_func;
+ devcb2_write_line m_write_irq;
+ devcb2_read8 m_read_k;
+ const char *m_screen_tag;
+ const char *m_cpu_tag;
screen_device *m_screen; // screen which sets bitmap properties
cpu_device *m_cpu;
sound_stream *m_stream;
@@ -210,6 +195,9 @@ protected:
m_noisesamples; /* count of samples to give out per tone */
int m_variant;
+
+ emu_timer *m_line_timer;
+ emu_timer *m_frame_timer;
};
diff --git a/src/emu/sound/sid.h b/src/emu/sound/sid.h
index 8b3d04545b0..45130f3da23 100644
--- a/src/emu/sound/sid.h
+++ b/src/emu/sound/sid.h
@@ -8,7 +8,6 @@
this part is for one chip,
*/
-#include "sound/sid6581.h"
#include "sidvoice.h"
/* private area */
@@ -20,7 +19,7 @@ struct SID6581_t
devcb_resolved_read8 in_potx_func;
devcb_resolved_read8 in_poty_func;
- SIDTYPE type;
+ int type;
UINT32 clock;
UINT16 PCMfreq; // samplerate of the current systems soundcard/DAC
diff --git a/src/emu/sound/sid6581.c b/src/emu/sound/sid6581.c
deleted file mode 100644
index b04398344d0..00000000000
--- a/src/emu/sound/sid6581.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/***************************************************************************
-
- sid6581.c
-
- MAME/MESS interface for SID6581 and SID8580 chips
-
-***************************************************************************/
-
-#include "emu.h"
-#include "sid6581.h"
-#include "sid.h"
-
-
-
-static SID6581_t *get_sid(device_t *device)
-{
- assert(device != NULL);
- assert((device->type() == SID6581) || (device->type() == SID8580));
- return (SID6581_t *) downcast<sid6581_device *>(device)->token();
-}
-
-
-
-static STREAM_UPDATE( sid_update )
-{
- SID6581_t *sid = (SID6581_t *) param;
- sidEmuFillBuffer(sid, outputs[0], samples);
-}
-
-
-
-static void sid_start(device_t *device, SIDTYPE sidtype)
-{
- SID6581_t *sid = get_sid(device);
- const sid6581_interface *iface = (const sid6581_interface*) device->static_config();
- assert(iface);
-
- // resolve callbacks
- sid->in_potx_func.resolve(iface->in_potx_cb, *device);
- sid->in_poty_func.resolve(iface->in_poty_cb, *device);
-
- sid->device = device;
- sid->mixer_channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), (void *) sid, sid_update);
- sid->PCMfreq = device->machine().sample_rate();
- sid->clock = device->clock();
- sid->type = sidtype;
-
- sid6581_init(sid);
- sidInitWaveformTables(sidtype);
-}
-
-
-
-static DEVICE_RESET( sid )
-{
- SID6581_t *sid = get_sid(device);
- sidEmuReset(sid);
-}
-
-
-
-static DEVICE_START( sid6581 )
-{
- sid_start(device, MOS6581);
-}
-
-
-
-static DEVICE_START( sid8580 )
-{
- sid_start(device, MOS8580);
-}
-
-
-
-READ8_MEMBER( sid6581_device::read )
-{
- return sid6581_port_r(machine(), get_sid(this), offset);
-}
-
-
-WRITE8_MEMBER( sid6581_device::write )
-{
- sid6581_port_w(get_sid(this), offset, data);
-}
-
-const device_type SID6581 = &device_creator<sid6581_device>;
-
-sid6581_device::sid6581_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, SID6581, "SID6581", tag, owner, clock),
- device_sound_interface(mconfig, *this)
-{
- m_token = global_alloc_clear(SID6581_t);
-}
-sid6581_device::sid6581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, type, name, tag, owner, clock),
- device_sound_interface(mconfig, *this)
-{
- m_token = global_alloc_clear(SID6581_t);
-}
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void sid6581_device::device_config_complete()
-{
-}
-
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void sid6581_device::device_start()
-{
- DEVICE_START_NAME( sid6581 )(this);
-}
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void sid6581_device::device_reset()
-{
- DEVICE_RESET_NAME( sid )(this);
-}
-
-//-------------------------------------------------
-// sound_stream_update - handle a stream update
-//-------------------------------------------------
-
-void sid6581_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
-{
- // should never get here
- fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
-}
-
-
-const device_type SID8580 = &device_creator<sid8580_device>;
-
-sid8580_device::sid8580_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : sid6581_device(mconfig, SID8580, "SID8580", tag, owner, clock)
-{
-}
-
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void sid8580_device::device_start()
-{
- DEVICE_START_NAME( sid8580 )(this);
-}
-
-//-------------------------------------------------
-// sound_stream_update - handle a stream update
-//-------------------------------------------------
-
-void sid8580_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
-{
- // should never get here
- fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
-}
diff --git a/src/emu/sound/sid6581.h b/src/emu/sound/sid6581.h
deleted file mode 100644
index 3166e295d17..00000000000
--- a/src/emu/sound/sid6581.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/***************************************************************************
-
- sid6581.h
-
- MAME/MESS interface for SID6581 and SID8580 chips
-
-***************************************************************************/
-
-#pragma once
-
-#ifndef __SID6581_H__
-#define __SID6581_H__
-
-#include "devlegcy.h"
-
-
-enum SIDTYPE
-{
- MOS6581,
- MOS8580
-};
-
-#define MOS6581_INTERFACE(name) \
- const sid6581_interface (name) =
-
-struct sid6581_interface
-{
- devcb_read8 in_potx_cb;
- devcb_read8 in_poty_cb;
-};
-
-struct SID6581_t;
-
-class sid6581_device : public device_t,
- public device_sound_interface
-{
-public:
- sid6581_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- sid6581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
- ~sid6581_device() { global_free(m_token); }
-
- // access to legacy token
- void *token() const { assert(m_token != NULL); return m_token; }
-
- DECLARE_READ8_MEMBER( read );
- DECLARE_WRITE8_MEMBER( write );
-
-protected:
- // device-level overrides
- virtual void device_config_complete();
- virtual void device_start();
- virtual void device_reset();
-
- // sound stream update overrides
- virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
-private:
- // internal state
- SID6581_t *m_token;
-};
-
-extern const device_type SID6581;
-
-class sid8580_device : public sid6581_device
-{
-public:
- sid8580_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-protected:
- // device-level overrides
- virtual void device_start();
-
- // sound stream update overrides
- virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
-};
-
-extern const device_type SID8580;
-
-
-#endif /* __SID6581_H__ */
diff --git a/src/emu/sound/sidvoice.c b/src/emu/sound/sidvoice.c
index bc73fb33b65..fd548680471 100644
--- a/src/emu/sound/sidvoice.c
+++ b/src/emu/sound/sidvoice.c
@@ -708,7 +708,7 @@ void sidEmuSet2(sidOperator* pVoice)
}
}
-void sidInitWaveformTables(SIDTYPE type)
+void sidInitWaveformTables(int type)
{
int i,j;
UINT16 k;
@@ -732,7 +732,7 @@ void sidInitWaveformTables(SIDTYPE type)
for ( i = 0; i < 4096; i++ )
squareTable[k++] = 0; //255;
- if ( type==MOS8580 )
+ if ( type==mos6581_device::TYPE_8580 )
{
waveform30 = waveform30_8580;
waveform50 = waveform50_8580;
@@ -747,7 +747,7 @@ void sidInitWaveformTables(SIDTYPE type)
waveform70 = waveform70_6581; /* really audible? */
}
- if ( type==MOS8580 )
+ if ( type==mos6581_device::TYPE_8580 )
{
sidModeNormalTable[3] = sidMode30;
sidModeNormalTable[6] = sidMode60;
diff --git a/src/emu/sound/sidvoice.h b/src/emu/sound/sidvoice.h
index dcf865a5efe..942ddabe836 100644
--- a/src/emu/sound/sidvoice.h
+++ b/src/emu/sound/sidvoice.h
@@ -8,7 +8,7 @@
approximation of the sid6581 chip
this part is for 1 (of the 3) voices of a chip
*/
-#include "sound/sid6581.h"
+#include "sound/mos6581.h"
struct sw_storage
{
@@ -105,7 +105,7 @@ void sidEmuSet(sidOperator* pVoice);
void sidEmuSet2(sidOperator* pVoice);
INT8 sidWaveCalcNormal(sidOperator* pVoice);
-void sidInitWaveformTables(SIDTYPE type);
+void sidInitWaveformTables(int type);
void sidInitMixerEngine(running_machine &machine);
#if 0
diff --git a/src/emu/sound/sound.mak b/src/emu/sound/sound.mak
index 962e48fe8d6..4c7919eb9bb 100644
--- a/src/emu/sound/sound.mak
+++ b/src/emu/sound/sound.mak
@@ -324,6 +324,16 @@ endif
#-------------------------------------------------
+# MOS 7360 TED
+#-------------------------------------------------
+
+ifneq ($(filter MOS7360,$(SOUNDS)),)
+SOUNDOBJS += $(SOUNDOBJ)/mos7360.o
+endif
+
+
+
+#-------------------------------------------------
# Namco custom sound chips
#-------------------------------------------------
@@ -511,11 +521,11 @@ endif
#-------------------------------------------------
ifneq ($(filter SID6581,$(SOUNDS)),)
-SOUNDOBJS += $(SOUNDOBJ)/sid6581.o $(SOUNDOBJ)/sid.o $(SOUNDOBJ)/sidenvel.o $(SOUNDOBJ)/sidvoice.o
+SOUNDOBJS += $(SOUNDOBJ)/mos6581.o $(SOUNDOBJ)/sid.o $(SOUNDOBJ)/sidenvel.o $(SOUNDOBJ)/sidvoice.o
endif
ifneq ($(filter SID8580,$(SOUNDS)),)
-SOUNDOBJS += $(SOUNDOBJ)/sid6581.o $(SOUNDOBJ)/sid.o $(SOUNDOBJ)/sidenvel.o $(SOUNDOBJ)/sidvoice.o
+SOUNDOBJS += $(SOUNDOBJ)/mos6581.o $(SOUNDOBJ)/sid.o $(SOUNDOBJ)/sidenvel.o $(SOUNDOBJ)/sidvoice.o
endif
diff --git a/src/mame/drivers/attckufo.c b/src/mame/drivers/attckufo.c
index 83e79409df2..f841fe06503 100644
--- a/src/mame/drivers/attckufo.c
+++ b/src/mame/drivers/attckufo.c
@@ -69,7 +69,6 @@ public:
DECLARE_READ8_MEMBER( vic_videoram_r );
DECLARE_READ8_MEMBER( vic_colorram_r );
- INTERRUPT_GEN_MEMBER(attckufo_raster_interrupt);
};
READ8_MEMBER(attckufo_state::attckufo_io_r)
@@ -148,28 +147,13 @@ static INPUT_PORTS_START( attckufo )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
INPUT_PORTS_END
-
-INTERRUPT_GEN_MEMBER(attckufo_state::attckufo_raster_interrupt)
-{
- m_mos6560->raster_interrupt_gen();
-}
-
-static MOS6560_INTERFACE( vic_intf )
-{
- "screen",
- DEVCB_NULL,
- DEVCB_NULL
-};
-
-
static MACHINE_CONFIG_START( attckufo, attckufo_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6502, 14318181/14)
MCFG_CPU_PROGRAM_MAP(cpu_map)
- MCFG_CPU_PERIODIC_INT_DRIVER(attckufo_state, attckufo_raster_interrupt, MOS656X_HRETRACERATE)
/* video hardware */
- MCFG_MOS656X_ATTACK_UFO_ADD("mos6560", "screen", 14318181/14, vic_intf, vic_videoram_map, vic_colorram_map)
+ MCFG_MOS656X_ATTACK_UFO_ADD("mos6560", "screen", 14318181/14, vic_videoram_map, vic_colorram_map)
MACHINE_CONFIG_END
ROM_START( attckufo )
diff --git a/src/mess/drivers/c128.c b/src/mess/drivers/c128.c
index 4a63515e07e..992026dfb45 100644
--- a/src/mess/drivers/c128.c
+++ b/src/mess/drivers/c128.c
@@ -899,16 +899,6 @@ WRITE8_MEMBER( c128_state::vic_k_w )
m_vic_k = data;
}
-static MOS8564_INTERFACE( vic_intf )
-{
- SCREEN_VIC_TAG,
- M8502_TAG,
- DEVCB_DRIVER_LINE_MEMBER(c128_state, vic_irq_w),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_MEMBER(c128_state, vic_k_w)
-};
-
//-------------------------------------------------
// MOS6581_INTERFACE( sid_intf )
@@ -968,12 +958,6 @@ READ8_MEMBER( c128_state::sid_poty_r )
return data;
}
-static MOS6581_INTERFACE( sid_intf )
-{
- DEVCB_DRIVER_MEMBER(c128_state, sid_potx_r),
- DEVCB_DRIVER_MEMBER(c128_state, sid_poty_r)
-};
-
//-------------------------------------------------
// MOS6526_INTERFACE( cia1_intf )
@@ -1112,18 +1096,6 @@ WRITE_LINE_MEMBER( c128_state::cia1_sp_w )
update_iec();
}
-static MOS6526_INTERFACE( cia1_intf )
-{
- DEVCB_DRIVER_LINE_MEMBER(c128_state, cia1_irq_w),
- DEVCB_NULL,
- DEVCB_DRIVER_LINE_MEMBER(c128_state, cia1_cnt_w),
- DEVCB_DRIVER_LINE_MEMBER(c128_state, cia1_sp_w),
- DEVCB_DRIVER_MEMBER(c128_state, cia1_pa_r),
- DEVCB_NULL,
- DEVCB_DRIVER_MEMBER(c128_state, cia1_pb_r),
- DEVCB_DRIVER_MEMBER(c128_state, cia1_pb_w)
-};
-
//-------------------------------------------------
// MOS6526_INTERFACE( cia2_intf )
@@ -1197,18 +1169,6 @@ WRITE8_MEMBER( c128_state::cia2_pa_w )
update_iec();
}
-static MOS6526_INTERFACE( cia2_intf )
-{
- DEVCB_DRIVER_LINE_MEMBER(c128_state, cia2_irq_w),
- DEVCB_DEVICE_LINE_MEMBER(C64_USER_PORT_TAG, c64_user_port_device, pc2_w),
- DEVCB_DEVICE_LINE_MEMBER(C64_USER_PORT_TAG, c64_user_port_device, sp2_w),
- DEVCB_DEVICE_LINE_MEMBER(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w),
- DEVCB_DRIVER_MEMBER(c128_state, cia2_pa_r),
- DEVCB_DRIVER_MEMBER(c128_state, cia2_pa_w),
- DEVCB_DEVICE_MEMBER(C64_USER_PORT_TAG, c64_user_port_device, pb_r),
- DEVCB_DEVICE_MEMBER(C64_USER_PORT_TAG, c64_user_port_device, pb_w)
-};
-
//-------------------------------------------------
// M6510_INTERFACE( cpu_intf )
@@ -1313,15 +1273,6 @@ WRITE_LINE_MEMBER( c128_state::iec_data_w )
update_iec();
}
-static CBM_IEC_INTERFACE( cbm_iec_intf )
-{
- DEVCB_DRIVER_LINE_MEMBER(c128_state, iec_srq_w),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_LINE_MEMBER(c128_state, iec_data_w),
- DEVCB_NULL
-};
-
//-------------------------------------------------
// C64_EXPANSION_INTERFACE( expansion_intf )
@@ -1491,13 +1442,13 @@ static MACHINE_CONFIG_START( ntsc, c128_state )
// video hardware
MCFG_MOS8563_ADD(MOS8563_TAG, SCREEN_VDC_TAG, VIC6567_CLOCK*2, vdc_intf, vdc_videoram_map)
- MCFG_MOS8564_ADD(MOS8564_TAG, SCREEN_VIC_TAG, VIC6567_CLOCK, vic_intf, vic_videoram_map, vic_colorram_map)
+ MCFG_MOS8564_ADD(MOS8564_TAG, SCREEN_VIC_TAG, M8502_TAG, VIC6567_CLOCK, vic_videoram_map, vic_colorram_map, DEVWRITELINE(DEVICE_SELF, c128_state, vic_irq_w), DEVWRITE8(DEVICE_SELF, c128_state, vic_k_w))
MCFG_GFXDECODE(c128)
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD(MOS6581_TAG, SID6581, VIC6567_CLOCK)
- MCFG_SOUND_CONFIG(sid_intf)
+ MCFG_SOUND_ADD(MOS6581_TAG, MOS6581, VIC6567_CLOCK)
+ MCFG_MOS6581_POTXY_CALLBACKS(DEVREAD8(DEVICE_SELF, c128_state, sid_potx_r), DEVREAD8(DEVICE_SELF, c128_state, sid_poty_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MCFG_SOUND_ADD("dac", DAC, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
@@ -1505,8 +1456,14 @@ static MACHINE_CONFIG_START( ntsc, c128_state )
// devices
MCFG_MOS8722_ADD(MOS8722_TAG, mmu_intf)
MCFG_MOS8721_ADD(MOS8721_TAG)
- MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6567_CLOCK, 60, cia1_intf)
- MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, cia2_intf)
+ MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6567_CLOCK, 60, DEVWRITELINE(DEVICE_SELF, c128_state, cia1_irq_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(DEVICE_SELF, c128_state, cia1_cnt_w), DEVWRITELINE(DEVICE_SELF, c128_state, cia1_sp_w))
+ MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, c128_state, cia1_pa_r), NULL)
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, c128_state, cia1_pb_r), DEVWRITE8(DEVICE_SELF, c128_state, cia1_pb_w), NULL)
+ MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, DEVWRITELINE(DEVICE_SELF, c128_state, cia2_irq_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w))
+ MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, c128_state, cia2_pa_r), DEVWRITE8(DEVICE_SELF, c128_state, cia2_pa_w))
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w))
MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
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)
@@ -1547,7 +1504,9 @@ MACHINE_CONFIG_END
//-------------------------------------------------
static MACHINE_CONFIG_DERIVED( c128, ntsc )
- MCFG_CBM_IEC_ADD(cbm_iec_intf, "c1571")
+ MCFG_CBM_IEC_ADD("c1571")
+ MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(DEVICE_SELF, c128_state, iec_srq_w))
+ MCFG_CBM_IEC_BUS_DATA_CALLBACK(DEVWRITELINE(DEVICE_SELF, c128_state, iec_data_w))
MACHINE_CONFIG_END
@@ -1556,12 +1515,14 @@ MACHINE_CONFIG_END
//-------------------------------------------------
static MACHINE_CONFIG_DERIVED( c128dcr, ntsc )
- MCFG_CBM_IEC_BUS_ADD(cbm_iec_intf)
MCFG_CBM_IEC_SLOT_ADD("iec4", 4, cbm_iec_devices, NULL, NULL)
MCFG_CBM_IEC_SLOT_ADD("iec8", 8, c128dcr_iec_devices, "c1571", NULL) // TODO c1571cr
MCFG_CBM_IEC_SLOT_ADD("iec9", 9, cbm_iec_devices, NULL, NULL)
MCFG_CBM_IEC_SLOT_ADD("iec10", 10, cbm_iec_devices, NULL, NULL)
MCFG_CBM_IEC_SLOT_ADD("iec11", 11, cbm_iec_devices, NULL, NULL)
+ MCFG_CBM_IEC_BUS_ADD()
+ MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(DEVICE_SELF, c128_state, iec_srq_w))
+ MCFG_CBM_IEC_BUS_DATA_CALLBACK(DEVWRITELINE(DEVICE_SELF, c128_state, iec_data_w))
MACHINE_CONFIG_END
@@ -1570,12 +1531,14 @@ MACHINE_CONFIG_END
//-------------------------------------------------
static MACHINE_CONFIG_DERIVED( c128d81, ntsc )
- MCFG_CBM_IEC_BUS_ADD(cbm_iec_intf)
MCFG_CBM_IEC_SLOT_ADD("iec4", 4, cbm_iec_devices, NULL, NULL)
MCFG_CBM_IEC_SLOT_ADD("iec8", 8, c128d81_iec_devices, "c1563", NULL)
MCFG_CBM_IEC_SLOT_ADD("iec9", 9, cbm_iec_devices, NULL, NULL)
MCFG_CBM_IEC_SLOT_ADD("iec10", 10, cbm_iec_devices, NULL, NULL)
MCFG_CBM_IEC_SLOT_ADD("iec11", 11, cbm_iec_devices, NULL, NULL)
+ MCFG_CBM_IEC_BUS_ADD()
+ MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(DEVICE_SELF, c128_state, iec_srq_w))
+ MCFG_CBM_IEC_BUS_DATA_CALLBACK(DEVWRITELINE(DEVICE_SELF, c128_state, iec_data_w))
MACHINE_CONFIG_END
@@ -1598,13 +1561,13 @@ static MACHINE_CONFIG_START( pal, c128_state )
// video hardware
MCFG_MOS8563_ADD(MOS8563_TAG, SCREEN_VDC_TAG, VIC6569_CLOCK*2, vdc_intf, vdc_videoram_map)
- MCFG_MOS8566_ADD(MOS8564_TAG, SCREEN_VIC_TAG, VIC6569_CLOCK, vic_intf, vic_videoram_map, vic_colorram_map)
+ MCFG_MOS8566_ADD(MOS8564_TAG, SCREEN_VIC_TAG, M8502_TAG, VIC6569_CLOCK, vic_videoram_map, vic_colorram_map, DEVWRITELINE(DEVICE_SELF, c128_state, vic_irq_w), DEVWRITE8(DEVICE_SELF, c128_state, vic_k_w))
MCFG_GFXDECODE(c128)
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD(MOS6581_TAG, SID6581, VIC6569_CLOCK)
- MCFG_SOUND_CONFIG(sid_intf)
+ MCFG_SOUND_ADD(MOS6581_TAG, MOS6581, VIC6569_CLOCK)
+ MCFG_MOS6581_POTXY_CALLBACKS(DEVREAD8(DEVICE_SELF, c128_state, sid_potx_r), DEVREAD8(DEVICE_SELF, c128_state, sid_poty_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MCFG_SOUND_ADD("dac", DAC, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
@@ -1612,8 +1575,14 @@ static MACHINE_CONFIG_START( pal, c128_state )
// devices
MCFG_MOS8722_ADD(MOS8722_TAG, mmu_intf)
MCFG_MOS8721_ADD(MOS8721_TAG)
- MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6569_CLOCK, 50, cia1_intf)
- MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6569_CLOCK, 50, cia2_intf)
+ MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6569_CLOCK, 50, DEVWRITELINE(DEVICE_SELF, c128_state, cia1_irq_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(DEVICE_SELF, c128_state, cia1_cnt_w), DEVWRITELINE(DEVICE_SELF, c128_state, cia1_sp_w))
+ MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, c128_state, cia1_pa_r), NULL)
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, c128_state, cia1_pb_r), DEVWRITE8(DEVICE_SELF, c128_state, cia1_pb_w), NULL)
+ MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6569_CLOCK, 50, DEVWRITELINE(DEVICE_SELF, c128_state, cia2_irq_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w))
+ MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, c128_state, cia2_pa_r), DEVWRITE8(DEVICE_SELF, c128_state, cia2_pa_w))
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w))
MCFG_QUICKLOAD_ADD("quickload", cbm_c64, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
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)
@@ -1654,7 +1623,9 @@ MACHINE_CONFIG_END
//-------------------------------------------------
static MACHINE_CONFIG_DERIVED( c128pal, pal )
- MCFG_CBM_IEC_ADD(cbm_iec_intf, "c1571")
+ MCFG_CBM_IEC_ADD("c1571")
+ MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(DEVICE_SELF, c128_state, iec_srq_w))
+ MCFG_CBM_IEC_BUS_DATA_CALLBACK(DEVWRITELINE(DEVICE_SELF, c128_state, iec_data_w))
MACHINE_CONFIG_END
@@ -1663,12 +1634,14 @@ MACHINE_CONFIG_END
//-------------------------------------------------
static MACHINE_CONFIG_DERIVED( c128dcrp, pal )
- MCFG_CBM_IEC_BUS_ADD(cbm_iec_intf)
MCFG_CBM_IEC_SLOT_ADD("iec4", 4, cbm_iec_devices, NULL, NULL)
MCFG_CBM_IEC_SLOT_ADD("iec8", 8, c128dcr_iec_devices, "c1571", NULL) // TODO c1571cr
MCFG_CBM_IEC_SLOT_ADD("iec9", 9, cbm_iec_devices, NULL, NULL)
MCFG_CBM_IEC_SLOT_ADD("iec10", 10, cbm_iec_devices, NULL, NULL)
MCFG_CBM_IEC_SLOT_ADD("iec11", 11, cbm_iec_devices, NULL, NULL)
+ MCFG_CBM_IEC_BUS_ADD()
+ MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(DEVICE_SELF, c128_state, iec_srq_w))
+ MCFG_CBM_IEC_BUS_DATA_CALLBACK(DEVWRITELINE(DEVICE_SELF, c128_state, iec_data_w))
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/c64.c b/src/mess/drivers/c64.c
index 225624f60c4..36279a2bca0 100644
--- a/src/mess/drivers/c64.c
+++ b/src/mess/drivers/c64.c
@@ -493,16 +493,6 @@ WRITE_LINE_MEMBER( c64_state::vic_irq_w )
check_interrupts();
}
-static MOS6567_INTERFACE( vic_intf )
-{
- SCREEN_TAG,
- M6510_TAG,
- DEVCB_DRIVER_LINE_MEMBER(c64_state, vic_irq_w),
- DEVCB_NULL, // BA -> 6502 RDY
- DEVCB_NULL, // AEC -> 6502 AEC
- DEVCB_NULL
-};
-
//-------------------------------------------------
// MOS6581_INTERFACE( sid_intf )
@@ -562,12 +552,6 @@ READ8_MEMBER( c64_state::sid_poty_r )
return data;
}
-static MOS6581_INTERFACE( sid_intf )
-{
- DEVCB_DRIVER_MEMBER(c64_state, sid_potx_r),
- DEVCB_DRIVER_MEMBER(c64_state, sid_poty_r)
-};
-
//-------------------------------------------------
// MOS6526_INTERFACE( cia1_intf )
@@ -688,18 +672,6 @@ WRITE8_MEMBER( c64_state::cia1_pb_w )
m_vic->lp_w(BIT(data, 4));
}
-static MOS6526_INTERFACE( cia1_intf )
-{
- DEVCB_DRIVER_LINE_MEMBER(c64_state, cia1_irq_w),
- DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(C64_USER_PORT_TAG, c64_user_port_device, sp1_w),
- DEVCB_DEVICE_LINE_MEMBER(C64_USER_PORT_TAG, c64_user_port_device, cnt1_w),
- DEVCB_DRIVER_MEMBER(c64_state, cia1_pa_r),
- DEVCB_NULL,
- DEVCB_DRIVER_MEMBER(c64_state, cia1_pb_r),
- DEVCB_DRIVER_MEMBER(c64_state, cia1_pb_w)
-};
-
READ8_MEMBER( c64gs_state::cia1_pa_r )
{
/*
@@ -756,18 +728,6 @@ READ8_MEMBER( c64gs_state::cia1_pb_r )
return data;
}
-static MOS6526_INTERFACE( c64gs_cia1_intf )
-{
- DEVCB_DRIVER_LINE_MEMBER(c64_state, cia1_irq_w),
- DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(C64_USER_PORT_TAG, c64_user_port_device, sp1_w),
- DEVCB_DEVICE_LINE_MEMBER(C64_USER_PORT_TAG, c64_user_port_device, cnt1_w),
- DEVCB_DRIVER_MEMBER(c64gs_state, cia1_pa_r),
- DEVCB_NULL,
- DEVCB_DRIVER_MEMBER(c64gs_state, cia1_pb_r),
- DEVCB_DRIVER_MEMBER(c64_state, cia1_pb_w)
-};
-
//-------------------------------------------------
// MOS6526_INTERFACE( cia2_intf )
@@ -839,18 +799,6 @@ WRITE8_MEMBER( c64_state::cia2_pa_w )
m_iec->data_w(!BIT(data, 5));
}
-static MOS6526_INTERFACE( cia2_intf )
-{
- DEVCB_DRIVER_LINE_MEMBER(c64_state, cia2_irq_w),
- DEVCB_DEVICE_LINE_MEMBER(C64_USER_PORT_TAG, c64_user_port_device, pc2_w),
- DEVCB_DEVICE_LINE_MEMBER(C64_USER_PORT_TAG, c64_user_port_device, sp2_w),
- DEVCB_DEVICE_LINE_MEMBER(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w),
- DEVCB_DRIVER_MEMBER(c64_state, cia2_pa_r),
- DEVCB_DRIVER_MEMBER(c64_state, cia2_pa_w),
- DEVCB_DEVICE_MEMBER(C64_USER_PORT_TAG, c64_user_port_device, pb_r),
- DEVCB_DEVICE_MEMBER(C64_USER_PORT_TAG, c64_user_port_device, pb_w)
-};
-
//-------------------------------------------------
// M6510_INTERFACE( cpu_intf )
@@ -995,20 +943,6 @@ WRITE8_MEMBER( c64gs_state::cpu_w )
//-------------------------------------------------
-// CBM_IEC_INTERFACE( iec_intf )
-//-------------------------------------------------
-
-static CBM_IEC_INTERFACE( iec_intf )
-{
- 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,
- DEVCB_NULL
-};
-
-
-//-------------------------------------------------
// C64_EXPANSION_INTERFACE( expansion_intf )
//-------------------------------------------------
@@ -1152,20 +1086,28 @@ static MACHINE_CONFIG_START( ntsc, c64_state )
MCFG_QUANTUM_PERFECT_CPU(M6510_TAG)
// video hardware
- MCFG_MOS6567_ADD(MOS6567_TAG, SCREEN_TAG, VIC6567_CLOCK, vic_intf, vic_videoram_map, vic_colorram_map)
+ MCFG_MOS6567_ADD(MOS6567_TAG, SCREEN_TAG, VIC6567_CLOCK, vic_videoram_map, vic_colorram_map, DEVWRITELINE(DEVICE_SELF, c64_state, vic_irq_w))
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD(MOS6581_TAG, SID6581, VIC6567_CLOCK)
- MCFG_SOUND_CONFIG(sid_intf)
+ MCFG_SOUND_ADD(MOS6581_TAG, MOS6581, VIC6567_CLOCK)
+ MCFG_MOS6581_POTXY_CALLBACKS(DEVREAD8(DEVICE_SELF, c64_state, sid_potx_r), DEVREAD8(DEVICE_SELF, c64_state, sid_poty_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
// devices
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_MOS6526_ADD(MOS6526_1_TAG, VIC6567_CLOCK, 60, DEVWRITELINE(DEVICE_SELF, c64_state, cia1_irq_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt1_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp1_w))
+ MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, c64_state, cia1_pa_r), NULL)
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, c64_state, cia1_pb_r), DEVWRITE8(DEVICE_SELF, c64_state, cia1_pb_w), NULL)
+ MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6567_CLOCK, 60, DEVWRITELINE(DEVICE_SELF, c64_state, cia2_irq_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w))
+ MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, c64_state, cia2_pa_r), DEVWRITE8(DEVICE_SELF, c64_state, cia2_pa_w))
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w))
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_CBM_IEC_ADD("c1541")
+ MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w))
+ MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, atn_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, "joy", NULL)
@@ -1234,8 +1176,8 @@ MACHINE_CONFIG_END
//-------------------------------------------------
static MACHINE_CONFIG_DERIVED_CLASS( ntsc_c, ntsc, c64c_state )
- MCFG_SOUND_REPLACE(MOS6581_TAG, SID8580, VIC6567_CLOCK)
- MCFG_SOUND_CONFIG(sid_intf)
+ MCFG_SOUND_REPLACE(MOS6581_TAG, MOS8580, VIC6567_CLOCK)
+ MCFG_MOS6581_POTXY_CALLBACKS(DEVREAD8(DEVICE_SELF, c64_state, sid_potx_r), DEVREAD8(DEVICE_SELF, c64_state, sid_poty_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MACHINE_CONFIG_END
@@ -1253,20 +1195,28 @@ static MACHINE_CONFIG_START( pal, c64_state )
MCFG_QUANTUM_PERFECT_CPU(M6510_TAG)
// video hardware
- MCFG_MOS6569_ADD(MOS6569_TAG, SCREEN_TAG, VIC6569_CLOCK, vic_intf, vic_videoram_map, vic_colorram_map)
+ MCFG_MOS6569_ADD(MOS6569_TAG, SCREEN_TAG, VIC6569_CLOCK, vic_videoram_map, vic_colorram_map, DEVWRITELINE(DEVICE_SELF, c64_state, vic_irq_w))
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD(MOS6581_TAG, SID6581, VIC6569_CLOCK)
- MCFG_SOUND_CONFIG(sid_intf)
+ MCFG_SOUND_ADD(MOS6581_TAG, MOS6581, VIC6569_CLOCK)
+ MCFG_MOS6581_POTXY_CALLBACKS(DEVREAD8(DEVICE_SELF, c64_state, sid_potx_r), DEVREAD8(DEVICE_SELF, c64_state, sid_poty_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
// devices
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_MOS6526_ADD(MOS6526_1_TAG, VIC6569_CLOCK, 50, DEVWRITELINE(DEVICE_SELF, c64_state, cia1_irq_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt1_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp1_w))
+ MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, c64_state, cia1_pa_r), NULL)
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, c64_state, cia1_pb_r), DEVWRITE8(DEVICE_SELF, c64_state, cia1_pb_w), NULL)
+ MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6569_CLOCK, 50, DEVWRITELINE(DEVICE_SELF, c64_state, cia2_irq_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w))
+ MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, c64_state, cia2_pa_r), DEVWRITE8(DEVICE_SELF, c64_state, cia2_pa_w))
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w))
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_CBM_IEC_ADD("c1541")
+ MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w))
+ MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, atn_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, "joy", NULL)
@@ -1313,8 +1263,8 @@ MACHINE_CONFIG_END
//-------------------------------------------------
static MACHINE_CONFIG_DERIVED_CLASS( pal_c, pal, c64c_state )
- MCFG_SOUND_REPLACE(MOS6581_TAG, SID8580, VIC6569_CLOCK)
- MCFG_SOUND_CONFIG(sid_intf)
+ MCFG_SOUND_REPLACE(MOS6581_TAG, MOS8580, VIC6569_CLOCK)
+ MCFG_MOS6581_POTXY_CALLBACKS(DEVREAD8(DEVICE_SELF, c64_state, sid_potx_r), DEVREAD8(DEVICE_SELF, c64_state, sid_poty_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MACHINE_CONFIG_END
@@ -1332,19 +1282,28 @@ static MACHINE_CONFIG_START( pal_gs, c64gs_state )
MCFG_QUANTUM_PERFECT_CPU(M6510_TAG)
// video hardware
- MCFG_MOS8565_ADD(MOS6569_TAG, SCREEN_TAG, VIC6569_CLOCK, vic_intf, vic_videoram_map, vic_colorram_map)
+ MCFG_MOS8565_ADD(MOS6569_TAG, SCREEN_TAG, VIC6569_CLOCK, vic_videoram_map, vic_colorram_map, DEVWRITELINE(DEVICE_SELF, c64_state, vic_irq_w))
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD(MOS6581_TAG, SID8580, VIC6569_CLOCK)
- MCFG_SOUND_CONFIG(sid_intf)
+ MCFG_SOUND_ADD(MOS6581_TAG, MOS8580, VIC6569_CLOCK)
+ MCFG_MOS6581_POTXY_CALLBACKS(DEVREAD8(DEVICE_SELF, c64_state, sid_potx_r), DEVREAD8(DEVICE_SELF, c64_state, sid_poty_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
// devices
MCFG_PLS100_ADD(PLA_TAG)
- MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6569_CLOCK, 50, c64gs_cia1_intf)
- MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6569_CLOCK, 50, cia2_intf)
- MCFG_CBM_IEC_BUS_ADD(iec_intf)
+ MCFG_MOS6526_ADD(MOS6526_1_TAG, VIC6569_CLOCK, 50, DEVWRITELINE(DEVICE_SELF, c64_state, cia1_irq_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt1_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp1_w))
+ MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, c64gs_state, cia1_pa_r), NULL)
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, c64gs_state, cia1_pb_r), NULL, NULL)
+ MCFG_MOS6526_ADD(MOS6526_2_TAG, VIC6569_CLOCK, 50, DEVWRITELINE(DEVICE_SELF, c64_state, cia2_irq_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, cnt2_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, sp2_w))
+ MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, c64_state, cia2_pa_r), DEVWRITE8(DEVICE_SELF, c64_state, cia2_pa_w))
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(C64_USER_PORT_TAG, c64_user_port_device, pb_r), DEVWRITE8(C64_USER_PORT_TAG, c64_user_port_device, pb_w), DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, pc2_w))
+ MCFG_CBM_IEC_ADD(NULL)
+ MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(MOS6526_1_TAG, mos6526_device, flag_w))
+ MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(C64_USER_PORT_TAG, c64_user_port_device, atn_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, "joy", NULL)
diff --git a/src/mess/drivers/c65.c b/src/mess/drivers/c65.c
index 11be69df720..beea2fa8c3d 100644
--- a/src/mess/drivers/c65.c
+++ b/src/mess/drivers/c65.c
@@ -52,7 +52,7 @@ bus serial (available in all modes), a Fast and a Burst serial bus
#include "emu.h"
#include "cpu/m6502/m4510.h"
-#include "sound/sid6581.h"
+#include "sound/mos6581.h"
#include "machine/6526cia.h"
#include "machine/cbmipt.h"
#include "video/vic4567.h"
@@ -203,28 +203,6 @@ READ8_MEMBER( c65_state::sid_poty_r )
return c64_paddle_read(sid, space, 1);
}
-static MOS6581_INTERFACE( sidr_intf )
-{
- DEVCB_DRIVER_MEMBER(c65_state, sid_potx_r),
- DEVCB_DRIVER_MEMBER(c65_state, sid_poty_r)
-};
-
-static MOS6581_INTERFACE( sidl_intf )
-{
- DEVCB_NULL,
- DEVCB_NULL
-};
-
-
-static CBM_IEC_INTERFACE( cbm_iec_intf )
-{
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL
-};
-
/*************************************
*
@@ -326,12 +304,11 @@ static MACHINE_CONFIG_START( c65, c65_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_SOUND_ADD("sid_r", SID8580, 985248)
- MCFG_SOUND_CONFIG(sidr_intf)
+ MCFG_SOUND_ADD("sid_r", MOS8580, 985248)
+ MCFG_MOS6581_POTXY_CALLBACKS(DEVREAD8(DEVICE_SELF, c65_state, sid_potx_r), DEVREAD8(DEVICE_SELF, c65_state, sid_poty_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
- MCFG_SOUND_ADD("sid_l", SID8580, 985248)
+ MCFG_SOUND_ADD("sid_l", MOS8580, 985248)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
- MCFG_SOUND_CONFIG(sidl_intf)
/* quickload */
MCFG_QUICKLOAD_ADD("quickload", cbm_c65, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
@@ -341,7 +318,7 @@ static MACHINE_CONFIG_START( c65, c65_state )
MCFG_LEGACY_MOS6526R1_ADD("cia_1", 3500000, 60, c65_cia1)
/* floppy from serial bus */
- MCFG_CBM_IEC_ADD(cbm_iec_intf, NULL)
+ MCFG_CBM_IEC_ADD(NULL)
MCFG_FRAGMENT_ADD(c64_cartslot)
@@ -361,11 +338,10 @@ static MACHINE_CONFIG_DERIVED( c65pal, c65 )
MCFG_VIC3_ADD("vic3", c65_vic3_pal_intf)
/* sound hardware */
- MCFG_SOUND_REPLACE("sid_r", SID8580, 1022727)
- MCFG_SOUND_CONFIG(sidr_intf)
+ MCFG_SOUND_REPLACE("sid_r", MOS8580, 1022727)
+ MCFG_MOS6581_POTXY_CALLBACKS(DEVREAD8(DEVICE_SELF, c65_state, sid_potx_r), DEVREAD8(DEVICE_SELF, c65_state, sid_poty_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
- MCFG_SOUND_REPLACE("sid_l", SID8580, 1022727)
- MCFG_SOUND_CONFIG(sidl_intf)
+ MCFG_SOUND_REPLACE("sid_l", MOS8580, 1022727)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
/* cia */
diff --git a/src/mess/drivers/cbm2.c b/src/mess/drivers/cbm2.c
index 676d17b85b3..053d274cfef 100644
--- a/src/mess/drivers/cbm2.c
+++ b/src/mess/drivers/cbm2.c
@@ -1135,16 +1135,6 @@ WRITE_LINE_MEMBER( p500_state::vic_irq_w )
m_maincpu->set_input_line(INPUT_LINE_IRQ0, m_vic_irq || m_tpi1_irq || m_user_irq);
}
-static MOS6567_INTERFACE( vic_intf )
-{
- SCREEN_TAG,
- M6509_TAG,
- DEVCB_DRIVER_LINE_MEMBER(p500_state, vic_irq_w),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL
-};
-
//-------------------------------------------------
// MOS6581_INTERFACE( sid_intf )
@@ -1204,12 +1194,6 @@ READ8_MEMBER( cbm2_state::sid_poty_r )
return data;
}
-static MOS6581_INTERFACE( sid_intf )
-{
- DEVCB_DRIVER_MEMBER(cbm2_state, sid_potx_r),
- DEVCB_DRIVER_MEMBER(cbm2_state, sid_poty_r)
-};
-
//-------------------------------------------------
// tpi6525_interface tpi1_intf
@@ -1649,18 +1633,6 @@ READ8_MEMBER( cbm2_state::cia_pb_r )
return data;
}
-static MOS6526_INTERFACE( cia_intf )
-{
- DEVCB_DEVICE_LINE_MEMBER(MOS6525_1_TAG, tpi6525_device, i2_w),
- DEVCB_DEVICE_LINE_MEMBER(CBM2_USER_PORT_TAG, cbm2_user_port_device, pc_w),
- DEVCB_DEVICE_LINE_MEMBER(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w),
- DEVCB_DEVICE_LINE_MEMBER(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w),
- DEVCB_DRIVER_MEMBER(cbm2_state, cia_pa_r),
- DEVCB_DRIVER_MEMBER(cbm2_state, cia_pa_w),
- DEVCB_DRIVER_MEMBER(cbm2_state, cia_pb_r),
- DEVCB_DEVICE_MEMBER(CBM2_USER_PORT_TAG, cbm2_user_port_device, d2_w)
-};
-
//-------------------------------------------------
// DS75161A_INTERFACE( ds75161a_intf )
@@ -1688,23 +1660,6 @@ static DS75161A_INTERFACE( ds75161a_intf )
//-------------------------------------------------
-// IEEE488_INTERFACE( ieee488_intf )
-//-------------------------------------------------
-
-static IEEE488_INTERFACE( ieee488_intf )
-{
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(MOS6525_1_TAG, tpi6525_device, i1_w),
- DEVCB_NULL,
- DEVCB_NULL
-};
-
-
-//-------------------------------------------------
// pic8259_interface ext_pic_intf
//-------------------------------------------------
@@ -1888,18 +1843,6 @@ WRITE8_MEMBER( cbm2_state::ext_cia_pb_w )
m_ext_pic->ir7_w(BIT(data, 7));
}
-static MOS6526_INTERFACE( ext_cia_intf )
-{
- DEVCB_DEVICE_LINE_MEMBER(MOS6525_1_TAG, tpi6525_device, i3_w),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DEVICE_HANDLER(EXT_MOS6525_TAG, tpi6525_porta_r),
- DEVCB_NULL,
- DEVCB_DRIVER_MEMBER(cbm2_state, ext_cia_pb_r),
- DEVCB_DRIVER_MEMBER(cbm2_state, ext_cia_pb_w)
-};
-
//-------------------------------------------------
// CBM2_USER_PORT_INTERFACE( user_intf )
@@ -2187,12 +2130,12 @@ static MACHINE_CONFIG_START( p500_ntsc, p500_state )
MCFG_QUANTUM_PERFECT_CPU(M6509_TAG)
// video hardware
- MCFG_MOS6567_ADD(MOS6567_TAG, SCREEN_TAG, VIC6567_CLOCK, vic_intf, vic_videoram_map, vic_colorram_map)
+ MCFG_MOS6567_ADD(MOS6567_TAG, SCREEN_TAG, VIC6567_CLOCK, vic_videoram_map, vic_colorram_map, DEVWRITELINE(DEVICE_SELF, p500_state, vic_irq_w))
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD(MOS6851_TAG, SID6581, VIC6567_CLOCK)
- MCFG_SOUND_CONFIG(sid_intf)
+ MCFG_SOUND_ADD(MOS6581_TAG, MOS6581, VIC6567_CLOCK)
+ MCFG_MOS6581_POTXY_CALLBACKS(DEVREAD8(DEVICE_SELF, p500_state, sid_potx_r), DEVREAD8(DEVICE_SELF, p500_state, sid_poty_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
// devices
@@ -2201,10 +2144,14 @@ static MACHINE_CONFIG_START( p500_ntsc, p500_state )
MCFG_TPI6525_ADD(MOS6525_1_TAG, p500_tpi1_intf)
MCFG_TPI6525_ADD(MOS6525_2_TAG, p500_tpi2_intf)
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_MOS6526_ADD(MOS6526_TAG, VIC6567_CLOCK, 60, DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i2_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w))
+ MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, cbm2_state, cia_pa_r), DEVWRITE8(DEVICE_SELF, cbm2_state, cia_pa_w))
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, cbm2_state, cia_pb_r), DEVWRITE8(CBM2_USER_PORT_TAG, cbm2_user_port_device, d2_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, pc_w))
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_CBM_IEEE488_ADD("c8050")
+ MCFG_IEEE488_SRQ_CALLBACK(DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i1_w))
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))
@@ -2239,12 +2186,12 @@ static MACHINE_CONFIG_START( p500_pal, p500_state )
MCFG_QUANTUM_PERFECT_CPU(M6509_TAG)
// video hardware
- MCFG_MOS6569_ADD(MOS6569_TAG, SCREEN_TAG, VIC6569_CLOCK, vic_intf, vic_videoram_map, vic_colorram_map)
+ MCFG_MOS6569_ADD(MOS6569_TAG, SCREEN_TAG, VIC6569_CLOCK, vic_videoram_map, vic_colorram_map, DEVWRITELINE(DEVICE_SELF, p500_state, vic_irq_w))
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD(MOS6851_TAG, SID6581, VIC6569_CLOCK)
- MCFG_SOUND_CONFIG(sid_intf)
+ MCFG_SOUND_ADD(MOS6581_TAG, MOS6581, VIC6569_CLOCK)
+ MCFG_MOS6581_POTXY_CALLBACKS(DEVREAD8(DEVICE_SELF, p500_state, sid_potx_r), DEVREAD8(DEVICE_SELF, p500_state, sid_poty_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
// devices
@@ -2253,10 +2200,14 @@ static MACHINE_CONFIG_START( p500_pal, p500_state )
MCFG_TPI6525_ADD(MOS6525_1_TAG, p500_tpi1_intf)
MCFG_TPI6525_ADD(MOS6525_2_TAG, p500_tpi2_intf)
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_MOS6526_ADD(MOS6526_TAG, VIC6569_CLOCK, 50, DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i2_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w))
+ MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, cbm2_state, cia_pa_r), DEVWRITE8(DEVICE_SELF, cbm2_state, cia_pa_w))
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, cbm2_state, cia_pb_r), DEVWRITE8(CBM2_USER_PORT_TAG, cbm2_user_port_device, d2_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, pc_w))
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_CBM_IEEE488_ADD("c8050")
+ MCFG_IEEE488_SRQ_CALLBACK(DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i1_w))
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))
@@ -2303,8 +2254,8 @@ static MACHINE_CONFIG_START( cbm2lp_ntsc, cbm2_state )
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD(MOS6851_TAG, SID6581, XTAL_18MHz/9)
- MCFG_SOUND_CONFIG(sid_intf)
+ MCFG_SOUND_ADD(MOS6581_TAG, MOS6581, XTAL_18MHz/9)
+ MCFG_MOS6581_POTXY_CALLBACKS(DEVREAD8(DEVICE_SELF, cbm2_state, sid_potx_r), DEVREAD8(DEVICE_SELF, cbm2_state, sid_poty_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
// devices
@@ -2312,10 +2263,14 @@ static MACHINE_CONFIG_START( cbm2lp_ntsc, cbm2_state )
MCFG_TPI6525_ADD(MOS6525_1_TAG, tpi1_intf)
MCFG_TPI6525_ADD(MOS6525_2_TAG, tpi2_intf)
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_MOS6526_ADD(MOS6526_TAG, XTAL_18MHz/9, 60, DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i2_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w))
+ MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, cbm2_state, cia_pa_r), DEVWRITE8(DEVICE_SELF, cbm2_state, cia_pa_w))
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, cbm2_state, cia_pb_r), DEVWRITE8(CBM2_USER_PORT_TAG, cbm2_user_port_device, d2_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, pc_w))
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_CBM_IEEE488_ADD("c8050")
+ MCFG_IEEE488_SRQ_CALLBACK(DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i1_w))
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)
@@ -2358,7 +2313,10 @@ static MACHINE_CONFIG_DERIVED( cbm2lp_pal, cbm2lp_ntsc )
MCFG_MACHINE_START_OVERRIDE(cbm2_state, cbm2_pal)
MCFG_DEVICE_REMOVE(MOS6526_TAG)
- MCFG_MOS6526_ADD(MOS6526_TAG, XTAL_18MHz/9, 50, cia_intf)
+ MCFG_MOS6526_ADD(MOS6526_TAG, VIC6569_CLOCK, 50, DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i2_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w))
+ MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, cbm2_state, cia_pa_r), DEVWRITE8(DEVICE_SELF, cbm2_state, cia_pa_w))
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, cbm2_state, cia_pb_r), DEVWRITE8(CBM2_USER_PORT_TAG, cbm2_user_port_device, d2_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, pc_w))
MACHINE_CONFIG_END
@@ -2421,7 +2379,10 @@ static MACHINE_CONFIG_DERIVED( bx256hp, b256hp )
MCFG_PIC8259_ADD(EXT_I8259A_TAG, ext_pic_intf)
MCFG_TPI6525_ADD(EXT_MOS6525_TAG, ext_tpi_intf)
- MCFG_MOS6526_ADD(EXT_MOS6526_TAG, XTAL_18MHz/9, 50, ext_cia_intf)
+ MCFG_MOS6526_ADD(EXT_MOS6526_TAG, XTAL_18MHz/9, 60, DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i3_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w))
+ //MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(EXT_MOS6525_TAG, tpi6525_porta_r), NULL)
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, cbm2_state, ext_cia_pb_r), DEVWRITE8(DEVICE_SELF, cbm2_state, ext_cia_pb_w), NULL)
MACHINE_CONFIG_END
@@ -2437,7 +2398,10 @@ static MACHINE_CONFIG_DERIVED( cbm2hp_pal, cbm2hp_ntsc )
MCFG_TPI6525_ADD(MOS6525_2_TAG, hp_tpi2_intf)
MCFG_DEVICE_REMOVE(MOS6526_TAG)
- MCFG_MOS6526_ADD(MOS6526_TAG, XTAL_18MHz/9, 50, cia_intf)
+ MCFG_MOS6526_ADD(EXT_MOS6526_TAG, XTAL_18MHz/9, 50, DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i3_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w))
+ //MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(EXT_MOS6525_TAG, tpi6525_porta_r), NULL)
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, cbm2_state, ext_cia_pb_r), DEVWRITE8(DEVICE_SELF, cbm2_state, ext_cia_pb_w), NULL)
MACHINE_CONFIG_END
@@ -2472,7 +2436,10 @@ static MACHINE_CONFIG_DERIVED( cbm730, cbm720 )
MCFG_PIC8259_ADD(EXT_I8259A_TAG, ext_pic_intf)
MCFG_TPI6525_ADD(EXT_MOS6525_TAG, ext_tpi_intf)
- MCFG_MOS6526_ADD(EXT_MOS6526_TAG, XTAL_18MHz/9, 60, ext_cia_intf)
+ MCFG_MOS6526_ADD(EXT_MOS6526_TAG, XTAL_18MHz/9, 50, DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i3_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w))
+ //MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(EXT_MOS6525_TAG, tpi6525_porta_r), NULL)
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, cbm2_state, ext_cia_pb_r), DEVWRITE8(DEVICE_SELF, cbm2_state, ext_cia_pb_w), NULL)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/osborne1.c b/src/mess/drivers/osborne1.c
index d4b1013d366..535a6012b81 100644
--- a/src/mess/drivers/osborne1.c
+++ b/src/mess/drivers/osborne1.c
@@ -212,18 +212,6 @@ static const floppy_interface osborne1_floppy_interface =
NULL
};
-static IEEE488_INTERFACE( ieee488_intf )
-{
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER("pia_0", pia6821_device, ca2_w),
- DEVCB_NULL,
- DEVCB_NULL
-};
-
/* F4 Character Displayer */
static const gfx_layout osborne1_charlayout =
{
@@ -267,7 +255,8 @@ static MACHINE_CONFIG_START( osborne1, osborne1_state )
MCFG_MB8877_ADD("mb8877", default_wd17xx_interface_2_drives )
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(osborne1_floppy_interface)
- MCFG_IEEE488_BUS_ADD(ieee488_intf)
+ MCFG_IEEE488_BUS_ADD()
+ MCFG_IEEE488_SRQ_CALLBACK(DEVWRITELINE("pia_0", pia6821_device, ca2_w))
MCFG_SOFTWARE_LIST_ADD("flop_list","osborne1")
/* internal ram */
diff --git a/src/mess/drivers/pet2001.c b/src/mess/drivers/pet2001.c
index 373141ea7e3..568cb6c4888 100644
--- a/src/mess/drivers/pet2001.c
+++ b/src/mess/drivers/pet2001.c
@@ -864,23 +864,6 @@ const pia6821_interface pia2_intf =
//-------------------------------------------------
-// IEEE488_INTERFACE( ieee488_intf )
-//-------------------------------------------------
-
-static IEEE488_INTERFACE( ieee488_intf )
-{
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(M6520_2_TAG, pia6821_device, cb1_w),
- DEVCB_DEVICE_LINE_MEMBER(M6520_2_TAG, pia6821_device, ca1_w),
- DEVCB_NULL
-};
-
-
-//-------------------------------------------------
// PET_USER_PORT_INTERFACE( user_intf )
//-------------------------------------------------
@@ -1170,7 +1153,9 @@ static MACHINE_CONFIG_START( pet, pet_state )
MCFG_VIA6522_ADD(M6522_TAG, XTAL_8MHz/8, via_intf)
MCFG_PIA6821_ADD(M6520_1_TAG, pia1_intf)
MCFG_PIA6821_ADD(M6520_2_TAG, pia2_intf)
- MCFG_CBM_IEEE488_ADD(ieee488_intf, "c4040")
+ MCFG_CBM_IEEE488_ADD("c4040")
+ MCFG_IEEE488_SRQ_CALLBACK(DEVWRITELINE(M6520_2_TAG, pia6821_device, cb1_w))
+ MCFG_IEEE488_ATN_CALLBACK(DEVWRITELINE(M6520_2_TAG, pia6821_device, ca1_w))
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)
@@ -1447,7 +1432,9 @@ static MACHINE_CONFIG_START( pet80, pet80_state )
MCFG_VIA6522_ADD(M6522_TAG, XTAL_16MHz/16, via_intf)
MCFG_PIA6821_ADD(M6520_1_TAG, pia1_intf)
MCFG_PIA6821_ADD(M6520_2_TAG, pia2_intf)
- MCFG_CBM_IEEE488_ADD(ieee488_intf, "c8050")
+ MCFG_CBM_IEEE488_ADD("c8050")
+ MCFG_IEEE488_SRQ_CALLBACK(DEVWRITELINE(M6520_2_TAG, pia6821_device, cb1_w))
+ MCFG_IEEE488_ATN_CALLBACK(DEVWRITELINE(M6520_2_TAG, pia6821_device, ca1_w))
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)
diff --git a/src/mess/drivers/plus4.c b/src/mess/drivers/plus4.c
index e3d07d8c1b8..34af3e34613 100644
--- a/src/mess/drivers/plus4.c
+++ b/src/mess/drivers/plus4.c
@@ -52,7 +52,7 @@ void plus4_state::check_interrupts()
// MEMORY MANAGEMENT
//**************************************************************************
-void plus4_state::bankswitch(offs_t offset, int phi0, int mux, int ras, int *scs, int *phi2, int *user, int *_6551, int *addr_clk, int *keyport, int *kernal, int *cs0, int *cs1)
+void plus4_state::bankswitch(offs_t offset, int phi0, int mux, int ras, int *scs, int *phi2, int *user, int *_6551, int *addr_clk, int *keyport, int *kernal)
{
UINT16 i = ras << 15 | BA10 << 14 | BA11 << 13 | BA13 << 12 | BA9 << 11 | BA8 << 10 | BA14 << 9 | mux << 8 | BA12 << 7 | BA7 << 6 | BA6 << 5 | BA5 << 4 | BA4 << 3 | BA15 << 2 | phi0 << 1 | 1;
/* UINT8 data = m_pla->read(i);
@@ -118,9 +118,6 @@ void plus4_state::bankswitch(offs_t offset, int phi0, int mux, int ras, int *scs
*addr_clk = F4;
*keyport = F5;
*kernal = F6;
-
- *cs0 = m_ted->cs0_r(offset);
- *cs1 = m_ted->cs1_r(offset);
}
@@ -128,10 +125,10 @@ void plus4_state::bankswitch(offs_t offset, int phi0, int mux, int ras, int *scs
// read_memory -
//-------------------------------------------------
-UINT8 plus4_state::read_memory(address_space &space, offs_t offset, int ba, int scs, int phi2, int user, int _6551, int addr_clk, int keyport, int kernal, int cs0, int cs1)
+UINT8 plus4_state::read_memory(address_space &space, offs_t offset, int ba, int scs, int phi2, int user, int _6551, int addr_clk, int keyport, int kernal)
{
- UINT8 data = m_ted->bus_r();
- int c1l = 1, c1h = 1, c2l = 1, c2h = 1;
+ int cs0 = 1, cs1 = 1, c1l = 1, c1h = 1, c2l = 1, c2h = 1;
+ UINT8 data = m_ted->read(space, offset, cs0, cs1);
//logerror("offset %04x user %u 6551 %u addr_clk %u keyport %u kernal %u cs0 %u cs1 %u\n", offset,user,_6551,addr_clk,keyport,kernal,cs0,cs1);
@@ -222,10 +219,6 @@ UINT8 plus4_state::read_memory(address_space &space, offs_t offset, int ba, int
}
}
}
- else if (offset >= 0xff00 && offset < 0xff20)
- {
- data = m_ted->read(space, offset & 0x1f);
- }
else if (offset < 0xfd00 || offset >= 0xff20)
{
data = m_ram->pointer()[offset & m_ram->mask()];
@@ -242,11 +235,11 @@ UINT8 plus4_state::read_memory(address_space &space, offs_t offset, int ba, int
READ8_MEMBER( plus4_state::read )
{
int phi0 = 1, mux = 0, ras = 0, ba = 1;
- int scs, phi2, user, _6551, addr_clk, keyport, kernal, cs0, cs1;
+ int scs, phi2, user, _6551, addr_clk, keyport, kernal;
- bankswitch(offset, phi0, mux, ras, &scs, &phi2, &user, &_6551, &addr_clk, &keyport, &kernal, &cs0, &cs1);
+ bankswitch(offset, phi0, mux, ras, &scs, &phi2, &user, &_6551, &addr_clk, &keyport, &kernal);
- return read_memory(space, offset, ba, scs, phi2, user, _6551, addr_clk, keyport, kernal, cs0, cs1);
+ return read_memory(space, offset, ba, scs, phi2, user, _6551, addr_clk, keyport, kernal);
}
@@ -256,11 +249,13 @@ READ8_MEMBER( plus4_state::read )
WRITE8_MEMBER( plus4_state::write )
{
- int scs, phi2, user, _6551, addr_clk, keyport, kernal, cs0, cs1;
+ int scs, phi2, user, _6551, addr_clk, keyport, kernal;
int phi0 = 1, mux = 0, ras = 0, ba = 1;
- int c1l = 1, c1h = 1, c2l = 1, c2h = 1;
+ int cs0 = 1, cs1 = 1, c1l = 1, c1h = 1, c2l = 1, c2h = 1;
+
+ bankswitch(offset, phi0, mux, ras, &scs, &phi2, &user, &_6551, &addr_clk, &keyport, &kernal);
- bankswitch(offset, phi0, mux, ras, &scs, &phi2, &user, &_6551, &addr_clk, &keyport, &kernal, &cs0, &cs1);
+ m_ted->write(space, offset, data, cs0, cs1);
//logerror("write offset %04x data %02x user %u 6551 %u addr_clk %u keyport %u kernal %u cs0 %u cs1 %u\n", offset,data,user,_6551,addr_clk,keyport,kernal,cs0,cs1);
@@ -284,18 +279,6 @@ WRITE8_MEMBER( plus4_state::write )
{
m_spi_kb->write(space, 0, data);
}
- else if (offset >= 0xff00 && offset < 0xff20)
- {
- m_ted->write(space, offset & 0x1f, data);
- }
- else if (offset == 0xff3e)
- {
- m_ted->rom_switch_w(1);
- }
- else if (offset == 0xff3f)
- {
- m_ted->rom_switch_w(0);
- }
else if (offset < 0xfd00 || offset >= 0xff20)
{
m_ram->pointer()[offset & m_ram->mask()] = data;
@@ -312,11 +295,11 @@ WRITE8_MEMBER( plus4_state::write )
READ8_MEMBER( plus4_state::ted_videoram_r )
{
int phi0 = 1, mux = 0, ras = 1, ba = 0;
- int scs, phi2, user, _6551, addr_clk, keyport, kernal, cs0, cs1;
+ int scs, phi2, user, _6551, addr_clk, keyport, kernal;
- bankswitch(offset, phi0, mux, ras, &scs, &phi2, &user, &_6551, &addr_clk, &keyport, &kernal, &cs0, &cs1);
+ bankswitch(offset, phi0, mux, ras, &scs, &phi2, &user, &_6551, &addr_clk, &keyport, &kernal);
- return read_memory(space, offset, ba, scs, phi2, user, _6551, addr_clk, keyport, kernal, cs0, cs1);
+ return read_memory(space, offset, ba, scs, phi2, user, _6551, addr_clk, keyport, kernal);
}
@@ -574,16 +557,6 @@ WRITE8_MEMBER( plus4_state::cpu_w )
// ted7360_interface ted_intf
//-------------------------------------------------
-INTERRUPT_GEN_MEMBER(plus4_state::c16_raster_interrupt)
-{
- m_ted->raster_interrupt_gen();
-}
-
-INTERRUPT_GEN_MEMBER(plus4_state::c16_frame_interrupt)
-{
- m_ted->frame_interrupt_gen();
-}
-
WRITE_LINE_MEMBER( plus4_state::ted_irq_w )
{
m_ted_irq = state;
@@ -640,13 +613,6 @@ READ8_MEMBER( plus4_state::ted_k_r )
return data;
}
-static MOS7360_INTERFACE( ted_intf )
-{
- SCREEN_TAG,
- MOS7501_TAG,
- DEVCB_DRIVER_LINE_MEMBER(plus4_state, ted_irq_w),
- DEVCB_DRIVER_MEMBER(plus4_state, ted_k_r)
-};
//-------------------------------------------------
@@ -672,34 +638,6 @@ WRITE_LINE_MEMBER( plus4_state::acia_irq_w )
//-------------------------------------------------
-// CBM_IEC_INTERFACE( iec_intf )
-//-------------------------------------------------
-
-static CBM_IEC_INTERFACE( iec_intf )
-{
- DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(PLUS4_USER_PORT_TAG, plus4_user_port_device, atn_w),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL
-};
-
-
-//-------------------------------------------------
-// CBM_IEC_INTERFACE( c16_iec_intf )
-//-------------------------------------------------
-
-static CBM_IEC_INTERFACE( c16_iec_intf )
-{
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL
-};
-
-
-//-------------------------------------------------
// PLUS4_EXPANSION_INTERFACE( expansion_intf )
//-------------------------------------------------
@@ -799,13 +737,11 @@ static MACHINE_CONFIG_START( ntsc, plus4_state )
MCFG_CPU_PROGRAM_MAP(plus4_mem)
MCFG_M7501_PORT_CALLBACKS(READ8(plus4_state, cpu_r), WRITE8(plus4_state, cpu_w))
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_PERFECT_CPU(MOS7501_TAG)
// video and sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_MOS7360_ADD(MOS7360_TAG, SCREEN_TAG, XTAL_14_31818MHz/4, ted_intf, ted_videoram_map)
+ MCFG_MOS7360_ADD(MOS7360_TAG, SCREEN_TAG, MOS7501_TAG, XTAL_14_31818MHz/4, ted_videoram_map, DEVWRITELINE(DEVICE_SELF, plus4_state, ted_irq_w), DEVREAD8(DEVICE_SELF, plus4_state, ted_k_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
// devices
@@ -814,7 +750,8 @@ static MACHINE_CONFIG_START( ntsc, plus4_state )
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_CBM_IEC_ADD(NULL)
+ MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(PLUS4_USER_PORT_TAG, plus4_user_port_device, atn_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, "joy", NULL)
MCFG_PLUS4_EXPANSION_SLOT_ADD(PLUS4_EXPANSION_SLOT_TAG, XTAL_14_31818MHz/16, expansion_intf, plus4_expansion_cards, "c1551", NULL)
@@ -845,13 +782,11 @@ static MACHINE_CONFIG_START( pal, plus4_state )
MCFG_CPU_PROGRAM_MAP(plus4_mem)
MCFG_M7501_PORT_CALLBACKS(READ8(plus4_state, cpu_r), WRITE8(plus4_state, cpu_w))
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_PERFECT_CPU(MOS7501_TAG)
// video and sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_MOS7360_ADD(MOS7360_TAG, SCREEN_TAG, XTAL_17_73447MHz/5, ted_intf, ted_videoram_map)
+ MCFG_MOS7360_ADD(MOS7360_TAG, SCREEN_TAG, MOS7501_TAG, XTAL_17_73447MHz/5, ted_videoram_map, DEVWRITELINE(DEVICE_SELF, plus4_state, ted_irq_w), DEVREAD8(DEVICE_SELF, plus4_state, ted_k_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
// devices
@@ -860,7 +795,8 @@ static MACHINE_CONFIG_START( pal, plus4_state )
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_CBM_IEC_ADD(NULL)
+ MCFG_CBM_IEC_BUS_ATN_CALLBACK(DEVWRITELINE(PLUS4_USER_PORT_TAG, plus4_user_port_device, atn_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, "joy", NULL)
MCFG_PLUS4_EXPANSION_SLOT_ADD(PLUS4_EXPANSION_SLOT_TAG, XTAL_17_73447MHz/20, expansion_intf, plus4_expansion_cards, "c1551", NULL)
@@ -895,7 +831,7 @@ static MACHINE_CONFIG_DERIVED_CLASS( c16n, ntsc, c16_state )
MCFG_DEVICE_REMOVE(PLUS4_USER_PORT_TAG)
MCFG_DEVICE_MODIFY(CBM_IEC_TAG)
- MCFG_DEVICE_CONFIG(c16_iec_intf)
+ MCFG_CBM_IEC_BUS_ATN_CALLBACK(NULL)
MCFG_DEVICE_MODIFY(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("16K")
@@ -917,7 +853,7 @@ static MACHINE_CONFIG_DERIVED_CLASS( c16p, pal, c16_state )
MCFG_DEVICE_REMOVE(PLUS4_USER_PORT_TAG)
MCFG_DEVICE_MODIFY(CBM_IEC_TAG)
- MCFG_DEVICE_CONFIG(c16_iec_intf)
+ MCFG_CBM_IEC_BUS_ATN_CALLBACK(NULL)
MCFG_DEVICE_MODIFY(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("16K")
diff --git a/src/mess/drivers/primo.c b/src/mess/drivers/primo.c
index 49289e50231..6d49ff5d770 100644
--- a/src/mess/drivers/primo.c
+++ b/src/mess/drivers/primo.c
@@ -248,15 +248,6 @@ static const cassette_interface primo_cassette_interface =
NULL
};
-static CBM_IEC_INTERFACE( cbm_iec_intf )
-{
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL
-};
-
static MACHINE_CONFIG_START( primoa32, primo_state )
/* basic machine hardware */
MCFG_CPU_ADD( "maincpu", Z80, 2500000 )
@@ -290,7 +281,7 @@ static MACHINE_CONFIG_START( primoa32, primo_state )
MCFG_CASSETTE_ADD( CASSETTE_TAG, primo_cassette_interface )
/* floppy from serial bus */
- MCFG_CBM_IEC_ADD(cbm_iec_intf, NULL)
+ MCFG_CBM_IEC_ADD(NULL)
/* cartridge */
MCFG_CARTSLOT_ADD("cart1")
diff --git a/src/mess/drivers/sage2.c b/src/mess/drivers/sage2.c
index a5ac172cbb5..11af9725e91 100644
--- a/src/mess/drivers/sage2.c
+++ b/src/mess/drivers/sage2.c
@@ -507,23 +507,6 @@ static const centronics_interface centronics_intf =
//-------------------------------------------------
-// IEEE488_INTERFACE( ieee488_intf )
-//-------------------------------------------------
-
-static IEEE488_INTERFACE( ieee488_intf )
-{
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL
-};
-
-
-//-------------------------------------------------
// GENERIC_TERMINAL_INTERFACE( terminal_intf )
//-------------------------------------------------
@@ -596,7 +579,7 @@ static MACHINE_CONFIG_START( sage2, sage2_state )
MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, centronics_intf)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", sage2_floppies, "525qd", 0, floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":1", sage2_floppies, "525qd", 0, floppy_image_device::default_floppy_formats)
- MCFG_IEEE488_BUS_ADD(ieee488_intf)
+ MCFG_IEEE488_BUS_ADD()
// internal ram
MCFG_RAM_ADD(RAM_TAG)
diff --git a/src/mess/drivers/tek405x.c b/src/mess/drivers/tek405x.c
index be29fa48699..f9661ac1627 100644
--- a/src/mess/drivers/tek405x.c
+++ b/src/mess/drivers/tek405x.c
@@ -1129,24 +1129,6 @@ static ACIA6850_INTERFACE( acia_intf )
-//-------------------------------------------------
-// IEEE488_INTERFACE( ieee488_intf )
-//-------------------------------------------------
-
-static IEEE488_INTERFACE( ieee488_intf )
-{
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL
-};
-
-
-
//**************************************************************************
// MACHINE INITIALIZATION
//**************************************************************************
@@ -1228,7 +1210,7 @@ static MACHINE_CONFIG_START( tek4051, tek4051_state )
MCFG_PIA6821_ADD(MC6820_GPIB_TAG, gpib_pia_intf)
MCFG_PIA6821_ADD(MC6820_COM_TAG, com_pia_intf)
MCFG_ACIA6850_ADD(MC6850_TAG, acia_intf)
- MCFG_IEEE488_BUS_ADD(ieee488_intf)
+ MCFG_IEEE488_BUS_ADD()
// internal ram
MCFG_RAM_ADD(RAM_TAG)
diff --git a/src/mess/drivers/vic10.c b/src/mess/drivers/vic10.c
index 7101c887dcb..fa4df4a466f 100644
--- a/src/mess/drivers/vic10.c
+++ b/src/mess/drivers/vic10.c
@@ -290,16 +290,6 @@ WRITE_LINE_MEMBER( vic10_state::vic_irq_w )
check_interrupts();
}
-static MOS6566_INTERFACE( vic_intf )
-{
- SCREEN_TAG,
- M6510_TAG,
- DEVCB_DRIVER_LINE_MEMBER(vic10_state, vic_irq_w),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL
-};
-
//-------------------------------------------------
// sid6581_interface sid_intf
@@ -359,12 +349,6 @@ READ8_MEMBER( vic10_state::sid_poty_r )
return data;
}
-static MOS6581_INTERFACE( sid_intf )
-{
- DEVCB_DRIVER_MEMBER(vic10_state, sid_potx_r),
- DEVCB_DRIVER_MEMBER(vic10_state, sid_poty_r)
-};
-
//-------------------------------------------------
// MOS6526_INTERFACE( cia_intf )
@@ -485,18 +469,6 @@ WRITE8_MEMBER( vic10_state::cia_pb_w )
m_vic->lp_w(BIT(data, 4));
}
-static MOS6526_INTERFACE( cia_intf )
-{
- DEVCB_DRIVER_LINE_MEMBER(vic10_state, cia_irq_w),
- DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(VIC10_EXPANSION_SLOT_TAG, vic10_expansion_slot_device, sp_w),
- DEVCB_DEVICE_LINE_MEMBER(VIC10_EXPANSION_SLOT_TAG, vic10_expansion_slot_device, cnt_w),
- DEVCB_DRIVER_MEMBER(vic10_state, cia_pa_r),
- DEVCB_NULL,
- DEVCB_DRIVER_MEMBER(vic10_state, cia_pb_r),
- DEVCB_DRIVER_MEMBER(vic10_state, cia_pb_w)
-};
-
//-------------------------------------------------
// M6510_INTERFACE( cpu_intf )
@@ -636,16 +608,19 @@ static MACHINE_CONFIG_START( vic10, vic10_state )
MCFG_QUANTUM_PERFECT_CPU(M6510_TAG)
// video hardware
- MCFG_MOS6566_ADD(MOS6566_TAG, SCREEN_TAG, VIC6566_CLOCK, vic_intf, vic_videoram_map, vic_colorram_map)
+ MCFG_MOS6566_ADD(MOS6566_TAG, SCREEN_TAG, VIC6566_CLOCK, vic_videoram_map, vic_colorram_map, DEVWRITELINE(DEVICE_SELF, vic10_state, vic_irq_w))
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD(MOS6581_TAG, SID6581, VIC6566_CLOCK)
- MCFG_SOUND_CONFIG(sid_intf)
+ MCFG_SOUND_ADD(MOS6581_TAG, MOS6581, VIC6566_CLOCK)
+ MCFG_MOS6581_POTXY_CALLBACKS(DEVREAD8(DEVICE_SELF, vic10_state, sid_potx_r), DEVREAD8(DEVICE_SELF, vic10_state, sid_poty_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
// devices
- MCFG_MOS6526_ADD(MOS6526_TAG, VIC6566_CLOCK, 60, cia_intf)
+ MCFG_MOS6526_ADD(MOS6526_TAG, VIC6566_CLOCK, 60, DEVWRITELINE(DEVICE_SELF, vic10_state, cia_irq_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(VIC10_EXPANSION_SLOT_TAG, vic10_expansion_slot_device, cnt_w), DEVWRITELINE(VIC10_EXPANSION_SLOT_TAG, vic10_expansion_slot_device, sp_w))
+ MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF, vic10_state, cia_pa_r), NULL)
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, vic10_state, cia_pb_r), DEVWRITE8(DEVICE_SELF, vic10_state, cia_pb_w), 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))
diff --git a/src/mess/drivers/vic20.c b/src/mess/drivers/vic20.c
index b5b34530d5b..42919a530b9 100644
--- a/src/mess/drivers/vic20.c
+++ b/src/mess/drivers/vic20.c
@@ -302,17 +302,6 @@ READ8_MEMBER( vic20_state::vic_videoram_r )
//**************************************************************************
-// VIDEO
-//**************************************************************************
-
-INTERRUPT_GEN_MEMBER(vic20_state::vic20_raster_interrupt)
-{
- m_vic->raster_interrupt_gen();
-}
-
-
-
-//**************************************************************************
// ADDRESS MAPS
//**************************************************************************
@@ -702,32 +691,6 @@ static const via6522_interface via1_intf =
//-------------------------------------------------
-// CBM_IEC_INTERFACE( cbm_iec_intf )
-//-------------------------------------------------
-
-static CBM_IEC_INTERFACE( cbm_iec_intf )
-{
- DEVCB_DEVICE_LINE_MEMBER(M6522_1_TAG, via6522_device, write_cb1),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL
-};
-
-
-//-------------------------------------------------
-// mos6560_interface vic_ntsc_intf
-//-------------------------------------------------
-
-static MOS6560_INTERFACE( vic_intf )
-{
- SCREEN_TAG,
- DEVCB_DEVICE_MEMBER(CONTROL1_TAG, vcs_control_port_device, pot_x_r),
- DEVCB_DEVICE_MEMBER(CONTROL1_TAG, vcs_control_port_device, pot_y_r)
-};
-
-
-//-------------------------------------------------
// VIC20_EXPANSION_INTERFACE( expansion_intf )
//-------------------------------------------------
@@ -813,7 +776,8 @@ static MACHINE_CONFIG_START( vic20, vic20_state )
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, cbm_datassette_devices, "c1530", NULL, DEVWRITELINE(M6522_1_TAG, via6522_device, write_ca1))
- MCFG_CBM_IEC_ADD(cbm_iec_intf, "c1541")
+ MCFG_CBM_IEC_ADD("c1541")
+ MCFG_CBM_IEC_BUS_SRQ_CALLBACK(DEVWRITELINE(M6522_1_TAG, via6522_device, write_cb1))
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)
@@ -836,11 +800,10 @@ static MACHINE_CONFIG_DERIVED( ntsc, vic20 )
// basic machine hardware
MCFG_CPU_ADD(M6502_TAG, M6502, MOS6560_CLOCK)
MCFG_CPU_PROGRAM_MAP(vic20_mem)
- MCFG_CPU_PERIODIC_INT_DRIVER(vic20_state, vic20_raster_interrupt, MOS656X_HRETRACERATE)
// video/sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_MOS6560_ADD(M6560_TAG, SCREEN_TAG, MOS6560_CLOCK, vic_intf, vic_videoram_map, vic_colorram_map)
+ MCFG_MOS6560_ADD(M6560_TAG, SCREEN_TAG, MOS6560_CLOCK, vic_videoram_map, vic_colorram_map, DEVREAD8(CONTROL1_TAG, vcs_control_port_device, pot_x_r), DEVREAD8(CONTROL1_TAG, vcs_control_port_device, pot_y_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
// devices
@@ -863,11 +826,10 @@ static MACHINE_CONFIG_DERIVED( pal, vic20 )
// basic machine hardware
MCFG_CPU_ADD(M6502_TAG, M6502, MOS6561_CLOCK)
MCFG_CPU_PROGRAM_MAP(vic20_mem)
- MCFG_CPU_PERIODIC_INT_DRIVER(vic20_state, vic20_raster_interrupt, MOS656X_HRETRACERATE)
// video/sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_MOS6561_ADD(M6560_TAG, SCREEN_TAG, MOS6561_CLOCK, vic_intf, vic_videoram_map, vic_colorram_map)
+ MCFG_MOS6561_ADD(M6560_TAG, SCREEN_TAG, MOS6561_CLOCK, vic_videoram_map, vic_colorram_map, DEVREAD8(CONTROL1_TAG, vcs_control_port_device, pot_x_r), DEVREAD8(CONTROL1_TAG, vcs_control_port_device, pot_y_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
// devices
diff --git a/src/mess/drivers/victor9k.c b/src/mess/drivers/victor9k.c
index 47ff55ec66f..403e4103212 100644
--- a/src/mess/drivers/victor9k.c
+++ b/src/mess/drivers/victor9k.c
@@ -884,20 +884,6 @@ static VICTOR9K_KEYBOARD_INTERFACE( kb_intf )
DEVCB_DRIVER_LINE_MEMBER(victor9k_state, kbrdy_w)
};
-// IEEE-488 Interface
-
-static IEEE488_INTERFACE( ieee488_intf )
-{
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(M6522_1_TAG, via6522_device, write_ca1),
- DEVCB_DEVICE_LINE_MEMBER(M6522_1_TAG, via6522_device, write_ca2),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL
-};
-
static SLOT_INTERFACE_START( victor9k_floppies )
SLOT_INTERFACE( "525qd", FLOPPY_525_QD )
SLOT_INTERFACE_END
@@ -948,7 +934,9 @@ static MACHINE_CONFIG_START( victor9k, victor9k_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
// devices
- MCFG_IEEE488_BUS_ADD(ieee488_intf)
+ MCFG_IEEE488_BUS_ADD()
+ MCFG_IEEE488_NRFD_CALLBACK(DEVWRITELINE(M6522_1_TAG, via6522_device, write_ca1))
+ MCFG_IEEE488_NDAC_CALLBACK(DEVWRITELINE(M6522_1_TAG, via6522_device, write_ca2))
MCFG_PIC8259_ADD(I8259A_TAG, pic_intf)
MCFG_PIT8253_ADD(I8253_TAG, pit_intf)
MCFG_UPD7201_ADD(UPD7201_TAG, XTAL_30MHz/30, mpsc_intf)
diff --git a/src/mess/drivers/vixen.c b/src/mess/drivers/vixen.c
index c40d6a991ac..cc2634f3cc8 100644
--- a/src/mess/drivers/vixen.c
+++ b/src/mess/drivers/vixen.c
@@ -698,18 +698,6 @@ WRITE_LINE_MEMBER( vixen_state::atn_w )
update_interrupt();
}
-static IEEE488_INTERFACE( ieee488_intf )
-{
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_LINE_MEMBER(vixen_state, srq_w),
- DEVCB_DRIVER_LINE_MEMBER(vixen_state, atn_w),
- DEVCB_NULL
-};
-
static SLOT_INTERFACE_START( vixen_floppies )
SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
SLOT_INTERFACE_END
@@ -831,7 +819,9 @@ static MACHINE_CONFIG_START( vixen, vixen_state )
MCFG_FD1797x_ADD(FDC1797_TAG, XTAL_23_9616MHz/24)
MCFG_FLOPPY_DRIVE_ADD(FDC1797_TAG":0", vixen_floppies, "525dd", NULL, floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(FDC1797_TAG":1", vixen_floppies, "525dd", NULL, floppy_image_device::default_floppy_formats)
- MCFG_IEEE488_BUS_ADD(ieee488_intf)
+ MCFG_IEEE488_BUS_ADD()
+ MCFG_IEEE488_SRQ_CALLBACK(DEVWRITELINE(DEVICE_SELF, vixen_state, srq_w))
+ MCFG_IEEE488_ATN_CALLBACK(DEVWRITELINE(DEVICE_SELF, vixen_state, atn_w))
/* software lists */
MCFG_SOFTWARE_LIST_ADD("disk_list", "vixen")
diff --git a/src/mess/includes/c128.h b/src/mess/includes/c128.h
index bcc632205f7..bdaebb7380a 100644
--- a/src/mess/includes/c128.h
+++ b/src/mess/includes/c128.h
@@ -18,7 +18,7 @@
#include "machine/ram.h"
#include "machine/vcsctrl.h"
#include "sound/dac.h"
-#include "sound/sid6581.h"
+#include "sound/mos6581.h"
#include "video/mos6566.h"
#define Z80A_TAG "u10"
@@ -105,7 +105,7 @@ public:
required_device<mos8721_device> m_pla;
required_device<mos8563_device> m_vdc;
required_device<mos6566_device> m_vic;
- required_device<sid6581_device> m_sid;
+ required_device<mos6581_device> m_sid;
required_device<mos6526_device> m_cia1;
required_device<mos6526_device> m_cia2;
required_device<cbm_iec_device> m_iec;
diff --git a/src/mess/includes/c64.h b/src/mess/includes/c64.h
index aaab110519d..5386d6a0408 100644
--- a/src/mess/includes/c64.h
+++ b/src/mess/includes/c64.h
@@ -16,7 +16,7 @@
#include "machine/ram.h"
#include "machine/vcsctrl.h"
#include "sound/dac.h"
-#include "sound/sid6581.h"
+#include "sound/mos6581.h"
#include "video/mos6566.h"
#define M6510_TAG "u7"
@@ -77,7 +77,7 @@ public:
required_device<m6510_device> m_maincpu;
required_device<pls100_device> m_pla;
required_device<mos6566_device> m_vic;
- required_device<sid6581_device> m_sid;
+ required_device<mos6581_device> m_sid;
required_device<mos6526_device> m_cia1;
required_device<mos6526_device> m_cia2;
optional_device<cbm_iec_device> m_iec;
diff --git a/src/mess/includes/cbm2.h b/src/mess/includes/cbm2.h
index 7fbda2bfa54..954ab8decc1 100644
--- a/src/mess/includes/cbm2.h
+++ b/src/mess/includes/cbm2.h
@@ -24,7 +24,7 @@
#include "machine/serial.h"
#include "machine/vcsctrl.h"
#include "sound/dac.h"
-#include "sound/sid6581.h"
+#include "sound/mos6581.h"
#include "video/mc6845.h"
#include "video/mos6566.h"
@@ -34,7 +34,7 @@
#define MOS6567_TAG "u23"
#define MOS6569_TAG "u23"
#define MC68B45_TAG "u10"
-#define MOS6851_TAG "u4"
+#define MOS6581_TAG "u4"
#define MOS6525_1_TAG "u20"
#define MOS6525_2_TAG "u102"
#define MOS6551A_TAG "u19"
@@ -60,7 +60,7 @@ public:
m_maincpu(*this, M6509_TAG),
m_pla1(*this, PLA1_TAG),
m_crtc(*this, MC68B45_TAG),
- m_sid(*this, MOS6851_TAG),
+ m_sid(*this, MOS6581_TAG),
m_tpi1(*this, MOS6525_1_TAG),
m_tpi2(*this, MOS6525_2_TAG),
m_acia(*this, MOS6551A_TAG),
@@ -115,7 +115,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<pls100_device> m_pla1;
optional_device<mc6845_device> m_crtc;
- required_device<sid6581_device> m_sid;
+ required_device<mos6581_device> m_sid;
required_device<tpi6525_device> m_tpi1;
required_device<tpi6525_device> m_tpi2;
required_device<mos6551_device> m_acia;
diff --git a/src/mess/includes/plus4.h b/src/mess/includes/plus4.h
index d496904fa98..d9c025b6c1f 100644
--- a/src/mess/includes/plus4.h
+++ b/src/mess/includes/plus4.h
@@ -4,7 +4,6 @@
#define __PLUS4__
#include "emu.h"
-#include "audio/mos7360.h"
#include "cpu/m6502/m7501.h"
#include "formats/cbm_snqk.h"
#include "machine/cbmiec.h"
@@ -17,6 +16,7 @@
#include "machine/plus4exp.h"
#include "machine/plus4user.h"
#include "machine/ram.h"
+#include "sound/mos7360.h"
#include "sound/t6721a.h"
#define MOS7501_TAG "u2"
@@ -99,8 +99,8 @@ public:
virtual void machine_reset();
void check_interrupts();
- void bankswitch(offs_t offset, int phi0, int mux, int ras, int *scs, int *phi2, int *user, int *_6551, int *addr_clk, int *keyport, int *kernal, int *cs0, int *cs1);
- UINT8 read_memory(address_space &space, offs_t offset, int ba, int scs, int phi2, int user, int _6551, int addr_clk, int keyport, int kernal, int cs0, int cs1);
+ void bankswitch(offs_t offset, int phi0, int mux, int ras, int *scs, int *phi2, int *user, int *_6551, int *addr_clk, int *keyport, int *kernal);
+ UINT8 read_memory(address_space &space, offs_t offset, int ba, int scs, int phi2, int user, int _6551, int addr_clk, int keyport, int kernal);
UINT8 read_keyboard(UINT8 databus);
DECLARE_READ8_MEMBER( read );
@@ -149,9 +149,6 @@ public:
// keyboard state
UINT8 m_kb;
-
- INTERRUPT_GEN_MEMBER(c16_raster_interrupt);
- INTERRUPT_GEN_MEMBER(c16_frame_interrupt);
};
diff --git a/src/mess/includes/vic10.h b/src/mess/includes/vic10.h
index eadad6f88f4..27db1534f71 100644
--- a/src/mess/includes/vic10.h
+++ b/src/mess/includes/vic10.h
@@ -11,7 +11,7 @@
#include "machine/ram.h"
#include "machine/vcsctrl.h"
#include "sound/dac.h"
-#include "sound/sid6581.h"
+#include "sound/mos6581.h"
#include "video/mos6566.h"
#define M6510_TAG "u3"
@@ -55,7 +55,7 @@ public:
required_device<m6510_device> m_maincpu;
required_device<mos6566_device> m_vic;
- required_device<sid6581_device> m_sid;
+ required_device<mos6581_device> m_sid;
required_device<mos6526_device> m_cia;
required_device<vcs_control_port_device> m_joy1;
required_device<vcs_control_port_device> m_joy2;
diff --git a/src/mess/includes/vic20.h b/src/mess/includes/vic20.h
index 698504af307..877c94e7a0c 100644
--- a/src/mess/includes/vic20.h
+++ b/src/mess/includes/vic20.h
@@ -113,7 +113,6 @@ public:
// keyboard state
int m_key_col;
- INTERRUPT_GEN_MEMBER(vic20_raster_interrupt);
};
#endif
diff --git a/src/mess/machine/c1571.c b/src/mess/machine/c1571.c
index afeb3793f36..293b3ea2460 100644
--- a/src/mess/machine/c1571.c
+++ b/src/mess/machine/c1571.c
@@ -67,7 +67,7 @@ const device_type MINI_CHIEF = &device_creator<mini_chief_device>;
// complete
//-------------------------------------------------
-void base_c1571_device::device_config_complete()
+void c1571_device::device_config_complete()
{
switch (m_variant)
{
@@ -148,7 +148,7 @@ ROM_END
// rom_region - device-specific ROM region
//-------------------------------------------------
-const rom_entry *base_c1571_device::device_rom_region() const
+const rom_entry *c1571_device::device_rom_region() const
{
switch (m_variant)
{
@@ -172,7 +172,7 @@ const rom_entry *base_c1571_device::device_rom_region() const
// ADDRESS_MAP( c1571_mem )
//-------------------------------------------------
-static ADDRESS_MAP_START( c1571_mem, AS_PROGRAM, 8, base_c1571_device )
+static ADDRESS_MAP_START( c1571_mem, AS_PROGRAM, 8, c1571_device )
AM_RANGE(0x0000, 0x07ff) AM_RAM
AM_RANGE(0x1800, 0x180f) AM_MIRROR(0x03f0) AM_DEVREADWRITE(M6522_0_TAG, via6522_device, read, write)
AM_RANGE(0x1c00, 0x1c0f) AM_MIRROR(0x03f0) AM_READWRITE(via1_r, via1_w)
@@ -202,14 +202,14 @@ ADDRESS_MAP_END
// via6522_interface via0_intf
//-------------------------------------------------
-WRITE_LINE_MEMBER( base_c1571_device::via0_irq_w )
+WRITE_LINE_MEMBER( c1571_device::via0_irq_w )
{
m_via0_irq = state;
m_maincpu->set_input_line(INPUT_LINE_IRQ0, (m_via0_irq || m_via1_irq || m_cia_irq) ? ASSERT_LINE : CLEAR_LINE);
}
-READ8_MEMBER( base_c1571_device::via0_pa_r )
+READ8_MEMBER( c1571_device::via0_pa_r )
{
/*
@@ -237,7 +237,7 @@ READ8_MEMBER( base_c1571_device::via0_pa_r )
return data;
}
-WRITE8_MEMBER( base_c1571_device::via0_pa_w )
+WRITE8_MEMBER( c1571_device::via0_pa_w )
{
/*
@@ -319,7 +319,7 @@ WRITE8_MEMBER( c1571cr_device::via0_pa_w )
}
}
-READ8_MEMBER( base_c1571_device::via0_pb_r )
+READ8_MEMBER( c1571_device::via0_pb_r )
{
/*
@@ -353,7 +353,7 @@ READ8_MEMBER( base_c1571_device::via0_pb_r )
return data;
}
-WRITE8_MEMBER( base_c1571_device::via0_pb_w )
+WRITE8_MEMBER( c1571_device::via0_pb_w )
{
/*
@@ -411,42 +411,42 @@ WRITE8_MEMBER( c1571cr_device::via0_pb_w )
update_iec();
}
-READ_LINE_MEMBER( base_c1571_device::atn_in_r )
+READ_LINE_MEMBER( c1571_device::atn_in_r )
{
return !m_bus->atn_r();
}
-READ_LINE_MEMBER( base_c1571_device::wprt_r )
+READ_LINE_MEMBER( c1571_device::wprt_r )
{
return !floppy_wpt_r(m_image);
}
static const via6522_interface via0_intf =
{
- DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, via0_pa_r),
- DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, via0_pb_r),
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, atn_in_r),
+ DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c1571_device, via0_pa_r),
+ DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c1571_device, via0_pb_r),
+ DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c1571_device, atn_in_r),
DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, wprt_r),
+ DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c1571_device, wprt_r),
DEVCB_NULL,
- DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, via0_pa_w),
- DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, via0_pb_w),
+ DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c1571_device, via0_pa_w),
+ DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c1571_device, via0_pb_w),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, via0_irq_w)
+ DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c1571_device, via0_irq_w)
};
static const via6522_interface c1571cr_via0_intf =
{
- DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, via0_pa_r),
- DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, via0_pb_r),
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, atn_in_r),
+ DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c1571_device, via0_pa_r),
+ DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c1571_device, via0_pb_r),
+ DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c1571_device, atn_in_r),
DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, wprt_r),
+ DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c1571_device, wprt_r),
DEVCB_NULL,
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c1571cr_device, via0_pa_w),
@@ -456,7 +456,7 @@ static const via6522_interface c1571cr_via0_intf =
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, via0_irq_w)
+ DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c1571_device, via0_irq_w)
};
@@ -464,7 +464,7 @@ static const via6522_interface c1571cr_via0_intf =
// via6522_interface via1_intf
//-------------------------------------------------
-READ8_MEMBER( base_c1571_device::via1_r )
+READ8_MEMBER( c1571_device::via1_r )
{
UINT8 data = m_via1->read(space, offset);
@@ -474,7 +474,7 @@ READ8_MEMBER( base_c1571_device::via1_r )
return data;
}
-WRITE8_MEMBER( base_c1571_device::via1_w )
+WRITE8_MEMBER( c1571_device::via1_w )
{
m_via1->write(space, offset, data);
@@ -482,14 +482,14 @@ WRITE8_MEMBER( base_c1571_device::via1_w )
m_ga->ted_w(1);
}
-WRITE_LINE_MEMBER( base_c1571_device::via1_irq_w )
+WRITE_LINE_MEMBER( c1571_device::via1_irq_w )
{
m_via1_irq = state;
m_maincpu->set_input_line(INPUT_LINE_IRQ0, (m_via0_irq || m_via1_irq || m_cia_irq) ? ASSERT_LINE : CLEAR_LINE);
}
-READ8_MEMBER( base_c1571_device::via1_pb_r )
+READ8_MEMBER( c1571_device::via1_pb_r )
{
/*
@@ -517,7 +517,7 @@ READ8_MEMBER( base_c1571_device::via1_pb_r )
return data;
}
-WRITE8_MEMBER( base_c1571_device::via1_pb_w )
+WRITE8_MEMBER( c1571_device::via1_pb_w )
{
/*
@@ -550,20 +550,20 @@ WRITE8_MEMBER( base_c1571_device::via1_pb_w )
static const via6522_interface via1_intf =
{
DEVCB_DEVICE_MEMBER(C64H156_TAG, c64h156_device, yb_r),
- DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, via1_pb_r),
+ DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c1571_device, via1_pb_r),
DEVCB_DEVICE_LINE_MEMBER(C64H156_TAG, c64h156_device, byte_r),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_DEVICE_MEMBER(C64H156_TAG, c64h156_device, yb_w),
- DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, via1_pb_w),
+ DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c1571_device, via1_pb_w),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_DEVICE_LINE_MEMBER(C64H156_TAG, c64h156_device, soe_w),
DEVCB_DEVICE_LINE_MEMBER(C64H156_TAG, c64h156_device, oe_w),
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, via1_irq_w)
+ DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c1571_device, via1_irq_w)
};
@@ -571,14 +571,14 @@ static const via6522_interface via1_intf =
// MOS6526_INTERFACE( cia_intf )
//-------------------------------------------------
-WRITE_LINE_MEMBER( base_c1571_device::cia_irq_w )
+WRITE_LINE_MEMBER( c1571_device::cia_irq_w )
{
m_cia_irq = state;
m_maincpu->set_input_line(INPUT_LINE_IRQ0, (m_via0_irq || m_via1_irq || m_cia_irq) ? ASSERT_LINE : CLEAR_LINE);
}
-WRITE_LINE_MEMBER( base_c1571_device::cia_pc_w )
+WRITE_LINE_MEMBER( c1571_device::cia_pc_w )
{
if (m_other != NULL)
{
@@ -586,24 +586,24 @@ WRITE_LINE_MEMBER( base_c1571_device::cia_pc_w )
}
}
-WRITE_LINE_MEMBER( base_c1571_device::cia_cnt_w )
+WRITE_LINE_MEMBER( c1571_device::cia_cnt_w )
{
m_cnt_out = state;
update_iec();
}
-WRITE_LINE_MEMBER( base_c1571_device::cia_sp_w )
+WRITE_LINE_MEMBER( c1571_device::cia_sp_w )
{
m_sp_out = state;
update_iec();
}
-READ8_MEMBER( base_c1571_device::cia_pb_r )
+READ8_MEMBER( c1571_device::cia_pb_r )
{
return m_parallel_data;
}
-WRITE8_MEMBER( base_c1571_device::cia_pb_w )
+WRITE8_MEMBER( c1571_device::cia_pb_w )
{
if (m_other != NULL)
{
@@ -611,17 +611,6 @@ WRITE8_MEMBER( base_c1571_device::cia_pb_w )
}
}
-static MOS6526_INTERFACE( cia_intf )
-{
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, cia_irq_w),
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, cia_pc_w),
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, cia_cnt_w),
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, cia_sp_w),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, cia_pb_r),
- DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, cia_pb_w)
-};
//-------------------------------------------------
// MOS6526_INTERFACE( mini_chief_cia_intf )
@@ -657,24 +646,12 @@ WRITE8_MEMBER( mini_chief_device::cia_pb_w )
*/
}
-static MOS6526_INTERFACE( mini_chief_cia_intf )
-{
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, cia_irq_w),
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, cia_pc_w),
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, cia_cnt_w),
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, cia_sp_w),
- DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, mini_chief_device, cia_pa_r),
- DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, mini_chief_device, cia_pa_w),
- DEVCB_NULL,
- DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, mini_chief_device, cia_pb_w)
-};
-
//-------------------------------------------------
// C64H156_INTERFACE( ga_intf )
//-------------------------------------------------
-WRITE_LINE_MEMBER( base_c1571_device::byte_w )
+WRITE_LINE_MEMBER( c1571_device::byte_w )
{
m_via1->write_ca1(state);
m_maincpu->set_input_line(M6502_SET_OVERFLOW, state);
@@ -684,7 +661,7 @@ static C64H156_INTERFACE( ga_intf )
{
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, byte_w)
+ DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c1571_device, byte_w)
};
@@ -721,7 +698,7 @@ LEGACY_FLOPPY_OPTIONS_END
// floppy_interface c1571_floppy_interface
//-------------------------------------------------
-WRITE_LINE_MEMBER( base_c1571_device::wpt_w )
+WRITE_LINE_MEMBER( c1571_device::wpt_w )
{
m_via0->write_ca2(!state);
}
@@ -731,7 +708,7 @@ static const floppy_interface c1571_floppy_interface =
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, wpt_w),
+ DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c1571_device, wpt_w),
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSDD,
LEGACY_FLOPPY_OPTIONS_NAME(c1571),
@@ -749,7 +726,7 @@ static const floppy_interface c1570_floppy_interface =
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1571_device, wpt_w),
+ DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c1571_device, wpt_w),
DEVCB_NULL,
FLOPPY_STANDARD_5_25_SSDD,
LEGACY_FLOPPY_OPTIONS_NAME(c1541),
@@ -794,11 +771,13 @@ static MACHINE_CONFIG_FRAGMENT( c1570 )
MCFG_VIA6522_ADD(M6522_0_TAG, XTAL_16MHz/16, via0_intf)
MCFG_VIA6522_ADD(M6522_1_TAG, XTAL_16MHz/16, via1_intf)
- MCFG_MOS6526_ADD(M6526_TAG, XTAL_16MHz/16, 0, cia_intf)
+ MCFG_MOS6526_ADD(M6526_TAG, XTAL_16MHz/16, 0, DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_irq_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_cnt_w), DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_sp_w))
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF_OWNER, c1571_device, cia_pb_r), DEVWRITE8(DEVICE_SELF_OWNER, c1571_device, cia_pb_w), DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_pc_w))
MCFG_WD1770x_ADD(WD1770_TAG, XTAL_16MHz/2)
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, c1570_floppy_interface)
- //MCFG_FLOPPY_DRIVE_ADD(WD1770_TAG":0", c1570_floppies, "525ssdd", 0, base_c1571_device::floppy_formats)
+ //MCFG_FLOPPY_DRIVE_ADD(WD1770_TAG":0", c1570_floppies, "525ssdd", 0, c1571_device::floppy_formats)
MCFG_64H156_ADD(C64H156_TAG, XTAL_16MHz, ga_intf)
MACHINE_CONFIG_END
@@ -814,11 +793,15 @@ static MACHINE_CONFIG_FRAGMENT( c1571 )
MCFG_VIA6522_ADD(M6522_0_TAG, XTAL_16MHz/16, via0_intf)
MCFG_VIA6522_ADD(M6522_1_TAG, XTAL_16MHz/16, via1_intf)
- MCFG_MOS6526_ADD(M6526_TAG, XTAL_16MHz/16, 0, cia_intf)
+
+ MCFG_MOS6526_ADD(M6526_TAG, XTAL_16MHz/16, 0, DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_irq_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_cnt_w), DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_sp_w))
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF_OWNER, c1571_device, cia_pb_r), DEVWRITE8(DEVICE_SELF_OWNER, c1571_device, cia_pb_w), DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_pc_w))
+
MCFG_WD1770x_ADD(WD1770_TAG, XTAL_16MHz/2)
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, c1571_floppy_interface)
- //MCFG_FLOPPY_DRIVE_ADD(WD1770_TAG":0", c1571_floppies, "525dd", 0, base_c1571_device::floppy_formats)
+ //MCFG_FLOPPY_DRIVE_ADD(WD1770_TAG":0", c1571_floppies, "525dd", 0, c1571_device::floppy_formats)
MCFG_64H156_ADD(C64H156_TAG, XTAL_16MHz, ga_intf)
MACHINE_CONFIG_END
@@ -834,11 +817,13 @@ static MACHINE_CONFIG_FRAGMENT( c1571cr )
MCFG_VIA6522_ADD(M6522_0_TAG, XTAL_16MHz/16, c1571cr_via0_intf)
MCFG_VIA6522_ADD(M6522_1_TAG, XTAL_16MHz/16, via1_intf)
- MCFG_MOS5710_ADD(M5710_TAG, XTAL_16MHz/16, 0, cia_intf)
+
+ //MCFG_MOS5710_ADD(M5710_TAG, XTAL_16MHz/16, 0)
+
MCFG_WD1770x_ADD(WD1770_TAG, XTAL_16MHz/2)
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, c1571_floppy_interface)
- //MCFG_FLOPPY_DRIVE_ADD(WD1770_TAG":0", c1571_floppies, "525dd", 0, base_c1571_device::floppy_formats)
+ //MCFG_FLOPPY_DRIVE_ADD(WD1770_TAG":0", c1571_floppies, "525dd", 0, c1571_device::floppy_formats)
MCFG_64H156_ADD(C64H156_TAG, XTAL_16MHz, ga_intf)
MACHINE_CONFIG_END
@@ -854,11 +839,16 @@ static MACHINE_CONFIG_FRAGMENT( mini_chief )
MCFG_VIA6522_ADD(M6522_0_TAG, XTAL_16MHz/16, via0_intf)
MCFG_VIA6522_ADD(M6522_1_TAG, XTAL_16MHz/16, via1_intf)
- MCFG_MOS6526_ADD(M6526_TAG, XTAL_16MHz/16, 0, mini_chief_cia_intf)
+
+ MCFG_MOS6526_ADD(M6526_TAG, XTAL_16MHz/16, 0, DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_irq_w))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_cnt_w), DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_sp_w))
+ MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF_OWNER, mini_chief_device, cia_pa_r), DEVWRITE8(DEVICE_SELF_OWNER, mini_chief_device, cia_pa_w))
+ MCFG_MOS6526_PORT_B_CALLBACKS(NULL, DEVWRITE8(DEVICE_SELF_OWNER, c1571_device, cia_pb_w), DEVWRITELINE(DEVICE_SELF_OWNER, c1571_device, cia_pc_w))
+
MCFG_WD1770x_ADD(WD1770_TAG, XTAL_16MHz/2)
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, c1571_floppy_interface)
- //MCFG_FLOPPY_DRIVE_ADD(WD1770_TAG":0", c1571_floppies, "525dd", 0, base_c1571_device::floppy_formats)
+ //MCFG_FLOPPY_DRIVE_ADD(WD1770_TAG":0", c1571_floppies, "525dd", 0, c1571_device::floppy_formats)
MCFG_64H156_ADD(C64H156_TAG, XTAL_16MHz, ga_intf)
MCFG_ISA8_BUS_ADD(ISA_BUS_TAG, M6502_TAG, isabus_intf)
@@ -871,7 +861,7 @@ MACHINE_CONFIG_END
// machine configurations
//-------------------------------------------------
-machine_config_constructor base_c1571_device::device_mconfig_additions() const
+machine_config_constructor c1571_device::device_mconfig_additions() const
{
switch (m_variant)
{
@@ -897,10 +887,10 @@ machine_config_constructor base_c1571_device::device_mconfig_additions() const
//**************************************************************************
//-------------------------------------------------
-// base_c1571_device - constructor
+// c1571_device - constructor
//-------------------------------------------------
-base_c1571_device::base_c1571_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant)
+c1571_device::c1571_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant)
: device_t(mconfig, type, name, tag, owner, clock),
device_cbm_iec_interface(mconfig, *this),
device_c64_floppy_parallel_interface(mconfig, *this),
@@ -923,25 +913,38 @@ base_c1571_device::base_c1571_device(const machine_config &mconfig, device_type
{
}
-
-//-------------------------------------------------
-// c1570_device - constructor
-//-------------------------------------------------
-
-c1570_device::c1570_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : base_c1571_device(mconfig, C1570, "C1570", tag, owner, clock, TYPE_1570)
- //m_floppy(*this, WD1770_TAG":0:525ssdd")
+c1571_device::c1571_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, C1571, "C1571", tag, owner, clock),
+ device_cbm_iec_interface(mconfig, *this),
+ device_c64_floppy_parallel_interface(mconfig, *this),
+ m_maincpu(*this, M6502_TAG),
+ m_via0(*this, M6522_0_TAG),
+ m_via1(*this, M6522_1_TAG),
+ m_cia(*this, M6526_TAG),
+ m_fdc(*this, WD1770_TAG),
+ m_ga(*this, C64H156_TAG),
+ m_image(*this, FLOPPY_0),
+ m_1_2mhz(0),
+ m_data_out(1),
+ m_ser_dir(0),
+ m_sp_out(1),
+ m_cnt_out(1),
+ m_via0_irq(CLEAR_LINE),
+ m_via1_irq(CLEAR_LINE),
+ m_cia_irq(CLEAR_LINE),
+ m_variant(TYPE_1571)
+ //m_floppy(*this, WD1770_TAG":0:525dd")
{
}
//-------------------------------------------------
-// c1571_device - constructor
+// c1570_device - constructor
//-------------------------------------------------
-c1571_device::c1571_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : base_c1571_device(mconfig, C1571, "C1571", tag, owner, clock, TYPE_1571)
- //m_floppy(*this, WD1770_TAG":0:525dd")
+c1570_device::c1570_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : c1571_device(mconfig, C1570, "C1570", tag, owner, clock, TYPE_1570)
+ //m_floppy(*this, WD1770_TAG":0:525ssdd")
{
}
@@ -951,7 +954,7 @@ c1571_device::c1571_device(const machine_config &mconfig, const char *tag, devic
//-------------------------------------------------
c1571cr_device::c1571cr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : base_c1571_device(mconfig, C1571CR, "C1571CR", tag, owner, clock, TYPE_1571CR)
+ : c1571_device(mconfig, C1571CR, "C1571CR", tag, owner, clock, TYPE_1571CR)
//m_floppy(*this, WD1770_TAG":0:525dd")
{
}
@@ -962,7 +965,7 @@ c1571cr_device::c1571cr_device(const machine_config &mconfig, const char *tag, d
//-------------------------------------------------
mini_chief_device::mini_chief_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : base_c1571_device(mconfig, MINI_CHIEF, "ICT Mini Chief", tag, owner, clock, TYPE_MINI_CHIEF)
+ : c1571_device(mconfig, MINI_CHIEF, "ICT Mini Chief", tag, owner, clock, TYPE_MINI_CHIEF)
//m_floppy(*this, WD1770_TAG":0:525dd")
{
}
@@ -972,7 +975,7 @@ mini_chief_device::mini_chief_device(const machine_config &mconfig, const char *
// device_start - device-specific startup
//-------------------------------------------------
-void base_c1571_device::device_start()
+void c1571_device::device_start()
{
// install image callbacks
m_ga->set_floppy(m_image);
@@ -994,7 +997,7 @@ void base_c1571_device::device_start()
// device_reset - device-specific reset
//-------------------------------------------------
-void base_c1571_device::device_reset()
+void c1571_device::device_reset()
{
m_maincpu->reset();
@@ -1016,7 +1019,7 @@ void base_c1571_device::device_reset()
// cbm_iec_srq -
//-------------------------------------------------
-void base_c1571_device::cbm_iec_srq(int state)
+void c1571_device::cbm_iec_srq(int state)
{
update_iec();
}
@@ -1026,7 +1029,7 @@ void base_c1571_device::cbm_iec_srq(int state)
// cbm_iec_atn -
//-------------------------------------------------
-void base_c1571_device::cbm_iec_atn(int state)
+void c1571_device::cbm_iec_atn(int state)
{
update_iec();
}
@@ -1036,7 +1039,7 @@ void base_c1571_device::cbm_iec_atn(int state)
// cbm_iec_data -
//-------------------------------------------------
-void base_c1571_device::cbm_iec_data(int state)
+void c1571_device::cbm_iec_data(int state)
{
update_iec();
}
@@ -1046,7 +1049,7 @@ void base_c1571_device::cbm_iec_data(int state)
// cbm_iec_reset -
//-------------------------------------------------
-void base_c1571_device::cbm_iec_reset(int state)
+void c1571_device::cbm_iec_reset(int state)
{
if (!state)
{
@@ -1059,7 +1062,7 @@ void base_c1571_device::cbm_iec_reset(int state)
// parallel_data_w -
//-------------------------------------------------
-void base_c1571_device::parallel_data_w(UINT8 data)
+void c1571_device::parallel_data_w(UINT8 data)
{
m_parallel_data = data;
}
@@ -1069,7 +1072,7 @@ void base_c1571_device::parallel_data_w(UINT8 data)
// parallel_strobe_w -
//-------------------------------------------------
-void base_c1571_device::parallel_strobe_w(int state)
+void c1571_device::parallel_strobe_w(int state)
{
m_cia->flag_w(state);
}
@@ -1079,7 +1082,7 @@ void base_c1571_device::parallel_strobe_w(int state)
// update_iec -
//-------------------------------------------------
-void base_c1571_device::update_iec()
+void c1571_device::update_iec()
{
m_cia->cnt_w(m_ser_dir || m_bus->srq_r());
m_cia->sp_w(m_ser_dir || m_bus->data_r());
diff --git a/src/mess/machine/c1571.h b/src/mess/machine/c1571.h
index 8a43116a56a..158bfeeb26c 100644
--- a/src/mess/machine/c1571.h
+++ b/src/mess/machine/c1571.h
@@ -41,9 +41,9 @@
// ======================> c1571_device
-class base_c1571_device : public device_t,
- public device_cbm_iec_interface,
- public device_c64_floppy_parallel_interface
+class c1571_device : public device_t,
+ public device_cbm_iec_interface,
+ public device_c64_floppy_parallel_interface
{
public:
enum
@@ -55,7 +55,8 @@ public:
};
// construction/destruction
- base_c1571_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant);
+ c1571_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant);
+ c1571_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// optional information overrides
virtual const rom_entry *device_rom_region() const;
@@ -133,7 +134,7 @@ protected:
// ======================> c1570_device
-class c1570_device : public base_c1571_device
+class c1570_device : public c1571_device
{
public:
// construction/destruction
@@ -141,19 +142,9 @@ public:
};
-// ======================> c1571_device
-
-class c1571_device : public base_c1571_device
-{
-public:
- // construction/destruction
- c1571_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-
// ======================> c1571cr_device
-class c1571cr_device : public base_c1571_device
+class c1571cr_device : public c1571_device
{
public:
// construction/destruction
@@ -166,7 +157,7 @@ public:
// ======================> mini_chief_device
-class mini_chief_device : public base_c1571_device
+class mini_chief_device : public c1571_device
{
public:
// construction/destruction
diff --git a/src/mess/machine/c1581.c b/src/mess/machine/c1581.c
index ee639e9bb58..a1ad0530f8e 100644
--- a/src/mess/machine/c1581.c
+++ b/src/mess/machine/c1581.c
@@ -52,7 +52,7 @@ const device_type C1581 = &device_creator<c1581_device>;
// complete
//-------------------------------------------------
-void base_c1581_device::device_config_complete()
+void c1581_device::device_config_complete()
{
switch (m_variant)
{
@@ -100,7 +100,7 @@ ROM_END
// rom_region - device-specific ROM region
//-------------------------------------------------
-const rom_entry *base_c1581_device::device_rom_region() const
+const rom_entry *c1581_device::device_rom_region() const
{
switch (m_variant)
{
@@ -118,7 +118,7 @@ const rom_entry *base_c1581_device::device_rom_region() const
// ADDRESS_MAP( c1581_mem )
//-------------------------------------------------
-static ADDRESS_MAP_START( c1581_mem, AS_PROGRAM, 8, base_c1581_device )
+static ADDRESS_MAP_START( c1581_mem, AS_PROGRAM, 8, c1581_device )
AM_RANGE(0x0000, 0x1fff) AM_MIRROR(0x2000) AM_RAM
AM_RANGE(0x4000, 0x400f) AM_MIRROR(0x1ff0) AM_DEVREADWRITE(M8520_TAG, mos8520_device, read, write)
AM_RANGE(0x6000, 0x6003) AM_MIRROR(0x1ffc) AM_DEVREADWRITE(WD1772_TAG, wd1772_t, read, write)
@@ -130,21 +130,21 @@ ADDRESS_MAP_END
// MOS8520_INTERFACE( cia_intf )
//-------------------------------------------------
-WRITE_LINE_MEMBER( base_c1581_device::cnt_w )
+WRITE_LINE_MEMBER( c1581_device::cnt_w )
{
m_cnt_out = state;
update_iec();
}
-WRITE_LINE_MEMBER( base_c1581_device::sp_w )
+WRITE_LINE_MEMBER( c1581_device::sp_w )
{
m_sp_out = state;
update_iec();
}
-READ8_MEMBER( base_c1581_device::cia_pa_r )
+READ8_MEMBER( c1581_device::cia_pa_r )
{
/*
@@ -175,7 +175,7 @@ READ8_MEMBER( base_c1581_device::cia_pa_r )
return data;
}
-WRITE8_MEMBER( base_c1581_device::cia_pa_w )
+WRITE8_MEMBER( c1581_device::cia_pa_w )
{
/*
@@ -205,7 +205,7 @@ WRITE8_MEMBER( base_c1581_device::cia_pa_w )
output_set_led_value(LED_ACT, BIT(data, 6));
}
-READ8_MEMBER( base_c1581_device::cia_pb_r )
+READ8_MEMBER( c1581_device::cia_pb_r )
{
/*
@@ -239,7 +239,7 @@ READ8_MEMBER( base_c1581_device::cia_pb_r )
return data;
}
-WRITE8_MEMBER( base_c1581_device::cia_pb_w )
+WRITE8_MEMBER( c1581_device::cia_pb_w )
{
/*
@@ -271,18 +271,6 @@ WRITE8_MEMBER( base_c1581_device::cia_pb_w )
update_iec();
}
-static MOS8520_INTERFACE( cia_intf )
-{
- DEVCB_CPU_INPUT_LINE(M6502_TAG, INPUT_LINE_IRQ0),
- DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1581_device, cnt_w),
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, base_c1581_device, sp_w),
- DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_c1581_device, cia_pa_r),
- DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_c1581_device, cia_pa_w),
- DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_c1581_device, cia_pb_r),
- DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, base_c1581_device, cia_pb_w)
-};
-
//-------------------------------------------------
// SLOT_INTERFACE( c1581_floppies )
@@ -297,7 +285,7 @@ SLOT_INTERFACE_END
// FLOPPY_FORMATS( c1581_device::floppy_formats )
//-------------------------------------------------
-FLOPPY_FORMATS_MEMBER( base_c1581_device::floppy_formats )
+FLOPPY_FORMATS_MEMBER( c1581_device::floppy_formats )
FLOPPY_D81_FORMAT
FLOPPY_FORMATS_END
@@ -310,10 +298,14 @@ static MACHINE_CONFIG_FRAGMENT( c1581 )
MCFG_CPU_ADD(M6502_TAG, M6502, XTAL_16MHz/8)
MCFG_CPU_PROGRAM_MAP(c1581_mem)
- MCFG_MOS8520_ADD(M8520_TAG, XTAL_16MHz/8, 0, cia_intf)
+ MCFG_MOS6526_ADD(M8520_TAG, XTAL_16MHz/8, 0, INPUTLINE(M6502_TAG, INPUT_LINE_IRQ0))
+ MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, c1581_device, cnt_w), DEVWRITELINE(DEVICE_SELF_OWNER, c1581_device, sp_w))
+ MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(DEVICE_SELF_OWNER, c1581_device, cia_pa_r), DEVWRITE8(DEVICE_SELF_OWNER, c1581_device, cia_pa_w))
+ MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF_OWNER, c1581_device, cia_pb_r), DEVWRITE8(DEVICE_SELF_OWNER, c1581_device, cia_pb_w), NULL)
+
MCFG_WD1772x_ADD(WD1772_TAG, XTAL_16MHz/2)
- MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":0", c1581_floppies, "35dd", 0, base_c1581_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":0", c1581_floppies, "35dd", 0, c1581_device::floppy_formats)
MACHINE_CONFIG_END
@@ -322,7 +314,7 @@ MACHINE_CONFIG_END
// machine configurations
//-------------------------------------------------
-machine_config_constructor base_c1581_device::device_mconfig_additions() const
+machine_config_constructor c1581_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( c1581 );
}
@@ -334,10 +326,10 @@ machine_config_constructor base_c1581_device::device_mconfig_additions() const
//**************************************************************************
//-------------------------------------------------
-// base_c1581_device - constructor
+// c1581_device - constructor
//-------------------------------------------------
-base_c1581_device::base_c1581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant)
+c1581_device::c1581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant)
: device_t(mconfig, type, name, tag, owner, clock),
device_cbm_iec_interface(mconfig, *this),
m_maincpu(*this, M6502_TAG),
@@ -353,28 +345,36 @@ base_c1581_device::base_c1581_device(const machine_config &mconfig, device_type
{
}
+c1581_device::c1581_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, C1581, "C1581", tag, owner, clock),
+ device_cbm_iec_interface(mconfig, *this),
+ m_maincpu(*this, M6502_TAG),
+ m_cia(*this, M8520_TAG),
+ m_fdc(*this, WD1772_TAG),
+ m_floppy(*this, WD1772_TAG":0:35dd"),
+ m_data_out(0),
+ m_atn_ack(0),
+ m_fast_ser_dir(0),
+ m_sp_out(1),
+ m_cnt_out(1),
+ m_variant(TYPE_1581)
+{
+}
+
//-------------------------------------------------
// c1563_device - constructor
//-------------------------------------------------
c1563_device::c1563_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : base_c1581_device(mconfig, C1563, "C1563", tag, owner, clock, TYPE_1563) { }
-
-
-//-------------------------------------------------
-// c1581_device - constructor
-//-------------------------------------------------
-
-c1581_device::c1581_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : base_c1581_device(mconfig, C1581, "C1581", tag, owner, clock, TYPE_1581) { }
+ : c1581_device(mconfig, C1563, "C1563", tag, owner, clock, TYPE_1563) { }
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
-void base_c1581_device::device_start()
+void c1581_device::device_start()
{
// state saving
save_item(NAME(m_data_out));
@@ -389,7 +389,7 @@ void base_c1581_device::device_start()
// device_reset - device-specific reset
//-------------------------------------------------
-void base_c1581_device::device_reset()
+void c1581_device::device_reset()
{
m_maincpu->reset();
@@ -410,7 +410,7 @@ void base_c1581_device::device_reset()
// cbm_iec_srq -
//-------------------------------------------------
-void base_c1581_device::cbm_iec_srq(int state)
+void c1581_device::cbm_iec_srq(int state)
{
update_iec();
}
@@ -420,7 +420,7 @@ void base_c1581_device::cbm_iec_srq(int state)
// cbm_iec_atn -
//-------------------------------------------------
-void base_c1581_device::cbm_iec_atn(int state)
+void c1581_device::cbm_iec_atn(int state)
{
update_iec();
}
@@ -430,7 +430,7 @@ void base_c1581_device::cbm_iec_atn(int state)
// cbm_iec_data -
//-------------------------------------------------
-void base_c1581_device::cbm_iec_data(int state)
+void c1581_device::cbm_iec_data(int state)
{
update_iec();
}
@@ -440,7 +440,7 @@ void base_c1581_device::cbm_iec_data(int state)
// cbm_iec_reset -
//-------------------------------------------------
-void base_c1581_device::cbm_iec_reset(int state)
+void c1581_device::cbm_iec_reset(int state)
{
if (!state)
{
@@ -453,7 +453,7 @@ void base_c1581_device::cbm_iec_reset(int state)
// update_iec -
//-------------------------------------------------
-void base_c1581_device::update_iec()
+void c1581_device::update_iec()
{
m_cia->cnt_w(m_fast_ser_dir || m_bus->srq_r());
m_cia->sp_w(m_fast_ser_dir || m_bus->data_r());
diff --git a/src/mess/machine/c1581.h b/src/mess/machine/c1581.h
index 64fd71ce8d6..d2c3839d300 100644
--- a/src/mess/machine/c1581.h
+++ b/src/mess/machine/c1581.h
@@ -34,14 +34,15 @@
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> base_c1581_device
+// ======================> c1581_device
-class base_c1581_device : public device_t,
- public device_cbm_iec_interface
+class c1581_device : public device_t,
+ public device_cbm_iec_interface
{
public:
// construction/destruction
- base_c1581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant);
+ c1581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant);
+ c1581_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
enum
{
@@ -94,7 +95,7 @@ protected:
// ======================> c1563_device
-class c1563_device : public base_c1581_device
+class c1563_device : public c1581_device
{
public:
// construction/destruction
@@ -102,16 +103,6 @@ public:
};
-// ======================> c1581_device
-
-class c1581_device : public base_c1581_device
-{
-public:
- // construction/destruction
- c1581_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-
// device type definition
extern const device_type C1563;
extern const device_type C1581;
diff --git a/src/mess/machine/c64_ieee488.c b/src/mess/machine/c64_ieee488.c
index 2fe6969c877..68c618168bd 100644
--- a/src/mess/machine/c64_ieee488.c
+++ b/src/mess/machine/c64_ieee488.c
@@ -151,23 +151,6 @@ static const tpi6525_interface tpi_intf =
//-------------------------------------------------
-// IEEE488_INTERFACE( ieee488_intf )
-//-------------------------------------------------
-
-static IEEE488_INTERFACE( ieee488_intf )
-{
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL
-};
-
-
-//-------------------------------------------------
// C64_EXPANSION_INTERFACE( expansion_intf )
//-------------------------------------------------
@@ -218,7 +201,7 @@ static C64_EXPANSION_INTERFACE( expansion_intf )
static MACHINE_CONFIG_FRAGMENT( c64_ieee488 )
MCFG_TPI6525_ADD(MOS6525_TAG, tpi_intf)
- MCFG_CBM_IEEE488_ADD(ieee488_intf, NULL)
+ MCFG_CBM_IEEE488_ADD(NULL)
MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, 0, expansion_intf, c64_expansion_cards, NULL, NULL)
MACHINE_CONFIG_END
diff --git a/src/mess/machine/c64_legacy.c b/src/mess/machine/c64_legacy.c
index 5dbc255636b..788855f8f7d 100644
--- a/src/mess/machine/c64_legacy.c
+++ b/src/mess/machine/c64_legacy.c
@@ -17,7 +17,7 @@
#include "cpu/m6502/m6510.h"
#include "cpu/z80/z80.h"
-#include "sound/sid6581.h"
+#include "sound/mos6581.h"
#include "machine/6526cia.h"
#include "machine/cbmiec.h"
diff --git a/src/mess/machine/c65.c b/src/mess/machine/c65.c
index 0c7f160a403..278e14d1faa 100644
--- a/src/mess/machine/c65.c
+++ b/src/mess/machine/c65.c
@@ -11,7 +11,7 @@
#include "includes/c65.h"
#include "includes/c64_legacy.h"
#include "cpu/m6502/m4510.h"
-#include "sound/sid6581.h"
+#include "sound/mos6581.h"
#include "machine/6526cia.h"
#include "machine/cbmiec.h"
#include "machine/ram.h"
@@ -645,8 +645,8 @@ static WRITE8_HANDLER( c65_ram_expansion_w )
static WRITE8_HANDLER( c65_write_io )
{
- sid6581_device *sid_0 = space.machine().device<sid6581_device>("sid_r");
- sid6581_device *sid_1 = space.machine().device<sid6581_device>("sid_l");
+ mos6581_device *sid_0 = space.machine().device<mos6581_device>("sid_r");
+ mos6581_device *sid_1 = space.machine().device<mos6581_device>("sid_l");
device_t *vic3 = space.machine().device("vic3");
switch (offset & 0xf00)
@@ -709,8 +709,8 @@ static WRITE8_HANDLER( c65_write_io_dc00 )
static READ8_HANDLER( c65_read_io )
{
- sid6581_device *sid_0 = space.machine().device<sid6581_device>("sid_r");
- sid6581_device *sid_1 = space.machine().device<sid6581_device>("sid_l");
+ mos6581_device *sid_0 = space.machine().device<mos6581_device>("sid_r");
+ mos6581_device *sid_1 = space.machine().device<mos6581_device>("sid_l");
device_t *vic3 = space.machine().device("vic3");
switch (offset & 0xf00)
diff --git a/src/mess/machine/cbmiec.c b/src/mess/machine/cbmiec.c
index 249ed7a9b6b..e609cf3e2aa 100644
--- a/src/mess/machine/cbmiec.c
+++ b/src/mess/machine/cbmiec.c
@@ -286,36 +286,6 @@ void cbm_iec_slot_device::device_start()
//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void cbm_iec_device::device_config_complete()
-{
- // inherit a copy of the static data
- const cbm_iec_interface *intf = reinterpret_cast<const cbm_iec_interface *>(static_config());
- if (intf != NULL)
- *static_cast<cbm_iec_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_out_srq_cb, 0, sizeof(m_out_srq_cb));
- memset(&m_out_atn_cb, 0, sizeof(m_out_atn_cb));
- memset(&m_out_clk_cb, 0, sizeof(m_out_clk_cb));
- memset(&m_out_data_cb, 0, sizeof(m_out_data_cb));
- memset(&m_out_reset_cb, 0, sizeof(m_out_reset_cb));
- }
-}
-
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -360,11 +330,11 @@ inline void cbm_iec_device::set_signal(device_t *device, int signal, int state)
{
switch (signal)
{
- case SRQ: m_out_srq_func(state); break;
- case ATN: m_out_atn_func(state); break;
- case CLK: m_out_clk_func(state); break;
- case DATA: m_out_data_func(state); break;
- case RESET: m_out_reset_func(state);break;
+ case SRQ: m_write_srq(state); break;
+ case ATN: m_write_atn(state); break;
+ case CLK: m_write_clk(state); break;
+ case DATA: m_write_data(state); break;
+ case RESET: m_write_reset(state);break;
}
daisy_entry *entry = m_device_list.first();
@@ -441,7 +411,12 @@ inline int cbm_iec_device::get_signal(int signal)
//-------------------------------------------------
cbm_iec_device::cbm_iec_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, CBM_IEC, "CBM IEC bus", tag, owner, clock)
+ : device_t(mconfig, CBM_IEC, "CBM IEC bus", tag, owner, clock),
+ m_write_srq(*this),
+ m_write_atn(*this),
+ m_write_clk(*this),
+ m_write_data(*this),
+ m_write_reset(*this)
{
for (int i = 0; i < SIGNAL_COUNT; i++)
{
@@ -457,11 +432,11 @@ cbm_iec_device::cbm_iec_device(const machine_config &mconfig, const char *tag, d
void cbm_iec_device::device_start()
{
// resolve callbacks
- m_out_srq_func.resolve(m_out_srq_cb, *this);
- m_out_atn_func.resolve(m_out_atn_cb, *this);
- m_out_clk_func.resolve(m_out_clk_cb, *this);
- m_out_data_func.resolve(m_out_data_cb, *this);
- m_out_reset_func.resolve(m_out_reset_cb, *this);
+ m_write_srq.resolve_safe();
+ m_write_atn.resolve_safe();
+ m_write_clk.resolve_safe();
+ m_write_data.resolve_safe();
+ m_write_reset.resolve_safe();
}
diff --git a/src/mess/machine/cbmiec.h b/src/mess/machine/cbmiec.h
index 534ecf3b820..b30f53cd4b9 100644
--- a/src/mess/machine/cbmiec.h
+++ b/src/mess/machine/cbmiec.h
@@ -28,13 +28,24 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_CBM_IEC_BUS_ADD(_config) \
- MCFG_DEVICE_ADD(CBM_IEC_TAG, CBM_IEC, 0) \
- MCFG_DEVICE_CONFIG(_config)
+#define MCFG_CBM_IEC_BUS_ADD() \
+ MCFG_DEVICE_ADD(CBM_IEC_TAG, CBM_IEC, 0)
-#define CBM_IEC_INTERFACE(_name) \
- const cbm_iec_interface (_name) =
+#define MCFG_CBM_IEC_BUS_SRQ_CALLBACK(_write) \
+ downcast<cbm_iec_device *>(device)->set_srq_callback(DEVCB2_##_write);
+
+#define MCFG_CBM_IEC_BUS_ATN_CALLBACK(_write) \
+ downcast<cbm_iec_device *>(device)->set_atn_callback(DEVCB2_##_write);
+
+#define MCFG_CBM_IEC_BUS_CLK_CALLBACK(_write) \
+ downcast<cbm_iec_device *>(device)->set_clk_callback(DEVCB2_##_write);
+
+#define MCFG_CBM_IEC_BUS_DATA_CALLBACK(_write) \
+ downcast<cbm_iec_device *>(device)->set_data_callback(DEVCB2_##_write);
+
+#define MCFG_CBM_IEC_BUS_RESET_CALLBACK(_write) \
+ downcast<cbm_iec_device *>(device)->set_reset_callback(DEVCB2_##_write);
#define MCFG_CBM_IEC_SLOT_ADD(_tag, _num, _slot_intf, _def_slot, _def_inp) \
@@ -48,29 +59,22 @@
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> cbm_iec_interface
-
-struct cbm_iec_interface
-{
- devcb_write_line m_out_srq_cb;
- devcb_write_line m_out_atn_cb;
- devcb_write_line m_out_clk_cb;
- devcb_write_line m_out_data_cb;
- devcb_write_line m_out_reset_cb;
-};
-
-
// ======================> cbm_iec_device
class device_cbm_iec_interface;
-class cbm_iec_device : public device_t,
- public cbm_iec_interface
+class cbm_iec_device : public device_t
{
public:
// construction/destruction
cbm_iec_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ template<class _write> void set_srq_callback(_write wr) { m_write_srq.set_callback(wr); }
+ template<class _write> void set_atn_callback(_write wr) { m_write_atn.set_callback(wr); }
+ template<class _write> void set_clk_callback(_write wr) { m_write_clk.set_callback(wr); }
+ template<class _write> void set_data_callback(_write wr) { m_write_data.set_callback(wr); }
+ template<class _write> void set_reset_callback(_write wr) { m_write_reset.set_callback(wr); }
+
void add_device(device_t *target, int address);
// reads for both host and peripherals
@@ -108,7 +112,6 @@ protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
- virtual void device_config_complete();
virtual void device_stop();
class daisy_entry
@@ -127,11 +130,11 @@ protected:
simple_list<daisy_entry> m_device_list;
private:
- devcb_resolved_write_line m_out_atn_func;
- devcb_resolved_write_line m_out_clk_func;
- devcb_resolved_write_line m_out_data_func;
- devcb_resolved_write_line m_out_srq_func;
- devcb_resolved_write_line m_out_reset_func;
+ devcb2_write_line m_write_srq;
+ devcb2_write_line m_write_atn;
+ devcb2_write_line m_write_clk;
+ devcb2_write_line m_write_data;
+ devcb2_write_line m_write_reset;
inline void set_signal(device_t *device, int signal, int state);
inline int get_signal(int signal);
@@ -177,10 +180,10 @@ public:
device_cbm_iec_interface *m_next;
// optional operation overrides
+ virtual void cbm_iec_srq(int state) { };
virtual void cbm_iec_atn(int state) { };
virtual void cbm_iec_clk(int state) { };
virtual void cbm_iec_data(int state) { };
- virtual void cbm_iec_srq(int state) { };
virtual void cbm_iec_reset(int state) { };
cbm_iec_device *m_bus;
diff --git a/src/mess/machine/cbmipt.h b/src/mess/machine/cbmipt.h
index 4af64157512..d8e87aaae57 100644
--- a/src/mess/machine/cbmipt.h
+++ b/src/mess/machine/cbmipt.h
@@ -104,21 +104,21 @@
#include "machine/vic20_megacart.h"
-#define MCFG_CBM_IEC_ADD(_intf, _default_drive) \
- MCFG_CBM_IEC_BUS_ADD(_intf) \
+#define MCFG_CBM_IEC_ADD(_default_drive) \
MCFG_CBM_IEC_SLOT_ADD("iec4", 4, cbm_iec_devices, NULL, NULL) \
MCFG_CBM_IEC_SLOT_ADD("iec8", 8, cbm_iec_devices, _default_drive, NULL) \
MCFG_CBM_IEC_SLOT_ADD("iec9", 9, cbm_iec_devices, NULL, NULL) \
MCFG_CBM_IEC_SLOT_ADD("iec10", 10, cbm_iec_devices, NULL, NULL) \
- MCFG_CBM_IEC_SLOT_ADD("iec11", 11, cbm_iec_devices, NULL, NULL)
+ MCFG_CBM_IEC_SLOT_ADD("iec11", 11, cbm_iec_devices, NULL, NULL) \
+ MCFG_CBM_IEC_BUS_ADD()
-#define MCFG_CBM_IEEE488_ADD(_intf, _default_drive) \
- MCFG_IEEE488_BUS_ADD(_intf) \
+#define MCFG_CBM_IEEE488_ADD(_default_drive) \
MCFG_IEEE488_SLOT_ADD("ieee8", 8, cbm_ieee488_devices, _default_drive, NULL) \
MCFG_IEEE488_SLOT_ADD("ieee9", 9, cbm_ieee488_devices, NULL, NULL) \
MCFG_IEEE488_SLOT_ADD("ieee10", 10, cbm_ieee488_devices, NULL, NULL) \
- MCFG_IEEE488_SLOT_ADD("ieee11", 11, cbm_ieee488_devices, NULL, NULL)
+ MCFG_IEEE488_SLOT_ADD("ieee11", 11, cbm_ieee488_devices, NULL, NULL) \
+ MCFG_IEEE488_BUS_ADD()
/* Commodore 64 */
diff --git a/src/mess/machine/ieee488.c b/src/mess/machine/ieee488.c
index 1f80106b096..17182109655 100644
--- a/src/mess/machine/ieee488.c
+++ b/src/mess/machine/ieee488.c
@@ -96,39 +96,6 @@ void ieee488_slot_device::device_start()
//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void ieee488_device::device_config_complete()
-{
- // inherit a copy of the static data
- const ieee488_interface *intf = reinterpret_cast<const ieee488_interface *>(static_config());
- if (intf != NULL)
- *static_cast<ieee488_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_out_eoi_cb, 0, sizeof(m_out_eoi_cb));
- memset(&m_out_dav_cb, 0, sizeof(m_out_dav_cb));
- memset(&m_out_nrfd_cb, 0, sizeof(m_out_nrfd_cb));
- memset(&m_out_ndac_cb, 0, sizeof(m_out_ndac_cb));
- memset(&m_out_ifc_cb, 0, sizeof(m_out_ifc_cb));
- memset(&m_out_srq_cb, 0, sizeof(m_out_srq_cb));
- memset(&m_out_atn_cb, 0, sizeof(m_out_atn_cb));
- memset(&m_out_ren_cb, 0, sizeof(m_out_ren_cb));
- }
-}
-
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -173,14 +140,14 @@ inline void ieee488_device::set_signal(device_t *device, int signal, int state)
{
switch (signal)
{
- case EOI: m_out_eoi_func(state); break;
- case DAV: m_out_dav_func(state); break;
- case NRFD: m_out_nrfd_func(state); break;
- case NDAC: m_out_ndac_func(state); break;
- case IFC: m_out_ifc_func(state); break;
- case SRQ: m_out_srq_func(state); break;
- case ATN: m_out_atn_func(state); break;
- case REN: m_out_ren_func(state); break;
+ case EOI: m_write_eoi(state); break;
+ case DAV: m_write_dav(state); break;
+ case NRFD: m_write_nrfd(state); break;
+ case NDAC: m_write_ndac(state); break;
+ case IFC: m_write_ifc(state); break;
+ case SRQ: m_write_srq(state); break;
+ case ATN: m_write_atn(state); break;
+ case REN: m_write_ren(state); break;
}
daisy_entry *entry = m_device_list.first();
@@ -325,6 +292,14 @@ inline UINT8 ieee488_device::get_data()
ieee488_device::ieee488_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, IEEE488, "IEEE488 bus", tag, owner, clock),
+ m_write_eoi(*this),
+ m_write_dav(*this),
+ m_write_nrfd(*this),
+ m_write_ndac(*this),
+ m_write_ifc(*this),
+ m_write_srq(*this),
+ m_write_atn(*this),
+ m_write_ren(*this),
m_dio(0xff)
{
for (int i = 0; i < SIGNAL_COUNT; i++)
@@ -341,16 +316,17 @@ ieee488_device::ieee488_device(const machine_config &mconfig, const char *tag, d
void ieee488_device::device_start()
{
// resolve callbacks
- m_out_eoi_func.resolve(m_out_eoi_cb, *this);
- m_out_dav_func.resolve(m_out_dav_cb, *this);
- m_out_nrfd_func.resolve(m_out_nrfd_cb, *this);
- m_out_ndac_func.resolve(m_out_ndac_cb, *this);
- m_out_ifc_func.resolve(m_out_ifc_cb, *this);
- m_out_srq_func.resolve(m_out_srq_cb, *this);
- m_out_atn_func.resolve(m_out_atn_cb, *this);
- m_out_ren_func.resolve(m_out_ren_cb, *this);
+ m_write_eoi.resolve_safe();
+ m_write_dav.resolve_safe();
+ m_write_nrfd.resolve_safe();
+ m_write_ndac.resolve_safe();
+ m_write_ifc.resolve_safe();
+ m_write_srq.resolve_safe();
+ m_write_atn.resolve_safe();
+ m_write_ren.resolve_safe();
}
+
//-------------------------------------------------
// device_stop - device-specific stop
//-------------------------------------------------
diff --git a/src/mess/machine/ieee488.h b/src/mess/machine/ieee488.h
index 43656d22ffc..39ebfb0e2d2 100644
--- a/src/mess/machine/ieee488.h
+++ b/src/mess/machine/ieee488.h
@@ -29,13 +29,33 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_IEEE488_BUS_ADD(_config) \
- MCFG_DEVICE_ADD(IEEE488_TAG, IEEE488, 0) \
- MCFG_DEVICE_CONFIG(_config)
+#define MCFG_IEEE488_BUS_ADD() \
+ MCFG_DEVICE_ADD(IEEE488_TAG, IEEE488, 0)
-#define IEEE488_INTERFACE(_name) \
- const ieee488_interface (_name) =
+#define MCFG_IEEE488_EOI_CALLBACK(_write) \
+ downcast<ieee488_device *>(device)->set_eoi_callback(DEVCB2_##_write);
+
+#define MCFG_IEEE488_DAV_CALLBACK(_write) \
+ downcast<ieee488_device *>(device)->set_dav_callback(DEVCB2_##_write);
+
+#define MCFG_IEEE488_NRFD_CALLBACK(_write) \
+ downcast<ieee488_device *>(device)->set_nrfd_callback(DEVCB2_##_write);
+
+#define MCFG_IEEE488_NDAC_CALLBACK(_write) \
+ downcast<ieee488_device *>(device)->set_ndac_callback(DEVCB2_##_write);
+
+#define MCFG_IEEE488_IFC_CALLBACK(_write) \
+ downcast<ieee488_device *>(device)->set_ifc_callback(DEVCB2_##_write);
+
+#define MCFG_IEEE488_SRQ_CALLBACK(_write) \
+ downcast<ieee488_device *>(device)->set_srq_callback(DEVCB2_##_write);
+
+#define MCFG_IEEE488_ATN_CALLBACK(_write) \
+ downcast<ieee488_device *>(device)->set_atn_callback(DEVCB2_##_write);
+
+#define MCFG_IEEE488_REN_CALLBACK(_write) \
+ downcast<ieee488_device *>(device)->set_ren_callback(DEVCB2_##_write);
#define MCFG_IEEE488_SLOT_ADD(_tag, _num, _slot_intf, _def_slot, _def_inp) \
@@ -49,32 +69,25 @@
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> ieee488_interface
-
-struct ieee488_interface
-{
- devcb_write_line m_out_eoi_cb;
- devcb_write_line m_out_dav_cb;
- devcb_write_line m_out_nrfd_cb;
- devcb_write_line m_out_ndac_cb;
- devcb_write_line m_out_ifc_cb;
- devcb_write_line m_out_srq_cb;
- devcb_write_line m_out_atn_cb;
- devcb_write_line m_out_ren_cb;
-};
-
-
// ======================> ieee488_device
class device_ieee488_interface;
-class ieee488_device : public device_t,
- public ieee488_interface
+class ieee488_device : public device_t
{
public:
// construction/destruction
ieee488_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ template<class _write> void set_eoi_callback(_write wr) { m_write_eoi.set_callback(wr); }
+ template<class _write> void set_dav_callback(_write wr) { m_write_dav.set_callback(wr); }
+ template<class _write> void set_nrfd_callback(_write wr) { m_write_nrfd.set_callback(wr); }
+ template<class _write> void set_ndac_callback(_write wr) { m_write_ndac.set_callback(wr); }
+ template<class _write> void set_ifc_callback(_write wr) { m_write_ifc.set_callback(wr); }
+ template<class _write> void set_srq_callback(_write wr) { m_write_srq.set_callback(wr); }
+ template<class _write> void set_atn_callback(_write wr) { m_write_atn.set_callback(wr); }
+ template<class _write> void set_ren_callback(_write wr) { m_write_ren.set_callback(wr); }
+
void add_device(device_t *target, int address);
// reads for both host and peripherals
@@ -128,7 +141,6 @@ protected:
// device-level overrides
virtual void device_start();
- virtual void device_config_complete();
virtual void device_stop();
class daisy_entry
@@ -148,14 +160,14 @@ protected:
simple_list<daisy_entry> m_device_list;
private:
- devcb_resolved_write_line m_out_eoi_func;
- devcb_resolved_write_line m_out_dav_func;
- devcb_resolved_write_line m_out_nrfd_func;
- devcb_resolved_write_line m_out_ndac_func;
- devcb_resolved_write_line m_out_ifc_func;
- devcb_resolved_write_line m_out_srq_func;
- devcb_resolved_write_line m_out_atn_func;
- devcb_resolved_write_line m_out_ren_func;
+ devcb2_write_line m_write_eoi;
+ devcb2_write_line m_write_dav;
+ devcb2_write_line m_write_nrfd;
+ devcb2_write_line m_write_ndac;
+ devcb2_write_line m_write_ifc;
+ devcb2_write_line m_write_srq;
+ devcb2_write_line m_write_atn;
+ devcb2_write_line m_write_ren;
inline void set_signal(device_t *device, int signal, int state);
inline int get_signal(int signal);
diff --git a/src/mess/machine/interpod.c b/src/mess/machine/interpod.c
index 4e5f32c154f..da66170a779 100644
--- a/src/mess/machine/interpod.c
+++ b/src/mess/machine/interpod.c
@@ -85,23 +85,6 @@ const device_type INTERPOD = &device_creator<interpod_device>;
//**************************************************************************
//-------------------------------------------------
-// IEEE488_INTERFACE( ieee488_intf )
-//-------------------------------------------------
-
-static IEEE488_INTERFACE( ieee488_intf )
-{
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL
-};
-
-
-//-------------------------------------------------
// ROM( interpod )
//-------------------------------------------------
@@ -203,7 +186,7 @@ static MACHINE_CONFIG_FRAGMENT( interpod )
MCFG_RIOT6532_ADD(R6532_TAG, 1000000, riot_intf)
MCFG_ACIA6850_ADD(MC6850_TAG, acia_intf)
- MCFG_CBM_IEEE488_ADD(ieee488_intf, NULL)
+ MCFG_CBM_IEEE488_ADD(NULL)
MACHINE_CONFIG_END
diff --git a/src/mess/machine/isa_ssi2001.c b/src/mess/machine/isa_ssi2001.c
index 7aae09dd30e..7086b42a79b 100644
--- a/src/mess/machine/isa_ssi2001.c
+++ b/src/mess/machine/isa_ssi2001.c
@@ -4,16 +4,9 @@
const device_type ISA8_SSI2001 = &device_creator<ssi2001_device>;
-static const sid6581_interface ssi_sid6581_interface =
-{
- DEVCB_NULL,
- DEVCB_NULL
-};
-
static MACHINE_CONFIG_FRAGMENT( ssi2001 )
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("sid6581", SID6581, XTAL_14_31818MHz/16)
- MCFG_SOUND_CONFIG(ssi_sid6581_interface)
+ MCFG_SOUND_ADD("sid6581", MOS6581, XTAL_14_31818MHz/16)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MCFG_PC_JOY_ADD("joy")
MACHINE_CONFIG_END
@@ -40,7 +33,7 @@ void ssi2001_device::device_start()
{
set_isa_device();
m_isa->install_device(0x0200, 0x0207, 0, 0, read8_delegate(FUNC(pc_joy_device::joy_port_r), subdevice<pc_joy_device>("joy")), write8_delegate(FUNC(pc_joy_device::joy_port_w), subdevice<pc_joy_device>("joy")));
- m_isa->install_device(0x0280, 0x029F, 0, 0, read8_delegate(FUNC(sid6581_device::read), subdevice<sid6581_device>("sid6581")), write8_delegate(FUNC(sid6581_device::write), subdevice<sid6581_device>("sid6581")));
+ m_isa->install_device(0x0280, 0x029F, 0, 0, read8_delegate(FUNC(mos6581_device::read), subdevice<mos6581_device>("sid6581")), write8_delegate(FUNC(mos6581_device::write), subdevice<mos6581_device>("sid6581")));
}
diff --git a/src/mess/machine/isa_ssi2001.h b/src/mess/machine/isa_ssi2001.h
index 9c6fcd12167..c23f2b59f53 100644
--- a/src/mess/machine/isa_ssi2001.h
+++ b/src/mess/machine/isa_ssi2001.h
@@ -3,7 +3,7 @@
#include "emu.h"
#include "machine/isa.h"
-#include "sound/sid6581.h"
+#include "sound/mos6581.h"
#include "machine/pc_joy.h"
//*********************************************************************
@@ -23,7 +23,7 @@ public:
virtual machine_config_constructor device_mconfig_additions() const;
required_device<pc_joy_device> m_joy;
- required_device<sid6581_device> m_sid;
+ required_device<mos6581_device> m_sid;
protected:
// device-level overrides
diff --git a/src/mess/machine/plus4_sid.c b/src/mess/machine/plus4_sid.c
index d0acd46783d..77487c191ea 100644
--- a/src/mess/machine/plus4_sid.c
+++ b/src/mess/machine/plus4_sid.c
@@ -59,24 +59,12 @@ const rom_entry *plus4_sid_cartridge_device::device_rom_region() const
//-------------------------------------------------
-// sid6581_interface sid_intf
-//-------------------------------------------------
-
-static MOS6581_INTERFACE( sid_intf )
-{
- DEVCB_NULL,
- DEVCB_NULL
-};
-
-
-//-------------------------------------------------
// MACHINE_CONFIG_FRAGMENT( plus4_sid )
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( plus4_sid )
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD(MOS8580_TAG, SID8580, XTAL_17_73447MHz/20)
- MCFG_SOUND_CONFIG(sid_intf)
+ MCFG_SOUND_ADD(MOS8580_TAG, MOS8580, XTAL_17_73447MHz/20)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MCFG_SOUND_ADD("dac", DAC, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
diff --git a/src/mess/machine/plus4_sid.h b/src/mess/machine/plus4_sid.h
index 5175f1c853e..178a3dc0b6b 100644
--- a/src/mess/machine/plus4_sid.h
+++ b/src/mess/machine/plus4_sid.h
@@ -16,7 +16,7 @@
#include "emu.h"
#include "machine/plus4exp.h"
#include "sound/dac.h"
-#include "sound/sid6581.h"
+#include "sound/mos6581.h"
#include "machine/cbmipt.h"
#include "machine/vcsctrl.h"
@@ -51,7 +51,7 @@ protected:
virtual void plus4_breset_w(int state);
private:
- required_device<sid6581_device> m_sid;
+ required_device<mos6581_device> m_sid;
required_device<vcs_control_port_device> m_joy;
};
diff --git a/src/mess/machine/vic1112.c b/src/mess/machine/vic1112.c
index 02d6c1a77dd..6c7754f2345 100644
--- a/src/mess/machine/vic1112.c
+++ b/src/mess/machine/vic1112.c
@@ -28,23 +28,6 @@ const device_type VIC1112 = &device_creator<vic1112_device>;
//-------------------------------------------------
-// IEEE488_INTERFACE( ieee488_intf )
-//-------------------------------------------------
-
-static IEEE488_INTERFACE( ieee488_intf )
-{
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(M6522_1_TAG, via6522_device, write_cb1),
- DEVCB_NULL,
- DEVCB_NULL
-};
-
-
-//-------------------------------------------------
// via6522_interface via0_intf
//-------------------------------------------------
@@ -164,7 +147,8 @@ static MACHINE_CONFIG_FRAGMENT( vic1112 )
MCFG_VIA6522_ADD(M6522_0_TAG, 0, via0_intf)
MCFG_VIA6522_ADD(M6522_1_TAG, 0, via1_intf)
- MCFG_CBM_IEEE488_ADD(ieee488_intf, NULL)
+ MCFG_CBM_IEEE488_ADD(NULL)
+ MCFG_IEEE488_SRQ_CALLBACK(DEVWRITELINE(M6522_1_TAG, via6522_device, write_cb1))
MACHINE_CONFIG_END
diff --git a/src/mess/mess.mak b/src/mess/mess.mak
index 5dce3321e74..5779f6f53b8 100644
--- a/src/mess/mess.mak
+++ b/src/mess/mess.mak
@@ -238,6 +238,7 @@ SOUNDS += TMS5200
SOUNDS += LMC1992
SOUNDS += AWACS
SOUNDS += T6721A
+SOUNDS += MOS7360
#-------------------------------------------------
# this is the list of driver libraries that
@@ -914,7 +915,6 @@ $(MESSOBJ)/cbm.a: \
$(MESS_MACHINE)/vic1111.o \
$(MESS_MACHINE)/vic1112.o \
$(MESS_MACHINE)/vic1210.o \
- $(MESS_AUDIO)/mos7360.o \
$(MESS_DRIVERS)/plus4.o \
$(MESS_MACHINE)/plus4exp.o \
$(MESS_MACHINE)/plus4user.o \
diff --git a/src/mess/video/mos6566.c b/src/mess/video/mos6566.c
index 4b5762f9124..102c0067042 100644
--- a/src/mess/video/mos6566.c
+++ b/src/mess/video/mos6566.c
@@ -267,7 +267,7 @@ inline void mos6566_device::set_interrupt( int mask )
{
DBG_LOG(2, "vic2", ("irq start %.2x\n", mask));
m_reg[0x19] |= 0x80;
- m_out_irq_func(ASSERT_LINE);
+ m_write_irq(ASSERT_LINE);
}
}
m_reg[0x19] |= mask;
@@ -280,7 +280,7 @@ inline void mos6566_device::clear_interrupt( int mask )
{
DBG_LOG(2, "vic2", ("irq end %.2x\n", mask));
m_reg[0x19] &= ~0x80;
- m_out_irq_func(CLEAR_LINE);
+ m_write_irq(CLEAR_LINE);
}
}
@@ -586,17 +586,26 @@ mos6566_device::mos6566_device(const machine_config &mconfig, const char *tag, d
m_icount(0),
m_variant(TYPE_6566),
m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, NULL, *ADDRESS_MAP_NAME(mos6566_videoram_map)),
- m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, NULL, *ADDRESS_MAP_NAME(mos6566_colorram_map))
+ m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, NULL, *ADDRESS_MAP_NAME(mos6566_colorram_map)),
+ m_write_irq(*this),
+ m_write_ba(*this),
+ m_write_aec(*this),
+ m_write_k(*this)
{
}
-mos6566_device::mos6566_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+mos6566_device::mos6566_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant)
: device_t(mconfig, type, name, tag, owner, clock),
device_memory_interface(mconfig, *this),
device_execute_interface(mconfig, *this),
m_icount(0),
+ m_variant(variant),
m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, NULL, *ADDRESS_MAP_NAME(mos6566_videoram_map)),
m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, NULL, *ADDRESS_MAP_NAME(mos6566_colorram_map)),
+ m_write_irq(*this),
+ m_write_ba(*this),
+ m_write_aec(*this),
+ m_write_k(*this),
m_phi0(1),
m_ba(ASSERT_LINE),
m_aec(ASSERT_LINE)
@@ -604,52 +613,28 @@ mos6566_device::mos6566_device(const machine_config &mconfig, device_type type,
}
mos6567_device::mos6567_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- :mos6566_device(mconfig, MOS6567, "MOS6567", tag, owner, clock) { m_variant = TYPE_6567; }
+ :mos6566_device(mconfig, MOS6567, "MOS6567", tag, owner, clock, TYPE_6567) { }
-mos6567_device::mos6567_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
- :mos6566_device(mconfig, type, name, tag, owner, clock) { }
+mos6567_device::mos6567_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant)
+ :mos6566_device(mconfig, type, name, tag, owner, clock, TYPE_6567) { }
mos8562_device::mos8562_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- :mos6567_device(mconfig, MOS8562, "MOS8562", tag, owner, clock) { m_variant = TYPE_8562; }
+ :mos6567_device(mconfig, MOS8562, "MOS8562", tag, owner, clock, TYPE_8562) { }
mos8564_device::mos8564_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- :mos6567_device(mconfig, MOS8564, "MOS8564", tag, owner, clock) { m_variant = TYPE_8564; }
+ :mos6567_device(mconfig, MOS8564, "MOS8564", tag, owner, clock, TYPE_8564) { }
mos6569_device::mos6569_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- :mos6566_device(mconfig, MOS6566, "MOS6569", tag, owner, clock) { m_variant = TYPE_6569; }
+ :mos6566_device(mconfig, MOS6566, "MOS6569", tag, owner, clock, TYPE_6569) { }
-mos6569_device::mos6569_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
- :mos6566_device(mconfig, type, name, tag, owner, clock) { }
+mos6569_device::mos6569_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant)
+ :mos6566_device(mconfig, type, name, tag, owner, clock, TYPE_6569) { }
mos8565_device::mos8565_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- :mos6569_device(mconfig, MOS8565, "MOS8565", tag, owner, clock) { m_variant = TYPE_8565; }
+ :mos6569_device(mconfig, MOS8565, "MOS8565", tag, owner, clock, TYPE_8565) { }
mos8566_device::mos8566_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- :mos6569_device(mconfig, MOS8566, "MOS8566", tag, owner, clock) { m_variant = TYPE_8566; }
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void mos6566_device::device_config_complete()
-{
- // inherit a copy of the static data
- const mos6566_interface *intf = reinterpret_cast<const mos6566_interface *>(static_config());
- if (intf != NULL)
- *static_cast<mos6566_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_out_irq_cb, 0, sizeof(m_out_irq_cb));
- memset(&m_out_ba_cb, 0, sizeof(m_out_ba_cb));
- memset(&m_out_aec_cb, 0, sizeof(m_out_aec_cb));
- memset(&m_out_k_cb, 0, sizeof(m_out_k_cb));
- }
-}
+ :mos6569_device(mconfig, MOS8566, "MOS8566", tag, owner, clock, TYPE_8566) { }
//-------------------------------------------------
@@ -662,12 +647,15 @@ void mos6566_device::device_start()
m_icountptr = &m_icount;
// resolve callbacks
- m_out_irq_func.resolve(m_out_irq_cb, *this);
- m_out_ba_func.resolve(m_out_ba_cb, *this);
- m_out_aec_func.resolve(m_out_aec_cb, *this);
- m_out_k_func.resolve(m_out_k_cb, *this);
+ m_write_irq.resolve_safe();
+ m_write_ba.resolve_safe();
+ m_write_aec.resolve_safe();
+ m_write_k.resolve_safe();
- m_cpu = machine().device<cpu_device>(m_cpu_tag);
+ if (m_cpu_tag != NULL)
+ m_cpu = machine().device<cpu_device>(m_cpu_tag);
+ else
+ m_cpu = machine().firstcpu;
m_screen = machine().device<screen_device>(m_screen_tag);
m_screen->register_screen_bitmap(m_bitmap);
@@ -1439,8 +1427,8 @@ void mos6566_device::execute_run()
m_phi0 = 1;
set_aec(BIT(m_aec_delay, 2));
- m_out_ba_func(m_ba);
- m_out_aec_func(m_aec);
+ m_write_ba(m_ba);
+ m_write_aec(m_aec);
m_raster_x += 8;
if (m_raster_x == 0x1fc) m_raster_x = 0x004;
@@ -2008,8 +1996,8 @@ void mos6569_device::execute_run()
m_phi0 = 1;
set_aec(BIT(m_aec_delay, 2));
- m_out_ba_func(m_ba);
- m_out_aec_func(m_aec);
+ m_write_ba(m_ba);
+ m_write_aec(m_aec);
m_raster_x += 8;
if (m_raster_x == 0x1fc) m_raster_x = 0x004;
@@ -2789,7 +2777,7 @@ WRITE8_MEMBER( mos6566_device::write )
{
m_reg[offset] = data | 0xf8;
- m_out_k_func(0, data & 0x07);
+ m_write_k((offs_t)0, data & 0x07);
}
break;
diff --git a/src/mess/video/mos6566.h b/src/mess/video/mos6566.h
index e938407ab5a..c1cb80d866b 100644
--- a/src/mess/video/mos6566.h
+++ b/src/mess/video/mos6566.h
@@ -91,9 +91,9 @@
// DEVICE CONFIGURATION MACROS
//***************************************************************************
-#define MCFG_MOS6566_ADD(_tag, _screen_tag, _clock, _config, _videoram_map, _colorram_map) \
+#define MCFG_MOS6566_ADD(_tag, _screen_tag, _clock, _videoram_map, _colorram_map, _irq) \
MCFG_DEVICE_ADD(_tag, MOS6566, _clock) \
- MCFG_DEVICE_CONFIG(_config) \
+ downcast<mos6566_device *>(device)->set_callbacks(_screen_tag, NULL, DEVCB2_##_irq, DEVCB2_NULL); \
MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \
MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) \
MCFG_SCREEN_ADD(_screen_tag, RASTER) \
@@ -102,9 +102,9 @@
MCFG_SCREEN_VISIBLE_AREA(0, VIC6567_VISIBLECOLUMNS - 1, 0, VIC6567_VISIBLELINES - 1) \
MCFG_SCREEN_UPDATE_DEVICE(_tag, mos6566_device, screen_update)
-#define MCFG_MOS6567_ADD(_tag, _screen_tag, _clock, _config, _videoram_map, _colorram_map) \
+#define MCFG_MOS6567_ADD(_tag, _screen_tag, _clock, _videoram_map, _colorram_map, _irq) \
MCFG_DEVICE_ADD(_tag, MOS6567, _clock) \
- MCFG_DEVICE_CONFIG(_config) \
+ downcast<mos6566_device *>(device)->set_callbacks(_screen_tag, NULL, DEVCB2_##_irq, DEVCB2_NULL); \
MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \
MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) \
MCFG_SCREEN_ADD(_screen_tag, RASTER) \
@@ -113,9 +113,9 @@
MCFG_SCREEN_VISIBLE_AREA(0, VIC6567_VISIBLECOLUMNS - 1, 0, VIC6567_VISIBLELINES - 1) \
MCFG_SCREEN_UPDATE_DEVICE(_tag, mos6567_device, screen_update)
-#define MCFG_MOS8562_ADD(_tag, _screen_tag, _clock, _config, _videoram_map, _colorram_map) \
+#define MCFG_MOS8562_ADD(_tag, _screen_tag, _clock, _videoram_map, _colorram_map, _irq) \
MCFG_DEVICE_ADD(_tag, MOS8562, _clock) \
- MCFG_DEVICE_CONFIG(_config) \
+ downcast<mos6566_device *>(device)->set_callbacks(_screen_tag, NULL, DEVCB2_##_irq, DEVCB2_NULL); \
MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \
MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) \
MCFG_SCREEN_ADD(_screen_tag, RASTER) \
@@ -124,9 +124,9 @@
MCFG_SCREEN_VISIBLE_AREA(0, VIC6567_VISIBLECOLUMNS - 1, 0, VIC6567_VISIBLELINES - 1) \
MCFG_SCREEN_UPDATE_DEVICE(_tag, mos8562_device, screen_update)
-#define MCFG_MOS8564_ADD(_tag, _screen_tag, _clock, _config, _videoram_map, _colorram_map) \
+#define MCFG_MOS8564_ADD(_tag, _screen_tag, _cpu_tag, _clock, _videoram_map, _colorram_map, _irq, _k) \
MCFG_DEVICE_ADD(_tag, MOS8564, _clock) \
- MCFG_DEVICE_CONFIG(_config) \
+ downcast<mos6566_device *>(device)->set_callbacks(_screen_tag, _cpu_tag, DEVCB2_##_irq, DEVCB2_##_k); \
MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \
MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) \
MCFG_SCREEN_ADD(_screen_tag, RASTER) \
@@ -135,9 +135,9 @@
MCFG_SCREEN_VISIBLE_AREA(0, VIC6567_VISIBLECOLUMNS - 1, 0, VIC6567_VISIBLELINES - 1) \
MCFG_SCREEN_UPDATE_DEVICE(_tag, mos8564_device, screen_update)
-#define MCFG_MOS6569_ADD(_tag, _screen_tag, _clock, _config, _videoram_map, _colorram_map) \
+#define MCFG_MOS6569_ADD(_tag, _screen_tag, _clock, _videoram_map, _colorram_map, _irq) \
MCFG_DEVICE_ADD(_tag, MOS6569, _clock) \
- MCFG_DEVICE_CONFIG(_config) \
+ downcast<mos6566_device *>(device)->set_callbacks(_screen_tag, NULL, DEVCB2_##_irq, DEVCB2_NULL); \
MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \
MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) \
MCFG_SCREEN_ADD(_screen_tag, RASTER) \
@@ -146,9 +146,9 @@
MCFG_SCREEN_VISIBLE_AREA(0, VIC6569_VISIBLECOLUMNS - 1, 0, VIC6569_VISIBLELINES - 1) \
MCFG_SCREEN_UPDATE_DEVICE(_tag, mos6569_device, screen_update)
-#define MCFG_MOS8565_ADD(_tag, _screen_tag, _clock, _config, _videoram_map, _colorram_map) \
+#define MCFG_MOS8565_ADD(_tag, _screen_tag, _clock, _videoram_map, _colorram_map, _irq) \
MCFG_DEVICE_ADD(_tag, MOS8565, _clock) \
- MCFG_DEVICE_CONFIG(_config) \
+ downcast<mos6566_device *>(device)->set_callbacks(_screen_tag, NULL, DEVCB2_##_irq, DEVCB2_NULL); \
MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \
MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) \
MCFG_SCREEN_ADD(_screen_tag, RASTER) \
@@ -157,9 +157,9 @@
MCFG_SCREEN_VISIBLE_AREA(0, VIC6569_VISIBLECOLUMNS - 1, 0, VIC6569_VISIBLELINES - 1) \
MCFG_SCREEN_UPDATE_DEVICE(_tag, mos8565_device, screen_update)
-#define MCFG_MOS8566_ADD(_tag, _screen_tag, _clock, _config, _videoram_map, _colorram_map) \
+#define MCFG_MOS8566_ADD(_tag, _screen_tag, _cpu_tag, _clock, _videoram_map, _colorram_map, _irq, _k) \
MCFG_DEVICE_ADD(_tag, MOS8566, _clock) \
- MCFG_DEVICE_CONFIG(_config) \
+ downcast<mos6566_device *>(device)->set_callbacks(_screen_tag, _cpu_tag, DEVCB2_##_irq, DEVCB2_##_k); \
MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \
MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) \
MCFG_SCREEN_ADD(_screen_tag, RASTER) \
@@ -169,22 +169,6 @@
MCFG_SCREEN_UPDATE_DEVICE(_tag, mos8566_device, screen_update)
-#define MOS6566_INTERFACE(_name) \
- const mos6566_interface (_name) =
-
-#define MOS6567_INTERFACE(_name) \
- const mos6566_interface (_name) =
-
-#define MOS8564_INTERFACE(_name) \
- const mos6566_interface (_name) =
-
-#define MOS6569_INTERFACE(_name) \
- const mos6566_interface (_name) =
-
-#define MOS8566_INTERFACE(_name) \
- const mos6566_interface (_name) =
-
-
//**************************************************************************
// MACROS / CONSTANTS
@@ -281,33 +265,24 @@
// TYPE DEFINITIONS
//***************************************************************************
-// ======================> mos6566_interface
-
-struct mos6566_interface
-{
- const char *m_screen_tag;
- const char *m_cpu_tag;
-
- devcb_write_line m_out_irq_cb;
- devcb_write_line m_out_ba_cb;
- devcb_write_line m_out_aec_cb;
-
- devcb_write8 m_out_k_cb;
-};
-
-
// ======================> mos6566_device
class mos6566_device : public device_t,
public device_memory_interface,
- public device_execute_interface,
- public mos6566_interface
+ public device_execute_interface
{
public:
// construction/destruction
- mos6566_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ mos6566_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant);
mos6566_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ template<class _irq, class _k> void set_callbacks(const char *screen_tag, const char *cpu_tag, _irq irq, _k k) {
+ m_screen_tag = screen_tag;
+ m_cpu_tag = cpu_tag;
+ m_write_irq.set_callback(irq);
+ m_write_k.set_callback(k);
+ }
+
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
DECLARE_READ8_MEMBER( read );
@@ -340,7 +315,6 @@ protected:
};
// device-level overrides
- virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void execute_run();
@@ -376,6 +350,13 @@ protected:
void draw_graphics();
void draw_sprites();
+ devcb2_write_line m_write_irq;
+ devcb2_write_line m_write_ba;
+ devcb2_write_line m_write_aec;
+ devcb2_write8 m_write_k;
+
+ const char *m_screen_tag;
+ const char *m_cpu_tag;
screen_device *m_screen; // screen which sets bitmap properties
cpu_device *m_cpu;
@@ -450,11 +431,6 @@ protected:
/* Cycles */
UINT64 m_first_ba_cycle;
UINT8 m_device_suspended;
-
- devcb_resolved_write_line m_out_irq_func;
- devcb_resolved_write_line m_out_ba_func;
- devcb_resolved_write_line m_out_aec_func;
- devcb_resolved_write8 m_out_k_func;
};
@@ -465,7 +441,7 @@ class mos6567_device : public mos6566_device
public:
// construction/destruction
mos6567_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- mos6567_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ mos6567_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant);
};
@@ -496,7 +472,7 @@ class mos6569_device : public mos6566_device
public:
// construction/destruction
mos6569_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- mos6569_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ mos6569_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant);
// device-level overrides
virtual void execute_run();