diff options
Diffstat (limited to 'Source/Core/DolphinWX/MainAndroid.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/MainAndroid.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/MainAndroid.cpp b/Source/Core/DolphinWX/MainAndroid.cpp index 50aab79f45..44391f0ccd 100644 --- a/Source/Core/DolphinWX/MainAndroid.cpp +++ b/Source/Core/DolphinWX/MainAndroid.cpp @@ -43,6 +43,7 @@ #include "VideoCommon/OnScreenDisplay.h" #include "VideoCommon/VideoBackendBase.h" +#include "../DiscIO/Volume.h" ANativeWindow* surf; std::string g_filename; @@ -178,6 +179,23 @@ static bool IsWiiTitle(std::string filename) return false; } +static int GetCountry(std::string filename) +{ + std::unique_ptr<DiscIO::IVolume> pVolume(DiscIO::CreateVolumeFromFilename(filename)); + + if (pVolume != nullptr) + { + DiscIO::IVolume::ECountry country = pVolume->GetCountry(); + + __android_log_print(ANDROID_LOG_INFO, DOLPHIN_TAG, "Country Code: %i", country); + + return country; + } + + // Technically correct. + return 13; +} + static std::string GetTitle(std::string filename) { __android_log_print(ANDROID_LOG_WARN, DOLPHIN_TAG, "Getting Title for file: %s", filename.c_str()); @@ -330,6 +348,7 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onGamePadMov JNIEXPORT jintArray JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetBanner(JNIEnv *env, jobject obj, jstring jFile);JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetTitle(JNIEnv *env, jobject obj, jstring jFilename); JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetDescription(JNIEnv *env, jobject obj, jstring jFilename); JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetGameId(JNIEnv *env, jobject obj, jstring jFilename); +JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetCountry(JNIEnv *env, jobject obj, jstring jFilename); JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetDate(JNIEnv *env, jobject obj, jstring jFilename); JNIEXPORT jlong JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetFilesize(JNIEnv *env, jobject obj, jstring jFilename); JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_IsWiiTitle(JNIEnv *env, jobject obj, jstring jFilename); @@ -411,6 +430,13 @@ JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetDate(J return env->NewStringUTF(date.c_str()); } +JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetCountry(JNIEnv *env, jobject obj, jstring jFilename) +{ + std::string filename = GetJString(env, jFilename); + int country = GetCountry(filename); + return country; +} + JNIEXPORT jlong JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetFilesize(JNIEnv *env, jobject obj, jstring jFilename) { std::string filename = GetJString(env, jFilename); |
