diff options
Diffstat (limited to 'src')
8 files changed, 33 insertions, 15 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt index f474a3873..6e39e542b 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt | |||
| @@ -247,7 +247,12 @@ object NativeLibrary { | |||
| 247 | 247 | ||
| 248 | external fun setAppDirectory(directory: String) | 248 | external fun setAppDirectory(directory: String) |
| 249 | 249 | ||
| 250 | external fun installFileToNand(filename: String): Int | 250 | /** |
| 251 | * Installs a nsp or xci file to nand | ||
| 252 | * @param filename String representation of file uri | ||
| 253 | * @param extension Lowercase string representation of file extension without "." | ||
| 254 | */ | ||
| 255 | external fun installFileToNand(filename: String, extension: String): Int | ||
| 251 | 256 | ||
| 252 | external fun initializeGpuDriver( | 257 | external fun initializeGpuDriver( |
| 253 | hookLibDir: String?, | 258 | hookLibDir: String?, |
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt index 4d2f2f604..ea26a21d0 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt | |||
| @@ -181,12 +181,14 @@ class SettingsActivity : AppCompatActivity() { | |||
| 181 | private fun setInsets() { | 181 | private fun setInsets() { |
| 182 | ViewCompat.setOnApplyWindowInsetsListener( | 182 | ViewCompat.setOnApplyWindowInsetsListener( |
| 183 | binding.navigationBarShade | 183 | binding.navigationBarShade |
| 184 | ) { view: View, windowInsets: WindowInsetsCompat -> | 184 | ) { _: View, windowInsets: WindowInsetsCompat -> |
| 185 | val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) | 185 | val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) |
| 186 | 186 | ||
| 187 | val mlpShade = view.layoutParams as MarginLayoutParams | 187 | // The only situation where we care to have a nav bar shade is when it's at the bottom |
| 188 | mlpShade.height = barInsets.bottom | 188 | // of the screen where scrolling list elements can go behind it. |
| 189 | view.layoutParams = mlpShade | 189 | val mlpNavShade = binding.navigationBarShade.layoutParams as MarginLayoutParams |
| 190 | mlpNavShade.height = barInsets.bottom | ||
| 191 | binding.navigationBarShade.layoutParams = mlpNavShade | ||
| 190 | 192 | ||
| 191 | windowInsets | 193 | windowInsets |
| 192 | } | 194 | } |
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt index 0cef6072b..0fa5df5e5 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt | |||
| @@ -528,7 +528,7 @@ class MainActivity : AppCompatActivity(), ThemeProvider { | |||
| 528 | if (documents.isNotEmpty()) { | 528 | if (documents.isNotEmpty()) { |
| 529 | IndeterminateProgressDialogFragment.newInstance( | 529 | IndeterminateProgressDialogFragment.newInstance( |
| 530 | this@MainActivity, | 530 | this@MainActivity, |
| 531 | R.string.install_game_content | 531 | R.string.installing_game_content |
| 532 | ) { | 532 | ) { |
| 533 | var installSuccess = 0 | 533 | var installSuccess = 0 |
| 534 | var installOverwrite = 0 | 534 | var installOverwrite = 0 |
| @@ -536,7 +536,12 @@ class MainActivity : AppCompatActivity(), ThemeProvider { | |||
| 536 | var errorExtension = 0 | 536 | var errorExtension = 0 |
| 537 | var errorOther = 0 | 537 | var errorOther = 0 |
| 538 | documents.forEach { | 538 | documents.forEach { |
| 539 | when (NativeLibrary.installFileToNand(it.toString())) { | 539 | when ( |
| 540 | NativeLibrary.installFileToNand( | ||
| 541 | it.toString(), | ||
| 542 | FileUtil.getExtension(it) | ||
| 543 | ) | ||
| 544 | ) { | ||
| 540 | NativeLibrary.InstallFileToNandResult.Success -> { | 545 | NativeLibrary.InstallFileToNandResult.Success -> { |
| 541 | installSuccess += 1 | 546 | installSuccess += 1 |
| 542 | } | 547 | } |
diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index 26666f59a..9fa082dd5 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp | |||
| @@ -104,7 +104,7 @@ public: | |||
| 104 | m_native_window = native_window; | 104 | m_native_window = native_window; |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | int InstallFileToNand(std::string filename) { | 107 | int InstallFileToNand(std::string filename, std::string file_extension) { |
| 108 | jconst copy_func = [](const FileSys::VirtualFile& src, const FileSys::VirtualFile& dest, | 108 | jconst copy_func = [](const FileSys::VirtualFile& src, const FileSys::VirtualFile& dest, |
| 109 | std::size_t block_size) { | 109 | std::size_t block_size) { |
| 110 | if (src == nullptr || dest == nullptr) { | 110 | if (src == nullptr || dest == nullptr) { |
| @@ -136,12 +136,12 @@ public: | |||
| 136 | m_system.GetFileSystemController().CreateFactories(*m_vfs); | 136 | m_system.GetFileSystemController().CreateFactories(*m_vfs); |
| 137 | 137 | ||
| 138 | [[maybe_unused]] std::shared_ptr<FileSys::NSP> nsp; | 138 | [[maybe_unused]] std::shared_ptr<FileSys::NSP> nsp; |
| 139 | if (filename.ends_with("nsp")) { | 139 | if (file_extension == "nsp") { |
| 140 | nsp = std::make_shared<FileSys::NSP>(m_vfs->OpenFile(filename, FileSys::Mode::Read)); | 140 | nsp = std::make_shared<FileSys::NSP>(m_vfs->OpenFile(filename, FileSys::Mode::Read)); |
| 141 | if (nsp->IsExtractedType()) { | 141 | if (nsp->IsExtractedType()) { |
| 142 | return InstallError; | 142 | return InstallError; |
| 143 | } | 143 | } |
| 144 | } else if (filename.ends_with("xci")) { | 144 | } else if (file_extension == "xci") { |
| 145 | jconst xci = | 145 | jconst xci = |
| 146 | std::make_shared<FileSys::XCI>(m_vfs->OpenFile(filename, FileSys::Mode::Read)); | 146 | std::make_shared<FileSys::XCI>(m_vfs->OpenFile(filename, FileSys::Mode::Read)); |
| 147 | nsp = xci->GetSecurePartitionNSP(); | 147 | nsp = xci->GetSecurePartitionNSP(); |
| @@ -609,8 +609,10 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_setAppDirectory(JNIEnv* env, jobject | |||
| 609 | } | 609 | } |
| 610 | 610 | ||
| 611 | int Java_org_yuzu_yuzu_1emu_NativeLibrary_installFileToNand(JNIEnv* env, jobject instance, | 611 | int Java_org_yuzu_yuzu_1emu_NativeLibrary_installFileToNand(JNIEnv* env, jobject instance, |
| 612 | [[maybe_unused]] jstring j_file) { | 612 | jstring j_file, |
| 613 | return EmulationSession::GetInstance().InstallFileToNand(GetJString(env, j_file)); | 613 | jstring j_file_extension) { |
| 614 | return EmulationSession::GetInstance().InstallFileToNand(GetJString(env, j_file), | ||
| 615 | GetJString(env, j_file_extension)); | ||
| 614 | } | 616 | } |
| 615 | 617 | ||
| 616 | void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeGpuDriver(JNIEnv* env, jclass clazz, | 618 | void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeGpuDriver(JNIEnv* env, jclass clazz, |
diff --git a/src/android/app/src/main/res/layout/activity_settings.xml b/src/android/app/src/main/res/layout/activity_settings.xml index 8a026a30a..a187665f2 100644 --- a/src/android/app/src/main/res/layout/activity_settings.xml +++ b/src/android/app/src/main/res/layout/activity_settings.xml | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | <View | 23 | <View |
| 24 | android:id="@+id/navigation_bar_shade" | 24 | android:id="@+id/navigation_bar_shade" |
| 25 | android:layout_width="match_parent" | 25 | android:layout_width="0dp" |
| 26 | android:layout_height="1px" | 26 | android:layout_height="1px" |
| 27 | android:background="@android:color/transparent" | 27 | android:background="@android:color/transparent" |
| 28 | android:clickable="false" | 28 | android:clickable="false" |
diff --git a/src/android/app/src/main/res/layout/fragment_emulation.xml b/src/android/app/src/main/res/layout/fragment_emulation.xml index da97d85c1..750ce094a 100644 --- a/src/android/app/src/main/res/layout/fragment_emulation.xml +++ b/src/android/app/src/main/res/layout/fragment_emulation.xml | |||
| @@ -32,7 +32,8 @@ | |||
| 32 | android:layout_width="wrap_content" | 32 | android:layout_width="wrap_content" |
| 33 | android:layout_height="wrap_content" | 33 | android:layout_height="wrap_content" |
| 34 | android:layout_gravity="center" | 34 | android:layout_gravity="center" |
| 35 | android:focusable="false"> | 35 | android:focusable="false" |
| 36 | android:clickable="false"> | ||
| 36 | 37 | ||
| 37 | <androidx.constraintlayout.widget.ConstraintLayout | 38 | <androidx.constraintlayout.widget.ConstraintLayout |
| 38 | android:id="@+id/loading_layout" | 39 | android:id="@+id/loading_layout" |
| @@ -155,7 +156,7 @@ | |||
| 155 | android:id="@+id/in_game_menu" | 156 | android:id="@+id/in_game_menu" |
| 156 | android:layout_width="wrap_content" | 157 | android:layout_width="wrap_content" |
| 157 | android:layout_height="match_parent" | 158 | android:layout_height="match_parent" |
| 158 | android:layout_gravity="start|bottom" | 159 | android:layout_gravity="start" |
| 159 | app:headerLayout="@layout/header_in_game" | 160 | app:headerLayout="@layout/header_in_game" |
| 160 | app:menu="@menu/menu_in_game" | 161 | app:menu="@menu/menu_in_game" |
| 161 | tools:visibility="gone" /> | 162 | tools:visibility="gone" /> |
diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 44845bfbf..21a40238c 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml | |||
| @@ -106,6 +106,7 @@ | |||
| 106 | <string name="share_log_missing">No log file found</string> | 106 | <string name="share_log_missing">No log file found</string> |
| 107 | <string name="install_game_content">Install game content</string> | 107 | <string name="install_game_content">Install game content</string> |
| 108 | <string name="install_game_content_description">Install game updates or DLC</string> | 108 | <string name="install_game_content_description">Install game updates or DLC</string> |
| 109 | <string name="installing_game_content">Installing content…</string> | ||
| 109 | <string name="install_game_content_failure">Error installing file(s) to NAND</string> | 110 | <string name="install_game_content_failure">Error installing file(s) to NAND</string> |
| 110 | <string name="install_game_content_failure_description">Please ensure content(s) are valid and that the prod.keys file is installed.</string> | 111 | <string name="install_game_content_failure_description">Please ensure content(s) are valid and that the prod.keys file is installed.</string> |
| 111 | <string name="install_game_content_failure_base">Installation of base games isn\'t permitted in order to avoid possible conflicts.</string> | 112 | <string name="install_game_content_failure_base">Installation of base games isn\'t permitted in order to avoid possible conflicts.</string> |
diff --git a/src/common/settings_setting.h b/src/common/settings_setting.h index 7be6f26f7..3175ab07d 100644 --- a/src/common/settings_setting.h +++ b/src/common/settings_setting.h | |||
| @@ -187,6 +187,8 @@ public: | |||
| 187 | this->SetValue(input == "true"); | 187 | this->SetValue(input == "true"); |
| 188 | } else if constexpr (std::is_same_v<Type, float>) { | 188 | } else if constexpr (std::is_same_v<Type, float>) { |
| 189 | this->SetValue(std::stof(input)); | 189 | this->SetValue(std::stof(input)); |
| 190 | } else if constexpr (std::is_same_v<Type, AudioEngine>) { | ||
| 191 | this->SetValue(ToEnum<AudioEngine>(input)); | ||
| 190 | } else { | 192 | } else { |
| 191 | this->SetValue(static_cast<Type>(std::stoll(input))); | 193 | this->SetValue(static_cast<Type>(std::stoll(input))); |
| 192 | } | 194 | } |