Previous 199869 Revisions Next

r19174 Tuesday 27th November, 2012 at 21:07:25 UTC by O. Galibert
wd_fdc: More renaming [O. Galibert]
[src/emu/machine]wd_fdc.c wd_fdc.h
[src/mess/drivers]einstein.c ht68k.c xerox820.c
[src/mess/includes]xerox820.h

trunk/src/emu/machine/wd_fdc.c
r19173r19174
4444const device_type WD1772x = &device_creator<wd1772_t>;
4545const device_type WD1773x = &device_creator<wd1773_t>;
4646
47wd177x_t::wd177x_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
47wd_fdc_t::wd_fdc_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
4848   device_t(mconfig, type, name, tag, owner, clock)
4949{
5050}
5151
52void wd177x_t::device_start()
52void wd_fdc_t::device_start()
5353{
5454   t_gen = timer_alloc(TM_GEN);
5555   t_cmd = timer_alloc(TM_CMD);
r19173r19174
7373   save_item(NAME(last_dir));
7474}
7575
76void wd177x_t::device_reset()
76void wd_fdc_t::device_reset()
7777{
7878   command = 0x00;
7979   main_state = IDLE;
r19173r19174
9393   live_abort();
9494}
9595
96void wd177x_t::set_floppy(floppy_image_device *_floppy)
96void wd_fdc_t::set_floppy(floppy_image_device *_floppy)
9797{
9898   if(floppy == _floppy)
9999      return;
r19173r19174
108108   if(floppy) {
109109      if(has_motor())
110110         floppy->mon_w(status & S_MON ? 0 : 1);
111      floppy->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(FUNC(wd177x_t::index_callback), this));
111      floppy->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(FUNC(wd_fdc_t::index_callback), this));
112112   }
113113}
114114
115void wd177x_t::setup_intrq_cb(line_cb cb)
115void wd_fdc_t::setup_intrq_cb(line_cb cb)
116116{
117117   intrq_cb = cb;
118118}
119119
120void wd177x_t::setup_drq_cb(line_cb cb)
120void wd_fdc_t::setup_drq_cb(line_cb cb)
121121{
122122   drq_cb = cb;
123123}
124124
125void wd177x_t::setup_hld_cb(line_cb cb)
125void wd_fdc_t::setup_hld_cb(line_cb cb)
126126{
127127   hld_cb = cb;
128128}
129129
130void wd177x_t::setup_enp_cb(line_cb cb)
130void wd_fdc_t::setup_enp_cb(line_cb cb)
131131{
132132   enp_cb = cb;
133133}
134134
135void wd177x_t::dden_w(bool _dden)
135void wd_fdc_t::dden_w(bool _dden)
136136{
137137   dden = _dden;
138138}
139139
140astring wd177x_t::tts(attotime t)
140astring wd_fdc_t::tts(attotime t)
141141{
142142   char buf[256];
143143   int nsec = t.attoseconds / ATTOSECONDS_PER_NANOSECOND;
r19173r19174
145145   return buf;
146146}
147147
148astring wd177x_t::ttsn()
148astring wd_fdc_t::ttsn()
149149{
150150   return tts(machine().time());
151151}
152152
153void wd177x_t::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
153void wd_fdc_t::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
154154{
155155   live_sync();
156156
r19173r19174
164164   general_continue();
165165}
166166
167void wd177x_t::command_end()
167void wd_fdc_t::command_end()
168168{
169169   main_state = sub_state = IDLE;
170170   status &= ~S_BUSY;
r19173r19174
174174      intrq_cb(intrq);
175175}
176176
177void wd177x_t::seek_start(int state)
177void wd_fdc_t::seek_start(int state)
178178{
179179   main_state = state;
180180   status = (status & ~(S_CRC|S_RNF|S_SPIN)) | S_BUSY;
r19173r19174
190190   seek_continue();
191191}
192192
193void wd177x_t::seek_continue()
193void wd_fdc_t::seek_continue()
194194{
195195   for(;;) {
196196      switch(sub_state) {
r19173r19174
317317   }
318318}
319319
320bool wd177x_t::sector_matches() const
320bool wd_fdc_t::sector_matches() const
321321{
322322   if(cur_live.idbuf[0] != track || cur_live.idbuf[2] != sector)
323323      return false;
r19173r19174
329329      return !(cur_live.idbuf[1] & 1);
330330}
331331
332bool wd177x_t::is_ready()
332bool wd_fdc_t::is_ready()
333333{
334334   return (floppy && !floppy->ready_r());
335335}
336336
337void wd177x_t::read_sector_start()
337void wd_fdc_t::read_sector_start()
338338{
339339   if(has_ready() && !is_ready())
340340      command_end();
r19173r19174
349349   read_sector_continue();
350350}
351351
352void wd177x_t::read_sector_continue()
352void wd_fdc_t::read_sector_continue()
353353{
354354   for(;;) {
355355      switch(sub_state) {
r19173r19174
424424   }
425425}
426426
427void wd177x_t::read_track_start()
427void wd_fdc_t::read_track_start()
428428{
429429   if(has_ready() && !is_ready())
430430      command_end();
r19173r19174
439439   read_track_continue();
440440}
441441
442void wd177x_t::read_track_continue()
442void wd_fdc_t::read_track_continue()
443443{
444444   for(;;) {
445445      switch(sub_state) {
r19173r19174
491491   }
492492}
493493
494void wd177x_t::read_id_start()
494void wd_fdc_t::read_id_start()
495495{
496496   if(has_ready() && !is_ready())
497497      command_end();
r19173r19174
506506   read_id_continue();
507507}
508508
509void wd177x_t::read_id_continue()
509void wd_fdc_t::read_id_continue()
510510{
511511   for(;;) {
512512      switch(sub_state) {
r19173r19174
556556   }
557557}
558558
559void wd177x_t::write_track_start()
559void wd_fdc_t::write_track_start()
560560{
561561   if(has_ready() && !is_ready())
562562      command_end();
r19173r19174
571571   write_track_continue();
572572}
573573
574void wd177x_t::write_track_continue()
574void wd_fdc_t::write_track_continue()
575575{
576576   for(;;) {
577577      switch(sub_state) {
r19173r19174
638638}
639639
640640
641void wd177x_t::write_sector_start()
641void wd_fdc_t::write_sector_start()
642642{
643643   if(has_ready() && !is_ready())
644644      command_end();
r19173r19174
653653   write_sector_continue();
654654}
655655
656void wd177x_t::write_sector_continue()
656void wd_fdc_t::write_sector_continue()
657657{
658658   for(;;) {
659659      switch(sub_state) {
r19173r19174
725725   }
726726}
727727
728void wd177x_t::interrupt_start()
728void wd_fdc_t::interrupt_start()
729729{
730730   if(status & S_BUSY) {
731731      main_state = sub_state = cur_live.state = IDLE;
r19173r19174
752752   }
753753}
754754
755void wd177x_t::general_continue()
755void wd_fdc_t::general_continue()
756756{
757757   if(cur_live.state != IDLE) {
758758      live_run();
r19173r19174
787787   }
788788}
789789
790void wd177x_t::do_generic()
790void wd_fdc_t::do_generic()
791791{
792792   switch(sub_state) {
793793   case IDLE:
r19173r19174
818818   }
819819}
820820
821void wd177x_t::do_cmd_w()
821void wd_fdc_t::do_cmd_w()
822822{
823823   //  fprintf(stderr, "%s: command %02x\n", ttsn().cstr(), cmd_buffer);
824824
r19173r19174
845845   }
846846}
847847
848void wd177x_t::cmd_w(UINT8 val)
848void wd_fdc_t::cmd_w(UINT8 val)
849849{
850850   logerror("wd1772 cmd: %02x\n", val);
851851   
r19173r19174
864864   delay_cycles(t_cmd, dden ? 384 : 184);
865865}
866866
867UINT8 wd177x_t::status_r()
867UINT8 wd_fdc_t::status_r()
868868{
869869   if(intrq && !(intrq_cond & I_IMM)) {
870870      intrq = false;
r19173r19174
904904   return status;
905905}
906906
907void wd177x_t::do_track_w()
907void wd_fdc_t::do_track_w()
908908{
909909   track = track_buffer;
910910   track_buffer = -1;
911911}
912912
913void wd177x_t::track_w(UINT8 val)
913void wd_fdc_t::track_w(UINT8 val)
914914{
915915   // No more than one write in flight
916916   if(track_buffer != -1)
r19173r19174
920920   delay_cycles(t_track, dden ? 256 : 128);
921921}
922922
923UINT8 wd177x_t::track_r()
923UINT8 wd_fdc_t::track_r()
924924{
925925   return track;
926926}
927927
928void wd177x_t::do_sector_w()
928void wd_fdc_t::do_sector_w()
929929{
930930   sector = sector_buffer;
931931   sector_buffer = -1;
932932}
933933
934void wd177x_t::sector_w(UINT8 val)
934void wd_fdc_t::sector_w(UINT8 val)
935935{
936936   // No more than one write in flight
937937   if(sector_buffer != -1)
r19173r19174
941941   delay_cycles(t_sector, dden ? 256 : 128);
942942}
943943
944UINT8 wd177x_t::sector_r()
944UINT8 wd_fdc_t::sector_r()
945945{
946946   return sector;
947947}
948948
949void wd177x_t::data_w(UINT8 val)
949void wd_fdc_t::data_w(UINT8 val)
950950{
951951   data = val;
952952   drop_drq();
953953}
954954
955UINT8 wd177x_t::data_r()
955UINT8 wd_fdc_t::data_r()
956956{
957957   drop_drq();
958958   return data;
959959}
960960
961void wd177x_t::gen_w(int reg, UINT8 val)
961void wd_fdc_t::gen_w(int reg, UINT8 val)
962962{
963963   switch(reg) {
964964   case 0: cmd_w(val); break;
r19173r19174
968968   }
969969}
970970
971UINT8 wd177x_t::gen_r(int reg)
971UINT8 wd_fdc_t::gen_r(int reg)
972972{
973973   switch(reg) {
974974   case 0: return status_r(); break;
r19173r19174
979979   return 0xff;
980980}
981981
982void wd177x_t::delay_cycles(emu_timer *tm, int cycles)
982void wd_fdc_t::delay_cycles(emu_timer *tm, int cycles)
983983{
984984   tm->adjust(clocks_to_attotime(cycles));
985985}
986986
987void wd177x_t::spinup()
987void wd_fdc_t::spinup()
988988{
989989   if(command & 0x08)
990990      sub_state = SPINUP_DONE;
r19173r19174
999999
10001000}
10011001
1002void wd177x_t::index_callback(floppy_image_device *floppy, int state)
1002void wd_fdc_t::index_callback(floppy_image_device *floppy, int state)
10031003{
10041004   live_sync();
10051005
r19173r19174
10791079   general_continue();
10801080}
10811081
1082bool wd177x_t::intrq_r()
1082bool wd_fdc_t::intrq_r()
10831083{
10841084   return intrq;
10851085}
10861086
1087bool wd177x_t::drq_r()
1087bool wd_fdc_t::drq_r()
10881088{
10891089   return drq;
10901090}
10911091
1092bool wd177x_t::hld_r()
1092bool wd_fdc_t::hld_r()
10931093{
10941094   return hld;
10951095}
10961096
1097void wd177x_t::hlt_w(bool state)
1097void wd_fdc_t::hlt_w(bool state)
10981098{
10991099   hlt = state;
11001100}
11011101
1102bool wd177x_t::enp_r()
1102bool wd_fdc_t::enp_r()
11031103{
11041104   return enp;
11051105}
11061106
1107void wd177x_t::live_start(int state)
1107void wd_fdc_t::live_start(int state)
11081108{
11091109   cur_live.tm = machine().time();
11101110   cur_live.state = state;
r19173r19174
11241124   live_run();
11251125}
11261126
1127void wd177x_t::checkpoint()
1127void wd_fdc_t::checkpoint()
11281128{
11291129   cur_live.pll.commit(floppy, cur_live.tm);
11301130   checkpoint_live = cur_live;
11311131}
11321132
1133void wd177x_t::rollback()
1133void wd_fdc_t::rollback()
11341134{
11351135   cur_live = checkpoint_live;
11361136}
11371137
1138void wd177x_t::live_delay(int state)
1138void wd_fdc_t::live_delay(int state)
11391139{
11401140   cur_live.next_state = state;
11411141   t_gen->adjust(cur_live.tm - machine().time());
11421142}
11431143
1144void wd177x_t::live_sync()
1144void wd_fdc_t::live_sync()
11451145{
11461146   if(!cur_live.tm.is_never()) {
11471147      if(cur_live.tm > machine().time()) {
r19173r19174
11661166   }
11671167}
11681168
1169void wd177x_t::live_abort()
1169void wd_fdc_t::live_abort()
11701170{
11711171   if(!cur_live.tm.is_never() && cur_live.tm > machine().time()) {
11721172      rollback();
r19173r19174
11791179   cur_live.next_state = -1;
11801180}
11811181
1182bool wd177x_t::read_one_bit(attotime limit)
1182bool wd_fdc_t::read_one_bit(attotime limit)
11831183{
11841184   int bit = cur_live.pll.get_next_bit(cur_live.tm, floppy, limit);
11851185   if(bit < 0)
r19173r19174
11971197   return false;
11981198}
11991199
1200bool wd177x_t::write_one_bit(attotime limit)
1200bool wd_fdc_t::write_one_bit(attotime limit)
12011201{
12021202   bool bit = cur_live.shift_reg & 0x8000;
12031203   if(cur_live.pll.write_next_bit(bit, cur_live.tm, floppy, limit))
r19173r19174
12131213   return false;
12141214}
12151215
1216void wd177x_t::live_write_raw(UINT16 raw)
1216void wd_fdc_t::live_write_raw(UINT16 raw)
12171217{
12181218   //  logerror("write %04x %04x\n", raw, cur_live.crc);
12191219   cur_live.shift_reg = raw;
12201220   cur_live.data_bit_context = raw & 1;
12211221}
12221222
1223void wd177x_t::live_write_mfm(UINT8 mfm)
1223void wd_fdc_t::live_write_mfm(UINT8 mfm)
12241224{
12251225   bool context = cur_live.data_bit_context;
12261226   UINT16 raw = 0;
r19173r19174
12371237   //  logerror("write %02x   %04x %04x\n", mfm, cur_live.crc, raw);
12381238}
12391239
1240void wd177x_t::live_run(attotime limit)
1240void wd_fdc_t::live_run(attotime limit)
12411241{
12421242   if(cur_live.state == IDLE || cur_live.next_state != -1)
12431243      return;
r19173r19174
16471647   }
16481648}
16491649
1650void wd177x_t::set_drq()
1650void wd_fdc_t::set_drq()
16511651{
16521652   if(drq)
16531653      status |= S_LOST;
r19173r19174
16581658   }
16591659}
16601660
1661void wd177x_t::drop_drq()
1661void wd_fdc_t::drop_drq()
16621662{
16631663   if(drq) {
16641664      drq = false;
r19173r19174
16671667   }
16681668}
16691669
1670void wd177x_t::pll_t::set_clock(attotime period)
1670void wd_fdc_t::pll_t::set_clock(attotime period)
16711671{
16721672   for(int i=0; i<42; i++)
16731673      delays[i] = period*(i+1);
16741674}
16751675
1676void wd177x_t::pll_t::reset(attotime when)
1676void wd_fdc_t::pll_t::reset(attotime when)
16771677{
16781678   counter = 0;
16791679   increment = 128;
r19173r19174
16891689   write_start_time = attotime::never;
16901690}
16911691
1692int wd177x_t::pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit)
1692int wd_fdc_t::pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit)
16931693{
16941694   attotime when = floppy ? floppy->get_next_transition(ctime) : attotime::never;
16951695#if 0
r19173r19174
17691769   return bit;
17701770}
17711771
1772void wd177x_t::pll_t::start_writing(attotime tm)
1772void wd_fdc_t::pll_t::start_writing(attotime tm)
17731773{
17741774   write_start_time = tm;
17751775   write_position = 0;
17761776}
17771777
1778void wd177x_t::pll_t::stop_writing(floppy_image_device *floppy, attotime tm)
1778void wd_fdc_t::pll_t::stop_writing(floppy_image_device *floppy, attotime tm)
17791779{
17801780   commit(floppy, tm);
17811781   write_start_time = attotime::never;
17821782}
17831783
1784bool wd177x_t::pll_t::write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit)
1784bool wd_fdc_t::pll_t::write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit)
17851785{
17861786   if(write_start_time.is_never()) {
17871787      write_start_time = ctime;
r19173r19174
18111811   return false;
18121812}
18131813
1814void wd177x_t::pll_t::commit(floppy_image_device *floppy, attotime tm)
1814void wd_fdc_t::pll_t::commit(floppy_image_device *floppy, attotime tm)
18151815{
18161816   if(write_start_time.is_never() || tm == write_start_time)
18171817      return;
r19173r19174
18221822   write_position = 0;
18231823}
18241824
1825int wd177x_t::step_time(int mode) const
1825int wd_fdc_t::step_time(int mode) const
18261826{
18271827   const static int step_times[4] = { 48000, 96000, 160000, 240000 };
18281828   return step_times[mode];
18291829}
18301830
1831int wd177x_t::settle_time() const
1831int wd_fdc_t::settle_time() const
18321832{
18331833   return 240000;
18341834}
18351835
1836bool wd177x_t::has_ready() const
1836bool wd_fdc_t::has_ready() const
18371837{
18381838   return false;
18391839}
18401840
1841bool wd177x_t::has_head_load() const
1841bool wd_fdc_t::has_head_load() const
18421842{
18431843   return false;
18441844}
18451845
1846bool wd177x_t::has_side_check() const
1846bool wd_fdc_t::has_side_check() const
18471847{
18481848   return false;
18491849}
18501850
1851bool wd177x_t::has_side_select() const
1851bool wd_fdc_t::has_side_select() const
18521852{
18531853   return false;
18541854}
18551855
1856bool wd177x_t::has_sector_length_select() const
1856bool wd_fdc_t::has_sector_length_select() const
18571857{
18581858   return false;
18591859}
18601860
1861bool wd177x_t::has_precompensation() const
1861bool wd_fdc_t::has_precompensation() const
18621862{
18631863   return false;
18641864}
18651865
1866fd1771_t::fd1771_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, FD1771x, "FD1771", tag, owner, clock)
1866fd1771_t::fd1771_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_t(mconfig, FD1771x, "FD1771", tag, owner, clock)
18671867{
18681868}
18691869
1870fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, FD1793x, "FD1793", tag, owner, clock)
1870fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_t(mconfig, FD1793x, "FD1793", tag, owner, clock)
18711871{
18721872}
18731873
1874fd1797_t::fd1797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, FD1797x, "FD1797", tag, owner, clock)
1874fd1797_t::fd1797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_t(mconfig, FD1797x, "FD1797", tag, owner, clock)
18751875{
18761876}
18771877
1878wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD2793x, "WD2793", tag, owner, clock)
1878wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_t(mconfig, WD2793x, "WD2793", tag, owner, clock)
18791879{
18801880}
18811881
1882wd2797_t::wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD2797x, "WD2797", tag, owner, clock)
1882wd2797_t::wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_t(mconfig, WD2797x, "WD2797", tag, owner, clock)
18831883{
18841884}
18851885
1886wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1770x, "WD1770", tag, owner, clock)
1886wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_t(mconfig, WD1770x, "WD1770", tag, owner, clock)
18871887{
18881888}
18891889
1890wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1772x, "WD1772", tag, owner, clock)
1890wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_t(mconfig, WD1772x, "WD1772", tag, owner, clock)
18911891{
18921892}
18931893
r19173r19174
19021902   return 120000;
19031903}
19041904
1905wd1773_t::wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd177x_t(mconfig, WD1773x, "WD1773", tag, owner, clock)
1905wd1773_t::wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_t(mconfig, WD1773x, "WD1773", tag, owner, clock)
19061906{
19071907}
trunk/src/emu/machine/wd_fdc.h
r19173r19174
1#ifndef WD1772_H
2#define WD1772_H
1#ifndef WD_FDC_H
2#define WD_FDC_H
33
44#include "emu.h"
55#include "imagedev/floppy.h"
r19173r19174
6565#define MCFG_WD1773x_ADD(_tag, _clock)  \
6666   MCFG_DEVICE_ADD(_tag, WD1773x, _clock)
6767
68class wd177x_t : public device_t {
68class wd_fdc_t : public device_t {
6969public:
7070   typedef delegate<void (bool state)> line_cb;
7171
72   wd177x_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
72   wd_fdc_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
7373
7474   void dden_w(bool dden);
7575   void set_floppy(floppy_image_device *floppy);
r19173r19174
369369   void set_drq();
370370};
371371
372class fd1771_t : public wd177x_t {
372class fd1771_t : public wd_fdc_t {
373373public:
374374   fd1771_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
375375
r19173r19174
380380   virtual bool has_side_check() const { return true; }
381381};
382382
383class fd1793_t : public wd177x_t {
383class fd1793_t : public wd_fdc_t {
384384public:
385385   fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
386386
r19173r19174
391391   virtual bool has_side_check() const { return true; }
392392};
393393
394class fd1797_t : public wd177x_t {
394class fd1797_t : public wd_fdc_t {
395395public:
396396   fd1797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
397397
r19173r19174
403403   virtual bool has_sector_length_select() const { return true; }
404404};
405405
406class wd2793_t : public wd177x_t {
406class wd2793_t : public wd_fdc_t {
407407public:
408408   wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
409409
r19173r19174
414414   virtual bool has_side_check() const { return true; }
415415};
416416
417class wd2797_t : public wd177x_t {
417class wd2797_t : public wd_fdc_t {
418418public:
419419   wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
420420
r19173r19174
426426   virtual bool has_sector_length_select() const { return true; }
427427};
428428
429class wd1770_t : public wd177x_t {
429class wd1770_t : public wd_fdc_t {
430430public:
431431   wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
432432
r19173r19174
435435   virtual bool has_precompensation() const { return true; }
436436};
437437
438class wd1772_t : public wd177x_t {
438class wd1772_t : public wd_fdc_t {
439439public:
440440   wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
441441
r19173r19174
446446   virtual int settle_time() const;
447447};
448448
449class wd1773_t : public wd177x_t {
449class wd1773_t : public wd_fdc_t {
450450public:
451451   wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
452452
trunk/src/mess/includes/xerox820.h
r19173r19174
5959   required_device<cpu_device> m_maincpu;
6060   required_device<z80pio_device> m_kbpio;
6161   required_device<z80ctc_device> m_ctc;
62   required_device<wd177x_t> m_fdc;
62   required_device<fd1771_t> m_fdc;
6363   required_device<ram_device> m_ram;
6464   required_device<floppy_connector> m_floppy0;
6565   required_device<floppy_connector> m_floppy1;
trunk/src/mess/drivers/xerox820.c
r19173r19174
241241   AM_RANGE(0x05, 0x05) AM_MIRROR(0xff02) AM_DEVREADWRITE_LEGACY(Z80SIO_TAG, z80dart_c_r, z80dart_c_w)
242242   AM_RANGE(0x08, 0x0b) AM_MIRROR(0xff00) AM_DEVREADWRITE(Z80PIO_GP_TAG, z80pio_device, read_alt, write_alt)
243243   AM_RANGE(0x0c, 0x0c) AM_MIRROR(0xff03) AM_DEVWRITE(COM8116_TAG, com8116_device, stt_w)
244   AM_RANGE(0x10, 0x13) AM_MIRROR(0xff00) AM_DEVREADWRITE(FD1771_TAG, wd177x_t, read, write)
244   AM_RANGE(0x10, 0x13) AM_MIRROR(0xff00) AM_DEVREADWRITE(FD1771_TAG, fd1771_t, read, write)
245245   AM_RANGE(0x14, 0x14) AM_MIRROR(0xff03) AM_MASK(0xff00) AM_WRITE(scroll_w)
246246   AM_RANGE(0x18, 0x1b) AM_MIRROR(0xff00) AM_DEVREADWRITE(Z80CTC_TAG, z80ctc_device, read, write)
247247   AM_RANGE(0x1c, 0x1f) AM_MIRROR(0xff00) AM_DEVREADWRITE(Z80PIO_KB_TAG, z80pio_device, read_alt, write_alt)
r19173r19174
747747void xerox820_state::machine_start()
748748{
749749   // floppy callbacks
750   m_fdc->setup_intrq_cb(wd177x_t::line_cb(FUNC(xerox820_state::fdc_intrq_w), this));
751   m_fdc->setup_drq_cb(wd177x_t::line_cb(FUNC(xerox820_state::fdc_drq_w), this));
750   m_fdc->setup_intrq_cb(fd1771_t::line_cb(FUNC(xerox820_state::fdc_intrq_w), this));
751   m_fdc->setup_drq_cb(fd1771_t::line_cb(FUNC(xerox820_state::fdc_drq_w), this));
752752
753753   // state saving
754754   save_item(NAME(m_keydata));
trunk/src/mess/drivers/ht68k.c
r19173r19174
6262   AM_RANGE(0x00000000, 0x0007ffff) AM_RAM AM_SHARE("p_ram") // 512 KB RAM / ROM at boot
6363   //AM_RANGE(0x00080000, 0x000fffff) // Expansion
6464   //AM_RANGE(0x00d80000, 0x00d8ffff) // Printer
65   AM_RANGE(0x00e00000, 0x00e00007) AM_MIRROR(0xfff8) AM_DEVREADWRITE8("wd1770", wd177x_t, read, write, 0x00ff) // FDC WD1770
65   AM_RANGE(0x00e00000, 0x00e00007) AM_MIRROR(0xfff8) AM_DEVREADWRITE8("wd1770", wd1770_t, read, write, 0x00ff) // FDC WD1770
6666   AM_RANGE(0x00e80000, 0x00e800ff) AM_MIRROR(0xff00) AM_DEVREADWRITE8_LEGACY("duart68681", duart68681_r, duart68681_w, 0xff )
6767   AM_RANGE(0x00f00000, 0x00f07fff) AM_ROM AM_MIRROR(0xf8000) AM_REGION("user1",0)
6868ADDRESS_MAP_END
trunk/src/mess/drivers/einstein.c
r19173r19174
514514   AM_RANGE(0x10, 0x10) AM_MIRROR(0xff06) AM_DEVREADWRITE(IC_I060, i8251_device, data_r, data_w)
515515   AM_RANGE(0x11, 0x11) AM_MIRROR(0xff06) AM_DEVREADWRITE(IC_I060, i8251_device, status_r, control_w)
516516   /* block 3, wd1770 floppy controller */
517   AM_RANGE(0x18, 0x1b) AM_MIRROR(0xff04) AM_DEVREADWRITE(IC_I042, wd177x_t, read, write)
517   AM_RANGE(0x18, 0x1b) AM_MIRROR(0xff04) AM_DEVREADWRITE(IC_I042, wd1770_t, read, write)
518518   /* block 4, internal controls */
519519   AM_RANGE(0x20, 0x20) AM_MIRROR(0xff00) AM_READWRITE(einstein_kybintmsk_r, einstein_kybintmsk_w)
520520   AM_RANGE(0x21, 0x21) AM_MIRROR(0xff00) AM_WRITE(einstein_adcintmsk_w)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team