Android: Add Riivolution patch configuration

This commit is contained in:
JosJuice 2021-10-24 21:06:59 +02:00
parent 34021b5ebc
commit 22a1f3422c
13 changed files with 594 additions and 2 deletions

View file

@ -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);
}
}