From 3df6eba237f41344f26a90837c6f21e4bd6c1516 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 5 Jun 2017 10:35:03 -0400 Subject: [PATCH] Fixed: my HALT line wasn't actually halting. NOPs followed, but the PC just kept counting. --- Processors/Z80/Z80.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Processors/Z80/Z80.hpp b/Processors/Z80/Z80.hpp index 3cb8db6cf..53cff7f37 100644 --- a/Processors/Z80/Z80.hpp +++ b/Processors/Z80/Z80.hpp @@ -803,7 +803,7 @@ template class Processor { break; case MicroOp::DecodeOperation: r_ = (r_ & 0x80) | ((r_ + current_instruction_page_->r_step) & 0x7f); - pc_.full += pc_increment_; + pc_.full += pc_increment_ & (uint16_t)halt_mask_; case MicroOp::DecodeOperationNoRChange: scheduled_program_counter_ = current_instruction_page_->instructions[operation_ & halt_mask_]; break;