1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-19 19:16:34 +00:00

Drives now have a finite number of heads.

The Amstrad volunteers itself to be single sided. Everything else stays as it was.
This commit is contained in:
Thomas Harte
2017-09-15 21:18:36 -04:00
parent 35fe4d50d4
commit da082673d7
9 changed files with 14 additions and 10 deletions
+5 -2
View File
@@ -15,9 +15,10 @@
using namespace Storage::Disk;
Drive::Drive(unsigned int input_clock_rate, int revolutions_per_minute):
Drive::Drive(unsigned int input_clock_rate, int revolutions_per_minute, unsigned int number_of_heads):
Storage::TimedEventLoop(input_clock_rate),
rotational_multiplier_(60, revolutions_per_minute) {
rotational_multiplier_(60, revolutions_per_minute),
available_heads_(number_of_heads) {
}
void Drive::set_disk(const std::shared_ptr<Disk> &disk) {
@@ -51,6 +52,7 @@ void Drive::step(int direction) {
}
void Drive::set_head(unsigned int head) {
head = std::min(head, available_heads_ - 1);
if(head != head_) {
head_ = head;
track_ = nullptr;
@@ -73,6 +75,7 @@ bool Drive::get_is_read_only() {
}
bool Drive::get_is_ready() {
return true;
return ready_index_count_ == 2;
}