mirror of
https://github.com/TomHarte/CLK.git
synced 2024-09-02 23:29:15 +00:00
Merge branch 'master' into InST
This commit is contained in:
commit
12277d9305
@ -27,6 +27,7 @@ enum ExecutionState: int {
|
|||||||
Reset = std::numeric_limits<int>::min(),
|
Reset = std::numeric_limits<int>::min(),
|
||||||
Decode,
|
Decode,
|
||||||
WaitForDTACK,
|
WaitForDTACK,
|
||||||
|
WaitForInterrupt,
|
||||||
|
|
||||||
StoreOperand,
|
StoreOperand,
|
||||||
StoreOperand_bw,
|
StoreOperand_bw,
|
||||||
@ -377,14 +378,21 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor
|
|||||||
}
|
}
|
||||||
MoveToStateSpecific(WaitForDTACK);
|
MoveToStateSpecific(WaitForDTACK);
|
||||||
|
|
||||||
// Spin in place until an interrupt arrives.
|
|
||||||
BeginState(STOP):
|
BeginState(STOP):
|
||||||
IdleBus(1);
|
// Apply the suffix status.
|
||||||
|
status_.set_status(prefetch_.w);
|
||||||
|
did_update_status();
|
||||||
|
[[fallthrough]];
|
||||||
|
|
||||||
|
BeginState(WaitForInterrupt):
|
||||||
|
// Spin in place until an interrupt arrives.
|
||||||
captured_interrupt_level_ = bus_interrupt_level_;
|
captured_interrupt_level_ = bus_interrupt_level_;
|
||||||
if(status_.would_accept_interrupt(captured_interrupt_level_)) {
|
if(status_.would_accept_interrupt(captured_interrupt_level_)) {
|
||||||
MoveToStateSpecific(DoInterrupt);
|
MoveToStateSpecific(DoInterrupt);
|
||||||
}
|
}
|
||||||
MoveToStateSpecific(STOP);
|
IdleBus(1);
|
||||||
|
CheckOverrun();
|
||||||
|
MoveToStateSpecific(WaitForInterrupt);
|
||||||
|
|
||||||
// Perform the RESET exception, which seeds the stack pointer and program
|
// Perform the RESET exception, which seeds the stack pointer and program
|
||||||
// counter, populates the prefetch queue, and then moves to instruction dispatch.
|
// counter, populates the prefetch queue, and then moves to instruction dispatch.
|
||||||
@ -587,8 +595,12 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor
|
|||||||
if(vpa_) {
|
if(vpa_) {
|
||||||
temporary_value_.b = uint8_t(InstructionSet::M68k::Exception::InterruptAutovectorBase - 1 + captured_interrupt_level_);
|
temporary_value_.b = uint8_t(InstructionSet::M68k::Exception::InterruptAutovectorBase - 1 + captured_interrupt_level_);
|
||||||
}
|
}
|
||||||
|
if(berr_) {
|
||||||
|
temporary_value_.b = uint8_t(InstructionSet::M68k::Exception::SpuriousInterrupt);
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: if bus error is set, treat interrupt as spurious.
|
// TODO: check documentation for other potential interrupt outcomes;
|
||||||
|
// and presumably spin here if DTACK isn't implicit.
|
||||||
|
|
||||||
IdleBus(3); // n- n
|
IdleBus(3); // n- n
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user