Previous 199869 Revisions Next

r19153 Monday 26th November, 2012 at 16:01:01 UTC by Curt Coder
(MESS) wd1772: Added FD1771 and FD1797 variants. [Curt Coder]
[src/mess/machine]wd1772.c wd1772.h

trunk/src/mess/machine/wd1772.c
r19152r19153
3535
3636#include "debugger.h"
3737
38const device_type FD1771x = &device_creator<fd1771_t>;
39const device_type FD1793x = &device_creator<fd1793_t>;
40const device_type FD1797x = &device_creator<fd1797_t>;
41const device_type WD2793x = &device_creator<wd2793_t>;
42const device_type WD2797x = &device_creator<wd2797_t>;
3843const device_type WD1770x = &device_creator<wd1770_t>;
3944const device_type WD1772x = &device_creator<wd1772_t>;
4045const device_type WD1773x = &device_creator<wd1773_t>;
41const device_type WD2793x = &device_creator<wd2793_t>;
42const device_type WD2797x = &device_creator<wd2797_t>;
43const device_type FD1793x = &device_creator<fd1793_t>;
4446
4547wd177x_t::wd177x_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
4648   device_t(mconfig, type, name, tag, owner, clock)
r19152r19153
18611863   return false;
18621864}
18631865
1864wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1770x, "WD1770", tag, owner, clock)
1866fd1771_t::fd1771_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, FD1771x, "FD1771", tag, owner, clock)
18651867{
18661868}
18671869
1868wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1772x, "WD1772", tag, owner, clock)
1870fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, FD1793x, "FD1793", tag, owner, clock)
18691871{
18701872}
18711873
1872int wd1772_t::step_time(int mode) const
1874fd1797_t::fd1797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, FD1797x, "FD1797", tag, owner, clock)
18731875{
1874   const static int step_times[4] = { 48000, 96000, 16000, 24000 };
1875   return step_times[mode];
18761876}
18771877
1878int wd1772_t::settle_time() const
1878wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD2793x, "WD2793", tag, owner, clock)
18791879{
1880   return 120000;
18811880}
18821881
1883wd1773_t::wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1773x, "WD1773", tag, owner, clock)
1882wd2797_t::wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD2797x, "WD2797", tag, owner, clock)
18841883{
18851884}
18861885
1887wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD2793x, "WD2793", tag, owner, clock)
1886wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1770x, "WD1770", tag, owner, clock)
18881887{
18891888}
18901889
1891wd2797_t::wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD2797x, "WD2797", tag, owner, clock)
1890wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1772x, "WD1772", tag, owner, clock)
18921891{
18931892}
18941893
1895fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, FD1793x, "FD1793", tag, owner, clock)
1894int wd1772_t::step_time(int mode) const
18961895{
1896   const static int step_times[4] = { 48000, 96000, 16000, 24000 };
1897   return step_times[mode];
18971898}
1899
1900int wd1772_t::settle_time() const
1901{
1902   return 120000;
1903}
1904
1905wd1773_t::wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1773x, "WD1773", tag, owner, clock)
1906{
1907}
trunk/src/mess/machine/wd1772.h
r19152r19153
44#include "emu.h"
55#include "imagedev/floppy.h"
66
7#define MCFG_WD1770x_ADD(_tag, _clock)  \
8   MCFG_DEVICE_ADD(_tag, WD1770x, _clock)
7#define MCFG_FD1771x_ADD(_tag, _clock)  \
8   MCFG_DEVICE_ADD(_tag, FD1771x, _clock)
99
10#define MCFG_WD1772x_ADD(_tag, _clock)  \
11   MCFG_DEVICE_ADD(_tag, WD1772x, _clock)
10#define MCFG_FD1793x_ADD(_tag, _clock)  \
11   MCFG_DEVICE_ADD(_tag, FD1793x, _clock)
1212
13#define MCFG_WD1773x_ADD(_tag, _clock)  \
14   MCFG_DEVICE_ADD(_tag, WD1773x, _clock)
13#define MCFG_FD1797x_ADD(_tag, _clock)  \
14   MCFG_DEVICE_ADD(_tag, FD1797x, _clock)
1515
1616#define MCFG_WD2793x_ADD(_tag, _clock)  \
1717   MCFG_DEVICE_ADD(_tag, WD2793x, _clock)
r19152r19153
1919#define MCFG_WD2797x_ADD(_tag, _clock)  \
2020   MCFG_DEVICE_ADD(_tag, WD2797x, _clock)
2121
22#define MCFG_FD1793x_ADD(_tag, _clock)  \
23   MCFG_DEVICE_ADD(_tag, FD1793x, _clock)
22#define MCFG_WD1770x_ADD(_tag, _clock)  \
23   MCFG_DEVICE_ADD(_tag, WD1770x, _clock)
2424
25#define MCFG_WD1772x_ADD(_tag, _clock)  \
26   MCFG_DEVICE_ADD(_tag, WD1772x, _clock)
27
28#define MCFG_WD1773x_ADD(_tag, _clock)  \
29   MCFG_DEVICE_ADD(_tag, WD1773x, _clock)
30
2531class wd177x_t : public device_t {
2632public:
2733   typedef delegate<void (bool state)> line_cb;
r19152r19153
326332   void set_drq();
327333};
328334
329class wd1770_t : public wd177x_t {
335class fd1771_t : public wd177x_t {
330336public:
331   wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
337   fd1771_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
332338
333339protected:
334   virtual bool has_motor() const { return true; }
335   virtual bool has_precompensation() const { return true; }
340   virtual bool has_ready() const { return true; }
341   virtual bool has_motor() const { return false; }
342   virtual bool has_head_load() const { return true; }
343   virtual bool has_side_check() const { return true; }
336344};
337345
338class wd1772_t : public wd177x_t {
346class fd1793_t : public wd177x_t {
339347public:
340   wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
348   fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
341349
342350protected:
343   virtual bool has_motor() const { return true; }
344   virtual bool has_precompensation() const { return true; }
345   virtual int step_time(int mode) const;
346   virtual int settle_time() const;
351   virtual bool has_ready() const { return true; }
352   virtual bool has_motor() const { return false; }
353   virtual bool has_head_load() const { return true; }
354   virtual bool has_side_check() const { return true; }
347355};
348356
349class wd1773_t : public wd177x_t {
357class fd1797_t : public wd177x_t {
350358public:
351   wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
359   fd1797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
352360
353361protected:
362   virtual bool has_ready() const { return true; }
354363   virtual bool has_motor() const { return false; }
355364   virtual bool has_head_load() const { return true; }
356   virtual bool has_side_check() const { return true; }
365   virtual bool has_side_select() const { return true; }
366   virtual bool has_sector_length_select() const { return true; }
357367};
358368
359369class wd2793_t : public wd177x_t {
r19152r19153
379389   virtual bool has_sector_length_select() const { return true; }
380390};
381391
382class fd1793_t : public wd177x_t {
392class wd1770_t : public wd177x_t {
383393public:
384   fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
394   wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
385395
386396protected:
387   virtual bool has_ready() const { return true; }
397   virtual bool has_motor() const { return true; }
398   virtual bool has_precompensation() const { return true; }
399};
400
401class wd1772_t : public wd177x_t {
402public:
403   wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
404
405protected:
406   virtual bool has_motor() const { return true; }
407   virtual bool has_precompensation() const { return true; }
408   virtual int step_time(int mode) const;
409   virtual int settle_time() const;
410};
411
412class wd1773_t : public wd177x_t {
413public:
414   wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
415
416protected:
388417   virtual bool has_motor() const { return false; }
389418   virtual bool has_head_load() const { return true; }
390419   virtual bool has_side_check() const { return true; }
391420};
392421
422extern const device_type FD1771x;
423extern const device_type FD1793x;
424extern const device_type FD1797x;
425extern const device_type WD2793x;
426extern const device_type WD2797x;
393427extern const device_type WD1770x;
394428extern const device_type WD1772x;
395429extern const device_type WD1773x;
396extern const device_type WD2793x;
397extern const device_type WD2797x;
398extern const device_type FD1793x;
399430
400431#endif

Previous 199869 Revisions Next


© 1997-2024 The MAME Team