summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar mooglyguy <therealmogminer@gmail.com>2018-08-09 20:47:17 +0200
committerGravatarGravatar mooglyguy <therealmogminer@gmail.com>2018-08-09 20:47:28 +0200
commit00e169f11f2186ae86062d76353872d1128c7a16 (patch) (github)
treeca9ff0c380e29ae8f278ae4ebcc07a984641eb31
parent6cfd636c604fc012eac8b19a4ff56b5e35e77693 (diff)
downloadmame-00e169f11f2186ae86062d76353872d1128c7a16.tar.bz2
mame-00e169f11f2186ae86062d76353872d1128c7a16.zip
-via6522: Removed MCFG acessors, nw
-rw-r--r--src/devices/bus/a2bus/a2mockingboard.cpp502
-rw-r--r--src/devices/bus/a2bus/a2mockingboard.h32
-rw-r--r--src/devices/bus/bbc/tube/tube_zep100.cpp41
-rw-r--r--src/devices/bus/bbc/tube/tube_zep100.h2
-rw-r--r--src/devices/bus/cbmiec/fd2000.cpp48
-rw-r--r--src/devices/bus/cbmiec/fd2000.h2
-rw-r--r--src/devices/bus/electron/m2105.cpp56
-rw-r--r--src/devices/bus/ieee488/c2040.cpp172
-rw-r--r--src/devices/bus/ieee488/c2040.h1
-rw-r--r--src/devices/bus/ieee488/c2040fdc.h3
-rw-r--r--src/devices/bus/ieee488/c8050.cpp192
-rw-r--r--src/devices/bus/ieee488/c8050.h1
-rw-r--r--src/devices/bus/vic20/vic1112.cpp34
-rw-r--r--src/devices/imagedev/floppy.h4
-rw-r--r--src/devices/machine/6522via.h39
-rw-r--r--src/devices/video/ramdac.h6
-rw-r--r--src/mame/drivers/accomm.cpp6
-rw-r--r--src/mame/drivers/aim65.cpp12
-rw-r--r--src/mame/drivers/apple3.cpp18
-rw-r--r--src/mame/drivers/applix.cpp10
-rw-r--r--src/mame/drivers/aristmk4.cpp214
-rw-r--r--src/mame/drivers/atarisy1.cpp10
-rw-r--r--src/mame/drivers/atom.cpp16
-rw-r--r--src/mame/drivers/bbc.cpp53
-rw-r--r--src/mame/drivers/beezer.cpp160
-rw-r--r--src/mame/drivers/bmcbowl.cpp142
26 files changed, 770 insertions, 1006 deletions
diff --git a/src/devices/bus/a2bus/a2mockingboard.cpp b/src/devices/bus/a2bus/a2mockingboard.cpp
index d905fe13bfd..71a21fa00a8 100644
--- a/src/devices/bus/a2bus/a2mockingboard.cpp
+++ b/src/devices/bus/a2bus/a2mockingboard.cpp
@@ -38,72 +38,57 @@ DEFINE_DEVICE_TYPE(A2BUS_ECHOPLUS, a2bus_echoplus_device, "a2echop", "S
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(a2bus_ayboard_device::device_add_mconfig)
- MCFG_DEVICE_ADD(VIA1_TAG, VIA6522, 1022727)
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, a2bus_ayboard_device, via1_out_a))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, a2bus_ayboard_device, via1_out_b))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE(*this, a2bus_ayboard_device, via1_irq_w))
+void a2bus_ayboard_device::add_common_devices(machine_config &config)
+{
+ VIA6522(config, m_via1, 1022727);
+ m_via1->writepa_handler().set(FUNC(a2bus_ayboard_device::via1_out_a));
+ m_via1->writepb_handler().set(FUNC(a2bus_ayboard_device::via1_out_b));
+ m_via1->irq_handler().set(FUNC(a2bus_ayboard_device::via1_irq_w));
- MCFG_DEVICE_ADD(VIA2_TAG, VIA6522, 1022727)
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, a2bus_ayboard_device, via2_out_a))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, a2bus_ayboard_device, via2_out_b))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE(*this, a2bus_ayboard_device, via2_irq_w))
+ VIA6522(config, m_via2, 1022727);
+ m_via2->writepa_handler().set(FUNC(a2bus_ayboard_device::via2_out_a));
+ m_via2->writepb_handler().set(FUNC(a2bus_ayboard_device::via2_out_b));
+ m_via2->irq_handler().set(FUNC(a2bus_ayboard_device::via2_irq_w));
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD(AY1_TAG, AY8913, 1022727)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_DEVICE_ADD(AY2_TAG, AY8913, 1022727)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(a2bus_phasor_device::device_add_mconfig)
- MCFG_DEVICE_ADD(VIA1_TAG, VIA6522, 1022727)
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, a2bus_ayboard_device, via1_out_a))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, a2bus_ayboard_device, via1_out_b))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE(*this, a2bus_ayboard_device, via1_irq_w))
-
- MCFG_DEVICE_ADD(VIA2_TAG, VIA6522, 1022727)
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, a2bus_ayboard_device, via2_out_a))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, a2bus_ayboard_device, via2_out_b))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE(*this, a2bus_ayboard_device, via2_irq_w))
+ AY8913(config, m_ay1, 1022727);
+ m_ay1->add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+}
+
+void a2bus_ayboard_device::device_add_mconfig(machine_config &config)
+{
+ add_common_devices(config);
+
+ AY8913(config, m_ay2, 1022727);
+ m_ay2->add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+}
+
+void a2bus_phasor_device::device_add_mconfig(machine_config &config)
+{
+ add_common_devices(config);
+
+ m_via1->writepb_handler().set(FUNC(a2bus_phasor_device::via1_out_b));
+ m_via2->writepb_handler().set(FUNC(a2bus_phasor_device::via2_out_b));
- SPEAKER(config, "lspeaker").front_left();
- SPEAKER(config, "rspeaker").front_right();
SPEAKER(config, "lspeaker2").front_left();
SPEAKER(config, "rspeaker2").front_right();
- MCFG_DEVICE_ADD(AY1_TAG, AY8913, 1022727)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_DEVICE_ADD(AY2_TAG, AY8913, 1022727)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker2", 1.0)
- MCFG_DEVICE_ADD(AY3_TAG, AY8913, 1022727)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_DEVICE_ADD(AY4_TAG, AY8913, 1022727)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker2", 1.0)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(a2bus_echoplus_device::device_add_mconfig)
- MCFG_DEVICE_ADD(VIA1_TAG, VIA6522, 1022727)
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, a2bus_ayboard_device, via1_out_a))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, a2bus_ayboard_device, via1_out_b))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE(*this, a2bus_ayboard_device, via1_irq_w))
-
- MCFG_DEVICE_ADD(VIA2_TAG, VIA6522, 1022727)
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, a2bus_ayboard_device, via2_out_a))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, a2bus_ayboard_device, via2_out_b))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE(*this, a2bus_ayboard_device, via2_irq_w))
+ AY8913(config, m_ay2, 1022727);
+ AY8913(config, m_ay3, 1022727);
+ AY8913(config, m_ay4, 1022727);
+ m_ay2->add_route(ALL_OUTPUTS, "lspeaker2", 1.0);
+ m_ay3->add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+ m_ay4->add_route(ALL_OUTPUTS, "rspeaker2", 1.0);
+}
- SPEAKER(config, "lspeaker").front_left();
- SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD(AY1_TAG, AY8913, 1022727)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_DEVICE_ADD(AY2_TAG, AY8913, 1022727)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+void a2bus_echoplus_device::device_add_mconfig(machine_config &config)
+{
+ add_common_devices(config);
SPEAKER(config, "echosp").front_center();
- MCFG_DEVICE_ADD(E2P_TMS_TAG, TMS5220, 640000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "echosp", 1.0)
-MACHINE_CONFIG_END
+ TMS5220(config, m_tms, 640000);
+ m_tms->add_route(ALL_OUTPUTS, "echosp", 1.0);
+}
//**************************************************************************
// LIVE DEVICE
@@ -116,31 +101,28 @@ a2bus_ayboard_device::a2bus_ayboard_device(const machine_config &mconfig, device
m_via2(*this, VIA2_TAG),
m_ay1(*this, AY1_TAG),
m_ay2(*this, AY2_TAG),
- m_ay3(*this, AY3_TAG),
- m_ay4(*this, AY4_TAG), m_isPhasor(false), m_PhasorNative(false), m_porta1(0), m_porta2(0)
+ m_porta1(0),
+ m_porta2(0)
{
}
a2bus_mockingboard_device::a2bus_mockingboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
a2bus_ayboard_device(mconfig, A2BUS_MOCKINGBOARD, tag, owner, clock)
{
- m_isPhasor = false;
- m_PhasorNative = false;
}
a2bus_phasor_device::a2bus_phasor_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- a2bus_ayboard_device(mconfig, A2BUS_PHASOR, tag, owner, clock)
+ a2bus_ayboard_device(mconfig, A2BUS_PHASOR, tag, owner, clock),
+ m_ay3(*this, AY3_TAG),
+ m_ay4(*this, AY4_TAG),
+ m_native(false)
{
- m_isPhasor = true;
- m_PhasorNative = false;
}
a2bus_echoplus_device::a2bus_echoplus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
a2bus_ayboard_device(mconfig, A2BUS_ECHOPLUS, tag, owner, clock),
m_tms(*this, E2P_TMS_TAG)
{
- m_isPhasor = false;
- m_PhasorNative = false;
}
//-------------------------------------------------
@@ -164,48 +146,34 @@ void a2bus_ayboard_device::device_reset()
uint8_t a2bus_ayboard_device::read_cnxx(uint8_t offset)
{
- if (m_isPhasor)
- {
- uint8_t retVal = 0;
- int viaSel;
+ if (offset <= 0x10)
+ return m_via1->read(offset & 0xf);
+ else if (offset >= 0x80 && offset <= 0x90)
+ return m_via2->read(offset & 0xf);
- if (m_PhasorNative)
- {
- viaSel = ((offset & 0x80)>> 6) | ((offset & 0x10)>> 4);
- }
- else
- {
- viaSel = (offset & 0x80) ? 2 : 1;
- }
+ return 0;
+}
- if ((offset <= 0x20) || (offset >= 0x80 && offset <= 0xa0))
- {
- if (viaSel & 1)
- {
- retVal |= m_via1->read(offset & 0xf);
- }
-
- if (viaSel & 2)
- {
- retVal |= m_via2->read(offset & 0xf);
- }
- }
+uint8_t a2bus_phasor_device::read_cnxx(uint8_t offset)
+{
+ uint8_t ret = 0;
+ int via_sel;
- return retVal;
- }
+ if (m_native)
+ via_sel = ((offset & 0x80) >> 6) | ((offset & 0x10) >> 4);
else
+ via_sel = (offset & 0x80) ? 2 : 1;
+
+ if ((offset <= 0x20) || (offset >= 0x80 && offset <= 0xa0))
{
- if (offset <= 0x10)
- {
- return m_via1->read(offset & 0xf);
- }
- else if (offset >= 0x80 && offset <= 0x90)
- {
- return m_via2->read(offset & 0xf);
- }
+ if (BIT(via_sel, 0))
+ ret |= m_via1->read(offset & 0xf);
+
+ if (BIT(via_sel, 1))
+ ret |= m_via2->read(offset & 0xf);
}
- return 0;
+ return ret;
}
/*-------------------------------------------------
@@ -214,71 +182,47 @@ uint8_t a2bus_ayboard_device::read_cnxx(uint8_t offset)
void a2bus_ayboard_device::write_cnxx(uint8_t offset, uint8_t data)
{
- if (m_isPhasor)
- {
- if ((offset <= 0x20) || (offset >= 0x80 && offset <= 0xa0))
- {
- int viaSel;
-
- if (m_PhasorNative)
- {
- viaSel = ((offset & 0x80)>> 6) | ((offset & 0x10)>> 4);
- }
- else
- {
- viaSel = (offset & 0x80) ? 2 : 1;
- }
-
- if (viaSel & 1)
- {
- m_via1->write(offset&0xf, data);
- }
- if (viaSel & 2)
- {
- m_via2->write(offset&0xf, data);
- }
- }
- }
+ if (offset <= 0x10)
+ m_via1->write(offset & 0xf, data);
+ else if (offset >= 0x80 && offset <= 0x90)
+ m_via2->write(offset & 0xf, data);
else
+ logerror("Mockingboard(%d): unk write %02x to Cn%02X (%s)\n", slotno(), data, offset, machine().describe_context());
+}
+
+void a2bus_phasor_device::write_cnxx(uint8_t offset, uint8_t data)
+{
+ if ((offset <= 0x20) || (offset >= 0x80 && offset <= 0xa0))
{
- if (offset <= 0x10)
- {
+ int via_sel;
+
+ if (m_native)
+ via_sel = ((offset & 0x80) >> 6) | ((offset & 0x10) >> 4);
+ else
+ via_sel = (offset & 0x80) ? 2 : 1;
+
+ if (BIT(via_sel, 0))
m_via1->write(offset & 0xf, data);
- }
- else if (offset >= 0x80 && offset <= 0x90)
- {
+
+ if (BIT(via_sel, 1))
m_via2->write(offset & 0xf, data);
- }
- else
- {
- logerror("Mockingboard(%d): unk write %02x to Cn%02X (%s)\n", slotno(), data, offset, machine().describe_context());
- }
}
}
-
WRITE_LINE_MEMBER( a2bus_ayboard_device::via1_irq_w )
{
if (state)
- {
raise_slot_irq();
- }
else
- {
lower_slot_irq();
- }
}
WRITE_LINE_MEMBER( a2bus_ayboard_device::via2_irq_w )
{
if (state)
- {
raise_slot_irq();
- }
else
- {
lower_slot_irq();
- }
}
WRITE8_MEMBER( a2bus_ayboard_device::via1_out_a )
@@ -288,88 +232,77 @@ WRITE8_MEMBER( a2bus_ayboard_device::via1_out_a )
WRITE8_MEMBER( a2bus_ayboard_device::via1_out_b )
{
+ if (!BIT(data, 2))
+ {
+ m_ay1->reset_w(space, 0, 0);
+ }
+ else
+ {
+ switch (data & 3)
+ {
+ case 0: // BDIR=0, BC1=0 (inactive)
+ break;
+
+ case 1: // BDIR=0, BC1=1 (read PSG)
+ m_porta1 = m_ay1->read_data();
+ break;
+
+ case 2: // BDIR=1, BC1=0 (write PSG)
+ m_ay1->write_data(m_porta1);
+ break;
+
+ case 3: // BDIR=1, BC1=1 (latch)
+ m_ay1->write_address(m_porta1);
+ break;
+ }
+ }
+}
+
+WRITE8_MEMBER( a2bus_phasor_device::via1_out_b )
+{
if (!(data & 4))
{
m_ay1->reset_w(space, 0, 0);
- if (m_isPhasor && m_PhasorNative)
+ if (m_native)
{
m_ay2->reset_w(space, 0, 0);
}
}
else
{
- if (!m_isPhasor)
+ int chip_sel;
+
+ if (m_native)
+ chip_sel = (~(data >> 3) & 3);
+ else
+ chip_sel = 1;
+
+// logerror("Phasor: %02x to AY1/2 CS %02x (BDIR/BC1 %02x, data %02x)\n", m_porta1, chipSel, data & 3, data);
+ switch (data & 3)
{
- switch (data & 3)
- {
- case 0: // BDIR=0, BC1=0 (inactive)
- break;
+ case 0: // BDIR=0, BC1=0 (inactive)
+ break;
- case 1: // BDIR=0, BC1=1 (read PSG)
+ case 1: // BDIR=0, BC1=1 (read PSG)
+ if (BIT(chip_sel, 0))
m_porta1 = m_ay1->read_data();
- break;
+ if (BIT(chip_sel, 1))
+ m_porta1 = m_ay2->read_data();
+ break;
- case 2: // BDIR=1, BC1=0 (write PSG)
+ case 2: // BDIR=1, BC1=0 (write PSG)
+ if (BIT(chip_sel, 0))
m_ay1->write_data(m_porta1);
- break;
+ if (BIT(chip_sel, 1))
+ m_ay2->write_data(m_porta1);
+ break;
- case 3: // BDIR=1, BC1=1 (latch)
+ case 3: // BDIR=1, BC1=1 (latch)
+ if (BIT(chip_sel, 0))
m_ay1->write_address(m_porta1);
- break;
- }
- }
- else
- {
- int chipSel;
-
- if (m_PhasorNative)
- {
- chipSel = (~(data >> 3) & 3);
- }
- else
- {
- chipSel = 1;
- }
-
-// logerror("Phasor: %02x to AY1/2 CS %02x (BDIR/BC1 %02x, data %02x)\n", m_porta1, chipSel, data & 3, data);
- switch (data & 3)
- {
- case 0: // BDIR=0, BC1=0 (inactive)
- break;
-
- case 1: // BDIR=0, BC1=1 (read PSG)
- if (chipSel & 1)
- {
- m_porta1 = m_ay1->read_data();
- }
- if (chipSel & 2)
- {
- m_porta1 = m_ay2->read_data();
- }
- break;
-
- case 2: // BDIR=1, BC1=0 (write PSG)
- if (chipSel & 1)
- {
- m_ay1->write_data(m_porta1);
- }
- if (chipSel & 2)
- {
- m_ay2->write_data(m_porta1);
- }
- break;
-
- case 3: // BDIR=1, BC1=1 (latch)
- if (chipSel & 1)
- {
- m_ay1->write_address(m_porta1);
- }
- if (chipSel & 2)
- {
- m_ay2->write_address(m_porta1);
- }
- break;
- }
+ if (BIT(chip_sel, 1))
+ m_ay2->write_address(m_porta1);
+ break;
}
}
}
@@ -381,9 +314,37 @@ WRITE8_MEMBER( a2bus_ayboard_device::via2_out_a )
WRITE8_MEMBER( a2bus_ayboard_device::via2_out_b )
{
- if (!(data & 4))
+ if (!BIT(data, 2))
+ {
+ m_ay2->reset_w(space, 0, 0);
+ }
+ else
{
- if (m_isPhasor && m_PhasorNative)
+ switch (data & 3)
+ {
+ case 0: // BDIR=0, BC1=0 (inactive)
+ break;
+
+ case 1: // BDIR=0, BC1=1 (read PSG)
+ m_porta2 = m_ay2->read_data();
+ break;
+
+ case 2: // BDIR=1, BC1=0 (write PSG)
+ m_ay2->write_data(m_porta2);
+ break;
+
+ case 3: // BDIR=1, BC1=1 (latch)
+ m_ay2->write_data(m_porta2);
+ break;
+ }
+ }
+}
+
+WRITE8_MEMBER( a2bus_phasor_device::via2_out_b )
+{
+ if (!BIT(data, 2))
+ {
+ if (m_native)
{
m_ay3->reset_w(space, 0, 0);
m_ay4->reset_w(space, 0, 0);
@@ -395,98 +356,53 @@ WRITE8_MEMBER( a2bus_ayboard_device::via2_out_b )
}
else
{
- if (!m_isPhasor)
- {
- switch (data & 3)
- {
- case 0: // BDIR=0, BC1=0 (inactive)
- break;
-
- case 1: // BDIR=0, BC1=1 (read PSG)
- m_porta2 = m_ay2->read_data();
- break;
-
- case 2: // BDIR=1, BC1=0 (write PSG)
- m_ay2->write_data(m_porta2);
- break;
-
- case 3: // BDIR=1, BC1=1 (latch)
- m_ay2->write_data(m_porta2);
- break;
- }
- }
+ int chip_sel;
+
+ if (m_native)
+ chip_sel = (~(data >> 3) & 3);
else
+ chip_sel = 1;
+
+// logerror("Phasor: %02x to AY3/4 CS %02x (BDIR/BC1 %02x, data %02x)\n", m_porta2, chipSel, data & 3, data);
+ switch (data & 3)
{
- int chipSel;
-
- if (m_PhasorNative)
- {
- chipSel = (~(data >> 3) & 3);
- }
- else
- {
- chipSel = 1;
- }
-
-// logerror("Phasor: %02x to AY3/4 CS %02x (BDIR/BC1 %02x, data %02x)\n", m_porta2, chipSel, data & 3, data);
- switch (data & 3)
- {
- case 0: // BDIR=0, BC1=0 (inactive)
- break;
-
- case 1: // BDIR=0, BC1=1 (read PSG)
- if (chipSel & 1)
- {
- m_porta2 = m_ay3->read_data();
- }
- if (chipSel & 2)
- {
- m_porta2 = m_ay4->read_data();
- }
- break;
-
- case 2: // BDIR=1, BC1=0 (write PSG)
- if (chipSel & 1)
- {
- m_ay3->write_data(m_porta2);
- }
- if (chipSel & 2)
- {
- m_ay4->write_data(m_porta2);
- }
- break;
-
- case 3: // BDIR=1, BC1=1 (latch)
- if (chipSel & 1)
- {
- m_ay3->write_address(m_porta2);
- }
- if (chipSel & 2)
- {
- m_ay4->write_address(m_porta2);
- }
- break;
- }
+ case 0: // BDIR=0, BC1=0 (inactive)
+ break;
+
+ case 1: // BDIR=0, BC1=1 (read PSG)
+ if (BIT(chip_sel, 0))
+ m_porta2 = m_ay3->read_data();
+ if (BIT(chip_sel, 1))
+ m_porta2 = m_ay4->read_data();
+ break;
+
+ case 2: // BDIR=1, BC1=0 (write PSG)
+ if (BIT(chip_sel, 0))
+ m_ay3->write_data(m_porta2);
+ if (BIT(chip_sel, 1))
+ m_ay4->write_data(m_porta2);
+ break;
+
+ case 3: // BDIR=1, BC1=1 (latch)
+ if (BIT(chip_sel, 0))
+ m_ay3->write_address(m_porta2);
+ if (BIT(chip_sel, 1))
+ m_ay4->write_address(m_porta2);
+ break;
}
}
}
-uint8_t a2bus_ayboard_device::read_c0nx(uint8_t offset)
-{
- if (m_isPhasor)
- {
- m_PhasorNative = (offset & 1) ? true : false;
- }
+uint8_t a2bus_phasor_device::read_c0nx(uint8_t offset)
+{
+ m_native = BIT(offset, 0);
return 0xff;
}
-void a2bus_ayboard_device::write_c0nx(uint8_t offset, uint8_t data)
+void a2bus_phasor_device::write_c0nx(uint8_t offset, uint8_t data)
{
- if (m_isPhasor)
- {
- m_PhasorNative = (offset & 1) ? true : false;
- }
+ m_native = BIT(offset, 0);
}
uint8_t a2bus_echoplus_device::read_c0nx(uint8_t offset)
diff --git a/src/devices/bus/a2bus/a2mockingboard.h b/src/devices/bus/a2bus/a2mockingboard.h
index f647f1fc7a4..b7d6b7f3b97 100644
--- a/src/devices/bus/a2bus/a2mockingboard.h
+++ b/src/devices/bus/a2bus/a2mockingboard.h
@@ -28,9 +28,9 @@ public:
DECLARE_WRITE_LINE_MEMBER( via1_irq_w );
DECLARE_WRITE_LINE_MEMBER( via2_irq_w );
DECLARE_WRITE8_MEMBER(via1_out_a);
- DECLARE_WRITE8_MEMBER(via1_out_b);
+ virtual DECLARE_WRITE8_MEMBER(via1_out_b);
DECLARE_WRITE8_MEMBER(via2_out_a);
- DECLARE_WRITE8_MEMBER(via2_out_b);
+ virtual DECLARE_WRITE8_MEMBER(via2_out_b);
protected:
// construction/destruction
@@ -41,22 +41,20 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
// overrides of standard a2bus slot functions
- virtual uint8_t read_c0nx(uint8_t offset) override;
- virtual void write_c0nx(uint8_t offset, uint8_t data) override;
+ virtual uint8_t read_c0nx(uint8_t offset) override { return 0xff; }
+ virtual void write_c0nx(uint8_t offset, uint8_t data) override { }
virtual uint8_t read_cnxx(uint8_t offset) override;
virtual void write_cnxx(uint8_t offset, uint8_t data) override;
+ void add_common_devices(machine_config &config);
+
required_device<via6522_device> m_via1;
required_device<via6522_device> m_via2;
required_device<ay8913_device> m_ay1;
required_device<ay8913_device> m_ay2;
- optional_device<ay8913_device> m_ay3;
- optional_device<ay8913_device> m_ay4;
-
- bool m_isPhasor, m_PhasorNative;
-private:
- uint8_t m_porta1, m_porta2;
+ uint8_t m_porta1;
+ uint8_t m_porta2;
};
class a2bus_mockingboard_device : public a2bus_ayboard_device
@@ -70,8 +68,22 @@ class a2bus_phasor_device : public a2bus_ayboard_device
public:
a2bus_phasor_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ DECLARE_WRITE8_MEMBER(via1_out_b) override;
+ DECLARE_WRITE8_MEMBER(via2_out_b) override;
+
protected:
virtual void device_add_mconfig(machine_config &config) override;
+
+ virtual uint8_t read_c0nx(uint8_t offset) override;
+ virtual void write_c0nx(uint8_t offset, uint8_t data) override;
+ virtual uint8_t read_cnxx(uint8_t offset) override;
+ virtual void write_cnxx(uint8_t offset, uint8_t data) override;
+
+ required_device<ay8913_device> m_ay3;
+ required_device<ay8913_device> m_ay4;
+
+private:
+ bool m_native;
};
class a2bus_echoplus_device : public a2bus_ayboard_device
diff --git a/src/devices/bus/bbc/tube/tube_zep100.cpp b/src/devices/bus/bbc/tube/tube_zep100.cpp
index 000af70de85..2096019c671 100644
--- a/src/devices/bus/bbc/tube/tube_zep100.cpp
+++ b/src/devices/bus/bbc/tube/tube_zep100.cpp
@@ -57,30 +57,31 @@ ROM_END
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(bbc_tube_zep100_device::device_add_mconfig)
- MCFG_DEVICE_ADD("z80", Z80, XTAL(4'000'000))
- MCFG_DEVICE_PROGRAM_MAP(tube_zep100_mem)
- MCFG_DEVICE_IO_MAP(tube_zep100_io)
-
- MCFG_DEVICE_ADD("via", VIA6522, XTAL(4'000'000) / 2)
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, bbc_tube_zep100_device, via_pb_w))
- MCFG_VIA6522_CB2_HANDLER(WRITELINE("ppi", i8255_device, pc2_w))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE("ppi", i8255_device, pc6_w))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE(DEVICE_SELF_OWNER, bbc_tube_slot_device, irq_w))
-
- MCFG_DEVICE_ADD("ppi", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8("via", via6522_device, write_pa))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, bbc_tube_zep100_device, ppi_pb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, bbc_tube_zep100_device, ppi_pc_w))
+void bbc_tube_zep100_device::device_add_mconfig(machine_config &config)
+{
+ Z80(config, m_z80, XTAL(4'000'000));
+ m_z80->set_addrmap(AS_PROGRAM, &bbc_tube_zep100_device::tube_zep100_mem);
+ m_z80->set_addrmap(AS_IO, &bbc_tube_zep100_device::tube_zep100_io);
+
+ VIA6522(config, m_via, XTAL(4'000'000) / 2);
+ m_via->writepb_handler().set(FUNC(bbc_tube_zep100_device::via_pb_w));
+ m_via->cb2_handler().set(m_ppi, FUNC(i8255_device::pc2_w));
+ m_via->ca2_handler().set(m_ppi, FUNC(i8255_device::pc6_w));
+ m_via->irq_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_tube_slot_device::irq_w));
+
+ I8255A(config, m_ppi, 0);
+ m_ppi->out_pa_callback().set(m_via, FUNC(via6522_device::write_pa));
+ m_ppi->in_pb_callback().set(FUNC(bbc_tube_zep100_device::ppi_pb_r));
+ m_ppi->out_pc_callback().set(FUNC(bbc_tube_zep100_device::ppi_pc_w));
/* internal ram */
- MCFG_RAM_ADD(RAM_TAG)
- MCFG_RAM_DEFAULT_SIZE("64K")
- MCFG_RAM_DEFAULT_VALUE(0x00)
+ RAM(config, m_ram);
+ m_ram->set_default_size("64K");
+ m_ram->set_default_value(0x00);
/* software lists */
- MCFG_SOFTWARE_LIST_ADD("flop_ls_torch", "bbc_flop_torch")
-MACHINE_CONFIG_END
+ SOFTWARE_LIST(config, "flop_ls_torch").set_type("bbc_flop_torch", SOFTWARE_LIST_ORIGINAL_SYSTEM);
+}
//-------------------------------------------------
// rom_region - device-specific ROM region
diff --git a/src/devices/bus/bbc/tube/tube_zep100.h b/src/devices/bus/bbc/tube/tube_zep100.h
index af6cae2d78d..5f6ddca8b09 100644
--- a/src/devices/bus/bbc/tube/tube_zep100.h
+++ b/src/devices/bus/bbc/tube/tube_zep100.h
@@ -45,7 +45,7 @@ protected:
virtual DECLARE_WRITE8_MEMBER( host_w ) override;
private:
- required_device<cpu_device> m_z80;
+ required_device<z80_device> m_z80;
required_device<via6522_device> m_via;
required_device<i8255_device> m_ppi;
required_device<ram_device> m_ram;
diff --git a/src/devices/bus/cbmiec/fd2000.cpp b/src/devices/bus/cbmiec/fd2000.cpp
index 94256ad02d1..2cecbec41e2 100644
--- a/src/devices/bus/cbmiec/fd2000.cpp
+++ b/src/devices/bus/cbmiec/fd2000.cpp
@@ -215,36 +215,32 @@ FLOPPY_FORMATS_END
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(fd2000_device::device_add_mconfig)
- MCFG_DEVICE_ADD(G65SC02PI2_TAG, M65C02, XTAL(24'000'000)/12)
- MCFG_DEVICE_PROGRAM_MAP(fd2000_mem)
-
- MCFG_DEVICE_ADD(G65SC22P2_TAG, VIA6522, XTAL(24'000'000)/12)
- MCFG_VIA6522_READPA_HANDLER(READ8(*this, fd2000_device, via_pa_r))
- MCFG_VIA6522_READPB_HANDLER(READ8(*this, fd2000_device, via_pb_r))
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, fd2000_device, via_pa_w))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, fd2000_device, via_pb_w))
-
- MCFG_DP8473_ADD(DP8473V_TAG)
-
- MCFG_FLOPPY_DRIVE_ADD_FIXED(DP8473V_TAG":0", fd2000_floppies, "35hd", floppy_image_device::default_floppy_formats)//fd2000_device::floppy_formats)
-MACHINE_CONFIG_END
-
+void fd2000_device::add_common_devices(machine_config &config)
+{
+ M65C02(config, m_maincpu, XTAL(24'000'000)/12);
-MACHINE_CONFIG_START(fd4000_device::device_add_mconfig)
- MCFG_DEVICE_ADD(R65C02P4_TAG, M65C02, XTAL(24'000'000)/6)
- MCFG_DEVICE_PROGRAM_MAP(fd4000_mem)
+ via6522_device &via(VIA6522(config, G65SC22P2_TAG, XTAL(24'000'000)/12));
+ via.readpa_handler().set(FUNC(fd2000_device::via_pa_r));
+ via.readpb_handler().set(FUNC(fd2000_device::via_pb_r));
+ via.writepa_handler().set(FUNC(fd2000_device::via_pa_w));
+ via.writepb_handler().set(FUNC(fd2000_device::via_pb_w));
- MCFG_DEVICE_ADD(G65SC22P2_TAG, VIA6522, XTAL(24'000'000)/12)
- MCFG_VIA6522_READPA_HANDLER(READ8(*this, fd2000_device, via_pa_r))
- MCFG_VIA6522_READPB_HANDLER(READ8(*this, fd2000_device, via_pb_r))
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, fd2000_device, via_pa_w))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, fd2000_device, via_pb_w))
+ DP8473(config, m_fdc, 0);
+}
- MCFG_PC8477A_ADD(PC8477AV1_TAG)
+void fd2000_device::device_add_mconfig(machine_config &config)
+{
+ add_common_devices(config);
+ m_maincpu->set_addrmap(AS_PROGRAM, &fd2000_device::fd2000_mem);
+ FLOPPY_CONNECTOR(config, DP8473V_TAG":0", fd2000_floppies, "35hd", floppy_image_device::default_floppy_formats);//fd2000_device::floppy_formats);
+}
- MCFG_FLOPPY_DRIVE_ADD_FIXED(PC8477AV1_TAG":0", fd4000_floppies, "35ed", floppy_image_device::default_floppy_formats)//fd2000_device::floppy_formats)
-MACHINE_CONFIG_END
+void fd4000_device::device_add_mconfig(machine_config &config)
+{
+ add_common_devices(config);
+ m_maincpu->set_addrmap(AS_PROGRAM, &fd4000_device::fd4000_mem);
+ FLOPPY_CONNECTOR(config, DP8473V_TAG":0", fd4000_floppies, "35hd", floppy_image_device::default_floppy_formats);//fd2000_device::floppy_formats);
+}
//**************************************************************************
diff --git a/src/devices/bus/cbmiec/fd2000.h b/src/devices/bus/cbmiec/fd2000.h
index 740c1ce6441..2b79a93dd70 100644
--- a/src/devices/bus/cbmiec/fd2000.h
+++ b/src/devices/bus/cbmiec/fd2000.h
@@ -64,6 +64,8 @@ protected:
void cbm_iec_data(int state) override;
void cbm_iec_reset(int state) override;
+ void add_common_devices(machine_config &config);
+
required_device<m65c02_device> m_maincpu;
required_device<upd765_family_device> m_fdc;
required_device<floppy_connector> m_floppy0;
diff --git a/src/devices/bus/electron/m2105.cpp b/src/devices/bus/electron/m2105.cpp
index 4a0dd4a762e..c4887527927 100644
--- a/src/devices/bus/electron/m2105.cpp
+++ b/src/devices/bus/electron/m2105.cpp
@@ -54,49 +54,51 @@ ROM_END
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(electron_m2105_device::device_add_mconfig)
+void electron_m2105_device::device_add_mconfig(machine_config &config)
+{
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_INPUT_MERGER_ANY_HIGH("irqs")
- MCFG_INPUT_MERGER_OUTPUT_HANDLER(WRITELINE(*this, electron_m2105_device, intrq_w))
+ INPUT_MERGER_ANY_HIGH(config, m_irqs);
+ m_irqs->output_handler().set(FUNC(electron_m2105_device::intrq_w));
/* system via */
- MCFG_DEVICE_ADD("via6522_0", VIA6522, 1000000)
- /*MCFG_VIA6522_READPA_HANDLER(READ8(*this, electron_m2105_device, m2105_via_system_read_porta))
- MCFG_VIA6522_READPB_HANDLER(READ8(*this, electron_m2105_device, m2105_via_system_read_portb))
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, electron_m2105_device, m2105_via_system_write_porta))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, electron_m2105_device, m2105_via_system_write_portb))*/
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE("irqs", input_merger_device, in_w<0>))
+ VIA6522(config, m_via6522_0, 1000000);
+ /*m_via6522_0->readpa_handler().set(FUNC(electron_m2105_device::m2105_via_system_read_porta));
+ m_via6522_0->readpb_handler().set(FUNC(electron_m2105_device::m2105_via_system_read_portb));
+ m_via6522_0->writepa_handler().set(FUNC(electron_m2105_device::m2105_via_system_write_porta));
+ m_via6522_0->writepb_handler().set(FUNC(electron_m2105_device::m2105_via_system_write_portb));*/
+ m_via6522_0->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<0>));
/* user via */
- MCFG_DEVICE_ADD("via6522_1", VIA6522, 1000000)
- //MCFG_VIA6522_READPB_HANDLER(READ8(*this, electron_m2105_device, m2105_via_user_read_portb))
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8("cent_data_out", output_latch_device, bus_w))
- //MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, electron_m2105_device, m2105_via_user_write_portb))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE(m_centronics, centronics_device, write_strobe))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE("irqs", input_merger_device, in_w<1>))
+ VIA6522(config, m_via6522_1, 1000000);
+ //m_via6522_1->readpb_handler().set(FUNC(electron_m2105_device::m2105_via_user_read_portb));
+ m_via6522_1->writepa_handler().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ //m_via6522_1->writepb_handler().set(FUNC(electron_m2105_device::m2105_via_user_write_portb));
+ m_via6522_1->ca2_handler().set(m_centronics, FUNC(centronics_device::write_strobe));
+ m_via6522_1->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<1>));
/* duart */
- MCFG_DEVICE_ADD("duart", SCN2681, XTAL(3'686'400))
- MCFG_MC68681_IRQ_CALLBACK(WRITELINE("irqs", input_merger_device, in_w<2>))
- MCFG_MC68681_A_TX_CALLBACK(WRITELINE("rs232", rs232_port_device, write_txd))
- //MCFG_MC68681_OUTPORT_CALLBACK(WRITE8(*this, electron_m2105_device, sio_out_w))
+ SCN2681(config, m_duart, XTAL(3'686'400));
+ m_duart->irq_cb().set(m_irqs, FUNC(input_merger_device::in_w<2>));
+ m_duart->a_tx_cb().set("rs232", FUNC(rs232_port_device::write_txd));
+ //m_duart->outport_cb().set(FUNC(electron_m2105_device::sio_out_w));
- MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE("duart", scn2681_device, rx_a_w))
+ rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, nullptr));
+ rs232.rxd_handler().set(m_duart, FUNC(scn2681_device::rx_a_w));
/* printer */
CENTRONICS(config, m_centronics, centronics_devices, "printer");
m_centronics->ack_handler().set(m_via6522_1, FUNC(via6522_device::write_ca1)).invert(); // ack seems to be inverted?
- MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
+ output_latch_device &latch(OUTPUT_LATCH(config, "cent_data_out"));
+ m_centronics->set_output_latch(latch);
/* speech hardware */
- MCFG_DEVICE_ADD("vsm", SPEECHROM, 0)
- MCFG_DEVICE_ADD("tms5220", TMS5220, 640000)
- MCFG_TMS52XX_SPEECHROM("vsm")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-MACHINE_CONFIG_END
+ SPEECHROM(config, "vsm", 0);
+ TMS5220(config, m_tms, 640000);
+ m_tms->set_speechrom_tag("vsm");
+ m_tms->add_route(ALL_OUTPUTS, "mono", 1.0);
+}
const tiny_rom_entry *electron_m2105_device::device_rom_region() const
{
diff --git a/src/devices/bus/ieee488/c2040.cpp b/src/devices/bus/ieee488/c2040.cpp
index 0348912b9c2..383091e3d92 100644
--- a/src/devices/bus/ieee488/c2040.cpp
+++ b/src/devices/bus/ieee488/c2040.cpp
@@ -450,133 +450,67 @@ FLOPPY_FORMATS_END
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(c2040_device::device_add_mconfig)
- // DOS
- MCFG_DEVICE_ADD(M6502_TAG, M6502, XTAL(16'000'000)/16)
- MCFG_DEVICE_PROGRAM_MAP(c2040_main_mem)
-
- MCFG_DEVICE_ADD(M6532_0_TAG, MOS6532_NEW, XTAL(16'000'000)/16)
- MCFG_MOS6530n_IN_PA_CB(READ8(*this, c2040_device, dio_r))
- MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, c2040_device, dio_w))
-
- MCFG_DEVICE_ADD(M6532_1_TAG, MOS6532_NEW, XTAL(16'000'000)/16)
- MCFG_MOS6530n_IN_PA_CB(READ8(*this, c2040_device, riot1_pa_r))
- MCFG_MOS6530n_OUT_PA_CB(WRITE8(*this, c2040_device, riot1_pa_w))
- MCFG_MOS6530n_IN_PB_CB(READ8(*this, c2040_device, riot1_pb_r))
- MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, c2040_device, riot1_pb_w))
- MCFG_MOS6530n_IRQ_CB(INPUTLINE(M6502_TAG, INPUT_LINE_IRQ0))
-
- // controller
- MCFG_DEVICE_ADD(M6504_TAG, M6504, XTAL(16'000'000)/16)
- MCFG_DEVICE_PROGRAM_MAP(c2040_fdc_mem)
-
- MCFG_DEVICE_ADD(M6522_TAG, VIA6522, XTAL(16'000'000)/16)
- MCFG_VIA6522_READPA_HANDLER(READ8(FDC_TAG, c2040_fdc_device, read))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, c2040_device, via_pb_w))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE(FDC_TAG, c2040_fdc_device, mode_sel_w))
- MCFG_VIA6522_CB2_HANDLER(WRITELINE(FDC_TAG, c2040_fdc_device, rw_sel_w))
-
- MCFG_DEVICE_ADD(M6530_TAG, MOS6530_NEW, XTAL(16'000'000)/16)
- MCFG_MOS6530n_OUT_PA_CB(WRITE8(FDC_TAG, c2040_fdc_device, write))
- MCFG_MOS6530n_OUT_PB0_CB(WRITELINE(FDC_TAG, c2040_fdc_device, drv_sel_w))
- MCFG_MOS6530n_OUT_PB1_CB(WRITELINE(FDC_TAG, c2040_fdc_device, ds0_w))
- MCFG_MOS6530n_OUT_PB2_CB(WRITELINE(FDC_TAG, c2040_fdc_device, ds1_w))
- MCFG_MOS6530n_OUT_PB7_CB(INPUTLINE(M6504_TAG, M6502_IRQ_LINE))
- MCFG_MOS6530n_IN_PB3_CB(READLINE(FDC_TAG, c2040_fdc_device, wps_r))
-
- MCFG_DEVICE_ADD(FDC_TAG, C2040_FDC, XTAL(16'000'000))
- MCFG_C2040_SYNC_CALLBACK(WRITELINE(M6530_TAG, mos6530_new_device, pb6_w))
- MCFG_C2040_READY_CALLBACK(WRITELINE(M6522_TAG, via6522_device, write_ca1))
- MCFG_C2040_ERROR_CALLBACK(WRITELINE(M6522_TAG, via6522_device, write_cb1))
- MCFG_FLOPPY_DRIVE_ADD_FIXED(FDC_TAG":0", c2040_floppies, "525ssqd", c2040_device::floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD_FIXED(FDC_TAG":1", c2040_floppies, "525ssqd", c2040_device::floppy_formats)
-MACHINE_CONFIG_END
-
-
-MACHINE_CONFIG_START(c3040_device::device_add_mconfig)
+void c2040_device::add_common_devices(machine_config &config)
+{
// DOS
- MCFG_DEVICE_ADD(M6502_TAG, M6502, XTAL(16'000'000)/16)
- MCFG_DEVICE_PROGRAM_MAP(c2040_main_mem)
+ M6502(config, m_maincpu, XTAL(16'000'000)/16);
+ m_maincpu->set_addrmap(AS_PROGRAM, &c2040_device::c2040_main_mem);
- MCFG_DEVICE_ADD(M6532_0_TAG, MOS6532_NEW, XTAL(16'000'000)/16)
- MCFG_MOS6530n_IN_PA_CB(READ8(*this, c2040_device, dio_r))
- MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, c2040_device, dio_w))
+ MOS6532_NEW(config, m_riot0, XTAL(16'000'000)/16);
+ m_riot0->pa_rd_callback().set(FUNC(c2040_device::dio_r));
+ m_riot0->pb_wr_callback().set(FUNC(c2040_device::dio_w));
- MCFG_DEVICE_ADD(M6532_1_TAG, MOS6532_NEW, XTAL(16'000'000)/16)
- MCFG_MOS6530n_IN_PA_CB(READ8(*this, c2040_device, riot1_pa_r))
- MCFG_MOS6530n_OUT_PA_CB(WRITE8(*this, c2040_device, riot1_pa_w))
- MCFG_MOS6530n_IN_PB_CB(READ8(*this, c2040_device, riot1_pb_r))
- MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, c2040_device, riot1_pb_w))
- MCFG_MOS6530n_IRQ_CB(INPUTLINE(M6502_TAG, INPUT_LINE_IRQ0))
+ MOS6532_NEW(config, m_riot1, XTAL(16'000'000)/16);
+ m_riot1->pa_rd_callback().set(FUNC(c2040_device::riot1_pa_r));
+ m_riot1->pa_wr_callback().set(FUNC(c2040_device::riot1_pa_w));
+ m_riot1->pb_rd_callback().set(FUNC(c2040_device::riot1_pb_r));
+ m_riot1->pb_wr_callback().set(FUNC(c2040_device::riot1_pb_w));
+ m_riot1->irq_wr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
// controller
- MCFG_DEVICE_ADD(M6504_TAG, M6504, XTAL(16'000'000)/16)
- MCFG_DEVICE_PROGRAM_MAP(c2040_fdc_mem)
-
- MCFG_DEVICE_ADD(M6522_TAG, VIA6522, XTAL(16'000'000)/16)
- MCFG_VIA6522_READPA_HANDLER(READ8(FDC_TAG, c2040_fdc_device, read))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, c2040_device, via_pb_w))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE(FDC_TAG, c2040_fdc_device, mode_sel_w))
- MCFG_VIA6522_CB2_HANDLER(WRITELINE(FDC_TAG, c2040_fdc_device, rw_sel_w))
-
- MCFG_DEVICE_ADD(M6530_TAG, MOS6530_NEW, XTAL(16'000'000)/16)
- MCFG_MOS6530n_OUT_PA_CB(WRITE8(FDC_TAG, c2040_fdc_device, write))
- MCFG_MOS6530n_OUT_PB0_CB(WRITELINE(FDC_TAG, c2040_fdc_device, drv_sel_w))
- MCFG_MOS6530n_OUT_PB1_CB(WRITELINE(FDC_TAG, c2040_fdc_device, ds0_w))
- MCFG_MOS6530n_OUT_PB2_CB(WRITELINE(FDC_TAG, c2040_fdc_device, ds1_w))
- MCFG_MOS6530n_IN_PB3_CB(READLINE(FDC_TAG, c2040_fdc_device, wps_r))
- MCFG_MOS6530n_OUT_PB7_CB(INPUTLINE(M6504_TAG, M6502_IRQ_LINE))
-
- MCFG_DEVICE_ADD(FDC_TAG, C2040_FDC, XTAL(16'000'000))
- MCFG_C2040_SYNC_CALLBACK(WRITELINE(M6530_TAG, mos6530_new_device, pb6_w))
- MCFG_C2040_READY_CALLBACK(WRITELINE(M6522_TAG, via6522_device, write_ca1))
- MCFG_C2040_ERROR_CALLBACK(WRITELINE(M6522_TAG, via6522_device, write_cb1))
- MCFG_FLOPPY_DRIVE_ADD_FIXED(FDC_TAG":0", c2040_floppies, "525ssqd", c3040_device::floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD_FIXED(FDC_TAG":1", c2040_floppies, "525ssqd", c3040_device::floppy_formats)
-MACHINE_CONFIG_END
-
-
-MACHINE_CONFIG_START(c4040_device::device_add_mconfig)
- // DOS
- MCFG_DEVICE_ADD(M6502_TAG, M6502, XTAL(16'000'000)/16)
- MCFG_DEVICE_PROGRAM_MAP(c2040_main_mem)
+ M6504(config, m_fdccpu, XTAL(16'000'000)/16);
+ m_fdccpu->set_addrmap(AS_PROGRAM, &c2040_device::c2040_fdc_mem);
+
+ VIA6522(config, m_via, XTAL(16'000'000)/16);
+ m_via->readpa_handler().set(m_fdc, FUNC(c2040_fdc_device::read));
+ m_via->writepb_handler().set(FUNC(c2040_device::via_pb_w));
+ m_via->ca2_handler().set(m_fdc, FUNC(c2040_fdc_device::mode_sel_w));
+ m_via->cb2_handler().set(m_fdc, FUNC(c2040_fdc_device::rw_sel_w));
+
+ MOS6530_NEW(config, m_miot, XTAL(16'000'000)/16);
+ m_miot->pa_wr_callback().set(m_fdc, FUNC(c2040_fdc_device::write));
+ m_miot->pb_wr_callback<0>().set(m_fdc, FUNC(c2040_fdc_device::drv_sel_w));
+ m_miot->pb_wr_callback<1>().set(m_fdc, FUNC(c2040_fdc_device::ds0_w));
+ m_miot->pb_wr_callback<2>().set(m_fdc, FUNC(c2040_fdc_device::ds1_w));
+ m_miot->pb_wr_callback<7>().set_inputline(m_fdccpu, M6502_IRQ_LINE);
+ m_miot->pb_rd_callback<3>().set(m_fdc, FUNC(c2040_fdc_device::wps_r));
+
+ C2040_FDC(config, m_fdc, XTAL(16'000'000));
+ m_fdc->sync_wr_callback().set(m_miot, FUNC(mos6530_new_device::pb6_w));
+ m_fdc->ready_wr_callback().set(m_via, FUNC(via6522_device::write_ca1));
+ m_fdc->error_wr_callback().set(m_via, FUNC(via6522_device::write_cb1));
+}
- MCFG_DEVICE_ADD(M6532_0_TAG, MOS6532_NEW, XTAL(16'000'000)/16)
- MCFG_MOS6530n_IN_PA_CB(READ8(*this, c2040_device, dio_r))
- MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, c2040_device, dio_w))
+void c2040_device::device_add_mconfig(machine_config &config)
+{
+ add_common_devices(config);
+ FLOPPY_CONNECTOR(config, FDC_TAG":0", c2040_floppies, "525ssqd", c2040_device::floppy_formats);
+ FLOPPY_CONNECTOR(config, FDC_TAG":1", c2040_floppies, "525ssqd", c2040_device::floppy_formats);
+}
- MCFG_DEVICE_ADD(M6532_1_TAG, MOS6532_NEW, XTAL(16'000'000)/16)
- MCFG_MOS6530n_IN_PA_CB(READ8(*this, c2040_device, riot1_pa_r))
- MCFG_MOS6530n_OUT_PA_CB(WRITE8(*this, c2040_device, riot1_pa_w))
- MCFG_MOS6530n_IN_PB_CB(READ8(*this, c2040_device, riot1_pb_r))
- MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, c2040_device, riot1_pb_w))
- MCFG_MOS6530n_IRQ_CB(INPUTLINE(M6502_TAG, INPUT_LINE_IRQ0))
+void c3040_device::device_add_mconfig(machine_config &config)
+{
+ add_common_devices(config);
+ FLOPPY_CONNECTOR(config, FDC_TAG":0", c2040_floppies, "525ssqd", c3040_device::floppy_formats);
+ FLOPPY_CONNECTOR(config, FDC_TAG":1", c2040_floppies, "525ssqd", c3040_device::floppy_formats);
+}
- // controller
- MCFG_DEVICE_ADD(M6504_TAG, M6504, XTAL(16'000'000)/16)
- MCFG_DEVICE_PROGRAM_MAP(c2040_fdc_mem)
-
- MCFG_DEVICE_ADD(M6522_TAG, VIA6522, XTAL(16'000'000)/16)
- MCFG_VIA6522_READPA_HANDLER(READ8(FDC_TAG, c2040_fdc_device, read))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, c2040_device, via_pb_w))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE(FDC_TAG, c2040_fdc_device, mode_sel_w))
- MCFG_VIA6522_CB2_HANDLER(WRITELINE(FDC_TAG, c2040_fdc_device, rw_sel_w))
-
- MCFG_DEVICE_ADD(M6530_TAG, MOS6530_NEW, XTAL(16'000'000)/16)
- MCFG_MOS6530n_OUT_PA_CB(WRITE8(FDC_TAG, c2040_fdc_device, write))
- MCFG_MOS6530n_OUT_PB0_CB(WRITELINE(FDC_TAG, c2040_fdc_device, drv_sel_w))
- MCFG_MOS6530n_OUT_PB1_CB(WRITELINE(FDC_TAG, c2040_fdc_device, ds0_w))
- MCFG_MOS6530n_OUT_PB2_CB(WRITELINE(FDC_TAG, c2040_fdc_device, ds1_w))
- MCFG_MOS6530n_IN_PB3_CB(READLINE(FDC_TAG, c2040_fdc_device, wps_r))
- MCFG_MOS6530n_OUT_PB7_CB(INPUTLINE(M6504_TAG, M6502_IRQ_LINE))
-
- MCFG_DEVICE_ADD(FDC_TAG, C2040_FDC, XTAL(16'000'000))
- MCFG_C2040_SYNC_CALLBACK(WRITELINE(M6530_TAG, mos6530_new_device, pb6_w))
- MCFG_C2040_READY_CALLBACK(WRITELINE(M6522_TAG, via6522_device, write_ca1))
- MCFG_C2040_ERROR_CALLBACK(WRITELINE(M6522_TAG, via6522_device, write_cb1))
- MCFG_FLOPPY_DRIVE_ADD_FIXED(FDC_TAG":0", c2040_floppies, "525ssqd", c4040_device::floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD_FIXED(FDC_TAG":1", c2040_floppies, "525ssqd", c4040_device::floppy_formats)
-MACHINE_CONFIG_END
+void c4040_device::device_add_mconfig(machine_config &config)
+{
+ add_common_devices(config);
+ FLOPPY_CONNECTOR(config, FDC_TAG":0", c2040_floppies, "525ssqd", c4040_device::floppy_formats);
+ FLOPPY_CONNECTOR(config, FDC_TAG":1", c2040_floppies, "525ssqd", c4040_device::floppy_formats);
+}
//-------------------------------------------------
diff --git a/src/devices/bus/ieee488/c2040.h b/src/devices/bus/ieee488/c2040.h
index dd72623c150..1b7c1c69618 100644
--- a/src/devices/bus/ieee488/c2040.h
+++ b/src/devices/bus/ieee488/c2040.h
@@ -66,6 +66,7 @@ protected:
LED_ERR
};
+ void add_common_devices(machine_config &config);
inline void update_ieee_signals();
DECLARE_FLOPPY_FORMATS( floppy_formats );
diff --git a/src/devices/bus/ieee488/c2040fdc.h b/src/devices/bus/ieee488/c2040fdc.h
index 7e27f1f1b81..c73e9826fbf 100644
--- a/src/devices/bus/ieee488/c2040fdc.h
+++ b/src/devices/bus/ieee488/c2040fdc.h
@@ -49,6 +49,9 @@ public:
template <class Object> devcb_base &set_sync_wr_callback(Object &&cb) { return m_write_sync.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_ready_wr_callback(Object &&cb) { return m_write_ready.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_error_wr_callback(Object &&cb) { return m_write_error.set_callback(std::forward<Object>(cb)); }
+ auto sync_wr_callback() { return m_write_sync.bind(); }
+ auto ready_wr_callback() { return m_write_ready.bind(); }
+ auto error_wr_callback() { return m_write_error.bind(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/bus/ieee488/c8050.cpp b/src/devices/bus/ieee488/c8050.cpp
index 94d8e9a89dc..9594b26cf7e 100644
--- a/src/devices/bus/ieee488/c8050.cpp
+++ b/src/devices/bus/ieee488/c8050.cpp
@@ -528,39 +528,34 @@ FLOPPY_FORMATS_MEMBER( sfd1001_device::floppy_formats )
FLOPPY_FORMATS_END
-//-------------------------------------------------
-// device_add_mconfig - add device configuration
-//-------------------------------------------------
-
-MACHINE_CONFIG_START(c8050_device::device_add_mconfig)
+void c8050_device::add_common_devices(machine_config &config)
+{
// DOS
- MCFG_DEVICE_ADD(M6502_TAG, M6502, XTAL(12'000'000)/12)
- MCFG_DEVICE_PROGRAM_MAP(c8050_main_mem)
+ M6502(config, m_maincpu, XTAL(12'000'000)/12);
+ m_maincpu->set_addrmap(AS_PROGRAM, &c8050_device::c8050_main_mem);
- MCFG_DEVICE_ADD(M6532_0_TAG, MOS6532_NEW, XTAL(12'000'000)/12)
- MCFG_MOS6530n_IN_PA_CB(READ8(*this, c8050_device, dio_r))
- MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, c8050_device, dio_w))
+ MOS6532_NEW(config, m_riot0, XTAL(12'000'000)/12);
+ m_riot0->pa_rd_callback().set(FUNC(c8050_device::dio_r));
+ m_riot0->pb_wr_callback().set(FUNC(c8050_device::dio_w));
- MCFG_DEVICE_ADD(M6532_1_TAG, MOS6532_NEW, XTAL(12'000'000)/12)
- MCFG_MOS6530n_IN_PA_CB(READ8(*this, c8050_device, riot1_pa_r))
- MCFG_MOS6530n_OUT_PA_CB(WRITE8(*this, c8050_device, riot1_pa_w))
- MCFG_MOS6530n_IN_PB_CB(READ8(*this, c8050_device, riot1_pb_r))
- MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, c8050_device, riot1_pb_w))
- MCFG_MOS6530n_IRQ_CB(INPUTLINE(M6502_TAG, INPUT_LINE_IRQ0))
+ MOS6532_NEW(config, m_riot1, XTAL(12'000'000)/12);
+ m_riot1->pa_rd_callback().set(FUNC(c8050_device::riot1_pa_r));
+ m_riot1->pa_wr_callback().set(FUNC(c8050_device::riot1_pa_w));
+ m_riot1->pb_rd_callback().set(FUNC(c8050_device::riot1_pb_r));
+ m_riot1->pb_wr_callback().set(FUNC(c8050_device::riot1_pb_w));
+ m_riot1->irq_wr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
// controller
- MCFG_DEVICE_ADD(m_fdccpu, M6504, XTAL(12'000'000)/12)
- MCFG_DEVICE_PROGRAM_MAP(c8050_fdc_mem)
+ M6504(config, m_fdccpu, XTAL(12'000'000)/12);
- MCFG_DEVICE_ADD(m_via, VIA6522, XTAL(12'000'000)/12)
- MCFG_VIA6522_READPA_HANDLER(READ8(m_fdc, c8050_fdc_device, read))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, c8050_device, via_pb_w))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE(m_fdc, c8050_fdc_device, mode_sel_w))
- MCFG_VIA6522_CB2_HANDLER(WRITELINE(m_fdc, c8050_fdc_device, rw_sel_w))
+ VIA6522(config, m_via, XTAL(12'000'000)/12);
+ m_via->readpa_handler().set(m_fdc, FUNC(c8050_fdc_device::read));
+ m_via->writepb_handler().set(FUNC(c8050_device::via_pb_w));
+ m_via->ca2_handler().set(m_fdc, FUNC(c8050_fdc_device::mode_sel_w));
+ m_via->cb2_handler().set(m_fdc, FUNC(c8050_fdc_device::rw_sel_w));
MOS6530_NEW(config, m_miot, XTAL(12'000'000)/12);
m_miot->pa_wr_callback().set(m_fdc, FUNC(c8050_fdc_device::write));
- m_miot->pb_wr_callback<0>().set(m_fdc, FUNC(c8050_fdc_device::drv_sel_w));
m_miot->pb_wr_callback<1>().set(m_fdc, FUNC(c8050_fdc_device::ds0_w));
m_miot->pb_wr_callback<2>().set(m_fdc, FUNC(c8050_fdc_device::ds1_w));
m_miot->pb_rd_callback<3>().set(m_fdc, FUNC(c8050_fdc_device::wps_r));
@@ -572,145 +567,56 @@ MACHINE_CONFIG_START(c8050_device::device_add_mconfig)
m_fdc->ready_wr_callback().set(m_via, FUNC(via6522_device::write_ca1));
m_fdc->brdy_wr_callback().set_inputline(m_fdccpu, M6502_SET_OVERFLOW).invert();
m_fdc->error_wr_callback().set(m_via, FUNC(via6522_device::write_cb1));
- MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":0", c8050_floppies, "525ssqd", c8050_device::floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":1", c8050_floppies, "525ssqd", c8050_device::floppy_formats)
-MACHINE_CONFIG_END
-
-
-MACHINE_CONFIG_START(c8250_device::device_add_mconfig)
- // DOS
- MCFG_DEVICE_ADD(M6502_TAG, M6502, XTAL(12'000'000)/12)
- MCFG_DEVICE_PROGRAM_MAP(c8050_main_mem)
+}
- MCFG_DEVICE_ADD(M6532_0_TAG, MOS6532_NEW, XTAL(12'000'000)/12)
- MCFG_MOS6530n_IN_PA_CB(READ8(*this, c8050_device, dio_r))
- MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, c8050_device, dio_w))
+void c8050_device::device_add_mconfig(machine_config &config)
+{
+ add_common_devices(config);
+ m_fdccpu->set_addrmap(AS_PROGRAM, &c8050_device::c8050_fdc_mem);
- MCFG_DEVICE_ADD(M6532_1_TAG, MOS6532_NEW, XTAL(12'000'000)/12)
- MCFG_MOS6530n_IN_PA_CB(READ8(*this, c8050_device, riot1_pa_r))
- MCFG_MOS6530n_OUT_PA_CB(WRITE8(*this, c8050_device, riot1_pa_w))
- MCFG_MOS6530n_IN_PB_CB(READ8(*this, c8050_device, riot1_pb_r))
- MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, c8050_device, riot1_pb_w))
- MCFG_MOS6530n_IRQ_CB(INPUTLINE(M6502_TAG, INPUT_LINE_IRQ0))
+ m_miot->pb_wr_callback<0>().set(m_fdc, FUNC(c8050_fdc_device::drv_sel_w));
+ m_miot->pb_rd_callback<6>().set_constant(1); // SINGLE SIDED
- // controller
- MCFG_DEVICE_ADD(m_fdccpu, M6504, XTAL(12'000'000)/12)
- MCFG_DEVICE_PROGRAM_MAP(c8050_fdc_mem)
+ FLOPPY_CONNECTOR(config, FDC_TAG ":0", c8050_floppies, "525ssqd", c8050_device::floppy_formats);
+ FLOPPY_CONNECTOR(config, FDC_TAG ":1", c8050_floppies, "525ssqd", c8050_device::floppy_formats);
+}
- MCFG_DEVICE_ADD(m_via, VIA6522, XTAL(12'000'000)/12)
- MCFG_VIA6522_READPA_HANDLER(READ8(m_fdc, c8050_fdc_device, read))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, c8050_device, via_pb_w))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE(m_fdc, c8050_fdc_device, mode_sel_w))
- MCFG_VIA6522_CB2_HANDLER(WRITELINE(m_fdc, c8050_fdc_device, rw_sel_w))
+void c8250_device::device_add_mconfig(machine_config &config)
+{
+ add_common_devices(config);
+ m_fdccpu->set_addrmap(AS_PROGRAM, &c8250_device::c8050_fdc_mem);
- MOS6530_NEW(config, m_miot, XTAL(12'000'000)/12);
- m_miot->pa_wr_callback().set(m_fdc, FUNC(c8050_fdc_device::write));
m_miot->pb_wr_callback<0>().set(m_fdc, FUNC(c8050_fdc_device::drv_sel_w));
- m_miot->pb_wr_callback<1>().set(m_fdc, FUNC(c8050_fdc_device::ds0_w));
- m_miot->pb_wr_callback<2>().set(m_fdc, FUNC(c8050_fdc_device::ds1_w));
- m_miot->pb_rd_callback<3>().set(m_fdc, FUNC(c8050_fdc_device::wps_r));
m_miot->pb_wr_callback<4>().set(m_fdc, FUNC(c8050_fdc_device::odd_hd_w));
m_miot->pb_rd_callback<6>().set_constant(0); // DOUBLE SIDED
- m_miot->pb_wr_callback<7>().set_inputline(m_fdccpu, M6502_IRQ_LINE);
- C8050_FDC(config, m_fdc, XTAL(12'000'000)/2);
- m_fdc->sync_wr_callback().set(m_via, FUNC(via6522_device::write_pb7));
- m_fdc->ready_wr_callback().set(m_via, FUNC(via6522_device::write_ca1));
- m_fdc->brdy_wr_callback().set_inputline(m_fdccpu, M6502_SET_OVERFLOW).invert();
- m_fdc->error_wr_callback().set(m_via, FUNC(via6522_device::write_cb1));
- MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":0", c8250_floppies, "525qd", c8250_device::floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":1", c8250_floppies, "525qd", c8250_device::floppy_formats)
-MACHINE_CONFIG_END
-
-
-MACHINE_CONFIG_START(c8250lp_device::device_add_mconfig)
- // DOS
- MCFG_DEVICE_ADD(M6502_TAG, M6502, XTAL(12'000'000)/12)
- MCFG_DEVICE_PROGRAM_MAP(c8050_main_mem)
-
- MCFG_DEVICE_ADD(M6532_0_TAG, MOS6532_NEW, XTAL(12'000'000)/12)
- MCFG_MOS6530n_IN_PA_CB(READ8(*this, c8050_device, dio_r))
- MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, c8050_device, dio_w))
-
- MCFG_DEVICE_ADD(M6532_1_TAG, MOS6532_NEW, XTAL(12'000'000)/12)
- MCFG_MOS6530n_IN_PA_CB(READ8(*this, c8050_device, riot1_pa_r))
- MCFG_MOS6530n_OUT_PA_CB(WRITE8(*this, c8050_device, riot1_pa_w))
- MCFG_MOS6530n_IN_PB_CB(READ8(*this, c8050_device, riot1_pb_r))
- MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, c8050_device, riot1_pb_w))
- MCFG_MOS6530n_IRQ_CB(INPUTLINE(M6502_TAG, INPUT_LINE_IRQ0))
-
- // controller
- MCFG_DEVICE_ADD(m_fdccpu, M6504, XTAL(12'000'000)/12)
- MCFG_DEVICE_PROGRAM_MAP(c8250lp_fdc_mem)
+ FLOPPY_CONNECTOR(config, FDC_TAG ":0", c8250_floppies, "525qd", c8250_device::floppy_formats);
+ FLOPPY_CONNECTOR(config, FDC_TAG ":1", c8250_floppies, "525qd", c8250_device::floppy_formats);
+}
- MCFG_DEVICE_ADD(m_via, VIA6522, XTAL(12'000'000)/12)
- MCFG_VIA6522_READPA_HANDLER(READ8(m_fdc, c8050_fdc_device, read))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, c8050_device, via_pb_w))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE(m_fdc, c8050_fdc_device, mode_sel_w))
- MCFG_VIA6522_CB2_HANDLER(WRITELINE(m_fdc, c8050_fdc_device, rw_sel_w))
+void c8250lp_device::device_add_mconfig(machine_config &config)
+{
+ add_common_devices(config);
+ m_fdccpu->set_addrmap(AS_PROGRAM, &c8250lp_device::c8250lp_fdc_mem);
- MOS6530_NEW(config, m_miot, XTAL(12'000'000)/12);
- m_miot->pa_wr_callback().set(m_fdc, FUNC(c8050_fdc_device::write));
m_miot->pb_wr_callback<0>().set(m_fdc, FUNC(c8050_fdc_device::drv_sel_w));
- m_miot->pb_wr_callback<1>().set(m_fdc, FUNC(c8050_fdc_device::ds0_w));
- m_miot->pb_wr_callback<2>().set(m_fdc, FUNC(c8050_fdc_device::ds1_w));
- m_miot->pb_rd_callback<3>().set(m_fdc, FUNC(c8050_fdc_device::wps_r));
m_miot->pb_wr_callback<4>().set(m_fdc, FUNC(c8050_fdc_device::odd_hd_w));
m_miot->pb_rd_callback<6>().set_constant(0); // DOUBLE SIDED
- m_miot->pb_wr_callback<7>().set_inputline(m_fdccpu, M6502_IRQ_LINE);
-
- C8050_FDC(config, m_fdc, XTAL(12'000'000)/2);
- m_fdc->sync_wr_callback().set(m_via, FUNC(via6522_device::write_pb7));
- m_fdc->ready_wr_callback().set(m_via, FUNC(via6522_device::write_ca1));
- m_fdc->brdy_wr_callback().set_inputline(m_fdccpu, M6502_SET_OVERFLOW).invert();
- m_fdc->error_wr_callback().set(m_via, FUNC(via6522_device::write_cb1));
- MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":0", c8250_floppies, "525qd", c8250lp_device::floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":1", c8250_floppies, "525qd", c8250lp_device::floppy_formats)
-MACHINE_CONFIG_END
-
-
-MACHINE_CONFIG_START(sfd1001_device::device_add_mconfig)
- // DOS
- MCFG_DEVICE_ADD(M6502_TAG, M6502, XTAL(12'000'000)/12)
- MCFG_DEVICE_PROGRAM_MAP(c8050_main_mem)
-
- MCFG_DEVICE_ADD(M6532_0_TAG, MOS6532_NEW, XTAL(12'000'000)/12)
- MCFG_MOS6530n_IN_PA_CB(READ8(*this, c8050_device, dio_r))
- MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, c8050_device, dio_w))
- MCFG_DEVICE_ADD(M6532_1_TAG, MOS6532_NEW, XTAL(12'000'000)/12)
- MCFG_MOS6530n_IN_PA_CB(READ8(*this, c8050_device, riot1_pa_r))
- MCFG_MOS6530n_OUT_PA_CB(WRITE8(*this, c8050_device, riot1_pa_w))
- MCFG_MOS6530n_IN_PB_CB(READ8(*this, c8050_device, riot1_pb_r))
- MCFG_MOS6530n_OUT_PB_CB(WRITE8(*this, c8050_device, riot1_pb_w))
- MCFG_MOS6530n_IRQ_CB(INPUTLINE(M6502_TAG, INPUT_LINE_IRQ0))
-
- // controller
- MCFG_DEVICE_ADD(m_fdccpu, M6504, XTAL(12'000'000)/12)
- MCFG_DEVICE_PROGRAM_MAP(sfd1001_fdc_mem)
+ FLOPPY_CONNECTOR(config, FDC_TAG ":0", c8250_floppies, "525qd", c8250lp_device::floppy_formats);
+ FLOPPY_CONNECTOR(config, FDC_TAG ":1", c8250_floppies, "525qd", c8250lp_device::floppy_formats);
+}
- MCFG_DEVICE_ADD(m_via, VIA6522, XTAL(12'000'000)/12)
- MCFG_VIA6522_READPA_HANDLER(READ8(m_fdc, c8050_fdc_device, read))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, c8050_device, via_pb_w))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE(m_fdc, c8050_fdc_device, mode_sel_w))
- MCFG_VIA6522_CB2_HANDLER(WRITELINE(m_fdc, c8050_fdc_device, rw_sel_w))
+void sfd1001_device::device_add_mconfig(machine_config &config)
+{
+ add_common_devices(config);
+ m_fdccpu->set_addrmap(AS_PROGRAM, &sfd1001_device::sfd1001_fdc_mem);
- MOS6530_NEW(config, m_miot, XTAL(12'000'000)/12);
- m_miot->pa_wr_callback().set(m_fdc, FUNC(c8050_fdc_device::write));
- m_miot->pb_wr_callback<1>().set(m_fdc, FUNC(c8050_fdc_device::ds0_w));
- m_miot->pb_wr_callback<2>().set(m_fdc, FUNC(c8050_fdc_device::ds1_w));
- m_miot->pb_rd_callback<3>().set(m_fdc, FUNC(c8050_fdc_device::wps_r));
m_miot->pb_wr_callback<4>().set(m_fdc, FUNC(c8050_fdc_device::odd_hd_w));
m_miot->pb_rd_callback<6>().set_constant(0); // DOUBLE SIDED
- m_miot->pb_wr_callback<7>().set_inputline(m_fdccpu, M6502_IRQ_LINE);
- C8050_FDC(config, m_fdc, XTAL(12'000'000)/2);
- m_fdc->sync_wr_callback().set(m_via, FUNC(via6522_device::write_pb7));
- m_fdc->ready_wr_callback().set(m_via, FUNC(via6522_device::write_ca1));
- m_fdc->brdy_wr_callback().set_inputline(m_fdccpu, M6502_SET_OVERFLOW).invert();
- m_fdc->error_wr_callback().set(m_via, FUNC(via6522_device::write_cb1));
- MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":0", sfd1001_floppies, "525qd", sfd1001_device::floppy_formats)
-MACHINE_CONFIG_END
+ FLOPPY_CONNECTOR(config, FDC_TAG ":0", sfd1001_floppies, "525qd", sfd1001_device::floppy_formats);
+}
//-------------------------------------------------
diff --git a/src/devices/bus/ieee488/c8050.h b/src/devices/bus/ieee488/c8050.h
index c4d236f1888..c8f96c4605f 100644
--- a/src/devices/bus/ieee488/c8050.h
+++ b/src/devices/bus/ieee488/c8050.h
@@ -60,6 +60,7 @@ protected:
virtual void ieee488_atn(int state) override;
virtual void ieee488_ifc(int state) override;
+ void add_common_devices(machine_config &config);
inline void update_ieee_signals();
required_device<m6502_device> m_maincpu;
diff --git a/src/devices/bus/vic20/vic1112.cpp b/src/devices/bus/vic20/vic1112.cpp
index e0711baf4e7..e8d55e1e89b 100644
--- a/src/devices/bus/vic20/vic1112.cpp
+++ b/src/devices/bus/vic20/vic1112.cpp
@@ -97,22 +97,24 @@ WRITE_LINE_MEMBER( vic1112_device::via1_irq_w )
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(vic1112_device::device_add_mconfig)
- MCFG_DEVICE_ADD(M6522_0_TAG, VIA6522, DERIVED_CLOCK(1, 1))
- MCFG_VIA6522_READPB_HANDLER(READ8(*this, vic1112_device, via0_pb_r))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, vic1112_device, via0_pb_w))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE(*this, vic1112_device, via0_irq_w))
-
- MCFG_DEVICE_ADD(M6522_1_TAG, VIA6522, DERIVED_CLOCK(1, 1))
- MCFG_VIA6522_READPB_HANDLER(READ8(IEEE488_TAG, ieee488_device, dio_r))
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(IEEE488_TAG, ieee488_device, host_dio_w))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE(IEEE488_TAG, ieee488_device, host_atn_w))
- MCFG_VIA6522_CB2_HANDLER(WRITELINE(IEEE488_TAG, ieee488_device, host_eoi_w))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE(*this, vic1112_device, via1_irq_w))
-
- MCFG_CBM_IEEE488_ADD(nullptr)
- MCFG_IEEE488_SRQ_CALLBACK(WRITELINE(M6522_1_TAG, via6522_device, write_cb1))
-MACHINE_CONFIG_END
+void vic1112_device::device_add_mconfig(machine_config &config)
+{
+ VIA6522(config, m_via0, DERIVED_CLOCK(1, 1));
+ m_via0->readpb_handler().set(FUNC(vic1112_device::via0_pb_r));
+ m_via0->writepb_handler().set(FUNC(vic1112_device::via0_pb_w));
+ m_via0->irq_handler().set(FUNC(vic1112_device::via0_irq_w));
+
+ VIA6522(config, m_via1, DERIVED_CLOCK(1, 1));
+ m_via1->readpb_handler().set(IEEE488_TAG, FUNC(ieee488_device::dio_r));
+ m_via1->writepa_handler().set(IEEE488_TAG, FUNC(ieee488_device::host_dio_w));
+ m_via1->ca2_handler().set(IEEE488_TAG, FUNC(ieee488_device::host_atn_w));
+ m_via1->cb2_handler().set(IEEE488_TAG, FUNC(ieee488_device::host_eoi_w));
+ m_via1->irq_handler().set(FUNC(vic1112_device::via1_irq_w));
+
+ IEEE488(config, m_bus, 0);
+ ieee488_slot_device::add_cbm_defaults(config, nullptr);
+ m_bus->srq_callback().set(m_via1, FUNC(via6522_device::write_cb1));
+}
diff --git a/src/devices/imagedev/floppy.h b/src/devices/imagedev/floppy.h
index c486018defd..d06ce318e27 100644
--- a/src/devices/imagedev/floppy.h
+++ b/src/devices/imagedev/floppy.h
@@ -317,13 +317,13 @@ class floppy_connector: public device_t,
{
public:
template <typename T>
- floppy_connector(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, const char *dflt, const floppy_format_type *formats)
+ floppy_connector(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, const char *dflt, const floppy_format_type *formats, bool fixed = false)
: floppy_connector(mconfig, tag, owner, 0)
{
option_reset();
opts(*this);
set_default_option(dflt);
- set_fixed(false);
+ set_fixed(fixed);
set_formats(formats);
}
floppy_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
diff --git a/src/devices/machine/6522via.h b/src/devices/machine/6522via.h
index a0a4ca06097..074f0581fd5 100644
--- a/src/devices/machine/6522via.h
+++ b/src/devices/machine/6522via.h
@@ -18,37 +18,6 @@
#pragma once
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-// TODO: REMOVE THESE
-#define MCFG_VIA6522_READPA_HANDLER(_devcb) \
- downcast<via6522_device &>(*device).set_readpa_handler(DEVCB_##_devcb);
-
-#define MCFG_VIA6522_READPB_HANDLER(_devcb) \
- downcast<via6522_device &>(*device).set_readpb_handler(DEVCB_##_devcb);
-
-// TODO: CONVERT THESE TO WRITE LINE
-#define MCFG_VIA6522_WRITEPA_HANDLER(_devcb) \
- downcast<via6522_device &>(*device).set_writepa_handler(DEVCB_##_devcb);
-
-#define MCFG_VIA6522_WRITEPB_HANDLER(_devcb) \
- downcast<via6522_device &>(*device).set_writepb_handler(DEVCB_##_devcb);
-
-#define MCFG_VIA6522_CA2_HANDLER(_devcb) \
- downcast<via6522_device &>(*device).set_ca2_handler(DEVCB_##_devcb);
-
-#define MCFG_VIA6522_CB1_HANDLER(_devcb) \
- downcast<via6522_device &>(*device).set_cb1_handler(DEVCB_##_devcb);
-
-#define MCFG_VIA6522_CB2_HANDLER(_devcb) \
- downcast<via6522_device &>(*device).set_cb2_handler(DEVCB_##_devcb);
-
-#define MCFG_VIA6522_IRQ_HANDLER(_devcb) \
- downcast<via6522_device &>(*device).set_irq_handler(DEVCB_##_devcb);
-
-
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
@@ -83,21 +52,13 @@ public:
via6522_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// TODO: REMOVE THESE
- template <class Object> devcb_base &set_readpa_handler(Object &&cb) { return m_in_a_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_readpb_handler(Object &&cb) { return m_in_b_handler.set_callback(std::forward<Object>(cb)); }
auto readpa_handler() { return m_in_a_handler.bind(); }
auto readpb_handler() { return m_in_b_handler.bind(); }
// TODO: CONVERT THESE TO WRITE LINE
- template <class Object> devcb_base &set_writepa_handler(Object &&cb) { return m_out_a_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_writepb_handler(Object &&cb) { return m_out_b_handler.set_callback(std::forward<Object>(cb)); }
auto writepa_handler() { return m_out_a_handler.bind(); }
auto writepb_handler() { return m_out_b_handler.bind(); }
- template <class Object> devcb_base &set_ca2_handler(Object &&cb) { return m_ca2_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_cb1_handler(Object &&cb) { return m_cb1_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_cb2_handler(Object &&cb) { return m_cb2_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); }
auto ca2_handler() { return m_ca2_handler.bind(); }
auto cb1_handler() { return m_cb1_handler.bind(); }
auto cb2_handler() { return m_cb2_handler.bind(); }
diff --git a/src/devices/video/ramdac.h b/src/devices/video/ramdac.h
index e090257023c..be8e885b54a 100644
--- a/src/devices/video/ramdac.h
+++ b/src/devices/video/ramdac.h
@@ -18,10 +18,10 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_RAMDAC_ADD(_tag, _map, _palette_tag) \
+#define MCFG_RAMDAC_ADD(_tag, _map, _palette) \
MCFG_DEVICE_ADD(_tag, RAMDAC, 0) \
MCFG_DEVICE_ADDRESS_MAP(0, _map) \
- downcast<ramdac_device &>(*device).set_palette_tag(_palette_tag);
+ downcast<ramdac_device &>(*device).set_palette(_palette);
#define MCFG_RAMDAC_COLOR_BASE(_color_base) \
downcast<ramdac_device &>(*device).set_color_base(_color_base);
@@ -44,7 +44,7 @@ public:
ramdac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration
- void set_palette_tag(const char *tag) { m_palette.set_tag(tag); }
+ template <typename T> void set_palette(T &&tag) { m_palette.set_tag(std::forward<T>(tag)); }
void set_color_base(uint32_t color_base) { m_color_base = color_base; }
void set_split_read(int split) { m_split_read_reg = split; }
diff --git a/src/mame/drivers/accomm.cpp b/src/mame/drivers/accomm.cpp
index 06ce2e394cd..473f44efb4d 100644
--- a/src/mame/drivers/accomm.cpp
+++ b/src/mame/drivers/accomm.cpp
@@ -862,9 +862,9 @@ MACHINE_CONFIG_START(accomm_state::accomm)
/* rtc pcf8573 */
/* via */
- MCFG_DEVICE_ADD("via6522", VIA6522, XTAL(16'000'000) / 16)
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE("centronics", centronics_device, write_strobe))
+ VIA6522(config, m_via, XTAL(16'000'000) / 16);
+ m_via->writepa_handler().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ m_via->ca2_handler().set("centronics", FUNC(centronics_device::write_strobe));
/* acia */
MCFG_DEVICE_ADD("acia", ACIA6850, 0)
diff --git a/src/mame/drivers/aim65.cpp b/src/mame/drivers/aim65.cpp
index d8d941bdde0..2e18a90e8c5 100644
--- a/src/mame/drivers/aim65.cpp
+++ b/src/mame/drivers/aim65.cpp
@@ -215,17 +215,17 @@ MACHINE_CONFIG_START(aim65_state::aim65)
MCFG_MOS6530n_IN_PB_CB(READ8(*this, aim65_state, aim65_riot_b_r))
MCFG_MOS6530n_IRQ_CB(INPUTLINE("maincpu", M6502_IRQ_LINE))
- MCFG_DEVICE_ADD("via6522_0", VIA6522, AIM65_CLOCK)
- MCFG_VIA6522_READPB_HANDLER(READ8(*this, aim65_state, aim65_pb_r))
+ via6522_device &via0(VIA6522(config, "via6522_0", AIM65_CLOCK));
+ via0.readpb_handler().set(FUNC(aim65_state::aim65_pb_r));
// in CA1 printer ready?
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, aim65_state, aim65_pb_w))
+ via0.writepb_handler().set(FUNC(aim65_state::aim65_pb_w));
// out CB1 printer start
// out CA2 cass control (H=in)
// out CB2 turn printer on
- MCFG_VIA6522_IRQ_HANDLER(INPUTLINE("maincpu", M6502_IRQ_LINE))
+ via0.irq_handler().set_inputline("maincpu", M6502_IRQ_LINE);
- MCFG_DEVICE_ADD("via6522_1", VIA6522, AIM65_CLOCK)
- MCFG_VIA6522_IRQ_HANDLER(INPUTLINE("maincpu", M6502_IRQ_LINE))
+ via6522_device &via1(VIA6522(config, "via6522_0", AIM65_CLOCK));
+ via1.irq_handler().set_inputline("maincpu", M6502_IRQ_LINE);
MCFG_DEVICE_ADD("pia6821", PIA6821, 0)
MCFG_PIA_WRITEPA_HANDLER(WRITE8(*this, aim65_state, aim65_pia_a_w))
diff --git a/src/mame/drivers/apple3.cpp b/src/mame/drivers/apple3.cpp
index b5671602f57..be1be563c2f 100644
--- a/src/mame/drivers/apple3.cpp
+++ b/src/mame/drivers/apple3.cpp
@@ -135,15 +135,15 @@ MACHINE_CONFIG_START(apple3_state::apple3)
MCFG_DEVICE_ADD("rtc", MM58167, XTAL(32'768))
/* via */
- MCFG_DEVICE_ADD("via6522_0", VIA6522, 1000000)
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, apple3_state, apple3_via_0_out_a))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, apple3_state, apple3_via_0_out_b))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE(*this, apple3_state, apple3_via_0_irq_func))
-
- MCFG_DEVICE_ADD("via6522_1", VIA6522, 1000000)
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, apple3_state, apple3_via_1_out_a))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, apple3_state, apple3_via_1_out_b))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE(*this, apple3_state, apple3_via_1_irq_func))
+ VIA6522(config, m_via[0], 1000000);
+ m_via[0]->writepa_handler().set(FUNC(apple3_state::apple3_via_0_out_a));
+ m_via[0]->writepb_handler().set(FUNC(apple3_state::apple3_via_0_out_b));
+ m_via[0]->irq_handler().set(FUNC(apple3_state::apple3_via_0_irq_func));
+
+ VIA6522(config, m_via[1], 1000000);
+ m_via[1]->writepa_handler().set(FUNC(apple3_state::apple3_via_1_out_a));
+ m_via[1]->writepb_handler().set(FUNC(apple3_state::apple3_via_1_out_b));
+ m_via[1]->irq_handler().set(FUNC(apple3_state::apple3_via_1_irq_func));
/* sound */
SPEAKER(config, "speaker").front_center();
diff --git a/src/mame/drivers/applix.cpp b/src/mame/drivers/applix.cpp
index f46e363de44..6c8f094dcf9 100644
--- a/src/mame/drivers/applix.cpp
+++ b/src/mame/drivers/applix.cpp
@@ -893,14 +893,14 @@ MACHINE_CONFIG_START(applix_state::applix)
MCFG_MC6845_UPDATE_ROW_CB(applix_state, crtc_update_row)
MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(*this, applix_state, vsync_w))
- MCFG_DEVICE_ADD("via6522", VIA6522, 30_MHz_XTAL / 4 / 10) // VIA uses 68000 E clock
- MCFG_VIA6522_READPB_HANDLER(READ8(*this, applix_state, applix_pb_r))
+ VIA6522(config, m_via, 30_MHz_XTAL / 4 / 10); // VIA uses 68000 E clock
+ m_via->readpb_handler().set(FUNC(applix_state::applix_pb_r));
// in CB1 kbd clk
// in CA2 vsync
// in CB2 kdb data
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, applix_state, applix_pa_w))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, applix_state, applix_pb_w))
- MCFG_VIA6522_IRQ_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
+ m_via->writepa_handler().set(FUNC(applix_state::applix_pa_w));
+ m_via->writepb_handler().set(FUNC(applix_state::applix_pb_w));
+ m_via->irq_handler().set_inputline("maincpu", M68K_IRQ_2);
MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer")
MCFG_CENTRONICS_ACK_HANDLER(WRITELINE("via6522", via6522_device, write_ca1))
diff --git a/src/mame/drivers/aristmk4.cpp b/src/mame/drivers/aristmk4.cpp
index a2ff4bc9606..fd36775d135 100644
--- a/src/mame/drivers/aristmk4.cpp
+++ b/src/mame/drivers/aristmk4.cpp
@@ -378,6 +378,13 @@ public:
void init_aristmk4();
private:
+ enum
+ {
+ TIMER_POWER_FAIL
+ };
+
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
required_device<cpu_device> m_maincpu;
required_device<mc146818_device> m_rtc;
required_device<ay8910_device> m_ay1;
@@ -409,6 +416,8 @@ private:
int m_insnote;
int m_cashcade_c;
int m_printer_motor;
+ emu_timer *m_power_timer;
+
DECLARE_READ8_MEMBER(ldsw);
DECLARE_READ8_MEMBER(cgdrr);
DECLARE_WRITE8_MEMBER(cgdrw);
@@ -442,17 +451,17 @@ private:
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void video_start() override;
- DECLARE_PALETTE_INIT(aristmk4);
- DECLARE_PALETTE_INIT(lions);
+ void aristmk4_palette(palette_device &palette);
+ void lions_palette(palette_device &palette);
uint32_t screen_update_aristmk4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(note_input_reset);
TIMER_CALLBACK_MEMBER(coin_input_reset);
TIMER_CALLBACK_MEMBER(hopper_reset);
- TIMER_DEVICE_CALLBACK_MEMBER(aristmk4_pf);
+ void power_fail();
inline void uBackgroundColour();
- void aristmk4_map(address_map &map);
- void aristmk4_poker_map(address_map &map);
+ void slots_mem(address_map &map);
+ void poker_mem(address_map &map);
};
/* Partial Cashcade protocol */
@@ -1016,7 +1025,7 @@ ADDRESS MAP - SLOT GAMES
******************************************************************************/
-void aristmk4_state::aristmk4_map(address_map &map)
+void aristmk4_state::slots_mem(address_map &map)
{
map(0x0000, 0x07ff).ram().share("mkiv_vram"); // video ram - chips U49 / U50
map(0x0800, 0x17ff).ram();
@@ -1061,7 +1070,7 @@ The graphics rom is mapped from 0x4000 - 0x4fff
The U87 personality rom is not required, therefore game rom code mapping is from 0x8000-0xffff
*/
-void aristmk4_state::aristmk4_poker_map(address_map &map)
+void aristmk4_state::poker_mem(address_map &map)
{
map(0x0000, 0x07ff).ram().share("mkiv_vram"); // video ram - chips U49 / U50
map(0x0800, 0x17ff).ram();
@@ -1692,29 +1701,18 @@ READ8_MEMBER(aristmk4_state::pc1_r)
}
/* same as Casino Winner HW */
-PALETTE_INIT_MEMBER(aristmk4_state, aristmk4)
+void aristmk4_state::aristmk4_palette(palette_device &palette)
{
const uint8_t *color_prom = memregion("proms")->base();
- int i;
- for (i = 0;i < palette.entries();i++)
+ for (int i = 0; i < palette.entries(); i++)
{
- int bit0,bit1,bit2,r,g,b;
-
- bit0 = (color_prom[0] >> 0) & 0x01;
- bit1 = (color_prom[0] >> 1) & 0x01;
- b = 0x4f * bit0 + 0xa8 * bit1;
- bit0 = (color_prom[0] >> 2) & 0x01;
- bit1 = (color_prom[0] >> 3) & 0x01;
- bit2 = (color_prom[0] >> 4) & 0x01;
- g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- bit0 = (color_prom[0] >> 5) & 0x01;
- bit1 = (color_prom[0] >> 6) & 0x01;
- bit2 = (color_prom[0] >> 7) & 0x01;
- r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
+ const uint8_t data = color_prom[i];
+ const int b = 0x4f * BIT(data, 0) + 0xa8 * BIT(data, 1);
+ const int g = 0x21 * BIT(data, 2) + 0x47 * BIT(data, 3) + 0x97 * BIT(data, 4);
+ const int r = 0x21 * BIT(data, 5) + 0x47 * BIT(data, 6) + 0x97 * BIT(data, 7);
palette.set_pen_color(i, rgb_t(r, g, b));
- color_prom++;
}
}
@@ -1732,6 +1730,7 @@ void aristmk4_state::machine_start()
m_credit_out_meter.resolve();
m_hopper_motor_out.resolve();
m_lamps.resolve();
+ m_power_timer = timer_alloc(TIMER_POWER_FAIL);
}
void aristmk4_state::machine_reset()
@@ -1746,9 +1745,20 @@ void aristmk4_state::machine_reset()
m_maincpu->set_unscaled_clock(MAIN_CLOCK/8); // 1.5 MHz
break;
}
+
+ m_power_timer->adjust(attotime::from_hz(1), 0, attotime::from_hz(1));
}
-TIMER_DEVICE_CALLBACK_MEMBER(aristmk4_state::aristmk4_pf)
+void aristmk4_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ switch (id)
+ {
+ case TIMER_POWER_FAIL: power_fail(); break;
+ default: assert_always(false, "Unknown id in aristmk4_state::device_timer");
+ }
+}
+
+void aristmk4_state::power_fail()
{
/*
IRQ generator pulses the NMI signal to CPU in the event of power down or power failure.
@@ -1768,118 +1778,106 @@ TIMER_DEVICE_CALLBACK_MEMBER(aristmk4_state::aristmk4_pf)
if(ioport("powerfail")->read()) // send NMI signal if L pressed
{
- m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE );
+ m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
}
}
-MACHINE_CONFIG_START(aristmk4_state::aristmk4)
+void aristmk4_state::aristmk4(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", MC6809E, MAIN_CLOCK/8) // M68B09E @ 1.5 MHz
- MCFG_DEVICE_PROGRAM_MAP(aristmk4_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", aristmk4_state, irq0_line_hold)
+ MC6809E(config, m_maincpu, MAIN_CLOCK/8); // M68B09E @ 1.5 MHz
+ m_maincpu->set_addrmap(AS_PROGRAM, &aristmk4_state::slots_mem);
- MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_TIMER_DRIVER_ADD_PERIODIC("power_fail", aristmk4_state, aristmk4_pf, attotime::from_hz(1))
+ NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(320, 256)
- MCFG_SCREEN_VISIBLE_AREA(0, 304-1, 0, 216-1) /* from the crtc registers... updated by crtc */
- MCFG_SCREEN_UPDATE_DRIVER(aristmk4_state, screen_update_aristmk4)
- MCFG_SCREEN_PALETTE("palette")
-
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_aristmk4)
- MCFG_PALETTE_ADD("palette", 512)
- MCFG_PALETTE_INIT_OWNER(aristmk4_state, aristmk4)
-
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(READ8(*this, aristmk4_state, pa1_r))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, aristmk4_state, pb1_r))
- MCFG_I8255_IN_PORTC_CB(READ8(*this, aristmk4_state, pc1_r))
-
- MCFG_DEVICE_ADD("via6522_0", VIA6522, MAIN_CLOCK/8) // R65C22P2
- MCFG_VIA6522_READPA_HANDLER(READ8(*this, aristmk4_state, via_a_r))
- MCFG_VIA6522_READPB_HANDLER(READ8(*this, aristmk4_state, via_b_r))
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, aristmk4_state, via_a_w))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, aristmk4_state, via_b_w))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE(*this, aristmk4_state, via_ca2_w))
- MCFG_VIA6522_CB2_HANDLER(WRITELINE(*this, aristmk4_state, via_cb2_w))
- MCFG_VIA6522_IRQ_HANDLER(INPUTLINE("maincpu", M6809_FIRQ_LINE))
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_size(320, 256);
+ screen.set_visarea(0, 304-1, 0, 216-1); /* from the crtc registers... updated by crtc */
+ screen.set_screen_update(FUNC(aristmk4_state::screen_update_aristmk4));
+ screen.screen_vblank().set_inputline(m_maincpu, M6809_IRQ_LINE, HOLD_LINE);
+ screen.set_palette(m_palette);
+
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_aristmk4);
+ PALETTE(config, m_palette, 512);
+ m_palette->set_init(DEVICE_SELF_OWNER, FUNC(aristmk4_state::aristmk4_palette));
+
+ i8255_device &ppi(I8255A(config, "ppi8255_0"));
+ ppi.in_pa_callback().set(FUNC(aristmk4_state::pa1_r));
+ ppi.in_pb_callback().set(FUNC(aristmk4_state::pb1_r));
+ ppi.in_pc_callback().set(FUNC(aristmk4_state::pc1_r));
+
+ via6522_device &via(VIA6522(config, "via6522_0", MAIN_CLOCK/8)); // R65C22P2
+ via.readpa_handler().set(FUNC(aristmk4_state::via_a_r));
+ via.readpb_handler().set(FUNC(aristmk4_state::via_b_r));
+ via.writepa_handler().set(FUNC(aristmk4_state::via_a_w));
+ via.writepb_handler().set(FUNC(aristmk4_state::via_b_w));
+ via.ca2_handler().set(FUNC(aristmk4_state::via_ca2_w));
+ via.cb2_handler().set(FUNC(aristmk4_state::via_cb2_w));
+ via.irq_handler().set_inputline(m_maincpu, M6809_FIRQ_LINE);
// CA1 is connected to +5V, CB1 is not connected.
- MCFG_DEVICE_ADD("pia6821_0", PIA6821, 0)
- MCFG_PIA_READPA_HANDLER(READ8(*this, aristmk4_state, mkiv_pia_ina))
- MCFG_PIA_WRITEPA_HANDLER(WRITE8(*this, aristmk4_state, mkiv_pia_outa))
- MCFG_PIA_WRITEPB_HANDLER(WRITE8(*this, aristmk4_state, mkiv_pia_outb))
- MCFG_PIA_CA2_HANDLER(WRITELINE(*this, aristmk4_state, mkiv_pia_ca2))
- MCFG_PIA_CB2_HANDLER(WRITELINE(*this, aristmk4_state, mkiv_pia_cb2))
+ pia6821_device &pia(PIA6821(config, "pia6821_0", 0));
+ pia.readpa_handler().set(FUNC(aristmk4_state::mkiv_pia_ina));
+ pia.writepa_handler().set(FUNC(aristmk4_state::mkiv_pia_outa));
+ pia.writepb_handler().set(FUNC(aristmk4_state::mkiv_pia_outb));
+ pia.ca2_handler().set(FUNC(aristmk4_state::mkiv_pia_ca2));
+ pia.cb2_handler().set(FUNC(aristmk4_state::mkiv_pia_cb2));
- MCFG_MC6845_ADD("crtc", C6545_1, "screen", MAIN_CLOCK/8) // TODO: type is unknown
+ mc6845_device &crtc(C6545_1(config, "crtc", MAIN_CLOCK/8)); // TODO: type is unknown
+ crtc.set_screen("screen");
/* in fact is a mc6845 driving 4 pixels by memory address.
that's why the big horizontal parameters */
- MCFG_MC6845_SHOW_BORDER_AREA(false)
- MCFG_MC6845_CHAR_WIDTH(4)
+ crtc.set_show_border_area(false);
+ crtc.set_char_width(4);
- MCFG_DEVICE_ADD("rtc", MC146818, 4.194304_MHz_XTAL)
+ MC146818(config, m_rtc, 4.194304_MHz_XTAL);
SPEAKER(config, "mono").front_center();
// the Mark IV has X 2 AY8910 sound chips which are tied to the VIA
- MCFG_DEVICE_ADD("ay1", AY8910 , MAIN_CLOCK/8)
- MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1"))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, aristmk4_state, zn434_w)) // Port write to set Vout of the DA convertors ( 2 x ZN434 )
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
-
- MCFG_DEVICE_ADD("ay2", AY8910 , MAIN_CLOCK/8)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, aristmk4_state, pblp_out)) // Port A write - goes to lamps on the buttons x8
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, aristmk4_state, pbltlp_out)) // Port B write - goes to lamps on the buttons x4 and light tower x4
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
-
- MCFG_DEVICE_ADD("samples", SAMPLES)
- MCFG_SAMPLES_CHANNELS(5) /* one for each meter - can pulse simultaneously */
- MCFG_SAMPLES_NAMES(meter_sample_names)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05)
-
-MACHINE_CONFIG_END
+ AY8910(config, m_ay1, MAIN_CLOCK/8);
+ m_ay1->port_a_read_callback().set_ioport("DSW1");
+ m_ay1->port_b_write_callback().set(FUNC(aristmk4_state::zn434_w)); // Port write to set Vout of the DA convertors ( 2 x ZN434 )
+ m_ay1->add_route(ALL_OUTPUTS, "mono", 0.40);
+
+ AY8910(config, m_ay2, MAIN_CLOCK/8);
+ m_ay2->port_a_write_callback().set(FUNC(aristmk4_state::pblp_out)); // Port A write - goes to lamps on the buttons x8
+ m_ay2->port_b_write_callback().set(FUNC(aristmk4_state::pbltlp_out)); // Port B write - goes to lamps on the buttons x4 and light tower x4
+ m_ay2->add_route(ALL_OUTPUTS, "mono", 0.40);
+
+ SAMPLES(config, m_samples);
+ m_samples->set_channels(5); /* one for each meter - can pulse simultaneously */
+ m_samples->set_samples_names(meter_sample_names);
+ m_samples->add_route(ALL_OUTPUTS, "mono", 0.05);
+}
-MACHINE_CONFIG_START(aristmk4_state::aristmk4_poker)
+void aristmk4_state::aristmk4_poker(machine_config &config)
+{
aristmk4(config);
- /* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(aristmk4_poker_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", aristmk4_state, irq0_line_hold)
-MACHINE_CONFIG_END
+ m_maincpu->set_addrmap(AS_PROGRAM, &aristmk4_state::poker_mem);
+}
/* same as Aristocrat Mark-IV HW color offset 7 */
-PALETTE_INIT_MEMBER(aristmk4_state,lions)
+void aristmk4_state::lions_palette(palette_device &palette)
{
- int i;
-
- for (i = 0;i < palette.entries();i++)
+ for (int i = 0; i < palette.entries(); i++)
{
- int bit0,bit1,r,g,b;
-
- bit0 = (i >> 0) & 0x01;
- bit1 = (i >> 1) & 0x01;
- b = 0x4f * bit0 + 0xa8 * bit1;
- bit0 = (i >> 2) & 0x01;
- bit1 = (i >> 3) & 0x01;
- g = 0x4f * bit0 + 0xa8 * bit1;
- bit0 = (i >> 4) & 0x01;
- bit1 = (i >> 5) & 0x01;
- r = 0x4f * bit0 + 0xa8 * bit1;
+ const int b = 0x4f * BIT(i, 0) + 0xa8 * BIT(i, 1);
+ const int g = 0x4f * BIT(i, 2) + 0xa8 * BIT(i, 3);
+ const int r = 0x4f * BIT(i, 4) + 0xa8 * BIT(i, 5);
palette.set_pen_color(i, rgb_t(r, g, b));
}
}
-MACHINE_CONFIG_START(aristmk4_state::_86lions)
+void aristmk4_state::_86lions(machine_config &config)
+{
aristmk4(config);
- MCFG_PALETTE_MODIFY("palette")
- MCFG_PALETTE_INIT_OWNER(aristmk4_state,lions)
-MACHINE_CONFIG_END
+ m_palette->set_init(DEVICE_SELF_OWNER, FUNC(aristmk4_state::lions_palette));
+}
ROM_START( 3bagflvt )
ROM_REGION(0x10000, "maincpu", 0 )
diff --git a/src/mame/drivers/atarisy1.cpp b/src/mame/drivers/atarisy1.cpp
index 40a6027420c..f1b5ed8af50 100644
--- a/src/mame/drivers/atarisy1.cpp
+++ b/src/mame/drivers/atarisy1.cpp
@@ -791,11 +791,11 @@ MACHINE_CONFIG_START(atarisy1_state::atarisy1)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
/* via */
- MCFG_DEVICE_ADD("via6522_0", VIA6522, ATARI_CLOCK_14MHz/8)
- MCFG_VIA6522_READPA_HANDLER(READ8(*this, atarisy1_state, via_pa_r))
- MCFG_VIA6522_READPB_HANDLER(READ8(*this, atarisy1_state, via_pb_r))
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, atarisy1_state, via_pa_w))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, atarisy1_state, via_pb_w))
+ via6522_device &via(VIA6522(config, "via6522_0", ATARI_CLOCK_14MHz/8));
+ via.readpa_handler().set(FUNC(atarisy1_state::via_pa_r));
+ via.readpb_handler().set(FUNC(atarisy1_state::via_pb_r));
+ via.writepa_handler().set(FUNC(atarisy1_state::via_pa_w));
+ via.writepb_handler().set(FUNC(atarisy1_state::via_pb_w));
MACHINE_CONFIG_END
MACHINE_CONFIG_START(atarisy1_state::marble)
diff --git a/src/mame/drivers/atom.cpp b/src/mame/drivers/atom.cpp
index b57b652e7d5..18f542d4160 100644
--- a/src/mame/drivers/atom.cpp
+++ b/src/mame/drivers/atom.cpp
@@ -727,10 +727,10 @@ MACHINE_CONFIG_START(atom_state::atom)
/* devices */
MCFG_TIMER_DRIVER_ADD_PERIODIC("hz2400", atom_state, cassette_output_tick, attotime::from_hz(4806))
- MCFG_DEVICE_ADD(R6522_TAG, VIA6522, X2/4)
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE(m_centronics, centronics_device, write_strobe))
- MCFG_VIA6522_IRQ_HANDLER(INPUTLINE(SY6502_TAG, M6502_IRQ_LINE))
+ via6522_device &via(VIA6522(config, R6522_TAG, X2/4));
+ via.writepa_handler().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ via.ca2_handler().set(m_centronics, FUNC(centronics_device::write_strobe));
+ via.irq_handler().set_inputline(SY6502_TAG, M6502_IRQ_LINE);
MCFG_DEVICE_ADD(INS8255_TAG, I8255, 0)
MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, atom_state, ppi_pa_w))
@@ -837,10 +837,10 @@ MACHINE_CONFIG_START(atom_state::atombb)
/* devices */
MCFG_TIMER_DRIVER_ADD_PERIODIC("hz2400", atom_state, cassette_output_tick, attotime::from_hz(4806))
- MCFG_DEVICE_ADD(R6522_TAG, VIA6522, X2/4)
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE(m_centronics, centronics_device, write_strobe))
- MCFG_VIA6522_IRQ_HANDLER(INPUTLINE(SY6502_TAG, M6502_IRQ_LINE))
+ via6522_device &via(VIA6522(config, R6522_TAG, X2/4));
+ via.writepa_handler().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ via.ca2_handler().set(m_centronics, FUNC(centronics_device::write_strobe));
+ via.irq_handler().set_inputline(SY6502_TAG, M6502_IRQ_LINE);
MCFG_DEVICE_ADD(INS8255_TAG, I8255, 0)
MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, atom_state, ppi_pa_w))
diff --git a/src/mame/drivers/bbc.cpp b/src/mame/drivers/bbc.cpp
index 8e25967f9d1..0b22650b78f 100644
--- a/src/mame/drivers/bbc.cpp
+++ b/src/mame/drivers/bbc.cpp
@@ -907,12 +907,12 @@ MACHINE_CONFIG_START(bbc_state::bbca)
MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, bbc_state, write_acia_clock))
/* system via */
- MCFG_DEVICE_ADD("via6522_0", VIA6522, 16_MHz_XTAL / 16)
- MCFG_VIA6522_READPA_HANDLER(READ8(*this, bbc_state, bbcb_via_system_read_porta))
- MCFG_VIA6522_READPB_HANDLER(READ8(*this, bbc_state, bbcb_via_system_read_portb))
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, bbc_state, bbcb_via_system_write_porta))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, bbc_state, bbcb_via_system_write_portb))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE("irqs", input_merger_device, in_w<1>))
+ VIA6522(config, m_via6522_0, 16_MHz_XTAL / 16);
+ m_via6522_0->readpa_handler().set(FUNC(bbc_state::bbcb_via_system_read_porta));
+ m_via6522_0->readpb_handler().set(FUNC(bbc_state::bbcb_via_system_read_portb));
+ m_via6522_0->writepa_handler().set(FUNC(bbc_state::bbcb_via_system_write_porta));
+ m_via6522_0->writepb_handler().set(FUNC(bbc_state::bbcb_via_system_write_portb));
+ m_via6522_0->irq_handler().set("irqs", FUNC(input_merger_device::in_w<1>));
/* EPROM sockets */
bbc_eprom_sockets(config);
@@ -940,12 +940,12 @@ MACHINE_CONFIG_START(bbc_state::bbcb)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
/* user via */
- MCFG_DEVICE_ADD("via6522_1", VIA6522, 16_MHz_XTAL / 16)
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_VIA6522_READPB_HANDLER(READ8("userport", bbc_userport_slot_device, pb_r))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8("userport", bbc_userport_slot_device, pb_w))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE("centronics", centronics_device, write_strobe))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE("irqs", input_merger_device, in_w<2>))
+ VIA6522(config, m_via6522_1, 16_MHz_XTAL / 16);
+ m_via6522_1->writepa_handler().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ m_via6522_1->readpb_handler().set("userport", FUNC(bbc_userport_slot_device::pb_r));
+ m_via6522_1->writepb_handler().set("userport", FUNC(bbc_userport_slot_device::pb_w));
+ m_via6522_1->ca2_handler().set("centronics", FUNC(centronics_device::write_strobe));
+ m_via6522_1->irq_handler().set("irqs", FUNC(input_merger_device::in_w<2>));
/* adc */
MCFG_DEVICE_ADD("upd7002", UPD7002, 0)
@@ -1409,20 +1409,20 @@ MACHINE_CONFIG_START(bbc_state::bbcm)
MCFG_UPD7002_EOC_CB(bbc_state, BBC_uPD7002_EOC)
/* system via */
- MCFG_DEVICE_ADD("via6522_0", VIA6522, 16_MHz_XTAL / 16)
- MCFG_VIA6522_READPA_HANDLER(READ8(*this, bbc_state, bbcb_via_system_read_porta))
- MCFG_VIA6522_READPB_HANDLER(READ8(*this, bbc_state, bbcb_via_system_read_portb))
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, bbc_state, bbcb_via_system_write_porta))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, bbc_state, bbcb_via_system_write_portb))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE("irqs", input_merger_device, in_w<1>))
+ VIA6522(config, m_via6522_0, 16_MHz_XTAL / 16);
+ m_via6522_0->readpa_handler().set(FUNC(bbc_state::bbcb_via_system_read_porta));
+ m_via6522_0->readpb_handler().set(FUNC(bbc_state::bbcb_via_system_read_portb));
+ m_via6522_0->writepa_handler().set(FUNC(bbc_state::bbcb_via_system_write_porta));
+ m_via6522_0->writepb_handler().set(FUNC(bbc_state::bbcb_via_system_write_portb));
+ m_via6522_0->irq_handler().set("irqs", FUNC(input_merger_device::in_w<1>));
/* user via */
- MCFG_DEVICE_ADD("via6522_1", VIA6522, 16_MHz_XTAL / 16)
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8("cent_data_out", output_latch_device, bus_w))
- MCFG_VIA6522_READPB_HANDLER(READ8("userport", bbc_userport_slot_device, pb_r))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8("userport", bbc_userport_slot_device, pb_w))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE("centronics", centronics_device, write_strobe))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE("irqs", input_merger_device, in_w<2>))
+ VIA6522(config, m_via6522_1, 16_MHz_XTAL / 16);
+ m_via6522_1->writepa_handler().set("cent_data_out", FUNC(output_latch_device::bus_w));
+ m_via6522_1->readpb_handler().set("userport", FUNC(bbc_userport_slot_device::pb_r));
+ m_via6522_1->writepb_handler().set("userport", FUNC(bbc_userport_slot_device::pb_w));
+ m_via6522_1->ca2_handler().set("centronics", FUNC(centronics_device::write_strobe));
+ m_via6522_1->irq_handler().set("irqs", FUNC(input_merger_device::in_w<2>));
/* fdc */
MCFG_DEVICE_ADD("wd1770", WD1770, 16_MHz_XTAL / 2)
@@ -1640,10 +1640,9 @@ MACHINE_CONFIG_START(bbc_state::bbcmc)
MCFG_MACHINE_RESET_OVERRIDE(bbc_state, bbcmc)
/* user via */
- MCFG_DEVICE_MODIFY("via6522_1")
// TODO: Joyport connected to PB0-PB4 only. PB5-PB7 are expansion port.
- MCFG_VIA6522_READPB_HANDLER(READ8("joyport", bbc_joyport_slot_device, pb_r))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8("joyport", bbc_joyport_slot_device, pb_w))
+ m_via6522_1->readpb_handler().set("joyport", FUNC(bbc_joyport_slot_device::pb_r));
+ m_via6522_1->writepb_handler().set("joyport", FUNC(bbc_joyport_slot_device::pb_w));
/* cartridge sockets */
MCFG_DEVICE_REMOVE("exp_rom1")
diff --git a/src/mame/drivers/beezer.cpp b/src/mame/drivers/beezer.cpp
index 99472bbf6cc..edb4c13ede9 100644
--- a/src/mame/drivers/beezer.cpp
+++ b/src/mame/drivers/beezer.cpp
@@ -60,7 +60,8 @@ public:
m_via_audio(*this, "via_u18"),
m_ptm(*this, "ptm"),
m_dac(*this, "dac"),
- m_timer_count(nullptr),
+ m_dac_timer(nullptr),
+ m_scanline_timer(nullptr),
m_count(0), m_noise(0),
m_pbus(0xff), m_x(0), m_y(0), m_z(0)
{
@@ -68,9 +69,10 @@ public:
m_dac_data[0] = m_dac_data[1] = m_dac_data[2] = m_dac_data[3] = 0;
}
- TIMER_DEVICE_CALLBACK_MEMBER(scanline_cb);
- uint32_t screen_update_beezer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- DECLARE_PALETTE_INIT(beezer);
+ void scanline_cb();
+ void dac_update_cb();
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void palette_init(palette_device &palette);
DECLARE_WRITE8_MEMBER(palette_w);
DECLARE_READ8_MEMBER(line_r);
@@ -98,6 +100,13 @@ public:
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
+
+ enum
+ {
+ TIMER_DAC,
+ TIMER_SCANLINE
+ };
+
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
private:
@@ -118,7 +127,8 @@ private:
double m_weights_g[3];
double m_weights_b[2];
- emu_timer *m_timer_count;
+ emu_timer *m_dac_timer;
+ emu_timer *m_scanline_timer;
int m_ch_sign[4];
uint8_t m_dac_data[4];
@@ -223,19 +233,24 @@ INPUT_PORTS_END
// VIDEO EMULATION
//**************************************************************************
-TIMER_DEVICE_CALLBACK_MEMBER( beezer_state::scanline_cb )
+void beezer_state::scanline_cb()
{
+ const int scanline = m_screen->vpos();
+
// TDISP, each 32 lines
- m_via_system->write_ca2((param & 32) ? 1 : 0);
+ m_via_system->write_ca2((scanline & 32) ? 1 : 0);
// actually unused by the game (points to a tight loop)
- if (param == 240)
+ if (scanline == 240)
m_maincpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
else
m_maincpu->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE);
+
+
+ m_scanline_timer->adjust(m_screen->time_until_pos(scanline + 1));
}
-uint32_t beezer_state::screen_update_beezer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+uint32_t beezer_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
{
@@ -249,7 +264,7 @@ uint32_t beezer_state::screen_update_beezer(screen_device &screen, bitmap_ind16
return 0;
}
-PALETTE_INIT_MEMBER(beezer_state, beezer)
+void beezer_state::palette_init(palette_device &device)
{
const int resistances_rg[3] = { 1200, 560, 330 };
const int resistances_b[2] = { 560, 330 };
@@ -283,6 +298,16 @@ READ8_MEMBER( beezer_state::line_r )
void beezer_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
+ switch (id)
+ {
+ case TIMER_DAC: dac_update_cb(); break;
+ case TIMER_SCANLINE: scanline_cb(); break;
+ default: assert_always(false, "Unknown id in beezer_state::device_timer");
+ }
+}
+
+void beezer_state::dac_update_cb()
+{
// channel multiplexer at u52
int ch = m_count++ & 3;
@@ -438,7 +463,8 @@ void beezer_state::machine_start()
m_rombank[i]->configure_entries(0, 2, m_banked_roms->base() + (i * 0x2000), 0x1000);
// allocate timers
- m_timer_count = timer_alloc(0);
+ m_dac_timer = timer_alloc(TIMER_DAC);
+ m_scanline_timer = timer_alloc(TIMER_SCANLINE);
// register for state saving
save_pointer(NAME(m_ch_sign), 4);
@@ -459,7 +485,8 @@ void beezer_state::machine_reset()
bankswitch_w(machine().dummy_space(), 0, 0);
// start timer
- m_timer_count->adjust(attotime::zero, 0, attotime::from_hz((XTAL(4'000'000) / 4) / 16));
+ m_dac_timer->adjust(attotime::zero, 0, attotime::from_hz((XTAL(4'000'000) / 4) / 16));
+ m_scanline_timer->adjust(m_screen->scan_period());
}
@@ -467,64 +494,63 @@ void beezer_state::machine_reset()
// MACHINE DEFINTIONS
//**************************************************************************
-MACHINE_CONFIG_START(beezer_state::beezer)
+void beezer_state::beezer(machine_config &config)
+{
// basic machine hardware
- MCFG_DEVICE_ADD("maincpu", MC6809, XTAL(12'000'000) / 3)
- MCFG_DEVICE_PROGRAM_MAP(main_map)
-
- MCFG_DEVICE_ADD("sysbank", ADDRESS_MAP_BANK, 0)
- MCFG_DEVICE_PROGRAM_MAP(banked_map)
- MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_BIG)
- MCFG_ADDRESS_MAP_BANK_DATA_WIDTH(8)
- MCFG_ADDRESS_MAP_BANK_ADDR_WIDTH(15)
- MCFG_ADDRESS_MAP_BANK_STRIDE(0x1000)
-
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", beezer_state, scanline_cb, "screen", 0, 1)
-
- MCFG_DEVICE_ADD("via_u6", VIA6522, XTAL(12'000'000) / 12)
- MCFG_VIA6522_READPA_HANDLER(READ8(*this, beezer_state, via_system_pa_r))
- MCFG_VIA6522_READPB_HANDLER(READ8(*this, beezer_state, via_system_pb_r))
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, beezer_state, via_system_pa_w))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, beezer_state, via_system_pb_w))
- MCFG_VIA6522_CB1_HANDLER(WRITELINE("via_u18", via6522_device, write_ca2))
- MCFG_VIA6522_CB2_HANDLER(WRITELINE("via_u18", via6522_device, write_ca1))
- MCFG_VIA6522_IRQ_HANDLER(INPUTLINE("maincpu", M6809_IRQ_LINE))
-
- MCFG_WATCHDOG_ADD("watchdog")
+ MC6809(config, m_maincpu, XTAL(12'000'000) / 3);
+ m_maincpu->set_addrmap(AS_PROGRAM, &beezer_state::main_map);
+
+ ADDRESS_MAP_BANK(config, m_sysbank, 0);
+ m_sysbank->set_addrmap(AS_PROGRAM, &beezer_state::banked_map);
+ m_sysbank->set_endianness(ENDIANNESS_BIG);
+ m_sysbank->set_data_width(8);
+ m_sysbank->set_addr_width(15);
+ m_sysbank->set_stride(0x1000);
+
+ VIA6522(config, m_via_system, XTAL(12'000'000) / 12);
+ m_via_system->readpa_handler().set(FUNC(beezer_state::via_system_pa_r));
+ m_via_system->readpb_handler().set(FUNC(beezer_state::via_system_pb_r));
+ m_via_system->writepa_handler().set(FUNC(beezer_state::via_system_pa_w));
+ m_via_system->writepb_handler().set(FUNC(beezer_state::via_system_pb_w));
+ m_via_system->cb1_handler().set(m_via_audio, FUNC(via6522_device::write_ca2));
+ m_via_system->cb2_handler().set(m_via_audio, FUNC(via6522_device::write_ca1));
+ m_via_system->irq_handler().set_inputline(m_maincpu, M6809_IRQ_LINE);
+
+ WATCHDOG_TIMER(config, "watchdog");
// video hardware
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(384, 256)
- MCFG_SCREEN_VISIBLE_AREA(16, 304-1, 0, 240-1) // 288 x 240, correct?
- MCFG_SCREEN_UPDATE_DRIVER(beezer_state, screen_update_beezer)
- MCFG_SCREEN_PALETTE("palette")
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(60);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ m_screen->set_size(384, 256);
+ m_screen->set_visarea(16, 304-1, 0, 240-1); // 288 x 240, correct?
+ m_screen->set_screen_update(FUNC(beezer_state::screen_update));
+ m_screen->set_palette(m_palette);
- MCFG_PALETTE_ADD("palette", 16)
- MCFG_PALETTE_INIT_OWNER(beezer_state, beezer)
+ PALETTE(config, m_palette, 16);
+ m_palette->set_init(DEVICE_SELF_OWNER, FUNC(beezer_state::palette_init));
// sound hardware
- MCFG_DEVICE_ADD("audiocpu", MC6809, XTAL(4'000'000))
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
-
- MCFG_INPUT_MERGER_ANY_HIGH("audio_irqs")
- MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", M6809_IRQ_LINE))
-
- MCFG_DEVICE_ADD("via_u18", VIA6522, XTAL(4'000'000) / 4)
- MCFG_VIA6522_READPA_HANDLER(READ8(*this, beezer_state, via_audio_pa_r))
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, beezer_state, via_audio_pa_w))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, beezer_state, via_audio_pb_w))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE("via_u6", via6522_device, write_cb1))
- MCFG_VIA6522_CB1_HANDLER(WRITELINE(*this, beezer_state, dmod_clr_w))
- MCFG_VIA6522_CB2_HANDLER(WRITELINE(*this, beezer_state, dmod_data_w))
- MCFG_VIA6522_IRQ_HANDLER(WRITELINE("audio_irqs", input_merger_device, in_w<0>))
-
- MCFG_DEVICE_ADD("ptm", PTM6840, XTAL(4'000'000) / 4)
- MCFG_PTM6840_O1_CB(WRITELINE(*this, beezer_state, ptm_o1_w))
- MCFG_PTM6840_O2_CB(WRITELINE(*this, beezer_state, ptm_o2_w))
- MCFG_PTM6840_O3_CB(WRITELINE(*this, beezer_state, ptm_o3_w))
- MCFG_PTM6840_IRQ_CB(WRITELINE("audio_irqs", input_merger_device, in_w<1>))
+ MC6809(config, m_audiocpu, XTAL(4'000'000));
+ m_audiocpu->set_addrmap(AS_PROGRAM, &beezer_state::sound_map);
+
+ input_merger_device &audio_irqs(INPUT_MERGER_ANY_HIGH(config, "audio_irqs"));
+ audio_irqs.output_handler().set_inputline(m_audiocpu, M6809_IRQ_LINE);
+
+ VIA6522(config, m_via_audio, XTAL(4'000'000) / 4);
+ m_via_audio->readpa_handler().set(FUNC(beezer_state::via_audio_pa_r));
+ m_via_audio->writepa_handler().set(FUNC(beezer_state::via_audio_pa_w));
+ m_via_audio->writepb_handler().set(FUNC(beezer_state::via_audio_pb_w));
+ m_via_audio->ca2_handler().set(m_via_system, FUNC(via6522_device::write_cb1));
+ m_via_audio->cb1_handler().set(FUNC(beezer_state::dmod_clr_w));
+ m_via_audio->cb2_handler().set(FUNC(beezer_state::dmod_data_w));
+ m_via_audio->irq_handler().set("audio_irqs", FUNC(input_merger_device::in_w<0>));
+
+ PTM6840(config, m_ptm, XTAL(4'000'000) / 4);
+ m_ptm->o1_callback().set(FUNC(beezer_state::ptm_o1_w));
+ m_ptm->o2_callback().set(FUNC(beezer_state::ptm_o2_w));
+ m_ptm->o3_callback().set(FUNC(beezer_state::ptm_o3_w));
+ m_ptm->irq_callback().set("audio_irqs", FUNC(input_merger_device::in_w<1>));
// schematics show an input labeled VCO to channel 2, but the source is unknown
mm5837_device &noise(MM5837(config, "noise"));
@@ -532,9 +558,9 @@ MACHINE_CONFIG_START(beezer_state::beezer)
noise.output_callback().set(FUNC(beezer_state::noise_w));
SPEAKER(config, "speaker").front_center();
- MCFG_DEVICE_ADD("dac", DAC76, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
-MACHINE_CONFIG_END
+ DAC76(config, m_dac, 0);
+ m_dac->add_route(ALL_OUTPUTS, "speaker", 1.0);
+}
//**************************************************************************
diff --git a/src/mame/drivers/bmcbowl.cpp b/src/mame/drivers/bmcbowl.cpp
index 57803ab89b1..2ca7256b8bf 100644
--- a/src/mame/drivers/bmcbowl.cpp
+++ b/src/mame/drivers/bmcbowl.cpp
@@ -125,16 +125,18 @@ public:
m_stats_ram(*this, "nvram", 16),
m_vid1(*this, "vid1"),
m_vid2(*this, "vid2"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_input(*this, "IN%u", 1)
+ { }
- required_device<cpu_device> m_maincpu;
- optional_shared_ptr<uint8_t> m_stats_ram;
- required_shared_ptr<uint16_t> m_vid1;
- required_shared_ptr<uint16_t> m_vid2;
- required_device<palette_device> m_palette;
- int m_bmc_input;
- DECLARE_READ16_MEMBER(bmc_random_read);
- DECLARE_READ16_MEMBER(bmc_protection_r);
+ void bmcbowl(machine_config &config);
+
+private:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
+ DECLARE_READ16_MEMBER(random_read);
+ DECLARE_READ16_MEMBER(protection_r);
DECLARE_WRITE16_MEMBER(scroll_w);
DECLARE_READ8_MEMBER(via_b_in);
DECLARE_WRITE8_MEMBER(via_a_out);
@@ -142,24 +144,23 @@ public:
DECLARE_WRITE_LINE_MEMBER(via_ca2_out);
DECLARE_READ8_MEMBER(dips1_r);
DECLARE_WRITE8_MEMBER(input_mux_w);
- void init_bmcbowl();
- virtual void machine_reset() override;
- virtual void video_start() override;
- uint32_t screen_update_bmcbowl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void init_stats(const uint8_t *table, int table_len, int address);
- void bmcbowl(machine_config &config);
- void bmcbowl_mem(address_map &map);
+ void main_mem(address_map &map);
void ramdac_map(address_map &map);
-};
-
+ required_device<cpu_device> m_maincpu;
+ optional_shared_ptr<uint8_t> m_stats_ram;
+ required_shared_ptr<uint16_t> m_vid1;
+ required_shared_ptr<uint16_t> m_vid2;
+ required_device<palette_device> m_palette;
+ required_ioport_array<2> m_input;
+ uint8_t m_selected_input;
+};
-void bmcbowl_state::video_start()
-{
-}
-uint32_t bmcbowl_state::screen_update_bmcbowl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+uint32_t bmcbowl_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
/*
280x230,4 bitmap layers, 8bpp,
@@ -208,12 +209,12 @@ uint32_t bmcbowl_state::screen_update_bmcbowl(screen_device &screen, bitmap_ind1
return 0;
}
-READ16_MEMBER(bmcbowl_state::bmc_random_read)
+READ16_MEMBER(bmcbowl_state::random_read)
{
return machine().rand();
}
-READ16_MEMBER(bmcbowl_state::bmc_protection_r)
+READ16_MEMBER(bmcbowl_state::protection_r)
{
switch(m_maincpu->pcbase())
{
@@ -301,6 +302,11 @@ void bmcbowl_state::init_stats(const uint8_t *table, int table_len, int address)
}
#endif
+void bmcbowl_state::machine_start()
+{
+ save_item(NAME(m_selected_input));
+}
+
void bmcbowl_state::machine_reset()
{
#ifdef NVRAM_HACK
@@ -313,7 +319,7 @@ void bmcbowl_state::machine_reset()
#endif
}
-void bmcbowl_state::bmcbowl_mem(address_map &map)
+void bmcbowl_state::main_mem(address_map &map)
{
map(0x000000, 0x01ffff).rom();
@@ -345,9 +351,9 @@ void bmcbowl_state::bmcbowl_mem(address_map &map)
map(0x30c040, 0x30c041).nopw();
map(0x30c080, 0x30c081).nopw();
map(0x30c0c0, 0x30c0c1).nopw();
- map(0x30c100, 0x30c101).r(FUNC(bmcbowl_state::bmc_protection_r));
+ map(0x30c100, 0x30c101).r(FUNC(bmcbowl_state::protection_r));
map(0x30c140, 0x30c141).nopw();
- map(0x30ca00, 0x30ca01).r(FUNC(bmcbowl_state::bmc_random_read)).nopw();
+ map(0x30ca00, 0x30ca01).r(FUNC(bmcbowl_state::random_read)).nopw();
}
@@ -436,19 +442,19 @@ INPUT_PORTS_END
READ8_MEMBER(bmcbowl_state::dips1_r)
{
- switch(m_bmc_input)
+ switch(m_selected_input)
{
- case 0x00: return ioport("IN1")->read();
- case 0x40: return ioport("IN2")->read();
+ case 0x00: return m_input[0]->read();
+ case 0x40: return m_input[1]->read();
}
- logerror("%s:unknown input - %X\n",machine().describe_context(),m_bmc_input);
+ logerror("%s: unknown input - %X\n", machine().describe_context(), m_selected_input);
return 0xff;
}
WRITE8_MEMBER(bmcbowl_state::input_mux_w)
{
- m_bmc_input=data;
+ m_selected_input = data;
}
void bmcbowl_state::ramdac_map(address_map &map)
@@ -456,49 +462,52 @@ void bmcbowl_state::ramdac_map(address_map &map)
map(0x000, 0x3ff).rw("ramdac", FUNC(ramdac_device::ramdac_pal_r), FUNC(ramdac_device::ramdac_rgb666_w));
}
-MACHINE_CONFIG_START(bmcbowl_state::bmcbowl)
- MCFG_DEVICE_ADD("maincpu", M68000, XTAL(21'477'272) / 2 )
- MCFG_DEVICE_PROGRAM_MAP(bmcbowl_mem)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", bmcbowl_state, irq2_line_hold)
+void bmcbowl_state::bmcbowl(machine_config &config)
+{
+ M68000(config, m_maincpu, XTAL(21'477'272) / 2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &bmcbowl_state::main_mem);
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(35*8, 30*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 35*8-1, 0*8, 29*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(bmcbowl_state, screen_update_bmcbowl)
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ screen.set_size(35*8, 30*8);
+ screen.set_visarea(0*8, 35*8-1, 0*8, 29*8-1);
+ screen.set_screen_update(FUNC(bmcbowl_state::screen_update));
+ screen.set_palette(m_palette);
+ screen.screen_vblank().set_inputline(m_maincpu, M68K_IRQ_2, HOLD_LINE);
- MCFG_PALETTE_ADD("palette", 256)
- MCFG_RAMDAC_ADD("ramdac", ramdac_map, "palette")
+ PALETTE(config, m_palette, 256);
+ ramdac_device &ramdac(RAMDAC(config, "ramdac", 0));
+ ramdac.set_palette(m_palette);
+ ramdac.set_addrmap(0, &bmcbowl_state::ramdac_map);
- MCFG_NVRAM_ADD_1FILL("nvram")
+ NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("ymsnd", YM2413, XTAL(3'579'545) ) // guessed chip type, clock not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
+ ym2413_device &ymsnd(YM2413(config, "ymsnd", XTAL(3'579'545))); // guessed chip type, clock not verified
+ ymsnd.add_route(ALL_OUTPUTS, "lspeaker", 0.50);
+ ymsnd.add_route(ALL_OUTPUTS, "rspeaker", 0.50);
- MCFG_DEVICE_ADD("aysnd", AY8910, XTAL(3'579'545) / 2)
- MCFG_AY8910_PORT_A_READ_CB(READ8(*this, bmcbowl_state, dips1_r))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, bmcbowl_state, input_mux_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
+ ay8910_device &aysnd(AY8910(config, "aysnd", XTAL(3'579'545) / 2));
+ aysnd.port_a_read_callback().set(FUNC(bmcbowl_state::dips1_r));
+ aysnd.port_b_write_callback().set(FUNC(bmcbowl_state::input_mux_w));
+ aysnd.add_route(ALL_OUTPUTS, "lspeaker", 0.50);
+ aysnd.add_route(ALL_OUTPUTS, "rspeaker", 0.50);
- MCFG_DEVICE_ADD("oki", OKIM6295, 1122000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
+ okim6295_device &oki(OKIM6295(config, "oki", 1122000, okim6295_device::PIN7_HIGH)); // clock frequency & pin 7 not verified
+ oki.add_route(ALL_OUTPUTS, "lspeaker", 0.50);
+ oki.add_route(ALL_OUTPUTS, "rspeaker", 0.50);
/* via */
- MCFG_DEVICE_ADD("via6522_0", VIA6522, 1000000)
- MCFG_VIA6522_READPB_HANDLER(READ8(*this, bmcbowl_state,via_b_in))
- MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, bmcbowl_state, via_a_out))
- MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, bmcbowl_state, via_b_out))
- MCFG_VIA6522_CA2_HANDLER(WRITELINE(*this, bmcbowl_state, via_ca2_out))
- MCFG_VIA6522_IRQ_HANDLER(INPUTLINE("maincpu", M68K_IRQ_4))
-MACHINE_CONFIG_END
+ via6522_device &via(VIA6522(config, "via6522_0", 1000000));
+ via.readpb_handler().set(FUNC(bmcbowl_state::via_b_in));
+ via.writepa_handler().set(FUNC(bmcbowl_state::via_a_out));
+ via.writepb_handler().set(FUNC(bmcbowl_state::via_b_out));
+ via.ca2_handler().set(FUNC(bmcbowl_state::via_ca2_out));
+ via.irq_handler().set_inputline(m_maincpu, M68K_IRQ_4);
+}
ROM_START( bmcbowl )
ROM_REGION( 0x200000, "maincpu", 0 ) /* 68000 Code */
@@ -518,9 +527,4 @@ ROM_START( bmcbowl )
ROM_END
-void bmcbowl_state::init_bmcbowl()
-{
- save_item(NAME(m_bmc_input));
-}
-
-GAME( 1994, bmcbowl, 0, bmcbowl, bmcbowl, bmcbowl_state, init_bmcbowl, ROT0, "BMC", "Konkyuu no Hoshi", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE)
+GAME( 1994, bmcbowl, 0, bmcbowl, bmcbowl, bmcbowl_state, empty_init, ROT0, "BMC", "Konkyuu no Hoshi", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE)