예제 #1
0
static bool CC_server(const UTF8 *arg)
{
 char server[300];
 unsigned int port = 0;

 server[0] = 0;

 switch(trio_sscanf((char*)arg, "%.299s %u", server, &port))
 {
  default:
  case 0:
	break;

  case 1:
	MDFNI_SetSetting("netplay.host", (char*)server);
	break;

  case 2:
	MDFNI_SetSetting("netplay.host", (char*)server);
	MDFNI_SetSettingUI("netplay.port", port);
	break;
 }

 MDFND_NetworkConnect();

 return(false);
}
예제 #2
0
파일: main.cpp 프로젝트: ben401/OpenEmu
int LoadGame(const char *path)
{
	MDFNGI *tmp;

	CloseGame();

	pending_save_state = 0;
	pending_save_movie = 0;
	pending_snapshot = 0;

	#ifdef NEED_CDEMU
	if(loadcd)
	{
	 if(!(tmp = MDFNI_LoadCD(loadcd, path)))
		return(0);
	}
	else
	#endif
	{
         if(!(tmp=MDFNI_LoadGame(path)))
	  return 0;
	}
	CurGame = tmp;
	InitGameInput(tmp);

        RefreshThrottleFPS(1);

        SDL_mutexP(VTMutex);
        NeedVideoChange = -1;
        SDL_mutexV(VTMutex);

        if(SDL_ThreadID() != MainThreadID)
          while(NeedVideoChange)
	  {
           SDL_Delay(1);
	  }
	sound_active = 0;

	if(MDFN_GetSettingB("sound"))
	 sound_active = InitSound(tmp);

        if(MDFN_GetSettingB("autosave"))
	 MDFNI_LoadState(NULL, "ncq");

	if(netconnect)
	 MDFND_NetworkConnect();

	GameThreadRun = 1;
	GameThread = SDL_CreateThread(GameLoop, NULL);

	ffnosound = MDFN_GetSettingB("ffnosound");
	return 1;
}