new frame sync math
Merge pull request #1 from jart/master

New frame sync maths