From 778aacaef66315f39423a7c2b4176df34798bd6c Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Sun, 27 Dec 2020 15:45:14 +0000 Subject: [PATCH] Z80: Better interrupt timing response. --- Z80/src/Z80.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Z80/src/Z80.cpp b/Z80/src/Z80.cpp index 0b8c9b9..5072c38 100644 --- a/Z80/src/Z80.cpp +++ b/Z80/src/Z80.cpp @@ -114,23 +114,22 @@ void EightBit::Z80::handleNMI() { void EightBit::Z80::handleINT() { IntelProcessor::handleINT(); + tick(2); // 2 extra clock cycles introduced to allow the bus to settle uint8_t data; { _ActivateIORQ iorq(*this); data = readBusDataM1(); } di(); - tick(5); switch (IM()) { case 0: // i8080 equivalent IntelProcessor::execute(data); break; case 1: - tick(); restart(7 << 3); break; case 2: - tick(7); + tick(7); // How long to allow fetching data from the device... call(MEMPTR() = { data, IV() }); break; default: