コード例 #1
0
ファイル: main.cpp プロジェクト: lutris/reicast-emulator
int main(int argc, wchar* argv[])
{
    //if (argc==2)
        //ndcid=atoi(argv[1]);

    if (setup_curses() < 0) die("failed to setup curses!\n");
#ifdef TARGET_PANDORA
    signal(SIGSEGV, clean_exit);
    signal(SIGKILL, clean_exit);
#endif

#if defined(USES_HOMEDIR) && HOST_OS != OS_DARWIN
    string home = (string)getenv("HOME");
    if(home.c_str())
    {
        home += "/.reicast";
        mkdir(home.c_str(), 0755); // create the directory if missing
        SetHomeDir(home);
    }
    else
        SetHomeDir(".");
#else
    SetHomeDir(".");
#endif

 /* #if defined(SUPPORT_X11)
        x11_keymap[113] = DPad_Left;
        x11_keymap[114] = DPad_Right;

        x11_keymap[111] = DPad_Up;
        x11_keymap[116] = DPad_Down;

        x11_keymap[52] = Btn_Y;
        x11_keymap[53] = Btn_X;
        x11_keymap[54] = Btn_B;
        x11_keymap[55] = Btn_A;

        x11_keymap[36] = Btn_Start;
    #endif */

    printf("Home dir is: %s\n",GetPath("/").c_str());

    common_linux_setup();

    SetupInput();

    settings.profile.run_counts=0;

    dc_init(argc,argv);

    dc_run();

#ifdef TARGET_PANDORA
    clean_exit(0);
#endif

    return 0;
}
コード例 #2
0
ファイル: Android.cpp プロジェクト: hean01/reicast-emulator
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_config(JNIEnv *env,jobject obj,jstring dirName)
{
  // Set home directory based on User config
  const char* D = dirName? env->GetStringUTFChars(dirName,0):0;
  SetHomeDir(D);
  printf("Home dir is: '%s'\n",GetPath("/").c_str());
  env->ReleaseStringUTFChars(dirName,D);
}
コード例 #3
0
void SetupPath()
{
	char fname[512];
	GetModuleFileName(0,fname,512);
	string fn=string(fname);
	fn=fn.substr(0,fn.find_last_of('\\'));
	SetHomeDir(fn);
}
コード例 #4
0
ファイル: main.cpp プロジェクト: SerzhAK/reicast-emulator
int main(int argc, wchar* argv[])
{
	//if (argc==2) 
		//ndcid=atoi(argv[1]);

#if defined(USES_HOMEDIR)
	string home = (string)getenv("HOME");
	if(home.c_str())
	{
		home += "/.reicast";
		mkdir(home.c_str(), 0755); // create the directory if missing
		SetHomeDir(home);
	}
	else
		SetHomeDir(".");
#else
	SetHomeDir(".");
#endif

	printf("Home dir is: %s\n",GetPath("/").c_str());

	common_linux_setup();

	printf("common linux setup done\n");
	
	settings.profile.run_counts=0;
		
	dc_init(argc,argv);

	if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK|SDL_INIT_NOPARACHUTE)==-1)
	die("error initializing SDL");
	
	SetupInput();
	
	#ifdef USE_OSS	
		init_sound();
	#endif
	
	dc_run();
	
	clean_exit(0);

	return 0;
}
コード例 #5
0
ファイル: main.cpp プロジェクト: zenogears/reicast-emulator
int main(int argc, wchar* argv[])
{
  if (setup_curses() < 0)
  {
    printf("failed to setup curses!\n");
  }
  #ifdef TARGET_PANDORA
    signal(SIGSEGV, clean_exit);
    signal(SIGKILL, clean_exit);
  #endif

  /* Set home dir */
  string home = ".";
  #if defined(USES_HOMEDIR)
    if(getenv("HOME") != NULL)
    {
      home = (string)getenv("HOME") + "/.reicast";
      mkdir(home.c_str(), 0755); // create the directory if missing
    }
  #endif
  SetHomeDir(home);
  printf("Home dir is: %s\n", GetPath("/").c_str());

  #if defined(SUPPORT_X11)
    x11_keymap[113] = DPad_Left;
    x11_keymap[114] = DPad_Right;

    x11_keymap[111] = DPad_Up;
    x11_keymap[116] = DPad_Down;

    x11_keymap[52] = Btn_Y;
    x11_keymap[53] = Btn_X;
    x11_keymap[54] = Btn_B;
    x11_keymap[55] = Btn_A;

    /*
      //TODO: Fix sliders
      x11_keymap[38] = DPad_Down;
      x11_keymap[39] = DPad_Down;
    */

    x11_keymap[36] = Btn_Start;
  #endif

  common_linux_setup();

  SetupInput();

  settings.profile.run_counts=0;

  dc_init(argc,argv);

  #if !defined(TARGET_EMSCRIPTEN)
    dc_run();
  #else
    emscripten_set_main_loop(&dc_run, 100, false);
  #endif


  #ifdef TARGET_PANDORA
    clean_exit(0);
  #endif

  return 0;
}
コード例 #6
0
ファイル: pgfmain.c プロジェクト: professorbeautiful/oncotcap
int WINAPI DllMain( HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved )
{

	FILE *inputfile;
    char strTemp[5];
	char strTcap[9];
    DWORD varsize;

	void TrialSetup();
	switch (fdwReason)
	{
	/* No multiple thread support  */
	case DLL_THREAD_ATTACH :
	case DLL_THREAD_DETACH :
		break;

	/* When process begins open logfile, initialize most stuff by calling
	 infile with a default parameter file, set conditions  */
	case DLL_PROCESS_ATTACH :
		strcpy(strTemp,"TEMP");
		strcpy(strTcap,"TCAPHOME");
		
		if ((varsize = GetEnvironmentVariable(strTemp, WorkingDir, 255)) == 0)
			MsgBoxError("TEMP environment variable not set");
	
/*		if ((varsize = GetEnvironmentVariable(strTcap, ArchiveDir, 247)) == 0)
            MsgBoxError("TCAPHOME environment variable not set");
*/
/*		SetVersion(); */
		SetHomeDir();
		
		strcat(ArchiveDir, "\\archive");

		INFINITESIMAL = 1e-12;
		INFINITY = 1e12;

		//TrialSetup();
		strcpy (ofilname, WorkingDir);
		strcat (ofilname, "\\pgf.dat");
		if (( eout = fopen(ofilname,"w")) ==  NULL)
		{
			MessageBox(NULL,"ERROR: pgf.dat failed open","treat.dll",MB_ICONEXCLAMATION | MB_OK);
			return (FALSE);
		}
       
		strcpy (infilname, ArchiveDir);
		strcat (infilname, "\\default.par");

		if (( inputfile = fopen(infilname,"r")) == NULL )
		{
			fprintf(eout,"Error opening default.par\n");
			MsgBoxWarning("Can't open default.par");
			fclose ( eout );
			return (FALSE);
		}
		else
		{

			fprintf(eout,"Reading default parameters (PAR.PANEL)\n");

			infile ( inputfile );
			fclose ( inputfile );
		}
			
		nconds = 0;
		nenvlist = 0;
		nICrules = 0;
		incondition ( /* inputfile */ );

		//create event objects to use in syncronizing event and cell
		//queue operations

		SimRunning = False;
		EndSim = False;
		MEndSim = False;
		break;
	
	/*  When process terminates close the logfile.*/
	case DLL_PROCESS_DETACH :
		fclose( eout );
		break;
	}

	return TRUE;
}