return emuWriteState((char *)file);
char * p = strrchr(filename,'\\'); if(p) p++; else p = filename; char * saveDir = regQueryStringValue("saveDir", NULL);  if(!saveDir) saveDir = getDirFromFile(filename);  if(isDriveRoot(saveDir)) sprintf(szFile, "%s%s%d.sgm", saveDir, p, num); else sprintf(szFile, "%s\\%s%d.sgm", saveDir, p, num);  bool res = writeSaveGame(szFile);  sprintf(winBuffer, winResLoadString(IDS_WROTE_STATE_N), num); systemScreenMessage(winBuffer);  return res;
bool writeSaveGame(const char *file){  return emuWriteState((char *)file);}