Merge pull request #8152 from angelXwind/master

Various fixes related to iOS 9 and JIT config logic
This commit is contained in:
Henrik Rydgård 2015-11-03 20:47:57 +01:00
commit f6e826a767
5 changed files with 42 additions and 9 deletions

View File

@ -1728,6 +1728,7 @@ if(IOS)
XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "iPhone/iPad"
XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES
XCODE_ATTRIBUTE_ENABLE_BITCODE NO
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-"
)
endif()

View File

@ -47,6 +47,8 @@ http::Downloader g_DownloadManager;
Config g_Config;
bool jitForcedOff;
#ifdef IOS
extern bool iosCanUseJit;
#endif
@ -931,9 +933,19 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
if (g_Config.bAutoFrameSkip && g_Config.iRenderingMode == FB_NON_BUFFERED_MODE) {
g_Config.iRenderingMode = FB_BUFFERED_MODE;
}
// Override ppsspp.ini JIT value to prevent crashing
if (!DefaultJit() && g_Config.bJit) {
jitForcedOff = true;
g_Config.bJit = false;
}
}
void Config::Save() {
if (jitForcedOff) {
// if JIT has been forced off, we don't want to screw up the user's ppsspp.ini
g_Config.bJit = true;
}
if (iniFilename_.size() && g_Config.bSaveSettings) {
saveGameConfig(gameId_);
@ -1002,6 +1014,10 @@ void Config::Save() {
} else {
INFO_LOG(LOADER, "Not saving config");
}
if (jitForcedOff) {
// force JIT off again just in case Config::Save() is called without exiting PPSSPP
g_Config.bJit = false;
}
}
// Use for debugging the version check without messing with the server

View File

@ -64,6 +64,7 @@ using namespace std;
#ifdef IOS
extern bool iosCanUseJit;
extern bool targetIsJailbroken;
#endif
GameSettingsScreen::GameSettingsScreen(std::string gamePath, std::string gameID, bool editThenRestore)
@ -1024,7 +1025,11 @@ void DeveloperToolsScreen::CreateViews() {
#ifdef IOS
if (!iosCanUseJit) {
canUseJit = false;
list->Add(new TextView(sy->T("DynarecisJailed", "Dynarec (JIT) - (Not jailbroken - JIT not available)")));
if (targetIsJailbroken) {
list->Add(new TextView(sy->T("iOS9NoDynarec", "Dynarec (JIT) - (JIT temporarily unavailable on iOS 9)")));
} else {
list->Add(new TextView(sy->T("DynarecisJailed", "Dynarec (JIT) - (Not jailbroken - JIT not available)")));
}
}
#endif
if (canUseJit) {

View File

@ -126,6 +126,7 @@ std::string config_filename;
#ifdef IOS
bool iosCanUseJit;
bool targetIsJailbroken;
#endif
// Really need to clean this mess of globals up... but instead I add more :P

View File

@ -23,6 +23,10 @@
#define IS_IPAD() ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad)
#define IS_IPHONE() ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone)
#ifndef kCFCoreFoundationVersionNumber_IOS_9_0
#define kCFCoreFoundationVersionNumber_IOS_9_0 1240.10
#endif
float dp_xscale = 1.0f;
float dp_yscale = 1.0f;
@ -35,6 +39,7 @@ InputState input_state;
extern std::string ram_temp_file;
extern bool iosCanUseJit;
extern bool targetIsJailbroken;
ViewController* sharedViewController;
@ -73,17 +78,22 @@ ViewController* sharedViewController;
ram_temp_file = [[NSTemporaryDirectory() stringByAppendingPathComponent:@"ram_tmp.file"] fileSystemRepresentation];
iosCanUseJit = false;
targetIsJailbroken = false;
NSArray *jailPath = [NSArray arrayWithObjects:
@"/Applications/Cydia.app",
@"/private/var/lib/apt" ,
@"/private/var/stash" ,
@"/usr/sbin/sshd" ,
@"/usr/bin/sshd" , nil];
@"/private/var/lib/apt",
@"/private/var/stash",
@"/usr/sbin/sshd",
@"/usr/bin/sshd", nil];
for(NSString *string in jailPath)
{
if ([[NSFileManager defaultManager] fileExistsAtPath:string])
iosCanUseJit = true;
for (NSString *string in jailPath) {
if ([[NSFileManager defaultManager] fileExistsAtPath:string]) {
// checking device jailbreak status in order to determine which message to show in GameSettingsScreen
targetIsJailbroken = true;
if (kCFCoreFoundationVersionNumber < kCFCoreFoundationVersionNumber_IOS_9_0) {
iosCanUseJit = true;
}
}
}
NativeInit(0, NULL, [self.documentsPath UTF8String], [self.bundlePath UTF8String], NULL);