Max frameskip as 8 and code cleanup
Fix divide by 0 bug
Merge pull request #2907 from raven02/patch-2

FBO to memory : Llimit frameskip to 8 and code cleanup