Rebasing of Libretro Mednafen - tries to be more upstreamable