1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-18 17:06:15 +00:00

Teaches the Oric to apply a lighter Disk II touch when possible.

This commit is contained in:
Thomas Harte 2018-05-28 18:20:43 -04:00
parent 6c16754a6b
commit 6812a001d8

View File

@ -411,6 +411,7 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
}
}
} else {
flush_diskii();
const int disk_value = diskii_.read_address(address);
if(isReadOperation(operation) && disk_value != diskii_.DidNotLoad) *value = static_cast<uint8_t>(disk_value);
}
@ -445,9 +446,11 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
microdisc_.run_for(Cycles(8));
break;
case Analyser::Static::Oric::Target::DiskInterface::Pravetz:
if(!diskii_is_sleeping_) {
if(diskii_clocking_preference_ == ClockingHint::Preference::RealTime) {
diskii_.set_data_input(*value);
diskii_.run_for(Cycles(2));
} else {
cycles_since_diskii_update_ += Cycles(2);
}
break;
}
@ -458,6 +461,7 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
forceinline void flush() {
update_video();
via_port_handler_.flush();
flush_diskii();
}
// to satisfy CRTMachine::Machine
@ -572,8 +576,8 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
}
}
void set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference is_sleeping) override final {
diskii_is_sleeping_ = diskii_.preferred_clocking() == ClockingHint::Preference::None;
void set_component_prefers_clocking(ClockingHint::Source *component, ClockingHint::Preference preference) override final {
diskii_clocking_preference_ = diskii_.preferred_clocking();
}
private:
@ -618,9 +622,13 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
// the Pravetz/Disk II, if in use
Apple::DiskII diskii_;
Cycles cycles_since_diskii_update_;
void flush_diskii() {
diskii_.run_for(cycles_since_diskii_update_.flush());
}
std::vector<uint8_t> pravetz_rom_;
std::size_t pravetz_rom_base_pointer_ = 0;
bool diskii_is_sleeping_ = false;
ClockingHint::Preference diskii_clocking_preference_ = ClockingHint::Preference::RealTime;
// Overlay RAM
uint16_t ram_top_ = basic_visible_ram_top_;