trunk/src/mess/machine/wd1772.c
| r19152 | r19153 | |
| 35 | 35 | |
| 36 | 36 | #include "debugger.h" |
| 37 | 37 | |
| 38 | const device_type FD1771x = &device_creator<fd1771_t>; |
| 39 | const device_type FD1793x = &device_creator<fd1793_t>; |
| 40 | const device_type FD1797x = &device_creator<fd1797_t>; |
| 41 | const device_type WD2793x = &device_creator<wd2793_t>; |
| 42 | const device_type WD2797x = &device_creator<wd2797_t>; |
| 38 | 43 | const device_type WD1770x = &device_creator<wd1770_t>; |
| 39 | 44 | const device_type WD1772x = &device_creator<wd1772_t>; |
| 40 | 45 | const device_type WD1773x = &device_creator<wd1773_t>; |
| 41 | | const device_type WD2793x = &device_creator<wd2793_t>; |
| 42 | | const device_type WD2797x = &device_creator<wd2797_t>; |
| 43 | | const device_type FD1793x = &device_creator<fd1793_t>; |
| 44 | 46 | |
| 45 | 47 | wd177x_t::wd177x_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) : |
| 46 | 48 | device_t(mconfig, type, name, tag, owner, clock) |
| r19152 | r19153 | |
| 1861 | 1863 | return false; |
| 1862 | 1864 | } |
| 1863 | 1865 | |
| 1864 | | wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1770x, "WD1770", tag, owner, clock) |
| 1866 | fd1771_t::fd1771_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, FD1771x, "FD1771", tag, owner, clock) |
| 1865 | 1867 | { |
| 1866 | 1868 | } |
| 1867 | 1869 | |
| 1868 | | wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1772x, "WD1772", tag, owner, clock) |
| 1870 | fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, FD1793x, "FD1793", tag, owner, clock) |
| 1869 | 1871 | { |
| 1870 | 1872 | } |
| 1871 | 1873 | |
| 1872 | | int wd1772_t::step_time(int mode) const |
| 1874 | fd1797_t::fd1797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, FD1797x, "FD1797", tag, owner, clock) |
| 1873 | 1875 | { |
| 1874 | | const static int step_times[4] = { 48000, 96000, 16000, 24000 }; |
| 1875 | | return step_times[mode]; |
| 1876 | 1876 | } |
| 1877 | 1877 | |
| 1878 | | int wd1772_t::settle_time() const |
| 1878 | wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD2793x, "WD2793", tag, owner, clock) |
| 1879 | 1879 | { |
| 1880 | | return 120000; |
| 1881 | 1880 | } |
| 1882 | 1881 | |
| 1883 | | wd1773_t::wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1773x, "WD1773", tag, owner, clock) |
| 1882 | wd2797_t::wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD2797x, "WD2797", tag, owner, clock) |
| 1884 | 1883 | { |
| 1885 | 1884 | } |
| 1886 | 1885 | |
| 1887 | | wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD2793x, "WD2793", tag, owner, clock) |
| 1886 | wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1770x, "WD1770", tag, owner, clock) |
| 1888 | 1887 | { |
| 1889 | 1888 | } |
| 1890 | 1889 | |
| 1891 | | wd2797_t::wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD2797x, "WD2797", tag, owner, clock) |
| 1890 | wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1772x, "WD1772", tag, owner, clock) |
| 1892 | 1891 | { |
| 1893 | 1892 | } |
| 1894 | 1893 | |
| 1895 | | fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, FD1793x, "FD1793", tag, owner, clock) |
| 1894 | int wd1772_t::step_time(int mode) const |
| 1896 | 1895 | { |
| 1896 | const static int step_times[4] = { 48000, 96000, 16000, 24000 }; |
| 1897 | return step_times[mode]; |
| 1897 | 1898 | } |
| 1899 | |
| 1900 | int wd1772_t::settle_time() const |
| 1901 | { |
| 1902 | return 120000; |
| 1903 | } |
| 1904 | |
| 1905 | wd1773_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
| r19152 | r19153 | |
| 4 | 4 | #include "emu.h" |
| 5 | 5 | #include "imagedev/floppy.h" |
| 6 | 6 | |
| 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) |
| 9 | 9 | |
| 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) |
| 12 | 12 | |
| 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) |
| 15 | 15 | |
| 16 | 16 | #define MCFG_WD2793x_ADD(_tag, _clock) \ |
| 17 | 17 | MCFG_DEVICE_ADD(_tag, WD2793x, _clock) |
| r19152 | r19153 | |
| 19 | 19 | #define MCFG_WD2797x_ADD(_tag, _clock) \ |
| 20 | 20 | MCFG_DEVICE_ADD(_tag, WD2797x, _clock) |
| 21 | 21 | |
| 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) |
| 24 | 24 | |
| 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 | |
| 25 | 31 | class wd177x_t : public device_t { |
| 26 | 32 | public: |
| 27 | 33 | typedef delegate<void (bool state)> line_cb; |
| r19152 | r19153 | |
| 326 | 332 | void set_drq(); |
| 327 | 333 | }; |
| 328 | 334 | |
| 329 | | class wd1770_t : public wd177x_t { |
| 335 | class fd1771_t : public wd177x_t { |
| 330 | 336 | public: |
| 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); |
| 332 | 338 | |
| 333 | 339 | protected: |
| 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; } |
| 336 | 344 | }; |
| 337 | 345 | |
| 338 | | class wd1772_t : public wd177x_t { |
| 346 | class fd1793_t : public wd177x_t { |
| 339 | 347 | public: |
| 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); |
| 341 | 349 | |
| 342 | 350 | protected: |
| 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; } |
| 347 | 355 | }; |
| 348 | 356 | |
| 349 | | class wd1773_t : public wd177x_t { |
| 357 | class fd1797_t : public wd177x_t { |
| 350 | 358 | public: |
| 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); |
| 352 | 360 | |
| 353 | 361 | protected: |
| 362 | virtual bool has_ready() const { return true; } |
| 354 | 363 | virtual bool has_motor() const { return false; } |
| 355 | 364 | 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; } |
| 357 | 367 | }; |
| 358 | 368 | |
| 359 | 369 | class wd2793_t : public wd177x_t { |
| r19152 | r19153 | |
| 379 | 389 | virtual bool has_sector_length_select() const { return true; } |
| 380 | 390 | }; |
| 381 | 391 | |
| 382 | | class fd1793_t : public wd177x_t { |
| 392 | class wd1770_t : public wd177x_t { |
| 383 | 393 | public: |
| 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); |
| 385 | 395 | |
| 386 | 396 | protected: |
| 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 | |
| 401 | class wd1772_t : public wd177x_t { |
| 402 | public: |
| 403 | wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 404 | |
| 405 | protected: |
| 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 | |
| 412 | class wd1773_t : public wd177x_t { |
| 413 | public: |
| 414 | wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 415 | |
| 416 | protected: |
| 388 | 417 | virtual bool has_motor() const { return false; } |
| 389 | 418 | virtual bool has_head_load() const { return true; } |
| 390 | 419 | virtual bool has_side_check() const { return true; } |
| 391 | 420 | }; |
| 392 | 421 | |
| 422 | extern const device_type FD1771x; |
| 423 | extern const device_type FD1793x; |
| 424 | extern const device_type FD1797x; |
| 425 | extern const device_type WD2793x; |
| 426 | extern const device_type WD2797x; |
| 393 | 427 | extern const device_type WD1770x; |
| 394 | 428 | extern const device_type WD1772x; |
| 395 | 429 | extern const device_type WD1773x; |
| 396 | | extern const device_type WD2793x; |
| 397 | | extern const device_type WD2797x; |
| 398 | | extern const device_type FD1793x; |
| 399 | 430 | |
| 400 | 431 | #endif |