Z80: Better interrupt timing response.

This commit is contained in:
Adrian Conlon 2020-12-27 15:45:14 +00:00
parent 28ae32b8a2
commit 778aacaef6

View File

@ -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: