Merge pull request #282 from hwhw/master

Bug fixes, emulated screen flash
fix rotation with viewport