From 6d4095abdf7efeb3ca3b31ab9477c09cbb2a277f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=2EMS/=E7=8E=8B=E4=BA=AC?= Date: Mon, 2 Dec 2013 03:28:20 +0800 Subject: [PATCH] Disable vertex jit on jailed iOS devices --- Core/Config.cpp | 10 +++++++--- UI/GameSettingsScreen.cpp | 4 ++-- UI/NativeApp.cpp | 2 +- ios/ViewController.mm | 7 +++---- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index d9b22d73ff..cd53ed2fee 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -41,7 +41,7 @@ http::Downloader g_DownloadManager; Config g_Config; #ifdef IOS -extern bool isJailed; +extern bool iosCanUseJit; #endif Config::Config() { } @@ -131,7 +131,7 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) { IniFile::Section *cpu = iniFile.GetOrCreateSection("CPU"); #ifdef IOS - cpu->Get("Jit", &bJit, !isJailed); + cpu->Get("Jit", &bJit, iosCanUseJit); #else cpu->Get("Jit", &bJit, true); #endif @@ -179,8 +179,12 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) { iAnisotropyLevel = 4; } graphics->Get("VertexCache", &bVertexCache, true); +#ifdef IOS + graphics->Get("VertexDecJit", &bVertexDecoderJit, iosCanUseJit); +#else graphics->Get("VertexDecJit", &bVertexDecoderJit, true); - +#endif + #ifdef _WIN32 graphics->Get("FullScreen", &bFullScreen, false); #endif diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 413825acb8..ef3222d437 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -48,7 +48,7 @@ namespace MainWindow { } #endif #ifdef IOS -extern bool isJailed; +extern bool iosCanUseJit; #endif static const int alternateSpeedTable[9] = { @@ -507,7 +507,7 @@ void DeveloperToolsScreen::CreateViews() { list->Add(new ItemHeader(s->T("General"))); #ifdef IOS - if (isJailed) { + if (!iosCanUseJit) { list->Add(new TextView(s->T("DynarecisJailed", "Dynarec (JIT) - (Not jailbroken - JIT not available)"))); } else { list->Add(new CheckBox(&g_Config.bJit, s->T("Dynarec", "Dynarec (JIT)"))); diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index ed9a615047..1110614194 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -100,7 +100,7 @@ std::string config_filename; std::string game_title; #ifdef IOS -bool isJailed; +bool iosCanUseJit; #endif // Really need to clean this mess of globals up... but instead I add more :P diff --git a/ios/ViewController.mm b/ios/ViewController.mm index 6201970f32..96310891d4 100644 --- a/ios/ViewController.mm +++ b/ios/ViewController.mm @@ -33,7 +33,7 @@ extern ScreenManager *screenManager; InputState input_state; extern std::string ram_temp_file; -extern bool isJailed; +extern bool iosCanUseJit; ViewController* sharedViewController; @@ -70,8 +70,7 @@ ViewController* sharedViewController; ram_temp_file = [[NSTemporaryDirectory() stringByAppendingPathComponent:@"ram_tmp.file"] fileSystemRepresentation]; NativeInit(0, NULL, [self.documentsPath UTF8String], [self.bundlePath UTF8String], NULL); - - isJailed = true; + iosCanUseJit = false; NSArray *jailPath = [NSArray arrayWithObjects: @"/Applications/Cydia.app", @@ -83,7 +82,7 @@ ViewController* sharedViewController; for(NSString *string in jailPath) { if ([[NSFileManager defaultManager] fileExistsAtPath:string]) - isJailed = false; + iosCanUseJit = true; } iCadeToKeyMap[iCadeJoystickUp] = NKCODE_DPAD_UP;