mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-27 06:35:04 +00:00
Fixed failure to set a delegate, slowed tape speed if operating in RAM.
This commit is contained in:
parent
43a7d1b7ae
commit
949c33774a
@ -35,6 +35,7 @@ Machine::Machine() :
|
||||
memset(_roms[c], 0xff, 16384);
|
||||
|
||||
_speaker.set_input_rate(125000);
|
||||
_tape.set_delegate(this);
|
||||
}
|
||||
|
||||
Machine::~Machine()
|
||||
@ -290,7 +291,7 @@ unsigned int Machine::perform_bus_operation(CPU6502::BusOperation operation, uin
|
||||
break;
|
||||
}
|
||||
|
||||
_tape.run_for_cycle();
|
||||
_tape.run_for_cycles(cycles);
|
||||
|
||||
return cycles;
|
||||
}
|
||||
@ -657,9 +658,11 @@ inline void Tape::clear_interrupts(uint8_t interrupts)
|
||||
}
|
||||
}
|
||||
|
||||
inline void Tape::run_for_cycle()
|
||||
inline void Tape::run_for_cycles(unsigned int number_of_cycles)
|
||||
{
|
||||
if(_is_running && _tape != nullptr)
|
||||
{
|
||||
while(number_of_cycles--)
|
||||
{
|
||||
_time_into_pulse += (unsigned int)_pulse_stepper->step();
|
||||
if(_time_into_pulse == _current_pulse.length.length)
|
||||
@ -693,4 +696,5 @@ inline void Tape::run_for_cycle()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ class Tape {
|
||||
};
|
||||
inline void set_delegate(Delegate *delegate) { _delegate = delegate; }
|
||||
|
||||
inline void run_for_cycle();
|
||||
inline void run_for_cycles(unsigned int number_of_cycles);
|
||||
|
||||
void set_is_running(bool is_running) { _is_running = is_running; }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user