Added some code for PIO and AY support