AY implementation by Alan Petrik - Factor 6