mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-22 12:33:29 +00:00
Implements unconditional force interrupt for the WD.
This commit is contained in:
parent
513c067f94
commit
793ef68206
@ -23,10 +23,16 @@ void WD1770::set_register(int address, uint8_t value) {
|
|||||||
switch(address&3) {
|
switch(address&3) {
|
||||||
case 0: {
|
case 0: {
|
||||||
if((value&0xf0) == 0xd0) {
|
if((value&0xf0) == 0xd0) {
|
||||||
printf("!!!TODO: force interrupt!!!\n");
|
if(value == 0xd0) {
|
||||||
update_status([] (Status &status) {
|
// Force interrupt **immediately**.
|
||||||
status.type = Status::One;
|
printf("Force interrupt immediately\n");
|
||||||
});
|
posit_event(static_cast<int>(Event1770::ForceInterrupt));
|
||||||
|
} else {
|
||||||
|
printf("!!!TODO: force interrupt!!!\n");
|
||||||
|
update_status([] (Status &status) {
|
||||||
|
status.type = Status::One;
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
command_ = value;
|
command_ = value;
|
||||||
posit_event(static_cast<int>(Event1770::Command));
|
posit_event(static_cast<int>(Event1770::Command));
|
||||||
@ -169,13 +175,22 @@ void WD1770::posit_event(int new_event_type) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(interesting_event_mask_ & static_cast<int>(new_event_type))) return;
|
if(new_event_type == static_cast<int>(Event1770::ForceInterrupt)) {
|
||||||
interesting_event_mask_ &= ~new_event_type;
|
interesting_event_mask_ = 0;
|
||||||
|
resume_point_ = 0;
|
||||||
|
update_status([] (Status &status) {
|
||||||
|
status.type = Status::One;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if(!(interesting_event_mask_ & static_cast<int>(new_event_type))) return;
|
||||||
|
interesting_event_mask_ &= ~new_event_type;
|
||||||
|
}
|
||||||
|
|
||||||
Status new_status;
|
Status new_status;
|
||||||
BEGIN_SECTION()
|
BEGIN_SECTION()
|
||||||
|
|
||||||
// Wait for a new command, branch to the appropriate handler.
|
// Wait for a new command, branch to the appropriate handler.
|
||||||
|
case 0:
|
||||||
wait_for_command:
|
wait_for_command:
|
||||||
printf("Idle...\n");
|
printf("Idle...\n");
|
||||||
set_data_mode(DataMode::Scanning);
|
set_data_mode(DataMode::Scanning);
|
||||||
|
@ -116,7 +116,8 @@ class WD1770: public Storage::Disk::MFMController {
|
|||||||
Command = (1 << 3), // Indicates receipt of a new command.
|
Command = (1 << 3), // Indicates receipt of a new command.
|
||||||
HeadLoad = (1 << 4), // Indicates the head has been loaded (1973 only).
|
HeadLoad = (1 << 4), // Indicates the head has been loaded (1973 only).
|
||||||
Timer = (1 << 5), // Indicates that the delay_time_-powered timer has timed out.
|
Timer = (1 << 5), // Indicates that the delay_time_-powered timer has timed out.
|
||||||
IndexHoleTarget = (1 << 6) // Indicates that index_hole_count_ has reached index_hole_count_target_.
|
IndexHoleTarget = (1 << 6), // Indicates that index_hole_count_ has reached index_hole_count_target_.
|
||||||
|
ForceInterrupt = (1 << 7) // Indicates a forced interrupt.
|
||||||
};
|
};
|
||||||
void posit_event(int type);
|
void posit_event(int type);
|
||||||
int interesting_event_mask_;
|
int interesting_event_mask_;
|
||||||
|
Loading…
Reference in New Issue
Block a user