diff options
author | 2012-11-26 16:01:01 +0000 | |
---|---|---|
committer | 2012-11-26 16:01:01 +0000 | |
commit | cbcc76b36ca448177e10dafabf68807a05bb5c98 (patch) | |
tree | 99fee07b1f2a35fd08f86e265b0f6d5e57332570 /src/mess | |
parent | 0a31823230a7c2241496b3587f32cfd81b503ab1 (diff) |
(MESS) wd1772: Added FD1771 and FD1797 variants. [Curt Coder]
Diffstat (limited to 'src/mess')
-rw-r--r-- | src/mess/machine/wd1772.c | 38 | ||||
-rw-r--r-- | src/mess/machine/wd1772.h | 85 |
2 files changed, 82 insertions, 41 deletions
diff --git a/src/mess/machine/wd1772.c b/src/mess/machine/wd1772.c index 0a819441799..3b29bfcce38 100644 --- a/src/mess/machine/wd1772.c +++ b/src/mess/machine/wd1772.c @@ -35,12 +35,14 @@ #include "debugger.h" +const device_type FD1771x = &device_creator<fd1771_t>; +const device_type FD1793x = &device_creator<fd1793_t>; +const device_type FD1797x = &device_creator<fd1797_t>; +const device_type WD2793x = &device_creator<wd2793_t>; +const device_type WD2797x = &device_creator<wd2797_t>; const device_type WD1770x = &device_creator<wd1770_t>; const device_type WD1772x = &device_creator<wd1772_t>; const device_type WD1773x = &device_creator<wd1773_t>; -const device_type WD2793x = &device_creator<wd2793_t>; -const device_type WD2797x = &device_creator<wd2797_t>; -const device_type FD1793x = &device_creator<fd1793_t>; wd177x_t::wd177x_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, type, name, tag, owner, clock) @@ -1861,37 +1863,45 @@ bool wd177x_t::has_precompensation() const return false; } -wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1770x, "WD1770", tag, owner, clock) +fd1771_t::fd1771_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, FD1771x, "FD1771", tag, owner, clock) { } -wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1772x, "WD1772", tag, owner, clock) +fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, FD1793x, "FD1793", tag, owner, clock) { } -int wd1772_t::step_time(int mode) const +fd1797_t::fd1797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, FD1797x, "FD1797", tag, owner, clock) { - const static int step_times[4] = { 48000, 96000, 16000, 24000 }; - return step_times[mode]; } -int wd1772_t::settle_time() const +wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD2793x, "WD2793", tag, owner, clock) { - return 120000; } -wd1773_t::wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1773x, "WD1773", tag, owner, clock) +wd2797_t::wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD2797x, "WD2797", tag, owner, clock) { } -wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD2793x, "WD2793", tag, owner, clock) +wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1770x, "WD1770", tag, owner, clock) { } -wd2797_t::wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD2797x, "WD2797", tag, owner, clock) +wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1772x, "WD1772", tag, owner, clock) { } -fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, FD1793x, "FD1793", tag, owner, clock) +int wd1772_t::step_time(int mode) const +{ + const static int step_times[4] = { 48000, 96000, 16000, 24000 }; + return step_times[mode]; +} + +int wd1772_t::settle_time() const +{ + return 120000; +} + +wd1773_t::wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1773x, "WD1773", tag, owner, clock) { } diff --git a/src/mess/machine/wd1772.h b/src/mess/machine/wd1772.h index b530ca1212b..22803f6ad39 100644 --- a/src/mess/machine/wd1772.h +++ b/src/mess/machine/wd1772.h @@ -4,14 +4,14 @@ #include "emu.h" #include "imagedev/floppy.h" -#define MCFG_WD1770x_ADD(_tag, _clock) \ - MCFG_DEVICE_ADD(_tag, WD1770x, _clock) +#define MCFG_FD1771x_ADD(_tag, _clock) \ + MCFG_DEVICE_ADD(_tag, FD1771x, _clock) -#define MCFG_WD1772x_ADD(_tag, _clock) \ - MCFG_DEVICE_ADD(_tag, WD1772x, _clock) +#define MCFG_FD1793x_ADD(_tag, _clock) \ + MCFG_DEVICE_ADD(_tag, FD1793x, _clock) -#define MCFG_WD1773x_ADD(_tag, _clock) \ - MCFG_DEVICE_ADD(_tag, WD1773x, _clock) +#define MCFG_FD1797x_ADD(_tag, _clock) \ + MCFG_DEVICE_ADD(_tag, FD1797x, _clock) #define MCFG_WD2793x_ADD(_tag, _clock) \ MCFG_DEVICE_ADD(_tag, WD2793x, _clock) @@ -19,8 +19,14 @@ #define MCFG_WD2797x_ADD(_tag, _clock) \ MCFG_DEVICE_ADD(_tag, WD2797x, _clock) -#define MCFG_FD1793x_ADD(_tag, _clock) \ - MCFG_DEVICE_ADD(_tag, FD1793x, _clock) +#define MCFG_WD1770x_ADD(_tag, _clock) \ + MCFG_DEVICE_ADD(_tag, WD1770x, _clock) + +#define MCFG_WD1772x_ADD(_tag, _clock) \ + MCFG_DEVICE_ADD(_tag, WD1772x, _clock) + +#define MCFG_WD1773x_ADD(_tag, _clock) \ + MCFG_DEVICE_ADD(_tag, WD1773x, _clock) class wd177x_t : public device_t { public: @@ -326,34 +332,38 @@ private: void set_drq(); }; -class wd1770_t : public wd177x_t { +class fd1771_t : public wd177x_t { public: - wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd1771_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); protected: - virtual bool has_motor() const { return true; } - virtual bool has_precompensation() const { return true; } + virtual bool has_ready() const { return true; } + virtual bool has_motor() const { return false; } + virtual bool has_head_load() const { return true; } + virtual bool has_side_check() const { return true; } }; -class wd1772_t : public wd177x_t { +class fd1793_t : public wd177x_t { public: - wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); protected: - virtual bool has_motor() const { return true; } - virtual bool has_precompensation() const { return true; } - virtual int step_time(int mode) const; - virtual int settle_time() const; + virtual bool has_ready() const { return true; } + virtual bool has_motor() const { return false; } + virtual bool has_head_load() const { return true; } + virtual bool has_side_check() const { return true; } }; -class wd1773_t : public wd177x_t { +class fd1797_t : public wd177x_t { public: - wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd1797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); protected: + virtual bool has_ready() const { return true; } virtual bool has_motor() const { return false; } virtual bool has_head_load() const { return true; } - virtual bool has_side_check() const { return true; } + virtual bool has_side_select() const { return true; } + virtual bool has_sector_length_select() const { return true; } }; class wd2793_t : public wd177x_t { @@ -379,22 +389,43 @@ protected: virtual bool has_sector_length_select() const { return true; } }; -class fd1793_t : public wd177x_t { +class wd1770_t : public wd177x_t { public: - fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + virtual bool has_motor() const { return true; } + virtual bool has_precompensation() const { return true; } +}; + +class wd1772_t : public wd177x_t { +public: + wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + virtual bool has_motor() const { return true; } + virtual bool has_precompensation() const { return true; } + virtual int step_time(int mode) const; + virtual int settle_time() const; +}; + +class wd1773_t : public wd177x_t { +public: + wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); protected: - virtual bool has_ready() const { return true; } virtual bool has_motor() const { return false; } virtual bool has_head_load() const { return true; } virtual bool has_side_check() const { return true; } }; +extern const device_type FD1771x; +extern const device_type FD1793x; +extern const device_type FD1797x; +extern const device_type WD2793x; +extern const device_type WD2797x; extern const device_type WD1770x; extern const device_type WD1772x; extern const device_type WD1773x; -extern const device_type WD2793x; -extern const device_type WD2797x; -extern const device_type FD1793x; #endif |