mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-16 18:30:32 +00:00
Reduced copying of Pulses.
This commit is contained in:
parent
5a6b7219b9
commit
b3861ff755
@ -72,7 +72,7 @@ uint8_t Tape::get_data_register() {
|
|||||||
return (uint8_t)(data_register_ >> 2);
|
return (uint8_t)(data_register_ >> 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tape::process_input_pulse(Storage::Tape::Tape::Pulse pulse) {
|
void Tape::process_input_pulse(const Storage::Tape::Tape::Pulse &pulse) {
|
||||||
shifter_.process_pulse(pulse);
|
shifter_.process_pulse(pulse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ class Tape:
|
|||||||
void acorn_shifter_output_bit(int value);
|
void acorn_shifter_output_bit(int value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void process_input_pulse(Storage::Tape::Tape::Pulse pulse);
|
void process_input_pulse(const Storage::Tape::Tape::Pulse &pulse);
|
||||||
inline void push_tape_bit(uint16_t bit);
|
inline void push_tape_bit(uint16_t bit);
|
||||||
inline void get_next_tape_pulse();
|
inline void get_next_tape_pulse();
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ void BinaryTapePlayer::set_delegate(Delegate *delegate) {
|
|||||||
delegate_ = delegate;
|
delegate_ = delegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinaryTapePlayer::process_input_pulse(Storage::Tape::Tape::Pulse pulse) {
|
void BinaryTapePlayer::process_input_pulse(const Storage::Tape::Tape::Pulse &pulse) {
|
||||||
bool new_input_level = pulse.type == Tape::Pulse::High;
|
bool new_input_level = pulse.type == Tape::Pulse::High;
|
||||||
if(input_level_ != new_input_level) {
|
if(input_level_ != new_input_level) {
|
||||||
input_level_ = new_input_level;
|
input_level_ = new_input_level;
|
||||||
|
@ -87,7 +87,7 @@ class TapePlayer: public TimedEventLoop {
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void process_next_event();
|
virtual void process_next_event();
|
||||||
virtual void process_input_pulse(Tape::Pulse pulse) = 0;
|
virtual void process_input_pulse(const Tape::Pulse &pulse) = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
inline void get_next_pulse();
|
inline void get_next_pulse();
|
||||||
@ -121,7 +121,7 @@ class BinaryTapePlayer: public TapePlayer {
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
Delegate *delegate_;
|
Delegate *delegate_;
|
||||||
virtual void process_input_pulse(Storage::Tape::Tape::Pulse pulse);
|
virtual void process_input_pulse(const Storage::Tape::Tape::Pulse &pulse);
|
||||||
bool input_level_;
|
bool input_level_;
|
||||||
bool motor_is_running_;
|
bool motor_is_running_;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user