From 01f7394f7f17581a9fcacceb3308b5c2a2f155d5 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 30 May 2017 20:58:07 -0400 Subject: [PATCH] Corrected 6502 scheduling when flushing the pipeline. --- Processors/6502/6502.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Processors/6502/6502.hpp b/Processors/6502/6502.hpp index 2d3247c3a..80a288fd1 100644 --- a/Processors/6502/6502.hpp +++ b/Processors/6502/6502.hpp @@ -564,6 +564,7 @@ template class Processor: public MicroOpScheduler { #define checkSchedule(op) \ if(!scheduled_program_counter_) {\ + schedule_programs_read_pointer_ = schedule_programs_write_pointer_ = 0; \ if(interrupt_requests_) {\ if(interrupt_requests_ & (InterruptRequestFlags::Reset | InterruptRequestFlags::PowerOn)) {\ interrupt_requests_ &= ~InterruptRequestFlags::PowerOn;\ @@ -707,7 +708,7 @@ template class Processor: public MicroOpScheduler { if(jam_handler_) { 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; @@ -1145,6 +1146,7 @@ template class Processor: public MicroOpScheduler { if(is_jammed_) { scheduled_programs_[0] = scheduled_programs_[1] = scheduled_programs_[2] = scheduled_programs_[3] = nullptr; + scheduled_program_counter_ = nullptr; } }