1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 23:52:26 +00:00

Corrected 6502 scheduling when flushing the pipeline.

This commit is contained in:
Thomas Harte 2017-05-30 20:58:07 -04:00
parent 5aa8b03349
commit 01f7394f7f

View File

@ -564,6 +564,7 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
#define checkSchedule(op) \ #define checkSchedule(op) \
if(!scheduled_program_counter_) {\ if(!scheduled_program_counter_) {\
schedule_programs_read_pointer_ = schedule_programs_write_pointer_ = 0; \
if(interrupt_requests_) {\ if(interrupt_requests_) {\
if(interrupt_requests_ & (InterruptRequestFlags::Reset | InterruptRequestFlags::PowerOn)) {\ if(interrupt_requests_ & (InterruptRequestFlags::Reset | InterruptRequestFlags::PowerOn)) {\
interrupt_requests_ &= ~InterruptRequestFlags::PowerOn;\ interrupt_requests_ &= ~InterruptRequestFlags::PowerOn;\
@ -707,7 +708,7 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
if(jam_handler_) { if(jam_handler_) {
jam_handler_->processor_did_jam(this, pc_.full - 1); jam_handler_->processor_did_jam(this, pc_.full - 1);
checkSchedule(is_jammed_ = false; scheduled_program_counter_ = scheduled_programs_[schedule_programs_read_pointer_]); checkSchedule(is_jammed_ = false;);
} }
} continue; } continue;
@ -1145,6 +1146,7 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
if(is_jammed_) { if(is_jammed_) {
scheduled_programs_[0] = scheduled_programs_[1] = scheduled_programs_[2] = scheduled_programs_[3] = nullptr; scheduled_programs_[0] = scheduled_programs_[1] = scheduled_programs_[2] = scheduled_programs_[3] = nullptr;
scheduled_program_counter_ = nullptr;
} }
} }