diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java b/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java index 5aa1075cde..8f8d935216 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java @@ -11,12 +11,11 @@ import android.content.Intent; import android.os.Bundle; import android.os.Environment; import android.util.Log; - -import java.io.*; - import org.dolphinemu.dolphinemu.gamelist.GameListActivity; import org.dolphinemu.dolphinemu.settings.UserPreferences; +import java.io.*; + /** * The main activity of this emulator. * diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java b/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java index 6b61393166..0af265697a 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java @@ -104,6 +104,22 @@ public final class NativeLibrary */ public static native String GetVersionString(); + /** + * Saves a game state to the slot number. + * + * @param slot The slot location to save state to. + */ + public static native void SaveState(int slot); + + /** + * Loads a game state from the slot number. + * + * @param slot The slot location to load state from. + */ + public static native void LoadState(int slot); + + + /** * Begins emulation. * diff --git a/Source/Core/DolphinWX/Src/MainAndroid.cpp b/Source/Core/DolphinWX/Src/MainAndroid.cpp index d5ff986841..065cddee8c 100644 --- a/Source/Core/DolphinWX/Src/MainAndroid.cpp +++ b/Source/Core/DolphinWX/Src/MainAndroid.cpp @@ -26,6 +26,7 @@ #include "CPUDetect.h" #include "Thread.h" +#include "State.h" #include "PowerPC/PowerPC.h" #include "HW/Wiimote.h" @@ -298,6 +299,16 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetDimension g_height = (int)_height; } +JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SaveState(JNIEnv *env, jobject obj, jint slot) +{ + State::Save(slot); +} + +JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_LoadState(JNIEnv *env, jobject obj, jint slot) +{ + State::Load(slot); +} + JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *env, jobject obj, jobject _surf) { surf = ANativeWindow_fromSurface(env, _surf);