1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-20 10:17:05 +00:00

Quick fixes: the binary tape player now considers talk to the sleep observer only if motor control changes. The Amstrad CPC no longer attempts to use the component argument to identify the caller, since this will often be that of the superclass and not that of the derived class known to the CPC.

This commit is contained in:
Thomas Harte
2017-08-20 13:18:46 -04:00
parent 5cf0395936
commit 0cbc1753b9
2 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -917,8 +917,8 @@ class ConcreteMachine:
}
void set_component_is_sleeping(void *component, bool is_sleeping) {
if(component == &fdc_) fdc_is_sleeping_ = is_sleeping;
else tape_player_is_sleeping_ = is_sleeping;
fdc_is_sleeping_ = fdc_.is_sleeping();
tape_player_is_sleeping_ = tape_player_.is_sleeping();
}
#pragma mark - Keyboard
+4 -2
View File
@@ -125,8 +125,10 @@ bool BinaryTapePlayer::is_sleeping() {
}
void BinaryTapePlayer::set_motor_control(bool enabled) {
motor_is_running_ = enabled;
update_sleep_observer();
if(motor_is_running_ != enabled) {
motor_is_running_ = enabled;
update_sleep_observer();
}
}
void BinaryTapePlayer::set_tape_output(bool set) {