1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-22 12:33:29 +00:00

Reduced copying of Pulses.

This commit is contained in:
Thomas Harte 2017-07-16 19:49:31 -04:00
parent 5a6b7219b9
commit b3861ff755
4 changed files with 5 additions and 5 deletions

View File

@ -72,7 +72,7 @@ uint8_t Tape::get_data_register() {
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);
}

View File

@ -45,7 +45,7 @@ class Tape:
void acorn_shifter_output_bit(int value);
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 get_next_tape_pulse();

View File

@ -108,7 +108,7 @@ void BinaryTapePlayer::set_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;
if(input_level_ != new_input_level) {
input_level_ = new_input_level;

View File

@ -87,7 +87,7 @@ class TapePlayer: public TimedEventLoop {
protected:
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:
inline void get_next_pulse();
@ -121,7 +121,7 @@ class BinaryTapePlayer: public TapePlayer {
protected:
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 motor_is_running_;
};