Previous 199869 Revisions Next

r33742 Monday 8th December, 2014 at 17:48:11 UTC by Curt Coder
fdc_pll: Added write_next_bit_prev_cell() that writes a bit at the position the previous bit was read from. This is needed for FDC's that read and write on the same clock cycle, e.g. the Commodore 8050 and Victor 9000. [Curt Coder]
[src/emu/machine]fdc_pll.c fdc_pll.h
[src/mess/machine]victor9k_fdc.c

trunk/src/emu/machine/fdc_pll.c
r242253r242254
2222void fdc_pll_t::reset(const attotime &when)
2323{
2424   ctime = when;
25   write_ctime = when;
2526   phase_adjust = attotime::zero;
2627   freq_hist = 0;
2728   write_position = 0;
r242253r242254
6566   if(next > limit)
6667      return -1;
6768
69   write_ctime = ctime;
6870   ctime = next;
6971   tm = next;
7072
r242253r242254
130132   ctime = etime;
131133   return false;
132134}
135
136bool fdc_pll_t::write_next_bit_prev_cell(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit)
137{
138   if(write_start_time.is_never()) {
139      write_start_time = write_ctime;
140      write_position = 0;
141   }
142
143   attotime etime = write_ctime + period;
144   if(etime > limit)
145      return true;
146
147   if(bit && write_position < ARRAY_LENGTH(write_buffer))
148      write_buffer[write_position++] = write_ctime + period/2;
149
150   return false;
151}
trunk/src/emu/machine/fdc_pll.h
r242253r242254
1212public:
1313   attotime ctime, period, min_period, max_period, period_adjust_base, phase_adjust;
1414
15   attotime write_ctime;
1516   attotime write_start_time;
1617   attotime write_buffer[32];
1718   int write_position;
r242253r242254
2122   void reset(const attotime &when);
2223   int get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit);
2324   bool write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit);
25   bool write_next_bit_prev_cell(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit);
2426   void start_writing(const attotime &tm);
2527   void commit(floppy_image_device *floppy, const attotime &tm);
2628   void stop_writing(floppy_image_device *floppy, const attotime &tm);
trunk/src/mess/machine/victor9k_fdc.c
r242253r242254
11141114
11151115bool victor_9000_fdc_t::pll_write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit)
11161116{
1117   return cur_pll.write_next_bit(bit, tm, floppy, limit);
1117   return cur_pll.write_next_bit_prev_cell(bit, tm, floppy, limit);
11181118}
11191119
11201120void victor_9000_fdc_t::checkpoint()


Previous 199869 Revisions Next


© 1997-2024 The MAME Team