Backport some patches http://github.com/libretro/fceu-next/commit/b2b1162bc46fe4f849c3373094339fb82609a71b