Introduce a one clock delay on ENAM. Fixes Midnight Magic.

This commit is contained in:
Christian Speckner 2017-01-20 01:02:52 +01:00
parent 6bb64d55e2
commit d521a230bd
1 changed files with 13 additions and 4 deletions

View File

@ -44,6 +44,7 @@ enum Delay: uInt8 {
hmclr = 2,
refp = 1,
enabl = 1,
enam = 1,
vblank = 1
};
@ -449,13 +450,11 @@ bool TIA::poke(uInt16 address, uInt8 value)
}
case ENAM0:
myLinesSinceChange = 0;
myMissile0.enam(value);
myDelayQueue.push(ENAM0, value, Delay::enam);
break;
case ENAM1:
myLinesSinceChange = 0;
myMissile1.enam(value);
myDelayQueue.push(ENAM1, value, Delay::enam);
break;
case RESM0:
@ -1237,6 +1236,16 @@ void TIA::delayedWrite(uInt8 address, uInt8 value)
myLinesSinceChange = 0;
myBall.enabl(value);
break;
case ENAM0:
myLinesSinceChange = 0;
myMissile0.enam(value);
break;
case ENAM1:
myLinesSinceChange = 0;
myMissile1.enam(value);
break;
}
}