Previous 15994 Revisions Next

r13299 Friday 18th November, 2011 at 08:48:22 UTC by Olivier Galibert
wd1772: generalize to all wd177x [O. Galibert]
[src/mess/drivers]einstein.c
[src/mess/machine]wd1772.c wd1772.h

src/mess/machine/wd1772.c
r13298r13299
22
33#include "debugger.h"
44
5const device_type WD1770x = &device_creator<wd1770_t>;
56const device_type WD1772x = &device_creator<wd1772_t>;
7const device_type WD1773x = &device_creator<wd1773_t>;
68
7const int wd1772_t::step_times[4] = { 48000, 96000, 16000, 24000 };
8
9wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, WD1772x, "WD1772", tag, owner, clock)
9wd177x_t::wd177x_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
10   device_t(mconfig, type, name, tag, owner, clock)
1011{
1112}
1213
13void wd1772_t::device_start()
14void wd177x_t::device_start()
1415{
1516   t_gen = timer_alloc(TM_GEN);
1617   t_cmd = timer_alloc(TM_CMD);
r13298r13299
3334   save_item(NAME(last_dir));
3435}
3536
36void wd1772_t::device_reset()
37void wd177x_t::device_reset()
3738{
3839   command = 0x00;
3940   main_state = IDLE;
r13298r13299
5253   drq = false;
5354}
5455
55void wd1772_t::set_floppy(floppy_image_device *_floppy)
56void wd177x_t::set_floppy(floppy_image_device *_floppy)
5657{
5758   if(floppy == _floppy)
5859      return;
r13298r13299
6566   floppy = _floppy;
6667
6768   if(floppy) {
68      floppy->mon_w(status & S_MON ? 0 : 1);
69      floppy->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(FUNC(wd1772_t::index_callback), this));
69      if(has_motor())
70         floppy->mon_w(status & S_MON ? 0 : 1);
71      floppy->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(FUNC(wd177x_t::index_callback), this));
7072   }
7173}
7274
73void wd1772_t::setup_intrq_cb(line_cb cb)
75void wd177x_t::setup_intrq_cb(line_cb cb)
7476{
7577   intrq_cb = cb;
7678}
7779
78void wd1772_t::setup_drq_cb(line_cb cb)
80void wd177x_t::setup_drq_cb(line_cb cb)
7981{
8082   drq_cb = cb;
8183}
8284
83void wd1772_t::dden_w(bool _dden)
85void wd177x_t::dden_w(bool _dden)
8486{
8587   dden = _dden;
8688}
8789
88astring wd1772_t::tts(attotime t)
90astring wd177x_t::tts(attotime t)
8991{
9092   char buf[256];
9193   int nsec = t.attoseconds / ATTOSECONDS_PER_NANOSECOND;
r13298r13299
9395   return buf;
9496}
9597
96astring wd1772_t::ttsn()
98astring wd177x_t::ttsn()
9799{
98100   return tts(machine().time());
99101}
100102
101void wd1772_t::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
103void wd177x_t::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
102104{
103105   live_sync();
104106
r13298r13299
112114   general_continue();
113115}
114116
115void wd1772_t::command_end()
117void wd177x_t::command_end()
116118{
117119   main_state = sub_state = IDLE;
118120   status &= ~S_BUSY;
r13298r13299
122124      intrq_cb(intrq);
123125}
124126
125void wd1772_t::seek_start(int state)
127void wd177x_t::seek_start(int state)
126128{
127129   main_state = state;
128130   status = (status & ~(S_CRC|S_RNF|S_SPIN)) | S_BUSY;
129   sub_state = SPINUP;
131   sub_state = has_motor() ? SPINUP : SPINUP_DONE;
130132   status_type_1 = true;
131133   seek_continue();
132134}
133135
134void wd1772_t::seek_continue()
136void wd177x_t::seek_continue()
135137{
136138   for(;;) {
137139      switch(sub_state) {
r13298r13299
174176         }
175177         counter++;
176178         sub_state = SEEK_WAIT_STEP_TIME;
177         delay_cycles(t_gen, step_times[command & 3]);
179         delay_cycles(t_gen, step_time(command & 3));
178180         return;
179181
180182      case SEEK_WAIT_STEP_TIME:
r13298r13299
254256   }
255257}
256258
257void wd1772_t::read_sector_start()
259bool wd177x_t::sector_matches() const
258260{
261   if(cur_live.idbuf[0] != track || cur_live.idbuf[2] != sector)
262      return false;
263   if(!has_side_check())
264      return true;
265   if(command & 8)
266      return cur_live.idbuf[1] & 1;
267   else
268      return !(cur_live.idbuf[1] & 1);
269}
270
271void wd177x_t::read_sector_start()
272{
259273   main_state = READ_SECTOR;
260274   status = (status & ~(S_CRC|S_LOST|S_RNF|S_WP|S_DDM)) | S_BUSY;
261275   drop_drq();
262   sub_state = SPINUP;
276   sub_state = has_motor() ? SPINUP : SPINUP_DONE;
263277   status_type_1 = false;
264278   read_sector_continue();
265279}
266280
267void wd1772_t::read_sector_continue()
281void wd177x_t::read_sector_continue()
268282{
269283   static int size_codes[4] = { 128, 256, 512, 1024 };
270284
r13298r13299
284298      case SPINUP_DONE:
285299         if(command & 4) {
286300            sub_state = SETTLE_WAIT;
287            delay_cycles(t_gen, 120000);
301            delay_cycles(t_gen, settle_time());
288302            return;
289303         } else {
290304            sub_state = SETTLE_DONE;
r13298r13299
301315         return;
302316
303317      case SCAN_ID:
304         if(cur_live.idbuf[0] != track || cur_live.idbuf[2] != sector) {
318         if(!sector_matches()) {
305319            live_start(SEARCH_ADDRESS_MARK);
306320            return;
307321         }
r13298r13299
340354   }
341355}
342356
343void wd1772_t::read_track_start()
357void wd177x_t::read_track_start()
344358{
345359   main_state = READ_TRACK;
346360   status = (status & ~(S_LOST|S_RNF)) | S_BUSY;
347361   drop_drq();
348   sub_state = SPINUP;
362   sub_state = has_motor() ? SPINUP : SPINUP_DONE;
349363   status_type_1 = false;
350364   read_track_continue();
351365}
352366
353void wd1772_t::read_track_continue()
367void wd177x_t::read_track_continue()
354368{
355369   for(;;) {
356370      switch(sub_state) {
r13298r13299
368382      case SPINUP_DONE:
369383         if(command & 4) {
370384            sub_state = SETTLE_WAIT;
371            delay_cycles(t_gen, 120000);
385            delay_cycles(t_gen, settle_time());
372386            return;
373387
374388         } else {
r13298r13299
403417   }
404418}
405419
406void wd1772_t::read_id_start()
420void wd177x_t::read_id_start()
407421{
408422   main_state = READ_ID;
409423   status = (status & ~(S_WP|S_DDM|S_LOST|S_RNF)) | S_BUSY;
410424   drop_drq();
411   sub_state = SPINUP;
425   sub_state = has_motor() ? SPINUP : SPINUP_DONE;
412426   status_type_1 = false;
413427   read_id_continue();
414428}
415429
416void wd1772_t::read_id_continue()
430void wd177x_t::read_id_continue()
417431{
418432   for(;;) {
419433      switch(sub_state) {
r13298r13299
431445      case SPINUP_DONE:
432446         if(command & 4) {
433447            sub_state = SETTLE_WAIT;
434            delay_cycles(t_gen, 120000);
448            delay_cycles(t_gen, settle_time());
435449            return;
436450         } else {
437451            sub_state = SETTLE_DONE;
r13298r13299
463477   }
464478}
465479
466void wd1772_t::write_track_start()
480void wd177x_t::write_track_start()
467481{
468482   main_state = WRITE_TRACK;
469483   status = (status & ~(S_WP|S_DDM|S_LOST|S_RNF)) | S_BUSY;
470484   drop_drq();
471   sub_state = SPINUP;
485   sub_state = has_motor() ? SPINUP : SPINUP_DONE;
472486   status_type_1 = false;
473487   write_track_continue();
474488}
475489
476void wd1772_t::write_track_continue()
490void wd177x_t::write_track_continue()
477491{
478492   for(;;) {
479493      switch(sub_state) {
r13298r13299
491505      case SPINUP_DONE:
492506         if(command & 4) {
493507            sub_state = SETTLE_WAIT;
494            delay_cycles(t_gen, 120000);
508            delay_cycles(t_gen, settle_time());
495509            return;
496510         } else {
497511            sub_state = SETTLE_DONE;
r13298r13299
539553}
540554
541555
542void wd1772_t::write_sector_start()
556void wd177x_t::write_sector_start()
543557{
544558   main_state = WRITE_SECTOR;
545559   status = (status & ~(S_CRC|S_LOST|S_RNF|S_WP|S_DDM)) | S_BUSY;
546560   drop_drq();
547   sub_state = SPINUP;
561   sub_state = has_motor() ? SPINUP : SPINUP_DONE;
548562   status_type_1 = false;
549563   write_sector_continue();
550564}
551565
552void wd1772_t::write_sector_continue()
566void wd177x_t::write_sector_continue()
553567{
554568   static int size_codes[4] = { 128, 256, 512, 1024 };
555569
r13298r13299
569583      case SPINUP_DONE:
570584         if(command & 4) {
571585            sub_state = SETTLE_WAIT;
572            delay_cycles(t_gen, 120000);
586            delay_cycles(t_gen, settle_time());
573587            return;
574588         } else {
575589            sub_state = SETTLE_DONE;
r13298r13299
586600         return;
587601
588602      case SCAN_ID:
589         if(cur_live.idbuf[0] != track || cur_live.idbuf[2] != sector) {
603         if(!sector_matches()) {
590604            live_start(SEARCH_ADDRESS_MARK);
591605            return;
592606         }
r13298r13299
622636   }
623637}
624638
625void wd1772_t::interrupt_start()
639void wd177x_t::interrupt_start()
626640{
627641   if(status & S_BUSY) {
628642      main_state = sub_state = cur_live.state = IDLE;
r13298r13299
636650   }
637651}
638652
639void wd1772_t::general_continue()
653void wd177x_t::general_continue()
640654{
641655   if(cur_live.state != IDLE) {
642656      live_run();
r13298r13299
671685   }
672686}
673687
674void wd1772_t::do_generic()
688void wd177x_t::do_generic()
675689{
676690   switch(sub_state) {
677691   case IDLE:
r13298r13299
702716   }
703717}
704718
705void wd1772_t::do_cmd_w()
719void wd177x_t::do_cmd_w()
706720{
707721   //  fprintf(stderr, "%s: command %02x\n", ttsn().cstr(), cmd_buffer);
708722
r13298r13299
729743   }
730744}
731745
732void wd1772_t::cmd_w(UINT8 val)
746void wd177x_t::cmd_w(UINT8 val)
733747{
734748   if(intrq && ((command & 0xf8) != 0xd8)) {
735749      intrq = false;
r13298r13299
746760   delay_cycles(t_cmd, dden ? 384 : 184);
747761}
748762
749UINT8 wd1772_t::status_r()
763UINT8 wd177x_t::status_r()
750764{
751765   if(intrq && ((command & 0xf8) != 0xd8)) {
752766      intrq = false;
r13298r13299
779793   return status;
780794}
781795
782void wd1772_t::do_track_w()
796void wd177x_t::do_track_w()
783797{
784798   track = track_buffer;
785799   track_buffer = -1;
786800}
787801
788void wd1772_t::track_w(UINT8 val)
802void wd177x_t::track_w(UINT8 val)
789803{
790804   // No more than one write in flight
791805   if(track_buffer != -1)
r13298r13299
795809   delay_cycles(t_track, dden ? 256 : 128);
796810}
797811
798UINT8 wd1772_t::track_r()
812UINT8 wd177x_t::track_r()
799813{
800814   return track;
801815}
802816
803void wd1772_t::do_sector_w()
817void wd177x_t::do_sector_w()
804818{
805819   sector = sector_buffer;
806820   sector_buffer = -1;
807821}
808822
809void wd1772_t::sector_w(UINT8 val)
823void wd177x_t::sector_w(UINT8 val)
810824{
811825   // No more than one write in flight
812826   if(sector_buffer != -1)
r13298r13299
816830   delay_cycles(t_sector, dden ? 256 : 128);
817831}
818832
819UINT8 wd1772_t::sector_r()
833UINT8 wd177x_t::sector_r()
820834{
821835   return sector;
822836}
823837
824void wd1772_t::data_w(UINT8 val)
838void wd177x_t::data_w(UINT8 val)
825839{
826840   data = val;
827841   drop_drq();
828842}
829843
830UINT8 wd1772_t::data_r()
844UINT8 wd177x_t::data_r()
831845{
832846   drop_drq();
833847   return data;
834848}
835849
836void wd1772_t::gen_w(int reg, UINT8 val)
850void wd177x_t::gen_w(int reg, UINT8 val)
837851{
838852   switch(reg) {
839853   case 0: cmd_w(val); break;
r13298r13299
843857   }
844858}
845859
846UINT8 wd1772_t::gen_r(int reg)
860UINT8 wd177x_t::gen_r(int reg)
847861{
848862   switch(reg) {
849863   case 0: return status_r(); break;
r13298r13299
854868   return 0xff;
855869}
856870
857void wd1772_t::delay_cycles(emu_timer *tm, int cycles)
871void wd177x_t::delay_cycles(emu_timer *tm, int cycles)
858872{
859873   tm->adjust(clocks_to_attotime(cycles));
860874}
861875
862void wd1772_t::spinup()
876void wd177x_t::spinup()
863877{
864878   if(command & 0x08)
865879      sub_state = SPINUP_DONE;
r13298r13299
874888
875889}
876890
877void wd1772_t::index_callback(floppy_image_device *floppy, int state)
891void wd177x_t::index_callback(floppy_image_device *floppy, int state)
878892{
879893   live_sync();
880894
r13298r13299
885899
886900   switch(sub_state) {
887901   case IDLE:
888      motor_timeout ++;
889      if(motor_timeout >= 5) {
890         status &= ~S_MON;
891         if(floppy)
892            floppy->mon_w(1);
902      if(has_motor()) {
903         motor_timeout ++;
904         if(motor_timeout >= 5) {
905            status &= ~S_MON;
906            if(floppy)
907               floppy->mon_w(1);
908         }
893909      }
894910      break;
895911
r13298r13299
944960   general_continue();
945961}
946962
947bool wd1772_t::intrq_r()
963bool wd177x_t::intrq_r()
948964{
949965   return intrq;
950966}
951967
952bool wd1772_t::drq_r()
968bool wd177x_t::drq_r()
953969{
954970   return drq;
955971}
956972
957void wd1772_t::live_start(int state)
973void wd177x_t::live_start(int state)
958974{
959975   cur_live.tm = machine().time();
960976   cur_live.state = state;
r13298r13299
974990   live_run();
975991}
976992
977void wd1772_t::checkpoint()
993void wd177x_t::checkpoint()
978994{
979995   cur_live.pll.commit(floppy, cur_live.tm);
980996   checkpoint_live = cur_live;
981997}
982998
983void wd1772_t::rollback()
999void wd177x_t::rollback()
9841000{
9851001   cur_live = checkpoint_live;
9861002}
9871003
988void wd1772_t::live_delay(int state)
1004void wd177x_t::live_delay(int state)
9891005{
9901006   cur_live.next_state = state;
9911007   t_gen->adjust(cur_live.tm - machine().time());
9921008}
9931009
994void wd1772_t::live_sync()
1010void wd177x_t::live_sync()
9951011{
9961012   if(!cur_live.tm.is_never()) {
9971013      if(cur_live.tm > machine().time()) {
r13298r13299
10141030   }
10151031}
10161032
1017void wd1772_t::live_abort()
1033void wd177x_t::live_abort()
10181034{
10191035   if(cur_live.tm > machine().time()) {
10201036      rollback();
r13298r13299
10271043   cur_live.next_state = -1;
10281044}
10291045
1030bool wd1772_t::read_one_bit(attotime limit)
1046bool wd177x_t::read_one_bit(attotime limit)
10311047{
10321048   int bit = cur_live.pll.get_next_bit(cur_live.tm, floppy, limit);
10331049   if(bit < 0)
r13298r13299
10451061   return false;
10461062}
10471063
1048bool wd1772_t::write_one_bit(attotime limit)
1064bool wd177x_t::write_one_bit(attotime limit)
10491065{
10501066   bool bit = cur_live.shift_reg & 0x8000;
10511067   if(cur_live.pll.write_next_bit(bit, cur_live.tm, floppy, limit))
r13298r13299
10611077   return false;
10621078}
10631079
1064void wd1772_t::live_write_raw(UINT16 raw)
1080void wd177x_t::live_write_raw(UINT16 raw)
10651081{
10661082   //  logerror("write %04x %04x\n", raw, cur_live.crc);
10671083   cur_live.shift_reg = raw;
10681084   cur_live.data_bit_context = raw & 1;
10691085}
10701086
1071void wd1772_t::live_write_mfm(UINT8 mfm)
1087void wd177x_t::live_write_mfm(UINT8 mfm)
10721088{
10731089   bool context = cur_live.data_bit_context;
10741090   UINT16 raw = 0;
r13298r13299
10851101   //  logerror("write %02x   %04x %04x\n", mfm, cur_live.crc, raw);
10861102}
10871103
1088void wd1772_t::live_run(attotime limit)
1104void wd177x_t::live_run(attotime limit)
10891105{
10901106   if(cur_live.state == IDLE || cur_live.next_state != -1)
10911107      return;
r13298r13299
14361452   }
14371453}
14381454
1439void wd1772_t::set_drq()
1455void wd177x_t::set_drq()
14401456{
14411457   if(drq)
14421458      status |= S_LOST;
r13298r13299
14471463   }
14481464}
14491465
1450void wd1772_t::drop_drq()
1466void wd177x_t::drop_drq()
14511467{
14521468   if(drq) {
14531469      drq = false;
r13298r13299
14561472   }
14571473}
14581474
1459void wd1772_t::pll_t::set_clock(attotime period)
1475void wd177x_t::pll_t::set_clock(attotime period)
14601476{
14611477   for(int i=0; i<42; i++)
14621478      delays[i] = period*(i+1);
14631479}
14641480
1465void wd1772_t::pll_t::reset(attotime when)
1481void wd177x_t::pll_t::reset(attotime when)
14661482{
14671483   counter = 0;
14681484   increment = 128;
r13298r13299
14781494   write_start_time = attotime::never;
14791495}
14801496
1481int wd1772_t::pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit)
1497int wd177x_t::pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit)
14821498{
14831499   attotime when = floppy ? floppy->get_next_transition(ctime) : attotime::never;
14841500#if 0
r13298r13299
15581574   return bit;
15591575}
15601576
1561void wd1772_t::pll_t::start_writing(attotime tm)
1577void wd177x_t::pll_t::start_writing(attotime tm)
15621578{
15631579   write_start_time = tm;
15641580   write_position = 0;
15651581}
15661582
1567void wd1772_t::pll_t::stop_writing(floppy_image_device *floppy, attotime tm)
1583void wd177x_t::pll_t::stop_writing(floppy_image_device *floppy, attotime tm)
15681584{
15691585   commit(floppy, tm);
15701586   write_start_time = attotime::never;
15711587}
15721588
1573bool wd1772_t::pll_t::write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit)
1589bool wd177x_t::pll_t::write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit)
15741590{
15751591   if(write_start_time == attotime::never) {
15761592      write_start_time = ctime;
r13298r13299
16001616   return false;
16011617}
16021618
1603void wd1772_t::pll_t::commit(floppy_image_device *floppy, attotime tm)
1619void wd177x_t::pll_t::commit(floppy_image_device *floppy, attotime tm)
16041620{
16051621   if(write_start_time == attotime::never || tm == write_start_time)
16061622      return;
r13298r13299
16101626   write_start_time = tm;
16111627   write_position = 0;
16121628}
1629
1630int wd177x_t::step_time(int mode) const
1631{
1632   const static int step_times[4] = { 48000, 96000, 160000, 240000 };
1633   return step_times[mode];
1634}
1635
1636int wd177x_t::settle_time() const
1637{
1638   return 240000;
1639}
1640
1641bool wd177x_t::has_side_check() const
1642{
1643   return false;
1644}
1645
1646wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1770x, "WD1770", tag, owner, clock)
1647{
1648}
1649
1650bool wd1770_t::has_motor() const
1651{
1652   return true;
1653}
1654
1655wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1772x, "WD1772", tag, owner, clock)
1656{
1657}
1658
1659bool wd1772_t::has_motor() const
1660{
1661   return true;
1662}
1663
1664int wd1772_t::step_time(int mode) const
1665{
1666   const static int step_times[4] = { 48000, 96000, 16000, 24000 };
1667   return step_times[mode];
1668}
1669
1670int wd1772_t::settle_time() const
1671{
1672   return 120000;
1673}
1674
1675wd1773_t::wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1773x, "WD1773", tag, owner, clock)
1676{
1677}
1678
1679bool wd1773_t::has_motor() const
1680{
1681   return false;
1682}
1683
1684bool wd1773_t::has_side_check() const
1685{
1686   return false;
1687}
src/mess/machine/wd1772.h
r13298r13299
44#include "emu.h"
55#include "imagedev/floppy.h"
66
7#define MCFG_WD1770x_ADD(_tag, _clock)   \
8   MCFG_DEVICE_ADD(_tag, WD1770x, _clock)
9
710#define MCFG_WD1772x_ADD(_tag, _clock)   \
811   MCFG_DEVICE_ADD(_tag, WD1772x, _clock)
912
10class wd1772_t : public device_t {
13#define MCFG_WD1773x_ADD(_tag, _clock)   \
14   MCFG_DEVICE_ADD(_tag, WD1773x, _clock)
15
16class wd177x_t : public device_t {
1117public:
1218   typedef delegate<void (bool state)> line_cb;
1319
14   wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
20   wd177x_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
1521
1622   void dden_w(bool dden);
1723   void set_floppy(floppy_image_device *floppy);
r13298r13299
4450   virtual void device_reset();
4551   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
4652
53   virtual bool has_motor() const = 0;
54   virtual bool has_side_check() const;
55   virtual int step_time(int mode) const;
56   virtual int settle_time() const;
57
4758private:
4859   enum { TM_GEN, TM_CMD, TM_TRACK, TM_SECTOR };
4960
r13298r13299
200211      S_MON  = 0x80
201212   };
202213
203   const static int step_times[4];
204
205214   floppy_image_device *floppy;
206215
207216   emu_timer *t_gen, *t_cmd, *t_track, *t_sector;
r13298r13299
257266
258267   void spinup();
259268   void index_callback(floppy_image_device *floppy, int state);
269   bool sector_matches() const;
260270
261271   void live_start(int live_state);
262272   void live_abort();
r13298r13299
275285   void set_drq();
276286};
277287
288class wd1770_t : public wd177x_t {
289public:
290   wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
291
292protected:
293   virtual bool has_motor() const;
294};
295
296class wd1772_t : public wd177x_t {
297public:
298   wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
299
300protected:
301   virtual bool has_motor() const;
302   virtual int step_time(int mode) const;
303   virtual int settle_time() const;
304};
305
306class wd1773_t : public wd177x_t {
307public:
308   wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
309
310protected:
311   virtual bool has_motor() const;
312   virtual bool has_side_check() const;
313};
314
315extern const device_type WD1770x;
278316extern const device_type WD1772x;
317extern const device_type WD1773x;
279318
280319#endif
src/mess/drivers/einstein.c
r13298r13299
536536   AM_RANGE(0x10, 0x10) AM_MIRROR(0xff06) AM_DEVREADWRITE_MODERN(IC_I060, i8251_device, data_r, data_w)
537537   AM_RANGE(0x11, 0x11) AM_MIRROR(0xff06) AM_DEVREADWRITE_MODERN(IC_I060, i8251_device, status_r, control_w)
538538   /* block 3, wd1770 floppy controller */
539   AM_RANGE(0x18, 0x1b) AM_MIRROR(0xff04) AM_DEVREADWRITE_MODERN(IC_I042, wd1772_t, read, write)
539   AM_RANGE(0x18, 0x1b) AM_MIRROR(0xff04) AM_DEVREADWRITE_MODERN(IC_I042, wd177x_t, read, write)
540540   /* block 4, internal controls */
541541   AM_RANGE(0x20, 0x20) AM_MIRROR(0xff00) AM_READWRITE(einstein_kybintmsk_r, einstein_kybintmsk_w)
542542   AM_RANGE(0x21, 0x21) AM_MIRROR(0xff00) AM_WRITE(einstein_adcintmsk_w)
r13298r13299
826826   /* uart */
827827   MCFG_I8251_ADD(IC_I060, default_i8251_interface)
828828
829   MCFG_WD1772x_ADD(IC_I042, XTAL_X002)
829   MCFG_WD1770x_ADD(IC_I042, XTAL_X002)
830830
831831   MCFG_FLOPPY_DRIVE_ADD("fd0", einstein_floppies, "525dd", 0, einstein_state::floppy_formats)
832832   MCFG_FLOPPY_DRIVE_ADD("fd1", einstein_floppies, "525dd", 0, einstein_state::floppy_formats)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team