1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-25 03:32:01 +00:00

Routed tape motor selections through to the C++ side of the world, and ensured that manual tape playback works properly.

This commit is contained in:
Thomas Harte 2017-07-08 19:21:12 -04:00
parent 23e989e170
commit e2575d6de4
3 changed files with 22 additions and 1 deletions

View File

@ -55,7 +55,7 @@ int Machine::perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) {
if(is_zx81_) horizontal_counter_ %= 207;
if(!tape_advance_delay_) {
tape_player_.run_for_cycles(cycle.length);
if(tape_is_automatically_playing_ || tape_is_playing_) tape_player_.run_for_cycles(cycle.length);
} else {
tape_advance_delay_ = std::max(tape_advance_delay_ - cycle.length, 0);
}

View File

@ -63,6 +63,11 @@ class Machine:
void clear_all_keys();
inline void set_use_fast_tape_hack(bool activate) { use_fast_tape_hack_ = activate; }
inline void set_use_automatic_tape_motor_control(bool enabled) {
use_automatic_tape_motor_control_ = enabled;
if(!enabled) tape_is_automatically_playing_ = false;
}
inline void set_tape_is_playing(bool is_playing) { tape_is_playing_ = is_playing; }
private:
std::shared_ptr<Video> video_;
@ -94,6 +99,8 @@ class Machine:
uint8_t latched_video_byte_;
bool use_fast_tape_hack_;
bool use_automatic_tape_motor_control_;
bool tape_is_playing_, tape_is_automatically_playing_;
int tape_advance_delay_;
};

View File

@ -110,4 +110,18 @@
}
}
- (void)setTapeIsPlaying:(BOOL)tapeIsPlaying {
@synchronized(self) {
_tapeIsPlaying = tapeIsPlaying;
_zx8081.set_tape_is_playing(tapeIsPlaying ? true : false);
}
}
- (void)setUseAutomaticTapeMotorControl:(BOOL)useAutomaticTapeMotorControl {
@synchronized(self) {
_useAutomaticTapeMotorControl = useAutomaticTapeMotorControl;
_zx8081.set_use_automatic_tape_motor_control(useAutomaticTapeMotorControl ? true : false);
}
}
@end