diff options
Diffstat (limited to 'src/devices/machine/fdc_pll.cpp')
-rw-r--r-- | src/devices/machine/fdc_pll.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/devices/machine/fdc_pll.cpp b/src/devices/machine/fdc_pll.cpp index cf616468a12..ef93eda920d 100644 --- a/src/devices/machine/fdc_pll.cpp +++ b/src/devices/machine/fdc_pll.cpp @@ -23,11 +23,16 @@ void fdc_pll_t::set_clock(const attotime &_period) void fdc_pll_t::reset(const attotime &when) { + read_reset(when); + write_position = 0; + write_start_time = attotime::never; +} + +void fdc_pll_t::read_reset(const attotime &when) +{ ctime = when; phase_adjust = attotime::zero; freq_hist = 0; - write_position = 0; - write_start_time = attotime::never; } void fdc_pll_t::start_writing(const attotime &tm) @@ -55,8 +60,13 @@ void fdc_pll_t::commit(floppy_image_device *floppy, const attotime &tm) int fdc_pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit) { - attotime edge = floppy ? floppy->get_next_transition(ctime) : attotime::never; + attotime edge = floppy ? floppy->get_next_transition(ctime) : attotime::never; + return feed_read_data(tm , edge , limit); +} + +int fdc_pll_t::feed_read_data(attotime &tm, const attotime& edge, const attotime &limit) +{ attotime next = ctime + period + phase_adjust; #if 0 @@ -70,7 +80,7 @@ int fdc_pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, const att ctime = next; tm = next; - if(edge.is_never() || edge >= next) { + if(edge.is_never() || edge > next) { // No transition in the window means 0 and pll in free run mode phase_adjust = attotime::zero; return 0; |