libretro Win32 backport

For now we have to patch gemdos.c until we can get upstream to make the needed changes, the rest is all under libretro to keep things clean and simple.