diff --git a/Machines/Commodore/1540/C1540.cpp b/Machines/Commodore/1540/C1540.cpp index fe1f80bd6..9f2cb4aa5 100644 --- a/Machines/Commodore/1540/C1540.cpp +++ b/Machines/Commodore/1540/C1540.cpp @@ -116,6 +116,14 @@ void Machine::mos6522_did_change_interrupt_status(void *mos6522) void Machine::process_input_bit(int value, unsigned int cycles_since_index_hole) { _shift_register = (_shift_register >> 1) | (value << 10); + + static int bitCount = 0; + bitCount++; + if(bitCount == 8) + { + printf("%02x.", _shift_register&0xff); + bitCount = 0; + } } // the 1540 does not recognise index holes diff --git a/Storage/Disk/DiskDrive.cpp b/Storage/Disk/DiskDrive.cpp index 1a98abe57..ee5f5b298 100644 --- a/Storage/Disk/DiskDrive.cpp +++ b/Storage/Disk/DiskDrive.cpp @@ -26,6 +26,7 @@ void DiskDrive::set_expected_bit_length(Time bit_length) // account of in rotation speed, air turbulence, etc, so a direct conversion will do int clocks_per_bit = (int)((bit_length.length * _clock_rate) / bit_length.clock_rate); _pll.reset(new DigitalPhaseLockedLoop(clocks_per_bit, clocks_per_bit / 5, 3)); + _pll->set_delegate(this); } void DiskDrive::set_disk(std::shared_ptr disk) @@ -61,7 +62,8 @@ void DiskDrive::run_for_cycles(int number_of_cycles) { if(has_disk()) { - _cycles_since_index_hole += number_of_cycles; + _cycles_since_index_hole += (unsigned int)number_of_cycles; + _pll->run_for_cycles(number_of_cycles); TimedEventLoop::run_for_cycles(number_of_cycles); } }