WiiUtils: Add function to get current system menu version

This commit is contained in:
OatmealDome 2022-01-09 15:58:45 -05:00
parent 36257f7f42
commit 30d51348f9
2 changed files with 16 additions and 0 deletions

View File

@ -29,4 +29,6 @@ public final class WiiUtils
public static native int doOnlineUpdate(String region, WiiUpdateCallback callback);
public static native boolean isSystemMenuInstalled();
public static native String getSystemMenuVersion();
}

View File

@ -140,4 +140,18 @@ Java_org_dolphinemu_dolphinemu_utils_WiiUtils_isSystemMenuInstalled(JNIEnv* env,
return tmd.IsValid();
}
JNIEXPORT jstring JNICALL
Java_org_dolphinemu_dolphinemu_utils_WiiUtils_getSystemMenuVersion(JNIEnv* env, jclass)
{
IOS::HLE::Kernel ios;
const auto tmd = ios.GetES()->FindInstalledTMD(Titles::SYSTEM_MENU);
if (!tmd.IsValid())
{
return ToJString(env, "");
}
return ToJString(env, DiscIO::GetSysMenuVersionString(tmd.GetTitleVersion()));
}
}