mirror of
https://github.com/TomHarte/CLK.git
synced 2024-09-08 03:54:27 +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:
parent
23e989e170
commit
e2575d6de4
@ -55,7 +55,7 @@ int Machine::perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) {
|
|||||||
|
|
||||||
if(is_zx81_) horizontal_counter_ %= 207;
|
if(is_zx81_) horizontal_counter_ %= 207;
|
||||||
if(!tape_advance_delay_) {
|
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 {
|
} else {
|
||||||
tape_advance_delay_ = std::max(tape_advance_delay_ - cycle.length, 0);
|
tape_advance_delay_ = std::max(tape_advance_delay_ - cycle.length, 0);
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,11 @@ class Machine:
|
|||||||
void clear_all_keys();
|
void clear_all_keys();
|
||||||
|
|
||||||
inline void set_use_fast_tape_hack(bool activate) { use_fast_tape_hack_ = activate; }
|
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:
|
private:
|
||||||
std::shared_ptr<Video> video_;
|
std::shared_ptr<Video> video_;
|
||||||
@ -94,6 +99,8 @@ class Machine:
|
|||||||
uint8_t latched_video_byte_;
|
uint8_t latched_video_byte_;
|
||||||
|
|
||||||
bool use_fast_tape_hack_;
|
bool use_fast_tape_hack_;
|
||||||
|
bool use_automatic_tape_motor_control_;
|
||||||
|
bool tape_is_playing_, tape_is_automatically_playing_;
|
||||||
int tape_advance_delay_;
|
int tape_advance_delay_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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
|
@end
|
||||||
|
Loading…
Reference in New Issue
Block a user