From 1bf797490b81320313664113d1a12c23e1c2d7dc Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Mon, 4 Dec 2017 23:20:55 +0000 Subject: [PATCH] Tidy the i8080 interrupt handling to be more like the Z80 implementation Signed-off-by: Adrian Conlon --- Intel8080/src/Intel8080.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Intel8080/src/Intel8080.cpp b/Intel8080/src/Intel8080.cpp index f730ac6..3aa319c 100644 --- a/Intel8080/src/Intel8080.cpp +++ b/Intel8080/src/Intel8080.cpp @@ -266,15 +266,14 @@ int EightBit::Intel8080::step() { ExecutingInstruction.fire(*this); resetCycles(); if (LIKELY(powered())) { - uint8_t instruction; - if (UNLIKELY(INT() && m_interruptEnable)) { + if (UNLIKELY(INT())) { INT() = false; - di(); - instruction = BUS().DATA(); - } else { - instruction = fetchByte(); + if (m_interruptEnable) { + di(); + return execute(BUS().DATA()); + } } - return execute(instruction); + return execute(fetchByte()); } return cycles(); }