summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Nigel Barnes <Pernod70@users.noreply.github.com>2018-07-17 10:41:42 +0100
committer Nigel Barnes <Pernod70@users.noreply.github.com>2018-07-17 10:41:42 +0100
commit1383b148837650193b868956d910cea6e7c56996 (patch)
tree637fba8dbb1cd9e37190dd581a06f23ac192bd25
parentaf0c87f0d6a0943daa509b77aa6926847c2830a7 (diff)
dragon devices: remove MCFG_ and machine().device (nw)
-rw-r--r--src/devices/bus/coco/dragon_fdc.cpp56
-rw-r--r--src/devices/bus/coco/dragon_jcbsnd.cpp25
-rw-r--r--src/devices/bus/coco/dragon_jcbsnd.h1
3 files changed, 32 insertions, 50 deletions
diff --git a/src/devices/bus/coco/dragon_fdc.cpp b/src/devices/bus/coco/dragon_fdc.cpp
index 9ca1758b887..9f644d088fb 100644
--- a/src/devices/bus/coco/dragon_fdc.cpp
+++ b/src/devices/bus/coco/dragon_fdc.cpp
@@ -82,8 +82,6 @@
***************************************************************************/
#define LOG_FDC 0
-#define WD2791_TAG "wd2791"
-#define WD2797_TAG "wd2797"
@@ -146,36 +144,28 @@ static void dragon_fdc_drives(device_slot_interface &device)
}
-MACHINE_CONFIG_START(dragon_fdc_device_base::device_add_mconfig)
- MCFG_DEVICE_ADD(WD2797_TAG, WD2797, 4_MHz_XTAL / 4)
- MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(*this, dragon_fdc_device_base, fdc_intrq_w))
- MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(*this, dragon_fdc_device_base, fdc_drq_w))
- MCFG_WD_FDC_FORCE_READY
-
- MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":0", dragon_fdc_drives, "qd", dragon_fdc_device_base::floppy_formats)
- MCFG_FLOPPY_DRIVE_SOUND(true)
- MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":1", dragon_fdc_drives, "qd", dragon_fdc_device_base::floppy_formats)
- MCFG_FLOPPY_DRIVE_SOUND(true)
- MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":2", dragon_fdc_drives, "", dragon_fdc_device_base::floppy_formats)
- MCFG_FLOPPY_DRIVE_SOUND(true)
- MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":3", dragon_fdc_drives, "", dragon_fdc_device_base::floppy_formats)
- MCFG_FLOPPY_DRIVE_SOUND(true)
-MACHINE_CONFIG_END
+void dragon_fdc_device_base::device_add_mconfig(machine_config &config)
+{
+ WD2797(config, m_wd2797, 4_MHz_XTAL / 4).set_force_ready(true);
+ m_wd2797->intrq_wr_callback().set(FUNC(dragon_fdc_device_base::fdc_intrq_w));
+ m_wd2797->drq_wr_callback().set(FUNC(dragon_fdc_device_base::fdc_drq_w));
+
+ FLOPPY_CONNECTOR(config, m_floppies[0], dragon_fdc_drives, "qd", dragon_fdc_device_base::floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, m_floppies[1], dragon_fdc_drives, "qd", dragon_fdc_device_base::floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, m_floppies[2], dragon_fdc_drives, "", dragon_fdc_device_base::floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, m_floppies[3], dragon_fdc_drives, "", dragon_fdc_device_base::floppy_formats).enable_sound(true);
+}
-MACHINE_CONFIG_START(premier_fdc_device_base::device_add_mconfig)
- MCFG_DEVICE_ADD(WD2791_TAG, WD2791, 2_MHz_XTAL / 2)
- MCFG_WD_FDC_FORCE_READY
+void premier_fdc_device_base::device_add_mconfig(machine_config &config)
+{
+ WD2791(config, m_wd2791, 2_MHz_XTAL / 2).set_force_ready(true);
- MCFG_FLOPPY_DRIVE_ADD(WD2791_TAG ":0", dragon_fdc_drives, "qd", dragon_fdc_device_base::floppy_formats)
- MCFG_FLOPPY_DRIVE_SOUND(true)
- MCFG_FLOPPY_DRIVE_ADD(WD2791_TAG ":1", dragon_fdc_drives, "qd", dragon_fdc_device_base::floppy_formats)
- MCFG_FLOPPY_DRIVE_SOUND(true)
- MCFG_FLOPPY_DRIVE_ADD(WD2791_TAG ":2", dragon_fdc_drives, "", dragon_fdc_device_base::floppy_formats)
- MCFG_FLOPPY_DRIVE_SOUND(true)
- MCFG_FLOPPY_DRIVE_ADD(WD2791_TAG ":3", dragon_fdc_drives, "", dragon_fdc_device_base::floppy_formats)
- MCFG_FLOPPY_DRIVE_SOUND(true)
-MACHINE_CONFIG_END
+ FLOPPY_CONNECTOR(config, m_floppies[0], dragon_fdc_drives, "qd", dragon_fdc_device_base::floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, m_floppies[1], dragon_fdc_drives, "qd", dragon_fdc_device_base::floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, m_floppies[2], dragon_fdc_drives, "", dragon_fdc_device_base::floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, m_floppies[3], dragon_fdc_drives, "", dragon_fdc_device_base::floppy_formats).enable_sound(true);
+}
//**************************************************************************
@@ -187,16 +177,16 @@ MACHINE_CONFIG_END
//-------------------------------------------------
dragon_fdc_device_base::dragon_fdc_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: coco_family_fdc_device_base(mconfig, type, tag, owner, clock)
- , m_wd2797(*this, WD2797_TAG)
- , m_floppies(*this, WD2797_TAG ":%u", 0)
+ , m_wd2797(*this, "wd2797")
+ , m_floppies(*this, "wd2797:%u", 0)
{
}
premier_fdc_device_base::premier_fdc_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: coco_family_fdc_device_base(mconfig, type, tag, owner, clock)
- , m_wd2791(*this, WD2791_TAG)
- , m_floppies(*this, WD2791_TAG ":%u", 0)
+ , m_wd2791(*this, "wd2791")
+ , m_floppies(*this, "wd2791:%u", 0)
{
}
diff --git a/src/devices/bus/coco/dragon_jcbsnd.cpp b/src/devices/bus/coco/dragon_jcbsnd.cpp
index 68265861715..8fae5eaf8df 100644
--- a/src/devices/bus/coco/dragon_jcbsnd.cpp
+++ b/src/devices/bus/coco/dragon_jcbsnd.cpp
@@ -4,6 +4,8 @@
JCB Sound Extension Module
+ http://archive.worldofdragon.org/index.php?title=Dragon_32_Sound_Extension_Module
+
The Dragon 32 Sound Extension Module is a cartridge by J.C.B. (Microsystems),
that contains a General Instruments AY-3-8910 sound chip. This allows the
Dragon to play interesting sound effects and complex chiptunes without
@@ -51,20 +53,10 @@ dragon_jcbsnd_device::dragon_jcbsnd_device(const machine_config &mconfig, const
void dragon_jcbsnd_device::device_start()
{
- m_cart = dynamic_cast<cococart_slot_device *>(owner());
-}
-
-//-------------------------------------------------
-// device_reset - device-specific startup
-//-------------------------------------------------
+ install_write_handler(0xfefe, 0xfefe, write8_delegate(FUNC(ay8910_device::address_w), (ay8910_device *)m_ay8910));
+ install_readwrite_handler(0xfeff, 0xfeff, read8_delegate(FUNC(ay8910_device::data_r), (ay8910_device *)m_ay8910), write8_delegate(FUNC(ay8910_device::data_w), (ay8910_device *)m_ay8910));
-void dragon_jcbsnd_device::device_reset()
-{
set_line_value(line::CART, line_value::Q);
-
- address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space.install_write_handler(0xfefe, 0xfefe, WRITE8_DEVICE_DELEGATE(m_ay8910, ay8910_device, address_w));
- space.install_readwrite_handler(0xfeff, 0xfeff, READ8_DEVICE_DELEGATE(m_ay8910, ay8910_device, data_r), WRITE8_DEVICE_DELEGATE(m_ay8910, ay8910_device, data_w));
}
//-------------------------------------------------
@@ -80,11 +72,12 @@ uint8_t* dragon_jcbsnd_device::get_cart_base()
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(dragon_jcbsnd_device::device_add_mconfig)
+void dragon_jcbsnd_device::device_add_mconfig(machine_config &config)
+{
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ay8910", AY8910, DERIVED_CLOCK(1, 1)) /* AY-3-8910 - clock not verified */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
-MACHINE_CONFIG_END
+ AY8910(config, m_ay8910, DERIVED_CLOCK(1, 1)); /* AY-3-8910 - clock not verified */
+ m_ay8910->add_route(ALL_OUTPUTS, "mono", 1.00);
+}
//-------------------------------------------------
// rom_region - device-specific ROM region
diff --git a/src/devices/bus/coco/dragon_jcbsnd.h b/src/devices/bus/coco/dragon_jcbsnd.h
index 5f4015d434f..35167dd53f8 100644
--- a/src/devices/bus/coco/dragon_jcbsnd.h
+++ b/src/devices/bus/coco/dragon_jcbsnd.h
@@ -28,7 +28,6 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
virtual uint8_t* get_cart_base() override;
// internal state