From c5b746543b4bed849b8d14abfcfe154366a0250c Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 14 May 2020 00:09:01 -0400 Subject: [PATCH] Factors the half mask into steps count. --- Processors/Z80/State/State.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Processors/Z80/State/State.cpp b/Processors/Z80/State/State.cpp index 10f81ae44..bcba268f9 100644 --- a/Processors/Z80/State/State.cpp +++ b/Processors/Z80/State/State.cpp @@ -8,6 +8,8 @@ #include "State.hpp" +#include + using namespace CPU::Z80; State::State(const ProcessorBase &src): State() { @@ -88,10 +90,12 @@ State::State(const ProcessorBase &src): State() { } else { // There's no need to determine which opcode because that knowledge is already // contained in the dedicated opcode field. - Populate(Operation, current_instruction_page_->instructions[src.operation_]); + Populate(Operation, current_instruction_page_->instructions[src.operation_ & src.halt_mask_]); } } + assert(execution_state.steps_into_phase >= 0); + #undef Populate #undef ContainedBy }