sfxr: fix bug for waveType == 0, add comments, fix some type