Reimplement cputest.c for libretro