trunk/src/emu/machine/fdc_pll.c
| r242253 | r242254 | |
| 22 | 22 | void fdc_pll_t::reset(const attotime &when) |
| 23 | 23 | { |
| 24 | 24 | ctime = when; |
| 25 | write_ctime = when; |
| 25 | 26 | phase_adjust = attotime::zero; |
| 26 | 27 | freq_hist = 0; |
| 27 | 28 | write_position = 0; |
| r242253 | r242254 | |
| 65 | 66 | if(next > limit) |
| 66 | 67 | return -1; |
| 67 | 68 | |
| 69 | write_ctime = ctime; |
| 68 | 70 | ctime = next; |
| 69 | 71 | tm = next; |
| 70 | 72 | |
| r242253 | r242254 | |
| 130 | 132 | ctime = etime; |
| 131 | 133 | return false; |
| 132 | 134 | } |
| 135 | |
| 136 | bool 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
| r242253 | r242254 | |
| 12 | 12 | public: |
| 13 | 13 | attotime ctime, period, min_period, max_period, period_adjust_base, phase_adjust; |
| 14 | 14 | |
| 15 | attotime write_ctime; |
| 15 | 16 | attotime write_start_time; |
| 16 | 17 | attotime write_buffer[32]; |
| 17 | 18 | int write_position; |
| r242253 | r242254 | |
| 21 | 22 | void reset(const attotime &when); |
| 22 | 23 | int get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit); |
| 23 | 24 | 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); |
| 24 | 26 | void start_writing(const attotime &tm); |
| 25 | 27 | void commit(floppy_image_device *floppy, const attotime &tm); |
| 26 | 28 | void stop_writing(floppy_image_device *floppy, const attotime &tm); |