implement serialization code correctly.
Merge branch 'master' of https://github.com/libretro/CATSFC-libretro