JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_init(JNIEnv *env,jobject obj,jstring fileName) { // Get filename string from Java const char* P = fileName? env->GetStringUTFChars(fileName,0):0; if(!P) CurFileName[0] = '\0'; else { printf("Got URI: '%s'\n",P); strncpy(CurFileName,(strlen(P)>=7)&&!memcmp(P,"file://",7)? P+7:P,sizeof(CurFileName)); CurFileName[sizeof(CurFileName)-1] = '\0'; env->ReleaseStringUTFChars(fileName,P); } printf("Opening file: '%s'\n",CurFileName); // Initialize platform-specific stuff common_linux_setup(); // Set configuration settings.profile.run_counts = 0; /* // Start native thread pthread_attr_init(&PTAttr); pthread_attr_setdetachstate(&PTAttr,PTHREAD_CREATE_DETACHED); pthread_create(&PThread,&PTAttr,ThreadHandler,CurFileName); pthread_attr_destroy(&PTAttr); */ ThreadHandler(CurFileName); }
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; }
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; }
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; }