Previous 199869 Revisions Next

r18992 Friday 16th November, 2012 at 18:37:23 UTC by Curt Coder
(MESS) wd1772: Added WD2797 variant, side select output, and immediate interrupt command (0xd8). [Curt Coder]
[src/mess/machine]wd1772.c wd1772.h

trunk/src/mess/machine/wd1772.c
r18991r18992
3939const device_type WD1772x = &device_creator<wd1772_t>;
4040const device_type WD1773x = &device_creator<wd1773_t>;
4141const device_type WD2793x = &device_creator<wd2793_t>;
42const device_type WD2797x = &device_creator<wd2797_t>;
4243
4344wd177x_t::wd177x_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
4445   device_t(mconfig, type, name, tag, owner, clock)
r18991r18992
307308   main_state = READ_SECTOR;
308309   status = (status & ~(S_CRC|S_LOST|S_RNF|S_WP|S_DDM)) | S_BUSY;
309310   drop_drq();
311   if (has_side_select() && floppy)
312      floppy->ss_w(BIT(command, 1));
310313   sub_state = has_motor() ? SPINUP : SPINUP_DONE;
311314   status_type_1 = false;
312315   read_sector_continue();
r18991r18992
391394   main_state = READ_TRACK;
392395   status = (status & ~(S_LOST|S_RNF)) | S_BUSY;
393396   drop_drq();
397   if (has_side_select() && floppy)
398      floppy->ss_w(BIT(command, 1));
394399   sub_state = has_motor() ? SPINUP : SPINUP_DONE;
395400   status_type_1 = false;
396401   read_track_continue();
r18991r18992
453458   main_state = READ_ID;
454459   status = (status & ~(S_WP|S_DDM|S_LOST|S_RNF)) | S_BUSY;
455460   drop_drq();
461   if (has_side_select() && floppy)
462      floppy->ss_w(BIT(command, 1));
456463   sub_state = has_motor() ? SPINUP : SPINUP_DONE;
457464   status_type_1 = false;
458465   read_id_continue();
r18991r18992
513520   main_state = WRITE_TRACK;
514521   status = (status & ~(S_WP|S_DDM|S_LOST|S_RNF)) | S_BUSY;
515522   drop_drq();
523   if (has_side_select() && floppy)
524      floppy->ss_w(BIT(command, 1));
516525   sub_state = has_motor() ? SPINUP : SPINUP_DONE;
517526   status_type_1 = false;
518527   write_track_continue();
r18991r18992
590599   main_state = WRITE_SECTOR;
591600   status = (status & ~(S_CRC|S_LOST|S_RNF|S_WP|S_DDM)) | S_BUSY;
592601   drop_drq();
602   if (has_side_select() && floppy)
603      floppy->ss_w(BIT(command, 1));
593604   sub_state = has_motor() ? SPINUP : SPINUP_DONE;
594605   status_type_1 = false;
595606   write_sector_continue();
r18991r18992
675686      drop_drq();
676687      motor_timeout = 0;
677688   }
678   if(command & 0x0f) {
689   if(command & 0x08) {
690      intrq = true;
691      if(!intrq_cb.isnull())
692         intrq_cb(intrq);
693   }
694   if(command & 0x07) {
679695      logerror("%s: unhandled interrupt generation (%02x)\n", ttsn().cstr(), command);
680696   }
681697}
r18991r18992
17361752   return false;
17371753}
17381754
1755bool wd177x_t::has_side_select() const
1756{
1757   return false;
1758}
1759
17391760wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1770x, "WD1770", tag, owner, clock)
17401761{
17411762}
r18991r18992
17901811
17911812bool wd2793_t::has_side_check() const
17921813{
1814   return true;
1815}
1816
1817wd2797_t::wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD2797x, "WD2797", tag, owner, clock)
1818{
1819}
1820
1821bool wd2797_t::has_motor() const
1822{
17931823   return false;
17941824}
1825
1826bool wd2797_t::has_side_check() const
1827{
1828   return false;
1829}
1830
1831bool wd2797_t::has_side_select() const
1832{
1833   return true;
1834}
trunk/src/mess/machine/wd1772.h
r18991r18992
1616#define MCFG_WD2793x_ADD(_tag, _clock)  \
1717   MCFG_DEVICE_ADD(_tag, WD2793x, _clock)
1818
19#define MCFG_WD2797x_ADD(_tag, _clock)  \
20   MCFG_DEVICE_ADD(_tag, WD2797x, _clock)
21
1922class wd177x_t : public device_t {
2023public:
2124   typedef delegate<void (bool state)> line_cb;
r18991r18992
6366
6467   virtual bool has_motor() const = 0;
6568   virtual bool has_side_check() const;
69   virtual bool has_side_select() const;
6670   virtual int step_time(int mode) const;
6771   virtual int settle_time() const;
6872
r18991r18992
334338   virtual bool has_side_check() const;
335339};
336340
341class wd2797_t : public wd177x_t {
342public:
343   wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
344
345protected:
346   virtual bool has_motor() const;
347   virtual bool has_side_check() const;
348   virtual bool has_side_select() const;
349};
350
337351extern const device_type WD1770x;
338352extern const device_type WD1772x;
339353extern const device_type WD1773x;
340354extern const device_type WD2793x;
355extern const device_type WD2797x;
341356
342357#endif

Previous 199869 Revisions Next


© 1997-2024 The MAME Team