void Java_org_yabause_android_YabauseRunnable_enableFrameskip( JNIEnv* env, jobject obj, jint enable ) { if (enable) EnableAutoFrameSkip(); else DisableAutoFrameSkip(); }
void Java_org_yabause_android_YabauseRunnable_deinit( JNIEnv* env ) { int slot = GetSaveSlot(); if (slot != -1) { const char * dirpath = GetSavesPath(); SetOSDToggle(0); DisableAutoFrameSkip(); g_swapped = 0; while(! g_swapped) YabauseExec(); YabSaveStateSlot(dirpath, slot); } YabauseDeInit(); }
extern "C" __declspec(dllexport) int libyabause_init ( CDInterface *_CD, const char *biosfn, int usegl, int carttype, int quickload, int clocksync, int clockbase ) { usinggl = usegl; if (usegl) { //headless cores should not create GL contexts, but use the one from the invoking frontend #ifndef HEADLESS if(!StartGLContext()) return 0; #endif if(!LoadExtensions()) return 0; } FECD.DeInit = _CD->DeInit; FECD.GetStatus = _CD->GetStatus; FECD.Init = _CD->Init; FECD.ReadAheadFAD = _CD->ReadAheadFAD; FECD.ReadSectorFAD = _CD->ReadSectorFAD; FECD.ReadTOC = _CD->ReadTOC; // only overwrite a few SNDDummy functions memcpy(&FESND, &SNDDummy, sizeof(FESND)); FESND.id = 2; FESND.Name = "FESND"; FESND.GetAudioSpace = FESNDGetAudioSpace; FESND.UpdateAudio = FESNDUpdateAudio; yabauseinit_struct yinit; memset(&yinit, 0, sizeof(yabauseinit_struct)); yinit.percoretype = PERCORE_DUMMY; yinit.sh2coretype = SH2CORE_INTERPRETER; if (usegl) yinit.vidcoretype = VIDCORE_OGL; else yinit.vidcoretype = VIDCORE_SOFT; yinit.sndcoretype = 2; //SNDCORE_DUMMY; yinit.cdcoretype = 2; // CDCORE_ISO; //CDCORE_DUMMY; yinit.m68kcoretype = M68KCORE_C68K; yinit.cartpath = CART_NONE; yinit.regionid = REGION_AUTODETECT; yinit.biospath = biosfn; yinit.cdpath = "Saturnus"; //NULL; yinit.buppath = NULL; yinit.mpegpath = NULL; yinit.carttype = carttype; yinit.netlinksetting = NULL; yinit.videoformattype = VIDEOFORMATTYPE_NTSC; yabsys.usequickload = quickload; yinit.usethreads = 0; yinit.frameskip = 0; yinit.clocksync = clocksync; yinit.basetime = clockbase; // same format as return from time(); 0 to use time() if (usegl && !vdp2hookfcn) { // hook vdp2setresolution vdp2hookfcn = VIDOGL.Vdp2SetResolution; VIDOGL.Vdp2SetResolution = vdp2newhook; } if (YabauseInit(&yinit) != 0) return 0; SpeedThrottleDisable(); DisableAutoFrameSkip(); ScspSetFrameAccurate(1); OSDChangeCore(OSDCORE_DUMMY); ctrl1 = PerPadAdd(&PORTDATA1); ctrl2 = PerPadAdd(&PORTDATA2); return 1; }
static void check_variables(void) { struct retro_variable var; var.key = "yabause_frameskip"; var.value = NULL; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { if (strcmp(var.value, "disabled") == 0 && frameskip_enable) { DisableAutoFrameSkip(); frameskip_enable = false; } else if (strcmp(var.value, "enabled") == 0 && !frameskip_enable) { EnableAutoFrameSkip(); frameskip_enable = true; } } var.key = "yabause_force_hle_bios"; var.value = NULL; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { if (strcmp(var.value, "disabled") == 0 && hle_bios_force) hle_bios_force = false; else if (strcmp(var.value, "enabled") == 0 && !hle_bios_force) hle_bios_force = true; } var.key = "yabause_addon_cart"; var.value = NULL; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { if (strcmp(var.value, "none") == 0 && addon_cart_type != CART_NONE) addon_cart_type = CART_NONE; else if (strcmp(var.value, "1M_ram") == 0 && addon_cart_type != CART_DRAM8MBIT) addon_cart_type = CART_DRAM8MBIT; else if (strcmp(var.value, "4M_ram") == 0 && addon_cart_type != CART_DRAM32MBIT) addon_cart_type = CART_DRAM32MBIT; } var.key = "yabause_numthreads"; var.value = NULL; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { if (strcmp(var.value, "1") == 0 && numthreads != 1) numthreads = 1; else if (strcmp(var.value, "2") == 0 && numthreads != 2) numthreads = 2; else if (strcmp(var.value, "4") == 0 && numthreads != 4) numthreads = 4; else if (strcmp(var.value, "8") == 0 && numthreads != 8) numthreads = 8; else if (strcmp(var.value, "16") == 0 && numthreads != 16) numthreads = 16; else if (strcmp(var.value, "32") == 0 && numthreads != 32) numthreads = 32; } }