1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-02 20:30:00 +00:00

Wired up the 1540 as a PLL delegate. Which prima facie means it should start receiving a bit stream. Except that I clearly have something in the timing way off — either my flux transitions are far too short or I need to significantly increase the clock rate on the PLL.

This commit is contained in:
Thomas Harte 2016-07-29 12:08:18 -04:00
parent 89a1881fef
commit 8f62211f5e
2 changed files with 11 additions and 1 deletions

View File

@ -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

View File

@ -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> 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);
}
}