mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-25 18:30:21 +00:00
Withdraws requirement for DiskController users to specify a PLL multiplier or to provide rotation speed.
In the latter case because it's no longer of any interest to the controller, and in the former because I'd rather it be picked automatically.
This commit is contained in:
parent
6d6cac429d
commit
96bf133924
@ -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),
|
||||
|
@ -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),
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
@ -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_),
|
||||
|
@ -21,10 +21,10 @@ class CommodoreGCRParser: public Storage::Disk::Controller {
|
||||
public:
|
||||
std::shared_ptr<Storage::Disk::Drive> 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 {
|
||||
|
@ -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);
|
||||
|
@ -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<DigitalPhaseLockedLoop> pll_;
|
||||
std::shared_ptr<Drive> drive_;
|
||||
|
@ -235,7 +235,7 @@ std::unique_ptr<Encoder> Storage::Encodings::MFM::GetFMEncoder(std::vector<uint8
|
||||
#pragma mark - Parser
|
||||
|
||||
Parser::Parser(bool is_mfm) :
|
||||
Storage::Disk::Controller(4000000, 32, 300),
|
||||
Storage::Disk::Controller(4000000),
|
||||
crc_generator_(0x1021, 0xffff),
|
||||
shift_register_(0), is_mfm_(is_mfm),
|
||||
track_(0), head_(0) {
|
||||
|
@ -12,8 +12,8 @@
|
||||
|
||||
using namespace Storage::Disk;
|
||||
|
||||
MFMController::MFMController(Cycles clock_rate, int clock_rate_multiplier, int revolutions_per_minute) :
|
||||
Storage::Disk::Controller(clock_rate, clock_rate_multiplier, revolutions_per_minute),
|
||||
MFMController::MFMController(Cycles clock_rate) :
|
||||
Storage::Disk::Controller(clock_rate),
|
||||
crc_generator_(0x1021, 0xffff),
|
||||
data_mode_(DataMode::Scanning),
|
||||
is_awaiting_marker_value_(false) {
|
||||
|
@ -22,7 +22,7 @@ namespace Disk {
|
||||
*/
|
||||
class MFMController: public Controller {
|
||||
public:
|
||||
MFMController(Cycles clock_rate, int clock_rate_multiplier, int revolutions_per_minute);
|
||||
MFMController(Cycles clock_rate);
|
||||
|
||||
protected:
|
||||
/// Indicates whether the controller should try to decode double-density MFM content, or single-density FM content.
|
||||
|
Loading…
Reference in New Issue
Block a user