summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/imagedev
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2017-05-07 23:18:47 +1000
committer Vas Crabb <vas@vastheman.com>2017-05-14 21:44:11 +1000
commit0f0d39ef81562c75e79176dd3bebb1e491ca39d5 (patch)
tree201cee7fdf55ee800f83859a92efd2cfe66cf2b3 /src/devices/imagedev
parente6c4be2b4d71c7a6c95be0bae111eb416ff0f9e7 (diff)
Move static data out of devices into the device types. This is a significant change, so please pay attention.
The core changes are: * Short name, full name and source file are no longer members of device_t, they are part of the device type * MACHINE_COFIG_START no longer needs a driver class * MACHINE_CONFIG_DERIVED_CLASS is no longer necessary * Specify the state class you want in the GAME/COMP/CONS line * The compiler will work out the base class where the driver init member is declared * There is one static device type object per driver rather than one per machine configuration Use DECLARE_DEVICE_TYPE or DECLARE_DEVICE_TYPE_NS to declare device type. * DECLARE_DEVICE_TYPE forward-declares teh device type and class, and declares extern object finders. * DECLARE_DEVICE_TYPE_NS is for devices classes in namespaces - it doesn't forward-declare the device type. Use DEFINE_DEVICE_TYPE or DEFINE_DEVICE_TYPE_NS to define device types. * These macros declare storage for the static data, and instantiate the device type and device finder templates. The rest of the changes are mostly just moving stuff out of headers that shouldn't be there, renaming stuff for consistency, and scoping stuff down where appropriate. Things I've actually messed with substantially: * More descriptive names for a lot of devices * Untangled the fantasy sound from the driver state, which necessitates breaking up sound/flip writes * Changed DECO BSMT2000 ready callback into a device delegate * Untangled Microprose 3D noise from driver state * Used object finders for CoCo multipak, KC85 D002, and Irem sound subdevices * Started to get TI-99 stuff out of the TI-990 directory and arrange bus devices properly * Started to break out common parts of Samsung ARM SoC devices * Turned some of FM, SID, SCSP DSP, EPIC12 and Voodoo cores into something resmbling C++ * Tried to make Z180 table allocation/setup a bit safer * Converted generic keyboard/terminal to not use WRITE8 - space/offset aren't relevant * Dynamically allocate generic terminal buffer so derived devices (e.g. teleprinter) can specify size * Imporved encapsulation of Z80DART channels * Refactored the SPC7110 bit table generator loop to make it more readable * Added wrappers for SNES PPU operations so members can be made protected * Factored out some boilerplate for YM chips with PSG * toaplan2 gfx * stic/intv resolution * Video System video * Out Run/Y-board sprite alignment * GIC video hookup * Amstrad CPC ROM box members * IQ151 ROM cart region * MSX cart IRQ callback resolution time * SMS passthrough control devices starting subslots I've smoke-tested several drivers, but I've probably missed something. Things I've missed will likely blow up spectacularly with failure to bind errors and the like. Let me know if there's more subtle breakage (could have happened in FM or Voodoo). And can everyone please, please try to keep stuff clean. In particular, please stop polluting the global namespace. Keep things out of headers that don't need to be there, and use things that can be scoped down rather than macros. It feels like an uphill battle trying to get this stuff under control while more of it's added.
Diffstat (limited to 'src/devices/imagedev')
-rw-r--r--src/devices/imagedev/bitbngr.cpp4
-rw-r--r--src/devices/imagedev/bitbngr.h2
-rw-r--r--src/devices/imagedev/cassette.cpp4
-rw-r--r--src/devices/imagedev/cassette.h8
-rw-r--r--src/devices/imagedev/chd_cd.cpp15
-rw-r--r--src/devices/imagedev/chd_cd.h14
-rw-r--r--src/devices/imagedev/diablo.cpp7
-rw-r--r--src/devices/imagedev/diablo.h15
-rw-r--r--src/devices/imagedev/flopdrv.cpp37
-rw-r--r--src/devices/imagedev/flopdrv.h13
-rw-r--r--src/devices/imagedev/floppy.cpp190
-rw-r--r--src/devices/imagedev/floppy.h122
-rw-r--r--src/devices/imagedev/harddriv.cpp17
-rw-r--r--src/devices/imagedev/harddriv.h10
-rw-r--r--src/devices/imagedev/mfmhd.cpp24
-rw-r--r--src/devices/imagedev/mfmhd.h21
-rw-r--r--src/devices/imagedev/midiin.cpp4
-rw-r--r--src/devices/imagedev/midiin.h10
-rw-r--r--src/devices/imagedev/midiout.cpp4
-rw-r--r--src/devices/imagedev/midiout.h8
-rw-r--r--src/devices/imagedev/printer.cpp4
-rw-r--r--src/devices/imagedev/printer.h10
-rw-r--r--src/devices/imagedev/snapquik.cpp18
-rw-r--r--src/devices/imagedev/snapquik.h14
24 files changed, 260 insertions, 315 deletions
diff --git a/src/devices/imagedev/bitbngr.cpp b/src/devices/imagedev/bitbngr.cpp
index c1aedcc3a10..5031e0acdd3 100644
--- a/src/devices/imagedev/bitbngr.cpp
+++ b/src/devices/imagedev/bitbngr.cpp
@@ -15,14 +15,14 @@
IMPLEMENTATION
***************************************************************************/
-const device_type BITBANGER = device_creator<bitbanger_device>;
+DEFINE_DEVICE_TYPE(BITBANGER, bitbanger_device, "bitbanger", "Bitbanger")
/*-------------------------------------------------
ctor
-------------------------------------------------*/
bitbanger_device::bitbanger_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, BITBANGER, "Bitbanger", tag, owner, clock, "bitbanger", __FILE__),
+ device_t(mconfig, BITBANGER, tag, owner, clock),
device_image_interface(mconfig, *this),
m_interface(nullptr)
{
diff --git a/src/devices/imagedev/bitbngr.h b/src/devices/imagedev/bitbngr.h
index ddbff5d7c4b..ebd7d3dcc35 100644
--- a/src/devices/imagedev/bitbngr.h
+++ b/src/devices/imagedev/bitbngr.h
@@ -50,6 +50,6 @@ private:
bitbanger_image_device::static_set_interface(*device, _interface);
// device type definition
-extern const device_type BITBANGER;
+DECLARE_DEVICE_TYPE(BITBANGER, bitbanger_device)
#endif // MAME_DEVICES_IMAGEDEV_BITBNGR_H
diff --git a/src/devices/imagedev/cassette.cpp b/src/devices/imagedev/cassette.cpp
index 6054082a764..20c4b919453 100644
--- a/src/devices/imagedev/cassette.cpp
+++ b/src/devices/imagedev/cassette.cpp
@@ -17,14 +17,14 @@
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
// device type definition
-const device_type CASSETTE = device_creator<cassette_image_device>;
+DEFINE_DEVICE_TYPE(CASSETTE, cassette_image_device, "cassette_image", "Cassette")
//-------------------------------------------------
// cassette_image_device - constructor
//-------------------------------------------------
cassette_image_device::cassette_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, CASSETTE, "Cassette", tag, owner, clock, "cassette_image", __FILE__),
+ : device_t(mconfig, CASSETTE, tag, owner, clock),
device_image_interface(mconfig, *this),
m_cassette(nullptr),
m_state(CASSETTE_STOPPED),
diff --git a/src/devices/imagedev/cassette.h b/src/devices/imagedev/cassette.h
index 8dd981551de..eb375f8afed 100644
--- a/src/devices/imagedev/cassette.h
+++ b/src/devices/imagedev/cassette.h
@@ -8,8 +8,8 @@
*********************************************************************/
-#ifndef CASSETTE_H
-#define CASSETTE_H
+#ifndef MAME_DEVICES_IMAGEDEV_CASSETTE_H
+#define MAME_DEVICES_IMAGEDEV_CASSETTE_H
#include "formats/cassimg.h"
#include "softlist_dev.h"
@@ -117,7 +117,7 @@ private:
};
// device type definition
-extern const device_type CASSETTE;
+DECLARE_DEVICE_TYPE(CASSETTE, cassette_image_device)
// device iterator
typedef device_type_iterator<cassette_image_device> cassette_device_iterator;
@@ -143,4 +143,4 @@ typedef device_type_iterator<cassette_image_device> cassette_device_iterator;
#define MCFG_CASSETTE_INTERFACE(_interface) \
cassette_image_device::static_set_interface(*device, _interface);
-#endif /* CASSETTE_H */
+#endif // MAME_DEVICES_IMAGEDEV_CASSETTE_H
diff --git a/src/devices/imagedev/chd_cd.cpp b/src/devices/imagedev/chd_cd.cpp
index e3a036fd0a4..49592a33f63 100644
--- a/src/devices/imagedev/chd_cd.cpp
+++ b/src/devices/imagedev/chd_cd.cpp
@@ -9,27 +9,24 @@
*********************************************************************/
#include "emu.h"
-#include "cdrom.h"
#include "chd_cd.h"
+#include "cdrom.h"
+
// device type definition
-const device_type CDROM = device_creator<cdrom_image_device>;
+DEFINE_DEVICE_TYPE(CDROM, cdrom_image_device, "cdrom_image", "CD-ROM Image")
//-------------------------------------------------
// cdrom_image_device - constructor
//-------------------------------------------------
cdrom_image_device::cdrom_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, CDROM, "CD-ROM Image", tag, owner, clock, "cdrom_image", __FILE__),
- device_image_interface(mconfig, *this),
- m_cdrom_handle(nullptr),
- m_extension_list(nullptr),
- m_interface(nullptr)
+ : cdrom_image_device(mconfig, CDROM, tag, owner, clock)
{
}
-cdrom_image_device::cdrom_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+cdrom_image_device::cdrom_image_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock),
device_image_interface(mconfig, *this),
m_cdrom_handle(nullptr),
m_extension_list(nullptr),
diff --git a/src/devices/imagedev/chd_cd.h b/src/devices/imagedev/chd_cd.h
index 9bf63749b58..e257ff67d3f 100644
--- a/src/devices/imagedev/chd_cd.h
+++ b/src/devices/imagedev/chd_cd.h
@@ -8,8 +8,10 @@
*********************************************************************/
-#ifndef CHD_CD_H
-#define CHD_CD_H
+#ifndef MAME_DEVICES_IMAGEDEV_CHD_CD_H
+#define MAME_DEVICES_IMAGEDEV_CHD_CD_H
+
+#pragma once
#include "cdrom.h"
#include "softlist_dev.h"
@@ -26,7 +28,6 @@ class cdrom_image_device : public device_t,
public:
// construction/destruction
cdrom_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- cdrom_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
virtual ~cdrom_image_device();
static void static_set_interface(device_t &device, const char *_interface) { downcast<cdrom_image_device &>(device).m_interface = _interface; }
@@ -48,7 +49,10 @@ public:
// specific implementation
cdrom_file *get_cdrom_file() { return m_cdrom_handle; }
+
protected:
+ cdrom_image_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
// device-level overrides
virtual void device_config_complete() override;
virtual void device_start() override;
@@ -61,7 +65,7 @@ protected:
};
// device type definition
-extern const device_type CDROM;
+DECLARE_DEVICE_TYPE(CDROM, cdrom_image_device)
/***************************************************************************
DEVICE CONFIGURATION MACROS
@@ -74,4 +78,4 @@ extern const device_type CDROM;
#define MCFG_CDROM_INTERFACE(_interface) \
cdrom_image_device::static_set_interface(*device, _interface);
-#endif /* CHD_CD_H */
+#endif // MAME_DEVICES_IMAGEDEV_CHD_CD_H
diff --git a/src/devices/imagedev/diablo.cpp b/src/devices/imagedev/diablo.cpp
index 43b79c5a373..1291e83c01b 100644
--- a/src/devices/imagedev/diablo.cpp
+++ b/src/devices/imagedev/diablo.cpp
@@ -5,9 +5,10 @@
**********************************************************/
#include "emu.h"
+#include "diablo.h"
+
#include "emuopts.h"
#include "harddisk.h"
-#include "diablo.h"
OPTION_GUIDE_START(dsk_option_guide)
@@ -23,14 +24,14 @@ static const char *dsk_option_spec =
// device type definition
-const device_type DIABLO = device_creator<diablo_image_device>;
+DEFINE_DEVICE_TYPE(DIABLO, diablo_image_device, "diablo_image", "Diablo")
//-------------------------------------------------
// diablo_image_device - constructor
//-------------------------------------------------
diablo_image_device::diablo_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, DIABLO, "Diablo", tag, owner, clock, "diablo_image", __FILE__),
+ : device_t(mconfig, DIABLO, tag, owner, clock),
device_image_interface(mconfig, *this),
m_chd(nullptr),
m_hard_disk_handle(nullptr),
diff --git a/src/devices/imagedev/diablo.h b/src/devices/imagedev/diablo.h
index e19cc598fa0..087a097ed2a 100644
--- a/src/devices/imagedev/diablo.h
+++ b/src/devices/imagedev/diablo.h
@@ -4,13 +4,15 @@
* DIABLO drive image to hard disk interface
**********************************************************/
-#ifndef _IMAGEDEV_DIABLO_H_
-#define _IMAGEDEV_DIABLO_H_
+#ifndef MAME_DEVICES_IMAGEDEV_DIABLO_H
+#define MAME_DEVICES_IMAGEDEV_DIABLO_H
+
+#pragma once
#include "harddisk.h"
#include "softlist_dev.h"
-#define DIABLO_TAG(_id) "diablo"#_id
+#define DIABLO_TAG(id) "diablo"#id
/***************************************************************************
TYPE DEFINITIONS
@@ -18,8 +20,7 @@
// ======================> diablo_image_device
-class diablo_image_device : public device_t,
- public device_image_interface
+class diablo_image_device : public device_t, public device_image_interface
{
public:
// construction/destruction
@@ -70,7 +71,7 @@ protected:
};
// device type definition
-extern const device_type DIABLO;
+DECLARE_DEVICE_TYPE(DIABLO, diablo_image_device)
/***************************************************************************
DEVICE CONFIGURATION MACROS
@@ -88,4 +89,4 @@ extern const device_type DIABLO;
#define MCFG_DIABLO_INTERFACE(_interface) \
diablo_image_device::static_set_interface(*device, _interface);
-#endif /* _IMAGEDEV_DIABLO_H_ */
+#endif // MAME_DEVICES_IMAGEDEV_DIABLO_H
diff --git a/src/devices/imagedev/flopdrv.cpp b/src/devices/imagedev/flopdrv.cpp
index ed99bcba329..38f21d7dd76 100644
--- a/src/devices/imagedev/flopdrv.cpp
+++ b/src/devices/imagedev/flopdrv.cpp
@@ -694,48 +694,19 @@ READ_LINE_MEMBER( legacy_floppy_image_device::floppy_ready_r )
}
// device type definition
-const device_type LEGACY_FLOPPY = device_creator<legacy_floppy_image_device>;
+DEFINE_DEVICE_TYPE(LEGACY_FLOPPY, legacy_floppy_image_device, "legacy_floppy_image", "Floppy Disk")
//-------------------------------------------------
// legacy_floppy_image_device - constructor
//-------------------------------------------------
legacy_floppy_image_device::legacy_floppy_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, LEGACY_FLOPPY, "Floppy Disk", tag, owner, clock, "legacy_floppy_image", __FILE__),
- device_image_interface(mconfig, *this),
- m_out_idx_func(*this),
- m_drtn(0),
- m_stp(0),
- m_wtg(0),
- m_mon(0),
- m_idx(0),
- m_tk00(0),
- m_wpt(0),
- m_rdy(0),
- m_dskchg(0),
- m_drive_id(0),
- m_active(0),
- m_config(nullptr),
- m_flags(0),
- m_max_track(0),
- m_num_sides(0),
- m_current_track(0),
- m_index_timer(nullptr),
- m_index_pulse_callback(nullptr),
- m_rpm(0.0f),
- m_id_index(0),
- m_controller(nullptr),
- m_floppy(nullptr),
- m_track(0),
- m_load_proc(nullptr),
- m_unload_proc(nullptr),
- m_floppy_drive_type(0)
+ : legacy_floppy_image_device(mconfig, LEGACY_FLOPPY, tag, owner, clock)
{
- memset(&m_extension_list,0,sizeof(m_extension_list));
}
-legacy_floppy_image_device::legacy_floppy_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+legacy_floppy_image_device::legacy_floppy_image_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock),
device_image_interface(mconfig, *this),
m_out_idx_func(*this),
m_drtn(0),
diff --git a/src/devices/imagedev/flopdrv.h b/src/devices/imagedev/flopdrv.h
index ca9f469edb6..da4eb864900 100644
--- a/src/devices/imagedev/flopdrv.h
+++ b/src/devices/imagedev/flopdrv.h
@@ -3,8 +3,10 @@
/* flopdrv provides simple emulation of a disc drive */
/* the 8271, upd765 and wd179x use this */
-#ifndef __FLOPDRV_H__
-#define __FLOPDRV_H__
+#ifndef MAME_DEVICES_IMAGEDV_FLOPDRV_H
+#define MAME_DEVICES_IMAGEDV_FLOPDRV_H
+
+#pragma once
#include "formats/flopimg.h"
#include "softlist_dev.h"
@@ -94,7 +96,6 @@ class legacy_floppy_image_device : public device_t,
public:
// construction/destruction
legacy_floppy_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- legacy_floppy_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
~legacy_floppy_image_device();
static void static_set_floppy_config(device_t &device, const floppy_interface *config) { downcast<legacy_floppy_image_device &>(device).m_config = config; }
@@ -167,6 +168,8 @@ private:
TIMER_CALLBACK_MEMBER( set_wpt );
protected:
+ legacy_floppy_image_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
// device overrides
virtual void device_config_complete() override;
virtual void device_start() override;
@@ -224,7 +227,7 @@ protected:
};
// device type definition
-extern const device_type LEGACY_FLOPPY;
+DECLARE_DEVICE_TYPE(LEGACY_FLOPPY, legacy_floppy_image_device)
@@ -267,4 +270,4 @@ int floppy_get_count(running_machine &machine);
MCFG_DEVICE_ADD(FLOPPY_1, LEGACY_FLOPPY, 0) \
MCFG_LEGACY_FLOPPY_CONFIG(_config)
-#endif /* __FLOPDRV_H__ */
+#endif // MAME_DEVICES_IMAGEDV_FLOPDRV_H
diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp
index 09c9d89429e..cacd4b6bda5 100644
--- a/src/devices/imagedev/floppy.cpp
+++ b/src/devices/imagedev/floppy.cpp
@@ -26,98 +26,94 @@
#define FLOPSND_TAG "floppysound"
// device type definition
-const device_type FLOPPY_CONNECTOR = device_creator<floppy_connector>;
+DEFINE_DEVICE_TYPE(FLOPPY_CONNECTOR, floppy_connector, "floppy_connector", "Floppy drive connector abstraction")
// generic 3" drives
-const device_type FLOPPY_3_SSDD = device_creator<floppy_3_ssdd>;
-const device_type FLOPPY_3_DSDD = device_creator<floppy_3_dsdd>;
+DEFINE_DEVICE_TYPE(FLOPPY_3_SSDD, floppy_3_ssdd, "floppy_3_ssdd", "3\" single-sided floppy drive")
+DEFINE_DEVICE_TYPE(FLOPPY_3_DSDD, floppy_3_dsdd, "floppy_3_dsdd", "3\" double-sided floppy drive")
// generic 3.5" drives
-const device_type FLOPPY_35_SSDD = device_creator<floppy_35_ssdd>;
-const device_type FLOPPY_35_DD = device_creator<floppy_35_dd>;
-const device_type FLOPPY_35_HD = device_creator<floppy_35_hd>;
-const device_type FLOPPY_35_ED = device_creator<floppy_35_ed>;
+DEFINE_DEVICE_TYPE(FLOPPY_35_SSDD, floppy_35_ssdd, "floppy_35_ssdd", "3.5\" single-sided double density floppy drive")
+DEFINE_DEVICE_TYPE(FLOPPY_35_DD, floppy_35_dd, "floppy_35_dd", "3.5\" double density floppy drive")
+DEFINE_DEVICE_TYPE(FLOPPY_35_HD, floppy_35_hd, "floppy_35_hd", "3.5\" high density floppy drive")
+DEFINE_DEVICE_TYPE(FLOPPY_35_ED, floppy_35_ed, "floppy_35_ed", "3.5\" extended density floppy drive")
// generic 5.25" drives
-const device_type FLOPPY_525_SSSD_35T = device_creator<floppy_525_sssd_35t>;
-const device_type FLOPPY_525_SD_35T = device_creator<floppy_525_sd_35t>;
-const device_type FLOPPY_525_SSSD = device_creator<floppy_525_sssd>;
-const device_type FLOPPY_525_SD = device_creator<floppy_525_sd>;
-const device_type FLOPPY_525_SSDD = device_creator<floppy_525_ssdd>;
-const device_type FLOPPY_525_DD = device_creator<floppy_525_dd>;
-const device_type FLOPPY_525_SSQD = device_creator<floppy_525_ssqd>;
-const device_type FLOPPY_525_QD = device_creator<floppy_525_qd>;
-const device_type FLOPPY_525_HD = device_creator<floppy_525_hd>;
+DEFINE_DEVICE_TYPE(FLOPPY_525_SSSD_35T, floppy_525_sssd_35t, "floppy_525_sssd_35t", "5.25\" single-sided single density 35-track floppy drive")
+DEFINE_DEVICE_TYPE(FLOPPY_525_SD_35T, floppy_525_sd_35t, "floppy_525_sd_35t", "5.25\" double-sided single density 35-track floppy drive")
+DEFINE_DEVICE_TYPE(FLOPPY_525_SSSD, floppy_525_sssd, "floppy_525_sssd", "5.25\" single-sided single density floppy drive")
+DEFINE_DEVICE_TYPE(FLOPPY_525_SD, floppy_525_sd, "floppy_525_sd", "5.25\" single density floppy drive")
+DEFINE_DEVICE_TYPE(FLOPPY_525_SSDD, floppy_525_ssdd, "floppy_525_ssdd", "5.25\" single-sided double density floppy drive")
+DEFINE_DEVICE_TYPE(FLOPPY_525_DD, floppy_525_dd, "floppy_525_dd", "5.25\" double density floppy drive")
+DEFINE_DEVICE_TYPE(FLOPPY_525_SSQD, floppy_525_ssqd, "floppy_525_ssqd", "5.25\" single-sided quad density floppy drive")
+DEFINE_DEVICE_TYPE(FLOPPY_525_QD, floppy_525_qd, "floppy_525_qd", "5.25\" quad density floppy drive")
+DEFINE_DEVICE_TYPE(FLOPPY_525_HD, floppy_525_hd, "floppy_525_hd", "5.25\" high density floppy drive")
// generic 8" drives
-const device_type FLOPPY_8_SSSD = device_creator<floppy_8_sssd>;
-const device_type FLOPPY_8_DSSD = device_creator<floppy_8_dssd>;
-const device_type FLOPPY_8_SSDD = device_creator<floppy_8_ssdd>;
-const device_type FLOPPY_8_DSDD = device_creator<floppy_8_dsdd>;
+DEFINE_DEVICE_TYPE(FLOPPY_8_SSSD, floppy_8_sssd, "floppy_8_sssd", "8\" single-sided single density floppy drive")
+DEFINE_DEVICE_TYPE(FLOPPY_8_DSSD, floppy_8_dssd, "floppy_8_dssd", "8\" double-sided single density floppy drive")
+DEFINE_DEVICE_TYPE(FLOPPY_8_SSDD, floppy_8_ssdd, "floppy_8_ssdd", "8\" single-sided double density floppy drive")
+DEFINE_DEVICE_TYPE(FLOPPY_8_DSDD, floppy_8_dsdd, "floppy_8_dsdd", "8\" double-sided double density floppy drive")
// Epson 3.5" drives
#if 0
-const device_type EPSON_SMD_110 = device_creator<epson_smd_110>;
-const device_type EPSON_SMD_120 = device_creator<epson_smd_120>;
-const device_type EPSON_SMD_125 = device_creator<epson_smd_125>;
-const device_type EPSON_SMD_130 = device_creator<epson_smd_130>;
-const device_type EPSON_SMD_140 = device_creator<epson_smd_140>;
-const device_type EPSON_SMD_150 = device_creator<epson_smd_150>;
-const device_type EPSON_SMD_160 = device_creator<epson_smd_160>;
+DEFINE_DEVICE_TYPE(EPSON_SMD_110, epson_smd_110, "epson_smd_110", "EPSON SMD-110 Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SMD_120, epson_smd_120, "epson_smd_120", "EPSON SMD-120 Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SMD_125, epson_smd_125, "epson_smd_125", "EPSON SMD-125 Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SMD_130, epson_smd_130, "epson_smd_130", "EPSON SMD-130 Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SMD_140, epson_smd_140, "epson_smd_140", "EPSON SMD-140 Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SMD_150, epson_smd_150, "epson_smd_150", "EPSON SMD-150 Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SMD_160, epson_smd_160, "epson_smd_160", "EPSON SMD-160 Floppy Disk Drive")
#endif
-const device_type EPSON_SMD_165 = device_creator<epson_smd_165>;
+DEFINE_DEVICE_TYPE(EPSON_SMD_165, epson_smd_165, "epson_smd_165", "EPSON SMD-165 Floppy Disk Drive")
#if 0
-const device_type EPSON_SMD_170 = device_creator<epson_smd_170>;
-const device_type EPSON_SMD_180 = device_creator<epson_smd_180>;
-const device_type EPSON_SMD_240L = device_creator<epson_smd_240l>;
-const device_type EPSON_SMD_280HL = device_creator<epson_smd_280hl>;
-const device_type EPSON_SMD_440L = device_creator<epson_smd_440l>;
-const device_type EPSON_SMD_449L = device_creator<epson_smd_449l>;
-const device_type EPSON_SMD_480LM = device_creator<epson_smd_480lm>;
-const device_type EPSON_SMD_489M = device_creator<epson_smd_489m>;
+DEFINE_DEVICE_TYPE(EPSON_SMD_170, epson_smd_170, "epson_smd_170", "EPSON SMD-170 Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SMD_180, epson_smd_180, "epson_smd_180", "EPSON SMD-180 Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SMD_240L, epson_smd_240l, "epson_smd_240l", "EPSON SMD-240L Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SMD_280HL, epson_smd_280hl, "epson_smd_280hl", "EPSON SMD-280HL Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SMD_440L, epson_smd_440l, "epson_smd_440l", "EPSON SMD-440L Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SMD_449L, epson_smd_449l, "epson_smd_449l", "EPSON SMD-449L Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SMD_480LM, epson_smd_480lm, "epson_smd_480lm", "EPSON SMD-480LM Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SMD_489M, epson_smd_489m, "epson_smd_489m", "EPSON SMD-489M Floppy Disk Drive")
#endif
// Epson 5.25" drives
#if 0
-const device_type EPSON_SD_311 = device_creator<epson_sd_311>;
+DEFINE_DEVICE_TYPE(EPSON_SD_311, epson_sd_311, "epson_sd_311", "EPSON SD-311 Mini-Floppy Disk Drive")
#endif
-const device_type EPSON_SD_320 = device_creator<epson_sd_320>;
-const device_type EPSON_SD_321 = device_creator<epson_sd_321>;
+DEFINE_DEVICE_TYPE(EPSON_SD_320, epson_sd_320, "epson_sd_320", "EPSON SD-320 Mini-Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SD_321, epson_sd_321, "epson_sd_321", "EPSON SD-321 Mini-Floppy Disk Drive")
#if 0
-const device_type EPSON_SD_521L = device_creator<epson_sd_531l>;
-const device_type EPSON_SD_525 = device_creator<epson_sd_525>;
-const device_type EPSON_SD_543 = device_creator<epson_sd_543>;
-const device_type EPSON_SD_545 = device_creator<epson_sd_545>;
-const device_type EPSON_SD_560 = device_creator<epson_sd_560>;
-const device_type EPSON_SD_580L = device_creator<epson_sd_580l>;
-const device_type EPSON_SD_581L = device_creator<epson_sd_581l>;
-const device_type EPSON_SD_621L = device_creator<epson_sd_621l>;
-const device_type EPSON_SD_680L = device_creator<epson_sd_680l>;
+DEFINE_DEVICE_TYPE(EPSON_SD_521L, epson_sd_531l, "epson_sd_531l", "EPSON SD-531L Mini-Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SD_525, epson_sd_525, "epson_sd_525", "EPSON SD-525 Mini-Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SD_543, epson_sd_543, "epson_sd_543", "EPSON SD-543 Mini-Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SD_545, epson_sd_545, "epson_sd_545", "EPSON SD-545 Mini-Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SD_560, epson_sd_560, "epson_sd_560", "EPSON SD-560 Mini-Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SD_580L, epson_sd_580l, "epson_sd_580l", "EPSON SD-580L Mini-Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SD_581L, epson_sd_581l, "epson_sd_581l", "EPSON SD-581L Mini-Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SD_621L, epson_sd_621l, "epson_sd_621l", "EPSON SD-621L Mini-Floppy Disk Drive")
+DEFINE_DEVICE_TYPE(EPSON_SD_680L, epson_sd_680l, "epson_sd_680l", "EPSON SD-680L Mini-Floppy Disk Drive")
#endif
// Sony 3.5" drives
-const device_type SONY_OA_D31V = device_creator<sony_oa_d31v>;
-const device_type SONY_OA_D32W = device_creator<sony_oa_d32w>;
-const device_type SONY_OA_D32V = device_creator<sony_oa_d32v>;
+DEFINE_DEVICE_TYPE(SONY_OA_D31V, sony_oa_d31v, "sony_oa_d31v", "Sony OA-D31V Micro Floppydisk Drive")
+DEFINE_DEVICE_TYPE(SONY_OA_D32W, sony_oa_d32w, "sony_oa_d32w", "Sony OA-D32W Micro Floppydisk Drive")
+DEFINE_DEVICE_TYPE(SONY_OA_D32V, sony_oa_d32v, "sony_oa_d32v", "Sony OA-D32V Micro Floppydisk Drive")
// TEAC 5.25" drives
#if 0
-const device_type TEAC_FD_55A = device_creator<teac_fd_55a>;
-const device_type TEAC_FD_55B = device_creator<teac_fd_55b>;
+DEFINE_DEVICE_TYPE(TEAC_FD_55A, teac_fd_55a, "teac_fd_55a", "TEAC FD-55A FDD")
+DEFINE_DEVICE_TYPE(TEAC_FD_55B, teac_fd_55b, "teac_fd_55b", "TEAC FD-55B FDD")
#endif
-const device_type TEAC_FD_55E = device_creator<teac_fd_55e>;
-const device_type TEAC_FD_55F = device_creator<teac_fd_55f>;
-const device_type TEAC_FD_55G = device_creator<teac_fd_55g>;
+DEFINE_DEVICE_TYPE(TEAC_FD_55E, teac_fd_55e, "teac_fd_55e", "TEAC FD-55E FDD")
+DEFINE_DEVICE_TYPE(TEAC_FD_55F, teac_fd_55f, "teac_fd_55f", "TEAC FD-55F FDD")
+DEFINE_DEVICE_TYPE(TEAC_FD_55G, teac_fd_55g, "teac_fd_55g", "TEAC FD-55G FDD")
// ALPS 5.25" drives
-const device_type ALPS_3255190x = device_creator<alps_3255190x>;
+DEFINE_DEVICE_TYPE(ALPS_3255190X, alps_3255190x, "alps_3255190x", "ALPS 32551901/32551902 Floppy Drive")
// IBM 8" drives
-const device_type IBM_6360 = device_creator<ibm_6360>;
-
-
-template class device_finder<floppy_connector, false>;
-template class device_finder<floppy_connector, true>;
+DEFINE_DEVICE_TYPE(IBM_6360, ibm_6360, "ibm_6360", "IBM 6360 8\" single-sided single density floppy drive")
const floppy_format_type floppy_image_device::default_floppy_formats[] = {
@@ -134,7 +130,7 @@ const floppy_format_type floppy_image_device::default_floppy_formats[] = {
};
floppy_connector::floppy_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, FLOPPY_CONNECTOR, "Floppy drive connector abstraction", tag, owner, clock, "floppy_connector", __FILE__),
+ device_t(mconfig, FLOPPY_CONNECTOR, tag, owner, clock),
device_slot_interface(mconfig, *this),
formats(nullptr),
m_enable_sound(false)
@@ -173,8 +169,8 @@ floppy_image_device *floppy_connector::get_device()
// floppy_image_device - constructor
//-------------------------------------------------
-floppy_image_device::floppy_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+floppy_image_device::floppy_image_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock),
device_image_interface(mconfig, *this),
device_slot_card_interface(mconfig, *this),
input_format(nullptr),
@@ -1044,7 +1040,7 @@ static const char *const floppy525_sample_names[] =
};
floppy_sound_device::floppy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : samples_device(mconfig, FLOPPYSOUND, "Floppy sound", tag, owner, clock, "flopsnd", __FILE__),
+ : samples_device(mconfig, FLOPPYSOUND, tag, owner, clock),
m_sound(nullptr),
m_step_base(0),
m_spin_samples(0),
@@ -1352,7 +1348,7 @@ machine_config_constructor floppy_image_device::device_mconfig_additions() const
return MACHINE_CONFIG_NAME( floppy_img );
}
-const device_type FLOPPYSOUND = device_creator<floppy_sound_device>;
+DEFINE_DEVICE_TYPE(FLOPPYSOUND, floppy_sound_device, "flopsnd", "Floppy sound")
//**************************************************************************
@@ -1364,7 +1360,7 @@ const device_type FLOPPYSOUND = device_creator<floppy_sound_device>;
//-------------------------------------------------
floppy_3_ssdd::floppy_3_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_3_SSDD, "3\" single sided floppy drive", tag, owner, clock, "floppy_3_ssdd", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_3_SSDD, tag, owner, clock)
{
}
@@ -1391,7 +1387,7 @@ void floppy_3_ssdd::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
floppy_3_dsdd::floppy_3_dsdd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_3_DSDD, "3\" double sided floppy drive", tag, owner, clock, "floppy_3_dsdd", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_3_DSDD, tag, owner, clock)
{
}
@@ -1419,7 +1415,7 @@ void floppy_3_dsdd::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
floppy_35_ssdd::floppy_35_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_35_SSDD, "3.5\" single-sided double density floppy drive", tag, owner, clock, "floppy_35_ssdd", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_35_SSDD, tag, owner, clock)
{
}
@@ -1447,7 +1443,7 @@ void floppy_35_ssdd::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
floppy_35_dd::floppy_35_dd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_35_DD, "3.5\" double density floppy drive", tag, owner, clock, "floppy_35_dd", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_35_DD, tag, owner, clock)
{
}
@@ -1476,7 +1472,7 @@ void floppy_35_dd::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
floppy_35_hd::floppy_35_hd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_35_HD, "3.5\" high density floppy drive", tag, owner, clock, "floppy_35_hd", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_35_HD, tag, owner, clock)
{
}
@@ -1506,7 +1502,7 @@ void floppy_35_hd::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
floppy_35_ed::floppy_35_ed(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_35_ED, "3.5\" extended density floppy drive", tag, owner, clock, "floppy_35_ed", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_35_ED, tag, owner, clock)
{
}
@@ -1537,7 +1533,7 @@ void floppy_35_ed::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
floppy_525_sssd_35t::floppy_525_sssd_35t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_525_SSSD_35T, "5.25\" single-sided single density 35-track floppy drive", tag, owner, clock, "floppy_525_sssd_35t", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_525_SSSD_35T, tag, owner, clock)
{
}
@@ -1564,7 +1560,7 @@ void floppy_525_sssd_35t::handled_variants(uint32_t *variants, int &var_count) c
//-------------------------------------------------
floppy_525_sd_35t::floppy_525_sd_35t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_525_SD_35T, "5.25\" single density 35-track floppy drive", tag, owner, clock, "floppy_525_sd_35t", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_525_SD_35T, tag, owner, clock)
{
}
@@ -1591,7 +1587,7 @@ void floppy_525_sd_35t::handled_variants(uint32_t *variants, int &var_count) con
//-------------------------------------------------
floppy_525_sssd::floppy_525_sssd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_525_SSSD, "5.25\" single-sided single density floppy drive", tag, owner, clock, "floppy_525_sssd", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_525_SSSD, tag, owner, clock)
{
}
@@ -1618,7 +1614,7 @@ void floppy_525_sssd::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
floppy_525_sd::floppy_525_sd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_525_SD, "5.25\" single density floppy drive", tag, owner, clock, "floppy_525_sd", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_525_SD, tag, owner, clock)
{
}
@@ -1645,7 +1641,7 @@ void floppy_525_sd::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
floppy_525_ssdd::floppy_525_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_525_SSDD, "5.25\" single-sided double density floppy drive", tag, owner, clock, "floppy_525_ssdd", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_525_SSDD, tag, owner, clock)
{
}
@@ -1673,7 +1669,7 @@ void floppy_525_ssdd::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
floppy_525_dd::floppy_525_dd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_525_DD, "5.25\" double density floppy drive", tag, owner, clock, "floppy_525_dd", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_525_DD, tag, owner, clock)
{
}
@@ -1702,7 +1698,7 @@ void floppy_525_dd::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
floppy_525_ssqd::floppy_525_ssqd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_525_SSQD, "5.25\" single-sided quad density floppy drive", tag, owner, clock, "floppy_525_ssqd", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_525_SSQD, tag, owner, clock)
{
}
@@ -1731,7 +1727,7 @@ void floppy_525_ssqd::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
floppy_525_qd::floppy_525_qd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_525_QD, "5.25\" quad density floppy drive", tag, owner, clock, "floppy_525_qd", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_525_QD, tag, owner, clock)
{
}
@@ -1763,7 +1759,7 @@ void floppy_525_qd::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
floppy_525_hd::floppy_525_hd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_525_HD, "5.25\" high density floppy drive", tag, owner, clock, "floppy_525_hd", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_525_HD, tag, owner, clock)
{
}
@@ -1795,7 +1791,7 @@ void floppy_525_hd::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
floppy_8_sssd::floppy_8_sssd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_8_SSSD, "8\" single density single sided floppy drive", tag, owner, clock, "floppy_8_sssd", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_8_SSSD, tag, owner, clock)
{
}
@@ -1823,7 +1819,7 @@ void floppy_8_sssd::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
floppy_8_dssd::floppy_8_dssd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_8_DSSD, "8\" single density double sided floppy drive", tag, owner, clock, "floppy_8_dssd", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_8_DSSD, tag, owner, clock)
{
}
@@ -1852,7 +1848,7 @@ void floppy_8_dssd::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
floppy_8_ssdd::floppy_8_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_8_SSDD, "8\" double density single sided floppy drive", tag, owner, clock, "floppy_8_ssdd", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_8_SSDD, tag, owner, clock)
{
}
@@ -1881,7 +1877,7 @@ void floppy_8_ssdd::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
floppy_8_dsdd::floppy_8_dsdd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, FLOPPY_8_DSDD, "8\" double density double sided floppy drive", tag, owner, clock, "floppy_8_dsdd", __FILE__)
+ floppy_image_device(mconfig, FLOPPY_8_DSDD, tag, owner, clock)
{
}
@@ -1922,7 +1918,7 @@ void floppy_8_dsdd::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
epson_smd_165::epson_smd_165(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, EPSON_SMD_165, "EPSON SMD-165 Floppy Disk Drive", tag, owner, clock, "epson_smd_165", __FILE__)
+ floppy_image_device(mconfig, EPSON_SMD_165, tag, owner, clock)
{
}
@@ -1973,7 +1969,7 @@ void epson_smd_165::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
epson_sd_320::epson_sd_320(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, EPSON_SD_320, "EPSON SD-320 Mini-Floppy Disk Drive", tag, owner, clock, "epson_sd_320", __FILE__)
+ floppy_image_device(mconfig, EPSON_SD_320, tag, owner, clock)
{
}
@@ -2005,7 +2001,7 @@ void epson_sd_320::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
epson_sd_321::epson_sd_321(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, EPSON_SD_321, "EPSON SD-321 Mini-Floppy Disk Drive", tag, owner, clock, "epson_sd_321", __FILE__)
+ floppy_image_device(mconfig, EPSON_SD_321, tag, owner, clock)
{
}
@@ -2040,7 +2036,7 @@ void epson_sd_321::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
sony_oa_d31v::sony_oa_d31v(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, SONY_OA_D31V, "Sony OA-D31V Micro Floppydisk Drive", tag, owner, clock, "sony_oa_d31v", __FILE__)
+ floppy_image_device(mconfig, SONY_OA_D31V, tag, owner, clock)
{
}
@@ -2076,7 +2072,7 @@ void sony_oa_d31v::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
sony_oa_d32w::sony_oa_d32w(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, SONY_OA_D32W, "Sony OA-D32W Micro Floppydisk Drive", tag, owner, clock, "sony_oa_d32w", __FILE__)
+ floppy_image_device(mconfig, SONY_OA_D32W, tag, owner, clock)
{
}
@@ -2113,7 +2109,7 @@ void sony_oa_d32w::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
sony_oa_d32v::sony_oa_d32v(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, SONY_OA_D32V, "Sony OA-D32V Micro Floppydisk Drive", tag, owner, clock, "sony_oa_d32v", __FILE__)
+ floppy_image_device(mconfig, SONY_OA_D32V, tag, owner, clock)
{
}
@@ -2148,7 +2144,7 @@ void sony_oa_d32v::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
teac_fd_55e::teac_fd_55e(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, TEAC_FD_55E, "TEAC FD-55E FDD", tag, owner, clock, "teac_fd_55e", __FILE__)
+ floppy_image_device(mconfig, TEAC_FD_55E, tag, owner, clock)
{
}
@@ -2183,7 +2179,7 @@ void teac_fd_55e::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
teac_fd_55f::teac_fd_55f(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, TEAC_FD_55F, "TEAC FD-55F FDD", tag, owner, clock, "teac_fd_55f", __FILE__)
+ floppy_image_device(mconfig, TEAC_FD_55F, tag, owner, clock)
{
}
@@ -2221,7 +2217,7 @@ void teac_fd_55f::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
teac_fd_55g::teac_fd_55g(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, TEAC_FD_55G, "TEAC FD-55G FDD", tag, owner, clock, "teac_fd_55g", __FILE__)
+ floppy_image_device(mconfig, TEAC_FD_55G, tag, owner, clock)
{
}
@@ -2255,7 +2251,7 @@ void teac_fd_55g::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
alps_3255190x::alps_3255190x(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, ALPS_3255190x, "ALPS 32551901/32551902 Floppy Drive", tag, owner, clock, "alps_3255190x", __FILE__)
+ floppy_image_device(mconfig, ALPS_3255190X, tag, owner, clock)
{
}
@@ -2283,7 +2279,7 @@ void alps_3255190x::handled_variants(uint32_t *variants, int &var_count) const
//-------------------------------------------------
ibm_6360::ibm_6360(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- floppy_image_device(mconfig, IBM_6360, "IBM 6360 8\" single density single sided floppy drive", tag, owner, clock, "ibm_6360", __FILE__)
+ floppy_image_device(mconfig, IBM_6360, tag, owner, clock)
{
}
diff --git a/src/devices/imagedev/floppy.h b/src/devices/imagedev/floppy.h
index 8df3ed191d7..bc84ad3ab5e 100644
--- a/src/devices/imagedev/floppy.h
+++ b/src/devices/imagedev/floppy.h
@@ -6,8 +6,10 @@
*********************************************************************/
-#ifndef FLOPPY_H
-#define FLOPPY_H
+#ifndef MAME_DEVICES_IMAGEDEV_FLOPPY_H
+#define MAME_DEVICES_IMAGEDEV_FLOPPY_H
+
+#pragma once
#include "formats/flopimg.h"
#include "formats/d88_dsk.h"
@@ -71,7 +73,6 @@ public:
typedef delegate<void (floppy_image_device *, int)> wpt_cb;
// construction/destruction
- floppy_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
virtual ~floppy_image_device();
virtual void handled_variants(uint32_t *variants, int &var_count) const = 0;
@@ -141,6 +142,8 @@ public:
void enable_sound(bool doit) { m_make_sound = doit; }
protected:
+ floppy_image_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
@@ -207,49 +210,50 @@ protected:
floppy_sound_device* m_sound_out;
};
-#define DECLARE_FLOPPY_IMAGE_DEVICE(_name, _interface) \
- class _name : public floppy_image_device { \
+#define DECLARE_FLOPPY_IMAGE_DEVICE(Type, Name, Interface) \
+ class Name : public floppy_image_device { \
public: \
- _name(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); \
- virtual ~_name(); \
+ Name(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); \
+ virtual ~Name(); \
virtual void handled_variants(uint32_t *variants, int &var_count) const override; \
- virtual const char *image_interface() const override { return _interface; } \
+ virtual const char *image_interface() const override { return Interface; } \
protected: \
virtual void setup_characteristics() override; \
- };
-
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_3_ssdd, "floppy_3")
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_3_dsdd, "floppy_3")
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_35_ssdd, "floppy_3_5")
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_35_dd, "floppy_3_5")
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_35_hd, "floppy_3_5")
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_35_ed, "floppy_3_5")
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_525_sssd_35t, "floppy_5_25")
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_525_sd_35t, "floppy_5_25")
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_525_sssd, "floppy_5_25")
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_525_sd, "floppy_5_25")
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_525_ssdd, "floppy_5_25")
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_525_dd, "floppy_5_25")
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_525_ssqd, "floppy_5_25")
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_525_qd, "floppy_5_25")
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_525_hd, "floppy_5_25")
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_8_sssd, "floppy_8")
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_8_dssd, "floppy_8")
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_8_ssdd, "floppy_8")
-DECLARE_FLOPPY_IMAGE_DEVICE(floppy_8_dsdd, "floppy_8")
-DECLARE_FLOPPY_IMAGE_DEVICE(epson_smd_165, "floppy_3_5")
-DECLARE_FLOPPY_IMAGE_DEVICE(epson_sd_320, "floppy_5_25")
-DECLARE_FLOPPY_IMAGE_DEVICE(epson_sd_321, "floppy_5_25")
-DECLARE_FLOPPY_IMAGE_DEVICE(sony_oa_d31v, "floppy_3_5")
-DECLARE_FLOPPY_IMAGE_DEVICE(sony_oa_d32w, "floppy_3_5")
-DECLARE_FLOPPY_IMAGE_DEVICE(sony_oa_d32v, "floppy_3_5")
-DECLARE_FLOPPY_IMAGE_DEVICE(teac_fd_55e, "floppy_5_25")
-DECLARE_FLOPPY_IMAGE_DEVICE(teac_fd_55f, "floppy_5_25")
-DECLARE_FLOPPY_IMAGE_DEVICE(teac_fd_55g, "floppy_5_25")
-DECLARE_FLOPPY_IMAGE_DEVICE(alps_3255190x, "floppy_5_25")
-DECLARE_FLOPPY_IMAGE_DEVICE(ibm_6360, "floppy_8")
-
-extern const device_type FLOPPYSOUND;
+ }; \
+ DECLARE_DEVICE_TYPE(Type, Name)
+
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_3_SSDD, floppy_3_ssdd, "floppy_3")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_3_DSDD, floppy_3_dsdd, "floppy_3")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_35_SSDD, floppy_35_ssdd, "floppy_3_5")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_35_DD, floppy_35_dd, "floppy_3_5")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_35_HD, floppy_35_hd, "floppy_3_5")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_35_ED, floppy_35_ed, "floppy_3_5")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_SSSD_35T, floppy_525_sssd_35t, "floppy_5_25")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_SD_35T, floppy_525_sd_35t, "floppy_5_25")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_SSSD, floppy_525_sssd, "floppy_5_25")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_SD, floppy_525_sd, "floppy_5_25")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_SSDD, floppy_525_ssdd, "floppy_5_25")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_DD, floppy_525_dd, "floppy_5_25")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_SSQD, floppy_525_ssqd, "floppy_5_25")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_QD, floppy_525_qd, "floppy_5_25")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_HD, floppy_525_hd, "floppy_5_25")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_8_SSSD, floppy_8_sssd, "floppy_8")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_8_DSSD, floppy_8_dssd, "floppy_8")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_8_SSDD, floppy_8_ssdd, "floppy_8")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_8_DSDD, floppy_8_dsdd, "floppy_8")
+DECLARE_FLOPPY_IMAGE_DEVICE(EPSON_SMD_165, epson_smd_165, "floppy_3_5")
+DECLARE_FLOPPY_IMAGE_DEVICE(EPSON_SD_320, epson_sd_320, "floppy_5_25")
+DECLARE_FLOPPY_IMAGE_DEVICE(EPSON_SD_321, epson_sd_321, "floppy_5_25")
+DECLARE_FLOPPY_IMAGE_DEVICE(SONY_OA_D31V, sony_oa_d31v, "floppy_3_5")
+DECLARE_FLOPPY_IMAGE_DEVICE(SONY_OA_D32W, sony_oa_d32w, "floppy_3_5")
+DECLARE_FLOPPY_IMAGE_DEVICE(SONY_OA_D32V, sony_oa_d32v, "floppy_3_5")
+DECLARE_FLOPPY_IMAGE_DEVICE(TEAC_FD_55E, teac_fd_55e, "floppy_5_25")
+DECLARE_FLOPPY_IMAGE_DEVICE(TEAC_FD_55F, teac_fd_55f, "floppy_5_25")
+DECLARE_FLOPPY_IMAGE_DEVICE(TEAC_FD_55G, teac_fd_55g, "floppy_5_25")
+DECLARE_FLOPPY_IMAGE_DEVICE(ALPS_3255190X, alps_3255190x, "floppy_5_25")
+DECLARE_FLOPPY_IMAGE_DEVICE(IBM_6360, ibm_6360, "floppy_8")
+
+DECLARE_DEVICE_TYPE(FLOPPYSOUND, floppy_sound_device)
/*
@@ -313,39 +317,9 @@ private:
// device type definition
-extern const device_type FLOPPY_CONNECTOR;
-extern const device_type FLOPPY_3_SSDD;
-extern const device_type FLOPPY_3_DSDD;
-extern const device_type FLOPPY_35_SSDD;
-extern const device_type FLOPPY_35_DD;
-extern const device_type FLOPPY_35_HD;
-extern const device_type FLOPPY_35_ED;
-extern const device_type FLOPPY_525_SSSD_35T;
-extern const device_type FLOPPY_525_SD_35T;
-extern const device_type FLOPPY_525_SSSD;
-extern const device_type FLOPPY_525_SD;
-extern const device_type FLOPPY_525_SSDD;
-extern const device_type FLOPPY_525_DD;
-extern const device_type FLOPPY_525_SSQD;
-extern const device_type FLOPPY_525_QD;
-extern const device_type FLOPPY_525_HD;
-extern const device_type FLOPPY_8_SSSD;
-extern const device_type FLOPPY_8_DSSD;
-extern const device_type FLOPPY_8_SSDD;
-extern const device_type FLOPPY_8_DSDD;
-extern const device_type EPSON_SMD_165;
-extern const device_type EPSON_SD_320;
-extern const device_type EPSON_SD_321;
-extern const device_type SONY_OA_D31V;
-extern const device_type SONY_OA_D32W;
-extern const device_type SONY_OA_D32V;
-extern const device_type TEAC_FD_55E;
-extern const device_type TEAC_FD_55F;
-extern const device_type TEAC_FD_55G;
-extern const device_type ALPS_3255190x;
-extern const device_type IBM_6360;
+DECLARE_DEVICE_TYPE(FLOPPY_CONNECTOR, floppy_connector)
extern template class device_finder<floppy_connector, false>;
extern template class device_finder<floppy_connector, true>;
-#endif /* FLOPPY_H */
+#endif // MAME_DEVICES_IMAGEDEV_FLOPPY_H
diff --git a/src/devices/imagedev/harddriv.cpp b/src/devices/imagedev/harddriv.cpp
index 44bba4268bf..490e0fe1bed 100644
--- a/src/devices/imagedev/harddriv.cpp
+++ b/src/devices/imagedev/harddriv.cpp
@@ -14,9 +14,10 @@
*********************************************************************/
#include "emu.h"
+#include "harddriv.h"
+
#include "emuopts.h"
#include "harddisk.h"
-#include "harddriv.h"
OPTION_GUIDE_START(hd_option_guide)
@@ -32,28 +33,22 @@ static const char *hd_option_spec =
// device type definition
-const device_type HARDDISK = device_creator<harddisk_image_device>;
+DEFINE_DEVICE_TYPE(HARDDISK, harddisk_image_device, "harddisk_image", "Harddisk")
//-------------------------------------------------
// harddisk_image_device - constructor
//-------------------------------------------------
harddisk_image_device::harddisk_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, HARDDISK, "Harddisk", tag, owner, clock, "harddisk_image", __FILE__),
- device_image_interface(mconfig, *this),
- m_chd(nullptr),
- m_hard_disk_handle(nullptr),
- m_device_image_load(device_image_load_delegate()),
- m_device_image_unload(device_image_func_delegate()),
- m_interface(nullptr)
+ : harddisk_image_device(mconfig, HARDDISK, tag, owner, clock)
{
}
//-------------------------------------------------
// harddisk_image_device - constructor for subclasses
//-------------------------------------------------
-harddisk_image_device::harddisk_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+harddisk_image_device::harddisk_image_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock),
device_image_interface(mconfig, *this),
m_chd(nullptr),
m_hard_disk_handle(nullptr),
diff --git a/src/devices/imagedev/harddriv.h b/src/devices/imagedev/harddriv.h
index 6347a43f624..bac33321cb6 100644
--- a/src/devices/imagedev/harddriv.h
+++ b/src/devices/imagedev/harddriv.h
@@ -8,8 +8,8 @@
*********************************************************************/
-#ifndef HARDDRIV_H
-#define HARDDRIV_H
+#ifndef MAME_DEVICES_IMAGEDEV_HARDDRIV_H
+#define MAME_DEVICES_IMAGEDEV_HARDDRIV_H
#include "harddisk.h"
#include "softlist_dev.h"
@@ -54,7 +54,7 @@ public:
chd_file *get_chd_file();
protected:
- harddisk_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
+ harddisk_image_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
virtual void device_config_complete() override;
@@ -74,7 +74,7 @@ protected:
};
// device type definition
-extern const device_type HARDDISK;
+DECLARE_DEVICE_TYPE(HARDDISK, harddisk_image_device)
/***************************************************************************
DEVICE CONFIGURATION MACROS
@@ -92,4 +92,4 @@ extern const device_type HARDDISK;
#define MCFG_HARDDISK_INTERFACE(_interface) \
harddisk_image_device::static_set_interface(*device, _interface);
-#endif /* HARDDRIV_H */
+#endif // MAME_DEVICES_IMAGEDEV_HARDDRIV_H
diff --git a/src/devices/imagedev/mfmhd.cpp b/src/devices/imagedev/mfmhd.cpp
index ba9d7e2a81d..6e95fcc9e64 100644
--- a/src/devices/imagedev/mfmhd.cpp
+++ b/src/devices/imagedev/mfmhd.cpp
@@ -307,8 +307,8 @@ std::string mfm_harddisk_device::tts(const attotime &t)
return buf;
}
-mfm_harddisk_device::mfm_harddisk_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : harddisk_image_device(mconfig, type, name, tag, owner, clock, shortname, source),
+mfm_harddisk_device::mfm_harddisk_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : harddisk_image_device(mconfig, type, tag, owner, clock),
device_slot_card_interface(mconfig, *this),
m_index_timer(nullptr),
m_spinup_timer(nullptr),
@@ -935,17 +935,17 @@ int mfm_harddisk_device::get_actual_heads()
The generic HD takes any kind of CHD HD image and magically creates enough heads and cylinders.
*/
mfm_hd_generic_device::mfm_hd_generic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
-: mfm_harddisk_device(mconfig, MFMHD_GENERIC, "Generic MFM hard disk", tag, owner, clock, "mfm_harddisk", __FILE__)
+: mfm_harddisk_device(mconfig, MFMHD_GENERIC, tag, owner, clock)
{
}
-const device_type MFMHD_GENERIC = device_creator<mfm_hd_generic_device>;
+DEFINE_DEVICE_TYPE(MFMHD_GENERIC, mfm_hd_generic_device, "mfm_harddisk", "Generic MFM hard disk")
/*
Various models.
*/
mfm_hd_st213_device::mfm_hd_st213_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
-: mfm_harddisk_device(mconfig, MFMHD_ST213, "Seagate ST-213 MFM hard disk", tag, owner, clock, "mfm_hd_st213", __FILE__)
+: mfm_harddisk_device(mconfig, MFMHD_ST213, tag, owner, clock)
{
m_phys_cylinders = 670;
m_max_cylinders = 615; // 0..614
@@ -955,10 +955,10 @@ mfm_hd_st213_device::mfm_hd_st213_device(const machine_config &mconfig, const ch
m_maxseek_time = 150;
}
-const device_type MFMHD_ST213 = device_creator<mfm_hd_st213_device>;
+DEFINE_DEVICE_TYPE(MFMHD_ST213, mfm_hd_st213_device, "mfm_hd_st213", "Seagate ST-213 MFM hard disk")
mfm_hd_st225_device::mfm_hd_st225_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
-: mfm_harddisk_device(mconfig, MFMHD_ST225, "Seagate ST-225 MFM hard disk", tag, owner, clock, "mfm_hd_st225", __FILE__)
+: mfm_harddisk_device(mconfig, MFMHD_ST225, tag, owner, clock)
{
m_phys_cylinders = 670;
m_max_cylinders = 615;
@@ -968,10 +968,10 @@ mfm_hd_st225_device::mfm_hd_st225_device(const machine_config &mconfig, const ch
m_maxseek_time = 150;
}
-const device_type MFMHD_ST225 = device_creator<mfm_hd_st225_device>;
+DEFINE_DEVICE_TYPE(MFMHD_ST225, mfm_hd_st225_device, "mfm_hd_st225", "Seagate ST-225 MFM hard disk")
mfm_hd_st251_device::mfm_hd_st251_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
-: mfm_harddisk_device(mconfig, MFMHD_ST251, "Seagate ST-251 MFM hard disk", tag, owner, clock, "mfm_hd_st251", __FILE__)
+: mfm_harddisk_device(mconfig, MFMHD_ST251, tag, owner, clock)
{
m_phys_cylinders = 821;
m_max_cylinders = 820;
@@ -981,7 +981,7 @@ mfm_hd_st251_device::mfm_hd_st251_device(const machine_config &mconfig, const ch
m_maxseek_time = 70;
}
-const device_type MFMHD_ST251 = device_creator<mfm_hd_st251_device>;
+DEFINE_DEVICE_TYPE(MFMHD_ST251, mfm_hd_st251_device, "mfm_hd_st251", "Seagate ST-251 MFM hard disk")
// ===========================================================
// Track cache
@@ -1178,7 +1178,7 @@ uint16_t* mfmhd_trackimage_cache::get_trackimage(int cylinder, int head)
// ================================================================
mfm_harddisk_connector::mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock):
- device_t(mconfig, MFM_HD_CONNECTOR, "MFM hard disk connector", tag, owner, clock, "mfm_hd_connector", __FILE__),
+ device_t(mconfig, MFM_HD_CONNECTOR, tag, owner, clock),
device_slot_interface(mconfig, *this),
m_encoding(),
m_spinupms(0),
@@ -1222,4 +1222,4 @@ void mfm_harddisk_connector::device_config_complete()
}
}
-const device_type MFM_HD_CONNECTOR = device_creator<mfm_harddisk_connector>;
+DEFINE_DEVICE_TYPE(MFM_HD_CONNECTOR, mfm_harddisk_connector, "mfm_hd_connector", "MFM hard disk connector")
diff --git a/src/devices/imagedev/mfmhd.h b/src/devices/imagedev/mfmhd.h
index e100a14f7d0..972d7bd4e75 100644
--- a/src/devices/imagedev/mfmhd.h
+++ b/src/devices/imagedev/mfmhd.h
@@ -11,8 +11,10 @@
*****************************************************************************/
-#ifndef __MFMHD__
-#define __MFMHD__
+#ifndef MAME_DEVICES_IMAGEDEV_MFMHD_H
+#define MAME_DEVICES_IMAGEDEV_MFMHD_H
+
+#pragma once
#include "imagedev/harddriv.h"
#include "formats/mfm_hd.h"
@@ -50,7 +52,6 @@ class mfm_harddisk_device : public harddisk_image_device,
public device_slot_card_interface
{
public:
- mfm_harddisk_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
~mfm_harddisk_device();
typedef delegate<void (mfm_harddisk_device*, int)> index_pulse_cb;
@@ -101,6 +102,8 @@ public:
int get_actual_heads();
protected:
+ mfm_harddisk_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
void device_start() override;
void device_stop() override;
void device_reset() override;
@@ -176,7 +179,7 @@ public:
mfm_hd_generic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
-extern const device_type MFMHD_GENERIC;
+DECLARE_DEVICE_TYPE(MFMHD_GENERIC, mfm_hd_generic_device)
class mfm_hd_st213_device : public mfm_harddisk_device
{
@@ -184,7 +187,7 @@ public:
mfm_hd_st213_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
-extern const device_type MFMHD_ST213;
+DECLARE_DEVICE_TYPE(MFMHD_ST213, mfm_hd_st213_device)
class mfm_hd_st225_device : public mfm_harddisk_device
{
@@ -192,7 +195,7 @@ public:
mfm_hd_st225_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
-extern const device_type MFMHD_ST225;
+DECLARE_DEVICE_TYPE(MFMHD_ST225, mfm_hd_st225_device)
class mfm_hd_st251_device : public mfm_harddisk_device
{
@@ -200,7 +203,7 @@ public:
mfm_hd_st251_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
-extern const device_type MFMHD_ST251;
+DECLARE_DEVICE_TYPE(MFMHD_ST251, mfm_hd_st251_device)
/* Connector for a MFM hard disk. See also floppy.c */
@@ -226,7 +229,7 @@ private:
mfmhd_image_format_t* m_format;
};
-extern const device_type MFM_HD_CONNECTOR;
+DECLARE_DEVICE_TYPE(MFM_HD_CONNECTOR, mfm_harddisk_connector)
/*
Add a harddisk connector.
@@ -246,4 +249,4 @@ extern const device_type MFM_HD_CONNECTOR;
static_cast<mfm_harddisk_connector *>(device)->configure(_enc, _spinupms, _cache, _format);
-#endif
+#endif // MAME_DEVICES_IMAGEDEV_MFMHD_H
diff --git a/src/devices/imagedev/midiin.cpp b/src/devices/imagedev/midiin.cpp
index de949f81881..e9301c76504 100644
--- a/src/devices/imagedev/midiin.cpp
+++ b/src/devices/imagedev/midiin.cpp
@@ -16,14 +16,14 @@
IMPLEMENTATION
***************************************************************************/
-const device_type MIDIIN = device_creator<midiin_device>;
+DEFINE_DEVICE_TYPE(MIDIIN, midiin_device, "midiin", "MIDI In image device")
/*-------------------------------------------------
ctor
-------------------------------------------------*/
midiin_device::midiin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, MIDIIN, "MIDI In image device", tag, owner, clock, "midiin", __FILE__),
+ : device_t(mconfig, MIDIIN, tag, owner, clock),
device_image_interface(mconfig, *this),
device_serial_interface(mconfig, *this),
m_midi(nullptr),
diff --git a/src/devices/imagedev/midiin.h b/src/devices/imagedev/midiin.h
index ed02b525dc4..581558bbe1b 100644
--- a/src/devices/imagedev/midiin.h
+++ b/src/devices/imagedev/midiin.h
@@ -8,8 +8,10 @@
*********************************************************************/
-#ifndef __MIDIIN_H__
-#define __MIDIIN_H__
+#ifndef MAME_DEVICES_IMAGEDEV_MIDIIN_H
+#define MAME_DEVICES_IMAGEDEV_MIDIIN_H
+
+#pragma once
#define MCFG_MIDIIN_INPUT_CB(_devcb) \
@@ -69,9 +71,9 @@ private:
};
// device type definition
-extern const device_type MIDIIN;
+DECLARE_DEVICE_TYPE(MIDIIN, midiin_device)
// device iterator
typedef device_type_iterator<midiin_device> midiin_device_iterator;
-#endif /* __MIDIIN_H__ */
+#endif // MAME_DEVICES_IMAGEDEV_MIDIIN_H
diff --git a/src/devices/imagedev/midiout.cpp b/src/devices/imagedev/midiout.cpp
index 8acb6a540ec..6b05020e77b 100644
--- a/src/devices/imagedev/midiout.cpp
+++ b/src/devices/imagedev/midiout.cpp
@@ -16,14 +16,14 @@
IMPLEMENTATION
***************************************************************************/
-const device_type MIDIOUT = device_creator<midiout_device>;
+DEFINE_DEVICE_TYPE(MIDIOUT, midiout_device, "midiout", "MIDI Out image device")
/*-------------------------------------------------
ctor
-------------------------------------------------*/
midiout_device::midiout_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, MIDIOUT, "MIDI Out image device", tag, owner, clock, "midiout", __FILE__),
+ : device_t(mconfig, MIDIOUT, tag, owner, clock),
device_image_interface(mconfig, *this),
device_serial_interface(mconfig, *this),
m_midi(nullptr)
diff --git a/src/devices/imagedev/midiout.h b/src/devices/imagedev/midiout.h
index d79f5247df4..8fa29f9d7a7 100644
--- a/src/devices/imagedev/midiout.h
+++ b/src/devices/imagedev/midiout.h
@@ -8,8 +8,8 @@
*********************************************************************/
-#ifndef __MIDIOUT_H__
-#define __MIDIOUT_H__
+#ifndef MAME_DEVICES_IMAGEDEV_MIDIOUT_H
+#define MAME_DEVICES_IMAGEDEV_MIDIOUT_H
/***************************************************************************
@@ -63,9 +63,9 @@ private:
};
// device type definition
-extern const device_type MIDIOUT;
+DECLARE_DEVICE_TYPE(MIDIOUT, midiout_device)
// device iterator
typedef device_type_iterator<midiout_device> midiout_device_iterator;
-#endif /* __MIDIOUT_H__ */
+#endif // MAME_DEVICES_IMAGEDEV_MIDIOUT_H
diff --git a/src/devices/imagedev/printer.cpp b/src/devices/imagedev/printer.cpp
index f4ea99a7d3f..2eb187d843a 100644
--- a/src/devices/imagedev/printer.cpp
+++ b/src/devices/imagedev/printer.cpp
@@ -13,14 +13,14 @@
// device type definition
-const device_type PRINTER = device_creator<printer_image_device>;
+DEFINE_DEVICE_TYPE(PRINTER, printer_image_device, "printer_image", "Printer")
//-------------------------------------------------
// printer_image_device - constructor
//-------------------------------------------------
printer_image_device::printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, PRINTER, "Printer", tag, owner, clock, "printer_image", __FILE__),
+ device_t(mconfig, PRINTER, tag, owner, clock),
device_image_interface(mconfig, *this),
m_online_cb(*this)
{
diff --git a/src/devices/imagedev/printer.h b/src/devices/imagedev/printer.h
index ae8ad93ae97..acf07296882 100644
--- a/src/devices/imagedev/printer.h
+++ b/src/devices/imagedev/printer.h
@@ -8,8 +8,10 @@
****************************************************************************/
-#ifndef __PRINTER_H__
-#define __PRINTER_H__
+#ifndef MAME_DEVICES_IMAGEDEV_PRINTER_H
+#define MAME_DEVICES_IMAGEDEV_PRINTER_H
+
+#pragma once
#define MCFG_PRINTER_ONLINE_CB(_devcb) \
devcb = &printer_image_device::set_online_callback(*device, DEVCB_##_devcb);
@@ -58,6 +60,6 @@ protected:
// device type definition
-extern const device_type PRINTER;
+DECLARE_DEVICE_TYPE(PRINTER, printer_image_device)
-#endif /* __PRINTER_H__ */
+#endif // MAME_DEVICES_IMAGEDEV_PRINTER_H
diff --git a/src/devices/imagedev/snapquik.cpp b/src/devices/imagedev/snapquik.cpp
index cc95783450d..0e24b9f81ba 100644
--- a/src/devices/imagedev/snapquik.cpp
+++ b/src/devices/imagedev/snapquik.cpp
@@ -12,25 +12,19 @@
#include "snapquik.h"
// device type definition
-const device_type SNAPSHOT = device_creator<snapshot_image_device>;
+DEFINE_DEVICE_TYPE(SNAPSHOT, snapshot_image_device, "snapsot_image", "Snapshot")
//-------------------------------------------------
// snapshot_image_device - constructor
//-------------------------------------------------
snapshot_image_device::snapshot_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, SNAPSHOT, "Snapshot", tag, owner, clock, "snapshot_image", __FILE__),
- device_image_interface(mconfig, *this),
- m_file_extensions(nullptr),
- m_interface(nullptr),
- m_delay_seconds(0),
- m_delay_attoseconds(0),
- m_timer(nullptr)
+ : snapshot_image_device(mconfig, SNAPSHOT, tag, owner, clock)
{
}
-snapshot_image_device::snapshot_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) :
- device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+snapshot_image_device::snapshot_image_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, type, tag, owner, clock),
device_image_interface(mconfig, *this),
m_file_extensions(nullptr),
m_interface(nullptr),
@@ -78,13 +72,13 @@ image_init_result snapshot_image_device::call_load()
}
// device type definition
-const device_type QUICKLOAD = device_creator<quickload_image_device>;
+DEFINE_DEVICE_TYPE(QUICKLOAD, quickload_image_device, "quickload", "Quickload")
//-------------------------------------------------
// quickload_image_device - constructor
//-------------------------------------------------
quickload_image_device::quickload_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : snapshot_image_device(mconfig, QUICKLOAD, "Quickload", tag, owner, clock, "quickload", __FILE__)
+ : snapshot_image_device(mconfig, QUICKLOAD, tag, owner, clock)
{
}
diff --git a/src/devices/imagedev/snapquik.h b/src/devices/imagedev/snapquik.h
index 89a77a8360f..dfe458979bb 100644
--- a/src/devices/imagedev/snapquik.h
+++ b/src/devices/imagedev/snapquik.h
@@ -8,8 +8,8 @@
*********************************************************************/
-#ifndef __SNAPQUIK_H__
-#define __SNAPQUIK_H__
+#ifndef MAME_DEVICES_IMAGEDEV_SNAPQUIK_H
+#define MAME_DEVICES_IMAGEDEV_SNAPQUIK_H
#include "softlist_dev.h"
@@ -22,7 +22,6 @@ class snapshot_image_device : public device_t,
public:
// construction/destruction
snapshot_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- snapshot_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
virtual ~snapshot_image_device();
static void static_set_interface(device_t &device, const char *_interface) { downcast<snapshot_image_device &>(device).m_interface = _interface; }
@@ -42,7 +41,10 @@ public:
TIMER_CALLBACK_MEMBER(process_snapshot_or_quickload);
void set_handler(snapquick_load_delegate load, const char *ext, seconds_t sec) { m_load = load; m_file_extensions = ext; m_delay_seconds = sec; };
+
protected:
+ snapshot_image_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
// device-level overrides
virtual void device_start() override;
@@ -55,7 +57,7 @@ protected:
};
// device type definition
-extern const device_type SNAPSHOT;
+DECLARE_DEVICE_TYPE(SNAPSHOT, snapshot_image_device)
// ======================> quickload_image_device
@@ -69,7 +71,7 @@ public:
};
// device type definition
-extern const device_type QUICKLOAD;
+DECLARE_DEVICE_TYPE(QUICKLOAD, quickload_image_device)
/***************************************************************************
DEVICE CONFIGURATION MACROS
@@ -100,4 +102,4 @@ extern const device_type QUICKLOAD;
#define MCFG_QUICKLOAD_INTERFACE(_interface) \
quickload_image_device::static_set_interface(*device, _interface);
-#endif /* __SNAPQUIK_H__ */
+#endif // MAME_DEVICES_IMAGEDEV_SNAPQUIK_H