Permalink
Browse files

Hack to temporarily fix issues with resuming on x86 Marshmallow.

  • Loading branch information...
nicklauslittle authored and fzurita committed Jan 24, 2016
1 parent ad08b06 commit eee4ede475b4ac1ec5e5e65ef258932a05f17d8a
@@ -22,6 +22,8 @@
import java.io.File;
import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;
import org.mupen64plusae.v3.alpha.R;
@@ -344,7 +346,24 @@ public void onStateCallback( int paramChanged, int newValue )
&& saveToLoad != null)
{
removeOnStateCallbackListener( this );
NativeExports.emuLoadFile( saveToLoad );
if( sAppData.useX86PicLibrary )
{
// This is a hack to get "Resume" to work on x86 with the old
// dynamic recompiler. Remove it once the new dynamic recompiler
// works on x86 Marshmallow and later.
new Timer("Resume Game").schedule(
new TimerTask()
{
@Override
public void run()
{
NativeExports.emuLoadFile( saveToLoad );
}
}, 1000);
}
else
NativeExports.emuLoadFile( saveToLoad );
sActivity.runOnUiThread(new Runnable()
{
@@ -127,6 +127,9 @@
/** The directory for temporary files. Contents deleted on uninstall. */
public final String tempDir;
/** True if using x86 on Marshmallow or later. */
public final boolean useX86PicLibrary;
/** The directory containing the native Mupen64Plus libraries. Contents deleted on uninstall, not accessible without root. */
public final String libsDir;
@@ -244,7 +247,9 @@ public AppData( Context context )
String arch = System.getProperty("os.arch");
// Check for x86, ignore 'arch64' or 'x86_64' for now
if( arch.equals( "i686" ) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M )
useX86PicLibrary = arch.equals( "i686" ) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
if (useX86PicLibrary)
coreLib = libsDir + "/libmupen64plus-core-pic.so";
else
coreLib = libsDir + "/libmupen64plus-core.so";

0 comments on commit eee4ede

Please sign in to comment.