1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-01 14:29:51 +00:00

Deintegrated the busy flag and the interrupt request line, as the latter is reset by status reads. Which also means I can start reporting the WD INTRQ line status directly from the Microdisc. That appears to be correct, rather than honouring the Microdisc IRQ select there.

This commit is contained in:
Thomas Harte 2016-12-06 21:16:29 -05:00
parent 4d3bdf8c7c
commit c304db0f5a
3 changed files with 10 additions and 3 deletions

View File

@ -21,6 +21,7 @@ WD1770::Status::Status() :
seek_error(false),
lost_data(false),
data_request(false),
interrupt_request(false),
busy(false)
{}
@ -83,6 +84,9 @@ uint8_t WD1770::get_register(int address)
{
default:
{
update_status([] (Status &status) {
status.interrupt_request = false;
});
uint8_t status =
(status_.write_protect ? Flag::WriteProtect : 0) |
(status_.crc_error ? Flag::CRCError : 0) |
@ -326,12 +330,14 @@ void WD1770::posit_event(Event new_event_type)
update_status([] (Status &status) {
status.busy = false;
status.interrupt_request = true;
});
WAIT_FOR_EVENT(Event::Command);
update_status([] (Status &status) {
status.busy = true;
status.interrupt_request = false;
});
printf("Starting %02x\n", command_);

View File

@ -46,8 +46,8 @@ class WD1770: public Storage::Disk::Controller {
Busy = 0x01
};
inline bool get_interrupt_request_line() { return !status_.busy; }
inline bool get_data_request_line() { return status_.data_request; }
inline bool get_interrupt_request_line() { return status_.interrupt_request; }
inline bool get_data_request_line() { return status_.data_request; }
class Delegate {
public:
virtual void wd1770_did_change_output(WD1770 *wd1770) = 0;
@ -73,6 +73,7 @@ class WD1770: public Storage::Disk::Controller {
bool seek_error;
bool lost_data;
bool data_request;
bool interrupt_request;
bool busy;
enum {
One, Two, Three

View File

@ -90,7 +90,7 @@ bool Microdisc::get_interrupt_request_line()
uint8_t Microdisc::get_interrupt_request_register()
{
return 0x7f | (get_interrupt_request_line() ? 0x00 : 0x80);
return 0x7f | (WD1770::get_interrupt_request_line() ? 0x00 : 0x80);
}
uint8_t Microdisc::get_data_request_register()