From 2dfbfadf8218ac60a643cbc8a4c1091bd98ec35c Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 11 Mar 2023 00:46:34 -0800 Subject: android: frontend: Add unique error strings for Vulkan initialization errors. --- .../main/java/org/yuzu/yuzu_emu/NativeLibrary.java | 40 ++++++++++++---------- src/android/app/src/main/res/values/strings.xml | 4 +++ 2 files changed, 25 insertions(+), 19 deletions(-) (limited to 'src/android/app') diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.java b/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.java index 6f76c3f95..067e9938d 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.java +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.java @@ -508,26 +508,28 @@ public final class NativeLibrary { final int Success = 0; final int ErrorNotInitialized = 1; final int ErrorGetLoader = 2; - final int ErrorSystemMode = 3; - final int ErrorLoader = 4; - final int ErrorLoader_ErrorEncrypted = 5; - final int ErrorLoader_ErrorInvalidFormat = 6; - final int ErrorSystemFiles = 7; - final int ErrorVideoCore = 8; - final int ErrorVideoCore_ErrorGenericDrivers = 9; - final int ErrorVideoCore_ErrorBelowGL33 = 10; - final int ShutdownRequested = 11; - final int ErrorUnknown = 12; - - int captionId = R.string.loader_error_invalid_format; - if (resultCode == ErrorLoader_ErrorEncrypted) { - captionId = R.string.loader_error_encrypted; + final int ErrorSystemFiles = 3; + final int ErrorSharedFont = 4; + final int ErrorVideoCore = 5; + final int ErrorUnknown = 6; + final int ErrorLoader = 7; + + int captionId; + int descriptionId; + switch (resultCode) { + case ErrorVideoCore: + captionId = R.string.loader_error_video_core; + descriptionId = R.string.loader_error_video_core_description; + break; + default: + captionId = R.string.loader_error_encrypted; + descriptionId = R.string.loader_error_encrypted_roms_description; + if (!ReloadKeys()) { + descriptionId = R.string.loader_error_encrypted_keys_description; + } + break; } - String formatedText = "Please follow the guides to redump your game cartidges or installed titles."; - if (!ReloadKeys()) { - formatedText = "Please ensure your prod.keys file is installed so that games can be decrypted."; - } final EmulationActivity emulationActivity = sEmulationActivity.get(); if (emulationActivity == null) { Log.warning("[NativeLibrary] EmulationActivity is null, can't exit."); @@ -536,7 +538,7 @@ public final class NativeLibrary { AlertDialog.Builder builder = new AlertDialog.Builder(emulationActivity) .setTitle(captionId) - .setMessage(Html.fromHtml(formatedText, Html.FROM_HTML_MODE_LEGACY)) + .setMessage(Html.fromHtml(emulationActivity.getString(descriptionId), Html.FROM_HTML_MODE_LEGACY)) .setPositiveButton(android.R.string.ok, (dialog, whichButton) -> emulationActivity.finish()) .setOnDismissListener(dialogInterface -> emulationActivity.finish()); emulationActivity.runOnUiThread(() -> { diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index c5e6a4e27..aa0cef521 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -76,6 +76,10 @@ Your ROM is encrypted + game cartidges or installed titles.]]> + prod.keys file is installed so that games can be decrypted.]]> + An error occurred initializing the video core + This is usually caused by an incompatible GPU drivers. Installing a custom GPU driver may resolve this problem. Unable to load ROM -- cgit v1.2.3