mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-26 08:29:33 +00:00
Creates a shell for the disk-drive add-on card.
This commit is contained in:
parent
d7ff6bd04d
commit
954386f1cc
30
Machines/Enterprise/EXDos.cpp
Normal file
30
Machines/Enterprise/EXDos.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
//
|
||||
// EXDos.cpp
|
||||
// Clock Signal
|
||||
//
|
||||
// Created by Thomas Harte on 20/06/2021.
|
||||
// Copyright © 2021 Thomas Harte. All rights reserved.
|
||||
//
|
||||
|
||||
#include "EXDos.hpp"
|
||||
|
||||
using namespace Enterprise;
|
||||
|
||||
EXDos::EXDos() : WD1770(P1770) {
|
||||
// emplace_drives(2, 8000000, 300, 2);
|
||||
set_control_register(0x00);
|
||||
}
|
||||
|
||||
void EXDos::set_disk(std::shared_ptr<Storage::Disk::Disk> disk, size_t drive) {
|
||||
}
|
||||
|
||||
void EXDos::set_control_register(uint8_t control) {
|
||||
last_control_ = control;
|
||||
}
|
||||
|
||||
uint8_t EXDos::get_control_register() {
|
||||
return last_control_;
|
||||
}
|
||||
|
||||
void EXDos::set_motor_on(bool on) {
|
||||
}
|
34
Machines/Enterprise/EXDos.hpp
Normal file
34
Machines/Enterprise/EXDos.hpp
Normal file
@ -0,0 +1,34 @@
|
||||
//
|
||||
// EXDos.hpp
|
||||
// Clock Signal
|
||||
//
|
||||
// Created by Thomas Harte on 20/06/2021.
|
||||
// Copyright © 2021 Thomas Harte. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef EXDos_hpp
|
||||
#define EXDos_hpp
|
||||
|
||||
#include "../../Components/1770/1770.hpp"
|
||||
#include "../../Activity/Observer.hpp"
|
||||
|
||||
namespace Enterprise {
|
||||
|
||||
class EXDos final : public WD::WD1770 {
|
||||
public:
|
||||
EXDos();
|
||||
|
||||
void set_disk(std::shared_ptr<Storage::Disk::Disk> disk, size_t drive);
|
||||
|
||||
void set_control_register(uint8_t control);
|
||||
uint8_t get_control_register();
|
||||
|
||||
private:
|
||||
uint8_t last_control_ = 0;
|
||||
|
||||
void set_motor_on(bool on) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* EXDos_hpp */
|
@ -10,6 +10,7 @@
|
||||
|
||||
#include "Keyboard.hpp"
|
||||
#include "Nick.hpp"
|
||||
#include "EXDos.hpp"
|
||||
|
||||
#include "../MachineTypes.hpp"
|
||||
|
||||
@ -208,6 +209,11 @@ template <bool has_disk_controller> class ConcreteMachine:
|
||||
previous_nick_interrupt_line_ = nick_interrupt_line;
|
||||
}
|
||||
|
||||
// The WD/etc runs at a nominal 8Mhz.
|
||||
if constexpr (has_disk_controller) {
|
||||
exdos_.run_for(Cycles(cycle.length.as_integral()));
|
||||
}
|
||||
|
||||
switch(cycle.operation) {
|
||||
default: break;
|
||||
|
||||
@ -218,6 +224,15 @@ template <bool has_disk_controller> class ConcreteMachine:
|
||||
assert(false);
|
||||
break;
|
||||
|
||||
case 0x10: case 0x11: case 0x12: case 0x13:
|
||||
case 0x14: case 0x15: case 0x16: case 0x17:
|
||||
*cycle.value = exdos_.read(address);
|
||||
break;
|
||||
case 0x18: case 0x19: case 0x1a: case 0x1b:
|
||||
case 0x1c: case 0x1d: case 0x1e: case 0x1f:
|
||||
*cycle.value = exdos_.get_control_register();
|
||||
break;
|
||||
|
||||
case 0xb0: *cycle.value = pages_[0]; break;
|
||||
case 0xb1: *cycle.value = pages_[1]; break;
|
||||
case 0xb2: *cycle.value = pages_[2]; break;
|
||||
@ -243,6 +258,15 @@ template <bool has_disk_controller> class ConcreteMachine:
|
||||
assert(false);
|
||||
break;
|
||||
|
||||
case 0x10: case 0x11: case 0x12: case 0x13:
|
||||
case 0x14: case 0x15: case 0x16: case 0x17:
|
||||
exdos_.write(address, *cycle.value);
|
||||
break;
|
||||
case 0x18: case 0x19: case 0x1a: case 0x1b:
|
||||
case 0x1c: case 0x1d: case 0x1e: case 0x1f:
|
||||
exdos_.set_control_register(*cycle.value);
|
||||
break;
|
||||
|
||||
case 0x80: case 0x81: case 0x82: case 0x83:
|
||||
case 0x84: case 0x85: case 0x86: case 0x87:
|
||||
case 0x88: case 0x89: case 0x8a: case 0x8b:
|
||||
@ -405,6 +429,9 @@ template <bool has_disk_controller> class ConcreteMachine:
|
||||
JustInTimeActor<Nick, HalfCycles, 40434603, 11360000> nick_;
|
||||
bool previous_nick_interrupt_line_ = false;
|
||||
// Cf. timing guesses above.
|
||||
|
||||
// MARK: - EXDos card.
|
||||
EXDos exdos_;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user