This will allow error reporting before attempting to load GUI
This commit is contained in:
parent
17b1d51f4b
commit
f5586ba47f
|
@ -205,12 +205,15 @@ void dc_term()
|
||||||
plugins_Term();
|
plugins_Term();
|
||||||
_vmem_release();
|
_vmem_release();
|
||||||
|
|
||||||
|
#ifndef _ANDROID
|
||||||
SaveSettings();
|
SaveSettings();
|
||||||
|
#endif
|
||||||
SaveRomFiles(GetPath("/data/"));
|
SaveRomFiles(GetPath("/data/"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadSettings()
|
void LoadSettings()
|
||||||
{
|
{
|
||||||
|
#ifndef _ANDROID
|
||||||
settings.dynarec.Enable = cfgLoadInt("config","Dynarec.Enabled", 1)!=0;
|
settings.dynarec.Enable = cfgLoadInt("config","Dynarec.Enabled", 1)!=0;
|
||||||
settings.dynarec.idleskip = cfgLoadInt("config","Dynarec.idleskip",1)!=0;
|
settings.dynarec.idleskip = cfgLoadInt("config","Dynarec.idleskip",1)!=0;
|
||||||
settings.dynarec.unstable_opt = cfgLoadInt("config","Dynarec.unstable-opt",0);
|
settings.dynarec.unstable_opt = cfgLoadInt("config","Dynarec.unstable-opt",0);
|
||||||
|
@ -227,6 +230,7 @@ void LoadSettings()
|
||||||
|
|
||||||
settings.pvr.ta_skip = cfgLoadInt("config","ta.skip",0);
|
settings.pvr.ta_skip = cfgLoadInt("config","ta.skip",0);
|
||||||
settings.pvr.rend = cfgLoadInt("config","pvr.rend",0);
|
settings.pvr.rend = cfgLoadInt("config","pvr.rend",0);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (HOST_OS != OS_LINUX || defined(_ANDROID) || defined(TARGET_PANDORA))
|
#if (HOST_OS != OS_LINUX || defined(_ANDROID) || defined(TARGET_PANDORA))
|
||||||
settings.aica.BufferSize=2048;
|
settings.aica.BufferSize=2048;
|
||||||
|
|
|
@ -71,16 +71,25 @@ public class MainActivity extends SlidingFragmentActivity implements
|
||||||
};
|
};
|
||||||
Thread.setDefaultUncaughtExceptionHandler(mUEHandler);
|
Thread.setDefaultUncaughtExceptionHandler(mUEHandler);
|
||||||
|
|
||||||
|
home_directory = mPrefs.getString("home_directory", home_directory);
|
||||||
|
|
||||||
String prior_error = mPrefs.getString("prior_error", null);
|
String prior_error = mPrefs.getString("prior_error", null);
|
||||||
if (prior_error != null && !prior_error.equals(null)) {
|
if (prior_error != null && !prior_error.equals(null)) {
|
||||||
initiateReport(prior_error);
|
initiateReport(prior_error, savedInstanceState);
|
||||||
mPrefs.edit().remove("prior_error").commit();
|
mPrefs.edit().remove("prior_error").commit();
|
||||||
|
} else {
|
||||||
|
loadInterface(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
home_directory = mPrefs.getString("home_directory", home_directory);
|
|
||||||
JNIdc.config(home_directory);
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadInterface(Bundle savedInstanceState) {
|
||||||
|
if (!getFilesDir().exists()) {
|
||||||
getFilesDir().mkdir();
|
getFilesDir().mkdir();
|
||||||
|
}
|
||||||
|
JNIdc.config(home_directory);
|
||||||
|
|
||||||
// Check that the activity is using the layout version with
|
// Check that the activity is using the layout version with
|
||||||
// the fragment_container FrameLayout
|
// the fragment_container FrameLayout
|
||||||
|
@ -261,17 +270,16 @@ public class MainActivity extends SlidingFragmentActivity implements
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
System.gc();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initiateReport(final String error) {
|
private void initiateReport(final String error, final Bundle savedInstanceState) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
|
||||||
builder.setTitle(getString(R.string.report_issue));
|
builder.setTitle(getString(R.string.report_issue));
|
||||||
builder.setMessage(error);
|
builder.setMessage(error);
|
||||||
builder.setNegativeButton("Cancel",
|
builder.setNegativeButton("Cancel",
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
loadInterface(savedInstanceState);
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue