diff options
Diffstat (limited to 'src/mess/machine/micropolis.h')
-rw-r--r-- | src/mess/machine/micropolis.h | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/src/mess/machine/micropolis.h b/src/mess/machine/micropolis.h index 32dc071d368..fa4ec0482f0 100644 --- a/src/mess/machine/micropolis.h +++ b/src/mess/machine/micropolis.h @@ -17,6 +17,12 @@ TYPE DEFINITIONS ***************************************************************************/ +#define MCFG_MICROPOLIS_DRIVE_TAGS(_tag1, _tag2, _tag3, _tag4) \ + micropolis_device::set_drive_tags(*device, _tag1, _tag2, _tag3, _tag4); + +#define MCFG_MICROPOLIS_DEFAULT_DRIVE4_TAGS \ + MCFG_MICROPOLIS_DRIVE_TAGS(FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3) + #define MCFG_MICROPOLIS_DDEN_CALLBACK(_read) \ devcb = µpolis_device::set_dden_rd_callback(*device, DEVCB_##_read); @@ -26,18 +32,11 @@ #define MCFG_MICROPOLIS_DRQ_CALLBACK(_write) \ devcb = µpolis_device::set_drq_wr_callback(*device, DEVCB_##_write); -/* Interface */ -struct micropolis_interface -{ - const char *m_floppy_drive_tags[4]; -}; - /*************************************************************************** MACROS ***************************************************************************/ -class micropolis_device : public device_t, - public micropolis_interface +class micropolis_device : public device_t { public: micropolis_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); @@ -47,6 +46,15 @@ public: template<class _Object> static devcb_base &set_intrq_wr_callback(device_t &device, _Object object) { return downcast<micropolis_device &>(device).m_write_intrq.set_callback(object); } template<class _Object> static devcb_base &set_drq_wr_callback(device_t &device, _Object object) { return downcast<micropolis_device &>(device).m_write_drq.set_callback(object); } + static void set_drive_tags(device_t &device, const char *tag1, const char *tag2, const char *tag3, const char *tag4) + { + micropolis_device &dev = downcast<micropolis_device &>(device); + dev.m_floppy_drive_tags[0] = tag1; + dev.m_floppy_drive_tags[1] = tag2; + dev.m_floppy_drive_tags[2] = tag3; + dev.m_floppy_drive_tags[3] = tag4; + } + void set_drive(UINT8 drive); // set current drive (0-3) DECLARE_READ8_MEMBER( status_r ); @@ -60,7 +68,6 @@ public: protected: // device-level overrides - virtual void device_config_complete(); virtual void device_start(); virtual void device_reset(); @@ -71,6 +78,8 @@ private: devcb_write_line m_write_intrq; devcb_write_line m_write_drq; + const char *m_floppy_drive_tags[4]; + /* register */ UINT8 m_data; UINT8 m_drive_num; @@ -97,19 +106,4 @@ private: extern const device_type MICROPOLIS; -/*************************************************************************** - FUNCTION PROTOTYPES -***************************************************************************/ - -extern const micropolis_interface default_micropolis_interface; - - -/*************************************************************************** - DEVICE CONFIGURATION MACROS -***************************************************************************/ - -#define MCFG_MICROPOLIS_ADD(_tag, _intrf) \ - MCFG_DEVICE_ADD(_tag, MICROPOLIS, 0) \ - MCFG_DEVICE_CONFIG(_intrf) - #endif /* __MICROPOLIS_H__ */ |