Previous 199869 Revisions Next

r19113 Friday 23rd November, 2012 at 15:11:35 UTC by Curt Coder
(MESS) wd1772: Improved interrupts, added ready handling and FD1793 variant. [Curt Coder]
(MESS) bw2: Fixed floppy drive select. (nw)
(MESS) v1050: Refactored to use modern floppy system. (nw)
[src/emu/machine]ctronics.h
[src/mess/drivers]bw2.c v1050.c
[src/mess/includes]v1050.h
[src/mess/machine]wd1772.c wd1772.h

trunk/src/emu/machine/ctronics.h
r19112r19113
6363   centronics_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
6464   virtual ~centronics_device();
6565
66   DECLARE_WRITE8_MEMBER( write ) { if (m_dev) m_dev->write(data); }
67   DECLARE_READ8_MEMBER( read ) {  return (m_dev) ? m_dev->read() : 0x00; }
66   void write(UINT8 data) { if (m_dev) m_dev->write(data); }
67   DECLARE_WRITE8_MEMBER( write ) { write(data); }
68   UINT8 read() { return (m_dev) ? m_dev->read() : 0x00; }
69   DECLARE_READ8_MEMBER( read ) { return read(); }
6870
6971   /* access to the individual bits */
7072   DECLARE_WRITE_LINE_MEMBER( d0_w ) { if (m_dev) m_dev->set_line(0, state); }
trunk/src/mess/drivers/bw2.c
r19112r19113
409409   // drive select
410410   m_floppy = NULL;
411411
412   if (BIT(data, 4)) m_floppy = m_floppy0->get_device();
413   if (BIT(data, 5)) m_floppy = m_floppy1->get_device();
412   if (!BIT(data, 4)) m_floppy = m_floppy0->get_device();
413   if (!BIT(data, 5)) m_floppy = m_floppy1->get_device();
414414
415415   m_fdc->set_floppy(m_floppy);
416416   if (m_floppy) m_floppy->mon_w(m_mtron);
trunk/src/mess/drivers/v1050.c
r19112r19113
463463   AM_RANGE(0x8c, 0x8c) AM_DEVREADWRITE(I8251A_SIO_TAG, i8251_device, data_r, data_w)
464464   AM_RANGE(0x8d, 0x8d) AM_DEVREADWRITE(I8251A_SIO_TAG, i8251_device, status_r, control_w)
465465   AM_RANGE(0x90, 0x93) AM_DEVREADWRITE(I8255A_MISC_TAG, i8255_device, read, write)
466   AM_RANGE(0x94, 0x97) AM_DEVREADWRITE_LEGACY(MB8877_TAG, wd17xx_r, wd17xx_w)
466   AM_RANGE(0x94, 0x97) AM_DEVREADWRITE(MB8877_TAG, fd1793_t, read, write)
467467   AM_RANGE(0x9c, 0x9f) AM_DEVREADWRITE(I8255A_RTC_TAG, i8255_device, read, write)
468468   AM_RANGE(0xa0, 0xa0) AM_READWRITE(vint_clr_r, vint_clr_w)
469469   AM_RANGE(0xb0, 0xb0) AM_READWRITE(dint_clr_r, dint_clr_w)
r19112r19113
697697
698698    */
699699
700   int f_motor_on = !BIT(data, 6);
701
702700   // floppy drive select
703   if (!BIT(data, 0)) wd17xx_set_drive(m_fdc, 0);
704   if (!BIT(data, 1)) wd17xx_set_drive(m_fdc, 1);
705   if (!BIT(data, 2)) wd17xx_set_drive(m_fdc, 2);
706   if (!BIT(data, 3)) wd17xx_set_drive(m_fdc, 3);
701   floppy_image_device *floppy = NULL;
707702
703   if (!BIT(data, 0)) floppy = m_floppy0->get_device();
704   if (!BIT(data, 1)) floppy = m_floppy1->get_device();
705   if (!BIT(data, 2)) floppy = m_floppy2->get_device();
706   if (!BIT(data, 3)) floppy = m_floppy3->get_device();
707
708   m_fdc->set_floppy(floppy);
709
708710   // floppy side select
709   wd17xx_set_side(m_fdc, BIT(data, 4));
711   if (floppy) floppy->ss_w(BIT(data, 4));
710712
711713   // floppy motor
712   floppy_mon_w(m_floppy0, BIT(data, 6));
713   floppy_mon_w(m_floppy1, BIT(data, 6));
714   floppy_drive_set_ready_state(m_floppy0, f_motor_on, 1);
715   floppy_drive_set_ready_state(m_floppy1, f_motor_on, 1);
714   if (floppy) floppy->mon_w(BIT(data, 6));
716715
717716   // density select
718   wd17xx_dden_w(m_fdc, BIT(data, 7));
717   m_fdc->dden_w(BIT(data, 7));
719718}
720719
721720WRITE8_MEMBER(v1050_state::misc_ppi_pb_w)
722721{
723   centronics_device *centronics = machine().device<centronics_device>(CENTRONICS_TAG);
724   centronics->write( machine().driver_data()->generic_space() , 0, ~data & 0xff);
722   m_centronics->write(~data & 0xff);
725723}
726724
727725READ8_MEMBER(v1050_state::misc_ppi_pc_r)
r19112r19113
742740    */
743741
744742   UINT8 data = 0;
745   centronics_device *centronics = machine().device<centronics_device>(CENTRONICS_TAG);
746   data |= centronics->not_busy_r() << 4;
747   data |= centronics->pe_r() << 5;
748743
744   data |= m_centronics->not_busy_r() << 4;
745   data |= m_centronics->pe_r() << 5;
746
749747   return data;
750748}
751749
r19112r19113
922920{
923921   m_rxrdy = state;
924922
925   set_interrupt(INT_RS_232, m_rxrdy | m_txrdy);
923   set_interrupt(INT_RS_232, m_rxrdy || m_txrdy);
926924}
927925
928926WRITE_LINE_MEMBER( v1050_state::sio_txrdy_w )
929927{
930928   m_txrdy = state;
931929
932   set_interrupt(INT_RS_232, m_rxrdy | m_txrdy);
930   set_interrupt(INT_RS_232, m_rxrdy || m_txrdy);
933931}
934932
935933static const i8251_interface sio_8251_intf =
r19112r19113
947945
948946// MB8877 Interface
949947
950WRITE_LINE_MEMBER( v1050_state::fdc_intrq_w )
948static SLOT_INTERFACE_START( v1050_floppies )
949   SLOT_INTERFACE( "525dd", FLOPPY_525_DD ) // Teac FD-55F
950SLOT_INTERFACE_END
951
952void v1050_state::fdc_intrq_w(bool state)
951953{
952954   if (m_f_int_enb)
953955   {
954      set_interrupt(INT_FLOPPY, state);
956      set_interrupt(INT_FLOPPY, state ? 1 : 0);
955957   }
956958   else
957959   {
r19112r19113
959961   }
960962}
961963
962WRITE_LINE_MEMBER( v1050_state::fdc_drq_w )
964void v1050_state::fdc_drq_w(bool state)
963965{
964966   if (m_f_int_enb)
965967   {
966      m_maincpu->set_input_line(INPUT_LINE_NMI, state);
968      m_maincpu->set_input_line(INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
967969   }
968970   else
969971   {
r19112r19113
971973   }
972974}
973975
974static const wd17xx_interface fdc_intf =
975{
976   DEVCB_NULL,
977   DEVCB_DRIVER_LINE_MEMBER(v1050_state, fdc_intrq_w),
978   DEVCB_DRIVER_LINE_MEMBER(v1050_state, fdc_drq_w),
979   { FLOPPY_0, FLOPPY_1, NULL, NULL }
980};
981
976/*
982977static LEGACY_FLOPPY_OPTIONS_START( v1050 )
983978   LEGACY_FLOPPY_OPTION( v1050, "dsk", "Visual 1050 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
984979      HEADS([1])
r19112r19113
987982      SECTOR_LENGTH([512])
988983      FIRST_SECTOR_ID([1]))
989984LEGACY_FLOPPY_OPTIONS_END
985*/
990986
991static const floppy_interface v1050_floppy_interface =
992{
993   DEVCB_NULL,
994   DEVCB_NULL,
995   DEVCB_NULL,
996   DEVCB_NULL,
997   DEVCB_NULL,
998   FLOPPY_STANDARD_5_25_DSHD,
999   LEGACY_FLOPPY_OPTIONS_NAME(v1050),
1000   "floppy_5_25",
1001   NULL
1002};
1003
1004
1005987// Machine Initialization
1006988
1007989static IRQ_CALLBACK( v1050_int_ack )
r19112r19113
10211003{
10221004   address_space &program = m_maincpu->space(AS_PROGRAM);
10231005
1006   // floppy callbacks
1007   m_fdc->setup_intrq_cb(fd1793_t::line_cb(FUNC(v1050_state::fdc_intrq_w), this));
1008   m_fdc->setup_drq_cb(fd1793_t::line_cb(FUNC(v1050_state::fdc_drq_w), this));
1009
10241010   // initialize I8214
10251011   m_pic->etlg_w(1);
10261012   m_pic->inte_w(1);
r19112r19113
11031089   MCFG_I8255A_ADD(I8255A_M6502_TAG, m6502_ppi_intf)
11041090   MCFG_I8251_ADD(I8251A_KB_TAG, /*XTAL_16MHz/8,*/ kb_8251_intf)
11051091   MCFG_I8251_ADD(I8251A_SIO_TAG, /*XTAL_16MHz/8,*/ sio_8251_intf)
1106   MCFG_MB8877_ADD(MB8877_TAG, /*XTAL_16MHz/16,*/ fdc_intf )
1107   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(v1050_floppy_interface)
1092   MCFG_FD1793x_ADD(MB8877_TAG, XTAL_16MHz/16)
1093   MCFG_FLOPPY_DRIVE_ADD(MB8877_TAG":0", v1050_floppies, "525dd", NULL, floppy_image_device::default_floppy_formats)
1094   MCFG_FLOPPY_DRIVE_ADD(MB8877_TAG":1", v1050_floppies, "525dd", NULL, floppy_image_device::default_floppy_formats)
1095   MCFG_FLOPPY_DRIVE_ADD(MB8877_TAG":2", v1050_floppies, NULL,    NULL, floppy_image_device::default_floppy_formats)
1096   MCFG_FLOPPY_DRIVE_ADD(MB8877_TAG":3", v1050_floppies, NULL,    NULL, floppy_image_device::default_floppy_formats)
11081097   MCFG_TIMER_DRIVER_ADD_PERIODIC(TIMER_KB_TAG, v1050_state, kb_8251_tick, attotime::from_hz((double)XTAL_16MHz/4/13/8))
11091098   MCFG_TIMER_DRIVER_ADD(TIMER_SIO_TAG, v1050_state, sio_8251_tick)
11101099
trunk/src/mess/machine/wd1772.c
r19112r19113
4040const device_type WD1773x = &device_creator<wd1773_t>;
4141const device_type WD2793x = &device_creator<wd2793_t>;
4242const device_type WD2797x = &device_creator<wd2797_t>;
43const device_type FD1793x = &device_creator<fd1793_t>;
4344
4445wd177x_t::wd177x_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
4546   device_t(mconfig, type, name, tag, owner, clock)
r19112r19113
6162   save_item(NAME(sub_state));
6263   save_item(NAME(track));
6364   save_item(NAME(sector));
65   save_item(NAME(intrq_cond));
6466   save_item(NAME(cmd_buffer));
6567   save_item(NAME(track_buffer));
6668   save_item(NAME(sector_buffer));
r19112r19113
8587   last_dir = 1;
8688   intrq = false;
8789   drq = false;
90   hld = false;
8891   live_abort();
8992}
9093
r19112r19113
117120   drq_cb = cb;
118121}
119122
123void wd177x_t::setup_hld_cb(line_cb cb)
124{
125   hld_cb = cb;
126}
127
128void wd177x_t::setup_enp_cb(line_cb cb)
129{
130   enp_cb = cb;
131}
132
120133void wd177x_t::dden_w(bool _dden)
121134{
122135   dden = _dden;
r19112r19113
163176{
164177   main_state = state;
165178   status = (status & ~(S_CRC|S_RNF|S_SPIN)) | S_BUSY;
179   if(has_head_load()) {
180      // TODO get value from HLT callback
181      if (command & 8)
182         status |= S_HLD;
183      else
184         status &= ~S_HLD;
185   }
166186   sub_state = has_motor() ? SPINUP : SPINUP_DONE;
167187   status_type_1 = true;
168188   seek_continue();
r19112r19113
295315{
296316   if(cur_live.idbuf[0] != track || cur_live.idbuf[2] != sector)
297317      return false;
298   if(!has_side_check())
318   if(!has_side_check() || (command & 2))
299319      return true;
300320   if(command & 8)
301321      return cur_live.idbuf[1] & 1;
r19112r19113
303323      return !(cur_live.idbuf[1] & 1);
304324}
305325
326bool wd177x_t::is_ready()
327{
328   return (floppy && !floppy->ready_r());
329}
330
306331void wd177x_t::read_sector_start()
307332{
333   if(has_ready() && !is_ready())
334      command_end();
335
308336   main_state = READ_SECTOR;
309337   status = (status & ~(S_CRC|S_LOST|S_RNF|S_WP|S_DDM)) | S_BUSY;
310338   drop_drq();
r19112r19113
359387            live_start(SEARCH_ADDRESS_MARK_HEADER);
360388            return;
361389         }
390         // TODO WD2795/7 alternate sector size
362391         sector_size = 128 << (cur_live.idbuf[3] & 3);
363392         sub_state = SECTOR_READ;
364393         live_start(SEARCH_ADDRESS_MARK_DATA);
r19112r19113
391420
392421void wd177x_t::read_track_start()
393422{
423   if(has_ready() && !is_ready())
424      command_end();
425   
394426   main_state = READ_TRACK;
395427   status = (status & ~(S_LOST|S_RNF)) | S_BUSY;
396428   drop_drq();
r19112r19113
455487
456488void wd177x_t::read_id_start()
457489{
490   if(has_ready() && !is_ready())
491      command_end();
492   
458493   main_state = READ_ID;
459494   status = (status & ~(S_WP|S_DDM|S_LOST|S_RNF)) | S_BUSY;
460495   drop_drq();
r19112r19113
517552
518553void wd177x_t::write_track_start()
519554{
555   if(has_ready() && !is_ready())
556      command_end();
557   
520558   main_state = WRITE_TRACK;
521559   status = (status & ~(S_WP|S_DDM|S_LOST|S_RNF)) | S_BUSY;
522560   drop_drq();
r19112r19113
596634
597635void wd177x_t::write_sector_start()
598636{
637   if(has_ready() && !is_ready())
638      command_end();
639   
599640   main_state = WRITE_SECTOR;
600641   status = (status & ~(S_CRC|S_LOST|S_RNF|S_WP|S_DDM)) | S_BUSY;
601642   drop_drq();
r19112r19113
650691            live_start(SEARCH_ADDRESS_MARK_HEADER);
651692            return;
652693         }
694         // TODO WD2795/7 alternate sector size
653695         sector_size = 128 << (cur_live.idbuf[3] & 3);
654696         sub_state = SECTOR_WRITE;
655697         live_start(WRITE_SECTOR_PRE);
r19112r19113
686728      drop_drq();
687729      motor_timeout = 0;
688730   }
689   if(command & 0x08) {
731   
732   if(!(command & 0x0f)) {
733      intrq_cond = 0;
734   } else {
735      intrq_cond = (intrq_cond & I_IMM) | (command & 0x07);
736   }
737
738   if(intrq_cond & I_IMM) {
690739      intrq = true;
691740      if(!intrq_cb.isnull())
692741         intrq_cb(intrq);
693742   }
694   if(command & 0x07) {
743
744   if(command & 0x03) {
695745      logerror("%s: unhandled interrupt generation (%02x)\n", ttsn().cstr(), command);
696746   }
697747}
r19112r19113
791841
792842void wd177x_t::cmd_w(UINT8 val)
793843{
794   if(intrq && ((command & 0xf8) != 0xd8)) {
844   logerror("wd1772 cmd: %02x\n", val);
845   
846   if(intrq && !(intrq_cond & I_IMM)) {
795847      intrq = false;
796848      if(!intrq_cb.isnull())
797849         intrq_cb(intrq);
r19112r19113
808860
809861UINT8 wd177x_t::status_r()
810862{
811   if(intrq && ((command & 0xf8) != 0xd8)) {
863   if(intrq && !(intrq_cond & I_IMM)) {
812864      intrq = false;
813865      if(!intrq_cb.isnull())
814866         intrq_cb(intrq);
815867   }
816868
869   if(main_state == IDLE || status_type_1) {
870      if(floppy && floppy->idx_r())
871         status |= S_IP;
872      else
873         status &= ~S_IP;
874   } else {
875      if(drq)
876         status |= S_DRQ;
877      else
878         status &= ~S_DRQ;
879   }
880
817881   if(status_type_1) {
818882      status &= ~(S_TR00|S_WP);
819883      if(floppy) {
r19112r19113
824888      }
825889   }
826890
827   if(main_state == IDLE || status_type_1) {
828      if(floppy && floppy->idx_r())
829         status |= S_IP;
891   if(has_ready()) {
892      if(!is_ready())
893         status |= S_NRDY;
830894      else
831         status &= ~S_IP;
832   } else {
833      if(drq)
834         status |= S_DRQ;
835      else
836         status &= ~S_DRQ;
895         status &= ~S_NRDY;
837896   }
838897
839898   return status;
r19112r19113
9431002      return;
9441003   }
9451004
1005   if(intrq_cond & I_IDX) {
1006      intrq = true;
1007      if(!intrq_cb.isnull())
1008         intrq_cb(intrq);
1009   }
1010
9461011   switch(sub_state) {
9471012   case IDLE:
9481013      if(has_motor()) {
r19112r19113
10181083   return drq;
10191084}
10201085
1086bool wd177x_t::hld_r()
1087{
1088   return hld;
1089}
1090
1091void wd177x_t::hlt_w(bool state)
1092{
1093   hlt = state;
1094}
1095
1096bool wd177x_t::enp_r()
1097{
1098   return enp;
1099}
1100
10211101void wd177x_t::live_start(int state)
10221102{
10231103   cur_live.tm = machine().time();
r19112r19113
17471827   return 240000;
17481828}
17491829
1830bool wd177x_t::has_ready() const
1831{
1832   return false;
1833}
1834
1835bool wd177x_t::has_head_load() const
1836{
1837   return false;
1838}
1839
17501840bool wd177x_t::has_side_check() const
17511841{
17521842   return false;
r19112r19113
17571847   return false;
17581848}
17591849
1760wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1770x, "WD1770", tag, owner, clock)
1850bool wd177x_t::has_sector_length_select() const
17611851{
1852   return false;
17621853}
17631854
1764bool wd1770_t::has_motor() const
1855bool wd177x_t::has_precompensation() const
17651856{
1766   return true;
1857   return false;
17671858}
17681859
1769wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1772x, "WD1772", tag, owner, clock)
1860wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1770x, "WD1770", tag, owner, clock)
17701861{
17711862}
17721863
1773bool wd1772_t::has_motor() const
1864wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1772x, "WD1772", tag, owner, clock)
17741865{
1775   return true;
17761866}
17771867
17781868int wd1772_t::step_time(int mode) const
r19112r19113
17901880{
17911881}
17921882
1793bool wd1773_t::has_motor() const
1794{
1795   return false;
1796}
1797
1798bool wd1773_t::has_side_check() const
1799{
1800   return false;
1801}
1802
18031883wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD2793x, "WD2793", tag, owner, clock)
18041884{
18051885}
18061886
1807bool wd2793_t::has_motor() const
1808{
1809   return false;
1810}
1811
1812bool wd2793_t::has_side_check() const
1813{
1814   return true;
1815}
1816
18171887wd2797_t::wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD2797x, "WD2797", tag, owner, clock)
18181888{
18191889}
18201890
1821bool wd2797_t::has_motor() const
1891fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, FD1793x, "FD1793", tag, owner, clock)
18221892{
1823   return false;
18241893}
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
r19112r19113
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)
24
2225class wd177x_t : public device_t {
2326public:
2427   typedef delegate<void (bool state)> line_cb;
r19112r19113
2932   void set_floppy(floppy_image_device *floppy);
3033   void setup_intrq_cb(line_cb cb);
3134   void setup_drq_cb(line_cb cb);
35   void setup_hld_cb(line_cb cb);
36   void setup_enp_cb(line_cb cb);
3237
3338   void cmd_w(UINT8 val);
3439   UINT8 status_r();
r19112r19113
5257
5358   void gen_w(int reg, UINT8 val);
5459   UINT8 gen_r(int reg);
60   DECLARE_READ8_MEMBER( read ) { return gen_r(offset);}
61   DECLARE_WRITE8_MEMBER( write ) { gen_w(offset,data); }
5562
5663   bool intrq_r();
5764   bool drq_r();
5865
59   DECLARE_READ8_MEMBER( read ) { return gen_r(offset);}
60   DECLARE_WRITE8_MEMBER( write ) { gen_w(offset,data); }
66   bool hld_r();
67   void hlt_w(bool state);
6168
69   bool enp_r();
70
6271protected:
6372   virtual void device_start();
6473   virtual void device_reset();
6574   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
6675
76   virtual bool has_ready() const;
6777   virtual bool has_motor() const = 0;
78   virtual bool has_head_load() const;
6879   virtual bool has_side_check() const;
6980   virtual bool has_side_select() const;
81   virtual bool has_sector_length_select() const;
82   virtual bool has_precompensation() const;
7083   virtual int step_time(int mode) const;
7184   virtual int settle_time() const;
7285
r19112r19113
223236      S_LOST = 0x04,
224237      S_CRC  = 0x08,
225238      S_RNF  = 0x10,
226      S_SPIN = 0x20,
239      S_HLD  = 0x20,
240      S_SPIN = 0x20, // WD1770, WD1772
227241      S_DDM  = 0x20,
242      S_WF   = 0x20, // WD1773
228243      S_WP   = 0x40,
229      S_MON  = 0x80
244      S_NRDY = 0x80,
245      S_MON  = 0x80  // WD1770, WD1772
230246   };
231247
248   enum {
249      I_RDY = 0x01,
250      I_NRDY = 0x02,
251      I_IDX = 0x04,
252      I_IMM = 0x08
253   };
254
232255   floppy_image_device *floppy;
233256
234257   emu_timer *t_gen, *t_cmd, *t_track, *t_sector;
235258
236   bool dden, status_type_1, intrq, drq;
259   bool dden, status_type_1, intrq, drq, hld, hlt, enp;
237260   int main_state, sub_state;
238   UINT8 command, track, sector, data, status;
261   UINT8 command, track, sector, data, status, intrq_cond;
239262   int last_dir;
240263
241264   int counter, motor_timeout, sector_size;
r19112r19113
243266   int cmd_buffer, track_buffer, sector_buffer;
244267
245268   live_info cur_live, checkpoint_live;
246   line_cb intrq_cb, drq_cb;
269   line_cb intrq_cb, drq_cb, hld_cb, enp_cb;
247270
248271   static astring tts(attotime t);
249272   astring ttsn();
r19112r19113
284307   void spinup();
285308   void index_callback(floppy_image_device *floppy, int state);
286309   bool sector_matches() const;
310   bool is_ready();
287311
288312   void live_start(int live_state);
289313   void live_abort();
r19112r19113
307331   wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
308332
309333protected:
310   virtual bool has_motor() const;
334   virtual bool has_motor() const { return true; }
335   virtual bool has_precompensation() const { return true; }
311336};
312337
313338class wd1772_t : public wd177x_t {
r19112r19113
315340   wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
316341
317342protected:
318   virtual bool has_motor() const;
343   virtual bool has_motor() const { return true; }
344   virtual bool has_precompensation() const { return true; }
319345   virtual int step_time(int mode) const;
320346   virtual int settle_time() const;
321347};
r19112r19113
325351   wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
326352
327353protected:
328   virtual bool has_motor() const;
329   virtual bool has_side_check() const;
354   virtual bool has_motor() const { return false; }
355   virtual bool has_head_load() const { return true; }
356   virtual bool has_side_check() const { return true; }
330357};
331358
332359class wd2793_t : public wd177x_t {
r19112r19113
334361   wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
335362
336363protected:
337   virtual bool has_motor() const;
338   virtual bool has_side_check() const;
364   virtual bool has_ready() const { return true; }
365   virtual bool has_motor() const { return false; }
366   virtual bool has_head_load() const { return true; }
367   virtual bool has_side_check() const { return true; }
339368};
340369
341370class wd2797_t : public wd177x_t {
r19112r19113
343372   wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
344373
345374protected:
346   virtual bool has_motor() const;
347   virtual bool has_side_check() const;
348   virtual bool has_side_select() const;
375   virtual bool has_ready() const { return true; }
376   virtual bool has_motor() const { return false; }
377   virtual bool has_head_load() const { return true; }
378   virtual bool has_side_select() const { return true; }
379   virtual bool has_sector_length_select() const { return true; }
349380};
350381
382class fd1793_t : public wd177x_t {
383public:
384   fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
385
386protected:
387   virtual bool has_ready() const { return true; }
388   virtual bool has_motor() const { return false; }
389   virtual bool has_head_load() const { return true; }
390   virtual bool has_side_check() const { return true; }
391};
392
351393extern const device_type WD1770x;
352394extern const device_type WD1772x;
353395extern const device_type WD1773x;
354396extern const device_type WD2793x;
355397extern const device_type WD2797x;
398extern const device_type FD1793x;
356399
357400#endif
trunk/src/mess/includes/v1050.h
r19112r19113
1717#include "machine/ram.h"
1818#include "machine/scsicb.h"
1919#include "machine/v1050kb.h"
20#include "machine/wd17xx.h"
20#include "machine/wd1772.h"
2121#include "video/mc6845.h"
2222
2323#define SCREEN_TAG            "screen"
r19112r19113
6969        m_crtc(*this, H46505_TAG),
7070        m_centronics(*this, CENTRONICS_TAG),
7171        m_ram(*this, RAM_TAG),
72        m_floppy0(*this, FLOPPY_0),
73        m_floppy1(*this, FLOPPY_1),
72        m_floppy0(*this, MB8877_TAG":0"),
73        m_floppy1(*this, MB8877_TAG":1"),
74        m_floppy2(*this, MB8877_TAG":2"),
75        m_floppy3(*this, MB8877_TAG":3"),
7476        m_timer_sio(*this, TIMER_SIO_TAG),
7577        m_timer_ack(*this, TIMER_ACK_TAG),
7678        m_timer_rst(*this, TIMER_RST_TAG),
77        m_sasibus(*this, SASIBUS_TAG ":host")
78   ,
79      m_video_ram(*this, "video_ram"){ }
79        m_sasibus(*this, SASIBUS_TAG ":host"),
80        m_video_ram(*this, "video_ram")
81   { }
8082
8183   required_device<cpu_device> m_maincpu;
8284   required_device<cpu_device> m_subcpu;
r19112r19113
8486   required_device<msm58321_device> m_rtc;
8587   required_device<i8251_device> m_uart_kb;
8688   required_device<i8251_device> m_uart_sio;
87   required_device<device_t> m_fdc;
89   required_device<fd1793_t> m_fdc;
8890   required_device<mc6845_device> m_crtc;
8991   required_device<centronics_device> m_centronics;
9092   required_device<ram_device> m_ram;
91   required_device<device_t> m_floppy0;
92   required_device<device_t> m_floppy1;
93   required_device<floppy_connector> m_floppy0;
94   required_device<floppy_connector> m_floppy1;
95   required_device<floppy_connector> m_floppy2;
96   required_device<floppy_connector> m_floppy3;
9397   required_device<timer_device> m_timer_sio;
9498   required_device<timer_device> m_timer_ack;
9599   required_device<timer_device> m_timer_rst;
r19112r19113
121125   DECLARE_WRITE_LINE_MEMBER( kb_rxrdy_w );
122126   DECLARE_WRITE_LINE_MEMBER( sio_rxrdy_w );
123127   DECLARE_WRITE_LINE_MEMBER( sio_txrdy_w );
124   DECLARE_WRITE_LINE_MEMBER( fdc_intrq_w );
125   DECLARE_WRITE_LINE_MEMBER( fdc_drq_w );
128   void fdc_intrq_w(bool state);
129   void fdc_drq_w(bool state);
126130   DECLARE_READ8_MEMBER( attr_r );
127131   DECLARE_WRITE8_MEMBER( attr_w );
128132   DECLARE_READ8_MEMBER( videoram_r );

Previous 199869 Revisions Next


© 1997-2024 The MAME Team