diff options
| author | JosJuice <josjuice@gmail.com> | 2021-10-24 21:06:59 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2021-10-30 23:24:37 +0200 |
| commit | 22a1f3422cd99fd88c2671d05955a4860dc6e959 (patch) | |
| tree | 210224d22522fbc72f4af5c2567e7c520f44ce7a /Source/Android/jni/AndroidCommon/IDCache.cpp | |
| parent | 34021b5ebc8d13478058e63b3d67cc1fccb9de29 (diff) | |
Android: Add Riivolution patch configuration
Diffstat (limited to 'Source/Android/jni/AndroidCommon/IDCache.cpp')
| -rw-r--r-- | Source/Android/jni/AndroidCommon/IDCache.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/Android/jni/AndroidCommon/IDCache.cpp b/Source/Android/jni/AndroidCommon/IDCache.cpp index d0a7710e1a..a5a52a4f36 100644 --- a/Source/Android/jni/AndroidCommon/IDCache.cpp +++ b/Source/Android/jni/AndroidCommon/IDCache.cpp @@ -70,6 +70,9 @@ static jclass s_patch_cheat_class; static jfieldID s_patch_cheat_pointer; static jmethodID s_patch_cheat_constructor; +static jclass s_riivolution_patches_class; +static jfieldID s_riivolution_patches_pointer; + namespace IDCache { JNIEnv* GetEnvForThread() @@ -325,6 +328,16 @@ jmethodID GetPatchCheatConstructor() return s_patch_cheat_constructor; } +jclass GetRiivolutionPatchesClass() +{ + return s_riivolution_patches_class; +} + +jfieldID GetRiivolutionPatchesPointer() +{ + return s_riivolution_patches_pointer; +} + } // namespace IDCache extern "C" { @@ -454,6 +467,13 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) s_patch_cheat_constructor = env->GetMethodID(patch_cheat_class, "<init>", "(J)V"); env->DeleteLocalRef(patch_cheat_class); + const jclass riivolution_patches_class = + env->FindClass("org/dolphinemu/dolphinemu/features/riivolution/model/RiivolutionPatches"); + s_riivolution_patches_class = + reinterpret_cast<jclass>(env->NewGlobalRef(riivolution_patches_class)); + s_riivolution_patches_pointer = env->GetFieldID(riivolution_patches_class, "mPointer", "J"); + env->DeleteLocalRef(riivolution_patches_class); + return JNI_VERSION; } @@ -477,5 +497,6 @@ JNIEXPORT void JNI_OnUnload(JavaVM* vm, void* reserved) env->DeleteGlobalRef(s_ar_cheat_class); env->DeleteGlobalRef(s_gecko_cheat_class); env->DeleteGlobalRef(s_patch_cheat_class); + env->DeleteGlobalRef(s_riivolution_patches_class); } } |
