diff --git a/Components/1770/1770.cpp b/Components/1770/1770.cpp index 5852d0b4e..991f5efdc 100644 --- a/Components/1770/1770.cpp +++ b/Components/1770/1770.cpp @@ -25,7 +25,7 @@ WD1770::Status::Status() : busy(false) {} WD1770::WD1770(Personality p) : - Storage::Disk::MFMController(8000000, 16, 300), + Storage::Disk::MFMController(8000000), interesting_event_mask_((int)Event1770::Command), resume_point_(0), delay_time_(0), diff --git a/Components/8272/i8272.cpp b/Components/8272/i8272.cpp index 437533249..fea0e1094 100644 --- a/Components/8272/i8272.cpp +++ b/Components/8272/i8272.cpp @@ -75,8 +75,8 @@ namespace { const uint8_t CommandSenseDriveStatus = 0x04; } -i8272::i8272(BusHandler &bus_handler, Cycles clock_rate, int clock_rate_multiplier, int revolutions_per_minute) : - Storage::Disk::MFMController(clock_rate, clock_rate_multiplier, revolutions_per_minute), +i8272::i8272(BusHandler &bus_handler, Cycles clock_rate) : + Storage::Disk::MFMController(clock_rate), bus_handler_(bus_handler), main_status_(0), interesting_event_mask_((int)Event8272::CommandByte), diff --git a/Components/8272/i8272.hpp b/Components/8272/i8272.hpp index c8fced878..6b01af86d 100644 --- a/Components/8272/i8272.hpp +++ b/Components/8272/i8272.hpp @@ -26,7 +26,7 @@ class BusHandler { class i8272: public Storage::Disk::MFMController { public: - i8272(BusHandler &bus_handler, Cycles clock_rate, int clock_rate_multiplier, int revolutions_per_minute); + i8272(BusHandler &bus_handler, Cycles clock_rate); void run_for(Cycles); diff --git a/Machines/AmstradCPC/AmstradCPC.cpp b/Machines/AmstradCPC/AmstradCPC.cpp index 34cf8d650..534aa2e78 100644 --- a/Machines/AmstradCPC/AmstradCPC.cpp +++ b/Machines/AmstradCPC/AmstradCPC.cpp @@ -584,10 +584,10 @@ class FDC: public Intel::i8272::i8272 { Intel::i8272::BusHandler bus_handler_; public: - FDC() : i8272(bus_handler_, Cycles(8000000), 16, 300) {} + FDC() : i8272(bus_handler_, Cycles(8000000)) {} void set_motor_on(bool on) { - // TODO: should set all motors on, not just the one active drive. + // TODO: should set all motors on, not 8272.hjust the one active drive. get_drive().set_motor_on(on); } }; diff --git a/Machines/Commodore/1540/Implementation/C1540.cpp b/Machines/Commodore/1540/Implementation/C1540.cpp index abe95e663..7bad7bcf9 100644 --- a/Machines/Commodore/1540/Implementation/C1540.cpp +++ b/Machines/Commodore/1540/Implementation/C1540.cpp @@ -18,7 +18,7 @@ using namespace Commodore::C1540; MachineBase::MachineBase() : m6502_(*this), shift_register_(0), - Storage::Disk::Controller(1000000, 4, 300), + Storage::Disk::Controller(1000000), serial_port_(new SerialPort), serial_port_VIA_port_handler_(new SerialPortVIA(serial_port_VIA_)), drive_VIA_(drive_VIA_port_handler_), diff --git a/StaticAnalyser/Commodore/Disk.cpp b/StaticAnalyser/Commodore/Disk.cpp index d9349b762..b576afe5b 100644 --- a/StaticAnalyser/Commodore/Disk.cpp +++ b/StaticAnalyser/Commodore/Disk.cpp @@ -21,10 +21,10 @@ class CommodoreGCRParser: public Storage::Disk::Controller { public: std::shared_ptr drive; - CommodoreGCRParser() : Storage::Disk::Controller(4000000, 1, 300), shift_register_(0), track_(1) { + CommodoreGCRParser() : Storage::Disk::Controller(4000000), shift_register_(0), track_(1) { drive.reset(new Storage::Disk::Drive(4000000, 300)); set_drive(drive); - get_drive().set_motor_on(true); + drive->set_motor_on(true); } struct Sector { diff --git a/Storage/Disk/DiskController.cpp b/Storage/Disk/DiskController.cpp index 62a66ee79..0444fb62b 100644 --- a/Storage/Disk/DiskController.cpp +++ b/Storage/Disk/DiskController.cpp @@ -12,9 +12,9 @@ using namespace Storage::Disk; -Controller::Controller(Cycles clock_rate, int clock_rate_multiplier, int revolutions_per_minute) : - clock_rate_(clock_rate.as_int() * clock_rate_multiplier), - clock_rate_multiplier_(clock_rate_multiplier), +Controller::Controller(Cycles clock_rate) : + clock_rate_multiplier_(128000000 / clock_rate.as_int()), + clock_rate_(clock_rate.as_int() * clock_rate_multiplier_), empty_drive_(new Drive((unsigned int)clock_rate.as_int(), 1)) { // seed this class with a PLL, any PLL, so that it's safe to assume non-nullptr later Time one(1); diff --git a/Storage/Disk/DiskController.hpp b/Storage/Disk/DiskController.hpp index 2f6585729..ec0b63016 100644 --- a/Storage/Disk/DiskController.hpp +++ b/Storage/Disk/DiskController.hpp @@ -32,10 +32,9 @@ namespace Disk { class Controller: public DigitalPhaseLockedLoop::Delegate, public Drive::EventDelegate, public Sleeper, public Sleeper::SleepObserver { protected: /*! - Constructs a @c DiskDrive that will be run at @c clock_rate and runs its PLL at @c clock_rate*clock_rate_multiplier, - spinning inserted disks at @c revolutions_per_minute. + Constructs a @c Controller that will be run at @c clock_rate. */ - Controller(Cycles clock_rate, int clock_rate_multiplier, int revolutions_per_minute); + Controller(Cycles clock_rate); /*! Communicates to the PLL the expected length of a bit as a fraction of a second. @@ -86,9 +85,8 @@ class Controller: public DigitalPhaseLockedLoop::Delegate, public Drive::EventDe private: Time bit_length_; - int clock_rate_; int clock_rate_multiplier_; - Time rotational_multiplier_; + int clock_rate_; std::shared_ptr pll_; std::shared_ptr drive_; diff --git a/Storage/Disk/Encodings/MFM.cpp b/Storage/Disk/Encodings/MFM.cpp index 3c7919db5..62eef12d7 100644 --- a/Storage/Disk/Encodings/MFM.cpp +++ b/Storage/Disk/Encodings/MFM.cpp @@ -235,7 +235,7 @@ std::unique_ptr Storage::Encodings::MFM::GetFMEncoder(std::vector