1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-12-21 23:29:16 +00:00

Handle all phase cases (zero and non-zero)

This commit is contained in:
Peter Evans 2018-02-04 01:11:30 -06:00
parent 2752d82044
commit 463a9ba268

View File

@ -185,9 +185,13 @@ apple2_dd_phaser(apple2dd *drive)
// We only want to respond to adjacent phases, so if the last phase
// shifted in _any_ direction is not equal to the phase state, then
// we should do nothing.
if (phase != (last << 1) ||
phase != (last >> 1)
) {
if (phase != 0 && (phase << 1) != last && (phase >> 1) != last) {
return;
}
// The above check works for non-zero phases, but for zero phases,
// the logic is a bit different.
if (phase == 0 && last != 0x1 && last != 0x8) {
return;
}