1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-04-10 07:39:01 +00:00

Provide target platform where serialiser will accept it.

This commit is contained in:
Thomas Harte 2025-01-17 17:09:47 -05:00
parent 0a22d8fb9e
commit bde2047184
11 changed files with 15 additions and 11 deletions
Analyser/Static/MSX
Machines
Acorn/Electron
AmstradCPC
Commodore
MSX
Oric
Sinclair
ZX8081
ZXSpectrum
Storage/Tape

@ -29,7 +29,7 @@ std::vector<File> Analyser::Static::MSX::GetFiles(const std::shared_ptr<Storage:
Storage::Tape::BinaryTapePlayer tape_player(1000000);
tape_player.set_motor_control(true);
tape_player.set_tape(tape);
tape_player.set_tape(tape, TargetPlatform::MSX);
using Parser = Storage::Tape::MSX::Parser;

@ -186,7 +186,7 @@ public:
bool insert_media(const Analyser::Static::Media &media) final {
if(!media.tapes.empty()) {
tape_.set_tape(media.tapes.front());
tape_.set_tape(media.tapes.front(), TargetPlatform::AcornElectron);
}
set_use_fast_tape_hack();

@ -1125,7 +1125,7 @@ public:
bool insert_media(const Analyser::Static::Media &media) final {
// If there are any tapes supplied, use the first of them.
if(!media.tapes.empty()) {
tape_player_.set_tape(media.tapes.front());
tape_player_.set_tape(media.tapes.front(), TargetPlatform::AmstradCPC);
set_use_fast_tape_hack();
}

@ -621,7 +621,7 @@ private:
bool insert_media(const Analyser::Static::Media &media) final {
if(!media.tapes.empty()) {
tape_player_->set_tape(media.tapes[0]);
tape_player_->set_tape(media.tapes[0], TargetPlatform::Plus4);
}
if(!media.disks.empty() && c1541_) {

@ -439,7 +439,7 @@ public:
bool insert_media(const Analyser::Static::Media &media) final {
if(!media.tapes.empty()) {
tape_->set_tape(media.tapes.front());
tape_->set_tape(media.tapes.front(), TargetPlatform::Vic20);
}
if(!media.disks.empty() && c1540_) {

@ -431,7 +431,7 @@ class ConcreteMachine:
}
if(!media.tapes.empty()) {
tape_player_.set_tape(media.tapes.front());
tape_player_.set_tape(media.tapes.front(), TargetPlatform::MSX);
}
if(!media.disks.empty()) {

@ -440,7 +440,7 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface, CPU::MOS
bool inserted = false;
if(!media.tapes.empty()) {
tape_player_.set_tape(media.tapes.front());
tape_player_.set_tape(media.tapes.front(), TargetPlatform::Oric);
inserted = true;
}

@ -323,7 +323,7 @@ template<bool is_zx81> class ConcreteMachine:
bool insert_media(const Analyser::Static::Media &media) final {
if(!media.tapes.empty()) {
tape_player_.set_tape(media.tapes.front());
tape_player_.set_tape(media.tapes.front(), is_zx81 ? TargetPlatform::ZX81 : TargetPlatform::ZX80);
}
set_use_fast_tape();

@ -681,7 +681,7 @@ template<Model model> class ConcreteMachine:
bool insert_media(const Analyser::Static::Media &media) override {
// If there are any tapes supplied, use the first of them.
if(!media.tapes.empty()) {
tape_player_.set_tape(media.tapes.front());
tape_player_.set_tape(media.tapes.front(), TargetPlatform::ZXSpectrum);
set_use_fast_tape();
}

@ -78,9 +78,13 @@ ClockingHint::Preference TapePlayer::preferred_clocking() const {
return (!tape_ || serialiser_->is_at_end()) ? ClockingHint::Preference::None : ClockingHint::Preference::JustInTime;
}
void TapePlayer::set_tape(std::shared_ptr<Storage::Tape::Tape> tape) {
void TapePlayer::set_tape(std::shared_ptr<Storage::Tape::Tape> tape, TargetPlatform::Type platform) {
tape_ = tape;
serialiser_ = tape->serialiser();
if(auto recipient = dynamic_cast<TargetPlatform::Recipient *>(serialiser_.get()); recipient) {
recipient->set_target_platforms(platform);
}
reset_timer();
next_pulse();
update_clocking_observer();

@ -115,7 +115,7 @@ public:
TapePlayer(int input_clock_rate);
virtual ~TapePlayer() = default;
void set_tape(std::shared_ptr<Storage::Tape::Tape>);
void set_tape(std::shared_ptr<Storage::Tape::Tape>, TargetPlatform::Type platform);
bool has_tape() const;
bool is_at_end() const;
TapeSerialiser *serialiser();