Skip to content

Commit

Permalink
Merge pull request #1372 from TomHarte/DiskReady
Browse files Browse the repository at this point in the history
Add Archimedes disk drive RDY signal.
  • Loading branch information
TomHarte authored May 1, 2024
2 parents c3ad215 + 6a2261d commit 63009d0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Machines/Acorn/Archimedes/FloppyDisc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ template <typename InterruptObserverT>
class FloppyDisc: public WD::WD1770, public WD::WD1770::Delegate {
public:
FloppyDisc(InterruptObserverT &observer) : WD::WD1770(P1772), observer_(observer) {
emplace_drives(1, 8000000, 300, 2);
emplace_drives(1, 8000000, 300, 2, Storage::Disk::Drive::ReadyType::IBMRDY); // A guess at RDY type.
set_delegate(this);
}

Expand All @@ -40,6 +40,10 @@ class FloppyDisc: public WD::WD1770, public WD::WD1770::Delegate {
get_drive(drive).set_disk(disk);
}

bool ready() const {
return get_drive().get_is_ready();
}

private:
InterruptObserverT &observer_;
};
Expand Down
3 changes: 2 additions & 1 deletion Machines/Acorn/Archimedes/InputOutputController.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,9 @@ struct InputOutputController: public ClockingHint::Observer {

case 0x00: {
uint8_t value = control_ | 0xc0;
value &= ~(i2c_.clock() ? 0x02 : 0x00);
value &= ~(i2c_.data() ? 0x01 : 0x00);
value &= ~(i2c_.clock() ? 0x02 : 0x00);
value &= ~(floppy_.ready() ? 0x04 : 0x00);
value &= ~(video_.flyback_active() ? 0x00 : 0x80); // i.e. high during flyback.
set_byte(value);
// logger.error().append("IOC control read: C:%d D:%d", !(value & 2), !(value & 1));
Expand Down
4 changes: 4 additions & 0 deletions Storage/Disk/Controller/DiskController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ Drive &Controller::get_drive() {
return *drive_;
}

const Drive &Controller::get_drive() const {
return *drive_;
}

// MARK: - Drive::EventDelegate

void Controller::process_event(const Drive::Event &event) {
Expand Down
1 change: 1 addition & 0 deletions Storage/Disk/Controller/DiskController.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class Controller:
made about the lifetime or the exclusivity of the invented drive.
*/
Drive &get_drive();
const Drive &get_drive() const;

Drive &get_drive(size_t index) {
return *drives_[index];
Expand Down

0 comments on commit 63009d0

Please sign in to comment.