summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.codespellrc4
-rw-r--r--.gitignore2
-rw-r--r--.gitmodules3
-rw-r--r--CMakeLists.txt2
-rw-r--r--externals/CMakeLists.txt6
-rw-r--r--externals/nx_tzdb/CMakeLists.txt101
-rw-r--r--externals/nx_tzdb/ListFilesInDirectory.cmake8
-rw-r--r--externals/nx_tzdb/NxTzdbCreateHeader.cmake46
-rw-r--r--externals/nx_tzdb/include/nx_tzdb.h27
-rw-r--r--externals/nx_tzdb/tzdb_template.h.in18
m---------externals/nx_tzdb/tzdb_to_nx0
m---------externals/vcpkg0
-rw-r--r--src/android/app/build.gradle.kts73
-rw-r--r--src/android/app/src/main/AndroidManifest.xml6
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt56
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/YuzuApplication.kt10
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt205
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/GameAdapter.kt13
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/HomeSettingAdapter.kt11
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/applets/keyboard/SoftwareKeyboard.kt29
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/disk_shader_cache/DiskShaderCacheProgress.kt5
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/disk_shader_cache/ui/ShaderProgressDialogFragment.kt4
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/DocumentProvider.kt89
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt5
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/IntSetting.kt12
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/Settings.kt7
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/StringSetting.kt1
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/HeaderSetting.kt8
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SingleChoiceSetting.kt1
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SliderSetting.kt6
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/StringSingleChoiceSetting.kt21
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SubmenuSetting.kt2
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt37
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivityPresenter.kt12
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsAdapter.kt3
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragment.kt9
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt104
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/DateTimeViewHolder.kt8
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SingleChoiceViewHolder.kt8
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SwitchSettingViewHolder.kt2
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/utils/SettingsFile.kt35
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/AboutFragment.kt10
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EarlyAccessFragment.kt10
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt242
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt172
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/ImportExportSavesFragment.kt27
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/IndeterminateProgressDialogFragment.kt1
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/LicensesFragment.kt4
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SearchFragment.kt27
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt23
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/layout/AutofitGridLayoutManager.kt4
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/model/Game.kt26
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/model/GamesViewModel.kt16
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt345
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlayDrawableDpad.kt5
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlayDrawableJoystick.kt28
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt8
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt104
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ControllerMappingHelper.kt4
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DirectoryInitialization.kt2
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DocumentsTree.kt17
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/EmulationMenuSettings.kt18
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/FileUtil.kt26
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ForegroundService.kt2
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GameHelper.kt6
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GpuDriverHelper.kt6
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GpuDriverMetadata.kt4
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt19
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InsetsHelper.kt12
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/NfcReader.kt21
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/SerializableHelper.kt20
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ThemeHelper.kt14
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt6
-rw-r--r--src/android/app/src/main/jni/config.cpp8
-rw-r--r--src/android/app/src/main/jni/default_ini.h6
-rw-r--r--src/android/app/src/main/jni/native.cpp153
-rw-r--r--src/android/app/src/main/res/drawable/ic_pip_pause.xml9
-rw-r--r--src/android/app/src/main/res/drawable/ic_pip_play.xml9
-rw-r--r--src/android/app/src/main/res/drawable/ic_system_update_alt.xml9
-rw-r--r--src/android/app/src/main/res/layout/activity_emulation.xml16
-rw-r--r--src/android/app/src/main/res/layout/fragment_emulation.xml82
-rw-r--r--src/android/app/src/main/res/layout/list_item_setting_switch.xml55
-rw-r--r--src/android/app/src/main/res/layout/list_item_settings_header.xml28
-rw-r--r--src/android/app/src/main/res/navigation/emulation_navigation.xml18
-rw-r--r--src/android/app/src/main/res/navigation/home_navigation.xml14
-rw-r--r--src/android/app/src/main/res/values-de/strings.xml332
-rw-r--r--src/android/app/src/main/res/values-es/strings.xml337
-rw-r--r--src/android/app/src/main/res/values-fr/strings.xml337
-rw-r--r--src/android/app/src/main/res/values-it/strings.xml337
-rw-r--r--src/android/app/src/main/res/values-ja/strings.xml335
-rw-r--r--src/android/app/src/main/res/values-ko/strings.xml337
-rw-r--r--src/android/app/src/main/res/values-nb/strings.xml337
-rw-r--r--src/android/app/src/main/res/values-pl/strings.xml337
-rw-r--r--src/android/app/src/main/res/values-pt-rBR/strings.xml337
-rw-r--r--src/android/app/src/main/res/values-pt-rPT/strings.xml337
-rw-r--r--src/android/app/src/main/res/values-ru/strings.xml337
-rw-r--r--src/android/app/src/main/res/values-uk/strings.xml337
-rw-r--r--src/android/app/src/main/res/values-zh-rCN/strings.xml337
-rw-r--r--src/android/app/src/main/res/values-zh-rTW/strings.xml336
-rw-r--r--src/android/app/src/main/res/values/arrays.xml23
-rw-r--r--src/android/app/src/main/res/values/integers.xml64
-rw-r--r--src/android/app/src/main/res/values/strings.xml50
-rw-r--r--src/android/app/src/main/res/xml/locales_config.xml17
-rw-r--r--src/android/build.gradle.kts9
-rw-r--r--src/audio_core/audio_core.cpp8
-rw-r--r--src/audio_core/audio_core.h14
-rw-r--r--src/common/fs/fs.cpp27
-rw-r--r--src/common/fs/fs_android.h5
-rw-r--r--src/common/fs/fs_paths.h1
-rw-r--r--src/common/fs/path_util.cpp1
-rw-r--r--src/common/fs/path_util.h1
-rw-r--r--src/common/settings.cpp32
-rw-r--r--src/common/settings.h2
-rw-r--r--src/common/time_zone.cpp63
-rw-r--r--src/common/time_zone.h6
-rw-r--r--src/common/uuid.cpp2
-rw-r--r--src/core/CMakeLists.txt11
-rw-r--r--src/core/arm/arm_interface.cpp84
-rw-r--r--src/core/arm/arm_interface.h37
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic.h29
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic_32.cpp64
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic_32.h16
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic_64.cpp64
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic_64.h18
-rw-r--r--src/core/arm/dynarmic/dynarmic_cp15.cpp (renamed from src/core/arm/dynarmic/arm_dynarmic_cp15.cpp)2
-rw-r--r--src/core/arm/dynarmic/dynarmic_cp15.h (renamed from src/core/arm/dynarmic/arm_dynarmic_cp15.h)0
-rw-r--r--src/core/arm/dynarmic/dynarmic_exclusive_monitor.cpp (renamed from src/core/arm/dynarmic/arm_exclusive_monitor.cpp)2
-rw-r--r--src/core/arm/dynarmic/dynarmic_exclusive_monitor.h (renamed from src/core/arm/dynarmic/arm_exclusive_monitor.h)0
-rw-r--r--src/core/arm/exclusive_monitor.cpp2
-rw-r--r--src/core/core.cpp44
-rw-r--r--src/core/core.h11
-rw-r--r--src/core/file_sys/submission_package.h1
-rw-r--r--src/core/file_sys/system_archive/time_zone_binary.cpp706
-rw-r--r--src/core/file_sys/vfs_concat.cpp14
-rw-r--r--src/core/file_sys/vfs_real.cpp187
-rw-r--r--src/core/file_sys/vfs_real.h30
-rw-r--r--src/core/hle/kernel/k_thread.cpp15
-rw-r--r--src/core/hle/kernel/k_thread.h4
-rw-r--r--src/core/hle/service/nfc/common/amiibo_crypto.cpp44
-rw-r--r--src/core/hle/service/nfc/common/amiibo_crypto.h9
-rw-r--r--src/core/hle/service/nfc/common/device.cpp300
-rw-r--r--src/core/hle/service/nfc/common/device.h15
-rw-r--r--src/core/hle/service/nfc/common/device_manager.cpp14
-rw-r--r--src/core/hle/service/nfc/mifare_result.h2
-rw-r--r--src/core/hle/service/nfc/nfc_interface.cpp21
-rw-r--r--src/core/hle/service/nfc/nfc_result.h21
-rw-r--r--src/core/hle/service/nfc/nfc_types.h37
-rw-r--r--src/core/hle/service/nfp/nfp_interface.cpp6
-rw-r--r--src/core/hle/service/nfp/nfp_result.h2
-rw-r--r--src/core/hle/service/nfp/nfp_types.h26
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp4
-rw-r--r--src/core/hle/service/nvnflinger/nvnflinger.cpp4
-rw-r--r--src/core/hle/service/time/time_manager.cpp34
-rw-r--r--src/core/hle/service/time/time_manager.h4
-rw-r--r--src/core/hle/service/time/time_zone_content_manager.cpp26
-rw-r--r--src/core/hle/service/time/time_zone_manager.cpp161
-rw-r--r--src/core/hle/service/time/time_zone_manager.h8
-rw-r--r--src/core/hle/service/time/time_zone_service.cpp67
-rw-r--r--src/core/hle/service/time/time_zone_service.h3
-rw-r--r--src/core/loader/nro.cpp13
-rw-r--r--src/core/loader/nro.h2
-rw-r--r--src/input_common/drivers/virtual_amiibo.cpp2
-rw-r--r--src/input_common/drivers/virtual_amiibo.h1
-rw-r--r--src/shader_recompiler/CMakeLists.txt2
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate_program.cpp6
-rw-r--r--src/shader_recompiler/host_translate_info.h3
-rw-r--r--src/shader_recompiler/ir_opt/conditional_barrier_pass.cpp44
-rw-r--r--src/shader_recompiler/ir_opt/lower_fp64_to_fp32.cpp185
-rw-r--r--src/shader_recompiler/ir_opt/passes.h2
-rw-r--r--src/video_core/buffer_cache/buffer_cache.h75
-rw-r--r--src/video_core/buffer_cache/buffer_cache_base.h12
-rw-r--r--src/video_core/engines/draw_manager.cpp10
-rw-r--r--src/video_core/memory_manager.cpp4
-rw-r--r--src/video_core/renderer_opengl/gl_buffer_cache.cpp17
-rw-r--r--src/video_core/renderer_opengl/gl_buffer_cache.h6
-rw-r--r--src/video_core/renderer_opengl/gl_compute_pipeline.cpp23
-rw-r--r--src/video_core/renderer_opengl/gl_device.cpp1
-rw-r--r--src/video_core/renderer_opengl/gl_device.h5
-rw-r--r--src/video_core/renderer_opengl/gl_graphics_pipeline.cpp27
-rw-r--r--src/video_core/renderer_opengl/gl_shader_cache.cpp2
-rw-r--r--src/video_core/renderer_opengl/gl_shader_context.h6
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp72
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.h11
-rw-r--r--src/video_core/renderer_vulkan/pipeline_helper.h11
-rw-r--r--src/video_core/renderer_vulkan/vk_blit_screen.cpp55
-rw-r--r--src/video_core/renderer_vulkan/vk_buffer_cache.cpp48
-rw-r--r--src/video_core/renderer_vulkan/vk_buffer_cache.h5
-rw-r--r--src/video_core/renderer_vulkan/vk_compute_pipeline.cpp8
-rw-r--r--src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp8
-rw-r--r--src/video_core/renderer_vulkan/vk_master_semaphore.cpp1
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp7
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.h6
-rw-r--r--src/video_core/renderer_vulkan/vk_swapchain.cpp5
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp51
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.h9
-rw-r--r--src/video_core/texture_cache/image_info.cpp20
-rw-r--r--src/video_core/texture_cache/image_view_base.cpp52
-rw-r--r--src/video_core/texture_cache/image_view_base.h2
-rw-r--r--src/video_core/texture_cache/texture_cache.h56
-rw-r--r--src/video_core/texture_cache/texture_cache_base.h22
-rw-r--r--src/video_core/textures/texture.cpp7
-rw-r--r--src/video_core/vulkan_common/vulkan_device.cpp28
-rw-r--r--src/video_core/vulkan_common/vulkan_device.h44
-rw-r--r--src/yuzu/CMakeLists.txt2
-rw-r--r--src/yuzu/configuration/config.cpp10
-rw-r--r--src/yuzu/configuration/config.h1
-rw-r--r--src/yuzu/configuration/configure_dialog.cpp5
-rw-r--r--src/yuzu/configuration/configure_dialog.h7
-rw-r--r--src/yuzu/configuration/configure_graphics.cpp55
-rw-r--r--src/yuzu/configuration/configure_graphics.h3
-rw-r--r--src/yuzu/configuration/configure_graphics_advanced.cpp18
-rw-r--r--src/yuzu/configuration/configure_graphics_advanced.h2
-rw-r--r--src/yuzu/configuration/configure_graphics_advanced.ui20
-rw-r--r--src/yuzu/configuration/configure_per_game.cpp5
-rw-r--r--src/yuzu/configuration/configure_per_game.h3
-rw-r--r--src/yuzu/configuration/configure_system.cpp3
-rw-r--r--src/yuzu/main.cpp18
-rw-r--r--src/yuzu/main.h6
-rw-r--r--src/yuzu/vk_device_info.cpp61
-rw-r--r--src/yuzu/vk_device_info.h36
-rw-r--r--vcpkg.json2
221 files changed, 8876 insertions, 2176 deletions
diff --git a/.codespellrc b/.codespellrc
index 786a991eb..01ddd2362 100644
--- a/.codespellrc
+++ b/.codespellrc
@@ -2,5 +2,5 @@
2; SPDX-License-Identifier: GPL-2.0-or-later 2; SPDX-License-Identifier: GPL-2.0-or-later
3 3
4[codespell] 4[codespell]
5skip = ./.git,./build,./dist,./Doxyfile,./externals,./LICENSES 5skip = ./.git,./build,./dist,./Doxyfile,./externals,./LICENSES,./src/android/app/src/main/res
6ignore-words-list = aci,allright,ba,deques,froms,hda,inout,lod,masia,nam,nax,nd,pullrequests,pullrequest,te,transfered,unstall,uscaled,zink 6ignore-words-list = aci,allright,ba,deques,froms,hda,inout,lod,masia,nam,nax,nd,optin,pullrequests,pullrequest,te,transfered,unstall,uscaled,zink
diff --git a/.gitignore b/.gitignore
index a5f7248c7..fbadb208b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,6 +26,8 @@ CMakeSettings.json
26# OSX global filetypes 26# OSX global filetypes
27# Created by Finder or Spotlight in directories for various OS functionality (indexing, etc) 27# Created by Finder or Spotlight in directories for various OS functionality (indexing, etc)
28.DS_Store 28.DS_Store
29.DS_Store?
30._*
29.AppleDouble 31.AppleDouble
30.LSOverride 32.LSOverride
31.Spotlight-V100 33.Spotlight-V100
diff --git a/.gitmodules b/.gitmodules
index 95eae8109..89f2ad924 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -52,3 +52,6 @@
52[submodule "libadrenotools"] 52[submodule "libadrenotools"]
53 path = externals/libadrenotools 53 path = externals/libadrenotools
54 url = https://github.com/bylaws/libadrenotools 54 url = https://github.com/bylaws/libadrenotools
55[submodule "tzdb_to_nx"]
56 path = externals/nx_tzdb/tzdb_to_nx
57 url = https://github.com/lat9nq/tzdb_to_nx.git
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3d03bbf94..6d3146c9e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,6 +59,8 @@ option(YUZU_CHECK_SUBMODULES "Check if submodules are present" ON)
59 59
60option(YUZU_ENABLE_LTO "Enable link-time optimization" OFF) 60option(YUZU_ENABLE_LTO "Enable link-time optimization" OFF)
61 61
62option(YUZU_DOWNLOAD_TIME_ZONE_DATA "Always download time zone binaries" OFF)
63
62CMAKE_DEPENDENT_OPTION(YUZU_USE_FASTER_LD "Check if a faster linker is available" ON "NOT WIN32" OFF) 64CMAKE_DEPENDENT_OPTION(YUZU_USE_FASTER_LD "Check if a faster linker is available" ON "NOT WIN32" OFF)
63 65
64# On Android, fetch and compile libcxx before doing anything else 66# On Android, fetch and compile libcxx before doing anything else
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt
index 500eb21e3..7cce27d51 100644
--- a/externals/CMakeLists.txt
+++ b/externals/CMakeLists.txt
@@ -63,8 +63,9 @@ if (YUZU_USE_EXTERNAL_SDL2)
63 # Yuzu itself needs: Atomic Audio Events Joystick Haptic Sensor Threads Timers 63 # Yuzu itself needs: Atomic Audio Events Joystick Haptic Sensor Threads Timers
64 # Since 2.0.18 Atomic+Threads required for HIDAPI/libusb (see https://github.com/libsdl-org/SDL/issues/5095) 64 # Since 2.0.18 Atomic+Threads required for HIDAPI/libusb (see https://github.com/libsdl-org/SDL/issues/5095)
65 # Yuzu-cmd also needs: Video (depends on Loadso/Dlopen) 65 # Yuzu-cmd also needs: Video (depends on Loadso/Dlopen)
66 # CPUinfo also required for SDL Audio, at least until 2.28.0 (see https://github.com/libsdl-org/SDL/issues/7809)
66 set(SDL_UNUSED_SUBSYSTEMS 67 set(SDL_UNUSED_SUBSYSTEMS
67 CPUinfo File Filesystem 68 File Filesystem
68 Locale Power Render) 69 Locale Power Render)
69 foreach(_SUB ${SDL_UNUSED_SUBSYSTEMS}) 70 foreach(_SUB ${SDL_UNUSED_SUBSYSTEMS})
70 string(TOUPPER ${_SUB} _OPT) 71 string(TOUPPER ${_SUB} _OPT)
@@ -139,6 +140,9 @@ if (YUZU_USE_EXTERNAL_VULKAN_HEADERS)
139 add_subdirectory(Vulkan-Headers) 140 add_subdirectory(Vulkan-Headers)
140endif() 141endif()
141 142
143# TZDB (Time Zone Database)
144add_subdirectory(nx_tzdb)
145
142if (NOT TARGET LLVM::Demangle) 146if (NOT TARGET LLVM::Demangle)
143 add_library(demangle demangle/ItaniumDemangle.cpp) 147 add_library(demangle demangle/ItaniumDemangle.cpp)
144 target_include_directories(demangle PUBLIC ./demangle) 148 target_include_directories(demangle PUBLIC ./demangle)
diff --git a/externals/nx_tzdb/CMakeLists.txt b/externals/nx_tzdb/CMakeLists.txt
new file mode 100644
index 000000000..593786250
--- /dev/null
+++ b/externals/nx_tzdb/CMakeLists.txt
@@ -0,0 +1,101 @@
1# SPDX-FileCopyrightText: 2023 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-2.0-or-later
3
4set(NX_TZDB_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/include")
5
6add_library(nx_tzdb INTERFACE)
7
8find_program(GIT git)
9find_program(GNU_MAKE make)
10find_program(DATE_PROG date)
11
12set(CAN_BUILD_NX_TZDB true)
13
14if (NOT GIT)
15 set(CAN_BUILD_NX_TZDB false)
16endif()
17if (NOT GNU_MAKE)
18 set(CAN_BUILD_NX_TZDB false)
19endif()
20if (NOT DATE_PROG)
21 set(CAN_BUILD_NX_TZDB false)
22endif()
23if (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR ANDROID)
24 # tzdb_to_nx currently requires a posix-compliant host
25 # MinGW and Android are handled here due to the executable format being different from the host system
26 # TODO (lat9nq): cross-compiling support
27 set(CAN_BUILD_NX_TZDB false)
28endif()
29
30set(NX_TZDB_VERSION "220816")
31set(NX_TZDB_ARCHIVE "${CMAKE_CURRENT_BINARY_DIR}/${NX_TZDB_VERSION}.zip")
32
33set(NX_TZDB_ROMFS_DIR "${CMAKE_CURRENT_BINARY_DIR}/nx_tzdb")
34
35if ((NOT CAN_BUILD_NX_TZDB OR YUZU_DOWNLOAD_TIME_ZONE_DATA) AND NOT EXISTS ${NX_TZDB_ARCHIVE})
36 set(NX_TZDB_DOWNLOAD_URL "https://github.com/lat9nq/tzdb_to_nx/releases/download/${NX_TZDB_VERSION}/${NX_TZDB_VERSION}.zip")
37
38 message(STATUS "Downloading time zone data from ${NX_TZDB_DOWNLOAD_URL}...")
39 file(DOWNLOAD ${NX_TZDB_DOWNLOAD_URL} ${NX_TZDB_ARCHIVE}
40 STATUS NX_TZDB_DOWNLOAD_STATUS)
41 list(GET NX_TZDB_DOWNLOAD_STATUS 0 NX_TZDB_DOWNLOAD_STATUS_CODE)
42 if (NOT NX_TZDB_DOWNLOAD_STATUS_CODE EQUAL 0)
43 message(FATAL_ERROR "Time zone data download failed (status code ${NX_TZDB_DOWNLOAD_STATUS_CODE})")
44 endif()
45
46 file(ARCHIVE_EXTRACT
47 INPUT
48 ${NX_TZDB_ARCHIVE}
49 DESTINATION
50 ${NX_TZDB_ROMFS_DIR})
51elseif (CAN_BUILD_NX_TZDB AND NOT YUZU_DOWNLOAD_TIME_ZONE_DATA)
52 add_subdirectory(tzdb_to_nx)
53 add_dependencies(nx_tzdb x80e)
54
55 set(NX_TZDB_ROMFS_DIR "${NX_TZDB_DIR}")
56endif()
57
58target_include_directories(nx_tzdb
59 INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include
60 INTERFACE ${NX_TZDB_INCLUDE_DIR})
61
62function(CreateHeader ZONE_PATH HEADER_NAME)
63 set(HEADER_PATH "${NX_TZDB_INCLUDE_DIR}/nx_tzdb/${HEADER_NAME}.h")
64 add_custom_command(
65 OUTPUT
66 ${NX_TZDB_INCLUDE_DIR}/nx_tzdb/${HEADER_NAME}.h
67 COMMAND
68 ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/NxTzdbCreateHeader.cmake
69 ${ZONE_PATH}
70 ${HEADER_NAME}
71 ${NX_TZDB_INCLUDE_DIR}
72 ${CMAKE_CURRENT_SOURCE_DIR}
73 DEPENDS
74 tzdb_template.h.in
75 NxTzdbCreateHeader.cmake)
76
77 target_sources(nx_tzdb PRIVATE ${HEADER_PATH})
78endfunction()
79
80CreateHeader(${NX_TZDB_ROMFS_DIR} base)
81CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo zoneinfo)
82CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/Africa africa)
83CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/America america)
84CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/America/Argentina america_argentina)
85CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/America/Indiana america_indiana)
86CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/America/Kentucky america_kentucky)
87CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/America/North_Dakota america_north_dakota)
88CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/Antarctica antarctica)
89CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/Arctic arctic)
90CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/Asia asia)
91CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/Atlantic atlantic)
92CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/Australia australia)
93CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/Brazil brazil)
94CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/Canada canada)
95CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/Chile chile)
96CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/Etc etc)
97CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/Europe europe)
98CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/Indian indian)
99CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/Mexico mexico)
100CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/Pacific pacific)
101CreateHeader(${NX_TZDB_ROMFS_DIR}/zoneinfo/US us)
diff --git a/externals/nx_tzdb/ListFilesInDirectory.cmake b/externals/nx_tzdb/ListFilesInDirectory.cmake
new file mode 100644
index 000000000..35a9e726a
--- /dev/null
+++ b/externals/nx_tzdb/ListFilesInDirectory.cmake
@@ -0,0 +1,8 @@
1# SPDX-FileCopyrightText: 2023 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-2.0-or-later
3
4# CMake does not have a way to list the files in a specific directory,
5# so we need this script to do that for us in a platform-agnostic fashion
6
7file(GLOB FILE_LIST LIST_DIRECTORIES false RELATIVE ${CMAKE_SOURCE_DIR} "*")
8execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${FILE_LIST};")
diff --git a/externals/nx_tzdb/NxTzdbCreateHeader.cmake b/externals/nx_tzdb/NxTzdbCreateHeader.cmake
new file mode 100644
index 000000000..8c29e1167
--- /dev/null
+++ b/externals/nx_tzdb/NxTzdbCreateHeader.cmake
@@ -0,0 +1,46 @@
1# SPDX-FileCopyrightText: 2023 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-2.0-or-later
3
4set(ZONE_PATH ${CMAKE_ARGV3})
5set(HEADER_NAME ${CMAKE_ARGV4})
6set(NX_TZDB_INCLUDE_DIR ${CMAKE_ARGV5})
7set(NX_TZDB_SOURCE_DIR ${CMAKE_ARGV6})
8
9execute_process(
10 COMMAND ${CMAKE_COMMAND} -P ${NX_TZDB_SOURCE_DIR}/ListFilesInDirectory.cmake
11 WORKING_DIRECTORY ${ZONE_PATH}
12 OUTPUT_VARIABLE FILE_LIST)
13
14set(DIRECTORY_NAME ${HEADER_NAME})
15
16set(FILE_DATA "")
17foreach(ZONE_FILE ${FILE_LIST})
18 if (ZONE_FILE STREQUAL "\n")
19 continue()
20 endif()
21
22 string(APPEND FILE_DATA "{\"${ZONE_FILE}\",\n{")
23
24 file(READ ${ZONE_PATH}/${ZONE_FILE} ZONE_DATA HEX)
25 string(LENGTH "${ZONE_DATA}" ZONE_DATA_LEN)
26 foreach(I RANGE 0 ${ZONE_DATA_LEN} 2)
27 math(EXPR BREAK_LINE "(${I} + 2) % 38")
28
29 string(SUBSTRING "${ZONE_DATA}" "${I}" 2 HEX_DATA)
30 if (NOT HEX_DATA)
31 break()
32 endif()
33
34 string(APPEND FILE_DATA "0x${HEX_DATA},")
35 if (BREAK_LINE EQUAL 0)
36 string(APPEND FILE_DATA "\n")
37 else()
38 string(APPEND FILE_DATA " ")
39 endif()
40 endforeach()
41
42 string(APPEND FILE_DATA "}},\n")
43endforeach()
44
45file(READ ${NX_TZDB_SOURCE_DIR}/tzdb_template.h.in NX_TZDB_TEMPLATE_H_IN)
46file(CONFIGURE OUTPUT ${NX_TZDB_INCLUDE_DIR}/nx_tzdb/${HEADER_NAME}.h CONTENT "${NX_TZDB_TEMPLATE_H_IN}")
diff --git a/externals/nx_tzdb/include/nx_tzdb.h b/externals/nx_tzdb/include/nx_tzdb.h
new file mode 100644
index 000000000..1f7c6069a
--- /dev/null
+++ b/externals/nx_tzdb/include/nx_tzdb.h
@@ -0,0 +1,27 @@
1// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include "nx_tzdb/africa.h"
7#include "nx_tzdb/america.h"
8#include "nx_tzdb/america_argentina.h"
9#include "nx_tzdb/america_indiana.h"
10#include "nx_tzdb/america_kentucky.h"
11#include "nx_tzdb/america_north_dakota.h"
12#include "nx_tzdb/antarctica.h"
13#include "nx_tzdb/arctic.h"
14#include "nx_tzdb/asia.h"
15#include "nx_tzdb/atlantic.h"
16#include "nx_tzdb/australia.h"
17#include "nx_tzdb/base.h"
18#include "nx_tzdb/brazil.h"
19#include "nx_tzdb/canada.h"
20#include "nx_tzdb/chile.h"
21#include "nx_tzdb/etc.h"
22#include "nx_tzdb/europe.h"
23#include "nx_tzdb/indian.h"
24#include "nx_tzdb/mexico.h"
25#include "nx_tzdb/pacific.h"
26#include "nx_tzdb/us.h"
27#include "nx_tzdb/zoneinfo.h"
diff --git a/externals/nx_tzdb/tzdb_template.h.in b/externals/nx_tzdb/tzdb_template.h.in
new file mode 100644
index 000000000..289d002ea
--- /dev/null
+++ b/externals/nx_tzdb/tzdb_template.h.in
@@ -0,0 +1,18 @@
1// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include <cstdint>
7#include <map>
8#include <vector>
9
10namespace NxTzdb {
11
12// clang-format off
13const static std::map<const char*, const std::vector<uint8_t>> @DIRECTORY_NAME@ =
14{
15@FILE_DATA@};
16// clang-format on
17
18} // namespace NxTzdb
diff --git a/externals/nx_tzdb/tzdb_to_nx b/externals/nx_tzdb/tzdb_to_nx
new file mode 160000
Subproject 8c272f21d19c6e821345fd055f41b9640f9189d
diff --git a/externals/vcpkg b/externals/vcpkg
Subproject 656fcc6ab2b05c6d999b7eaca717027ac3738f7 Subproject cbf56573a987527b39272e88cbdd11389b78c6e
diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts
index 13bb227ff..bab4f4d0f 100644
--- a/src/android/app/build.gradle.kts
+++ b/src/android/app/build.gradle.kts
@@ -2,12 +2,17 @@
2// SPDX-License-Identifier: GPL-3.0-or-later 2// SPDX-License-Identifier: GPL-3.0-or-later
3 3
4import android.annotation.SuppressLint 4import android.annotation.SuppressLint
5import kotlin.collections.setOf
6import org.jetbrains.kotlin.konan.properties.Properties
7import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
5 8
6plugins { 9plugins {
7 id("com.android.application") 10 id("com.android.application")
8 id("org.jetbrains.kotlin.android") 11 id("org.jetbrains.kotlin.android")
9 id("kotlin-parcelize") 12 id("kotlin-parcelize")
10 kotlin("plugin.serialization") version "1.8.21" 13 kotlin("plugin.serialization") version "1.8.21"
14 id("androidx.navigation.safeargs.kotlin")
15 id("org.jlleitschuh.gradle.ktlint") version "11.4.0"
11} 16}
12 17
13/** 18/**
@@ -42,24 +47,27 @@ android {
42 jniLibs.useLegacyPackaging = true 47 jniLibs.useLegacyPackaging = true
43 } 48 }
44 49
45 lint {
46 // This is important as it will run lint but not abort on error
47 // Lint has some overly obnoxious "errors" that should really be warnings
48 abortOnError = false
49
50 //Uncomment disable lines for test builds...
51 //disable 'MissingTranslation'bin
52 //disable 'ExtraTranslation'
53 }
54
55 defaultConfig { 50 defaultConfig {
56 // TODO If this is ever modified, change application_id in strings.xml 51 // TODO If this is ever modified, change application_id in strings.xml
57 applicationId = "org.yuzu.yuzu_emu" 52 applicationId = "org.yuzu.yuzu_emu"
58 minSdk = 30 53 minSdk = 30
59 targetSdk = 33 54 targetSdk = 33
60 versionCode = 1
61 versionName = getGitVersion() 55 versionName = getGitVersion()
62 56
57 // If you want to use autoVersion for the versionCode, create a property in local.properties
58 // named "autoVersioned" and set it to "true"
59 val properties = Properties()
60 val versionProperty = try {
61 properties.load(project.rootProject.file("local.properties").inputStream())
62 properties.getProperty("autoVersioned") ?: ""
63 } catch (e: Exception) { "" }
64
65 versionCode = if (versionProperty == "true") {
66 autoVersion
67 } else {
68 1
69 }
70
63 ndk { 71 ndk {
64 @SuppressLint("ChromeOsAbiSupport") 72 @SuppressLint("ChromeOsAbiSupport")
65 abiFilters += listOf("arm64-v8a") 73 abiFilters += listOf("arm64-v8a")
@@ -74,16 +82,7 @@ android {
74 82
75 // Signed by release key, allowing for upload to Play Store. 83 // Signed by release key, allowing for upload to Play Store.
76 release { 84 release {
77 signingConfig = signingConfigs.getByName("debug") 85 resValue("string", "app_name_suffixed", "yuzu")
78 isMinifyEnabled = true
79 isDebuggable = false
80 proguardFiles(
81 getDefaultProguardFile("proguard-android.txt"),
82 "proguard-rules.pro"
83 )
84 }
85
86 register("relWithVersionCode") {
87 signingConfig = signingConfigs.getByName("debug") 86 signingConfig = signingConfigs.getByName("debug")
88 isMinifyEnabled = true 87 isMinifyEnabled = true
89 isDebuggable = false 88 isDebuggable = false
@@ -96,6 +95,7 @@ android {
96 // builds a release build that doesn't need signing 95 // builds a release build that doesn't need signing
97 // Attaches 'debug' suffix to version and package name, allowing installation alongside the release build. 96 // Attaches 'debug' suffix to version and package name, allowing installation alongside the release build.
98 register("relWithDebInfo") { 97 register("relWithDebInfo") {
98 resValue("string", "app_name_suffixed", "yuzu Debug Release")
99 signingConfig = signingConfigs.getByName("debug") 99 signingConfig = signingConfigs.getByName("debug")
100 isMinifyEnabled = true 100 isMinifyEnabled = true
101 isDebuggable = true 101 isDebuggable = true
@@ -103,16 +103,19 @@ android {
103 getDefaultProguardFile("proguard-android.txt"), 103 getDefaultProguardFile("proguard-android.txt"),
104 "proguard-rules.pro" 104 "proguard-rules.pro"
105 ) 105 )
106 versionNameSuffix = "-debug" 106 versionNameSuffix = "-relWithDebInfo"
107 applicationIdSuffix = ".relWithDebInfo"
107 isJniDebuggable = true 108 isJniDebuggable = true
108 } 109 }
109 110
110 // Signed by debug key disallowing distribution on Play Store. 111 // Signed by debug key disallowing distribution on Play Store.
111 // Attaches 'debug' suffix to version and package name, allowing installation alongside the release build. 112 // Attaches 'debug' suffix to version and package name, allowing installation alongside the release build.
112 debug { 113 debug {
114 resValue("string", "app_name_suffixed", "yuzu Debug")
113 isDebuggable = true 115 isDebuggable = true
114 isJniDebuggable = true 116 isJniDebuggable = true
115 versionNameSuffix = "-debug" 117 versionNameSuffix = "-debug"
118 applicationIdSuffix = ".debug"
116 } 119 }
117 } 120 }
118 121
@@ -157,24 +160,42 @@ android {
157 } 160 }
158} 161}
159 162
163tasks.getByPath("preBuild").dependsOn("ktlintCheck")
164
165ktlint {
166 version.set("0.47.1")
167 android.set(true)
168 ignoreFailures.set(false)
169 disabledRules.set(
170 setOf(
171 "no-wildcard-imports",
172 "package-name",
173 "import-ordering"
174 )
175 )
176 reporters {
177 reporter(ReporterType.CHECKSTYLE)
178 }
179}
180
160dependencies { 181dependencies {
161 implementation("androidx.core:core-ktx:1.10.1") 182 implementation("androidx.core:core-ktx:1.10.1")
162 implementation("androidx.appcompat:appcompat:1.6.1") 183 implementation("androidx.appcompat:appcompat:1.6.1")
163 implementation("androidx.recyclerview:recyclerview:1.3.0") 184 implementation("androidx.recyclerview:recyclerview:1.3.0")
164 implementation("androidx.constraintlayout:constraintlayout:2.1.4") 185 implementation("androidx.constraintlayout:constraintlayout:2.1.4")
165 implementation("androidx.fragment:fragment-ktx:1.5.7") 186 implementation("androidx.fragment:fragment-ktx:1.6.0")
166 implementation("androidx.documentfile:documentfile:1.0.1") 187 implementation("androidx.documentfile:documentfile:1.0.1")
167 implementation("com.google.android.material:material:1.9.0") 188 implementation("com.google.android.material:material:1.9.0")
168 implementation("androidx.preference:preference:1.2.0") 189 implementation("androidx.preference:preference:1.2.0")
169 implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1") 190 implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1")
170 implementation("io.coil-kt:coil:2.2.2") 191 implementation("io.coil-kt:coil:2.2.2")
171 implementation("androidx.core:core-splashscreen:1.0.1") 192 implementation("androidx.core:core-splashscreen:1.0.1")
172 implementation("androidx.window:window:1.0.0") 193 implementation("androidx.window:window:1.1.0")
173 implementation("org.ini4j:ini4j:0.5.4") 194 implementation("org.ini4j:ini4j:0.5.4")
174 implementation("androidx.constraintlayout:constraintlayout:2.1.4") 195 implementation("androidx.constraintlayout:constraintlayout:2.1.4")
175 implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0") 196 implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
176 implementation("androidx.navigation:navigation-fragment-ktx:2.5.3") 197 implementation("androidx.navigation:navigation-fragment-ktx:2.6.0")
177 implementation("androidx.navigation:navigation-ui-ktx:2.5.3") 198 implementation("androidx.navigation:navigation-ui-ktx:2.6.0")
178 implementation("info.debatty:java-string-similarity:2.0.0") 199 implementation("info.debatty:java-string-similarity:2.0.0")
179 implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0") 200 implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0")
180} 201}
diff --git a/src/android/app/src/main/AndroidManifest.xml b/src/android/app/src/main/AndroidManifest.xml
index eef566042..e31ad69e2 100644
--- a/src/android/app/src/main/AndroidManifest.xml
+++ b/src/android/app/src/main/AndroidManifest.xml
@@ -18,12 +18,13 @@ SPDX-License-Identifier: GPL-3.0-or-later
18 18
19 <application 19 <application
20 android:name="org.yuzu.yuzu_emu.YuzuApplication" 20 android:name="org.yuzu.yuzu_emu.YuzuApplication"
21 android:label="@string/app_name" 21 android:label="@string/app_name_suffixed"
22 android:icon="@drawable/ic_launcher" 22 android:icon="@drawable/ic_launcher"
23 android:allowBackup="true" 23 android:allowBackup="true"
24 android:hasFragileUserData="true" 24 android:hasFragileUserData="true"
25 android:supportsRtl="true" 25 android:supportsRtl="true"
26 android:isGame="true" 26 android:isGame="true"
27 android:localeConfig="@xml/locales_config"
27 android:banner="@drawable/tv_banner" 28 android:banner="@drawable/tv_banner"
28 android:extractNativeLibs="true" 29 android:extractNativeLibs="true"
29 android:fullBackupContent="@xml/data_extraction_rules" 30 android:fullBackupContent="@xml/data_extraction_rules"
@@ -52,8 +53,9 @@ SPDX-License-Identifier: GPL-3.0-or-later
52 <activity 53 <activity
53 android:name="org.yuzu.yuzu_emu.activities.EmulationActivity" 54 android:name="org.yuzu.yuzu_emu.activities.EmulationActivity"
54 android:theme="@style/Theme.Yuzu.Main" 55 android:theme="@style/Theme.Yuzu.Main"
55 android:launchMode="singleTop"
56 android:screenOrientation="userLandscape" 56 android:screenOrientation="userLandscape"
57 android:supportsPictureInPicture="true"
58 android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|uiMode"
57 android:exported="true"> 59 android:exported="true">
58 60
59 <intent-filter> 61 <intent-filter>
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 c11b6bc16..f860cdd4b 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
@@ -14,16 +14,18 @@ import android.widget.TextView
14import androidx.annotation.Keep 14import androidx.annotation.Keep
15import androidx.fragment.app.DialogFragment 15import androidx.fragment.app.DialogFragment
16import com.google.android.material.dialog.MaterialAlertDialogBuilder 16import com.google.android.material.dialog.MaterialAlertDialogBuilder
17import java.lang.ref.WeakReference
17import org.yuzu.yuzu_emu.YuzuApplication.Companion.appContext 18import org.yuzu.yuzu_emu.YuzuApplication.Companion.appContext
18import org.yuzu.yuzu_emu.activities.EmulationActivity 19import org.yuzu.yuzu_emu.activities.EmulationActivity
19import org.yuzu.yuzu_emu.utils.DocumentsTree.Companion.isNativePath 20import org.yuzu.yuzu_emu.utils.DocumentsTree.Companion.isNativePath
21import org.yuzu.yuzu_emu.utils.FileUtil.exists
20import org.yuzu.yuzu_emu.utils.FileUtil.getFileSize 22import org.yuzu.yuzu_emu.utils.FileUtil.getFileSize
23import org.yuzu.yuzu_emu.utils.FileUtil.isDirectory
21import org.yuzu.yuzu_emu.utils.FileUtil.openContentUri 24import org.yuzu.yuzu_emu.utils.FileUtil.openContentUri
22import org.yuzu.yuzu_emu.utils.Log.error 25import org.yuzu.yuzu_emu.utils.Log.error
23import org.yuzu.yuzu_emu.utils.Log.verbose 26import org.yuzu.yuzu_emu.utils.Log.verbose
24import org.yuzu.yuzu_emu.utils.Log.warning 27import org.yuzu.yuzu_emu.utils.Log.warning
25import org.yuzu.yuzu_emu.utils.SerializableHelper.serializable 28import org.yuzu.yuzu_emu.utils.SerializableHelper.serializable
26import java.lang.ref.WeakReference
27 29
28/** 30/**
29 * Class which contains methods that interact 31 * Class which contains methods that interact
@@ -74,7 +76,9 @@ object NativeLibrary {
74 fun openContentUri(path: String?, openmode: String?): Int { 76 fun openContentUri(path: String?, openmode: String?): Int {
75 return if (isNativePath(path!!)) { 77 return if (isNativePath(path!!)) {
76 YuzuApplication.documentsTree!!.openContentUri(path, openmode) 78 YuzuApplication.documentsTree!!.openContentUri(path, openmode)
77 } else openContentUri(appContext, path, openmode) 79 } else {
80 openContentUri(appContext, path, openmode)
81 }
78 } 82 }
79 83
80 @Keep 84 @Keep
@@ -82,7 +86,29 @@ object NativeLibrary {
82 fun getSize(path: String?): Long { 86 fun getSize(path: String?): Long {
83 return if (isNativePath(path!!)) { 87 return if (isNativePath(path!!)) {
84 YuzuApplication.documentsTree!!.getFileSize(path) 88 YuzuApplication.documentsTree!!.getFileSize(path)
85 } else getFileSize(appContext, path) 89 } else {
90 getFileSize(appContext, path)
91 }
92 }
93
94 @Keep
95 @JvmStatic
96 fun exists(path: String?): Boolean {
97 return if (isNativePath(path!!)) {
98 YuzuApplication.documentsTree!!.exists(path)
99 } else {
100 exists(appContext, path)
101 }
102 }
103
104 @Keep
105 @JvmStatic
106 fun isDirectory(path: String?): Boolean {
107 return if (isNativePath(path!!)) {
108 YuzuApplication.documentsTree!!.isDirectory(path)
109 } else {
110 isDirectory(appContext, path)
111 }
86 } 112 }
87 113
88 /** 114 /**
@@ -223,8 +249,12 @@ object NativeLibrary {
223 249
224 external fun getCompany(filename: String): String 250 external fun getCompany(filename: String): String
225 251
252 external fun isHomebrew(filename: String): Boolean
253
226 external fun setAppDirectory(directory: String) 254 external fun setAppDirectory(directory: String)
227 255
256 external fun installFileToNand(filename: String): Int
257
228 external fun initializeGpuDriver( 258 external fun initializeGpuDriver(
229 hookLibDir: String?, 259 hookLibDir: String?,
230 customDriverDir: String?, 260 customDriverDir: String?,
@@ -279,6 +309,11 @@ object NativeLibrary {
279 external fun isRunning(): Boolean 309 external fun isRunning(): Boolean
280 310
281 /** 311 /**
312 * Returns true if emulation is paused.
313 */
314 external fun isPaused(): Boolean
315
316 /**
282 * Returns the performance stats for the current game 317 * Returns the performance stats for the current game
283 */ 318 */
284 external fun getPerfStats(): DoubleArray 319 external fun getPerfStats(): DoubleArray
@@ -427,7 +462,9 @@ object NativeLibrary {
427 Html.FROM_HTML_MODE_LEGACY 462 Html.FROM_HTML_MODE_LEGACY
428 ) 463 )
429 ) 464 )
430 .setPositiveButton(android.R.string.ok) { _: DialogInterface?, _: Int -> emulationActivity.finish() } 465 .setPositiveButton(android.R.string.ok) { _: DialogInterface?, _: Int ->
466 emulationActivity.finish()
467 }
431 .setOnDismissListener { emulationActivity.finish() } 468 .setOnDismissListener { emulationActivity.finish() }
432 emulationActivity.runOnUiThread { 469 emulationActivity.runOnUiThread {
433 val alert = builder.create() 470 val alert = builder.create()
@@ -505,4 +542,15 @@ object NativeLibrary {
505 const val RELEASED = 0 542 const val RELEASED = 0
506 const val PRESSED = 1 543 const val PRESSED = 1
507 } 544 }
545
546 /**
547 * Result from installFileToNand
548 */
549 object InstallFileToNandResult {
550 const val Success = 0
551 const val SuccessFileOverwritten = 1
552 const val Error = 2
553 const val ErrorBaseGame = 3
554 const val ErrorFilenameExtension = 4
555 }
508} 556}
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/YuzuApplication.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/YuzuApplication.kt
index 4c947b786..04ab6a220 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/YuzuApplication.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/YuzuApplication.kt
@@ -7,12 +7,12 @@ import android.app.Application
7import android.app.NotificationChannel 7import android.app.NotificationChannel
8import android.app.NotificationManager 8import android.app.NotificationManager
9import android.content.Context 9import android.content.Context
10import java.io.File
10import org.yuzu.yuzu_emu.utils.DirectoryInitialization 11import org.yuzu.yuzu_emu.utils.DirectoryInitialization
11import org.yuzu.yuzu_emu.utils.DocumentsTree 12import org.yuzu.yuzu_emu.utils.DocumentsTree
12import org.yuzu.yuzu_emu.utils.GpuDriverHelper 13import org.yuzu.yuzu_emu.utils.GpuDriverHelper
13import java.io.File
14 14
15fun Context.getPublicFilesDir() : File = getExternalFilesDir(null) ?: filesDir 15fun Context.getPublicFilesDir(): File = getExternalFilesDir(null) ?: filesDir
16 16
17class YuzuApplication : Application() { 17class YuzuApplication : Application() {
18 private fun createNotificationChannels() { 18 private fun createNotificationChannels() {
@@ -21,7 +21,9 @@ class YuzuApplication : Application() {
21 getString(R.string.emulation_notification_channel_name), 21 getString(R.string.emulation_notification_channel_name),
22 NotificationManager.IMPORTANCE_LOW 22 NotificationManager.IMPORTANCE_LOW
23 ) 23 )
24 emulationChannel.description = getString(R.string.emulation_notification_channel_description) 24 emulationChannel.description = getString(
25 R.string.emulation_notification_channel_description
26 )
25 emulationChannel.setSound(null, null) 27 emulationChannel.setSound(null, null)
26 emulationChannel.vibrationPattern = null 28 emulationChannel.vibrationPattern = null
27 29
@@ -48,7 +50,7 @@ class YuzuApplication : Application() {
48 GpuDriverHelper.initializeDriverParameters(applicationContext) 50 GpuDriverHelper.initializeDriverParameters(applicationContext)
49 NativeLibrary.logDeviceInfo() 51 NativeLibrary.logDeviceInfo()
50 52
51 createNotificationChannels(); 53 createNotificationChannels()
52 } 54 }
53 55
54 companion object { 56 companion object {
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt
index 94d5156cf..f0a6753a9 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt
@@ -4,17 +4,23 @@
4package org.yuzu.yuzu_emu.activities 4package org.yuzu.yuzu_emu.activities
5 5
6import android.app.Activity 6import android.app.Activity
7import android.app.PendingIntent
8import android.app.PictureInPictureParams
9import android.app.RemoteAction
10import android.content.BroadcastReceiver
7import android.content.Context 11import android.content.Context
8import android.content.Intent 12import android.content.Intent
13import android.content.IntentFilter
9import android.content.res.Configuration 14import android.content.res.Configuration
10import android.graphics.Rect 15import android.graphics.Rect
16import android.graphics.drawable.Icon
11import android.hardware.Sensor 17import android.hardware.Sensor
12import android.hardware.SensorEvent 18import android.hardware.SensorEvent
13import android.hardware.SensorEventListener 19import android.hardware.SensorEventListener
14import android.hardware.SensorManager 20import android.hardware.SensorManager
15import android.hardware.display.DisplayManager 21import android.os.Build
16import android.os.Bundle 22import android.os.Bundle
17import android.view.Display 23import android.util.Rational
18import android.view.InputDevice 24import android.view.InputDevice
19import android.view.KeyEvent 25import android.view.KeyEvent
20import android.view.MotionEvent 26import android.view.MotionEvent
@@ -23,35 +29,30 @@ import android.view.View
23import android.view.inputmethod.InputMethodManager 29import android.view.inputmethod.InputMethodManager
24import androidx.activity.viewModels 30import androidx.activity.viewModels
25import androidx.appcompat.app.AppCompatActivity 31import androidx.appcompat.app.AppCompatActivity
26import androidx.core.content.getSystemService
27import androidx.core.view.WindowCompat 32import androidx.core.view.WindowCompat
28import androidx.core.view.WindowInsetsCompat 33import androidx.core.view.WindowInsetsCompat
29import androidx.core.view.WindowInsetsControllerCompat 34import androidx.core.view.WindowInsetsControllerCompat
30import androidx.lifecycle.Lifecycle 35import androidx.navigation.fragment.NavHostFragment
31import androidx.lifecycle.lifecycleScope 36import kotlin.math.roundToInt
32import androidx.lifecycle.repeatOnLifecycle
33import androidx.window.layout.WindowInfoTracker
34import kotlinx.coroutines.Dispatchers
35import kotlinx.coroutines.launch
36import org.yuzu.yuzu_emu.NativeLibrary 37import org.yuzu.yuzu_emu.NativeLibrary
37import org.yuzu.yuzu_emu.R 38import org.yuzu.yuzu_emu.R
39import org.yuzu.yuzu_emu.databinding.ActivityEmulationBinding
40import org.yuzu.yuzu_emu.features.settings.model.BooleanSetting
41import org.yuzu.yuzu_emu.features.settings.model.IntSetting
38import org.yuzu.yuzu_emu.features.settings.model.SettingsViewModel 42import org.yuzu.yuzu_emu.features.settings.model.SettingsViewModel
39import org.yuzu.yuzu_emu.fragments.EmulationFragment
40import org.yuzu.yuzu_emu.model.Game 43import org.yuzu.yuzu_emu.model.Game
41import org.yuzu.yuzu_emu.utils.ControllerMappingHelper 44import org.yuzu.yuzu_emu.utils.ControllerMappingHelper
42import org.yuzu.yuzu_emu.utils.EmulationMenuSettings
43import org.yuzu.yuzu_emu.utils.ForegroundService 45import org.yuzu.yuzu_emu.utils.ForegroundService
44import org.yuzu.yuzu_emu.utils.InputHandler 46import org.yuzu.yuzu_emu.utils.InputHandler
45import org.yuzu.yuzu_emu.utils.NfcReader 47import org.yuzu.yuzu_emu.utils.NfcReader
46import org.yuzu.yuzu_emu.utils.SerializableHelper.parcelable
47import org.yuzu.yuzu_emu.utils.ThemeHelper 48import org.yuzu.yuzu_emu.utils.ThemeHelper
48import kotlin.math.roundToInt
49 49
50class EmulationActivity : AppCompatActivity(), SensorEventListener { 50class EmulationActivity : AppCompatActivity(), SensorEventListener {
51 private lateinit var binding: ActivityEmulationBinding
52
51 private var controllerMappingHelper: ControllerMappingHelper? = null 53 private var controllerMappingHelper: ControllerMappingHelper? = null
52 54
53 var isActivityRecreated = false 55 var isActivityRecreated = false
54 private var emulationFragment: EmulationFragment? = null
55 private lateinit var nfcReader: NfcReader 56 private lateinit var nfcReader: NfcReader
56 private lateinit var inputHandler: InputHandler 57 private lateinit var inputHandler: InputHandler
57 58
@@ -60,7 +61,8 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener {
60 private var motionTimestamp: Long = 0 61 private var motionTimestamp: Long = 0
61 private var flipMotionOrientation: Boolean = false 62 private var flipMotionOrientation: Boolean = false
62 63
63 private lateinit var game: Game 64 private val actionPause = "ACTION_EMULATOR_PAUSE"
65 private val actionPlay = "ACTION_EMULATOR_PLAY"
64 66
65 private val settingsViewModel: SettingsViewModel by viewModels() 67 private val settingsViewModel: SettingsViewModel by viewModels()
66 68
@@ -75,47 +77,31 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener {
75 settingsViewModel.settings.loadSettings() 77 settingsViewModel.settings.loadSettings()
76 78
77 super.onCreate(savedInstanceState) 79 super.onCreate(savedInstanceState)
78 if (savedInstanceState == null) { 80
79 // Get params we were passed 81 binding = ActivityEmulationBinding.inflate(layoutInflater)
80 game = intent.parcelable(EXTRA_SELECTED_GAME)!! 82 setContentView(binding.root)
81 isActivityRecreated = false 83
82 } else { 84 val navHostFragment =
83 isActivityRecreated = true 85 supportFragmentManager.findFragmentById(R.id.fragment_container) as NavHostFragment
84 restoreState(savedInstanceState) 86 val navController = navHostFragment.navController
85 } 87 navController
88 .setGraph(R.navigation.emulation_navigation, intent.extras)
89
90 isActivityRecreated = savedInstanceState != null
91
86 controllerMappingHelper = ControllerMappingHelper() 92 controllerMappingHelper = ControllerMappingHelper()
87 93
88 // Set these options now so that the SurfaceView the game renders into is the right size. 94 // Set these options now so that the SurfaceView the game renders into is the right size.
89 enableFullscreenImmersive() 95 enableFullscreenImmersive()
90 96
91 setContentView(R.layout.activity_emulation)
92 window.decorView.setBackgroundColor(getColor(android.R.color.black)) 97 window.decorView.setBackgroundColor(getColor(android.R.color.black))
93 98
94 // Find or create the EmulationFragment
95 emulationFragment =
96 supportFragmentManager.findFragmentById(R.id.frame_emulation_fragment) as EmulationFragment?
97 if (emulationFragment == null) {
98 emulationFragment = EmulationFragment.newInstance(game)
99 supportFragmentManager.beginTransaction()
100 .add(R.id.frame_emulation_fragment, emulationFragment!!)
101 .commit()
102 }
103 title = game.title
104
105 nfcReader = NfcReader(this) 99 nfcReader = NfcReader(this)
106 nfcReader.initialize() 100 nfcReader.initialize()
107 101
108 inputHandler = InputHandler() 102 inputHandler = InputHandler()
109 inputHandler.initialize() 103 inputHandler.initialize()
110 104
111 lifecycleScope.launch(Dispatchers.Main) {
112 lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) {
113 WindowInfoTracker.getOrCreate(this@EmulationActivity)
114 .windowLayoutInfo(this@EmulationActivity)
115 .collect { emulationFragment?.updateCurrentLayout(this@EmulationActivity, it) }
116 }
117 }
118
119 // Start a foreground service to prevent the app from getting killed in the background 105 // Start a foreground service to prevent the app from getting killed in the background
120 val startIntent = Intent(this, ForegroundService::class.java) 106 val startIntent = Intent(this, ForegroundService::class.java)
121 startForegroundService(startIntent) 107 startForegroundService(startIntent)
@@ -149,10 +135,7 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener {
149 nfcReader.startScanning() 135 nfcReader.startScanning()
150 startMotionSensorListener() 136 startMotionSensorListener()
151 137
152 NativeLibrary.notifyOrientationChange( 138 buildPictureInPictureParams()
153 EmulationMenuSettings.landscapeScreenLayout,
154 getAdjustedRotation()
155 )
156 } 139 }
157 140
158 override fun onPause() { 141 override fun onPause() {
@@ -161,17 +144,22 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener {
161 stopMotionSensorListener() 144 stopMotionSensorListener()
162 } 145 }
163 146
147 override fun onUserLeaveHint() {
148 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
149 if (BooleanSetting.PICTURE_IN_PICTURE.boolean && !isInPictureInPictureMode) {
150 val pictureInPictureParamsBuilder = PictureInPictureParams.Builder()
151 .getPictureInPictureActionsBuilder().getPictureInPictureAspectBuilder()
152 enterPictureInPictureMode(pictureInPictureParamsBuilder.build())
153 }
154 }
155 }
156
164 override fun onNewIntent(intent: Intent) { 157 override fun onNewIntent(intent: Intent) {
165 super.onNewIntent(intent) 158 super.onNewIntent(intent)
166 setIntent(intent) 159 setIntent(intent)
167 nfcReader.onNewIntent(intent) 160 nfcReader.onNewIntent(intent)
168 } 161 }
169 162
170 override fun onSaveInstanceState(outState: Bundle) {
171 outState.putParcelable(EXTRA_SELECTED_GAME, game)
172 super.onSaveInstanceState(outState)
173 }
174
175 override fun dispatchKeyEvent(event: KeyEvent): Boolean { 163 override fun dispatchKeyEvent(event: KeyEvent): Boolean {
176 if (event.source and InputDevice.SOURCE_JOYSTICK != InputDevice.SOURCE_JOYSTICK && 164 if (event.source and InputDevice.SOURCE_JOYSTICK != InputDevice.SOURCE_JOYSTICK &&
177 event.source and InputDevice.SOURCE_GAMEPAD != InputDevice.SOURCE_GAMEPAD 165 event.source and InputDevice.SOURCE_GAMEPAD != InputDevice.SOURCE_GAMEPAD
@@ -258,34 +246,107 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener {
258 246
259 override fun onAccuracyChanged(sensor: Sensor, i: Int) {} 247 override fun onAccuracyChanged(sensor: Sensor, i: Int) {}
260 248
261 private fun getAdjustedRotation():Int { 249 private fun enableFullscreenImmersive() {
262 val rotation = getSystemService<DisplayManager>()!!.getDisplay(Display.DEFAULT_DISPLAY).rotation 250 WindowCompat.setDecorFitsSystemWindows(window, false)
263 val config: Configuration = resources.configuration
264 251
265 if ((config.screenLayout and Configuration.SCREENLAYOUT_LONG_YES) != 0 || 252 WindowInsetsControllerCompat(window, window.decorView).let { controller ->
266 (config.screenLayout and Configuration.SCREENLAYOUT_LONG_NO) == 0) { 253 controller.hide(WindowInsetsCompat.Type.systemBars())
267 return rotation 254 controller.systemBarsBehavior =
255 WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
268 } 256 }
269 when (rotation) { 257 }
270 Surface.ROTATION_0 -> return Surface.ROTATION_90 258
271 Surface.ROTATION_90 -> return Surface.ROTATION_0 259 private fun PictureInPictureParams.Builder.getPictureInPictureAspectBuilder():
272 Surface.ROTATION_180 -> return Surface.ROTATION_270 260 PictureInPictureParams.Builder {
273 Surface.ROTATION_270 -> return Surface.ROTATION_180 261 val aspectRatio = when (IntSetting.RENDERER_ASPECT_RATIO.int) {
262 0 -> Rational(16, 9)
263 1 -> Rational(4, 3)
264 2 -> Rational(21, 9)
265 3 -> Rational(16, 10)
266 else -> null // Best fit
274 } 267 }
275 return rotation 268 return this.apply { aspectRatio?.let { setAspectRatio(it) } }
276 } 269 }
277 270
278 private fun restoreState(savedInstanceState: Bundle) { 271 private fun PictureInPictureParams.Builder.getPictureInPictureActionsBuilder():
279 game = savedInstanceState.parcelable(EXTRA_SELECTED_GAME)!! 272 PictureInPictureParams.Builder {
273 val pictureInPictureActions: MutableList<RemoteAction> = mutableListOf()
274 val pendingFlags = PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
275
276 if (NativeLibrary.isPaused()) {
277 val playIcon = Icon.createWithResource(this@EmulationActivity, R.drawable.ic_pip_play)
278 val playPendingIntent = PendingIntent.getBroadcast(
279 this@EmulationActivity,
280 R.drawable.ic_pip_play,
281 Intent(actionPlay),
282 pendingFlags
283 )
284 val playRemoteAction = RemoteAction(
285 playIcon,
286 getString(R.string.play),
287 getString(R.string.play),
288 playPendingIntent
289 )
290 pictureInPictureActions.add(playRemoteAction)
291 } else {
292 val pauseIcon = Icon.createWithResource(this@EmulationActivity, R.drawable.ic_pip_pause)
293 val pausePendingIntent = PendingIntent.getBroadcast(
294 this@EmulationActivity,
295 R.drawable.ic_pip_pause,
296 Intent(actionPause),
297 pendingFlags
298 )
299 val pauseRemoteAction = RemoteAction(
300 pauseIcon,
301 getString(R.string.pause),
302 getString(R.string.pause),
303 pausePendingIntent
304 )
305 pictureInPictureActions.add(pauseRemoteAction)
306 }
307
308 return this.apply { setActions(pictureInPictureActions) }
280 } 309 }
281 310
282 private fun enableFullscreenImmersive() { 311 fun buildPictureInPictureParams() {
283 WindowCompat.setDecorFitsSystemWindows(window, false) 312 val pictureInPictureParamsBuilder = PictureInPictureParams.Builder()
313 .getPictureInPictureActionsBuilder().getPictureInPictureAspectBuilder()
314 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
315 pictureInPictureParamsBuilder.setAutoEnterEnabled(
316 BooleanSetting.PICTURE_IN_PICTURE.boolean
317 )
318 }
319 setPictureInPictureParams(pictureInPictureParamsBuilder.build())
320 }
284 321
285 WindowInsetsControllerCompat(window, window.decorView).let { controller -> 322 private var pictureInPictureReceiver = object : BroadcastReceiver() {
286 controller.hide(WindowInsetsCompat.Type.systemBars()) 323 override fun onReceive(context: Context?, intent: Intent) {
287 controller.systemBarsBehavior = 324 if (intent.action == actionPlay) {
288 WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE 325 if (NativeLibrary.isPaused()) NativeLibrary.unPauseEmulation()
326 } else if (intent.action == actionPause) {
327 if (!NativeLibrary.isPaused()) NativeLibrary.pauseEmulation()
328 }
329 buildPictureInPictureParams()
330 }
331 }
332
333 override fun onPictureInPictureModeChanged(
334 isInPictureInPictureMode: Boolean,
335 newConfig: Configuration
336 ) {
337 super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig)
338 if (isInPictureInPictureMode) {
339 IntentFilter().apply {
340 addAction(actionPause)
341 addAction(actionPlay)
342 }.also {
343 registerReceiver(pictureInPictureReceiver, it)
344 }
345 } else {
346 try {
347 unregisterReceiver(pictureInPictureReceiver)
348 } catch (ignored: Exception) {
349 }
289 } 350 }
290 } 351 }
291 352
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/GameAdapter.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/GameAdapter.kt
index 7f9e2e2d4..e91277d35 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/GameAdapter.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/GameAdapter.kt
@@ -16,6 +16,7 @@ import androidx.appcompat.app.AppCompatActivity
16import androidx.documentfile.provider.DocumentFile 16import androidx.documentfile.provider.DocumentFile
17import androidx.lifecycle.ViewModelProvider 17import androidx.lifecycle.ViewModelProvider
18import androidx.lifecycle.lifecycleScope 18import androidx.lifecycle.lifecycleScope
19import androidx.navigation.findNavController
19import androidx.preference.PreferenceManager 20import androidx.preference.PreferenceManager
20import androidx.recyclerview.widget.AsyncDifferConfig 21import androidx.recyclerview.widget.AsyncDifferConfig
21import androidx.recyclerview.widget.DiffUtil 22import androidx.recyclerview.widget.DiffUtil
@@ -23,13 +24,13 @@ import androidx.recyclerview.widget.ListAdapter
23import androidx.recyclerview.widget.RecyclerView 24import androidx.recyclerview.widget.RecyclerView
24import coil.load 25import coil.load
25import kotlinx.coroutines.launch 26import kotlinx.coroutines.launch
27import org.yuzu.yuzu_emu.HomeNavigationDirections
26import org.yuzu.yuzu_emu.NativeLibrary 28import org.yuzu.yuzu_emu.NativeLibrary
27import org.yuzu.yuzu_emu.R 29import org.yuzu.yuzu_emu.R
28import org.yuzu.yuzu_emu.YuzuApplication 30import org.yuzu.yuzu_emu.YuzuApplication
31import org.yuzu.yuzu_emu.adapters.GameAdapter.GameViewHolder
29import org.yuzu.yuzu_emu.databinding.CardGameBinding 32import org.yuzu.yuzu_emu.databinding.CardGameBinding
30import org.yuzu.yuzu_emu.activities.EmulationActivity
31import org.yuzu.yuzu_emu.model.Game 33import org.yuzu.yuzu_emu.model.Game
32import org.yuzu.yuzu_emu.adapters.GameAdapter.GameViewHolder
33import org.yuzu.yuzu_emu.model.GamesViewModel 34import org.yuzu.yuzu_emu.model.GamesViewModel
34 35
35class GameAdapter(private val activity: AppCompatActivity) : 36class GameAdapter(private val activity: AppCompatActivity) :
@@ -58,7 +59,10 @@ class GameAdapter(private val activity: AppCompatActivity) :
58 override fun onClick(view: View) { 59 override fun onClick(view: View) {
59 val holder = view.tag as GameViewHolder 60 val holder = view.tag as GameViewHolder
60 61
61 val gameExists = DocumentFile.fromSingleUri(YuzuApplication.appContext, Uri.parse(holder.game.path))?.exists() == true 62 val gameExists = DocumentFile.fromSingleUri(
63 YuzuApplication.appContext,
64 Uri.parse(holder.game.path)
65 )?.exists() == true
62 if (!gameExists) { 66 if (!gameExists) {
63 Toast.makeText( 67 Toast.makeText(
64 YuzuApplication.appContext, 68 YuzuApplication.appContext,
@@ -78,7 +82,8 @@ class GameAdapter(private val activity: AppCompatActivity) :
78 ) 82 )
79 .apply() 83 .apply()
80 84
81 EmulationActivity.launch(activity, holder.game) 85 val action = HomeNavigationDirections.actionGlobalEmulationActivity(holder.game)
86 view.findNavController().navigate(action)
82 } 87 }
83 88
84 inner class GameViewHolder(val binding: CardGameBinding) : 89 inner class GameViewHolder(val binding: CardGameBinding) :
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/HomeSettingAdapter.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/HomeSettingAdapter.kt
index b719dd539..d3df3bc81 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/HomeSettingAdapter.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/HomeSettingAdapter.kt
@@ -58,11 +58,12 @@ class HomeSettingAdapter(private val activity: AppCompatActivity, var options: L
58 ) 58 )
59 59
60 when (option.titleId) { 60 when (option.titleId) {
61 R.string.get_early_access -> binding.optionLayout.background = 61 R.string.get_early_access ->
62 ContextCompat.getDrawable( 62 binding.optionLayout.background =
63 binding.optionCard.context, 63 ContextCompat.getDrawable(
64 R.drawable.premium_background 64 binding.optionCard.context,
65 ) 65 R.drawable.premium_background
66 )
66 } 67 }
67 } 68 }
68 } 69 }
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/applets/keyboard/SoftwareKeyboard.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/applets/keyboard/SoftwareKeyboard.kt
index 82a6712b6..e058067c9 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/applets/keyboard/SoftwareKeyboard.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/applets/keyboard/SoftwareKeyboard.kt
@@ -12,10 +12,10 @@ import android.view.WindowInsets
12import android.view.inputmethod.InputMethodManager 12import android.view.inputmethod.InputMethodManager
13import androidx.annotation.Keep 13import androidx.annotation.Keep
14import androidx.core.view.ViewCompat 14import androidx.core.view.ViewCompat
15import java.io.Serializable
15import org.yuzu.yuzu_emu.NativeLibrary 16import org.yuzu.yuzu_emu.NativeLibrary
16import org.yuzu.yuzu_emu.R 17import org.yuzu.yuzu_emu.R
17import org.yuzu.yuzu_emu.applets.keyboard.ui.KeyboardDialogFragment 18import org.yuzu.yuzu_emu.applets.keyboard.ui.KeyboardDialogFragment
18import java.io.Serializable
19 19
20@Keep 20@Keep
21object SoftwareKeyboard { 21object SoftwareKeyboard {
@@ -40,19 +40,22 @@ object SoftwareKeyboard {
40 // There isn't a good way to know that the IMM is dismissed, so poll every 500ms to submit inline keyboard result. 40 // There isn't a good way to know that the IMM is dismissed, so poll every 500ms to submit inline keyboard result.
41 val handler = Handler(Looper.myLooper()!!) 41 val handler = Handler(Looper.myLooper()!!)
42 val delayMs = 500 42 val delayMs = 500
43 handler.postDelayed(object : Runnable { 43 handler.postDelayed(
44 override fun run() { 44 object : Runnable {
45 val insets = ViewCompat.getRootWindowInsets(overlayView) 45 override fun run() {
46 val isKeyboardVisible = insets!!.isVisible(WindowInsets.Type.ime()) 46 val insets = ViewCompat.getRootWindowInsets(overlayView)
47 if (isKeyboardVisible) { 47 val isKeyboardVisible = insets!!.isVisible(WindowInsets.Type.ime())
48 handler.postDelayed(this, delayMs.toLong()) 48 if (isKeyboardVisible) {
49 return 49 handler.postDelayed(this, delayMs.toLong())
50 } 50 return
51 }
51 52
52 // No longer visible, submit the result. 53 // No longer visible, submit the result.
53 NativeLibrary.submitInlineKeyboardInput(KeyEvent.KEYCODE_ENTER) 54 NativeLibrary.submitInlineKeyboardInput(KeyEvent.KEYCODE_ENTER)
54 } 55 }
55 }, delayMs.toLong()) 56 },
57 delayMs.toLong()
58 )
56 } 59 }
57 60
58 @JvmStatic 61 @JvmStatic
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/disk_shader_cache/DiskShaderCacheProgress.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/disk_shader_cache/DiskShaderCacheProgress.kt
index 3b1559c80..a18efef19 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/disk_shader_cache/DiskShaderCacheProgress.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/disk_shader_cache/DiskShaderCacheProgress.kt
@@ -20,7 +20,10 @@ object DiskShaderCacheProgress {
20 emulationActivity.getString(R.string.loading), 20 emulationActivity.getString(R.string.loading),
21 emulationActivity.getString(R.string.preparing_shaders) 21 emulationActivity.getString(R.string.preparing_shaders)
22 ) 22 )
23 fragment.show(emulationActivity.supportFragmentManager, ShaderProgressDialogFragment.TAG) 23 fragment.show(
24 emulationActivity.supportFragmentManager,
25 ShaderProgressDialogFragment.TAG
26 )
24 } 27 }
25 synchronized(finishLock) { finishLock.wait() } 28 synchronized(finishLock) { finishLock.wait() }
26 } 29 }
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/disk_shader_cache/ui/ShaderProgressDialogFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/disk_shader_cache/ui/ShaderProgressDialogFragment.kt
index 2c68c9ac3..8a8e0a6e8 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/disk_shader_cache/ui/ShaderProgressDialogFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/disk_shader_cache/ui/ShaderProgressDialogFragment.kt
@@ -62,7 +62,9 @@ class ShaderProgressDialogFragment : DialogFragment() {
62 shaderProgressViewModel.message.observe(viewLifecycleOwner) { msg -> 62 shaderProgressViewModel.message.observe(viewLifecycleOwner) { msg ->
63 alertDialog.setMessage(msg) 63 alertDialog.setMessage(msg)
64 } 64 }
65 synchronized(DiskShaderCacheProgress.finishLock) { DiskShaderCacheProgress.finishLock.notifyAll() } 65 synchronized(DiskShaderCacheProgress.finishLock) {
66 DiskShaderCacheProgress.finishLock.notifyAll()
67 }
66 } 68 }
67 69
68 override fun onDestroyView() { 70 override fun onDestroyView() {
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/DocumentProvider.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/DocumentProvider.kt
index 4c3a9ca80..f3be156b5 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/DocumentProvider.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/DocumentProvider.kt
@@ -13,11 +13,11 @@ import android.os.ParcelFileDescriptor
13import android.provider.DocumentsContract 13import android.provider.DocumentsContract
14import android.provider.DocumentsProvider 14import android.provider.DocumentsProvider
15import android.webkit.MimeTypeMap 15import android.webkit.MimeTypeMap
16import java.io.*
16import org.yuzu.yuzu_emu.BuildConfig 17import org.yuzu.yuzu_emu.BuildConfig
17import org.yuzu.yuzu_emu.R 18import org.yuzu.yuzu_emu.R
18import org.yuzu.yuzu_emu.YuzuApplication 19import org.yuzu.yuzu_emu.YuzuApplication
19import org.yuzu.yuzu_emu.getPublicFilesDir 20import org.yuzu.yuzu_emu.getPublicFilesDir
20import java.io.*
21 21
22class DocumentProvider : DocumentsProvider() { 22class DocumentProvider : DocumentsProvider() {
23 private val baseDirectory: File 23 private val baseDirectory: File
@@ -44,7 +44,7 @@ class DocumentProvider : DocumentsProvider() {
44 DocumentsContract.Document.COLUMN_SIZE 44 DocumentsContract.Document.COLUMN_SIZE
45 ) 45 )
46 46
47 const val AUTHORITY : String = BuildConfig.APPLICATION_ID + ".user" 47 const val AUTHORITY: String = BuildConfig.APPLICATION_ID + ".user"
48 const val ROOT_ID: String = "root" 48 const val ROOT_ID: String = "root"
49 } 49 }
50 50
@@ -58,7 +58,11 @@ class DocumentProvider : DocumentsProvider() {
58 private fun getFile(documentId: String): File { 58 private fun getFile(documentId: String): File {
59 if (documentId.startsWith(ROOT_ID)) { 59 if (documentId.startsWith(ROOT_ID)) {
60 val file = baseDirectory.resolve(documentId.drop(ROOT_ID.length + 1)) 60 val file = baseDirectory.resolve(documentId.drop(ROOT_ID.length + 1))
61 if (!file.exists()) throw FileNotFoundException("${file.absolutePath} ($documentId) not found") 61 if (!file.exists()) {
62 throw FileNotFoundException(
63 "${file.absolutePath} ($documentId) not found"
64 )
65 }
62 return file 66 return file
63 } else { 67 } else {
64 throw FileNotFoundException("'$documentId' is not in any known root") 68 throw FileNotFoundException("'$documentId' is not in any known root")
@@ -80,7 +84,8 @@ class DocumentProvider : DocumentsProvider() {
80 add(DocumentsContract.Root.COLUMN_SUMMARY, null) 84 add(DocumentsContract.Root.COLUMN_SUMMARY, null)
81 add( 85 add(
82 DocumentsContract.Root.COLUMN_FLAGS, 86 DocumentsContract.Root.COLUMN_FLAGS,
83 DocumentsContract.Root.FLAG_SUPPORTS_CREATE or DocumentsContract.Root.FLAG_SUPPORTS_IS_CHILD 87 DocumentsContract.Root.FLAG_SUPPORTS_CREATE or
88 DocumentsContract.Root.FLAG_SUPPORTS_IS_CHILD
84 ) 89 )
85 add(DocumentsContract.Root.COLUMN_TITLE, context!!.getString(R.string.app_name)) 90 add(DocumentsContract.Root.COLUMN_TITLE, context!!.getString(R.string.app_name))
86 add(DocumentsContract.Root.COLUMN_DOCUMENT_ID, getDocumentId(baseDirectory)) 91 add(DocumentsContract.Root.COLUMN_DOCUMENT_ID, getDocumentId(baseDirectory))
@@ -127,11 +132,13 @@ class DocumentProvider : DocumentsProvider() {
127 132
128 try { 133 try {
129 if (DocumentsContract.Document.MIME_TYPE_DIR == mimeType) { 134 if (DocumentsContract.Document.MIME_TYPE_DIR == mimeType) {
130 if (!newFile.mkdir()) 135 if (!newFile.mkdir()) {
131 throw IOException("Failed to create directory") 136 throw IOException("Failed to create directory")
137 }
132 } else { 138 } else {
133 if (!newFile.createNewFile()) 139 if (!newFile.createNewFile()) {
134 throw IOException("Failed to create file") 140 throw IOException("Failed to create file")
141 }
135 } 142 }
136 } catch (e: IOException) { 143 } catch (e: IOException) {
137 throw FileNotFoundException("Couldn't create document '${newFile.path}': ${e.message}") 144 throw FileNotFoundException("Couldn't create document '${newFile.path}': ${e.message}")
@@ -142,8 +149,9 @@ class DocumentProvider : DocumentsProvider() {
142 149
143 override fun deleteDocument(documentId: String?) { 150 override fun deleteDocument(documentId: String?) {
144 val file = getFile(documentId!!) 151 val file = getFile(documentId!!)
145 if (!file.delete()) 152 if (!file.delete()) {
146 throw FileNotFoundException("Couldn't delete document with ID '$documentId'") 153 throw FileNotFoundException("Couldn't delete document with ID '$documentId'")
154 }
147 } 155 }
148 156
149 override fun removeDocument(documentId: String, parentDocumentId: String?) { 157 override fun removeDocument(documentId: String, parentDocumentId: String?) {
@@ -151,38 +159,55 @@ class DocumentProvider : DocumentsProvider() {
151 val file = getFile(documentId) 159 val file = getFile(documentId)
152 160
153 if (parent == file || file.parentFile == null || file.parentFile!! == parent) { 161 if (parent == file || file.parentFile == null || file.parentFile!! == parent) {
154 if (!file.delete()) 162 if (!file.delete()) {
155 throw FileNotFoundException("Couldn't delete document with ID '$documentId'") 163 throw FileNotFoundException("Couldn't delete document with ID '$documentId'")
164 }
156 } else { 165 } else {
157 throw FileNotFoundException("Couldn't delete document with ID '$documentId'") 166 throw FileNotFoundException("Couldn't delete document with ID '$documentId'")
158 } 167 }
159 } 168 }
160 169
161 override fun renameDocument(documentId: String?, displayName: String?): String { 170 override fun renameDocument(documentId: String?, displayName: String?): String {
162 if (displayName == null) 171 if (displayName == null) {
163 throw FileNotFoundException("Couldn't rename document '$documentId' as the new name is null") 172 throw FileNotFoundException(
173 "Couldn't rename document '$documentId' as the new name is null"
174 )
175 }
164 176
165 val sourceFile = getFile(documentId!!) 177 val sourceFile = getFile(documentId!!)
166 val sourceParentFile = sourceFile.parentFile 178 val sourceParentFile = sourceFile.parentFile
167 ?: throw FileNotFoundException("Couldn't rename document '$documentId' as it has no parent") 179 ?: throw FileNotFoundException(
180 "Couldn't rename document '$documentId' as it has no parent"
181 )
168 val destFile = sourceParentFile.resolve(displayName) 182 val destFile = sourceParentFile.resolve(displayName)
169 183
170 try { 184 try {
171 if (!sourceFile.renameTo(destFile)) 185 if (!sourceFile.renameTo(destFile)) {
172 throw FileNotFoundException("Couldn't rename document from '${sourceFile.name}' to '${destFile.name}'") 186 throw FileNotFoundException(
187 "Couldn't rename document from '${sourceFile.name}' to '${destFile.name}'"
188 )
189 }
173 } catch (e: Exception) { 190 } catch (e: Exception) {
174 throw FileNotFoundException("Couldn't rename document from '${sourceFile.name}' to '${destFile.name}': ${e.message}") 191 throw FileNotFoundException(
192 "Couldn't rename document from '${sourceFile.name}' to '${destFile.name}': " +
193 "${e.message}"
194 )
175 } 195 }
176 196
177 return getDocumentId(destFile) 197 return getDocumentId(destFile)
178 } 198 }
179 199
180 private fun copyDocument( 200 private fun copyDocument(
181 sourceDocumentId: String, sourceParentDocumentId: String, 201 sourceDocumentId: String,
202 sourceParentDocumentId: String,
182 targetParentDocumentId: String? 203 targetParentDocumentId: String?
183 ): String { 204 ): String {
184 if (!isChildDocument(sourceParentDocumentId, sourceDocumentId)) 205 if (!isChildDocument(sourceParentDocumentId, sourceDocumentId)) {
185 throw FileNotFoundException("Couldn't copy document '$sourceDocumentId' as its parent is not '$sourceParentDocumentId'") 206 throw FileNotFoundException(
207 "Couldn't copy document '$sourceDocumentId' as its parent is not " +
208 "'$sourceParentDocumentId'"
209 )
210 }
186 211
187 return copyDocument(sourceDocumentId, targetParentDocumentId) 212 return copyDocument(sourceDocumentId, targetParentDocumentId)
188 } 213 }
@@ -193,8 +218,13 @@ class DocumentProvider : DocumentsProvider() {
193 val newFile = parent.resolveWithoutConflict(oldFile.name) 218 val newFile = parent.resolveWithoutConflict(oldFile.name)
194 219
195 try { 220 try {
196 if (!(newFile.createNewFile() && newFile.setWritable(true) && newFile.setReadable(true))) 221 if (!(
222 newFile.createNewFile() && newFile.setWritable(true) &&
223 newFile.setReadable(true)
224 )
225 ) {
197 throw IOException("Couldn't create new file") 226 throw IOException("Couldn't create new file")
227 }
198 228
199 FileInputStream(oldFile).use { inStream -> 229 FileInputStream(oldFile).use { inStream ->
200 FileOutputStream(newFile).use { outStream -> 230 FileOutputStream(newFile).use { outStream ->
@@ -209,12 +239,14 @@ class DocumentProvider : DocumentsProvider() {
209 } 239 }
210 240
211 override fun moveDocument( 241 override fun moveDocument(
212 sourceDocumentId: String, sourceParentDocumentId: String?, 242 sourceDocumentId: String,
243 sourceParentDocumentId: String?,
213 targetParentDocumentId: String? 244 targetParentDocumentId: String?
214 ): String { 245 ): String {
215 try { 246 try {
216 val newDocumentId = copyDocument( 247 val newDocumentId = copyDocument(
217 sourceDocumentId, sourceParentDocumentId!!, 248 sourceDocumentId,
249 sourceParentDocumentId!!,
218 targetParentDocumentId 250 targetParentDocumentId
219 ) 251 )
220 removeDocument(sourceDocumentId, sourceParentDocumentId) 252 removeDocument(sourceDocumentId, sourceParentDocumentId)
@@ -245,24 +277,30 @@ class DocumentProvider : DocumentsProvider() {
245 add(DocumentsContract.Document.COLUMN_DOCUMENT_ID, localDocumentId) 277 add(DocumentsContract.Document.COLUMN_DOCUMENT_ID, localDocumentId)
246 add( 278 add(
247 DocumentsContract.Document.COLUMN_DISPLAY_NAME, 279 DocumentsContract.Document.COLUMN_DISPLAY_NAME,
248 if (localFile == baseDirectory) context!!.getString(R.string.app_name) else localFile.name 280 if (localFile == baseDirectory) {
281 context!!.getString(R.string.app_name)
282 } else {
283 localFile.name
284 }
249 ) 285 )
250 add(DocumentsContract.Document.COLUMN_SIZE, localFile.length()) 286 add(DocumentsContract.Document.COLUMN_SIZE, localFile.length())
251 add(DocumentsContract.Document.COLUMN_MIME_TYPE, getTypeForFile(localFile)) 287 add(DocumentsContract.Document.COLUMN_MIME_TYPE, getTypeForFile(localFile))
252 add(DocumentsContract.Document.COLUMN_LAST_MODIFIED, localFile.lastModified()) 288 add(DocumentsContract.Document.COLUMN_LAST_MODIFIED, localFile.lastModified())
253 add(DocumentsContract.Document.COLUMN_FLAGS, flags) 289 add(DocumentsContract.Document.COLUMN_FLAGS, flags)
254 if (localFile == baseDirectory) 290 if (localFile == baseDirectory) {
255 add(DocumentsContract.Root.COLUMN_ICON, R.drawable.ic_yuzu) 291 add(DocumentsContract.Root.COLUMN_ICON, R.drawable.ic_yuzu)
292 }
256 } 293 }
257 294
258 return cursor 295 return cursor
259 } 296 }
260 297
261 private fun getTypeForFile(file: File): Any { 298 private fun getTypeForFile(file: File): Any {
262 return if (file.isDirectory) 299 return if (file.isDirectory) {
263 DocumentsContract.Document.MIME_TYPE_DIR 300 DocumentsContract.Document.MIME_TYPE_DIR
264 else 301 } else {
265 getTypeForName(file.name) 302 getTypeForName(file.name)
303 }
266 } 304 }
267 305
268 private fun getTypeForName(name: String): Any { 306 private fun getTypeForName(name: String): Any {
@@ -270,8 +308,9 @@ class DocumentProvider : DocumentsProvider() {
270 if (lastDot >= 0) { 308 if (lastDot >= 0) {
271 val extension = name.substring(lastDot + 1) 309 val extension = name.substring(lastDot + 1)
272 val mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension) 310 val mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension)
273 if (mime != null) 311 if (mime != null) {
274 return mime 312 return mime
313 }
275 } 314 }
276 return "application/octect-stream" 315 return "application/octect-stream"
277 } 316 }
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt
index 3dfd66779..d41933766 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt
@@ -8,6 +8,10 @@ enum class BooleanSetting(
8 override val section: String, 8 override val section: String,
9 override val defaultValue: Boolean 9 override val defaultValue: Boolean
10) : AbstractBooleanSetting { 10) : AbstractBooleanSetting {
11 CPU_DEBUG_MODE("cpu_debug_mode", Settings.SECTION_CPU, false),
12 FASTMEM("cpuopt_fastmem", Settings.SECTION_CPU, true),
13 FASTMEM_EXCLUSIVES("cpuopt_fastmem_exclusives", Settings.SECTION_CPU, true),
14 PICTURE_IN_PICTURE("picture_in_picture", Settings.SECTION_GENERAL, true),
11 USE_CUSTOM_RTC("custom_rtc_enabled", Settings.SECTION_SYSTEM, false); 15 USE_CUSTOM_RTC("custom_rtc_enabled", Settings.SECTION_SYSTEM, false);
12 16
13 override var boolean: Boolean = defaultValue 17 override var boolean: Boolean = defaultValue
@@ -27,6 +31,7 @@ enum class BooleanSetting(
27 31
28 companion object { 32 companion object {
29 private val NOT_RUNTIME_EDITABLE = listOf( 33 private val NOT_RUNTIME_EDITABLE = listOf(
34 PICTURE_IN_PICTURE,
30 USE_CUSTOM_RTC 35 USE_CUSTOM_RTC
31 ) 36 )
32 37
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/IntSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/IntSetting.kt
index c5722a5a1..4427a7d9d 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/IntSetting.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/IntSetting.kt
@@ -26,13 +26,18 @@ enum class IntSetting(
26 RENDERER_FORCE_MAX_CLOCK( 26 RENDERER_FORCE_MAX_CLOCK(
27 "force_max_clock", 27 "force_max_clock",
28 Settings.SECTION_RENDERER, 28 Settings.SECTION_RENDERER,
29 1 29 0
30 ), 30 ),
31 RENDERER_ASYNCHRONOUS_SHADERS( 31 RENDERER_ASYNCHRONOUS_SHADERS(
32 "use_asynchronous_shaders", 32 "use_asynchronous_shaders",
33 Settings.SECTION_RENDERER, 33 Settings.SECTION_RENDERER,
34 0 34 0
35 ), 35 ),
36 RENDERER_REACTIVE_FLUSHING(
37 "use_reactive_flushing",
38 Settings.SECTION_RENDERER,
39 0
40 ),
36 RENDERER_DEBUG( 41 RENDERER_DEBUG(
37 "debug", 42 "debug",
38 Settings.SECTION_RENDERER, 43 Settings.SECTION_RENDERER,
@@ -88,6 +93,11 @@ enum class IntSetting(
88 Settings.SECTION_RENDERER, 93 Settings.SECTION_RENDERER,
89 0 94 0
90 ), 95 ),
96 RENDERER_SCREEN_LAYOUT(
97 "screen_layout",
98 Settings.SECTION_RENDERER,
99 Settings.LayoutOption_MobileLandscape
100 ),
91 RENDERER_ASPECT_RATIO( 101 RENDERER_ASPECT_RATIO(
92 "aspect_ratio", 102 "aspect_ratio",
93 Settings.SECTION_RENDERER, 103 Settings.SECTION_RENDERER,
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/Settings.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/Settings.kt
index 8df20b928..88afb2223 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/Settings.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/Settings.kt
@@ -4,11 +4,11 @@
4package org.yuzu.yuzu_emu.features.settings.model 4package org.yuzu.yuzu_emu.features.settings.model
5 5
6import android.text.TextUtils 6import android.text.TextUtils
7import java.util.*
7import org.yuzu.yuzu_emu.R 8import org.yuzu.yuzu_emu.R
8import org.yuzu.yuzu_emu.YuzuApplication 9import org.yuzu.yuzu_emu.YuzuApplication
9import org.yuzu.yuzu_emu.features.settings.ui.SettingsActivityView 10import org.yuzu.yuzu_emu.features.settings.ui.SettingsActivityView
10import org.yuzu.yuzu_emu.features.settings.utils.SettingsFile 11import org.yuzu.yuzu_emu.features.settings.utils.SettingsFile
11import java.util.*
12 12
13class Settings { 13class Settings {
14 private var gameId: String? = null 14 private var gameId: String? = null
@@ -133,7 +133,6 @@ class Settings {
133 const val PREF_MENU_SETTINGS_JOYSTICK_REL_CENTER = "EmulationMenuSettings_JoystickRelCenter" 133 const val PREF_MENU_SETTINGS_JOYSTICK_REL_CENTER = "EmulationMenuSettings_JoystickRelCenter"
134 const val PREF_MENU_SETTINGS_DPAD_SLIDE = "EmulationMenuSettings_DpadSlideEnable" 134 const val PREF_MENU_SETTINGS_DPAD_SLIDE = "EmulationMenuSettings_DpadSlideEnable"
135 const val PREF_MENU_SETTINGS_HAPTICS = "EmulationMenuSettings_Haptics" 135 const val PREF_MENU_SETTINGS_HAPTICS = "EmulationMenuSettings_Haptics"
136 const val PREF_MENU_SETTINGS_LANDSCAPE = "EmulationMenuSettings_LandscapeScreenLayout"
137 const val PREF_MENU_SETTINGS_SHOW_FPS = "EmulationMenuSettings_ShowFps" 136 const val PREF_MENU_SETTINGS_SHOW_FPS = "EmulationMenuSettings_ShowFps"
138 const val PREF_MENU_SETTINGS_SHOW_OVERLAY = "EmulationMenuSettings_ShowOverlay" 137 const val PREF_MENU_SETTINGS_SHOW_OVERLAY = "EmulationMenuSettings_ShowOverlay"
139 138
@@ -144,6 +143,10 @@ class Settings {
144 143
145 private val configFileSectionsMap: MutableMap<String, List<String>> = HashMap() 144 private val configFileSectionsMap: MutableMap<String, List<String>> = HashMap()
146 145
146 const val LayoutOption_Unspecified = 0
147 const val LayoutOption_MobilePortrait = 4
148 const val LayoutOption_MobileLandscape = 5
149
147 init { 150 init {
148 configFileSectionsMap[SettingsFile.FILE_NAME_CONFIG] = 151 configFileSectionsMap[SettingsFile.FILE_NAME_CONFIG] =
149 listOf( 152 listOf(
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/StringSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/StringSetting.kt
index 63f95690c..6621289fd 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/StringSetting.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/StringSetting.kt
@@ -8,6 +8,7 @@ enum class StringSetting(
8 override val section: String, 8 override val section: String,
9 override val defaultValue: String 9 override val defaultValue: String
10) : AbstractStringSetting { 10) : AbstractStringSetting {
11 AUDIO_OUTPUT_ENGINE("output_engine", Settings.SECTION_AUDIO, "auto"),
11 CUSTOM_RTC("custom_rtc", Settings.SECTION_SYSTEM, "0"); 12 CUSTOM_RTC("custom_rtc", Settings.SECTION_SYSTEM, "0");
12 13
13 override var string: String = defaultValue 14 override var string: String = defaultValue
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/HeaderSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/HeaderSetting.kt
index 0f8edbfb0..a67001311 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/HeaderSetting.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/HeaderSetting.kt
@@ -3,12 +3,8 @@
3 3
4package org.yuzu.yuzu_emu.features.settings.model.view 4package org.yuzu.yuzu_emu.features.settings.model.view
5 5
6import org.yuzu.yuzu_emu.features.settings.model.AbstractSetting
7
8class HeaderSetting( 6class HeaderSetting(
9 setting: AbstractSetting?, 7 titleId: Int
10 titleId: Int, 8) : SettingsItem(null, titleId, 0) {
11 descriptionId: Int
12) : SettingsItem(setting, titleId, descriptionId) {
13 override val type = TYPE_HEADER 9 override val type = TYPE_HEADER
14} 10}
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SingleChoiceSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SingleChoiceSetting.kt
index 9eac9904e..7306ec458 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SingleChoiceSetting.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SingleChoiceSetting.kt
@@ -4,7 +4,6 @@
4package org.yuzu.yuzu_emu.features.settings.model.view 4package org.yuzu.yuzu_emu.features.settings.model.view
5 5
6import org.yuzu.yuzu_emu.features.settings.model.AbstractIntSetting 6import org.yuzu.yuzu_emu.features.settings.model.AbstractIntSetting
7import org.yuzu.yuzu_emu.features.settings.model.IntSetting
8 7
9class SingleChoiceSetting( 8class SingleChoiceSetting(
10 setting: AbstractIntSetting?, 9 setting: AbstractIntSetting?,
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SliderSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SliderSetting.kt
index 842648ce4..92d0167ae 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SliderSetting.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SliderSetting.kt
@@ -3,13 +3,11 @@
3 3
4package org.yuzu.yuzu_emu.features.settings.model.view 4package org.yuzu.yuzu_emu.features.settings.model.view
5 5
6import kotlin.math.roundToInt
6import org.yuzu.yuzu_emu.features.settings.model.AbstractFloatSetting 7import org.yuzu.yuzu_emu.features.settings.model.AbstractFloatSetting
7import org.yuzu.yuzu_emu.features.settings.model.AbstractIntSetting 8import org.yuzu.yuzu_emu.features.settings.model.AbstractIntSetting
8import org.yuzu.yuzu_emu.features.settings.model.AbstractSetting 9import org.yuzu.yuzu_emu.features.settings.model.AbstractSetting
9import org.yuzu.yuzu_emu.features.settings.model.FloatSetting
10import org.yuzu.yuzu_emu.features.settings.model.IntSetting
11import org.yuzu.yuzu_emu.utils.Log 10import org.yuzu.yuzu_emu.utils.Log
12import kotlin.math.roundToInt
13 11
14class SliderSetting( 12class SliderSetting(
15 setting: AbstractSetting?, 13 setting: AbstractSetting?,
@@ -19,7 +17,7 @@ class SliderSetting(
19 val max: Int, 17 val max: Int,
20 val units: String, 18 val units: String,
21 val key: String? = null, 19 val key: String? = null,
22 val defaultValue: Int? = null, 20 val defaultValue: Int? = null
23) : SettingsItem(setting, titleId, descriptionId) { 21) : SettingsItem(setting, titleId, descriptionId) {
24 override val type = TYPE_SLIDER 22 override val type = TYPE_SLIDER
25 23
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/StringSingleChoiceSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/StringSingleChoiceSetting.kt
index 9e9b00d10..3b6731dcd 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/StringSingleChoiceSetting.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/StringSingleChoiceSetting.kt
@@ -5,24 +5,25 @@ package org.yuzu.yuzu_emu.features.settings.model.view
5 5
6import org.yuzu.yuzu_emu.features.settings.model.AbstractSetting 6import org.yuzu.yuzu_emu.features.settings.model.AbstractSetting
7import org.yuzu.yuzu_emu.features.settings.model.AbstractStringSetting 7import org.yuzu.yuzu_emu.features.settings.model.AbstractStringSetting
8import org.yuzu.yuzu_emu.features.settings.model.StringSetting
9 8
10class StringSingleChoiceSetting( 9class StringSingleChoiceSetting(
11 val key: String? = null,
12 setting: AbstractSetting?, 10 setting: AbstractSetting?,
13 titleId: Int, 11 titleId: Int,
14 descriptionId: Int, 12 descriptionId: Int,
15 val choicesId: Array<String>, 13 val choices: Array<String>,
16 private val valuesId: Array<String>?, 14 val values: Array<String>?,
15 val key: String? = null,
17 private val defaultValue: String? = null 16 private val defaultValue: String? = null
18) : SettingsItem(setting, titleId, descriptionId) { 17) : SettingsItem(setting, titleId, descriptionId) {
19 override val type = TYPE_STRING_SINGLE_CHOICE 18 override val type = TYPE_STRING_SINGLE_CHOICE
20 19
21 fun getValueAt(index: Int): String? { 20 fun getValueAt(index: Int): String? {
22 if (valuesId == null) return null 21 if (values == null) return null
23 return if (index >= 0 && index < valuesId.size) { 22 return if (index >= 0 && index < values.size) {
24 valuesId[index] 23 values[index]
25 } else "" 24 } else {
25 ""
26 }
26 } 27 }
27 28
28 val selectedValue: String 29 val selectedValue: String
@@ -35,8 +36,8 @@ class StringSingleChoiceSetting(
35 val selectValueIndex: Int 36 val selectValueIndex: Int
36 get() { 37 get() {
37 val selectedValue = selectedValue 38 val selectedValue = selectedValue
38 for (i in valuesId!!.indices) { 39 for (i in values!!.indices) {
39 if (valuesId[i] == selectedValue) { 40 if (values[i] == selectedValue) {
40 return i 41 return i
41 } 42 }
42 } 43 }
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SubmenuSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SubmenuSetting.kt
index a3ef59c2f..8a9d13a92 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SubmenuSetting.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SubmenuSetting.kt
@@ -3,8 +3,6 @@
3 3
4package org.yuzu.yuzu_emu.features.settings.model.view 4package org.yuzu.yuzu_emu.features.settings.model.view
5 5
6import org.yuzu.yuzu_emu.features.settings.model.AbstractSetting
7
8class SubmenuSetting( 6class SubmenuSetting(
9 titleId: Int, 7 titleId: Int,
10 descriptionId: Int, 8 descriptionId: Int,
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 72e2cce2a..a5af5a7ae 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
@@ -8,17 +8,18 @@ import android.content.Intent
8import android.os.Bundle 8import android.os.Bundle
9import android.view.Menu 9import android.view.Menu
10import android.view.View 10import android.view.View
11import android.view.ViewGroup.MarginLayoutParams
11import android.widget.Toast 12import android.widget.Toast
13import androidx.activity.OnBackPressedCallback
14import androidx.activity.result.ActivityResultLauncher
12import androidx.activity.viewModels 15import androidx.activity.viewModels
13import androidx.appcompat.app.AppCompatActivity 16import androidx.appcompat.app.AppCompatActivity
14import androidx.core.view.ViewCompat 17import androidx.core.view.ViewCompat
15import androidx.core.view.WindowCompat 18import androidx.core.view.WindowCompat
16import androidx.core.view.WindowInsetsCompat 19import androidx.core.view.WindowInsetsCompat
17import android.view.ViewGroup.MarginLayoutParams
18import androidx.activity.OnBackPressedCallback
19import androidx.core.view.updatePadding 20import androidx.core.view.updatePadding
20import com.google.android.material.color.MaterialColors 21import com.google.android.material.color.MaterialColors
21import org.yuzu.yuzu_emu.NativeLibrary 22import java.io.IOException
22import org.yuzu.yuzu_emu.R 23import org.yuzu.yuzu_emu.R
23import org.yuzu.yuzu_emu.databinding.ActivitySettingsBinding 24import org.yuzu.yuzu_emu.databinding.ActivitySettingsBinding
24import org.yuzu.yuzu_emu.features.settings.model.BooleanSetting 25import org.yuzu.yuzu_emu.features.settings.model.BooleanSetting
@@ -29,7 +30,6 @@ import org.yuzu.yuzu_emu.features.settings.model.SettingsViewModel
29import org.yuzu.yuzu_emu.features.settings.model.StringSetting 30import org.yuzu.yuzu_emu.features.settings.model.StringSetting
30import org.yuzu.yuzu_emu.features.settings.utils.SettingsFile 31import org.yuzu.yuzu_emu.features.settings.utils.SettingsFile
31import org.yuzu.yuzu_emu.utils.* 32import org.yuzu.yuzu_emu.utils.*
32import java.io.IOException
33 33
34class SettingsActivity : AppCompatActivity(), SettingsActivityView { 34class SettingsActivity : AppCompatActivity(), SettingsActivityView {
35 private val presenter = SettingsActivityPresenter(this) 35 private val presenter = SettingsActivityPresenter(this)
@@ -59,7 +59,9 @@ class SettingsActivity : AppCompatActivity(), SettingsActivityView {
59 setSupportActionBar(binding.toolbarSettings) 59 setSupportActionBar(binding.toolbarSettings)
60 supportActionBar!!.setDisplayHomeAsUpEnabled(true) 60 supportActionBar!!.setDisplayHomeAsUpEnabled(true)
61 61
62 if (InsetsHelper.getSystemGestureType(applicationContext) != InsetsHelper.GESTURE_NAVIGATION) { 62 if (InsetsHelper.getSystemGestureType(applicationContext) !=
63 InsetsHelper.GESTURE_NAVIGATION
64 ) {
63 binding.navigationBarShade.setBackgroundColor( 65 binding.navigationBarShade.setBackgroundColor(
64 ThemeHelper.getColorWithOpacity( 66 ThemeHelper.getColorWithOpacity(
65 MaterialColors.getColor( 67 MaterialColors.getColor(
@@ -75,7 +77,8 @@ class SettingsActivity : AppCompatActivity(), SettingsActivityView {
75 this, 77 this,
76 object : OnBackPressedCallback(true) { 78 object : OnBackPressedCallback(true) {
77 override fun handleOnBackPressed() = navigateBack() 79 override fun handleOnBackPressed() = navigateBack()
78 }) 80 }
81 )
79 82
80 setInsets() 83 setInsets()
81 } 84 }
@@ -148,11 +151,13 @@ class SettingsActivity : AppCompatActivity(), SettingsActivityView {
148 private fun areSystemAnimationsEnabled(): Boolean { 151 private fun areSystemAnimationsEnabled(): Boolean {
149 val duration = android.provider.Settings.Global.getFloat( 152 val duration = android.provider.Settings.Global.getFloat(
150 contentResolver, 153 contentResolver,
151 android.provider.Settings.Global.ANIMATOR_DURATION_SCALE, 1f 154 android.provider.Settings.Global.ANIMATOR_DURATION_SCALE,
155 1f
152 ) 156 )
153 val transition = android.provider.Settings.Global.getFloat( 157 val transition = android.provider.Settings.Global.getFloat(
154 contentResolver, 158 contentResolver,
155 android.provider.Settings.Global.TRANSITION_ANIMATION_SCALE, 1f 159 android.provider.Settings.Global.TRANSITION_ANIMATION_SCALE,
160 1f
156 ) 161 )
157 return duration != 0f && transition != 0f 162 return duration != 0f && transition != 0f
158 } 163 }
@@ -207,7 +212,9 @@ class SettingsActivity : AppCompatActivity(), SettingsActivityView {
207 get() = supportFragmentManager.findFragmentByTag(FRAGMENT_TAG) as SettingsFragment? 212 get() = supportFragmentManager.findFragmentByTag(FRAGMENT_TAG) as SettingsFragment?
208 213
209 private fun setInsets() { 214 private fun setInsets() {
210 ViewCompat.setOnApplyWindowInsetsListener(binding.frameContent) { view: View, windowInsets: WindowInsetsCompat -> 215 ViewCompat.setOnApplyWindowInsetsListener(
216 binding.frameContent
217 ) { view: View, windowInsets: WindowInsetsCompat ->
211 val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) 218 val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
212 val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout()) 219 val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout())
213 view.updatePadding( 220 view.updatePadding(
@@ -239,5 +246,17 @@ class SettingsActivity : AppCompatActivity(), SettingsActivityView {
239 settings.putExtra(ARG_GAME_ID, gameId) 246 settings.putExtra(ARG_GAME_ID, gameId)
240 context.startActivity(settings) 247 context.startActivity(settings)
241 } 248 }
249
250 fun launch(
251 context: Context,
252 launcher: ActivityResultLauncher<Intent>,
253 menuTag: String?,
254 gameId: String?
255 ) {
256 val settings = Intent(context, SettingsActivity::class.java)
257 settings.putExtra(ARG_MENU_TAG, menuTag)
258 settings.putExtra(ARG_GAME_ID, gameId)
259 launcher.launch(settings)
260 }
242 } 261 }
243} 262}
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivityPresenter.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivityPresenter.kt
index 4361d95fb..93e677b21 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivityPresenter.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivityPresenter.kt
@@ -6,12 +6,12 @@ package org.yuzu.yuzu_emu.features.settings.ui
6import android.content.Context 6import android.content.Context
7import android.os.Bundle 7import android.os.Bundle
8import android.text.TextUtils 8import android.text.TextUtils
9import java.io.File
9import org.yuzu.yuzu_emu.NativeLibrary 10import org.yuzu.yuzu_emu.NativeLibrary
10import org.yuzu.yuzu_emu.features.settings.model.Settings 11import org.yuzu.yuzu_emu.features.settings.model.Settings
11import org.yuzu.yuzu_emu.features.settings.utils.SettingsFile 12import org.yuzu.yuzu_emu.features.settings.utils.SettingsFile
12import org.yuzu.yuzu_emu.utils.DirectoryInitialization 13import org.yuzu.yuzu_emu.utils.DirectoryInitialization
13import org.yuzu.yuzu_emu.utils.Log 14import org.yuzu.yuzu_emu.utils.Log
14import java.io.File
15 15
16class SettingsActivityPresenter(private val activityView: SettingsActivityView) { 16class SettingsActivityPresenter(private val activityView: SettingsActivityView) {
17 val settings: Settings get() = activityView.settings 17 val settings: Settings get() = activityView.settings
@@ -46,9 +46,15 @@ class SettingsActivityPresenter(private val activityView: SettingsActivityView)
46 46
47 private fun prepareDirectoriesIfNeeded() { 47 private fun prepareDirectoriesIfNeeded() {
48 val configFile = 48 val configFile =
49 File(DirectoryInitialization.userDirectory + "/config/" + SettingsFile.FILE_NAME_CONFIG + ".ini") 49 File(
50 "${DirectoryInitialization.userDirectory}/config/" +
51 "${SettingsFile.FILE_NAME_CONFIG}.ini"
52 )
50 if (!configFile.exists()) { 53 if (!configFile.exists()) {
51 Log.error(DirectoryInitialization.userDirectory + "/config/" + SettingsFile.FILE_NAME_CONFIG + ".ini") 54 Log.error(
55 "${DirectoryInitialization.userDirectory}/config/" +
56 "${SettingsFile.FILE_NAME_CONFIG}.ini"
57 )
52 Log.error("yuzu config file could not be found!") 58 Log.error("yuzu config file could not be found!")
53 } 59 }
54 60
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsAdapter.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsAdapter.kt
index 1eb4899fc..ce0b92c90 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsAdapter.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsAdapter.kt
@@ -13,7 +13,6 @@ import android.view.ViewGroup
13import android.widget.TextView 13import android.widget.TextView
14import androidx.appcompat.app.AlertDialog 14import androidx.appcompat.app.AlertDialog
15import androidx.appcompat.app.AppCompatActivity 15import androidx.appcompat.app.AppCompatActivity
16import androidx.fragment.app.setFragmentResultListener
17import androidx.recyclerview.widget.RecyclerView 16import androidx.recyclerview.widget.RecyclerView
18import com.google.android.material.datepicker.MaterialDatePicker 17import com.google.android.material.datepicker.MaterialDatePicker
19import com.google.android.material.dialog.MaterialAlertDialogBuilder 18import com.google.android.material.dialog.MaterialAlertDialogBuilder
@@ -139,7 +138,7 @@ class SettingsAdapter(
139 clickedItem = item 138 clickedItem = item
140 dialog = MaterialAlertDialogBuilder(context) 139 dialog = MaterialAlertDialogBuilder(context)
141 .setTitle(item.nameId) 140 .setTitle(item.nameId)
142 .setSingleChoiceItems(item.choicesId, item.selectValueIndex, this) 141 .setSingleChoiceItems(item.choices, item.selectValueIndex, this)
143 .show() 142 .show()
144 } 143 }
145 144
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragment.kt
index 867147950..70a74c4dd 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragment.kt
@@ -50,7 +50,10 @@ class SettingsFragment : Fragment(), SettingsFragmentView {
50 50
51 override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 51 override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
52 settingsAdapter = SettingsAdapter(this, requireActivity()) 52 settingsAdapter = SettingsAdapter(this, requireActivity())
53 val dividerDecoration = MaterialDividerItemDecoration(requireContext(), LinearLayoutManager.VERTICAL) 53 val dividerDecoration = MaterialDividerItemDecoration(
54 requireContext(),
55 LinearLayoutManager.VERTICAL
56 )
54 dividerDecoration.isLastItemDecorated = false 57 dividerDecoration.isLastItemDecorated = false
55 binding.listSettings.apply { 58 binding.listSettings.apply {
56 adapter = settingsAdapter 59 adapter = settingsAdapter
@@ -99,7 +102,9 @@ class SettingsFragment : Fragment(), SettingsFragmentView {
99 } 102 }
100 103
101 private fun setInsets() { 104 private fun setInsets() {
102 ViewCompat.setOnApplyWindowInsetsListener(binding.listSettings) { view: View, windowInsets: WindowInsetsCompat -> 105 ViewCompat.setOnApplyWindowInsetsListener(
106 binding.listSettings
107 ) { view: View, windowInsets: WindowInsetsCompat ->
103 val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) 108 val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
104 view.updatePadding(bottom = insets.bottom) 109 view.updatePadding(bottom = insets.bottom)
105 windowInsets 110 windowInsets
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt
index 061046b2e..59c1d9d54 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt
@@ -7,7 +7,6 @@ import android.content.SharedPreferences
7import android.os.Build 7import android.os.Build
8import android.text.TextUtils 8import android.text.TextUtils
9import androidx.preference.PreferenceManager 9import androidx.preference.PreferenceManager
10import com.google.android.material.dialog.MaterialAlertDialogBuilder
11import org.yuzu.yuzu_emu.R 10import org.yuzu.yuzu_emu.R
12import org.yuzu.yuzu_emu.YuzuApplication 11import org.yuzu.yuzu_emu.YuzuApplication
13import org.yuzu.yuzu_emu.features.settings.model.AbstractBooleanSetting 12import org.yuzu.yuzu_emu.features.settings.model.AbstractBooleanSetting
@@ -43,7 +42,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
43 } 42 }
44 43
45 fun putSetting(setting: AbstractSetting) { 44 fun putSetting(setting: AbstractSetting) {
46 if (setting.section == null) { 45 if (setting.section == null || setting.key == null) {
47 return 46 return
48 } 47 }
49 48
@@ -166,6 +165,15 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
166 IntSetting.CPU_ACCURACY.defaultValue 165 IntSetting.CPU_ACCURACY.defaultValue
167 ) 166 )
168 ) 167 )
168 add(
169 SwitchSetting(
170 BooleanSetting.PICTURE_IN_PICTURE,
171 R.string.picture_in_picture,
172 R.string.picture_in_picture_description,
173 BooleanSetting.PICTURE_IN_PICTURE.key,
174 BooleanSetting.PICTURE_IN_PICTURE.defaultValue
175 )
176 )
169 } 177 }
170 } 178 }
171 179
@@ -227,7 +235,6 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
227 private fun addGraphicsSettings(sl: ArrayList<SettingsItem>) { 235 private fun addGraphicsSettings(sl: ArrayList<SettingsItem>) {
228 settingsActivity.setToolbarTitle(settingsActivity.getString(R.string.preferences_graphics)) 236 settingsActivity.setToolbarTitle(settingsActivity.getString(R.string.preferences_graphics))
229 sl.apply { 237 sl.apply {
230
231 add( 238 add(
232 SingleChoiceSetting( 239 SingleChoiceSetting(
233 IntSetting.RENDERER_ACCURACY, 240 IntSetting.RENDERER_ACCURACY,
@@ -285,6 +292,17 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
285 ) 292 )
286 add( 293 add(
287 SingleChoiceSetting( 294 SingleChoiceSetting(
295 IntSetting.RENDERER_SCREEN_LAYOUT,
296 R.string.renderer_screen_layout,
297 0,
298 R.array.rendererScreenLayoutNames,
299 R.array.rendererScreenLayoutValues,
300 IntSetting.RENDERER_SCREEN_LAYOUT.key,
301 IntSetting.RENDERER_SCREEN_LAYOUT.defaultValue
302 )
303 )
304 add(
305 SingleChoiceSetting(
288 IntSetting.RENDERER_ASPECT_RATIO, 306 IntSetting.RENDERER_ASPECT_RATIO,
289 R.string.renderer_aspect_ratio, 307 R.string.renderer_aspect_ratio,
290 0, 308 0,
@@ -321,23 +339,45 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
321 IntSetting.RENDERER_ASYNCHRONOUS_SHADERS.defaultValue 339 IntSetting.RENDERER_ASYNCHRONOUS_SHADERS.defaultValue
322 ) 340 )
323 ) 341 )
342 add(
343 SwitchSetting(
344 IntSetting.RENDERER_REACTIVE_FLUSHING,
345 R.string.renderer_reactive_flushing,
346 R.string.renderer_reactive_flushing_description,
347 IntSetting.RENDERER_REACTIVE_FLUSHING.key,
348 IntSetting.RENDERER_REACTIVE_FLUSHING.defaultValue
349 )
350 )
324 } 351 }
325 } 352 }
326 353
327 private fun addAudioSettings(sl: ArrayList<SettingsItem>) { 354 private fun addAudioSettings(sl: ArrayList<SettingsItem>) {
328 settingsActivity.setToolbarTitle(settingsActivity.getString(R.string.preferences_audio)) 355 settingsActivity.setToolbarTitle(settingsActivity.getString(R.string.preferences_audio))
329 sl.add( 356 sl.apply {
330 SliderSetting( 357 add(
331 IntSetting.AUDIO_VOLUME, 358 StringSingleChoiceSetting(
332 R.string.audio_volume, 359 StringSetting.AUDIO_OUTPUT_ENGINE,
333 R.string.audio_volume_description, 360 R.string.audio_output_engine,
334 0, 361 0,
335 100, 362 settingsActivity.resources.getStringArray(R.array.outputEngineEntries),
336 "%", 363 settingsActivity.resources.getStringArray(R.array.outputEngineValues),
337 IntSetting.AUDIO_VOLUME.key, 364 StringSetting.AUDIO_OUTPUT_ENGINE.key,
338 IntSetting.AUDIO_VOLUME.defaultValue 365 StringSetting.AUDIO_OUTPUT_ENGINE.defaultValue
339 ) 366 )
340 ) 367 )
368 add(
369 SliderSetting(
370 IntSetting.AUDIO_VOLUME,
371 R.string.audio_volume,
372 R.string.audio_volume_description,
373 0,
374 100,
375 "%",
376 IntSetting.AUDIO_VOLUME.key,
377 IntSetting.AUDIO_VOLUME.defaultValue
378 )
379 )
380 }
341 } 381 }
342 382
343 private fun addThemeSettings(sl: ArrayList<SettingsItem>) { 383 private fun addThemeSettings(sl: ArrayList<SettingsItem>) {
@@ -440,6 +480,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
440 private fun addDebugSettings(sl: ArrayList<SettingsItem>) { 480 private fun addDebugSettings(sl: ArrayList<SettingsItem>) {
441 settingsActivity.setToolbarTitle(settingsActivity.getString(R.string.preferences_debug)) 481 settingsActivity.setToolbarTitle(settingsActivity.getString(R.string.preferences_debug))
442 sl.apply { 482 sl.apply {
483 add(HeaderSetting(R.string.gpu))
443 add( 484 add(
444 SingleChoiceSetting( 485 SingleChoiceSetting(
445 IntSetting.RENDERER_BACKEND, 486 IntSetting.RENDERER_BACKEND,
@@ -460,6 +501,39 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
460 IntSetting.RENDERER_DEBUG.defaultValue 501 IntSetting.RENDERER_DEBUG.defaultValue
461 ) 502 )
462 ) 503 )
504
505 add(HeaderSetting(R.string.cpu))
506 add(
507 SwitchSetting(
508 BooleanSetting.CPU_DEBUG_MODE,
509 R.string.cpu_debug_mode,
510 R.string.cpu_debug_mode_description,
511 BooleanSetting.CPU_DEBUG_MODE.key,
512 BooleanSetting.CPU_DEBUG_MODE.defaultValue
513 )
514 )
515
516 val fastmem = object : AbstractBooleanSetting {
517 override var boolean: Boolean
518 get() =
519 BooleanSetting.FASTMEM.boolean && BooleanSetting.FASTMEM_EXCLUSIVES.boolean
520 set(value) {
521 BooleanSetting.FASTMEM.boolean = value
522 BooleanSetting.FASTMEM_EXCLUSIVES.boolean = value
523 }
524 override val key: String? = null
525 override val section: String = Settings.SECTION_CPU
526 override val isRuntimeEditable: Boolean = false
527 override val valueAsString: String = ""
528 override val defaultValue: Any = true
529 }
530 add(
531 SwitchSetting(
532 fastmem,
533 R.string.fastmem,
534 0
535 )
536 )
463 } 537 }
464 } 538 }
465} 539}
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/DateTimeViewHolder.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/DateTimeViewHolder.kt
index 04c045e77..7955532ee 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/DateTimeViewHolder.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/DateTimeViewHolder.kt
@@ -4,15 +4,15 @@
4package org.yuzu.yuzu_emu.features.settings.ui.viewholder 4package org.yuzu.yuzu_emu.features.settings.ui.viewholder
5 5
6import android.view.View 6import android.view.View
7import org.yuzu.yuzu_emu.databinding.ListItemSettingBinding
8import org.yuzu.yuzu_emu.features.settings.model.view.DateTimeSetting
9import org.yuzu.yuzu_emu.features.settings.model.view.SettingsItem
10import org.yuzu.yuzu_emu.features.settings.ui.SettingsAdapter
11import java.time.Instant 7import java.time.Instant
12import java.time.ZoneId 8import java.time.ZoneId
13import java.time.ZonedDateTime 9import java.time.ZonedDateTime
14import java.time.format.DateTimeFormatter 10import java.time.format.DateTimeFormatter
15import java.time.format.FormatStyle 11import java.time.format.FormatStyle
12import org.yuzu.yuzu_emu.databinding.ListItemSettingBinding
13import org.yuzu.yuzu_emu.features.settings.model.view.DateTimeSetting
14import org.yuzu.yuzu_emu.features.settings.model.view.SettingsItem
15import org.yuzu.yuzu_emu.features.settings.ui.SettingsAdapter
16 16
17class DateTimeViewHolder(val binding: ListItemSettingBinding, adapter: SettingsAdapter) : 17class DateTimeViewHolder(val binding: ListItemSettingBinding, adapter: SettingsAdapter) :
18 SettingViewHolder(binding.root, adapter) { 18 SettingViewHolder(binding.root, adapter) {
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SingleChoiceViewHolder.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SingleChoiceViewHolder.kt
index de764a27f..e4e321bd3 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SingleChoiceViewHolder.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SingleChoiceViewHolder.kt
@@ -26,6 +26,14 @@ class SingleChoiceViewHolder(val binding: ListItemSettingBinding, adapter: Setti
26 for (i in values.indices) { 26 for (i in values.indices) {
27 if (values[i] == item.selectedValue) { 27 if (values[i] == item.selectedValue) {
28 binding.textSettingDescription.text = resMgr.getStringArray(item.choicesId)[i] 28 binding.textSettingDescription.text = resMgr.getStringArray(item.choicesId)[i]
29 return
30 }
31 }
32 } else if (item is StringSingleChoiceSetting) {
33 for (i in item.values!!.indices) {
34 if (item.values[i] == item.selectedValue) {
35 binding.textSettingDescription.text = item.choices[i]
36 return
29 } 37 }
30 } 38 }
31 } else { 39 } else {
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SwitchSettingViewHolder.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SwitchSettingViewHolder.kt
index b163bd6ca..54f531795 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SwitchSettingViewHolder.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SwitchSettingViewHolder.kt
@@ -6,8 +6,8 @@ package org.yuzu.yuzu_emu.features.settings.ui.viewholder
6import android.view.View 6import android.view.View
7import android.widget.CompoundButton 7import android.widget.CompoundButton
8import org.yuzu.yuzu_emu.databinding.ListItemSettingSwitchBinding 8import org.yuzu.yuzu_emu.databinding.ListItemSettingSwitchBinding
9import org.yuzu.yuzu_emu.features.settings.model.view.SwitchSetting
10import org.yuzu.yuzu_emu.features.settings.model.view.SettingsItem 9import org.yuzu.yuzu_emu.features.settings.model.view.SettingsItem
10import org.yuzu.yuzu_emu.features.settings.model.view.SwitchSetting
11import org.yuzu.yuzu_emu.features.settings.ui.SettingsAdapter 11import org.yuzu.yuzu_emu.features.settings.ui.SettingsAdapter
12 12
13class SwitchSettingViewHolder(val binding: ListItemSettingSwitchBinding, adapter: SettingsAdapter) : 13class SwitchSettingViewHolder(val binding: ListItemSettingSwitchBinding, adapter: SettingsAdapter) :
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/utils/SettingsFile.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/utils/SettingsFile.kt
index e29bca11d..70a52df5d 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/utils/SettingsFile.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/utils/SettingsFile.kt
@@ -3,6 +3,8 @@
3 3
4package org.yuzu.yuzu_emu.features.settings.utils 4package org.yuzu.yuzu_emu.features.settings.utils
5 5
6import java.io.*
7import java.util.*
6import org.ini4j.Wini 8import org.ini4j.Wini
7import org.yuzu.yuzu_emu.NativeLibrary 9import org.yuzu.yuzu_emu.NativeLibrary
8import org.yuzu.yuzu_emu.R 10import org.yuzu.yuzu_emu.R
@@ -13,8 +15,6 @@ import org.yuzu.yuzu_emu.features.settings.ui.SettingsActivityView
13import org.yuzu.yuzu_emu.utils.BiMap 15import org.yuzu.yuzu_emu.utils.BiMap
14import org.yuzu.yuzu_emu.utils.DirectoryInitialization 16import org.yuzu.yuzu_emu.utils.DirectoryInitialization
15import org.yuzu.yuzu_emu.utils.Log 17import org.yuzu.yuzu_emu.utils.Log
16import java.io.*
17import java.util.*
18 18
19/** 19/**
20 * Contains static methods for interacting with .ini files in which settings are stored. 20 * Contains static methods for interacting with .ini files in which settings are stored.
@@ -137,9 +137,12 @@ object SettingsFile {
137 for (settingKey in sortedKeySet) { 137 for (settingKey in sortedKeySet) {
138 val setting = settings[settingKey] 138 val setting = settings[settingKey]
139 NativeLibrary.setUserSetting( 139 NativeLibrary.setUserSetting(
140 gameId, mapSectionNameFromIni( 140 gameId,
141 mapSectionNameFromIni(
141 section.name 142 section.name
142 ), setting!!.key, setting.valueAsString 143 ),
144 setting!!.key,
145 setting.valueAsString
143 ) 146 )
144 } 147 }
145 } 148 }
@@ -148,13 +151,17 @@ object SettingsFile {
148 private fun mapSectionNameFromIni(generalSectionName: String): String? { 151 private fun mapSectionNameFromIni(generalSectionName: String): String? {
149 return if (sectionsMap.getForward(generalSectionName) != null) { 152 return if (sectionsMap.getForward(generalSectionName) != null) {
150 sectionsMap.getForward(generalSectionName) 153 sectionsMap.getForward(generalSectionName)
151 } else generalSectionName 154 } else {
155 generalSectionName
156 }
152 } 157 }
153 158
154 private fun mapSectionNameToIni(generalSectionName: String): String { 159 private fun mapSectionNameToIni(generalSectionName: String): String {
155 return if (sectionsMap.getBackward(generalSectionName) != null) { 160 return if (sectionsMap.getBackward(generalSectionName) != null) {
156 sectionsMap.getBackward(generalSectionName).toString() 161 sectionsMap.getBackward(generalSectionName).toString()
157 } else generalSectionName 162 } else {
163 generalSectionName
164 }
158 } 165 }
159 166
160 fun getSettingsFile(fileName: String): File { 167 fun getSettingsFile(fileName: String): File {
@@ -237,5 +244,21 @@ object SettingsFile {
237 val setting = settings[key] 244 val setting = settings[key]
238 parser.put(header, setting!!.key, setting.valueAsString) 245 parser.put(header, setting!!.key, setting.valueAsString)
239 } 246 }
247
248 BooleanSetting.values().forEach {
249 if (!keySet.contains(it.key)) {
250 parser.put(header, it.key, it.valueAsString)
251 }
252 }
253 IntSetting.values().forEach {
254 if (!keySet.contains(it.key)) {
255 parser.put(header, it.key, it.valueAsString)
256 }
257 }
258 StringSetting.values().forEach {
259 if (!keySet.contains(it.key)) {
260 parser.put(header, it.key, it.valueAsString)
261 }
262 }
240 } 263 }
241} 264}
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/AboutFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/AboutFragment.kt
index c92e2755c..2ff827c6b 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/AboutFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/AboutFragment.kt
@@ -66,7 +66,11 @@ class AboutFragment : Fragment() {
66 true 66 true
67 } 67 }
68 68
69 binding.buttonContributors.setOnClickListener { openLink(getString(R.string.contributors_link)) } 69 binding.buttonContributors.setOnClickListener {
70 openLink(
71 getString(R.string.contributors_link)
72 )
73 }
70 binding.buttonLicenses.setOnClickListener { 74 binding.buttonLicenses.setOnClickListener {
71 exitTransition = MaterialSharedAxis(MaterialSharedAxis.X, true) 75 exitTransition = MaterialSharedAxis(MaterialSharedAxis.X, true)
72 binding.root.findNavController().navigate(R.id.action_aboutFragment_to_licensesFragment) 76 binding.root.findNavController().navigate(R.id.action_aboutFragment_to_licensesFragment)
@@ -101,7 +105,9 @@ class AboutFragment : Fragment() {
101 } 105 }
102 106
103 private fun setInsets() = 107 private fun setInsets() =
104 ViewCompat.setOnApplyWindowInsetsListener(binding.root) { _: View, windowInsets: WindowInsetsCompat -> 108 ViewCompat.setOnApplyWindowInsetsListener(
109 binding.root
110 ) { _: View, windowInsets: WindowInsetsCompat ->
105 val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) 111 val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
106 val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout()) 112 val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout())
107 113
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EarlyAccessFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EarlyAccessFragment.kt
index d8bbc1ce4..dbc16da4a 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EarlyAccessFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EarlyAccessFragment.kt
@@ -49,7 +49,11 @@ class EarlyAccessFragment : Fragment() {
49 parentFragmentManager.primaryNavigationFragment?.findNavController()?.popBackStack() 49 parentFragmentManager.primaryNavigationFragment?.findNavController()?.popBackStack()
50 } 50 }
51 51
52 binding.getEarlyAccessButton.setOnClickListener { openLink(getString(R.string.play_store_link)) } 52 binding.getEarlyAccessButton.setOnClickListener {
53 openLink(
54 getString(R.string.play_store_link)
55 )
56 }
53 57
54 setInsets() 58 setInsets()
55 } 59 }
@@ -60,7 +64,9 @@ class EarlyAccessFragment : Fragment() {
60 } 64 }
61 65
62 private fun setInsets() = 66 private fun setInsets() =
63 ViewCompat.setOnApplyWindowInsetsListener(binding.root) { _: View, windowInsets: WindowInsetsCompat -> 67 ViewCompat.setOnApplyWindowInsetsListener(
68 binding.root
69 ) { _: View, windowInsets: WindowInsetsCompat ->
64 val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) 70 val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
65 val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout()) 71 val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout())
66 72
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt
index 9523381cd..4643418c1 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt
@@ -7,30 +7,39 @@ import android.annotation.SuppressLint
7import android.app.AlertDialog 7import android.app.AlertDialog
8import android.content.Context 8import android.content.Context
9import android.content.DialogInterface 9import android.content.DialogInterface
10import android.content.Intent
10import android.content.SharedPreferences 11import android.content.SharedPreferences
11import android.content.pm.ActivityInfo 12import android.content.pm.ActivityInfo
12import android.content.res.Resources 13import android.content.res.Configuration
13import android.graphics.Color 14import android.graphics.Color
14import android.os.Bundle 15import android.os.Bundle
15import android.os.Handler 16import android.os.Handler
16import android.os.Looper 17import android.os.Looper
17import android.util.Rational 18import android.util.Rational
18import android.util.TypedValue
19import android.view.* 19import android.view.*
20import android.widget.TextView 20import android.widget.TextView
21import androidx.activity.OnBackPressedCallback 21import androidx.activity.OnBackPressedCallback
22import androidx.activity.result.ActivityResultLauncher
23import androidx.activity.result.contract.ActivityResultContracts
22import androidx.appcompat.widget.PopupMenu 24import androidx.appcompat.widget.PopupMenu
23import androidx.core.content.res.ResourcesCompat 25import androidx.core.content.res.ResourcesCompat
24import androidx.core.graphics.Insets 26import androidx.core.graphics.Insets
25import androidx.core.view.ViewCompat 27import androidx.core.view.ViewCompat
26import androidx.core.view.WindowInsetsCompat 28import androidx.core.view.WindowInsetsCompat
27import androidx.core.view.updatePadding 29import androidx.core.view.isVisible
28import androidx.fragment.app.Fragment 30import androidx.fragment.app.Fragment
31import androidx.lifecycle.Lifecycle
32import androidx.lifecycle.lifecycleScope
33import androidx.lifecycle.repeatOnLifecycle
34import androidx.navigation.fragment.navArgs
29import androidx.preference.PreferenceManager 35import androidx.preference.PreferenceManager
30import androidx.window.layout.FoldingFeature 36import androidx.window.layout.FoldingFeature
37import androidx.window.layout.WindowInfoTracker
31import androidx.window.layout.WindowLayoutInfo 38import androidx.window.layout.WindowLayoutInfo
32import com.google.android.material.dialog.MaterialAlertDialogBuilder 39import com.google.android.material.dialog.MaterialAlertDialogBuilder
33import com.google.android.material.slider.Slider 40import com.google.android.material.slider.Slider
41import kotlinx.coroutines.Dispatchers
42import kotlinx.coroutines.launch
34import org.yuzu.yuzu_emu.NativeLibrary 43import org.yuzu.yuzu_emu.NativeLibrary
35import org.yuzu.yuzu_emu.R 44import org.yuzu.yuzu_emu.R
36import org.yuzu.yuzu_emu.YuzuApplication 45import org.yuzu.yuzu_emu.YuzuApplication
@@ -41,9 +50,8 @@ import org.yuzu.yuzu_emu.features.settings.model.IntSetting
41import org.yuzu.yuzu_emu.features.settings.model.Settings 50import org.yuzu.yuzu_emu.features.settings.model.Settings
42import org.yuzu.yuzu_emu.features.settings.ui.SettingsActivity 51import org.yuzu.yuzu_emu.features.settings.ui.SettingsActivity
43import org.yuzu.yuzu_emu.features.settings.utils.SettingsFile 52import org.yuzu.yuzu_emu.features.settings.utils.SettingsFile
44import org.yuzu.yuzu_emu.model.Game 53import org.yuzu.yuzu_emu.overlay.InputOverlay
45import org.yuzu.yuzu_emu.utils.* 54import org.yuzu.yuzu_emu.utils.*
46import org.yuzu.yuzu_emu.utils.SerializableHelper.parcelable
47 55
48class EmulationFragment : Fragment(), SurfaceHolder.Callback { 56class EmulationFragment : Fragment(), SurfaceHolder.Callback {
49 private lateinit var preferences: SharedPreferences 57 private lateinit var preferences: SharedPreferences
@@ -54,13 +62,30 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
54 private var _binding: FragmentEmulationBinding? = null 62 private var _binding: FragmentEmulationBinding? = null
55 private val binding get() = _binding!! 63 private val binding get() = _binding!!
56 64
57 private lateinit var game: Game 65 val args by navArgs<EmulationFragmentArgs>()
66
67 private var isInFoldableLayout = false
68
69 private lateinit var onReturnFromSettings: ActivityResultLauncher<Intent>
58 70
59 override fun onAttach(context: Context) { 71 override fun onAttach(context: Context) {
60 super.onAttach(context) 72 super.onAttach(context)
61 if (context is EmulationActivity) { 73 if (context is EmulationActivity) {
62 emulationActivity = context 74 emulationActivity = context
63 NativeLibrary.setEmulationActivity(context) 75 NativeLibrary.setEmulationActivity(context)
76
77 lifecycleScope.launch(Dispatchers.Main) {
78 lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) {
79 WindowInfoTracker.getOrCreate(context)
80 .windowLayoutInfo(context)
81 .collect { updateFoldableLayout(context, it) }
82 }
83 }
84
85 onReturnFromSettings = context.activityResultRegistry.register(
86 "SettingsResult",
87 ActivityResultContracts.StartActivityForResult()
88 ) { updateScreenLayout() }
64 } else { 89 } else {
65 throw IllegalStateException("EmulationFragment must have EmulationActivity parent") 90 throw IllegalStateException("EmulationFragment must have EmulationActivity parent")
66 } 91 }
@@ -75,8 +100,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
75 // So this fragment doesn't restart on configuration changes; i.e. rotation. 100 // So this fragment doesn't restart on configuration changes; i.e. rotation.
76 retainInstance = true 101 retainInstance = true
77 preferences = PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext) 102 preferences = PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext)
78 game = requireArguments().parcelable(EmulationActivity.EXTRA_SELECTED_GAME)!! 103 emulationState = EmulationState(args.game.path)
79 emulationState = EmulationState(game.path)
80 } 104 }
81 105
82 /** 106 /**
@@ -100,7 +124,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
100 updateShowFpsOverlay() 124 updateShowFpsOverlay()
101 125
102 binding.inGameMenu.getHeaderView(0).findViewById<TextView>(R.id.text_game_title).text = 126 binding.inGameMenu.getHeaderView(0).findViewById<TextView>(R.id.text_game_title).text =
103 game.title 127 args.game.title
104 binding.inGameMenu.setNavigationItemSelectedListener { 128 binding.inGameMenu.setNavigationItemSelectedListener {
105 when (it.itemId) { 129 when (it.itemId) {
106 R.id.menu_pause_emulation -> { 130 R.id.menu_pause_emulation -> {
@@ -125,7 +149,12 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
125 } 149 }
126 150
127 R.id.menu_settings -> { 151 R.id.menu_settings -> {
128 SettingsActivity.launch(requireContext(), SettingsFile.FILE_NAME_CONFIG, "") 152 SettingsActivity.launch(
153 requireContext(),
154 onReturnFromSettings,
155 SettingsFile.FILE_NAME_CONFIG,
156 ""
157 )
129 true 158 true
130 } 159 }
131 160
@@ -150,9 +179,48 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
150 requireActivity(), 179 requireActivity(),
151 object : OnBackPressedCallback(true) { 180 object : OnBackPressedCallback(true) {
152 override fun handleOnBackPressed() { 181 override fun handleOnBackPressed() {
153 if (binding.drawerLayout.isOpen) binding.drawerLayout.close() else binding.drawerLayout.open() 182 if (binding.drawerLayout.isOpen) {
183 binding.drawerLayout.close()
184 } else {
185 binding.drawerLayout.open()
186 }
187 }
188 }
189 )
190
191 viewLifecycleOwner.lifecycleScope.launch(Dispatchers.Main) {
192 lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) {
193 WindowInfoTracker.getOrCreate(requireContext())
194 .windowLayoutInfo(requireActivity())
195 .collect { updateFoldableLayout(requireActivity() as EmulationActivity, it) }
196 }
197 }
198 }
199
200 override fun onConfigurationChanged(newConfig: Configuration) {
201 super.onConfigurationChanged(newConfig)
202 if (emulationActivity?.isInPictureInPictureMode == true) {
203 if (binding.drawerLayout.isOpen) {
204 binding.drawerLayout.close()
205 }
206 if (EmulationMenuSettings.showOverlay) {
207 binding.surfaceInputOverlay.post { binding.surfaceInputOverlay.isVisible = false }
208 }
209 } else {
210 if (EmulationMenuSettings.showOverlay) {
211 binding.surfaceInputOverlay.post { binding.surfaceInputOverlay.isVisible = true }
212 }
213 if (!isInFoldableLayout) {
214 if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
215 binding.surfaceInputOverlay.orientation = InputOverlay.PORTRAIT
216 } else {
217 binding.surfaceInputOverlay.orientation = InputOverlay.LANDSCAPE
154 } 218 }
155 }) 219 }
220 if (!binding.surfaceInputOverlay.isInEditMode) {
221 refreshInputOverlay()
222 }
223 }
156 } 224 }
157 225
158 override fun onResume() { 226 override fun onResume() {
@@ -161,16 +229,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
161 DirectoryInitialization.start(requireContext()) 229 DirectoryInitialization.start(requireContext())
162 } 230 }
163 231
164 binding.surfaceEmulation.setAspectRatio( 232 updateScreenLayout()
165 when (IntSetting.RENDERER_ASPECT_RATIO.int) {
166 0 -> Rational(16, 9)
167 1 -> Rational(4, 3)
168 2 -> Rational(21, 9)
169 3 -> Rational(16, 10)
170 4 -> null // Stretch
171 else -> Rational(16, 9)
172 }
173 )
174 233
175 emulationState.run(emulationActivity!!.isActivityRecreated) 234 emulationState.run(emulationActivity!!.isActivityRecreated)
176 } 235 }
@@ -231,31 +290,72 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
231 } 290 }
232 } 291 }
233 292
234 private val Number.toPx get() = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, this.toFloat(), Resources.getSystem().displayMetrics).toInt() 293 @SuppressLint("SourceLockedOrientationActivity")
235 294 private fun updateOrientation() {
236 fun updateCurrentLayout(emulationActivity: EmulationActivity, newLayoutInfo: WindowLayoutInfo) { 295 emulationActivity?.let {
237 val isFolding = (newLayoutInfo.displayFeatures.find { it is FoldingFeature } as? FoldingFeature)?.let { 296 it.requestedOrientation = when (IntSetting.RENDERER_SCREEN_LAYOUT.int) {
238 if (it.isSeparating) { 297 Settings.LayoutOption_MobileLandscape ->
239 emulationActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED 298 ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
240 if (it.orientation == FoldingFeature.Orientation.HORIZONTAL) { 299 Settings.LayoutOption_MobilePortrait ->
241 binding.surfaceEmulation.layoutParams.height = it.bounds.top 300 ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
242 binding.inGameMenu.layoutParams.height = it.bounds.bottom 301 Settings.LayoutOption_Unspecified -> ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
243 binding.overlayContainer.layoutParams.height = it.bounds.bottom - 48.toPx 302 else -> ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
244 binding.overlayContainer.updatePadding(0, 0, 0, 24.toPx)
245 }
246 } 303 }
247 it.isSeparating 304 }
248 } ?: false 305 }
306
307 private fun updateScreenLayout() {
308 binding.surfaceEmulation.setAspectRatio(
309 when (IntSetting.RENDERER_ASPECT_RATIO.int) {
310 0 -> Rational(16, 9)
311 1 -> Rational(4, 3)
312 2 -> Rational(21, 9)
313 3 -> Rational(16, 10)
314 4 -> null // Stretch
315 else -> Rational(16, 9)
316 }
317 )
318 emulationActivity?.buildPictureInPictureParams()
319 updateOrientation()
320 }
321
322 private fun updateFoldableLayout(
323 emulationActivity: EmulationActivity,
324 newLayoutInfo: WindowLayoutInfo
325 ) {
326 val isFolding =
327 (newLayoutInfo.displayFeatures.find { it is FoldingFeature } as? FoldingFeature)?.let {
328 if (it.isSeparating) {
329 emulationActivity.requestedOrientation =
330 ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
331 if (it.orientation == FoldingFeature.Orientation.HORIZONTAL) {
332 // Restrict emulation and overlays to the top of the screen
333 binding.emulationContainer.layoutParams.height = it.bounds.top
334 binding.overlayContainer.layoutParams.height = it.bounds.top
335 // Restrict input and menu drawer to the bottom of the screen
336 binding.inputContainer.layoutParams.height = it.bounds.bottom
337 binding.inGameMenu.layoutParams.height = it.bounds.bottom
338
339 isInFoldableLayout = true
340 binding.surfaceInputOverlay.orientation = InputOverlay.FOLDABLE
341 refreshInputOverlay()
342 }
343 }
344 it.isSeparating
345 } ?: false
249 if (!isFolding) { 346 if (!isFolding) {
250 binding.surfaceEmulation.layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT 347 binding.emulationContainer.layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT
251 binding.inGameMenu.layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT 348 binding.inputContainer.layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT
252 binding.overlayContainer.layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT 349 binding.overlayContainer.layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT
253 binding.overlayContainer.updatePadding(0, 0, 0, 0) 350 binding.inGameMenu.layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT
254 emulationActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE 351 isInFoldableLayout = false
352 updateOrientation()
353 onConfigurationChanged(resources.configuration)
255 } 354 }
256 binding.surfaceInputOverlay.requestLayout() 355 binding.emulationContainer.requestLayout()
257 binding.inGameMenu.requestLayout() 356 binding.inputContainer.requestLayout()
258 binding.overlayContainer.requestLayout() 357 binding.overlayContainer.requestLayout()
358 binding.inGameMenu.requestLayout()
259 } 359 }
260 360
261 override fun surfaceCreated(holder: SurfaceHolder) { 361 override fun surfaceCreated(holder: SurfaceHolder) {
@@ -385,7 +485,19 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
385 popup.show() 485 popup.show()
386 } 486 }
387 487
488 @SuppressLint("SourceLockedOrientationActivity")
388 private fun startConfiguringControls() { 489 private fun startConfiguringControls() {
490 // Lock the current orientation to prevent editing inconsistencies
491 if (IntSetting.RENDERER_SCREEN_LAYOUT.int == Settings.LayoutOption_Unspecified) {
492 emulationActivity?.let {
493 it.requestedOrientation =
494 if (resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT) {
495 ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
496 } else {
497 ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
498 }
499 }
500 }
389 binding.doneControlConfig.visibility = View.VISIBLE 501 binding.doneControlConfig.visibility = View.VISIBLE
390 binding.surfaceInputOverlay.setIsInEditMode(true) 502 binding.surfaceInputOverlay.setIsInEditMode(true)
391 } 503 }
@@ -393,6 +505,12 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
393 private fun stopConfiguringControls() { 505 private fun stopConfiguringControls() {
394 binding.doneControlConfig.visibility = View.GONE 506 binding.doneControlConfig.visibility = View.GONE
395 binding.surfaceInputOverlay.setIsInEditMode(false) 507 binding.surfaceInputOverlay.setIsInEditMode(false)
508 // Unlock the orientation if it was locked for editing
509 if (IntSetting.RENDERER_SCREEN_LAYOUT.int == Settings.LayoutOption_Unspecified) {
510 emulationActivity?.let {
511 it.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
512 }
513 }
396 } 514 }
397 515
398 @SuppressLint("SetTextI18n") 516 @SuppressLint("SetTextI18n")
@@ -402,18 +520,22 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
402 inputScaleSlider.apply { 520 inputScaleSlider.apply {
403 valueTo = 150F 521 valueTo = 150F
404 value = preferences.getInt(Settings.PREF_CONTROL_SCALE, 50).toFloat() 522 value = preferences.getInt(Settings.PREF_CONTROL_SCALE, 50).toFloat()
405 addOnChangeListener(Slider.OnChangeListener { _, value, _ -> 523 addOnChangeListener(
406 inputScaleValue.text = "${value.toInt()}%" 524 Slider.OnChangeListener { _, value, _ ->
407 setControlScale(value.toInt()) 525 inputScaleValue.text = "${value.toInt()}%"
408 }) 526 setControlScale(value.toInt())
527 }
528 )
409 } 529 }
410 inputOpacitySlider.apply { 530 inputOpacitySlider.apply {
411 valueTo = 100F 531 valueTo = 100F
412 value = preferences.getInt(Settings.PREF_CONTROL_OPACITY, 100).toFloat() 532 value = preferences.getInt(Settings.PREF_CONTROL_OPACITY, 100).toFloat()
413 addOnChangeListener(Slider.OnChangeListener { _, value, _ -> 533 addOnChangeListener(
414 inputOpacityValue.text = "${value.toInt()}%" 534 Slider.OnChangeListener { _, value, _ ->
415 setControlOpacity(value.toInt()) 535 inputOpacityValue.text = "${value.toInt()}%"
416 }) 536 setControlOpacity(value.toInt())
537 }
538 )
417 } 539 }
418 inputScaleValue.text = "${inputScaleSlider.value.toInt()}%" 540 inputScaleValue.text = "${inputScaleSlider.value.toInt()}%"
419 inputOpacityValue.text = "${inputOpacitySlider.value.toInt()}%" 541 inputOpacityValue.text = "${inputOpacitySlider.value.toInt()}%"
@@ -445,7 +567,9 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
445 } 567 }
446 568
447 private fun setInsets() { 569 private fun setInsets() {
448 ViewCompat.setOnApplyWindowInsetsListener(binding.inGameMenu) { v: View, windowInsets: WindowInsetsCompat -> 570 ViewCompat.setOnApplyWindowInsetsListener(
571 binding.inGameMenu
572 ) { v: View, windowInsets: WindowInsetsCompat ->
449 val cutInsets: Insets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout()) 573 val cutInsets: Insets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout())
450 var left = 0 574 var left = 0
451 var right = 0 575 var right = 0
@@ -565,8 +689,12 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
565 state = State.PAUSED 689 state = State.PAUSED
566 } 690 }
567 691
568 State.PAUSED -> Log.warning("[EmulationFragment] Surface cleared while emulation paused.") 692 State.PAUSED -> Log.warning(
569 else -> Log.warning("[EmulationFragment] Surface cleared while emulation stopped.") 693 "[EmulationFragment] Surface cleared while emulation paused."
694 )
695 else -> Log.warning(
696 "[EmulationFragment] Surface cleared while emulation stopped."
697 )
570 } 698 }
571 } 699 }
572 } 700 }
@@ -601,13 +729,5 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
601 729
602 companion object { 730 companion object {
603 private val perfStatsUpdateHandler = Handler(Looper.myLooper()!!) 731 private val perfStatsUpdateHandler = Handler(Looper.myLooper()!!)
604
605 fun newInstance(game: Game): EmulationFragment {
606 val args = Bundle()
607 args.putParcelable(EmulationActivity.EXTRA_SELECTED_GAME, game)
608 val fragment = EmulationFragment()
609 fragment.arguments = args
610 return fragment
611 }
612 } 732 }
613} 733}
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt
index bdc337501..5a36ffad4 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt
@@ -68,67 +68,109 @@ class HomeSettingsFragment : Fragment() {
68 override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 68 override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
69 mainActivity = requireActivity() as MainActivity 69 mainActivity = requireActivity() as MainActivity
70 70
71 val optionsList: MutableList<HomeSetting> = mutableListOf( 71 val optionsList: MutableList<HomeSetting> = mutableListOf<HomeSetting>().apply {
72 HomeSetting( 72 add(
73 R.string.advanced_settings, 73 HomeSetting(
74 R.string.settings_description, 74 R.string.advanced_settings,
75 R.drawable.ic_settings 75 R.string.settings_description,
76 ) { SettingsActivity.launch(requireContext(), SettingsFile.FILE_NAME_CONFIG, "") }, 76 R.drawable.ic_settings
77 HomeSetting( 77 ) { SettingsActivity.launch(requireContext(), SettingsFile.FILE_NAME_CONFIG, "") }
78 R.string.open_user_folder, 78 )
79 R.string.open_user_folder_description, 79 add(
80 R.drawable.ic_folder_open 80 HomeSetting(
81 ) { openFileManager() }, 81 R.string.open_user_folder,
82 HomeSetting( 82 R.string.open_user_folder_description,
83 R.string.preferences_theme, 83 R.drawable.ic_folder_open
84 R.string.theme_and_color_description, 84 ) { openFileManager() }
85 R.drawable.ic_palette 85 )
86 ) { SettingsActivity.launch(requireContext(), Settings.SECTION_THEME, "") }, 86 add(
87 HomeSetting( 87 HomeSetting(
88 R.string.install_gpu_driver, 88 R.string.preferences_theme,
89 R.string.install_gpu_driver_description, 89 R.string.theme_and_color_description,
90 R.drawable.ic_exit 90 R.drawable.ic_palette
91 ) { driverInstaller() }, 91 ) { SettingsActivity.launch(requireContext(), Settings.SECTION_THEME, "") }
92 HomeSetting( 92 )
93 R.string.install_amiibo_keys, 93
94 R.string.install_amiibo_keys_description, 94 if (GpuDriverHelper.supportsCustomDriverLoading()) {
95 R.drawable.ic_nfc 95 add(
96 ) { mainActivity.getAmiiboKey.launch(arrayOf("*/*")) }, 96 HomeSetting(
97 HomeSetting( 97 R.string.install_gpu_driver,
98 R.string.select_games_folder, 98 R.string.install_gpu_driver_description,
99 R.string.select_games_folder_description, 99 R.drawable.ic_exit
100 R.drawable.ic_add 100 ) { driverInstaller() }
101 ) { mainActivity.getGamesDirectory.launch(Intent(Intent.ACTION_OPEN_DOCUMENT_TREE).data) }, 101 )
102 HomeSetting(
103 R.string.manage_save_data,
104 R.string.import_export_saves_description,
105 R.drawable.ic_save
106 ) { ImportExportSavesFragment().show(parentFragmentManager, ImportExportSavesFragment.TAG) },
107 HomeSetting(
108 R.string.install_prod_keys,
109 R.string.install_prod_keys_description,
110 R.drawable.ic_unlock
111 ) { mainActivity.getProdKey.launch(arrayOf("*/*")) },
112 HomeSetting(
113 R.string.install_firmware,
114 R.string.install_firmware_description,
115 R.drawable.ic_firmware
116 ) { mainActivity.getFirmware.launch(arrayOf("application/zip")) },
117 HomeSetting(
118 R.string.share_log,
119 R.string.share_log_description,
120 R.drawable.ic_log
121 ) { shareLog() },
122 HomeSetting(
123 R.string.about,
124 R.string.about_description,
125 R.drawable.ic_info_outline
126 ) {
127 exitTransition = MaterialSharedAxis(MaterialSharedAxis.X, true)
128 parentFragmentManager.primaryNavigationFragment?.findNavController()
129 ?.navigate(R.id.action_homeSettingsFragment_to_aboutFragment)
130 } 102 }
131 ) 103
104 add(
105 HomeSetting(
106 R.string.install_amiibo_keys,
107 R.string.install_amiibo_keys_description,
108 R.drawable.ic_nfc
109 ) { mainActivity.getAmiiboKey.launch(arrayOf("*/*")) }
110 )
111 add(
112 HomeSetting(
113 R.string.install_game_content,
114 R.string.install_game_content_description,
115 R.drawable.ic_system_update_alt
116 ) { mainActivity.installGameUpdate.launch(arrayOf("*/*")) }
117 )
118 add(
119 HomeSetting(
120 R.string.select_games_folder,
121 R.string.select_games_folder_description,
122 R.drawable.ic_add
123 ) {
124 mainActivity.getGamesDirectory.launch(
125 Intent(Intent.ACTION_OPEN_DOCUMENT_TREE).data
126 )
127 }
128 )
129 add(
130 HomeSetting(
131 R.string.manage_save_data,
132 R.string.import_export_saves_description,
133 R.drawable.ic_save
134 ) {
135 ImportExportSavesFragment().show(
136 parentFragmentManager,
137 ImportExportSavesFragment.TAG
138 )
139 }
140 )
141 add(
142 HomeSetting(
143 R.string.install_prod_keys,
144 R.string.install_prod_keys_description,
145 R.drawable.ic_unlock
146 ) { mainActivity.getProdKey.launch(arrayOf("*/*")) }
147 )
148 add(
149 HomeSetting(
150 R.string.install_firmware,
151 R.string.install_firmware_description,
152 R.drawable.ic_firmware
153 ) { mainActivity.getFirmware.launch(arrayOf("application/zip")) }
154 )
155 add(
156 HomeSetting(
157 R.string.share_log,
158 R.string.share_log_description,
159 R.drawable.ic_log
160 ) { shareLog() }
161 )
162 add(
163 HomeSetting(
164 R.string.about,
165 R.string.about_description,
166 R.drawable.ic_info_outline
167 ) {
168 exitTransition = MaterialSharedAxis(MaterialSharedAxis.X, true)
169 parentFragmentManager.primaryNavigationFragment?.findNavController()
170 ?.navigate(R.id.action_homeSettingsFragment_to_aboutFragment)
171 }
172 )
173 }
132 174
133 if (!BuildConfig.PREMIUM) { 175 if (!BuildConfig.PREMIUM) {
134 optionsList.add( 176 optionsList.add(
@@ -215,7 +257,11 @@ class HomeSettingsFragment : Fragment() {
215 val intent = Intent(action) 257 val intent = Intent(action)
216 intent.addCategory(Intent.CATEGORY_DEFAULT) 258 intent.addCategory(Intent.CATEGORY_DEFAULT)
217 intent.data = DocumentsContract.buildRootUri(authority, DocumentProvider.ROOT_ID) 259 intent.data = DocumentsContract.buildRootUri(authority, DocumentProvider.ROOT_ID)
218 intent.addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION or Intent.FLAG_GRANT_PREFIX_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION) 260 intent.addFlags(
261 Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION or
262 Intent.FLAG_GRANT_PREFIX_URI_PERMISSION or
263 Intent.FLAG_GRANT_WRITE_URI_PERMISSION
264 )
219 return intent 265 return intent
220 } 266 }
221 267
@@ -297,7 +343,9 @@ class HomeSettingsFragment : Fragment() {
297 } 343 }
298 344
299 private fun setInsets() = 345 private fun setInsets() =
300 ViewCompat.setOnApplyWindowInsetsListener(binding.root) { view: View, windowInsets: WindowInsetsCompat -> 346 ViewCompat.setOnApplyWindowInsetsListener(
347 binding.root
348 ) { view: View, windowInsets: WindowInsetsCompat ->
301 val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) 349 val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
302 val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout()) 350 val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout())
303 val spacingNavigation = resources.getDimensionPixelSize(R.dimen.spacing_navigation) 351 val spacingNavigation = resources.getDimensionPixelSize(R.dimen.spacing_navigation)
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/ImportExportSavesFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/ImportExportSavesFragment.kt
index 36e63bb9e..e1495ee8c 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/ImportExportSavesFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/ImportExportSavesFragment.kt
@@ -15,6 +15,14 @@ import androidx.appcompat.app.AppCompatActivity
15import androidx.documentfile.provider.DocumentFile 15import androidx.documentfile.provider.DocumentFile
16import androidx.fragment.app.DialogFragment 16import androidx.fragment.app.DialogFragment
17import com.google.android.material.dialog.MaterialAlertDialogBuilder 17import com.google.android.material.dialog.MaterialAlertDialogBuilder
18import java.io.BufferedOutputStream
19import java.io.File
20import java.io.FileOutputStream
21import java.io.FilenameFilter
22import java.time.LocalDateTime
23import java.time.format.DateTimeFormatter
24import java.util.zip.ZipEntry
25import java.util.zip.ZipOutputStream
18import kotlinx.coroutines.CoroutineScope 26import kotlinx.coroutines.CoroutineScope
19import kotlinx.coroutines.Dispatchers 27import kotlinx.coroutines.Dispatchers
20import kotlinx.coroutines.launch 28import kotlinx.coroutines.launch
@@ -24,14 +32,6 @@ import org.yuzu.yuzu_emu.YuzuApplication
24import org.yuzu.yuzu_emu.features.DocumentProvider 32import org.yuzu.yuzu_emu.features.DocumentProvider
25import org.yuzu.yuzu_emu.getPublicFilesDir 33import org.yuzu.yuzu_emu.getPublicFilesDir
26import org.yuzu.yuzu_emu.utils.FileUtil 34import org.yuzu.yuzu_emu.utils.FileUtil
27import java.io.BufferedOutputStream
28import java.io.File
29import java.io.FileOutputStream
30import java.io.FilenameFilter
31import java.time.LocalDateTime
32import java.time.format.DateTimeFormatter
33import java.util.zip.ZipEntry
34import java.util.zip.ZipOutputStream
35 35
36class ImportExportSavesFragment : DialogFragment() { 36class ImportExportSavesFragment : DialogFragment() {
37 private val context = YuzuApplication.appContext 37 private val context = YuzuApplication.appContext
@@ -98,7 +98,7 @@ class ImportExportSavesFragment : DialogFragment() {
98 val outputZipFile = File( 98 val outputZipFile = File(
99 tempFolder, 99 tempFolder,
100 "yuzu saves - ${ 100 "yuzu saves - ${
101 LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")) 101 LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"))
102 }.zip" 102 }.zip"
103 ) 103 )
104 outputZipFile.createNewFile() 104 outputZipFile.createNewFile()
@@ -106,12 +106,14 @@ class ImportExportSavesFragment : DialogFragment() {
106 saveFolder.walkTopDown().forEach { file -> 106 saveFolder.walkTopDown().forEach { file ->
107 val zipFileName = 107 val zipFileName =
108 file.absolutePath.removePrefix(savesFolderRoot).removePrefix("/") 108 file.absolutePath.removePrefix(savesFolderRoot).removePrefix("/")
109 if (zipFileName == "") 109 if (zipFileName == "") {
110 return@forEach 110 return@forEach
111 }
111 val entry = ZipEntry("$zipFileName${(if (file.isDirectory) "/" else "")}") 112 val entry = ZipEntry("$zipFileName${(if (file.isDirectory) "/" else "")}")
112 zos.putNextEntry(entry) 113 zos.putNextEntry(entry)
113 if (file.isFile) 114 if (file.isFile) {
114 file.inputStream().use { fis -> fis.copyTo(zos) } 115 file.inputStream().use { fis -> fis.copyTo(zos) }
116 }
115 } 117 }
116 } 118 }
117 lastZipCreated = outputZipFile 119 lastZipCreated = outputZipFile
@@ -137,7 +139,8 @@ class ImportExportSavesFragment : DialogFragment() {
137 139
138 withContext(Dispatchers.Main) { 140 withContext(Dispatchers.Main) {
139 val file = DocumentFile.fromSingleUri( 141 val file = DocumentFile.fromSingleUri(
140 context, DocumentsContract.buildDocumentUri( 142 context,
143 DocumentsContract.buildDocumentUri(
141 DocumentProvider.AUTHORITY, 144 DocumentProvider.AUTHORITY,
142 "${DocumentProvider.ROOT_ID}/temp/${lastZipFile.name}" 145 "${DocumentProvider.ROOT_ID}/temp/${lastZipFile.name}"
143 ) 146 )
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/IndeterminateProgressDialogFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/IndeterminateProgressDialogFragment.kt
index c7880d8cc..739b26f99 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/IndeterminateProgressDialogFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/IndeterminateProgressDialogFragment.kt
@@ -14,7 +14,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
14import org.yuzu.yuzu_emu.databinding.DialogProgressBarBinding 14import org.yuzu.yuzu_emu.databinding.DialogProgressBarBinding
15import org.yuzu.yuzu_emu.model.TaskViewModel 15import org.yuzu.yuzu_emu.model.TaskViewModel
16 16
17
18class IndeterminateProgressDialogFragment : DialogFragment() { 17class IndeterminateProgressDialogFragment : DialogFragment() {
19 private val taskViewModel: TaskViewModel by activityViewModels() 18 private val taskViewModel: TaskViewModel by activityViewModels()
20 19
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/LicensesFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/LicensesFragment.kt
index 59141e823..b6e9129f7 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/LicensesFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/LicensesFragment.kt
@@ -113,7 +113,9 @@ class LicensesFragment : Fragment() {
113 } 113 }
114 114
115 private fun setInsets() = 115 private fun setInsets() =
116 ViewCompat.setOnApplyWindowInsetsListener(binding.root) { _: View, windowInsets: WindowInsetsCompat -> 116 ViewCompat.setOnApplyWindowInsetsListener(
117 binding.root
118 ) { _: View, windowInsets: WindowInsetsCompat ->
117 val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) 119 val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
118 val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout()) 120 val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout())
119 121
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SearchFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SearchFragment.kt
index ebc0f164a..dd6c895fd 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SearchFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SearchFragment.kt
@@ -20,6 +20,7 @@ import androidx.fragment.app.activityViewModels
20import androidx.preference.PreferenceManager 20import androidx.preference.PreferenceManager
21import info.debatty.java.stringsimilarity.Jaccard 21import info.debatty.java.stringsimilarity.Jaccard
22import info.debatty.java.stringsimilarity.JaroWinkler 22import info.debatty.java.stringsimilarity.JaroWinkler
23import java.util.Locale
23import org.yuzu.yuzu_emu.R 24import org.yuzu.yuzu_emu.R
24import org.yuzu.yuzu_emu.YuzuApplication 25import org.yuzu.yuzu_emu.YuzuApplication
25import org.yuzu.yuzu_emu.adapters.GameAdapter 26import org.yuzu.yuzu_emu.adapters.GameAdapter
@@ -29,8 +30,6 @@ import org.yuzu.yuzu_emu.model.Game
29import org.yuzu.yuzu_emu.model.GamesViewModel 30import org.yuzu.yuzu_emu.model.GamesViewModel
30import org.yuzu.yuzu_emu.model.HomeViewModel 31import org.yuzu.yuzu_emu.model.HomeViewModel
31import org.yuzu.yuzu_emu.utils.FileUtil 32import org.yuzu.yuzu_emu.utils.FileUtil
32import org.yuzu.yuzu_emu.utils.Log
33import java.util.Locale
34 33
35class SearchFragment : Fragment() { 34class SearchFragment : Fragment() {
36 private var _binding: FragmentSearchBinding? = null 35 private var _binding: FragmentSearchBinding? = null
@@ -127,24 +126,18 @@ class SearchFragment : Fragment() {
127 } 126 }
128 } 127 }
129 128
130 R.id.chip_homebrew -> { 129 R.id.chip_homebrew -> baseList.filter { it.isHomebrew }
131 baseList.filter {
132 Log.error("Guh - ${it.path}")
133 FileUtil.hasExtension(it.path, "nro")
134 || FileUtil.hasExtension(it.path, "nso")
135 }
136 }
137 130
138 R.id.chip_retail -> baseList.filter { 131 R.id.chip_retail -> baseList.filter {
139 FileUtil.hasExtension(it.path, "xci") 132 FileUtil.hasExtension(it.path, "xci") ||
140 || FileUtil.hasExtension(it.path, "nsp") 133 FileUtil.hasExtension(it.path, "nsp")
141 } 134 }
142 135
143 else -> baseList 136 else -> baseList
144 } 137 }
145 138
146 if (binding.searchText.text.toString().isEmpty() 139 if (binding.searchText.text.toString().isEmpty() &&
147 && binding.chipGroup.checkedChipId != View.NO_ID 140 binding.chipGroup.checkedChipId != View.NO_ID
148 ) { 141 ) {
149 gamesViewModel.setSearchedGames(filteredList) 142 gamesViewModel.setSearchedGames(filteredList)
150 return 143 return
@@ -179,14 +172,16 @@ class SearchFragment : Fragment() {
179 private fun focusSearch() { 172 private fun focusSearch() {
180 if (_binding != null) { 173 if (_binding != null) {
181 binding.searchText.requestFocus() 174 binding.searchText.requestFocus()
182 val imm = 175 val imm = requireActivity()
183 requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager? 176 .getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager?
184 imm?.showSoftInput(binding.searchText, InputMethodManager.SHOW_IMPLICIT) 177 imm?.showSoftInput(binding.searchText, InputMethodManager.SHOW_IMPLICIT)
185 } 178 }
186 } 179 }
187 180
188 private fun setInsets() = 181 private fun setInsets() =
189 ViewCompat.setOnApplyWindowInsetsListener(binding.root) { view: View, windowInsets: WindowInsetsCompat -> 182 ViewCompat.setOnApplyWindowInsetsListener(
183 binding.root
184 ) { view: View, windowInsets: WindowInsetsCompat ->
190 val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) 185 val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
191 val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout()) 186 val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout())
192 val extraListSpacing = resources.getDimensionPixelSize(R.dimen.spacing_med) 187 val extraListSpacing = resources.getDimensionPixelSize(R.dimen.spacing_med)
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt
index 258773380..6c4ddaf6b 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt
@@ -25,6 +25,7 @@ import androidx.navigation.findNavController
25import androidx.preference.PreferenceManager 25import androidx.preference.PreferenceManager
26import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback 26import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback
27import com.google.android.material.transition.MaterialFadeThrough 27import com.google.android.material.transition.MaterialFadeThrough
28import java.io.File
28import org.yuzu.yuzu_emu.R 29import org.yuzu.yuzu_emu.R
29import org.yuzu.yuzu_emu.YuzuApplication 30import org.yuzu.yuzu_emu.YuzuApplication
30import org.yuzu.yuzu_emu.adapters.SetupAdapter 31import org.yuzu.yuzu_emu.adapters.SetupAdapter
@@ -35,7 +36,6 @@ import org.yuzu.yuzu_emu.model.SetupPage
35import org.yuzu.yuzu_emu.ui.main.MainActivity 36import org.yuzu.yuzu_emu.ui.main.MainActivity
36import org.yuzu.yuzu_emu.utils.DirectoryInitialization 37import org.yuzu.yuzu_emu.utils.DirectoryInitialization
37import org.yuzu.yuzu_emu.utils.GameHelper 38import org.yuzu.yuzu_emu.utils.GameHelper
38import java.io.File
39 39
40class SetupFragment : Fragment() { 40class SetupFragment : Fragment() {
41 private var _binding: FragmentSetupBinding? = null 41 private var _binding: FragmentSetupBinding? = null
@@ -82,7 +82,8 @@ class SetupFragment : Fragment() {
82 requireActivity().finish() 82 requireActivity().finish()
83 } 83 }
84 } 84 }
85 }) 85 }
86 )
86 87
87 requireActivity().window.navigationBarColor = 88 requireActivity().window.navigationBarColor =
88 ContextCompat.getColor(requireContext(), android.R.color.transparent) 89 ContextCompat.getColor(requireContext(), android.R.color.transparent)
@@ -148,14 +149,20 @@ class SetupFragment : Fragment() {
148 R.drawable.ic_add, 149 R.drawable.ic_add,
149 true, 150 true,
150 R.string.add_games, 151 R.string.add_games,
151 { mainActivity.getGamesDirectory.launch(Intent(Intent.ACTION_OPEN_DOCUMENT_TREE).data) }, 152 {
153 mainActivity.getGamesDirectory.launch(
154 Intent(Intent.ACTION_OPEN_DOCUMENT_TREE).data
155 )
156 },
152 true, 157 true,
153 R.string.add_games_warning, 158 R.string.add_games_warning,
154 R.string.add_games_warning_description, 159 R.string.add_games_warning_description,
155 R.string.add_games_warning_help, 160 R.string.add_games_warning_help,
156 { 161 {
157 val preferences = 162 val preferences =
158 PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext) 163 PreferenceManager.getDefaultSharedPreferences(
164 YuzuApplication.appContext
165 )
159 preferences.getString(GameHelper.KEY_GAME_PATH, "")!!.isNotEmpty() 166 preferences.getString(GameHelper.KEY_GAME_PATH, "")!!.isNotEmpty()
160 } 167 }
161 ) 168 )
@@ -260,7 +267,9 @@ class SetupFragment : Fragment() {
260 @RequiresApi(Build.VERSION_CODES.TIRAMISU) 267 @RequiresApi(Build.VERSION_CODES.TIRAMISU)
261 private val permissionLauncher = 268 private val permissionLauncher =
262 registerForActivityResult(ActivityResultContracts.RequestPermission()) { 269 registerForActivityResult(ActivityResultContracts.RequestPermission()) {
263 if (!it && !shouldShowRequestPermissionRationale(Manifest.permission.POST_NOTIFICATIONS)) { 270 if (!it &&
271 !shouldShowRequestPermissionRationale(Manifest.permission.POST_NOTIFICATIONS)
272 ) {
264 PermissionDeniedDialogFragment().show( 273 PermissionDeniedDialogFragment().show(
265 childFragmentManager, 274 childFragmentManager,
266 PermissionDeniedDialogFragment.TAG 275 PermissionDeniedDialogFragment.TAG
@@ -315,7 +324,9 @@ class SetupFragment : Fragment() {
315 } 324 }
316 325
317 private fun setInsets() = 326 private fun setInsets() =
318 ViewCompat.setOnApplyWindowInsetsListener(binding.root) { view: View, windowInsets: WindowInsetsCompat -> 327 ViewCompat.setOnApplyWindowInsetsListener(
328 binding.root
329 ) { view: View, windowInsets: WindowInsetsCompat ->
319 val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) 330 val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
320 val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout()) 331 val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout())
321 view.setPadding( 332 view.setPadding(
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/layout/AutofitGridLayoutManager.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/layout/AutofitGridLayoutManager.kt
index be5e4c86c..bdd6ea628 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/layout/AutofitGridLayoutManager.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/layout/AutofitGridLayoutManager.kt
@@ -44,7 +44,9 @@ class AutofitGridLayoutManager(
44 override fun onLayoutChildren(recycler: Recycler, state: RecyclerView.State) { 44 override fun onLayoutChildren(recycler: Recycler, state: RecyclerView.State) {
45 val width = width 45 val width = width
46 val height = height 46 val height = height
47 if (columnWidth > 0 && width > 0 && height > 0 && (isColumnWidthChanged || lastWidth != width || lastHeight != height)) { 47 if (columnWidth > 0 && width > 0 && height > 0 &&
48 (isColumnWidthChanged || lastWidth != width || lastHeight != height)
49 ) {
48 val totalSpace: Int = if (orientation == VERTICAL) { 50 val totalSpace: Int = if (orientation == VERTICAL) {
49 width - paddingRight - paddingLeft 51 width - paddingRight - paddingLeft
50 } else { 52 } else {
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/Game.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/Game.kt
index 2a17653b2..6a048e39f 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/Game.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/Game.kt
@@ -4,9 +4,9 @@
4package org.yuzu.yuzu_emu.model 4package org.yuzu.yuzu_emu.model
5 5
6import android.os.Parcelable 6import android.os.Parcelable
7import java.util.HashSet
7import kotlinx.parcelize.Parcelize 8import kotlinx.parcelize.Parcelize
8import kotlinx.serialization.Serializable 9import kotlinx.serialization.Serializable
9import java.util.HashSet
10 10
11@Parcelize 11@Parcelize
12@Serializable 12@Serializable
@@ -16,21 +16,29 @@ class Game(
16 val regions: String, 16 val regions: String,
17 val path: String, 17 val path: String,
18 val gameId: String, 18 val gameId: String,
19 val company: String 19 val company: String,
20 val isHomebrew: Boolean
20) : Parcelable { 21) : Parcelable {
21 val keyAddedToLibraryTime get() = "${gameId}_AddedToLibraryTime" 22 val keyAddedToLibraryTime get() = "${gameId}_AddedToLibraryTime"
22 val keyLastPlayedTime get() = "${gameId}_LastPlayed" 23 val keyLastPlayedTime get() = "${gameId}_LastPlayed"
23 24
24 override fun equals(other: Any?): Boolean { 25 override fun equals(other: Any?): Boolean {
25 if (other !is Game) 26 if (other !is Game) {
26 return false 27 return false
28 }
29
30 return hashCode() == other.hashCode()
31 }
27 32
28 return title == other.title 33 override fun hashCode(): Int {
29 && description == other.description 34 var result = title.hashCode()
30 && regions == other.regions 35 result = 31 * result + description.hashCode()
31 && path == other.path 36 result = 31 * result + regions.hashCode()
32 && gameId == other.gameId 37 result = 31 * result + path.hashCode()
33 && company == other.company 38 result = 31 * result + gameId.hashCode()
39 result = 31 * result + company.hashCode()
40 result = 31 * result + isHomebrew.hashCode()
41 return result
34 } 42 }
35 43
36 companion object { 44 companion object {
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/GamesViewModel.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/GamesViewModel.kt
index 7059856f1..1fe42f922 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/GamesViewModel.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/GamesViewModel.kt
@@ -10,16 +10,19 @@ import androidx.lifecycle.MutableLiveData
10import androidx.lifecycle.ViewModel 10import androidx.lifecycle.ViewModel
11import androidx.lifecycle.viewModelScope 11import androidx.lifecycle.viewModelScope
12import androidx.preference.PreferenceManager 12import androidx.preference.PreferenceManager
13import java.util.Locale
13import kotlinx.coroutines.Dispatchers 14import kotlinx.coroutines.Dispatchers
14import kotlinx.coroutines.launch 15import kotlinx.coroutines.launch
15import kotlinx.coroutines.withContext 16import kotlinx.coroutines.withContext
17import kotlinx.serialization.ExperimentalSerializationApi
18import kotlinx.serialization.MissingFieldException
16import kotlinx.serialization.decodeFromString 19import kotlinx.serialization.decodeFromString
17import kotlinx.serialization.json.Json 20import kotlinx.serialization.json.Json
18import org.yuzu.yuzu_emu.NativeLibrary 21import org.yuzu.yuzu_emu.NativeLibrary
19import org.yuzu.yuzu_emu.YuzuApplication 22import org.yuzu.yuzu_emu.YuzuApplication
20import org.yuzu.yuzu_emu.utils.GameHelper 23import org.yuzu.yuzu_emu.utils.GameHelper
21import java.util.Locale
22 24
25@OptIn(ExperimentalSerializationApi::class)
23class GamesViewModel : ViewModel() { 26class GamesViewModel : ViewModel() {
24 private val _games = MutableLiveData<List<Game>>(emptyList()) 27 private val _games = MutableLiveData<List<Game>>(emptyList())
25 val games: LiveData<List<Game>> get() = _games 28 val games: LiveData<List<Game>> get() = _games
@@ -49,7 +52,13 @@ class GamesViewModel : ViewModel() {
49 if (storedGames!!.isNotEmpty()) { 52 if (storedGames!!.isNotEmpty()) {
50 val deserializedGames = mutableSetOf<Game>() 53 val deserializedGames = mutableSetOf<Game>()
51 storedGames.forEach { 54 storedGames.forEach {
52 val game: Game = Json.decodeFromString(it) 55 val game: Game
56 try {
57 game = Json.decodeFromString(it)
58 } catch (e: MissingFieldException) {
59 return@forEach
60 }
61
53 val gameExists = 62 val gameExists =
54 DocumentFile.fromSingleUri(YuzuApplication.appContext, Uri.parse(game.path)) 63 DocumentFile.fromSingleUri(YuzuApplication.appContext, Uri.parse(game.path))
55 ?.exists() 64 ?.exists()
@@ -90,8 +99,9 @@ class GamesViewModel : ViewModel() {
90 } 99 }
91 100
92 fun reloadGames(directoryChanged: Boolean) { 101 fun reloadGames(directoryChanged: Boolean) {
93 if (isReloading.value == true) 102 if (isReloading.value == true) {
94 return 103 return
104 }
95 _isReloading.postValue(true) 105 _isReloading.postValue(true)
96 106
97 viewModelScope.launch { 107 viewModelScope.launch {
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt
index c9f5797ac..6251ec783 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt
@@ -6,7 +6,6 @@ package org.yuzu.yuzu_emu.overlay
6import android.app.Activity 6import android.app.Activity
7import android.content.Context 7import android.content.Context
8import android.content.SharedPreferences 8import android.content.SharedPreferences
9import android.content.res.Configuration
10import android.graphics.Bitmap 9import android.graphics.Bitmap
11import android.graphics.Canvas 10import android.graphics.Canvas
12import android.graphics.Point 11import android.graphics.Point
@@ -24,6 +23,8 @@ import android.view.WindowInsets
24import androidx.core.content.ContextCompat 23import androidx.core.content.ContextCompat
25import androidx.preference.PreferenceManager 24import androidx.preference.PreferenceManager
26import androidx.window.layout.WindowMetricsCalculator 25import androidx.window.layout.WindowMetricsCalculator
26import kotlin.math.max
27import kotlin.math.min
27import org.yuzu.yuzu_emu.NativeLibrary 28import org.yuzu.yuzu_emu.NativeLibrary
28import org.yuzu.yuzu_emu.NativeLibrary.ButtonType 29import org.yuzu.yuzu_emu.NativeLibrary.ButtonType
29import org.yuzu.yuzu_emu.NativeLibrary.StickType 30import org.yuzu.yuzu_emu.NativeLibrary.StickType
@@ -31,14 +32,13 @@ import org.yuzu.yuzu_emu.R
31import org.yuzu.yuzu_emu.YuzuApplication 32import org.yuzu.yuzu_emu.YuzuApplication
32import org.yuzu.yuzu_emu.features.settings.model.Settings 33import org.yuzu.yuzu_emu.features.settings.model.Settings
33import org.yuzu.yuzu_emu.utils.EmulationMenuSettings 34import org.yuzu.yuzu_emu.utils.EmulationMenuSettings
34import kotlin.math.max
35import kotlin.math.min
36 35
37/** 36/**
38 * Draws the interactive input overlay on top of the 37 * Draws the interactive input overlay on top of the
39 * [SurfaceView] that is rendering emulation. 38 * [SurfaceView] that is rendering emulation.
40 */ 39 */
41class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context, attrs), 40class InputOverlay(context: Context, attrs: AttributeSet?) :
41 SurfaceView(context, attrs),
42 OnTouchListener { 42 OnTouchListener {
43 private val overlayButtons: MutableSet<InputOverlayDrawableButton> = HashSet() 43 private val overlayButtons: MutableSet<InputOverlayDrawableButton> = HashSet()
44 private val overlayDpads: MutableSet<InputOverlayDrawableDpad> = HashSet() 44 private val overlayDpads: MutableSet<InputOverlayDrawableDpad> = HashSet()
@@ -51,12 +51,14 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
51 51
52 private lateinit var windowInsets: WindowInsets 52 private lateinit var windowInsets: WindowInsets
53 53
54 var orientation = LANDSCAPE
55
54 override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) { 56 override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
55 super.onLayout(changed, left, top, right, bottom) 57 super.onLayout(changed, left, top, right, bottom)
56 58
57 windowInsets = rootWindowInsets 59 windowInsets = rootWindowInsets
58 60
59 if (!preferences.getBoolean(Settings.PREF_OVERLAY_INIT, false)) { 61 if (!preferences.getBoolean("${Settings.PREF_OVERLAY_INIT}$orientation", false)) {
60 defaultOverlay() 62 defaultOverlay()
61 } 63 }
62 64
@@ -93,7 +95,11 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
93 95
94 var shouldUpdateView = false 96 var shouldUpdateView = false
95 val playerIndex = 97 val playerIndex =
96 if (NativeLibrary.isHandheldOnly()) NativeLibrary.ConsoleDevice else NativeLibrary.Player1Device 98 if (NativeLibrary.isHandheldOnly()) {
99 NativeLibrary.ConsoleDevice
100 } else {
101 NativeLibrary.Player1Device
102 }
97 103
98 for (button in overlayButtons) { 104 for (button in overlayButtons) {
99 if (!button.updateStatus(event)) { 105 if (!button.updateStatus(event)) {
@@ -156,8 +162,9 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
156 shouldUpdateView = true 162 shouldUpdateView = true
157 } 163 }
158 164
159 if (shouldUpdateView) 165 if (shouldUpdateView) {
160 invalidate() 166 invalidate()
167 }
161 168
162 if (!preferences.getBoolean(Settings.PREF_TOUCH_ENABLED, true)) { 169 if (!preferences.getBoolean(Settings.PREF_TOUCH_ENABLED, true)) {
163 return true 170 return true
@@ -233,10 +240,6 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
233 val fingerPositionX = event.getX(pointerIndex).toInt() 240 val fingerPositionX = event.getX(pointerIndex).toInt()
234 val fingerPositionY = event.getY(pointerIndex).toInt() 241 val fingerPositionY = event.getY(pointerIndex).toInt()
235 242
236 // TODO: Provide support for portrait layout
237 //val orientation =
238 // if (resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT) "-Portrait" else ""
239
240 for (button in overlayButtons) { 243 for (button in overlayButtons) {
241 // Determine the button state to apply based on the MotionEvent action flag. 244 // Determine the button state to apply based on the MotionEvent action flag.
242 when (event.action and MotionEvent.ACTION_MASK) { 245 when (event.action and MotionEvent.ACTION_MASK) {
@@ -245,9 +248,9 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
245 // If no button is being moved now, remember the currently touched button to move. 248 // If no button is being moved now, remember the currently touched button to move.
246 if (buttonBeingConfigured == null && 249 if (buttonBeingConfigured == null &&
247 button.bounds.contains( 250 button.bounds.contains(
248 fingerPositionX, 251 fingerPositionX,
249 fingerPositionY 252 fingerPositionY
250 ) 253 )
251 ) { 254 ) {
252 buttonBeingConfigured = button 255 buttonBeingConfigured = button
253 buttonBeingConfigured!!.onConfigureTouch(event) 256 buttonBeingConfigured!!.onConfigureTouch(event)
@@ -266,7 +269,7 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
266 buttonBeingConfigured!!.buttonId, 269 buttonBeingConfigured!!.buttonId,
267 buttonBeingConfigured!!.bounds.centerX(), 270 buttonBeingConfigured!!.bounds.centerX(),
268 buttonBeingConfigured!!.bounds.centerY(), 271 buttonBeingConfigured!!.bounds.centerY(),
269 "" 272 orientation
270 ) 273 )
271 buttonBeingConfigured = null 274 buttonBeingConfigured = null
272 } 275 }
@@ -299,7 +302,7 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
299 dpadBeingConfigured!!.upId, 302 dpadBeingConfigured!!.upId,
300 dpadBeingConfigured!!.bounds.centerX(), 303 dpadBeingConfigured!!.bounds.centerX(),
301 dpadBeingConfigured!!.bounds.centerY(), 304 dpadBeingConfigured!!.bounds.centerY(),
302 "" 305 orientation
303 ) 306 )
304 dpadBeingConfigured = null 307 dpadBeingConfigured = null
305 } 308 }
@@ -311,9 +314,9 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
311 MotionEvent.ACTION_DOWN, 314 MotionEvent.ACTION_DOWN,
312 MotionEvent.ACTION_POINTER_DOWN -> if (joystickBeingConfigured == null && 315 MotionEvent.ACTION_POINTER_DOWN -> if (joystickBeingConfigured == null &&
313 joystick.bounds.contains( 316 joystick.bounds.contains(
314 fingerPositionX, 317 fingerPositionX,
315 fingerPositionY 318 fingerPositionY
316 ) 319 )
317 ) { 320 ) {
318 joystickBeingConfigured = joystick 321 joystickBeingConfigured = joystick
319 joystickBeingConfigured!!.onConfigureTouch(event) 322 joystickBeingConfigured!!.onConfigureTouch(event)
@@ -330,7 +333,7 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
330 joystickBeingConfigured!!.buttonId, 333 joystickBeingConfigured!!.buttonId,
331 joystickBeingConfigured!!.bounds.centerX(), 334 joystickBeingConfigured!!.bounds.centerX(),
332 joystickBeingConfigured!!.bounds.centerY(), 335 joystickBeingConfigured!!.bounds.centerY(),
333 "" 336 orientation
334 ) 337 )
335 joystickBeingConfigured = null 338 joystickBeingConfigured = null
336 } 339 }
@@ -533,8 +536,6 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
533 overlayButtons.clear() 536 overlayButtons.clear()
534 overlayDpads.clear() 537 overlayDpads.clear()
535 overlayJoysticks.clear() 538 overlayJoysticks.clear()
536 val orientation =
537 if (resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT) "-Portrait" else ""
538 539
539 // Add all the enabled overlay items back to the HashSet. 540 // Add all the enabled overlay items back to the HashSet.
540 if (EmulationMenuSettings.showOverlay) { 541 if (EmulationMenuSettings.showOverlay) {
@@ -548,8 +549,8 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
548 val min = windowSize.first 549 val min = windowSize.first
549 val max = windowSize.second 550 val max = windowSize.second
550 PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext).edit() 551 PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext).edit()
551 .putFloat("$sharedPrefsId$orientation-X", (x - min.x).toFloat() / max.x) 552 .putFloat("$sharedPrefsId-X$orientation", (x - min.x).toFloat() / max.x)
552 .putFloat("$sharedPrefsId$orientation-Y", (y - min.y).toFloat() / max.y) 553 .putFloat("$sharedPrefsId-Y$orientation", (y - min.y).toFloat() / max.y)
553 .apply() 554 .apply()
554 } 555 }
555 556
@@ -558,145 +559,250 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
558 } 559 }
559 560
560 private fun defaultOverlay() { 561 private fun defaultOverlay() {
561 if (!preferences.getBoolean(Settings.PREF_OVERLAY_INIT, false)) { 562 if (!preferences.getBoolean("${Settings.PREF_OVERLAY_INIT}$orientation", false)) {
562 defaultOverlayLandscape() 563 defaultOverlayByLayout(orientation)
563 } 564 }
564 565
565 resetButtonPlacement() 566 resetButtonPlacement()
566 preferences.edit() 567 preferences.edit()
567 .putBoolean(Settings.PREF_OVERLAY_INIT, true) 568 .putBoolean("${Settings.PREF_OVERLAY_INIT}$orientation", true)
568 .apply() 569 .apply()
569 } 570 }
570 571
571 fun resetButtonPlacement() { 572 fun resetButtonPlacement() {
572 defaultOverlayLandscape() 573 defaultOverlayByLayout(orientation)
573 refreshControls() 574 refreshControls()
574 } 575 }
575 576
576 private fun defaultOverlayLandscape() { 577 private val landscapeResources = arrayOf(
578 R.integer.SWITCH_BUTTON_A_X,
579 R.integer.SWITCH_BUTTON_A_Y,
580 R.integer.SWITCH_BUTTON_B_X,
581 R.integer.SWITCH_BUTTON_B_Y,
582 R.integer.SWITCH_BUTTON_X_X,
583 R.integer.SWITCH_BUTTON_X_Y,
584 R.integer.SWITCH_BUTTON_Y_X,
585 R.integer.SWITCH_BUTTON_Y_Y,
586 R.integer.SWITCH_TRIGGER_ZL_X,
587 R.integer.SWITCH_TRIGGER_ZL_Y,
588 R.integer.SWITCH_TRIGGER_ZR_X,
589 R.integer.SWITCH_TRIGGER_ZR_Y,
590 R.integer.SWITCH_BUTTON_DPAD_X,
591 R.integer.SWITCH_BUTTON_DPAD_Y,
592 R.integer.SWITCH_TRIGGER_L_X,
593 R.integer.SWITCH_TRIGGER_L_Y,
594 R.integer.SWITCH_TRIGGER_R_X,
595 R.integer.SWITCH_TRIGGER_R_Y,
596 R.integer.SWITCH_BUTTON_PLUS_X,
597 R.integer.SWITCH_BUTTON_PLUS_Y,
598 R.integer.SWITCH_BUTTON_MINUS_X,
599 R.integer.SWITCH_BUTTON_MINUS_Y,
600 R.integer.SWITCH_BUTTON_HOME_X,
601 R.integer.SWITCH_BUTTON_HOME_Y,
602 R.integer.SWITCH_BUTTON_CAPTURE_X,
603 R.integer.SWITCH_BUTTON_CAPTURE_Y,
604 R.integer.SWITCH_STICK_R_X,
605 R.integer.SWITCH_STICK_R_Y,
606 R.integer.SWITCH_STICK_L_X,
607 R.integer.SWITCH_STICK_L_Y
608 )
609
610 private val portraitResources = arrayOf(
611 R.integer.SWITCH_BUTTON_A_X_PORTRAIT,
612 R.integer.SWITCH_BUTTON_A_Y_PORTRAIT,
613 R.integer.SWITCH_BUTTON_B_X_PORTRAIT,
614 R.integer.SWITCH_BUTTON_B_Y_PORTRAIT,
615 R.integer.SWITCH_BUTTON_X_X_PORTRAIT,
616 R.integer.SWITCH_BUTTON_X_Y_PORTRAIT,
617 R.integer.SWITCH_BUTTON_Y_X_PORTRAIT,
618 R.integer.SWITCH_BUTTON_Y_Y_PORTRAIT,
619 R.integer.SWITCH_TRIGGER_ZL_X_PORTRAIT,
620 R.integer.SWITCH_TRIGGER_ZL_Y_PORTRAIT,
621 R.integer.SWITCH_TRIGGER_ZR_X_PORTRAIT,
622 R.integer.SWITCH_TRIGGER_ZR_Y_PORTRAIT,
623 R.integer.SWITCH_BUTTON_DPAD_X_PORTRAIT,
624 R.integer.SWITCH_BUTTON_DPAD_Y_PORTRAIT,
625 R.integer.SWITCH_TRIGGER_L_X_PORTRAIT,
626 R.integer.SWITCH_TRIGGER_L_Y_PORTRAIT,
627 R.integer.SWITCH_TRIGGER_R_X_PORTRAIT,
628 R.integer.SWITCH_TRIGGER_R_Y_PORTRAIT,
629 R.integer.SWITCH_BUTTON_PLUS_X_PORTRAIT,
630 R.integer.SWITCH_BUTTON_PLUS_Y_PORTRAIT,
631 R.integer.SWITCH_BUTTON_MINUS_X_PORTRAIT,
632 R.integer.SWITCH_BUTTON_MINUS_Y_PORTRAIT,
633 R.integer.SWITCH_BUTTON_HOME_X_PORTRAIT,
634 R.integer.SWITCH_BUTTON_HOME_Y_PORTRAIT,
635 R.integer.SWITCH_BUTTON_CAPTURE_X_PORTRAIT,
636 R.integer.SWITCH_BUTTON_CAPTURE_Y_PORTRAIT,
637 R.integer.SWITCH_STICK_R_X_PORTRAIT,
638 R.integer.SWITCH_STICK_R_Y_PORTRAIT,
639 R.integer.SWITCH_STICK_L_X_PORTRAIT,
640 R.integer.SWITCH_STICK_L_Y_PORTRAIT
641 )
642
643 private val foldableResources = arrayOf(
644 R.integer.SWITCH_BUTTON_A_X_FOLDABLE,
645 R.integer.SWITCH_BUTTON_A_Y_FOLDABLE,
646 R.integer.SWITCH_BUTTON_B_X_FOLDABLE,
647 R.integer.SWITCH_BUTTON_B_Y_FOLDABLE,
648 R.integer.SWITCH_BUTTON_X_X_FOLDABLE,
649 R.integer.SWITCH_BUTTON_X_Y_FOLDABLE,
650 R.integer.SWITCH_BUTTON_Y_X_FOLDABLE,
651 R.integer.SWITCH_BUTTON_Y_Y_FOLDABLE,
652 R.integer.SWITCH_TRIGGER_ZL_X_FOLDABLE,
653 R.integer.SWITCH_TRIGGER_ZL_Y_FOLDABLE,
654 R.integer.SWITCH_TRIGGER_ZR_X_FOLDABLE,
655 R.integer.SWITCH_TRIGGER_ZR_Y_FOLDABLE,
656 R.integer.SWITCH_BUTTON_DPAD_X_FOLDABLE,
657 R.integer.SWITCH_BUTTON_DPAD_Y_FOLDABLE,
658 R.integer.SWITCH_TRIGGER_L_X_FOLDABLE,
659 R.integer.SWITCH_TRIGGER_L_Y_FOLDABLE,
660 R.integer.SWITCH_TRIGGER_R_X_FOLDABLE,
661 R.integer.SWITCH_TRIGGER_R_Y_FOLDABLE,
662 R.integer.SWITCH_BUTTON_PLUS_X_FOLDABLE,
663 R.integer.SWITCH_BUTTON_PLUS_Y_FOLDABLE,
664 R.integer.SWITCH_BUTTON_MINUS_X_FOLDABLE,
665 R.integer.SWITCH_BUTTON_MINUS_Y_FOLDABLE,
666 R.integer.SWITCH_BUTTON_HOME_X_FOLDABLE,
667 R.integer.SWITCH_BUTTON_HOME_Y_FOLDABLE,
668 R.integer.SWITCH_BUTTON_CAPTURE_X_FOLDABLE,
669 R.integer.SWITCH_BUTTON_CAPTURE_Y_FOLDABLE,
670 R.integer.SWITCH_STICK_R_X_FOLDABLE,
671 R.integer.SWITCH_STICK_R_Y_FOLDABLE,
672 R.integer.SWITCH_STICK_L_X_FOLDABLE,
673 R.integer.SWITCH_STICK_L_Y_FOLDABLE
674 )
675
676 private fun getResourceValue(orientation: String, position: Int): Float {
677 return when (orientation) {
678 PORTRAIT -> resources.getInteger(portraitResources[position]).toFloat() / 1000
679 FOLDABLE -> resources.getInteger(foldableResources[position]).toFloat() / 1000
680 else -> resources.getInteger(landscapeResources[position]).toFloat() / 1000
681 }
682 }
683
684 private fun defaultOverlayByLayout(orientation: String) {
577 // Each value represents the position of the button in relation to the screen size without insets. 685 // Each value represents the position of the button in relation to the screen size without insets.
578 preferences.edit() 686 preferences.edit()
579 .putFloat( 687 .putFloat(
580 ButtonType.BUTTON_A.toString() + "-X", 688 ButtonType.BUTTON_A.toString() + "-X$orientation",
581 resources.getInteger(R.integer.SWITCH_BUTTON_A_X).toFloat() / 1000 689 getResourceValue(orientation, 0)
582 ) 690 )
583 .putFloat( 691 .putFloat(
584 ButtonType.BUTTON_A.toString() + "-Y", 692 ButtonType.BUTTON_A.toString() + "-Y$orientation",
585 resources.getInteger(R.integer.SWITCH_BUTTON_A_Y).toFloat() / 1000 693 getResourceValue(orientation, 1)
586 ) 694 )
587 .putFloat( 695 .putFloat(
588 ButtonType.BUTTON_B.toString() + "-X", 696 ButtonType.BUTTON_B.toString() + "-X$orientation",
589 resources.getInteger(R.integer.SWITCH_BUTTON_B_X).toFloat() / 1000 697 getResourceValue(orientation, 2)
590 ) 698 )
591 .putFloat( 699 .putFloat(
592 ButtonType.BUTTON_B.toString() + "-Y", 700 ButtonType.BUTTON_B.toString() + "-Y$orientation",
593 resources.getInteger(R.integer.SWITCH_BUTTON_B_Y).toFloat() / 1000 701 getResourceValue(orientation, 3)
594 ) 702 )
595 .putFloat( 703 .putFloat(
596 ButtonType.BUTTON_X.toString() + "-X", 704 ButtonType.BUTTON_X.toString() + "-X$orientation",
597 resources.getInteger(R.integer.SWITCH_BUTTON_X_X).toFloat() / 1000 705 getResourceValue(orientation, 4)
598 ) 706 )
599 .putFloat( 707 .putFloat(
600 ButtonType.BUTTON_X.toString() + "-Y", 708 ButtonType.BUTTON_X.toString() + "-Y$orientation",
601 resources.getInteger(R.integer.SWITCH_BUTTON_X_Y).toFloat() / 1000 709 getResourceValue(orientation, 5)
602 ) 710 )
603 .putFloat( 711 .putFloat(
604 ButtonType.BUTTON_Y.toString() + "-X", 712 ButtonType.BUTTON_Y.toString() + "-X$orientation",
605 resources.getInteger(R.integer.SWITCH_BUTTON_Y_X).toFloat() / 1000 713 getResourceValue(orientation, 6)
606 ) 714 )
607 .putFloat( 715 .putFloat(
608 ButtonType.BUTTON_Y.toString() + "-Y", 716 ButtonType.BUTTON_Y.toString() + "-Y$orientation",
609 resources.getInteger(R.integer.SWITCH_BUTTON_Y_Y).toFloat() / 1000 717 getResourceValue(orientation, 7)
610 ) 718 )
611 .putFloat( 719 .putFloat(
612 ButtonType.TRIGGER_ZL.toString() + "-X", 720 ButtonType.TRIGGER_ZL.toString() + "-X$orientation",
613 resources.getInteger(R.integer.SWITCH_TRIGGER_ZL_X).toFloat() / 1000 721 getResourceValue(orientation, 8)
614 ) 722 )
615 .putFloat( 723 .putFloat(
616 ButtonType.TRIGGER_ZL.toString() + "-Y", 724 ButtonType.TRIGGER_ZL.toString() + "-Y$orientation",
617 resources.getInteger(R.integer.SWITCH_TRIGGER_ZL_Y).toFloat() / 1000 725 getResourceValue(orientation, 9)
618 ) 726 )
619 .putFloat( 727 .putFloat(
620 ButtonType.TRIGGER_ZR.toString() + "-X", 728 ButtonType.TRIGGER_ZR.toString() + "-X$orientation",
621 resources.getInteger(R.integer.SWITCH_TRIGGER_ZR_X).toFloat() / 1000 729 getResourceValue(orientation, 10)
622 ) 730 )
623 .putFloat( 731 .putFloat(
624 ButtonType.TRIGGER_ZR.toString() + "-Y", 732 ButtonType.TRIGGER_ZR.toString() + "-Y$orientation",
625 resources.getInteger(R.integer.SWITCH_TRIGGER_ZR_Y).toFloat() / 1000 733 getResourceValue(orientation, 11)
626 ) 734 )
627 .putFloat( 735 .putFloat(
628 ButtonType.DPAD_UP.toString() + "-X", 736 ButtonType.DPAD_UP.toString() + "-X$orientation",
629 resources.getInteger(R.integer.SWITCH_BUTTON_DPAD_X).toFloat() / 1000 737 getResourceValue(orientation, 12)
630 ) 738 )
631 .putFloat( 739 .putFloat(
632 ButtonType.DPAD_UP.toString() + "-Y", 740 ButtonType.DPAD_UP.toString() + "-Y$orientation",
633 resources.getInteger(R.integer.SWITCH_BUTTON_DPAD_Y).toFloat() / 1000 741 getResourceValue(orientation, 13)
634 ) 742 )
635 .putFloat( 743 .putFloat(
636 ButtonType.TRIGGER_L.toString() + "-X", 744 ButtonType.TRIGGER_L.toString() + "-X$orientation",
637 resources.getInteger(R.integer.SWITCH_TRIGGER_L_X).toFloat() / 1000 745 getResourceValue(orientation, 14)
638 ) 746 )
639 .putFloat( 747 .putFloat(
640 ButtonType.TRIGGER_L.toString() + "-Y", 748 ButtonType.TRIGGER_L.toString() + "-Y$orientation",
641 resources.getInteger(R.integer.SWITCH_TRIGGER_L_Y).toFloat() / 1000 749 getResourceValue(orientation, 15)
642 ) 750 )
643 .putFloat( 751 .putFloat(
644 ButtonType.TRIGGER_R.toString() + "-X", 752 ButtonType.TRIGGER_R.toString() + "-X$orientation",
645 resources.getInteger(R.integer.SWITCH_TRIGGER_R_X).toFloat() / 1000 753 getResourceValue(orientation, 16)
646 ) 754 )
647 .putFloat( 755 .putFloat(
648 ButtonType.TRIGGER_R.toString() + "-Y", 756 ButtonType.TRIGGER_R.toString() + "-Y$orientation",
649 resources.getInteger(R.integer.SWITCH_TRIGGER_R_Y).toFloat() / 1000 757 getResourceValue(orientation, 17)
650 ) 758 )
651 .putFloat( 759 .putFloat(
652 ButtonType.BUTTON_PLUS.toString() + "-X", 760 ButtonType.BUTTON_PLUS.toString() + "-X$orientation",
653 resources.getInteger(R.integer.SWITCH_BUTTON_PLUS_X).toFloat() / 1000 761 getResourceValue(orientation, 18)
654 ) 762 )
655 .putFloat( 763 .putFloat(
656 ButtonType.BUTTON_PLUS.toString() + "-Y", 764 ButtonType.BUTTON_PLUS.toString() + "-Y$orientation",
657 resources.getInteger(R.integer.SWITCH_BUTTON_PLUS_Y).toFloat() / 1000 765 getResourceValue(orientation, 19)
658 ) 766 )
659 .putFloat( 767 .putFloat(
660 ButtonType.BUTTON_MINUS.toString() + "-X", 768 ButtonType.BUTTON_MINUS.toString() + "-X$orientation",
661 resources.getInteger(R.integer.SWITCH_BUTTON_MINUS_X).toFloat() / 1000 769 getResourceValue(orientation, 20)
662 ) 770 )
663 .putFloat( 771 .putFloat(
664 ButtonType.BUTTON_MINUS.toString() + "-Y", 772 ButtonType.BUTTON_MINUS.toString() + "-Y$orientation",
665 resources.getInteger(R.integer.SWITCH_BUTTON_MINUS_Y).toFloat() / 1000 773 getResourceValue(orientation, 21)
666 ) 774 )
667 .putFloat( 775 .putFloat(
668 ButtonType.BUTTON_HOME.toString() + "-X", 776 ButtonType.BUTTON_HOME.toString() + "-X$orientation",
669 resources.getInteger(R.integer.SWITCH_BUTTON_HOME_X).toFloat() / 1000 777 getResourceValue(orientation, 22)
670 ) 778 )
671 .putFloat( 779 .putFloat(
672 ButtonType.BUTTON_HOME.toString() + "-Y", 780 ButtonType.BUTTON_HOME.toString() + "-Y$orientation",
673 resources.getInteger(R.integer.SWITCH_BUTTON_HOME_Y).toFloat() / 1000 781 getResourceValue(orientation, 23)
674 ) 782 )
675 .putFloat( 783 .putFloat(
676 ButtonType.BUTTON_CAPTURE.toString() + "-X", 784 ButtonType.BUTTON_CAPTURE.toString() + "-X$orientation",
677 resources.getInteger(R.integer.SWITCH_BUTTON_CAPTURE_X) 785 getResourceValue(orientation, 24)
678 .toFloat() / 1000
679 ) 786 )
680 .putFloat( 787 .putFloat(
681 ButtonType.BUTTON_CAPTURE.toString() + "-Y", 788 ButtonType.BUTTON_CAPTURE.toString() + "-Y$orientation",
682 resources.getInteger(R.integer.SWITCH_BUTTON_CAPTURE_Y) 789 getResourceValue(orientation, 25)
683 .toFloat() / 1000
684 ) 790 )
685 .putFloat( 791 .putFloat(
686 ButtonType.STICK_R.toString() + "-X", 792 ButtonType.STICK_R.toString() + "-X$orientation",
687 resources.getInteger(R.integer.SWITCH_STICK_R_X).toFloat() / 1000 793 getResourceValue(orientation, 26)
688 ) 794 )
689 .putFloat( 795 .putFloat(
690 ButtonType.STICK_R.toString() + "-Y", 796 ButtonType.STICK_R.toString() + "-Y$orientation",
691 resources.getInteger(R.integer.SWITCH_STICK_R_Y).toFloat() / 1000 797 getResourceValue(orientation, 27)
692 ) 798 )
693 .putFloat( 799 .putFloat(
694 ButtonType.STICK_L.toString() + "-X", 800 ButtonType.STICK_L.toString() + "-X$orientation",
695 resources.getInteger(R.integer.SWITCH_STICK_L_X).toFloat() / 1000 801 getResourceValue(orientation, 28)
696 ) 802 )
697 .putFloat( 803 .putFloat(
698 ButtonType.STICK_L.toString() + "-Y", 804 ButtonType.STICK_L.toString() + "-Y$orientation",
699 resources.getInteger(R.integer.SWITCH_STICK_L_Y).toFloat() / 1000 805 getResourceValue(orientation, 29)
700 ) 806 )
701 .apply() 807 .apply()
702 } 808 }
@@ -709,13 +815,17 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
709 private val preferences: SharedPreferences = 815 private val preferences: SharedPreferences =
710 PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext) 816 PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext)
711 817
818 const val LANDSCAPE = ""
819 const val PORTRAIT = "_Portrait"
820 const val FOLDABLE = "_Foldable"
821
712 /** 822 /**
713 * Resizes a [Bitmap] by a given scale factor 823 * Resizes a [Bitmap] by a given scale factor
714 * 824 *
715 * @param context Context for getting the vector drawable 825 * @param context Context for getting the vector drawable
716 * @param drawableId The ID of the drawable to scale. 826 * @param drawableId The ID of the drawable to scale.
717 * @param scale The scale factor for the bitmap. 827 * @param scale The scale factor for the bitmap.
718 * @return The scaled [Bitmap] 828 * @return The scaled [Bitmap]
719 */ 829 */
720 private fun getBitmap(context: Context, drawableId: Int, scale: Float): Bitmap { 830 private fun getBitmap(context: Context, drawableId: Int, scale: Float): Bitmap {
721 val vectorDrawable = ContextCompat.getDrawable(context, drawableId) as VectorDrawable 831 val vectorDrawable = ContextCompat.getDrawable(context, drawableId) as VectorDrawable
@@ -749,14 +859,13 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
749 * Gets the safe screen size for drawing the overlay 859 * Gets the safe screen size for drawing the overlay
750 * 860 *
751 * @param context Context for getting the window metrics 861 * @param context Context for getting the window metrics
752 * @return A pair of points, the first being the top left corner of the safe area, 862 * @return A pair of points, the first being the top left corner of the safe area,
753 * the second being the bottom right corner of the safe area 863 * the second being the bottom right corner of the safe area
754 */ 864 */
755 private fun getSafeScreenSize(context: Context): Pair<Point, Point> { 865 private fun getSafeScreenSize(context: Context): Pair<Point, Point> {
756 // Get screen size 866 // Get screen size
757 val windowMetrics = 867 val windowMetrics = WindowMetricsCalculator.getOrCreate()
758 WindowMetricsCalculator.getOrCreate() 868 .computeCurrentWindowMetrics(context as Activity)
759 .computeCurrentWindowMetrics(context as Activity)
760 var maxY = windowMetrics.bounds.height().toFloat() 869 var maxY = windowMetrics.bounds.height().toFloat()
761 var maxX = windowMetrics.bounds.width().toFloat() 870 var maxX = windowMetrics.bounds.width().toFloat()
762 var minY = 0 871 var minY = 0
@@ -765,18 +874,26 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
765 // If we have API access, calculate the safe area to draw the overlay 874 // If we have API access, calculate the safe area to draw the overlay
766 var cutoutLeft = 0 875 var cutoutLeft = 0
767 var cutoutBottom = 0 876 var cutoutBottom = 0
768 val insets = context.windowManager.currentWindowMetrics.windowInsets.displayCutout 877 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
769 if (insets != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { 878 val insets = context.windowManager.currentWindowMetrics.windowInsets.displayCutout
770 if (insets.boundingRectTop.bottom != 0 && insets.boundingRectTop.bottom > maxY / 2) 879 if (insets != null) {
771 insets.boundingRectTop.bottom.toFloat() else maxY 880 if (insets.boundingRectTop.bottom != 0 &&
772 if (insets.boundingRectRight.left != 0 && insets.boundingRectRight.left > maxX / 2) 881 insets.boundingRectTop.bottom > maxY / 2
773 insets.boundingRectRight.left.toFloat() else maxX 882 ) {
774 883 maxY = insets.boundingRectTop.bottom.toFloat()
775 minX = insets.boundingRectLeft.right - insets.boundingRectLeft.left 884 }
776 minY = insets.boundingRectBottom.top - insets.boundingRectBottom.bottom 885 if (insets.boundingRectRight.left != 0 &&
777 886 insets.boundingRectRight.left > maxX / 2
778 cutoutLeft = insets.boundingRectRight.right - insets.boundingRectRight.left 887 ) {
779 cutoutBottom = insets.boundingRectTop.top - insets.boundingRectTop.bottom 888 maxX = insets.boundingRectRight.left.toFloat()
889 }
890
891 minX = insets.boundingRectLeft.right - insets.boundingRectLeft.left
892 minY = insets.boundingRectBottom.top - insets.boundingRectBottom.bottom
893
894 cutoutLeft = insets.boundingRectRight.right - insets.boundingRectRight.left
895 cutoutBottom = insets.boundingRectTop.top - insets.boundingRectTop.bottom
896 }
780 } 897 }
781 898
782 // This makes sure that if we have an inset on one side of the screen, we mirror it on 899 // This makes sure that if we have an inset on one side of the screen, we mirror it on
@@ -876,8 +993,8 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
876 993
877 // The X and Y coordinates of the InputOverlayDrawableButton on the InputOverlay. 994 // The X and Y coordinates of the InputOverlayDrawableButton on the InputOverlay.
878 // These were set in the input overlay configuration menu. 995 // These were set in the input overlay configuration menu.
879 val xKey = "$buttonId$orientation-X" 996 val xKey = "$buttonId-X$orientation"
880 val yKey = "$buttonId$orientation-Y" 997 val yKey = "$buttonId-Y$orientation"
881 val drawableXPercent = sPrefs.getFloat(xKey, 0f) 998 val drawableXPercent = sPrefs.getFloat(xKey, 0f)
882 val drawableYPercent = sPrefs.getFloat(yKey, 0f) 999 val drawableYPercent = sPrefs.getFloat(yKey, 0f)
883 val drawableX = (drawableXPercent * max.x + min.x).toInt() 1000 val drawableX = (drawableXPercent * max.x + min.x).toInt()
@@ -957,8 +1074,8 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
957 1074
958 // The X and Y coordinates of the InputOverlayDrawableDpad on the InputOverlay. 1075 // The X and Y coordinates of the InputOverlayDrawableDpad on the InputOverlay.
959 // These were set in the input overlay configuration menu. 1076 // These were set in the input overlay configuration menu.
960 val drawableXPercent = sPrefs.getFloat("${ButtonType.DPAD_UP}$orientation-X", 0f) 1077 val drawableXPercent = sPrefs.getFloat("${ButtonType.DPAD_UP}-X$orientation", 0f)
961 val drawableYPercent = sPrefs.getFloat("${ButtonType.DPAD_UP}$orientation-Y", 0f) 1078 val drawableYPercent = sPrefs.getFloat("${ButtonType.DPAD_UP}-Y$orientation", 0f)
962 val drawableX = (drawableXPercent * max.x + min.x).toInt() 1079 val drawableX = (drawableXPercent * max.x + min.x).toInt()
963 val drawableY = (drawableYPercent * max.y + min.y).toInt() 1080 val drawableY = (drawableYPercent * max.y + min.y).toInt()
964 val width = overlayDrawable.width 1081 val width = overlayDrawable.width
@@ -1024,8 +1141,8 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
1024 1141
1025 // The X and Y coordinates of the InputOverlayDrawableButton on the InputOverlay. 1142 // The X and Y coordinates of the InputOverlayDrawableButton on the InputOverlay.
1026 // These were set in the input overlay configuration menu. 1143 // These were set in the input overlay configuration menu.
1027 val drawableXPercent = sPrefs.getFloat("$button$orientation-X", 0f) 1144 val drawableXPercent = sPrefs.getFloat("$button-X$orientation", 0f)
1028 val drawableYPercent = sPrefs.getFloat("$button$orientation-Y", 0f) 1145 val drawableYPercent = sPrefs.getFloat("$button-Y$orientation", 0f)
1029 val drawableX = (drawableXPercent * max.x + min.x).toInt() 1146 val drawableX = (drawableXPercent * max.x + min.x).toInt()
1030 val drawableY = (drawableYPercent * max.y + min.y).toInt() 1147 val drawableY = (drawableYPercent * max.y + min.y).toInt()
1031 val outerScale = 1.66f 1148 val outerScale = 1.66f
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlayDrawableDpad.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlayDrawableDpad.kt
index 43d664d21..8aef6f5a5 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlayDrawableDpad.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlayDrawableDpad.kt
@@ -133,7 +133,10 @@ class InputOverlayDrawableDpad(
133 downButtonState = axisY > VIRT_AXIS_DEADZONE 133 downButtonState = axisY > VIRT_AXIS_DEADZONE
134 leftButtonState = axisX < -VIRT_AXIS_DEADZONE 134 leftButtonState = axisX < -VIRT_AXIS_DEADZONE
135 rightButtonState = axisX > VIRT_AXIS_DEADZONE 135 rightButtonState = axisX > VIRT_AXIS_DEADZONE
136 return oldUpState != upButtonState || oldDownState != downButtonState || oldLeftState != leftButtonState || oldRightState != rightButtonState 136 return oldUpState != upButtonState ||
137 oldDownState != downButtonState ||
138 oldLeftState != leftButtonState ||
139 oldRightState != rightButtonState
137 } 140 }
138 return false 141 return false
139 } 142 }
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlayDrawableJoystick.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlayDrawableJoystick.kt
index f1d32192a..fb48f584d 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlayDrawableJoystick.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlayDrawableJoystick.kt
@@ -9,12 +9,12 @@ import android.graphics.Canvas
9import android.graphics.Rect 9import android.graphics.Rect
10import android.graphics.drawable.BitmapDrawable 10import android.graphics.drawable.BitmapDrawable
11import android.view.MotionEvent 11import android.view.MotionEvent
12import org.yuzu.yuzu_emu.NativeLibrary
13import org.yuzu.yuzu_emu.utils.EmulationMenuSettings
14import kotlin.math.atan2 12import kotlin.math.atan2
15import kotlin.math.cos 13import kotlin.math.cos
16import kotlin.math.sin 14import kotlin.math.sin
17import kotlin.math.sqrt 15import kotlin.math.sqrt
16import org.yuzu.yuzu_emu.NativeLibrary
17import org.yuzu.yuzu_emu.utils.EmulationMenuSettings
18 18
19/** 19/**
20 * Custom [BitmapDrawable] that is capable 20 * Custom [BitmapDrawable] that is capable
@@ -241,14 +241,22 @@ class InputOverlayDrawableJoystick(
241 private fun setInnerBounds() { 241 private fun setInnerBounds() {
242 var x = virtBounds.centerX() + (xAxis * (virtBounds.width() / 2)).toInt() 242 var x = virtBounds.centerX() + (xAxis * (virtBounds.width() / 2)).toInt()
243 var y = virtBounds.centerY() + (yAxis * (virtBounds.height() / 2)).toInt() 243 var y = virtBounds.centerY() + (yAxis * (virtBounds.height() / 2)).toInt()
244 if (x > virtBounds.centerX() + virtBounds.width() / 2) x = 244 if (x > virtBounds.centerX() + virtBounds.width() / 2) {
245 virtBounds.centerX() + virtBounds.width() / 2 245 x =
246 if (x < virtBounds.centerX() - virtBounds.width() / 2) x = 246 virtBounds.centerX() + virtBounds.width() / 2
247 virtBounds.centerX() - virtBounds.width() / 2 247 }
248 if (y > virtBounds.centerY() + virtBounds.height() / 2) y = 248 if (x < virtBounds.centerX() - virtBounds.width() / 2) {
249 virtBounds.centerY() + virtBounds.height() / 2 249 x =
250 if (y < virtBounds.centerY() - virtBounds.height() / 2) y = 250 virtBounds.centerX() - virtBounds.width() / 2
251 virtBounds.centerY() - virtBounds.height() / 2 251 }
252 if (y > virtBounds.centerY() + virtBounds.height() / 2) {
253 y =
254 virtBounds.centerY() + virtBounds.height() / 2
255 }
256 if (y < virtBounds.centerY() - virtBounds.height() / 2) {
257 y =
258 virtBounds.centerY() - virtBounds.height() / 2
259 }
252 val width = pressedStateInnerBitmap.bounds.width() / 2 260 val width = pressedStateInnerBitmap.bounds.width() / 2
253 val height = pressedStateInnerBitmap.bounds.height() / 2 261 val height = pressedStateInnerBitmap.bounds.height() / 2
254 defaultStateInnerBitmap.setBounds( 262 defaultStateInnerBitmap.setBounds(
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt
index 97eef40d2..b0156dca5 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt
@@ -99,7 +99,9 @@ class GamesFragment : Fragment() {
99 } 99 }
100 shouldSwapData.observe(viewLifecycleOwner) { shouldSwapData -> 100 shouldSwapData.observe(viewLifecycleOwner) { shouldSwapData ->
101 if (shouldSwapData) { 101 if (shouldSwapData) {
102 (binding.gridGames.adapter as GameAdapter).submitList(gamesViewModel.games.value!!) 102 (binding.gridGames.adapter as GameAdapter).submitList(
103 gamesViewModel.games.value!!
104 )
103 gamesViewModel.setShouldSwapData(false) 105 gamesViewModel.setShouldSwapData(false)
104 } 106 }
105 } 107 }
@@ -128,7 +130,9 @@ class GamesFragment : Fragment() {
128 } 130 }
129 131
130 private fun setInsets() = 132 private fun setInsets() =
131 ViewCompat.setOnApplyWindowInsetsListener(binding.root) { view: View, windowInsets: WindowInsetsCompat -> 133 ViewCompat.setOnApplyWindowInsetsListener(
134 binding.root
135 ) { view: View, windowInsets: WindowInsetsCompat ->
132 val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) 136 val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
133 val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout()) 137 val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout())
134 val extraListSpacing = resources.getDimensionPixelSize(R.dimen.spacing_large) 138 val extraListSpacing = resources.getDimensionPixelSize(R.dimen.spacing_large)
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 124f62f08..cc1d87f1b 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
@@ -26,6 +26,9 @@ import androidx.preference.PreferenceManager
26import com.google.android.material.color.MaterialColors 26import com.google.android.material.color.MaterialColors
27import com.google.android.material.dialog.MaterialAlertDialogBuilder 27import com.google.android.material.dialog.MaterialAlertDialogBuilder
28import com.google.android.material.navigation.NavigationBarView 28import com.google.android.material.navigation.NavigationBarView
29import java.io.File
30import java.io.FilenameFilter
31import java.io.IOException
29import kotlinx.coroutines.Dispatchers 32import kotlinx.coroutines.Dispatchers
30import kotlinx.coroutines.launch 33import kotlinx.coroutines.launch
31import kotlinx.coroutines.withContext 34import kotlinx.coroutines.withContext
@@ -43,9 +46,6 @@ import org.yuzu.yuzu_emu.fragments.MessageDialogFragment
43import org.yuzu.yuzu_emu.model.GamesViewModel 46import org.yuzu.yuzu_emu.model.GamesViewModel
44import org.yuzu.yuzu_emu.model.HomeViewModel 47import org.yuzu.yuzu_emu.model.HomeViewModel
45import org.yuzu.yuzu_emu.utils.* 48import org.yuzu.yuzu_emu.utils.*
46import java.io.File
47import java.io.FilenameFilter
48import java.io.IOException
49 49
50class MainActivity : AppCompatActivity(), ThemeProvider { 50class MainActivity : AppCompatActivity(), ThemeProvider {
51 private lateinit var binding: ActivityMainBinding 51 private lateinit var binding: ActivityMainBinding
@@ -86,7 +86,9 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
86 ThemeHelper.SYSTEM_BAR_ALPHA 86 ThemeHelper.SYSTEM_BAR_ALPHA
87 ) 87 )
88 ) 88 )
89 if (InsetsHelper.getSystemGestureType(applicationContext) != InsetsHelper.GESTURE_NAVIGATION) { 89 if (InsetsHelper.getSystemGestureType(applicationContext) !=
90 InsetsHelper.GESTURE_NAVIGATION
91 ) {
90 binding.navigationBarShade.setBackgroundColor( 92 binding.navigationBarShade.setBackgroundColor(
91 ThemeHelper.getColorWithOpacity( 93 ThemeHelper.getColorWithOpacity(
92 MaterialColors.getColor( 94 MaterialColors.getColor(
@@ -172,7 +174,9 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
172 binding.navigationView.height.toFloat() * 2 174 binding.navigationView.height.toFloat() * 2
173 translationY(0f) 175 translationY(0f)
174 } else { 176 } else {
175 if (ViewCompat.getLayoutDirection(binding.navigationView) == ViewCompat.LAYOUT_DIRECTION_LTR) { 177 if (ViewCompat.getLayoutDirection(binding.navigationView) ==
178 ViewCompat.LAYOUT_DIRECTION_LTR
179 ) {
176 binding.navigationView.translationX = 180 binding.navigationView.translationX =
177 binding.navigationView.width.toFloat() * -2 181 binding.navigationView.width.toFloat() * -2
178 translationX(0f) 182 translationX(0f)
@@ -189,7 +193,9 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
189 if (smallLayout) { 193 if (smallLayout) {
190 translationY(binding.navigationView.height.toFloat() * 2) 194 translationY(binding.navigationView.height.toFloat() * 2)
191 } else { 195 } else {
192 if (ViewCompat.getLayoutDirection(binding.navigationView) == ViewCompat.LAYOUT_DIRECTION_LTR) { 196 if (ViewCompat.getLayoutDirection(binding.navigationView) ==
197 ViewCompat.LAYOUT_DIRECTION_LTR
198 ) {
193 translationX(binding.navigationView.width.toFloat() * -2) 199 translationX(binding.navigationView.width.toFloat() * -2)
194 } else { 200 } else {
195 translationX(binding.navigationView.width.toFloat() * 2) 201 translationX(binding.navigationView.width.toFloat() * 2)
@@ -234,7 +240,9 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
234 } 240 }
235 241
236 private fun setInsets() = 242 private fun setInsets() =
237 ViewCompat.setOnApplyWindowInsetsListener(binding.root) { _: View, windowInsets: WindowInsetsCompat -> 243 ViewCompat.setOnApplyWindowInsetsListener(
244 binding.root
245 ) { _: View, windowInsets: WindowInsetsCompat ->
238 val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) 246 val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
239 val mlpStatusShade = binding.statusBarShade.layoutParams as MarginLayoutParams 247 val mlpStatusShade = binding.statusBarShade.layoutParams as MarginLayoutParams
240 mlpStatusShade.height = insets.top 248 mlpStatusShade.height = insets.top
@@ -256,8 +264,9 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
256 264
257 val getGamesDirectory = 265 val getGamesDirectory =
258 registerForActivityResult(ActivityResultContracts.OpenDocumentTree()) { result -> 266 registerForActivityResult(ActivityResultContracts.OpenDocumentTree()) { result ->
259 if (result == null) 267 if (result == null) {
260 return@registerForActivityResult 268 return@registerForActivityResult
269 }
261 270
262 contentResolver.takePersistableUriPermission( 271 contentResolver.takePersistableUriPermission(
263 result, 272 result,
@@ -281,13 +290,14 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
281 290
282 val getProdKey = 291 val getProdKey =
283 registerForActivityResult(ActivityResultContracts.OpenDocument()) { result -> 292 registerForActivityResult(ActivityResultContracts.OpenDocument()) { result ->
284 if (result == null) 293 if (result == null) {
285 return@registerForActivityResult 294 return@registerForActivityResult
295 }
286 296
287 if (!FileUtil.hasExtension(result.toString(), "keys")) { 297 if (!FileUtil.hasExtension(result, "keys")) {
288 MessageDialogFragment.newInstance( 298 MessageDialogFragment.newInstance(
289 R.string.reading_keys_failure, 299 R.string.reading_keys_failure,
290 R.string.install_keys_failure_extension_description 300 R.string.install_prod_keys_failure_extension_description
291 ).show(supportFragmentManager, MessageDialogFragment.TAG) 301 ).show(supportFragmentManager, MessageDialogFragment.TAG)
292 return@registerForActivityResult 302 return@registerForActivityResult
293 } 303 }
@@ -324,8 +334,9 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
324 334
325 val getFirmware = 335 val getFirmware =
326 registerForActivityResult(ActivityResultContracts.OpenDocument()) { result -> 336 registerForActivityResult(ActivityResultContracts.OpenDocument()) { result ->
327 if (result == null) 337 if (result == null) {
328 return@registerForActivityResult 338 return@registerForActivityResult
339 }
329 340
330 val inputZip = contentResolver.openInputStream(result) 341 val inputZip = contentResolver.openInputStream(result)
331 if (inputZip == null) { 342 if (inputZip == null) {
@@ -376,13 +387,14 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
376 387
377 val getAmiiboKey = 388 val getAmiiboKey =
378 registerForActivityResult(ActivityResultContracts.OpenDocument()) { result -> 389 registerForActivityResult(ActivityResultContracts.OpenDocument()) { result ->
379 if (result == null) 390 if (result == null) {
380 return@registerForActivityResult 391 return@registerForActivityResult
392 }
381 393
382 if (!FileUtil.hasExtension(result.toString(), "bin")) { 394 if (!FileUtil.hasExtension(result, "bin")) {
383 MessageDialogFragment.newInstance( 395 MessageDialogFragment.newInstance(
384 R.string.reading_keys_failure, 396 R.string.reading_keys_failure,
385 R.string.install_keys_failure_extension_description 397 R.string.install_amiibo_keys_failure_extension_description
386 ).show(supportFragmentManager, MessageDialogFragment.TAG) 398 ).show(supportFragmentManager, MessageDialogFragment.TAG)
387 return@registerForActivityResult 399 return@registerForActivityResult
388 } 400 }
@@ -418,8 +430,9 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
418 430
419 val getDriver = 431 val getDriver =
420 registerForActivityResult(ActivityResultContracts.OpenDocument()) { result -> 432 registerForActivityResult(ActivityResultContracts.OpenDocument()) { result ->
421 if (result == null) 433 if (result == null) {
422 return@registerForActivityResult 434 return@registerForActivityResult
435 }
423 436
424 val takeFlags = 437 val takeFlags =
425 Intent.FLAG_GRANT_WRITE_URI_PERMISSION or Intent.FLAG_GRANT_READ_URI_PERMISSION 438 Intent.FLAG_GRANT_WRITE_URI_PERMISSION or Intent.FLAG_GRANT_READ_URI_PERMISSION
@@ -467,4 +480,63 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
467 } 480 }
468 } 481 }
469 } 482 }
483
484 val installGameUpdate =
485 registerForActivityResult(ActivityResultContracts.OpenDocument()) {
486 if (it == null) {
487 return@registerForActivityResult
488 }
489
490 IndeterminateProgressDialogFragment.newInstance(
491 this@MainActivity,
492 R.string.install_game_content
493 ) {
494 val result = NativeLibrary.installFileToNand(it.toString())
495 lifecycleScope.launch {
496 withContext(Dispatchers.Main) {
497 when (result) {
498 NativeLibrary.InstallFileToNandResult.Success -> {
499 Toast.makeText(
500 applicationContext,
501 R.string.install_game_content_success,
502 Toast.LENGTH_SHORT
503 ).show()
504 }
505
506 NativeLibrary.InstallFileToNandResult.SuccessFileOverwritten -> {
507 Toast.makeText(
508 applicationContext,
509 R.string.install_game_content_success_overwrite,
510 Toast.LENGTH_SHORT
511 ).show()
512 }
513
514 NativeLibrary.InstallFileToNandResult.ErrorBaseGame -> {
515 MessageDialogFragment.newInstance(
516 R.string.install_game_content_failure,
517 R.string.install_game_content_failure_base
518 ).show(supportFragmentManager, MessageDialogFragment.TAG)
519 }
520
521 NativeLibrary.InstallFileToNandResult.ErrorFilenameExtension -> {
522 MessageDialogFragment.newInstance(
523 R.string.install_game_content_failure,
524 R.string.install_game_content_failure_file_extension,
525 R.string.install_game_content_help_link
526 ).show(supportFragmentManager, MessageDialogFragment.TAG)
527 }
528
529 else -> {
530 MessageDialogFragment.newInstance(
531 R.string.install_game_content_failure,
532 R.string.install_game_content_failure_description,
533 R.string.install_game_content_help_link
534 ).show(supportFragmentManager, MessageDialogFragment.TAG)
535 }
536 }
537 }
538 }
539 return@newInstance result
540 }.show(supportFragmentManager, IndeterminateProgressDialogFragment.TAG)
541 }
470} 542}
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ControllerMappingHelper.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ControllerMappingHelper.kt
index 791cea904..eeefcdf20 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ControllerMappingHelper.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ControllerMappingHelper.kt
@@ -19,7 +19,9 @@ class ControllerMappingHelper {
19 // The two analog triggers generate analog motion events as well as a keycode. 19 // The two analog triggers generate analog motion events as well as a keycode.
20 // We always prefer to use the analog values, so throw away the button press 20 // We always prefer to use the analog values, so throw away the button press
21 keyCode == KeyEvent.KEYCODE_BUTTON_L2 || keyCode == KeyEvent.KEYCODE_BUTTON_R2 21 keyCode == KeyEvent.KEYCODE_BUTTON_L2 || keyCode == KeyEvent.KEYCODE_BUTTON_R2
22 } else false 22 } else {
23 false
24 }
23 } 25 }
24 26
25 /** 27 /**
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DirectoryInitialization.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DirectoryInitialization.kt
index 36c479e6c..2ee63697e 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DirectoryInitialization.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DirectoryInitialization.kt
@@ -4,8 +4,8 @@
4package org.yuzu.yuzu_emu.utils 4package org.yuzu.yuzu_emu.utils
5 5
6import android.content.Context 6import android.content.Context
7import org.yuzu.yuzu_emu.NativeLibrary
8import java.io.IOException 7import java.io.IOException
8import org.yuzu.yuzu_emu.NativeLibrary
9 9
10object DirectoryInitialization { 10object DirectoryInitialization {
11 private var userPath: String? = null 11 private var userPath: String? = null
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DocumentsTree.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DocumentsTree.kt
index cc8ea6b9d..cf226ad94 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DocumentsTree.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DocumentsTree.kt
@@ -5,10 +5,10 @@ package org.yuzu.yuzu_emu.utils
5 5
6import android.net.Uri 6import android.net.Uri
7import androidx.documentfile.provider.DocumentFile 7import androidx.documentfile.provider.DocumentFile
8import org.yuzu.yuzu_emu.YuzuApplication
9import org.yuzu.yuzu_emu.model.MinimalDocumentFile
10import java.io.File 8import java.io.File
11import java.util.* 9import java.util.*
10import org.yuzu.yuzu_emu.YuzuApplication
11import org.yuzu.yuzu_emu.model.MinimalDocumentFile
12 12
13class DocumentsTree { 13class DocumentsTree {
14 private var root: DocumentsNode? = null 14 private var root: DocumentsNode? = null
@@ -29,13 +29,20 @@ class DocumentsTree {
29 val node = resolvePath(filepath) 29 val node = resolvePath(filepath)
30 return if (node == null || node.isDirectory) { 30 return if (node == null || node.isDirectory) {
31 0 31 0
32 } else FileUtil.getFileSize(YuzuApplication.appContext, node.uri.toString()) 32 } else {
33 FileUtil.getFileSize(YuzuApplication.appContext, node.uri.toString())
34 }
33 } 35 }
34 36
35 fun exists(filepath: String): Boolean { 37 fun exists(filepath: String): Boolean {
36 return resolvePath(filepath) != null 38 return resolvePath(filepath) != null
37 } 39 }
38 40
41 fun isDirectory(filepath: String): Boolean {
42 val node = resolvePath(filepath)
43 return node != null && node.isDirectory
44 }
45
39 private fun resolvePath(filepath: String): DocumentsNode? { 46 private fun resolvePath(filepath: String): DocumentsNode? {
40 val tokens = StringTokenizer(filepath, File.separator, false) 47 val tokens = StringTokenizer(filepath, File.separator, false)
41 var iterator = root 48 var iterator = root
@@ -106,7 +113,9 @@ class DocumentsTree {
106 fun isNativePath(path: String): Boolean { 113 fun isNativePath(path: String): Boolean {
107 return if (path.isNotEmpty()) { 114 return if (path.isNotEmpty()) {
108 path[0] == '/' 115 path[0] == '/'
109 } else false 116 } else {
117 false
118 }
110 } 119 }
111 } 120 }
112} 121}
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/EmulationMenuSettings.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/EmulationMenuSettings.kt
index e1e7a59d7..7e8f058c1 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/EmulationMenuSettings.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/EmulationMenuSettings.kt
@@ -11,14 +11,6 @@ object EmulationMenuSettings {
11 private val preferences = 11 private val preferences =
12 PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext) 12 PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext)
13 13
14 // These must match what is defined in src/core/settings.h
15 const val LayoutOption_Default = 0
16 const val LayoutOption_SingleScreen = 1
17 const val LayoutOption_LargeScreen = 2
18 const val LayoutOption_SideScreen = 3
19 const val LayoutOption_MobilePortrait = 4
20 const val LayoutOption_MobileLandscape = 5
21
22 var joystickRelCenter: Boolean 14 var joystickRelCenter: Boolean
23 get() = preferences.getBoolean(Settings.PREF_MENU_SETTINGS_JOYSTICK_REL_CENTER, true) 15 get() = preferences.getBoolean(Settings.PREF_MENU_SETTINGS_JOYSTICK_REL_CENTER, true)
24 set(value) { 16 set(value) {
@@ -41,16 +33,6 @@ object EmulationMenuSettings {
41 .apply() 33 .apply()
42 } 34 }
43 35
44 var landscapeScreenLayout: Int
45 get() = preferences.getInt(
46 Settings.PREF_MENU_SETTINGS_LANDSCAPE,
47 LayoutOption_MobileLandscape
48 )
49 set(value) {
50 preferences.edit()
51 .putInt(Settings.PREF_MENU_SETTINGS_LANDSCAPE, value)
52 .apply()
53 }
54 var showFps: Boolean 36 var showFps: Boolean
55 get() = preferences.getBoolean(Settings.PREF_MENU_SETTINGS_SHOW_FPS, false) 37 get() = preferences.getBoolean(Settings.PREF_MENU_SETTINGS_SHOW_FPS, false)
56 set(value) { 38 set(value) {
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/FileUtil.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/FileUtil.kt
index 593dad8d3..9f3bbe56f 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/FileUtil.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/FileUtil.kt
@@ -7,8 +7,8 @@ import android.content.Context
7import android.database.Cursor 7import android.database.Cursor
8import android.net.Uri 8import android.net.Uri
9import android.provider.DocumentsContract 9import android.provider.DocumentsContract
10import android.provider.OpenableColumns
10import androidx.documentfile.provider.DocumentFile 11import androidx.documentfile.provider.DocumentFile
11import org.yuzu.yuzu_emu.model.MinimalDocumentFile
12import java.io.BufferedInputStream 12import java.io.BufferedInputStream
13import java.io.File 13import java.io.File
14import java.io.FileOutputStream 14import java.io.FileOutputStream
@@ -17,6 +17,8 @@ import java.io.InputStream
17import java.net.URLDecoder 17import java.net.URLDecoder
18import java.util.zip.ZipEntry 18import java.util.zip.ZipEntry
19import java.util.zip.ZipInputStream 19import java.util.zip.ZipInputStream
20import org.yuzu.yuzu_emu.YuzuApplication
21import org.yuzu.yuzu_emu.model.MinimalDocumentFile
20 22
21object FileUtil { 23object FileUtil {
22 const val PATH_TREE = "tree" 24 const val PATH_TREE = "tree"
@@ -324,7 +326,25 @@ object FileUtil {
324 } 326 }
325 } 327 }
326 328
327 fun hasExtension(path: String, extension: String): Boolean { 329 fun hasExtension(path: String, extension: String): Boolean =
328 return path.substring(path.lastIndexOf(".") + 1).contains(extension) 330 path.substring(path.lastIndexOf(".") + 1).contains(extension)
331
332 fun hasExtension(uri: Uri, extension: String): Boolean {
333 val fileName: String?
334 val cursor = YuzuApplication.appContext.contentResolver.query(uri, null, null, null, null)
335 val nameIndex = cursor?.getColumnIndex(OpenableColumns.DISPLAY_NAME)
336 cursor?.moveToFirst()
337
338 if (nameIndex == null) {
339 return false
340 }
341
342 fileName = cursor.getString(nameIndex)
343 cursor.close()
344
345 if (fileName == null) {
346 return false
347 }
348 return fileName.substring(fileName.lastIndexOf(".") + 1).contains(extension)
329 } 349 }
330} 350}
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ForegroundService.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ForegroundService.kt
index dc9b7c744..086d17606 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ForegroundService.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ForegroundService.kt
@@ -54,7 +54,7 @@ class ForegroundService : Service() {
54 54
55 override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { 55 override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
56 if (intent == null) { 56 if (intent == null) {
57 return START_NOT_STICKY; 57 return START_NOT_STICKY
58 } 58 }
59 if (intent.action == ACTION_STOP) { 59 if (intent.action == ACTION_STOP) {
60 NotificationManagerCompat.from(this).cancel(EMULATION_RUNNING_NOTIFICATION) 60 NotificationManagerCompat.from(this).cancel(EMULATION_RUNNING_NOTIFICATION)
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GameHelper.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GameHelper.kt
index ba6b5783e..ee9f3e570 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GameHelper.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GameHelper.kt
@@ -6,13 +6,12 @@ package org.yuzu.yuzu_emu.utils
6import android.content.SharedPreferences 6import android.content.SharedPreferences
7import android.net.Uri 7import android.net.Uri
8import androidx.preference.PreferenceManager 8import androidx.preference.PreferenceManager
9import kotlinx.serialization.decodeFromString 9import java.util.*
10import kotlinx.serialization.encodeToString 10import kotlinx.serialization.encodeToString
11import kotlinx.serialization.json.Json 11import kotlinx.serialization.json.Json
12import org.yuzu.yuzu_emu.NativeLibrary 12import org.yuzu.yuzu_emu.NativeLibrary
13import org.yuzu.yuzu_emu.YuzuApplication 13import org.yuzu.yuzu_emu.YuzuApplication
14import org.yuzu.yuzu_emu.model.Game 14import org.yuzu.yuzu_emu.model.Game
15import java.util.*
16 15
17object GameHelper { 16object GameHelper {
18 const val KEY_GAME_PATH = "game_path" 17 const val KEY_GAME_PATH = "game_path"
@@ -83,7 +82,8 @@ object GameHelper {
83 NativeLibrary.getRegions(filePath), 82 NativeLibrary.getRegions(filePath),
84 filePath, 83 filePath,
85 gameId, 84 gameId,
86 NativeLibrary.getCompany(filePath) 85 NativeLibrary.getCompany(filePath),
86 NativeLibrary.isHomebrew(filePath)
87 ) 87 )
88 88
89 val addedTime = preferences.getLong(newGame.keyAddedToLibraryTime, 0L) 89 val addedTime = preferences.getLong(newGame.keyAddedToLibraryTime, 0L)
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GpuDriverHelper.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GpuDriverHelper.kt
index 528011d7f..1d4695a2a 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GpuDriverHelper.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GpuDriverHelper.kt
@@ -5,14 +5,14 @@ package org.yuzu.yuzu_emu.utils
5 5
6import android.content.Context 6import android.content.Context
7import android.net.Uri 7import android.net.Uri
8import org.yuzu.yuzu_emu.NativeLibrary
9import org.yuzu.yuzu_emu.utils.FileUtil.copyUriToInternalStorage
10import java.io.BufferedInputStream 8import java.io.BufferedInputStream
11import java.io.File 9import java.io.File
12import java.io.FileInputStream 10import java.io.FileInputStream
13import java.io.FileOutputStream 11import java.io.FileOutputStream
14import java.io.IOException 12import java.io.IOException
15import java.util.zip.ZipInputStream 13import java.util.zip.ZipInputStream
14import org.yuzu.yuzu_emu.NativeLibrary
15import org.yuzu.yuzu_emu.utils.FileUtil.copyUriToInternalStorage
16 16
17object GpuDriverHelper { 17object GpuDriverHelper {
18 private const val META_JSON_FILENAME = "meta.json" 18 private const val META_JSON_FILENAME = "meta.json"
@@ -113,6 +113,8 @@ object GpuDriverHelper {
113 initializeDriverParameters(context) 113 initializeDriverParameters(context)
114 } 114 }
115 115
116 external fun supportsCustomDriverLoading(): Boolean
117
116 // Parse the custom driver metadata to retrieve the name. 118 // Parse the custom driver metadata to retrieve the name.
117 val customDriverName: String? 119 val customDriverName: String?
118 get() { 120 get() {
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GpuDriverMetadata.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GpuDriverMetadata.kt
index 70bdb4097..a4e64070a 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GpuDriverMetadata.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GpuDriverMetadata.kt
@@ -3,12 +3,12 @@
3 3
4package org.yuzu.yuzu_emu.utils 4package org.yuzu.yuzu_emu.utils
5 5
6import org.json.JSONException
7import org.json.JSONObject
8import java.io.IOException 6import java.io.IOException
9import java.nio.charset.StandardCharsets 7import java.nio.charset.StandardCharsets
10import java.nio.file.Files 8import java.nio.file.Files
11import java.nio.file.Paths 9import java.nio.file.Paths
10import org.json.JSONException
11import org.json.JSONObject
12 12
13class GpuDriverMetadata(metadataFilePath: String) { 13class GpuDriverMetadata(metadataFilePath: String) {
14 var name: String? = null 14 var name: String? = null
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt
index 24e999b29..e963dfbc1 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt
@@ -5,8 +5,8 @@ package org.yuzu.yuzu_emu.utils
5 5
6import android.view.KeyEvent 6import android.view.KeyEvent
7import android.view.MotionEvent 7import android.view.MotionEvent
8import org.yuzu.yuzu_emu.NativeLibrary
9import kotlin.math.sqrt 8import kotlin.math.sqrt
9import org.yuzu.yuzu_emu.NativeLibrary
10 10
11class InputHandler { 11class InputHandler {
12 fun initialize() { 12 fun initialize() {
@@ -68,7 +68,11 @@ class InputHandler {
68 6 -> NativeLibrary.Player6Device 68 6 -> NativeLibrary.Player6Device
69 7 -> NativeLibrary.Player7Device 69 7 -> NativeLibrary.Player7Device
70 8 -> NativeLibrary.Player8Device 70 8 -> NativeLibrary.Player8Device
71 else -> if (NativeLibrary.isHandheldOnly()) NativeLibrary.ConsoleDevice else NativeLibrary.Player1Device 71 else -> if (NativeLibrary.isHandheldOnly()) {
72 NativeLibrary.ConsoleDevice
73 } else {
74 NativeLibrary.Player1Device
75 }
72 } 76 }
73 } 77 }
74 78
@@ -107,7 +111,11 @@ class InputHandler {
107 } 111 }
108 112
109 private fun getAxisToButton(axis: Float): Int { 113 private fun getAxisToButton(axis: Float): Int {
110 return if (axis > 0.5f) NativeLibrary.ButtonState.PRESSED else NativeLibrary.ButtonState.RELEASED 114 return if (axis > 0.5f) {
115 NativeLibrary.ButtonState.PRESSED
116 } else {
117 NativeLibrary.ButtonState.RELEASED
118 }
111 } 119 }
112 120
113 private fun setAxisDpadState(playerNumber: Int, xAxis: Float, yAxis: Float) { 121 private fun setAxisDpadState(playerNumber: Int, xAxis: Float, yAxis: Float) {
@@ -287,7 +295,6 @@ class InputHandler {
287 } 295 }
288 } 296 }
289 297
290
291 private fun setJoyconAxisInput(event: MotionEvent, axis: Int) { 298 private fun setJoyconAxisInput(event: MotionEvent, axis: Int) {
292 // Joycon support is half dead. Right joystick doesn't work 299 // Joycon support is half dead. Right joystick doesn't work
293 val playerNumber = getPlayerNumber(event.device.controllerNumber) 300 val playerNumber = getPlayerNumber(event.device.controllerNumber)
@@ -355,6 +362,4 @@ class InputHandler {
355 ) 362 )
356 } 363 }
357 } 364 }
358 365}
359
360} \ No newline at end of file
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InsetsHelper.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InsetsHelper.kt
index 19c53c481..595f0d284 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InsetsHelper.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InsetsHelper.kt
@@ -4,9 +4,7 @@
4package org.yuzu.yuzu_emu.utils 4package org.yuzu.yuzu_emu.utils
5 5
6import android.annotation.SuppressLint 6import android.annotation.SuppressLint
7import android.app.Activity
8import android.content.Context 7import android.content.Context
9import android.graphics.Rect
10 8
11object InsetsHelper { 9object InsetsHelper {
12 const val THREE_BUTTON_NAVIGATION = 0 10 const val THREE_BUTTON_NAVIGATION = 0
@@ -20,12 +18,8 @@ object InsetsHelper {
20 resources.getIdentifier("config_navBarInteractionMode", "integer", "android") 18 resources.getIdentifier("config_navBarInteractionMode", "integer", "android")
21 return if (resourceId != 0) { 19 return if (resourceId != 0) {
22 resources.getInteger(resourceId) 20 resources.getInteger(resourceId)
23 } else 0 21 } else {
24 } 22 0
25 23 }
26 fun getBottomPaddingRequired(activity: Activity): Int {
27 val visibleFrame = Rect()
28 activity.window.decorView.getWindowVisibleDisplayFrame(visibleFrame)
29 return visibleFrame.bottom - visibleFrame.top - activity.resources.displayMetrics.heightPixels
30 } 24 }
31} 25}
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/NfcReader.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/NfcReader.kt
index 344dd8a0a..68ed66565 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/NfcReader.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/NfcReader.kt
@@ -13,8 +13,8 @@ import android.nfc.tech.NfcA
13import android.os.Build 13import android.os.Build
14import android.os.Handler 14import android.os.Handler
15import android.os.Looper 15import android.os.Looper
16import org.yuzu.yuzu_emu.NativeLibrary
17import java.io.IOException 16import java.io.IOException
17import org.yuzu.yuzu_emu.NativeLibrary
18 18
19class NfcReader(private val activity: Activity) { 19class NfcReader(private val activity: Activity) {
20 private var nfcAdapter: NfcAdapter? = null 20 private var nfcAdapter: NfcAdapter? = null
@@ -25,10 +25,13 @@ class NfcReader(private val activity: Activity) {
25 25
26 pendingIntent = PendingIntent.getActivity( 26 pendingIntent = PendingIntent.getActivity(
27 activity, 27 activity,
28 0, Intent(activity, activity.javaClass), 28 0,
29 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) 29 Intent(activity, activity.javaClass),
30 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
30 PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE 31 PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE
31 else PendingIntent.FLAG_UPDATE_CURRENT 32 } else {
33 PendingIntent.FLAG_UPDATE_CURRENT
34 }
32 ) 35 )
33 36
34 val tagDetected = IntentFilter(NfcAdapter.ACTION_TAG_DISCOVERED) 37 val tagDetected = IntentFilter(NfcAdapter.ACTION_TAG_DISCOVERED)
@@ -45,9 +48,9 @@ class NfcReader(private val activity: Activity) {
45 48
46 fun onNewIntent(intent: Intent) { 49 fun onNewIntent(intent: Intent) {
47 val action = intent.action 50 val action = intent.action
48 if (NfcAdapter.ACTION_TAG_DISCOVERED != action 51 if (NfcAdapter.ACTION_TAG_DISCOVERED != action &&
49 && NfcAdapter.ACTION_TECH_DISCOVERED != action 52 NfcAdapter.ACTION_TECH_DISCOVERED != action &&
50 && NfcAdapter.ACTION_NDEF_DISCOVERED != action 53 NfcAdapter.ACTION_NDEF_DISCOVERED != action
51 ) { 54 ) {
52 return 55 return
53 } 56 }
@@ -84,7 +87,7 @@ class NfcReader(private val activity: Activity) {
84 } 87 }
85 88
86 private fun ntag215ReadAll(amiibo: NfcA): ByteArray? { 89 private fun ntag215ReadAll(amiibo: NfcA): ByteArray? {
87 val bufferSize = amiibo.maxTransceiveLength; 90 val bufferSize = amiibo.maxTransceiveLength
88 val tagSize = 0x21C 91 val tagSize = 0x21C
89 val pageSize = 4 92 val pageSize = 4
90 val lastPage = tagSize / pageSize - 1 93 val lastPage = tagSize / pageSize - 1
@@ -103,7 +106,7 @@ class NfcReader(private val activity: Activity) {
103 val data = ntag215FastRead(amiibo, dataStart, dataEnd - 1) 106 val data = ntag215FastRead(amiibo, dataStart, dataEnd - 1)
104 System.arraycopy(data, 0, tagData, i, (dataEnd - dataStart) * pageSize) 107 System.arraycopy(data, 0, tagData, i, (dataEnd - dataStart) * pageSize)
105 } catch (e: IOException) { 108 } catch (e: IOException) {
106 return null; 109 return null
107 } 110 }
108 } 111 }
109 return tagData 112 return tagData
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/SerializableHelper.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/SerializableHelper.kt
index 87ee7f2e6..00e58faec 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/SerializableHelper.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/SerializableHelper.kt
@@ -11,30 +11,34 @@ import java.io.Serializable
11 11
12object SerializableHelper { 12object SerializableHelper {
13 inline fun <reified T : Serializable> Bundle.serializable(key: String): T? { 13 inline fun <reified T : Serializable> Bundle.serializable(key: String): T? {
14 return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) 14 return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
15 getSerializable(key, T::class.java) 15 getSerializable(key, T::class.java)
16 else 16 } else {
17 getSerializable(key) as? T 17 getSerializable(key) as? T
18 }
18 } 19 }
19 20
20 inline fun <reified T : Serializable> Intent.serializable(key: String): T? { 21 inline fun <reified T : Serializable> Intent.serializable(key: String): T? {
21 return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) 22 return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
22 getSerializableExtra(key, T::class.java) 23 getSerializableExtra(key, T::class.java)
23 else 24 } else {
24 getSerializableExtra(key) as? T 25 getSerializableExtra(key) as? T
26 }
25 } 27 }
26 28
27 inline fun <reified T : Parcelable> Bundle.parcelable(key: String): T? { 29 inline fun <reified T : Parcelable> Bundle.parcelable(key: String): T? {
28 return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) 30 return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
29 getParcelable(key, T::class.java) 31 getParcelable(key, T::class.java)
30 else 32 } else {
31 getParcelable(key) as? T 33 getParcelable(key) as? T
34 }
32 } 35 }
33 36
34 inline fun <reified T : Parcelable> Intent.parcelable(key: String): T? { 37 inline fun <reified T : Parcelable> Intent.parcelable(key: String): T? {
35 return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) 38 return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
36 getParcelableExtra(key, T::class.java) 39 getParcelableExtra(key, T::class.java)
37 else 40 } else {
38 getParcelableExtra(key) as? T 41 getParcelableExtra(key) as? T
42 }
39 } 43 }
40} 44}
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ThemeHelper.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ThemeHelper.kt
index e55767c0f..f312e24cf 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ThemeHelper.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/ThemeHelper.kt
@@ -3,21 +3,19 @@
3 3
4package org.yuzu.yuzu_emu.utils 4package org.yuzu.yuzu_emu.utils
5 5
6import android.app.Activity
7import android.content.res.Configuration 6import android.content.res.Configuration
8import android.graphics.Color 7import android.graphics.Color
9import androidx.annotation.ColorInt 8import androidx.annotation.ColorInt
10import androidx.appcompat.app.AppCompatActivity 9import androidx.appcompat.app.AppCompatActivity
11import androidx.appcompat.app.AppCompatDelegate 10import androidx.appcompat.app.AppCompatDelegate
12import androidx.core.content.ContextCompat
13import androidx.core.view.WindowCompat 11import androidx.core.view.WindowCompat
14import androidx.core.view.WindowInsetsControllerCompat 12import androidx.core.view.WindowInsetsControllerCompat
15import androidx.preference.PreferenceManager 13import androidx.preference.PreferenceManager
14import kotlin.math.roundToInt
16import org.yuzu.yuzu_emu.R 15import org.yuzu.yuzu_emu.R
17import org.yuzu.yuzu_emu.YuzuApplication 16import org.yuzu.yuzu_emu.YuzuApplication
18import org.yuzu.yuzu_emu.features.settings.model.Settings 17import org.yuzu.yuzu_emu.features.settings.model.Settings
19import org.yuzu.yuzu_emu.ui.main.ThemeProvider 18import org.yuzu.yuzu_emu.ui.main.ThemeProvider
20import kotlin.math.roundToInt
21 19
22object ThemeHelper { 20object ThemeHelper {
23 const val SYSTEM_BAR_ALPHA = 0.9f 21 const val SYSTEM_BAR_ALPHA = 0.9f
@@ -36,8 +34,8 @@ object ThemeHelper {
36 // Using a specific night mode check because this could apply incorrectly when using the 34 // Using a specific night mode check because this could apply incorrectly when using the
37 // light app mode, dark system mode, and black backgrounds. Launching the settings activity 35 // light app mode, dark system mode, and black backgrounds. Launching the settings activity
38 // will then show light mode colors/navigation bars but with black backgrounds. 36 // will then show light mode colors/navigation bars but with black backgrounds.
39 if (preferences.getBoolean(Settings.PREF_BLACK_BACKGROUNDS, false) 37 if (preferences.getBoolean(Settings.PREF_BLACK_BACKGROUNDS, false) &&
40 && isNightMode(activity) 38 isNightMode(activity)
41 ) { 39 ) {
42 activity.setTheme(R.style.ThemeOverlay_Yuzu_Dark) 40 activity.setTheme(R.style.ThemeOverlay_Yuzu_Dark)
43 } 41 }
@@ -46,8 +44,10 @@ object ThemeHelper {
46 @ColorInt 44 @ColorInt
47 fun getColorWithOpacity(@ColorInt color: Int, alphaFactor: Float): Int { 45 fun getColorWithOpacity(@ColorInt color: Int, alphaFactor: Float): Int {
48 return Color.argb( 46 return Color.argb(
49 (alphaFactor * Color.alpha(color)).roundToInt(), Color.red(color), 47 (alphaFactor * Color.alpha(color)).roundToInt(),
50 Color.green(color), Color.blue(color) 48 Color.red(color),
49 Color.green(color),
50 Color.blue(color)
51 ) 51 )
52 } 52 }
53 53
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt
index c8ef8c1fd..685ccaa76 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt
@@ -38,9 +38,11 @@ class FixedRatioSurfaceView @JvmOverloads constructor(
38 newWidth = width 38 newWidth = width
39 newHeight = (width / aspectRatio).roundToInt() 39 newHeight = (width / aspectRatio).roundToInt()
40 } 40 }
41 setMeasuredDimension(newWidth, newHeight) 41 val left = (width - newWidth) / 2
42 val top = (height - newHeight) / 2
43 setLeftTopRightBottom(left, top, left + newWidth, top + newHeight)
42 } else { 44 } else {
43 setMeasuredDimension(width, height) 45 setLeftTopRightBottom(0, 0, width, height)
44 } 46 }
45 } 47 }
46} 48}
diff --git a/src/android/app/src/main/jni/config.cpp b/src/android/app/src/main/jni/config.cpp
index 2d622a048..43e8aa72a 100644
--- a/src/android/app/src/main/jni/config.cpp
+++ b/src/android/app/src/main/jni/config.cpp
@@ -235,9 +235,13 @@ void Config::ReadValues() {
235 Settings::values.async_presentation = 235 Settings::values.async_presentation =
236 config->GetBoolean("Renderer", "async_presentation", true); 236 config->GetBoolean("Renderer", "async_presentation", true);
237 237
238 // Enable force_max_clock by default on Android 238 // Disable force_max_clock by default on Android
239 Settings::values.renderer_force_max_clock = 239 Settings::values.renderer_force_max_clock =
240 config->GetBoolean("Renderer", "force_max_clock", true); 240 config->GetBoolean("Renderer", "force_max_clock", false);
241
242 // Disable use_reactive_flushing by default on Android
243 Settings::values.use_reactive_flushing =
244 config->GetBoolean("Renderer", "use_reactive_flushing", false);
241 245
242 // Audio 246 // Audio
243 ReadSetting("Audio", Settings::values.sink_id); 247 ReadSetting("Audio", Settings::values.sink_id);
diff --git a/src/android/app/src/main/jni/default_ini.h b/src/android/app/src/main/jni/default_ini.h
index c5dfaff54..d81422a74 100644
--- a/src/android/app/src/main/jni/default_ini.h
+++ b/src/android/app/src/main/jni/default_ini.h
@@ -251,7 +251,7 @@ backend =
251# 0: Off, 1 (default): On 251# 0: Off, 1 (default): On
252async_presentation = 252async_presentation =
253 253
254# Enable graphics API debugging mode. 254# Forces the GPU to run at the maximum possible clocks (thermal constraints will still be applied).
255# 0 (default): Disabled, 1: Enabled 255# 0 (default): Disabled, 1: Enabled
256force_max_clock = 256force_max_clock =
257 257
@@ -328,6 +328,10 @@ shader_backend =
328# 0 (default): Off, 1: On 328# 0 (default): Off, 1: On
329use_asynchronous_shaders = 329use_asynchronous_shaders =
330 330
331# Uses reactive flushing instead of predictive flushing. Allowing a more accurate syncing of memory.
332# 0 (default): Off, 1: On
333use_reactive_flushing =
334
331# NVDEC emulation. 335# NVDEC emulation.
332# 0: Disabled, 1: CPU Decoding, 2 (default): GPU Decoding 336# 0: Disabled, 1: CPU Decoding, 2 (default): GPU Decoding
333nvdec_emulation = 337nvdec_emulation =
diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp
index b87e04b3d..632aa50b3 100644
--- a/src/android/app/src/main/jni/native.cpp
+++ b/src/android/app/src/main/jni/native.cpp
@@ -13,6 +13,7 @@
13 13
14#include <android/api-level.h> 14#include <android/api-level.h>
15#include <android/native_window_jni.h> 15#include <android/native_window_jni.h>
16#include <core/loader/nro.h>
16 17
17#include "common/detached_tasks.h" 18#include "common/detached_tasks.h"
18#include "common/dynamic_library.h" 19#include "common/dynamic_library.h"
@@ -27,7 +28,10 @@
27#include "core/core.h" 28#include "core/core.h"
28#include "core/cpu_manager.h" 29#include "core/cpu_manager.h"
29#include "core/crypto/key_manager.h" 30#include "core/crypto/key_manager.h"
31#include "core/file_sys/card_image.h"
30#include "core/file_sys/registered_cache.h" 32#include "core/file_sys/registered_cache.h"
33#include "core/file_sys/submission_package.h"
34#include "core/file_sys/vfs.h"
31#include "core/file_sys/vfs_real.h" 35#include "core/file_sys/vfs_real.h"
32#include "core/frontend/applets/cabinet.h" 36#include "core/frontend/applets/cabinet.h"
33#include "core/frontend/applets/controller.h" 37#include "core/frontend/applets/controller.h"
@@ -93,12 +97,72 @@ public:
93 m_native_window = native_window; 97 m_native_window = native_window;
94 } 98 }
95 99
96 u32 ScreenRotation() const { 100 int InstallFileToNand(std::string filename) {
97 return m_screen_rotation; 101 const auto copy_func = [](const FileSys::VirtualFile& src, const FileSys::VirtualFile& dest,
98 } 102 std::size_t block_size) {
103 if (src == nullptr || dest == nullptr) {
104 return false;
105 }
106 if (!dest->Resize(src->GetSize())) {
107 return false;
108 }
109
110 using namespace Common::Literals;
111 std::vector<u8> buffer(1_MiB);
112
113 for (std::size_t i = 0; i < src->GetSize(); i += buffer.size()) {
114 const auto read = src->Read(buffer.data(), buffer.size(), i);
115 dest->Write(buffer.data(), read, i);
116 }
117 return true;
118 };
119
120 enum InstallResult {
121 Success = 0,
122 SuccessFileOverwritten = 1,
123 InstallError = 2,
124 ErrorBaseGame = 3,
125 ErrorFilenameExtension = 4,
126 };
127
128 m_system.SetContentProvider(std::make_unique<FileSys::ContentProviderUnion>());
129 m_system.GetFileSystemController().CreateFactories(*m_vfs);
130
131 std::shared_ptr<FileSys::NSP> nsp;
132 if (filename.ends_with("nsp")) {
133 nsp = std::make_shared<FileSys::NSP>(m_vfs->OpenFile(filename, FileSys::Mode::Read));
134 if (nsp->IsExtractedType()) {
135 return InstallError;
136 }
137 } else if (filename.ends_with("xci")) {
138 const auto xci =
139 std::make_shared<FileSys::XCI>(m_vfs->OpenFile(filename, FileSys::Mode::Read));
140 nsp = xci->GetSecurePartitionNSP();
141 } else {
142 return ErrorFilenameExtension;
143 }
99 144
100 void SetScreenRotation(u32 screen_rotation) { 145 if (!nsp) {
101 m_screen_rotation = screen_rotation; 146 return InstallError;
147 }
148
149 if (nsp->GetStatus() != Loader::ResultStatus::Success) {
150 return InstallError;
151 }
152
153 const auto res = m_system.GetFileSystemController().GetUserNANDContents()->InstallEntry(
154 *nsp, true, copy_func);
155
156 switch (res) {
157 case FileSys::InstallResult::Success:
158 return Success;
159 case FileSys::InstallResult::OverwriteExisting:
160 return SuccessFileOverwritten;
161 case FileSys::InstallResult::ErrorBaseInstall:
162 return ErrorBaseGame;
163 default:
164 return InstallError;
165 }
102 } 166 }
103 167
104 void InitializeGpuDriver(const std::string& hook_lib_dir, const std::string& custom_driver_dir, 168 void InitializeGpuDriver(const std::string& hook_lib_dir, const std::string& custom_driver_dir,
@@ -138,6 +202,11 @@ public:
138 return m_is_running; 202 return m_is_running;
139 } 203 }
140 204
205 bool IsPaused() const {
206 std::scoped_lock lock(m_mutex);
207 return m_is_running && m_is_paused;
208 }
209
141 const Core::PerfStatsResults& PerfStats() const { 210 const Core::PerfStatsResults& PerfStats() const {
142 std::scoped_lock m_perf_stats_lock(m_perf_stats_mutex); 211 std::scoped_lock m_perf_stats_lock(m_perf_stats_mutex);
143 return m_perf_stats; 212 return m_perf_stats;
@@ -161,14 +230,14 @@ public:
161 m_window = std::make_unique<EmuWindow_Android>(&m_input_subsystem, m_native_window, 230 m_window = std::make_unique<EmuWindow_Android>(&m_input_subsystem, m_native_window,
162 m_vulkan_library); 231 m_vulkan_library);
163 232
233 m_system.SetFilesystem(m_vfs);
234
164 // Initialize system. 235 // Initialize system.
165 auto android_keyboard = std::make_unique<SoftwareKeyboard::AndroidKeyboard>(); 236 auto android_keyboard = std::make_unique<SoftwareKeyboard::AndroidKeyboard>();
166 m_software_keyboard = android_keyboard.get(); 237 m_software_keyboard = android_keyboard.get();
167 m_system.SetShuttingDown(false); 238 m_system.SetShuttingDown(false);
168 m_system.ApplySettings(); 239 m_system.ApplySettings();
169 m_system.HIDCore().ReloadInputDevices(); 240 m_system.HIDCore().ReloadInputDevices();
170 m_system.SetContentProvider(std::make_unique<FileSys::ContentProviderUnion>());
171 m_system.SetFilesystem(std::make_shared<FileSys::RealVfsFilesystem>());
172 m_system.SetAppletFrontendSet({ 241 m_system.SetAppletFrontendSet({
173 nullptr, // Amiibo Settings 242 nullptr, // Amiibo Settings
174 nullptr, // Controller Selector 243 nullptr, // Controller Selector
@@ -180,7 +249,8 @@ public:
180 std::move(android_keyboard), // Software Keyboard 249 std::move(android_keyboard), // Software Keyboard
181 nullptr, // Web Browser 250 nullptr, // Web Browser
182 }); 251 });
183 m_system.GetFileSystemController().CreateFactories(*m_system.GetFilesystem()); 252 m_system.SetContentProvider(std::make_unique<FileSys::ContentProviderUnion>());
253 m_system.GetFileSystemController().CreateFactories(*m_vfs);
184 254
185 // Initialize account manager 255 // Initialize account manager
186 m_profile_manager = std::make_unique<Service::Account::ProfileManager>(); 256 m_profile_manager = std::make_unique<Service::Account::ProfileManager>();
@@ -222,11 +292,13 @@ public:
222 void PauseEmulation() { 292 void PauseEmulation() {
223 std::scoped_lock lock(m_mutex); 293 std::scoped_lock lock(m_mutex);
224 m_system.Pause(); 294 m_system.Pause();
295 m_is_paused = true;
225 } 296 }
226 297
227 void UnPauseEmulation() { 298 void UnPauseEmulation() {
228 std::scoped_lock lock(m_mutex); 299 std::scoped_lock lock(m_mutex);
229 m_system.Run(); 300 m_system.Run();
301 m_is_paused = false;
230 } 302 }
231 303
232 void HaltEmulation() { 304 void HaltEmulation() {
@@ -281,6 +353,10 @@ public:
281 return GetRomMetadata(path).icon; 353 return GetRomMetadata(path).icon;
282 } 354 }
283 355
356 bool GetIsHomebrew(const std::string& path) {
357 return GetRomMetadata(path).isHomebrew;
358 }
359
284 void ResetRomMetadata() { 360 void ResetRomMetadata() {
285 m_rom_metadata_cache.clear(); 361 m_rom_metadata_cache.clear();
286 } 362 }
@@ -348,6 +424,7 @@ private:
348 struct RomMetadata { 424 struct RomMetadata {
349 std::string title; 425 std::string title;
350 std::vector<u8> icon; 426 std::vector<u8> icon;
427 bool isHomebrew;
351 }; 428 };
352 429
353 RomMetadata GetRomMetadata(const std::string& path) { 430 RomMetadata GetRomMetadata(const std::string& path) {
@@ -360,11 +437,17 @@ private:
360 437
361 RomMetadata CacheRomMetadata(const std::string& path) { 438 RomMetadata CacheRomMetadata(const std::string& path) {
362 const auto file = Core::GetGameFileFromPath(m_vfs, path); 439 const auto file = Core::GetGameFileFromPath(m_vfs, path);
363 const auto loader = Loader::GetLoader(EmulationSession::GetInstance().System(), file, 0, 0); 440 auto loader = Loader::GetLoader(EmulationSession::GetInstance().System(), file, 0, 0);
364 441
365 RomMetadata entry; 442 RomMetadata entry;
366 loader->ReadTitle(entry.title); 443 loader->ReadTitle(entry.title);
367 loader->ReadIcon(entry.icon); 444 loader->ReadIcon(entry.icon);
445 if (loader->GetFileType() == Loader::FileType::NRO) {
446 auto loader_nro = dynamic_cast<Loader::AppLoader_NRO*>(loader.get());
447 entry.isHomebrew = loader_nro->IsHomebrew();
448 } else {
449 entry.isHomebrew = false;
450 }
368 451
369 m_rom_metadata_cache[path] = entry; 452 m_rom_metadata_cache[path] = entry;
370 453
@@ -388,16 +471,16 @@ private:
388 // Window management 471 // Window management
389 std::unique_ptr<EmuWindow_Android> m_window; 472 std::unique_ptr<EmuWindow_Android> m_window;
390 ANativeWindow* m_native_window{}; 473 ANativeWindow* m_native_window{};
391 u32 m_screen_rotation{};
392 474
393 // Core emulation 475 // Core emulation
394 Core::System m_system; 476 Core::System m_system;
395 InputCommon::InputSubsystem m_input_subsystem; 477 InputCommon::InputSubsystem m_input_subsystem;
396 Common::DetachedTasks m_detached_tasks; 478 Common::DetachedTasks m_detached_tasks;
397 Core::PerfStatsResults m_perf_stats{}; 479 Core::PerfStatsResults m_perf_stats{};
398 std::shared_ptr<FileSys::RealVfsFilesystem> m_vfs; 480 std::shared_ptr<FileSys::VfsFilesystem> m_vfs;
399 Core::SystemResultStatus m_load_result{Core::SystemResultStatus::ErrorNotInitialized}; 481 Core::SystemResultStatus m_load_result{Core::SystemResultStatus::ErrorNotInitialized};
400 bool m_is_running{}; 482 bool m_is_running{};
483 bool m_is_paused{};
401 SoftwareKeyboard::AndroidKeyboard* m_software_keyboard{}; 484 SoftwareKeyboard::AndroidKeyboard* m_software_keyboard{};
402 std::unique_ptr<Service::Account::ProfileManager> m_profile_manager; 485 std::unique_ptr<Service::Account::ProfileManager> m_profile_manager;
403 486
@@ -414,10 +497,6 @@ private:
414 497
415} // Anonymous namespace 498} // Anonymous namespace
416 499
417u32 GetAndroidScreenRotation() {
418 return EmulationSession::GetInstance().ScreenRotation();
419}
420
421static Core::SystemResultStatus RunEmulation(const std::string& filepath) { 500static Core::SystemResultStatus RunEmulation(const std::string& filepath) {
422 Common::Log::Initialize(); 501 Common::Log::Initialize();
423 Common::Log::SetColorConsoleBackendEnabled(true); 502 Common::Log::SetColorConsoleBackendEnabled(true);
@@ -461,19 +540,18 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_surfaceDestroyed(JNIEnv* env,
461 EmulationSession::GetInstance().SurfaceChanged(); 540 EmulationSession::GetInstance().SurfaceChanged();
462} 541}
463 542
464void Java_org_yuzu_yuzu_1emu_NativeLibrary_notifyOrientationChange(JNIEnv* env,
465 [[maybe_unused]] jclass clazz,
466 jint layout_option,
467 jint rotation) {
468 return EmulationSession::GetInstance().SetScreenRotation(static_cast<u32>(rotation));
469}
470
471void Java_org_yuzu_yuzu_1emu_NativeLibrary_setAppDirectory(JNIEnv* env, 543void Java_org_yuzu_yuzu_1emu_NativeLibrary_setAppDirectory(JNIEnv* env,
472 [[maybe_unused]] jclass clazz, 544 [[maybe_unused]] jclass clazz,
473 jstring j_directory) { 545 jstring j_directory) {
474 Common::FS::SetAppDirectory(GetJString(env, j_directory)); 546 Common::FS::SetAppDirectory(GetJString(env, j_directory));
475} 547}
476 548
549int Java_org_yuzu_yuzu_1emu_NativeLibrary_installFileToNand(JNIEnv* env,
550 [[maybe_unused]] jclass clazz,
551 jstring j_file) {
552 return EmulationSession::GetInstance().InstallFileToNand(GetJString(env, j_file));
553}
554
477void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeGpuDriver( 555void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeGpuDriver(
478 JNIEnv* env, [[maybe_unused]] jclass clazz, jstring hook_lib_dir, jstring custom_driver_dir, 556 JNIEnv* env, [[maybe_unused]] jclass clazz, jstring hook_lib_dir, jstring custom_driver_dir,
479 jstring custom_driver_name, jstring file_redirect_dir) { 557 jstring custom_driver_name, jstring file_redirect_dir) {
@@ -482,6 +560,26 @@ void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeGpuDriver(
482 GetJString(env, custom_driver_name), GetJString(env, file_redirect_dir)); 560 GetJString(env, custom_driver_name), GetJString(env, file_redirect_dir));
483} 561}
484 562
563[[maybe_unused]] static bool CheckKgslPresent() {
564 constexpr auto KgslPath{"/dev/kgsl-3d0"};
565
566 return access(KgslPath, F_OK) == 0;
567}
568
569[[maybe_unused]] bool SupportsCustomDriver() {
570 return android_get_device_api_level() >= 28 && CheckKgslPresent();
571}
572
573jboolean JNICALL Java_org_yuzu_yuzu_1emu_utils_GpuDriverHelper_supportsCustomDriverLoading(
574 [[maybe_unused]] JNIEnv* env, [[maybe_unused]] jobject instance) {
575#ifdef ARCHITECTURE_arm64
576 // If the KGSL device exists custom drivers can be loaded using adrenotools
577 return SupportsCustomDriver();
578#else
579 return false;
580#endif
581}
582
485jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_reloadKeys(JNIEnv* env, 583jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_reloadKeys(JNIEnv* env,
486 [[maybe_unused]] jclass clazz) { 584 [[maybe_unused]] jclass clazz) {
487 Core::Crypto::KeyManager::Instance().ReloadKeys(); 585 Core::Crypto::KeyManager::Instance().ReloadKeys();
@@ -513,6 +611,11 @@ jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isRunning([[maybe_unused]] JNIEnv
513 return static_cast<jboolean>(EmulationSession::GetInstance().IsRunning()); 611 return static_cast<jboolean>(EmulationSession::GetInstance().IsRunning());
514} 612}
515 613
614jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isPaused([[maybe_unused]] JNIEnv* env,
615 [[maybe_unused]] jclass clazz) {
616 return static_cast<jboolean>(EmulationSession::GetInstance().IsPaused());
617}
618
516jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isHandheldOnly([[maybe_unused]] JNIEnv* env, 619jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isHandheldOnly([[maybe_unused]] JNIEnv* env,
517 [[maybe_unused]] jclass clazz) { 620 [[maybe_unused]] jclass clazz) {
518 return EmulationSession::GetInstance().IsHandheldOnly(); 621 return EmulationSession::GetInstance().IsHandheldOnly();
@@ -662,6 +765,12 @@ jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getCompany([[maybe_unused]] JNIEnv
662 return env->NewStringUTF(""); 765 return env->NewStringUTF("");
663} 766}
664 767
768jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isHomebrew([[maybe_unused]] JNIEnv* env,
769 [[maybe_unused]] jclass clazz,
770 [[maybe_unused]] jstring j_filename) {
771 return EmulationSession::GetInstance().GetIsHomebrew(GetJString(env, j_filename));
772}
773
665void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeEmulation 774void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeEmulation
666 [[maybe_unused]] (JNIEnv* env, [[maybe_unused]] jclass clazz) { 775 [[maybe_unused]] (JNIEnv* env, [[maybe_unused]] jclass clazz) {
667 // Create the default config.ini. 776 // Create the default config.ini.
diff --git a/src/android/app/src/main/res/drawable/ic_pip_pause.xml b/src/android/app/src/main/res/drawable/ic_pip_pause.xml
new file mode 100644
index 000000000..4a7d4ea03
--- /dev/null
+++ b/src/android/app/src/main/res/drawable/ic_pip_pause.xml
@@ -0,0 +1,9 @@
1<vector xmlns:android="http://schemas.android.com/apk/res/android"
2 android:width="24dp"
3 android:height="24dp"
4 android:viewportHeight="24"
5 android:viewportWidth="24">
6 <path
7 android:fillColor="@android:color/white"
8 android:pathData="M6,19h4L10,5L6,5v14zM14,5v14h4L18,5h-4z" />
9</vector>
diff --git a/src/android/app/src/main/res/drawable/ic_pip_play.xml b/src/android/app/src/main/res/drawable/ic_pip_play.xml
new file mode 100644
index 000000000..2303a4623
--- /dev/null
+++ b/src/android/app/src/main/res/drawable/ic_pip_play.xml
@@ -0,0 +1,9 @@
1<vector xmlns:android="http://schemas.android.com/apk/res/android"
2 android:width="24dp"
3 android:height="24dp"
4 android:viewportHeight="24"
5 android:viewportWidth="24">
6 <path
7 android:fillColor="@android:color/white"
8 android:pathData="M8,5v14l11,-7z" />
9</vector>
diff --git a/src/android/app/src/main/res/drawable/ic_system_update_alt.xml b/src/android/app/src/main/res/drawable/ic_system_update_alt.xml
new file mode 100644
index 000000000..0f6adfdb8
--- /dev/null
+++ b/src/android/app/src/main/res/drawable/ic_system_update_alt.xml
@@ -0,0 +1,9 @@
1<vector xmlns:android="http://schemas.android.com/apk/res/android"
2 android:width="48dp"
3 android:height="48dp"
4 android:viewportWidth="960"
5 android:viewportHeight="960">
6 <path
7 android:fillColor="#FF000000"
8 android:pathData="M140,800q-24,0 -42,-18t-18,-42v-520q0,-24 18,-42t42,-18h250v60L140,220v520h680v-520L570,220v-60h250q24,0 42,18t18,42v520q0,24 -18,42t-42,18L140,800ZM480,615L280,415l43,-43 127,127v-339h60v339l127,-127 43,43 -200,200Z"/>
9</vector>
diff --git a/src/android/app/src/main/res/layout/activity_emulation.xml b/src/android/app/src/main/res/layout/activity_emulation.xml
index f6360a65b..139065d3d 100644
--- a/src/android/app/src/main/res/layout/activity_emulation.xml
+++ b/src/android/app/src/main/res/layout/activity_emulation.xml
@@ -1,13 +1,9 @@
1<FrameLayout 1<androidx.fragment.app.FragmentContainerView
2 xmlns:android="http://schemas.android.com/apk/res/android" 2 xmlns:android="http://schemas.android.com/apk/res/android"
3 android:id="@+id/frame_content" 3 xmlns:app="http://schemas.android.com/apk/res-auto"
4 android:id="@+id/fragment_container"
5 android:name="androidx.navigation.fragment.NavHostFragment"
4 android:layout_width="match_parent" 6 android:layout_width="match_parent"
5 android:layout_height="match_parent" 7 android:layout_height="match_parent"
6 android:keepScreenOn="true"> 8 android:keepScreenOn="true"
7 9 app:defaultNavHost="true" />
8 <FrameLayout
9 android:id="@+id/frame_emulation_fragment"
10 android:layout_width="match_parent"
11 android:layout_height="match_parent" />
12
13</FrameLayout>
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 09b789b6b..e54a10e8f 100644
--- a/src/android/app/src/main/res/layout/fragment_emulation.xml
+++ b/src/android/app/src/main/res/layout/fragment_emulation.xml
@@ -12,49 +12,65 @@
12 android:layout_width="match_parent" 12 android:layout_width="match_parent"
13 android:layout_height="match_parent"> 13 android:layout_height="match_parent">
14 14
15 <!-- This is what everything is rendered to during emulation --> 15 <FrameLayout
16 <org.yuzu.yuzu_emu.views.FixedRatioSurfaceView 16 android:id="@+id/emulation_container"
17 android:id="@+id/surface_emulation"
18 android:layout_width="match_parent" 17 android:layout_width="match_parent"
19 android:layout_height="match_parent" 18 android:layout_height="match_parent">
20 android:layout_gravity="center" 19
21 android:focusable="false" 20 <!-- This is what everything is rendered to during emulation -->
22 android:focusableInTouchMode="false" /> 21 <org.yuzu.yuzu_emu.views.FixedRatioSurfaceView
22 android:id="@+id/surface_emulation"
23 android:layout_width="match_parent"
24 android:layout_height="match_parent"
25 android:layout_gravity="center"
26 android:focusable="false"
27 android:focusableInTouchMode="false" />
28
29 </FrameLayout>
23 30
24 <FrameLayout 31 <FrameLayout
25 android:id="@+id/overlay_container" 32 android:id="@+id/input_container"
26 android:layout_width="match_parent" 33 android:layout_width="match_parent"
27 android:layout_height="match_parent" 34 android:layout_height="match_parent"
28 android:layout_gravity="bottom"> 35 android:layout_gravity="bottom">
29 36
30 <!-- This is the onscreen input overlay --> 37 <!-- This is the onscreen input overlay -->
31 <org.yuzu.yuzu_emu.overlay.InputOverlay 38 <org.yuzu.yuzu_emu.overlay.InputOverlay
32 android:id="@+id/surface_input_overlay" 39 android:id="@+id/surface_input_overlay"
40 android:layout_width="match_parent"
41 android:layout_height="match_parent"
42 android:layout_gravity="center"
43 android:focusable="true"
44 android:focusableInTouchMode="true" />
45
46 <Button
47 style="@style/Widget.Material3.Button.ElevatedButton"
48 android:id="@+id/done_control_config"
49 android:layout_width="wrap_content"
50 android:layout_height="wrap_content"
51 android:layout_gravity="center"
52 android:text="@string/emulation_done"
53 android:visibility="gone" />
54
55 </FrameLayout>
56
57 <FrameLayout
58 android:id="@+id/overlay_container"
33 android:layout_width="match_parent" 59 android:layout_width="match_parent"
34 android:layout_height="match_parent" 60 android:layout_height="match_parent">
35 android:focusable="true"
36 android:focusableInTouchMode="true" />
37 61
38 <TextView 62 <TextView
39 android:id="@+id/show_fps_text" 63 android:id="@+id/show_fps_text"
40 android:layout_width="wrap_content" 64 android:layout_width="wrap_content"
41 android:layout_height="wrap_content" 65 android:layout_height="wrap_content"
42 android:layout_gravity="left" 66 android:layout_gravity="left"
43 android:clickable="false" 67 android:clickable="false"
44 android:focusable="false" 68 android:focusable="false"
45 android:shadowColor="@android:color/black" 69 android:shadowColor="@android:color/black"
46 android:textColor="@android:color/white" 70 android:textColor="@android:color/white"
47 android:textSize="12sp" 71 android:textSize="12sp"
48 tools:ignore="RtlHardcoded" /> 72 tools:ignore="RtlHardcoded" />
49 73
50 <Button
51 style="@style/Widget.Material3.Button.ElevatedButton"
52 android:id="@+id/done_control_config"
53 android:layout_width="wrap_content"
54 android:layout_height="wrap_content"
55 android:layout_gravity="center"
56 android:text="@string/emulation_done"
57 android:visibility="gone" />
58 </FrameLayout> 74 </FrameLayout>
59 75
60 </androidx.coordinatorlayout.widget.CoordinatorLayout> 76 </androidx.coordinatorlayout.widget.CoordinatorLayout>
diff --git a/src/android/app/src/main/res/layout/list_item_setting_switch.xml b/src/android/app/src/main/res/layout/list_item_setting_switch.xml
index 599d845ad..a5767adee 100644
--- a/src/android/app/src/main/res/layout/list_item_setting_switch.xml
+++ b/src/android/app/src/main/res/layout/list_item_setting_switch.xml
@@ -1,16 +1,16 @@
1<?xml version="1.0" encoding="utf-8"?> 1<?xml version="1.0" encoding="utf-8"?>
2<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:app="http://schemas.android.com/apk/res-auto"
3 xmlns:tools="http://schemas.android.com/tools" 4 xmlns:tools="http://schemas.android.com/tools"
4 android:layout_width="match_parent" 5 android:layout_width="match_parent"
5 android:layout_height="wrap_content" 6 android:layout_height="wrap_content"
6 xmlns:app="http://schemas.android.com/apk/res-auto"
7 android:background="?android:attr/selectableItemBackground" 7 android:background="?android:attr/selectableItemBackground"
8 android:clickable="true" 8 android:clickable="true"
9 android:focusable="true" 9 android:focusable="true"
10 android:minHeight="72dp" 10 android:minHeight="72dp"
11 android:paddingVertical="@dimen/spacing_large"
11 android:paddingStart="@dimen/spacing_large" 12 android:paddingStart="@dimen/spacing_large"
12 android:paddingEnd="24dp" 13 android:paddingEnd="24dp">
13 android:paddingVertical="@dimen/spacing_large">
14 14
15 <com.google.android.material.materialswitch.MaterialSwitch 15 <com.google.android.material.materialswitch.MaterialSwitch
16 android:id="@+id/switch_widget" 16 android:id="@+id/switch_widget"
@@ -19,32 +19,35 @@
19 android:layout_alignParentEnd="true" 19 android:layout_alignParentEnd="true"
20 android:layout_centerVertical="true" /> 20 android:layout_centerVertical="true" />
21 21
22 <com.google.android.material.textview.MaterialTextView 22 <LinearLayout
23 style="@style/TextAppearance.Material3.BodySmall" 23 android:layout_width="match_parent"
24 android:id="@+id/text_setting_description"
25 android:layout_width="wrap_content"
26 android:layout_height="wrap_content"
27 android:layout_alignParentStart="true"
28 android:layout_alignStart="@+id/text_setting_name"
29 android:layout_below="@+id/text_setting_name"
30 android:layout_marginEnd="@dimen/spacing_large"
31 android:layout_marginTop="@dimen/spacing_small"
32 android:layout_toStartOf="@+id/switch_widget"
33 android:textAlignment="viewStart"
34 tools:text="@string/frame_limit_enable_description" />
35
36 <com.google.android.material.textview.MaterialTextView
37 style="@style/TextAppearance.Material3.HeadlineMedium"
38 android:id="@+id/text_setting_name"
39 android:layout_width="0dp"
40 android:layout_height="wrap_content" 24 android:layout_height="wrap_content"
41 android:layout_alignParentStart="true"
42 android:layout_alignParentTop="true" 25 android:layout_alignParentTop="true"
26 android:layout_centerVertical="true"
43 android:layout_marginEnd="@dimen/spacing_large" 27 android:layout_marginEnd="@dimen/spacing_large"
44 android:layout_toStartOf="@+id/switch_widget" 28 android:layout_toStartOf="@+id/switch_widget"
45 android:textSize="16sp" 29 android:gravity="center_vertical"
46 android:textAlignment="viewStart" 30 android:orientation="vertical">
47 app:lineHeight="28dp" 31
48 tools:text="@string/frame_limit_enable" /> 32 <com.google.android.material.textview.MaterialTextView
33 android:id="@+id/text_setting_name"
34 style="@style/TextAppearance.Material3.HeadlineMedium"
35 android:layout_width="wrap_content"
36 android:layout_height="wrap_content"
37 android:textAlignment="viewStart"
38 android:textSize="16sp"
39 app:lineHeight="28dp"
40 tools:text="@string/frame_limit_enable" />
41
42 <com.google.android.material.textview.MaterialTextView
43 android:id="@+id/text_setting_description"
44 style="@style/TextAppearance.Material3.BodySmall"
45 android:layout_width="wrap_content"
46 android:layout_height="wrap_content"
47 android:layout_marginTop="@dimen/spacing_small"
48 android:textAlignment="viewStart"
49 tools:text="@string/frame_limit_enable_description" />
50
51 </LinearLayout>
49 52
50</RelativeLayout> 53</RelativeLayout>
diff --git a/src/android/app/src/main/res/layout/list_item_settings_header.xml b/src/android/app/src/main/res/layout/list_item_settings_header.xml
index abd24df6f..cf85bc0da 100644
--- a/src/android/app/src/main/res/layout/list_item_settings_header.xml
+++ b/src/android/app/src/main/res/layout/list_item_settings_header.xml
@@ -1,20 +1,14 @@
1<?xml version="1.0" encoding="utf-8"?> 1<?xml version="1.0" encoding="utf-8"?>
2<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 2<com.google.android.material.textview.MaterialTextView xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:tools="http://schemas.android.com/tools" 3 xmlns:tools="http://schemas.android.com/tools"
4 android:id="@+id/text_header_name"
5 style="@style/TextAppearance.Material3.TitleSmall"
4 android:layout_width="match_parent" 6 android:layout_width="match_parent"
5 android:layout_height="48dp" 7 android:layout_height="wrap_content"
6 android:paddingVertical="4dp" 8 android:layout_gravity="start|center_vertical"
7 android:paddingHorizontal="@dimen/spacing_large"> 9 android:paddingHorizontal="@dimen/spacing_large"
8 10 android:paddingVertical="16dp"
9 <com.google.android.material.textview.MaterialTextView 11 android:textAlignment="viewStart"
10 style="@style/TextAppearance.Material3.TitleSmall" 12 android:textColor="?attr/colorPrimary"
11 android:id="@+id/text_header_name" 13 android:textStyle="bold"
12 android:layout_width="match_parent" 14 tools:text="CPU Settings" />
13 android:layout_height="wrap_content"
14 android:layout_gravity="start|center_vertical"
15 android:textColor="?attr/colorPrimary"
16 android:textAlignment="viewStart"
17 android:textStyle="bold"
18 tools:text="CPU Settings" />
19
20</FrameLayout>
diff --git a/src/android/app/src/main/res/navigation/emulation_navigation.xml b/src/android/app/src/main/res/navigation/emulation_navigation.xml
new file mode 100644
index 000000000..8208f4c2c
--- /dev/null
+++ b/src/android/app/src/main/res/navigation/emulation_navigation.xml
@@ -0,0 +1,18 @@
1<?xml version="1.0" encoding="utf-8"?>
2<navigation xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:app="http://schemas.android.com/apk/res-auto"
4 xmlns:tools="http://schemas.android.com/tools"
5 android:id="@+id/emulation_navigation"
6 app:startDestination="@id/emulationFragment">
7
8 <fragment
9 android:id="@+id/emulationFragment"
10 android:name="org.yuzu.yuzu_emu.fragments.EmulationFragment"
11 android:label="fragment_emulation"
12 tools:layout="@layout/fragment_emulation" >
13 <argument
14 android:name="game"
15 app:argType="org.yuzu.yuzu_emu.model.Game" />
16 </fragment>
17
18</navigation>
diff --git a/src/android/app/src/main/res/navigation/home_navigation.xml b/src/android/app/src/main/res/navigation/home_navigation.xml
index 48072683e..fcebba726 100644
--- a/src/android/app/src/main/res/navigation/home_navigation.xml
+++ b/src/android/app/src/main/res/navigation/home_navigation.xml
@@ -56,4 +56,18 @@
56 android:name="org.yuzu.yuzu_emu.fragments.LicensesFragment" 56 android:name="org.yuzu.yuzu_emu.fragments.LicensesFragment"
57 android:label="LicensesFragment" /> 57 android:label="LicensesFragment" />
58 58
59 <activity
60 android:id="@+id/emulationActivity"
61 android:name="org.yuzu.yuzu_emu.activities.EmulationActivity"
62 android:label="EmulationActivity">
63 <argument
64 android:name="game"
65 app:argType="org.yuzu.yuzu_emu.model.Game" />
66 </activity>
67
68 <action
69 android:id="@+id/action_global_emulationActivity"
70 app:destination="@id/emulationActivity"
71 app:launchSingleTop="true" />
72
59</navigation> 73</navigation>
diff --git a/src/android/app/src/main/res/values-de/strings.xml b/src/android/app/src/main/res/values-de/strings.xml
new file mode 100644
index 000000000..969223ef8
--- /dev/null
+++ b/src/android/app/src/main/res/values-de/strings.xml
@@ -0,0 +1,332 @@
1<?xml version="1.0" encoding="utf-8"?>
2<resources>
3
4 <string name="app_disclaimer">Diese Software kann Spiele für die Nintendo Switch abspielen. Keine Spiele oder Spielekeys sind enthalten.&lt;br /&gt;&lt;br /&gt;Bevor du beginnst, bitte halte deine <![CDATA[<b> prod.keys </b>]]> auf deinem Gerät bereit. .&lt;br /&gt;&lt;br /&gt;<![CDATA[<a href=\"https://yuzu-emu.org/help/quickstart\">Mehr Infos</a>]]></string>
5 <string name="emulation_notification_channel_name">Emulation ist aktiv</string>
6 <string name="emulation_notification_channel_description">Zeigt eine dauerhafte Benachrichtigung an, wenn die Emulation läuft.</string>
7 <string name="emulation_notification_running">yuzu läuft</string>
8 <string name="notice_notification_channel_name">Hinweise und Fehler</string>
9 <string name="notice_notification_channel_description">Zeigt Benachrichtigungen an, wenn etwas schief läuft.</string>
10 <string name="notification_permission_not_granted">Berechtigung für Benachrichtigungen nicht erlaubt!</string>
11
12 <!-- Setup strings -->
13 <string name="welcome">Willkommen!</string>
14 <string name="welcome_description">Erfahre wie man &lt;b>yuzu&lt;/b> einrichtet und beginne mit der Emulation.</string>
15 <string name="get_started">Erste Schritte</string>
16 <string name="keys">Schlüssel</string>
17 <string name="keys_description">Wähle deine &lt;b>prod.keys&lt;/b> Datei mit dem Button unten aus.</string>
18 <string name="select_keys">Schlüssel auswählen</string>
19 <string name="games">Spiele</string>
20 <string name="games_description">Wähle mit dem Knopf unten den &lt;b>Spiele&lt;/b>-Ordner aus.</string>
21 <string name="done">Fertig</string>
22 <string name="done_description">Wir können loslegen.\nViel Spaß!</string>
23 <string name="text_continue">Fortsetzen</string>
24 <string name="next">Weiter</string>
25 <string name="back">Zurück</string>
26 <string name="add_games">Spiele hinzufügen</string>
27 <string name="add_games_description">Spieleverzeichnis auswählen</string>
28
29 <!-- Home strings -->
30 <string name="home_games">Spiele</string>
31 <string name="home_search">Suche</string>
32 <string name="home_settings">Einstellungen</string>
33 <string name="empty_gamelist">Es wurden keine Dateien gefunden oder es wurde noch kein Spielverzeichnis ausgewählt.</string>
34 <string name="search_and_filter_games">Spiele suchen und filtern</string>
35 <string name="select_games_folder">Spieleverzeichnis auswählen</string>
36 <string name="select_games_folder_description">Erlaubt yuzu die Spieleliste zu füllen</string>
37 <string name="add_games_warning">Auswahl des Spieleverzeichnisses überspringen?</string>
38 <string name="add_games_warning_description">Spiele werden in der Spieleliste nicht angezeigt, wenn kein Ordner ausgewählt ist.</string>
39 <string name="add_games_warning_help">https://yuzu-emu.org/help/quickstart/#dumping-games</string>
40 <string name="home_search_games">Spiele suchen</string>
41 <string name="games_dir_selected">Spieleverzeichnis ausgewählt</string>
42 <string name="install_prod_keys">prod.keys installieren</string>
43 <string name="install_prod_keys_description">Zum Entschlüsseln von Spielen benötigt</string>
44 <string name="install_prod_keys_warning">Hinzufügen der Schlüssel überspringen?</string>
45 <string name="install_prod_keys_warning_description">Für die Emulation von Spielen sind gültige Schlüssel erforderlich. Wenn du fortfährst, funktionieren nur Homebrew-Anwendungen.</string>
46 <string name="install_prod_keys_warning_help">https://yuzu-emu.org/help/quickstart/#guide-introduction</string>
47 <string name="notifications">Benachrichtigungen</string>
48 <string name="notifications_description">Erteile mit dem Knopf unten die Berechtigung, Benachrichtigungen zu senden.</string>
49 <string name="give_permission">Berechtigung erteilen</string>
50 <string name="notification_warning_description">yuzu wird dich nicht über wichtige Informationen benachrichtigen können.</string>
51 <string name="permission_denied">Zugriff verweigert</string>
52 <string name="permission_denied_description">Du hast diese Berechtigung zu oft verweigert und musst sie nun manuell in den Systemeinstellungen erteilen.</string>
53 <string name="about">Über</string>
54 <string name="about_description">Build-Version, Credits und mehr</string>
55 <string name="warning_help">Hilfe</string>
56 <string name="warning_skip">Überspringen</string>
57 <string name="warning_cancel">Abbrechen</string>
58 <string name="install_amiibo_keys">Amiibo-Schlüssel installieren</string>
59 <string name="install_amiibo_keys_description">Benötigt um Amiibos im Spiel zu verwenden</string>
60 <string name="invalid_keys_file">Ungültige Schlüsseldatei ausgewählt</string>
61 <string name="install_keys_success">Schlüssel erfolgreich installiert</string>
62 <string name="reading_keys_failure">Fehler beim Lesen der Schlüssel</string>
63 <string name="invalid_keys_error">Ungültige Schlüssel</string>
64 <string name="dumping_keys_quickstart_link">https://yuzu-emu.org/help/quickstart/#dumping-decryption-keys</string>
65 <string name="install_gpu_driver">GPU-Treiber installieren</string>
66 <string name="install_gpu_driver_description">Alternative Treiber für eventuell bessere Leistung oder Genauigkeit installieren</string>
67 <string name="advanced_settings">Erweiterte Einstellungen</string>
68 <string name="settings_description">Emulatoreinstellungen konfigurieren</string>
69 <string name="search_recently_played">Kürzlich gespielt</string>
70 <string name="search_recently_added">Kürzlich hinzugefügt</string>
71 <string name="search_retail">Spiele</string>
72 <string name="search_homebrew">Homebrew</string>
73 <string name="open_user_folder">yuzu-Ordner öffnen</string>
74 <string name="open_user_folder_description">yuzu\'s interne Dateien verwalten</string>
75 <string name="theme_and_color_description">Das Aussehen der App ändern</string>
76 <string name="no_file_manager">Kein Dateimanager gefunden</string>
77 <string name="notification_no_directory_link">yuzu-Verzeichnis konnte nicht geöffnet werden</string>
78 <string name="notification_no_directory_link_description">Bitte suche den Benutzerordner manuell über die Seitenleiste des Dateimanagers.</string>
79 <string name="manage_save_data">Speicherdaten verwalten</string>
80 <string name="manage_save_data_description">Speicherdaten gefunden. Bitte wähle unten eine Option aus.</string>
81 <string name="import_export_saves_description">Speicherdaten importieren oder exportieren</string>
82 <string name="import_export_saves_no_profile">Keine Speicherdaten gefunden. Bitte starte ein Spiel und versuche es erneut.</string>
83 <string name="save_file_imported_success">Erfolgreich importiert</string>
84 <string name="save_file_invalid_zip_structure">Ungültige Speicherverzeichnisstruktur</string>
85 <string name="save_file_invalid_zip_structure_description">Der erste Unterordnername muss die Titel-ID des Spiels sein.</string>
86 <string name="import_saves">Importieren</string>
87 <string name="export_saves">Exportieren</string>
88
89 <!-- About screen strings -->
90 <string name="gaia_is_not_real">Gaia ist nicht real</string>
91 <string name="copied_to_clipboard">In die Zwischenablage kopiert</string>
92 <string name="about_app_description">Ein quelloffener Switch-Emulator</string>
93 <string name="contributors">Beitragende</string>
94 <string name="contributors_description">Gemacht mit \u2764 vom yuzu Team</string>
95 <string name="contributors_link">https://github.com/yuzu-emu/yuzu/graphs/contributors</string>
96 <string name="build">Build</string>
97 <string name="support_link">https://discord.gg/u77vRWY</string>
98 <string name="website_link">https://yuzu-emu.org/</string>
99 <string name="github_link">https://github.com/yuzu-emu</string>
100
101 <!-- Early access upgrade strings -->
102 <string name="early_access">Early Access</string>
103 <string name="get_early_access">Early Access bekommen</string>
104 <string name="play_store_link">https://play.google.com/store/apps/details?id=org.yuzu.yuzu_emu.ea</string>
105 <string name="get_early_access_description">Neueste Features, frühzeitiger Zugriff auf Updates und mehr</string>
106 <string name="early_access_benefits">Early Access Vorteile</string>
107 <string name="cutting_edge_features">Neueste Features</string>
108 <string name="early_access_updates">Früherer Zugriff auf Updates</string>
109 <string name="no_manual_installation">Keine manuelle Installation</string>
110 <string name="prioritized_support">Priorisierte Unterstützung</string>
111 <string name="our_eternal_gratitude">Unsere ewige Dankbarkeit</string>
112 <string name="are_you_interested">Bist du interessiert?</string>
113
114 <!-- General settings strings -->
115 <string name="frame_limit_enable">Geschwindigkeitsbegrenzung aktivieren</string>
116 <string name="frame_limit_enable_description">Wenn aktiviert, wird die Emulationsgeschwindigkeit auf einen Prozentsatz der normalen Geschwindigkeit begrenzt.</string>
117 <string name="frame_limit_slider">Geschwindkeitsbegrenzung in Prozent</string>
118 <string name="frame_limit_slider_description">Legt den Prozentsatz der Bergrenzung der Emulationsgeschwindigkeit fest. Mit dem Standardwert von 100% wird die Emulation auf die normale Geschwindigkeit begrenzt. Höhere oder niedrigere Werte erhöhen oder verringern die Geschwindigkeitsbegrenzung.</string>
119 <string name="cpu_accuracy">CPU-Genauigkeit</string>
120
121 <!-- System settings strings -->
122 <string name="use_docked_mode">Dock-Modus</string>
123 <string name="use_docked_mode_description">Emuliert im Dock-Modus, was die Auflösung verbessert, aber die Leistung senkt.</string>
124 <string name="emulated_region">Emulierte Region</string>
125 <string name="emulated_language">Emulierte Sprache</string>
126 <string name="select_rtc_date">RTC-Datum auswählen</string>
127 <string name="select_rtc_time">RTC-Zeit auswählen</string>
128 <string name="use_custom_rtc">Benutzerdefinierte RTC aktivieren</string>
129 <string name="use_custom_rtc_description">Mit dieser Einstellung kann eine benutzerdefinierte Echtzeituhr unabhängig von der aktuellen Systemzeit verwendet werden.</string>
130 <string name="set_custom_rtc">Benutzerdefinierte RTC einstellen</string>
131
132 <!-- Graphics settings strings -->
133 <string name="renderer_api">API</string>
134 <string name="renderer_accuracy">Genauigkeitsstufe</string>
135 <string name="renderer_resolution">Auflösung</string>
136 <string name="renderer_vsync">VSync-Modus</string>
137 <string name="renderer_aspect_ratio">Seitenverhältnis</string>
138 <string name="renderer_scaling_filter">Fensteranpassungsfilter</string>
139 <string name="renderer_anti_aliasing">Kantenglättungs-Methode</string>
140 <string name="renderer_force_max_clock">Maximale Taktfrequenz erzwingen (nur Adreno)</string>
141 <string name="renderer_force_max_clock_description">Erzwingt den Betrieb der GPU mit der maximal möglichen Taktfrequenz (Temperaturbeschränkungen werden weiterhin angewendet).</string>
142 <string name="renderer_asynchronous_shaders">Asynchrone Shader nutzen</string>
143 <string name="renderer_asynchronous_shaders_description">Kompiliert Shader asynchron, was Ruckler reduziert, aber zu Glitches führen kann.</string>
144 <string name="renderer_debug">Grafik-Debugging aktivieren</string>
145 <string name="renderer_debug_description">Wenn aktiviert, schaltet die Grafik-API in einen langsameren Debugging-Modus.</string>
146 <string name="use_disk_shader_cache">Nutze Festplatten-Shader-Cache</string>
147 <string name="use_disk_shader_cache_description">Ruckeln wird durch das Speichern und Laden von generierten Shadern auf der Festplatte reduziert.</string>
148
149 <!-- Audio settings strings -->
150 <string name="audio_volume">Lautstärke</string>
151 <string name="audio_volume_description">Legt die Lautstärke der Audioausgabe fest.</string>
152
153 <!-- Miscellaneous -->
154 <string name="slider_default">Standard</string>
155 <string name="ini_saved">Einstellungen gespeichert</string>
156 <string name="gameid_saved">Einstellungen für %1$s gespeichert</string>
157 <string name="error_saving">Fehler beim Speichern von %1$s.ini: %2$s</string>
158 <string name="loading">Lädt...</string>
159 <string name="reset_setting_confirmation">Möchtest du diese Einstellung auf den Standardwert zurücksetzen?</string>
160 <string name="reset_to_default">Auf Standard zurücksetzen</string>
161 <string name="reset_all_settings">Alle Einstellungen zurücksetzen?</string>
162 <string name="reset_all_settings_description">Alle erweiterten Einstellungen werden auf ihren Standardwert zurückgesetzt. Dies kann nicht rückgängig gemacht werden.</string>
163 <string name="settings_reset">Einstellungen zurückgesetzt</string>
164 <string name="close">Schließen</string>
165 <string name="learn_more">Mehr erfahren</string>
166
167 <!-- GPU driver installation -->
168 <string name="select_gpu_driver">GPU-Treiber auswählen</string>
169 <string name="select_gpu_driver_title">Möchtest du deinen aktuellen GPU-Treiber ersetzen?</string>
170 <string name="select_gpu_driver_install">Installieren</string>
171 <string name="select_gpu_driver_default">Standard</string>
172 <string name="select_gpu_driver_install_success">%s wurde installiert</string>
173 <string name="select_gpu_driver_use_default">Standard GPU-Treiber wird verwendet</string>
174 <string name="select_gpu_driver_error">Ungültiger Treiber ausgewählt, Standard-Treiber wird verwendet!</string>
175 <string name="system_gpu_driver">System GPU-Treiber</string>
176 <string name="installing_driver">Treiber wird installiert...</string>
177
178 <!-- Preferences Screen -->
179 <string name="preferences_settings">Einstellungen</string>
180 <string name="preferences_general">Allgemein</string>
181 <string name="preferences_system">System</string>
182 <string name="preferences_graphics">Grafik</string>
183 <string name="preferences_audio">Audio</string>
184 <string name="preferences_theme">Theme und Farbe</string>
185
186 <!-- ROM loading errors -->
187 <string name="loader_error_encrypted">Das ROM ist verschlüsselt</string>
188 <string name="loader_error_encrypted_keys_description"><![CDATA[Bitte stelle sicher dass die <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-prodkeys-and-titlekeys\">prod.keys</a> Datei installiert ist, damit Spiele entschlüsselt werden können.]]></string>
189 <string name="loader_error_video_core">Bei der Initialisierung des Videokerns ist ein Fehler aufgetreten</string>
190 <string name="loader_error_video_core_description">Dies wird normalerweise durch einen inkompatiblen GPU-Treiber verursacht. Die Installation eines passenden GPU-Treibers kann dieses Problem beheben.</string>
191 <string name="loader_error_invalid_format">ROM konnte nicht geladen werden</string>
192 <string name="loader_error_file_not_found">ROM-Datei existiert nicht</string>
193
194 <!-- Emulation Menu -->
195 <string name="emulation_exit">Emulation beenden</string>
196 <string name="emulation_done">Fertig</string>
197 <string name="emulation_fps_counter">FPS Zähler</string>
198 <string name="emulation_toggle_controls">Steuerung umschalten</string>
199 <string name="emulation_rel_stick_center">Relative Stick-Mitte</string>
200 <string name="emulation_dpad_slide">DPad Slide</string>
201 <string name="emulation_haptics">Haptik</string>
202 <string name="emulation_show_overlay">Overlay anzeigen</string>
203 <string name="emulation_toggle_all">Alle umschalten</string>
204 <string name="emulation_control_adjust">Overlay anpassen</string>
205 <string name="emulation_control_scale">Größe</string>
206 <string name="emulation_control_opacity">Transparenz</string>
207 <string name="emulation_touch_overlay_reset">Overlay zurücksetzen</string>
208 <string name="emulation_touch_overlay_edit">Overlay bearbeiten</string>
209 <string name="emulation_pause">Emulation pausieren</string>
210 <string name="emulation_unpause">Emulation fortsetzen</string>
211 <string name="emulation_input_overlay">Overlay-Optionen</string>
212 <string name="emulation_game_loading">Spiel lädt…</string>
213
214 <string name="load_settings">Lädt Einstellungen...</string>
215
216 <!-- Software keyboard -->
217 <string name="software_keyboard">Software-Tastatur</string>
218
219 <!-- Errors and warnings -->
220 <string name="abort_button">Abbrechen</string>
221 <string name="continue_button">Fortsetzen</string>
222 <string name="system_archive_not_found">Systemarchiv nicht gefunden</string>
223 <string name="system_archive_general">Ein System-Archiv</string>
224 <string name="save_load_error">Speicher-/Ladefehler</string>
225 <string name="fatal_error">Schwerwiegender Fehler</string>
226 <string name="fatal_error_message">Ein schwerwiegender Fehler ist aufgetreten. Einzelheiten wurden im Log protokolliert.\nDas Fortsetzen der Emulation kann zu Abstürzen und Bugs führen.</string>
227 <string name="performance_warning">Das Deaktivieren dieser Einstellung führt zu erheblichen Leistungsverlusten! Für ein optimales Erlebnis wird empfohlen, sie aktiviert zu lassen.</string>
228
229 <!-- Region Names -->
230 <string name="region_japan">Japan</string>
231 <string name="region_usa">USA</string>
232 <string name="region_europe">Europa</string>
233 <string name="region_australia">Australien</string>
234 <string name="region_china">China</string>
235 <string name="region_korea">Korea</string>
236 <string name="region_taiwan">Taiwan</string>
237
238 <!-- Language Names -->
239 <string name="language_japanese">Japanisch (日本語)</string>
240 <string name="language_english">Englisch</string>
241 <string name="language_french">Französisch (Français)</string>
242 <string name="langauge_german">Deutsch (German)</string>
243 <string name="language_italian">Italienisch (Italiano)</string>
244 <string name="language_spanish">Spanisch (Español)</string>
245 <string name="language_chinese">Chinesisch (简体中文)</string>
246 <string name="language_korean">Koreanisch (한국어)</string>
247 <string name="language_dutch">Niederländisch (Nederlands)</string>
248 <string name="language_portuguese">Portugiesisch (Português)</string>
249 <string name="language_russian">Russisch (Русский)</string>
250 <string name="language_taiwanese">Taiwanesisch (台湾)</string>
251 <string name="language_british_english">Britisches Englisch</string>
252 <string name="language_canadian_french">Kanadisches Französisch (Français canadien)</string>
253 <string name="language_latin_american_spanish">Lateinamerikanisches Spanisch (Español latinoamericano)</string>
254 <string name="language_simplified_chinese">Vereinfachtes Chinesisch (简体中文)</string>
255 <string name="language_traditional_chinese">Traditionelles Chinesisch (正體中文)</string>
256 <string name="language_brazilian_portuguese">Brasilianisches Portugiesisch (Português do Brasil)</string>
257
258 <!-- Renderer APIs -->
259 <string name="renderer_vulkan">Vulkan</string>
260 <string name="renderer_none">Keiner</string>
261
262 <!-- Renderer Accuracy -->
263 <string name="renderer_accuracy_normal">Normal</string>
264 <string name="renderer_accuracy_high">Hoch</string>
265 <string name="renderer_accuracy_extreme">Extrem (Langsam)</string>
266
267 <!-- Resolutions -->
268 <string name="resolution_half">0.5X (360p/540p)</string>
269 <string name="resolution_three_quarter">0.75X (540p/810p)</string>
270 <string name="resolution_one">1X (720p/1080p)</string>
271 <string name="resolution_two">2X (1440p/2160p) (Langsam)</string>
272 <string name="resolution_three">3X (2160p/3240p) (Langsam)</string>
273 <string name="resolution_four">4X (2880p/4320p) (Langsam)</string>
274
275 <!-- Renderer VSync -->
276 <string name="renderer_vsync_immediate">Direkt (Aus)</string>
277 <string name="renderer_vsync_mailbox">Mailbox</string>
278 <string name="renderer_vsync_fifo">FIFO (An)</string>
279 <string name="renderer_vsync_fifo_relaxed">FIFO Relaxed</string>
280
281 <!-- Scaling Filters -->
282 <string name="scaling_filter_nearest_neighbor">Nächste-Nachbarn</string>
283 <string name="scaling_filter_bilinear">Bilinear</string>
284 <string name="scaling_filter_bicubic">Bikubisch</string>
285 <string name="scaling_filter_gaussian">Gaussian</string>
286 <string name="scaling_filter_scale_force">ScaleForce</string>
287 <string name="scaling_filter_fsr">AMD FidelityFX™ Super Resolution</string>
288
289 <!-- Anti-Aliasing -->
290 <string name="anti_aliasing_none">Keiner</string>
291 <string name="anti_aliasing_fxaa">FXAA</string>
292 <string name="anti_aliasing_smaa">SMAA</string>
293
294 <!-- Aspect Ratios -->
295 <string name="ratio_default">Standard (16:9)</string>
296 <string name="ratio_force_four_three">4:3 erzwingen</string>
297 <string name="ratio_force_twenty_one_nine">21:9 erzwingen</string>
298 <string name="ratio_force_sixteen_ten">Erzwinge 16:10</string>
299 <string name="ratio_stretch">Auf Fenster anpassen</string>
300
301 <!-- CPU Accuracy -->
302 <string name="cpu_accuracy_accurate">Akkurat</string>
303 <string name="cpu_accuracy_unsafe">Unsicher</string>
304 <string name="cpu_accuracy_paranoid">Paranoid (Langsam)</string>
305
306 <!-- Gamepad Buttons -->
307 <string name="gamepad_d_pad">Steuerkreuz</string>
308 <string name="gamepad_left_stick">Linker Analogstick</string>
309 <string name="gamepad_right_stick">Rechter Analogstick</string>
310 <string name="gamepad_home">Home</string>
311 <string name="gamepad_screenshot">Screenshot</string>
312
313 <!-- Disk shader cache -->
314 <string name="preparing_shaders">Shader werden vorbereitet</string>
315 <string name="building_shaders">Shader werden erstellt</string>
316
317 <!-- Theme options -->
318 <string name="change_app_theme">App-Theme ändern</string>
319 <string name="theme_default">Standard</string>
320 <string name="theme_material_you">Material You</string>
321
322 <!-- Theme Modes -->
323 <string name="change_theme_mode">Theme-Modus ändern</string>
324 <string name="theme_mode_follow_system">System folgen</string>
325 <string name="theme_mode_light">Hell</string>
326 <string name="theme_mode_dark">Dunkel</string>
327
328 <!-- Black backgrounds theme -->
329 <string name="use_black_backgrounds">Schwarze Hintergünde verwenden</string>
330 <string name="use_black_backgrounds_description">Bei Verwendung des dunklen Themes, schwarze Hintergründe verwenden.</string>
331
332</resources>
diff --git a/src/android/app/src/main/res/values-es/strings.xml b/src/android/app/src/main/res/values-es/strings.xml
new file mode 100644
index 000000000..986e80e50
--- /dev/null
+++ b/src/android/app/src/main/res/values-es/strings.xml
@@ -0,0 +1,337 @@
1<?xml version="1.0" encoding="utf-8"?>
2<resources>
3
4 <string name="app_disclaimer">Este software ejecuta juegos para la videoconsola Nintendo Switch. Los videojuegos o keys no vienen incluidos.&lt;br /&gt;&lt;br /&gt;Antes de empezar, por favor, localice el archivo <![CDATA[<b> prod.keys </b>]]>en el almacenamiento de su dispositivo..&lt;br /&gt;&lt;br /&gt;<![CDATA[<a href=\"https://yuzu-emu.org/help/quickstart\">Saber más</a>]]></string>
5 <string name="emulation_notification_channel_name">Emulación activa</string>
6 <string name="emulation_notification_channel_description">Muestra una notificación persistente cuando la emulación está activa.</string>
7 <string name="emulation_notification_running">yuzu esta ejecutándose</string>
8 <string name="notice_notification_channel_name">Avisos y errores</string>
9 <string name="notice_notification_channel_description">Mostrar notificaciones cuándo algo vaya mal.</string>
10 <string name="notification_permission_not_granted">¡Permisos de notificación no concedidos!</string>
11
12 <!-- Setup strings -->
13 <string name="welcome">¡Bienvenido!</string>
14 <string name="welcome_description">Aprende cómo configurar &lt;b>yuzu&lt;/b> y avanza a la emulación.</string>
15 <string name="get_started">Empezar</string>
16 <string name="keys">Claves</string>
17 <string name="keys_description">Selecciona el archivo &lt;b>prod.keys&lt;/b> utilizando el botón de abajo.</string>
18 <string name="select_keys">Seleccionar las claves</string>
19 <string name="games">Juegos</string>
20 <string name="games_description">Selecciona la carpeta &lt;b>Games&lt;/b> utilizando el botón de abajo</string>
21 <string name="done">Hecho</string>
22 <string name="done_description">Todo listo.\n¡Disfrute de sus juegos!</string>
23 <string name="text_continue">Continuar</string>
24 <string name="next">Siguiente</string>
25 <string name="back">Atrás</string>
26 <string name="add_games">Añadir Juegos</string>
27 <string name="add_games_description">Selecciona la carpeta de juegos</string>
28
29 <!-- Home strings -->
30 <string name="home_games">Juegos</string>
31 <string name="home_search">Buscar</string>
32 <string name="home_settings">Ajustes</string>
33 <string name="empty_gamelist">No se ha encontrado ningún archivo o aún no se ha seleccionado ningún directorio de juegos.</string>
34 <string name="search_and_filter_games">Busca y filtra juegos</string>
35 <string name="select_games_folder">Seleccionar carpeta de juegos</string>
36 <string name="select_games_folder_description">Permite que yuzu llene la lista de juegos</string>
37 <string name="add_games_warning">¿Omitir la selección de la carpeta de juegos?</string>
38 <string name="add_games_warning_description">No se mostrará ningún juego si no se ha seleccionado una carpeta de juegos.</string>
39 <string name="add_games_warning_help">https://yuzu-emu.org/help/quickstart/#dumping-games</string>
40 <string name="home_search_games">Buscar Juegos</string>
41 <string name="games_dir_selected">Directorio de juegos seleccionado</string>
42 <string name="install_prod_keys">Instalar prod.keys</string>
43 <string name="install_prod_keys_description">Requerido para descifrar juegos</string>
44 <string name="install_prod_keys_warning">¿Omitir agregar claves?</string>
45 <string name="install_prod_keys_warning_description">Se requieren claves válidas para emular juegos. Solo las aplicaciones homebrew funcionarán si continúas.</string>
46 <string name="install_prod_keys_warning_help">https://yuzu-emu.org/help/quickstart/#guide-introduction</string>
47 <string name="notifications">Notificaciones</string>
48 <string name="notifications_description">Otorgue el permiso de notificación con el botón de abajo.</string>
49 <string name="give_permission">Conceder permiso</string>
50 <string name="notification_warning">¿Omitir conceder el permiso de notificación?</string>
51 <string name="notification_warning_description">yuzu no podrá notificarte información importante.</string>
52 <string name="permission_denied">Permiso denegado</string>
53 <string name="permission_denied_description">Negó este permiso demasiadas veces y ahora debe otorgarlo manualmente en la configuración del sistema.</string>
54 <string name="about">Acerca de</string>
55 <string name="about_description">Versión, créditos y más</string>
56 <string name="warning_help">Ayuda</string>
57 <string name="warning_skip">Siguiente</string>
58 <string name="warning_cancel">Cancelar</string>
59 <string name="install_amiibo_keys">Instalar clave de Amiiboo</string>
60 <string name="install_amiibo_keys_description">Necesario para usar Amiibo en el juego</string>
61 <string name="invalid_keys_file">Archivo de claves inválido seleccionado</string>
62 <string name="install_keys_success">Claves instaladas correctamente</string>
63 <string name="reading_keys_failure">Error al leer las claves de cifrado</string>
64 <string name="invalid_keys_error">Claves de cifrado no válidas</string>
65 <string name="dumping_keys_quickstart_link">https://yuzu-emu.org/help/quickstart/#dumping-decryption-keys</string>
66 <string name="install_keys_failure_description">El archivo seleccionado es incorrecto o está corrupto. Vuelva a redumpear sus claves.</string>
67 <string name="install_gpu_driver">Instalar driver de GPU</string>
68 <string name="install_gpu_driver_description">Instale drivers alternativos para obtener un rendimiento o una precisión potencialmente mejores</string>
69 <string name="advanced_settings">Opciones avanzadas</string>
70 <string name="settings_description">Configurar las opciones del emulador</string>
71 <string name="search_recently_played">Jugado recientemente</string>
72 <string name="search_recently_added">Añadido recientemente</string>
73 <string name="search_retail">Juegos</string>
74 <string name="search_homebrew">Homebrew</string>
75 <string name="open_user_folder">Abrir la carpeta de yuzu</string>
76 <string name="open_user_folder_description">Administrar los archivos internos de yuzu</string>
77 <string name="theme_and_color_description">Modificar la apariencia de la aplicación</string>
78 <string name="no_file_manager">Explorador de archivos no encontrado</string>
79 <string name="notification_no_directory_link">No se pudo abrir la carpeta yuzu</string>
80 <string name="notification_no_directory_link_description">Por favor, busque la carpeta user con el panel lateral del explorador de archivos de forma manual.</string>
81 <string name="manage_save_data">Administrar datos de guardado</string>
82 <string name="manage_save_data_description">Guardar los datos encontrados. Por favor, seleccione una opción de abajo.</string>
83 <string name="import_export_saves_description">Importar o exportar archivos de guardado</string>
84 <string name="import_export_saves_no_profile">No se han encontrado datos de guardado. Por favor, ejecute un juego y vuelva a intentarlo.</string>
85 <string name="save_file_imported_success">Importado correctamente</string>
86 <string name="save_file_invalid_zip_structure">Estructura del directorio de guardado no válido</string>
87 <string name="save_file_invalid_zip_structure_description">El nombre de la primera subcarpeta debe ser el Title ID del juego.</string>
88 <string name="import_saves">Importar</string>
89 <string name="export_saves">Exportar</string>
90
91 <!-- About screen strings -->
92 <string name="gaia_is_not_real">Gaia no es real</string>
93 <string name="copied_to_clipboard">Copiado al portapapeles</string>
94 <string name="about_app_description">Un emulador de Switch de código abierto</string>
95 <string name="contributors">Contribuidores</string>
96 <string name="contributors_description">Hecho con \u2764 del equipo yuzu</string>
97 <string name="contributors_link">https://github.com/yuzu-emu/yuzu/graphs/contributors</string>
98 <string name="build">Versión</string>
99 <string name="support_link">https://discord.gg/u77vRWY</string>
100 <string name="website_link">https://yuzu-emu.org/</string>
101 <string name="github_link">https://github.com/yuzu-emu</string>
102
103 <!-- Early access upgrade strings -->
104 <string name="early_access">Early Access</string>
105 <string name="get_early_access">Conseguir Early Access</string>
106 <string name="play_store_link">https://play.google.com/store/apps/details?id=org.yuzu.yuzu_emu.ea</string>
107 <string name="get_early_access_description">Funciones de vanguardia, acceso anticipado a actualizaciones y más</string>
108 <string name="early_access_benefits">Beneficios Early Access</string>
109 <string name="cutting_edge_features">Características de vanguardia</string>
110 <string name="early_access_updates">Acceso anticipado a las actualizaciones</string>
111 <string name="no_manual_installation">Sin instalación manual</string>
112 <string name="prioritized_support">Soporte prioritario</string>
113 <string name="helping_game_preservation">Ayudarás a la preservación de juegos</string>
114 <string name="our_eternal_gratitude">Nuestra eterna gratitud</string>
115 <string name="are_you_interested">¿Estás interesado?</string>
116
117 <!-- General settings strings -->
118 <string name="frame_limit_enable">Activar limite de velocidad</string>
119 <string name="frame_limit_enable_description">Cuando está habilitado, la velocidad de emulación se limitará a un porcentaje específico de la velocidad normal.</string>
120 <string name="frame_limit_slider">Limitar porcentaje de velocidad</string>
121 <string name="frame_limit_slider_description">Especifica el porcentaje para limitar la velocidad de emulación. Con el valor predeterminado del 100 %, la emulación se limitará a la velocidad normal. Valores más altos o más bajos aumentarán o disminuirán el límite de velocidad.</string>
122 <string name="cpu_accuracy">Precisión de CPU</string>
123
124 <!-- System settings strings -->
125 <string name="use_docked_mode">Modo sobremesa</string>
126 <string name="use_docked_mode_description">Emula en modo sobremesa, lo que aumenta la resolución perjudicando el rendimiento.</string>
127 <string name="emulated_region">Región emulada</string>
128 <string name="emulated_language">Idioma emulado</string>
129 <string name="select_rtc_date">Seleccionar Fecha RTC</string>
130 <string name="select_rtc_time">Seleccionar Tiempo RTC</string>
131 <string name="use_custom_rtc">Habilitar RTC Personalizado</string>
132 <string name="use_custom_rtc_description">Esta configuración le permite configurar un reloj de tiempo real personalizado diferente a la hora actual de su sistema</string>
133 <string name="set_custom_rtc">Establecer RTC Personalizado</string>
134
135 <!-- Graphics settings strings -->
136 <string name="renderer_api">API</string>
137 <string name="renderer_accuracy">Nivel de precisión</string>
138 <string name="renderer_resolution">Resolución</string>
139 <string name="renderer_vsync">Modo VSync</string>
140 <string name="renderer_aspect_ratio">Relación de aspecto</string>
141 <string name="renderer_scaling_filter">Filtro de adaptación de ventana</string>
142 <string name="renderer_anti_aliasing">Metodo Anti Aliasing</string>
143 <string name="renderer_force_max_clock">Forzar velocidad al máximo (solo Adreno)</string>
144 <string name="renderer_force_max_clock_description">Fuerza a la GPU a ejecutarse a la velocidad máxima de reloj posible (se seguirán aplicando restricciones térmicas).</string>
145 <string name="renderer_asynchronous_shaders">Usar shaders asíncronos</string>
146 <string name="renderer_asynchronous_shaders_description">Compila shaders de forma asincrónica, lo que reducirá los parones pero puede introducir fallos.</string>
147 <string name="renderer_debug">Habilitar la depuración de gráficos</string>
148 <string name="renderer_debug_description">Cuando esté marcado, la API de gráficos entra en un modo de depuración más lento.</string>
149 <string name="use_disk_shader_cache">Usar caché de shaders en disco</string>
150 <string name="use_disk_shader_cache_description">Reduzca los parones almacenando y cargando shaders generados en el disco.</string>
151
152 <!-- Audio settings strings -->
153 <string name="audio_volume">Volumen</string>
154 <string name="audio_volume_description">Especifica el volumen de la salida de audio.</string>
155
156 <!-- Miscellaneous -->
157 <string name="slider_default">Predeterminado</string>
158 <string name="ini_saved">Configuración guardada</string>
159 <string name="gameid_saved">Configuración guardada para %1$s</string>
160 <string name="error_saving">Error guardando %1$s.ini: %2$s</string>
161 <string name="loading">Cargando...</string>
162 <string name="reset_setting_confirmation">¿Desea restablecer esta configuración a su valor predeterminado?</string>
163 <string name="reset_to_default">Restablecer a predeterminado</string>
164 <string name="reset_all_settings">¿Restablecer todas las configuraciones?</string>
165 <string name="reset_all_settings_description">Todas las configuraciones avanzadas se restablecerán a su configuración predeterminada. Esto no se puede deshacer.</string>
166 <string name="settings_reset">Reiniciar la configuracion</string>
167 <string name="close">Cerrar</string>
168 <string name="learn_more">Más información</string>
169
170 <!-- GPU driver installation -->
171 <string name="select_gpu_driver">Seleccionar driver GPU</string>
172 <string name="select_gpu_driver_title">¿Quiere reemplazar el driver de GPU actual?</string>
173 <string name="select_gpu_driver_install">Instalar</string>
174 <string name="select_gpu_driver_default">Predeterminado</string>
175 <string name="select_gpu_driver_install_success">Instalado %s</string>
176 <string name="select_gpu_driver_use_default">Usando el driver de GPU por defecto </string>
177 <string name="select_gpu_driver_error">¡Driver no válido, utilizando el predeterminado del sistema!</string>
178 <string name="system_gpu_driver">Driver GPU del sistema</string>
179 <string name="installing_driver">Instalando driver...</string>
180
181 <!-- Preferences Screen -->
182 <string name="preferences_settings">Ajustes</string>
183 <string name="preferences_general">General</string>
184 <string name="preferences_system">Sistema</string>
185 <string name="preferences_graphics">Gráficos</string>
186 <string name="preferences_audio">Audio</string>
187 <string name="preferences_theme">Tema y color</string>
188
189 <!-- ROM loading errors -->
190 <string name="loader_error_encrypted">Su ROM está encriptada</string>
191 <string name="loader_error_encrypted_roms_description"><![CDATA[Por favor, siga las guías para redumpear <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-cartridge-games\">cartuchos de juegos</a> o <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-installed-titles-eshop\">titulos instalados</a>.]]></string>
192 <string name="loader_error_encrypted_keys_description"><![CDATA[Por favor, compruebe que su archivo <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-prodkeys-and-titlekeys\">prod.keys</a> está instalado, para que los juegos sean descifrados.]]></string>
193 <string name="loader_error_video_core">Ocurrió un error al inicializar el núcleo de video, posiblemente debido a una incompatibilidad con el driver seleccionado</string>
194 <string name="loader_error_video_core_description">Esto suele deberse a un driver de GPU incompatible. La instalación de un controlador de GPU personalizado puede resolver este problema.</string>
195 <string name="loader_error_invalid_format">No se pudo cargar la ROM</string>
196 <string name="loader_error_file_not_found">Archivo ROM no existe</string>
197
198 <!-- Emulation Menu -->
199 <string name="emulation_exit">Salir de la emulación</string>
200 <string name="emulation_done">Hecho</string>
201 <string name="emulation_fps_counter">Contador de FPS</string>
202 <string name="emulation_toggle_controls">Alternar Controles</string>
203 <string name="emulation_rel_stick_center">Centro Relativo del Stick</string>
204 <string name="emulation_dpad_slide">Deslizamiento de la Cruceta</string>
205 <string name="emulation_haptics">Hápticos</string>
206 <string name="emulation_show_overlay">Mostrar pantalla</string>
207 <string name="emulation_toggle_all">Alternar Todo</string>
208 <string name="emulation_control_adjust">Ajustar pantalla</string>
209 <string name="emulation_control_scale">Escala</string>
210 <string name="emulation_control_opacity">Opacidad</string>
211 <string name="emulation_touch_overlay_reset">Reiniciar pantalla</string>
212 <string name="emulation_touch_overlay_edit">Editar pantalla</string>
213 <string name="emulation_pause">Pausar Emulación</string>
214 <string name="emulation_unpause">Reanudar Emulación</string>
215 <string name="emulation_input_overlay">Opciones de pantalla </string>
216 <string name="emulation_game_loading">Cargando juego...</string>
217
218 <string name="load_settings">Cargando configuración...</string>
219
220 <!-- Software keyboard -->
221 <string name="software_keyboard">Software del teclado</string>
222
223 <!-- Errors and warnings -->
224 <string name="abort_button">Abortar</string>
225 <string name="continue_button">Continuar</string>
226 <string name="system_archive_not_found">Archivo del sistema no encontrado</string>
227 <string name="system_archive_not_found_message">%s no se ha encontrado. Vacíe los archivos de su sistema.\nContinuar con la emulación puede provocar bloqueos y errores.</string>
228 <string name="system_archive_general">Un archivo del sistema</string>
229 <string name="save_load_error">Error de Guardado/Carga</string>
230 <string name="fatal_error">Error fatal</string>
231 <string name="fatal_error_message">Ocurrió un error fatal. Consulte el registro para obtener más detalles.\nContinuar con la emulación puede provocar bloqueos y errores.</string>
232 <string name="performance_warning">¡Desactivar esta configuración reducirá significativamente el rendimiento de la emulación! Para obtener la mejor experiencia, se recomienda dejar esta configuración habilitada.</string>
233
234 <!-- Region Names -->
235 <string name="region_japan">Japón</string>
236 <string name="region_usa">EEUU</string>
237 <string name="region_europe">Europa</string>
238 <string name="region_australia">Australia</string>
239 <string name="region_china">China</string>
240 <string name="region_korea">Corea</string>
241 <string name="region_taiwan">Taiwán</string>
242
243 <!-- Language Names -->
244 <string name="language_japanese">Japonés (日本語)</string>
245 <string name="language_english">Inglés (English)</string>
246 <string name="language_french">Francés (Français)</string>
247 <string name="langauge_german">Alemán (deutsch)</string>
248 <string name="language_italian">Italiano (Italiano)</string>
249 <string name="language_spanish">Español (Español)</string>
250 <string name="language_chinese">Chino (简体中文)</string>
251 <string name="language_korean">Coreano (한국어)</string>
252 <string name="language_dutch">Holandés (nederlands)</string>
253 <string name="language_portuguese">Portugués (Português)</string>
254 <string name="language_russian">Ruso (Русский)</string>
255 <string name="language_taiwanese">Taiwanés (台湾)</string>
256 <string name="language_british_english">Inglés británico</string>
257 <string name="language_canadian_french">Francés Canadiense (Français canadien)</string>
258 <string name="language_latin_american_spanish">Español Latinoamericano (Español latinoamericano)</string>
259 <string name="language_simplified_chinese">Chino Simplificado (简体中文)</string>
260 <string name="language_traditional_chinese">Chino tradicional (正體中文)</string>
261 <string name="language_brazilian_portuguese">Portugués Brasileño (Português do Brasil)</string>
262
263 <!-- Renderer APIs -->
264 <string name="renderer_vulkan">Vulkan</string>
265 <string name="renderer_none">Ninguno</string>
266
267 <!-- Renderer Accuracy -->
268 <string name="renderer_accuracy_normal">Normal</string>
269 <string name="renderer_accuracy_high">Alto</string>
270 <string name="renderer_accuracy_extreme">Extremo (Lento)</string>
271
272 <!-- Resolutions -->
273 <string name="resolution_half">0.5X (360p/540p)</string>
274 <string name="resolution_three_quarter">0.75X (540p/810p)</string>
275 <string name="resolution_one">x1 (720p/1080p)</string>
276 <string name="resolution_two">2X (1440p/2160p) (Lento)</string>
277 <string name="resolution_three">3X (2160p/3240p) (Lento)</string>
278 <string name="resolution_four">4X (2880p/4320p) (Lento)</string>
279
280 <!-- Renderer VSync -->
281 <string name="renderer_vsync_immediate">Inmediata (Desactivado)</string>
282 <string name="renderer_vsync_mailbox">Mailbox</string>
283 <string name="renderer_vsync_fifo">FIFO (Activado)</string>
284 <string name="renderer_vsync_fifo_relaxed">FIFO Relajado</string>
285
286 <!-- Scaling Filters -->
287 <string name="scaling_filter_nearest_neighbor">Vecino más próximo</string>
288 <string name="scaling_filter_bilinear">Bilineal</string>
289 <string name="scaling_filter_bicubic">Bicúbico</string>
290 <string name="scaling_filter_gaussian">Gaussiano</string>
291 <string name="scaling_filter_scale_force">ScaleForce</string>
292 <string name="scaling_filter_fsr">AMD FidelityFX™ Super Resolución</string>
293
294 <!-- Anti-Aliasing -->
295 <string name="anti_aliasing_none">Ninguno</string>
296 <string name="anti_aliasing_fxaa">FXAA</string>
297 <string name="anti_aliasing_smaa">SMAA</string>
298
299 <!-- Aspect Ratios -->
300 <string name="ratio_default">Predeterminado (16:9)</string>
301 <string name="ratio_force_four_three">Forzar 4:3</string>
302 <string name="ratio_force_twenty_one_nine">Forzar 21:9</string>
303 <string name="ratio_force_sixteen_ten">Forzar 16:10</string>
304 <string name="ratio_stretch">Ajustar a la ventana</string>
305
306 <!-- CPU Accuracy -->
307 <string name="cpu_accuracy_accurate">Preciso</string>
308 <string name="cpu_accuracy_unsafe">Impreciso</string>
309 <string name="cpu_accuracy_paranoid">Paranoico (Lento)</string>
310
311 <!-- Gamepad Buttons -->
312 <string name="gamepad_d_pad">Cruceta</string>
313 <string name="gamepad_left_stick">Palanca izquierda</string>
314 <string name="gamepad_right_stick">Palanca derecha</string>
315 <string name="gamepad_home">Home</string>
316 <string name="gamepad_screenshot">Captura de pantalla</string>
317
318 <!-- Disk shader cache -->
319 <string name="preparing_shaders">Preparando shaders</string>
320 <string name="building_shaders">Construyendo shaders</string>
321
322 <!-- Theme options -->
323 <string name="change_app_theme">Cambiar Tema</string>
324 <string name="theme_default">Predeterminado</string>
325 <string name="theme_material_you">Material You</string>
326
327 <!-- Theme Modes -->
328 <string name="change_theme_mode">Cambiar modo del tema</string>
329 <string name="theme_mode_follow_system">Igual al sistema</string>
330 <string name="theme_mode_light">Claro</string>
331 <string name="theme_mode_dark">Oscuro</string>
332
333 <!-- Black backgrounds theme -->
334 <string name="use_black_backgrounds">Usar Fondos Negros</string>
335 <string name="use_black_backgrounds_description">Cuando utilice el modo oscuro, aplique fondos negros.</string>
336
337</resources>
diff --git a/src/android/app/src/main/res/values-fr/strings.xml b/src/android/app/src/main/res/values-fr/strings.xml
new file mode 100644
index 000000000..14a9b2d5c
--- /dev/null
+++ b/src/android/app/src/main/res/values-fr/strings.xml
@@ -0,0 +1,337 @@
1<?xml version="1.0" encoding="utf-8"?>
2<resources>
3
4 <string name="app_disclaimer">Ce logiciel exécutera des jeux pour la console de jeu Nintendo Switch. Aucun jeux ou clés n\'est inclus.&lt;br /&gt;&lt;br /&gt;Avant de commencer, veuillez localiser votre fichier <![CDATA[<b> prod.keys </b>]]> sur le stockage de votre appareil.&lt;br /&gt;&lt;br /&gt;<![CDATA[<a href=\"https://yuzu-emu.org/help/quickstart\">En savoir plus</a>]]></string>
5 <string name="emulation_notification_channel_name">L\'émulation est active</string>
6 <string name="emulation_notification_channel_description">Affiche une notification persistante lorsque l\'émulation est en cours d\'exécution.</string>
7 <string name="emulation_notification_running">yuzu est en cours d\'exécution</string>
8 <string name="notice_notification_channel_name">Avis et erreurs</string>
9 <string name="notice_notification_channel_description">Affiche des notifications en cas de problème.</string>
10 <string name="notification_permission_not_granted">Permission de notification non accordée !</string>
11
12 <!-- Setup strings -->
13 <string name="welcome">Bienvenue !</string>
14 <string name="welcome_description">Apprenez à configurer &lt;b>yuzu&lt;/b> et passez à l\'émulation.</string>
15 <string name="get_started">Commencer</string>
16 <string name="keys">Clés</string>
17 <string name="keys_description">Sélectionnez votre fichier &lt;b>prod.keys&lt;/b> avec le bouton ci-dessous.</string>
18 <string name="select_keys">Sélectionner les clés</string>
19 <string name="games">Jeux</string>
20 <string name="games_description">Sélectionnez votre dossier &lt;b>de Jeux&lt;/b> avec le bouton ci-dessous.</string>
21 <string name="done">Terminé</string>
22 <string name="done_description">Vous êtes prêt.\nProfitez de vos jeux !</string>
23 <string name="text_continue">Continuer</string>
24 <string name="next">Suivant</string>
25 <string name="back">Retour</string>
26 <string name="add_games">Ajouter des jeux</string>
27 <string name="add_games_description">Sélectionner votre dossier de jeux</string>
28
29 <!-- Home strings -->
30 <string name="home_games">Jeux</string>
31 <string name="home_search">Rechercher</string>
32 <string name="home_settings">Paramètres</string>
33 <string name="empty_gamelist">Aucun fichier n\'a été trouvé ou aucun répertoire de jeu n\'a encore été sélectionné.</string>
34 <string name="search_and_filter_games">Rechercher et filtrer les jeux</string>
35 <string name="select_games_folder">Sélectionner le dossier de jeux</string>
36 <string name="select_games_folder_description">Permet à yuzu de remplir la liste des jeux</string>
37 <string name="add_games_warning">Ne pas sélectionner le dossier des jeux ?</string>
38 <string name="add_games_warning_description">Les jeux ne seront pas affichés dans la liste des jeux si aucun dossier n\'est sélectionné.</string>
39 <string name="add_games_warning_help">https://yuzu-emu.org/help/quickstart/#dumping-games</string>
40 <string name="home_search_games">Rechercher des jeux</string>
41 <string name="games_dir_selected">Répertoire de jeux sélectionné</string>
42 <string name="install_prod_keys">Installer prod.keys</string>
43 <string name="install_prod_keys_description">Nécessaire pour décrypter les jeux commerciaux.</string>
44 <string name="install_prod_keys_warning">Sauter l\'ajout des clés ?</string>
45 <string name="install_prod_keys_warning_description">Des clés valides sont nécessaires pour émuler des jeux commerciaux. Seules les applications homebrew fonctionneront si vous continuez.</string>
46 <string name="install_prod_keys_warning_help">https://yuzu-emu.org/help/quickstart/#guide-introduction</string>
47 <string name="notifications">Notifications</string>
48 <string name="notifications_description">Accordez l\'autorisation de notification avec le bouton ci-dessous.</string>
49 <string name="give_permission">Donner la permission</string>
50 <string name="notification_warning">Ne pas accorder la permission de notification ?</string>
51 <string name="notification_warning_description">yuzu ne pourra pas vous communiquer d\'informations importantes.</string>
52 <string name="permission_denied">Permission refusée</string>
53 <string name="permission_denied_description">Vous avez refusé cette permission trop de fois et vous devez maintenant l\'accorder manuellement dans les paramètres système.</string>
54 <string name="about">À propos</string>
55 <string name="about_description">Numéro de build, crédits et plus encore</string>
56 <string name="warning_help">Aide</string>
57 <string name="warning_skip">Sauter</string>
58 <string name="warning_cancel">Annuler</string>
59 <string name="install_amiibo_keys">Installer les clés Amiibo</string>
60 <string name="install_amiibo_keys_description">Nécessaire pour utiliser les Amiibo en jeu</string>
61 <string name="invalid_keys_file">Fichier de clés sélectionné invalide</string>
62 <string name="install_keys_success">Clés installées avec succès</string>
63 <string name="reading_keys_failure">Erreur lors de la lecture des clés de chiffrement</string>
64 <string name="invalid_keys_error">Clés de chiffrement invalides</string>
65 <string name="dumping_keys_quickstart_link">https://yuzu-emu.org/help/quickstart/#dumping-decryption-keys</string>
66 <string name="install_keys_failure_description">Le fichier sélectionné est incorrect ou corrompu. Veuillez dumper à nouveau vos clés.</string>
67 <string name="install_gpu_driver">Installer le pilote du GPU</string>
68 <string name="install_gpu_driver_description">Installez des pilotes alternatifs pour des performances ou une précision potentiellement meilleures</string>
69 <string name="advanced_settings">Paramètres avancés</string>
70 <string name="settings_description">Configurer les paramètres de l\'émulateur</string>
71 <string name="search_recently_played">Joué récemment</string>
72 <string name="search_recently_added">Ajouté récemment</string>
73 <string name="search_retail">Commercial</string>
74 <string name="search_homebrew">Homebrew</string>
75 <string name="open_user_folder">Ouvrir le dossier de yuzu</string>
76 <string name="open_user_folder_description">Gérer les fichiers internes de yuzu</string>
77 <string name="theme_and_color_description">Modifier l\'apparence de l\'application</string>
78 <string name="no_file_manager">Aucun gestionnaire de fichiers trouvé</string>
79 <string name="notification_no_directory_link">Impossible d\'ouvrir le répertoire de yuzu</string>
80 <string name="notification_no_directory_link_description">Veuillez localiser manuellement le dossier utilisateur avec le panneau latéral du gestionnaire de fichiers.</string>
81 <string name="manage_save_data">Gérer les données de sauvegarde</string>
82 <string name="manage_save_data_description">Données de sauvegarde trouvées. Veuillez sélectionner une option ci-dessous.</string>
83 <string name="import_export_saves_description">Importer ou exporter des fichiers de sauvegarde</string>
84 <string name="import_export_saves_no_profile">Aucune données de sauvegarde trouvées. Veuillez lancer un jeu et réessayer.</string>
85 <string name="save_file_imported_success">Importé avec succès</string>
86 <string name="save_file_invalid_zip_structure">Structure de répertoire de sauvegarde non valide</string>
87 <string name="save_file_invalid_zip_structure_description">Le nom du premier sous-dossier doit être l\'identifiant du titre du jeu.</string>
88 <string name="import_saves">Importer</string>
89 <string name="export_saves">Exporter</string>
90
91 <!-- About screen strings -->
92 <string name="gaia_is_not_real">Gaia n\'est pas réel</string>
93 <string name="copied_to_clipboard">Copié dans le presse-papier</string>
94 <string name="about_app_description">Un émulateur Switch open source</string>
95 <string name="contributors">Contributeurs</string>
96 <string name="contributors_description">Fait avec \u2764 de l\'équipe yuzu</string>
97 <string name="contributors_link">https://github.com/yuzu-emu/yuzu/graphs/contributors</string>
98 <string name="build">Build</string>
99 <string name="support_link">https://discord.gg/u77vRWY</string>
100 <string name="website_link">https://yuzu-emu.org/</string>
101 <string name="github_link">https://github.com/yuzu-emu</string>
102
103 <!-- Early access upgrade strings -->
104 <string name="early_access">Early Access</string>
105 <string name="get_early_access">Obtenir l\'Early Access</string>
106 <string name="play_store_link">https://play.google.com/store/apps/details?id=org.yuzu.yuzu_emu.ea</string>
107 <string name="get_early_access_description">Fonctionnalités de pointe, accès anticipé aux mises à jour, et plus encore</string>
108 <string name="early_access_benefits">Avantages de l\'Early Access</string>
109 <string name="cutting_edge_features">Fonctionnalités de pointe</string>
110 <string name="early_access_updates">Accès anticipé aux mises à jour</string>
111 <string name="no_manual_installation">Pas d\'installation manuelle</string>
112 <string name="prioritized_support">Assistance prioritaire</string>
113 <string name="helping_game_preservation">Contribuer à la préservation des jeux</string>
114 <string name="our_eternal_gratitude">Notre gratitude éternelle</string>
115 <string name="are_you_interested">Es tu intéressé ?</string>
116
117 <!-- General settings strings -->
118 <string name="frame_limit_enable">Activer la vitesse limite</string>
119 <string name="frame_limit_enable_description">Lorsqu\'elle est activée, la vitesse d\'émulation sera limitée à un pourcentage spécifié de la vitesse normale.</string>
120 <string name="frame_limit_slider">Limite en pourcentage de vitesse</string>
121 <string name="frame_limit_slider_description">Spécifie le pourcentage pour limiter la vitesse d\'émulation. Avec la valeur par défaut de 100%, l\'émulation sera limitée à la vitesse normale. Des valeurs supérieures ou inférieures augmenteront ou diminueront la limite de vitesse.</string>
122 <string name="cpu_accuracy">Précision du CPU</string>
123
124 <!-- System settings strings -->
125 <string name="use_docked_mode">Mode TV</string>
126 <string name="use_docked_mode_description">Émuler en mode TV augmente la résolution au détriment des performances.</string>
127 <string name="emulated_region">Région émulée</string>
128 <string name="emulated_language">Langue émulée</string>
129 <string name="select_rtc_date">Sélectionner la date RTC</string>
130 <string name="select_rtc_time">Sélectionner l\'heure RTC</string>
131 <string name="use_custom_rtc">Activer l\'horloge RTC personnalisée</string>
132 <string name="use_custom_rtc_description">Ce paramètre vous permet de définir une horloge en temps réel personnalisée distincte de l\'heure actuelle de votre système.</string>
133 <string name="set_custom_rtc">Définir l\'horloge RTC personnalisée</string>
134
135 <!-- Graphics settings strings -->
136 <string name="renderer_api">API</string>
137 <string name="renderer_accuracy">Niveau de précision</string>
138 <string name="renderer_resolution">Résolution</string>
139 <string name="renderer_vsync">Mode VSync</string>
140 <string name="renderer_aspect_ratio">Format</string>
141 <string name="renderer_scaling_filter">Filtre de fenêtre adaptatif</string>
142 <string name="renderer_anti_aliasing">Méthode d\'anticrénelage :</string>
143 <string name="renderer_force_max_clock">Forcer la fréquence d\'horloge maximale (Adreno uniquement)</string>
144 <string name="renderer_force_max_clock_description">Force le GPU à fonctionner au maximum d\'horloges possibles (les contraintes thermiques seront toujours appliquées).</string>
145 <string name="renderer_asynchronous_shaders">Utiliser les shaders asynchrones</string>
146 <string name="renderer_asynchronous_shaders_description">Compile les shaders de manière asynchrone, ce qui réduira les saccades mais peut entraîner des problèmes visuels.</string>
147 <string name="renderer_debug">Activer le débogage des graphismes</string>
148 <string name="renderer_debug_description">Lorsque cette case est cochée, l\'API graphique entre dans un mode de débogage plus lent.</string>
149 <string name="use_disk_shader_cache">Utiliser les shader cache de disque</string>
150 <string name="use_disk_shader_cache_description">Réduire les saccades en stockant et en chargeant les shaders générés sur le disque.</string>
151
152 <!-- Audio settings strings -->
153 <string name="audio_volume">Volume</string>
154 <string name="audio_volume_description">Spécifie le volume de la sortie audio.</string>
155
156 <!-- Miscellaneous -->
157 <string name="slider_default">Défaut</string>
158 <string name="ini_saved">Paramètres enregistrés</string>
159 <string name="gameid_saved">Paramètres enregistrés pour %1$s</string>
160 <string name="error_saving">Erreur lors de l\'enregistrement de %1$s.ini: %2$s</string>
161 <string name="loading">Chargement...</string>
162 <string name="reset_setting_confirmation">Voulez-vous réinitialiser ce paramètre à sa valeur par défaut ?</string>
163 <string name="reset_to_default">Réinitialiser par défaut</string>
164 <string name="reset_all_settings">Réinitialiser tous les réglages ?</string>
165 <string name="reset_all_settings_description">Tous les paramètres avancés seront réinitialisés à leur configuration par défaut. Ça ne peut pas être annulé.</string>
166 <string name="settings_reset">Paramètres réinitialisés</string>
167 <string name="close">Fermer</string>
168 <string name="learn_more">Plus d\'informations</string>
169
170 <!-- GPU driver installation -->
171 <string name="select_gpu_driver">Sélectionner le pilote du GPU</string>
172 <string name="select_gpu_driver_title">Souhaitez vous remplacer votre pilote actuel ?</string>
173 <string name="select_gpu_driver_install">Installer</string>
174 <string name="select_gpu_driver_default">Défaut</string>
175 <string name="select_gpu_driver_install_success">%s Installé</string>
176 <string name="select_gpu_driver_use_default">Utilisation du pilote de GPU par défaut</string>
177 <string name="select_gpu_driver_error">Pilote non valide sélectionné, utilisation du paramètre par défaut du système !</string>
178 <string name="system_gpu_driver">Pilote du GPU du système</string>
179 <string name="installing_driver">Installation du pilote...</string>
180
181 <!-- Preferences Screen -->
182 <string name="preferences_settings">Paramètres</string>
183 <string name="preferences_general">Général</string>
184 <string name="preferences_system">Système</string>
185 <string name="preferences_graphics">Vidéo</string>
186 <string name="preferences_audio">Audio</string>
187 <string name="preferences_theme">Thème et couleur</string>
188
189 <!-- ROM loading errors -->
190 <string name="loader_error_encrypted">Votre ROM est cryptée</string>
191 <string name="loader_error_encrypted_roms_description"><![CDATA[Veuillez suivre les guides pour redumper vos <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-cartridge-games\">cartouches de jeu</a> ou <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-installed-titles-eshop\">titres installés</a>.]]></string>
192 <string name="loader_error_encrypted_keys_description"><![CDATA[Veuillez vous assurer que votre fichier <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-prodkeys-and-titlekeys\">prod.keys</a> est installé pour que les jeux puissent être déchiffrés.]]></string>
193 <string name="loader_error_video_core">Une erreur s\'est produite lors de l\'initialisation du noyau vidéo</string>
194 <string name="loader_error_video_core_description">Cela est généralement dû à un pilote du GPU incompatible. L\'installation d\'un pilote du GPU personnalisé peut résoudre ce problème.</string>
195 <string name="loader_error_invalid_format">Impossible de charger la ROM</string>
196 <string name="loader_error_file_not_found">Le fichier ROM n\'existe pas</string>
197
198 <!-- Emulation Menu -->
199 <string name="emulation_exit">Quitter l\'émulation</string>
200 <string name="emulation_done">Terminé</string>
201 <string name="emulation_fps_counter">Compteur FPS</string>
202 <string name="emulation_toggle_controls">Activer/Désactiver les contrôles</string>
203 <string name="emulation_rel_stick_center">Centre du stick relatif</string>
204 <string name="emulation_dpad_slide">Glissement du DPad</string>
205 <string name="emulation_haptics">Haptique</string>
206 <string name="emulation_show_overlay">Afficher l\'overlay</string>
207 <string name="emulation_toggle_all">Tout basculer</string>
208 <string name="emulation_control_adjust">Ajuster l\'overlay</string>
209 <string name="emulation_control_scale">Échelle</string>
210 <string name="emulation_control_opacity">Opacité</string>
211 <string name="emulation_touch_overlay_reset">Réinitialiser l\'overlay</string>
212 <string name="emulation_touch_overlay_edit">Modifier l\'overlay</string>
213 <string name="emulation_pause">Mettre en pause l\'émulation</string>
214 <string name="emulation_unpause">Reprendre l\'émulation</string>
215 <string name="emulation_input_overlay">Options de l\'overlay</string>
216 <string name="emulation_game_loading">Chargement du jeu...</string>
217
218 <string name="load_settings">Chargement des paramètres…</string>
219
220 <!-- Software keyboard -->
221 <string name="software_keyboard">Clavier virtuel</string>
222
223 <!-- Errors and warnings -->
224 <string name="abort_button">Abandonner</string>
225 <string name="continue_button">Continuer</string>
226 <string name="system_archive_not_found">Archive système introuvable</string>
227 <string name="system_archive_not_found_message">%s est manquant. Veuillez dumper vos archives système.\nContinuer peut entraîner des plantages et des bogues.</string>
228 <string name="system_archive_general">Une archive système</string>
229 <string name="save_load_error">Erreur de sauvegarde/chargement</string>
230 <string name="fatal_error">Erreur fatale</string>
231 <string name="fatal_error_message">Une erreur fatale s\'est produite. Consultez les logs pour plus de détails.\nContinuer l\'émulation peut entraîner des plantages et des bogues.</string>
232 <string name="performance_warning">La désactivation de ce paramètre réduira considérablement les performances d\'émulation ! Pour une expérience optimale, il est recommandé de laisser ce paramètre activé.</string>
233
234 <!-- Region Names -->
235 <string name="region_japan">Japon</string>
236 <string name="region_usa">É.-U.A.</string>
237 <string name="region_europe">Europe</string>
238 <string name="region_australia">Australie</string>
239 <string name="region_china">Chine</string>
240 <string name="region_korea">Corée</string>
241 <string name="region_taiwan">Taïwan</string>
242
243 <!-- Language Names -->
244 <string name="language_japanese">Japonais (日本語)</string>
245 <string name="language_english">Anglais</string>
246 <string name="language_french">Français (Français)</string>
247 <string name="langauge_german">Allemand (Deutsch)</string>
248 <string name="language_italian">Italien (Italiano)</string>
249 <string name="language_spanish">Espagnol (Español)</string>
250 <string name="language_chinese">Chinois (简体中文)</string>
251 <string name="language_korean">Coréen (한국어)</string>
252 <string name="language_dutch">Néerlandais (Nederlands)</string>
253 <string name="language_portuguese">Portugais (Português)</string>
254 <string name="language_russian">Russe (Русский)</string>
255 <string name="language_taiwanese">Taïwanais (台湾)</string>
256 <string name="language_british_english">Anglais Britannique</string>
257 <string name="language_canadian_french">Français canadien (Français canadien)</string>
258 <string name="language_latin_american_spanish">Espagnol latino-américain (Español latinoamericano)</string>
259 <string name="language_simplified_chinese">Chinois simplifié (简体中文)</string>
260 <string name="language_traditional_chinese">Chinois Traditionnel (正體中文)</string>
261 <string name="language_brazilian_portuguese">Portugais brésilien (Português do Brasil)</string>
262
263 <!-- Renderer APIs -->
264 <string name="renderer_vulkan">Vulkan</string>
265 <string name="renderer_none">Aucune</string>
266
267 <!-- Renderer Accuracy -->
268 <string name="renderer_accuracy_normal">Normal</string>
269 <string name="renderer_accuracy_high">Haut</string>
270 <string name="renderer_accuracy_extreme">Extrême (Lent)</string>
271
272 <!-- Resolutions -->
273 <string name="resolution_half">0.5X (360p/540p)</string>
274 <string name="resolution_three_quarter">0.75X (540p/810p)</string>
275 <string name="resolution_one">1X (720p/1080p)</string>
276 <string name="resolution_two">2X (1440p/2160p) (Lent)</string>
277 <string name="resolution_three">3X (2160p/3240p) (Lent)</string>
278 <string name="resolution_four">4X (2880p/4320p) (Lent)</string>
279
280 <!-- Renderer VSync -->
281 <string name="renderer_vsync_immediate">Immédiat (Désactivé)</string>
282 <string name="renderer_vsync_mailbox">Mailbox</string>
283 <string name="renderer_vsync_fifo">FIFO (Activé)</string>
284 <string name="renderer_vsync_fifo_relaxed">FIFO souple</string>
285
286 <!-- Scaling Filters -->
287 <string name="scaling_filter_nearest_neighbor">Plus proche voisin</string>
288 <string name="scaling_filter_bilinear">Bilinéaire</string>
289 <string name="scaling_filter_bicubic">Bicubique</string>
290 <string name="scaling_filter_gaussian">Gaussien</string>
291 <string name="scaling_filter_scale_force">ScaleForce</string>
292 <string name="scaling_filter_fsr">AMD FidelityFX™ Super Resolution</string>
293
294 <!-- Anti-Aliasing -->
295 <string name="anti_aliasing_none">Aucune</string>
296 <string name="anti_aliasing_fxaa">FXAA</string>
297 <string name="anti_aliasing_smaa">SMAA</string>
298
299 <!-- Aspect Ratios -->
300 <string name="ratio_default">Par défaut (16:9)</string>
301 <string name="ratio_force_four_three">Forcer le 4:3</string>
302 <string name="ratio_force_twenty_one_nine">Forcer le 21:9</string>
303 <string name="ratio_force_sixteen_ten">Forcer le 16:10</string>
304 <string name="ratio_stretch">Étirer à la fenêtre</string>
305
306 <!-- CPU Accuracy -->
307 <string name="cpu_accuracy_accurate">Précis</string>
308 <string name="cpu_accuracy_unsafe">Risqué</string>
309 <string name="cpu_accuracy_paranoid">Paranoïaque (Lent)</string>
310
311 <!-- Gamepad Buttons -->
312 <string name="gamepad_d_pad">Pavé directionnel</string>
313 <string name="gamepad_left_stick">Stick Gauche</string>
314 <string name="gamepad_right_stick">Stick Droit</string>
315 <string name="gamepad_home">Home</string>
316 <string name="gamepad_screenshot">Capture d\'écran</string>
317
318 <!-- Disk shader cache -->
319 <string name="preparing_shaders">Préparation des shaders</string>
320 <string name="building_shaders">Compilation des shaders</string>
321
322 <!-- Theme options -->
323 <string name="change_app_theme">Changer le thème de l\'application</string>
324 <string name="theme_default">Défaut</string>
325 <string name="theme_material_you">Material You</string>
326
327 <!-- Theme Modes -->
328 <string name="change_theme_mode">Changer le mode de thème</string>
329 <string name="theme_mode_follow_system">Automatique</string>
330 <string name="theme_mode_light">Lumineux</string>
331 <string name="theme_mode_dark">Sombre</string>
332
333 <!-- Black backgrounds theme -->
334 <string name="use_black_backgrounds">Utiliser des arrière-plans noirs</string>
335 <string name="use_black_backgrounds_description">Lorsque vous utilisez le thème sombre, appliquer des arrière-plans noirs.</string>
336
337</resources>
diff --git a/src/android/app/src/main/res/values-it/strings.xml b/src/android/app/src/main/res/values-it/strings.xml
new file mode 100644
index 000000000..47a4cfa31
--- /dev/null
+++ b/src/android/app/src/main/res/values-it/strings.xml
@@ -0,0 +1,337 @@
1<?xml version="1.0" encoding="utf-8"?>
2<resources>
3
4 <string name="app_disclaimer">Questo software permette di giocare ai giochi della console Nintendo Switch. Nessun gioco o chiave è inclusa.&lt;br /&gt;&lt;br /&gt;Prima di iniziare, perfavore individua il file <![CDATA[<b>prod.keys </b>]]> nella memoria del tuo dispositivo.&lt;br /&gt;&lt;br /&gt;<![CDATA[<a href=\"https://yuzu-emu.org/help/quickstart\">Scopri di più</a>]]></string>
5 <string name="emulation_notification_channel_name">L\'emulatore è attivo</string>
6 <string name="emulation_notification_channel_description">Mostra una notifica persistente quando l\'emulatore è in esecuzione.</string>
7 <string name="emulation_notification_running">yuzu è in esecuzione</string>
8 <string name="notice_notification_channel_name">Avvisi ed errori</string>
9 <string name="notice_notification_channel_description">Mostra le notifiche quando qualcosa va storto.</string>
10 <string name="notification_permission_not_granted">Autorizzazione di notifica non concessa!</string>
11
12 <!-- Setup strings -->
13 <string name="welcome">Benvenuto!</string>
14 <string name="welcome_description">Scopri come configurare &lt;b>yuzu&lt;/b> e passare all\'emulazione.</string>
15 <string name="get_started">Iniziare</string>
16 <string name="keys">Pulsanti</string>
17 <string name="keys_description">Seleziona il tuo file &lt;b>prod.keys&lt;/b> con il pulsante in basso.</string>
18 <string name="select_keys">Selezione Pulsanti</string>
19 <string name="games">Giochi</string>
20 <string name="games_description">Seleziona la cartella &lt;b>Games&lt;/b> con il pulsante in basso.</string>
21 <string name="done">Fatto</string>
22 <string name="done_description">È tutto pronto.\nDivertiti a giocare!</string>
23 <string name="text_continue">Continua</string>
24 <string name="next">Successivo</string>
25 <string name="back">Indietro</string>
26 <string name="add_games">Aggiungi giochi</string>
27 <string name="add_games_description">Seleziona la cartella dei giochi</string>
28
29 <!-- Home strings -->
30 <string name="home_games">Giochi</string>
31 <string name="home_search">Cerca</string>
32 <string name="home_settings">Impostazioni</string>
33 <string name="empty_gamelist">Non sono stati trovati file o non è stata ancora selezionata alcuna directory di gioco.</string>
34 <string name="search_and_filter_games">Cerca e filtra i giochi</string>
35 <string name="select_games_folder">Seleziona la cartella di gioco</string>
36 <string name="select_games_folder_description">Consente a yuzu di popolare l\'elenco dei giochi</string>
37 <string name="add_games_warning">Saltare la selezione della cartella dei giochi?</string>
38 <string name="add_games_warning_description">I giochi non saranno mostrati nella lista dei giochi se una cartella non è selezionata.</string>
39 <string name="add_games_warning_help">https://yuzu-emu.org/help/quickstart/#dumping-games</string>
40 <string name="home_search_games">Cerca giochi</string>
41 <string name="games_dir_selected">Cartella dei giochi selezionata</string>
42 <string name="install_prod_keys">Installa prod.keys</string>
43 <string name="install_prod_keys_description">Necessario per decrittografare i giochi</string>
44 <string name="install_prod_keys_warning">Saltare l\'aggiunta delle chiavi?</string>
45 <string name="install_prod_keys_warning_description">Sono necessarie delle chiavi valide per emulare i giochi. Se continui, funzioneranno solo le app homebrew.</string>
46 <string name="install_prod_keys_warning_help">https://yuzu-emu.org/help/quickstart/#guide-introduction</string>
47 <string name="notifications">Notifiche</string>
48 <string name="notifications_description">Concedi l\'autorizzazione alle notifiche con il pulsante in basso.</string>
49 <string name="give_permission">Concedere l\'autorizzazione</string>
50 <string name="notification_warning">Saltare la concessione dell\'autorizzazione alle notifiche?</string>
51 <string name="notification_warning_description">yuzu non sarà in grado di notificarti informazioni importanti.</string>
52 <string name="permission_denied">Permesso negato</string>
53 <string name="permission_denied_description">Hai negato l\'autorizzazione troppe volte ed ora devi concederla manualmente nelle impostazioni di sistema.</string>
54 <string name="about">Informazioni</string>
55 <string name="about_description">Versione build, crediti ed altro</string>
56 <string name="warning_help">Aiuto</string>
57 <string name="warning_skip">Salta</string>
58 <string name="warning_cancel">Annulla</string>
59 <string name="install_amiibo_keys">Installa le chiavi degli Amiibo</string>
60 <string name="install_amiibo_keys_description">Necessario per usare gli Amiibo in gioco</string>
61 <string name="invalid_keys_file">Selezionate chiavi non valide</string>
62 <string name="install_keys_success">Chiavi installate correttamente</string>
63 <string name="reading_keys_failure">Errore durante la lettura delle chiavi di crittografia</string>
64 <string name="invalid_keys_error">Chiavi di crittografia non valide</string>
65 <string name="dumping_keys_quickstart_link">https://yuzu-emu.org/help/quickstart/#dumping-decryption-keys</string>
66 <string name="install_keys_failure_description">Il file selezionato è incorretto o corrotto. Per favore riesegui il dump delle tue chiavi.</string>
67 <string name="install_gpu_driver">Installa i driver GPU</string>
68 <string name="install_gpu_driver_description">Installa driver alternativi per potenziali prestazioni migliori o accuratezza.</string>
69 <string name="advanced_settings">Impostazioni avanzate</string>
70 <string name="settings_description">Configura le impostazioni dell\'emulatore</string>
71 <string name="search_recently_played">Giocato recentemente</string>
72 <string name="search_recently_added">Aggiunto recentemente</string>
73 <string name="search_retail">Rivenditore</string>
74 <string name="search_homebrew">Homebrew</string>
75 <string name="open_user_folder">Apri la cartella di yuzu</string>
76 <string name="open_user_folder_description">Gestisci i file interni di yuzu</string>
77 <string name="theme_and_color_description">Modifica l\'aspetto dell\'app</string>
78 <string name="no_file_manager">Nessun file manager trovato</string>
79 <string name="notification_no_directory_link">Impossibile aprire la cartella di yuzu</string>
80 <string name="notification_no_directory_link_description">Per favore individua la cartella dell\'utente manualmente con il pannello laterale del file manager.</string>
81 <string name="manage_save_data">Gestisci i salvataggi</string>
82 <string name="manage_save_data_description">Salvataggio non trovato. Seleziona un\'opzione di seguito.</string>
83 <string name="import_export_saves_description">Importa o esporta i salvataggi</string>
84 <string name="import_export_saves_no_profile">Nessun salvataggio trovato. Avvia un gioco e riprova.</string>
85 <string name="save_file_imported_success">Importato con successo</string>
86 <string name="save_file_invalid_zip_structure">La struttura della cartella dei salvataggi è invalida</string>
87 <string name="save_file_invalid_zip_structure_description">La prima sotto cartella <b>deve</b> chiamarsi come l\'ID del titolo del gioco.</string>
88 <string name="import_saves">Importa</string>
89 <string name="export_saves">Esporta</string>
90
91 <!-- About screen strings -->
92 <string name="gaia_is_not_real">Gaia non è reale</string>
93 <string name="copied_to_clipboard">Copiato negli appunti</string>
94 <string name="about_app_description">Un emulatore della Switch open-source.</string>
95 <string name="contributors">Collaboratori</string>
96 <string name="contributors_description">Realizzato con \u2764 dal team yuzu</string>
97 <string name="contributors_link">https://github.com/yuzu-emu/yuzu/graphs/contributors</string>
98 <string name="build">Compilazione</string>
99 <string name="support_link">https://discord.gg/u77vRWY</string>
100 <string name="website_link">https://yuzu-emu.org/</string>
101 <string name="github_link">https://github.com/yuzu-emu</string>
102
103 <!-- Early access upgrade strings -->
104 <string name="early_access">Accesso Anticipato</string>
105 <string name="get_early_access">Ottieni l\'accesso anticipato</string>
106 <string name="play_store_link">https://play.google.com/store/apps/details?id=org.yuzu.yuzu_emu.ea</string>
107 <string name="get_early_access_description">Funzionalità all\'avanguardia, aggiornamenti in anticipo e altro</string>
108 <string name="early_access_benefits">Vantaggi dell\'accesso anticipato</string>
109 <string name="cutting_edge_features">Funzionalità all\'avanguardia</string>
110 <string name="early_access_updates">Accesso anticipato agli aggiornamenti</string>
111 <string name="no_manual_installation">Non installare manualmente.</string>
112 <string name="prioritized_support">Supporto prioritario</string>
113 <string name="helping_game_preservation">Aiuta a preservare il gioco</string>
114 <string name="our_eternal_gratitude">La nostra gratitudine eterna</string>
115 <string name="are_you_interested">Sei interessato?</string>
116
117 <!-- General settings strings -->
118 <string name="frame_limit_enable">Abilita il limite di velocità</string>
119 <string name="frame_limit_enable_description">Quando abilitato, la velocità di emulazione verrà limitata a una specifica percentuale della velocità normale.</string>
120 <string name="frame_limit_slider">Limite velocità percentuale</string>
121 <string name="frame_limit_slider_description">Specifica la percentuale del limite della velocità di emulazione. Con quella preimpostata al 100% l\'emulazione verrà limitata alla velocità normale. Valori più alti o bassi aumenteranno o diminuiranno il limite di velocità.</string>
122 <string name="cpu_accuracy">Accuratezza della CPU</string>
123
124 <!-- System settings strings -->
125 <string name="use_docked_mode">Modalità docked</string>
126 <string name="use_docked_mode_description">Emula in modalità docked, questo aumenta la risoluzione a spese delle performance.</string>
127 <string name="emulated_region">Regione emulata</string>
128 <string name="emulated_language">Lingua emulata</string>
129 <string name="select_rtc_date">Seleziona la data dall\'orologio in tempo reale</string>
130 <string name="select_rtc_time">Seleziona il tempo dall\'orologio in tempo reale</string>
131 <string name="use_custom_rtc">Abilità l\'orologio in tempo reale personalizzato</string>
132 <string name="use_custom_rtc_description">Questa impostazione ti permette di impostare un orologio in tempo reale personalizzato separato da quello del tuo sistema corrente.</string>
133 <string name="set_custom_rtc">Imposta l\'orologio in tempo reale personalizzato</string>
134
135 <!-- Graphics settings strings -->
136 <string name="renderer_api">API</string>
137 <string name="renderer_accuracy">Livello di accuratezza</string>
138 <string name="renderer_resolution">Risoluzione</string>
139 <string name="renderer_vsync">Modalità VSync</string>
140 <string name="renderer_aspect_ratio">Rapporto d\'aspetto</string>
141 <string name="renderer_scaling_filter">Filtro di adattamento alla finestra</string>
142 <string name="renderer_anti_aliasing">Metodo di anti-aliasing</string>
143 <string name="renderer_force_max_clock">Forza clock massimi (solo Adreno)</string>
144 <string name="renderer_force_max_clock_description">Forza la GPU a girare col massimo clock possibile (i vincoli alla temperatura saranno comunque applicati)</string>
145 <string name="renderer_asynchronous_shaders">Usa shaders asincrone</string>
146 <string name="renderer_asynchronous_shaders_description">Compila le shaders asincronamente, questo riduce lo shutter ma potrebbe introdurre dei glitch. </string>
147 <string name="renderer_debug">Abilità il debug grafico</string>
148 <string name="renderer_debug_description">Quando l\'opzione è selezionata, l\'API grafica entra in una modalità di debug più lenta</string>
149 <string name="use_disk_shader_cache">Usa cache shader su disco</string>
150 <string name="use_disk_shader_cache_description">Riduce lo stuttering salvando e caricando le shader generate sul disco.</string>
151
152 <!-- Audio settings strings -->
153 <string name="audio_volume">Volume</string>
154 <string name="audio_volume_description">Specifica il volume dell\'audio in uscita.</string>
155
156 <!-- Miscellaneous -->
157 <string name="slider_default">Predefinito</string>
158 <string name="ini_saved">Impostazioni salvate</string>
159 <string name="gameid_saved">Impostazioni salvate per %1$s</string>
160 <string name="error_saving">Errore nel salvare %1$s.ini %2$s</string>
161 <string name="loading">Caricamento…</string>
162 <string name="reset_setting_confirmation">Vuoi ripristinare queste impostazioni al loro valore originale?</string>
163 <string name="reset_to_default">Riportare alle impostazioni originali</string>
164 <string name="reset_all_settings">Resettare tutte le impostazioni?</string>
165 <string name="reset_all_settings_description">Tutte le Impostazioni Avanzate saranno ripristinate a quelle originali. Questa operazione non è reversibile</string>
166 <string name="settings_reset">Reimposta le impostazioni</string>
167 <string name="close">Chiudi</string>
168 <string name="learn_more">Per saperne di più</string>
169
170 <!-- GPU driver installation -->
171 <string name="select_gpu_driver">Seleziona il driver della GPU</string>
172 <string name="select_gpu_driver_title">Vuoi sostituire il driver della tua GPU attuale?</string>
173 <string name="select_gpu_driver_install">Installa</string>
174 <string name="select_gpu_driver_default">Predefinito</string>
175 <string name="select_gpu_driver_install_success">Installato%s</string>
176 <string name="select_gpu_driver_use_default">Utilizza il driver predefinito della GPU.</string>
177 <string name="select_gpu_driver_error">Il driver selezionato è invalido, è in utilizzo quello predefinito di sistema!</string>
178 <string name="system_gpu_driver">Driver GPU del sistema</string>
179 <string name="installing_driver">Installando i driver...</string>
180
181 <!-- Preferences Screen -->
182 <string name="preferences_settings">Impostazioni</string>
183 <string name="preferences_general">Generali</string>
184 <string name="preferences_system">Sistema</string>
185 <string name="preferences_graphics">Grafica</string>
186 <string name="preferences_audio">Audio</string>
187 <string name="preferences_theme">Tema e colori</string>
188
189 <!-- ROM loading errors -->
190 <string name="loader_error_encrypted">La tua ROM è criptata</string>
191 <string name="loader_error_encrypted_roms_description"><![CDATA[Per favore segui la guida per eseguire il dump della <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-cartridge-games\">cartuccia di gioco</a> o i <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-installed-titles-eshop\">titoli installati</a>.]]></string>
192 <string name="loader_error_encrypted_keys_description"><![CDATA[Per favore assicurati che il file <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-prodkeys-and-titlekeys\">prod.keys</a> sia installato in modo che i giochi possano essere decrittati.]]></string>
193 <string name="loader_error_video_core">È stato riscontrato un errore nell\'inizializzazione del core video</string>
194 <string name="loader_error_video_core_description">Questo è causato solitamente dal driver incompatibile di una GPU. L\'installazione di driver GPU personalizzati potrebbe risolvere questo problema.</string>
195 <string name="loader_error_invalid_format">Impossibile caricare la ROM</string>
196 <string name="loader_error_file_not_found">Il file della ROM non esiste</string>
197
198 <!-- Emulation Menu -->
199 <string name="emulation_exit">Uscire dall\'emulazione</string>
200 <string name="emulation_done">Fatto</string>
201 <string name="emulation_fps_counter">Contatore degli FPS</string>
202 <string name="emulation_toggle_controls">Controlli a interruttore</string>
203 <string name="emulation_rel_stick_center">Centro relativo degli Stick</string>
204 <string name="emulation_dpad_slide">Slittamento del Pad Direzionale</string>
205 <string name="emulation_haptics">Aptico</string>
206 <string name="emulation_show_overlay">Mostra Overlay</string>
207 <string name="emulation_toggle_all">Attiva/disattiva tutto</string>
208 <string name="emulation_control_adjust">Aggiusta Overlay</string>
209 <string name="emulation_control_scale">Scala</string>
210 <string name="emulation_control_opacity">Opacità</string>
211 <string name="emulation_touch_overlay_reset">Reimposta Overlay</string>
212 <string name="emulation_touch_overlay_edit">Modifica Overlay</string>
213 <string name="emulation_pause">Metti in pausa l\'emulazione</string>
214 <string name="emulation_unpause">Riprendi Emulazione</string>
215 <string name="emulation_input_overlay">Impostazioni Overlay</string>
216 <string name="emulation_game_loading">Caricamento del gioco...</string>
217
218 <string name="load_settings">Caricamento delle impostazioni...</string>
219
220 <!-- Software keyboard -->
221 <string name="software_keyboard">Tastiera software</string>
222
223 <!-- Errors and warnings -->
224 <string name="abort_button">Interrompi</string>
225 <string name="continue_button">Continua</string>
226 <string name="system_archive_not_found">Archivio di sistema non trovato</string>
227 <string name="system_archive_not_found_message">%s è mancante. Per favore esegui il dump degli archivi del tuo sistema.\nContinuare ad emulare potrebbe portare bug o causare crash.</string>
228 <string name="system_archive_general">Un archivio di sistema</string>
229 <string name="save_load_error">Errore di salvataggio/caricamento</string>
230 <string name="fatal_error">Errore Fatale</string>
231 <string name="fatal_error_message">Un errore fatale è accaduto. Controlla i log per i dettagli.\nContinuare ad emulare potrebbe portare bug o causare crash.</string>
232 <string name="performance_warning">Disattivare questa impostazione può ridurre significativamente le performance di emulazione! Per una migliore esperienza, è consigliato lasciare questa impostazione attivata.</string>
233
234 <!-- Region Names -->
235 <string name="region_japan">Giappone</string>
236 <string name="region_usa">USA</string>
237 <string name="region_europe">Europa</string>
238 <string name="region_australia">Australia</string>
239 <string name="region_china">Cina</string>
240 <string name="region_korea">Corea</string>
241 <string name="region_taiwan">Taiwan</string>
242
243 <!-- Language Names -->
244 <string name="language_japanese">Giapponese (日本語)</string>
245 <string name="language_english">Inglese (English)</string>
246 <string name="language_french">Francese (Français)</string>
247 <string name="langauge_german">Tedesco (Deutsch)</string>
248 <string name="language_italian">Italiano (Italiano)</string>
249 <string name="language_spanish">Spagnolo (Español)</string>
250 <string name="language_chinese">Cinese (简体中文)</string>
251 <string name="language_korean">Coreano (한국어)</string>
252 <string name="language_dutch">Olandese (Nederlands)</string>
253 <string name="language_portuguese">Portoghese (Português)</string>
254 <string name="language_russian">Russo (Русский)</string>
255 <string name="language_taiwanese">Taiwanese (台湾)</string>
256 <string name="language_british_english">Inglese britannico</string>
257 <string name="language_canadian_french">Francese Canadese (Français canadien)</string>
258 <string name="language_latin_american_spanish">Spagnolo Latino Americano (Español latinoamericano)</string>
259 <string name="language_simplified_chinese">Cinese Semplificato (简体中文)</string>
260 <string name="language_traditional_chinese">Cinese tradizionale (正體中文)</string>
261 <string name="language_brazilian_portuguese">Portoghese (Português)</string>
262
263 <!-- Renderer APIs -->
264 <string name="renderer_vulkan">Vulkan</string>
265 <string name="renderer_none">Nessuna</string>
266
267 <!-- Renderer Accuracy -->
268 <string name="renderer_accuracy_normal">Normale</string>
269 <string name="renderer_accuracy_high">Alta</string>
270 <string name="renderer_accuracy_extreme">Estrema (Lenta)</string>
271
272 <!-- Resolutions -->
273 <string name="resolution_half">0.5X (360p/540p)</string>
274 <string name="resolution_three_quarter">0.75X (540p/810p)</string>
275 <string name="resolution_one">1X (720p/1080p)</string>
276 <string name="resolution_two">2X (1440p/2160p) (Slow)</string>
277 <string name="resolution_three">3X (2160p/3240p) (Slow)</string>
278 <string name="resolution_four">4X (2880p/4320p) (Slow)</string>
279
280 <!-- Renderer VSync -->
281 <string name="renderer_vsync_immediate">Immediato (Off)</string>
282 <string name="renderer_vsync_mailbox">Cassella postale</string>
283 <string name="renderer_vsync_fifo">FIFO (On)</string>
284 <string name="renderer_vsync_fifo_relaxed">FIFO Rilassato</string>
285
286 <!-- Scaling Filters -->
287 <string name="scaling_filter_nearest_neighbor">Nearest neighbor</string>
288 <string name="scaling_filter_bilinear">Bilineare</string>
289 <string name="scaling_filter_bicubic">Bicubico</string>
290 <string name="scaling_filter_gaussian">Gaussiano</string>
291 <string name="scaling_filter_scale_force">ScaleForce</string>
292 <string name="scaling_filter_fsr">AMD FidelityFX™️ Super Resolution</string>
293
294 <!-- Anti-Aliasing -->
295 <string name="anti_aliasing_none">Nessuna</string>
296 <string name="anti_aliasing_fxaa">FXAA</string>
297 <string name="anti_aliasing_smaa">SMAA</string>
298
299 <!-- Aspect Ratios -->
300 <string name="ratio_default">Predefinito (16:9)</string>
301 <string name="ratio_force_four_three">Forza 4:3</string>
302 <string name="ratio_force_twenty_one_nine">Forza 21:9</string>
303 <string name="ratio_force_sixteen_ten">Forza 16:10</string>
304 <string name="ratio_stretch">Allunga a finestra</string>
305
306 <!-- CPU Accuracy -->
307 <string name="cpu_accuracy_accurate">Accurata</string>
308 <string name="cpu_accuracy_unsafe">Non sicura</string>
309 <string name="cpu_accuracy_paranoid">Paranoico (Lento)</string>
310
311 <!-- Gamepad Buttons -->
312 <string name="gamepad_d_pad">D-Pad</string>
313 <string name="gamepad_left_stick">Levetta sinistra</string>
314 <string name="gamepad_right_stick">Levetta destra</string>
315 <string name="gamepad_home">Home</string>
316 <string name="gamepad_screenshot">Screenshot</string>
317
318 <!-- Disk shader cache -->
319 <string name="preparing_shaders">Preparazione degli shaders</string>
320 <string name="building_shaders">Costruendo gli shaders</string>
321
322 <!-- Theme options -->
323 <string name="change_app_theme">Cambia il tema dell\'app</string>
324 <string name="theme_default">Predefinito</string>
325 <string name="theme_material_you">Material You</string>
326
327 <!-- Theme Modes -->
328 <string name="change_theme_mode">Cambia la modalità del tema</string>
329 <string name="theme_mode_follow_system">Segue il Sistema</string>
330 <string name="theme_mode_light">Chiaro</string>
331 <string name="theme_mode_dark">Scuro</string>
332
333 <!-- Black backgrounds theme -->
334 <string name="use_black_backgrounds">Usa sfondi neri</string>
335 <string name="use_black_backgrounds_description">Quando utilizzi il tema scuro, applica sfondi neri.</string>
336
337</resources>
diff --git a/src/android/app/src/main/res/values-ja/strings.xml b/src/android/app/src/main/res/values-ja/strings.xml
new file mode 100644
index 000000000..46eda9ef7
--- /dev/null
+++ b/src/android/app/src/main/res/values-ja/strings.xml
@@ -0,0 +1,335 @@
1<?xml version="1.0" encoding="utf-8"?>
2<resources>
3
4 <string name="app_disclaimer">このソフトウェアは、Nintendo Switch用のゲームを実行します。 ゲームソフトやキーは含まれません。&lt;br /&gt;&lt;br /&gt;事前に、 <![CDATA[<b> prod.keys </b>]]> ファイルをデバイスのストレージに配置しておいてください。&lt;br /&gt;&lt;br /&gt;<![CDATA[<a href=\"https://yuzu-emu.org/help/quickstart\">詳細</a>]]></string>
5 <string name="emulation_notification_channel_name">エミュレーションが有効です</string>
6 <string name="emulation_notification_channel_description">エミュレーションの実行中に常設通知を表示します。</string>
7 <string name="emulation_notification_running">yuzu は実行中です</string>
8 <string name="notice_notification_channel_description">問題が発生したときに通知を表示します。</string>
9 <string name="notification_permission_not_granted">通知が許可されていません!</string>
10
11 <!-- Setup strings -->
12 <string name="welcome">ようこそ!</string>
13 <string name="welcome_description">&lt;b>yuzu&lt;/b> のセットアップ方法を学び、エミュレーションに飛び込みましょう。</string>
14 <string name="get_started">はじめる</string>
15 <string name="keys">キー</string>
16 <string name="keys_description">下のボタンから &lt;b>prod.keys&lt;/b> ファイルを選択してください。</string>
17 <string name="select_keys">キーを選択</string>
18 <string name="games">ゲーム</string>
19 <string name="games_description">下のボタンから&lt;b>ゲーム&lt;/b>があるフォルダを選択してください。</string>
20 <string name="done">完了</string>
21 <string name="done_description">準備が完了しました。\nゲームをお楽しみください!</string>
22 <string name="text_continue">続行</string>
23 <string name="next">次へ</string>
24 <string name="back">戻る</string>
25 <string name="add_games">ゲームを追加</string>
26 <string name="add_games_description">ゲームフォルダを選択</string>
27
28 <!-- Home strings -->
29 <string name="home_games">ゲーム</string>
30 <string name="home_search">検索</string>
31 <string name="home_settings">設定</string>
32 <string name="empty_gamelist">ファイルが見つからないか、ゲームディレクトリがまだ選択されていません。</string>
33 <string name="search_and_filter_games">ゲームの検索と絞り込み</string>
34 <string name="select_games_folder">ゲームフォルダを選択</string>
35 <string name="select_games_folder_description">yuzu がゲームリストに追加できるようにします</string>
36 <string name="add_games_warning">ゲームフォルダの選択をスキップしますか?</string>
37 <string name="add_games_warning_description">フォルダを選択しない場合、ゲームはゲームリストに表示されません。</string>
38 <string name="add_games_warning_help">https://yuzu-emu.org/help/quickstart/#dumping-games</string>
39 <string name="home_search_games">ゲームを検索</string>
40 <string name="games_dir_selected">ゲームディレクトリが選択されました</string>
41 <string name="install_prod_keys">prod.keys をインストール</string>
42 <string name="install_prod_keys_description">ゲームの復号化に必要</string>
43 <string name="install_prod_keys_warning">キーの追加をスキップしますか?</string>
44 <string name="install_prod_keys_warning_description">製品版ゲームのエミュレーションには、有効なキーが必要です。続行すると自作アプリしか機能しません。</string>
45 <string name="install_prod_keys_warning_help">https://yuzu-emu.org/help/quickstart/#guide-introduction</string>
46 <string name="notifications">通知</string>
47 <string name="notifications_description">下のボタンで通知の権限を許可してください。</string>
48 <string name="give_permission">許可</string>
49 <string name="notification_warning">通知の許可をスキップしますか?</string>
50 <string name="notification_warning_description">yuzuは重要なお知らせを通知できません。</string>
51 <string name="permission_denied">権限が拒否されました</string>
52 <string name="permission_denied_description">この権限を複数回拒否したため、システム設定で手動で許可する必要があります。</string>
53 <string name="about">情報</string>
54 <string name="about_description">ビルドバージョン、クレジットなど</string>
55 <string name="warning_help">ヘルプ</string>
56 <string name="warning_skip">スキップ</string>
57 <string name="warning_cancel">キャンセル</string>
58 <string name="install_amiibo_keys">Amiibo キーをインストール</string>
59 <string name="install_amiibo_keys_description">ゲーム内での Amiibo の使用に必要</string>
60 <string name="invalid_keys_file">無効なキーファイルが選択されました</string>
61 <string name="install_keys_success">正常にインストールされました</string>
62 <string name="reading_keys_failure">暗号化キーの読み取りエラー</string>
63 <string name="invalid_keys_error">暗号化キーが無効です</string>
64 <string name="dumping_keys_quickstart_link">https://yuzu-emu.org/help/quickstart/#dumping-decryption-keys</string>
65 <string name="install_keys_failure_description">選択されたファイルが不正または破損しています。キーを再ダンプしてください。</string>
66 <string name="install_gpu_driver">GPUドライバーをインストール</string>
67 <string name="install_gpu_driver_description">代替ドライバーをインストールしてパフォーマンスや精度を向上させます</string>
68 <string name="advanced_settings">高度な設定</string>
69 <string name="settings_description">エミュレーターの設定を構成します</string>
70 <string name="search_recently_played">最近プレイした</string>
71 <string name="search_recently_added">最近追加された</string>
72 <string name="search_retail">製品版</string>
73 <string name="search_homebrew">自作</string>
74 <string name="open_user_folder">yuzu フォルダを開く</string>
75 <string name="open_user_folder_description">yuzu内部のファイルを管理します</string>
76 <string name="theme_and_color_description">アプリの見た目を変更</string>
77 <string name="no_file_manager">ファイルマネージャーが見つかりませんでした</string>
78 <string name="notification_no_directory_link">yuzuのディレクトリを開けません</string>
79 <string name="notification_no_directory_link_description">ファイルマネージャのサイドパネルでユーザーフォルダを手動で探してください。</string>
80 <string name="manage_save_data">セーブデータを管理</string>
81 <string name="manage_save_data_description">セーブデータが見つかりました。以下のオプションから選択してください。</string>
82 <string name="import_export_saves_description">セーブファイルをインポート/エクスポート</string>
83 <string name="import_export_saves_no_profile">セーブデータがありません。ゲームを起動してから再度お試しください。</string>
84 <string name="save_file_imported_success">インポートが完了しました</string>
85 <string name="save_file_invalid_zip_structure">セーブデータのディレクトリ構造が無効です</string>
86 <string name="save_file_invalid_zip_structure_description">最初のサブフォルダ名は、ゲームのタイトルIDである必要があります。</string>
87 <string name="import_saves">インポート</string>
88 <string name="export_saves">エクスポート</string>
89
90 <!-- About screen strings -->
91 <string name="gaia_is_not_real">ガイアは実在しない</string>
92 <string name="copied_to_clipboard">クリップボードにコピーしました</string>
93 <string name="about_app_description">オープンソースのSwitchエミュレータ</string>
94 <string name="contributors">貢献者</string>
95 <string name="contributors_description">yuzuチームの\u2764で作られた</string>
96 <string name="contributors_link">https://github.com/yuzu-emu/yuzu/graphs/contributors</string>
97 <string name="build">ビルド</string>
98 <string name="support_link">https://discord.gg/u77vRWY</string>
99 <string name="website_link">https://yuzu-emu.org/</string>
100 <string name="github_link">https://github.com/yuzu-emu</string>
101
102 <!-- Early access upgrade strings -->
103 <string name="early_access">早期アクセス</string>
104 <string name="get_early_access">早期アクセスを手に入れる</string>
105 <string name="play_store_link">https://play.google.com/store/apps/details?id=org.yuzu.yuzu_emu.ea</string>
106 <string name="get_early_access_description">最先端の機能、アップデートの早期アクセスなど</string>
107 <string name="early_access_benefits">早期アクセスのメリット</string>
108 <string name="cutting_edge_features">最先端の機能</string>
109 <string name="early_access_updates">アップデートの早期アクセス</string>
110 <string name="no_manual_installation">手動インストールが不要</string>
111 <string name="prioritized_support">優先的なサポート</string>
112 <string name="helping_game_preservation">ゲームの保存に貢献</string>
113 <string name="our_eternal_gratitude">私たちの永遠の感謝</string>
114 <string name="are_you_interested">興味がありますか?</string>
115
116 <!-- General settings strings -->
117 <string name="frame_limit_enable">速度制限を有効化</string>
118 <string name="frame_limit_enable_description">有効にすると、エミュレーション速度が任意の割合に制限されます。</string>
119 <string name="frame_limit_slider">エミュレーション速度の制限</string>
120 <string name="frame_limit_slider_description">エミュレーション速度を制限する割合を指定します。デフォルトの100%では、エミュレーションは通常の速度に制限されます。値が高いまたは低いほど、速度制限が増加または減少します。</string>
121 <string name="cpu_accuracy">CPU精度</string>
122
123 <!-- System settings strings -->
124 <string name="use_docked_mode">TVモード</string>
125 <string name="use_docked_mode_description">TVモードでエミュレートします。パフォーマンスが犠牲になりますが、解像度が向上します。</string>
126 <string name="emulated_region">地域</string>
127 <string name="emulated_language">言語</string>
128 <string name="select_rtc_date">RTCの日付を選択</string>
129 <string name="select_rtc_time">RTCの時刻を選択</string>
130 <string name="use_custom_rtc">カスタムRTC</string>
131 <string name="use_custom_rtc_description">現在のシステム時間とは別にカスタムのリアルタイムクロックを設定できます。</string>
132 <string name="set_custom_rtc">カスタムRTCを設定</string>
133
134 <!-- Graphics settings strings -->
135 <string name="renderer_api">API</string>
136 <string name="renderer_accuracy">精度</string>
137 <string name="renderer_resolution">解像度</string>
138 <string name="renderer_vsync">垂直同期モード</string>
139 <string name="renderer_aspect_ratio">アスペクト比</string>
140 <string name="renderer_scaling_filter">ウィンドウ適応フィルター</string>
141 <string name="renderer_anti_aliasing">アンチエイリアス方式</string>
142 <string name="renderer_force_max_clock">最大クロックを強制 (Adrenoのみ)</string>
143 <string name="renderer_force_max_clock_description">GPUを可能な限り最大クロックで動作させます (過熱制限は引き続き適用されます)。</string>
144 <string name="renderer_asynchronous_shaders">非同期シェーダー</string>
145 <string name="renderer_asynchronous_shaders_description">シェーダーを非同期でコンパイルします。コマ落ちが軽減されますが、不具合が発生する可能性があります。</string>
146 <string name="renderer_debug">グラフィックデバッグ</string>
147 <string name="renderer_debug_description">オンにすると、グラフィックAPI は低速のデバッグモードに入ります。</string>
148 <string name="use_disk_shader_cache">シェーダーキャッシュを使用</string>
149 <string name="use_disk_shader_cache_description">生成したシェーダーをディスクに保存して読み込むことで、コマ落ちを軽減します。</string>
150
151 <!-- Audio settings strings -->
152 <string name="audio_volume">音量</string>
153 <string name="audio_volume_description">オーディオ出力の音量を指定します</string>
154
155 <!-- Miscellaneous -->
156 <string name="slider_default">デフォルト</string>
157 <string name="ini_saved">設定を保存しました</string>
158 <string name="gameid_saved">%1$sの設定を保存しました</string>
159 <string name="error_saving">%1$s.ini の保存エラー: %2$s</string>
160 <string name="loading">読み込み中…</string>
161 <string name="reset_setting_confirmation">この設定を初期値にリセットしますか?</string>
162 <string name="reset_to_default">初期設定に戻す</string>
163 <string name="reset_all_settings">すべての設定をリセットしますか?</string>
164 <string name="reset_all_settings_description">すべての詳細設定が初期設定に戻されます。この操作は元に戻せません。</string>
165 <string name="settings_reset">設定をリセットしました</string>
166 <string name="close">閉じる</string>
167 <string name="learn_more">詳細情報</string>
168
169 <!-- GPU driver installation -->
170 <string name="select_gpu_driver">GPUドライバを選択</string>
171 <string name="select_gpu_driver_title">現在のGPUドライバーを置き換えますか?</string>
172 <string name="select_gpu_driver_install">インストール</string>
173 <string name="select_gpu_driver_default">デフォルト</string>
174 <string name="select_gpu_driver_install_success">%s をインストールしました</string>
175 <string name="select_gpu_driver_use_default">デフォルトのGPUドライバーを使用します</string>
176 <string name="select_gpu_driver_error">選択されたドライバが無効なため、システムのデフォルトを使用します!</string>
177 <string name="system_gpu_driver">システムのGPUドライバ</string>
178 <string name="installing_driver">インストール中…</string>
179
180 <!-- Preferences Screen -->
181 <string name="preferences_settings">設定</string>
182 <string name="preferences_general">全般</string>
183 <string name="preferences_system">システム</string>
184 <string name="preferences_graphics">グラフィック</string>
185 <string name="preferences_audio">サウンド</string>
186 <string name="preferences_theme">テーマと色</string>
187
188 <!-- ROM loading errors -->
189 <string name="loader_error_encrypted">ROMが暗号化されています</string>
190 <string name="loader_error_encrypted_roms_description"><![CDATA[<a href=\"https://yuzu-emu.org/help/quickstart/#dumping-cartridge-games\">ゲームカートリッジ</a>や<a href=\"https://yuzu-emu.org/help/quickstart/#dumping-installed-titles-eshop\">インストール済みのタイトル</a>を再度ダンプするためのガイドに従ってください。]]></string>
191 <string name="loader_error_encrypted_keys_description"><![CDATA[ゲームを復号化するために <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-prodkeys-and-titlekeys\">prod.keys</a> ファイルがインストールされていることを確認してください。]]></string>
192 <string name="loader_error_video_core">ビデオコアの初期化中にエラーが発生しました</string>
193 <string name="loader_error_video_core_description">これは通常、互換性のないGPUドライバーが原因で発生します。 カスタムGPUドライバーをインストールすると、問題が解決する可能性があります。</string>
194 <string name="loader_error_invalid_format">ROMの読み込みに失敗しました</string>
195 <string name="loader_error_file_not_found">ROMファイルが存在しません</string>
196
197 <!-- Emulation Menu -->
198 <string name="emulation_exit">エミュレーションを終了</string>
199 <string name="emulation_done">完了</string>
200 <string name="emulation_fps_counter">FPSカウンター</string>
201 <string name="emulation_toggle_controls">コントロールを切り替え</string>
202 <string name="emulation_dpad_slide">十字キーのスライド操作</string>
203 <string name="emulation_haptics">振動</string>
204 <string name="emulation_show_overlay">オーバーレイを表示</string>
205 <string name="emulation_toggle_all">すべて選択</string>
206 <string name="emulation_control_adjust">オーバーレイを調整</string>
207 <string name="emulation_control_scale">大きさ</string>
208 <string name="emulation_control_opacity">不透明度</string>
209 <string name="emulation_touch_overlay_reset">リセット</string>
210 <string name="emulation_touch_overlay_edit">オーバーレイを編集</string>
211 <string name="emulation_pause">エミュレーションを一時停止</string>
212 <string name="emulation_unpause">エミュレーションを再開</string>
213 <string name="emulation_input_overlay">オーバーレイオプション</string>
214 <string name="emulation_game_loading">ロード中…</string>
215
216 <string name="load_settings">設定をロード中…</string>
217
218 <!-- Software keyboard -->
219 <string name="software_keyboard">ソフトウェアキーボード</string>
220
221 <!-- Errors and warnings -->
222 <string name="abort_button">中断</string>
223 <string name="continue_button">続行</string>
224 <string name="system_archive_not_found">システムアーカイブが見つかりません</string>
225 <string name="system_archive_not_found_message">%s が見つかりません。システムアーカイブをダンプしてください。\nエミュレーションを続行すると、クラッシュやバグが発生する可能性があります。</string>
226 <string name="system_archive_general">システムアーカイブ</string>
227 <string name="save_load_error">セーブ/ロード エラー</string>
228 <string name="fatal_error">致命的なエラー</string>
229 <string name="fatal_error_message">致命的なエラーが発生しました。詳細はログを確認してください。\nエミュレーションを続行するとクラッシュやバグが発生する可能性があります。</string>
230 <string name="performance_warning">この設定をオフにすると、エミュレーションのパフォーマンスが著しく低下します!最高の体験を得るためには、この設定を有効にしておくことをお勧めします。</string>
231
232 <!-- Region Names -->
233 <string name="region_japan">日本</string>
234 <string name="region_usa">アメリカ</string>
235 <string name="region_europe">ヨーロッパ</string>
236 <string name="region_australia">オーストラリア</string>
237 <string name="region_china">中国</string>
238 <string name="region_korea">韓国</string>
239 <string name="region_taiwan">台湾</string>
240
241 <!-- Language Names -->
242 <string name="language_japanese">日本語</string>
243 <string name="language_english">英語</string>
244 <string name="language_french">フランス語 (Français)</string>
245 <string name="langauge_german">ドイツ語 (Deutsch)</string>
246 <string name="language_italian">イタリア語 (Italiano)</string>
247 <string name="language_spanish">スペイン語 (Español)</string>
248 <string name="language_chinese">中国語 (简体中文)</string>
249 <string name="language_korean">韓国語 (한국어)</string>
250 <string name="language_dutch">オランダ語 (Nederlands)</string>
251 <string name="language_portuguese">ポルトガル語 (Português)</string>
252 <string name="language_russian">ロシア語 (Русский)</string>
253 <string name="language_taiwanese">台湾語 (台湾)</string>
254 <string name="language_british_english">イギリス英語</string>
255 <string name="language_canadian_french">フランス語(カナダ) (Français canadien)</string>
256 <string name="language_latin_american_spanish">スペイン語(ラテンアメリカ) (Español latinoamericano)</string>
257 <string name="language_simplified_chinese">中国語 (简体中文)</string>
258 <string name="language_traditional_chinese">繁体字中国語 (正體中文)</string>
259 <string name="language_brazilian_portuguese">ポルトガル語(ブラジル) (Português do Brasil)</string>
260
261 <!-- Renderer APIs -->
262 <string name="renderer_vulkan">Vulkan</string>
263 <string name="renderer_none">なし</string>
264
265 <!-- Renderer Accuracy -->
266 <string name="renderer_accuracy_normal">標準</string>
267 <string name="renderer_accuracy_high">高い</string>
268 <string name="renderer_accuracy_extreme">最高 (低速)</string>
269
270 <!-- Resolutions -->
271 <string name="resolution_half">0.5X (360p/540p)</string>
272 <string name="resolution_three_quarter">0.75X (540p/810p)</string>
273 <string name="resolution_one">1X (720p/1080p)</string>
274 <string name="resolution_two">2X (1440p/2160p) (低速)</string>
275 <string name="resolution_three">3X (2160p/3240p) (低速)</string>
276 <string name="resolution_four">4X (2880p/4320p) (低速)</string>
277
278 <!-- Renderer VSync -->
279 <string name="renderer_vsync_immediate">Immediate (オフ)</string>
280 <string name="renderer_vsync_mailbox">Mailbox</string>
281 <string name="renderer_vsync_fifo">FIFO (オン)</string>
282 <string name="renderer_vsync_fifo_relaxed">FIFO Relaxed</string>
283
284 <!-- Scaling Filters -->
285 <string name="scaling_filter_nearest_neighbor">Nearest Neighbor</string>
286 <string name="scaling_filter_bilinear">Bilinear</string>
287 <string name="scaling_filter_bicubic">Bicubic</string>
288 <string name="scaling_filter_gaussian">Gaussian</string>
289 <string name="scaling_filter_scale_force">ScaleForce</string>
290 <string name="scaling_filter_fsr">AMD FidelityFX™ Super Resolution</string>
291
292 <!-- Anti-Aliasing -->
293 <string name="anti_aliasing_none">なし</string>
294 <string name="anti_aliasing_fxaa">FXAA</string>
295 <string name="anti_aliasing_smaa">SMAA</string>
296
297 <!-- Aspect Ratios -->
298 <string name="ratio_default">デフォルト (16:9)</string>
299 <string name="ratio_force_four_three">強制 4:3</string>
300 <string name="ratio_force_twenty_one_nine">強制 21:9</string>
301 <string name="ratio_force_sixteen_ten">強制 16:10</string>
302 <string name="ratio_stretch">ウィンドウに合わせる</string>
303
304 <!-- CPU Accuracy -->
305 <string name="cpu_accuracy_accurate">正確</string>
306 <string name="cpu_accuracy_unsafe">不安定</string>
307 <string name="cpu_accuracy_paranoid">パラノイド (低速)</string>
308
309 <!-- Gamepad Buttons -->
310 <string name="gamepad_d_pad">方向ボタン</string>
311 <string name="gamepad_left_stick">Lスティック</string>
312 <string name="gamepad_right_stick">Rスティック</string>
313 <string name="gamepad_home">HOMEボタン</string>
314 <string name="gamepad_screenshot">スクリーンショット</string>
315
316 <!-- Disk shader cache -->
317 <string name="preparing_shaders">シェーダーを準備しています</string>
318 <string name="building_shaders">シェーダーを構築しています</string>
319
320 <!-- Theme options -->
321 <string name="change_app_theme">アプリのテーマ</string>
322 <string name="theme_default">デフォルト</string>
323 <string name="theme_material_you">Material You</string>
324
325 <!-- Theme Modes -->
326 <string name="change_theme_mode">テーマモード</string>
327 <string name="theme_mode_follow_system">システムに従う</string>
328 <string name="theme_mode_light">ライト</string>
329 <string name="theme_mode_dark">ダーク</string>
330
331 <!-- Black backgrounds theme -->
332 <string name="use_black_backgrounds">黒色の背景を使用</string>
333 <string name="use_black_backgrounds_description">ダークテーマの使用時は、黒色の背景を有効にしてください。</string>
334
335</resources>
diff --git a/src/android/app/src/main/res/values-ko/strings.xml b/src/android/app/src/main/res/values-ko/strings.xml
new file mode 100644
index 000000000..5da80ab4b
--- /dev/null
+++ b/src/android/app/src/main/res/values-ko/strings.xml
@@ -0,0 +1,337 @@
1<?xml version="1.0" encoding="utf-8"?>
2<resources>
3
4 <string name="app_disclaimer">이 소프트웨어는 닌텐도 스위치 게임 콘솔용 게임을 실행합니다. 게임 타이틀이나 keys는 포함되어 있지 않습니다.&lt;br /&gt;&lt;br /&gt;시작하기 전에 장치 저장소에서 <![CDATA[<b> prod.keys </b>]]> 파일을 찾아주세요.&lt;br /&gt;&lt;br /&gt;<![CDATA[<a href=\"https://yuzu-emu.org/help/quickstart\">자세히 알아보기</a>]]></string>
5 <string name="emulation_notification_channel_name">에뮬레이션이 활성화됨</string>
6 <string name="emulation_notification_channel_description">에뮬레이션이 실행 중일 때 영구 알림을 표시합니다.</string>
7 <string name="emulation_notification_running">yuzu가 실행 중입니다.</string>
8 <string name="notice_notification_channel_name">알림 및 오류</string>
9 <string name="notice_notification_channel_description">문제가 발생하면 알림을 표시합니다.</string>
10 <string name="notification_permission_not_granted">알림 권한이 부여되지 않았습니다!</string>
11
12 <!-- Setup strings -->
13 <string name="welcome">환영합니다!</string>
14 <string name="welcome_description">&lt;b>yuzu&lt;/b> 를 설정하고 에뮬레이션으로 이동하는 방법을 알아보세요.</string>
15 <string name="get_started">시작하기</string>
16 <string name="keys">Keys</string>
17 <string name="keys_description">아래 버튼을 사용하여 &lt;b>prod.keys&lt;/b> 파일을 선택합니다.</string>
18 <string name="select_keys">keys 선택</string>
19 <string name="games">게임</string>
20 <string name="games_description">아래 버튼으로 &lt;b>게임&lt;/b> 폴더를 선택합니다.</string>
21 <string name="done">완료</string>
22 <string name="done_description">모든 준비가 완료되었습니다.\n게임을 즐기세요!</string>
23 <string name="text_continue">계속</string>
24 <string name="next">다음</string>
25 <string name="back">뒤로</string>
26 <string name="add_games">게임 추가</string>
27 <string name="add_games_description">게임 폴더 선택</string>
28
29 <!-- Home strings -->
30 <string name="home_games">게임</string>
31 <string name="home_search">검색</string>
32 <string name="home_settings">설정</string>
33 <string name="empty_gamelist">파일을 찾을 수 없거나 아직 게임 디렉토리를 선택하지 않았습니다.</string>
34 <string name="search_and_filter_games">게임 검색 및 필터링</string>
35 <string name="select_games_folder">게임 폴더 선택</string>
36 <string name="select_games_folder_description">yuzu가 게임 목록을 채울 수 있도록 허용</string>
37 <string name="add_games_warning">게임 폴더 선택을 건너뛰겠습니까?</string>
38 <string name="add_games_warning_description">폴더를 선택하지 않으면 게임 목록에 게임이 표시되지 않습니다.</string>
39 <string name="add_games_warning_help">https://yuzu-emu.org/help/quickstart/#dumping-games</string>
40 <string name="home_search_games">게임 검색</string>
41 <string name="games_dir_selected">게임 디렉터리 선택</string>
42 <string name="install_prod_keys">prod.keys 설치</string>
43 <string name="install_prod_keys_description">판매용 게임 암호 해독에 요구</string>
44 <string name="install_prod_keys_warning">keys 추가를 건너뛰겠습니까?</string>
45 <string name="install_prod_keys_warning_description">정품 게임을 에뮬레이트하려면 유효한 keys가 필요합니다. 계속하면 자체 제작 앱만 작동합니다.</string>
46 <string name="install_prod_keys_warning_help">https://yuzu-emu.org/help/quickstart/#guide-introduction</string>
47 <string name="notifications">알림</string>
48 <string name="notifications_description">아래 버튼으로 알림 권한을 부여합니다.</string>
49 <string name="give_permission">권한 부여</string>
50 <string name="notification_warning">알림 권한 부여를 건너뛰겠습니까?</string>
51 <string name="notification_warning_description">yuzu는 중요한 정보를 알려드리지 않습니다.</string>
52 <string name="permission_denied">권한 거부됨</string>
53 <string name="permission_denied_description">이 권한을 너무 많이 거부했으므로 이제 시스템 설정에서 수동으로 권한을 부여해야 합니다.</string>
54 <string name="about">정보</string>
55 <string name="about_description">빌드 버전, 크레딧 등</string>
56 <string name="warning_help">도움말</string>
57 <string name="warning_skip">건너뛰기</string>
58 <string name="warning_cancel">취소</string>
59 <string name="install_amiibo_keys">Amiibo keys 설치</string>
60 <string name="install_amiibo_keys_description">게임에서 아미보 사용 시 필요</string>
61 <string name="invalid_keys_file">잘못된 keys 파일 선택</string>
62 <string name="install_keys_success">keys가 성공적으로 설치됨</string>
63 <string name="reading_keys_failure">암호화 keys 읽기 오류</string>
64 <string name="invalid_keys_error">잘못된 암호화 keys</string>
65 <string name="dumping_keys_quickstart_link">https://yuzu-emu.org/help/quickstart/#dumping-decryption-keys</string>
66 <string name="install_keys_failure_description">선택한 파일이 잘못되었거나 손상되었습니다. keys를 다시 덤프하세요.</string>
67 <string name="install_gpu_driver">GPU 드라이버 설치</string>
68 <string name="install_gpu_driver_description">잠재적으로 더 나은 성능 또는 정확성을 위해 대체 드라이버를 설치하세요.</string>
69 <string name="advanced_settings">고급 설정</string>
70 <string name="settings_description">에뮬레이터 설정 구성</string>
71 <string name="search_recently_played">최근 플레이한 게임</string>
72 <string name="search_recently_added">최근 추가한 게임</string>
73 <string name="search_retail">판매용</string>
74 <string name="search_homebrew">홈브류</string>
75 <string name="open_user_folder">yuzu 폴더 열기</string>
76 <string name="open_user_folder_description">yuzu의 내부 파일 관리</string>
77 <string name="theme_and_color_description">앱 모양 수정</string>
78 <string name="no_file_manager">파일 관리자를 찾을 수 없음</string>
79 <string name="notification_no_directory_link">yuzu 디렉토리를 열 수 없음</string>
80 <string name="notification_no_directory_link_description">파일 관리자의 사이드 패널에서 사용자 폴더를 수동으로 찾아주세요.</string>
81 <string name="manage_save_data">저장 데이터 관리</string>
82 <string name="manage_save_data_description">데이터를 저장했습니다. 아래에서 옵션을 선택하세요.</string>
83 <string name="import_export_saves_description">저장 파일 가져오기 또는 내보내기</string>
84 <string name="import_export_saves_no_profile">저장 데이터를 찾을 수 없습니다. 게임을 실행한 후 다시 시도하세요.</string>
85 <string name="save_file_imported_success">가져오기 성공</string>
86 <string name="save_file_invalid_zip_structure">저장 디렉터리 구조가 잘못됨</string>
87 <string name="save_file_invalid_zip_structure_description">첫 번째 하위 폴더 이름은 게임의 타이틀 ID여야 합니다.</string>
88 <string name="import_saves">가져오기</string>
89 <string name="export_saves">내보내기</string>
90
91 <!-- About screen strings -->
92 <string name="gaia_is_not_real">가이아는 진짜가 아님</string>
93 <string name="copied_to_clipboard">클립보드에 복사</string>
94 <string name="about_app_description">오픈 소스 스위치 에뮬레이터</string>
95 <string name="contributors">기여자</string>
96 <string name="contributors_description">yuzu 팀의 \u2764로 제작</string>
97 <string name="contributors_link">https://github.com/yuzu-emu/yuzu/graphs/contributors</string>
98 <string name="build">빌드</string>
99 <string name="support_link">https://discord.gg/u77vRWY</string>
100 <string name="website_link">https://yuzu-emu.org/</string>
101 <string name="github_link">https://github.com/yuzu-emu</string>
102
103 <!-- Early access upgrade strings -->
104 <string name="early_access">미리 체험하기</string>
105 <string name="get_early_access">미리 체험하기 신청</string>
106 <string name="play_store_link">https://play.google.com/store/apps/details?id=org.yuzu.yuzu_emu.ea</string>
107 <string name="get_early_access_description">최첨단 기능, 미리 체험하기 업데이트 등</string>
108 <string name="early_access_benefits">미리 체험하기 혜택</string>
109 <string name="cutting_edge_features">최첨단 기능</string>
110 <string name="early_access_updates">미리 체험하기 업데이트</string>
111 <string name="no_manual_installation">수동 설치 불필요</string>
112 <string name="prioritized_support">우선 지원</string>
113 <string name="helping_game_preservation">게임 보존 도움주기</string>
114 <string name="our_eternal_gratitude">영원한 감사의 마음을 전합니다</string>
115 <string name="are_you_interested">관심 있으세요?</string>
116
117 <!-- General settings strings -->
118 <string name="frame_limit_enable">제한 속도 활성화</string>
119 <string name="frame_limit_enable_description">활성화하면 에뮬레이션 속도가 정상 속도의 지정된 비율로 제한됩니다.</string>
120 <string name="frame_limit_slider">속도 제한 비율</string>
121 <string name="frame_limit_slider_description">에뮬레이션 속도를 제한할 비율을 지정합니다. 기본값인 100%로 설정하면 에뮬레이션이 정상 속도로 제한됩니다. 값이 높거나 낮으면 속도 제한이 증가하거나 감소합니다.</string>
122 <string name="cpu_accuracy">CPU 정확도</string>
123
124 <!-- System settings strings -->
125 <string name="use_docked_mode">도킹 모드</string>
126 <string name="use_docked_mode_description">도킹 모드에서 에뮬레이션하면 성능이 저하되는 대신 해상도가 향상됩니다.</string>
127 <string name="emulated_region">에뮬레이트된 지역</string>
128 <string name="emulated_language">에뮬레이트된 언어</string>
129 <string name="select_rtc_date">RTC 날짜 선택</string>
130 <string name="select_rtc_time">RTC 시간 선택</string>
131 <string name="use_custom_rtc">커스텀 RTC 활성화</string>
132 <string name="use_custom_rtc_description">이 설정을 사용하면 현재 시스템 시간과 별도로 사용자 지정 실시간 시계를 설정할 수 있음</string>
133 <string name="set_custom_rtc">커스텀 RTC 설정</string>
134
135 <!-- Graphics settings strings -->
136 <string name="renderer_api">API</string>
137 <string name="renderer_accuracy">정확도 수준</string>
138 <string name="renderer_resolution">해상도</string>
139 <string name="renderer_vsync">수직동기화 모드</string>
140 <string name="renderer_aspect_ratio">화면비</string>
141 <string name="renderer_scaling_filter">창 적응 필터</string>
142 <string name="renderer_anti_aliasing">안티-에일리어싱 방법</string>
143 <string name="renderer_force_max_clock">최대 클럭 강제 설정 (아드레노만 해당)</string>
144 <string name="renderer_force_max_clock_description">GPU가 가능한 최대 클럭으로 실행되도록 강제합니다 (열 제약 조건은 여전히 적용됩니다).</string>
145 <string name="renderer_asynchronous_shaders">비동기 셰이더 사용</string>
146 <string name="renderer_asynchronous_shaders_description">셰이더를 비동기식으로 컴파일하므로 끊김 현상이 줄어들지만 글리치가 발생할 수 있습니다.</string>
147 <string name="renderer_debug">그래픽 디버깅 활성화</string>
148 <string name="renderer_debug_description">이 옵션을 선택하면 그래픽 API가 느린 디버깅 모드로 전환됩니다.</string>
149 <string name="use_disk_shader_cache">디스크 셰이더 캐시 사용</string>
150 <string name="use_disk_shader_cache_description">생성된 셰이더를 디스크에 저장하고 불러오기하여 끊김 현상을 줄입니다.</string>
151
152 <!-- Audio settings strings -->
153 <string name="audio_volume">볼륨</string>
154 <string name="audio_volume_description">오디오 출력의 볼륨을 지정합니다.</string>
155
156 <!-- Miscellaneous -->
157 <string name="slider_default">기본값</string>
158 <string name="ini_saved">저장된 설정</string>
159 <string name="gameid_saved">%1$s를 위해 저장된 설정</string>
160 <string name="error_saving">%1$s.ini 저장 중 오류: %2$s</string>
161 <string name="loading">불러오기 중...</string>
162 <string name="reset_setting_confirmation">이 설정을 기본값으로 되돌리겠습니까?</string>
163 <string name="reset_to_default">기본값으로 재설정</string>
164 <string name="reset_all_settings">모든 설정을 초기화하겠습니까?</string>
165 <string name="reset_all_settings_description">모든 고급 설정이 기본 구성으로 재설정됩니다. 이 설정은 되돌릴 수 없습니다.</string>
166 <string name="settings_reset">설정 초기화</string>
167 <string name="close">닫기</string>
168 <string name="learn_more">자세히 알아보기</string>
169
170 <!-- GPU driver installation -->
171 <string name="select_gpu_driver">GPU 드라이버 선택</string>
172 <string name="select_gpu_driver_title">현재 사용 중인 GPU 드라이버를 교체하겠습니까?</string>
173 <string name="select_gpu_driver_install">설치</string>
174 <string name="select_gpu_driver_default">기본값</string>
175 <string name="select_gpu_driver_install_success">설치된 %s</string>
176 <string name="select_gpu_driver_use_default">기본 GPU 드라이버 사용</string>
177 <string name="select_gpu_driver_error">시스템 기본값을 사용하여 잘못된 드라이버를 선택했습니다!</string>
178 <string name="system_gpu_driver">시스템 GPU 드라이버</string>
179 <string name="installing_driver">드라이버 설치 중...</string>
180
181 <!-- Preferences Screen -->
182 <string name="preferences_settings">설정</string>
183 <string name="preferences_general">일반</string>
184 <string name="preferences_system">시스템</string>
185 <string name="preferences_graphics">그래픽</string>
186 <string name="preferences_audio">오디오</string>
187 <string name="preferences_theme">테마 및 색상</string>
188
189 <!-- ROM loading errors -->
190 <string name="loader_error_encrypted">롬이 암호화되었음</string>
191 <string name="loader_error_encrypted_roms_description"><![CDATA[가이드에 따라 <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-cartridge-games\">게임 카트리지</a> 또는 <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-installed-titles-eshop\">설치된 타이틀</a>를 다시 덤프하세요.]]></string>
192 <string name="loader_error_encrypted_keys_description"><![CDATA[P게임을 해독할 수 있도록 <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-prodkeys-and-titlekeys\">prod.keys</a> 파일이 설치되어 있는지 확인하세요.]]></string>
193 <string name="loader_error_video_core">비디오 코어를 초기화하는 동안 오류 발생</string>
194 <string name="loader_error_video_core_description">이 문제는 일반적으로 호환되지 않는 GPU 드라이버로 인해 발생합니다. 사용자 지정 GPU 드라이버를 설치하면 이 문제가 해결될 수 있습니다.</string>
195 <string name="loader_error_invalid_format">롬을 불러올 수 없음</string>
196 <string name="loader_error_file_not_found">롬 파일이 존재하지 않음</string>
197
198 <!-- Emulation Menu -->
199 <string name="emulation_exit">에뮬레이션 종료</string>
200 <string name="emulation_done">완료</string>
201 <string name="emulation_fps_counter">FPS 카운터</string>
202 <string name="emulation_toggle_controls">토글 제어</string>
203 <string name="emulation_rel_stick_center">상대 스틱 센터</string>
204 <string name="emulation_dpad_slide">십자패드 슬라이드</string>
205 <string name="emulation_haptics">햅틱</string>
206 <string name="emulation_show_overlay">오버레이 표시</string>
207 <string name="emulation_toggle_all">모두 토글</string>
208 <string name="emulation_control_adjust">오버레이 조정</string>
209 <string name="emulation_control_scale">스케일</string>
210 <string name="emulation_control_opacity">불투명도</string>
211 <string name="emulation_touch_overlay_reset">오버레이 재설정</string>
212 <string name="emulation_touch_overlay_edit">오버레이 편집</string>
213 <string name="emulation_pause">에뮬레이션 일시 중지</string>
214 <string name="emulation_unpause">에뮬레이션 일시 중지 해제</string>
215 <string name="emulation_input_overlay">오버레이 옵션</string>
216 <string name="emulation_game_loading">게임 불러오기 중...</string>
217
218 <string name="load_settings">설정 불러오기 중...</string>
219
220 <!-- Software keyboard -->
221 <string name="software_keyboard">가상 키보드</string>
222
223 <!-- Errors and warnings -->
224 <string name="abort_button">정보</string>
225 <string name="continue_button">계속</string>
226 <string name="system_archive_not_found">시스템 아카이브를 찾을 수 없음</string>
227 <string name="system_archive_not_found_message">%s가 누락되었습니다. 시스템 아카이브를 덤프하세요.\n에뮬레이션을 계속하면 충돌 및 버그가 발생할 수 있습니다.</string>
228 <string name="system_archive_general">시스템 아카이브</string>
229 <string name="save_load_error">저장하기/불러오기 오류</string>
230 <string name="fatal_error">치명적인 오류</string>
231 <string name="fatal_error_message">치명적인 오류가 발생했습니다. 자세한 내용은 로그를 확인하십시오.\n에뮬레이션을 계속하면 충돌 및 버그가 발생할 수 있습니다.</string>
232 <string name="performance_warning">이 설정을 끄면 에뮬레이션 성능이 크게 저하됩니다! 최상의 환경을 위해 이 설정을 활성화된 상태로 두는 것이 좋습니다.</string>
233
234 <!-- Region Names -->
235 <string name="region_japan">일본</string>
236 <string name="region_usa">미국</string>
237 <string name="region_europe">유럽</string>
238 <string name="region_australia">호주</string>
239 <string name="region_china">중국</string>
240 <string name="region_korea">대한민국</string>
241 <string name="region_taiwan">타이완</string>
242
243 <!-- Language Names -->
244 <string name="language_japanese">일본어 (日本語)</string>
245 <string name="language_english">영어 (English)</string>
246 <string name="language_french">프랑스어 (Français)</string>
247 <string name="langauge_german">독일어(Deutsch)</string>
248 <string name="language_italian">이탈리아어 (Italiano)</string>
249 <string name="language_spanish">스페인어 (Español)</string>
250 <string name="language_chinese">중국어 (简体中文)</string>
251 <string name="language_korean">한국어 (Korean)</string>
252 <string name="language_dutch">네덜란드어 (Nederlands)</string>
253 <string name="language_portuguese">포르투갈어 (Português)</string>
254 <string name="language_russian">러시아어 (Русский)</string>
255 <string name="language_taiwanese">대만어 (台湾)</string>
256 <string name="language_british_english">영어 (British English)</string>
257 <string name="language_canadian_french">캐나다 프랑스어 (Français canadien)</string>
258 <string name="language_latin_american_spanish">라틴 아메리카 스페인어 (Español latinoamericano)</string>
259 <string name="language_simplified_chinese">중국어 간체 (简体中文)</string>
260 <string name="language_traditional_chinese">중국어 번체 (正體中文)</string>
261 <string name="language_brazilian_portuguese">브라질 포르투갈어 (Português do Brasil)</string>
262
263 <!-- Renderer APIs -->
264 <string name="renderer_vulkan">불칸</string>
265 <string name="renderer_none">없음</string>
266
267 <!-- Renderer Accuracy -->
268 <string name="renderer_accuracy_normal">보통</string>
269 <string name="renderer_accuracy_high">높음</string>
270 <string name="renderer_accuracy_extreme">극한 (느림)</string>
271
272 <!-- Resolutions -->
273 <string name="resolution_half">0.5X (360p/540p)</string>
274 <string name="resolution_three_quarter">0.75X (540p/810p)</string>
275 <string name="resolution_one">1X (720p/1080p)</string>
276 <string name="resolution_two">2X (1440p/2160p) (느림)</string>
277 <string name="resolution_three">3X (2160p/3240p) (느림)</string>
278 <string name="resolution_four">4X (2880p/4320p) (느림)</string>
279
280 <!-- Renderer VSync -->
281 <string name="renderer_vsync_immediate">즉시 (끔)</string>
282 <string name="renderer_vsync_mailbox">메일박스</string>
283 <string name="renderer_vsync_fifo">FIFO (켬)</string>
284 <string name="renderer_vsync_fifo_relaxed">FIFO 릴랙스</string>
285
286 <!-- Scaling Filters -->
287 <string name="scaling_filter_nearest_neighbor">가장 가까운 이웃</string>
288 <string name="scaling_filter_bilinear">이중선형</string>
289 <string name="scaling_filter_bicubic">고등차수보간</string>
290 <string name="scaling_filter_gaussian">가우시안</string>
291 <string name="scaling_filter_scale_force">스케일포스</string>
292 <string name="scaling_filter_fsr">AMD FidelityFX™ 초고해상도</string>
293
294 <!-- Anti-Aliasing -->
295 <string name="anti_aliasing_none">없음</string>
296 <string name="anti_aliasing_fxaa">FXAA</string>
297 <string name="anti_aliasing_smaa">SMAA</string>
298
299 <!-- Aspect Ratios -->
300 <string name="ratio_default">기본 (16:9)</string>
301 <string name="ratio_force_four_three">강제 4:3</string>
302 <string name="ratio_force_twenty_one_nine">강제 21:9</string>
303 <string name="ratio_force_sixteen_ten">강제 16:10</string>
304 <string name="ratio_stretch">창에 맞게 늘림</string>
305
306 <!-- CPU Accuracy -->
307 <string name="cpu_accuracy_accurate">정확함</string>
308 <string name="cpu_accuracy_unsafe">안전하지 않음</string>
309 <string name="cpu_accuracy_paranoid">편집증 (느림)</string>
310
311 <!-- Gamepad Buttons -->
312 <string name="gamepad_d_pad">십자패드</string>
313 <string name="gamepad_left_stick">L 스틱</string>
314 <string name="gamepad_right_stick">R 스틱</string>
315 <string name="gamepad_home">홈</string>
316 <string name="gamepad_screenshot">스크린샷</string>
317
318 <!-- Disk shader cache -->
319 <string name="preparing_shaders">셰이더 준비하기</string>
320 <string name="building_shaders">셰이더 빌드 중</string>
321
322 <!-- Theme options -->
323 <string name="change_app_theme">앱 테마 변경</string>
324 <string name="theme_default">기본값</string>
325 <string name="theme_material_you">Material You</string>
326
327 <!-- Theme Modes -->
328 <string name="change_theme_mode">테마 모드 변경</string>
329 <string name="theme_mode_follow_system">팔로우 시스템</string>
330 <string name="theme_mode_light">밝음</string>
331 <string name="theme_mode_dark">어두움</string>
332
333 <!-- Black backgrounds theme -->
334 <string name="use_black_backgrounds">검은색 배경 사용</string>
335 <string name="use_black_backgrounds_description">어두운 테마를 사용할 때는 검은색 배경을 적용합니다.</string>
336
337</resources>
diff --git a/src/android/app/src/main/res/values-nb/strings.xml b/src/android/app/src/main/res/values-nb/strings.xml
new file mode 100644
index 000000000..3e1f9bce5
--- /dev/null
+++ b/src/android/app/src/main/res/values-nb/strings.xml
@@ -0,0 +1,337 @@
1<?xml version="1.0" encoding="utf-8"?>
2<resources>
3
4 <string name="app_disclaimer">Denne programvaren vil kjøre spill for Nintendo Switch-spillkonsollen. Ingen spilltitler eller nøkler er inkludert.&lt;br /&gt;&lt;br /&gt;Før du begynner, må du finne <![CDATA[<b> prod.keys </b>]]> filen din på enhetslagringen.&lt;br /&gt;&lt;br /&gt;<![CDATA[<a href=\"https://yuzu-emu.org/help/quickstart\">Lær mer</a>]]></string>
5 <string name="emulation_notification_channel_name">Emulering er aktiv</string>
6 <string name="emulation_notification_channel_description">Viser et vedvarende varsel når emuleringen kjører.</string>
7 <string name="emulation_notification_running">Yuzu kjører</string>
8 <string name="notice_notification_channel_name">Merknader og feil</string>
9 <string name="notice_notification_channel_description">Viser varsler når noe går galt.</string>
10 <string name="notification_permission_not_granted">Varslingstillatelse ikke gitt!</string>
11
12 <!-- Setup strings -->
13 <string name="welcome">Velkommen!</string>
14 <string name="welcome_description">Lær å sette opp &lt;b>yuzu&lt;/b> og hopp inn i emulering.</string>
15 <string name="get_started">Kom i gang</string>
16 <string name="keys">Nøkler</string>
17 <string name="keys_description">Velg din &lt;b>prod.keys&lt;/b> fil ved å bruke knappen under.</string>
18 <string name="select_keys">Velg nøkler</string>
19 <string name="games">Spill</string>
20 <string name="games_description">Velg din &lt;b>Spill&lt;/b> mappe ved å bruke knappen under.</string>
21 <string name="done">Ferdig</string>
22 <string name="done_description">Nå er du klar.\nGled deg til å spille!</string>
23 <string name="text_continue">Fortsett</string>
24 <string name="next">Neste</string>
25 <string name="back">Tilbake</string>
26 <string name="add_games">Legg til spill</string>
27 <string name="add_games_description">Velg din spillmappe</string>
28
29 <!-- Home strings -->
30 <string name="home_games">Spill</string>
31 <string name="home_search">Søk</string>
32 <string name="home_settings">Innstillinger</string>
33 <string name="empty_gamelist">Ingen filer ble funnet eller ingen spillkatalog er valgt ennå.</string>
34 <string name="search_and_filter_games">Søk og filtrer spill</string>
35 <string name="select_games_folder">Velg spillmappe</string>
36 <string name="select_games_folder_description">Gjør det mulig for yuzu å fylle ut spillelisten.</string>
37 <string name="add_games_warning">Hoppe over valg av spillmappe?</string>
38 <string name="add_games_warning_description">Spill vises ikke i Spill-listen hvis en mappe ikke er valgt.</string>
39 <string name="add_games_warning_help">https://yuzu-emu.org/help/quickstart/#dumping-games</string>
40 <string name="home_search_games">Søk i spill</string>
41 <string name="games_dir_selected">Spillkatalogen er valgt</string>
42 <string name="install_prod_keys">Installer prod.keys</string>
43 <string name="install_prod_keys_description">Nødvendig for å dekryptere spill</string>
44 <string name="install_prod_keys_warning">Hoppe over å legge til nøkler?</string>
45 <string name="install_prod_keys_warning_description">Gyldige nøkler er påkrevd for å emulere spill. Bare hjemmebryggede apper vil fungere hvis du fortsetter.</string>
46 <string name="install_prod_keys_warning_help">https://yuzu-emu.org/help/quickstart/#guide-introduction</string>
47 <string name="notifications">Varsler</string>
48 <string name="notifications_description">Gi varslingstillatelse med knappen nedenfor.</string>
49 <string name="give_permission">Gi tillatelse</string>
50 <string name="notification_warning">Hoppe over å gi tillatelse til varsling?</string>
51 <string name="notification_warning_description">yuzu vil ikke kunne varsle deg om viktig informasjon.</string>
52 <string name="permission_denied">Tillatelse avslått</string>
53 <string name="permission_denied_description">Du har nektet denne tillatelsen for mange ganger, og nå må du gi den manuelt i systeminnstillingene.</string>
54 <string name="about">Om</string>
55 <string name="about_description">Byggeversjon, kildehenvisninger og mer</string>
56 <string name="warning_help">Hjelp</string>
57 <string name="warning_skip">Hopp over</string>
58 <string name="warning_cancel">Avbryt</string>
59 <string name="install_amiibo_keys">Installer Amiibo-nøkler</string>
60 <string name="install_amiibo_keys_description">Kreves for å bruke Amiibo i spillet</string>
61 <string name="invalid_keys_file">Ugyldig nøkkelfil valgt</string>
62 <string name="install_keys_success">Nøkler vellykket installert</string>
63 <string name="reading_keys_failure">Feil ved lesing av krypteringsnøkler</string>
64 <string name="invalid_keys_error">Ugyldige krypteringsnøkler</string>
65 <string name="dumping_keys_quickstart_link">https://yuzu-emu.org/help/quickstart/#dumping-decryption-keys</string>
66 <string name="install_keys_failure_description">Den valgte filen er feil eller ødelagt. Vennligst dump nøklene på nytt.</string>
67 <string name="install_gpu_driver">Installer GPU-driver</string>
68 <string name="install_gpu_driver_description">Installer alternative drivere for potensielt bedre ytelse eller nøyaktighet.</string>
69 <string name="advanced_settings">Avanserte innstillinger</string>
70 <string name="settings_description">Konfigurere emulatorinnstillinger</string>
71 <string name="search_recently_played">Nylig spilt</string>
72 <string name="search_recently_added">Nylig lagt til</string>
73 <string name="search_retail">Butikkhandel</string>
74 <string name="search_homebrew">Homebrew</string>
75 <string name="open_user_folder">Åpne yuzu-mappen</string>
76 <string name="open_user_folder_description">Administrere yuzus interne filer</string>
77 <string name="theme_and_color_description">Endre appens utseende</string>
78 <string name="no_file_manager">Ingen filbehandler funnet</string>
79 <string name="notification_no_directory_link">Kunne ikke åpne yuzu-katalogen</string>
80 <string name="notification_no_directory_link_description">Finn brukermappen manuelt med filbehandlingens sidepanel.</string>
81 <string name="manage_save_data">Administrere lagringsdata</string>
82 <string name="manage_save_data_description">Lagringsdata funnet. Velg et alternativ nedenfor.</string>
83 <string name="import_export_saves_description">Importer eller eksporter lagringsfiler</string>
84 <string name="import_export_saves_no_profile">Ingen lagringsdata funnet. Start et nytt spill og prøv på nytt.</string>
85 <string name="save_file_imported_success">Vellykket import</string>
86 <string name="save_file_invalid_zip_structure">Ugyldig struktur for lagringskatalog</string>
87 <string name="save_file_invalid_zip_structure_description">Det første undermappenavnet må være spillets tittel-ID.</string>
88 <string name="import_saves">Importer</string>
89 <string name="export_saves">Eksporter</string>
90
91 <!-- About screen strings -->
92 <string name="gaia_is_not_real">Gaia er ikke ekte</string>
93 <string name="copied_to_clipboard">Kopiert til utklippstavlen</string>
94 <string name="about_app_description">En Switch-emulator med åpen kildekode</string>
95 <string name="contributors">Bidragsytere</string>
96 <string name="contributors_description">Laget med \u2764 fra yuzu-teamet</string>
97 <string name="contributors_link">https://github.com/yuzu-emu/yuzu/graphs/contributors</string>
98 <string name="build">Bygg</string>
99 <string name="support_link">https://discord.gg/u77vRWY</string>
100 <string name="website_link">https://yuzu-emu.org/</string>
101 <string name="github_link">https://github.com/yuzu-emu</string>
102
103 <!-- Early access upgrade strings -->
104 <string name="early_access">Tidlig tilgang</string>
105 <string name="get_early_access">Få tidlig tilgang</string>
106 <string name="play_store_link">https://play.google.com/store/apps/details?id=org.yuzu.yuzu_emu.ea</string>
107 <string name="get_early_access_description">Banebrytende funksjoner, tidlig tilgang til oppdateringer og mye mer.</string>
108 <string name="early_access_benefits">Fordeler ved tidlig tilgang</string>
109 <string name="cutting_edge_features">Avanserte funksjoner</string>
110 <string name="early_access_updates">Tidlig tilgang til oppdateringer</string>
111 <string name="no_manual_installation">Ingen manuell installasjon</string>
112 <string name="prioritized_support">Prioritert støtte</string>
113 <string name="helping_game_preservation">Bidra til bevaring av spill</string>
114 <string name="our_eternal_gratitude">Vår evige takknemlighet</string>
115 <string name="are_you_interested">Er du interessert?</string>
116
117 <!-- General settings strings -->
118 <string name="frame_limit_enable">Aktiver hastighetsbegrensning</string>
119 <string name="frame_limit_enable_description">Når aktivert, begrenses emuleringshastigheten til en angitt prosentandel av normal hastighet.</string>
120 <string name="frame_limit_slider">Hastighetsbegrensning i prosent</string>
121 <string name="frame_limit_slider_description">Angir prosentandelen som skal begrense emuleringshastigheten. Med standardverdien 100 % vil emuleringen være begrenset til normal hastighet. Høyere eller lavere verdier vil øke eller redusere hastighetsbegrensningen.</string>
122 <string name="cpu_accuracy">CPU-nøyaktighet</string>
123
124 <!-- System settings strings -->
125 <string name="use_docked_mode">Dokket modus</string>
126 <string name="use_docked_mode_description">Emulerer i dokket modus, noe som øker oppløsningen på bekostning av ytelsen.</string>
127 <string name="emulated_region">Emulert region</string>
128 <string name="emulated_language">Emulert språk</string>
129 <string name="select_rtc_date">Velg RTC-dato</string>
130 <string name="select_rtc_time">Velg RTC-tid</string>
131 <string name="use_custom_rtc">Aktiver egendefinert RTC</string>
132 <string name="use_custom_rtc_description">Med denne innstillingen kan du stille inn en egendefinert sanntidsklokke som er atskilt fra gjeldende systemtid.</string>
133 <string name="set_custom_rtc">Angi egendefinert RTC</string>
134
135 <!-- Graphics settings strings -->
136 <string name="renderer_api">API</string>
137 <string name="renderer_accuracy">Nøyaktighetsnivå</string>
138 <string name="renderer_resolution">Oppløsning</string>
139 <string name="renderer_vsync">VSync-modus</string>
140 <string name="renderer_aspect_ratio">Størrelsesforhold</string>
141 <string name="renderer_scaling_filter">Filter for vindustilpasning</string>
142 <string name="renderer_anti_aliasing">Anti-Aliasing-metode</string>
143 <string name="renderer_force_max_clock">Tving fram maksimal klokkefrekvens (kun Adreno)</string>
144 <string name="renderer_force_max_clock_description">Tvinger GPU-en til å kjøre med maksimal klokkefrekvens (termiske begrensninger vil fortsatt gjelde).</string>
145 <string name="renderer_asynchronous_shaders">Bruk asynkrone shaders</string>
146 <string name="renderer_asynchronous_shaders_description">Kompilerer shaders asynkront, noe som reduserer hakkingen, men kan føre til feil.</string>
147 <string name="renderer_debug">Aktiver feilsøking av grafikk</string>
148 <string name="renderer_debug_description">Når dette er merket av, går grafikk-API-et inn i en langsommere feilsøkingsmodus.</string>
149 <string name="use_disk_shader_cache">Bruk disk shader-cache</string>
150 <string name="use_disk_shader_cache_description">Reduser hakking ved å lagre og laste inn genererte shaders på disken.</string>
151
152 <!-- Audio settings strings -->
153 <string name="audio_volume">Volum</string>
154 <string name="audio_volume_description">Angir volumet på lydutgangen.</string>
155
156 <!-- Miscellaneous -->
157 <string name="slider_default">Standard</string>
158 <string name="ini_saved">Lagrede innstillinger</string>
159 <string name="gameid_saved">Lagrede innstillinger for %1$s</string>
160 <string name="error_saving">Feil ved lagring av %1$s.ini: %2$s</string>
161 <string name="loading">Lastes inn...</string>
162 <string name="reset_setting_confirmation">Vil du tilbakestille denne innstillingen til standardverdien?</string>
163 <string name="reset_to_default">Tilbakestill til standardinnstillingene</string>
164 <string name="reset_all_settings">Tilbakestille alle innstillinger?</string>
165 <string name="reset_all_settings_description">Alle avanserte innstillinger tilbakestilles til standardkonfigurasjonen. Dette kan ikke angres.</string>
166 <string name="settings_reset">Tilbakestilling av innstillinger</string>
167 <string name="close">Lukk</string>
168 <string name="learn_more">Lær Mer</string>
169
170 <!-- GPU driver installation -->
171 <string name="select_gpu_driver">Velg GPU-driver</string>
172 <string name="select_gpu_driver_title">Ønsker du å bytte ut din nåværende GPU-driver?</string>
173 <string name="select_gpu_driver_install">Installer</string>
174 <string name="select_gpu_driver_default">Standard</string>
175 <string name="select_gpu_driver_install_success">Installert %s</string>
176 <string name="select_gpu_driver_use_default">Bruk av standard GPU-driver</string>
177 <string name="select_gpu_driver_error">Ugyldig driver valgt, bruker systemstandard!</string>
178 <string name="system_gpu_driver">Systemets GPU-driver</string>
179 <string name="installing_driver">Installerer driver...</string>
180
181 <!-- Preferences Screen -->
182 <string name="preferences_settings">Innstillinger</string>
183 <string name="preferences_general">Generelt</string>
184 <string name="preferences_system">System</string>
185 <string name="preferences_graphics">Grafikk</string>
186 <string name="preferences_audio">Lyd</string>
187 <string name="preferences_theme">Tema og farge</string>
188
189 <!-- ROM loading errors -->
190 <string name="loader_error_encrypted">ROM-en din er kryptert</string>
191 <string name="loader_error_encrypted_roms_description"><![CDATA[Følg veiledningene for å redumpe dine <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-cartridge-games\">spillkassetter</a> eller <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-installed-titles-eshop\">installerte titler</a>.]]></string>
192 <string name="loader_error_encrypted_keys_description"><![CDATA[Vennligst sørg for at <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-prodkeys-and-titlekeys\">prod.keys</a> filen er installert slik at spillene kan dekrypteres.]]></string>
193 <string name="loader_error_video_core">Det oppstod en feil ved initialisering av videokjernen</string>
194 <string name="loader_error_video_core_description">Dette skyldes vanligvis en inkompatibel GPU-driver. Installering av en tilpasset GPU-driver kan løse problemet.</string>
195 <string name="loader_error_invalid_format">Kunne ikke laste inn ROM</string>
196 <string name="loader_error_file_not_found">ROM-filen finnes ikke</string>
197
198 <!-- Emulation Menu -->
199 <string name="emulation_exit">Avslutt emulering</string>
200 <string name="emulation_done">Ferdig</string>
201 <string name="emulation_fps_counter">FPS-teller</string>
202 <string name="emulation_toggle_controls">Veksle kontroller</string>
203 <string name="emulation_rel_stick_center">Relativt senter for stikken</string>
204 <string name="emulation_dpad_slide">DPad-skyveplate</string>
205 <string name="emulation_haptics">Haptikk</string>
206 <string name="emulation_show_overlay">Vis overlegg</string>
207 <string name="emulation_toggle_all">Slå av alt</string>
208 <string name="emulation_control_adjust">Juster overlegg</string>
209 <string name="emulation_control_scale">Skaler</string>
210 <string name="emulation_control_opacity">Gjennomsiktighet</string>
211 <string name="emulation_touch_overlay_reset">Tilbakestill overlegg</string>
212 <string name="emulation_touch_overlay_edit">Rediger overlegg</string>
213 <string name="emulation_pause">Pause Emulering</string>
214 <string name="emulation_unpause">Opphev pausing av emulering</string>
215 <string name="emulation_input_overlay">Alternativer for overlegg</string>
216 <string name="emulation_game_loading">Spillet lastes inn...</string>
217
218 <string name="load_settings">Laster inn innstillinger...</string>
219
220 <!-- Software keyboard -->
221 <string name="software_keyboard">Programvare Tastatur</string>
222
223 <!-- Errors and warnings -->
224 <string name="abort_button">Avbryt</string>
225 <string name="continue_button">Fortsett</string>
226 <string name="system_archive_not_found">System Arkiv Ikke Funnet</string>
227 <string name="system_archive_not_found_message">%s mangler. Dump systemarkivene dine.\nFortsatt emulering kan føre til krasj og feil.</string>
228 <string name="system_archive_general">Et systemarkiv</string>
229 <string name="save_load_error">Feil ved lagring/innlasting</string>
230 <string name="fatal_error">Fatal Feil</string>
231 <string name="fatal_error_message">Det oppstod en fatal feil. Sjekk loggen for mer informasjon.\nFortsatt emulering kan føre til krasj og feil.</string>
232 <string name="performance_warning">Hvis du slår av denne innstillingen, reduseres emuleringsytelsen betydelig! Vi anbefaler at du lar denne innstillingen være aktivert for å få den beste opplevelsen.</string>
233
234 <!-- Region Names -->
235 <string name="region_japan">Japan</string>
236 <string name="region_usa">USA</string>
237 <string name="region_europe">Europa</string>
238 <string name="region_australia">Australia</string>
239 <string name="region_china">Kina</string>
240 <string name="region_korea">Korea</string>
241 <string name="region_taiwan">Taiwan</string>
242
243 <!-- Language Names -->
244 <string name="language_japanese">Japansk (日本語)</string>
245 <string name="language_english">Engelsk</string>
246 <string name="language_french">Fransk (Français)</string>
247 <string name="langauge_german">Tysk (Deutsch)</string>
248 <string name="language_italian">Italiensk (Italiano)</string>
249 <string name="language_spanish">Spansk (Español)</string>
250 <string name="language_chinese">Kinesisk (简体中文)</string>
251 <string name="language_korean">Koreansk (한국어)</string>
252 <string name="language_dutch">Nederlandsk (Nederlands)</string>
253 <string name="language_portuguese">Portugisisk (Português)</string>
254 <string name="language_russian">Russisk (Русский)</string>
255 <string name="language_taiwanese">Taiwansk (台湾)</string>
256 <string name="language_british_english">Britisk Engelsk</string>
257 <string name="language_canadian_french">Kanadisk fransk (Français canadien)</string>
258 <string name="language_latin_american_spanish">Latinamerikansk spansk (Español latinoamericano)</string>
259 <string name="language_simplified_chinese">Forenklet kinesisk (简体中文)</string>
260 <string name="language_traditional_chinese">Tradisjonell Kinesisk (正體中文)</string>
261 <string name="language_brazilian_portuguese">Brasiliansk portugisisk (Português do Brasil)</string>
262
263 <!-- Renderer APIs -->
264 <string name="renderer_vulkan">Vulkan</string>
265 <string name="renderer_none">Ingen</string>
266
267 <!-- Renderer Accuracy -->
268 <string name="renderer_accuracy_normal">Normal</string>
269 <string name="renderer_accuracy_high">Høy</string>
270 <string name="renderer_accuracy_extreme">Ekstrem (Treg)</string>
271
272 <!-- Resolutions -->
273 <string name="resolution_half">0.5X (360p/540p)</string>
274 <string name="resolution_three_quarter">0.75X (540p/810p)</string>
275 <string name="resolution_one">1X (720p/1080p)</string>
276 <string name="resolution_two">2X (1440p/2160p) (Slow)</string>
277 <string name="resolution_three">3X (2160p/3240p) (Slow)</string>
278 <string name="resolution_four">4X (2880p/4320p) (Slow)</string>
279
280 <!-- Renderer VSync -->
281 <string name="renderer_vsync_immediate">Umiddelbar (av)</string>
282 <string name="renderer_vsync_mailbox">Postkasse</string>
283 <string name="renderer_vsync_fifo">FIFO (På)</string>
284 <string name="renderer_vsync_fifo_relaxed">FIFO avslappet</string>
285
286 <!-- Scaling Filters -->
287 <string name="scaling_filter_nearest_neighbor">Nærmeste nabo</string>
288 <string name="scaling_filter_bilinear">Bilineær</string>
289 <string name="scaling_filter_bicubic">Bikubisk</string>
290 <string name="scaling_filter_gaussian">Gaussisk</string>
291 <string name="scaling_filter_scale_force">ScaleForce</string>
292 <string name="scaling_filter_fsr">AMD FidelityFX™ Super Resolution</string>
293
294 <!-- Anti-Aliasing -->
295 <string name="anti_aliasing_none">Ingen</string>
296 <string name="anti_aliasing_fxaa">FXAA</string>
297 <string name="anti_aliasing_smaa">SMAA</string>
298
299 <!-- Aspect Ratios -->
300 <string name="ratio_default">Standard (16:9)</string>
301 <string name="ratio_force_four_three">Tving 4:3</string>
302 <string name="ratio_force_twenty_one_nine">Tving 21:9</string>
303 <string name="ratio_force_sixteen_ten">Tving 16:10</string>
304 <string name="ratio_stretch">Strekk til Vindu</string>
305
306 <!-- CPU Accuracy -->
307 <string name="cpu_accuracy_accurate">Nøyaktig</string>
308 <string name="cpu_accuracy_unsafe">Utrygt</string>
309 <string name="cpu_accuracy_paranoid">Paranoid (Langsom)</string>
310
311 <!-- Gamepad Buttons -->
312 <string name="gamepad_d_pad">D-Pad</string>
313 <string name="gamepad_left_stick">Venstre Pinne</string>
314 <string name="gamepad_right_stick">Høyre Pinne</string>
315 <string name="gamepad_home">Hjem</string>
316 <string name="gamepad_screenshot">Skjermbilde</string>
317
318 <!-- Disk shader cache -->
319 <string name="preparing_shaders">Forberedelse av shaders</string>
320 <string name="building_shaders">Bygging av shaders</string>
321
322 <!-- Theme options -->
323 <string name="change_app_theme">Endre appens tema</string>
324 <string name="theme_default">Standard</string>
325 <string name="theme_material_you">Material You</string>
326
327 <!-- Theme Modes -->
328 <string name="change_theme_mode">Endre temamodus</string>
329 <string name="theme_mode_follow_system">Følg systemet</string>
330 <string name="theme_mode_light">Lys</string>
331 <string name="theme_mode_dark">Mørk</string>
332
333 <!-- Black backgrounds theme -->
334 <string name="use_black_backgrounds">Bruk svart bakgrunn</string>
335 <string name="use_black_backgrounds_description">Bruk svart bakgrunn når du bruker det mørke temaet.</string>
336
337</resources>
diff --git a/src/android/app/src/main/res/values-pl/strings.xml b/src/android/app/src/main/res/values-pl/strings.xml
new file mode 100644
index 000000000..1cd1a8f87
--- /dev/null
+++ b/src/android/app/src/main/res/values-pl/strings.xml
@@ -0,0 +1,337 @@
1<?xml version="1.0" encoding="utf-8"?>
2<resources>
3
4 <string name="app_disclaimer">To oprogramowanie umożliwia uruchomienie gier z konsoli Nintendo Switch. Nie zawiera gier ani wymaganych kluczy.&lt;br /&gt;&lt;br /&gt;Zanim zaczniesz, wybierz plik kluczy <![CDATA[<b> prod.keys </b>]]> z katalogu w pamięci masowej.&lt;br /&gt;&lt;br /&gt;<![CDATA[<a href=\"https://yuzu-emu.org/help/quickstart\">Dowiedz się więcej</a>]]></string>
5 <string name="emulation_notification_channel_name">Emulacja jest uruchomiona</string>
6 <string name="emulation_notification_channel_description">Pokaż trwałe powiadomienie gdy emulacja jest uruchomiona.</string>
7 <string name="emulation_notification_running">yuzu jest uruchomiony</string>
8 <string name="notice_notification_channel_name">Powiadomienia błędy</string>
9 <string name="notice_notification_channel_description">Pokaż powiadomienie gdy coś pójdzie źle</string>
10 <string name="notification_permission_not_granted">Nie zezwolono na powiadomienia!</string>
11
12 <!-- Setup strings -->
13 <string name="welcome">Witaj!</string>
14 <string name="welcome_description">Zobacz jak skonfigurować &lt;b>yuzu&lt;/b> i wskocz w świat emulacji.</string>
15 <string name="get_started">Zaczynamy</string>
16 <string name="keys">Klucze</string>
17 <string name="keys_description">Wybierz swoje klucze &lt;b>prod.keys&lt;/b> za pomocą przycisku poniżej.</string>
18 <string name="select_keys">Wybierz klucze</string>
19 <string name="games">Gry</string>
20 <string name="games_description">Wybierz katalog z grami &lt;b>Games&lt;/b> za pomocą przycisku poniżej.</string>
21 <string name="done">Gotowe</string>
22 <string name="done_description">Wszystko skonfigurowane.\n Miłego grania!</string>
23 <string name="text_continue">Kontynuuj</string>
24 <string name="next">Dalej</string>
25 <string name="back">Wstecz</string>
26 <string name="add_games">Dodaj gry</string>
27 <string name="add_games_description">Wybierz folder zawierający Twoje gry</string>
28
29 <!-- Home strings -->
30 <string name="home_games">Gry</string>
31 <string name="home_search">Szukaj</string>
32 <string name="home_settings">Ustawienia</string>
33 <string name="empty_gamelist">Nie znaleziono plików, lub nie wybrano jeszcze katalogu zawierającego gry.</string>
34 <string name="search_and_filter_games">Szukaj i filtruj gry</string>
35 <string name="select_games_folder">Wybierz folder z grami</string>
36 <string name="select_games_folder_description">Pozwala yuzu wygenerować listę gier</string>
37 <string name="add_games_warning">Pominąć wybór folderu z grami?</string>
38 <string name="add_games_warning_description">Aby pokazać listę gier wybierz katalog zawierający gry.</string>
39 <string name="add_games_warning_help">https://yuzu-emu.org/help/quickstart/#dumping-games</string>
40 <string name="home_search_games">Szukaj gier</string>
41 <string name="games_dir_selected">Wybrano katalog gier</string>
42 <string name="install_prod_keys">Instaluj klucze prod.keys</string>
43 <string name="install_prod_keys_description">Wymagane aby poprawnie odczytać sklepowe gry</string>
44 <string name="install_prod_keys_warning">Pominąć dodawanie kluczy?</string>
45 <string name="install_prod_keys_warning_description">Poprawne klucze są wymagane aby emulować sklepowe gry. Jeśli przejdziesz dalej, jedynie homebrew będą działać.</string>
46 <string name="install_prod_keys_warning_help">https://yuzu-emu.org/help/quickstart/#guide-introduction</string>
47 <string name="notifications">Powiadomienia</string>
48 <string name="notifications_description">Nadaj uprawnienia dostępu do powiadomień. </string>
49 <string name="give_permission">Nadaj uprawnienia</string>
50 <string name="notification_warning">Pominąć nadanie uprawnień powiadomień?</string>
51 <string name="notification_warning_description">yuzu nie będzie mógł powiadamiać Cię o ważnych informacjach.</string>
52 <string name="permission_denied">Odmowa dostępu</string>
53 <string name="permission_denied_description">Odmówiłeś dostępu do powiadomień zbyt wiele razy, teraz musisz przyznać je w ustawieniach systemowych Androida.</string>
54 <string name="about">O aplikacji</string>
55 <string name="about_description">Wersja, podziękowania i więcej</string>
56 <string name="warning_help">Pomoc</string>
57 <string name="warning_skip">Pomiń</string>
58 <string name="warning_cancel">Anuluj</string>
59 <string name="install_amiibo_keys">Zainstaluj klucze Amiibo</string>
60 <string name="install_amiibo_keys_description">Wymagane aby korzystać z Amiibo w grze</string>
61 <string name="invalid_keys_file">Wybrano niepoprawne klucze</string>
62 <string name="install_keys_success">Klucze zainstalowane pomyślnie</string>
63 <string name="reading_keys_failure">Błąd podczas odczytu kluczy</string>
64 <string name="invalid_keys_error">Niepoprawne klucze</string>
65 <string name="dumping_keys_quickstart_link">https://yuzu-emu.org/help/quickstart/#dumping-decryption-keys</string>
66 <string name="install_keys_failure_description">Wybrany plik jest niepoprawny lub uszkodzony. Zrzuć ponownie swoje klucze.</string>
67 <string name="install_gpu_driver">Zainstaluj sterownik GPU</string>
68 <string name="install_gpu_driver_description">Użyj alternatywnych sterowników aby potencjalnie zwiększyć wydajność i naprawić błędy</string>
69 <string name="advanced_settings">Ustawienia zaawansowane</string>
70 <string name="settings_description">Skonfiguruj ustawienia emulatora</string>
71 <string name="search_recently_played">Ostatnio grane</string>
72 <string name="search_recently_added">Ostatnio dodane</string>
73 <string name="search_retail">Sklepowe</string>
74 <string name="search_homebrew">Homebrew</string>
75 <string name="open_user_folder">Otwórz folder yuzu</string>
76 <string name="open_user_folder_description">Zarządzaj plikami emulatora</string>
77 <string name="theme_and_color_description">Personalizuj wygląd aplikacji</string>
78 <string name="no_file_manager">Nie znaleziono menedżera plików</string>
79 <string name="notification_no_directory_link">Nie można otworzyć folderu emulatora</string>
80 <string name="notification_no_directory_link_description">Proszę wybrać ręcznie folder z pomocą panelu bocznego menedżera plików.</string>
81 <string name="manage_save_data">Zarządzaj plikami zapisów gier</string>
82 <string name="manage_save_data_description">Znaleziono pliki zapisów gier. Wybierz opcję poniżej.</string>
83 <string name="import_export_saves_description">Importuj lub wyeksportuj pliki zapisów</string>
84 <string name="import_export_saves_no_profile">Nie znaleziono plików zapisów. Uruchom grę i spróbuj ponownie.</string>
85 <string name="save_file_imported_success">Zaimportowano pomyślnie</string>
86 <string name="save_file_invalid_zip_structure">Niepoprawna struktura folderów</string>
87 <string name="save_file_invalid_zip_structure_description">Pierwszy podkatalog musi zawierać w nazwie numer ID tytułu gry.</string>
88 <string name="import_saves">Importuj</string>
89 <string name="export_saves">Eksportuj</string>
90
91 <!-- About screen strings -->
92 <string name="gaia_is_not_real">Gaia isn\'t real</string>
93 <string name="copied_to_clipboard">Skopiowano do schowka</string>
94 <string name="about_app_description">Otwarto-źródłowy emulator konsoli Switch</string>
95 <string name="contributors">Współtwórcy</string>
96 <string name="contributors_description">Stworzone z \u2764 przez zespół yuzu</string>
97 <string name="contributors_link">https://github.com/yuzu-emu/yuzu/graphs/contributors</string>
98 <string name="build">Wersja</string>
99 <string name="support_link">https://discord.gg/u77vRWY</string>
100 <string name="website_link">https://yuzu-emu.org/</string>
101 <string name="github_link">https://github.com/yuzu-emu</string>
102
103 <!-- Early access upgrade strings -->
104 <string name="early_access">Wczesny dostęp</string>
105 <string name="get_early_access">Uzyskaj wczesny dostęp</string>
106 <string name="play_store_link">https://play.google.com/store/apps/details?id=org.yuzu.yuzu_emu.ea</string>
107 <string name="get_early_access_description">Nowe funkcje, szybszy dostęp do aktualizacji i nie tylko</string>
108 <string name="early_access_benefits">Korzyści z wcześniejszego dostępu</string>
109 <string name="cutting_edge_features">Nowatorskie funkcje</string>
110 <string name="early_access_updates">Częste aktualizacje</string>
111 <string name="no_manual_installation">Automatyczne aktualizacje</string>
112 <string name="prioritized_support">Priorytetowe wsparcie</string>
113 <string name="helping_game_preservation">Pomoc w problemach z grami</string>
114 <string name="our_eternal_gratitude">Nasza wdzięczność</string>
115 <string name="are_you_interested">Jesteś zainteresowany?</string>
116
117 <!-- General settings strings -->
118 <string name="frame_limit_enable">Włącz limit szybkości emulacji</string>
119 <string name="frame_limit_enable_description">Włącz, aby ustawić procentowy limit szybkości emulacji</string>
120 <string name="frame_limit_slider">Procentowy limit szybkości emulacji</string>
121 <string name="frame_limit_slider_description">Określa limit szybkości emulacji gier. Domyślna wartość 100% oznacza normalną szybkość z jaką działa gra. Wartości niższe lub wyższe zmniejszą lub zwiększą limit szybkości.</string>
122 <string name="cpu_accuracy">Dokładność procesora CPU</string>
123
124 <!-- System settings strings -->
125 <string name="use_docked_mode">Tryb zadokowany</string>
126 <string name="use_docked_mode_description">Emulacja w trybie stacji dokującej, zwiększa rozdzielczość kosztem wydajności.</string>
127 <string name="emulated_region">Region emulacji</string>
128 <string name="emulated_language">Język emulacji</string>
129 <string name="select_rtc_date">Ustaw datę RTC</string>
130 <string name="select_rtc_time">Ustaw czas RTC</string>
131 <string name="use_custom_rtc">Włącz niestandardowy zegar RTC</string>
132 <string name="use_custom_rtc_description">Ta opcja pozwala na wybranie własnych ustawień czasu używanych w czasie emulacji, innych niż czas systemu Android.</string>
133 <string name="set_custom_rtc">Ustaw niestandardowy czas RTC</string>
134
135 <!-- Graphics settings strings -->
136 <string name="renderer_api">Interfejs graficzny</string>
137 <string name="renderer_accuracy">Poziom precyzji emulacji</string>
138 <string name="renderer_resolution">Rozdzielczość</string>
139 <string name="renderer_vsync">Synchronizacja pionowa VSync</string>
140 <string name="renderer_aspect_ratio">Proporcje ekranu</string>
141 <string name="renderer_scaling_filter">Filtr adaptacji rozdzielczości</string>
142 <string name="renderer_anti_aliasing">Metoda wygładzania krawędzi</string>
143 <string name="renderer_force_max_clock">Maksymalne taktowanie GPU (układy Adreno)</string>
144 <string name="renderer_force_max_clock_description">Wymusza uruchomienie maksymalnego taktowania układu graficznego (zabezpieczenia termiczne będą dalej aktywne).</string>
145 <string name="renderer_asynchronous_shaders">Wyłącz synchronizację shaderów</string>
146 <string name="renderer_asynchronous_shaders_description">Kompiluj oświetlenie bez synchronizacji, poprawi wydajność ale może powodować błędy.</string>
147 <string name="renderer_debug">Włącz debugowanie grafiki</string>
148 <string name="renderer_debug_description">Kiedy włączone, interfejs graficzny korzysta z wolnego trybu debugowania błędów.</string>
149 <string name="use_disk_shader_cache">Użyj pamięci podręcznej shaderów na dysku</string>
150 <string name="use_disk_shader_cache_description">Zmniejsza przycięcia przez przechowywanie gotowych wygenerowanych plików oświetlenia w pamięci urządzenia.</string>
151
152 <!-- Audio settings strings -->
153 <string name="audio_volume">Głośność</string>
154 <string name="audio_volume_description">Ustala poziom głośności wyjścia dźwięku.</string>
155
156 <!-- Miscellaneous -->
157 <string name="slider_default">Domyślne</string>
158 <string name="ini_saved">Ustawienia zapisane</string>
159 <string name="gameid_saved">Ustawienia zapisane w %1$s</string>
160 <string name="error_saving">Błąd zapisu %1$s.ini: %2$s</string>
161 <string name="loading">Wczytywanie...</string>
162 <string name="reset_setting_confirmation">Przywrócić wartość tego ustawienia do wartości domyślnej?</string>
163 <string name="reset_to_default">Przywróć ustawienia domyślne</string>
164 <string name="reset_all_settings">Przywrócić WSZYSTKIE ustawienia?</string>
165 <string name="reset_all_settings_description">Wszystkie zaawansowane opcje zostaną przywrócone do wartości domyślnych. Czynności nie będzie można cofnąć.</string>
166 <string name="settings_reset">Reset ustawień</string>
167 <string name="close">Zamknij</string>
168 <string name="learn_more">Dowiedz się więcej</string>
169
170 <!-- GPU driver installation -->
171 <string name="select_gpu_driver">Wybierz sterownik GPU </string>
172 <string name="select_gpu_driver_title">Chcesz zastąpić obecny sterownik układu graficznego?</string>
173 <string name="select_gpu_driver_install">Zainstaluj</string>
174 <string name="select_gpu_driver_default">Domyślne</string>
175 <string name="select_gpu_driver_install_success">Zainstalowano %s</string>
176 <string name="select_gpu_driver_use_default">Aktywny domyślny sterownik GPU</string>
177 <string name="select_gpu_driver_error">Wybrano błędny sterownik, powrót do domyślnego. </string>
178 <string name="system_gpu_driver">Systemowy sterownik GPU</string>
179 <string name="installing_driver">Instalowanie sterownika...</string>
180
181 <!-- Preferences Screen -->
182 <string name="preferences_settings">Ustawienia</string>
183 <string name="preferences_general">Ogólne</string>
184 <string name="preferences_system">System</string>
185 <string name="preferences_graphics">Grafika</string>
186 <string name="preferences_audio">Dźwięk</string>
187 <string name="preferences_theme">Motyw i kolor</string>
188
189 <!-- ROM loading errors -->
190 <string name="loader_error_encrypted">Twój ROM jest zakodowany</string>
191 <string name="loader_error_encrypted_roms_description"><![CDATA[Użyj przewodnika aby wykonać zrzuty <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-cartridge-games\">kardridży</a> lub <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-installed-titles-eshop\">zainstalowanych gier</a>.]]></string>
192 <string name="loader_error_encrypted_keys_description"><![CDATA[Upewnij się że plik kluczy <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-prodkeys-and-titlekeys\">prod.keys</a> jest zainstalowany aby gry mogły zostać odczytane.]]></string>
193 <string name="loader_error_video_core">Błąd inicjacji podsystemu graficznego</string>
194 <string name="loader_error_video_core_description">Zazwyczaj spowodowane niekompatybilnym sterownikiem GPU, instalacja niestandardowego sterownika może rozwiązać ten problem.</string>
195 <string name="loader_error_invalid_format">Nie można wczytać pliku ROM</string>
196 <string name="loader_error_file_not_found">Plik ROM nie istnieje</string>
197
198 <!-- Emulation Menu -->
199 <string name="emulation_exit">Zakończ emulację</string>
200 <string name="emulation_done">Gotowe</string>
201 <string name="emulation_fps_counter">Licznik FPS</string>
202 <string name="emulation_toggle_controls">Wybierz przyciski</string>
203 <string name="emulation_rel_stick_center">Wycentruj gałki</string>
204 <string name="emulation_dpad_slide">Ruchomy DPad</string>
205 <string name="emulation_haptics">Wibracje haptyczne</string>
206 <string name="emulation_show_overlay">Pokaż przyciski</string>
207 <string name="emulation_toggle_all">Zaznacz wszystkie</string>
208 <string name="emulation_control_adjust">Dostosuj nakładkę</string>
209 <string name="emulation_control_scale">Skala</string>
210 <string name="emulation_control_opacity">Przeźroczystość</string>
211 <string name="emulation_touch_overlay_reset">Resetuj</string>
212 <string name="emulation_touch_overlay_edit">Edytuj nakładkę</string>
213 <string name="emulation_pause">Wstrzymaj emulację</string>
214 <string name="emulation_unpause">Wznów emulację</string>
215 <string name="emulation_input_overlay">Opcje nakładki</string>
216 <string name="emulation_game_loading">Wczytywanie gry...</string>
217
218 <string name="load_settings">Wczytywanie ustawień...</string>
219
220 <!-- Software keyboard -->
221 <string name="software_keyboard">Klawiatura systemowa</string>
222
223 <!-- Errors and warnings -->
224 <string name="abort_button">Przerwij</string>
225 <string name="continue_button">Kontynuuj</string>
226 <string name="system_archive_not_found">Archiwum systemu nie znalezione.</string>
227 <string name="system_archive_not_found_message">%s nieznaleziony. Proszę wykonać zrzut archiwum systemu.\nKontynuowanie może powodować błędy lub przerwanie emulacji.</string>
228 <string name="system_archive_general">Archiwum systemu</string>
229 <string name="save_load_error">Błąd odczytu/zapisu</string>
230 <string name="fatal_error">Błąd krytyczny</string>
231 <string name="fatal_error_message">Wystąpił błąd krytyczny. Szczegóły znajdziesz w pliku log.\nKontynuowanie może spowodować błędy lub przerwanie emulacji. </string>
232 <string name="performance_warning">Wyłączenie tej opcji znacząco ograniczy wydajność! Dla najlepszego doświadczenia, zaleca się zostawienie tej opcji włączonej.</string>
233
234 <!-- Region Names -->
235 <string name="region_japan">Japonia</string>
236 <string name="region_usa">USA</string>
237 <string name="region_europe">Europa</string>
238 <string name="region_australia">Australia</string>
239 <string name="region_china">Chiny</string>
240 <string name="region_korea">Korea</string>
241 <string name="region_taiwan">Tajwan</string>
242
243 <!-- Language Names -->
244 <string name="language_japanese">Japoński (日本語)</string>
245 <string name="language_english">Angielski</string>
246 <string name="language_french">Francuski (Francja)</string>
247 <string name="langauge_german">Niemiecki (Niemcy)</string>
248 <string name="language_italian">Włoski (Włochy)</string>
249 <string name="language_spanish">Hiszpański (Hiszpania)</string>
250 <string name="language_chinese">Chiński (简体中文)</string>
251 <string name="language_korean">Koreański (한국어)</string>
252 <string name="language_dutch">Duński (Holandia)</string>
253 <string name="language_portuguese">Portugalski (Portugalia)</string>
254 <string name="language_russian">Rosyjski (Русский)</string>
255 <string name="language_taiwanese">Tajwański (台湾)</string>
256 <string name="language_british_english">Angielski Brytyjski</string>
257 <string name="language_canadian_french">Francuski (Kanada)</string>
258 <string name="language_latin_american_spanish">Hiszpański (Ameryka Latynoska)</string>
259 <string name="language_simplified_chinese">Chiński uproszczony (简体中文)</string>
260 <string name="language_traditional_chinese">Chiński tradycyjny (正體中文)</string>
261 <string name="language_brazilian_portuguese">Portugalski (Brazylia)</string>
262
263 <!-- Renderer APIs -->
264 <string name="renderer_vulkan">Vulkan</string>
265 <string name="renderer_none">Żadny</string>
266
267 <!-- Renderer Accuracy -->
268 <string name="renderer_accuracy_normal">Normalny</string>
269 <string name="renderer_accuracy_high">Wysoki</string>
270 <string name="renderer_accuracy_extreme">Ekstremalny (Wolny)</string>
271
272 <!-- Resolutions -->
273 <string name="resolution_half">0.5X (360p/540p)</string>
274 <string name="resolution_three_quarter">0.75X (540p/810p)</string>
275 <string name="resolution_one">1X (720p/1080p)</string>
276 <string name="resolution_two">2X (1440p/2160p) (Wolno)</string>
277 <string name="resolution_three">3X (2160p/3240p) (Wolno)</string>
278 <string name="resolution_four">4X (2880p/4320p) (Wolno)</string>
279
280 <!-- Renderer VSync -->
281 <string name="renderer_vsync_immediate">Natychmiastowa (Wyłączona)</string>
282 <string name="renderer_vsync_mailbox">Skrzynka pocztowa</string>
283 <string name="renderer_vsync_fifo">FIFO (Włączona)</string>
284 <string name="renderer_vsync_fifo_relaxed">FIFO Relaks</string>
285
286 <!-- Scaling Filters -->
287 <string name="scaling_filter_nearest_neighbor">Najbliższy sąsiadujący</string>
288 <string name="scaling_filter_bilinear">Bilinearny</string>
289 <string name="scaling_filter_bicubic">Bikubiczny</string>
290 <string name="scaling_filter_gaussian">Kulisty</string>
291 <string name="scaling_filter_scale_force">ScaleForce</string>
292 <string name="scaling_filter_fsr">AMD FidelityFX™ Super Resolution</string>
293
294 <!-- Anti-Aliasing -->
295 <string name="anti_aliasing_none">Żadna (wyłączony)</string>
296 <string name="anti_aliasing_fxaa">FXAA</string>
297 <string name="anti_aliasing_smaa">SMAA</string>
298
299 <!-- Aspect Ratios -->
300 <string name="ratio_default">Domyślne (16:9)</string>
301 <string name="ratio_force_four_three">Wymuś 4:3</string>
302 <string name="ratio_force_twenty_one_nine">Wymuś 21:9</string>
303 <string name="ratio_force_sixteen_ten">Wymuś 16:10</string>
304 <string name="ratio_stretch">Rozciągnij do Okna</string>
305
306 <!-- CPU Accuracy -->
307 <string name="cpu_accuracy_accurate">Dokładny</string>
308 <string name="cpu_accuracy_unsafe">Niebezpieczny</string>
309 <string name="cpu_accuracy_paranoid">Paranoid (Wolny)</string>
310
311 <!-- Gamepad Buttons -->
312 <string name="gamepad_d_pad">D-Pad</string>
313 <string name="gamepad_left_stick">Lewa gałka</string>
314 <string name="gamepad_right_stick">Prawa gałka</string>
315 <string name="gamepad_home">Home</string>
316 <string name="gamepad_screenshot">Zrzut ekranu</string>
317
318 <!-- Disk shader cache -->
319 <string name="preparing_shaders">Przygotowanie shaderów</string>
320 <string name="building_shaders">Budowanie shaderów</string>
321
322 <!-- Theme options -->
323 <string name="change_app_theme">Zmień motyw aplikacji</string>
324 <string name="theme_default">Domyślny</string>
325 <string name="theme_material_you">Material You</string>
326
327 <!-- Theme Modes -->
328 <string name="change_theme_mode">Zmiana trybu motywu</string>
329 <string name="theme_mode_follow_system">Podążaj za systemowym</string>
330 <string name="theme_mode_light">Jasny</string>
331 <string name="theme_mode_dark">Ciemny</string>
332
333 <!-- Black backgrounds theme -->
334 <string name="use_black_backgrounds">Używaj czarnego tła</string>
335 <string name="use_black_backgrounds_description">Kiedy używany ciemny motyw, tła zostają zastąpione czernią.</string>
336
337</resources>
diff --git a/src/android/app/src/main/res/values-pt-rBR/strings.xml b/src/android/app/src/main/res/values-pt-rBR/strings.xml
new file mode 100644
index 000000000..35197c280
--- /dev/null
+++ b/src/android/app/src/main/res/values-pt-rBR/strings.xml
@@ -0,0 +1,337 @@
1<?xml version="1.0" encoding="utf-8"?>
2<resources>
3
4 <string name="app_disclaimer">Este software corre jogos para a consola Nintendo Switch. Não estão incluídas nem jogos ou chaves. &lt;br /&gt;&lt;br /&gt;Antes de começares, por favor localiza o ficheiro <![CDATA[1 prod.keys 1]]> no armazenamento do teu dispositivo.&lt;br /&gt;&lt;br /&gt;<![CDATA[2Learn more2]]></string>
5 <string name="emulation_notification_channel_name">Emulação está Ativa</string>
6 <string name="emulation_notification_channel_description">Mostra uma notificação permanente enquanto a emulação está a correr.</string>
7 <string name="emulation_notification_running">Yuzu está em execução </string>
8 <string name="notice_notification_channel_name">Notificações e erros</string>
9 <string name="notice_notification_channel_description">Mostra notificações quendo algo corre mal.</string>
10 <string name="notification_permission_not_granted">Permissões de notificação não permitidas </string>
11
12 <!-- Setup strings -->
13 <string name="welcome">Bemvindo! </string>
14 <string name="welcome_description">Aprende como configurar &lt;b>yuzu&lt;/b> e arranca a emulação.</string>
15 <string name="get_started">Começa</string>
16 <string name="keys">Chaves</string>
17 <string name="keys_description">Seleciona o teu ficheiro &lt;b>prod.keys&lt;/b> com o botão abaixo.</string>
18 <string name="select_keys">Seleciona as Chaves</string>
19 <string name="games">Jogos</string>
20 <string name="games_description">Seleciona a tua pasta &lt;b>Games&lt;/b> com o botão abaixo.</string>
21 <string name="done">Feito</string>
22 <string name="done_description">Tudo pronto.\nDisfruta dos teus jogos!</string>
23 <string name="text_continue">Continuar</string>
24 <string name="next">Próximo</string>
25 <string name="back">Voltar</string>
26 <string name="add_games">Adiciona Jogos</string>
27 <string name="add_games_description">Seleciona a tua pasta de Jogos</string>
28
29 <!-- Home strings -->
30 <string name="home_games">Jogos</string>
31 <string name="home_search">Pesquisar</string>
32 <string name="home_settings">Configurações</string>
33 <string name="empty_gamelist">Não foram encontrados jogos ou a pasta de Jogos ainda não foi definida. </string>
34 <string name="search_and_filter_games">Procura e filtra jogos.</string>
35 <string name="select_games_folder">Seleciona a pasta de jogos.</string>
36 <string name="select_games_folder_description">Permite que o Yuzu preencha a lista de jogos</string>
37 <string name="add_games_warning">Ignorar a seleção da pasta de jogos?</string>
38 <string name="add_games_warning_description">Os jogos não serão exibidos na lista de jogos se uma pasta não estiver selecionada.</string>
39 <string name="add_games_warning_help">https://yuzu-emu.org/help/quickstart/#dumping-games</string>
40 <string name="home_search_games">Procurar Jogos</string>
41 <string name="games_dir_selected">Pasta de Jogos selecionada</string>
42 <string name="install_prod_keys">Instala prod.keys</string>
43 <string name="install_prod_keys_description">Necessário para desencriptar jogos comerciais</string>
44 <string name="install_prod_keys_warning">Ignorar a adição de chaves?</string>
45 <string name="install_prod_keys_warning_description">São necessárias chaves válidas para emular jogos comerciais. Somente aplicativos homebrew funcionarão se você continuar.</string>
46 <string name="install_prod_keys_warning_help">https://yuzu-emu.org/help/quickstart/#Guia de introdução</string>
47 <string name="notifications">Notificações</string>
48 <string name="notifications_description">Conceda a permissão de notificação com o botão abaixo.</string>
49 <string name="give_permission">Conceda permissão</string>
50 <string name="notification_warning">Saltar a concessão da permissão de notificação?</string>
51 <string name="notification_warning_description">Yuzu não conseguirá te notificar de informações importantes. </string>
52 <string name="permission_denied">Permissão negada</string>
53 <string name="permission_denied_description">Você negou essa permissão muitas vezes e agora precisa concedê-la manualmente nas configurações do sistema.</string>
54 <string name="about">Sobre</string>
55 <string name="about_description">Versão de compilação, créditos e mais</string>
56 <string name="warning_help">Ajuda</string>
57 <string name="warning_skip">Saltar</string>
58 <string name="warning_cancel">Cancelar</string>
59 <string name="install_amiibo_keys">Instala chaves Amiibo</string>
60 <string name="install_amiibo_keys_description">Necessário para usares Amiibo no jogo</string>
61 <string name="invalid_keys_file">Ficheiro de chaves inválido</string>
62 <string name="install_keys_success">Chaves instaladas com sucesso</string>
63 <string name="reading_keys_failure">Erro ao ler chaves de encriptação</string>
64 <string name="invalid_keys_error">Chaves de encriptação inválidas</string>
65 <string name="dumping_keys_quickstart_link">https://yuzu-emu.org/help/quickstart/#dumping-decryption-keys</string>
66 <string name="install_keys_failure_description">O ficheiro selecionado está corrompido. Por favor recarrega as tuas chaves.</string>
67 <string name="install_gpu_driver">Instala driver para GPU</string>
68 <string name="install_gpu_driver_description">Instala drivers alternativos para desempenho ou precisão potencialmente melhores</string>
69 <string name="advanced_settings">Definições avançadas</string>
70 <string name="settings_description">Configura definições do emulador</string>
71 <string name="search_recently_played">Jogos recentes</string>
72 <string name="search_recently_added">Adicionados recentemente</string>
73 <string name="search_retail">Jogos comerciais</string>
74 <string name="search_homebrew">Homebrew</string>
75 <string name="open_user_folder">Abre a pasta Yuzu</string>
76 <string name="open_user_folder_description">Gere os ficheiro internos do Yuzu</string>
77 <string name="theme_and_color_description">Modifica a aparência da App</string>
78 <string name="no_file_manager">Nenhum gestor de ficheiros encontrado</string>
79 <string name="notification_no_directory_link">Impossível abrir pasta Yuzu</string>
80 <string name="notification_no_directory_link_description">Localiza a pasta de utilizador manualmente com o painel lateral do gestor de ficheiros.</string>
81 <string name="manage_save_data">Gerir dados guardados</string>
82 <string name="manage_save_data_description">Dados não encontrados. Por favor seleciona uma opção abaixo.</string>
83 <string name="import_export_saves_description">Importa ou exporta dados guardados</string>
84 <string name="import_export_saves_no_profile">Dados não encontrados. Por favor lança o jogo e tenta novamente.</string>
85 <string name="save_file_imported_success">Importado com sucesso</string>
86 <string name="save_file_invalid_zip_structure">Estrutura de diretório de dados invalida</string>
87 <string name="save_file_invalid_zip_structure_description">O nome da primeira sub pasta tem de ser a ID do jogo.</string>
88 <string name="import_saves">Importar</string>
89 <string name="export_saves">Exportar</string>
90
91 <!-- About screen strings -->
92 <string name="gaia_is_not_real">Gaia não é real</string>
93 <string name="copied_to_clipboard">Copiado para a área de transferência</string>
94 <string name="about_app_description">Um emulador Switch de código aberto</string>
95 <string name="contributors">Contribuidores</string>
96 <string name="contributors_description">Feito com \u2764 da equipa do Yuzu</string>
97 <string name="contributors_link">https://github.com/yuzu-emu/yuzu/graphs/contributors</string>
98 <string name="build">Versão</string>
99 <string name="support_link">https://discord.gg/u77vRWY</string>
100 <string name="website_link">https://yuzu-emu.org/</string>
101 <string name="github_link">https://github.com/yuzu-emu</string>
102
103 <!-- Early access upgrade strings -->
104 <string name="early_access">Acesso antecipado</string>
105 <string name="get_early_access">Obtém Acesso Antecipado</string>
106 <string name="play_store_link">https://play.google.com/store/apps/details?id=org.yuzu.yuzu_emu.ea</string>
107 <string name="get_early_access_description">Recursos de ponta, acesso antecipado a atualizações e muito mais</string>
108 <string name="early_access_benefits">Benefícios do Acesso Antecipado</string>
109 <string name="cutting_edge_features">Recursos de ponta</string>
110 <string name="early_access_updates">Acesso antecipado a atualizações</string>
111 <string name="no_manual_installation">Sem instalação manual</string>
112 <string name="prioritized_support">Suporte prioritário</string>
113 <string name="helping_game_preservation">Ajuda na preservação dos jogos</string>
114 <string name="our_eternal_gratitude">A nossa eterna gratidão</string>
115 <string name="are_you_interested">Estás interessado?</string>
116
117 <!-- General settings strings -->
118 <string name="frame_limit_enable">Ativar limite de velocidade</string>
119 <string name="frame_limit_enable_description">Quando ativada, a velocidade da emulação será limitada à percentagem definida da velocidade normal.</string>
120 <string name="frame_limit_slider">Percentagem do limite de velocidade</string>
121 <string name="frame_limit_slider_description">Especifica o limite da percentagem da velocidade da emulação. Com a velocidade por defeito a 100% a emulação será limitada à velocidade normal. Valores maiores ou menores aumentarão ou diminuirão o limite de velocidade.</string>
122 <string name="cpu_accuracy">Precisão do CPU</string>
123
124 <!-- System settings strings -->
125 <string name="use_docked_mode">Modo ancorado</string>
126 <string name="use_docked_mode_description">Emula em modo ancorado, que aumenta a resolução ás custas da performance.</string>
127 <string name="emulated_region">Região da emulação</string>
128 <string name="emulated_language">Idioma da emulação</string>
129 <string name="select_rtc_date">Seleciona a data RTC</string>
130 <string name="select_rtc_time">Seleciona a hora RTC</string>
131 <string name="use_custom_rtc">Ativa RTC personalizado</string>
132 <string name="use_custom_rtc_description">Esta configuração permite definir um RTC personalizado diferente da hora atual do sistema</string>
133 <string name="set_custom_rtc">Define RTC personalizado</string>
134
135 <!-- Graphics settings strings -->
136 <string name="renderer_api">API</string>
137 <string name="renderer_accuracy">Nível de precisão</string>
138 <string name="renderer_resolution">Resolução</string>
139 <string name="renderer_vsync">Modo VSync</string>
140 <string name="renderer_aspect_ratio">Proporção do ecrã</string>
141 <string name="renderer_scaling_filter">Filtro de Adaptação da Janela</string>
142 <string name="renderer_anti_aliasing">Método de Anti-Aliasing </string>
143 <string name="renderer_force_max_clock">Força velocidade máxima (Adreno only)</string>
144 <string name="renderer_force_max_clock_description">Força o GPU a correr à velocidade máxima (restrições térmicas serão aplicadas)</string>
145 <string name="renderer_asynchronous_shaders">Usa shaders assíncronos </string>
146 <string name="renderer_asynchronous_shaders_description">Compila shaders assincronamente, que aumentará a fluidez, mas poderá causar falhas.</string>
147 <string name="renderer_debug">Ativar depuração de gráficos</string>
148 <string name="renderer_debug_description">Quando selecionado, a API gráfica entra num modo de depuração mais lento.</string>
149 <string name="use_disk_shader_cache">Usar cache de shaders em disco</string>
150 <string name="use_disk_shader_cache_description">Aumenta a fluidez ao guardar e carregar shaders gerados para o armazenamento.</string>
151
152 <!-- Audio settings strings -->
153 <string name="audio_volume">Volume</string>
154 <string name="audio_volume_description">Especifica o volume de saída.</string>
155
156 <!-- Miscellaneous -->
157 <string name="slider_default">Padrão</string>
158 <string name="ini_saved">Definições guardadas</string>
159 <string name="gameid_saved">Definições guardadas para %1$s</string>
160 <string name="error_saving">Erro ao guardar %1$s.ini: %2$s</string>
161 <string name="loading">A carregar...</string>
162 <string name="reset_setting_confirmation">Queres reverter esta definição para os valores padrão?</string>
163 <string name="reset_to_default">Reverter para padrão</string>
164 <string name="reset_all_settings">Redefinir todas as definições?</string>
165 <string name="reset_all_settings_description">Todas as definições avançadas serão redefinidas para as definições padrão. Isto não pode ser revertido.</string>
166 <string name="settings_reset">Redefinir definições</string>
167 <string name="close">Fechar</string>
168 <string name="learn_more">Saiba mais</string>
169
170 <!-- GPU driver installation -->
171 <string name="select_gpu_driver">Seleciona a driver para o GPU</string>
172 <string name="select_gpu_driver_title">Queres substituir o driver do GPU atual? </string>
173 <string name="select_gpu_driver_install">Instalar</string>
174 <string name="select_gpu_driver_default">Padrão</string>
175 <string name="select_gpu_driver_install_success">Instalado%s</string>
176 <string name="select_gpu_driver_use_default">Usar o driver padrão do GPU</string>
177 <string name="select_gpu_driver_error">Driver selecionado inválido, a usar o padrão do sistema!</string>
178 <string name="system_gpu_driver">Driver do GPU padrão</string>
179 <string name="installing_driver">A instalar o Driver...</string>
180
181 <!-- Preferences Screen -->
182 <string name="preferences_settings">Configurações</string>
183 <string name="preferences_general">Geral</string>
184 <string name="preferences_system">Sistema</string>
185 <string name="preferences_graphics">Gráficos</string>
186 <string name="preferences_audio">Áudio</string>
187 <string name="preferences_theme">Cor e tema.</string>
188
189 <!-- ROM loading errors -->
190 <string name="loader_error_encrypted">A tua ROM está encriptada</string>
191 <string name="loader_error_encrypted_roms_description"><![CDATA[Por favor segue os guias para fazer redump das tuas<a href=\"https://yuzu-emu.org/help/quickstart/#dumping-cartridge-games\">Cartidges de Jogo</a> or <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-installed-titles-eshop\">Jogos Instalados</a>.]]></string>
192 <string name="loader_error_encrypted_keys_description"><![CDATA[Por favor confirma que o teu ficheiro <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-prodkeys-and-titlekeys\">prod.keys</a> está instalado para que os jogos possam ser desencriptados.]]></string>
193 <string name="loader_error_video_core">Ocorreu um erro ao iniciar o núcleo de vídeo.</string>
194 <string name="loader_error_video_core_description">Isto é normalmente causado por um driver de GPU incompatível. Instalar um driver GPU pode resolver este problema.</string>
195 <string name="loader_error_invalid_format">Impossível carregar a tua ROM</string>
196 <string name="loader_error_file_not_found">O ficheiro da ROM não existe</string>
197
198 <!-- Emulation Menu -->
199 <string name="emulation_exit">Sair da emulação</string>
200 <string name="emulation_done">Feito</string>
201 <string name="emulation_fps_counter">Contador de FPS</string>
202 <string name="emulation_toggle_controls">Alterar Controlos</string>
203 <string name="emulation_rel_stick_center">Centro do Analógico Relativo</string>
204 <string name="emulation_dpad_slide">Deslizar do DPad</string>
205 <string name="emulation_haptics">Hápticos </string>
206 <string name="emulation_show_overlay">Mostrar sobreposição </string>
207 <string name="emulation_toggle_all">Alterar todos</string>
208 <string name="emulation_control_adjust">Ajustar a sobreposição </string>
209 <string name="emulation_control_scale">Escala</string>
210 <string name="emulation_control_opacity">Opacidade</string>
211 <string name="emulation_touch_overlay_reset">Redefinir Sobreposição </string>
212 <string name="emulation_touch_overlay_edit">Editar sobreposição </string>
213 <string name="emulation_pause">Pausa emulação</string>
214 <string name="emulation_unpause">Retomar emulação</string>
215 <string name="emulation_input_overlay">Opções de sobreposição </string>
216 <string name="emulation_game_loading">Jogo a carregar...</string>
217
218 <string name="load_settings">Configurações a carregar...</string>
219
220 <!-- Software keyboard -->
221 <string name="software_keyboard">Teclado de software</string>
222
223 <!-- Errors and warnings -->
224 <string name="abort_button">Abortar</string>
225 <string name="continue_button">Continuar</string>
226 <string name="system_archive_not_found">Arquivo do sistema não encontrado</string>
227 <string name="system_archive_not_found_message">%s está em falta. Por favor apaga os teus ficheiros de sistema.\nContinuar a emulação pode causar erros.</string>
228 <string name="system_archive_general">Um arquivo do sistema</string>
229 <string name="save_load_error">Erro Guardar/Carregar</string>
230 <string name="fatal_error">Erro fatal</string>
231 <string name="fatal_error_message">Ocorreu um erro fatal. Verifica o teu registro para detalhes. \nContinuar a emulação pode causar erros.</string>
232 <string name="performance_warning">Desligar esta configuração irá reduzir a performance da emulação significantemente! Para a melhor experiência é recomendado que deixes esta configuração ativada.</string>
233
234 <!-- Region Names -->
235 <string name="region_japan">Japão</string>
236 <string name="region_usa">EUA</string>
237 <string name="region_europe">Europa</string>
238 <string name="region_australia">Austrália</string>
239 <string name="region_china">China</string>
240 <string name="region_korea">Coréia</string>
241 <string name="region_taiwan">Taiwan</string>
242
243 <!-- Language Names -->
244 <string name="language_japanese">Japônes (日本語)</string>
245 <string name="language_english">Português do Brasil</string>
246 <string name="language_french">Francês (Français)</string>
247 <string name="langauge_german">Alemão (Deutsch)</string>
248 <string name="language_italian">Italiano (Italiano)</string>
249 <string name="language_spanish">Espanhol (Español)</string>
250 <string name="language_chinese">Mandarim (简体中文)</string>
251 <string name="language_korean">Coreano (한국어)</string>
252 <string name="language_dutch">Holandês (Nederlands)</string>
253 <string name="language_portuguese">Português (Português)</string>
254 <string name="language_russian">Russo (Русский)</string>
255 <string name="language_taiwanese">Taiwanês (台湾)</string>
256 <string name="language_british_english">Inglês britânico (British English)</string>
257 <string name="language_canadian_french">Fracês Canadiano (Français canadien)</string>
258 <string name="language_latin_american_spanish">Espanhol da América Latina (Español latino-americano)</string>
259 <string name="language_simplified_chinese">Chinês Simplificado (简体中文)</string>
260 <string name="language_traditional_chinese">Chinês tradicional (正體中文)</string>
261 <string name="language_brazilian_portuguese">Português do Brasil (Português do Brasil)</string>
262
263 <!-- Renderer APIs -->
264 <string name="renderer_vulkan">Vulcano</string>
265 <string name="renderer_none">Nenhum</string>
266
267 <!-- Renderer Accuracy -->
268 <string name="renderer_accuracy_normal">Normal</string>
269 <string name="renderer_accuracy_high">Alto</string>
270 <string name="renderer_accuracy_extreme">Estremo (Lento)</string>
271
272 <!-- Resolutions -->
273 <string name="resolution_half">0.5X (360p/540p)</string>
274 <string name="resolution_three_quarter">0.75X (540p/810p)</string>
275 <string name="resolution_one">1X (720p/1080p)</string>
276 <string name="resolution_two">2X (1440p/2160p) (Slow)</string>
277 <string name="resolution_three">3X (2160p/3240p) (Lento)</string>
278 <string name="resolution_four">4X (2880p/4320p) (Lento)</string>
279
280 <!-- Renderer VSync -->
281 <string name="renderer_vsync_immediate">Imediato (Desligado)</string>
282 <string name="renderer_vsync_mailbox">Caixa de entrada</string>
283 <string name="renderer_vsync_fifo">FIFO (Ligado)</string>
284 <string name="renderer_vsync_fifo_relaxed">FIFO Relaxado </string>
285
286 <!-- Scaling Filters -->
287 <string name="scaling_filter_nearest_neighbor">Vizinho mais próximo</string>
288 <string name="scaling_filter_bilinear">Bilinear</string>
289 <string name="scaling_filter_bicubic">Bicúbico</string>
290 <string name="scaling_filter_gaussian">Gaussiano</string>
291 <string name="scaling_filter_scale_force">ScaleForce</string>
292 <string name="scaling_filter_fsr">AMD FidelityFX™ Super Resolution</string>
293
294 <!-- Anti-Aliasing -->
295 <string name="anti_aliasing_none">Nenhum</string>
296 <string name="anti_aliasing_fxaa">FXAA</string>
297 <string name="anti_aliasing_smaa">SMAA</string>
298
299 <!-- Aspect Ratios -->
300 <string name="ratio_default">Padrão (16:9)</string>
301 <string name="ratio_force_four_three">Forçar 4:3</string>
302 <string name="ratio_force_twenty_one_nine">Forçar 21:9</string>
303 <string name="ratio_force_sixteen_ten">Forçar 16:10</string>
304 <string name="ratio_stretch">Esticar para a janela</string>
305
306 <!-- CPU Accuracy -->
307 <string name="cpu_accuracy_accurate">Preciso</string>
308 <string name="cpu_accuracy_unsafe">Não seguro</string>
309 <string name="cpu_accuracy_paranoid">Paranoid (Lento)</string>
310
311 <!-- Gamepad Buttons -->
312 <string name="gamepad_d_pad">D-pad</string>
313 <string name="gamepad_left_stick">Analógico esquerdo</string>
314 <string name="gamepad_right_stick">Analógico direito</string>
315 <string name="gamepad_home">Botão Home</string>
316 <string name="gamepad_screenshot">Captura de ecrã</string>
317
318 <!-- Disk shader cache -->
319 <string name="preparing_shaders">A preparar shaders</string>
320 <string name="building_shaders">A criar shaders</string>
321
322 <!-- Theme options -->
323 <string name="change_app_theme">Muda o Tema da App</string>
324 <string name="theme_default">Padrão</string>
325 <string name="theme_material_you">Material You</string>
326
327 <!-- Theme Modes -->
328 <string name="change_theme_mode">Altera o Modo do Tema</string>
329 <string name="theme_mode_follow_system">Igual ao Sistema</string>
330 <string name="theme_mode_light">Claro</string>
331 <string name="theme_mode_dark">Escuro</string>
332
333 <!-- Black backgrounds theme -->
334 <string name="use_black_backgrounds">Usa Fundos Negros</string>
335 <string name="use_black_backgrounds_description">Quando usar tema escuro, aplicar fundos escuros</string>
336
337</resources>
diff --git a/src/android/app/src/main/res/values-pt-rPT/strings.xml b/src/android/app/src/main/res/values-pt-rPT/strings.xml
new file mode 100644
index 000000000..8761e2374
--- /dev/null
+++ b/src/android/app/src/main/res/values-pt-rPT/strings.xml
@@ -0,0 +1,337 @@
1<?xml version="1.0" encoding="utf-8"?>
2<resources>
3
4 <string name="app_disclaimer">Este software corre jogos para a consola Nintendo Switch. Não estão incluídas nem jogos ou chaves. &lt;br /&gt;&lt;br /&gt;Antes de começares, por favor localiza o ficheiro <![CDATA[1 prod.keys 1]]> no armazenamento do teu dispositivo.&lt;br /&gt;&lt;br /&gt;<![CDATA[2Learn more2]]></string>
5 <string name="emulation_notification_channel_name">Emulação está Ativa</string>
6 <string name="emulation_notification_channel_description">Mostra uma notificação permanente enquanto a emulação está a correr.</string>
7 <string name="emulation_notification_running">Yuzu está em execução </string>
8 <string name="notice_notification_channel_name">Notificações e erros</string>
9 <string name="notice_notification_channel_description">Mostra notificações quendo algo corre mal.</string>
10 <string name="notification_permission_not_granted">Permissões de notificação não permitidas </string>
11
12 <!-- Setup strings -->
13 <string name="welcome">Benvindo! </string>
14 <string name="welcome_description">Aprende como configurar &lt;b>yuzu&lt;/b> e arranca a emulação.</string>
15 <string name="get_started">Começa</string>
16 <string name="keys">Chaves</string>
17 <string name="keys_description">Seleciona o teu ficheiro &lt;b>prod.keys&lt;/b> com o botão abaixo.</string>
18 <string name="select_keys">Seleciona as Chaves</string>
19 <string name="games">Jogos</string>
20 <string name="games_description">Seleciona a tua pasta &lt;b>Games&lt;/b> com o botão abaixo.</string>
21 <string name="done">Feito</string>
22 <string name="done_description">Tudo pronto.\nDisfruta dos teus jogos!</string>
23 <string name="text_continue">Continuar</string>
24 <string name="next">Próximo</string>
25 <string name="back">Voltar</string>
26 <string name="add_games">Adiciona Jogos</string>
27 <string name="add_games_description">Seleciona a tua pasta de Jogos</string>
28
29 <!-- Home strings -->
30 <string name="home_games">Jogos</string>
31 <string name="home_search">Pesquisar</string>
32 <string name="home_settings">Configurações</string>
33 <string name="empty_gamelist">Não foram encontrados jogos ou a pasta de Jogos ainda não foi definida. </string>
34 <string name="search_and_filter_games">Procura e filtra jogos.</string>
35 <string name="select_games_folder">Seleciona a pasta de jogos.</string>
36 <string name="select_games_folder_description">Permite que o Yuzu preencha a lista de jogos</string>
37 <string name="add_games_warning">Ignorar a seleção da pasta de jogos?</string>
38 <string name="add_games_warning_description">Os jogos não serão exibidos na lista de jogos se uma pasta não estiver selecionada.</string>
39 <string name="add_games_warning_help">https://yuzu-emu.org/help/quickstart/#dumping-games</string>
40 <string name="home_search_games">Procurar Jogos</string>
41 <string name="games_dir_selected">Pasta de Jogos selecionada</string>
42 <string name="install_prod_keys">Instala prod.keys</string>
43 <string name="install_prod_keys_description">Necessário para desencriptar jogos comerciais</string>
44 <string name="install_prod_keys_warning">Ignorar a adição de chaves?</string>
45 <string name="install_prod_keys_warning_description">São necessárias chaves válidas para emular jogos comerciais. Somente aplicativos homebrew funcionarão se você continuar.</string>
46 <string name="install_prod_keys_warning_help">https://yuzu-emu.org/help/quickstart/#guide-introduction</string>
47 <string name="notifications">Notificações</string>
48 <string name="notifications_description">Conceda a permissão de notificação com o botão abaixo.</string>
49 <string name="give_permission">Conceda permissão</string>
50 <string name="notification_warning">Saltar a concessão da permissão de notificação?</string>
51 <string name="notification_warning_description">Yuzu não conseguirá te notificar de informações importantes. </string>
52 <string name="permission_denied">Permissão negada</string>
53 <string name="permission_denied_description">Você negou essa permissão muitas vezes e agora precisa concedê-la manualmente nas configurações do sistema.</string>
54 <string name="about">Sobre</string>
55 <string name="about_description">Versão de compilação, créditos e mais</string>
56 <string name="warning_help">Ajuda</string>
57 <string name="warning_skip">Saltar</string>
58 <string name="warning_cancel">Cancelar</string>
59 <string name="install_amiibo_keys">Instala chaves Amiibo</string>
60 <string name="install_amiibo_keys_description">Necessário para usares Amiibo no jogo</string>
61 <string name="invalid_keys_file">Ficheiro de chaves inválido</string>
62 <string name="install_keys_success">Chaves instaladas com sucesso</string>
63 <string name="reading_keys_failure">Erro ao ler chaves de encriptação</string>
64 <string name="invalid_keys_error">Chaves de encriptação inválidas</string>
65 <string name="dumping_keys_quickstart_link">https://yuzu-emu.org/help/quickstart/#dumping-decryption-keys</string>
66 <string name="install_keys_failure_description">O ficheiro selecionado está corrompido. Por favor recarrega as tuas chaves.</string>
67 <string name="install_gpu_driver">Instala driver para GPU</string>
68 <string name="install_gpu_driver_description">Instala drivers alternativos para desempenho ou precisão potencialmente melhores</string>
69 <string name="advanced_settings">Configurações avançadas</string>
70 <string name="settings_description">Configura configurações do emulador</string>
71 <string name="search_recently_played">Jogos recentes</string>
72 <string name="search_recently_added">Adicionados recentemente</string>
73 <string name="search_retail">Jogos comerciais</string>
74 <string name="search_homebrew">Homebrew</string>
75 <string name="open_user_folder">Abre a pasta Yuzu</string>
76 <string name="open_user_folder_description">Gere os ficheiro internos do Yuzu</string>
77 <string name="theme_and_color_description">Modifica a aparência da App</string>
78 <string name="no_file_manager">Nenhum gestor de ficheiros encontrado</string>
79 <string name="notification_no_directory_link">Impossível abrir pasta Yuzu</string>
80 <string name="notification_no_directory_link_description">Localiza a pasta de utilizador manualmente com o painel lateral do gestor de ficheiros.</string>
81 <string name="manage_save_data">Gerir dados guardados</string>
82 <string name="manage_save_data_description">Dados não encontrados. Por favor seleciona uma opção abaixo.</string>
83 <string name="import_export_saves_description">Importa ou exporta dados guardados</string>
84 <string name="import_export_saves_no_profile">Dados não encontrados. Por favor lança o jogo e tenta novamente.</string>
85 <string name="save_file_imported_success">Importado com sucesso</string>
86 <string name="save_file_invalid_zip_structure">Estrutura de diretório de dados invalida</string>
87 <string name="save_file_invalid_zip_structure_description">O nome da primeira sub pasta tem de ser a ID do jogo.</string>
88 <string name="import_saves">Importar</string>
89 <string name="export_saves">Exportar</string>
90
91 <!-- About screen strings -->
92 <string name="gaia_is_not_real">Gaia não é real</string>
93 <string name="copied_to_clipboard">Copiado para a área de transferência</string>
94 <string name="about_app_description">Um emulador Switch de código aberto</string>
95 <string name="contributors">Contribuidores</string>
96 <string name="contributors_description">Feito com \u2764 da equipa do Yuzu</string>
97 <string name="contributors_link">https://github.com/yuzu-emu/yuzu/graphs/contributors</string>
98 <string name="build">Versão</string>
99 <string name="support_link">https://discord.gg/u77vRWY</string>
100 <string name="website_link">https://yuzu-emu.org/</string>
101 <string name="github_link">https://github.com/yuzu-emu</string>
102
103 <!-- Early access upgrade strings -->
104 <string name="early_access">Acesso antecipado</string>
105 <string name="get_early_access">Obtém Acesso Antecipado</string>
106 <string name="play_store_link">https://play.google.com/store/apps/details?id=org.yuzu.yuzu_emu.ea</string>
107 <string name="get_early_access_description">Recursos de ponta, acesso antecipado a atualizações e muito mais</string>
108 <string name="early_access_benefits">Benefícios do Acesso Antecipado</string>
109 <string name="cutting_edge_features">Recursos de ponta</string>
110 <string name="early_access_updates">Acesso antecipado a atualizações</string>
111 <string name="no_manual_installation">Sem instalação manual</string>
112 <string name="prioritized_support">Suporte prioritário</string>
113 <string name="helping_game_preservation">Ajuda na preservação dos jogos</string>
114 <string name="our_eternal_gratitude">A nossa eterna gratidão</string>
115 <string name="are_you_interested">Estás interessado?</string>
116
117 <!-- General settings strings -->
118 <string name="frame_limit_enable">Ativar limite de velocidade</string>
119 <string name="frame_limit_enable_description">Quando ativada, a velocidade da emulação será limitada à percentagem definida da velocidade normal.</string>
120 <string name="frame_limit_slider">Percentagem do limite de velocidade</string>
121 <string name="frame_limit_slider_description">Especifica o limite da percentagem da velocidade da emulação. Com a velocidade por defeito a 100% a emulação será limitada à velocidade normal. Valores maiores ou menores aumentarão ou diminuirão o limite de velocidade.</string>
122 <string name="cpu_accuracy">Precisão do CPU</string>
123
124 <!-- System settings strings -->
125 <string name="use_docked_mode">Modo ancorado</string>
126 <string name="use_docked_mode_description">Emula em modo ancorado, que aumenta a resolução ás custas da performance.</string>
127 <string name="emulated_region">Região da emulação</string>
128 <string name="emulated_language">Idioma da emulação</string>
129 <string name="select_rtc_date">Seleciona a data RTC</string>
130 <string name="select_rtc_time">Seleciona a hora RTC</string>
131 <string name="use_custom_rtc">Ativa RTC personalizado</string>
132 <string name="use_custom_rtc_description">Esta configuração permite definir um RTC personalizado diferente da hora atual do sistema</string>
133 <string name="set_custom_rtc">Define RTC personalizado</string>
134
135 <!-- Graphics settings strings -->
136 <string name="renderer_api">API</string>
137 <string name="renderer_accuracy">Nível de precisão</string>
138 <string name="renderer_resolution">Resolução</string>
139 <string name="renderer_vsync">Modo VSync</string>
140 <string name="renderer_aspect_ratio">Proporção do ecrã</string>
141 <string name="renderer_scaling_filter">Filtro de Adaptação da Janela</string>
142 <string name="renderer_anti_aliasing">Método de Anti-Aliasing </string>
143 <string name="renderer_force_max_clock">Força velocidade máxima (Adreno only)</string>
144 <string name="renderer_force_max_clock_description">Força o GPU a correr à velocidade máxima (restrições térmicas serão aplicadas)</string>
145 <string name="renderer_asynchronous_shaders">Usa shaders assíncronos </string>
146 <string name="renderer_asynchronous_shaders_description">Compila shaders assincronamente, que aumentará a fluidez, mas poderá causar falhas.</string>
147 <string name="renderer_debug">Ativar depuração de gráficos</string>
148 <string name="renderer_debug_description">Quando selecionado, a API gráfica entra num modo de depuração mais lento.</string>
149 <string name="use_disk_shader_cache">Usar cache do disk shader</string>
150 <string name="use_disk_shader_cache_description">Aumenta a fluidez ao guardar e carregar shaders gerados para o armazenamento.</string>
151
152 <!-- Audio settings strings -->
153 <string name="audio_volume">Volume</string>
154 <string name="audio_volume_description">Especifica o volume de saída.</string>
155
156 <!-- Miscellaneous -->
157 <string name="slider_default">Padrão</string>
158 <string name="ini_saved">Configurações guardadas</string>
159 <string name="gameid_saved">Configurações guardadas para %1$s</string>
160 <string name="error_saving">Erro ao guardar %1$s.ini: %2$s</string>
161 <string name="loading">A carregar...</string>
162 <string name="reset_setting_confirmation">Queres reverter esta definição para os valores padrão?</string>
163 <string name="reset_to_default">Reverter para padrão</string>
164 <string name="reset_all_settings">Redefinir todas as configurações?</string>
165 <string name="reset_all_settings_description">Todas as configurações avançadas serão redefinidas para as definições padrão. Isto não pode ser revertido.</string>
166 <string name="settings_reset">Redefinir configurações </string>
167 <string name="close">Fechar</string>
168 <string name="learn_more">Saber Mais</string>
169
170 <!-- GPU driver installation -->
171 <string name="select_gpu_driver">Seleciona a driver para o GPU</string>
172 <string name="select_gpu_driver_title">Queres substituir o driver do GPU atual? </string>
173 <string name="select_gpu_driver_install">Instalar</string>
174 <string name="select_gpu_driver_default">Padrão</string>
175 <string name="select_gpu_driver_install_success">Instalado%s</string>
176 <string name="select_gpu_driver_use_default">Usar o driver padrão do GPU</string>
177 <string name="select_gpu_driver_error">Driver selecionado inválido, a usar o padrão do sistema!</string>
178 <string name="system_gpu_driver">Driver do GPU padrão</string>
179 <string name="installing_driver">A instalar o Driver...</string>
180
181 <!-- Preferences Screen -->
182 <string name="preferences_settings">Configurações</string>
183 <string name="preferences_general">Geral</string>
184 <string name="preferences_system">Sistema</string>
185 <string name="preferences_graphics">Gráficos</string>
186 <string name="preferences_audio">Audio</string>
187 <string name="preferences_theme">Cor e tema.</string>
188
189 <!-- ROM loading errors -->
190 <string name="loader_error_encrypted">A tua ROM está encriptada</string>
191 <string name="loader_error_encrypted_roms_description"><![CDATA[Por favor segue os guias para fazer redump das tuas<a href=\"https://yuzu-emu.org/help/quickstart/#dumping-cartridge-games\">Cartidges de Jogo</a> or <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-installed-titles-eshop\">Jogos Instalados</a>.]]></string>
192 <string name="loader_error_encrypted_keys_description"><![CDATA[Por favor confirma que o teu ficheiro <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-prodkeys-and-titlekeys\">prod.keys</a> está instalado para que os jogos possam ser desencriptados.]]></string>
193 <string name="loader_error_video_core">Ocorreu um erro ao iniciar o núcleo de vídeo.</string>
194 <string name="loader_error_video_core_description">Isto é normalmente causado por um driver de GPU incompatível. Instalar um driver GPU pode resolver este problema.</string>
195 <string name="loader_error_invalid_format">Impossível carregar a tua ROM</string>
196 <string name="loader_error_file_not_found">O ficheiro da ROM não existe</string>
197
198 <!-- Emulation Menu -->
199 <string name="emulation_exit">Sair da emulação</string>
200 <string name="emulation_done">Feito</string>
201 <string name="emulation_fps_counter">Contador de FPS</string>
202 <string name="emulation_toggle_controls">Alterar Controlos</string>
203 <string name="emulation_rel_stick_center">Centro do Analógico Relativo</string>
204 <string name="emulation_dpad_slide">Deslizar do DPad</string>
205 <string name="emulation_haptics">Hápticos </string>
206 <string name="emulation_show_overlay">Mostrar sobreposição </string>
207 <string name="emulation_toggle_all">Alterar todos</string>
208 <string name="emulation_control_adjust">Ajustar a sobreposição </string>
209 <string name="emulation_control_scale">Escala</string>
210 <string name="emulation_control_opacity">Opacidade</string>
211 <string name="emulation_touch_overlay_reset">Redefinir Sobreposição </string>
212 <string name="emulation_touch_overlay_edit">Editar sobreposição </string>
213 <string name="emulation_pause">Pausa emulação</string>
214 <string name="emulation_unpause">Retomar emulação</string>
215 <string name="emulation_input_overlay">Opções de sobreposição </string>
216 <string name="emulation_game_loading">Jogo a carregar...</string>
217
218 <string name="load_settings">Configurações a carregar...</string>
219
220 <!-- Software keyboard -->
221 <string name="software_keyboard">Teclado de Software</string>
222
223 <!-- Errors and warnings -->
224 <string name="abort_button">Abortar</string>
225 <string name="continue_button">Continuar</string>
226 <string name="system_archive_not_found">Arquivo do Sistema Não Encontrado</string>
227 <string name="system_archive_not_found_message">%s está em falta. Por favor apaga os teus ficheiros de sistema.\nContinuar a emulação pode causar erros.</string>
228 <string name="system_archive_general">Um arquivo do sistema</string>
229 <string name="save_load_error">Erro Guardar/Carregar</string>
230 <string name="fatal_error">Erro fatal</string>
231 <string name="fatal_error_message">Ocorreu um erro fatal. Verifica o teu registro para detalhes. \nContinuar a emulação pode causar erros.</string>
232 <string name="performance_warning">Desligar esta configuração irá reduzir a performance da emulação significantemente! Para a melhor experiência é recomendado que deixes esta configuração ativada.</string>
233
234 <!-- Region Names -->
235 <string name="region_japan">Japão</string>
236 <string name="region_usa">EUA</string>
237 <string name="region_europe">Europa</string>
238 <string name="region_australia">Austrália</string>
239 <string name="region_china">China</string>
240 <string name="region_korea">Coreia</string>
241 <string name="region_taiwan">Taiwan</string>
242
243 <!-- Language Names -->
244 <string name="language_japanese">Japonês (日本語)</string>
245 <string name="language_english">Inglês</string>
246 <string name="language_french">Francês (Français)</string>
247 <string name="langauge_german">Alemão (Deutsch)</string>
248 <string name="language_italian">Italiano (Italiano)</string>
249 <string name="language_spanish">Espanhol (Español)</string>
250 <string name="language_chinese">Chinês simplificado (简体中文)</string>
251 <string name="language_korean">Coreano (한국어)</string>
252 <string name="language_dutch">Holandês (Nederlands)</string>
253 <string name="language_portuguese">Português (Português)</string>
254 <string name="language_russian">Russo (Русский)</string>
255 <string name="language_taiwanese">Taiwanês (台湾)</string>
256 <string name="language_british_english">Inglês Britânico</string>
257 <string name="language_canadian_french">Fracês Canadiano (Français canadien)</string>
258 <string name="language_latin_american_spanish">Espanhol da América Latina (Español latino-americano)</string>
259 <string name="language_simplified_chinese">Chinês Simplificado (简体中文)</string>
260 <string name="language_traditional_chinese">Chinês Tradicional (正 體 中文)</string>
261 <string name="language_brazilian_portuguese">Português do Brasil (Português do Brasil)</string>
262
263 <!-- Renderer APIs -->
264 <string name="renderer_vulkan">Vulcano</string>
265 <string name="renderer_none">Nenhum</string>
266
267 <!-- Renderer Accuracy -->
268 <string name="renderer_accuracy_normal">Normal</string>
269 <string name="renderer_accuracy_high">Alto</string>
270 <string name="renderer_accuracy_extreme">Estremo (Lento)</string>
271
272 <!-- Resolutions -->
273 <string name="resolution_half">0.5X (360p/540p)</string>
274 <string name="resolution_three_quarter">0.75X (540p/810p)</string>
275 <string name="resolution_one">1X (720p/1080p)</string>
276 <string name="resolution_two">2X (1440p/2160p) (Lento)</string>
277 <string name="resolution_three">3X (2160p/3240p) (Lento)</string>
278 <string name="resolution_four">4X (2880p/4320p) (Lento)</string>
279
280 <!-- Renderer VSync -->
281 <string name="renderer_vsync_immediate">Imediato (Desligado)</string>
282 <string name="renderer_vsync_mailbox">Caixa de entrada</string>
283 <string name="renderer_vsync_fifo">FIFO (Ligado)</string>
284 <string name="renderer_vsync_fifo_relaxed">FIFO Relaxado </string>
285
286 <!-- Scaling Filters -->
287 <string name="scaling_filter_nearest_neighbor">Vizinho mais próximo</string>
288 <string name="scaling_filter_bilinear">Bilinear</string>
289 <string name="scaling_filter_bicubic">Bicúbico</string>
290 <string name="scaling_filter_gaussian">Gaussiano</string>
291 <string name="scaling_filter_scale_force">ScaleForce</string>
292 <string name="scaling_filter_fsr">AMD FidelityFX™ Super Resolution</string>
293
294 <!-- Anti-Aliasing -->
295 <string name="anti_aliasing_none">Nenhum</string>
296 <string name="anti_aliasing_fxaa">FXAA</string>
297 <string name="anti_aliasing_smaa">SMAA</string>
298
299 <!-- Aspect Ratios -->
300 <string name="ratio_default">Padrão (16:9)</string>
301 <string name="ratio_force_four_three">Forçar 4:3</string>
302 <string name="ratio_force_twenty_one_nine">Forçar 21:9</string>
303 <string name="ratio_force_sixteen_ten">Forçar 16:10</string>
304 <string name="ratio_stretch">Esticar à Janela</string>
305
306 <!-- CPU Accuracy -->
307 <string name="cpu_accuracy_accurate">Preciso</string>
308 <string name="cpu_accuracy_unsafe">Inseguro</string>
309 <string name="cpu_accuracy_paranoid">Paranoid (Lento)</string>
310
311 <!-- Gamepad Buttons -->
312 <string name="gamepad_d_pad">D-Pad</string>
313 <string name="gamepad_left_stick">Analógico Esquerdo</string>
314 <string name="gamepad_right_stick">Analógico Direito</string>
315 <string name="gamepad_home">Home</string>
316 <string name="gamepad_screenshot">Captura de ecrã</string>
317
318 <!-- Disk shader cache -->
319 <string name="preparing_shaders">A preparar shaders</string>
320 <string name="building_shaders">A criar shaders</string>
321
322 <!-- Theme options -->
323 <string name="change_app_theme">Muda o Tema da App</string>
324 <string name="theme_default">Padrão</string>
325 <string name="theme_material_you">Material You</string>
326
327 <!-- Theme Modes -->
328 <string name="change_theme_mode">Altera o Modo do Tema</string>
329 <string name="theme_mode_follow_system">Igual ao Sistema</string>
330 <string name="theme_mode_light">Claro</string>
331 <string name="theme_mode_dark">Escuro</string>
332
333 <!-- Black backgrounds theme -->
334 <string name="use_black_backgrounds">Usa Fundos Escuros</string>
335 <string name="use_black_backgrounds_description">Quando usar tema escuro, aplicar fundos escuros</string>
336
337</resources>
diff --git a/src/android/app/src/main/res/values-ru/strings.xml b/src/android/app/src/main/res/values-ru/strings.xml
new file mode 100644
index 000000000..0fb4908f7
--- /dev/null
+++ b/src/android/app/src/main/res/values-ru/strings.xml
@@ -0,0 +1,337 @@
1<?xml version="1.0" encoding="utf-8"?>
2<resources>
3
4 <string name="app_disclaimer">Это программное обеспечение позволяет запускать игры для игровой консоли Nintendo Switch. Мы не предоставляем сами игры или ключи.&lt;br /&gt;&lt;br /&gt;Перед началом работы найдите файл <![CDATA[<b> prod.keys </b>]]> в хранилище устройства..&lt;br /&gt;&lt;br /&gt;<![CDATA[<a href=\"https://yuzu-emu.org/help/quickstart\">Узнать больше</a>]]></string>
5 <string name="emulation_notification_channel_name">Эмуляция активна</string>
6 <string name="emulation_notification_channel_description">Показывает постоянное уведомление, когда запущена эмуляция.</string>
7 <string name="emulation_notification_running">yuzu запущен</string>
8 <string name="notice_notification_channel_name">Уведомления и ошибки</string>
9 <string name="notice_notification_channel_description">Показывать уведомления, когда что-то пошло не так</string>
10 <string name="notification_permission_not_granted">Вы не предоставили разрешение уведомлений!</string>
11
12 <!-- Setup strings -->
13 <string name="welcome">Добро пожаловать!</string>
14 <string name="welcome_description">Узнайте, как настроить &lt;b>yuzu&lt;/b> и перейти прямиком к эмуляции.</string>
15 <string name="get_started">Начать</string>
16 <string name="keys">Ключи</string>
17 <string name="keys_description">Выберите ваш файл &lt;b>prod.keys&lt;/b> с помощью кнопки ниже.</string>
18 <string name="select_keys">Выбрать ключи</string>
19 <string name="games">Игры</string>
20 <string name="games_description">Выберите вашу папку с &lt;b>играми&lt;/b> с помощью кнопки ниже.</string>
21 <string name="done">Готово</string>
22 <string name="done_description">Все готово.\nМожно играть!</string>
23 <string name="text_continue">Продолжить</string>
24 <string name="next">Далее</string>
25 <string name="back">Назад</string>
26 <string name="add_games">Добавить игры</string>
27 <string name="add_games_description">Выберите папку с играми</string>
28
29 <!-- Home strings -->
30 <string name="home_games">Игры</string>
31 <string name="home_search">Поиск</string>
32 <string name="home_settings">Настройки</string>
33 <string name="empty_gamelist">Не найдены файлы или еще не выбрана папка с играми.</string>
34 <string name="search_and_filter_games">Поиск и фильтрация игр</string>
35 <string name="select_games_folder">Выберите папку с играми</string>
36 <string name="select_games_folder_description">Позволяет yuzu заполнить список игр</string>
37 <string name="add_games_warning">Пропустить выбор папки с играми?</string>
38 <string name="add_games_warning_description">Игры не будут отображаться в списке Игры, если папка не выбрана.</string>
39 <string name="add_games_warning_help">https://yuzu-emu.org/help/quickstart/#dumping-games</string>
40 <string name="home_search_games">Найти игры</string>
41 <string name="games_dir_selected">Выбрана папка с играми</string>
42 <string name="install_prod_keys">Установить prod.keys</string>
43 <string name="install_prod_keys_description">Требуется для расшифровки розничных игр</string>
44 <string name="install_prod_keys_warning">Пропустить добавление ключей?</string>
45 <string name="install_prod_keys_warning_description">Для эмуляции розничных игр требуются действительные ключи. Если вы продолжите, будут работать только homebrew приложения.</string>
46 <string name="install_prod_keys_warning_help">https://yuzu-emu.org/help/quickstart/#guide-introduction</string>
47 <string name="notifications">Уведомления</string>
48 <string name="notifications_description">Предоставьте разрешение уведомлений с помощью кнопки ниже.</string>
49 <string name="give_permission">Предоставить разрешение</string>
50 <string name="notification_warning">Пропустить предоставление разрешения уведомлений?</string>
51 <string name="notification_warning_description">yuzu не сможет уведомлять вас о важной информации.</string>
52 <string name="permission_denied">Разрешение отказано</string>
53 <string name="permission_denied_description">Вы слишком часто отклоняли это разрешение, и теперь вам нужно будет вручную предоставить его в настройках системы.</string>
54 <string name="about">О нас</string>
55 <string name="about_description">Версия сборки, титры и другое</string>
56 <string name="warning_help">Помощь</string>
57 <string name="warning_skip">Пропустить</string>
58 <string name="warning_cancel">Отмена</string>
59 <string name="install_amiibo_keys">Установить ключи Amiibo</string>
60 <string name="install_amiibo_keys_description">Необходимо для использования Amiibo в играх</string>
61 <string name="invalid_keys_file">Выбран неверный файл ключей</string>
62 <string name="install_keys_success">Ключи успешно установлены</string>
63 <string name="reading_keys_failure">Ошибка при чтении ключей шифрования</string>
64 <string name="invalid_keys_error">Неверные ключи шифрования</string>
65 <string name="dumping_keys_quickstart_link">https://yuzu-emu.org/help/quickstart/#dumping-decryption-keys</string>
66 <string name="install_keys_failure_description">Выбранный файл неверен или поврежден. Пожалуйста, пере-дампите ваши ключи.</string>
67 <string name="install_gpu_driver">Установить драйвер ГП</string>
68 <string name="install_gpu_driver_description">Установите альтернативные драйверы для потенциально лучшей производительности и/или точности</string>
69 <string name="advanced_settings">Расширенные настройки</string>
70 <string name="settings_description">Настройка параметров эмулятора</string>
71 <string name="search_recently_played">Недавно сыграно</string>
72 <string name="search_recently_added">Недавно добавлено</string>
73 <string name="search_retail">Розничные</string>
74 <string name="search_homebrew">Homebrew</string>
75 <string name="open_user_folder">Открыть папку yuzu</string>
76 <string name="open_user_folder_description">Управление внутренними файлами yuzu</string>
77 <string name="theme_and_color_description">Изменение внешнего вида приложения</string>
78 <string name="no_file_manager">Не найден файловый менеджер</string>
79 <string name="notification_no_directory_link">Не удалось открыть папку yuzu</string>
80 <string name="notification_no_directory_link_description">Пожалуйста, найдите папку пользователя с помощью боковой панели файлового менеджера вручную.</string>
81 <string name="manage_save_data">Управление данными сохранений</string>
82 <string name="manage_save_data_description">Найдено данные сохранений. Пожалуйста, выберите вариант ниже.</string>
83 <string name="import_export_saves_description">Импорт или экспорт файлов сохранения</string>
84 <string name="import_export_saves_no_profile">Данные сохранений не найдены. Пожалуйста, запустите игру и повторите попытку.</string>
85 <string name="save_file_imported_success">Успешно импортировано</string>
86 <string name="save_file_invalid_zip_structure">Недопустимая структура папки сохранения</string>
87 <string name="save_file_invalid_zip_structure_description">Название первой вложенной папки должно быть идентификатором игры.</string>
88 <string name="import_saves">Импорт</string>
89 <string name="export_saves">Экспорт</string>
90
91 <!-- About screen strings -->
92 <string name="gaia_is_not_real">Gaia не существует</string>
93 <string name="copied_to_clipboard">Скопировано в буфер обмена</string>
94 <string name="about_app_description">Эмулятор Switch с открытым исходным кодом</string>
95 <string name="contributors">Контрибьюторы</string>
96 <string name="contributors_description">Сделано с \u2764 от команды yuzu</string>
97 <string name="contributors_link">https://github.com/yuzu-emu/yuzu/graphs/contributors</string>
98 <string name="build">Сборка</string>
99 <string name="support_link">https://discord.gg/u77vRWY</string>
100 <string name="website_link">https://yuzu-emu.org/</string>
101 <string name="github_link">https://github.com/yuzu-emu</string>
102
103 <!-- Early access upgrade strings -->
104 <string name="early_access">Ранний доступ</string>
105 <string name="get_early_access">Получить ранний доступ</string>
106 <string name="play_store_link">https://play.google.com/store/apps/details?id=org.yuzu.yuzu_emu.ea</string>
107 <string name="get_early_access_description">Новейшие возможности, ранний доступ к обновлениям и другое</string>
108 <string name="early_access_benefits">Преимущества раннего доступа</string>
109 <string name="cutting_edge_features">Новейшие возможности</string>
110 <string name="early_access_updates">Ранний доступ к обновлениям</string>
111 <string name="no_manual_installation">Без ручной установки</string>
112 <string name="prioritized_support">Приоритетная поддержка</string>
113 <string name="helping_game_preservation">Помощь в презервации игр</string>
114 <string name="our_eternal_gratitude">Наша бесконечная благодарность</string>
115 <string name="are_you_interested">Вы заинтересованы?</string>
116
117 <!-- General settings strings -->
118 <string name="frame_limit_enable">Включить ограничение скорости</string>
119 <string name="frame_limit_enable_description">Если эта функция включена, скорость эмуляции будет ограничена указанным процентом от нормальной скорости.</string>
120 <string name="frame_limit_slider">Ограничение процента cкорости</string>
121 <string name="frame_limit_slider_description">Указывает процент для ограничения скорости эмуляции. При значении по умолчанию 100% эмуляция будет ограничена нормальной скоростью. Значения выше или ниже будут увеличивать или уменьшать ограничение скорости.</string>
122 <string name="cpu_accuracy">Точность ЦП</string>
123
124 <!-- System settings strings -->
125 <string name="use_docked_mode">Режим док-станции</string>
126 <string name="use_docked_mode_description">Эмуляция режима док-станции, что увеличивает разрешение за счет снижения производительности.</string>
127 <string name="emulated_region">Эмулируемый регион</string>
128 <string name="emulated_language">Эмулируемый язык</string>
129 <string name="select_rtc_date">Выберите дату RTC</string>
130 <string name="select_rtc_time">Выберите время RTC</string>
131 <string name="use_custom_rtc">Включить пользовательский RTC</string>
132 <string name="use_custom_rtc_description">Этот параметр позволяет установить пользовательские часы реального времени отдельно от текущего системного времени</string>
133 <string name="set_custom_rtc">Установить пользовательский RTC</string>
134
135 <!-- Graphics settings strings -->
136 <string name="renderer_api">API</string>
137 <string name="renderer_accuracy">Уровень точности</string>
138 <string name="renderer_resolution">Разрешение</string>
139 <string name="renderer_vsync">Режим верт. синхронизации</string>
140 <string name="renderer_aspect_ratio">Соотношение сторон</string>
141 <string name="renderer_scaling_filter">Фильтр адаптации окна</string>
142 <string name="renderer_anti_aliasing">Метод сглаживания</string>
143 <string name="renderer_force_max_clock">Принудительно заставить максимальную тактовую частоту (только для Adreno)</string>
144 <string name="renderer_force_max_clock_description">Заставляет ГП работать на максимально возможных тактовых частотах (тепловые ограничения все равно будут применяться).</string>
145 <string name="renderer_asynchronous_shaders">Использовать асинхронные шейдеры</string>
146 <string name="renderer_asynchronous_shaders_description">Компилирует шейдеры асинхронно, что уменьшает зависания, но может взамен предоставить визуальные баги.</string>
147 <string name="renderer_debug">Включить отладку графики</string>
148 <string name="renderer_debug_description">Если включено, графический API переходит в более медленный режим отладки</string>
149 <string name="use_disk_shader_cache">Использовать кэш шейдеров на диске</string>
150 <string name="use_disk_shader_cache_description">Уменьшение зависаний за счет хранения и загрузки сгенерированных шейдеров на хранилище.</string>
151
152 <!-- Audio settings strings -->
153 <string name="audio_volume">Громкость</string>
154 <string name="audio_volume_description">Задает громкость аудиовыхода.</string>
155
156 <!-- Miscellaneous -->
157 <string name="slider_default">По умолчанию</string>
158 <string name="ini_saved">Сохраненные настройки</string>
159 <string name="gameid_saved">Настройки сохранены для %1$s</string>
160 <string name="error_saving">Ошибка сохранения %1$s.ini: %2$s</string>
161 <string name="loading">Загрузка...</string>
162 <string name="reset_setting_confirmation">Хотите ли вы вернуть этот параметр к значению по умолчанию?</string>
163 <string name="reset_to_default">Сброс к настройкам по умолчанию</string>
164 <string name="reset_all_settings">Сбросить все настройки?</string>
165 <string name="reset_all_settings_description">Все дополнительные настройки будут сброшены к настройке по умолчанию. Это невозможно отменить.</string>
166 <string name="settings_reset">Настройки сброшены</string>
167 <string name="close">Закрыть</string>
168 <string name="learn_more">Узнать больше</string>
169
170 <!-- GPU driver installation -->
171 <string name="select_gpu_driver">Выбрать драйвер ГП</string>
172 <string name="select_gpu_driver_title">Хотите заменить текущий драйвер ГП?</string>
173 <string name="select_gpu_driver_install">Установить</string>
174 <string name="select_gpu_driver_default">По умолчанию</string>
175 <string name="select_gpu_driver_install_success">Установлено %s</string>
176 <string name="select_gpu_driver_use_default">Используется стандартный драйвер ГП </string>
177 <string name="select_gpu_driver_error">Выбран неверный драйвер, используется стандартный системный!</string>
178 <string name="system_gpu_driver">Системный драйвер ГП</string>
179 <string name="installing_driver">Установка драйвера...</string>
180
181 <!-- Preferences Screen -->
182 <string name="preferences_settings">Настройки</string>
183 <string name="preferences_general">Общие</string>
184 <string name="preferences_system">Система</string>
185 <string name="preferences_graphics">Графика</string>
186 <string name="preferences_audio">Аудио</string>
187 <string name="preferences_theme">Тема и цвет</string>
188
189 <!-- ROM loading errors -->
190 <string name="loader_error_encrypted">Ваш ROM зашифрованный</string>
191 <string name="loader_error_encrypted_roms_description"><![CDATA[Пожалуйста, следуйте инструкциям, чтобы пере-дампить ваши <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-cartridge-games\">игровые картриджи</a> или <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-installed-titles-eshop\">установленные игры</a>.]]></string>
192 <string name="loader_error_encrypted_keys_description"><![CDATA[Пожалуйста, убедитесь, что ваш файл <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-prodkeys-and-titlekeys\">prod.keys</a> установлен, чтобы игры можно было расшифровать.]]></string>
193 <string name="loader_error_video_core">Произошла ошибка при инициализации видеоядра.</string>
194 <string name="loader_error_video_core_description">Обычно это вызвано несовместимым драйвером ГП. Установка пользовательского драйвера ГП может решить эту проблему.</string>
195 <string name="loader_error_invalid_format">Не удалось запустить ROM</string>
196 <string name="loader_error_file_not_found">Файл ROM не существует</string>
197
198 <!-- Emulation Menu -->
199 <string name="emulation_exit">Выход из эмуляции</string>
200 <string name="emulation_done">Готово</string>
201 <string name="emulation_fps_counter">Счётчик FPS</string>
202 <string name="emulation_toggle_controls">Переключение управления</string>
203 <string name="emulation_rel_stick_center">Относительный центр стика</string>
204 <string name="emulation_dpad_slide">Слайд крестовиной</string>
205 <string name="emulation_haptics">Тактильная обратная связь</string>
206 <string name="emulation_show_overlay">Показать оверлей</string>
207 <string name="emulation_toggle_all">Переключить всё</string>
208 <string name="emulation_control_adjust">Настроить оверлей</string>
209 <string name="emulation_control_scale">Масштаб</string>
210 <string name="emulation_control_opacity">Непрозрачность</string>
211 <string name="emulation_touch_overlay_reset">Сбросить оверлей</string>
212 <string name="emulation_touch_overlay_edit">Изменить оверлей</string>
213 <string name="emulation_pause">Пауза эмуляции</string>
214 <string name="emulation_unpause">Возобновление эмуляции</string>
215 <string name="emulation_input_overlay">Настройки оверлея</string>
216 <string name="emulation_game_loading">Загрузка игры...</string>
217
218 <string name="load_settings">Загрузка настроек...</string>
219
220 <!-- Software keyboard -->
221 <string name="software_keyboard">Виртуальная клавиатура</string>
222
223 <!-- Errors and warnings -->
224 <string name="abort_button">Прервать</string>
225 <string name="continue_button">Продолжить</string>
226 <string name="system_archive_not_found">Системный архив не найден</string>
227 <string name="system_archive_not_found_message">%s отсутствует. Пожалуйста, сдампите ваши системные архивы.\nПродолжение эмуляции может привести к сбоям и ошибкам.</string>
228 <string name="system_archive_general">Системный архив</string>
229 <string name="save_load_error">Ошибка сохранения/загрузки</string>
230 <string name="fatal_error">Фатальная ошибка</string>
231 <string name="fatal_error_message">Произошла фатальная ошибка. Проверьте журнал для получения подробной информации.\nПродолжение эмуляции может привести к сбоям и ошибкам.</string>
232 <string name="performance_warning">Отключение этой настройки значительно снизит производительность эмуляции! Для достижения наилучших результатов рекомендуется оставить эту настройку включенной.</string>
233
234 <!-- Region Names -->
235 <string name="region_japan">Япония</string>
236 <string name="region_usa">США</string>
237 <string name="region_europe">Европа</string>
238 <string name="region_australia">Австралия</string>
239 <string name="region_china">Китай</string>
240 <string name="region_korea">Корея</string>
241 <string name="region_taiwan">Тайвань</string>
242
243 <!-- Language Names -->
244 <string name="language_japanese">Японский (日本語)</string>
245 <string name="language_english">Английский (English)</string>
246 <string name="language_french">Французский (Français)</string>
247 <string name="langauge_german">Немецкий (Deutsch)</string>
248 <string name="language_italian">Итальянский (Italiano)</string>
249 <string name="language_spanish">Испанский (Español)</string>
250 <string name="language_chinese">Китайский (简体中文)</string>
251 <string name="language_korean">Корейский (한국어)</string>
252 <string name="language_dutch">Голландский (Nederlands)</string>
253 <string name="language_portuguese">Португальский (Português)</string>
254 <string name="language_russian">Русский</string>
255 <string name="language_taiwanese">Тайваньский (台湾)</string>
256 <string name="language_british_english">Британский английский</string>
257 <string name="language_canadian_french">Канадский французский (Français canadien)</string>
258 <string name="language_latin_american_spanish">Латиноамериканский испанский (Español latinoamericano)</string>
259 <string name="language_simplified_chinese">Упрощенный китайский (简体中文)</string>
260 <string name="language_traditional_chinese">Традиционный китайский (正體中文)</string>
261 <string name="language_brazilian_portuguese">Бразильский португальский (Português do Brasil)</string>
262
263 <!-- Renderer APIs -->
264 <string name="renderer_vulkan">Vulkan</string>
265 <string name="renderer_none">Никакой</string>
266
267 <!-- Renderer Accuracy -->
268 <string name="renderer_accuracy_normal">Нормальная</string>
269 <string name="renderer_accuracy_high">Высокая</string>
270 <string name="renderer_accuracy_extreme">Экстрим (медленный)</string>
271
272 <!-- Resolutions -->
273 <string name="resolution_half">0.5X (360p/540p)</string>
274 <string name="resolution_three_quarter">0.75X (540p/810p)</string>
275 <string name="resolution_one">1X (720p/1080p)</string>
276 <string name="resolution_two">2X (1440p/2160p) (Медленно)</string>
277 <string name="resolution_three">3X (2160p/3240p) (Медленно)</string>
278 <string name="resolution_four">4X (2880p/4320p) (Медленно)</string>
279
280 <!-- Renderer VSync -->
281 <string name="renderer_vsync_immediate">Моментальная (выключена) </string>
282 <string name="renderer_vsync_mailbox">Mailbox</string>
283 <string name="renderer_vsync_fifo">FIFO (Включена)</string>
284 <string name="renderer_vsync_fifo_relaxed">FIFO Relaxed</string>
285
286 <!-- Scaling Filters -->
287 <string name="scaling_filter_nearest_neighbor">Ближайший сосед</string>
288 <string name="scaling_filter_bilinear">Билинейный</string>
289 <string name="scaling_filter_bicubic">Бикубический</string>
290 <string name="scaling_filter_gaussian">Гаусс</string>
291 <string name="scaling_filter_scale_force">ScaleForce</string>
292 <string name="scaling_filter_fsr">AMD FidelityFX™️ Super Resolution</string>
293
294 <!-- Anti-Aliasing -->
295 <string name="anti_aliasing_none">Выкл.</string>
296 <string name="anti_aliasing_fxaa">FXAA</string>
297 <string name="anti_aliasing_smaa">SMAA</string>
298
299 <!-- Aspect Ratios -->
300 <string name="ratio_default">Стандартное (16:9)</string>
301 <string name="ratio_force_four_three">Заставить 4:3</string>
302 <string name="ratio_force_twenty_one_nine">Заставить 21:9</string>
303 <string name="ratio_force_sixteen_ten">Заставить 16:10</string>
304 <string name="ratio_stretch">Растянуть до окна</string>
305
306 <!-- CPU Accuracy -->
307 <string name="cpu_accuracy_accurate">Точно</string>
308 <string name="cpu_accuracy_unsafe">Небезопасно</string>
309 <string name="cpu_accuracy_paranoid">Параноик (медленно)</string>
310
311 <!-- Gamepad Buttons -->
312 <string name="gamepad_d_pad">Крестовина</string>
313 <string name="gamepad_left_stick">Левый мини-джойстик</string>
314 <string name="gamepad_right_stick">Правый мини-джойстик</string>
315 <string name="gamepad_home">Home</string>
316 <string name="gamepad_screenshot">Скриншот</string>
317
318 <!-- Disk shader cache -->
319 <string name="preparing_shaders">Подготовка шейдеров</string>
320 <string name="building_shaders">Постройка шейдеров</string>
321
322 <!-- Theme options -->
323 <string name="change_app_theme">Изменить тему приложения</string>
324 <string name="theme_default">По умолчанию</string>
325 <string name="theme_material_you">Material You</string>
326
327 <!-- Theme Modes -->
328 <string name="change_theme_mode">Изменить режим темы</string>
329 <string name="theme_mode_follow_system">Системная</string>
330 <string name="theme_mode_light">Светлая</string>
331 <string name="theme_mode_dark">Темная</string>
332
333 <!-- Black backgrounds theme -->
334 <string name="use_black_backgrounds">Использовать черный фон</string>
335 <string name="use_black_backgrounds_description">При использовании темной темы применяйте черный фон.</string>
336
337</resources>
diff --git a/src/android/app/src/main/res/values-uk/strings.xml b/src/android/app/src/main/res/values-uk/strings.xml
new file mode 100644
index 000000000..0d11eb2d2
--- /dev/null
+++ b/src/android/app/src/main/res/values-uk/strings.xml
@@ -0,0 +1,337 @@
1<?xml version="1.0" encoding="utf-8"?>
2<resources>
3
4 <string name="app_disclaimer">Це програмне забезпечення дозволяє запускати ігри для ігрової консолі Nintendo Switch. Ми не надаємо самі ігри або ключі.&lt;br /&gt;&lt;br /&gt;Перед початком роботи знайдіть ваш файл <![CDATA[<b> prod.keys </b>]]> у сховищі пристрою.&lt;br /&gt;&lt;br /&gt;<![CDATA[<a href=\"https://yuzu-emu.org/help/quickstart\">Дізнатися більше</a>]]></string>
5 <string name="emulation_notification_channel_name">Емуляція активна</string>
6 <string name="emulation_notification_channel_description">Показує постійне сповіщення, коли запущено емуляцію.</string>
7 <string name="emulation_notification_running">yuzu запущено</string>
8 <string name="notice_notification_channel_name">Сповіщення та помилки</string>
9 <string name="notice_notification_channel_description">Показувати сповіщення, коли щось пішло не так</string>
10 <string name="notification_permission_not_granted">Ви не надали дозвіл сповіщень!</string>
11
12 <!-- Setup strings -->
13 <string name="welcome">Вітаємо!</string>
14 <string name="welcome_description">Дізнайтеся, як налаштувати &lt;b>yuzu&lt;/b> та перейти до емуляції.</string>
15 <string name="get_started">Розпочати</string>
16 <string name="keys">Ключі</string>
17 <string name="keys_description">Виберіть ваш файл &lt;b>prod.keys&lt;/b> за допомогою кнопки нижче.</string>
18 <string name="select_keys">Вибрати ключі</string>
19 <string name="games">Ігри</string>
20 <string name="games_description">Виберіть вашу папку з &lt;b>іграми&lt;/b> за допомогою кнопки нижче.</string>
21 <string name="done">Готово</string>
22 <string name="done_description">Все готово.\nМожна грати!</string>
23 <string name="text_continue">Продовжити</string>
24 <string name="next">Далі</string>
25 <string name="back">Назад</string>
26 <string name="add_games">Додати ігри</string>
27 <string name="add_games_description">Виберіть папку з іграми</string>
28
29 <!-- Home strings -->
30 <string name="home_games">Ігри</string>
31 <string name="home_search">Пошук</string>
32 <string name="home_settings">Налаштування</string>
33 <string name="empty_gamelist">Не знайдено файлів або ще не вибрано папку з іграми.</string>
34 <string name="search_and_filter_games">Пошук та фільтрація ігор</string>
35 <string name="select_games_folder">Виберіть папку з іграми</string>
36 <string name="select_games_folder_description">Дозволяє yuzu заповнити список ігор</string>
37 <string name="add_games_warning">Пропустити вибір папки з іграми?</string>
38 <string name="add_games_warning_description">Ігри не відображатимуться у списку Ігри, якщо папку не вибрано.</string>
39 <string name="add_games_warning_help">https://yuzu-emu.org/help/quickstart/#dumping-games</string>
40 <string name="home_search_games">Знайти ігри</string>
41 <string name="games_dir_selected">Вибрано папку з іграми</string>
42 <string name="install_prod_keys">Встановити prod.keys</string>
43 <string name="install_prod_keys_description">Потрібно для розшифровки роздрібних ігор</string>
44 <string name="install_prod_keys_warning">Пропустити додавання ключів?</string>
45 <string name="install_prod_keys_warning_description">Для емуляції роздрібних ігор потрібні дійсні ключі. Якщо ви продовжите, працюватимуть тільки homebrew додатки.</string>
46 <string name="install_prod_keys_warning_help">https://yuzu-emu.org/help/quickstart/#guide-introduction</string>
47 <string name="notifications">Сповіщення</string>
48 <string name="notifications_description">Надайте дозвіл сповіщень за допомогою кнопки нижче.</string>
49 <string name="give_permission">Надати дозвіл</string>
50 <string name="notification_warning">Пропустити надання дозволу сповіщень?</string>
51 <string name="notification_warning_description">yuzu не зможе повідомляти вас про важливу інформацію.</string>
52 <string name="permission_denied">У дозволі відмовлено</string>
53 <string name="permission_denied_description">Ви занадто часто відхиляли цей дозвіл, тож тепер вам потрібно буде вручну надати його в системних налаштуваннях.</string>
54 <string name="about">Про нас</string>
55 <string name="about_description">Версія збірки, титри та інше</string>
56 <string name="warning_help">Допомога</string>
57 <string name="warning_skip">Пропустити</string>
58 <string name="warning_cancel">Відміна</string>
59 <string name="install_amiibo_keys">Встановити ключі Amiibo</string>
60 <string name="install_amiibo_keys_description">Необхідно для використання Amiibo в іграх</string>
61 <string name="invalid_keys_file">Вибрано неправильний файл ключів</string>
62 <string name="install_keys_success">Ключі успішно встановлено</string>
63 <string name="reading_keys_failure">Помилка під час зчитування ключів шифрування</string>
64 <string name="invalid_keys_error">Невірні ключі шифрування</string>
65 <string name="dumping_keys_quickstart_link">https://yuzu-emu.org/help/quickstart/#dumping-decryption-keys</string>
66 <string name="install_keys_failure_description">Обраний файл невірний або пошкоджений. Будь ласка, пере-дампіть ваші ключі.</string>
67 <string name="install_gpu_driver">Встановити драйвер ГП</string>
68 <string name="install_gpu_driver_description">Встановіть альтернативні драйвери для потенційно кращої продуктивності та/або точності</string>
69 <string name="advanced_settings">Розширені налаштування</string>
70 <string name="settings_description">Налаштування параметрів емулятора</string>
71 <string name="search_recently_played">Нещодавно зіграно</string>
72 <string name="search_recently_added">Нещодавно додано</string>
73 <string name="search_retail">Роздрібні</string>
74 <string name="search_homebrew">Homebrew</string>
75 <string name="open_user_folder">Відкрити папку yuzu</string>
76 <string name="open_user_folder_description">Керування внутрішніми файлами yuzu</string>
77 <string name="theme_and_color_description">Змінити зовнішній вигляд застосунку</string>
78 <string name="no_file_manager">Не знайдено файлового менеджера</string>
79 <string name="notification_no_directory_link">Не вдалося відкрити папку yuzu</string>
80 <string name="notification_no_directory_link_description">Будь ласка, знайдіть папку користувача за допомогою бічної панелі файлового менеджера вручну.</string>
81 <string name="manage_save_data">Керування даними збережень</string>
82 <string name="manage_save_data_description">Знайдено дані збережень. Будь ласка, виберіть варіант нижче.</string>
83 <string name="import_export_saves_description">Імпорт або експорт файлів збереження</string>
84 <string name="import_export_saves_no_profile">Дані збережень не знайдено. Будь ласка, запустіть гру та повторіть спробу.</string>
85 <string name="save_file_imported_success">Успішно імпортовано</string>
86 <string name="save_file_invalid_zip_structure">Неприпустима структура папки збереження</string>
87 <string name="save_file_invalid_zip_structure_description">Назва першої вкладеної папки має бути ідентифікатором гри.</string>
88 <string name="import_saves">Імпорт</string>
89 <string name="export_saves">Експорт</string>
90
91 <!-- About screen strings -->
92 <string name="gaia_is_not_real">Gaia не існує</string>
93 <string name="copied_to_clipboard">Скопійовано в буфер обміну</string>
94 <string name="about_app_description">Емулятор Switch із відкритим першокодом</string>
95 <string name="contributors">Вкладники</string>
96 <string name="contributors_description">Зроблено з \u2764 від команди yuzu</string>
97 <string name="contributors_link">https://github.com/yuzu-emu/yuzu/graphs/contributors</string>
98 <string name="build">Збірка</string>
99 <string name="support_link">https://discord.gg/u77vRWY</string>
100 <string name="website_link">https://yuzu-emu.org/</string>
101 <string name="github_link">https://github.com/yuzu-emu</string>
102
103 <!-- Early access upgrade strings -->
104 <string name="early_access">Ранній доступ</string>
105 <string name="get_early_access">Отримати ранній доступ</string>
106 <string name="play_store_link">https://play.google.com/store/apps/details?id=org.yuzu.yuzu_emu.ea</string>
107 <string name="get_early_access_description">Новітні можливості, ранній доступ до оновлень та інше</string>
108 <string name="early_access_benefits">Переваги раннього доступу</string>
109 <string name="cutting_edge_features">Новітні можливості</string>
110 <string name="early_access_updates">Ранній доступ до оновлень</string>
111 <string name="no_manual_installation">Без ручного встановлення</string>
112 <string name="prioritized_support">Пріоритетна підтримка</string>
113 <string name="helping_game_preservation">Допомога в презервації ігор</string>
114 <string name="our_eternal_gratitude">Наша нескінченна вдячність</string>
115 <string name="are_you_interested">Ви зацікавлені?</string>
116
117 <!-- General settings strings -->
118 <string name="frame_limit_enable">Увімкнути обмеження швидкості</string>
119 <string name="frame_limit_enable_description">Якщо цю функцію ввімкнено, швидкість емуляції буде обмежена зазначеним відсотком від нормальної швидкості.</string>
120 <string name="frame_limit_slider">Обмеження відсотка швидкості</string>
121 <string name="frame_limit_slider_description">Вказує відсоток для обмеження швидкості емуляції. При значенні за замовчуванням 100% емуляція буде обмежена нормальною швидкістю. Значення вище або нижче збільшуватимуть або зменшуватимуть обмеження швидкості.</string>
122 <string name="cpu_accuracy">Точність ЦП</string>
123
124 <!-- System settings strings -->
125 <string name="use_docked_mode">Режим док-станції</string>
126 <string name="use_docked_mode_description">Емуляція режиму док-станції, що збільшує роздільну здатність за рахунок зниження продуктивності.</string>
127 <string name="emulated_region">Емульований регіон</string>
128 <string name="emulated_language">Емульована мова</string>
129 <string name="select_rtc_date">Оберіть дату RTC</string>
130 <string name="select_rtc_time">Оберіть час RTC</string>
131 <string name="use_custom_rtc">Увімкнути користувацький RTC</string>
132 <string name="use_custom_rtc_description">Цей параметр дає змогу встановити користувацький годинник реального часу окремо від поточного системного часу</string>
133 <string name="set_custom_rtc">Встановити користувацький RTC</string>
134
135 <!-- Graphics settings strings -->
136 <string name="renderer_api">API</string>
137 <string name="renderer_accuracy">Рівень точності</string>
138 <string name="renderer_resolution">Роздільна здатність</string>
139 <string name="renderer_vsync">Режим верт. синхронізації</string>
140 <string name="renderer_aspect_ratio">Співвідношення сторін</string>
141 <string name="renderer_scaling_filter">Фільтр адаптації вікна</string>
142 <string name="renderer_anti_aliasing">Метод згладжування</string>
143 <string name="renderer_force_max_clock">Примусово змусити максимальну тактову частоту (тільки для Adreno)</string>
144 <string name="renderer_force_max_clock_description">Змушує ГП працювати на максимально можливих тактових частотах (теплові обмеження все одно будуть застосовуватися).</string>
145 <string name="renderer_asynchronous_shaders">Використовувати асинхронні шейдери</string>
146 <string name="renderer_asynchronous_shaders_description">Компілює шейдери асинхронно, що зменшує зависання, але може натомість надати візуальні баги.</string>
147 <string name="renderer_debug">Увімкнути налагодження графіки</string>
148 <string name="renderer_debug_description">Якщо увімкнено, графічний API переходить у повільніший режим налагодження</string>
149 <string name="use_disk_shader_cache">Використовувати кеш шейдерів на диску</string>
150 <string name="use_disk_shader_cache_description">Зменшення зависань завдяки зберіганню та завантаженню згенерованих шейдерів на сховище.</string>
151
152 <!-- Audio settings strings -->
153 <string name="audio_volume">Гучність</string>
154 <string name="audio_volume_description">Вказує гучність аудіовиходу.</string>
155
156 <!-- Miscellaneous -->
157 <string name="slider_default">За замовчуванням</string>
158 <string name="ini_saved">Збережені налаштування</string>
159 <string name="gameid_saved">Налаштування збережені для %1$s</string>
160 <string name="error_saving">Помилка збереження %1$s.ini: %2$s</string>
161 <string name="loading">Завантаження...</string>
162 <string name="reset_setting_confirmation">Чи хочете ви повернути цей параметр до значення за замовчуванням?</string>
163 <string name="reset_to_default">Скидання до налаштувань за замовчуванням</string>
164 <string name="reset_all_settings">Скинути всі налаштування</string>
165 <string name="reset_all_settings_description">Усі додаткові налаштування буде скинуто до налаштування за замовчуванням. Це неможливо скасувати.</string>
166 <string name="settings_reset">Налаштування скинуто</string>
167 <string name="close">Закрити</string>
168 <string name="learn_more">Дізнатися більше</string>
169
170 <!-- GPU driver installation -->
171 <string name="select_gpu_driver">Вибрати драйвер ГП</string>
172 <string name="select_gpu_driver_title">Хочете замінити поточний драйвер ГП?</string>
173 <string name="select_gpu_driver_install">Встановити</string>
174 <string name="select_gpu_driver_default">За замовчуванням</string>
175 <string name="select_gpu_driver_install_success">Встановлено %s</string>
176 <string name="select_gpu_driver_use_default">Використовується стандартний драйвер ГП</string>
177 <string name="select_gpu_driver_error">Обрано неправильний драйвер, використовується стандартний системний!</string>
178 <string name="system_gpu_driver">Системний драйвер ГП</string>
179 <string name="installing_driver">Встановлення драйвера...</string>
180
181 <!-- Preferences Screen -->
182 <string name="preferences_settings">Налаштування</string>
183 <string name="preferences_general">Загальні</string>
184 <string name="preferences_system">Система</string>
185 <string name="preferences_graphics">Графіка</string>
186 <string name="preferences_audio">Аудіо</string>
187 <string name="preferences_theme">Тема і колір</string>
188
189 <!-- ROM loading errors -->
190 <string name="loader_error_encrypted">Ваш ROM зашифрований</string>
191 <string name="loader_error_encrypted_roms_description"><![CDATA[Будь ласка, дотримуйтесь інструкцій, щоб пере-дампити ваші <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-cartridge-games\">ігрові картриджі</a> або <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-installed-titles-eshop\">встановлені ігри</a>.]]></string>
192 <string name="loader_error_encrypted_keys_description"><![CDATA[Будь ласка, переконайтеся, що ваш файл <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-prodkeys-and-titlekeys\">prod.keys</a> встановлено, щоб ігри можна було розшифрувати.]]></string>
193 <string name="loader_error_video_core">Сталася помилка під час ініціалізації відеоядра.</string>
194 <string name="loader_error_video_core_description">Зазвичай це спричинено несумісним драйвером ГП. Встановлення користувацького драйвера ГП може вирішити цю проблему.</string>
195 <string name="loader_error_invalid_format">Не вдалося запустити ROM</string>
196 <string name="loader_error_file_not_found">Файл ROM не існує</string>
197
198 <!-- Emulation Menu -->
199 <string name="emulation_exit">Вихід з емуляції</string>
200 <string name="emulation_done">Готово</string>
201 <string name="emulation_fps_counter">Лічильник FPS</string>
202 <string name="emulation_toggle_controls">Перемикання керування</string>
203 <string name="emulation_rel_stick_center">Відносний центр стіка</string>
204 <string name="emulation_dpad_slide">Слайд хрестовиною</string>
205 <string name="emulation_haptics">Тактильний зворотний зв\'язок</string>
206 <string name="emulation_show_overlay">Показати оверлей</string>
207 <string name="emulation_toggle_all">Перемкнути все</string>
208 <string name="emulation_control_adjust">Налаштувати оверлей</string>
209 <string name="emulation_control_scale">Масштаб</string>
210 <string name="emulation_control_opacity">Непрозорість</string>
211 <string name="emulation_touch_overlay_reset">Скинути оверлей</string>
212 <string name="emulation_touch_overlay_edit">Змінити оверлей</string>
213 <string name="emulation_pause">Пауза емуляції</string>
214 <string name="emulation_unpause">Відновлення емуляції</string>
215 <string name="emulation_input_overlay">Налаштування оверлея</string>
216 <string name="emulation_game_loading">Завантаження гри...</string>
217
218 <string name="load_settings">Завантаження налаштувань...</string>
219
220 <!-- Software keyboard -->
221 <string name="software_keyboard">Віртуальна клавіатура</string>
222
223 <!-- Errors and warnings -->
224 <string name="abort_button">Перервати</string>
225 <string name="continue_button">Продовжити</string>
226 <string name="system_archive_not_found">Системний архів не знайдено</string>
227 <string name="system_archive_not_found_message">%s відсутній. Будь ласка, здампіть ваші системні архіви.\nПродовження емуляції може призвести до збоїв і помилок.</string>
228 <string name="system_archive_general">Системний архів</string>
229 <string name="save_load_error">Помилка збереження/завантаження</string>
230 <string name="fatal_error">Фатальна помилка</string>
231 <string name="fatal_error_message">Сталася фатальна помилка. Перевірте журнал для отримання докладної інформації.\nПродовження емуляції може призвести до збоїв і помилок.</string>
232 <string name="performance_warning">Вимкнення цього налаштування значно знизить продуктивність емуляції! Для досягнення найкращих результатів рекомендується залишити це налаштування увімкненим.</string>
233
234 <!-- Region Names -->
235 <string name="region_japan">Японія</string>
236 <string name="region_usa">США</string>
237 <string name="region_europe">Європа</string>
238 <string name="region_australia">Австралія</string>
239 <string name="region_china">Китай</string>
240 <string name="region_korea">Корея</string>
241 <string name="region_taiwan">Тайвань</string>
242
243 <!-- Language Names -->
244 <string name="language_japanese">Японська (日本語)</string>
245 <string name="language_english">Англійська (English)</string>
246 <string name="language_french">Французька (Français)</string>
247 <string name="langauge_german">Німецька (Deutsch)</string>
248 <string name="language_italian">Італійська (Italiano)</string>
249 <string name="language_spanish">Іспанська (Español)</string>
250 <string name="language_chinese">Китайскька (简体中文)</string>
251 <string name="language_korean">Корейська (한국어)</string>
252 <string name="language_dutch">Голландська (Nederlands)</string>
253 <string name="language_portuguese">Португальська (Português)</string>
254 <string name="language_russian">Російська (Русский)</string>
255 <string name="language_taiwanese">Тайванська (台湾)</string>
256 <string name="language_british_english">Британська англійська</string>
257 <string name="language_canadian_french">Канадська французька (Français canadien)</string>
258 <string name="language_latin_american_spanish">Латиноамериканська іспанська (Español latinoamericano)</string>
259 <string name="language_simplified_chinese">Спрощена китайська (简体中文)</string>
260 <string name="language_traditional_chinese">Традиційна китайська (正體中文)</string>
261 <string name="language_brazilian_portuguese">Бразильська португальська (Português do Brasil)</string>
262
263 <!-- Renderer APIs -->
264 <string name="renderer_vulkan">Vulkan</string>
265 <string name="renderer_none">Вимкнено</string>
266
267 <!-- Renderer Accuracy -->
268 <string name="renderer_accuracy_normal">Нормальна</string>
269 <string name="renderer_accuracy_high">Висока</string>
270 <string name="renderer_accuracy_extreme">Екстрим (повільно)</string>
271
272 <!-- Resolutions -->
273 <string name="resolution_half">0.5X (360p/540p)</string>
274 <string name="resolution_three_quarter">0.75X (540p/810p)</string>
275 <string name="resolution_one">1X (720p/1080p)</string>
276 <string name="resolution_two">2X (1440p/2160p) (Повільно)</string>
277 <string name="resolution_three">3X (2160p/3240p) (Повільно)</string>
278 <string name="resolution_four">4X (2880p/4320p) (Повільно)</string>
279
280 <!-- Renderer VSync -->
281 <string name="renderer_vsync_immediate">Моментальна (вимкнена)</string>
282 <string name="renderer_vsync_mailbox">Mailbox</string>
283 <string name="renderer_vsync_fifo">FIFO (ввімкнута)</string>
284 <string name="renderer_vsync_fifo_relaxed">FIFO Relaxed</string>
285
286 <!-- Scaling Filters -->
287 <string name="scaling_filter_nearest_neighbor">Найближчий сусід</string>
288 <string name="scaling_filter_bilinear">Білінійне</string>
289 <string name="scaling_filter_bicubic">Бікубічне</string>
290 <string name="scaling_filter_gaussian">Гауса</string>
291 <string name="scaling_filter_scale_force">ScaleForce</string>
292 <string name="scaling_filter_fsr">AMD FidelityFX™ Super Resolution</string>
293
294 <!-- Anti-Aliasing -->
295 <string name="anti_aliasing_none">Вимкнено</string>
296 <string name="anti_aliasing_fxaa">FXAA</string>
297 <string name="anti_aliasing_smaa">SMAA</string>
298
299 <!-- Aspect Ratios -->
300 <string name="ratio_default">За замовчуванням (16:9)</string>
301 <string name="ratio_force_four_three">Змусити 4:3</string>
302 <string name="ratio_force_twenty_one_nine">Змусити 21:9</string>
303 <string name="ratio_force_sixteen_ten">Змусити 16:10</string>
304 <string name="ratio_stretch">Розтягнути до вікна</string>
305
306 <!-- CPU Accuracy -->
307 <string name="cpu_accuracy_accurate">Точно</string>
308 <string name="cpu_accuracy_unsafe">Небезпечно</string>
309 <string name="cpu_accuracy_paranoid">Параноїк (повільно)</string>
310
311 <!-- Gamepad Buttons -->
312 <string name="gamepad_d_pad">Кнопки напрямків</string>
313 <string name="gamepad_left_stick">Лівий міні-джойстик</string>
314 <string name="gamepad_right_stick">Правий міні-джойстик</string>
315 <string name="gamepad_home">Home</string>
316 <string name="gamepad_screenshot">Знімок екрану</string>
317
318 <!-- Disk shader cache -->
319 <string name="preparing_shaders">Підготовка шейдерів</string>
320 <string name="building_shaders">Побудова шейдерів</string>
321
322 <!-- Theme options -->
323 <string name="change_app_theme">Змінити тему застосунку</string>
324 <string name="theme_default">За замовчуванням</string>
325 <string name="theme_material_you">Material You</string>
326
327 <!-- Theme Modes -->
328 <string name="change_theme_mode">Змінити режим теми</string>
329 <string name="theme_mode_follow_system">Системна</string>
330 <string name="theme_mode_light">Світла</string>
331 <string name="theme_mode_dark">Темна</string>
332
333 <!-- Black backgrounds theme -->
334 <string name="use_black_backgrounds">Використовувати чорне тло</string>
335 <string name="use_black_backgrounds_description">У разі використання темної теми застосовуйте чорне тло.</string>
336
337</resources>
diff --git a/src/android/app/src/main/res/values-zh-rCN/strings.xml b/src/android/app/src/main/res/values-zh-rCN/strings.xml
new file mode 100644
index 000000000..e00bbaa2e
--- /dev/null
+++ b/src/android/app/src/main/res/values-zh-rCN/strings.xml
@@ -0,0 +1,337 @@
1<?xml version="1.0" encoding="utf-8"?>
2<resources>
3
4 <string name="app_disclaimer">此软件可以运行 Nintendo Switch 游戏,但不包含任何游戏和密钥文件。&lt;br /&gt;&lt;br /&gt;在开始前,请找到放置于设备存储中的 <![CDATA[<b> prod.keys </b>]]> 文件。&lt;br /&gt;&lt;br /&gt;<![CDATA[<a href=\"https://yuzu-emu.org/help/quickstart\">了解更多</a>]]></string>
5 <string name="emulation_notification_channel_name">正在进行模拟</string>
6 <string name="emulation_notification_channel_description">在模拟运行时显示持久通知。</string>
7 <string name="emulation_notification_running">yuzu 正在运行</string>
8 <string name="notice_notification_channel_name">通知及错误提醒</string>
9 <string name="notice_notification_channel_description">当发生错误时显示通知。</string>
10 <string name="notification_permission_not_granted">未授予通知权限!</string>
11
12 <!-- Setup strings -->
13 <string name="welcome">欢迎!</string>
14 <string name="welcome_description">了解如何设置 &lt;b>yuzu&lt;/b> 并进行模拟。</string>
15 <string name="get_started">开始</string>
16 <string name="keys">密钥文件</string>
17 <string name="keys_description">使用下方的按钮来选择你的 &lt;b>prod.keys&lt;/b> 文件。</string>
18 <string name="select_keys">选择密钥文件</string>
19 <string name="games">游戏</string>
20 <string name="games_description">使用下方的按钮选择你的 &lt;b>游戏&lt;/b> 文件夹。</string>
21 <string name="done">完成</string>
22 <string name="done_description">你完成了全部设置。\n玩的开心!</string>
23 <string name="text_continue">继续</string>
24 <string name="next">下一步</string>
25 <string name="back">上一步</string>
26 <string name="add_games">添加游戏</string>
27 <string name="add_games_description">选择你的游戏文件夹</string>
28
29 <!-- Home strings -->
30 <string name="home_games">游戏</string>
31 <string name="home_search">搜索</string>
32 <string name="home_settings">设置</string>
33 <string name="empty_gamelist">找不到游戏,或者尚未选择游戏文件夹。</string>
34 <string name="search_and_filter_games">搜索游戏</string>
35 <string name="select_games_folder">选择游戏文件夹</string>
36 <string name="select_games_folder_description">允许 yuzu 填充游戏列表</string>
37 <string name="add_games_warning">跳过选择游戏文件夹?</string>
38 <string name="add_games_warning_description">如果未选择游戏文件夹,游戏将不会显示在游戏列表中。</string>
39 <string name="add_games_warning_help">https://yuzu-emu.org/help/quickstart/#dumping-games</string>
40 <string name="home_search_games">搜索游戏</string>
41 <string name="games_dir_selected">已选择游戏文件夹</string>
42 <string name="install_prod_keys">安装 prod.keys 文件</string>
43 <string name="install_prod_keys_description">需要密钥文件来解密游戏</string>
44 <string name="install_prod_keys_warning">跳过添加密钥文件?</string>
45 <string name="install_prod_keys_warning_description">对于商业游戏,需要有效的密钥文件才能运行。如果没有密钥文件,将只能运行自制软件。</string>
46 <string name="install_prod_keys_warning_help">https://yuzu-emu.org/help/quickstart/#guide-introduction</string>
47 <string name="notifications">通知</string>
48 <string name="notifications_description">使用下方的按钮授予通知权限。</string>
49 <string name="give_permission">授予权限</string>
50 <string name="notification_warning">跳过授予通知权限?</string>
51 <string name="notification_warning_description">yuzu 将无法通知您重要信息。</string>
52 <string name="permission_denied">授权遭拒</string>
53 <string name="permission_denied_description">您曾多次拒绝权限请求,现在您需要在系统设置中手动授予权限。</string>
54 <string name="about">关于</string>
55 <string name="about_description">开发版本、贡献者、以及更多</string>
56 <string name="warning_help">帮助</string>
57 <string name="warning_skip">跳过</string>
58 <string name="warning_cancel">取消</string>
59 <string name="install_amiibo_keys">安装 Amiibo 密钥文件</string>
60 <string name="install_amiibo_keys_description">在遊戏中使用 Amiibo 时必需</string>
61 <string name="invalid_keys_file">选择的密钥文件无效</string>
62 <string name="install_keys_success">密钥文件已成功安装</string>
63 <string name="reading_keys_failure">读取加密密钥时出错</string>
64 <string name="invalid_keys_error">无效的加密密钥</string>
65 <string name="dumping_keys_quickstart_link">https://yuzu-emu.org/help/quickstart/#dumping-decryption-keys</string>
66 <string name="install_keys_failure_description">选择的密钥文件不正确或已损坏。请重新转储密钥文件。</string>
67 <string name="install_gpu_driver">安装 GPU 驱动</string>
68 <string name="install_gpu_driver_description">安装替代的驱动程序以获得更好的性能和精度</string>
69 <string name="advanced_settings">高级选项</string>
70 <string name="settings_description">更改模拟器设置</string>
71 <string name="search_recently_played">最近游玩</string>
72 <string name="search_recently_added">最近添加</string>
73 <string name="search_retail">商业游戏</string>
74 <string name="search_homebrew">自制游戏</string>
75 <string name="open_user_folder">打开 yuzu 文件夹</string>
76 <string name="open_user_folder_description">管理 yuzu 内部文件</string>
77 <string name="theme_and_color_description">更改外观</string>
78 <string name="no_file_manager">找不到可用的文件管理器</string>
79 <string name="notification_no_directory_link">无法打开 yuzu 文件夹</string>
80 <string name="notification_no_directory_link_description">请使用文件管理器的侧部面板手动定位用户文件夹。</string>
81 <string name="manage_save_data">管理存档数据</string>
82 <string name="manage_save_data_description">已找到存档数据,请选择下方的选项。</string>
83 <string name="import_export_saves_description">导入或导出存档</string>
84 <string name="import_export_saves_no_profile">找不到存档数据,请启动游戏并重试。</string>
85 <string name="save_file_imported_success">已成功导入存档</string>
86 <string name="save_file_invalid_zip_structure">无效的存档目录</string>
87 <string name="save_file_invalid_zip_structure_description">第一个子文件夹名称必须为当前游戏的 ID。</string>
88 <string name="import_saves">导入</string>
89 <string name="export_saves">导出</string>
90
91 <!-- About screen strings -->
92 <string name="gaia_is_not_real">Gaia 不真实</string>
93 <string name="copied_to_clipboard">已复制到剪贴板</string>
94 <string name="about_app_description">一款开放源代码的 Switch 模拟器</string>
95 <string name="contributors">贡献者</string>
96 <string name="contributors_description">使用来自 yuzu 团队的 \u2764 制作</string>
97 <string name="contributors_link">https://github.com/yuzu-emu/yuzu/graphs/contributors</string>
98 <string name="build">构建版本</string>
99 <string name="support_link">https://discord.gg/u77vRWY</string>
100 <string name="website_link">https://yuzu-emu.org/</string>
101 <string name="github_link">https://github.com/yuzu-emu</string>
102
103 <!-- Early access upgrade strings -->
104 <string name="early_access">抢先体验</string>
105 <string name="get_early_access">取得抢先体验</string>
106 <string name="play_store_link">https://play.google.com/store/apps/details?id=org.yuzu.yuzu_emu.ea</string>
107 <string name="get_early_access_description">最新的功能、抢先更新、以及更多</string>
108 <string name="early_access_benefits">抢先体验的权益</string>
109 <string name="cutting_edge_features">最新功能</string>
110 <string name="early_access_updates">抢先更新</string>
111 <string name="no_manual_installation">无需手动安装</string>
112 <string name="prioritized_support">优先支持</string>
113 <string name="helping_game_preservation">帮助保留游戏</string>
114 <string name="our_eternal_gratitude">我们真诚的感激</string>
115 <string name="are_you_interested">您对此感兴趣吗?</string>
116
117 <!-- General settings strings -->
118 <string name="frame_limit_enable">启用运行速度限制</string>
119 <string name="frame_limit_enable_description">启用后,模拟速度将限制在正常运行速度的指定百分比。</string>
120 <string name="frame_limit_slider">限制速度百分比</string>
121 <string name="frame_limit_slider_description">指定限制模拟速度的百分比。预设为 100%,此时模拟速度将被限制为标准速度。更高或更低的值将增加或降低速度限制上限。</string>
122 <string name="cpu_accuracy">CPU 精度</string>
123
124 <!-- System settings strings -->
125 <string name="use_docked_mode">主机模式</string>
126 <string name="use_docked_mode_description">以主机模式进行模拟,牺牲性能并提高画面分辨率。</string>
127 <string name="emulated_region">模拟区域</string>
128 <string name="emulated_language">模拟语言</string>
129 <string name="select_rtc_date">选择日期</string>
130 <string name="select_rtc_time">选择时间</string>
131 <string name="use_custom_rtc">启用自定义系统时钟</string>
132 <string name="use_custom_rtc_description">此选项允许您设置与目前系统时间相独立的自定义系统时钟</string>
133 <string name="set_custom_rtc">设置自定义系统时钟</string>
134
135 <!-- Graphics settings strings -->
136 <string name="renderer_api">API</string>
137 <string name="renderer_accuracy">精度等级</string>
138 <string name="renderer_resolution">分辨率</string>
139 <string name="renderer_vsync">垂直同步模式</string>
140 <string name="renderer_aspect_ratio">屏幕纵横比</string>
141 <string name="renderer_scaling_filter">窗口滤镜</string>
142 <string name="renderer_anti_aliasing">抗锯齿方式</string>
143 <string name="renderer_force_max_clock">强制最大时钟 (仅限 Adreno)</string>
144 <string name="renderer_force_max_clock_description">强制 GPU 以最大时钟运行 (仍被温控限制)。</string>
145 <string name="renderer_asynchronous_shaders">使用异步着色器</string>
146 <string name="renderer_asynchronous_shaders_description">异步编译着色器,减少卡顿,但可能引入故障。</string>
147 <string name="renderer_debug">启用图形调试</string>
148 <string name="renderer_debug_description">启用时,图形 API 将进入较慢的调试模式。</string>
149 <string name="use_disk_shader_cache">使用磁盘着色器缓存</string>
150 <string name="use_disk_shader_cache_description">将生成的着色器缓存于磁盘中并进行读取以减少卡顿。</string>
151
152 <!-- Audio settings strings -->
153 <string name="audio_volume">音量</string>
154 <string name="audio_volume_description">指定输出的音量。</string>
155
156 <!-- Miscellaneous -->
157 <string name="slider_default">系统默认</string>
158 <string name="ini_saved">已保存设置</string>
159 <string name="gameid_saved">已保存 %1$s 的设置</string>
160 <string name="error_saving">保存 %1$s.ini 时出错: %2$s</string>
161 <string name="loading">加载中…</string>
162 <string name="reset_setting_confirmation">您要将此设定重设为默认值吗?</string>
163 <string name="reset_to_default">恢复默认</string>
164 <string name="reset_all_settings">重置所有设置项?</string>
165 <string name="reset_all_settings_description">所有高级选项都将被重设,此动作无法还原。</string>
166 <string name="settings_reset">重设设置项</string>
167 <string name="close">关闭</string>
168 <string name="learn_more">了解更多</string>
169
170 <!-- GPU driver installation -->
171 <string name="select_gpu_driver">选择 GPU 驱动程序</string>
172 <string name="select_gpu_driver_title">要取代您当前的 GPU 驱动程序吗?</string>
173 <string name="select_gpu_driver_install">安装</string>
174 <string name="select_gpu_driver_default">系统默认</string>
175 <string name="select_gpu_driver_install_success">已安装 %s</string>
176 <string name="select_gpu_driver_use_default">使用默认 GPU 驱动程序</string>
177 <string name="select_gpu_driver_error">选择的驱动程序无效,将使用系统默认的驱动程序!</string>
178 <string name="system_gpu_driver">系统 GPU 驱动程序</string>
179 <string name="installing_driver">正在安装驱动程序…</string>
180
181 <!-- Preferences Screen -->
182 <string name="preferences_settings">设置</string>
183 <string name="preferences_general">通用</string>
184 <string name="preferences_system">系统</string>
185 <string name="preferences_graphics">图形</string>
186 <string name="preferences_audio">声音</string>
187 <string name="preferences_theme">主题和色彩</string>
188
189 <!-- ROM loading errors -->
190 <string name="loader_error_encrypted">您的 ROM 已加密</string>
191 <string name="loader_error_encrypted_roms_description"><![CDATA[请参考指南重新转储你的<a href=\"https://yuzu-emu.org/help/quickstart/#dumping-cartridge-games\">游戏卡带</a>或<a href=\"https://yuzu-emu.org/help/quickstart/#dumping-installed-titles-eshop\">已安装的游戏</a>。]]></string>
192 <string name="loader_error_encrypted_keys_description"><![CDATA[请确保 <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-prodkeys-and-titlekeys\">prod.keys</a> 文件已安装,使得游戏可以被解密。]]></string>
193 <string name="loader_error_video_core">初始化视频核心时发生错误</string>
194 <string name="loader_error_video_core_description">这通常由不兼容的 GPU 驱动程序造成,安装自定义 GPU 驱动程序可能解决此问题。</string>
195 <string name="loader_error_invalid_format">无法载入 ROM</string>
196 <string name="loader_error_file_not_found">ROM 文件不存在</string>
197
198 <!-- Emulation Menu -->
199 <string name="emulation_exit">退出模拟</string>
200 <string name="emulation_done">完成</string>
201 <string name="emulation_fps_counter">FPS 计数器</string>
202 <string name="emulation_toggle_controls">按键切换</string>
203 <string name="emulation_rel_stick_center">相对摇杆中心</string>
204 <string name="emulation_dpad_slide">十字方向键滑动</string>
205 <string name="emulation_haptics">触觉反馈</string>
206 <string name="emulation_show_overlay">显示虚拟按键</string>
207 <string name="emulation_toggle_all">全部切换</string>
208 <string name="emulation_control_adjust">调整虚拟按键</string>
209 <string name="emulation_control_scale">缩放</string>
210 <string name="emulation_control_opacity">不透明度</string>
211 <string name="emulation_touch_overlay_reset">重设虚拟按键</string>
212 <string name="emulation_touch_overlay_edit">编辑虚拟按键</string>
213 <string name="emulation_pause">暂停模拟</string>
214 <string name="emulation_unpause">继续模拟</string>
215 <string name="emulation_input_overlay">虚拟按键选项</string>
216 <string name="emulation_game_loading">载入游戏中…</string>
217
218 <string name="load_settings">正在载入设定…</string>
219
220 <!-- Software keyboard -->
221 <string name="software_keyboard">软件键盘</string>
222
223 <!-- Errors and warnings -->
224 <string name="abort_button">中止</string>
225 <string name="continue_button">继续</string>
226 <string name="system_archive_not_found">未找到系统档案</string>
227 <string name="system_archive_not_found_message">%s 丢失,请转储您的系统档案。\n继续模拟可能造成崩溃和错误。</string>
228 <string name="system_archive_general">系统档案</string>
229 <string name="save_load_error">保存/载入发生错误</string>
230 <string name="fatal_error">致命错误</string>
231 <string name="fatal_error_message">发生致命错误,请查阅日志获取详细信息。\n继续模拟可能会造成崩溃和错误。</string>
232 <string name="performance_warning">关闭此项会显著降低模拟性能!建议您将此项保持为启用状态。</string>
233
234 <!-- Region Names -->
235 <string name="region_japan">日本</string>
236 <string name="region_usa">美国</string>
237 <string name="region_europe">欧洲</string>
238 <string name="region_australia">澳大利亚</string>
239 <string name="region_china">中国</string>
240 <string name="region_korea">韩国</string>
241 <string name="region_taiwan">中国台湾</string>
242
243 <!-- Language Names -->
244 <string name="language_japanese">日语 (日本語)</string>
245 <string name="language_english">英语 (English)</string>
246 <string name="language_french">法语 (Français)</string>
247 <string name="langauge_german">德语 (Deutsch)</string>
248 <string name="language_italian">意大利语 (Italiano)</string>
249 <string name="language_spanish">西班牙语 (Español)</string>
250 <string name="language_chinese">中文 (简体中文)</string>
251 <string name="language_korean">韩语 (한국어)</string>
252 <string name="language_dutch">荷兰语 (Nederlands)</string>
253 <string name="language_portuguese">葡萄牙语 (Português)</string>
254 <string name="language_russian">俄语 (Русский)</string>
255 <string name="language_taiwanese">台湾中文 (台灣)</string>
256 <string name="language_british_english">英式英语</string>
257 <string name="language_canadian_french">加拿大法语 (Français canadien)</string>
258 <string name="language_latin_american_spanish">拉丁美洲西班牙语 (Español latinoamericano)</string>
259 <string name="language_simplified_chinese">简体中文 (简体中文)</string>
260 <string name="language_traditional_chinese">繁体中文 (正體中文)</string>
261 <string name="language_brazilian_portuguese">巴西葡萄牙语 (Português do Brasil)</string>
262
263 <!-- Renderer APIs -->
264 <string name="renderer_vulkan">Vulkan</string>
265 <string name="renderer_none">无</string>
266
267 <!-- Renderer Accuracy -->
268 <string name="renderer_accuracy_normal">正常</string>
269 <string name="renderer_accuracy_high">高</string>
270 <string name="renderer_accuracy_extreme">极高 (慢速)</string>
271
272 <!-- Resolutions -->
273 <string name="resolution_half">0.5X (360p/540p)</string>
274 <string name="resolution_three_quarter">0.75X (540p/810p)</string>
275 <string name="resolution_one">1X (720p/1080p)</string>
276 <string name="resolution_two">2X (1440p/2160p) (慢速)</string>
277 <string name="resolution_three">3X (2160p/3240p) (慢速)</string>
278 <string name="resolution_four">4X (2880p/4320p) (慢速)</string>
279
280 <!-- Renderer VSync -->
281 <string name="renderer_vsync_immediate">即时 (关闭)</string>
282 <string name="renderer_vsync_mailbox">Mailbox</string>
283 <string name="renderer_vsync_fifo">FIFO (开启)</string>
284 <string name="renderer_vsync_fifo_relaxed">FIFO Relaxed</string>
285
286 <!-- Scaling Filters -->
287 <string name="scaling_filter_nearest_neighbor">近邻取样</string>
288 <string name="scaling_filter_bilinear">双线性过滤</string>
289 <string name="scaling_filter_bicubic">双三线过滤</string>
290 <string name="scaling_filter_gaussian">高斯模糊</string>
291 <string name="scaling_filter_scale_force">强制缩放</string>
292 <string name="scaling_filter_fsr">AMD FidelityFX™️ 超级分辨率锐画技术</string>
293
294 <!-- Anti-Aliasing -->
295 <string name="anti_aliasing_none">无</string>
296 <string name="anti_aliasing_fxaa">快速近似抗锯齿</string>
297 <string name="anti_aliasing_smaa">子像素形态学抗锯齿</string>
298
299 <!-- Aspect Ratios -->
300 <string name="ratio_default">默认 (16:9)</string>
301 <string name="ratio_force_four_three">强制 4:3</string>
302 <string name="ratio_force_twenty_one_nine">强制 21:9</string>
303 <string name="ratio_force_sixteen_ten">强制 16:10</string>
304 <string name="ratio_stretch">拉伸窗口</string>
305
306 <!-- CPU Accuracy -->
307 <string name="cpu_accuracy_accurate">高精度</string>
308 <string name="cpu_accuracy_unsafe">低精度</string>
309 <string name="cpu_accuracy_paranoid">偏执模式 (慢速)</string>
310
311 <!-- Gamepad Buttons -->
312 <string name="gamepad_d_pad">十字方向键</string>
313 <string name="gamepad_left_stick">左摇杆</string>
314 <string name="gamepad_right_stick">右摇杆</string>
315 <string name="gamepad_home">Home</string>
316 <string name="gamepad_screenshot">截图</string>
317
318 <!-- Disk shader cache -->
319 <string name="preparing_shaders">正在准备着色器</string>
320 <string name="building_shaders">正在编译着色器</string>
321
322 <!-- Theme options -->
323 <string name="change_app_theme">切换主题</string>
324 <string name="theme_default">系统默认</string>
325 <string name="theme_material_you">Material You</string>
326
327 <!-- Theme Modes -->
328 <string name="change_theme_mode">主题模式</string>
329 <string name="theme_mode_follow_system">跟随系统</string>
330 <string name="theme_mode_light">浅色</string>
331 <string name="theme_mode_dark">深色</string>
332
333 <!-- Black backgrounds theme -->
334 <string name="use_black_backgrounds">使用黑色背景</string>
335 <string name="use_black_backgrounds_description">使用深色主题时,套用黑色背景。</string>
336
337</resources>
diff --git a/src/android/app/src/main/res/values-zh-rTW/strings.xml b/src/android/app/src/main/res/values-zh-rTW/strings.xml
new file mode 100644
index 000000000..a54d04248
--- /dev/null
+++ b/src/android/app/src/main/res/values-zh-rTW/strings.xml
@@ -0,0 +1,336 @@
1<?xml version="1.0" encoding="utf-8"?>
2<resources>
3
4 <string name="app_disclaimer">此軟體可以執行 Nintendo Switch 主機遊戲,但不包含任何遊戲和金鑰。&lt;br /&gt;&lt;br /&gt;在您開始前,請找到放置於您的裝置儲存空間的 <![CDATA[<b> prod.keys </b>]]> 檔案。&lt;br /&gt;&lt;br /&gt;<![CDATA[<a href=\"https://yuzu-emu.org/help/quickstart\">深入瞭解</a>]]></string>
5 <string name="emulation_notification_channel_name">模擬進行中</string>
6 <string name="emulation_notification_channel_description">在模擬執行時顯示持續通知。</string>
7 <string name="emulation_notification_running">yuzu 正在執行</string>
8 <string name="notice_notification_channel_name">通知和錯誤</string>
9 <string name="notice_notification_channel_description">發生錯誤時顯示通知。</string>
10 <string name="notification_permission_not_granted">未授予通知權限!</string>
11
12 <!-- Setup strings -->
13 <string name="welcome">歡迎!</string>
14 <string name="welcome_description">瞭解如何設定 &lt;b>yuzu&lt;/b> 並進入模擬。</string>
15 <string name="get_started">開始使用</string>
16 <string name="keys">金鑰</string>
17 <string name="keys_description">使用下方的按鈕選取您的 &lt;b>prod.keys&lt;/b> 檔案。</string>
18 <string name="select_keys">選取金鑰</string>
19 <string name="games">遊戲</string>
20 <string name="games_description">使用下方的按鈕選取您的&lt;b>遊戲&lt;/b>資料夾。</string>
21 <string name="done">完成</string>
22 <string name="done_description">您已準備就緒。\n盡情遊玩您的遊戲!</string>
23 <string name="text_continue">繼續</string>
24 <string name="next">下一步</string>
25 <string name="back">上一步</string>
26 <string name="add_games">新增遊戲</string>
27 <string name="add_games_description">選取您的遊戲資料夾</string>
28
29 <!-- Home strings -->
30 <string name="home_games">遊戲</string>
31 <string name="home_search">搜尋</string>
32 <string name="home_settings">設定</string>
33 <string name="empty_gamelist">找不到檔案,或者尚未選取遊戲目錄。</string>
34 <string name="search_and_filter_games">搜尋並篩選遊戲</string>
35 <string name="select_games_folder">選取遊戲資料夾</string>
36 <string name="select_games_folder_description">一律允許 yuzu 填入遊戲清單</string>
37 <string name="add_games_warning">跳過選取遊戲資料夾?</string>
38 <string name="add_games_warning_description">如果資料夾未選取,遊戲將不會顯示在遊戲清單。</string>
39 <string name="add_games_warning_help">https://yuzu-emu.org/help/quickstart/#dumping-games</string>
40 <string name="home_search_games">搜尋遊戲</string>
41 <string name="games_dir_selected">遊戲目錄已選取</string>
42 <string name="install_prod_keys">安裝 prod.keys</string>
43 <string name="install_prod_keys_description">需要解密零售遊戲</string>
44 <string name="install_prod_keys_warning">跳過新增金鑰?</string>
45 <string name="install_prod_keys_warning_description">模擬零售遊戲需要有效的金鑰,若要繼續,將僅有自製遊戲應用程式可以運作。</string>
46 <string name="install_prod_keys_warning_help">https://yuzu-emu.org/help/quickstart/#guide-introduction</string>
47 <string name="notifications">通知</string>
48 <string name="notifications_description">使用下方的按鈕授予通知權限。</string>
49 <string name="give_permission">授予權限</string>
50 <string name="notification_warning">跳過授予通知權限?</string>
51 <string name="notification_warning_description">yuzu 將無法通知您重要資訊。</string>
52 <string name="permission_denied">權限遭拒</string>
53 <string name="permission_denied_description">您曾多次拒絕了權限要求,現在您需要在系統設定中手動授予權限。</string>
54 <string name="about">關於</string>
55 <string name="about_description">組建版本、製作群、以及更多</string>
56 <string name="warning_help">說明</string>
57 <string name="warning_skip">跳過</string>
58 <string name="warning_cancel">取消</string>
59 <string name="install_amiibo_keys">安裝 Amiibo 金鑰</string>
60 <string name="install_amiibo_keys_description">需要在遊戲中使用 Amiibo</string>
61 <string name="invalid_keys_file">無效的金鑰檔案已選取</string>
62 <string name="install_keys_success">金鑰已成功安裝</string>
63 <string name="reading_keys_failure">讀取加密金鑰時出現錯誤</string>
64 <string name="invalid_keys_error">無效的加密金鑰</string>
65 <string name="dumping_keys_quickstart_link">https://yuzu-emu.org/help/quickstart/#dumping-decryption-keys</string>
66 <string name="install_keys_failure_description">選取的檔案不正確或已損毀,請重新傾印您的金鑰。</string>
67 <string name="install_gpu_driver">安裝 GPU 驅動程式</string>
68 <string name="install_gpu_driver_description">安裝替代驅動程式以取得潛在的更佳效能或準確度</string>
69 <string name="advanced_settings">進階設定</string>
70 <string name="settings_description">進行模擬器設定</string>
71 <string name="search_recently_played">最近遊玩</string>
72 <string name="search_recently_added">最近新增</string>
73 <string name="search_retail">零售</string>
74 <string name="search_homebrew">自製遊戲</string>
75 <string name="open_user_folder">開啟 yuzu 資料夾</string>
76 <string name="open_user_folder_description">管理 yuzu 的內部檔案</string>
77 <string name="theme_and_color_description">修改應用程式外觀</string>
78 <string name="no_file_manager">找不到檔案管理員</string>
79 <string name="notification_no_directory_link">無法開啟 yuzu 目錄</string>
80 <string name="notification_no_directory_link_description">請使用檔案管理員的側邊面板手動定位到使用者資料夾。</string>
81 <string name="manage_save_data">管理儲存資料</string>
82 <string name="manage_save_data_description">已找到儲存資料,請選取下方的選項。</string>
83 <string name="import_export_saves_description">匯入或匯出儲存檔案</string>
84 <string name="import_export_saves_no_profile">找不到儲存資料,請啟動遊戲並重試。</string>
85 <string name="save_file_imported_success">已成功匯入</string>
86 <string name="save_file_invalid_zip_structure">無效的儲存目錄結構</string>
87 <string name="save_file_invalid_zip_structure_description">首個子資料夾名稱必須為遊戲標題 ID。</string>
88 <string name="import_saves">匯入</string>
89 <string name="export_saves">匯出</string>
90
91 <!-- About screen strings -->
92 <string name="gaia_is_not_real">Gaia 不真實</string>
93 <string name="copied_to_clipboard">已複製到剪貼簿</string>
94 <string name="about_app_description">一個開放原始碼的 Switch 模擬器</string>
95 <string name="contributors">參與者</string>
96 <string name="contributors_description">使用來自 yuzu 團隊的 \u2764 製作</string>
97 <string name="contributors_link">https://github.com/yuzu-emu/yuzu/graphs/contributors</string>
98 <string name="build">組建</string>
99 <string name="support_link">https://discord.gg/u77vRWY</string>
100 <string name="website_link">https://yuzu-emu.org/</string>
101 <string name="github_link">https://github.com/yuzu-emu</string>
102
103 <!-- Early access upgrade strings -->
104 <string name="early_access">搶先體驗</string>
105 <string name="get_early_access">搶先體驗新功能</string>
106 <string name="play_store_link">https://play.google.com/store/apps/details?id=org.yuzu.yuzu_emu.ea</string>
107 <string name="get_early_access_description">最新的功能、搶先版更新、以及更多</string>
108 <string name="early_access_benefits">搶先體驗權益</string>
109 <string name="cutting_edge_features">最新功能</string>
110 <string name="early_access_updates">搶先版更新</string>
111 <string name="no_manual_installation">無需手動安裝</string>
112 <string name="prioritized_support">優先支援</string>
113 <string name="helping_game_preservation">協助遊戲保留</string>
114 <string name="our_eternal_gratitude">我們永遠的感激</string>
115 <string name="are_you_interested">您仍感興趣嗎?</string>
116
117 <!-- General settings strings -->
118 <string name="frame_limit_enable">啟用限制速度</string>
119 <string name="frame_limit_enable_description">若啟用,模擬速度將會限制在標準速度的指定百分比。</string>
120 <string name="frame_limit_slider">限制速度百分比</string>
121 <string name="frame_limit_slider_description">指定限制模擬速度的百分比。預設為 100%,模擬速度將被限制為標準速度。更高或更低的值將會增加或減少速度限制。</string>
122 <string name="cpu_accuracy">CPU 準確度</string>
123
124 <!-- System settings strings -->
125 <string name="use_docked_mode">底座模式</string>
126 <string name="use_docked_mode_description">以底座模式模擬,以犧牲效能的代價提高解析度。</string>
127 <string name="emulated_region">模擬區域</string>
128 <string name="emulated_language">模擬語言</string>
129 <string name="select_rtc_date">選取 RTC 日期</string>
130 <string name="select_rtc_time">選取 RTC 時間</string>
131 <string name="use_custom_rtc">啟用自訂 RTC</string>
132 <string name="use_custom_rtc_description">此設定允許您設定與您的目前系統時間相互獨立的自訂即時時鐘</string>
133 <string name="set_custom_rtc">設定自訂 RTC</string>
134
135 <!-- Graphics settings strings -->
136 <string name="renderer_api">API</string>
137 <string name="renderer_accuracy">準確度層級</string>
138 <string name="renderer_resolution">解析度</string>
139 <string name="renderer_vsync">VSync 模式</string>
140 <string name="renderer_aspect_ratio">長寬比</string>
141 <string name="renderer_scaling_filter">視窗適應過濾器</string>
142 <string name="renderer_anti_aliasing">消除鋸齒方法</string>
143 <string name="renderer_force_max_clock">強制最大時脈 (僅 Adreno)</string>
144 <string name="renderer_force_max_clock_description">強制 GPU 以最大可能時脈執行 (熱溫限制仍被套用)。</string>
145 <string name="renderer_asynchronous_shaders">使用非同步著色器</string>
146 <string name="renderer_asynchronous_shaders_description">非同步編譯著色器,將會減少間斷,但可能會引入故障。</string>
147 <string name="renderer_debug">啟用圖形偵錯</string>
148 <string name="renderer_debug_description">核取時,圖形 API 將會進入慢速偵錯模式。</string>
149 <string name="use_disk_shader_cache">使用磁碟著色器快取</string>
150 <string name="use_disk_shader_cache_description">透過將產生的著色器儲存並載入至磁碟,減少中斷。</string>
151
152 <!-- Audio settings strings -->
153 <string name="audio_volume">音量</string>
154 <string name="audio_volume_description">指定音訊輸出音量。</string>
155
156 <!-- Miscellaneous -->
157 <string name="slider_default">預設</string>
158 <string name="ini_saved">已儲存設定</string>
159 <string name="gameid_saved">已儲存 %1$s 設定</string>
160 <string name="error_saving">儲存 %1$s 時發生錯誤 ini: %2$s</string>
161 <string name="loading">正在載入…</string>
162 <string name="reset_setting_confirmation">要將此設定重設回預設值嗎?</string>
163 <string name="reset_to_default">重設為預設值</string>
164 <string name="reset_all_settings">重設所有設定?</string>
165 <string name="reset_all_settings_description">所有進階設定將被重設為預設組態,此動作無法復原。</string>
166 <string name="settings_reset">設定已重設</string>
167 <string name="close">關閉</string>
168 <string name="learn_more">深入瞭解</string>
169
170 <!-- GPU driver installation -->
171 <string name="select_gpu_driver">選取 GPU 驅動程式</string>
172 <string name="select_gpu_driver_title">要取代您目前的 GPU 驅動程式嗎?</string>
173 <string name="select_gpu_driver_install">安裝</string>
174 <string name="select_gpu_driver_default">預設</string>
175 <string name="select_gpu_driver_install_success">已安裝 %s</string>
176 <string name="select_gpu_driver_use_default">使用預設 GPU 驅動程式</string>
177 <string name="select_gpu_driver_error">選取的驅動程式無效,將使用系統預設驅動程式!</string>
178 <string name="system_gpu_driver">系統 GPU 驅動程式</string>
179 <string name="installing_driver">正在安裝驅動程式…</string>
180
181 <!-- Preferences Screen -->
182 <string name="preferences_settings">設定</string>
183 <string name="preferences_general">一般</string>
184 <string name="preferences_system">系統</string>
185 <string name="preferences_graphics">圖形</string>
186 <string name="preferences_audio">音訊</string>
187 <string name="preferences_theme">主題和色彩</string>
188
189 <!-- ROM loading errors -->
190 <string name="loader_error_encrypted">您的 ROM 已加密</string>
191 <string name="loader_error_encrypted_roms_description"><![CDATA[請依循指南重新傾印您的<a href=\"https://yuzu-emu.org/help/quickstart/#dumping-cartridge-games\">遊戲卡匣</a>或<a href=\"https://yuzu-emu.org/help/quickstart/#dumping-installed-titles-eshop\">安裝標題</a>。]]></string>
192 <string name="loader_error_encrypted_keys_description"><![CDATA[請確保您的 <a href=\"https://yuzu-emu.org/help/quickstart/#dumping-prodkeys-and-titlekeys\">prod.keys</a> 檔案已安裝,讓遊戲可以解密。]]></string>
193 <string name="loader_error_video_core">初始化視訊核心時發生錯誤</string>
194 <string name="loader_error_video_core_description">這經常由不相容的 GPU 驅動程式造成,安裝自訂 GPU 驅動程式可能會解決此問題。</string>
195 <string name="loader_error_invalid_format">無法載入 ROM</string>
196 <string name="loader_error_file_not_found">ROM 檔案不存在</string>
197
198 <!-- Emulation Menu -->
199 <string name="emulation_exit">結束模擬</string>
200 <string name="emulation_done">完成</string>
201 <string name="emulation_fps_counter">FPS 計數器</string>
202 <string name="emulation_toggle_controls">切換控制</string>
203 <string name="emulation_rel_stick_center">相對搖桿中心</string>
204 <string name="emulation_dpad_slide">方向鍵滑動</string>
205 <string name="emulation_haptics">觸覺回饋技術</string>
206 <string name="emulation_show_overlay">顯示覆疊</string>
207 <string name="emulation_toggle_all">全部切換</string>
208 <string name="emulation_control_adjust">調整覆疊</string>
209 <string name="emulation_control_scale">縮放</string>
210 <string name="emulation_control_opacity">不透明度</string>
211 <string name="emulation_touch_overlay_reset">重設覆疊</string>
212 <string name="emulation_touch_overlay_edit">編輯覆疊</string>
213 <string name="emulation_pause">暫停模擬</string>
214 <string name="emulation_unpause">取消暫停模擬</string>
215 <string name="emulation_input_overlay">覆疊選項</string>
216 <string name="emulation_game_loading">遊戲正在載入…</string>
217
218 <string name="load_settings">正在載入設定…</string>
219
220 <!-- Software keyboard -->
221 <string name="software_keyboard">軟體鍵盤</string>
222
223 <!-- Errors and warnings -->
224 <string name="abort_button">中止</string>
225 <string name="continue_button">繼續</string>
226 <string name="system_archive_not_found">找不到系統檔案</string>
227 <string name="system_archive_not_found_message">%s 遺失,請傾印您的系統封存。\n繼續模擬可能會造成當機和錯誤。</string>
228 <string name="system_archive_general">系統封存</string>
229 <string name="save_load_error">儲存/載入發生錯誤</string>
230 <string name="fatal_error">嚴重錯誤</string>
231 <string name="fatal_error_message">發生嚴重錯誤,檢查記錄以取得詳細資訊。\n繼續模擬可能會造成當機和錯誤。</string>
232 <string name="performance_warning">關閉此設定會顯著降低模擬效能!如需最佳體驗,建議您將此設定保持為啟用狀態。</string>
233
234 <!-- Region Names -->
235 <string name="region_japan">日本</string>
236 <string name="region_usa">美國</string>
237 <string name="region_europe">歐洲</string>
238 <string name="region_australia">澳洲</string>
239 <string name="region_china">中國</string>
240 <string name="region_korea">南韓</string>
241 <string name="region_taiwan">台灣</string>
242
243 <!-- Language Names -->
244 <string name="language_japanese">日文 (日本語)</string>
245 <string name="language_english">英文</string>
246 <string name="language_french">法文 (Français)</string>
247 <string name="langauge_german">德文 (Deutsch)</string>
248 <string name="language_italian">義大利文 (Italiano)</string>
249 <string name="language_spanish">西班牙文 (Español)</string>
250 <string name="language_chinese">中文 (简体中文)</string>
251 <string name="language_korean">韓文 (한국어)</string>
252 <string name="language_dutch">荷蘭文 (Nederlands)</string>
253 <string name="language_portuguese">葡萄牙文 (Português)</string>
254 <string name="language_russian">俄文 (Русский)</string>
255 <string name="language_taiwanese">台文 (台灣)</string>
256 <string name="language_british_english">英式英文</string>
257 <string name="language_canadian_french">加拿大法文 (Français canadien)</string>
258 <string name="language_latin_american_spanish">拉丁美洲西班牙文 (Español latinoamericano)</string>
259 <string name="language_simplified_chinese">簡體中文 (简体中文)</string>
260 <string name="language_traditional_chinese">正體中文 (正體中文)</string>
261 <string name="language_brazilian_portuguese">巴西葡萄牙文 (Português do Brasil)</string>
262
263 <!-- Renderer APIs -->
264 <string name="renderer_vulkan">Vulkan</string>
265 <string name="renderer_none">無</string>
266
267 <!-- Renderer Accuracy -->
268 <string name="renderer_accuracy_normal">標準</string>
269 <string name="renderer_accuracy_high">高</string>
270 <string name="renderer_accuracy_extreme">極高 (慢)</string>
271
272 <!-- Resolutions -->
273 <string name="resolution_half">0.5X (360p/540p)</string>
274 <string name="resolution_three_quarter">0.75X (540p/810p)</string>
275 <string name="resolution_one">1X (720p/1080p)</string>
276 <string name="resolution_two">2X (1440p/2160p) (慢)</string>
277 <string name="resolution_three">3X (2160p/3240p) (慢)</string>
278 <string name="resolution_four">4X (2880p/4320p) (慢)</string>
279
280 <!-- Renderer VSync -->
281 <string name="renderer_vsync_immediate">即時 (關閉)</string>
282 <string name="renderer_vsync_mailbox">信箱</string>
283 <string name="renderer_vsync_fifo">FIFO (開啟)</string>
284 <string name="renderer_vsync_fifo_relaxed">FIFO 寬鬆</string>
285
286 <!-- Scaling Filters -->
287 <string name="scaling_filter_nearest_neighbor">最近鄰</string>
288 <string name="scaling_filter_bilinear">雙線性</string>
289 <string name="scaling_filter_bicubic">雙立方</string>
290 <string name="scaling_filter_gaussian">高斯</string>
291 <string name="scaling_filter_scale_force">強制縮放</string>
292 <string name="scaling_filter_fsr">AMD Radeon™ 超級解析度</string>
293
294 <!-- Anti-Aliasing -->
295 <string name="anti_aliasing_none">無</string>
296 <string name="anti_aliasing_fxaa">FXAA</string>
297 <string name="anti_aliasing_smaa">SMAA</string>
298
299 <!-- Aspect Ratios -->
300 <string name="ratio_default">預設 (16:9)</string>
301 <string name="ratio_force_four_three">強制 4:3</string>
302 <string name="ratio_force_twenty_one_nine">強制 21:9</string>
303 <string name="ratio_force_sixteen_ten">強制 16:10</string>
304 <string name="ratio_stretch">延伸視窗</string>
305
306 <!-- CPU Accuracy -->
307 <string name="cpu_accuracy_unsafe">低精度</string>
308 <string name="cpu_accuracy_paranoid">不合理 (慢)</string>
309
310 <!-- Gamepad Buttons -->
311 <string name="gamepad_d_pad">方向鍵</string>
312 <string name="gamepad_left_stick">左搖桿</string>
313 <string name="gamepad_right_stick">右搖桿</string>
314 <string name="gamepad_home">HOME</string>
315 <string name="gamepad_screenshot">螢幕截圖</string>
316
317 <!-- Disk shader cache -->
318 <string name="preparing_shaders">正在準備著色器</string>
319 <string name="building_shaders">正在建置著色器</string>
320
321 <!-- Theme options -->
322 <string name="change_app_theme">變更應用程式主題</string>
323 <string name="theme_default">預設</string>
324 <string name="theme_material_you">Material You</string>
325
326 <!-- Theme Modes -->
327 <string name="change_theme_mode">變更主題模式</string>
328 <string name="theme_mode_follow_system">跟隨系統</string>
329 <string name="theme_mode_light">淺色</string>
330 <string name="theme_mode_dark">深色</string>
331
332 <!-- Black backgrounds theme -->
333 <string name="use_black_backgrounds">使用黑色背景</string>
334 <string name="use_black_backgrounds_description">使用深色主題時,套用黑色背景。</string>
335
336</resources>
diff --git a/src/android/app/src/main/res/values/arrays.xml b/src/android/app/src/main/res/values/arrays.xml
index ea20cb17c..6d092f7a9 100644
--- a/src/android/app/src/main/res/values/arrays.xml
+++ b/src/android/app/src/main/res/values/arrays.xml
@@ -119,6 +119,18 @@
119 <item>3</item> 119 <item>3</item>
120 </integer-array> 120 </integer-array>
121 121
122 <string-array name="rendererScreenLayoutNames">
123 <item>@string/screen_layout_landscape</item>
124 <item>@string/screen_layout_portrait</item>
125 <item>@string/screen_layout_auto</item>
126 </string-array>
127
128 <integer-array name="rendererScreenLayoutValues">
129 <item>5</item>
130 <item>4</item>
131 <item>0</item>
132 </integer-array>
133
122 <string-array name="rendererAspectRatioNames"> 134 <string-array name="rendererAspectRatioNames">
123 <item>@string/ratio_default</item> 135 <item>@string/ratio_default</item>
124 <item>@string/ratio_force_four_three</item> 136 <item>@string/ratio_force_four_three</item>
@@ -224,4 +236,15 @@
224 <item>2</item> 236 <item>2</item>
225 </integer-array> 237 </integer-array>
226 238
239 <string-array name="outputEngineEntries">
240 <item>@string/auto</item>
241 <item>@string/cubeb</item>
242 <item>@string/string_null</item>
243 </string-array>
244 <string-array name="outputEngineValues">
245 <item>auto</item>
246 <item>cubeb</item>
247 <item>null</item>
248 </string-array>
249
227</resources> 250</resources>
diff --git a/src/android/app/src/main/res/values/integers.xml b/src/android/app/src/main/res/values/integers.xml
index bc614b81d..2e93b408c 100644
--- a/src/android/app/src/main/res/values/integers.xml
+++ b/src/android/app/src/main/res/values/integers.xml
@@ -34,4 +34,68 @@
34 <integer name="SWITCH_BUTTON_DPAD_X">260</integer> 34 <integer name="SWITCH_BUTTON_DPAD_X">260</integer>
35 <integer name="SWITCH_BUTTON_DPAD_Y">790</integer> 35 <integer name="SWITCH_BUTTON_DPAD_Y">790</integer>
36 36
37 <!-- Default SWITCH portrait layout -->
38 <integer name="SWITCH_BUTTON_A_X_PORTRAIT">840</integer>
39 <integer name="SWITCH_BUTTON_A_Y_PORTRAIT">840</integer>
40 <integer name="SWITCH_BUTTON_B_X_PORTRAIT">740</integer>
41 <integer name="SWITCH_BUTTON_B_Y_PORTRAIT">880</integer>
42 <integer name="SWITCH_BUTTON_X_X_PORTRAIT">740</integer>
43 <integer name="SWITCH_BUTTON_X_Y_PORTRAIT">800</integer>
44 <integer name="SWITCH_BUTTON_Y_X_PORTRAIT">640</integer>
45 <integer name="SWITCH_BUTTON_Y_Y_PORTRAIT">840</integer>
46 <integer name="SWITCH_STICK_L_X_PORTRAIT">180</integer>
47 <integer name="SWITCH_STICK_L_Y_PORTRAIT">660</integer>
48 <integer name="SWITCH_STICK_R_X_PORTRAIT">820</integer>
49 <integer name="SWITCH_STICK_R_Y_PORTRAIT">660</integer>
50 <integer name="SWITCH_TRIGGER_L_X_PORTRAIT">140</integer>
51 <integer name="SWITCH_TRIGGER_L_Y_PORTRAIT">260</integer>
52 <integer name="SWITCH_TRIGGER_R_X_PORTRAIT">860</integer>
53 <integer name="SWITCH_TRIGGER_R_Y_PORTRAIT">260</integer>
54 <integer name="SWITCH_TRIGGER_ZL_X_PORTRAIT">140</integer>
55 <integer name="SWITCH_TRIGGER_ZL_Y_PORTRAIT">200</integer>
56 <integer name="SWITCH_TRIGGER_ZR_X_PORTRAIT">860</integer>
57 <integer name="SWITCH_TRIGGER_ZR_Y_PORTRAIT">200</integer>
58 <integer name="SWITCH_BUTTON_MINUS_X_PORTRAIT">440</integer>
59 <integer name="SWITCH_BUTTON_MINUS_Y_PORTRAIT">950</integer>
60 <integer name="SWITCH_BUTTON_PLUS_X_PORTRAIT">560</integer>
61 <integer name="SWITCH_BUTTON_PLUS_Y_PORTRAIT">950</integer>
62 <integer name="SWITCH_BUTTON_HOME_X_PORTRAIT">680</integer>
63 <integer name="SWITCH_BUTTON_HOME_Y_PORTRAIT">950</integer>
64 <integer name="SWITCH_BUTTON_CAPTURE_X_PORTRAIT">320</integer>
65 <integer name="SWITCH_BUTTON_CAPTURE_Y_PORTRAIT">950</integer>
66 <integer name="SWITCH_BUTTON_DPAD_X_PORTRAIT">240</integer>
67 <integer name="SWITCH_BUTTON_DPAD_Y_PORTRAIT">840</integer>
68
69 <!-- Default SWITCH foldable layout -->
70 <integer name="SWITCH_BUTTON_A_X_FOLDABLE">840</integer>
71 <integer name="SWITCH_BUTTON_A_Y_FOLDABLE">390</integer>
72 <integer name="SWITCH_BUTTON_B_X_FOLDABLE">740</integer>
73 <integer name="SWITCH_BUTTON_B_Y_FOLDABLE">430</integer>
74 <integer name="SWITCH_BUTTON_X_X_FOLDABLE">740</integer>
75 <integer name="SWITCH_BUTTON_X_Y_FOLDABLE">350</integer>
76 <integer name="SWITCH_BUTTON_Y_X_FOLDABLE">640</integer>
77 <integer name="SWITCH_BUTTON_Y_Y_FOLDABLE">390</integer>
78 <integer name="SWITCH_STICK_L_X_FOLDABLE">180</integer>
79 <integer name="SWITCH_STICK_L_Y_FOLDABLE">250</integer>
80 <integer name="SWITCH_STICK_R_X_FOLDABLE">820</integer>
81 <integer name="SWITCH_STICK_R_Y_FOLDABLE">250</integer>
82 <integer name="SWITCH_TRIGGER_L_X_FOLDABLE">140</integer>
83 <integer name="SWITCH_TRIGGER_L_Y_FOLDABLE">130</integer>
84 <integer name="SWITCH_TRIGGER_R_X_FOLDABLE">860</integer>
85 <integer name="SWITCH_TRIGGER_R_Y_FOLDABLE">130</integer>
86 <integer name="SWITCH_TRIGGER_ZL_X_FOLDABLE">140</integer>
87 <integer name="SWITCH_TRIGGER_ZL_Y_FOLDABLE">70</integer>
88 <integer name="SWITCH_TRIGGER_ZR_X_FOLDABLE">860</integer>
89 <integer name="SWITCH_TRIGGER_ZR_Y_FOLDABLE">70</integer>
90 <integer name="SWITCH_BUTTON_MINUS_X_FOLDABLE">440</integer>
91 <integer name="SWITCH_BUTTON_MINUS_Y_FOLDABLE">470</integer>
92 <integer name="SWITCH_BUTTON_PLUS_X_FOLDABLE">560</integer>
93 <integer name="SWITCH_BUTTON_PLUS_Y_FOLDABLE">470</integer>
94 <integer name="SWITCH_BUTTON_HOME_X_FOLDABLE">680</integer>
95 <integer name="SWITCH_BUTTON_HOME_Y_FOLDABLE">470</integer>
96 <integer name="SWITCH_BUTTON_CAPTURE_X_FOLDABLE">320</integer>
97 <integer name="SWITCH_BUTTON_CAPTURE_Y_FOLDABLE">470</integer>
98 <integer name="SWITCH_BUTTON_DPAD_X_FOLDABLE">240</integer>
99 <integer name="SWITCH_BUTTON_DPAD_Y_FOLDABLE">390</integer>
100
37</resources> 101</resources>
diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml
index 0ae69afb4..cc1d8c39d 100644
--- a/src/android/app/src/main/res/values/strings.xml
+++ b/src/android/app/src/main/res/values/strings.xml
@@ -1,5 +1,5 @@
1<?xml version="1.0" encoding="utf-8"?> 1<?xml version="1.0" encoding="utf-8"?>
2<resources> 2<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
3 3
4 <!-- General application strings --> 4 <!-- General application strings -->
5 <string name="app_name" translatable="false">yuzu</string> 5 <string name="app_name" translatable="false">yuzu</string>
@@ -65,11 +65,8 @@
65 <string name="invalid_keys_file">Invalid keys file selected</string> 65 <string name="invalid_keys_file">Invalid keys file selected</string>
66 <string name="install_keys_success">Keys successfully installed</string> 66 <string name="install_keys_success">Keys successfully installed</string>
67 <string name="reading_keys_failure">Error reading encryption keys</string> 67 <string name="reading_keys_failure">Error reading encryption keys</string>
68 <string name="install_keys_failure_extension_description"> 68 <string name="install_prod_keys_failure_extension_description">Verify your keys file has a .keys extension and try again.</string>
69 1. Verify your keys have the .keys extension.\n\n 69 <string name="install_amiibo_keys_failure_extension_description">Verify your keys file has a .bin extension and try again.</string>
70 2. Keys must not be stored in the Downloads folder.\n\n
71 Resolve the issue(s) and try again.
72 </string>
73 <string name="invalid_keys_error">Invalid encryption keys</string> 70 <string name="invalid_keys_error">Invalid encryption keys</string>
74 <string name="dumping_keys_quickstart_link">https://yuzu-emu.org/help/quickstart/#dumping-decryption-keys</string> 71 <string name="dumping_keys_quickstart_link">https://yuzu-emu.org/help/quickstart/#dumping-decryption-keys</string>
75 <string name="install_keys_failure_description">The selected file is incorrect or corrupt. Please redump your keys.</string> 72 <string name="install_keys_failure_description">The selected file is incorrect or corrupt. Please redump your keys.</string>
@@ -105,6 +102,15 @@
105 <string name="share_log">Share debug logs</string> 102 <string name="share_log">Share debug logs</string>
106 <string name="share_log_description">Share yuzu\'s log file to debug issues</string> 103 <string name="share_log_description">Share yuzu\'s log file to debug issues</string>
107 <string name="share_log_missing">No log file found</string> 104 <string name="share_log_missing">No log file found</string>
105 <string name="install_game_content">Install game content</string>
106 <string name="install_game_content_description">Install game updates or DLC</string>
107 <string name="install_game_content_failure">Error installing file to NAND</string>
108 <string name="install_game_content_failure_description">Game content installation failed. Please ensure content is valid and that the prod.keys file is installed.</string>
109 <string name="install_game_content_failure_base">Installation of base games isn\'t permitted in order to avoid possible conflicts. Please select an update or DLC instead.</string>
110 <string name="install_game_content_failure_file_extension">The selected file type is not supported. Only NSP and XCI content is supported for this action. Please verify the game content is valid.</string>
111 <string name="install_game_content_success">Game content installed successfully</string>
112 <string name="install_game_content_success_overwrite">Game content was overwritten successfully</string>
113 <string name="install_game_content_help_link">https://yuzu-emu.org/help/quickstart/#dumping-installed-updates</string>
108 114
109 <!-- About screen strings --> 115 <!-- About screen strings -->
110 <string name="gaia_is_not_real">Gaia isn\'t real</string> 116 <string name="gaia_is_not_real">Gaia isn\'t real</string>
@@ -152,10 +158,10 @@
152 <string name="set_custom_rtc">Set custom RTC</string> 158 <string name="set_custom_rtc">Set custom RTC</string>
153 159
154 <!-- Graphics settings strings --> 160 <!-- Graphics settings strings -->
155 <string name="renderer_api">API</string>
156 <string name="renderer_accuracy">Accuracy level</string> 161 <string name="renderer_accuracy">Accuracy level</string>
157 <string name="renderer_resolution">Resolution (Handheld/Docked)</string> 162 <string name="renderer_resolution">Resolution (Handheld/Docked)</string>
158 <string name="renderer_vsync">VSync mode</string> 163 <string name="renderer_vsync">VSync mode</string>
164 <string name="renderer_screen_layout">Orientation</string>
159 <string name="renderer_aspect_ratio">Aspect ratio</string> 165 <string name="renderer_aspect_ratio">Aspect ratio</string>
160 <string name="renderer_scaling_filter">Window adapting filter</string> 166 <string name="renderer_scaling_filter">Window adapting filter</string>
161 <string name="renderer_anti_aliasing">Anti-aliasing method</string> 167 <string name="renderer_anti_aliasing">Anti-aliasing method</string>
@@ -163,12 +169,23 @@
163 <string name="renderer_force_max_clock_description">Forces the GPU to run at the maximum possible clocks (thermal constraints will still be applied).</string> 169 <string name="renderer_force_max_clock_description">Forces the GPU to run at the maximum possible clocks (thermal constraints will still be applied).</string>
164 <string name="renderer_asynchronous_shaders">Use asynchronous shaders</string> 170 <string name="renderer_asynchronous_shaders">Use asynchronous shaders</string>
165 <string name="renderer_asynchronous_shaders_description">Compiles shaders asynchronously, reducing stutter but may introduce glitches.</string> 171 <string name="renderer_asynchronous_shaders_description">Compiles shaders asynchronously, reducing stutter but may introduce glitches.</string>
166 <string name="renderer_debug">Graphics debugging</string> 172 <string name="renderer_reactive_flushing">Use reactive flushing</string>
167 <string name="renderer_debug_description">Sets the graphics API to a slow debugging mode.</string> 173 <string name="renderer_reactive_flushing_description">Improves rendering accuracy in some games at the cost of performance.</string>
168 <string name="use_disk_shader_cache">Disk shader cache</string> 174 <string name="use_disk_shader_cache">Disk shader cache</string>
169 <string name="use_disk_shader_cache_description">Reduces stuttering by locally storing and loading generated shaders.</string> 175 <string name="use_disk_shader_cache_description">Reduces stuttering by locally storing and loading generated shaders.</string>
170 176
177 <!-- Debug settings strings -->
178 <string name="cpu">CPU</string>
179 <string name="cpu_debug_mode">CPU Debugging</string>
180 <string name="cpu_debug_mode_description">Puts the CPU in a slow debugging mode.</string>
181 <string name="gpu">GPU</string>
182 <string name="renderer_api">API</string>
183 <string name="renderer_debug">Graphics debugging</string>
184 <string name="renderer_debug_description">Sets the graphics API to a slow debugging mode.</string>
185 <string name="fastmem">Fastmem</string>
186
171 <!-- Audio settings strings --> 187 <!-- Audio settings strings -->
188 <string name="audio_output_engine">Output engine</string>
172 <string name="audio_volume">Volume</string> 189 <string name="audio_volume">Volume</string>
173 <string name="audio_volume_description">Specifies the volume of audio output.</string> 190 <string name="audio_volume_description">Specifies the volume of audio output.</string>
174 191
@@ -187,6 +204,7 @@
187 <string name="learn_more">Learn more</string> 204 <string name="learn_more">Learn more</string>
188 <string name="auto">Auto</string> 205 <string name="auto">Auto</string>
189 <string name="submit">Submit</string> 206 <string name="submit">Submit</string>
207 <string name="string_null">Null</string>
190 208
191 <!-- GPU driver installation --> 209 <!-- GPU driver installation -->
192 <string name="select_gpu_driver">Select GPU driver</string> 210 <string name="select_gpu_driver">Select GPU driver</string>
@@ -318,6 +336,11 @@
318 <string name="anti_aliasing_fxaa">FXAA</string> 336 <string name="anti_aliasing_fxaa">FXAA</string>
319 <string name="anti_aliasing_smaa">SMAA</string> 337 <string name="anti_aliasing_smaa">SMAA</string>
320 338
339 <!-- Screen Layouts -->
340 <string name="screen_layout_landscape">Landscape</string>
341 <string name="screen_layout_portrait">Portrait</string>
342 <string name="screen_layout_auto">Auto</string>
343
321 <!-- Aspect Ratios --> 344 <!-- Aspect Ratios -->
322 <string name="ratio_default">Default (16:9)</string> 345 <string name="ratio_default">Default (16:9)</string>
323 <string name="ratio_force_four_three">Force 4:3</string> 346 <string name="ratio_force_four_three">Force 4:3</string>
@@ -352,10 +375,19 @@
352 <string name="theme_mode_light">Light</string> 375 <string name="theme_mode_light">Light</string>
353 <string name="theme_mode_dark">Dark</string> 376 <string name="theme_mode_dark">Dark</string>
354 377
378 <!-- Audio output engines -->
379 <string name="cubeb">cubeb</string>
380
355 <!-- Black backgrounds theme --> 381 <!-- Black backgrounds theme -->
356 <string name="use_black_backgrounds">Black backgrounds</string> 382 <string name="use_black_backgrounds">Black backgrounds</string>
357 <string name="use_black_backgrounds_description">When using the dark theme, apply black backgrounds.</string> 383 <string name="use_black_backgrounds_description">When using the dark theme, apply black backgrounds.</string>
358 384
385 <!-- Picture-In-Picture -->
386 <string name="picture_in_picture">Picture in Picture</string>
387 <string name="picture_in_picture_description">Minimize window when placed in the background</string>
388 <string name="pause">Pause</string>
389 <string name="play">Play</string>
390
359 <!-- Licenses screen strings --> 391 <!-- Licenses screen strings -->
360 <string name="licenses">Licenses</string> 392 <string name="licenses">Licenses</string>
361 <string name="license_fidelityfx_fsr" translatable="false">FidelityFX-FSR</string> 393 <string name="license_fidelityfx_fsr" translatable="false">FidelityFX-FSR</string>
diff --git a/src/android/app/src/main/res/xml/locales_config.xml b/src/android/app/src/main/res/xml/locales_config.xml
new file mode 100644
index 000000000..51b88d9dc
--- /dev/null
+++ b/src/android/app/src/main/res/xml/locales_config.xml
@@ -0,0 +1,17 @@
1<?xml version="1.0" encoding="utf-8"?>
2<locale-config xmlns:android="http://schemas.android.com/apk/res/android">
3 <locale android:name="en" /> <!-- English (default) -->
4 <locale android:name="de" /> <!-- German -->
5 <locale android:name="es" /> <!-- Spanish -->
6 <locale android:name="fr" /> <!-- French -->
7 <locale android:name="it" /> <!-- Italian -->
8 <locale android:name="ja" /> <!-- Japanese -->
9 <locale android:name="nb" /> <!-- Norwegian Bokmal -->
10 <locale android:name="pl" /> <!-- Polish -->
11 <locale android:name="pt-rBR" /> <!-- Portuguese (Brazil) -->
12 <locale android:name="pt-RPT" /> <!-- Portuguese (Portugal) -->
13 <locale android:name="ru" /> <!-- Russian -->
14 <locale android:name="uk" /> <!-- Ukranian -->
15 <locale android:name="zh-rCN" /> <!-- Chinese (China) -->
16 <locale android:name="zh-rTW" /> <!-- Chinese (Taiwan) -->
17</locale-config>
diff --git a/src/android/build.gradle.kts b/src/android/build.gradle.kts
index e19e8ce58..80f370c16 100644
--- a/src/android/build.gradle.kts
+++ b/src/android/build.gradle.kts
@@ -11,3 +11,12 @@ plugins {
11tasks.register("clean").configure { 11tasks.register("clean").configure {
12 delete(rootProject.buildDir) 12 delete(rootProject.buildDir)
13} 13}
14
15buildscript {
16 repositories {
17 google()
18 }
19 dependencies {
20 classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.6.0")
21 }
22}
diff --git a/src/audio_core/audio_core.cpp b/src/audio_core/audio_core.cpp
index 07a679c32..703ef4494 100644
--- a/src/audio_core/audio_core.cpp
+++ b/src/audio_core/audio_core.cpp
@@ -47,12 +47,4 @@ AudioRenderer::ADSP::ADSP& AudioCore::GetADSP() {
47 return *adsp; 47 return *adsp;
48} 48}
49 49
50void AudioCore::SetNVDECActive(bool active) {
51 nvdec_active = active;
52}
53
54bool AudioCore::IsNVDECActive() const {
55 return nvdec_active;
56}
57
58} // namespace AudioCore 50} // namespace AudioCore
diff --git a/src/audio_core/audio_core.h b/src/audio_core/audio_core.h
index e33e00a3e..ea047773e 100644
--- a/src/audio_core/audio_core.h
+++ b/src/audio_core/audio_core.h
@@ -57,18 +57,6 @@ public:
57 */ 57 */
58 AudioRenderer::ADSP::ADSP& GetADSP(); 58 AudioRenderer::ADSP::ADSP& GetADSP();
59 59
60 /**
61 * Toggle NVDEC state, used to avoid stall in playback.
62 *
63 * @param active - Set true if nvdec is active, otherwise false.
64 */
65 void SetNVDECActive(bool active);
66
67 /**
68 * Get NVDEC state.
69 */
70 bool IsNVDECActive() const;
71
72private: 60private:
73 /** 61 /**
74 * Create the sinks on startup. 62 * Create the sinks on startup.
@@ -83,8 +71,6 @@ private:
83 std::unique_ptr<Sink::Sink> input_sink; 71 std::unique_ptr<Sink::Sink> input_sink;
84 /// The ADSP in the sysmodule 72 /// The ADSP in the sysmodule
85 std::unique_ptr<AudioRenderer::ADSP::ADSP> adsp; 73 std::unique_ptr<AudioRenderer::ADSP::ADSP> adsp;
86 /// Is NVDec currently active?
87 bool nvdec_active{false};
88}; 74};
89 75
90} // namespace AudioCore 76} // namespace AudioCore
diff --git a/src/common/fs/fs.cpp b/src/common/fs/fs.cpp
index e1716c62d..6d66c926d 100644
--- a/src/common/fs/fs.cpp
+++ b/src/common/fs/fs.cpp
@@ -3,6 +3,9 @@
3 3
4#include "common/fs/file.h" 4#include "common/fs/file.h"
5#include "common/fs/fs.h" 5#include "common/fs/fs.h"
6#ifdef ANDROID
7#include "common/fs/fs_android.h"
8#endif
6#include "common/fs/path_util.h" 9#include "common/fs/path_util.h"
7#include "common/logging/log.h" 10#include "common/logging/log.h"
8 11
@@ -525,15 +528,39 @@ void IterateDirEntriesRecursively(const std::filesystem::path& path,
525// Generic Filesystem Operations 528// Generic Filesystem Operations
526 529
527bool Exists(const fs::path& path) { 530bool Exists(const fs::path& path) {
531#ifdef ANDROID
532 if (Android::IsContentUri(path)) {
533 return Android::Exists(path);
534 } else {
535 return fs::exists(path);
536 }
537#else
528 return fs::exists(path); 538 return fs::exists(path);
539#endif
529} 540}
530 541
531bool IsFile(const fs::path& path) { 542bool IsFile(const fs::path& path) {
543#ifdef ANDROID
544 if (Android::IsContentUri(path)) {
545 return !Android::IsDirectory(path);
546 } else {
547 return fs::is_regular_file(path);
548 }
549#else
532 return fs::is_regular_file(path); 550 return fs::is_regular_file(path);
551#endif
533} 552}
534 553
535bool IsDir(const fs::path& path) { 554bool IsDir(const fs::path& path) {
555#ifdef ANDROID
556 if (Android::IsContentUri(path)) {
557 return Android::IsDirectory(path);
558 } else {
559 return fs::is_directory(path);
560 }
561#else
536 return fs::is_directory(path); 562 return fs::is_directory(path);
563#endif
537} 564}
538 565
539fs::path GetCurrentDir() { 566fs::path GetCurrentDir() {
diff --git a/src/common/fs/fs_android.h b/src/common/fs/fs_android.h
index bb8a52648..b441c2a12 100644
--- a/src/common/fs/fs_android.h
+++ b/src/common/fs/fs_android.h
@@ -12,7 +12,10 @@
12 "openContentUri", "(Ljava/lang/String;Ljava/lang/String;)I") 12 "openContentUri", "(Ljava/lang/String;Ljava/lang/String;)I")
13 13
14#define ANDROID_SINGLE_PATH_DETERMINE_FUNCTIONS(V) \ 14#define ANDROID_SINGLE_PATH_DETERMINE_FUNCTIONS(V) \
15 V(GetSize, std::uint64_t, get_size, CallStaticLongMethod, "getSize", "(Ljava/lang/String;)J") 15 V(GetSize, std::uint64_t, get_size, CallStaticLongMethod, "getSize", "(Ljava/lang/String;)J") \
16 V(IsDirectory, bool, is_directory, CallStaticBooleanMethod, "isDirectory", \
17 "(Ljava/lang/String;)Z") \
18 V(Exists, bool, file_exists, CallStaticBooleanMethod, "exists", "(Ljava/lang/String;)Z")
16 19
17namespace Common::FS::Android { 20namespace Common::FS::Android {
18 21
diff --git a/src/common/fs/fs_paths.h b/src/common/fs/fs_paths.h
index c77c112f1..61bac9eba 100644
--- a/src/common/fs/fs_paths.h
+++ b/src/common/fs/fs_paths.h
@@ -10,6 +10,7 @@
10 10
11// Sub-directories contained within a yuzu data directory 11// Sub-directories contained within a yuzu data directory
12 12
13#define AMIIBO_DIR "amiibo"
13#define CACHE_DIR "cache" 14#define CACHE_DIR "cache"
14#define CONFIG_DIR "config" 15#define CONFIG_DIR "config"
15#define DUMP_DIR "dump" 16#define DUMP_DIR "dump"
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp
index e026a13d9..d71cfacc6 100644
--- a/src/common/fs/path_util.cpp
+++ b/src/common/fs/path_util.cpp
@@ -114,6 +114,7 @@ public:
114#endif 114#endif
115 115
116 GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); 116 GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path);
117 GenerateYuzuPath(YuzuPath::AmiiboDir, yuzu_path / AMIIBO_DIR);
117 GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path_cache); 118 GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path_cache);
118 GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path_config); 119 GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path_config);
119 GenerateYuzuPath(YuzuPath::DumpDir, yuzu_path / DUMP_DIR); 120 GenerateYuzuPath(YuzuPath::DumpDir, yuzu_path / DUMP_DIR);
diff --git a/src/common/fs/path_util.h b/src/common/fs/path_util.h
index 7cfe85b70..ba28964d0 100644
--- a/src/common/fs/path_util.h
+++ b/src/common/fs/path_util.h
@@ -12,6 +12,7 @@ namespace Common::FS {
12 12
13enum class YuzuPath { 13enum class YuzuPath {
14 YuzuDir, // Where yuzu stores its data. 14 YuzuDir, // Where yuzu stores its data.
15 AmiiboDir, // Where Amiibo backups are stored.
15 CacheDir, // Where cached filesystem data is stored. 16 CacheDir, // Where cached filesystem data is stored.
16 ConfigDir, // Where config files are stored. 17 ConfigDir, // Where config files are stored.
17 DumpDir, // Where dumped data is stored. 18 DumpDir, // Where dumped data is stored.
diff --git a/src/common/settings.cpp b/src/common/settings.cpp
index ff53e80bb..66dffc9bf 100644
--- a/src/common/settings.cpp
+++ b/src/common/settings.cpp
@@ -1,12 +1,16 @@
1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later 2// SPDX-License-Identifier: GPL-2.0-or-later
3 3
4#if __cpp_lib_chrono >= 201907L
5#include <chrono>
6#endif
4#include <string_view> 7#include <string_view>
5 8
6#include "common/assert.h" 9#include "common/assert.h"
7#include "common/fs/path_util.h" 10#include "common/fs/path_util.h"
8#include "common/logging/log.h" 11#include "common/logging/log.h"
9#include "common/settings.h" 12#include "common/settings.h"
13#include "common/time_zone.h"
10 14
11namespace Settings { 15namespace Settings {
12 16
@@ -14,18 +18,23 @@ Values values;
14static bool configuring_global = true; 18static bool configuring_global = true;
15 19
16std::string GetTimeZoneString() { 20std::string GetTimeZoneString() {
17 static constexpr std::array timezones{
18 "auto", "default", "CET", "CST6CDT", "Cuba", "EET", "Egypt", "Eire",
19 "EST", "EST5EDT", "GB", "GB-Eire", "GMT", "GMT+0", "GMT-0", "GMT0",
20 "Greenwich", "Hongkong", "HST", "Iceland", "Iran", "Israel", "Jamaica", "Japan",
21 "Kwajalein", "Libya", "MET", "MST", "MST7MDT", "Navajo", "NZ", "NZ-CHAT",
22 "Poland", "Portugal", "PRC", "PST8PDT", "ROC", "ROK", "Singapore", "Turkey",
23 "UCT", "Universal", "UTC", "W-SU", "WET", "Zulu",
24 };
25
26 const auto time_zone_index = static_cast<std::size_t>(values.time_zone_index.GetValue()); 21 const auto time_zone_index = static_cast<std::size_t>(values.time_zone_index.GetValue());
27 ASSERT(time_zone_index < timezones.size()); 22 ASSERT(time_zone_index < Common::TimeZone::GetTimeZoneStrings().size());
28 return timezones[time_zone_index]; 23
24 std::string location_name;
25 if (time_zone_index == 0) { // Auto
26#if __cpp_lib_chrono >= 201907L
27 const struct std::chrono::tzdb& time_zone_data = std::chrono::get_tzdb();
28 const std::chrono::time_zone* current_zone = time_zone_data.current_zone();
29 std::string_view current_zone_name = current_zone->name();
30 location_name = current_zone_name;
31#else
32 location_name = Common::TimeZone::FindSystemTimeZone();
33#endif
34 } else {
35 location_name = Common::TimeZone::GetTimeZoneStrings()[time_zone_index];
36 }
37 return location_name;
29} 38}
30 39
31void LogSettings() { 40void LogSettings() {
@@ -235,6 +244,7 @@ void RestoreGlobalState(bool is_powered_on) {
235 values.bg_green.SetGlobal(true); 244 values.bg_green.SetGlobal(true);
236 values.bg_blue.SetGlobal(true); 245 values.bg_blue.SetGlobal(true);
237 values.enable_compute_pipelines.SetGlobal(true); 246 values.enable_compute_pipelines.SetGlobal(true);
247 values.use_video_framerate.SetGlobal(true);
238 248
239 // System 249 // System
240 values.language_index.SetGlobal(true); 250 values.language_index.SetGlobal(true);
diff --git a/src/common/settings.h b/src/common/settings.h
index 7f865b2a7..3aedf3850 100644
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -482,6 +482,8 @@ struct Values {
482 SwitchableSetting<AstcRecompression, true> astc_recompression{ 482 SwitchableSetting<AstcRecompression, true> astc_recompression{
483 AstcRecompression::Uncompressed, AstcRecompression::Uncompressed, AstcRecompression::Bc3, 483 AstcRecompression::Uncompressed, AstcRecompression::Uncompressed, AstcRecompression::Bc3,
484 "astc_recompression"}; 484 "astc_recompression"};
485 SwitchableSetting<bool> use_video_framerate{false, "use_video_framerate"};
486 SwitchableSetting<bool> barrier_feedback_loops{true, "barrier_feedback_loops"};
485 487
486 SwitchableSetting<u8> bg_red{0, "bg_red"}; 488 SwitchableSetting<u8> bg_red{0, "bg_red"};
487 SwitchableSetting<u8> bg_green{0, "bg_green"}; 489 SwitchableSetting<u8> bg_green{0, "bg_green"};
diff --git a/src/common/time_zone.cpp b/src/common/time_zone.cpp
index 126836b01..d8d7896c6 100644
--- a/src/common/time_zone.cpp
+++ b/src/common/time_zone.cpp
@@ -2,14 +2,33 @@
2// SPDX-License-Identifier: GPL-2.0-or-later 2// SPDX-License-Identifier: GPL-2.0-or-later
3 3
4#include <chrono> 4#include <chrono>
5#include <exception>
5#include <iomanip> 6#include <iomanip>
6#include <sstream> 7#include <sstream>
8#include <stdexcept>
9#include <fmt/chrono.h>
10#include <fmt/core.h>
7 11
8#include "common/logging/log.h" 12#include "common/logging/log.h"
13#include "common/settings.h"
9#include "common/time_zone.h" 14#include "common/time_zone.h"
10 15
11namespace Common::TimeZone { 16namespace Common::TimeZone {
12 17
18// Time zone strings
19constexpr std::array timezones{
20 "GMT", "GMT", "CET", "CST6CDT", "Cuba", "EET", "Egypt", "Eire",
21 "EST", "EST5EDT", "GB", "GB-Eire", "GMT", "GMT+0", "GMT-0", "GMT0",
22 "Greenwich", "Hongkong", "HST", "Iceland", "Iran", "Israel", "Jamaica", "Japan",
23 "Kwajalein", "Libya", "MET", "MST", "MST7MDT", "Navajo", "NZ", "NZ-CHAT",
24 "Poland", "Portugal", "PRC", "PST8PDT", "ROC", "ROK", "Singapore", "Turkey",
25 "UCT", "Universal", "UTC", "W-SU", "WET", "Zulu",
26};
27
28const std::array<const char*, 46>& GetTimeZoneStrings() {
29 return timezones;
30}
31
13std::string GetDefaultTimeZone() { 32std::string GetDefaultTimeZone() {
14 return "GMT"; 33 return "GMT";
15} 34}
@@ -18,10 +37,7 @@ static std::string GetOsTimeZoneOffset() {
18 const std::time_t t{std::time(nullptr)}; 37 const std::time_t t{std::time(nullptr)};
19 const std::tm tm{*std::localtime(&t)}; 38 const std::tm tm{*std::localtime(&t)};
20 39
21 std::stringstream ss; 40 return fmt::format("{:%z}", tm);
22 ss << std::put_time(&tm, "%z"); // Get the current timezone offset, e.g. "-400", as a string
23
24 return ss.str();
25} 41}
26 42
27static int ConvertOsTimeZoneOffsetToInt(const std::string& timezone) { 43static int ConvertOsTimeZoneOffsetToInt(const std::string& timezone) {
@@ -45,4 +61,43 @@ std::chrono::seconds GetCurrentOffsetSeconds() {
45 return std::chrono::seconds{seconds}; 61 return std::chrono::seconds{seconds};
46} 62}
47 63
64// Key is [Hours * 100 + Minutes], multiplied by 100 if DST
65const static std::map<s64, const char*> off_timezones = {
66 {530, "Asia/Calcutta"}, {930, "Australia/Darwin"}, {845, "Australia/Eucla"},
67 {103000, "Australia/Adelaide"}, {1030, "Australia/Lord_Howe"}, {630, "Indian/Cocos"},
68 {1245, "Pacific/Chatham"}, {134500, "Pacific/Chatham"}, {-330, "Canada/Newfoundland"},
69 {-23000, "Canada/Newfoundland"}, {430, "Asia/Kabul"}, {330, "Asia/Tehran"},
70 {43000, "Asia/Tehran"}, {545, "Asia/Kathmandu"}, {-930, "Asia/Marquesas"},
71};
72
73std::string FindSystemTimeZone() {
74#if defined(MINGW)
75 // MinGW has broken strftime -- https://sourceforge.net/p/mingw-w64/bugs/793/
76 // e.g. fmt::format("{:%z}") -- returns "Eastern Daylight Time" when it should be "-0400"
77 return timezones[0];
78#else
79 const s64 seconds = static_cast<s64>(GetCurrentOffsetSeconds().count());
80
81 const s64 minutes = seconds / 60;
82 const s64 hours = minutes / 60;
83
84 const s64 minutes_off = minutes - hours * 60;
85
86 if (minutes_off != 0) {
87 const auto the_time = std::time(nullptr);
88 const struct std::tm& local = *std::localtime(&the_time);
89 const bool is_dst = local.tm_isdst != 0;
90
91 const s64 tz_index = (hours * 100 + minutes_off) * (is_dst ? 100 : 1);
92
93 try {
94 return off_timezones.at(tz_index);
95 } catch (std::out_of_range&) {
96 LOG_ERROR(Common, "Time zone {} not handled, defaulting to hour offset.", tz_index);
97 }
98 }
99 return fmt::format("Etc/GMT{:s}{:d}", hours > 0 ? "-" : "+", std::abs(hours));
100#endif
101}
102
48} // namespace Common::TimeZone 103} // namespace Common::TimeZone
diff --git a/src/common/time_zone.h b/src/common/time_zone.h
index 99cae6ef2..f574d5c04 100644
--- a/src/common/time_zone.h
+++ b/src/common/time_zone.h
@@ -3,15 +3,21 @@
3 3
4#pragma once 4#pragma once
5 5
6#include <array>
6#include <chrono> 7#include <chrono>
7#include <string> 8#include <string>
8 9
9namespace Common::TimeZone { 10namespace Common::TimeZone {
10 11
12[[nodiscard]] const std::array<const char*, 46>& GetTimeZoneStrings();
13
11/// Gets the default timezone, i.e. "GMT" 14/// Gets the default timezone, i.e. "GMT"
12[[nodiscard]] std::string GetDefaultTimeZone(); 15[[nodiscard]] std::string GetDefaultTimeZone();
13 16
14/// Gets the offset of the current timezone (from the default), in seconds 17/// Gets the offset of the current timezone (from the default), in seconds
15[[nodiscard]] std::chrono::seconds GetCurrentOffsetSeconds(); 18[[nodiscard]] std::chrono::seconds GetCurrentOffsetSeconds();
16 19
20/// Searches time zone offsets for the closest offset to the system time zone
21[[nodiscard]] std::string FindSystemTimeZone();
22
17} // namespace Common::TimeZone 23} // namespace Common::TimeZone
diff --git a/src/common/uuid.cpp b/src/common/uuid.cpp
index 89e1ed225..035df7fe0 100644
--- a/src/common/uuid.cpp
+++ b/src/common/uuid.cpp
@@ -48,7 +48,7 @@ std::array<u8, 0x10> ConstructFromRawString(std::string_view raw_string) {
48} 48}
49 49
50std::array<u8, 0x10> ConstructFromFormattedString(std::string_view formatted_string) { 50std::array<u8, 0x10> ConstructFromFormattedString(std::string_view formatted_string) {
51 std::array<u8, 0x10> uuid; 51 std::array<u8, 0x10> uuid{};
52 52
53 size_t i = 0; 53 size_t i = 0;
54 54
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 3df4094a7..3655b8478 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -4,8 +4,6 @@
4add_library(core STATIC 4add_library(core STATIC
5 arm/arm_interface.h 5 arm/arm_interface.h
6 arm/arm_interface.cpp 6 arm/arm_interface.cpp
7 arm/dynarmic/arm_exclusive_monitor.cpp
8 arm/dynarmic/arm_exclusive_monitor.h
9 arm/exclusive_monitor.cpp 7 arm/exclusive_monitor.cpp
10 arm/exclusive_monitor.h 8 arm/exclusive_monitor.h
11 arm/symbols.cpp 9 arm/symbols.cpp
@@ -835,7 +833,7 @@ endif()
835 833
836create_target_directory_groups(core) 834create_target_directory_groups(core)
837 835
838target_link_libraries(core PUBLIC common PRIVATE audio_core network video_core) 836target_link_libraries(core PUBLIC common PRIVATE audio_core network video_core nx_tzdb)
839target_link_libraries(core PUBLIC Boost::headers PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls Opus::opus) 837target_link_libraries(core PUBLIC Boost::headers PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls Opus::opus)
840if (MINGW) 838if (MINGW)
841 target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY}) 839 target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY})
@@ -848,12 +846,15 @@ endif()
848 846
849if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) 847if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64)
850 target_sources(core PRIVATE 848 target_sources(core PRIVATE
849 arm/dynarmic/arm_dynarmic.h
851 arm/dynarmic/arm_dynarmic_64.cpp 850 arm/dynarmic/arm_dynarmic_64.cpp
852 arm/dynarmic/arm_dynarmic_64.h 851 arm/dynarmic/arm_dynarmic_64.h
853 arm/dynarmic/arm_dynarmic_32.cpp 852 arm/dynarmic/arm_dynarmic_32.cpp
854 arm/dynarmic/arm_dynarmic_32.h 853 arm/dynarmic/arm_dynarmic_32.h
855 arm/dynarmic/arm_dynarmic_cp15.cpp 854 arm/dynarmic/dynarmic_cp15.cpp
856 arm/dynarmic/arm_dynarmic_cp15.h 855 arm/dynarmic/dynarmic_cp15.h
856 arm/dynarmic/dynarmic_exclusive_monitor.cpp
857 arm/dynarmic/dynarmic_exclusive_monitor.h
857 hle/service/jit/jit_context.cpp 858 hle/service/jit/jit_context.cpp
858 hle/service/jit/jit_context.h 859 hle/service/jit/jit_context.h
859 hle/service/jit/jit.cpp 860 hle/service/jit/jit.cpp
diff --git a/src/core/arm/arm_interface.cpp b/src/core/arm/arm_interface.cpp
index d30914b7a..beaea64b3 100644
--- a/src/core/arm/arm_interface.cpp
+++ b/src/core/arm/arm_interface.cpp
@@ -13,25 +13,68 @@
13#include "core/core.h" 13#include "core/core.h"
14#include "core/debugger/debugger.h" 14#include "core/debugger/debugger.h"
15#include "core/hle/kernel/k_process.h" 15#include "core/hle/kernel/k_process.h"
16#include "core/hle/kernel/k_thread.h"
16#include "core/hle/kernel/svc.h" 17#include "core/hle/kernel/svc.h"
17#include "core/loader/loader.h" 18#include "core/loader/loader.h"
18#include "core/memory.h" 19#include "core/memory.h"
19 20
20#include "core/arm/dynarmic/arm_dynarmic_32.h"
21#include "core/arm/dynarmic/arm_dynarmic_64.h"
22
23namespace Core { 21namespace Core {
24 22
25constexpr u64 SEGMENT_BASE = 0x7100000000ull; 23constexpr u64 SEGMENT_BASE = 0x7100000000ull;
26 24
27std::vector<ARM_Interface::BacktraceEntry> ARM_Interface::GetBacktraceFromContext( 25std::vector<ARM_Interface::BacktraceEntry> ARM_Interface::GetBacktraceFromContext(
28 Core::System& system, const ARM_Interface::ThreadContext32& ctx) { 26 Core::System& system, const ARM_Interface::ThreadContext32& ctx) {
29 return ARM_Dynarmic_32::GetBacktraceFromContext(system, ctx); 27 std::vector<BacktraceEntry> out;
28 auto& memory = system.ApplicationMemory();
29
30 const auto& reg = ctx.cpu_registers;
31 u32 pc = reg[15], lr = reg[14], fp = reg[11];
32 out.push_back({"", 0, pc, 0, ""});
33
34 // fp (= r11) points to the last frame record.
35 // Frame records are two words long:
36 // fp+0 : pointer to previous frame record
37 // fp+4 : value of lr for frame
38 for (size_t i = 0; i < 256; i++) {
39 out.push_back({"", 0, lr, 0, ""});
40 if (!fp || (fp % 4 != 0) || !memory.IsValidVirtualAddressRange(fp, 8)) {
41 break;
42 }
43 lr = memory.Read32(fp + 4);
44 fp = memory.Read32(fp);
45 }
46
47 SymbolicateBacktrace(system, out);
48
49 return out;
30} 50}
31 51
32std::vector<ARM_Interface::BacktraceEntry> ARM_Interface::GetBacktraceFromContext( 52std::vector<ARM_Interface::BacktraceEntry> ARM_Interface::GetBacktraceFromContext(
33 Core::System& system, const ARM_Interface::ThreadContext64& ctx) { 53 Core::System& system, const ARM_Interface::ThreadContext64& ctx) {
34 return ARM_Dynarmic_64::GetBacktraceFromContext(system, ctx); 54 std::vector<BacktraceEntry> out;
55 auto& memory = system.ApplicationMemory();
56
57 const auto& reg = ctx.cpu_registers;
58 u64 pc = ctx.pc, lr = reg[30], fp = reg[29];
59
60 out.push_back({"", 0, pc, 0, ""});
61
62 // fp (= x29) points to the previous frame record.
63 // Frame records are two words long:
64 // fp+0 : pointer to previous frame record
65 // fp+8 : value of lr for frame
66 for (size_t i = 0; i < 256; i++) {
67 out.push_back({"", 0, lr, 0, ""});
68 if (!fp || (fp % 4 != 0) || !memory.IsValidVirtualAddressRange(fp, 16)) {
69 break;
70 }
71 lr = memory.Read64(fp + 8);
72 fp = memory.Read64(fp);
73 }
74
75 SymbolicateBacktrace(system, out);
76
77 return out;
35} 78}
36 79
37void ARM_Interface::SymbolicateBacktrace(Core::System& system, std::vector<BacktraceEntry>& out) { 80void ARM_Interface::SymbolicateBacktrace(Core::System& system, std::vector<BacktraceEntry>& out) {
@@ -76,6 +119,18 @@ void ARM_Interface::SymbolicateBacktrace(Core::System& system, std::vector<Backt
76 } 119 }
77} 120}
78 121
122std::vector<ARM_Interface::BacktraceEntry> ARM_Interface::GetBacktrace() const {
123 if (GetArchitecture() == Architecture::Aarch64) {
124 ThreadContext64 ctx;
125 SaveContext(ctx);
126 return GetBacktraceFromContext(system, ctx);
127 } else {
128 ThreadContext32 ctx;
129 SaveContext(ctx);
130 return GetBacktraceFromContext(system, ctx);
131 }
132}
133
79void ARM_Interface::LogBacktrace() const { 134void ARM_Interface::LogBacktrace() const {
80 const VAddr sp = GetSP(); 135 const VAddr sp = GetSP();
81 const VAddr pc = GetPC(); 136 const VAddr pc = GetPC();
@@ -83,7 +138,6 @@ void ARM_Interface::LogBacktrace() const {
83 LOG_ERROR(Core_ARM, "{:20}{:20}{:20}{:20}{}", "Module Name", "Address", "Original Address", 138 LOG_ERROR(Core_ARM, "{:20}{:20}{:20}{:20}{}", "Module Name", "Address", "Original Address",
84 "Offset", "Symbol"); 139 "Offset", "Symbol");
85 LOG_ERROR(Core_ARM, ""); 140 LOG_ERROR(Core_ARM, "");
86
87 const auto backtrace = GetBacktrace(); 141 const auto backtrace = GetBacktrace();
88 for (const auto& entry : backtrace) { 142 for (const auto& entry : backtrace) {
89 LOG_ERROR(Core_ARM, "{:20}{:016X} {:016X} {:016X} {}", entry.module, entry.address, 143 LOG_ERROR(Core_ARM, "{:20}{:016X} {:016X} {:016X} {}", entry.module, entry.address,
@@ -97,7 +151,7 @@ void ARM_Interface::Run() {
97 151
98 while (true) { 152 while (true) {
99 Kernel::KThread* current_thread{Kernel::GetCurrentThreadPointer(system.Kernel())}; 153 Kernel::KThread* current_thread{Kernel::GetCurrentThreadPointer(system.Kernel())};
100 Dynarmic::HaltReason hr{}; 154 HaltReason hr{};
101 155
102 // Notify the debugger and go to sleep if a step was performed 156 // Notify the debugger and go to sleep if a step was performed
103 // and this thread has been scheduled again. 157 // and this thread has been scheduled again.
@@ -108,17 +162,17 @@ void ARM_Interface::Run() {
108 } 162 }
109 163
110 // Otherwise, run the thread. 164 // Otherwise, run the thread.
111 system.EnterDynarmicProfile(); 165 system.EnterCPUProfile();
112 if (current_thread->GetStepState() == StepState::StepPending) { 166 if (current_thread->GetStepState() == StepState::StepPending) {
113 hr = StepJit(); 167 hr = StepJit();
114 168
115 if (Has(hr, step_thread)) { 169 if (True(hr & HaltReason::StepThread)) {
116 current_thread->SetStepState(StepState::StepPerformed); 170 current_thread->SetStepState(StepState::StepPerformed);
117 } 171 }
118 } else { 172 } else {
119 hr = RunJit(); 173 hr = RunJit();
120 } 174 }
121 system.ExitDynarmicProfile(); 175 system.ExitCPUProfile();
122 176
123 // If the thread is scheduled for termination, exit the thread. 177 // If the thread is scheduled for termination, exit the thread.
124 if (current_thread->HasDpc()) { 178 if (current_thread->HasDpc()) {
@@ -130,8 +184,8 @@ void ARM_Interface::Run() {
130 184
131 // Notify the debugger and go to sleep if a breakpoint was hit, 185 // Notify the debugger and go to sleep if a breakpoint was hit,
132 // or if the thread is unable to continue for any reason. 186 // or if the thread is unable to continue for any reason.
133 if (Has(hr, breakpoint) || Has(hr, no_execute)) { 187 if (True(hr & HaltReason::InstructionBreakpoint) || True(hr & HaltReason::PrefetchAbort)) {
134 if (!Has(hr, no_execute)) { 188 if (!True(hr & HaltReason::InstructionBreakpoint)) {
135 RewindBreakpointInstruction(); 189 RewindBreakpointInstruction();
136 } 190 }
137 if (system.DebuggerEnabled()) { 191 if (system.DebuggerEnabled()) {
@@ -144,7 +198,7 @@ void ARM_Interface::Run() {
144 } 198 }
145 199
146 // Notify the debugger and go to sleep if a watchpoint was hit. 200 // Notify the debugger and go to sleep if a watchpoint was hit.
147 if (Has(hr, watchpoint)) { 201 if (True(hr & HaltReason::DataAbort)) {
148 if (system.DebuggerEnabled()) { 202 if (system.DebuggerEnabled()) {
149 system.GetDebugger().NotifyThreadWatchpoint(current_thread, *HaltedWatchpoint()); 203 system.GetDebugger().NotifyThreadWatchpoint(current_thread, *HaltedWatchpoint());
150 } 204 }
@@ -153,11 +207,11 @@ void ARM_Interface::Run() {
153 } 207 }
154 208
155 // Handle syscalls and scheduling (this may change the current thread/core) 209 // Handle syscalls and scheduling (this may change the current thread/core)
156 if (Has(hr, svc_call)) { 210 if (True(hr & HaltReason::SupervisorCall)) {
157 Kernel::Svc::Call(system, GetSvcNumber()); 211 Kernel::Svc::Call(system, GetSvcNumber());
158 break; 212 break;
159 } 213 }
160 if (Has(hr, break_loop) || !uses_wall_clock) { 214 if (True(hr & HaltReason::BreakLoop) || !uses_wall_clock) {
161 break; 215 break;
162 } 216 }
163 } 217 }
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h
index 8e40702cc..d5f2fa09a 100644
--- a/src/core/arm/arm_interface.h
+++ b/src/core/arm/arm_interface.h
@@ -8,8 +8,6 @@
8#include <string> 8#include <string>
9#include <vector> 9#include <vector>
10 10
11#include <dynarmic/interface/halt_reason.h>
12
13#include "common/common_funcs.h" 11#include "common/common_funcs.h"
14#include "common/common_types.h" 12#include "common/common_types.h"
15#include "core/hardware_properties.h" 13#include "core/hardware_properties.h"
@@ -30,6 +28,22 @@ class CPUInterruptHandler;
30 28
31using WatchpointArray = std::array<Kernel::DebugWatchpoint, Core::Hardware::NUM_WATCHPOINTS>; 29using WatchpointArray = std::array<Kernel::DebugWatchpoint, Core::Hardware::NUM_WATCHPOINTS>;
32 30
31// NOTE: these values match the HaltReason enum in Dynarmic
32enum class HaltReason : u64 {
33 StepThread = 0x00000001,
34 DataAbort = 0x00000004,
35 BreakLoop = 0x02000000,
36 SupervisorCall = 0x04000000,
37 InstructionBreakpoint = 0x08000000,
38 PrefetchAbort = 0x20000000,
39};
40DECLARE_ENUM_FLAG_OPERATORS(HaltReason);
41
42enum class Architecture {
43 Aarch32,
44 Aarch64,
45};
46
33/// Generic ARMv8 CPU interface 47/// Generic ARMv8 CPU interface
34class ARM_Interface { 48class ARM_Interface {
35public: 49public:
@@ -167,8 +181,9 @@ public:
167 */ 181 */
168 virtual void SetTPIDR_EL0(u64 value) = 0; 182 virtual void SetTPIDR_EL0(u64 value) = 0;
169 183
170 virtual void SaveContext(ThreadContext32& ctx) = 0; 184 virtual Architecture GetArchitecture() const = 0;
171 virtual void SaveContext(ThreadContext64& ctx) = 0; 185 virtual void SaveContext(ThreadContext32& ctx) const = 0;
186 virtual void SaveContext(ThreadContext64& ctx) const = 0;
172 virtual void LoadContext(const ThreadContext32& ctx) = 0; 187 virtual void LoadContext(const ThreadContext32& ctx) = 0;
173 virtual void LoadContext(const ThreadContext64& ctx) = 0; 188 virtual void LoadContext(const ThreadContext64& ctx) = 0;
174 void LoadWatchpointArray(const WatchpointArray& wp); 189 void LoadWatchpointArray(const WatchpointArray& wp);
@@ -195,17 +210,9 @@ public:
195 static std::vector<BacktraceEntry> GetBacktraceFromContext(System& system, 210 static std::vector<BacktraceEntry> GetBacktraceFromContext(System& system,
196 const ThreadContext64& ctx); 211 const ThreadContext64& ctx);
197 212
198 virtual std::vector<BacktraceEntry> GetBacktrace() const = 0; 213 std::vector<BacktraceEntry> GetBacktrace() const;
199
200 void LogBacktrace() const; 214 void LogBacktrace() const;
201 215
202 static constexpr Dynarmic::HaltReason step_thread = Dynarmic::HaltReason::Step;
203 static constexpr Dynarmic::HaltReason break_loop = Dynarmic::HaltReason::UserDefined2;
204 static constexpr Dynarmic::HaltReason svc_call = Dynarmic::HaltReason::UserDefined3;
205 static constexpr Dynarmic::HaltReason breakpoint = Dynarmic::HaltReason::UserDefined4;
206 static constexpr Dynarmic::HaltReason watchpoint = Dynarmic::HaltReason::MemoryAbort;
207 static constexpr Dynarmic::HaltReason no_execute = Dynarmic::HaltReason::UserDefined6;
208
209protected: 216protected:
210 /// System context that this ARM interface is running under. 217 /// System context that this ARM interface is running under.
211 System& system; 218 System& system;
@@ -216,8 +223,8 @@ protected:
216 const Kernel::DebugWatchpoint* MatchingWatchpoint( 223 const Kernel::DebugWatchpoint* MatchingWatchpoint(
217 u64 addr, u64 size, Kernel::DebugWatchpointType access_type) const; 224 u64 addr, u64 size, Kernel::DebugWatchpointType access_type) const;
218 225
219 virtual Dynarmic::HaltReason RunJit() = 0; 226 virtual HaltReason RunJit() = 0;
220 virtual Dynarmic::HaltReason StepJit() = 0; 227 virtual HaltReason StepJit() = 0;
221 virtual u32 GetSvcNumber() const = 0; 228 virtual u32 GetSvcNumber() const = 0;
222 virtual const Kernel::DebugWatchpoint* HaltedWatchpoint() const = 0; 229 virtual const Kernel::DebugWatchpoint* HaltedWatchpoint() const = 0;
223 virtual void RewindBreakpointInstruction() = 0; 230 virtual void RewindBreakpointInstruction() = 0;
diff --git a/src/core/arm/dynarmic/arm_dynarmic.h b/src/core/arm/dynarmic/arm_dynarmic.h
new file mode 100644
index 000000000..eef7c3116
--- /dev/null
+++ b/src/core/arm/dynarmic/arm_dynarmic.h
@@ -0,0 +1,29 @@
1// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include <dynarmic/interface/halt_reason.h>
5
6#include "core/arm/arm_interface.h"
7
8namespace Core {
9
10constexpr Dynarmic::HaltReason StepThread = Dynarmic::HaltReason::Step;
11constexpr Dynarmic::HaltReason DataAbort = Dynarmic::HaltReason::MemoryAbort;
12constexpr Dynarmic::HaltReason BreakLoop = Dynarmic::HaltReason::UserDefined2;
13constexpr Dynarmic::HaltReason SupervisorCall = Dynarmic::HaltReason::UserDefined3;
14constexpr Dynarmic::HaltReason InstructionBreakpoint = Dynarmic::HaltReason::UserDefined4;
15constexpr Dynarmic::HaltReason PrefetchAbort = Dynarmic::HaltReason::UserDefined6;
16
17constexpr HaltReason TranslateHaltReason(Dynarmic::HaltReason hr) {
18 static_assert(static_cast<u64>(HaltReason::StepThread) == static_cast<u64>(StepThread));
19 static_assert(static_cast<u64>(HaltReason::DataAbort) == static_cast<u64>(DataAbort));
20 static_assert(static_cast<u64>(HaltReason::BreakLoop) == static_cast<u64>(BreakLoop));
21 static_assert(static_cast<u64>(HaltReason::SupervisorCall) == static_cast<u64>(SupervisorCall));
22 static_assert(static_cast<u64>(HaltReason::InstructionBreakpoint) ==
23 static_cast<u64>(InstructionBreakpoint));
24 static_assert(static_cast<u64>(HaltReason::PrefetchAbort) == static_cast<u64>(PrefetchAbort));
25
26 return static_cast<HaltReason>(hr);
27}
28
29} // namespace Core
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp
index dfdcbe35a..5acf9008d 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp
+++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp
@@ -10,9 +10,10 @@
10#include "common/logging/log.h" 10#include "common/logging/log.h"
11#include "common/page_table.h" 11#include "common/page_table.h"
12#include "common/settings.h" 12#include "common/settings.h"
13#include "core/arm/dynarmic/arm_dynarmic.h"
13#include "core/arm/dynarmic/arm_dynarmic_32.h" 14#include "core/arm/dynarmic/arm_dynarmic_32.h"
14#include "core/arm/dynarmic/arm_dynarmic_cp15.h" 15#include "core/arm/dynarmic/dynarmic_cp15.h"
15#include "core/arm/dynarmic/arm_exclusive_monitor.h" 16#include "core/arm/dynarmic/dynarmic_exclusive_monitor.h"
16#include "core/core.h" 17#include "core/core.h"
17#include "core/core_timing.h" 18#include "core/core_timing.h"
18#include "core/debugger/debugger.h" 19#include "core/debugger/debugger.h"
@@ -104,11 +105,11 @@ public:
104 switch (exception) { 105 switch (exception) {
105 case Dynarmic::A32::Exception::NoExecuteFault: 106 case Dynarmic::A32::Exception::NoExecuteFault:
106 LOG_CRITICAL(Core_ARM, "Cannot execute instruction at unmapped address {:#08x}", pc); 107 LOG_CRITICAL(Core_ARM, "Cannot execute instruction at unmapped address {:#08x}", pc);
107 ReturnException(pc, ARM_Interface::no_execute); 108 ReturnException(pc, PrefetchAbort);
108 return; 109 return;
109 default: 110 default:
110 if (debugger_enabled) { 111 if (debugger_enabled) {
111 ReturnException(pc, ARM_Interface::breakpoint); 112 ReturnException(pc, InstructionBreakpoint);
112 return; 113 return;
113 } 114 }
114 115
@@ -121,7 +122,7 @@ public:
121 122
122 void CallSVC(u32 swi) override { 123 void CallSVC(u32 swi) override {
123 parent.svc_swi = swi; 124 parent.svc_swi = swi;
124 parent.jit.load()->HaltExecution(ARM_Interface::svc_call); 125 parent.jit.load()->HaltExecution(SupervisorCall);
125 } 126 }
126 127
127 void AddTicks(u64 ticks) override { 128 void AddTicks(u64 ticks) override {
@@ -162,7 +163,7 @@ public:
162 if (!memory.IsValidVirtualAddressRange(addr, size)) { 163 if (!memory.IsValidVirtualAddressRange(addr, size)) {
163 LOG_CRITICAL(Core_ARM, "Stopping execution due to unmapped memory access at {:#x}", 164 LOG_CRITICAL(Core_ARM, "Stopping execution due to unmapped memory access at {:#x}",
164 addr); 165 addr);
165 parent.jit.load()->HaltExecution(ARM_Interface::no_execute); 166 parent.jit.load()->HaltExecution(PrefetchAbort);
166 return false; 167 return false;
167 } 168 }
168 169
@@ -173,7 +174,7 @@ public:
173 const auto match{parent.MatchingWatchpoint(addr, size, type)}; 174 const auto match{parent.MatchingWatchpoint(addr, size, type)};
174 if (match) { 175 if (match) {
175 parent.halted_watchpoint = match; 176 parent.halted_watchpoint = match;
176 parent.jit.load()->HaltExecution(ARM_Interface::watchpoint); 177 parent.jit.load()->HaltExecution(DataAbort);
177 return false; 178 return false;
178 } 179 }
179 180
@@ -329,12 +330,12 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable*
329 return std::make_unique<Dynarmic::A32::Jit>(config); 330 return std::make_unique<Dynarmic::A32::Jit>(config);
330} 331}
331 332
332Dynarmic::HaltReason ARM_Dynarmic_32::RunJit() { 333HaltReason ARM_Dynarmic_32::RunJit() {
333 return jit.load()->Run(); 334 return TranslateHaltReason(jit.load()->Run());
334} 335}
335 336
336Dynarmic::HaltReason ARM_Dynarmic_32::StepJit() { 337HaltReason ARM_Dynarmic_32::StepJit() {
337 return jit.load()->Step(); 338 return TranslateHaltReason(jit.load()->Step());
338} 339}
339 340
340u32 ARM_Dynarmic_32::GetSvcNumber() const { 341u32 ARM_Dynarmic_32::GetSvcNumber() const {
@@ -408,7 +409,7 @@ void ARM_Dynarmic_32::SetTPIDR_EL0(u64 value) {
408 cp15->uprw = static_cast<u32>(value); 409 cp15->uprw = static_cast<u32>(value);
409} 410}
410 411
411void ARM_Dynarmic_32::SaveContext(ThreadContext32& ctx) { 412void ARM_Dynarmic_32::SaveContext(ThreadContext32& ctx) const {
412 Dynarmic::A32::Jit* j = jit.load(); 413 Dynarmic::A32::Jit* j = jit.load();
413 ctx.cpu_registers = j->Regs(); 414 ctx.cpu_registers = j->Regs();
414 ctx.extension_registers = j->ExtRegs(); 415 ctx.extension_registers = j->ExtRegs();
@@ -425,11 +426,11 @@ void ARM_Dynarmic_32::LoadContext(const ThreadContext32& ctx) {
425} 426}
426 427
427void ARM_Dynarmic_32::SignalInterrupt() { 428void ARM_Dynarmic_32::SignalInterrupt() {
428 jit.load()->HaltExecution(break_loop); 429 jit.load()->HaltExecution(BreakLoop);
429} 430}
430 431
431void ARM_Dynarmic_32::ClearInterrupt() { 432void ARM_Dynarmic_32::ClearInterrupt() {
432 jit.load()->ClearHalt(break_loop); 433 jit.load()->ClearHalt(BreakLoop);
433} 434}
434 435
435void ARM_Dynarmic_32::ClearInstructionCache() { 436void ARM_Dynarmic_32::ClearInstructionCache() {
@@ -462,39 +463,4 @@ void ARM_Dynarmic_32::PageTableChanged(Common::PageTable& page_table,
462 jit_cache.emplace(key, std::move(new_jit)); 463 jit_cache.emplace(key, std::move(new_jit));
463} 464}
464 465
465std::vector<ARM_Interface::BacktraceEntry> ARM_Dynarmic_32::GetBacktrace(Core::System& system,
466 u64 fp, u64 lr, u64 pc) {
467 std::vector<BacktraceEntry> out;
468 auto& memory = system.ApplicationMemory();
469
470 out.push_back({"", 0, pc, 0, ""});
471
472 // fp (= r11) points to the last frame record.
473 // Frame records are two words long:
474 // fp+0 : pointer to previous frame record
475 // fp+4 : value of lr for frame
476 for (size_t i = 0; i < 256; i++) {
477 out.push_back({"", 0, lr, 0, ""});
478 if (!fp || (fp % 4 != 0) || !memory.IsValidVirtualAddressRange(fp, 8)) {
479 break;
480 }
481 lr = memory.Read32(fp + 4);
482 fp = memory.Read32(fp);
483 }
484
485 SymbolicateBacktrace(system, out);
486
487 return out;
488}
489
490std::vector<ARM_Interface::BacktraceEntry> ARM_Dynarmic_32::GetBacktraceFromContext(
491 System& system, const ThreadContext32& ctx) {
492 const auto& reg = ctx.cpu_registers;
493 return GetBacktrace(system, reg[11], reg[14], reg[15]);
494}
495
496std::vector<ARM_Interface::BacktraceEntry> ARM_Dynarmic_32::GetBacktrace() const {
497 return GetBacktrace(system, GetReg(11), GetReg(14), GetReg(15));
498}
499
500} // namespace Core 466} // namespace Core
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.h b/src/core/arm/dynarmic/arm_dynarmic_32.h
index bce695daf..a990845cb 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_32.h
+++ b/src/core/arm/dynarmic/arm_dynarmic_32.h
@@ -50,8 +50,11 @@ public:
50 return (GetPSTATE() & 0x20) != 0; 50 return (GetPSTATE() & 0x20) != 0;
51 } 51 }
52 52
53 void SaveContext(ThreadContext32& ctx) override; 53 Architecture GetArchitecture() const override {
54 void SaveContext(ThreadContext64& ctx) override {} 54 return Architecture::Aarch32;
55 }
56 void SaveContext(ThreadContext32& ctx) const override;
57 void SaveContext(ThreadContext64& ctx) const override {}
55 void LoadContext(const ThreadContext32& ctx) override; 58 void LoadContext(const ThreadContext32& ctx) override;
56 void LoadContext(const ThreadContext64& ctx) override {} 59 void LoadContext(const ThreadContext64& ctx) override {}
57 60
@@ -64,14 +67,9 @@ public:
64 void PageTableChanged(Common::PageTable& new_page_table, 67 void PageTableChanged(Common::PageTable& new_page_table,
65 std::size_t new_address_space_size_in_bits) override; 68 std::size_t new_address_space_size_in_bits) override;
66 69
67 static std::vector<BacktraceEntry> GetBacktraceFromContext(System& system,
68 const ThreadContext32& ctx);
69
70 std::vector<BacktraceEntry> GetBacktrace() const override;
71
72protected: 70protected:
73 Dynarmic::HaltReason RunJit() override; 71 HaltReason RunJit() override;
74 Dynarmic::HaltReason StepJit() override; 72 HaltReason StepJit() override;
75 u32 GetSvcNumber() const override; 73 u32 GetSvcNumber() const override;
76 const Kernel::DebugWatchpoint* HaltedWatchpoint() const override; 74 const Kernel::DebugWatchpoint* HaltedWatchpoint() const override;
77 void RewindBreakpointInstruction() override; 75 void RewindBreakpointInstruction() override;
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp
index bbbcb4f9d..bb97ed5bc 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp
+++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp
@@ -10,8 +10,9 @@
10#include "common/logging/log.h" 10#include "common/logging/log.h"
11#include "common/page_table.h" 11#include "common/page_table.h"
12#include "common/settings.h" 12#include "common/settings.h"
13#include "core/arm/dynarmic/arm_dynarmic.h"
13#include "core/arm/dynarmic/arm_dynarmic_64.h" 14#include "core/arm/dynarmic/arm_dynarmic_64.h"
14#include "core/arm/dynarmic/arm_exclusive_monitor.h" 15#include "core/arm/dynarmic/dynarmic_exclusive_monitor.h"
15#include "core/core.h" 16#include "core/core.h"
16#include "core/core_timing.h" 17#include "core/core_timing.h"
17#include "core/debugger/debugger.h" 18#include "core/debugger/debugger.h"
@@ -113,7 +114,7 @@ public:
113 LOG_ERROR(Core_ARM, 114 LOG_ERROR(Core_ARM,
114 "Unimplemented instruction @ 0x{:X} for {} instructions (instr = {:08X})", pc, 115 "Unimplemented instruction @ 0x{:X} for {} instructions (instr = {:08X})", pc,
115 num_instructions, memory.Read32(pc)); 116 num_instructions, memory.Read32(pc));
116 ReturnException(pc, ARM_Interface::no_execute); 117 ReturnException(pc, PrefetchAbort);
117 } 118 }
118 119
119 void InstructionCacheOperationRaised(Dynarmic::A64::InstructionCacheOperation op, 120 void InstructionCacheOperationRaised(Dynarmic::A64::InstructionCacheOperation op,
@@ -148,11 +149,11 @@ public:
148 return; 149 return;
149 case Dynarmic::A64::Exception::NoExecuteFault: 150 case Dynarmic::A64::Exception::NoExecuteFault:
150 LOG_CRITICAL(Core_ARM, "Cannot execute instruction at unmapped address {:#016x}", pc); 151 LOG_CRITICAL(Core_ARM, "Cannot execute instruction at unmapped address {:#016x}", pc);
151 ReturnException(pc, ARM_Interface::no_execute); 152 ReturnException(pc, PrefetchAbort);
152 return; 153 return;
153 default: 154 default:
154 if (debugger_enabled) { 155 if (debugger_enabled) {
155 ReturnException(pc, ARM_Interface::breakpoint); 156 ReturnException(pc, InstructionBreakpoint);
156 return; 157 return;
157 } 158 }
158 159
@@ -164,7 +165,7 @@ public:
164 165
165 void CallSVC(u32 swi) override { 166 void CallSVC(u32 swi) override {
166 parent.svc_swi = swi; 167 parent.svc_swi = swi;
167 parent.jit.load()->HaltExecution(ARM_Interface::svc_call); 168 parent.jit.load()->HaltExecution(SupervisorCall);
168 } 169 }
169 170
170 void AddTicks(u64 ticks) override { 171 void AddTicks(u64 ticks) override {
@@ -207,7 +208,7 @@ public:
207 if (!memory.IsValidVirtualAddressRange(addr, size)) { 208 if (!memory.IsValidVirtualAddressRange(addr, size)) {
208 LOG_CRITICAL(Core_ARM, "Stopping execution due to unmapped memory access at {:#x}", 209 LOG_CRITICAL(Core_ARM, "Stopping execution due to unmapped memory access at {:#x}",
209 addr); 210 addr);
210 parent.jit.load()->HaltExecution(ARM_Interface::no_execute); 211 parent.jit.load()->HaltExecution(PrefetchAbort);
211 return false; 212 return false;
212 } 213 }
213 214
@@ -218,7 +219,7 @@ public:
218 const auto match{parent.MatchingWatchpoint(addr, size, type)}; 219 const auto match{parent.MatchingWatchpoint(addr, size, type)};
219 if (match) { 220 if (match) {
220 parent.halted_watchpoint = match; 221 parent.halted_watchpoint = match;
221 parent.jit.load()->HaltExecution(ARM_Interface::watchpoint); 222 parent.jit.load()->HaltExecution(DataAbort);
222 return false; 223 return false;
223 } 224 }
224 225
@@ -383,12 +384,12 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable*
383 return std::make_shared<Dynarmic::A64::Jit>(config); 384 return std::make_shared<Dynarmic::A64::Jit>(config);
384} 385}
385 386
386Dynarmic::HaltReason ARM_Dynarmic_64::RunJit() { 387HaltReason ARM_Dynarmic_64::RunJit() {
387 return jit.load()->Run(); 388 return TranslateHaltReason(jit.load()->Run());
388} 389}
389 390
390Dynarmic::HaltReason ARM_Dynarmic_64::StepJit() { 391HaltReason ARM_Dynarmic_64::StepJit() {
391 return jit.load()->Step(); 392 return TranslateHaltReason(jit.load()->Step());
392} 393}
393 394
394u32 ARM_Dynarmic_64::GetSvcNumber() const { 395u32 ARM_Dynarmic_64::GetSvcNumber() const {
@@ -464,7 +465,7 @@ void ARM_Dynarmic_64::SetTPIDR_EL0(u64 value) {
464 cb->tpidr_el0 = value; 465 cb->tpidr_el0 = value;
465} 466}
466 467
467void ARM_Dynarmic_64::SaveContext(ThreadContext64& ctx) { 468void ARM_Dynarmic_64::SaveContext(ThreadContext64& ctx) const {
468 Dynarmic::A64::Jit* j = jit.load(); 469 Dynarmic::A64::Jit* j = jit.load();
469 ctx.cpu_registers = j->GetRegisters(); 470 ctx.cpu_registers = j->GetRegisters();
470 ctx.sp = j->GetSP(); 471 ctx.sp = j->GetSP();
@@ -489,11 +490,11 @@ void ARM_Dynarmic_64::LoadContext(const ThreadContext64& ctx) {
489} 490}
490 491
491void ARM_Dynarmic_64::SignalInterrupt() { 492void ARM_Dynarmic_64::SignalInterrupt() {
492 jit.load()->HaltExecution(break_loop); 493 jit.load()->HaltExecution(BreakLoop);
493} 494}
494 495
495void ARM_Dynarmic_64::ClearInterrupt() { 496void ARM_Dynarmic_64::ClearInterrupt() {
496 jit.load()->ClearHalt(break_loop); 497 jit.load()->ClearHalt(BreakLoop);
497} 498}
498 499
499void ARM_Dynarmic_64::ClearInstructionCache() { 500void ARM_Dynarmic_64::ClearInstructionCache() {
@@ -526,39 +527,4 @@ void ARM_Dynarmic_64::PageTableChanged(Common::PageTable& page_table,
526 jit_cache.emplace(key, std::move(new_jit)); 527 jit_cache.emplace(key, std::move(new_jit));
527} 528}
528 529
529std::vector<ARM_Interface::BacktraceEntry> ARM_Dynarmic_64::GetBacktrace(Core::System& system,
530 u64 fp, u64 lr, u64 pc) {
531 std::vector<BacktraceEntry> out;
532 auto& memory = system.ApplicationMemory();
533
534 out.push_back({"", 0, pc, 0, ""});
535
536 // fp (= x29) points to the previous frame record.
537 // Frame records are two words long:
538 // fp+0 : pointer to previous frame record
539 // fp+8 : value of lr for frame
540 for (size_t i = 0; i < 256; i++) {
541 out.push_back({"", 0, lr, 0, ""});
542 if (!fp || (fp % 4 != 0) || !memory.IsValidVirtualAddressRange(fp, 16)) {
543 break;
544 }
545 lr = memory.Read64(fp + 8);
546 fp = memory.Read64(fp);
547 }
548
549 SymbolicateBacktrace(system, out);
550
551 return out;
552}
553
554std::vector<ARM_Interface::BacktraceEntry> ARM_Dynarmic_64::GetBacktraceFromContext(
555 System& system, const ThreadContext64& ctx) {
556 const auto& reg = ctx.cpu_registers;
557 return GetBacktrace(system, reg[29], reg[30], ctx.pc);
558}
559
560std::vector<ARM_Interface::BacktraceEntry> ARM_Dynarmic_64::GetBacktrace() const {
561 return GetBacktrace(system, GetReg(29), GetReg(30), GetPC());
562}
563
564} // namespace Core 530} // namespace Core
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.h b/src/core/arm/dynarmic/arm_dynarmic_64.h
index e83599e82..af2aa1f1c 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_64.h
+++ b/src/core/arm/dynarmic/arm_dynarmic_64.h
@@ -43,8 +43,11 @@ public:
43 void SetTPIDR_EL0(u64 value) override; 43 void SetTPIDR_EL0(u64 value) override;
44 u64 GetTPIDR_EL0() const override; 44 u64 GetTPIDR_EL0() const override;
45 45
46 void SaveContext(ThreadContext32& ctx) override {} 46 Architecture GetArchitecture() const override {
47 void SaveContext(ThreadContext64& ctx) override; 47 return Architecture::Aarch64;
48 }
49 void SaveContext(ThreadContext32& ctx) const override {}
50 void SaveContext(ThreadContext64& ctx) const override;
48 void LoadContext(const ThreadContext32& ctx) override {} 51 void LoadContext(const ThreadContext32& ctx) override {}
49 void LoadContext(const ThreadContext64& ctx) override; 52 void LoadContext(const ThreadContext64& ctx) override;
50 53
@@ -57,14 +60,9 @@ public:
57 void PageTableChanged(Common::PageTable& new_page_table, 60 void PageTableChanged(Common::PageTable& new_page_table,
58 std::size_t new_address_space_size_in_bits) override; 61 std::size_t new_address_space_size_in_bits) override;
59 62
60 static std::vector<BacktraceEntry> GetBacktraceFromContext(System& system,
61 const ThreadContext64& ctx);
62
63 std::vector<BacktraceEntry> GetBacktrace() const override;
64
65protected: 63protected:
66 Dynarmic::HaltReason RunJit() override; 64 HaltReason RunJit() override;
67 Dynarmic::HaltReason StepJit() override; 65 HaltReason StepJit() override;
68 u32 GetSvcNumber() const override; 66 u32 GetSvcNumber() const override;
69 const Kernel::DebugWatchpoint* HaltedWatchpoint() const override; 67 const Kernel::DebugWatchpoint* HaltedWatchpoint() const override;
70 void RewindBreakpointInstruction() override; 68 void RewindBreakpointInstruction() override;
@@ -73,8 +71,6 @@ private:
73 std::shared_ptr<Dynarmic::A64::Jit> MakeJit(Common::PageTable* page_table, 71 std::shared_ptr<Dynarmic::A64::Jit> MakeJit(Common::PageTable* page_table,
74 std::size_t address_space_bits) const; 72 std::size_t address_space_bits) const;
75 73
76 static std::vector<BacktraceEntry> GetBacktrace(Core::System& system, u64 fp, u64 lr, u64 pc);
77
78 using JitCacheKey = std::pair<Common::PageTable*, std::size_t>; 74 using JitCacheKey = std::pair<Common::PageTable*, std::size_t>;
79 using JitCacheType = 75 using JitCacheType =
80 std::unordered_map<JitCacheKey, std::shared_ptr<Dynarmic::A64::Jit>, Common::PairHash>; 76 std::unordered_map<JitCacheKey, std::shared_ptr<Dynarmic::A64::Jit>, Common::PairHash>;
diff --git a/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp b/src/core/arm/dynarmic/dynarmic_cp15.cpp
index 5a4eba3eb..92c548db0 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp
+++ b/src/core/arm/dynarmic/dynarmic_cp15.cpp
@@ -4,7 +4,7 @@
4#include <fmt/format.h> 4#include <fmt/format.h>
5#include "common/logging/log.h" 5#include "common/logging/log.h"
6#include "core/arm/dynarmic/arm_dynarmic_32.h" 6#include "core/arm/dynarmic/arm_dynarmic_32.h"
7#include "core/arm/dynarmic/arm_dynarmic_cp15.h" 7#include "core/arm/dynarmic/dynarmic_cp15.h"
8#include "core/core.h" 8#include "core/core.h"
9#include "core/core_timing.h" 9#include "core/core_timing.h"
10 10
diff --git a/src/core/arm/dynarmic/arm_dynarmic_cp15.h b/src/core/arm/dynarmic/dynarmic_cp15.h
index d90b3e568..d90b3e568 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_cp15.h
+++ b/src/core/arm/dynarmic/dynarmic_cp15.h
diff --git a/src/core/arm/dynarmic/arm_exclusive_monitor.cpp b/src/core/arm/dynarmic/dynarmic_exclusive_monitor.cpp
index fa0c48b25..b5c9c43c4 100644
--- a/src/core/arm/dynarmic/arm_exclusive_monitor.cpp
+++ b/src/core/arm/dynarmic/dynarmic_exclusive_monitor.cpp
@@ -1,7 +1,7 @@
1// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later 2// SPDX-License-Identifier: GPL-2.0-or-later
3 3
4#include "core/arm/dynarmic/arm_exclusive_monitor.h" 4#include "core/arm/dynarmic/dynarmic_exclusive_monitor.h"
5#include "core/memory.h" 5#include "core/memory.h"
6 6
7namespace Core { 7namespace Core {
diff --git a/src/core/arm/dynarmic/arm_exclusive_monitor.h b/src/core/arm/dynarmic/dynarmic_exclusive_monitor.h
index 57e6dd0d0..57e6dd0d0 100644
--- a/src/core/arm/dynarmic/arm_exclusive_monitor.h
+++ b/src/core/arm/dynarmic/dynarmic_exclusive_monitor.h
diff --git a/src/core/arm/exclusive_monitor.cpp b/src/core/arm/exclusive_monitor.cpp
index 20550faeb..6d9a862e1 100644
--- a/src/core/arm/exclusive_monitor.cpp
+++ b/src/core/arm/exclusive_monitor.cpp
@@ -2,7 +2,7 @@
2// SPDX-License-Identifier: GPL-2.0-or-later 2// SPDX-License-Identifier: GPL-2.0-or-later
3 3
4#if defined(ARCHITECTURE_x86_64) || defined(ARCHITECTURE_arm64) 4#if defined(ARCHITECTURE_x86_64) || defined(ARCHITECTURE_arm64)
5#include "core/arm/dynarmic/arm_exclusive_monitor.h" 5#include "core/arm/dynarmic/dynarmic_exclusive_monitor.h"
6#endif 6#endif
7#include "core/arm/exclusive_monitor.h" 7#include "core/arm/exclusive_monitor.h"
8#include "core/memory.h" 8#include "core/memory.h"
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 4406ae30e..b74fd0a58 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -54,10 +54,10 @@
54#include "video_core/renderer_base.h" 54#include "video_core/renderer_base.h"
55#include "video_core/video_core.h" 55#include "video_core/video_core.h"
56 56
57MICROPROFILE_DEFINE(ARM_Jit_Dynarmic_CPU0, "ARM JIT", "Dynarmic CPU 0", MP_RGB(255, 64, 64)); 57MICROPROFILE_DEFINE(ARM_CPU0, "ARM", "CPU 0", MP_RGB(255, 64, 64));
58MICROPROFILE_DEFINE(ARM_Jit_Dynarmic_CPU1, "ARM JIT", "Dynarmic CPU 1", MP_RGB(255, 64, 64)); 58MICROPROFILE_DEFINE(ARM_CPU1, "ARM", "CPU 1", MP_RGB(255, 64, 64));
59MICROPROFILE_DEFINE(ARM_Jit_Dynarmic_CPU2, "ARM JIT", "Dynarmic CPU 2", MP_RGB(255, 64, 64)); 59MICROPROFILE_DEFINE(ARM_CPU2, "ARM", "CPU 2", MP_RGB(255, 64, 64));
60MICROPROFILE_DEFINE(ARM_Jit_Dynarmic_CPU3, "ARM JIT", "Dynarmic CPU 3", MP_RGB(255, 64, 64)); 60MICROPROFILE_DEFINE(ARM_CPU3, "ARM", "CPU 3", MP_RGB(255, 64, 64));
61 61
62namespace Core { 62namespace Core {
63 63
@@ -216,6 +216,14 @@ struct System::Impl {
216 } 216 }
217 } 217 }
218 218
219 void SetNVDECActive(bool is_nvdec_active) {
220 nvdec_active = is_nvdec_active;
221 }
222
223 bool GetNVDECActive() {
224 return nvdec_active;
225 }
226
219 void InitializeDebugger(System& system, u16 port) { 227 void InitializeDebugger(System& system, u16 port) {
220 debugger = std::make_unique<Debugger>(system, port); 228 debugger = std::make_unique<Debugger>(system, port);
221 } 229 }
@@ -251,10 +259,10 @@ struct System::Impl {
251 is_powered_on = true; 259 is_powered_on = true;
252 exit_lock = false; 260 exit_lock = false;
253 261
254 microprofile_dynarmic[0] = MICROPROFILE_TOKEN(ARM_Jit_Dynarmic_CPU0); 262 microprofile_cpu[0] = MICROPROFILE_TOKEN(ARM_CPU0);
255 microprofile_dynarmic[1] = MICROPROFILE_TOKEN(ARM_Jit_Dynarmic_CPU1); 263 microprofile_cpu[1] = MICROPROFILE_TOKEN(ARM_CPU1);
256 microprofile_dynarmic[2] = MICROPROFILE_TOKEN(ARM_Jit_Dynarmic_CPU2); 264 microprofile_cpu[2] = MICROPROFILE_TOKEN(ARM_CPU2);
257 microprofile_dynarmic[3] = MICROPROFILE_TOKEN(ARM_Jit_Dynarmic_CPU3); 265 microprofile_cpu[3] = MICROPROFILE_TOKEN(ARM_CPU3);
258 266
259 LOG_DEBUG(Core, "Initialized OK"); 267 LOG_DEBUG(Core, "Initialized OK");
260 268
@@ -485,6 +493,8 @@ struct System::Impl {
485 std::atomic_bool is_powered_on{}; 493 std::atomic_bool is_powered_on{};
486 bool exit_lock = false; 494 bool exit_lock = false;
487 495
496 bool nvdec_active{};
497
488 Reporter reporter; 498 Reporter reporter;
489 std::unique_ptr<Memory::CheatEngine> cheat_engine; 499 std::unique_ptr<Memory::CheatEngine> cheat_engine;
490 std::unique_ptr<Tools::Freezer> memory_freezer; 500 std::unique_ptr<Tools::Freezer> memory_freezer;
@@ -529,7 +539,7 @@ struct System::Impl {
529 ExitCallback exit_callback; 539 ExitCallback exit_callback;
530 540
531 std::array<u64, Core::Hardware::NUM_CPU_CORES> dynarmic_ticks{}; 541 std::array<u64, Core::Hardware::NUM_CPU_CORES> dynarmic_ticks{};
532 std::array<MicroProfileToken, Core::Hardware::NUM_CPU_CORES> microprofile_dynarmic{}; 542 std::array<MicroProfileToken, Core::Hardware::NUM_CPU_CORES> microprofile_cpu{};
533}; 543};
534 544
535System::System() : impl{std::make_unique<Impl>(*this)} {} 545System::System() : impl{std::make_unique<Impl>(*this)} {}
@@ -594,6 +604,14 @@ void System::UnstallApplication() {
594 impl->UnstallApplication(); 604 impl->UnstallApplication();
595} 605}
596 606
607void System::SetNVDECActive(bool is_nvdec_active) {
608 impl->SetNVDECActive(is_nvdec_active);
609}
610
611bool System::GetNVDECActive() {
612 return impl->GetNVDECActive();
613}
614
597void System::InitializeDebugger() { 615void System::InitializeDebugger() {
598 impl->InitializeDebugger(*this, Settings::values.gdbstub_port.GetValue()); 616 impl->InitializeDebugger(*this, Settings::values.gdbstub_port.GetValue());
599} 617}
@@ -909,14 +927,14 @@ void System::RegisterHostThread() {
909 impl->kernel.RegisterHostThread(); 927 impl->kernel.RegisterHostThread();
910} 928}
911 929
912void System::EnterDynarmicProfile() { 930void System::EnterCPUProfile() {
913 std::size_t core = impl->kernel.GetCurrentHostThreadID(); 931 std::size_t core = impl->kernel.GetCurrentHostThreadID();
914 impl->dynarmic_ticks[core] = MicroProfileEnter(impl->microprofile_dynarmic[core]); 932 impl->dynarmic_ticks[core] = MicroProfileEnter(impl->microprofile_cpu[core]);
915} 933}
916 934
917void System::ExitDynarmicProfile() { 935void System::ExitCPUProfile() {
918 std::size_t core = impl->kernel.GetCurrentHostThreadID(); 936 std::size_t core = impl->kernel.GetCurrentHostThreadID();
919 MicroProfileLeave(impl->microprofile_dynarmic[core], impl->dynarmic_ticks[core]); 937 MicroProfileLeave(impl->microprofile_cpu[core], impl->dynarmic_ticks[core]);
920} 938}
921 939
922bool System::IsMulticore() const { 940bool System::IsMulticore() const {
diff --git a/src/core/core.h b/src/core/core.h
index 4f153154f..93afc9303 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -189,6 +189,9 @@ public:
189 std::unique_lock<std::mutex> StallApplication(); 189 std::unique_lock<std::mutex> StallApplication();
190 void UnstallApplication(); 190 void UnstallApplication();
191 191
192 void SetNVDECActive(bool is_nvdec_active);
193 [[nodiscard]] bool GetNVDECActive();
194
192 /** 195 /**
193 * Initialize the debugger. 196 * Initialize the debugger.
194 */ 197 */
@@ -409,11 +412,11 @@ public:
409 /// Register a host thread as an auxiliary thread. 412 /// Register a host thread as an auxiliary thread.
410 void RegisterHostThread(); 413 void RegisterHostThread();
411 414
412 /// Enter Dynarmic Microprofile 415 /// Enter CPU Microprofile
413 void EnterDynarmicProfile(); 416 void EnterCPUProfile();
414 417
415 /// Exit Dynarmic Microprofile 418 /// Exit CPU Microprofile
416 void ExitDynarmicProfile(); 419 void ExitCPUProfile();
417 420
418 /// Tells if system is running on multicore. 421 /// Tells if system is running on multicore.
419 [[nodiscard]] bool IsMulticore() const; 422 [[nodiscard]] bool IsMulticore() const;
diff --git a/src/core/file_sys/submission_package.h b/src/core/file_sys/submission_package.h
index 3226b884a..27f97c725 100644
--- a/src/core/file_sys/submission_package.h
+++ b/src/core/file_sys/submission_package.h
@@ -8,6 +8,7 @@
8#include <set> 8#include <set>
9#include <vector> 9#include <vector>
10#include "common/common_types.h" 10#include "common/common_types.h"
11#include "core/file_sys/nca_metadata.h"
11#include "core/file_sys/vfs.h" 12#include "core/file_sys/vfs.h"
12 13
13namespace Core::Crypto { 14namespace Core::Crypto {
diff --git a/src/core/file_sys/system_archive/time_zone_binary.cpp b/src/core/file_sys/system_archive/time_zone_binary.cpp
index 85383998d..7c17bbefa 100644
--- a/src/core/file_sys/system_archive/time_zone_binary.cpp
+++ b/src/core/file_sys/system_archive/time_zone_binary.cpp
@@ -1,7 +1,6 @@
1// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later 2// SPDX-License-Identifier: GPL-2.0-or-later
3 3
4#include <array>
5#include <vector> 4#include <vector>
6 5
7#include "common/swap.h" 6#include "common/swap.h"
@@ -9,656 +8,79 @@
9#include "core/file_sys/vfs_vector.h" 8#include "core/file_sys/vfs_vector.h"
10#include "core/hle/service/time/time_zone_types.h" 9#include "core/hle/service/time/time_zone_types.h"
11 10
12namespace FileSys::SystemArchive { 11#include "nx_tzdb.h"
13
14static constexpr std::array<u8, 9633> LOCATION_NAMES{
15 0x43, 0x45, 0x54, 0x0d, 0x0a, 0x43, 0x53, 0x54, 0x36, 0x43, 0x44, 0x54, 0x0d, 0x0a, 0x43, 0x75,
16 0x62, 0x61, 0x0d, 0x0a, 0x45, 0x45, 0x54, 0x0d, 0x0a, 0x45, 0x67, 0x79, 0x70, 0x74, 0x0d, 0x0a,
17 0x45, 0x69, 0x72, 0x65, 0x0d, 0x0a, 0x45, 0x53, 0x54, 0x0d, 0x0a, 0x45, 0x53, 0x54, 0x35, 0x45,
18 0x44, 0x54, 0x0d, 0x0a, 0x47, 0x42, 0x0d, 0x0a, 0x47, 0x42, 0x2d, 0x45, 0x69, 0x72, 0x65, 0x0d,
19 0x0a, 0x47, 0x4d, 0x54, 0x0d, 0x0a, 0x47, 0x4d, 0x54, 0x2b, 0x30, 0x0d, 0x0a, 0x47, 0x4d, 0x54,
20 0x2d, 0x30, 0x0d, 0x0a, 0x47, 0x4d, 0x54, 0x30, 0x0d, 0x0a, 0x47, 0x72, 0x65, 0x65, 0x6e, 0x77,
21 0x69, 0x63, 0x68, 0x0d, 0x0a, 0x48, 0x6f, 0x6e, 0x67, 0x6b, 0x6f, 0x6e, 0x67, 0x0d, 0x0a, 0x48,
22 0x53, 0x54, 0x0d, 0x0a, 0x49, 0x63, 0x65, 0x6c, 0x61, 0x6e, 0x64, 0x0d, 0x0a, 0x49, 0x72, 0x61,
23 0x6e, 0x0d, 0x0a, 0x49, 0x73, 0x72, 0x61, 0x65, 0x6c, 0x0d, 0x0a, 0x4a, 0x61, 0x6d, 0x61, 0x69,
24 0x63, 0x61, 0x0d, 0x0a, 0x4a, 0x61, 0x70, 0x61, 0x6e, 0x0d, 0x0a, 0x4b, 0x77, 0x61, 0x6a, 0x61,
25 0x6c, 0x65, 0x69, 0x6e, 0x0d, 0x0a, 0x4c, 0x69, 0x62, 0x79, 0x61, 0x0d, 0x0a, 0x4d, 0x45, 0x54,
26 0x0d, 0x0a, 0x4d, 0x53, 0x54, 0x0d, 0x0a, 0x4d, 0x53, 0x54, 0x37, 0x4d, 0x44, 0x54, 0x0d, 0x0a,
27 0x4e, 0x61, 0x76, 0x61, 0x6a, 0x6f, 0x0d, 0x0a, 0x4e, 0x5a, 0x0d, 0x0a, 0x4e, 0x5a, 0x2d, 0x43,
28 0x48, 0x41, 0x54, 0x0d, 0x0a, 0x50, 0x6f, 0x6c, 0x61, 0x6e, 0x64, 0x0d, 0x0a, 0x50, 0x6f, 0x72,
29 0x74, 0x75, 0x67, 0x61, 0x6c, 0x0d, 0x0a, 0x50, 0x52, 0x43, 0x0d, 0x0a, 0x50, 0x53, 0x54, 0x38,
30 0x50, 0x44, 0x54, 0x0d, 0x0a, 0x52, 0x4f, 0x43, 0x0d, 0x0a, 0x52, 0x4f, 0x4b, 0x0d, 0x0a, 0x53,
31 0x69, 0x6e, 0x67, 0x61, 0x70, 0x6f, 0x72, 0x65, 0x0d, 0x0a, 0x54, 0x75, 0x72, 0x6b, 0x65, 0x79,
32 0x0d, 0x0a, 0x55, 0x43, 0x54, 0x0d, 0x0a, 0x55, 0x6e, 0x69, 0x76, 0x65, 0x72, 0x73, 0x61, 0x6c,
33 0x0d, 0x0a, 0x55, 0x54, 0x43, 0x0d, 0x0a, 0x57, 0x2d, 0x53, 0x55, 0x0d, 0x0a, 0x57, 0x45, 0x54,
34 0x0d, 0x0a, 0x5a, 0x75, 0x6c, 0x75, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41,
35 0x62, 0x69, 0x64, 0x6a, 0x61, 0x6e, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41,
36 0x63, 0x63, 0x72, 0x61, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x64, 0x64,
37 0x69, 0x73, 0x5f, 0x41, 0x62, 0x61, 0x62, 0x61, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61,
38 0x2f, 0x41, 0x6c, 0x67, 0x69, 0x65, 0x72, 0x73, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61,
39 0x2f, 0x41, 0x73, 0x6d, 0x61, 0x72, 0x61, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f,
40 0x41, 0x73, 0x6d, 0x65, 0x72, 0x61, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42,
41 0x61, 0x6d, 0x61, 0x6b, 0x6f, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x61,
42 0x6e, 0x67, 0x75, 0x69, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x61, 0x6e,
43 0x6a, 0x75, 0x6c, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x69, 0x73, 0x73,
44 0x61, 0x75, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x6c, 0x61, 0x6e, 0x74,
45 0x79, 0x72, 0x65, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x72, 0x61, 0x7a,
46 0x7a, 0x61, 0x76, 0x69, 0x6c, 0x6c, 0x65, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f,
47 0x42, 0x75, 0x6a, 0x75, 0x6d, 0x62, 0x75, 0x72, 0x61, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63,
48 0x61, 0x2f, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f,
49 0x43, 0x61, 0x73, 0x61, 0x62, 0x6c, 0x61, 0x6e, 0x63, 0x61, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69,
50 0x63, 0x61, 0x2f, 0x43, 0x65, 0x75, 0x74, 0x61, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61,
51 0x2f, 0x43, 0x6f, 0x6e, 0x61, 0x6b, 0x72, 0x79, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61,
52 0x2f, 0x44, 0x61, 0x6b, 0x61, 0x72, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44,
53 0x61, 0x72, 0x5f, 0x65, 0x73, 0x5f, 0x53, 0x61, 0x6c, 0x61, 0x61, 0x6d, 0x0d, 0x0a, 0x41, 0x66,
54 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x6a, 0x69, 0x62, 0x6f, 0x75, 0x74, 0x69, 0x0d, 0x0a, 0x41,
55 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x6f, 0x75, 0x61, 0x6c, 0x61, 0x0d, 0x0a, 0x41, 0x66,
56 0x72, 0x69, 0x63, 0x61, 0x2f, 0x45, 0x6c, 0x5f, 0x41, 0x61, 0x69, 0x75, 0x6e, 0x0d, 0x0a, 0x41,
57 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x46, 0x72, 0x65, 0x65, 0x74, 0x6f, 0x77, 0x6e, 0x0d, 0x0a,
58 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x47, 0x61, 0x62, 0x6f, 0x72, 0x6f, 0x6e, 0x65, 0x0d,
59 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x48, 0x61, 0x72, 0x61, 0x72, 0x65, 0x0d, 0x0a,
60 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4a, 0x6f, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x73, 0x62,
61 0x75, 0x72, 0x67, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4a, 0x75, 0x62, 0x61,
62 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4b, 0x61, 0x6d, 0x70, 0x61, 0x6c, 0x61,
63 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4b, 0x68, 0x61, 0x72, 0x74, 0x6f, 0x75,
64 0x6d, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4b, 0x69, 0x67, 0x61, 0x6c, 0x69,
65 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4b, 0x69, 0x6e, 0x73, 0x68, 0x61, 0x73,
66 0x61, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x61, 0x67, 0x6f, 0x73, 0x0d,
67 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x69, 0x62, 0x72, 0x65, 0x76, 0x69, 0x6c,
68 0x6c, 0x65, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x6f, 0x6d, 0x65, 0x0d,
69 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x75, 0x61, 0x6e, 0x64, 0x61, 0x0d, 0x0a,
70 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x75, 0x62, 0x75, 0x6d, 0x62, 0x61, 0x73, 0x68,
71 0x69, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x75, 0x73, 0x61, 0x6b, 0x61,
72 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x6c, 0x61, 0x62, 0x6f, 0x0d,
73 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x70, 0x75, 0x74, 0x6f, 0x0d, 0x0a,
74 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x73, 0x65, 0x72, 0x75, 0x0d, 0x0a, 0x41,
75 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x62, 0x61, 0x62, 0x61, 0x6e, 0x65, 0x0d, 0x0a, 0x41,
76 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x6f, 0x67, 0x61, 0x64, 0x69, 0x73, 0x68, 0x75, 0x0d,
77 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x6f, 0x6e, 0x72, 0x6f, 0x76, 0x69, 0x61,
78 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x61, 0x69, 0x72, 0x6f, 0x62, 0x69,
79 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x64, 0x6a, 0x61, 0x6d, 0x65, 0x6e,
80 0x61, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x69, 0x61, 0x6d, 0x65, 0x79,
81 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x6f, 0x75, 0x61, 0x6b, 0x63, 0x68,
82 0x6f, 0x74, 0x74, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4f, 0x75, 0x61, 0x67,
83 0x61, 0x64, 0x6f, 0x75, 0x67, 0x6f, 0x75, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f,
84 0x50, 0x6f, 0x72, 0x74, 0x6f, 0x2d, 0x4e, 0x6f, 0x76, 0x6f, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69,
85 0x63, 0x61, 0x2f, 0x53, 0x61, 0x6f, 0x5f, 0x54, 0x6f, 0x6d, 0x65, 0x0d, 0x0a, 0x41, 0x66, 0x72,
86 0x69, 0x63, 0x61, 0x2f, 0x54, 0x69, 0x6d, 0x62, 0x75, 0x6b, 0x74, 0x75, 0x0d, 0x0a, 0x41, 0x66,
87 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x72, 0x69, 0x70, 0x6f, 0x6c, 0x69, 0x0d, 0x0a, 0x41, 0x66,
88 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x75, 0x6e, 0x69, 0x73, 0x0d, 0x0a, 0x41, 0x66, 0x72, 0x69,
89 0x63, 0x61, 0x2f, 0x57, 0x69, 0x6e, 0x64, 0x68, 0x6f, 0x65, 0x6b, 0x0d, 0x0a, 0x41, 0x6d, 0x65,
90 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x64, 0x61, 0x6b, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69,
91 0x63, 0x61, 0x2f, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x0d, 0x0a, 0x41, 0x6d,
92 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x6e, 0x67, 0x75, 0x69, 0x6c, 0x6c, 0x61, 0x0d, 0x0a,
93 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x6e, 0x74, 0x69, 0x67, 0x75, 0x61, 0x0d,
94 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x61, 0x67, 0x75, 0x61, 0x69,
95 0x6e, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x75, 0x62,
96 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x73, 0x75, 0x6e, 0x63,
97 0x69, 0x6f, 0x6e, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x74, 0x69,
98 0x6b, 0x6f, 0x6b, 0x61, 0x6e, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41,
99 0x74, 0x6b, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x61, 0x68,
100 0x69, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x61, 0x68, 0x69,
101 0x61, 0x5f, 0x42, 0x61, 0x6e, 0x64, 0x65, 0x72, 0x61, 0x73, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72,
102 0x69, 0x63, 0x61, 0x2f, 0x42, 0x61, 0x72, 0x62, 0x61, 0x64, 0x6f, 0x73, 0x0d, 0x0a, 0x41, 0x6d,
103 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x65, 0x6c, 0x65, 0x6d, 0x0d, 0x0a, 0x41, 0x6d, 0x65,
104 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x65, 0x6c, 0x69, 0x7a, 0x65, 0x0d, 0x0a, 0x41, 0x6d, 0x65,
105 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x6c, 0x61, 0x6e, 0x63, 0x2d, 0x53, 0x61, 0x62, 0x6c, 0x6f,
106 0x6e, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x6f, 0x61, 0x5f, 0x56,
107 0x69, 0x73, 0x74, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x6f,
108 0x67, 0x6f, 0x74, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x6f,
109 0x69, 0x73, 0x65, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x75, 0x65,
110 0x6e, 0x6f, 0x73, 0x5f, 0x41, 0x69, 0x72, 0x65, 0x73, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69,
111 0x63, 0x61, 0x2f, 0x43, 0x61, 0x6d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x42, 0x61, 0x79,
112 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x61, 0x6d, 0x70, 0x6f, 0x5f,
113 0x47, 0x72, 0x61, 0x6e, 0x64, 0x65, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
114 0x43, 0x61, 0x6e, 0x63, 0x75, 0x6e, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
115 0x43, 0x61, 0x72, 0x61, 0x63, 0x61, 0x73, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
116 0x2f, 0x43, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x72, 0x63, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72,
117 0x69, 0x63, 0x61, 0x2f, 0x43, 0x61, 0x79, 0x65, 0x6e, 0x6e, 0x65, 0x0d, 0x0a, 0x41, 0x6d, 0x65,
118 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x61, 0x79, 0x6d, 0x61, 0x6e, 0x0d, 0x0a, 0x41, 0x6d, 0x65,
119 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x68, 0x69, 0x63, 0x61, 0x67, 0x6f, 0x0d, 0x0a, 0x41, 0x6d,
120 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x68, 0x69, 0x68, 0x75, 0x61, 0x68, 0x75, 0x61, 0x0d,
121 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x6f, 0x72, 0x61, 0x6c, 0x5f, 0x48,
122 0x61, 0x72, 0x62, 0x6f, 0x75, 0x72, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
123 0x43, 0x6f, 0x72, 0x64, 0x6f, 0x62, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
124 0x2f, 0x43, 0x6f, 0x73, 0x74, 0x61, 0x5f, 0x52, 0x69, 0x63, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65,
125 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x0d, 0x0a, 0x41, 0x6d,
126 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x75, 0x69, 0x61, 0x62, 0x61, 0x0d, 0x0a, 0x41, 0x6d,
127 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x75, 0x72, 0x61, 0x63, 0x61, 0x6f, 0x0d, 0x0a, 0x41,
128 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x61, 0x6e, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x68,
129 0x61, 0x76, 0x6e, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x61, 0x77,
130 0x73, 0x6f, 0x6e, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x61, 0x77,
131 0x73, 0x6f, 0x6e, 0x5f, 0x43, 0x72, 0x65, 0x65, 0x6b, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69,
132 0x63, 0x61, 0x2f, 0x44, 0x65, 0x6e, 0x76, 0x65, 0x72, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69,
133 0x63, 0x61, 0x2f, 0x44, 0x65, 0x74, 0x72, 0x6f, 0x69, 0x74, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72,
134 0x69, 0x63, 0x61, 0x2f, 0x44, 0x6f, 0x6d, 0x69, 0x6e, 0x69, 0x63, 0x61, 0x0d, 0x0a, 0x41, 0x6d,
135 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x45, 0x64, 0x6d, 0x6f, 0x6e, 0x74, 0x6f, 0x6e, 0x0d, 0x0a,
136 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x45, 0x69, 0x72, 0x75, 0x6e, 0x65, 0x70, 0x65,
137 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x45, 0x6c, 0x5f, 0x53, 0x61, 0x6c,
138 0x76, 0x61, 0x64, 0x6f, 0x72, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x45,
139 0x6e, 0x73, 0x65, 0x6e, 0x61, 0x64, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
140 0x2f, 0x46, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x65, 0x7a, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72,
141 0x69, 0x63, 0x61, 0x2f, 0x46, 0x6f, 0x72, 0x74, 0x5f, 0x4e, 0x65, 0x6c, 0x73, 0x6f, 0x6e, 0x0d,
142 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x46, 0x6f, 0x72, 0x74, 0x5f, 0x57, 0x61,
143 0x79, 0x6e, 0x65, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x47, 0x6c, 0x61,
144 0x63, 0x65, 0x5f, 0x42, 0x61, 0x79, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
145 0x47, 0x6f, 0x64, 0x74, 0x68, 0x61, 0x62, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
146 0x2f, 0x47, 0x6f, 0x6f, 0x73, 0x65, 0x5f, 0x42, 0x61, 0x79, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72,
147 0x69, 0x63, 0x61, 0x2f, 0x47, 0x72, 0x61, 0x6e, 0x64, 0x5f, 0x54, 0x75, 0x72, 0x6b, 0x0d, 0x0a,
148 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x47, 0x72, 0x65, 0x6e, 0x61, 0x64, 0x61, 0x0d,
149 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x47, 0x75, 0x61, 0x64, 0x65, 0x6c, 0x6f,
150 0x75, 0x70, 0x65, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x47, 0x75, 0x61,
151 0x74, 0x65, 0x6d, 0x61, 0x6c, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
152 0x47, 0x75, 0x61, 0x79, 0x61, 0x71, 0x75, 0x69, 0x6c, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69,
153 0x63, 0x61, 0x2f, 0x47, 0x75, 0x79, 0x61, 0x6e, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69,
154 0x63, 0x61, 0x2f, 0x48, 0x61, 0x6c, 0x69, 0x66, 0x61, 0x78, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72,
155 0x69, 0x63, 0x61, 0x2f, 0x48, 0x61, 0x76, 0x61, 0x6e, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72,
156 0x69, 0x63, 0x61, 0x2f, 0x48, 0x65, 0x72, 0x6d, 0x6f, 0x73, 0x69, 0x6c, 0x6c, 0x6f, 0x0d, 0x0a,
157 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x70,
158 0x6f, 0x6c, 0x69, 0x73, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e,
159 0x75, 0x76, 0x69, 0x6b, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x71,
160 0x61, 0x6c, 0x75, 0x69, 0x74, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4a,
161 0x61, 0x6d, 0x61, 0x69, 0x63, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
162 0x4a, 0x75, 0x6a, 0x75, 0x79, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4a,
163 0x75, 0x6e, 0x65, 0x61, 0x75, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4b,
164 0x6e, 0x6f, 0x78, 0x5f, 0x49, 0x4e, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
165 0x4b, 0x72, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6a, 0x6b, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72,
166 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x61, 0x5f, 0x50, 0x61, 0x7a, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72,
167 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x69, 0x6d, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
168 0x61, 0x2f, 0x4c, 0x6f, 0x73, 0x5f, 0x41, 0x6e, 0x67, 0x65, 0x6c, 0x65, 0x73, 0x0d, 0x0a, 0x41,
169 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x6f, 0x75, 0x69, 0x73, 0x76, 0x69, 0x6c, 0x6c,
170 0x65, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x6f, 0x77, 0x65, 0x72,
171 0x5f, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x65, 0x73, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
172 0x61, 0x2f, 0x4d, 0x61, 0x63, 0x65, 0x69, 0x6f, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
173 0x61, 0x2f, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x75, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69,
174 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x6e, 0x61, 0x75, 0x73, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69,
175 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x72, 0x69, 0x67, 0x6f, 0x74, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72,
176 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x0d, 0x0a,
177 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x74, 0x61, 0x6d, 0x6f, 0x72, 0x6f,
178 0x73, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x7a, 0x61, 0x74,
179 0x6c, 0x61, 0x6e, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x65, 0x6e,
180 0x64, 0x6f, 0x7a, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x65,
181 0x6e, 0x6f, 0x6d, 0x69, 0x6e, 0x65, 0x65, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
182 0x2f, 0x4d, 0x65, 0x72, 0x69, 0x64, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
183 0x2f, 0x4d, 0x65, 0x74, 0x6c, 0x61, 0x6b, 0x61, 0x74, 0x6c, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65,
184 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x5f, 0x43, 0x69, 0x74, 0x79,
185 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x69, 0x71, 0x75, 0x65, 0x6c,
186 0x6f, 0x6e, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x6f, 0x6e, 0x63,
187 0x74, 0x6f, 0x6e, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x6f, 0x6e,
188 0x74, 0x65, 0x72, 0x72, 0x65, 0x79, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
189 0x4d, 0x6f, 0x6e, 0x74, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72,
190 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x6f, 0x6e, 0x74, 0x72, 0x65, 0x61, 0x6c, 0x0d, 0x0a, 0x41, 0x6d,
191 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x6f, 0x6e, 0x74, 0x73, 0x65, 0x72, 0x72, 0x61, 0x74,
192 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x61, 0x73, 0x73, 0x61, 0x75,
193 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x65, 0x77, 0x5f, 0x59, 0x6f,
194 0x72, 0x6b, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x69, 0x70, 0x69,
195 0x67, 0x6f, 0x6e, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x6f, 0x6d,
196 0x65, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x6f, 0x72, 0x6f, 0x6e,
197 0x68, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4f, 0x6a, 0x69, 0x6e,
198 0x61, 0x67, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x61, 0x6e,
199 0x61, 0x6d, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x61, 0x6e,
200 0x67, 0x6e, 0x69, 0x72, 0x74, 0x75, 0x6e, 0x67, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
201 0x61, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x61, 0x72, 0x69, 0x62, 0x6f, 0x0d, 0x0a, 0x41, 0x6d,
202 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x68, 0x6f, 0x65, 0x6e, 0x69, 0x78, 0x0d, 0x0a, 0x41,
203 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x6f, 0x72, 0x74, 0x2d, 0x61, 0x75, 0x2d, 0x50,
204 0x72, 0x69, 0x6e, 0x63, 0x65, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50,
205 0x6f, 0x72, 0x74, 0x6f, 0x5f, 0x41, 0x63, 0x72, 0x65, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69,
206 0x63, 0x61, 0x2f, 0x50, 0x6f, 0x72, 0x74, 0x6f, 0x5f, 0x56, 0x65, 0x6c, 0x68, 0x6f, 0x0d, 0x0a,
207 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x6f, 0x72, 0x74, 0x5f, 0x6f, 0x66, 0x5f,
208 0x53, 0x70, 0x61, 0x69, 0x6e, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50,
209 0x75, 0x65, 0x72, 0x74, 0x6f, 0x5f, 0x52, 0x69, 0x63, 0x6f, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72,
210 0x69, 0x63, 0x61, 0x2f, 0x50, 0x75, 0x6e, 0x74, 0x61, 0x5f, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x73,
211 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x52, 0x61, 0x69, 0x6e, 0x79, 0x5f,
212 0x52, 0x69, 0x76, 0x65, 0x72, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x52,
213 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x5f, 0x49, 0x6e, 0x6c, 0x65, 0x74, 0x0d, 0x0a, 0x41, 0x6d, 0x65,
214 0x72, 0x69, 0x63, 0x61, 0x2f, 0x52, 0x65, 0x63, 0x69, 0x66, 0x65, 0x0d, 0x0a, 0x41, 0x6d, 0x65,
215 0x72, 0x69, 0x63, 0x61, 0x2f, 0x52, 0x65, 0x67, 0x69, 0x6e, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65,
216 0x72, 0x69, 0x63, 0x61, 0x2f, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x0d, 0x0a, 0x41,
217 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x52, 0x69, 0x6f, 0x5f, 0x42, 0x72, 0x61, 0x6e, 0x63,
218 0x6f, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x52, 0x6f, 0x73, 0x61, 0x72,
219 0x69, 0x6f, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x61, 0x6e, 0x74,
220 0x61, 0x72, 0x65, 0x6d, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x61,
221 0x6e, 0x74, 0x61, 0x5f, 0x49, 0x73, 0x61, 0x62, 0x65, 0x6c, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72,
222 0x69, 0x63, 0x61, 0x2f, 0x53, 0x61, 0x6e, 0x74, 0x69, 0x61, 0x67, 0x6f, 0x0d, 0x0a, 0x41, 0x6d,
223 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x61, 0x6e, 0x74, 0x6f, 0x5f, 0x44, 0x6f, 0x6d, 0x69,
224 0x6e, 0x67, 0x6f, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x61, 0x6f,
225 0x5f, 0x50, 0x61, 0x75, 0x6c, 0x6f, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
226 0x53, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x62, 0x79, 0x73, 0x75, 0x6e, 0x64, 0x0d, 0x0a, 0x41, 0x6d,
227 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x68, 0x69, 0x70, 0x72, 0x6f, 0x63, 0x6b, 0x0d, 0x0a,
228 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x69, 0x74, 0x6b, 0x61, 0x0d, 0x0a, 0x41,
229 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x74, 0x5f, 0x42, 0x61, 0x72, 0x74, 0x68, 0x65,
230 0x6c, 0x65, 0x6d, 0x79, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x74,
231 0x5f, 0x4a, 0x6f, 0x68, 0x6e, 0x73, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
232 0x53, 0x74, 0x5f, 0x4b, 0x69, 0x74, 0x74, 0x73, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
233 0x61, 0x2f, 0x53, 0x74, 0x5f, 0x4c, 0x75, 0x63, 0x69, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72,
234 0x69, 0x63, 0x61, 0x2f, 0x53, 0x74, 0x5f, 0x54, 0x68, 0x6f, 0x6d, 0x61, 0x73, 0x0d, 0x0a, 0x41,
235 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x74, 0x5f, 0x56, 0x69, 0x6e, 0x63, 0x65, 0x6e,
236 0x74, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x77, 0x69, 0x66, 0x74,
237 0x5f, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
238 0x61, 0x2f, 0x54, 0x65, 0x67, 0x75, 0x63, 0x69, 0x67, 0x61, 0x6c, 0x70, 0x61, 0x0d, 0x0a, 0x41,
239 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x68, 0x75, 0x6c, 0x65, 0x0d, 0x0a, 0x41, 0x6d,
240 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x68, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x42, 0x61,
241 0x79, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x69, 0x6a, 0x75, 0x61,
242 0x6e, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x6f, 0x72, 0x6f,
243 0x6e, 0x74, 0x6f, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x6f, 0x72,
244 0x74, 0x6f, 0x6c, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x56, 0x61,
245 0x6e, 0x63, 0x6f, 0x75, 0x76, 0x65, 0x72, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
246 0x2f, 0x56, 0x69, 0x72, 0x67, 0x69, 0x6e, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
247 0x2f, 0x57, 0x68, 0x69, 0x74, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x0d, 0x0a, 0x41, 0x6d, 0x65,
248 0x72, 0x69, 0x63, 0x61, 0x2f, 0x57, 0x69, 0x6e, 0x6e, 0x69, 0x70, 0x65, 0x67, 0x0d, 0x0a, 0x41,
249 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x59, 0x61, 0x6b, 0x75, 0x74, 0x61, 0x74, 0x0d, 0x0a,
250 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x59, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6b, 0x6e,
251 0x69, 0x66, 0x65, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67,
252 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f, 0x42, 0x75, 0x65, 0x6e, 0x6f, 0x73, 0x5f, 0x41, 0x69,
253 0x72, 0x65, 0x73, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67,
254 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f, 0x43, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x72, 0x63, 0x61,
255 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74,
256 0x69, 0x6e, 0x61, 0x2f, 0x43, 0x6f, 0x6d, 0x6f, 0x64, 0x52, 0x69, 0x76, 0x61, 0x64, 0x61, 0x76,
257 0x69, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65,
258 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f, 0x43, 0x6f, 0x72, 0x64, 0x6f, 0x62, 0x61, 0x0d, 0x0a, 0x41,
259 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61,
260 0x2f, 0x4a, 0x75, 0x6a, 0x75, 0x79, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
261 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f, 0x4c, 0x61, 0x5f, 0x52, 0x69, 0x6f,
262 0x6a, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65,
263 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f, 0x4d, 0x65, 0x6e, 0x64, 0x6f, 0x7a, 0x61, 0x0d, 0x0a, 0x41,
264 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61,
265 0x2f, 0x52, 0x69, 0x6f, 0x5f, 0x47, 0x61, 0x6c, 0x6c, 0x65, 0x67, 0x6f, 0x73, 0x0d, 0x0a, 0x41,
266 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61,
267 0x2f, 0x53, 0x61, 0x6c, 0x74, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
268 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f, 0x53, 0x61, 0x6e, 0x5f, 0x4a, 0x75,
269 0x61, 0x6e, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65,
270 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f, 0x53, 0x61, 0x6e, 0x5f, 0x4c, 0x75, 0x69, 0x73, 0x0d, 0x0a,
271 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e,
272 0x61, 0x2f, 0x54, 0x75, 0x63, 0x75, 0x6d, 0x61, 0x6e, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69,
273 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f, 0x55, 0x73, 0x68,
274 0x75, 0x61, 0x69, 0x61, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e,
275 0x64, 0x69, 0x61, 0x6e, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x70, 0x6f, 0x6c,
276 0x69, 0x73, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69,
277 0x61, 0x6e, 0x61, 0x2f, 0x4b, 0x6e, 0x6f, 0x78, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
278 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x2f, 0x4d, 0x61, 0x72, 0x65, 0x6e, 0x67,
279 0x6f, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61,
280 0x6e, 0x61, 0x2f, 0x50, 0x65, 0x74, 0x65, 0x72, 0x73, 0x62, 0x75, 0x72, 0x67, 0x0d, 0x0a, 0x41,
281 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x2f, 0x54,
282 0x65, 0x6c, 0x6c, 0x5f, 0x43, 0x69, 0x74, 0x79, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
283 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x2f, 0x56, 0x65, 0x76, 0x61, 0x79, 0x0d,
284 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61,
285 0x2f, 0x56, 0x69, 0x6e, 0x63, 0x65, 0x6e, 0x6e, 0x65, 0x73, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72,
286 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x2f, 0x57, 0x69, 0x6e, 0x61,
287 0x6d, 0x61, 0x63, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4b, 0x65, 0x6e,
288 0x74, 0x75, 0x63, 0x6b, 0x79, 0x2f, 0x4c, 0x6f, 0x75, 0x69, 0x73, 0x76, 0x69, 0x6c, 0x6c, 0x65,
289 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4b, 0x65, 0x6e, 0x74, 0x75, 0x63,
290 0x6b, 0x79, 0x2f, 0x4d, 0x6f, 0x6e, 0x74, 0x69, 0x63, 0x65, 0x6c, 0x6c, 0x6f, 0x0d, 0x0a, 0x41,
291 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x5f, 0x44, 0x61, 0x6b,
292 0x6f, 0x74, 0x61, 0x2f, 0x42, 0x65, 0x75, 0x6c, 0x61, 0x68, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72,
293 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x5f, 0x44, 0x61, 0x6b, 0x6f, 0x74, 0x61,
294 0x2f, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x0d, 0x0a, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
295 0x2f, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x5f, 0x44, 0x61, 0x6b, 0x6f, 0x74, 0x61, 0x2f, 0x4e, 0x65,
296 0x77, 0x5f, 0x53, 0x61, 0x6c, 0x65, 0x6d, 0x0d, 0x0a, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74,
297 0x69, 0x63, 0x61, 0x2f, 0x43, 0x61, 0x73, 0x65, 0x79, 0x0d, 0x0a, 0x41, 0x6e, 0x74, 0x61, 0x72,
298 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x61, 0x76, 0x69, 0x73, 0x0d, 0x0a, 0x41, 0x6e, 0x74,
299 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x75, 0x6d, 0x6f, 0x6e, 0x74, 0x44, 0x55,
300 0x72, 0x76, 0x69, 0x6c, 0x6c, 0x65, 0x0d, 0x0a, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69,
301 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x63, 0x71, 0x75, 0x61, 0x72, 0x69, 0x65, 0x0d, 0x0a, 0x41, 0x6e,
302 0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x77, 0x73, 0x6f, 0x6e, 0x0d,
303 0x0a, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x63, 0x4d, 0x75,
304 0x72, 0x64, 0x6f, 0x0d, 0x0a, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f,
305 0x50, 0x61, 0x6c, 0x6d, 0x65, 0x72, 0x0d, 0x0a, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69,
306 0x63, 0x61, 0x2f, 0x52, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x61, 0x0d, 0x0a, 0x41, 0x6e, 0x74, 0x61,
307 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x50, 0x6f, 0x6c,
308 0x65, 0x0d, 0x0a, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x79,
309 0x6f, 0x77, 0x61, 0x0d, 0x0a, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f,
310 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x0d, 0x0a, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63,
311 0x61, 0x2f, 0x56, 0x6f, 0x73, 0x74, 0x6f, 0x6b, 0x0d, 0x0a, 0x41, 0x72, 0x63, 0x74, 0x69, 0x63,
312 0x2f, 0x4c, 0x6f, 0x6e, 0x67, 0x79, 0x65, 0x61, 0x72, 0x62, 0x79, 0x65, 0x6e, 0x0d, 0x0a, 0x41,
313 0x73, 0x69, 0x61, 0x2f, 0x41, 0x64, 0x65, 0x6e, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41,
314 0x6c, 0x6d, 0x61, 0x74, 0x79, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x6d, 0x6d, 0x61,
315 0x6e, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x6e, 0x61, 0x64, 0x79, 0x72, 0x0d, 0x0a,
316 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x71, 0x74, 0x61, 0x75, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61,
317 0x2f, 0x41, 0x71, 0x74, 0x6f, 0x62, 0x65, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x73,
318 0x68, 0x67, 0x61, 0x62, 0x61, 0x74, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x73, 0x68,
319 0x6b, 0x68, 0x61, 0x62, 0x61, 0x64, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x74, 0x79,
320 0x72, 0x61, 0x75, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x42, 0x61, 0x67, 0x68, 0x64, 0x61,
321 0x64, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x42, 0x61, 0x68, 0x72, 0x61, 0x69, 0x6e, 0x0d,
322 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x42, 0x61, 0x6b, 0x75, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61,
323 0x2f, 0x42, 0x61, 0x6e, 0x67, 0x6b, 0x6f, 0x6b, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x42,
324 0x61, 0x72, 0x6e, 0x61, 0x75, 0x6c, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x42, 0x65, 0x69,
325 0x72, 0x75, 0x74, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x42, 0x69, 0x73, 0x68, 0x6b, 0x65,
326 0x6b, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x42, 0x72, 0x75, 0x6e, 0x65, 0x69, 0x0d, 0x0a,
327 0x41, 0x73, 0x69, 0x61, 0x2f, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x74, 0x74, 0x61, 0x0d, 0x0a, 0x41,
328 0x73, 0x69, 0x61, 0x2f, 0x43, 0x68, 0x69, 0x74, 0x61, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f,
329 0x43, 0x68, 0x6f, 0x69, 0x62, 0x61, 0x6c, 0x73, 0x61, 0x6e, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61,
330 0x2f, 0x43, 0x68, 0x6f, 0x6e, 0x67, 0x71, 0x69, 0x6e, 0x67, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61,
331 0x2f, 0x43, 0x68, 0x75, 0x6e, 0x67, 0x6b, 0x69, 0x6e, 0x67, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61,
332 0x2f, 0x43, 0x6f, 0x6c, 0x6f, 0x6d, 0x62, 0x6f, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x44,
333 0x61, 0x63, 0x63, 0x61, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x44, 0x61, 0x6d, 0x61, 0x73,
334 0x63, 0x75, 0x73, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x44, 0x68, 0x61, 0x6b, 0x61, 0x0d,
335 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x44, 0x69, 0x6c, 0x69, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61,
336 0x2f, 0x44, 0x75, 0x62, 0x61, 0x69, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x44, 0x75, 0x73,
337 0x68, 0x61, 0x6e, 0x62, 0x65, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x46, 0x61, 0x6d, 0x61,
338 0x67, 0x75, 0x73, 0x74, 0x61, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x47, 0x61, 0x7a, 0x61,
339 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x48, 0x61, 0x72, 0x62, 0x69, 0x6e, 0x0d, 0x0a, 0x41,
340 0x73, 0x69, 0x61, 0x2f, 0x48, 0x65, 0x62, 0x72, 0x6f, 0x6e, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61,
341 0x2f, 0x48, 0x6f, 0x6e, 0x67, 0x5f, 0x4b, 0x6f, 0x6e, 0x67, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61,
342 0x2f, 0x48, 0x6f, 0x76, 0x64, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x48, 0x6f, 0x5f, 0x43,
343 0x68, 0x69, 0x5f, 0x4d, 0x69, 0x6e, 0x68, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x49, 0x72,
344 0x6b, 0x75, 0x74, 0x73, 0x6b, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x49, 0x73, 0x74, 0x61,
345 0x6e, 0x62, 0x75, 0x6c, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4a, 0x61, 0x6b, 0x61, 0x72,
346 0x74, 0x61, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4a, 0x61, 0x79, 0x61, 0x70, 0x75, 0x72,
347 0x61, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4a, 0x65, 0x72, 0x75, 0x73, 0x61, 0x6c, 0x65,
348 0x6d, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x61, 0x62, 0x75, 0x6c, 0x0d, 0x0a, 0x41,
349 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x61, 0x6d, 0x63, 0x68, 0x61, 0x74, 0x6b, 0x61, 0x0d, 0x0a, 0x41,
350 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x61, 0x72, 0x61, 0x63, 0x68, 0x69, 0x0d, 0x0a, 0x41, 0x73, 0x69,
351 0x61, 0x2f, 0x4b, 0x61, 0x73, 0x68, 0x67, 0x61, 0x72, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f,
352 0x4b, 0x61, 0x74, 0x68, 0x6d, 0x61, 0x6e, 0x64, 0x75, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f,
353 0x4b, 0x61, 0x74, 0x6d, 0x61, 0x6e, 0x64, 0x75, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b,
354 0x68, 0x61, 0x6e, 0x64, 0x79, 0x67, 0x61, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x6f,
355 0x6c, 0x6b, 0x61, 0x74, 0x61, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x72, 0x61, 0x73,
356 0x6e, 0x6f, 0x79, 0x61, 0x72, 0x73, 0x6b, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x75,
357 0x61, 0x6c, 0x61, 0x5f, 0x4c, 0x75, 0x6d, 0x70, 0x75, 0x72, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61,
358 0x2f, 0x4b, 0x75, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b,
359 0x75, 0x77, 0x61, 0x69, 0x74, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4d, 0x61, 0x63, 0x61,
360 0x6f, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4d, 0x61, 0x63, 0x61, 0x75, 0x0d, 0x0a, 0x41,
361 0x73, 0x69, 0x61, 0x2f, 0x4d, 0x61, 0x67, 0x61, 0x64, 0x61, 0x6e, 0x0d, 0x0a, 0x41, 0x73, 0x69,
362 0x61, 0x2f, 0x4d, 0x61, 0x6b, 0x61, 0x73, 0x73, 0x61, 0x72, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61,
363 0x2f, 0x4d, 0x61, 0x6e, 0x69, 0x6c, 0x61, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4d, 0x75,
364 0x73, 0x63, 0x61, 0x74, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4e, 0x69, 0x63, 0x6f, 0x73,
365 0x69, 0x61, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4e, 0x6f, 0x76, 0x6f, 0x6b, 0x75, 0x7a,
366 0x6e, 0x65, 0x74, 0x73, 0x6b, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4e, 0x6f, 0x76, 0x6f,
367 0x73, 0x69, 0x62, 0x69, 0x72, 0x73, 0x6b, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4f, 0x6d,
368 0x73, 0x6b, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4f, 0x72, 0x61, 0x6c, 0x0d, 0x0a, 0x41,
369 0x73, 0x69, 0x61, 0x2f, 0x50, 0x68, 0x6e, 0x6f, 0x6d, 0x5f, 0x50, 0x65, 0x6e, 0x68, 0x0d, 0x0a,
370 0x41, 0x73, 0x69, 0x61, 0x2f, 0x50, 0x6f, 0x6e, 0x74, 0x69, 0x61, 0x6e, 0x61, 0x6b, 0x0d, 0x0a,
371 0x41, 0x73, 0x69, 0x61, 0x2f, 0x50, 0x79, 0x6f, 0x6e, 0x67, 0x79, 0x61, 0x6e, 0x67, 0x0d, 0x0a,
372 0x41, 0x73, 0x69, 0x61, 0x2f, 0x51, 0x61, 0x74, 0x61, 0x72, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61,
373 0x2f, 0x51, 0x79, 0x7a, 0x79, 0x6c, 0x6f, 0x72, 0x64, 0x61, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61,
374 0x2f, 0x52, 0x61, 0x6e, 0x67, 0x6f, 0x6f, 0x6e, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x52,
375 0x69, 0x79, 0x61, 0x64, 0x68, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x53, 0x61, 0x69, 0x67,
376 0x6f, 0x6e, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x53, 0x61, 0x6b, 0x68, 0x61, 0x6c, 0x69,
377 0x6e, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x53, 0x61, 0x6d, 0x61, 0x72, 0x6b, 0x61, 0x6e,
378 0x64, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x53, 0x65, 0x6f, 0x75, 0x6c, 0x0d, 0x0a, 0x41,
379 0x73, 0x69, 0x61, 0x2f, 0x53, 0x68, 0x61, 0x6e, 0x67, 0x68, 0x61, 0x69, 0x0d, 0x0a, 0x41, 0x73,
380 0x69, 0x61, 0x2f, 0x53, 0x69, 0x6e, 0x67, 0x61, 0x70, 0x6f, 0x72, 0x65, 0x0d, 0x0a, 0x41, 0x73,
381 0x69, 0x61, 0x2f, 0x53, 0x72, 0x65, 0x64, 0x6e, 0x65, 0x6b, 0x6f, 0x6c, 0x79, 0x6d, 0x73, 0x6b,
382 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x54, 0x61, 0x69, 0x70, 0x65, 0x69, 0x0d, 0x0a, 0x41,
383 0x73, 0x69, 0x61, 0x2f, 0x54, 0x61, 0x73, 0x68, 0x6b, 0x65, 0x6e, 0x74, 0x0d, 0x0a, 0x41, 0x73,
384 0x69, 0x61, 0x2f, 0x54, 0x62, 0x69, 0x6c, 0x69, 0x73, 0x69, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61,
385 0x2f, 0x54, 0x65, 0x68, 0x72, 0x61, 0x6e, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x54, 0x65,
386 0x6c, 0x5f, 0x41, 0x76, 0x69, 0x76, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x54, 0x68, 0x69,
387 0x6d, 0x62, 0x75, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x54, 0x68, 0x69, 0x6d, 0x70, 0x68,
388 0x75, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x54, 0x6f, 0x6b, 0x79, 0x6f, 0x0d, 0x0a, 0x41,
389 0x73, 0x69, 0x61, 0x2f, 0x54, 0x6f, 0x6d, 0x73, 0x6b, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f,
390 0x55, 0x6a, 0x75, 0x6e, 0x67, 0x5f, 0x50, 0x61, 0x6e, 0x64, 0x61, 0x6e, 0x67, 0x0d, 0x0a, 0x41,
391 0x73, 0x69, 0x61, 0x2f, 0x55, 0x6c, 0x61, 0x61, 0x6e, 0x62, 0x61, 0x61, 0x74, 0x61, 0x72, 0x0d,
392 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x55, 0x6c, 0x61, 0x6e, 0x5f, 0x42, 0x61, 0x74, 0x6f, 0x72,
393 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x55, 0x72, 0x75, 0x6d, 0x71, 0x69, 0x0d, 0x0a, 0x41,
394 0x73, 0x69, 0x61, 0x2f, 0x55, 0x73, 0x74, 0x2d, 0x4e, 0x65, 0x72, 0x61, 0x0d, 0x0a, 0x41, 0x73,
395 0x69, 0x61, 0x2f, 0x56, 0x69, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6e, 0x65, 0x0d, 0x0a, 0x41, 0x73,
396 0x69, 0x61, 0x2f, 0x56, 0x6c, 0x61, 0x64, 0x69, 0x76, 0x6f, 0x73, 0x74, 0x6f, 0x6b, 0x0d, 0x0a,
397 0x41, 0x73, 0x69, 0x61, 0x2f, 0x59, 0x61, 0x6b, 0x75, 0x74, 0x73, 0x6b, 0x0d, 0x0a, 0x41, 0x73,
398 0x69, 0x61, 0x2f, 0x59, 0x61, 0x6e, 0x67, 0x6f, 0x6e, 0x0d, 0x0a, 0x41, 0x73, 0x69, 0x61, 0x2f,
399 0x59, 0x65, 0x6b, 0x61, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x62, 0x75, 0x72, 0x67, 0x0d, 0x0a, 0x41,
400 0x73, 0x69, 0x61, 0x2f, 0x59, 0x65, 0x72, 0x65, 0x76, 0x61, 0x6e, 0x0d, 0x0a, 0x41, 0x74, 0x6c,
401 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x41, 0x7a, 0x6f, 0x72, 0x65, 0x73, 0x0d, 0x0a, 0x41, 0x74,
402 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x42, 0x65, 0x72, 0x6d, 0x75, 0x64, 0x61, 0x0d, 0x0a,
403 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x43, 0x61, 0x6e, 0x61, 0x72, 0x79, 0x0d,
404 0x0a, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x43, 0x61, 0x70, 0x65, 0x5f, 0x56,
405 0x65, 0x72, 0x64, 0x65, 0x0d, 0x0a, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x46,
406 0x61, 0x65, 0x72, 0x6f, 0x65, 0x0d, 0x0a, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f,
407 0x46, 0x61, 0x72, 0x6f, 0x65, 0x0d, 0x0a, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f,
408 0x4a, 0x61, 0x6e, 0x5f, 0x4d, 0x61, 0x79, 0x65, 0x6e, 0x0d, 0x0a, 0x41, 0x74, 0x6c, 0x61, 0x6e,
409 0x74, 0x69, 0x63, 0x2f, 0x4d, 0x61, 0x64, 0x65, 0x69, 0x72, 0x61, 0x0d, 0x0a, 0x41, 0x74, 0x6c,
410 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x52, 0x65, 0x79, 0x6b, 0x6a, 0x61, 0x76, 0x69, 0x6b, 0x0d,
411 0x0a, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x5f,
412 0x47, 0x65, 0x6f, 0x72, 0x67, 0x69, 0x61, 0x0d, 0x0a, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69,
413 0x63, 0x2f, 0x53, 0x74, 0x61, 0x6e, 0x6c, 0x65, 0x79, 0x0d, 0x0a, 0x41, 0x74, 0x6c, 0x61, 0x6e,
414 0x74, 0x69, 0x63, 0x2f, 0x53, 0x74, 0x5f, 0x48, 0x65, 0x6c, 0x65, 0x6e, 0x61, 0x0d, 0x0a, 0x41,
415 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x41, 0x43, 0x54, 0x0d, 0x0a, 0x41, 0x75,
416 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x41, 0x64, 0x65, 0x6c, 0x61, 0x69, 0x64, 0x65,
417 0x0d, 0x0a, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x42, 0x72, 0x69, 0x73,
418 0x62, 0x61, 0x6e, 0x65, 0x0d, 0x0a, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f,
419 0x42, 0x72, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x48, 0x69, 0x6c, 0x6c, 0x0d, 0x0a, 0x41, 0x75, 0x73,
420 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x43, 0x61, 0x6e, 0x62, 0x65, 0x72, 0x72, 0x61, 0x0d,
421 0x0a, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x43, 0x75, 0x72, 0x72, 0x69,
422 0x65, 0x0d, 0x0a, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x44, 0x61, 0x72,
423 0x77, 0x69, 0x6e, 0x0d, 0x0a, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x45,
424 0x75, 0x63, 0x6c, 0x61, 0x0d, 0x0a, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f,
425 0x48, 0x6f, 0x62, 0x61, 0x72, 0x74, 0x0d, 0x0a, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69,
426 0x61, 0x2f, 0x4c, 0x48, 0x49, 0x0d, 0x0a, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61,
427 0x2f, 0x4c, 0x69, 0x6e, 0x64, 0x65, 0x6d, 0x61, 0x6e, 0x0d, 0x0a, 0x41, 0x75, 0x73, 0x74, 0x72,
428 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x4c, 0x6f, 0x72, 0x64, 0x5f, 0x48, 0x6f, 0x77, 0x65, 0x0d, 0x0a,
429 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x4d, 0x65, 0x6c, 0x62, 0x6f, 0x75,
430 0x72, 0x6e, 0x65, 0x0d, 0x0a, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x4e,
431 0x6f, 0x72, 0x74, 0x68, 0x0d, 0x0a, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f,
432 0x4e, 0x53, 0x57, 0x0d, 0x0a, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x50,
433 0x65, 0x72, 0x74, 0x68, 0x0d, 0x0a, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f,
434 0x51, 0x75, 0x65, 0x65, 0x6e, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x0d, 0x0a, 0x41, 0x75, 0x73, 0x74,
435 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x0d, 0x0a, 0x41, 0x75, 0x73,
436 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x53, 0x79, 0x64, 0x6e, 0x65, 0x79, 0x0d, 0x0a, 0x41,
437 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x54, 0x61, 0x73, 0x6d, 0x61, 0x6e, 0x69,
438 0x61, 0x0d, 0x0a, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x56, 0x69, 0x63,
439 0x74, 0x6f, 0x72, 0x69, 0x61, 0x0d, 0x0a, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61,
440 0x2f, 0x57, 0x65, 0x73, 0x74, 0x0d, 0x0a, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61,
441 0x2f, 0x59, 0x61, 0x6e, 0x63, 0x6f, 0x77, 0x69, 0x6e, 0x6e, 0x61, 0x0d, 0x0a, 0x42, 0x72, 0x61,
442 0x7a, 0x69, 0x6c, 0x2f, 0x41, 0x63, 0x72, 0x65, 0x0d, 0x0a, 0x42, 0x72, 0x61, 0x7a, 0x69, 0x6c,
443 0x2f, 0x44, 0x65, 0x4e, 0x6f, 0x72, 0x6f, 0x6e, 0x68, 0x61, 0x0d, 0x0a, 0x42, 0x72, 0x61, 0x7a,
444 0x69, 0x6c, 0x2f, 0x45, 0x61, 0x73, 0x74, 0x0d, 0x0a, 0x42, 0x72, 0x61, 0x7a, 0x69, 0x6c, 0x2f,
445 0x57, 0x65, 0x73, 0x74, 0x0d, 0x0a, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x61, 0x2f, 0x41, 0x74, 0x6c,
446 0x61, 0x6e, 0x74, 0x69, 0x63, 0x0d, 0x0a, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x61, 0x2f, 0x43, 0x65,
447 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x0d, 0x0a, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x61, 0x2f, 0x45, 0x61,
448 0x73, 0x74, 0x2d, 0x53, 0x61, 0x73, 0x6b, 0x61, 0x74, 0x63, 0x68, 0x65, 0x77, 0x61, 0x6e, 0x0d,
449 0x0a, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x61, 0x2f, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6e, 0x0d,
450 0x0a, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x61, 0x2f, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x69, 0x6e,
451 0x0d, 0x0a, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x61, 0x2f, 0x4e, 0x65, 0x77, 0x66, 0x6f, 0x75, 0x6e,
452 0x64, 0x6c, 0x61, 0x6e, 0x64, 0x0d, 0x0a, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x61, 0x2f, 0x50, 0x61,
453 0x63, 0x69, 0x66, 0x69, 0x63, 0x0d, 0x0a, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x61, 0x2f, 0x53, 0x61,
454 0x73, 0x6b, 0x61, 0x74, 0x63, 0x68, 0x65, 0x77, 0x61, 0x6e, 0x0d, 0x0a, 0x43, 0x61, 0x6e, 0x61,
455 0x64, 0x61, 0x2f, 0x59, 0x75, 0x6b, 0x6f, 0x6e, 0x0d, 0x0a, 0x43, 0x68, 0x69, 0x6c, 0x65, 0x2f,
456 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x0d, 0x0a, 0x43, 0x68, 0x69,
457 0x6c, 0x65, 0x2f, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x0d,
458 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d,
459 0x54, 0x2b, 0x30, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x31, 0x0d, 0x0a,
460 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x31, 0x30, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f,
461 0x47, 0x4d, 0x54, 0x2b, 0x31, 0x31, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b,
462 0x31, 0x32, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x32, 0x0d, 0x0a, 0x45,
463 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x33, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d,
464 0x54, 0x2b, 0x34, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x35, 0x0d, 0x0a,
465 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x36, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47,
466 0x4d, 0x54, 0x2b, 0x37, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x38, 0x0d,
467 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x39, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f,
468 0x47, 0x4d, 0x54, 0x2d, 0x30, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x31,
469 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x31, 0x30, 0x0d, 0x0a, 0x45, 0x74,
470 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x31, 0x31, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d,
471 0x54, 0x2d, 0x31, 0x32, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x31, 0x33,
472 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x31, 0x34, 0x0d, 0x0a, 0x45, 0x74,
473 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x32, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54,
474 0x2d, 0x33, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x34, 0x0d, 0x0a, 0x45,
475 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x35, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d,
476 0x54, 0x2d, 0x36, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x37, 0x0d, 0x0a,
477 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x38, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47,
478 0x4d, 0x54, 0x2d, 0x39, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x30, 0x0d, 0x0a,
479 0x45, 0x74, 0x63, 0x2f, 0x47, 0x72, 0x65, 0x65, 0x6e, 0x77, 0x69, 0x63, 0x68, 0x0d, 0x0a, 0x45,
480 0x74, 0x63, 0x2f, 0x55, 0x43, 0x54, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x55, 0x6e, 0x69, 0x76,
481 0x65, 0x72, 0x73, 0x61, 0x6c, 0x0d, 0x0a, 0x45, 0x74, 0x63, 0x2f, 0x55, 0x54, 0x43, 0x0d, 0x0a,
482 0x45, 0x74, 0x63, 0x2f, 0x5a, 0x75, 0x6c, 0x75, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65,
483 0x2f, 0x41, 0x6d, 0x73, 0x74, 0x65, 0x72, 0x64, 0x61, 0x6d, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f,
484 0x70, 0x65, 0x2f, 0x41, 0x6e, 0x64, 0x6f, 0x72, 0x72, 0x61, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f,
485 0x70, 0x65, 0x2f, 0x41, 0x73, 0x74, 0x72, 0x61, 0x6b, 0x68, 0x61, 0x6e, 0x0d, 0x0a, 0x45, 0x75,
486 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x41, 0x74, 0x68, 0x65, 0x6e, 0x73, 0x0d, 0x0a, 0x45, 0x75, 0x72,
487 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x65, 0x6c, 0x66, 0x61, 0x73, 0x74, 0x0d, 0x0a, 0x45, 0x75, 0x72,
488 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x65, 0x6c, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0d, 0x0a, 0x45, 0x75,
489 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x65, 0x72, 0x6c, 0x69, 0x6e, 0x0d, 0x0a, 0x45, 0x75, 0x72,
490 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x72, 0x61, 0x74, 0x69, 0x73, 0x6c, 0x61, 0x76, 0x61, 0x0d, 0x0a,
491 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x72, 0x75, 0x73, 0x73, 0x65, 0x6c, 0x73, 0x0d,
492 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x75, 0x63, 0x68, 0x61, 0x72, 0x65, 0x73,
493 0x74, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x75, 0x64, 0x61, 0x70, 0x65,
494 0x73, 0x74, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x75, 0x73, 0x69, 0x6e,
495 0x67, 0x65, 0x6e, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x43, 0x68, 0x69, 0x73,
496 0x69, 0x6e, 0x61, 0x75, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x43, 0x6f, 0x70,
497 0x65, 0x6e, 0x68, 0x61, 0x67, 0x65, 0x6e, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f,
498 0x44, 0x75, 0x62, 0x6c, 0x69, 0x6e, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x47,
499 0x69, 0x62, 0x72, 0x61, 0x6c, 0x74, 0x61, 0x72, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65,
500 0x2f, 0x47, 0x75, 0x65, 0x72, 0x6e, 0x73, 0x65, 0x79, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70,
501 0x65, 0x2f, 0x48, 0x65, 0x6c, 0x73, 0x69, 0x6e, 0x6b, 0x69, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f,
502 0x70, 0x65, 0x2f, 0x49, 0x73, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x5f, 0x4d, 0x61, 0x6e, 0x0d, 0x0a,
503 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x49, 0x73, 0x74, 0x61, 0x6e, 0x62, 0x75, 0x6c, 0x0d,
504 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4a, 0x65, 0x72, 0x73, 0x65, 0x79, 0x0d, 0x0a,
505 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4b, 0x61, 0x6c, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x72,
506 0x61, 0x64, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4b, 0x69, 0x65, 0x76, 0x0d,
507 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4b, 0x69, 0x72, 0x6f, 0x76, 0x0d, 0x0a, 0x45,
508 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4c, 0x69, 0x73, 0x62, 0x6f, 0x6e, 0x0d, 0x0a, 0x45, 0x75,
509 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4c, 0x6a, 0x75, 0x62, 0x6c, 0x6a, 0x61, 0x6e, 0x61, 0x0d, 0x0a,
510 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4c, 0x6f, 0x6e, 0x64, 0x6f, 0x6e, 0x0d, 0x0a, 0x45,
511 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4c, 0x75, 0x78, 0x65, 0x6d, 0x62, 0x6f, 0x75, 0x72, 0x67,
512 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4d, 0x61, 0x64, 0x72, 0x69, 0x64, 0x0d,
513 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4d, 0x61, 0x6c, 0x74, 0x61, 0x0d, 0x0a, 0x45,
514 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4d, 0x61, 0x72, 0x69, 0x65, 0x68, 0x61, 0x6d, 0x6e, 0x0d,
515 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4d, 0x69, 0x6e, 0x73, 0x6b, 0x0d, 0x0a, 0x45,
516 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4d, 0x6f, 0x6e, 0x61, 0x63, 0x6f, 0x0d, 0x0a, 0x45, 0x75,
517 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4d, 0x6f, 0x73, 0x63, 0x6f, 0x77, 0x0d, 0x0a, 0x45, 0x75, 0x72,
518 0x6f, 0x70, 0x65, 0x2f, 0x4e, 0x69, 0x63, 0x6f, 0x73, 0x69, 0x61, 0x0d, 0x0a, 0x45, 0x75, 0x72,
519 0x6f, 0x70, 0x65, 0x2f, 0x4f, 0x73, 0x6c, 0x6f, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65,
520 0x2f, 0x50, 0x61, 0x72, 0x69, 0x73, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x50,
521 0x6f, 0x64, 0x67, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65,
522 0x2f, 0x50, 0x72, 0x61, 0x67, 0x75, 0x65, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f,
523 0x52, 0x69, 0x67, 0x61, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x52, 0x6f, 0x6d,
524 0x65, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x53, 0x61, 0x6d, 0x61, 0x72, 0x61,
525 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x53, 0x61, 0x6e, 0x5f, 0x4d, 0x61, 0x72,
526 0x69, 0x6e, 0x6f, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x53, 0x61, 0x72, 0x61,
527 0x6a, 0x65, 0x76, 0x6f, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x53, 0x61, 0x72,
528 0x61, 0x74, 0x6f, 0x76, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x53, 0x69, 0x6d,
529 0x66, 0x65, 0x72, 0x6f, 0x70, 0x6f, 0x6c, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f,
530 0x53, 0x6b, 0x6f, 0x70, 0x6a, 0x65, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x53,
531 0x6f, 0x66, 0x69, 0x61, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x53, 0x74, 0x6f,
532 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x6d, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x54,
533 0x61, 0x6c, 0x6c, 0x69, 0x6e, 0x6e, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x54,
534 0x69, 0x72, 0x61, 0x6e, 0x65, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x54, 0x69,
535 0x72, 0x61, 0x73, 0x70, 0x6f, 0x6c, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x55,
536 0x6c, 0x79, 0x61, 0x6e, 0x6f, 0x76, 0x73, 0x6b, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65,
537 0x2f, 0x55, 0x7a, 0x68, 0x67, 0x6f, 0x72, 0x6f, 0x64, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70,
538 0x65, 0x2f, 0x56, 0x61, 0x64, 0x75, 0x7a, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f,
539 0x56, 0x61, 0x74, 0x69, 0x63, 0x61, 0x6e, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f,
540 0x56, 0x69, 0x65, 0x6e, 0x6e, 0x61, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x56,
541 0x69, 0x6c, 0x6e, 0x69, 0x75, 0x73, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x56,
542 0x6f, 0x6c, 0x67, 0x6f, 0x67, 0x72, 0x61, 0x64, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65,
543 0x2f, 0x57, 0x61, 0x72, 0x73, 0x61, 0x77, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f,
544 0x5a, 0x61, 0x67, 0x72, 0x65, 0x62, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x5a,
545 0x61, 0x70, 0x6f, 0x72, 0x6f, 0x7a, 0x68, 0x79, 0x65, 0x0d, 0x0a, 0x45, 0x75, 0x72, 0x6f, 0x70,
546 0x65, 0x2f, 0x5a, 0x75, 0x72, 0x69, 0x63, 0x68, 0x0d, 0x0a, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e,
547 0x2f, 0x41, 0x6e, 0x74, 0x61, 0x6e, 0x61, 0x6e, 0x61, 0x72, 0x69, 0x76, 0x6f, 0x0d, 0x0a, 0x49,
548 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x43, 0x68, 0x61, 0x67, 0x6f, 0x73, 0x0d, 0x0a, 0x49, 0x6e,
549 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x43, 0x68, 0x72, 0x69, 0x73, 0x74, 0x6d, 0x61, 0x73, 0x0d, 0x0a,
550 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x43, 0x6f, 0x63, 0x6f, 0x73, 0x0d, 0x0a, 0x49, 0x6e,
551 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x43, 0x6f, 0x6d, 0x6f, 0x72, 0x6f, 0x0d, 0x0a, 0x49, 0x6e, 0x64,
552 0x69, 0x61, 0x6e, 0x2f, 0x4b, 0x65, 0x72, 0x67, 0x75, 0x65, 0x6c, 0x65, 0x6e, 0x0d, 0x0a, 0x49,
553 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x4d, 0x61, 0x68, 0x65, 0x0d, 0x0a, 0x49, 0x6e, 0x64, 0x69,
554 0x61, 0x6e, 0x2f, 0x4d, 0x61, 0x6c, 0x64, 0x69, 0x76, 0x65, 0x73, 0x0d, 0x0a, 0x49, 0x6e, 0x64,
555 0x69, 0x61, 0x6e, 0x2f, 0x4d, 0x61, 0x75, 0x72, 0x69, 0x74, 0x69, 0x75, 0x73, 0x0d, 0x0a, 0x49,
556 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x4d, 0x61, 0x79, 0x6f, 0x74, 0x74, 0x65, 0x0d, 0x0a, 0x49,
557 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x52, 0x65, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x0d, 0x0a, 0x4d,
558 0x65, 0x78, 0x69, 0x63, 0x6f, 0x2f, 0x42, 0x61, 0x6a, 0x61, 0x4e, 0x6f, 0x72, 0x74, 0x65, 0x0d,
559 0x0a, 0x4d, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x2f, 0x42, 0x61, 0x6a, 0x61, 0x53, 0x75, 0x72, 0x0d,
560 0x0a, 0x4d, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x2f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x0d,
561 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x41, 0x70, 0x69, 0x61, 0x0d, 0x0a, 0x50,
562 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x41, 0x75, 0x63, 0x6b, 0x6c, 0x61, 0x6e, 0x64, 0x0d,
563 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x42, 0x6f, 0x75, 0x67, 0x61, 0x69, 0x6e,
564 0x76, 0x69, 0x6c, 0x6c, 0x65, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x43,
565 0x68, 0x61, 0x74, 0x68, 0x61, 0x6d, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f,
566 0x43, 0x68, 0x75, 0x75, 0x6b, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x45,
567 0x61, 0x73, 0x74, 0x65, 0x72, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x45,
568 0x66, 0x61, 0x74, 0x65, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x45, 0x6e,
569 0x64, 0x65, 0x72, 0x62, 0x75, 0x72, 0x79, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63,
570 0x2f, 0x46, 0x61, 0x6b, 0x61, 0x6f, 0x66, 0x6f, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69,
571 0x63, 0x2f, 0x46, 0x69, 0x6a, 0x69, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f,
572 0x46, 0x75, 0x6e, 0x61, 0x66, 0x75, 0x74, 0x69, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69,
573 0x63, 0x2f, 0x47, 0x61, 0x6c, 0x61, 0x70, 0x61, 0x67, 0x6f, 0x73, 0x0d, 0x0a, 0x50, 0x61, 0x63,
574 0x69, 0x66, 0x69, 0x63, 0x2f, 0x47, 0x61, 0x6d, 0x62, 0x69, 0x65, 0x72, 0x0d, 0x0a, 0x50, 0x61,
575 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x47, 0x75, 0x61, 0x64, 0x61, 0x6c, 0x63, 0x61, 0x6e, 0x61,
576 0x6c, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x47, 0x75, 0x61, 0x6d, 0x0d,
577 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x48, 0x6f, 0x6e, 0x6f, 0x6c, 0x75, 0x6c,
578 0x75, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4a, 0x6f, 0x68, 0x6e, 0x73,
579 0x74, 0x6f, 0x6e, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4b, 0x69, 0x72,
580 0x69, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63,
581 0x2f, 0x4b, 0x6f, 0x73, 0x72, 0x61, 0x65, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63,
582 0x2f, 0x4b, 0x77, 0x61, 0x6a, 0x61, 0x6c, 0x65, 0x69, 0x6e, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69,
583 0x66, 0x69, 0x63, 0x2f, 0x4d, 0x61, 0x6a, 0x75, 0x72, 0x6f, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69,
584 0x66, 0x69, 0x63, 0x2f, 0x4d, 0x61, 0x72, 0x71, 0x75, 0x65, 0x73, 0x61, 0x73, 0x0d, 0x0a, 0x50,
585 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4d, 0x69, 0x64, 0x77, 0x61, 0x79, 0x0d, 0x0a, 0x50,
586 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4e, 0x61, 0x75, 0x72, 0x75, 0x0d, 0x0a, 0x50, 0x61,
587 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4e, 0x69, 0x75, 0x65, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69,
588 0x66, 0x69, 0x63, 0x2f, 0x4e, 0x6f, 0x72, 0x66, 0x6f, 0x6c, 0x6b, 0x0d, 0x0a, 0x50, 0x61, 0x63,
589 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4e, 0x6f, 0x75, 0x6d, 0x65, 0x61, 0x0d, 0x0a, 0x50, 0x61, 0x63,
590 0x69, 0x66, 0x69, 0x63, 0x2f, 0x50, 0x61, 0x67, 0x6f, 0x5f, 0x50, 0x61, 0x67, 0x6f, 0x0d, 0x0a,
591 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x50, 0x61, 0x6c, 0x61, 0x75, 0x0d, 0x0a, 0x50,
592 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x50, 0x69, 0x74, 0x63, 0x61, 0x69, 0x72, 0x6e, 0x0d,
593 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x50, 0x6f, 0x68, 0x6e, 0x70, 0x65, 0x69,
594 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x50, 0x6f, 0x6e, 0x61, 0x70, 0x65,
595 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x50, 0x6f, 0x72, 0x74, 0x5f, 0x4d,
596 0x6f, 0x72, 0x65, 0x73, 0x62, 0x79, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f,
597 0x52, 0x61, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x67, 0x61, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66,
598 0x69, 0x63, 0x2f, 0x53, 0x61, 0x69, 0x70, 0x61, 0x6e, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66,
599 0x69, 0x63, 0x2f, 0x53, 0x61, 0x6d, 0x6f, 0x61, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69,
600 0x63, 0x2f, 0x54, 0x61, 0x68, 0x69, 0x74, 0x69, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69,
601 0x63, 0x2f, 0x54, 0x61, 0x72, 0x61, 0x77, 0x61, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69,
602 0x63, 0x2f, 0x54, 0x6f, 0x6e, 0x67, 0x61, 0x74, 0x61, 0x70, 0x75, 0x0d, 0x0a, 0x50, 0x61, 0x63,
603 0x69, 0x66, 0x69, 0x63, 0x2f, 0x54, 0x72, 0x75, 0x6b, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66,
604 0x69, 0x63, 0x2f, 0x57, 0x61, 0x6b, 0x65, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63,
605 0x2f, 0x57, 0x61, 0x6c, 0x6c, 0x69, 0x73, 0x0d, 0x0a, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63,
606 0x2f, 0x59, 0x61, 0x70, 0x0d, 0x0a, 0x55, 0x53, 0x2f, 0x41, 0x6c, 0x61, 0x73, 0x6b, 0x61, 0x0d,
607 0x0a, 0x55, 0x53, 0x2f, 0x41, 0x6c, 0x65, 0x75, 0x74, 0x69, 0x61, 0x6e, 0x0d, 0x0a, 0x55, 0x53,
608 0x2f, 0x41, 0x72, 0x69, 0x7a, 0x6f, 0x6e, 0x61, 0x0d, 0x0a, 0x55, 0x53, 0x2f, 0x43, 0x65, 0x6e,
609 0x74, 0x72, 0x61, 0x6c, 0x0d, 0x0a, 0x55, 0x53, 0x2f, 0x45, 0x61, 0x73, 0x74, 0x2d, 0x49, 0x6e,
610 0x64, 0x69, 0x61, 0x6e, 0x61, 0x0d, 0x0a, 0x55, 0x53, 0x2f, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72,
611 0x6e, 0x0d, 0x0a, 0x55, 0x53, 0x2f, 0x48, 0x61, 0x77, 0x61, 0x69, 0x69, 0x0d, 0x0a, 0x55, 0x53,
612 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x2d, 0x53, 0x74, 0x61, 0x72, 0x6b, 0x65, 0x0d,
613 0x0a, 0x55, 0x53, 0x2f, 0x4d, 0x69, 0x63, 0x68, 0x69, 0x67, 0x61, 0x6e, 0x0d, 0x0a, 0x55, 0x53,
614 0x2f, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x0d, 0x0a, 0x55, 0x53, 0x2f, 0x50, 0x61,
615 0x63, 0x69, 0x66, 0x69, 0x63, 0x0d, 0x0a, 0x55, 0x53, 0x2f, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69,
616 0x63, 0x2d, 0x4e, 0x65, 0x77, 0x0d, 0x0a, 0x55, 0x53, 0x2f, 0x53, 0x61, 0x6d, 0x6f, 0x61, 0x0d,
617 0x0a};
618 12
619static VirtualFile GenerateDefaultTimeZoneFile() { 13namespace FileSys::SystemArchive {
620 struct TimeZoneInfo {
621 s64_be at;
622 std::array<u8, 7> padding1;
623 std::array<char, 4> time_zone_chars;
624 std::array<u8, 2> padding2;
625 std::array<char, 6> time_zone_name;
626 };
627 14
628 VirtualFile file{std::make_shared<VectorVfsFile>( 15const static std::map<std::string, const std::map<const char*, const std::vector<u8>>&>
629 std::vector<u8>(sizeof(Service::Time::TimeZone::TzifHeader) + sizeof(TimeZoneInfo)), 16 tzdb_zoneinfo_dirs = {{"Africa", NxTzdb::africa},
630 "GMT")}; 17 {"America", NxTzdb::america},
18 {"Antarctica", NxTzdb::antarctica},
19 {"Arctic", NxTzdb::arctic},
20 {"Asia", NxTzdb::asia},
21 {"Atlantic", NxTzdb::atlantic},
22 {"Australia", NxTzdb::australia},
23 {"Brazil", NxTzdb::brazil},
24 {"Canada", NxTzdb::canada},
25 {"Chile", NxTzdb::chile},
26 {"Etc", NxTzdb::etc},
27 {"Europe", NxTzdb::europe},
28 {"Indian", NxTzdb::indian},
29 {"Mexico", NxTzdb::mexico},
30 {"Pacific", NxTzdb::pacific},
31 {"US", NxTzdb::us}};
631 32
632 const Service::Time::TimeZone::TzifHeader header{ 33const static std::map<std::string, const std::map<const char*, const std::vector<u8>>&>
633 .magic = 0x545a6966, 34 tzdb_america_dirs = {{"Argentina", NxTzdb::america_argentina},
634 .version = 0x32, 35 {"Indiana", NxTzdb::america_indiana},
635 .ttis_gmt_count = 1, 36 {"Kentucky", NxTzdb::america_kentucky},
636 .ttis_std_count = 1, 37 {"North_Dakota", NxTzdb::america_north_dakota}};
637 .time_count = 1,
638 .type_count = 1,
639 .char_count = 4,
640 };
641 file->WriteObject(header, 0);
642 38
643 const TimeZoneInfo time_zone_info{ 39static void GenerateFiles(std::vector<VirtualFile>& directory,
644 .at = 0xf8, 40 const std::map<const char*, const std::vector<u8>>& files) {
645 .padding1 = {}, 41 for (const auto& [filename, data] : files) {
646 .time_zone_chars = {'G', 'M', 'T', '\0'}, 42 const auto data_copy{data};
647 .padding2 = {}, 43 const std::string filename_copy{filename};
648 .time_zone_name = {'\n', 'G', 'M', 'T', '0', '\n'}, 44 VirtualFile file{
649 }; 45 std::make_shared<VectorVfsFile>(std::move(data_copy), std::move(filename_copy))};
650 file->WriteObject(time_zone_info, sizeof(Service::Time::TimeZone::TzifHeader)); 46 directory.push_back(file);
47 }
48}
651 49
652 return file; 50static std::vector<VirtualFile> GenerateZoneinfoFiles() {
51 std::vector<VirtualFile> zoneinfo_files;
52 GenerateFiles(zoneinfo_files, NxTzdb::zoneinfo);
53 return zoneinfo_files;
653} 54}
654 55
655VirtualDir TimeZoneBinary() { 56VirtualDir TimeZoneBinary() {
656 std::vector<VirtualDir> root_dirs{std::make_shared<VectorVfsDirectory>( 57 std::vector<VirtualDir> america_sub_dirs;
657 std::vector<VirtualFile>{GenerateDefaultTimeZoneFile()}, std::vector<VirtualDir>{}, 58 for (const auto& [dir_name, files] : tzdb_america_dirs) {
658 "zoneinfo")}; 59 std::vector<VirtualFile> vfs_files;
659 std::vector<VirtualFile> root_files{MakeArrayFile(LOCATION_NAMES, "binaryList.txt")}; 60 GenerateFiles(vfs_files, files);
61 america_sub_dirs.push_back(std::make_shared<VectorVfsDirectory>(
62 std::move(vfs_files), std::vector<VirtualDir>{}, dir_name));
63 }
64
65 std::vector<VirtualDir> zoneinfo_sub_dirs;
66 for (const auto& [dir_name, files] : tzdb_zoneinfo_dirs) {
67 std::vector<VirtualFile> vfs_files;
68 GenerateFiles(vfs_files, files);
69 if (dir_name == "America") {
70 zoneinfo_sub_dirs.push_back(std::make_shared<VectorVfsDirectory>(
71 std::move(vfs_files), std::move(america_sub_dirs), dir_name));
72 } else {
73 zoneinfo_sub_dirs.push_back(std::make_shared<VectorVfsDirectory>(
74 std::move(vfs_files), std::vector<VirtualDir>{}, dir_name));
75 }
76 }
77
78 std::vector<VirtualDir> zoneinfo_dir{std::make_shared<VectorVfsDirectory>(
79 GenerateZoneinfoFiles(), std::move(zoneinfo_sub_dirs), "zoneinfo")};
80 std::vector<VirtualFile> root_files;
81 GenerateFiles(root_files, NxTzdb::base);
660 82
661 return std::make_shared<VectorVfsDirectory>(std::move(root_files), std::move(root_dirs), 83 return std::make_shared<VectorVfsDirectory>(std::move(root_files), std::move(zoneinfo_dir),
662 "data"); 84 "data");
663} 85}
664 86
diff --git a/src/core/file_sys/vfs_concat.cpp b/src/core/file_sys/vfs_concat.cpp
index 853b893a1..311a59e5f 100644
--- a/src/core/file_sys/vfs_concat.cpp
+++ b/src/core/file_sys/vfs_concat.cpp
@@ -150,23 +150,29 @@ std::size_t ConcatenatedVfsFile::Read(u8* data, std::size_t length, std::size_t
150 while (cur_length > 0 && it != concatenation_map.end()) { 150 while (cur_length > 0 && it != concatenation_map.end()) {
151 // Check if we can read the file at this position. 151 // Check if we can read the file at this position.
152 const auto& file = it->file; 152 const auto& file = it->file;
153 const u64 file_offset = it->offset; 153 const u64 map_offset = it->offset;
154 const u64 file_size = file->GetSize(); 154 const u64 file_size = file->GetSize();
155 155
156 if (cur_offset >= file_offset + file_size) { 156 if (cur_offset > map_offset + file_size) {
157 // Entirely out of bounds read. 157 // Entirely out of bounds read.
158 break; 158 break;
159 } 159 }
160 160
161 // Read the file at this position. 161 // Read the file at this position.
162 const u64 intended_read_size = std::min<u64>(cur_length, file_size); 162 const u64 file_seek = cur_offset - map_offset;
163 const u64 intended_read_size = std::min<u64>(cur_length, file_size - file_seek);
163 const u64 actual_read_size = 164 const u64 actual_read_size =
164 file->Read(data + (cur_offset - offset), intended_read_size, cur_offset - file_offset); 165 file->Read(data + (cur_offset - offset), intended_read_size, file_seek);
165 166
166 // Update tracking. 167 // Update tracking.
167 cur_offset += actual_read_size; 168 cur_offset += actual_read_size;
168 cur_length -= actual_read_size; 169 cur_length -= actual_read_size;
169 it++; 170 it++;
171
172 // If we encountered a short read, we're done.
173 if (actual_read_size < intended_read_size) {
174 break;
175 }
170 } 176 }
171 177
172 return cur_offset - offset; 178 return cur_offset - offset;
diff --git a/src/core/file_sys/vfs_real.cpp b/src/core/file_sys/vfs_real.cpp
index cc0076238..7a15d8438 100644
--- a/src/core/file_sys/vfs_real.cpp
+++ b/src/core/file_sys/vfs_real.cpp
@@ -25,6 +25,8 @@ namespace FS = Common::FS;
25 25
26namespace { 26namespace {
27 27
28constexpr size_t MaxOpenFiles = 512;
29
28constexpr FS::FileAccessMode ModeFlagsToFileAccessMode(Mode mode) { 30constexpr FS::FileAccessMode ModeFlagsToFileAccessMode(Mode mode) {
29 switch (mode) { 31 switch (mode) {
30 case Mode::Read: 32 case Mode::Read:
@@ -73,28 +75,30 @@ VfsEntryType RealVfsFilesystem::GetEntryType(std::string_view path_) const {
73VirtualFile RealVfsFilesystem::OpenFile(std::string_view path_, Mode perms) { 75VirtualFile RealVfsFilesystem::OpenFile(std::string_view path_, Mode perms) {
74 const auto path = FS::SanitizePath(path_, FS::DirectorySeparator::PlatformDefault); 76 const auto path = FS::SanitizePath(path_, FS::DirectorySeparator::PlatformDefault);
75 77
76 if (const auto weak_iter = cache.find(path); weak_iter != cache.cend()) { 78 if (auto it = cache.find(path); it != cache.end()) {
77 const auto& weak = weak_iter->second; 79 if (auto file = it->second.lock(); file) {
78 80 return file;
79 if (!weak.expired()) {
80 return std::shared_ptr<RealVfsFile>(new RealVfsFile(*this, weak.lock(), path, perms));
81 } 81 }
82 } 82 }
83 83
84 auto backing = FS::FileOpen(path, ModeFlagsToFileAccessMode(perms), FS::FileType::BinaryFile); 84 if (!FS::Exists(path) || !FS::IsFile(path)) {
85
86 if (!backing) {
87 return nullptr; 85 return nullptr;
88 } 86 }
89 87
90 cache.insert_or_assign(path, std::move(backing)); 88 auto reference = std::make_unique<FileReference>();
89 this->InsertReferenceIntoList(*reference);
91 90
92 // Cannot use make_shared as RealVfsFile constructor is private 91 auto file =
93 return std::shared_ptr<RealVfsFile>(new RealVfsFile(*this, backing, path, perms)); 92 std::shared_ptr<RealVfsFile>(new RealVfsFile(*this, std::move(reference), path, perms));
93 cache[path] = file;
94
95 return file;
94} 96}
95 97
96VirtualFile RealVfsFilesystem::CreateFile(std::string_view path_, Mode perms) { 98VirtualFile RealVfsFilesystem::CreateFile(std::string_view path_, Mode perms) {
97 const auto path = FS::SanitizePath(path_, FS::DirectorySeparator::PlatformDefault); 99 const auto path = FS::SanitizePath(path_, FS::DirectorySeparator::PlatformDefault);
100 cache.erase(path);
101
98 // Current usages of CreateFile expect to delete the contents of an existing file. 102 // Current usages of CreateFile expect to delete the contents of an existing file.
99 if (FS::IsFile(path)) { 103 if (FS::IsFile(path)) {
100 FS::IOFile temp{path, FS::FileAccessMode::Write, FS::FileType::BinaryFile}; 104 FS::IOFile temp{path, FS::FileAccessMode::Write, FS::FileType::BinaryFile};
@@ -123,51 +127,22 @@ VirtualFile RealVfsFilesystem::CopyFile(std::string_view old_path_, std::string_
123VirtualFile RealVfsFilesystem::MoveFile(std::string_view old_path_, std::string_view new_path_) { 127VirtualFile RealVfsFilesystem::MoveFile(std::string_view old_path_, std::string_view new_path_) {
124 const auto old_path = FS::SanitizePath(old_path_, FS::DirectorySeparator::PlatformDefault); 128 const auto old_path = FS::SanitizePath(old_path_, FS::DirectorySeparator::PlatformDefault);
125 const auto new_path = FS::SanitizePath(new_path_, FS::DirectorySeparator::PlatformDefault); 129 const auto new_path = FS::SanitizePath(new_path_, FS::DirectorySeparator::PlatformDefault);
126 const auto cached_file_iter = cache.find(old_path); 130 cache.erase(old_path);
127 131 cache.erase(new_path);
128 if (cached_file_iter != cache.cend()) { 132 if (!FS::RenameFile(old_path, new_path)) {
129 auto file = cached_file_iter->second.lock();
130
131 if (!cached_file_iter->second.expired()) {
132 file->Close();
133 }
134
135 if (!FS::RenameFile(old_path, new_path)) {
136 return nullptr;
137 }
138
139 cache.erase(old_path);
140 file->Open(new_path, FS::FileAccessMode::Read, FS::FileType::BinaryFile);
141 if (file->IsOpen()) {
142 cache.insert_or_assign(new_path, std::move(file));
143 } else {
144 LOG_ERROR(Service_FS, "Failed to open path {} in order to re-cache it", new_path);
145 }
146 } else {
147 ASSERT(false);
148 return nullptr; 133 return nullptr;
149 } 134 }
150
151 return OpenFile(new_path, Mode::ReadWrite); 135 return OpenFile(new_path, Mode::ReadWrite);
152} 136}
153 137
154bool RealVfsFilesystem::DeleteFile(std::string_view path_) { 138bool RealVfsFilesystem::DeleteFile(std::string_view path_) {
155 const auto path = FS::SanitizePath(path_, FS::DirectorySeparator::PlatformDefault); 139 const auto path = FS::SanitizePath(path_, FS::DirectorySeparator::PlatformDefault);
156 const auto cached_iter = cache.find(path); 140 cache.erase(path);
157
158 if (cached_iter != cache.cend()) {
159 if (!cached_iter->second.expired()) {
160 cached_iter->second.lock()->Close();
161 }
162 cache.erase(path);
163 }
164
165 return FS::RemoveFile(path); 141 return FS::RemoveFile(path);
166} 142}
167 143
168VirtualDir RealVfsFilesystem::OpenDirectory(std::string_view path_, Mode perms) { 144VirtualDir RealVfsFilesystem::OpenDirectory(std::string_view path_, Mode perms) {
169 const auto path = FS::SanitizePath(path_, FS::DirectorySeparator::PlatformDefault); 145 const auto path = FS::SanitizePath(path_, FS::DirectorySeparator::PlatformDefault);
170 // Cannot use make_shared as RealVfsDirectory constructor is private
171 return std::shared_ptr<RealVfsDirectory>(new RealVfsDirectory(*this, path, perms)); 146 return std::shared_ptr<RealVfsDirectory>(new RealVfsDirectory(*this, path, perms));
172} 147}
173 148
@@ -176,7 +151,6 @@ VirtualDir RealVfsFilesystem::CreateDirectory(std::string_view path_, Mode perms
176 if (!FS::CreateDirs(path)) { 151 if (!FS::CreateDirs(path)) {
177 return nullptr; 152 return nullptr;
178 } 153 }
179 // Cannot use make_shared as RealVfsDirectory constructor is private
180 return std::shared_ptr<RealVfsDirectory>(new RealVfsDirectory(*this, path, perms)); 154 return std::shared_ptr<RealVfsDirectory>(new RealVfsDirectory(*this, path, perms));
181} 155}
182 156
@@ -194,73 +168,102 @@ VirtualDir RealVfsFilesystem::MoveDirectory(std::string_view old_path_,
194 if (!FS::RenameDir(old_path, new_path)) { 168 if (!FS::RenameDir(old_path, new_path)) {
195 return nullptr; 169 return nullptr;
196 } 170 }
171 return OpenDirectory(new_path, Mode::ReadWrite);
172}
197 173
198 for (auto& kv : cache) { 174bool RealVfsFilesystem::DeleteDirectory(std::string_view path_) {
199 // If the path in the cache doesn't start with old_path, then bail on this file. 175 const auto path = FS::SanitizePath(path_, FS::DirectorySeparator::PlatformDefault);
200 if (kv.first.rfind(old_path, 0) != 0) { 176 return FS::RemoveDirRecursively(path);
201 continue; 177}
202 }
203 178
204 const auto file_old_path = 179void RealVfsFilesystem::RefreshReference(const std::string& path, Mode perms,
205 FS::SanitizePath(kv.first, FS::DirectorySeparator::PlatformDefault); 180 FileReference& reference) {
206 auto file_new_path = FS::SanitizePath(new_path + '/' + kv.first.substr(old_path.size()), 181 // Temporarily remove from list.
207 FS::DirectorySeparator::PlatformDefault); 182 this->RemoveReferenceFromList(reference);
208 const auto& cached = cache[file_old_path];
209 183
210 if (cached.expired()) { 184 // Restore file if needed.
211 continue; 185 if (!reference.file) {
212 } 186 this->EvictSingleReference();
213 187
214 auto file = cached.lock(); 188 reference.file =
215 cache.erase(file_old_path); 189 FS::FileOpen(path, ModeFlagsToFileAccessMode(perms), FS::FileType::BinaryFile);
216 file->Open(file_new_path, FS::FileAccessMode::Read, FS::FileType::BinaryFile); 190 if (reference.file) {
217 if (file->IsOpen()) { 191 num_open_files++;
218 cache.insert_or_assign(std::move(file_new_path), std::move(file));
219 } else {
220 LOG_ERROR(Service_FS, "Failed to open path {} in order to re-cache it", file_new_path);
221 } 192 }
222 } 193 }
223 194
224 return OpenDirectory(new_path, Mode::ReadWrite); 195 // Reinsert into list.
196 this->InsertReferenceIntoList(reference);
225} 197}
226 198
227bool RealVfsFilesystem::DeleteDirectory(std::string_view path_) { 199void RealVfsFilesystem::DropReference(std::unique_ptr<FileReference>&& reference) {
228 const auto path = FS::SanitizePath(path_, FS::DirectorySeparator::PlatformDefault); 200 // Remove from list.
201 this->RemoveReferenceFromList(*reference);
229 202
230 for (auto& kv : cache) { 203 // Close the file.
231 // If the path in the cache doesn't start with path, then bail on this file. 204 if (reference->file) {
232 if (kv.first.rfind(path, 0) != 0) { 205 reference->file.reset();
233 continue; 206 num_open_files--;
234 } 207 }
208}
235 209
236 const auto& entry = cache[kv.first]; 210void RealVfsFilesystem::EvictSingleReference() {
237 if (!entry.expired()) { 211 if (num_open_files < MaxOpenFiles || open_references.empty()) {
238 entry.lock()->Close(); 212 return;
239 } 213 }
214
215 // Get and remove from list.
216 auto& reference = open_references.back();
217 this->RemoveReferenceFromList(reference);
240 218
241 cache.erase(kv.first); 219 // Close the file.
220 if (reference.file) {
221 reference.file.reset();
222 num_open_files--;
242 } 223 }
243 224
244 return FS::RemoveDirRecursively(path); 225 // Reinsert into closed list.
226 this->InsertReferenceIntoList(reference);
227}
228
229void RealVfsFilesystem::InsertReferenceIntoList(FileReference& reference) {
230 if (reference.file) {
231 open_references.push_front(reference);
232 } else {
233 closed_references.push_front(reference);
234 }
235}
236
237void RealVfsFilesystem::RemoveReferenceFromList(FileReference& reference) {
238 if (reference.file) {
239 open_references.erase(open_references.iterator_to(reference));
240 } else {
241 closed_references.erase(closed_references.iterator_to(reference));
242 }
245} 243}
246 244
247RealVfsFile::RealVfsFile(RealVfsFilesystem& base_, std::shared_ptr<FS::IOFile> backing_, 245RealVfsFile::RealVfsFile(RealVfsFilesystem& base_, std::unique_ptr<FileReference> reference_,
248 const std::string& path_, Mode perms_) 246 const std::string& path_, Mode perms_)
249 : base(base_), backing(std::move(backing_)), path(path_), parent_path(FS::GetParentPath(path_)), 247 : base(base_), reference(std::move(reference_)), path(path_),
250 path_components(FS::SplitPathComponents(path_)), perms(perms_) {} 248 parent_path(FS::GetParentPath(path_)), path_components(FS::SplitPathComponents(path_)),
249 perms(perms_) {}
251 250
252RealVfsFile::~RealVfsFile() = default; 251RealVfsFile::~RealVfsFile() {
252 base.DropReference(std::move(reference));
253}
253 254
254std::string RealVfsFile::GetName() const { 255std::string RealVfsFile::GetName() const {
255 return path_components.back(); 256 return path_components.back();
256} 257}
257 258
258std::size_t RealVfsFile::GetSize() const { 259std::size_t RealVfsFile::GetSize() const {
259 return backing->GetSize(); 260 base.RefreshReference(path, perms, *reference);
261 return reference->file ? reference->file->GetSize() : 0;
260} 262}
261 263
262bool RealVfsFile::Resize(std::size_t new_size) { 264bool RealVfsFile::Resize(std::size_t new_size) {
263 return backing->SetSize(new_size); 265 base.RefreshReference(path, perms, *reference);
266 return reference->file ? reference->file->SetSize(new_size) : false;
264} 267}
265 268
266VirtualDir RealVfsFile::GetContainingDirectory() const { 269VirtualDir RealVfsFile::GetContainingDirectory() const {
@@ -276,27 +279,25 @@ bool RealVfsFile::IsReadable() const {
276} 279}
277 280
278std::size_t RealVfsFile::Read(u8* data, std::size_t length, std::size_t offset) const { 281std::size_t RealVfsFile::Read(u8* data, std::size_t length, std::size_t offset) const {
279 if (!backing->Seek(static_cast<s64>(offset))) { 282 base.RefreshReference(path, perms, *reference);
283 if (!reference->file || !reference->file->Seek(static_cast<s64>(offset))) {
280 return 0; 284 return 0;
281 } 285 }
282 return backing->ReadSpan(std::span{data, length}); 286 return reference->file->ReadSpan(std::span{data, length});
283} 287}
284 288
285std::size_t RealVfsFile::Write(const u8* data, std::size_t length, std::size_t offset) { 289std::size_t RealVfsFile::Write(const u8* data, std::size_t length, std::size_t offset) {
286 if (!backing->Seek(static_cast<s64>(offset))) { 290 base.RefreshReference(path, perms, *reference);
291 if (!reference->file || !reference->file->Seek(static_cast<s64>(offset))) {
287 return 0; 292 return 0;
288 } 293 }
289 return backing->WriteSpan(std::span{data, length}); 294 return reference->file->WriteSpan(std::span{data, length});
290} 295}
291 296
292bool RealVfsFile::Rename(std::string_view name) { 297bool RealVfsFile::Rename(std::string_view name) {
293 return base.MoveFile(path, parent_path + '/' + std::string(name)) != nullptr; 298 return base.MoveFile(path, parent_path + '/' + std::string(name)) != nullptr;
294} 299}
295 300
296void RealVfsFile::Close() {
297 backing->Close();
298}
299
300// TODO(DarkLordZach): MSVC would not let me combine the following two functions using 'if 301// TODO(DarkLordZach): MSVC would not let me combine the following two functions using 'if
301// constexpr' because there is a compile error in the branch not used. 302// constexpr' because there is a compile error in the branch not used.
302 303
diff --git a/src/core/file_sys/vfs_real.h b/src/core/file_sys/vfs_real.h
index b92c84316..d8c900e33 100644
--- a/src/core/file_sys/vfs_real.h
+++ b/src/core/file_sys/vfs_real.h
@@ -3,8 +3,9 @@
3 3
4#pragma once 4#pragma once
5 5
6#include <map>
6#include <string_view> 7#include <string_view>
7#include <boost/container/flat_map.hpp> 8#include "common/intrusive_list.h"
8#include "core/file_sys/mode.h" 9#include "core/file_sys/mode.h"
9#include "core/file_sys/vfs.h" 10#include "core/file_sys/vfs.h"
10 11
@@ -14,6 +15,11 @@ class IOFile;
14 15
15namespace FileSys { 16namespace FileSys {
16 17
18struct FileReference : public Common::IntrusiveListBaseNode<FileReference> {
19 std::shared_ptr<Common::FS::IOFile> file{};
20};
21
22class RealVfsFile;
17class RealVfsFilesystem : public VfsFilesystem { 23class RealVfsFilesystem : public VfsFilesystem {
18public: 24public:
19 RealVfsFilesystem(); 25 RealVfsFilesystem();
@@ -35,7 +41,21 @@ public:
35 bool DeleteDirectory(std::string_view path) override; 41 bool DeleteDirectory(std::string_view path) override;
36 42
37private: 43private:
38 boost::container::flat_map<std::string, std::weak_ptr<Common::FS::IOFile>> cache; 44 using ReferenceListType = Common::IntrusiveListBaseTraits<FileReference>::ListType;
45 std::map<std::string, std::weak_ptr<VfsFile>, std::less<>> cache;
46 ReferenceListType open_references;
47 ReferenceListType closed_references;
48 size_t num_open_files{};
49
50private:
51 friend class RealVfsFile;
52 void RefreshReference(const std::string& path, Mode perms, FileReference& reference);
53 void DropReference(std::unique_ptr<FileReference>&& reference);
54 void EvictSingleReference();
55
56private:
57 void InsertReferenceIntoList(FileReference& reference);
58 void RemoveReferenceFromList(FileReference& reference);
39}; 59};
40 60
41// An implementation of VfsFile that represents a file on the user's computer. 61// An implementation of VfsFile that represents a file on the user's computer.
@@ -57,13 +77,11 @@ public:
57 bool Rename(std::string_view name) override; 77 bool Rename(std::string_view name) override;
58 78
59private: 79private:
60 RealVfsFile(RealVfsFilesystem& base, std::shared_ptr<Common::FS::IOFile> backing, 80 RealVfsFile(RealVfsFilesystem& base, std::unique_ptr<FileReference> reference,
61 const std::string& path, Mode perms = Mode::Read); 81 const std::string& path, Mode perms = Mode::Read);
62 82
63 void Close();
64
65 RealVfsFilesystem& base; 83 RealVfsFilesystem& base;
66 std::shared_ptr<Common::FS::IOFile> backing; 84 std::unique_ptr<FileReference> reference;
67 std::string path; 85 std::string path;
68 std::string parent_path; 86 std::string parent_path;
69 std::vector<std::string> path_components; 87 std::vector<std::string> path_components;
diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp
index 70480b725..908811e2c 100644
--- a/src/core/hle/kernel/k_thread.cpp
+++ b/src/core/hle/kernel/k_thread.cpp
@@ -4,6 +4,8 @@
4#include <algorithm> 4#include <algorithm>
5#include <atomic> 5#include <atomic>
6#include <cinttypes> 6#include <cinttypes>
7#include <condition_variable>
8#include <mutex>
7#include <optional> 9#include <optional>
8#include <vector> 10#include <vector>
9 11
@@ -1313,7 +1315,8 @@ void KThread::RequestDummyThreadWait() {
1313 ASSERT(this->IsDummyThread()); 1315 ASSERT(this->IsDummyThread());
1314 1316
1315 // We will block when the scheduler lock is released. 1317 // We will block when the scheduler lock is released.
1316 m_dummy_thread_runnable.store(false); 1318 std::scoped_lock lock{m_dummy_thread_mutex};
1319 m_dummy_thread_runnable = false;
1317} 1320}
1318 1321
1319void KThread::DummyThreadBeginWait() { 1322void KThread::DummyThreadBeginWait() {
@@ -1323,7 +1326,8 @@ void KThread::DummyThreadBeginWait() {
1323 } 1326 }
1324 1327
1325 // Block until runnable is no longer false. 1328 // Block until runnable is no longer false.
1326 m_dummy_thread_runnable.wait(false); 1329 std::unique_lock lock{m_dummy_thread_mutex};
1330 m_dummy_thread_cv.wait(lock, [this] { return m_dummy_thread_runnable; });
1327} 1331}
1328 1332
1329void KThread::DummyThreadEndWait() { 1333void KThread::DummyThreadEndWait() {
@@ -1331,8 +1335,11 @@ void KThread::DummyThreadEndWait() {
1331 ASSERT(this->IsDummyThread()); 1335 ASSERT(this->IsDummyThread());
1332 1336
1333 // Wake up the waiting thread. 1337 // Wake up the waiting thread.
1334 m_dummy_thread_runnable.store(true); 1338 {
1335 m_dummy_thread_runnable.notify_one(); 1339 std::scoped_lock lock{m_dummy_thread_mutex};
1340 m_dummy_thread_runnable = true;
1341 }
1342 m_dummy_thread_cv.notify_one();
1336} 1343}
1337 1344
1338void KThread::BeginWait(KThreadQueue* queue) { 1345void KThread::BeginWait(KThreadQueue* queue) {
diff --git a/src/core/hle/kernel/k_thread.h b/src/core/hle/kernel/k_thread.h
index f9814ac8f..37fe5db77 100644
--- a/src/core/hle/kernel/k_thread.h
+++ b/src/core/hle/kernel/k_thread.h
@@ -892,7 +892,9 @@ private:
892 std::shared_ptr<Common::Fiber> m_host_context{}; 892 std::shared_ptr<Common::Fiber> m_host_context{};
893 ThreadType m_thread_type{}; 893 ThreadType m_thread_type{};
894 StepState m_step_state{}; 894 StepState m_step_state{};
895 std::atomic<bool> m_dummy_thread_runnable{true}; 895 bool m_dummy_thread_runnable{true};
896 std::mutex m_dummy_thread_mutex{};
897 std::condition_variable m_dummy_thread_cv{};
896 898
897 // For debugging 899 // For debugging
898 std::vector<KSynchronizationObject*> m_wait_objects_for_debugging{}; 900 std::vector<KSynchronizationObject*> m_wait_objects_for_debugging{};
diff --git a/src/core/hle/service/nfc/common/amiibo_crypto.cpp b/src/core/hle/service/nfc/common/amiibo_crypto.cpp
index b2bcb68c3..bc232c334 100644
--- a/src/core/hle/service/nfc/common/amiibo_crypto.cpp
+++ b/src/core/hle/service/nfc/common/amiibo_crypto.cpp
@@ -36,12 +36,12 @@ bool IsAmiiboValid(const EncryptedNTAG215File& ntag_file) {
36 36
37 // Validate UUID 37 // Validate UUID
38 constexpr u8 CT = 0x88; // As defined in `ISO / IEC 14443 - 3` 38 constexpr u8 CT = 0x88; // As defined in `ISO / IEC 14443 - 3`
39 if ((CT ^ ntag_file.uuid.uid[0] ^ ntag_file.uuid.uid[1] ^ ntag_file.uuid.uid[2]) != 39 if ((CT ^ ntag_file.uuid.part1[0] ^ ntag_file.uuid.part1[1] ^ ntag_file.uuid.part1[2]) !=
40 ntag_file.uuid.uid[3]) { 40 ntag_file.uuid.crc_check1) {
41 return false; 41 return false;
42 } 42 }
43 if ((ntag_file.uuid.uid[4] ^ ntag_file.uuid.uid[5] ^ ntag_file.uuid.uid[6] ^ 43 if ((ntag_file.uuid.part2[0] ^ ntag_file.uuid.part2[1] ^ ntag_file.uuid.part2[2] ^
44 ntag_file.uuid.nintendo_id) != ntag_file.uuid.lock_bytes[0]) { 44 ntag_file.uuid.nintendo_id) != ntag_file.uuid_crc_check2) {
45 return false; 45 return false;
46 } 46 }
47 47
@@ -74,8 +74,9 @@ bool IsAmiiboValid(const NTAG215File& ntag_file) {
74NTAG215File NfcDataToEncodedData(const EncryptedNTAG215File& nfc_data) { 74NTAG215File NfcDataToEncodedData(const EncryptedNTAG215File& nfc_data) {
75 NTAG215File encoded_data{}; 75 NTAG215File encoded_data{};
76 76
77 encoded_data.uid = nfc_data.uuid.uid; 77 encoded_data.uid = nfc_data.uuid;
78 encoded_data.nintendo_id = nfc_data.uuid.nintendo_id; 78 encoded_data.uid_crc_check2 = nfc_data.uuid_crc_check2;
79 encoded_data.internal_number = nfc_data.internal_number;
79 encoded_data.static_lock = nfc_data.static_lock; 80 encoded_data.static_lock = nfc_data.static_lock;
80 encoded_data.compability_container = nfc_data.compability_container; 81 encoded_data.compability_container = nfc_data.compability_container;
81 encoded_data.hmac_data = nfc_data.user_memory.hmac_data; 82 encoded_data.hmac_data = nfc_data.user_memory.hmac_data;
@@ -94,7 +95,6 @@ NTAG215File NfcDataToEncodedData(const EncryptedNTAG215File& nfc_data) {
94 encoded_data.register_info_crc = nfc_data.user_memory.register_info_crc; 95 encoded_data.register_info_crc = nfc_data.user_memory.register_info_crc;
95 encoded_data.application_area = nfc_data.user_memory.application_area; 96 encoded_data.application_area = nfc_data.user_memory.application_area;
96 encoded_data.hmac_tag = nfc_data.user_memory.hmac_tag; 97 encoded_data.hmac_tag = nfc_data.user_memory.hmac_tag;
97 encoded_data.lock_bytes = nfc_data.uuid.lock_bytes;
98 encoded_data.model_info = nfc_data.user_memory.model_info; 98 encoded_data.model_info = nfc_data.user_memory.model_info;
99 encoded_data.keygen_salt = nfc_data.user_memory.keygen_salt; 99 encoded_data.keygen_salt = nfc_data.user_memory.keygen_salt;
100 encoded_data.dynamic_lock = nfc_data.dynamic_lock; 100 encoded_data.dynamic_lock = nfc_data.dynamic_lock;
@@ -108,9 +108,9 @@ NTAG215File NfcDataToEncodedData(const EncryptedNTAG215File& nfc_data) {
108EncryptedNTAG215File EncodedDataToNfcData(const NTAG215File& encoded_data) { 108EncryptedNTAG215File EncodedDataToNfcData(const NTAG215File& encoded_data) {
109 EncryptedNTAG215File nfc_data{}; 109 EncryptedNTAG215File nfc_data{};
110 110
111 nfc_data.uuid.uid = encoded_data.uid; 111 nfc_data.uuid = encoded_data.uid;
112 nfc_data.uuid.nintendo_id = encoded_data.nintendo_id; 112 nfc_data.uuid_crc_check2 = encoded_data.uid_crc_check2;
113 nfc_data.uuid.lock_bytes = encoded_data.lock_bytes; 113 nfc_data.internal_number = encoded_data.internal_number;
114 nfc_data.static_lock = encoded_data.static_lock; 114 nfc_data.static_lock = encoded_data.static_lock;
115 nfc_data.compability_container = encoded_data.compability_container; 115 nfc_data.compability_container = encoded_data.compability_container;
116 nfc_data.user_memory.hmac_data = encoded_data.hmac_data; 116 nfc_data.user_memory.hmac_data = encoded_data.hmac_data;
@@ -139,23 +139,12 @@ EncryptedNTAG215File EncodedDataToNfcData(const NTAG215File& encoded_data) {
139 return nfc_data; 139 return nfc_data;
140} 140}
141 141
142u32 GetTagPassword(const TagUuid& uuid) {
143 // Verify that the generated password is correct
144 u32 password = 0xAA ^ (uuid.uid[1] ^ uuid.uid[3]);
145 password &= (0x55 ^ (uuid.uid[2] ^ uuid.uid[4])) << 8;
146 password &= (0xAA ^ (uuid.uid[3] ^ uuid.uid[5])) << 16;
147 password &= (0x55 ^ (uuid.uid[4] ^ uuid.uid[6])) << 24;
148 return password;
149}
150
151HashSeed GetSeed(const NTAG215File& data) { 142HashSeed GetSeed(const NTAG215File& data) {
152 HashSeed seed{ 143 HashSeed seed{
153 .magic = data.write_counter, 144 .magic = data.write_counter,
154 .padding = {}, 145 .padding = {},
155 .uid_1 = data.uid, 146 .uid_1 = data.uid,
156 .nintendo_id_1 = data.nintendo_id,
157 .uid_2 = data.uid, 147 .uid_2 = data.uid,
158 .nintendo_id_2 = data.nintendo_id,
159 .keygen_salt = data.keygen_salt, 148 .keygen_salt = data.keygen_salt,
160 }; 149 };
161 150
@@ -177,10 +166,11 @@ std::vector<u8> GenerateInternalKey(const InternalKey& key, const HashSeed& seed
177 output.insert(output.end(), key.magic_bytes.begin(), 166 output.insert(output.end(), key.magic_bytes.begin(),
178 key.magic_bytes.begin() + key.magic_length); 167 key.magic_bytes.begin() + key.magic_length);
179 168
180 output.insert(output.end(), seed.uid_1.begin(), seed.uid_1.end()); 169 std::array<u8, sizeof(NFP::TagUuid)> seed_uuid{};
181 output.emplace_back(seed.nintendo_id_1); 170 memcpy(seed_uuid.data(), &seed.uid_1, sizeof(NFP::TagUuid));
182 output.insert(output.end(), seed.uid_2.begin(), seed.uid_2.end()); 171 output.insert(output.end(), seed_uuid.begin(), seed_uuid.end());
183 output.emplace_back(seed.nintendo_id_2); 172 memcpy(seed_uuid.data(), &seed.uid_2, sizeof(NFP::TagUuid));
173 output.insert(output.end(), seed_uuid.begin(), seed_uuid.end());
184 174
185 for (std::size_t i = 0; i < sizeof(seed.keygen_salt); i++) { 175 for (std::size_t i = 0; i < sizeof(seed.keygen_salt); i++) {
186 output.emplace_back(static_cast<u8>(seed.keygen_salt[i] ^ key.xor_pad[i])); 176 output.emplace_back(static_cast<u8>(seed.keygen_salt[i] ^ key.xor_pad[i]));
@@ -264,8 +254,8 @@ void Cipher(const DerivedKeys& keys, const NTAG215File& in_data, NTAG215File& ou
264 254
265 // Copy the rest of the data directly 255 // Copy the rest of the data directly
266 out_data.uid = in_data.uid; 256 out_data.uid = in_data.uid;
267 out_data.nintendo_id = in_data.nintendo_id; 257 out_data.uid_crc_check2 = in_data.uid_crc_check2;
268 out_data.lock_bytes = in_data.lock_bytes; 258 out_data.internal_number = in_data.internal_number;
269 out_data.static_lock = in_data.static_lock; 259 out_data.static_lock = in_data.static_lock;
270 out_data.compability_container = in_data.compability_container; 260 out_data.compability_container = in_data.compability_container;
271 261
diff --git a/src/core/hle/service/nfc/common/amiibo_crypto.h b/src/core/hle/service/nfc/common/amiibo_crypto.h
index bf3044ed9..6a3e0841e 100644
--- a/src/core/hle/service/nfc/common/amiibo_crypto.h
+++ b/src/core/hle/service/nfc/common/amiibo_crypto.h
@@ -24,10 +24,8 @@ using DrgbOutput = std::array<u8, 0x20>;
24struct HashSeed { 24struct HashSeed {
25 u16_be magic; 25 u16_be magic;
26 std::array<u8, 0xE> padding; 26 std::array<u8, 0xE> padding;
27 NFC::UniqueSerialNumber uid_1; 27 TagUuid uid_1;
28 u8 nintendo_id_1; 28 TagUuid uid_2;
29 NFC::UniqueSerialNumber uid_2;
30 u8 nintendo_id_2;
31 std::array<u8, 0x20> keygen_salt; 29 std::array<u8, 0x20> keygen_salt;
32}; 30};
33static_assert(sizeof(HashSeed) == 0x40, "HashSeed is an invalid size"); 31static_assert(sizeof(HashSeed) == 0x40, "HashSeed is an invalid size");
@@ -69,9 +67,6 @@ NTAG215File NfcDataToEncodedData(const EncryptedNTAG215File& nfc_data);
69/// Converts from encoded file format to encrypted file format 67/// Converts from encoded file format to encrypted file format
70EncryptedNTAG215File EncodedDataToNfcData(const NTAG215File& encoded_data); 68EncryptedNTAG215File EncodedDataToNfcData(const NTAG215File& encoded_data);
71 69
72/// Returns password needed to allow write access to protected memory
73u32 GetTagPassword(const TagUuid& uuid);
74
75// Generates Seed needed for key derivation 70// Generates Seed needed for key derivation
76HashSeed GetSeed(const NTAG215File& data); 71HashSeed GetSeed(const NTAG215File& data);
77 72
diff --git a/src/core/hle/service/nfc/common/device.cpp b/src/core/hle/service/nfc/common/device.cpp
index 0bd7900e1..f4b180b06 100644
--- a/src/core/hle/service/nfc/common/device.cpp
+++ b/src/core/hle/service/nfc/common/device.cpp
@@ -12,6 +12,11 @@
12#pragma warning(pop) 12#pragma warning(pop)
13#endif 13#endif
14 14
15#include <fmt/format.h>
16
17#include "common/fs/file.h"
18#include "common/fs/fs.h"
19#include "common/fs/path_util.h"
15#include "common/input.h" 20#include "common/input.h"
16#include "common/logging/log.h" 21#include "common/logging/log.h"
17#include "common/string_util.h" 22#include "common/string_util.h"
@@ -136,7 +141,7 @@ bool NfcDevice::LoadNfcTag(std::span<const u8> data) {
136 if (!NFP::AmiiboCrypto::IsKeyAvailable()) { 141 if (!NFP::AmiiboCrypto::IsKeyAvailable()) {
137 LOG_INFO(Service_NFC, "Loading amiibo without keys"); 142 LOG_INFO(Service_NFC, "Loading amiibo without keys");
138 memcpy(&encrypted_tag_data, data.data(), sizeof(NFP::EncryptedNTAG215File)); 143 memcpy(&encrypted_tag_data, data.data(), sizeof(NFP::EncryptedNTAG215File));
139 BuildAmiiboWithoutKeys(); 144 BuildAmiiboWithoutKeys(tag_data, encrypted_tag_data);
140 is_plain_amiibo = true; 145 is_plain_amiibo = true;
141 is_write_protected = true; 146 is_write_protected = true;
142 return true; 147 return true;
@@ -237,34 +242,39 @@ Result NfcDevice::GetTagInfo(NFP::TagInfo& tag_info, bool is_mifare) const {
237 return ResultWrongDeviceState; 242 return ResultWrongDeviceState;
238 } 243 }
239 244
240 UniqueSerialNumber uuid = encrypted_tag_data.uuid.uid; 245 UniqueSerialNumber uuid{};
241 246 u8 uuid_length{};
242 // Generate random UUID to bypass amiibo load limits 247 NfcProtocol protocol{NfcProtocol::TypeA};
243 if (Settings::values.random_amiibo_id) { 248 TagType tag_type{TagType::Type2};
244 Common::TinyMT rng{};
245 rng.Initialize(static_cast<u32>(GetCurrentPosixTime()));
246 rng.GenerateRandomBytes(uuid.data(), sizeof(UniqueSerialNumber));
247 uuid[3] = 0x88 ^ uuid[0] ^ uuid[1] ^ uuid[2];
248 }
249 249
250 if (is_mifare) { 250 if (is_mifare) {
251 tag_info = { 251 tag_type = TagType::Mifare;
252 .uuid = uuid, 252 uuid_length = sizeof(NFP::NtagTagUuid);
253 .uuid_extension = {}, 253 memcpy(uuid.data(), mifare_data.data(), uuid_length);
254 .uuid_length = static_cast<u8>(uuid.size()), 254 } else {
255 .protocol = NfcProtocol::TypeA, 255 tag_type = TagType::Type2;
256 .tag_type = TagType::Type4, 256 uuid_length = sizeof(NFP::NtagTagUuid);
257 NFP::NtagTagUuid nUuid{
258 .part1 = encrypted_tag_data.uuid.part1,
259 .part2 = encrypted_tag_data.uuid.part2,
260 .nintendo_id = encrypted_tag_data.uuid.nintendo_id,
257 }; 261 };
258 return ResultSuccess; 262 memcpy(uuid.data(), &nUuid, uuid_length);
263
264 // Generate random UUID to bypass amiibo load limits
265 if (Settings::values.random_amiibo_id) {
266 Common::TinyMT rng{};
267 rng.Initialize(static_cast<u32>(GetCurrentPosixTime()));
268 rng.GenerateRandomBytes(uuid.data(), uuid_length);
269 }
259 } 270 }
260 271
261 // Protocol and tag type may change here 272 // Protocol and tag type may change here
262 tag_info = { 273 tag_info = {
263 .uuid = uuid, 274 .uuid = uuid,
264 .uuid_extension = {}, 275 .uuid_length = uuid_length,
265 .uuid_length = static_cast<u8>(uuid.size()), 276 .protocol = protocol,
266 .protocol = NfcProtocol::TypeA, 277 .tag_type = tag_type,
267 .tag_type = TagType::Type2,
268 }; 278 };
269 279
270 return ResultSuccess; 280 return ResultSuccess;
@@ -272,8 +282,38 @@ Result NfcDevice::GetTagInfo(NFP::TagInfo& tag_info, bool is_mifare) const {
272 282
273Result NfcDevice::ReadMifare(std::span<const MifareReadBlockParameter> parameters, 283Result NfcDevice::ReadMifare(std::span<const MifareReadBlockParameter> parameters,
274 std::span<MifareReadBlockData> read_block_data) const { 284 std::span<MifareReadBlockData> read_block_data) const {
285 if (device_state != DeviceState::TagFound && device_state != DeviceState::TagMounted) {
286 LOG_ERROR(Service_NFC, "Wrong device state {}", device_state);
287 if (device_state == DeviceState::TagRemoved) {
288 return ResultTagRemoved;
289 }
290 return ResultWrongDeviceState;
291 }
292
275 Result result = ResultSuccess; 293 Result result = ResultSuccess;
276 294
295 TagInfo tag_info{};
296 result = GetTagInfo(tag_info, true);
297
298 if (result.IsError()) {
299 return result;
300 }
301
302 if (tag_info.protocol != NfcProtocol::TypeA || tag_info.tag_type != TagType::Mifare) {
303 return ResultInvalidTagType;
304 }
305
306 if (parameters.size() == 0) {
307 return ResultInvalidArgument;
308 }
309
310 const auto unknown = parameters[0].sector_key.unknown;
311 for (std::size_t i = 0; i < parameters.size(); i++) {
312 if (unknown != parameters[i].sector_key.unknown) {
313 return ResultInvalidArgument;
314 }
315 }
316
277 for (std::size_t i = 0; i < parameters.size(); i++) { 317 for (std::size_t i = 0; i < parameters.size(); i++) {
278 result = ReadMifare(parameters[i], read_block_data[i]); 318 result = ReadMifare(parameters[i], read_block_data[i]);
279 if (result.IsError()) { 319 if (result.IsError()) {
@@ -288,17 +328,8 @@ Result NfcDevice::ReadMifare(const MifareReadBlockParameter& parameter,
288 MifareReadBlockData& read_block_data) const { 328 MifareReadBlockData& read_block_data) const {
289 const std::size_t sector_index = parameter.sector_number * sizeof(DataBlock); 329 const std::size_t sector_index = parameter.sector_number * sizeof(DataBlock);
290 read_block_data.sector_number = parameter.sector_number; 330 read_block_data.sector_number = parameter.sector_number;
291
292 if (device_state != DeviceState::TagFound && device_state != DeviceState::TagMounted) {
293 LOG_ERROR(Service_NFC, "Wrong device state {}", device_state);
294 if (device_state == DeviceState::TagRemoved) {
295 return ResultTagRemoved;
296 }
297 return ResultWrongDeviceState;
298 }
299
300 if (mifare_data.size() < sector_index + sizeof(DataBlock)) { 331 if (mifare_data.size() < sector_index + sizeof(DataBlock)) {
301 return Mifare::ResultReadError; 332 return ResultMifareError288;
302 } 333 }
303 334
304 // TODO: Use parameter.sector_key to read encrypted data 335 // TODO: Use parameter.sector_key to read encrypted data
@@ -310,6 +341,28 @@ Result NfcDevice::ReadMifare(const MifareReadBlockParameter& parameter,
310Result NfcDevice::WriteMifare(std::span<const MifareWriteBlockParameter> parameters) { 341Result NfcDevice::WriteMifare(std::span<const MifareWriteBlockParameter> parameters) {
311 Result result = ResultSuccess; 342 Result result = ResultSuccess;
312 343
344 TagInfo tag_info{};
345 result = GetTagInfo(tag_info, true);
346
347 if (result.IsError()) {
348 return result;
349 }
350
351 if (tag_info.protocol != NfcProtocol::TypeA || tag_info.tag_type != TagType::Mifare) {
352 return ResultInvalidTagType;
353 }
354
355 if (parameters.size() == 0) {
356 return ResultInvalidArgument;
357 }
358
359 const auto unknown = parameters[0].sector_key.unknown;
360 for (std::size_t i = 0; i < parameters.size(); i++) {
361 if (unknown != parameters[i].sector_key.unknown) {
362 return ResultInvalidArgument;
363 }
364 }
365
313 for (std::size_t i = 0; i < parameters.size(); i++) { 366 for (std::size_t i = 0; i < parameters.size(); i++) {
314 result = WriteMifare(parameters[i]); 367 result = WriteMifare(parameters[i]);
315 if (result.IsError()) { 368 if (result.IsError()) {
@@ -319,7 +372,7 @@ Result NfcDevice::WriteMifare(std::span<const MifareWriteBlockParameter> paramet
319 372
320 if (!npad_device->WriteNfc(mifare_data)) { 373 if (!npad_device->WriteNfc(mifare_data)) {
321 LOG_ERROR(Service_NFP, "Error writing to file"); 374 LOG_ERROR(Service_NFP, "Error writing to file");
322 return Mifare::ResultReadError; 375 return ResultMifareError288;
323 } 376 }
324 377
325 return result; 378 return result;
@@ -337,7 +390,7 @@ Result NfcDevice::WriteMifare(const MifareWriteBlockParameter& parameter) {
337 } 390 }
338 391
339 if (mifare_data.size() < sector_index + sizeof(DataBlock)) { 392 if (mifare_data.size() < sector_index + sizeof(DataBlock)) {
340 return Mifare::ResultReadError; 393 return ResultMifareError288;
341 } 394 }
342 395
343 // TODO: Use parameter.sector_key to encrypt the data 396 // TODO: Use parameter.sector_key to encrypt the data
@@ -361,21 +414,30 @@ Result NfcDevice::Mount(NFP::ModelType model_type, NFP::MountTarget mount_target
361 414
362 if (!NFP::AmiiboCrypto::IsAmiiboValid(encrypted_tag_data)) { 415 if (!NFP::AmiiboCrypto::IsAmiiboValid(encrypted_tag_data)) {
363 LOG_ERROR(Service_NFP, "Not an amiibo"); 416 LOG_ERROR(Service_NFP, "Not an amiibo");
364 return ResultNotAnAmiibo; 417 return ResultInvalidTagType;
365 } 418 }
366 419
367 // The loaded amiibo is not encrypted 420 // The loaded amiibo is not encrypted
368 if (is_plain_amiibo) { 421 if (is_plain_amiibo) {
422 std::vector<u8> data(sizeof(NFP::NTAG215File));
423 memcpy(data.data(), &tag_data, sizeof(tag_data));
424 WriteBackupData(tag_data.uid, data);
425
369 device_state = DeviceState::TagMounted; 426 device_state = DeviceState::TagMounted;
370 mount_target = mount_target_; 427 mount_target = mount_target_;
371 return ResultSuccess; 428 return ResultSuccess;
372 } 429 }
373 430
374 if (!NFP::AmiiboCrypto::DecodeAmiibo(encrypted_tag_data, tag_data)) { 431 if (!NFP::AmiiboCrypto::DecodeAmiibo(encrypted_tag_data, tag_data)) {
375 LOG_ERROR(Service_NFP, "Can't decode amiibo {}", device_state); 432 bool has_backup = HasBackup(encrypted_tag_data.uuid).IsSuccess();
376 return ResultCorruptedData; 433 LOG_ERROR(Service_NFP, "Can't decode amiibo, has_backup= {}", has_backup);
434 return has_backup ? ResultCorruptedDataWithBackup : ResultCorruptedData;
377 } 435 }
378 436
437 std::vector<u8> data(sizeof(NFP::EncryptedNTAG215File));
438 memcpy(data.data(), &encrypted_tag_data, sizeof(encrypted_tag_data));
439 WriteBackupData(encrypted_tag_data.uuid, data);
440
379 device_state = DeviceState::TagMounted; 441 device_state = DeviceState::TagMounted;
380 mount_target = mount_target_; 442 mount_target = mount_target_;
381 return ResultSuccess; 443 return ResultSuccess;
@@ -470,6 +532,7 @@ Result NfcDevice::FlushWithBreak(NFP::BreakType break_type) {
470 std::vector<u8> data(sizeof(NFP::EncryptedNTAG215File)); 532 std::vector<u8> data(sizeof(NFP::EncryptedNTAG215File));
471 if (is_plain_amiibo) { 533 if (is_plain_amiibo) {
472 memcpy(data.data(), &tag_data, sizeof(tag_data)); 534 memcpy(data.data(), &tag_data, sizeof(tag_data));
535 WriteBackupData(tag_data.uid, data);
473 } else { 536 } else {
474 if (!NFP::AmiiboCrypto::EncodeAmiibo(tag_data, encrypted_tag_data)) { 537 if (!NFP::AmiiboCrypto::EncodeAmiibo(tag_data, encrypted_tag_data)) {
475 LOG_ERROR(Service_NFP, "Failed to encode data"); 538 LOG_ERROR(Service_NFP, "Failed to encode data");
@@ -477,6 +540,7 @@ Result NfcDevice::FlushWithBreak(NFP::BreakType break_type) {
477 } 540 }
478 541
479 memcpy(data.data(), &encrypted_tag_data, sizeof(encrypted_tag_data)); 542 memcpy(data.data(), &encrypted_tag_data, sizeof(encrypted_tag_data));
543 WriteBackupData(encrypted_tag_data.uuid, data);
480 } 544 }
481 545
482 if (!npad_device->WriteNfc(data)) { 546 if (!npad_device->WriteNfc(data)) {
@@ -488,7 +552,7 @@ Result NfcDevice::FlushWithBreak(NFP::BreakType break_type) {
488} 552}
489 553
490Result NfcDevice::Restore() { 554Result NfcDevice::Restore() {
491 if (device_state != DeviceState::TagMounted) { 555 if (device_state != DeviceState::TagFound) {
492 LOG_ERROR(Service_NFP, "Wrong device state {}", device_state); 556 LOG_ERROR(Service_NFP, "Wrong device state {}", device_state);
493 if (device_state == DeviceState::TagRemoved) { 557 if (device_state == DeviceState::TagRemoved) {
494 return ResultTagRemoved; 558 return ResultTagRemoved;
@@ -496,13 +560,59 @@ Result NfcDevice::Restore() {
496 return ResultWrongDeviceState; 560 return ResultWrongDeviceState;
497 } 561 }
498 562
499 if (mount_target == NFP::MountTarget::None || mount_target == NFP::MountTarget::Rom) { 563 NFC::TagInfo tag_info{};
500 LOG_ERROR(Service_NFC, "Amiibo is read only", device_state); 564 std::array<u8, sizeof(NFP::EncryptedNTAG215File)> data{};
501 return ResultWrongDeviceState; 565 Result result = GetTagInfo(tag_info, false);
566
567 if (result.IsError()) {
568 return result;
502 } 569 }
503 570
504 // TODO: Load amiibo from backup on system 571 result = ReadBackupData(tag_info.uuid, tag_info.uuid_length, data);
505 LOG_ERROR(Service_NFP, "Not Implemented"); 572
573 if (result.IsError()) {
574 return result;
575 }
576
577 NFP::NTAG215File temporary_tag_data{};
578 NFP::EncryptedNTAG215File temporary_encrypted_tag_data{};
579
580 // Fallback for encrypted amiibos without keys
581 if (is_write_protected) {
582 return ResultWriteAmiiboFailed;
583 }
584
585 // Fallback for plain amiibos
586 if (is_plain_amiibo) {
587 LOG_INFO(Service_NFP, "Restoring backup of plain amiibo");
588 memcpy(&temporary_tag_data, data.data(), sizeof(NFP::EncryptedNTAG215File));
589 temporary_encrypted_tag_data = NFP::AmiiboCrypto::EncodedDataToNfcData(temporary_tag_data);
590 }
591
592 if (!is_plain_amiibo) {
593 LOG_INFO(Service_NFP, "Restoring backup of encrypted amiibo");
594 temporary_tag_data = {};
595 memcpy(&temporary_encrypted_tag_data, data.data(), sizeof(NFP::EncryptedNTAG215File));
596 }
597
598 if (!NFP::AmiiboCrypto::IsAmiiboValid(temporary_encrypted_tag_data)) {
599 return ResultInvalidTagType;
600 }
601
602 if (!is_plain_amiibo) {
603 if (!NFP::AmiiboCrypto::DecodeAmiibo(temporary_encrypted_tag_data, temporary_tag_data)) {
604 LOG_ERROR(Service_NFP, "Can't decode amiibo");
605 return ResultCorruptedData;
606 }
607 }
608
609 // Overwrite tag contents with backup and mount the tag
610 tag_data = temporary_tag_data;
611 encrypted_tag_data = temporary_encrypted_tag_data;
612 device_state = DeviceState::TagMounted;
613 mount_target = NFP::MountTarget::All;
614 is_data_moddified = true;
615
506 return ResultSuccess; 616 return ResultSuccess;
507} 617}
508 618
@@ -1132,16 +1242,98 @@ Result NfcDevice::BreakTag(NFP::BreakType break_type) {
1132 return FlushWithBreak(break_type); 1242 return FlushWithBreak(break_type);
1133} 1243}
1134 1244
1135Result NfcDevice::ReadBackupData(std::span<u8> data) const { 1245Result NfcDevice::HasBackup(const UniqueSerialNumber& uid, std::size_t uuid_size) const {
1136 // Not implemented 1246 ASSERT_MSG(uuid_size < sizeof(UniqueSerialNumber), "Invalid UUID size");
1247 constexpr auto backup_dir = "backup";
1248 const auto yuzu_amiibo_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::AmiiboDir);
1249 const auto file_name =
1250 fmt::format("{0:02x}.bin", fmt::join(uid.begin(), uid.begin() + uuid_size, ""));
1251
1252 if (!Common::FS::Exists(yuzu_amiibo_dir / backup_dir / file_name)) {
1253 return ResultUnableToAccessBackupFile;
1254 }
1255
1137 return ResultSuccess; 1256 return ResultSuccess;
1138} 1257}
1139 1258
1140Result NfcDevice::WriteBackupData(std::span<const u8> data) { 1259Result NfcDevice::HasBackup(const NFP::TagUuid& tag_uid) const {
1141 // Not implemented 1260 UniqueSerialNumber uuid{};
1261 memcpy(uuid.data(), &tag_uid, sizeof(NFP::TagUuid));
1262 return HasBackup(uuid, sizeof(NFP::TagUuid));
1263}
1264
1265Result NfcDevice::ReadBackupData(const UniqueSerialNumber& uid, std::size_t uuid_size,
1266 std::span<u8> data) const {
1267 ASSERT_MSG(uuid_size < sizeof(UniqueSerialNumber), "Invalid UUID size");
1268 constexpr auto backup_dir = "backup";
1269 const auto yuzu_amiibo_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::AmiiboDir);
1270 const auto file_name =
1271 fmt::format("{0:02x}.bin", fmt::join(uid.begin(), uid.begin() + uuid_size, ""));
1272
1273 const Common::FS::IOFile keys_file{yuzu_amiibo_dir / backup_dir / file_name,
1274 Common::FS::FileAccessMode::Read,
1275 Common::FS::FileType::BinaryFile};
1276
1277 if (!keys_file.IsOpen()) {
1278 LOG_ERROR(Service_NFP, "Failed to open amiibo backup");
1279 return ResultUnableToAccessBackupFile;
1280 }
1281
1282 if (keys_file.Read(data) != data.size()) {
1283 LOG_ERROR(Service_NFP, "Failed to read amiibo backup");
1284 return ResultUnableToAccessBackupFile;
1285 }
1286
1287 return ResultSuccess;
1288}
1289
1290Result NfcDevice::ReadBackupData(const NFP::TagUuid& tag_uid, std::span<u8> data) const {
1291 UniqueSerialNumber uuid{};
1292 memcpy(uuid.data(), &tag_uid, sizeof(NFP::TagUuid));
1293 return ReadBackupData(uuid, sizeof(NFP::TagUuid), data);
1294}
1295
1296Result NfcDevice::WriteBackupData(const UniqueSerialNumber& uid, std::size_t uuid_size,
1297 std::span<const u8> data) {
1298 ASSERT_MSG(uuid_size < sizeof(UniqueSerialNumber), "Invalid UUID size");
1299 constexpr auto backup_dir = "backup";
1300 const auto yuzu_amiibo_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::AmiiboDir);
1301 const auto file_name =
1302 fmt::format("{0:02x}.bin", fmt::join(uid.begin(), uid.begin() + uuid_size, ""));
1303
1304 if (HasBackup(uid, uuid_size).IsError()) {
1305 if (!Common::FS::CreateDir(yuzu_amiibo_dir / backup_dir)) {
1306 return ResultBackupPathAlreadyExist;
1307 }
1308
1309 if (!Common::FS::NewFile(yuzu_amiibo_dir / backup_dir / file_name)) {
1310 return ResultBackupPathAlreadyExist;
1311 }
1312 }
1313
1314 const Common::FS::IOFile keys_file{yuzu_amiibo_dir / backup_dir / file_name,
1315 Common::FS::FileAccessMode::ReadWrite,
1316 Common::FS::FileType::BinaryFile};
1317
1318 if (!keys_file.IsOpen()) {
1319 LOG_ERROR(Service_NFP, "Failed to open amiibo backup");
1320 return ResultUnableToAccessBackupFile;
1321 }
1322
1323 if (keys_file.Write(data) != data.size()) {
1324 LOG_ERROR(Service_NFP, "Failed to write amiibo backup");
1325 return ResultUnableToAccessBackupFile;
1326 }
1327
1142 return ResultSuccess; 1328 return ResultSuccess;
1143} 1329}
1144 1330
1331Result NfcDevice::WriteBackupData(const NFP::TagUuid& tag_uid, std::span<const u8> data) {
1332 UniqueSerialNumber uuid{};
1333 memcpy(uuid.data(), &tag_uid, sizeof(NFP::TagUuid));
1334 return WriteBackupData(uuid, sizeof(NFP::TagUuid), data);
1335}
1336
1145Result NfcDevice::WriteNtf(std::span<const u8> data) { 1337Result NfcDevice::WriteNtf(std::span<const u8> data) {
1146 if (device_state != DeviceState::TagMounted) { 1338 if (device_state != DeviceState::TagMounted) {
1147 LOG_ERROR(Service_NFC, "Wrong device state {}", device_state); 1339 LOG_ERROR(Service_NFC, "Wrong device state {}", device_state);
@@ -1177,7 +1369,8 @@ NFP::AmiiboName NfcDevice::GetAmiiboName(const NFP::AmiiboSettings& settings) co
1177 return amiibo_name; 1369 return amiibo_name;
1178} 1370}
1179 1371
1180void NfcDevice::SetAmiiboName(NFP::AmiiboSettings& settings, const NFP::AmiiboName& amiibo_name) { 1372void NfcDevice::SetAmiiboName(NFP::AmiiboSettings& settings,
1373 const NFP::AmiiboName& amiibo_name) const {
1181 std::array<char16_t, NFP::amiibo_name_length> settings_amiibo_name{}; 1374 std::array<char16_t, NFP::amiibo_name_length> settings_amiibo_name{};
1182 1375
1183 // Convert from utf8 to utf16 1376 // Convert from utf8 to utf16
@@ -1258,22 +1451,23 @@ void NfcDevice::UpdateRegisterInfoCrc() {
1258 tag_data.register_info_crc = crc.checksum(); 1451 tag_data.register_info_crc = crc.checksum();
1259} 1452}
1260 1453
1261void NfcDevice::BuildAmiiboWithoutKeys() { 1454void NfcDevice::BuildAmiiboWithoutKeys(NFP::NTAG215File& stubbed_tag_data,
1455 const NFP::EncryptedNTAG215File& encrypted_file) const {
1262 Service::Mii::MiiManager manager; 1456 Service::Mii::MiiManager manager;
1263 auto& settings = tag_data.settings; 1457 auto& settings = stubbed_tag_data.settings;
1264 1458
1265 tag_data = NFP::AmiiboCrypto::NfcDataToEncodedData(encrypted_tag_data); 1459 stubbed_tag_data = NFP::AmiiboCrypto::NfcDataToEncodedData(encrypted_file);
1266 1460
1267 // Common info 1461 // Common info
1268 tag_data.write_counter = 0; 1462 stubbed_tag_data.write_counter = 0;
1269 tag_data.amiibo_version = 0; 1463 stubbed_tag_data.amiibo_version = 0;
1270 settings.write_date = GetAmiiboDate(GetCurrentPosixTime()); 1464 settings.write_date = GetAmiiboDate(GetCurrentPosixTime());
1271 1465
1272 // Register info 1466 // Register info
1273 SetAmiiboName(settings, {'y', 'u', 'z', 'u', 'A', 'm', 'i', 'i', 'b', 'o'}); 1467 SetAmiiboName(settings, {'y', 'u', 'z', 'u', 'A', 'm', 'i', 'i', 'b', 'o'});
1274 settings.settings.font_region.Assign(0); 1468 settings.settings.font_region.Assign(0);
1275 settings.init_date = GetAmiiboDate(GetCurrentPosixTime()); 1469 settings.init_date = GetAmiiboDate(GetCurrentPosixTime());
1276 tag_data.owner_mii = manager.BuildFromStoreData(manager.BuildDefault(0)); 1470 stubbed_tag_data.owner_mii = manager.BuildFromStoreData(manager.BuildDefault(0));
1277 1471
1278 // Admin info 1472 // Admin info
1279 settings.settings.amiibo_initialized.Assign(1); 1473 settings.settings.amiibo_initialized.Assign(1);
diff --git a/src/core/hle/service/nfc/common/device.h b/src/core/hle/service/nfc/common/device.h
index 6a37e8458..7560210d6 100644
--- a/src/core/hle/service/nfc/common/device.h
+++ b/src/core/hle/service/nfc/common/device.h
@@ -86,8 +86,14 @@ public:
86 Result GetAll(NFP::NfpData& data) const; 86 Result GetAll(NFP::NfpData& data) const;
87 Result SetAll(const NFP::NfpData& data); 87 Result SetAll(const NFP::NfpData& data);
88 Result BreakTag(NFP::BreakType break_type); 88 Result BreakTag(NFP::BreakType break_type);
89 Result ReadBackupData(std::span<u8> data) const; 89 Result HasBackup(const UniqueSerialNumber& uid, std::size_t uuid_size) const;
90 Result WriteBackupData(std::span<const u8> data); 90 Result HasBackup(const NFP::TagUuid& tag_uid) const;
91 Result ReadBackupData(const UniqueSerialNumber& uid, std::size_t uuid_size,
92 std::span<u8> data) const;
93 Result ReadBackupData(const NFP::TagUuid& tag_uid, std::span<u8> data) const;
94 Result WriteBackupData(const UniqueSerialNumber& uid, std::size_t uuid_size,
95 std::span<const u8> data);
96 Result WriteBackupData(const NFP::TagUuid& tag_uid, std::span<const u8> data);
91 Result WriteNtf(std::span<const u8> data); 97 Result WriteNtf(std::span<const u8> data);
92 98
93 u64 GetHandle() const; 99 u64 GetHandle() const;
@@ -103,14 +109,15 @@ private:
103 void CloseNfcTag(); 109 void CloseNfcTag();
104 110
105 NFP::AmiiboName GetAmiiboName(const NFP::AmiiboSettings& settings) const; 111 NFP::AmiiboName GetAmiiboName(const NFP::AmiiboSettings& settings) const;
106 void SetAmiiboName(NFP::AmiiboSettings& settings, const NFP::AmiiboName& amiibo_name); 112 void SetAmiiboName(NFP::AmiiboSettings& settings, const NFP::AmiiboName& amiibo_name) const;
107 NFP::AmiiboDate GetAmiiboDate(s64 posix_time) const; 113 NFP::AmiiboDate GetAmiiboDate(s64 posix_time) const;
108 u64 GetCurrentPosixTime() const; 114 u64 GetCurrentPosixTime() const;
109 u64 RemoveVersionByte(u64 application_id) const; 115 u64 RemoveVersionByte(u64 application_id) const;
110 void UpdateSettingsCrc(); 116 void UpdateSettingsCrc();
111 void UpdateRegisterInfoCrc(); 117 void UpdateRegisterInfoCrc();
112 118
113 void BuildAmiiboWithoutKeys(); 119 void BuildAmiiboWithoutKeys(NFP::NTAG215File& stubbed_tag_data,
120 const NFP::EncryptedNTAG215File& encrypted_file) const;
114 121
115 bool is_controller_set{}; 122 bool is_controller_set{};
116 int callback_key; 123 int callback_key;
diff --git a/src/core/hle/service/nfc/common/device_manager.cpp b/src/core/hle/service/nfc/common/device_manager.cpp
index d5deaaf27..b0456508e 100644
--- a/src/core/hle/service/nfc/common/device_manager.cpp
+++ b/src/core/hle/service/nfc/common/device_manager.cpp
@@ -543,9 +543,14 @@ Result DeviceManager::ReadBackupData(u64 device_handle, std::span<u8> data) cons
543 543
544 std::shared_ptr<NfcDevice> device = nullptr; 544 std::shared_ptr<NfcDevice> device = nullptr;
545 auto result = GetDeviceHandle(device_handle, device); 545 auto result = GetDeviceHandle(device_handle, device);
546 NFC::TagInfo tag_info{};
546 547
547 if (result.IsSuccess()) { 548 if (result.IsSuccess()) {
548 result = device->ReadBackupData(data); 549 result = device->GetTagInfo(tag_info, false);
550 }
551
552 if (result.IsSuccess()) {
553 result = device->ReadBackupData(tag_info.uuid, tag_info.uuid_length, data);
549 result = VerifyDeviceResult(device, result); 554 result = VerifyDeviceResult(device, result);
550 } 555 }
551 556
@@ -557,9 +562,14 @@ Result DeviceManager::WriteBackupData(u64 device_handle, std::span<const u8> dat
557 562
558 std::shared_ptr<NfcDevice> device = nullptr; 563 std::shared_ptr<NfcDevice> device = nullptr;
559 auto result = GetDeviceHandle(device_handle, device); 564 auto result = GetDeviceHandle(device_handle, device);
565 NFC::TagInfo tag_info{};
566
567 if (result.IsSuccess()) {
568 result = device->GetTagInfo(tag_info, false);
569 }
560 570
561 if (result.IsSuccess()) { 571 if (result.IsSuccess()) {
562 result = device->WriteBackupData(data); 572 result = device->WriteBackupData(tag_info.uuid, tag_info.uuid_length, data);
563 result = VerifyDeviceResult(device, result); 573 result = VerifyDeviceResult(device, result);
564 } 574 }
565 575
diff --git a/src/core/hle/service/nfc/mifare_result.h b/src/core/hle/service/nfc/mifare_result.h
index 4b60048a5..16a9171e6 100644
--- a/src/core/hle/service/nfc/mifare_result.h
+++ b/src/core/hle/service/nfc/mifare_result.h
@@ -12,6 +12,6 @@ constexpr Result ResultInvalidArgument(ErrorModule::NFCMifare, 65);
12constexpr Result ResultWrongDeviceState(ErrorModule::NFCMifare, 73); 12constexpr Result ResultWrongDeviceState(ErrorModule::NFCMifare, 73);
13constexpr Result ResultNfcDisabled(ErrorModule::NFCMifare, 80); 13constexpr Result ResultNfcDisabled(ErrorModule::NFCMifare, 80);
14constexpr Result ResultTagRemoved(ErrorModule::NFCMifare, 97); 14constexpr Result ResultTagRemoved(ErrorModule::NFCMifare, 97);
15constexpr Result ResultReadError(ErrorModule::NFCMifare, 288); 15constexpr Result ResultNotAMifare(ErrorModule::NFCMifare, 288);
16 16
17} // namespace Service::NFC::Mifare 17} // namespace Service::NFC::Mifare
diff --git a/src/core/hle/service/nfc/nfc_interface.cpp b/src/core/hle/service/nfc/nfc_interface.cpp
index 0fa29d398..130fb7f78 100644
--- a/src/core/hle/service/nfc/nfc_interface.cpp
+++ b/src/core/hle/service/nfc/nfc_interface.cpp
@@ -142,9 +142,13 @@ void NfcInterface::AttachAvailabilityChangeEvent(HLERequestContext& ctx) {
142void NfcInterface::StartDetection(HLERequestContext& ctx) { 142void NfcInterface::StartDetection(HLERequestContext& ctx) {
143 IPC::RequestParser rp{ctx}; 143 IPC::RequestParser rp{ctx};
144 const auto device_handle{rp.Pop<u64>()}; 144 const auto device_handle{rp.Pop<u64>()};
145 const auto tag_protocol{rp.PopEnum<NfcProtocol>()}; 145 auto tag_protocol{NfcProtocol::All};
146 LOG_INFO(Service_NFC, "called, device_handle={}, nfp_protocol={}", device_handle, tag_protocol); 146
147 if (backend_type == BackendType::Nfc) {
148 tag_protocol = rp.PopEnum<NfcProtocol>();
149 }
147 150
151 LOG_INFO(Service_NFC, "called, device_handle={}, nfp_protocol={}", device_handle, tag_protocol);
148 auto result = GetManager()->StartDetection(device_handle, tag_protocol); 152 auto result = GetManager()->StartDetection(device_handle, tag_protocol);
149 result = TranslateResultToServiceError(result); 153 result = TranslateResultToServiceError(result);
150 154
@@ -302,7 +306,7 @@ Result NfcInterface::TranslateResultToServiceError(Result result) const {
302 return TranslateResultToNfp(result); 306 return TranslateResultToNfp(result);
303 } 307 }
304 default: 308 default:
305 if (result != ResultUnknown216) { 309 if (result != ResultBackupPathAlreadyExist) {
306 return result; 310 return result;
307 } 311 }
308 return ResultUnknown74; 312 return ResultUnknown74;
@@ -343,6 +347,9 @@ Result NfcInterface::TranslateResultToNfp(Result result) const {
343 if (result == ResultApplicationAreaIsNotInitialized) { 347 if (result == ResultApplicationAreaIsNotInitialized) {
344 return NFP::ResultApplicationAreaIsNotInitialized; 348 return NFP::ResultApplicationAreaIsNotInitialized;
345 } 349 }
350 if (result == ResultCorruptedDataWithBackup) {
351 return NFP::ResultCorruptedDataWithBackup;
352 }
346 if (result == ResultCorruptedData) { 353 if (result == ResultCorruptedData) {
347 return NFP::ResultCorruptedData; 354 return NFP::ResultCorruptedData;
348 } 355 }
@@ -352,9 +359,12 @@ Result NfcInterface::TranslateResultToNfp(Result result) const {
352 if (result == ResultApplicationAreaExist) { 359 if (result == ResultApplicationAreaExist) {
353 return NFP::ResultApplicationAreaExist; 360 return NFP::ResultApplicationAreaExist;
354 } 361 }
355 if (result == ResultNotAnAmiibo) { 362 if (result == ResultInvalidTagType) {
356 return NFP::ResultNotAnAmiibo; 363 return NFP::ResultNotAnAmiibo;
357 } 364 }
365 if (result == ResultUnableToAccessBackupFile) {
366 return NFP::ResultUnableToAccessBackupFile;
367 }
358 LOG_WARNING(Service_NFC, "Result conversion not handled"); 368 LOG_WARNING(Service_NFC, "Result conversion not handled");
359 return result; 369 return result;
360} 370}
@@ -375,6 +385,9 @@ Result NfcInterface::TranslateResultToMifare(Result result) const {
375 if (result == ResultTagRemoved) { 385 if (result == ResultTagRemoved) {
376 return Mifare::ResultTagRemoved; 386 return Mifare::ResultTagRemoved;
377 } 387 }
388 if (result == ResultInvalidTagType) {
389 return Mifare::ResultNotAMifare;
390 }
378 LOG_WARNING(Service_NFC, "Result conversion not handled"); 391 LOG_WARNING(Service_NFC, "Result conversion not handled");
379 return result; 392 return result;
380} 393}
diff --git a/src/core/hle/service/nfc/nfc_result.h b/src/core/hle/service/nfc/nfc_result.h
index 917d79ef8..715c0e80c 100644
--- a/src/core/hle/service/nfc/nfc_result.h
+++ b/src/core/hle/service/nfc/nfc_result.h
@@ -9,20 +9,23 @@ namespace Service::NFC {
9 9
10constexpr Result ResultDeviceNotFound(ErrorModule::NFC, 64); 10constexpr Result ResultDeviceNotFound(ErrorModule::NFC, 64);
11constexpr Result ResultInvalidArgument(ErrorModule::NFC, 65); 11constexpr Result ResultInvalidArgument(ErrorModule::NFC, 65);
12constexpr Result ResultWrongApplicationAreaSize(ErrorModule::NFP, 68); 12constexpr Result ResultWrongApplicationAreaSize(ErrorModule::NFC, 68);
13constexpr Result ResultWrongDeviceState(ErrorModule::NFC, 73); 13constexpr Result ResultWrongDeviceState(ErrorModule::NFC, 73);
14constexpr Result ResultUnknown74(ErrorModule::NFC, 74); 14constexpr Result ResultUnknown74(ErrorModule::NFC, 74);
15constexpr Result ResultUnknown76(ErrorModule::NFC, 76); 15constexpr Result ResultUnknown76(ErrorModule::NFC, 76);
16constexpr Result ResultNfcNotInitialized(ErrorModule::NFC, 77); 16constexpr Result ResultNfcNotInitialized(ErrorModule::NFC, 77);
17constexpr Result ResultNfcDisabled(ErrorModule::NFC, 80); 17constexpr Result ResultNfcDisabled(ErrorModule::NFC, 80);
18constexpr Result ResultWriteAmiiboFailed(ErrorModule::NFP, 88); 18constexpr Result ResultWriteAmiiboFailed(ErrorModule::NFC, 88);
19constexpr Result ResultTagRemoved(ErrorModule::NFC, 97); 19constexpr Result ResultTagRemoved(ErrorModule::NFC, 97);
20constexpr Result ResultRegistrationIsNotInitialized(ErrorModule::NFP, 120); 20constexpr Result ResultUnableToAccessBackupFile(ErrorModule::NFC, 113);
21constexpr Result ResultApplicationAreaIsNotInitialized(ErrorModule::NFP, 128); 21constexpr Result ResultRegistrationIsNotInitialized(ErrorModule::NFC, 120);
22constexpr Result ResultCorruptedData(ErrorModule::NFP, 144); 22constexpr Result ResultApplicationAreaIsNotInitialized(ErrorModule::NFC, 128);
23constexpr Result ResultWrongApplicationAreaId(ErrorModule::NFP, 152); 23constexpr Result ResultCorruptedDataWithBackup(ErrorModule::NFC, 136);
24constexpr Result ResultApplicationAreaExist(ErrorModule::NFP, 168); 24constexpr Result ResultCorruptedData(ErrorModule::NFC, 144);
25constexpr Result ResultNotAnAmiibo(ErrorModule::NFP, 178); 25constexpr Result ResultWrongApplicationAreaId(ErrorModule::NFC, 152);
26constexpr Result ResultUnknown216(ErrorModule::NFC, 216); 26constexpr Result ResultApplicationAreaExist(ErrorModule::NFC, 168);
27constexpr Result ResultInvalidTagType(ErrorModule::NFC, 178);
28constexpr Result ResultBackupPathAlreadyExist(ErrorModule::NFC, 216);
29constexpr Result ResultMifareError288(ErrorModule::NFC, 288);
27 30
28} // namespace Service::NFC 31} // namespace Service::NFC
diff --git a/src/core/hle/service/nfc/nfc_types.h b/src/core/hle/service/nfc/nfc_types.h
index c7ebd1fdb..68e724442 100644
--- a/src/core/hle/service/nfc/nfc_types.h
+++ b/src/core/hle/service/nfc/nfc_types.h
@@ -35,32 +35,35 @@ enum class State : u32 {
35 35
36// This is nn::nfc::TagType 36// This is nn::nfc::TagType
37enum class TagType : u32 { 37enum class TagType : u32 {
38 None, 38 None = 0,
39 Type1, // ISO14443A RW 96-2k bytes 106kbit/s 39 Type1 = 1U << 0, // ISO14443A RW. Topaz
40 Type2, // ISO14443A RW/RO 540 bytes 106kbit/s 40 Type2 = 1U << 1, // ISO14443A RW. Ultralight, NTAGX, ST25TN
41 Type3, // Sony FeliCa RW/RO 2k bytes 212kbit/s 41 Type3 = 1U << 2, // ISO14443A RW/RO. Sony FeliCa
42 Type4, // ISO14443A RW/RO 4k-32k bytes 424kbit/s 42 Type4A = 1U << 3, // ISO14443A RW/RO. DESFire
43 Type5, // ISO15693 RW/RO 540 bytes 106kbit/s 43 Type4B = 1U << 4, // ISO14443B RW/RO. DESFire
44 Type5 = 1U << 5, // ISO15693 RW/RO. SLI, SLIX, ST25TV
45 Mifare = 1U << 6, // Mifare classic. Skylanders
46 All = 0xFFFFFFFF,
44}; 47};
45 48
46enum class PackedTagType : u8 { 49enum class PackedTagType : u8 {
47 None, 50 None = 0,
48 Type1, // ISO14443A RW 96-2k bytes 106kbit/s 51 Type1 = 1U << 0, // ISO14443A RW. Topaz
49 Type2, // ISO14443A RW/RO 540 bytes 106kbit/s 52 Type2 = 1U << 1, // ISO14443A RW. Ultralight, NTAGX, ST25TN
50 Type3, // Sony FeliCa RW/RO 2k bytes 212kbit/s 53 Type3 = 1U << 2, // ISO14443A RW/RO. Sony FeliCa
51 Type4, // ISO14443A RW/RO 4k-32k bytes 424kbit/s 54 Type4A = 1U << 3, // ISO14443A RW/RO. DESFire
52 Type5, // ISO15693 RW/RO 540 bytes 106kbit/s 55 Type4B = 1U << 4, // ISO14443B RW/RO. DESFire
56 Type5 = 1U << 5, // ISO15693 RW/RO. SLI, SLIX, ST25TV
57 Mifare = 1U << 6, // Mifare classic. Skylanders
58 All = 0xFF,
53}; 59};
54 60
55// This is nn::nfc::NfcProtocol 61// This is nn::nfc::NfcProtocol
56// Verify this enum. It might be completely wrong default protocol is 0x48
57enum class NfcProtocol : u32 { 62enum class NfcProtocol : u32 {
58 None, 63 None,
59 TypeA = 1U << 0, // ISO14443A 64 TypeA = 1U << 0, // ISO14443A
60 TypeB = 1U << 1, // ISO14443B 65 TypeB = 1U << 1, // ISO14443B
61 TypeF = 1U << 2, // Sony FeliCa 66 TypeF = 1U << 2, // Sony FeliCa
62 Unknown1 = 1U << 3,
63 Unknown2 = 1U << 5,
64 All = 0xFFFFFFFFU, 67 All = 0xFFFFFFFFU,
65}; 68};
66 69
@@ -69,8 +72,7 @@ enum class TestWaveType : u32 {
69 Unknown, 72 Unknown,
70}; 73};
71 74
72using UniqueSerialNumber = std::array<u8, 7>; 75using UniqueSerialNumber = std::array<u8, 10>;
73using UniqueSerialNumberExtension = std::array<u8, 3>;
74 76
75// This is nn::nfc::DeviceHandle 77// This is nn::nfc::DeviceHandle
76using DeviceHandle = u64; 78using DeviceHandle = u64;
@@ -78,7 +80,6 @@ using DeviceHandle = u64;
78// This is nn::nfc::TagInfo 80// This is nn::nfc::TagInfo
79struct TagInfo { 81struct TagInfo {
80 UniqueSerialNumber uuid; 82 UniqueSerialNumber uuid;
81 UniqueSerialNumberExtension uuid_extension;
82 u8 uuid_length; 83 u8 uuid_length;
83 INSERT_PADDING_BYTES(0x15); 84 INSERT_PADDING_BYTES(0x15);
84 NfcProtocol protocol; 85 NfcProtocol protocol;
diff --git a/src/core/hle/service/nfp/nfp_interface.cpp b/src/core/hle/service/nfp/nfp_interface.cpp
index 21d159154..34ef9d82d 100644
--- a/src/core/hle/service/nfp/nfp_interface.cpp
+++ b/src/core/hle/service/nfp/nfp_interface.cpp
@@ -126,7 +126,7 @@ void Interface::Flush(HLERequestContext& ctx) {
126void Interface::Restore(HLERequestContext& ctx) { 126void Interface::Restore(HLERequestContext& ctx) {
127 IPC::RequestParser rp{ctx}; 127 IPC::RequestParser rp{ctx};
128 const auto device_handle{rp.Pop<u64>()}; 128 const auto device_handle{rp.Pop<u64>()};
129 LOG_WARNING(Service_NFP, "(STUBBED) called, device_handle={}", device_handle); 129 LOG_INFO(Service_NFP, "called, device_handle={}", device_handle);
130 130
131 auto result = GetManager()->Restore(device_handle); 131 auto result = GetManager()->Restore(device_handle);
132 result = TranslateResultToServiceError(result); 132 result = TranslateResultToServiceError(result);
@@ -394,7 +394,7 @@ void Interface::BreakTag(HLERequestContext& ctx) {
394void Interface::ReadBackupData(HLERequestContext& ctx) { 394void Interface::ReadBackupData(HLERequestContext& ctx) {
395 IPC::RequestParser rp{ctx}; 395 IPC::RequestParser rp{ctx};
396 const auto device_handle{rp.Pop<u64>()}; 396 const auto device_handle{rp.Pop<u64>()};
397 LOG_WARNING(Service_NFP, "(STUBBED) called, device_handle={}", device_handle); 397 LOG_INFO(Service_NFP, "called, device_handle={}", device_handle);
398 398
399 std::vector<u8> backup_data{}; 399 std::vector<u8> backup_data{};
400 auto result = GetManager()->ReadBackupData(device_handle, backup_data); 400 auto result = GetManager()->ReadBackupData(device_handle, backup_data);
@@ -412,7 +412,7 @@ void Interface::WriteBackupData(HLERequestContext& ctx) {
412 IPC::RequestParser rp{ctx}; 412 IPC::RequestParser rp{ctx};
413 const auto device_handle{rp.Pop<u64>()}; 413 const auto device_handle{rp.Pop<u64>()};
414 const auto backup_data_buffer{ctx.ReadBuffer()}; 414 const auto backup_data_buffer{ctx.ReadBuffer()};
415 LOG_WARNING(Service_NFP, "(STUBBED) called, device_handle={}", device_handle); 415 LOG_INFO(Service_NFP, "called, device_handle={}", device_handle);
416 416
417 auto result = GetManager()->WriteBackupData(device_handle, backup_data_buffer); 417 auto result = GetManager()->WriteBackupData(device_handle, backup_data_buffer);
418 result = TranslateResultToServiceError(result); 418 result = TranslateResultToServiceError(result);
diff --git a/src/core/hle/service/nfp/nfp_result.h b/src/core/hle/service/nfp/nfp_result.h
index 4c126cd81..618533843 100644
--- a/src/core/hle/service/nfp/nfp_result.h
+++ b/src/core/hle/service/nfp/nfp_result.h
@@ -17,9 +17,11 @@ constexpr Result ResultWriteAmiiboFailed(ErrorModule::NFP, 88);
17constexpr Result ResultTagRemoved(ErrorModule::NFP, 97); 17constexpr Result ResultTagRemoved(ErrorModule::NFP, 97);
18constexpr Result ResultRegistrationIsNotInitialized(ErrorModule::NFP, 120); 18constexpr Result ResultRegistrationIsNotInitialized(ErrorModule::NFP, 120);
19constexpr Result ResultApplicationAreaIsNotInitialized(ErrorModule::NFP, 128); 19constexpr Result ResultApplicationAreaIsNotInitialized(ErrorModule::NFP, 128);
20constexpr Result ResultCorruptedDataWithBackup(ErrorModule::NFP, 136);
20constexpr Result ResultCorruptedData(ErrorModule::NFP, 144); 21constexpr Result ResultCorruptedData(ErrorModule::NFP, 144);
21constexpr Result ResultWrongApplicationAreaId(ErrorModule::NFP, 152); 22constexpr Result ResultWrongApplicationAreaId(ErrorModule::NFP, 152);
22constexpr Result ResultApplicationAreaExist(ErrorModule::NFP, 168); 23constexpr Result ResultApplicationAreaExist(ErrorModule::NFP, 168);
23constexpr Result ResultNotAnAmiibo(ErrorModule::NFP, 178); 24constexpr Result ResultNotAnAmiibo(ErrorModule::NFP, 178);
25constexpr Result ResultUnableToAccessBackupFile(ErrorModule::NFP, 200);
24 26
25} // namespace Service::NFP 27} // namespace Service::NFP
diff --git a/src/core/hle/service/nfp/nfp_types.h b/src/core/hle/service/nfp/nfp_types.h
index 7d36d5ee6..aed12a7f8 100644
--- a/src/core/hle/service/nfp/nfp_types.h
+++ b/src/core/hle/service/nfp/nfp_types.h
@@ -85,7 +85,7 @@ enum class CabinetMode : u8 {
85 StartFormatter, 85 StartFormatter,
86}; 86};
87 87
88using LockBytes = std::array<u8, 2>; 88using UuidPart = std::array<u8, 3>;
89using HashData = std::array<u8, 0x20>; 89using HashData = std::array<u8, 0x20>;
90using ApplicationArea = std::array<u8, 0xD8>; 90using ApplicationArea = std::array<u8, 0xD8>;
91using AmiiboName = std::array<char, (amiibo_name_length * 4) + 1>; 91using AmiiboName = std::array<char, (amiibo_name_length * 4) + 1>;
@@ -93,12 +93,20 @@ using AmiiboName = std::array<char, (amiibo_name_length * 4) + 1>;
93// This is nn::nfp::TagInfo 93// This is nn::nfp::TagInfo
94using TagInfo = NFC::TagInfo; 94using TagInfo = NFC::TagInfo;
95 95
96struct NtagTagUuid {
97 UuidPart part1;
98 UuidPart part2;
99 u8 nintendo_id;
100};
101static_assert(sizeof(NtagTagUuid) == 7, "NtagTagUuid is an invalid size");
102
96struct TagUuid { 103struct TagUuid {
97 NFC::UniqueSerialNumber uid; 104 UuidPart part1;
105 u8 crc_check1;
106 UuidPart part2;
98 u8 nintendo_id; 107 u8 nintendo_id;
99 LockBytes lock_bytes;
100}; 108};
101static_assert(sizeof(TagUuid) == 10, "TagUuid is an invalid size"); 109static_assert(sizeof(TagUuid) == 8, "TagUuid is an invalid size");
102 110
103struct WriteDate { 111struct WriteDate {
104 u16 year; 112 u16 year;
@@ -231,7 +239,8 @@ struct EncryptedAmiiboFile {
231static_assert(sizeof(EncryptedAmiiboFile) == 0x1F8, "AmiiboFile is an invalid size"); 239static_assert(sizeof(EncryptedAmiiboFile) == 0x1F8, "AmiiboFile is an invalid size");
232 240
233struct NTAG215File { 241struct NTAG215File {
234 LockBytes lock_bytes; // Tag UUID 242 u8 uid_crc_check2;
243 u8 internal_number;
235 u16 static_lock; // Set defined pages as read only 244 u16 static_lock; // Set defined pages as read only
236 u32 compability_container; // Defines available memory 245 u32 compability_container; // Defines available memory
237 HashData hmac_data; // Hash 246 HashData hmac_data; // Hash
@@ -250,8 +259,7 @@ struct NTAG215File {
250 u32_be register_info_crc; 259 u32_be register_info_crc;
251 ApplicationArea application_area; // Encrypted Game data 260 ApplicationArea application_area; // Encrypted Game data
252 HashData hmac_tag; // Hash 261 HashData hmac_tag; // Hash
253 NFC::UniqueSerialNumber uid; // Unique serial number 262 TagUuid uid;
254 u8 nintendo_id; // Tag UUID
255 AmiiboModelInfo model_info; 263 AmiiboModelInfo model_info;
256 HashData keygen_salt; // Salt 264 HashData keygen_salt; // Salt
257 u32 dynamic_lock; // Dynamic lock 265 u32 dynamic_lock; // Dynamic lock
@@ -264,7 +272,9 @@ static_assert(std::is_trivially_copyable_v<NTAG215File>, "NTAG215File must be tr
264#pragma pack() 272#pragma pack()
265 273
266struct EncryptedNTAG215File { 274struct EncryptedNTAG215File {
267 TagUuid uuid; // Unique serial number 275 TagUuid uuid;
276 u8 uuid_crc_check2;
277 u8 internal_number;
268 u16 static_lock; // Set defined pages as read only 278 u16 static_lock; // Set defined pages as read only
269 u32 compability_container; // Defines available memory 279 u32 compability_container; // Defines available memory
270 EncryptedAmiiboFile user_memory; // Writable data 280 EncryptedAmiiboFile user_memory; // Writable data
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp
index 0c7aee1b8..dc45169ad 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp
@@ -69,7 +69,7 @@ NvResult nvhost_nvdec::Ioctl3(DeviceFD fd, Ioctl command, std::span<const u8> in
69 69
70void nvhost_nvdec::OnOpen(DeviceFD fd) { 70void nvhost_nvdec::OnOpen(DeviceFD fd) {
71 LOG_INFO(Service_NVDRV, "NVDEC video stream started"); 71 LOG_INFO(Service_NVDRV, "NVDEC video stream started");
72 system.AudioCore().SetNVDECActive(true); 72 system.SetNVDECActive(true);
73} 73}
74 74
75void nvhost_nvdec::OnClose(DeviceFD fd) { 75void nvhost_nvdec::OnClose(DeviceFD fd) {
@@ -79,7 +79,7 @@ void nvhost_nvdec::OnClose(DeviceFD fd) {
79 if (iter != host1x_file.fd_to_id.end()) { 79 if (iter != host1x_file.fd_to_id.end()) {
80 system.GPU().ClearCdmaInstance(iter->second); 80 system.GPU().ClearCdmaInstance(iter->second);
81 } 81 }
82 system.AudioCore().SetNVDECActive(false); 82 system.SetNVDECActive(false);
83} 83}
84 84
85} // namespace Service::Nvidia::Devices 85} // namespace Service::Nvidia::Devices
diff --git a/src/core/hle/service/nvnflinger/nvnflinger.cpp b/src/core/hle/service/nvnflinger/nvnflinger.cpp
index aa3356611..b41c6240c 100644
--- a/src/core/hle/service/nvnflinger/nvnflinger.cpp
+++ b/src/core/hle/service/nvnflinger/nvnflinger.cpp
@@ -325,6 +325,10 @@ s64 Nvnflinger::GetNextTicks() const {
325 speed_scale = 0.01f; 325 speed_scale = 0.01f;
326 } 326 }
327 } 327 }
328 if (system.GetNVDECActive() && settings.use_video_framerate.GetValue()) {
329 // Run at intended presentation rate during video playback.
330 speed_scale = 1.f;
331 }
328 332
329 // As an extension, treat nonpositive swap interval as framerate multiplier. 333 // As an extension, treat nonpositive swap interval as framerate multiplier.
330 const f32 effective_fps = swap_interval <= 0 ? 120.f * static_cast<f32>(1 - swap_interval) 334 const f32 effective_fps = swap_interval <= 0 ? 120.f * static_cast<f32>(1 - swap_interval)
diff --git a/src/core/hle/service/time/time_manager.cpp b/src/core/hle/service/time/time_manager.cpp
index 28667710e..fa0fd0531 100644
--- a/src/core/hle/service/time/time_manager.cpp
+++ b/src/core/hle/service/time/time_manager.cpp
@@ -22,10 +22,6 @@ s64 GetSecondsSinceEpoch() {
22 return std::chrono::duration_cast<std::chrono::seconds>(time_since_epoch).count() + 22 return std::chrono::duration_cast<std::chrono::seconds>(time_since_epoch).count() +
23 Settings::values.custom_rtc_differential; 23 Settings::values.custom_rtc_differential;
24} 24}
25
26s64 GetExternalRtcValue() {
27 return GetSecondsSinceEpoch() + TimeManager::GetExternalTimeZoneOffset();
28}
29} // Anonymous namespace 25} // Anonymous namespace
30 26
31struct TimeManager::Impl final { 27struct TimeManager::Impl final {
@@ -43,7 +39,7 @@ struct TimeManager::Impl final {
43 std::make_shared<Clock::EphemeralNetworkSystemClockContextWriter>()}, 39 std::make_shared<Clock::EphemeralNetworkSystemClockContextWriter>()},
44 time_zone_content_manager{system} { 40 time_zone_content_manager{system} {
45 41
46 const auto system_time{Clock::TimeSpanType::FromSeconds(GetExternalRtcValue())}; 42 const auto system_time{Clock::TimeSpanType::FromSeconds(GetSecondsSinceEpoch())};
47 SetupStandardSteadyClock(system, Common::UUID::MakeRandom(), system_time, {}, {}); 43 SetupStandardSteadyClock(system, Common::UUID::MakeRandom(), system_time, {}, {});
48 SetupStandardLocalSystemClock(system, {}, system_time.ToSeconds()); 44 SetupStandardLocalSystemClock(system, {}, system_time.ToSeconds());
49 45
@@ -107,7 +103,7 @@ struct TimeManager::Impl final {
107 103
108 void SetupTimeZoneManager(std::string location_name, 104 void SetupTimeZoneManager(std::string location_name,
109 Clock::SteadyClockTimePoint time_zone_updated_time_point, 105 Clock::SteadyClockTimePoint time_zone_updated_time_point,
110 std::size_t total_location_name_count, u128 time_zone_rule_version, 106 std::vector<std::string> location_names, u128 time_zone_rule_version,
111 FileSys::VirtualFile& vfs_file) { 107 FileSys::VirtualFile& vfs_file) {
112 if (time_zone_content_manager.GetTimeZoneManager().SetDeviceLocationNameWithTimeZoneRule( 108 if (time_zone_content_manager.GetTimeZoneManager().SetDeviceLocationNameWithTimeZoneRule(
113 location_name, vfs_file) != ResultSuccess) { 109 location_name, vfs_file) != ResultSuccess) {
@@ -117,20 +113,13 @@ struct TimeManager::Impl final {
117 113
118 time_zone_content_manager.GetTimeZoneManager().SetUpdatedTime(time_zone_updated_time_point); 114 time_zone_content_manager.GetTimeZoneManager().SetUpdatedTime(time_zone_updated_time_point);
119 time_zone_content_manager.GetTimeZoneManager().SetTotalLocationNameCount( 115 time_zone_content_manager.GetTimeZoneManager().SetTotalLocationNameCount(
120 total_location_name_count); 116 location_names.size());
117 time_zone_content_manager.GetTimeZoneManager().SetLocationNames(location_names);
121 time_zone_content_manager.GetTimeZoneManager().SetTimeZoneRuleVersion( 118 time_zone_content_manager.GetTimeZoneManager().SetTimeZoneRuleVersion(
122 time_zone_rule_version); 119 time_zone_rule_version);
123 time_zone_content_manager.GetTimeZoneManager().MarkAsInitialized(); 120 time_zone_content_manager.GetTimeZoneManager().MarkAsInitialized();
124 } 121 }
125 122
126 static s64 GetExternalTimeZoneOffset() {
127 // With "auto" timezone setting, we use the external system's timezone offset
128 if (Settings::GetTimeZoneString() == "auto") {
129 return Common::TimeZone::GetCurrentOffsetSeconds().count();
130 }
131 return 0;
132 }
133
134 void SetupStandardSteadyClock(Core::System& system_, Common::UUID clock_source_id, 123 void SetupStandardSteadyClock(Core::System& system_, Common::UUID clock_source_id,
135 Clock::TimeSpanType setup_value, 124 Clock::TimeSpanType setup_value,
136 Clock::TimeSpanType internal_offset, bool is_rtc_reset_detected) { 125 Clock::TimeSpanType internal_offset, bool is_rtc_reset_detected) {
@@ -295,19 +284,10 @@ void TimeManager::UpdateLocalSystemClockTime(s64 posix_time) {
295 284
296void TimeManager::SetupTimeZoneManager(std::string location_name, 285void TimeManager::SetupTimeZoneManager(std::string location_name,
297 Clock::SteadyClockTimePoint time_zone_updated_time_point, 286 Clock::SteadyClockTimePoint time_zone_updated_time_point,
298 std::size_t total_location_name_count, 287 std::vector<std::string> location_names,
299 u128 time_zone_rule_version, 288 u128 time_zone_rule_version,
300 FileSys::VirtualFile& vfs_file) { 289 FileSys::VirtualFile& vfs_file) {
301 impl->SetupTimeZoneManager(location_name, time_zone_updated_time_point, 290 impl->SetupTimeZoneManager(location_name, time_zone_updated_time_point, location_names,
302 total_location_name_count, time_zone_rule_version, vfs_file); 291 time_zone_rule_version, vfs_file);
303} 292}
304
305/*static*/ s64 TimeManager::GetExternalTimeZoneOffset() {
306 // With "auto" timezone setting, we use the external system's timezone offset
307 if (Settings::GetTimeZoneString() == "auto") {
308 return Common::TimeZone::GetCurrentOffsetSeconds().count();
309 }
310 return 0;
311}
312
313} // namespace Service::Time 293} // namespace Service::Time
diff --git a/src/core/hle/service/time/time_manager.h b/src/core/hle/service/time/time_manager.h
index 4f046f266..84572dbfa 100644
--- a/src/core/hle/service/time/time_manager.h
+++ b/src/core/hle/service/time/time_manager.h
@@ -61,11 +61,9 @@ public:
61 61
62 void SetupTimeZoneManager(std::string location_name, 62 void SetupTimeZoneManager(std::string location_name,
63 Clock::SteadyClockTimePoint time_zone_updated_time_point, 63 Clock::SteadyClockTimePoint time_zone_updated_time_point,
64 std::size_t total_location_name_count, u128 time_zone_rule_version, 64 std::vector<std::string> location_names, u128 time_zone_rule_version,
65 FileSys::VirtualFile& vfs_file); 65 FileSys::VirtualFile& vfs_file);
66 66
67 static s64 GetExternalTimeZoneOffset();
68
69private: 67private:
70 Core::System& system; 68 Core::System& system;
71 69
diff --git a/src/core/hle/service/time/time_zone_content_manager.cpp b/src/core/hle/service/time/time_zone_content_manager.cpp
index afbfe9715..5d60be67a 100644
--- a/src/core/hle/service/time/time_zone_content_manager.cpp
+++ b/src/core/hle/service/time/time_zone_content_manager.cpp
@@ -1,6 +1,7 @@
1// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later 2// SPDX-License-Identifier: GPL-2.0-or-later
3 3
4#include <chrono>
4#include <sstream> 5#include <sstream>
5 6
6#include "common/logging/log.h" 7#include "common/logging/log.h"
@@ -12,7 +13,11 @@
12#include "core/file_sys/registered_cache.h" 13#include "core/file_sys/registered_cache.h"
13#include "core/file_sys/romfs.h" 14#include "core/file_sys/romfs.h"
14#include "core/file_sys/system_archive/system_archive.h" 15#include "core/file_sys/system_archive/system_archive.h"
16#include "core/file_sys/vfs.h"
17#include "core/file_sys/vfs_types.h"
18#include "core/hle/result.h"
15#include "core/hle/service/filesystem/filesystem.h" 19#include "core/hle/service/filesystem/filesystem.h"
20#include "core/hle/service/time/errors.h"
16#include "core/hle/service/time/time_manager.h" 21#include "core/hle/service/time/time_manager.h"
17#include "core/hle/service/time/time_zone_content_manager.h" 22#include "core/hle/service/time/time_zone_content_manager.h"
18 23
@@ -71,19 +76,13 @@ TimeZoneContentManager::TimeZoneContentManager(Core::System& system_)
71 : system{system_}, location_name_cache{BuildLocationNameCache(system)} {} 76 : system{system_}, location_name_cache{BuildLocationNameCache(system)} {}
72 77
73void TimeZoneContentManager::Initialize(TimeManager& time_manager) { 78void TimeZoneContentManager::Initialize(TimeManager& time_manager) {
74 std::string location_name;
75 const auto timezone_setting = Settings::GetTimeZoneString(); 79 const auto timezone_setting = Settings::GetTimeZoneString();
76 if (timezone_setting == "auto" || timezone_setting == "default") {
77 location_name = Common::TimeZone::GetDefaultTimeZone();
78 } else {
79 location_name = timezone_setting;
80 }
81 80
82 if (FileSys::VirtualFile vfs_file; 81 if (FileSys::VirtualFile vfs_file;
83 GetTimeZoneInfoFile(location_name, vfs_file) == ResultSuccess) { 82 GetTimeZoneInfoFile(timezone_setting, vfs_file) == ResultSuccess) {
84 const auto time_point{ 83 const auto time_point{
85 time_manager.GetStandardSteadyClockCore().GetCurrentTimePoint(system)}; 84 time_manager.GetStandardSteadyClockCore().GetCurrentTimePoint(system)};
86 time_manager.SetupTimeZoneManager(location_name, time_point, location_name_cache.size(), {}, 85 time_manager.SetupTimeZoneManager(timezone_setting, time_point, location_name_cache, {},
87 vfs_file); 86 vfs_file);
88 } else { 87 } else {
89 time_zone_manager.MarkAsInitialized(); 88 time_zone_manager.MarkAsInitialized();
@@ -126,8 +125,15 @@ Result TimeZoneContentManager::GetTimeZoneInfoFile(const std::string& location_n
126 125
127 vfs_file = zoneinfo_dir->GetFileRelative(location_name); 126 vfs_file = zoneinfo_dir->GetFileRelative(location_name);
128 if (!vfs_file) { 127 if (!vfs_file) {
129 LOG_ERROR(Service_Time, "{:016X} has no file \"{}\"! Using default timezone.", 128 LOG_WARNING(Service_Time, "{:016X} has no file \"{}\"! Using system timezone.",
130 time_zone_binary_titleid, location_name); 129 time_zone_binary_titleid, location_name);
130 const std::string system_time_zone{Common::TimeZone::FindSystemTimeZone()};
131 vfs_file = zoneinfo_dir->GetFile(system_time_zone);
132 }
133
134 if (!vfs_file) {
135 LOG_WARNING(Service_Time, "{:016X} has no file \"{}\"! Using default timezone.",
136 time_zone_binary_titleid, location_name);
131 vfs_file = zoneinfo_dir->GetFile(Common::TimeZone::GetDefaultTimeZone()); 137 vfs_file = zoneinfo_dir->GetFile(Common::TimeZone::GetDefaultTimeZone());
132 } 138 }
133 139
diff --git a/src/core/hle/service/time/time_zone_manager.cpp b/src/core/hle/service/time/time_zone_manager.cpp
index 973f7837a..205371a26 100644
--- a/src/core/hle/service/time/time_zone_manager.cpp
+++ b/src/core/hle/service/time/time_zone_manager.cpp
@@ -2,6 +2,7 @@
2// SPDX-License-Identifier: GPL-2.0-or-later 2// SPDX-License-Identifier: GPL-2.0-or-later
3 3
4#include <climits> 4#include <climits>
5#include <limits>
5 6
6#include "common/assert.h" 7#include "common/assert.h"
7#include "common/logging/log.h" 8#include "common/logging/log.h"
@@ -9,6 +10,7 @@
9#include "core/file_sys/nca_metadata.h" 10#include "core/file_sys/nca_metadata.h"
10#include "core/file_sys/registered_cache.h" 11#include "core/file_sys/registered_cache.h"
11#include "core/hle/service/time/time_zone_manager.h" 12#include "core/hle/service/time/time_zone_manager.h"
13#include "core/hle/service/time/time_zone_types.h"
12 14
13namespace Service::Time::TimeZone { 15namespace Service::Time::TimeZone {
14 16
@@ -128,10 +130,10 @@ static constexpr int GetQZName(const char* name, int offset, char delimiter) {
128} 130}
129 131
130static constexpr int GetTZName(const char* name, int offset) { 132static constexpr int GetTZName(const char* name, int offset) {
131 for (char value{name[offset]}; 133 char c;
132 value != '\0' && !IsDigit(value) && value != ',' && value != '-' && value != '+'; 134
133 offset++) { 135 while ((c = name[offset]) != '\0' && !IsDigit(c) && c != ',' && c != '-' && c != '+') {
134 value = name[offset]; 136 ++offset;
135 } 137 }
136 return offset; 138 return offset;
137} 139}
@@ -147,6 +149,7 @@ static constexpr bool GetInteger(const char* name, int& offset, int& value, int
147 if (value > max) { 149 if (value > max) {
148 return {}; 150 return {};
149 } 151 }
152 offset++;
150 temp = name[offset]; 153 temp = name[offset];
151 } while (IsDigit(temp)); 154 } while (IsDigit(temp));
152 155
@@ -471,6 +474,13 @@ static bool ParsePosixName(const char* name, TimeZoneRule& rule) {
471 their_std_offset = their_offset; 474 their_std_offset = their_offset;
472 } 475 }
473 } 476 }
477
478 if (rule.time_count > 0) {
479 UNIMPLEMENTED();
480 // TODO (lat9nq): Implement eggert/tz/localtime.c:tzparse:1329
481 // Seems to be unused in yuzu for now: I never hit the UNIMPLEMENTED in testing
482 }
483
474 rule.ttis[0].gmt_offset = -std_offset; 484 rule.ttis[0].gmt_offset = -std_offset;
475 rule.ttis[0].is_dst = false; 485 rule.ttis[0].is_dst = false;
476 rule.ttis[0].abbreviation_list_index = 0; 486 rule.ttis[0].abbreviation_list_index = 0;
@@ -514,6 +524,7 @@ static bool ParseTimeZoneBinary(TimeZoneRule& time_zone_rule, FileSys::VirtualFi
514 524
515 constexpr s32 time_zone_max_leaps{50}; 525 constexpr s32 time_zone_max_leaps{50};
516 constexpr s32 time_zone_max_chars{50}; 526 constexpr s32 time_zone_max_chars{50};
527 constexpr s32 time_zone_max_times{1000};
517 if (!(0 <= header.leap_count && header.leap_count < time_zone_max_leaps && 528 if (!(0 <= header.leap_count && header.leap_count < time_zone_max_leaps &&
518 0 < header.type_count && header.type_count < s32(time_zone_rule.ttis.size()) && 529 0 < header.type_count && header.type_count < s32(time_zone_rule.ttis.size()) &&
519 0 <= header.time_count && header.time_count < s32(time_zone_rule.ats.size()) && 530 0 <= header.time_count && header.time_count < s32(time_zone_rule.ats.size()) &&
@@ -546,7 +557,7 @@ static bool ParseTimeZoneBinary(TimeZoneRule& time_zone_rule, FileSys::VirtualFi
546 for (int index{}; index < time_zone_rule.time_count; ++index) { 557 for (int index{}; index < time_zone_rule.time_count; ++index) {
547 const u8 type{*vfs_file->ReadByte(read_offset)}; 558 const u8 type{*vfs_file->ReadByte(read_offset)};
548 read_offset += sizeof(u8); 559 read_offset += sizeof(u8);
549 if (time_zone_rule.time_count <= type) { 560 if (time_zone_rule.type_count <= type) {
550 return {}; 561 return {};
551 } 562 }
552 if (time_zone_rule.types[index] != 0) { 563 if (time_zone_rule.types[index] != 0) {
@@ -624,16 +635,109 @@ static bool ParseTimeZoneBinary(TimeZoneRule& time_zone_rule, FileSys::VirtualFi
624 std::array<char, time_zone_name_max> name{}; 635 std::array<char, time_zone_name_max> name{};
625 std::memcpy(name.data(), temp_name.data() + 1, std::size_t(bytes_read - 1)); 636 std::memcpy(name.data(), temp_name.data() + 1, std::size_t(bytes_read - 1));
626 637
638 // Fill in computed transition times with temp rule
627 TimeZoneRule temp_rule; 639 TimeZoneRule temp_rule;
628 if (ParsePosixName(name.data(), temp_rule)) { 640 if (ParsePosixName(name.data(), temp_rule)) {
629 UNIMPLEMENTED(); 641 int have_abbreviation = 0;
642 int char_count = time_zone_rule.char_count;
643
644 for (int i = 0; i < temp_rule.type_count; i++) {
645 char* temp_abbreviation =
646 temp_rule.chars.data() + temp_rule.ttis[i].abbreviation_list_index;
647 int j;
648 for (j = 0; j < char_count; j++) {
649 if (std::strcmp(time_zone_rule.chars.data() + j, temp_abbreviation) == 0) {
650 temp_rule.ttis[i].abbreviation_list_index = j;
651 have_abbreviation++;
652 break;
653 }
654 }
655 if (j >= char_count) {
656 int temp_abbreviation_length = static_cast<int>(std::strlen(temp_abbreviation));
657 if (j + temp_abbreviation_length < time_zone_max_chars) {
658 std::strcpy(time_zone_rule.chars.data() + j, temp_abbreviation);
659 char_count = j + temp_abbreviation_length + 1;
660 temp_rule.ttis[i].abbreviation_list_index = j;
661 have_abbreviation++;
662 }
663 }
664 }
665
666 if (have_abbreviation == temp_rule.type_count) {
667 time_zone_rule.char_count = char_count;
668
669 // Original comment:
670 /* Ignore any trailing, no-op transitions generated
671 by zic as they don't help here and can run afoul
672 of bugs in zic 2016j or earlier. */
673 // This is possibly unnecessary for yuzu, since Nintendo doesn't run zic
674 while (1 < time_zone_rule.time_count &&
675 (time_zone_rule.types[time_zone_rule.time_count - 1] ==
676 time_zone_rule.types[time_zone_rule.time_count - 2])) {
677 time_zone_rule.time_count--;
678 }
679
680 for (int i = 0;
681 i < temp_rule.time_count && time_zone_rule.time_count < time_zone_max_times;
682 i++) {
683 const s64 transition_time = temp_rule.ats[i];
684 if (0 < time_zone_rule.time_count &&
685 transition_time <= time_zone_rule.ats[time_zone_rule.time_count - 1]) {
686 continue;
687 }
688
689 time_zone_rule.ats[time_zone_rule.time_count] = transition_time;
690 time_zone_rule.types[time_zone_rule.time_count] =
691 static_cast<s8>(time_zone_rule.type_count + temp_rule.types[i]);
692 time_zone_rule.time_count++;
693 }
694 for (int i = 0; i < temp_rule.type_count; i++) {
695 time_zone_rule.ttis[time_zone_rule.type_count++] = temp_rule.ttis[i];
696 }
697 }
630 } 698 }
631 } 699 }
700
701 const auto typesequiv = [](TimeZoneRule& rule, int a, int b) -> bool {
702 if (a < 0 || a >= rule.type_count || b < 0 || b >= rule.type_count) {
703 return {};
704 }
705
706 const struct TimeTypeInfo* ap = &rule.ttis[a];
707 const struct TimeTypeInfo* bp = &rule.ttis[b];
708
709 return (ap->gmt_offset == bp->gmt_offset && ap->is_dst == bp->is_dst &&
710 (std::strcmp(&rule.chars[ap->abbreviation_list_index],
711 &rule.chars[bp->abbreviation_list_index]) == 0));
712 };
713
632 if (time_zone_rule.type_count == 0) { 714 if (time_zone_rule.type_count == 0) {
633 return {}; 715 return {};
634 } 716 }
635 if (time_zone_rule.time_count > 1) { 717 if (time_zone_rule.time_count > 1) {
636 UNIMPLEMENTED(); 718 if (time_zone_rule.ats[0] <= std::numeric_limits<s64>::max() - seconds_per_repeat) {
719 s64 repeatat = time_zone_rule.ats[0] + seconds_per_repeat;
720 int repeatattype = time_zone_rule.types[0];
721 for (int i = 1; i < time_zone_rule.time_count; ++i) {
722 if (time_zone_rule.ats[i] == repeatat &&
723 typesequiv(time_zone_rule, time_zone_rule.types[i], repeatattype)) {
724 time_zone_rule.go_back = true;
725 break;
726 }
727 }
728 }
729 if (std::numeric_limits<s64>::min() + seconds_per_repeat <=
730 time_zone_rule.ats[time_zone_rule.time_count - 1]) {
731 s64 repeatat = time_zone_rule.ats[time_zone_rule.time_count - 1] - seconds_per_repeat;
732 int repeatattype = time_zone_rule.types[time_zone_rule.time_count - 1];
733 for (int i = time_zone_rule.time_count; i >= 0; --i) {
734 if (time_zone_rule.ats[i] == repeatat &&
735 typesequiv(time_zone_rule, time_zone_rule.types[i], repeatattype)) {
736 time_zone_rule.go_ahead = true;
737 break;
738 }
739 }
740 }
637 } 741 }
638 742
639 s32 default_type{}; 743 s32 default_type{};
@@ -745,8 +849,9 @@ static Result CreateCalendarTime(s64 time, int gmt_offset, CalendarTimeInternal&
745static Result ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time, 849static Result ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time,
746 CalendarTimeInternal& calendar_time, 850 CalendarTimeInternal& calendar_time,
747 CalendarAdditionalInfo& calendar_additional_info) { 851 CalendarAdditionalInfo& calendar_additional_info) {
748 if ((rules.go_ahead && time < rules.ats[0]) || 852 ASSERT(rules.go_ahead ? rules.time_count > 0 : true);
749 (rules.go_back && time > rules.ats[rules.time_count - 1])) { 853 if ((rules.go_back && time < rules.ats[0]) ||
854 (rules.go_ahead && time > rules.ats[rules.time_count - 1])) {
750 s64 seconds{}; 855 s64 seconds{};
751 if (time < rules.ats[0]) { 856 if (time < rules.ats[0]) {
752 seconds = rules.ats[0] - time; 857 seconds = rules.ats[0] - time;
@@ -806,9 +911,13 @@ static Result ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time,
806 911
807 calendar_additional_info.is_dst = rules.ttis[tti_index].is_dst; 912 calendar_additional_info.is_dst = rules.ttis[tti_index].is_dst;
808 const char* time_zone{&rules.chars[rules.ttis[tti_index].abbreviation_list_index]}; 913 const char* time_zone{&rules.chars[rules.ttis[tti_index].abbreviation_list_index]};
809 for (int index{}; time_zone[index] != '\0'; ++index) { 914 u32 index;
915 for (index = 0; time_zone[index] != '\0' && time_zone[index] != ',' &&
916 index < calendar_additional_info.timezone_name.size() - 1;
917 ++index) {
810 calendar_additional_info.timezone_name[index] = time_zone[index]; 918 calendar_additional_info.timezone_name[index] = time_zone[index];
811 } 919 }
920 calendar_additional_info.timezone_name[index] = '\0';
812 return ResultSuccess; 921 return ResultSuccess;
813} 922}
814 923
@@ -1038,4 +1147,36 @@ Result TimeZoneManager::GetDeviceLocationName(LocationName& value) const {
1038 return ResultSuccess; 1147 return ResultSuccess;
1039} 1148}
1040 1149
1150Result TimeZoneManager::GetTotalLocationNameCount(s32& count) const {
1151 if (!is_initialized) {
1152 return ERROR_UNINITIALIZED_CLOCK;
1153 }
1154 count = static_cast<u32>(total_location_name_count);
1155
1156 return ResultSuccess;
1157}
1158
1159Result TimeZoneManager::GetTimeZoneRuleVersion(u128& version) const {
1160 if (!is_initialized) {
1161 return ERROR_UNINITIALIZED_CLOCK;
1162 }
1163 version = time_zone_rule_version;
1164
1165 return ResultSuccess;
1166}
1167
1168Result TimeZoneManager::LoadLocationNameList(std::vector<LocationName>& values) const {
1169 if (!is_initialized) {
1170 return ERROR_UNINITIALIZED_CLOCK;
1171 }
1172
1173 for (const auto& name : total_location_names) {
1174 LocationName entry{};
1175 std::memcpy(entry.data(), name.c_str(), name.size());
1176 values.push_back(entry);
1177 }
1178
1179 return ResultSuccess;
1180}
1181
1041} // namespace Service::Time::TimeZone 1182} // namespace Service::Time::TimeZone
diff --git a/src/core/hle/service/time/time_zone_manager.h b/src/core/hle/service/time/time_zone_manager.h
index 5ebd4035e..8664f28d1 100644
--- a/src/core/hle/service/time/time_zone_manager.h
+++ b/src/core/hle/service/time/time_zone_manager.h
@@ -21,6 +21,10 @@ public:
21 total_location_name_count = value; 21 total_location_name_count = value;
22 } 22 }
23 23
24 void SetLocationNames(std::vector<std::string> location_names) {
25 total_location_names = location_names;
26 }
27
24 void SetTimeZoneRuleVersion(const u128& value) { 28 void SetTimeZoneRuleVersion(const u128& value) {
25 time_zone_rule_version = value; 29 time_zone_rule_version = value;
26 } 30 }
@@ -33,6 +37,9 @@ public:
33 FileSys::VirtualFile& vfs_file); 37 FileSys::VirtualFile& vfs_file);
34 Result SetUpdatedTime(const Clock::SteadyClockTimePoint& value); 38 Result SetUpdatedTime(const Clock::SteadyClockTimePoint& value);
35 Result GetDeviceLocationName(TimeZone::LocationName& value) const; 39 Result GetDeviceLocationName(TimeZone::LocationName& value) const;
40 Result GetTotalLocationNameCount(s32& count) const;
41 Result GetTimeZoneRuleVersion(u128& version) const;
42 Result LoadLocationNameList(std::vector<TimeZone::LocationName>& values) const;
36 Result ToCalendarTime(const TimeZoneRule& rules, s64 time, CalendarInfo& calendar) const; 43 Result ToCalendarTime(const TimeZoneRule& rules, s64 time, CalendarInfo& calendar) const;
37 Result ToCalendarTimeWithMyRules(s64 time, CalendarInfo& calendar) const; 44 Result ToCalendarTimeWithMyRules(s64 time, CalendarInfo& calendar) const;
38 Result ParseTimeZoneRuleBinary(TimeZoneRule& rules, FileSys::VirtualFile& vfs_file) const; 45 Result ParseTimeZoneRuleBinary(TimeZoneRule& rules, FileSys::VirtualFile& vfs_file) const;
@@ -46,6 +53,7 @@ private:
46 std::string device_location_name{"GMT"}; 53 std::string device_location_name{"GMT"};
47 u128 time_zone_rule_version{}; 54 u128 time_zone_rule_version{};
48 std::size_t total_location_name_count{}; 55 std::size_t total_location_name_count{};
56 std::vector<std::string> total_location_names{};
49 Clock::SteadyClockTimePoint time_zone_update_time_point{ 57 Clock::SteadyClockTimePoint time_zone_update_time_point{
50 Clock::SteadyClockTimePoint::GetRandom()}; 58 Clock::SteadyClockTimePoint::GetRandom()};
51}; 59};
diff --git a/src/core/hle/service/time/time_zone_service.cpp b/src/core/hle/service/time/time_zone_service.cpp
index cda8d8343..8171c82a5 100644
--- a/src/core/hle/service/time/time_zone_service.cpp
+++ b/src/core/hle/service/time/time_zone_service.cpp
@@ -15,10 +15,10 @@ ITimeZoneService::ITimeZoneService(Core::System& system_,
15 static const FunctionInfo functions[] = { 15 static const FunctionInfo functions[] = {
16 {0, &ITimeZoneService::GetDeviceLocationName, "GetDeviceLocationName"}, 16 {0, &ITimeZoneService::GetDeviceLocationName, "GetDeviceLocationName"},
17 {1, nullptr, "SetDeviceLocationName"}, 17 {1, nullptr, "SetDeviceLocationName"},
18 {2, nullptr, "GetTotalLocationNameCount"}, 18 {2, &ITimeZoneService::GetTotalLocationNameCount, "GetTotalLocationNameCount"},
19 {3, nullptr, "LoadLocationNameList"}, 19 {3, &ITimeZoneService::LoadLocationNameList, "LoadLocationNameList"},
20 {4, &ITimeZoneService::LoadTimeZoneRule, "LoadTimeZoneRule"}, 20 {4, &ITimeZoneService::LoadTimeZoneRule, "LoadTimeZoneRule"},
21 {5, nullptr, "GetTimeZoneRuleVersion"}, 21 {5, &ITimeZoneService::GetTimeZoneRuleVersion, "GetTimeZoneRuleVersion"},
22 {6, nullptr, "GetDeviceLocationNameAndUpdatedTime"}, 22 {6, nullptr, "GetDeviceLocationNameAndUpdatedTime"},
23 {100, &ITimeZoneService::ToCalendarTime, "ToCalendarTime"}, 23 {100, &ITimeZoneService::ToCalendarTime, "ToCalendarTime"},
24 {101, &ITimeZoneService::ToCalendarTimeWithMyRule, "ToCalendarTimeWithMyRule"}, 24 {101, &ITimeZoneService::ToCalendarTimeWithMyRule, "ToCalendarTimeWithMyRule"},
@@ -45,6 +45,57 @@ void ITimeZoneService::GetDeviceLocationName(HLERequestContext& ctx) {
45 rb.PushRaw(location_name); 45 rb.PushRaw(location_name);
46} 46}
47 47
48void ITimeZoneService::GetTotalLocationNameCount(HLERequestContext& ctx) {
49 LOG_DEBUG(Service_Time, "called");
50
51 s32 count{};
52 if (const Result result{
53 time_zone_content_manager.GetTimeZoneManager().GetTotalLocationNameCount(count)};
54 result != ResultSuccess) {
55 IPC::ResponseBuilder rb{ctx, 2};
56 rb.Push(result);
57 return;
58 }
59
60 IPC::ResponseBuilder rb{ctx, 3};
61 rb.Push(ResultSuccess);
62 rb.Push(count);
63}
64
65void ITimeZoneService::LoadLocationNameList(HLERequestContext& ctx) {
66 LOG_DEBUG(Service_Time, "called");
67
68 std::vector<TimeZone::LocationName> location_names{};
69 if (const Result result{
70 time_zone_content_manager.GetTimeZoneManager().LoadLocationNameList(location_names)};
71 result != ResultSuccess) {
72 IPC::ResponseBuilder rb{ctx, 2};
73 rb.Push(result);
74 return;
75 }
76
77 ctx.WriteBuffer(location_names);
78 IPC::ResponseBuilder rb{ctx, 3};
79 rb.Push(ResultSuccess);
80 rb.Push(static_cast<s32>(location_names.size()));
81}
82void ITimeZoneService::GetTimeZoneRuleVersion(HLERequestContext& ctx) {
83 LOG_DEBUG(Service_Time, "called");
84
85 u128 rule_version{};
86 if (const Result result{
87 time_zone_content_manager.GetTimeZoneManager().GetTimeZoneRuleVersion(rule_version)};
88 result != ResultSuccess) {
89 IPC::ResponseBuilder rb{ctx, 2};
90 rb.Push(result);
91 return;
92 }
93
94 IPC::ResponseBuilder rb{ctx, 6};
95 rb.Push(ResultSuccess);
96 rb.PushRaw(rule_version);
97}
98
48void ITimeZoneService::LoadTimeZoneRule(HLERequestContext& ctx) { 99void ITimeZoneService::LoadTimeZoneRule(HLERequestContext& ctx) {
49 IPC::RequestParser rp{ctx}; 100 IPC::RequestParser rp{ctx};
50 const auto raw_location_name{rp.PopRaw<std::array<u8, 0x24>>()}; 101 const auto raw_location_name{rp.PopRaw<std::array<u8, 0x24>>()};
@@ -61,20 +112,14 @@ void ITimeZoneService::LoadTimeZoneRule(HLERequestContext& ctx) {
61 LOG_DEBUG(Service_Time, "called, location_name={}", location_name); 112 LOG_DEBUG(Service_Time, "called, location_name={}", location_name);
62 113
63 TimeZone::TimeZoneRule time_zone_rule{}; 114 TimeZone::TimeZoneRule time_zone_rule{};
64 if (const Result result{ 115 const Result result{time_zone_content_manager.LoadTimeZoneRule(time_zone_rule, location_name)};
65 time_zone_content_manager.LoadTimeZoneRule(time_zone_rule, location_name)};
66 result != ResultSuccess) {
67 IPC::ResponseBuilder rb{ctx, 2};
68 rb.Push(result);
69 return;
70 }
71 116
72 std::vector<u8> time_zone_rule_outbuffer(sizeof(TimeZone::TimeZoneRule)); 117 std::vector<u8> time_zone_rule_outbuffer(sizeof(TimeZone::TimeZoneRule));
73 std::memcpy(time_zone_rule_outbuffer.data(), &time_zone_rule, sizeof(TimeZone::TimeZoneRule)); 118 std::memcpy(time_zone_rule_outbuffer.data(), &time_zone_rule, sizeof(TimeZone::TimeZoneRule));
74 ctx.WriteBuffer(time_zone_rule_outbuffer); 119 ctx.WriteBuffer(time_zone_rule_outbuffer);
75 120
76 IPC::ResponseBuilder rb{ctx, 2}; 121 IPC::ResponseBuilder rb{ctx, 2};
77 rb.Push(ResultSuccess); 122 rb.Push(result);
78} 123}
79 124
80void ITimeZoneService::ToCalendarTime(HLERequestContext& ctx) { 125void ITimeZoneService::ToCalendarTime(HLERequestContext& ctx) {
diff --git a/src/core/hle/service/time/time_zone_service.h b/src/core/hle/service/time/time_zone_service.h
index ea83b5714..952fcb0e2 100644
--- a/src/core/hle/service/time/time_zone_service.h
+++ b/src/core/hle/service/time/time_zone_service.h
@@ -22,6 +22,9 @@ public:
22 22
23private: 23private:
24 void GetDeviceLocationName(HLERequestContext& ctx); 24 void GetDeviceLocationName(HLERequestContext& ctx);
25 void GetTotalLocationNameCount(HLERequestContext& ctx);
26 void LoadLocationNameList(HLERequestContext& ctx);
27 void GetTimeZoneRuleVersion(HLERequestContext& ctx);
25 void LoadTimeZoneRule(HLERequestContext& ctx); 28 void LoadTimeZoneRule(HLERequestContext& ctx);
26 void ToCalendarTime(HLERequestContext& ctx); 29 void ToCalendarTime(HLERequestContext& ctx);
27 void ToCalendarTimeWithMyRule(HLERequestContext& ctx); 30 void ToCalendarTimeWithMyRule(HLERequestContext& ctx);
diff --git a/src/core/loader/nro.cpp b/src/core/loader/nro.cpp
index 73d04d7ee..7be6cf5f3 100644
--- a/src/core/loader/nro.cpp
+++ b/src/core/loader/nro.cpp
@@ -33,7 +33,8 @@ static_assert(sizeof(NroSegmentHeader) == 0x8, "NroSegmentHeader has incorrect s
33struct NroHeader { 33struct NroHeader {
34 INSERT_PADDING_BYTES(0x4); 34 INSERT_PADDING_BYTES(0x4);
35 u32_le module_header_offset; 35 u32_le module_header_offset;
36 INSERT_PADDING_BYTES(0x8); 36 u32 magic_ext1;
37 u32 magic_ext2;
37 u32_le magic; 38 u32_le magic;
38 INSERT_PADDING_BYTES(0x4); 39 INSERT_PADDING_BYTES(0x4);
39 u32_le file_size; 40 u32_le file_size;
@@ -124,6 +125,16 @@ FileType AppLoader_NRO::IdentifyType(const FileSys::VirtualFile& nro_file) {
124 return FileType::Error; 125 return FileType::Error;
125} 126}
126 127
128bool AppLoader_NRO::IsHomebrew() {
129 // Read NSO header
130 NroHeader nro_header{};
131 if (sizeof(NroHeader) != file->ReadObject(&nro_header)) {
132 return false;
133 }
134 return nro_header.magic_ext1 == Common::MakeMagic('H', 'O', 'M', 'E') &&
135 nro_header.magic_ext2 == Common::MakeMagic('B', 'R', 'E', 'W');
136}
137
127static constexpr u32 PageAlignSize(u32 size) { 138static constexpr u32 PageAlignSize(u32 size) {
128 return static_cast<u32>((size + Core::Memory::YUZU_PAGEMASK) & ~Core::Memory::YUZU_PAGEMASK); 139 return static_cast<u32>((size + Core::Memory::YUZU_PAGEMASK) & ~Core::Memory::YUZU_PAGEMASK);
129} 140}
diff --git a/src/core/loader/nro.h b/src/core/loader/nro.h
index ccb77b581..8de6eebc6 100644
--- a/src/core/loader/nro.h
+++ b/src/core/loader/nro.h
@@ -38,6 +38,8 @@ public:
38 */ 38 */
39 static FileType IdentifyType(const FileSys::VirtualFile& nro_file); 39 static FileType IdentifyType(const FileSys::VirtualFile& nro_file);
40 40
41 bool IsHomebrew();
42
41 FileType GetFileType() const override { 43 FileType GetFileType() const override {
42 return IdentifyType(file); 44 return IdentifyType(file);
43 } 45 }
diff --git a/src/input_common/drivers/virtual_amiibo.cpp b/src/input_common/drivers/virtual_amiibo.cpp
index f8bafe553..6435b8af8 100644
--- a/src/input_common/drivers/virtual_amiibo.cpp
+++ b/src/input_common/drivers/virtual_amiibo.cpp
@@ -82,6 +82,7 @@ VirtualAmiibo::Info VirtualAmiibo::LoadAmiibo(const std::string& filename) {
82 switch (nfc_file.GetSize()) { 82 switch (nfc_file.GetSize()) {
83 case AmiiboSize: 83 case AmiiboSize:
84 case AmiiboSizeWithoutPassword: 84 case AmiiboSizeWithoutPassword:
85 case AmiiboSizeWithSignature:
85 data.resize(AmiiboSize); 86 data.resize(AmiiboSize);
86 if (nfc_file.Read(data) < AmiiboSizeWithoutPassword) { 87 if (nfc_file.Read(data) < AmiiboSizeWithoutPassword) {
87 return Info::NotAnAmiibo; 88 return Info::NotAnAmiibo;
@@ -109,6 +110,7 @@ VirtualAmiibo::Info VirtualAmiibo::LoadAmiibo(std::span<u8> data) {
109 switch (data.size_bytes()) { 110 switch (data.size_bytes()) {
110 case AmiiboSize: 111 case AmiiboSize:
111 case AmiiboSizeWithoutPassword: 112 case AmiiboSizeWithoutPassword:
113 case AmiiboSizeWithSignature:
112 nfc_data.resize(AmiiboSize); 114 nfc_data.resize(AmiiboSize);
113 break; 115 break;
114 case MifareSize: 116 case MifareSize:
diff --git a/src/input_common/drivers/virtual_amiibo.h b/src/input_common/drivers/virtual_amiibo.h
index 34e97cd91..09ca09e68 100644
--- a/src/input_common/drivers/virtual_amiibo.h
+++ b/src/input_common/drivers/virtual_amiibo.h
@@ -57,6 +57,7 @@ public:
57private: 57private:
58 static constexpr std::size_t AmiiboSize = 0x21C; 58 static constexpr std::size_t AmiiboSize = 0x21C;
59 static constexpr std::size_t AmiiboSizeWithoutPassword = AmiiboSize - 0x8; 59 static constexpr std::size_t AmiiboSizeWithoutPassword = AmiiboSize - 0x8;
60 static constexpr std::size_t AmiiboSizeWithSignature = AmiiboSize + 0x20;
60 static constexpr std::size_t MifareSize = 0x400; 61 static constexpr std::size_t MifareSize = 0x400;
61 62
62 std::string file_path{}; 63 std::string file_path{};
diff --git a/src/shader_recompiler/CMakeLists.txt b/src/shader_recompiler/CMakeLists.txt
index 525b2363c..07e75f9d8 100644
--- a/src/shader_recompiler/CMakeLists.txt
+++ b/src/shader_recompiler/CMakeLists.txt
@@ -216,6 +216,7 @@ add_library(shader_recompiler STATIC
216 frontend/maxwell/translate_program.h 216 frontend/maxwell/translate_program.h
217 host_translate_info.h 217 host_translate_info.h
218 ir_opt/collect_shader_info_pass.cpp 218 ir_opt/collect_shader_info_pass.cpp
219 ir_opt/conditional_barrier_pass.cpp
219 ir_opt/constant_propagation_pass.cpp 220 ir_opt/constant_propagation_pass.cpp
220 ir_opt/dead_code_elimination_pass.cpp 221 ir_opt/dead_code_elimination_pass.cpp
221 ir_opt/dual_vertex_pass.cpp 222 ir_opt/dual_vertex_pass.cpp
@@ -223,6 +224,7 @@ add_library(shader_recompiler STATIC
223 ir_opt/identity_removal_pass.cpp 224 ir_opt/identity_removal_pass.cpp
224 ir_opt/layer_pass.cpp 225 ir_opt/layer_pass.cpp
225 ir_opt/lower_fp16_to_fp32.cpp 226 ir_opt/lower_fp16_to_fp32.cpp
227 ir_opt/lower_fp64_to_fp32.cpp
226 ir_opt/lower_int64_to_int32.cpp 228 ir_opt/lower_int64_to_int32.cpp
227 ir_opt/passes.h 229 ir_opt/passes.h
228 ir_opt/position_pass.cpp 230 ir_opt/position_pass.cpp
diff --git a/src/shader_recompiler/frontend/maxwell/translate_program.cpp b/src/shader_recompiler/frontend/maxwell/translate_program.cpp
index 17a6d4888..928b35561 100644
--- a/src/shader_recompiler/frontend/maxwell/translate_program.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate_program.cpp
@@ -280,12 +280,18 @@ IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::Blo
280 RemoveUnreachableBlocks(program); 280 RemoveUnreachableBlocks(program);
281 281
282 // Replace instructions before the SSA rewrite 282 // Replace instructions before the SSA rewrite
283 if (!host_info.support_float64) {
284 Optimization::LowerFp64ToFp32(program);
285 }
283 if (!host_info.support_float16) { 286 if (!host_info.support_float16) {
284 Optimization::LowerFp16ToFp32(program); 287 Optimization::LowerFp16ToFp32(program);
285 } 288 }
286 if (!host_info.support_int64) { 289 if (!host_info.support_int64) {
287 Optimization::LowerInt64ToInt32(program); 290 Optimization::LowerInt64ToInt32(program);
288 } 291 }
292 if (!host_info.support_conditional_barrier) {
293 Optimization::ConditionalBarrierPass(program);
294 }
289 Optimization::SsaRewritePass(program); 295 Optimization::SsaRewritePass(program);
290 296
291 Optimization::ConstantPropagationPass(env, program); 297 Optimization::ConstantPropagationPass(env, program);
diff --git a/src/shader_recompiler/host_translate_info.h b/src/shader_recompiler/host_translate_info.h
index 2aaa6c5ea..7d2ded907 100644
--- a/src/shader_recompiler/host_translate_info.h
+++ b/src/shader_recompiler/host_translate_info.h
@@ -10,6 +10,7 @@ namespace Shader {
10 10
11/// Misc information about the host 11/// Misc information about the host
12struct HostTranslateInfo { 12struct HostTranslateInfo {
13 bool support_float64{}; ///< True when the device supports 64-bit floats
13 bool support_float16{}; ///< True when the device supports 16-bit floats 14 bool support_float16{}; ///< True when the device supports 16-bit floats
14 bool support_int64{}; ///< True when the device supports 64-bit integers 15 bool support_int64{}; ///< True when the device supports 64-bit integers
15 bool needs_demote_reorder{}; ///< True when the device needs DemoteToHelperInvocation reordered 16 bool needs_demote_reorder{}; ///< True when the device needs DemoteToHelperInvocation reordered
@@ -17,6 +18,8 @@ struct HostTranslateInfo {
17 bool support_viewport_index_layer{}; ///< True when the device supports gl_Layer in VS 18 bool support_viewport_index_layer{}; ///< True when the device supports gl_Layer in VS
18 bool support_geometry_shader_passthrough{}; ///< True when the device supports geometry 19 bool support_geometry_shader_passthrough{}; ///< True when the device supports geometry
19 ///< passthrough shaders 20 ///< passthrough shaders
21 bool support_conditional_barrier{}; ///< True when the device supports barriers in conditional
22 ///< control flow
20}; 23};
21 24
22} // namespace Shader 25} // namespace Shader
diff --git a/src/shader_recompiler/ir_opt/conditional_barrier_pass.cpp b/src/shader_recompiler/ir_opt/conditional_barrier_pass.cpp
new file mode 100644
index 000000000..c3ed27f4f
--- /dev/null
+++ b/src/shader_recompiler/ir_opt/conditional_barrier_pass.cpp
@@ -0,0 +1,44 @@
1// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include "shader_recompiler/frontend/ir/program.h"
5#include "shader_recompiler/ir_opt/passes.h"
6
7namespace Shader::Optimization {
8
9void ConditionalBarrierPass(IR::Program& program) {
10 s32 conditional_control_flow_count{0};
11 s32 conditional_return_count{0};
12 for (IR::AbstractSyntaxNode& node : program.syntax_list) {
13 switch (node.type) {
14 case IR::AbstractSyntaxNode::Type::If:
15 case IR::AbstractSyntaxNode::Type::Loop:
16 conditional_control_flow_count++;
17 break;
18 case IR::AbstractSyntaxNode::Type::EndIf:
19 case IR::AbstractSyntaxNode::Type::Repeat:
20 conditional_control_flow_count--;
21 break;
22 case IR::AbstractSyntaxNode::Type::Unreachable:
23 case IR::AbstractSyntaxNode::Type::Return:
24 if (conditional_control_flow_count > 0) {
25 conditional_return_count++;
26 }
27 break;
28 case IR::AbstractSyntaxNode::Type::Block:
29 for (IR::Inst& inst : node.data.block->Instructions()) {
30 if ((conditional_control_flow_count > 0 || conditional_return_count > 0) &&
31 inst.GetOpcode() == IR::Opcode::Barrier) {
32 LOG_WARNING(Shader, "Barrier within conditional control flow");
33 inst.ReplaceOpcode(IR::Opcode::Identity);
34 }
35 }
36 break;
37 default:
38 break;
39 }
40 }
41 ASSERT(conditional_control_flow_count == 0);
42}
43
44} // namespace Shader::Optimization
diff --git a/src/shader_recompiler/ir_opt/lower_fp64_to_fp32.cpp b/src/shader_recompiler/ir_opt/lower_fp64_to_fp32.cpp
new file mode 100644
index 000000000..5db7a38ad
--- /dev/null
+++ b/src/shader_recompiler/ir_opt/lower_fp64_to_fp32.cpp
@@ -0,0 +1,185 @@
1// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include "shader_recompiler/frontend/ir/ir_emitter.h"
5#include "shader_recompiler/frontend/ir/opcodes.h"
6#include "shader_recompiler/frontend/ir/value.h"
7#include "shader_recompiler/ir_opt/passes.h"
8
9namespace Shader::Optimization {
10namespace {
11
12constexpr s32 F64ToF32Exp = +1023 - 127;
13constexpr s32 F32ToF64Exp = +127 - 1023;
14
15IR::F32 PackedF64ToF32(IR::IREmitter& ir, const IR::Value& packed) {
16 const IR::U32 lo{ir.CompositeExtract(packed, 0)};
17 const IR::U32 hi{ir.CompositeExtract(packed, 1)};
18 const IR::U32 sign{ir.BitFieldExtract(hi, ir.Imm32(31), ir.Imm32(1))};
19 const IR::U32 exp{ir.BitFieldExtract(hi, ir.Imm32(20), ir.Imm32(11))};
20 const IR::U32 mantissa_hi{ir.BitFieldExtract(hi, ir.Imm32(0), ir.Imm32(20))};
21 const IR::U32 mantissa_lo{ir.BitFieldExtract(lo, ir.Imm32(29), ir.Imm32(3))};
22 const IR::U32 mantissa{
23 ir.BitwiseOr(ir.ShiftLeftLogical(mantissa_hi, ir.Imm32(3)), mantissa_lo)};
24 const IR::U32 exp_if_subnorm{
25 ir.Select(ir.IEqual(exp, ir.Imm32(0)), ir.Imm32(0), ir.IAdd(exp, ir.Imm32(F64ToF32Exp)))};
26 const IR::U32 exp_if_infnan{
27 ir.Select(ir.IEqual(exp, ir.Imm32(0x7ff)), ir.Imm32(0xff), exp_if_subnorm)};
28 const IR::U32 result{
29 ir.BitwiseOr(ir.ShiftLeftLogical(sign, ir.Imm32(31)),
30 ir.BitwiseOr(ir.ShiftLeftLogical(exp_if_infnan, ir.Imm32(23)), mantissa))};
31 return ir.BitCast<IR::F32>(result);
32}
33
34IR::Value F32ToPackedF64(IR::IREmitter& ir, const IR::Value& raw) {
35 const IR::U32 value{ir.BitCast<IR::U32>(IR::F32(raw))};
36 const IR::U32 sign{ir.BitFieldExtract(value, ir.Imm32(31), ir.Imm32(1))};
37 const IR::U32 exp{ir.BitFieldExtract(value, ir.Imm32(23), ir.Imm32(8))};
38 const IR::U32 mantissa{ir.BitFieldExtract(value, ir.Imm32(0), ir.Imm32(23))};
39 const IR::U32 mantissa_hi{ir.BitFieldExtract(mantissa, ir.Imm32(3), ir.Imm32(20))};
40 const IR::U32 mantissa_lo{ir.BitFieldExtract(mantissa, ir.Imm32(0), ir.Imm32(3))};
41 const IR::U32 exp_if_subnorm{
42 ir.Select(ir.IEqual(exp, ir.Imm32(0)), ir.Imm32(0), ir.IAdd(exp, ir.Imm32(F32ToF64Exp)))};
43 const IR::U32 exp_if_infnan{
44 ir.Select(ir.IEqual(exp, ir.Imm32(0xff)), ir.Imm32(0x7ff), exp_if_subnorm)};
45 const IR::U32 lo{ir.ShiftLeftLogical(mantissa_lo, ir.Imm32(29))};
46 const IR::U32 hi{
47 ir.BitwiseOr(ir.ShiftLeftLogical(sign, ir.Imm32(31)),
48 ir.BitwiseOr(ir.ShiftLeftLogical(exp_if_infnan, ir.Imm32(20)), mantissa_hi))};
49 return ir.CompositeConstruct(lo, hi);
50}
51
52IR::Opcode Replace(IR::Opcode op) {
53 switch (op) {
54 case IR::Opcode::FPAbs64:
55 return IR::Opcode::FPAbs32;
56 case IR::Opcode::FPAdd64:
57 return IR::Opcode::FPAdd32;
58 case IR::Opcode::FPCeil64:
59 return IR::Opcode::FPCeil32;
60 case IR::Opcode::FPFloor64:
61 return IR::Opcode::FPFloor32;
62 case IR::Opcode::FPFma64:
63 return IR::Opcode::FPFma32;
64 case IR::Opcode::FPMul64:
65 return IR::Opcode::FPMul32;
66 case IR::Opcode::FPNeg64:
67 return IR::Opcode::FPNeg32;
68 case IR::Opcode::FPRoundEven64:
69 return IR::Opcode::FPRoundEven32;
70 case IR::Opcode::FPSaturate64:
71 return IR::Opcode::FPSaturate32;
72 case IR::Opcode::FPClamp64:
73 return IR::Opcode::FPClamp32;
74 case IR::Opcode::FPTrunc64:
75 return IR::Opcode::FPTrunc32;
76 case IR::Opcode::CompositeConstructF64x2:
77 return IR::Opcode::CompositeConstructF32x2;
78 case IR::Opcode::CompositeConstructF64x3:
79 return IR::Opcode::CompositeConstructF32x3;
80 case IR::Opcode::CompositeConstructF64x4:
81 return IR::Opcode::CompositeConstructF32x4;
82 case IR::Opcode::CompositeExtractF64x2:
83 return IR::Opcode::CompositeExtractF32x2;
84 case IR::Opcode::CompositeExtractF64x3:
85 return IR::Opcode::CompositeExtractF32x3;
86 case IR::Opcode::CompositeExtractF64x4:
87 return IR::Opcode::CompositeExtractF32x4;
88 case IR::Opcode::CompositeInsertF64x2:
89 return IR::Opcode::CompositeInsertF32x2;
90 case IR::Opcode::CompositeInsertF64x3:
91 return IR::Opcode::CompositeInsertF32x3;
92 case IR::Opcode::CompositeInsertF64x4:
93 return IR::Opcode::CompositeInsertF32x4;
94 case IR::Opcode::FPOrdEqual64:
95 return IR::Opcode::FPOrdEqual32;
96 case IR::Opcode::FPUnordEqual64:
97 return IR::Opcode::FPUnordEqual32;
98 case IR::Opcode::FPOrdNotEqual64:
99 return IR::Opcode::FPOrdNotEqual32;
100 case IR::Opcode::FPUnordNotEqual64:
101 return IR::Opcode::FPUnordNotEqual32;
102 case IR::Opcode::FPOrdLessThan64:
103 return IR::Opcode::FPOrdLessThan32;
104 case IR::Opcode::FPUnordLessThan64:
105 return IR::Opcode::FPUnordLessThan32;
106 case IR::Opcode::FPOrdGreaterThan64:
107 return IR::Opcode::FPOrdGreaterThan32;
108 case IR::Opcode::FPUnordGreaterThan64:
109 return IR::Opcode::FPUnordGreaterThan32;
110 case IR::Opcode::FPOrdLessThanEqual64:
111 return IR::Opcode::FPOrdLessThanEqual32;
112 case IR::Opcode::FPUnordLessThanEqual64:
113 return IR::Opcode::FPUnordLessThanEqual32;
114 case IR::Opcode::FPOrdGreaterThanEqual64:
115 return IR::Opcode::FPOrdGreaterThanEqual32;
116 case IR::Opcode::FPUnordGreaterThanEqual64:
117 return IR::Opcode::FPUnordGreaterThanEqual32;
118 case IR::Opcode::FPIsNan64:
119 return IR::Opcode::FPIsNan32;
120 case IR::Opcode::ConvertS16F64:
121 return IR::Opcode::ConvertS16F32;
122 case IR::Opcode::ConvertS32F64:
123 return IR::Opcode::ConvertS32F32;
124 case IR::Opcode::ConvertS64F64:
125 return IR::Opcode::ConvertS64F32;
126 case IR::Opcode::ConvertU16F64:
127 return IR::Opcode::ConvertU16F32;
128 case IR::Opcode::ConvertU32F64:
129 return IR::Opcode::ConvertU32F32;
130 case IR::Opcode::ConvertU64F64:
131 return IR::Opcode::ConvertU64F32;
132 case IR::Opcode::ConvertF32F64:
133 return IR::Opcode::Identity;
134 case IR::Opcode::ConvertF64F32:
135 return IR::Opcode::Identity;
136 case IR::Opcode::ConvertF64S8:
137 return IR::Opcode::ConvertF32S8;
138 case IR::Opcode::ConvertF64S16:
139 return IR::Opcode::ConvertF32S16;
140 case IR::Opcode::ConvertF64S32:
141 return IR::Opcode::ConvertF32S32;
142 case IR::Opcode::ConvertF64S64:
143 return IR::Opcode::ConvertF32S64;
144 case IR::Opcode::ConvertF64U8:
145 return IR::Opcode::ConvertF32U8;
146 case IR::Opcode::ConvertF64U16:
147 return IR::Opcode::ConvertF32U16;
148 case IR::Opcode::ConvertF64U32:
149 return IR::Opcode::ConvertF32U32;
150 case IR::Opcode::ConvertF64U64:
151 return IR::Opcode::ConvertF32U64;
152 default:
153 return op;
154 }
155}
156
157void Lower(IR::Block& block, IR::Inst& inst) {
158 switch (inst.GetOpcode()) {
159 case IR::Opcode::PackDouble2x32: {
160 IR::IREmitter ir(block, IR::Block::InstructionList::s_iterator_to(inst));
161 inst.ReplaceUsesWith(PackedF64ToF32(ir, inst.Arg(0)));
162 break;
163 }
164 case IR::Opcode::UnpackDouble2x32: {
165 IR::IREmitter ir(block, IR::Block::InstructionList::s_iterator_to(inst));
166 inst.ReplaceUsesWith(F32ToPackedF64(ir, inst.Arg(0)));
167 break;
168 }
169 default:
170 inst.ReplaceOpcode(Replace(inst.GetOpcode()));
171 break;
172 }
173}
174
175} // Anonymous namespace
176
177void LowerFp64ToFp32(IR::Program& program) {
178 for (IR::Block* const block : program.blocks) {
179 for (IR::Inst& inst : block->Instructions()) {
180 Lower(*block, inst);
181 }
182 }
183}
184
185} // namespace Shader::Optimization
diff --git a/src/shader_recompiler/ir_opt/passes.h b/src/shader_recompiler/ir_opt/passes.h
index 1f8f2ba95..629d18fa1 100644
--- a/src/shader_recompiler/ir_opt/passes.h
+++ b/src/shader_recompiler/ir_opt/passes.h
@@ -13,10 +13,12 @@ struct HostTranslateInfo;
13namespace Shader::Optimization { 13namespace Shader::Optimization {
14 14
15void CollectShaderInfoPass(Environment& env, IR::Program& program); 15void CollectShaderInfoPass(Environment& env, IR::Program& program);
16void ConditionalBarrierPass(IR::Program& program);
16void ConstantPropagationPass(Environment& env, IR::Program& program); 17void ConstantPropagationPass(Environment& env, IR::Program& program);
17void DeadCodeEliminationPass(IR::Program& program); 18void DeadCodeEliminationPass(IR::Program& program);
18void GlobalMemoryToStorageBufferPass(IR::Program& program); 19void GlobalMemoryToStorageBufferPass(IR::Program& program);
19void IdentityRemovalPass(IR::Program& program); 20void IdentityRemovalPass(IR::Program& program);
21void LowerFp64ToFp32(IR::Program& program);
20void LowerFp16ToFp32(IR::Program& program); 22void LowerFp16ToFp32(IR::Program& program);
21void LowerInt64ToInt32(IR::Program& program); 23void LowerInt64ToInt32(IR::Program& program);
22void RescalingPass(IR::Program& program); 24void RescalingPass(IR::Program& program);
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h
index 2f281b370..45977d578 100644
--- a/src/video_core/buffer_cache/buffer_cache.h
+++ b/src/video_core/buffer_cache/buffer_cache.h
@@ -715,6 +715,8 @@ void BufferCache<P>::BindHostIndexBuffer() {
715 715
716template <class P> 716template <class P>
717void BufferCache<P>::BindHostVertexBuffers() { 717void BufferCache<P>::BindHostVertexBuffers() {
718 HostBindings<typename P::Buffer> host_bindings;
719 bool any_valid{false};
718 auto& flags = maxwell3d->dirty.flags; 720 auto& flags = maxwell3d->dirty.flags;
719 for (u32 index = 0; index < NUM_VERTEX_BUFFERS; ++index) { 721 for (u32 index = 0; index < NUM_VERTEX_BUFFERS; ++index) {
720 const Binding& binding = channel_state->vertex_buffers[index]; 722 const Binding& binding = channel_state->vertex_buffers[index];
@@ -726,9 +728,28 @@ void BufferCache<P>::BindHostVertexBuffers() {
726 } 728 }
727 flags[Dirty::VertexBuffer0 + index] = false; 729 flags[Dirty::VertexBuffer0 + index] = false;
728 730
729 const u32 stride = maxwell3d->regs.vertex_streams[index].stride; 731 host_bindings.min_index = std::min(host_bindings.min_index, index);
730 const u32 offset = buffer.Offset(binding.cpu_addr); 732 host_bindings.max_index = std::max(host_bindings.max_index, index);
731 runtime.BindVertexBuffer(index, buffer, offset, binding.size, stride); 733 any_valid = true;
734 }
735
736 if (any_valid) {
737 host_bindings.max_index++;
738 for (u32 index = host_bindings.min_index; index < host_bindings.max_index; index++) {
739 flags[Dirty::VertexBuffer0 + index] = false;
740
741 const Binding& binding = channel_state->vertex_buffers[index];
742 Buffer& buffer = slot_buffers[binding.buffer_id];
743
744 const u32 stride = maxwell3d->regs.vertex_streams[index].stride;
745 const u32 offset = buffer.Offset(binding.cpu_addr);
746
747 host_bindings.buffers.push_back(&buffer);
748 host_bindings.offsets.push_back(offset);
749 host_bindings.sizes.push_back(binding.size);
750 host_bindings.strides.push_back(stride);
751 }
752 runtime.BindVertexBuffers(host_bindings);
732 } 753 }
733} 754}
734 755
@@ -882,15 +903,25 @@ void BufferCache<P>::BindHostTransformFeedbackBuffers() {
882 if (maxwell3d->regs.transform_feedback_enabled == 0) { 903 if (maxwell3d->regs.transform_feedback_enabled == 0) {
883 return; 904 return;
884 } 905 }
906 HostBindings<typename P::Buffer> host_bindings;
885 for (u32 index = 0; index < NUM_TRANSFORM_FEEDBACK_BUFFERS; ++index) { 907 for (u32 index = 0; index < NUM_TRANSFORM_FEEDBACK_BUFFERS; ++index) {
886 const Binding& binding = channel_state->transform_feedback_buffers[index]; 908 const Binding& binding = channel_state->transform_feedback_buffers[index];
909 if (maxwell3d->regs.transform_feedback.controls[index].varying_count == 0 &&
910 maxwell3d->regs.transform_feedback.controls[index].stride == 0) {
911 break;
912 }
887 Buffer& buffer = slot_buffers[binding.buffer_id]; 913 Buffer& buffer = slot_buffers[binding.buffer_id];
888 TouchBuffer(buffer, binding.buffer_id); 914 TouchBuffer(buffer, binding.buffer_id);
889 const u32 size = binding.size; 915 const u32 size = binding.size;
890 SynchronizeBuffer(buffer, binding.cpu_addr, size); 916 SynchronizeBuffer(buffer, binding.cpu_addr, size);
891 917
892 const u32 offset = buffer.Offset(binding.cpu_addr); 918 const u32 offset = buffer.Offset(binding.cpu_addr);
893 runtime.BindTransformFeedbackBuffer(index, buffer, offset, size); 919 host_bindings.buffers.push_back(&buffer);
920 host_bindings.offsets.push_back(offset);
921 host_bindings.sizes.push_back(binding.size);
922 }
923 if (host_bindings.buffers.size() > 0) {
924 runtime.BindTransformFeedbackBuffers(host_bindings);
894 } 925 }
895} 926}
896 927
@@ -1616,6 +1647,8 @@ void BufferCache<P>::DownloadBufferMemory(Buffer& buffer, VAddr cpu_addr, u64 si
1616 1647
1617template <class P> 1648template <class P>
1618void BufferCache<P>::DeleteBuffer(BufferId buffer_id, bool do_not_mark) { 1649void BufferCache<P>::DeleteBuffer(BufferId buffer_id, bool do_not_mark) {
1650 bool dirty_index{false};
1651 boost::container::small_vector<u64, NUM_VERTEX_BUFFERS> dirty_vertex_buffers;
1619 const auto scalar_replace = [buffer_id](Binding& binding) { 1652 const auto scalar_replace = [buffer_id](Binding& binding) {
1620 if (binding.buffer_id == buffer_id) { 1653 if (binding.buffer_id == buffer_id) {
1621 binding.buffer_id = BufferId{}; 1654 binding.buffer_id = BufferId{};
@@ -1624,8 +1657,19 @@ void BufferCache<P>::DeleteBuffer(BufferId buffer_id, bool do_not_mark) {
1624 const auto replace = [scalar_replace](std::span<Binding> bindings) { 1657 const auto replace = [scalar_replace](std::span<Binding> bindings) {
1625 std::ranges::for_each(bindings, scalar_replace); 1658 std::ranges::for_each(bindings, scalar_replace);
1626 }; 1659 };
1627 scalar_replace(channel_state->index_buffer); 1660
1628 replace(channel_state->vertex_buffers); 1661 if (channel_state->index_buffer.buffer_id == buffer_id) {
1662 channel_state->index_buffer.buffer_id = BufferId{};
1663 dirty_index = true;
1664 }
1665
1666 for (u32 index = 0; index < channel_state->vertex_buffers.size(); index++) {
1667 auto& binding = channel_state->vertex_buffers[index];
1668 if (binding.buffer_id == buffer_id) {
1669 binding.buffer_id = BufferId{};
1670 dirty_vertex_buffers.push_back(index);
1671 }
1672 }
1629 std::ranges::for_each(channel_state->uniform_buffers, replace); 1673 std::ranges::for_each(channel_state->uniform_buffers, replace);
1630 std::ranges::for_each(channel_state->storage_buffers, replace); 1674 std::ranges::for_each(channel_state->storage_buffers, replace);
1631 replace(channel_state->transform_feedback_buffers); 1675 replace(channel_state->transform_feedback_buffers);
@@ -1642,20 +1686,21 @@ void BufferCache<P>::DeleteBuffer(BufferId buffer_id, bool do_not_mark) {
1642 delayed_destruction_ring.Push(std::move(slot_buffers[buffer_id])); 1686 delayed_destruction_ring.Push(std::move(slot_buffers[buffer_id]));
1643 slot_buffers.erase(buffer_id); 1687 slot_buffers.erase(buffer_id);
1644 1688
1645 NotifyBufferDeletion();
1646}
1647
1648template <class P>
1649void BufferCache<P>::NotifyBufferDeletion() {
1650 if constexpr (HAS_PERSISTENT_UNIFORM_BUFFER_BINDINGS) { 1689 if constexpr (HAS_PERSISTENT_UNIFORM_BUFFER_BINDINGS) {
1651 channel_state->dirty_uniform_buffers.fill(~u32{0}); 1690 channel_state->dirty_uniform_buffers.fill(~u32{0});
1652 channel_state->uniform_buffer_binding_sizes.fill({}); 1691 channel_state->uniform_buffer_binding_sizes.fill({});
1653 } 1692 }
1693
1654 auto& flags = maxwell3d->dirty.flags; 1694 auto& flags = maxwell3d->dirty.flags;
1655 flags[Dirty::IndexBuffer] = true; 1695 if (dirty_index) {
1656 flags[Dirty::VertexBuffers] = true; 1696 flags[Dirty::IndexBuffer] = true;
1657 for (u32 index = 0; index < NUM_VERTEX_BUFFERS; ++index) { 1697 }
1658 flags[Dirty::VertexBuffer0 + index] = true; 1698
1699 if (dirty_vertex_buffers.size() > 0) {
1700 flags[Dirty::VertexBuffers] = true;
1701 for (auto index : dirty_vertex_buffers) {
1702 flags[Dirty::VertexBuffer0 + index] = true;
1703 }
1659 } 1704 }
1660 channel_state->has_deleted_buffers = true; 1705 channel_state->has_deleted_buffers = true;
1661} 1706}
diff --git a/src/video_core/buffer_cache/buffer_cache_base.h b/src/video_core/buffer_cache/buffer_cache_base.h
index 60a1f285e..63a120f7a 100644
--- a/src/video_core/buffer_cache/buffer_cache_base.h
+++ b/src/video_core/buffer_cache/buffer_cache_base.h
@@ -105,6 +105,16 @@ static constexpr Binding NULL_BINDING{
105 .buffer_id = NULL_BUFFER_ID, 105 .buffer_id = NULL_BUFFER_ID,
106}; 106};
107 107
108template <typename Buffer>
109struct HostBindings {
110 boost::container::small_vector<Buffer*, NUM_VERTEX_BUFFERS> buffers;
111 boost::container::small_vector<u64, NUM_VERTEX_BUFFERS> offsets;
112 boost::container::small_vector<u64, NUM_VERTEX_BUFFERS> sizes;
113 boost::container::small_vector<u64, NUM_VERTEX_BUFFERS> strides;
114 u32 min_index{NUM_VERTEX_BUFFERS};
115 u32 max_index{0};
116};
117
108class BufferCacheChannelInfo : public ChannelInfo { 118class BufferCacheChannelInfo : public ChannelInfo {
109public: 119public:
110 BufferCacheChannelInfo() = delete; 120 BufferCacheChannelInfo() = delete;
@@ -519,8 +529,6 @@ private:
519 529
520 void DeleteBuffer(BufferId buffer_id, bool do_not_mark = false); 530 void DeleteBuffer(BufferId buffer_id, bool do_not_mark = false);
521 531
522 void NotifyBufferDeletion();
523
524 [[nodiscard]] Binding StorageBufferBinding(GPUVAddr ssbo_addr, u32 cbuf_index, 532 [[nodiscard]] Binding StorageBufferBinding(GPUVAddr ssbo_addr, u32 cbuf_index,
525 bool is_written) const; 533 bool is_written) const;
526 534
diff --git a/src/video_core/engines/draw_manager.cpp b/src/video_core/engines/draw_manager.cpp
index 0e94c521a..f34090791 100644
--- a/src/video_core/engines/draw_manager.cpp
+++ b/src/video_core/engines/draw_manager.cpp
@@ -1,6 +1,7 @@
1// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later 2// SPDX-License-Identifier: GPL-2.0-or-later
3 3
4#include "common/settings.h"
4#include "video_core/dirty_flags.h" 5#include "video_core/dirty_flags.h"
5#include "video_core/engines/draw_manager.h" 6#include "video_core/engines/draw_manager.h"
6#include "video_core/rasterizer_interface.h" 7#include "video_core/rasterizer_interface.h"
@@ -195,8 +196,12 @@ void DrawManager::DrawTexture() {
195 if (lower_left) { 196 if (lower_left) {
196 draw_texture_state.dst_y0 -= dst_height; 197 draw_texture_state.dst_y0 -= dst_height;
197 } 198 }
198 draw_texture_state.dst_x1 = draw_texture_state.dst_x0 + dst_width; 199 draw_texture_state.dst_x1 =
199 draw_texture_state.dst_y1 = draw_texture_state.dst_y0 + dst_height; 200 draw_texture_state.dst_x0 +
201 static_cast<f32>(Settings::values.resolution_info.ScaleUp(static_cast<u32>(dst_width)));
202 draw_texture_state.dst_y1 =
203 draw_texture_state.dst_y0 +
204 static_cast<f32>(Settings::values.resolution_info.ScaleUp(static_cast<u32>(dst_height)));
200 draw_texture_state.src_x0 = static_cast<float>(regs.draw_texture.src_x0) / 4096.f; 205 draw_texture_state.src_x0 = static_cast<float>(regs.draw_texture.src_x0) / 4096.f;
201 draw_texture_state.src_y0 = static_cast<float>(regs.draw_texture.src_y0) / 4096.f; 206 draw_texture_state.src_y0 = static_cast<float>(regs.draw_texture.src_y0) / 4096.f;
202 draw_texture_state.src_x1 = 207 draw_texture_state.src_x1 =
@@ -207,7 +212,6 @@ void DrawManager::DrawTexture() {
207 draw_texture_state.src_y0; 212 draw_texture_state.src_y0;
208 draw_texture_state.src_sampler = regs.draw_texture.src_sampler; 213 draw_texture_state.src_sampler = regs.draw_texture.src_sampler;
209 draw_texture_state.src_texture = regs.draw_texture.src_texture; 214 draw_texture_state.src_texture = regs.draw_texture.src_texture;
210
211 maxwell3d->rasterizer->DrawTexture(); 215 maxwell3d->rasterizer->DrawTexture();
212} 216}
213 217
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp
index 7b2cde7a7..b2f7e160a 100644
--- a/src/video_core/memory_manager.cpp
+++ b/src/video_core/memory_manager.cpp
@@ -111,7 +111,7 @@ GPUVAddr MemoryManager::PageTableOp(GPUVAddr gpu_addr, [[maybe_unused]] VAddr cp
111 [[maybe_unused]] const auto current_entry_type = GetEntry<false>(current_gpu_addr); 111 [[maybe_unused]] const auto current_entry_type = GetEntry<false>(current_gpu_addr);
112 SetEntry<false>(current_gpu_addr, entry_type); 112 SetEntry<false>(current_gpu_addr, entry_type);
113 if (current_entry_type != entry_type) { 113 if (current_entry_type != entry_type) {
114 rasterizer->ModifyGPUMemory(unique_identifier, gpu_addr, page_size); 114 rasterizer->ModifyGPUMemory(unique_identifier, current_gpu_addr, page_size);
115 } 115 }
116 if constexpr (entry_type == EntryType::Mapped) { 116 if constexpr (entry_type == EntryType::Mapped) {
117 const VAddr current_cpu_addr = cpu_addr + offset; 117 const VAddr current_cpu_addr = cpu_addr + offset;
@@ -134,7 +134,7 @@ GPUVAddr MemoryManager::BigPageTableOp(GPUVAddr gpu_addr, [[maybe_unused]] VAddr
134 [[maybe_unused]] const auto current_entry_type = GetEntry<true>(current_gpu_addr); 134 [[maybe_unused]] const auto current_entry_type = GetEntry<true>(current_gpu_addr);
135 SetEntry<true>(current_gpu_addr, entry_type); 135 SetEntry<true>(current_gpu_addr, entry_type);
136 if (current_entry_type != entry_type) { 136 if (current_entry_type != entry_type) {
137 rasterizer->ModifyGPUMemory(unique_identifier, gpu_addr, big_page_size); 137 rasterizer->ModifyGPUMemory(unique_identifier, current_gpu_addr, big_page_size);
138 } 138 }
139 if constexpr (entry_type == EntryType::Mapped) { 139 if constexpr (entry_type == EntryType::Mapped) {
140 const VAddr current_cpu_addr = cpu_addr + offset; 140 const VAddr current_cpu_addr = cpu_addr + offset;
diff --git a/src/video_core/renderer_opengl/gl_buffer_cache.cpp b/src/video_core/renderer_opengl/gl_buffer_cache.cpp
index c419714d4..38d553d3c 100644
--- a/src/video_core/renderer_opengl/gl_buffer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_buffer_cache.cpp
@@ -232,6 +232,15 @@ void BufferCacheRuntime::BindVertexBuffer(u32 index, Buffer& buffer, u32 offset,
232 } 232 }
233} 233}
234 234
235void BufferCacheRuntime::BindVertexBuffers(VideoCommon::HostBindings<Buffer>& bindings) {
236 for (u32 index = 0; index < bindings.buffers.size(); ++index) {
237 BindVertexBuffer(bindings.min_index + index, *bindings.buffers[index],
238 static_cast<u32>(bindings.offsets[index]),
239 static_cast<u32>(bindings.sizes[index]),
240 static_cast<u32>(bindings.strides[index]));
241 }
242}
243
235void BufferCacheRuntime::BindUniformBuffer(size_t stage, u32 binding_index, Buffer& buffer, 244void BufferCacheRuntime::BindUniformBuffer(size_t stage, u32 binding_index, Buffer& buffer,
236 u32 offset, u32 size) { 245 u32 offset, u32 size) {
237 if (use_assembly_shaders) { 246 if (use_assembly_shaders) {
@@ -320,6 +329,14 @@ void BufferCacheRuntime::BindTransformFeedbackBuffer(u32 index, Buffer& buffer,
320 static_cast<GLintptr>(offset), static_cast<GLsizeiptr>(size)); 329 static_cast<GLintptr>(offset), static_cast<GLsizeiptr>(size));
321} 330}
322 331
332void BufferCacheRuntime::BindTransformFeedbackBuffers(VideoCommon::HostBindings<Buffer>& bindings) {
333 for (u32 index = 0; index < bindings.buffers.size(); ++index) {
334 glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, index, bindings.buffers[index]->Handle(),
335 static_cast<GLintptr>(bindings.offsets[index]),
336 static_cast<GLsizeiptr>(bindings.sizes[index]));
337 }
338}
339
323void BufferCacheRuntime::BindTextureBuffer(Buffer& buffer, u32 offset, u32 size, 340void BufferCacheRuntime::BindTextureBuffer(Buffer& buffer, u32 offset, u32 size,
324 PixelFormat format) { 341 PixelFormat format) {
325 *texture_handles++ = buffer.View(offset, size, format); 342 *texture_handles++ = buffer.View(offset, size, format);
diff --git a/src/video_core/renderer_opengl/gl_buffer_cache.h b/src/video_core/renderer_opengl/gl_buffer_cache.h
index a24991585..41b746f3b 100644
--- a/src/video_core/renderer_opengl/gl_buffer_cache.h
+++ b/src/video_core/renderer_opengl/gl_buffer_cache.h
@@ -7,7 +7,7 @@
7#include <span> 7#include <span>
8 8
9#include "common/common_types.h" 9#include "common/common_types.h"
10#include "video_core/buffer_cache/buffer_cache.h" 10#include "video_core/buffer_cache/buffer_cache_base.h"
11#include "video_core/buffer_cache/memory_tracker_base.h" 11#include "video_core/buffer_cache/memory_tracker_base.h"
12#include "video_core/rasterizer_interface.h" 12#include "video_core/rasterizer_interface.h"
13#include "video_core/renderer_opengl/gl_device.h" 13#include "video_core/renderer_opengl/gl_device.h"
@@ -88,6 +88,8 @@ public:
88 88
89 void BindVertexBuffer(u32 index, Buffer& buffer, u32 offset, u32 size, u32 stride); 89 void BindVertexBuffer(u32 index, Buffer& buffer, u32 offset, u32 size, u32 stride);
90 90
91 void BindVertexBuffers(VideoCommon::HostBindings<Buffer>& bindings);
92
91 void BindUniformBuffer(size_t stage, u32 binding_index, Buffer& buffer, u32 offset, u32 size); 93 void BindUniformBuffer(size_t stage, u32 binding_index, Buffer& buffer, u32 offset, u32 size);
92 94
93 void BindComputeUniformBuffer(u32 binding_index, Buffer& buffer, u32 offset, u32 size); 95 void BindComputeUniformBuffer(u32 binding_index, Buffer& buffer, u32 offset, u32 size);
@@ -100,6 +102,8 @@ public:
100 102
101 void BindTransformFeedbackBuffer(u32 index, Buffer& buffer, u32 offset, u32 size); 103 void BindTransformFeedbackBuffer(u32 index, Buffer& buffer, u32 offset, u32 size);
102 104
105 void BindTransformFeedbackBuffers(VideoCommon::HostBindings<Buffer>& bindings);
106
103 void BindTextureBuffer(Buffer& buffer, u32 offset, u32 size, 107 void BindTextureBuffer(Buffer& buffer, u32 offset, u32 size,
104 VideoCore::Surface::PixelFormat format); 108 VideoCore::Surface::PixelFormat format);
105 109
diff --git a/src/video_core/renderer_opengl/gl_compute_pipeline.cpp b/src/video_core/renderer_opengl/gl_compute_pipeline.cpp
index 1a0cea9b7..3151c0db8 100644
--- a/src/video_core/renderer_opengl/gl_compute_pipeline.cpp
+++ b/src/video_core/renderer_opengl/gl_compute_pipeline.cpp
@@ -87,7 +87,8 @@ void ComputePipeline::Configure() {
87 texture_cache.SynchronizeComputeDescriptors(); 87 texture_cache.SynchronizeComputeDescriptors();
88 88
89 boost::container::static_vector<VideoCommon::ImageViewInOut, MAX_TEXTURES + MAX_IMAGES> views; 89 boost::container::static_vector<VideoCommon::ImageViewInOut, MAX_TEXTURES + MAX_IMAGES> views;
90 std::array<GLuint, MAX_TEXTURES> samplers; 90 boost::container::static_vector<VideoCommon::SamplerId, MAX_TEXTURES> samplers;
91 std::array<GLuint, MAX_TEXTURES> gl_samplers;
91 std::array<GLuint, MAX_TEXTURES> textures; 92 std::array<GLuint, MAX_TEXTURES> textures;
92 std::array<GLuint, MAX_IMAGES> images; 93 std::array<GLuint, MAX_IMAGES> images;
93 GLsizei sampler_binding{}; 94 GLsizei sampler_binding{};
@@ -131,7 +132,6 @@ void ComputePipeline::Configure() {
131 for (u32 index = 0; index < desc.count; ++index) { 132 for (u32 index = 0; index < desc.count; ++index) {
132 const auto handle{read_handle(desc, index)}; 133 const auto handle{read_handle(desc, index)};
133 views.push_back({handle.first}); 134 views.push_back({handle.first});
134 samplers[sampler_binding++] = 0;
135 } 135 }
136 } 136 }
137 for (const auto& desc : info.image_buffer_descriptors) { 137 for (const auto& desc : info.image_buffer_descriptors) {
@@ -142,8 +142,8 @@ void ComputePipeline::Configure() {
142 const auto handle{read_handle(desc, index)}; 142 const auto handle{read_handle(desc, index)};
143 views.push_back({handle.first}); 143 views.push_back({handle.first});
144 144
145 Sampler* const sampler = texture_cache.GetComputeSampler(handle.second); 145 VideoCommon::SamplerId sampler = texture_cache.GetComputeSamplerId(handle.second);
146 samplers[sampler_binding++] = sampler->Handle(); 146 samplers.push_back(sampler);
147 } 147 }
148 } 148 }
149 for (const auto& desc : info.image_descriptors) { 149 for (const auto& desc : info.image_descriptors) {
@@ -186,10 +186,17 @@ void ComputePipeline::Configure() {
186 186
187 const VideoCommon::ImageViewInOut* views_it{views.data() + num_texture_buffers + 187 const VideoCommon::ImageViewInOut* views_it{views.data() + num_texture_buffers +
188 num_image_buffers}; 188 num_image_buffers};
189 const VideoCommon::SamplerId* samplers_it{samplers.data()};
189 texture_binding += num_texture_buffers; 190 texture_binding += num_texture_buffers;
190 image_binding += num_image_buffers; 191 image_binding += num_image_buffers;
191 192
192 u32 texture_scaling_mask{}; 193 u32 texture_scaling_mask{};
194
195 for (const auto& desc : info.texture_buffer_descriptors) {
196 for (u32 index = 0; index < desc.count; ++index) {
197 gl_samplers[sampler_binding++] = 0;
198 }
199 }
193 for (const auto& desc : info.texture_descriptors) { 200 for (const auto& desc : info.texture_descriptors) {
194 for (u32 index = 0; index < desc.count; ++index) { 201 for (u32 index = 0; index < desc.count; ++index) {
195 ImageView& image_view{texture_cache.GetImageView((views_it++)->id)}; 202 ImageView& image_view{texture_cache.GetImageView((views_it++)->id)};
@@ -198,6 +205,12 @@ void ComputePipeline::Configure() {
198 texture_scaling_mask |= 1u << texture_binding; 205 texture_scaling_mask |= 1u << texture_binding;
199 } 206 }
200 ++texture_binding; 207 ++texture_binding;
208
209 const Sampler& sampler{texture_cache.GetSampler(*(samplers_it++))};
210 const bool use_fallback_sampler{sampler.HasAddedAnisotropy() &&
211 !image_view.SupportsAnisotropy()};
212 gl_samplers[sampler_binding++] =
213 use_fallback_sampler ? sampler.HandleWithDefaultAnisotropy() : sampler.Handle();
201 } 214 }
202 } 215 }
203 u32 image_scaling_mask{}; 216 u32 image_scaling_mask{};
@@ -228,7 +241,7 @@ void ComputePipeline::Configure() {
228 if (texture_binding != 0) { 241 if (texture_binding != 0) {
229 ASSERT(texture_binding == sampler_binding); 242 ASSERT(texture_binding == sampler_binding);
230 glBindTextures(0, texture_binding, textures.data()); 243 glBindTextures(0, texture_binding, textures.data());
231 glBindSamplers(0, sampler_binding, samplers.data()); 244 glBindSamplers(0, sampler_binding, gl_samplers.data());
232 } 245 }
233 if (image_binding != 0) { 246 if (image_binding != 0) {
234 glBindImageTextures(0, image_binding, images.data()); 247 glBindImageTextures(0, image_binding, images.data());
diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp
index 400c21981..03d234f2f 100644
--- a/src/video_core/renderer_opengl/gl_device.cpp
+++ b/src/video_core/renderer_opengl/gl_device.cpp
@@ -201,6 +201,7 @@ Device::Device(Core::Frontend::EmuWindow& emu_window) {
201 use_asynchronous_shaders = Settings::values.use_asynchronous_shaders.GetValue() && 201 use_asynchronous_shaders = Settings::values.use_asynchronous_shaders.GetValue() &&
202 !(is_amd || (is_intel && !is_linux)) && !strict_context_required; 202 !(is_amd || (is_intel && !is_linux)) && !strict_context_required;
203 use_driver_cache = is_nvidia; 203 use_driver_cache = is_nvidia;
204 supports_conditional_barriers = !is_intel;
204 205
205 LOG_INFO(Render_OpenGL, "Renderer_VariableAOFFI: {}", has_variable_aoffi); 206 LOG_INFO(Render_OpenGL, "Renderer_VariableAOFFI: {}", has_variable_aoffi);
206 LOG_INFO(Render_OpenGL, "Renderer_ComponentIndexingBug: {}", has_component_indexing_bug); 207 LOG_INFO(Render_OpenGL, "Renderer_ComponentIndexingBug: {}", has_component_indexing_bug);
diff --git a/src/video_core/renderer_opengl/gl_device.h b/src/video_core/renderer_opengl/gl_device.h
index cc0b95f1a..ad27264e5 100644
--- a/src/video_core/renderer_opengl/gl_device.h
+++ b/src/video_core/renderer_opengl/gl_device.h
@@ -188,6 +188,10 @@ public:
188 return strict_context_required; 188 return strict_context_required;
189 } 189 }
190 190
191 bool SupportsConditionalBarriers() const {
192 return supports_conditional_barriers;
193 }
194
191private: 195private:
192 static bool TestVariableAoffi(); 196 static bool TestVariableAoffi();
193 static bool TestPreciseBug(); 197 static bool TestPreciseBug();
@@ -233,6 +237,7 @@ private:
233 bool has_bool_ref_bug{}; 237 bool has_bool_ref_bug{};
234 bool can_report_memory{}; 238 bool can_report_memory{};
235 bool strict_context_required{}; 239 bool strict_context_required{};
240 bool supports_conditional_barriers{};
236 241
237 std::string vendor_name; 242 std::string vendor_name;
238}; 243};
diff --git a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp
index 89000d6e0..c58f760b8 100644
--- a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp
+++ b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp
@@ -275,9 +275,9 @@ GraphicsPipeline::GraphicsPipeline(const Device& device, TextureCache& texture_c
275template <typename Spec> 275template <typename Spec>
276void GraphicsPipeline::ConfigureImpl(bool is_indexed) { 276void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
277 std::array<VideoCommon::ImageViewInOut, MAX_TEXTURES + MAX_IMAGES> views; 277 std::array<VideoCommon::ImageViewInOut, MAX_TEXTURES + MAX_IMAGES> views;
278 std::array<GLuint, MAX_TEXTURES> samplers; 278 std::array<VideoCommon::SamplerId, MAX_TEXTURES> samplers;
279 size_t views_index{}; 279 size_t views_index{};
280 GLsizei sampler_binding{}; 280 size_t samplers_index{};
281 281
282 texture_cache.SynchronizeGraphicsDescriptors(); 282 texture_cache.SynchronizeGraphicsDescriptors();
283 283
@@ -337,7 +337,6 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
337 for (u32 index = 0; index < desc.count; ++index) { 337 for (u32 index = 0; index < desc.count; ++index) {
338 const auto handle{read_handle(desc, index)}; 338 const auto handle{read_handle(desc, index)};
339 views[views_index++] = {handle.first}; 339 views[views_index++] = {handle.first};
340 samplers[sampler_binding++] = 0;
341 } 340 }
342 } 341 }
343 } 342 }
@@ -351,8 +350,8 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
351 const auto handle{read_handle(desc, index)}; 350 const auto handle{read_handle(desc, index)};
352 views[views_index++] = {handle.first}; 351 views[views_index++] = {handle.first};
353 352
354 Sampler* const sampler{texture_cache.GetGraphicsSampler(handle.second)}; 353 VideoCommon::SamplerId sampler{texture_cache.GetGraphicsSamplerId(handle.second)};
355 samplers[sampler_binding++] = sampler->Handle(); 354 samplers[samplers_index++] = sampler;
356 } 355 }
357 } 356 }
358 if constexpr (Spec::has_images) { 357 if constexpr (Spec::has_images) {
@@ -445,10 +444,13 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
445 program_manager.BindSourcePrograms(source_programs); 444 program_manager.BindSourcePrograms(source_programs);
446 } 445 }
447 const VideoCommon::ImageViewInOut* views_it{views.data()}; 446 const VideoCommon::ImageViewInOut* views_it{views.data()};
447 const VideoCommon::SamplerId* samplers_it{samplers.data()};
448 GLsizei texture_binding = 0; 448 GLsizei texture_binding = 0;
449 GLsizei image_binding = 0; 449 GLsizei image_binding = 0;
450 GLsizei sampler_binding{};
450 std::array<GLuint, MAX_TEXTURES> textures; 451 std::array<GLuint, MAX_TEXTURES> textures;
451 std::array<GLuint, MAX_IMAGES> images; 452 std::array<GLuint, MAX_IMAGES> images;
453 std::array<GLuint, MAX_TEXTURES> gl_samplers;
452 const auto prepare_stage{[&](size_t stage) { 454 const auto prepare_stage{[&](size_t stage) {
453 buffer_cache.runtime.SetImagePointers(&textures[texture_binding], &images[image_binding]); 455 buffer_cache.runtime.SetImagePointers(&textures[texture_binding], &images[image_binding]);
454 buffer_cache.BindHostStageBuffers(stage); 456 buffer_cache.BindHostStageBuffers(stage);
@@ -465,6 +467,13 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
465 u32 stage_image_binding{}; 467 u32 stage_image_binding{};
466 468
467 const auto& info{stage_infos[stage]}; 469 const auto& info{stage_infos[stage]};
470 if constexpr (Spec::has_texture_buffers) {
471 for (const auto& desc : info.texture_buffer_descriptors) {
472 for (u32 index = 0; index < desc.count; ++index) {
473 gl_samplers[sampler_binding++] = 0;
474 }
475 }
476 }
468 for (const auto& desc : info.texture_descriptors) { 477 for (const auto& desc : info.texture_descriptors) {
469 for (u32 index = 0; index < desc.count; ++index) { 478 for (u32 index = 0; index < desc.count; ++index) {
470 ImageView& image_view{texture_cache.GetImageView((views_it++)->id)}; 479 ImageView& image_view{texture_cache.GetImageView((views_it++)->id)};
@@ -474,6 +483,12 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
474 } 483 }
475 ++texture_binding; 484 ++texture_binding;
476 ++stage_texture_binding; 485 ++stage_texture_binding;
486
487 const Sampler& sampler{texture_cache.GetSampler(*(samplers_it++))};
488 const bool use_fallback_sampler{sampler.HasAddedAnisotropy() &&
489 !image_view.SupportsAnisotropy()};
490 gl_samplers[sampler_binding++] =
491 use_fallback_sampler ? sampler.HandleWithDefaultAnisotropy() : sampler.Handle();
477 } 492 }
478 } 493 }
479 for (const auto& desc : info.image_descriptors) { 494 for (const auto& desc : info.image_descriptors) {
@@ -534,7 +549,7 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
534 if (texture_binding != 0) { 549 if (texture_binding != 0) {
535 ASSERT(texture_binding == sampler_binding); 550 ASSERT(texture_binding == sampler_binding);
536 glBindTextures(0, texture_binding, textures.data()); 551 glBindTextures(0, texture_binding, textures.data());
537 glBindSamplers(0, sampler_binding, samplers.data()); 552 glBindSamplers(0, sampler_binding, gl_samplers.data());
538 } 553 }
539 if (image_binding != 0) { 554 if (image_binding != 0) {
540 glBindImageTextures(0, image_binding, images.data()); 555 glBindImageTextures(0, image_binding, images.data());
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp
index 6ecda2984..3f077311e 100644
--- a/src/video_core/renderer_opengl/gl_shader_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp
@@ -232,12 +232,14 @@ ShaderCache::ShaderCache(RasterizerOpenGL& rasterizer_, Core::Frontend::EmuWindo
232 .gl_max_compute_smem_size = device.GetMaxComputeSharedMemorySize(), 232 .gl_max_compute_smem_size = device.GetMaxComputeSharedMemorySize(),
233 }, 233 },
234 host_info{ 234 host_info{
235 .support_float64 = true,
235 .support_float16 = false, 236 .support_float16 = false,
236 .support_int64 = device.HasShaderInt64(), 237 .support_int64 = device.HasShaderInt64(),
237 .needs_demote_reorder = device.IsAmd(), 238 .needs_demote_reorder = device.IsAmd(),
238 .support_snorm_render_buffer = false, 239 .support_snorm_render_buffer = false,
239 .support_viewport_index_layer = device.HasVertexViewportLayer(), 240 .support_viewport_index_layer = device.HasVertexViewportLayer(),
240 .support_geometry_shader_passthrough = device.HasGeometryShaderPassthrough(), 241 .support_geometry_shader_passthrough = device.HasGeometryShaderPassthrough(),
242 .support_conditional_barrier = device.SupportsConditionalBarriers(),
241 } { 243 } {
242 if (use_asynchronous_shaders) { 244 if (use_asynchronous_shaders) {
243 workers = CreateWorkers(); 245 workers = CreateWorkers();
diff --git a/src/video_core/renderer_opengl/gl_shader_context.h b/src/video_core/renderer_opengl/gl_shader_context.h
index 207a75d42..d12cd06fa 100644
--- a/src/video_core/renderer_opengl/gl_shader_context.h
+++ b/src/video_core/renderer_opengl/gl_shader_context.h
@@ -16,9 +16,9 @@ struct ShaderPools {
16 inst.ReleaseContents(); 16 inst.ReleaseContents();
17 } 17 }
18 18
19 Shader::ObjectPool<Shader::IR::Inst> inst; 19 Shader::ObjectPool<Shader::IR::Inst> inst{8192};
20 Shader::ObjectPool<Shader::IR::Block> block; 20 Shader::ObjectPool<Shader::IR::Block> block{32};
21 Shader::ObjectPool<Shader::Maxwell::Flow::Block> flow_block; 21 Shader::ObjectPool<Shader::Maxwell::Flow::Block> flow_block{32};
22}; 22};
23 23
24struct Context { 24struct Context {
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index 1c5dbcdd8..3b446be07 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -1268,36 +1268,48 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const TSCEntry& config) {
1268 1268
1269 UNIMPLEMENTED_IF(config.cubemap_anisotropy != 1); 1269 UNIMPLEMENTED_IF(config.cubemap_anisotropy != 1);
1270 1270
1271 sampler.Create(); 1271 const f32 max_anisotropy = std::clamp(config.MaxAnisotropy(), 1.0f, 16.0f);
1272 const GLuint handle = sampler.handle; 1272
1273 glSamplerParameteri(handle, GL_TEXTURE_WRAP_S, MaxwellToGL::WrapMode(config.wrap_u)); 1273 const auto create_sampler = [&](const f32 anisotropy) {
1274 glSamplerParameteri(handle, GL_TEXTURE_WRAP_T, MaxwellToGL::WrapMode(config.wrap_v)); 1274 OGLSampler new_sampler;
1275 glSamplerParameteri(handle, GL_TEXTURE_WRAP_R, MaxwellToGL::WrapMode(config.wrap_p)); 1275 new_sampler.Create();
1276 glSamplerParameteri(handle, GL_TEXTURE_COMPARE_MODE, compare_mode); 1276 const GLuint handle = new_sampler.handle;
1277 glSamplerParameteri(handle, GL_TEXTURE_COMPARE_FUNC, compare_func); 1277 glSamplerParameteri(handle, GL_TEXTURE_WRAP_S, MaxwellToGL::WrapMode(config.wrap_u));
1278 glSamplerParameteri(handle, GL_TEXTURE_MAG_FILTER, mag); 1278 glSamplerParameteri(handle, GL_TEXTURE_WRAP_T, MaxwellToGL::WrapMode(config.wrap_v));
1279 glSamplerParameteri(handle, GL_TEXTURE_MIN_FILTER, min); 1279 glSamplerParameteri(handle, GL_TEXTURE_WRAP_R, MaxwellToGL::WrapMode(config.wrap_p));
1280 glSamplerParameterf(handle, GL_TEXTURE_LOD_BIAS, config.LodBias()); 1280 glSamplerParameteri(handle, GL_TEXTURE_COMPARE_MODE, compare_mode);
1281 glSamplerParameterf(handle, GL_TEXTURE_MIN_LOD, config.MinLod()); 1281 glSamplerParameteri(handle, GL_TEXTURE_COMPARE_FUNC, compare_func);
1282 glSamplerParameterf(handle, GL_TEXTURE_MAX_LOD, config.MaxLod()); 1282 glSamplerParameteri(handle, GL_TEXTURE_MAG_FILTER, mag);
1283 glSamplerParameterfv(handle, GL_TEXTURE_BORDER_COLOR, config.BorderColor().data()); 1283 glSamplerParameteri(handle, GL_TEXTURE_MIN_FILTER, min);
1284 1284 glSamplerParameterf(handle, GL_TEXTURE_LOD_BIAS, config.LodBias());
1285 if (GLAD_GL_ARB_texture_filter_anisotropic || GLAD_GL_EXT_texture_filter_anisotropic) { 1285 glSamplerParameterf(handle, GL_TEXTURE_MIN_LOD, config.MinLod());
1286 const f32 max_anisotropy = std::clamp(config.MaxAnisotropy(), 1.0f, 16.0f); 1286 glSamplerParameterf(handle, GL_TEXTURE_MAX_LOD, config.MaxLod());
1287 glSamplerParameterf(handle, GL_TEXTURE_MAX_ANISOTROPY, max_anisotropy); 1287 glSamplerParameterfv(handle, GL_TEXTURE_BORDER_COLOR, config.BorderColor().data());
1288 } else { 1288
1289 LOG_WARNING(Render_OpenGL, "GL_ARB_texture_filter_anisotropic is required"); 1289 if (GLAD_GL_ARB_texture_filter_anisotropic || GLAD_GL_EXT_texture_filter_anisotropic) {
1290 } 1290 glSamplerParameterf(handle, GL_TEXTURE_MAX_ANISOTROPY, anisotropy);
1291 if (GLAD_GL_ARB_texture_filter_minmax || GLAD_GL_EXT_texture_filter_minmax) { 1291 } else {
1292 glSamplerParameteri(handle, GL_TEXTURE_REDUCTION_MODE_ARB, reduction_filter); 1292 LOG_WARNING(Render_OpenGL, "GL_ARB_texture_filter_anisotropic is required");
1293 } else if (reduction_filter != GL_WEIGHTED_AVERAGE_ARB) { 1293 }
1294 LOG_WARNING(Render_OpenGL, "GL_ARB_texture_filter_minmax is required"); 1294 if (GLAD_GL_ARB_texture_filter_minmax || GLAD_GL_EXT_texture_filter_minmax) {
1295 } 1295 glSamplerParameteri(handle, GL_TEXTURE_REDUCTION_MODE_ARB, reduction_filter);
1296 if (GLAD_GL_ARB_seamless_cubemap_per_texture || GLAD_GL_AMD_seamless_cubemap_per_texture) { 1296 } else if (reduction_filter != GL_WEIGHTED_AVERAGE_ARB) {
1297 glSamplerParameteri(handle, GL_TEXTURE_CUBE_MAP_SEAMLESS, seamless); 1297 LOG_WARNING(Render_OpenGL, "GL_ARB_texture_filter_minmax is required");
1298 } else if (seamless == GL_FALSE) { 1298 }
1299 // We default to false because it's more common 1299 if (GLAD_GL_ARB_seamless_cubemap_per_texture || GLAD_GL_AMD_seamless_cubemap_per_texture) {
1300 LOG_WARNING(Render_OpenGL, "GL_ARB_seamless_cubemap_per_texture is required"); 1300 glSamplerParameteri(handle, GL_TEXTURE_CUBE_MAP_SEAMLESS, seamless);
1301 } else if (seamless == GL_FALSE) {
1302 // We default to false because it's more common
1303 LOG_WARNING(Render_OpenGL, "GL_ARB_seamless_cubemap_per_texture is required");
1304 }
1305 return new_sampler;
1306 };
1307
1308 sampler = create_sampler(max_anisotropy);
1309
1310 const f32 max_anisotropy_default = static_cast<f32>(1U << config.max_anisotropy);
1311 if (max_anisotropy > max_anisotropy_default) {
1312 sampler_default_anisotropy = create_sampler(max_anisotropy_default);
1301 } 1313 }
1302} 1314}
1303 1315
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h
index 1148b73d7..3676eaaa9 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.h
+++ b/src/video_core/renderer_opengl/gl_texture_cache.h
@@ -309,12 +309,21 @@ class Sampler {
309public: 309public:
310 explicit Sampler(TextureCacheRuntime&, const Tegra::Texture::TSCEntry&); 310 explicit Sampler(TextureCacheRuntime&, const Tegra::Texture::TSCEntry&);
311 311
312 GLuint Handle() const noexcept { 312 [[nodiscard]] GLuint Handle() const noexcept {
313 return sampler.handle; 313 return sampler.handle;
314 } 314 }
315 315
316 [[nodiscard]] GLuint HandleWithDefaultAnisotropy() const noexcept {
317 return sampler_default_anisotropy.handle;
318 }
319
320 [[nodiscard]] bool HasAddedAnisotropy() const noexcept {
321 return static_cast<bool>(sampler_default_anisotropy.handle);
322 }
323
316private: 324private:
317 OGLSampler sampler; 325 OGLSampler sampler;
326 OGLSampler sampler_default_anisotropy;
318}; 327};
319 328
320class Framebuffer { 329class Framebuffer {
diff --git a/src/video_core/renderer_vulkan/pipeline_helper.h b/src/video_core/renderer_vulkan/pipeline_helper.h
index 983e1c2e1..71c783709 100644
--- a/src/video_core/renderer_vulkan/pipeline_helper.h
+++ b/src/video_core/renderer_vulkan/pipeline_helper.h
@@ -178,7 +178,7 @@ public:
178inline void PushImageDescriptors(TextureCache& texture_cache, 178inline void PushImageDescriptors(TextureCache& texture_cache,
179 GuestDescriptorQueue& guest_descriptor_queue, 179 GuestDescriptorQueue& guest_descriptor_queue,
180 const Shader::Info& info, RescalingPushConstant& rescaling, 180 const Shader::Info& info, RescalingPushConstant& rescaling,
181 const VkSampler*& samplers, 181 const VideoCommon::SamplerId*& samplers,
182 const VideoCommon::ImageViewInOut*& views) { 182 const VideoCommon::ImageViewInOut*& views) {
183 const u32 num_texture_buffers = Shader::NumDescriptors(info.texture_buffer_descriptors); 183 const u32 num_texture_buffers = Shader::NumDescriptors(info.texture_buffer_descriptors);
184 const u32 num_image_buffers = Shader::NumDescriptors(info.image_buffer_descriptors); 184 const u32 num_image_buffers = Shader::NumDescriptors(info.image_buffer_descriptors);
@@ -187,10 +187,15 @@ inline void PushImageDescriptors(TextureCache& texture_cache,
187 for (const auto& desc : info.texture_descriptors) { 187 for (const auto& desc : info.texture_descriptors) {
188 for (u32 index = 0; index < desc.count; ++index) { 188 for (u32 index = 0; index < desc.count; ++index) {
189 const VideoCommon::ImageViewId image_view_id{(views++)->id}; 189 const VideoCommon::ImageViewId image_view_id{(views++)->id};
190 const VkSampler sampler{*(samplers++)}; 190 const VideoCommon::SamplerId sampler_id{*(samplers++)};
191 ImageView& image_view{texture_cache.GetImageView(image_view_id)}; 191 ImageView& image_view{texture_cache.GetImageView(image_view_id)};
192 const VkImageView vk_image_view{image_view.Handle(desc.type)}; 192 const VkImageView vk_image_view{image_view.Handle(desc.type)};
193 guest_descriptor_queue.AddSampledImage(vk_image_view, sampler); 193 const Sampler& sampler{texture_cache.GetSampler(sampler_id)};
194 const bool use_fallback_sampler{sampler.HasAddedAnisotropy() &&
195 !image_view.SupportsAnisotropy()};
196 const VkSampler vk_sampler{use_fallback_sampler ? sampler.HandleWithDefaultAnisotropy()
197 : sampler.Handle()};
198 guest_descriptor_queue.AddSampledImage(vk_image_view, vk_sampler);
194 rescaling.PushTexture(texture_cache.IsRescaling(image_view)); 199 rescaling.PushTexture(texture_cache.IsRescaling(image_view));
195 } 200 }
196 } 201 }
diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.cpp b/src/video_core/renderer_vulkan/vk_blit_screen.cpp
index 7cdde992b..acb143fc7 100644
--- a/src/video_core/renderer_vulkan/vk_blit_screen.cpp
+++ b/src/video_core/renderer_vulkan/vk_blit_screen.cpp
@@ -37,10 +37,6 @@
37#include "video_core/vulkan_common/vulkan_memory_allocator.h" 37#include "video_core/vulkan_common/vulkan_memory_allocator.h"
38#include "video_core/vulkan_common/vulkan_wrapper.h" 38#include "video_core/vulkan_common/vulkan_wrapper.h"
39 39
40#ifdef ANDROID
41extern u32 GetAndroidScreenRotation();
42#endif
43
44namespace Vulkan { 40namespace Vulkan {
45 41
46namespace { 42namespace {
@@ -78,47 +74,6 @@ struct ScreenRectVertex {
78 } 74 }
79}; 75};
80 76
81#ifdef ANDROID
82
83std::array<f32, 4 * 4> MakeOrthographicMatrix(f32 width, f32 height) {
84 constexpr u32 ROTATION_0 = 0;
85 constexpr u32 ROTATION_90 = 1;
86 constexpr u32 ROTATION_180 = 2;
87 constexpr u32 ROTATION_270 = 3;
88
89 // clang-format off
90 switch (GetAndroidScreenRotation()) {
91 case ROTATION_0:
92 // Desktop
93 return { 2.f / width, 0.f, 0.f, 0.f,
94 0.f, 2.f / height, 0.f, 0.f,
95 0.f, 0.f, 1.f, 0.f,
96 -1.f, -1.f, 0.f, 1.f};
97 case ROTATION_180:
98 // Reverse desktop
99 return {-2.f / width, 0.f, 0.f, 0.f,
100 0.f, -2.f / height, 0.f, 0.f,
101 0.f, 0.f, 1.f, 0.f,
102 1.f, 1.f, 0.f, 1.f};
103 case ROTATION_270:
104 // Reverse landscape
105 return { 0.f, -2.f / width, 0.f, 0.f,
106 2.f / height, 0.f, 0.f, 0.f,
107 0.f, 0.f, 1.f, 0.f,
108 -1.f, 1.f, 0.f, 1.f};
109 case ROTATION_90:
110 default:
111 // Landscape
112 return { 0.f, 2.f / width, 0.f, 0.f,
113 -2.f / height, 0.f, 0.f, 0.f,
114 0.f, 0.f, 1.f, 0.f,
115 1.f, -1.f, 0.f, 1.f};
116 }
117 // clang-format on
118}
119
120#else
121
122std::array<f32, 4 * 4> MakeOrthographicMatrix(f32 width, f32 height) { 77std::array<f32, 4 * 4> MakeOrthographicMatrix(f32 width, f32 height) {
123 // clang-format off 78 // clang-format off
124 return { 2.f / width, 0.f, 0.f, 0.f, 79 return { 2.f / width, 0.f, 0.f, 0.f,
@@ -128,8 +83,6 @@ std::array<f32, 4 * 4> MakeOrthographicMatrix(f32 width, f32 height) {
128 // clang-format on 83 // clang-format on
129} 84}
130 85
131#endif
132
133u32 GetBytesPerPixel(const Tegra::FramebufferConfig& framebuffer) { 86u32 GetBytesPerPixel(const Tegra::FramebufferConfig& framebuffer) {
134 using namespace VideoCore::Surface; 87 using namespace VideoCore::Surface;
135 return BytesPerBlock(PixelFormatFromGPUPixelFormat(framebuffer.pixel_format)); 88 return BytesPerBlock(PixelFormatFromGPUPixelFormat(framebuffer.pixel_format));
@@ -1159,7 +1112,7 @@ void BlitScreen::CreateRawImages(const Tegra::FramebufferConfig& framebuffer) {
1159 .pNext = nullptr, 1112 .pNext = nullptr,
1160 .flags = 0, 1113 .flags = 0,
1161 .imageType = VK_IMAGE_TYPE_2D, 1114 .imageType = VK_IMAGE_TYPE_2D,
1162 .format = GetFormat(framebuffer), 1115 .format = used_on_framebuffer ? VK_FORMAT_R16G16B16A16_SFLOAT : GetFormat(framebuffer),
1163 .extent = 1116 .extent =
1164 { 1117 {
1165 .width = (up_scale * framebuffer.width) >> down_shift, 1118 .width = (up_scale * framebuffer.width) >> down_shift,
@@ -1180,14 +1133,14 @@ void BlitScreen::CreateRawImages(const Tegra::FramebufferConfig& framebuffer) {
1180 const auto create_commit = [&](vk::Image& image) { 1133 const auto create_commit = [&](vk::Image& image) {
1181 return memory_allocator.Commit(image, MemoryUsage::DeviceLocal); 1134 return memory_allocator.Commit(image, MemoryUsage::DeviceLocal);
1182 }; 1135 };
1183 const auto create_image_view = [&](vk::Image& image) { 1136 const auto create_image_view = [&](vk::Image& image, bool used_on_framebuffer = false) {
1184 return device.GetLogical().CreateImageView(VkImageViewCreateInfo{ 1137 return device.GetLogical().CreateImageView(VkImageViewCreateInfo{
1185 .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, 1138 .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
1186 .pNext = nullptr, 1139 .pNext = nullptr,
1187 .flags = 0, 1140 .flags = 0,
1188 .image = *image, 1141 .image = *image,
1189 .viewType = VK_IMAGE_VIEW_TYPE_2D, 1142 .viewType = VK_IMAGE_VIEW_TYPE_2D,
1190 .format = GetFormat(framebuffer), 1143 .format = used_on_framebuffer ? VK_FORMAT_R16G16B16A16_SFLOAT : GetFormat(framebuffer),
1191 .components = 1144 .components =
1192 { 1145 {
1193 .r = VK_COMPONENT_SWIZZLE_IDENTITY, 1146 .r = VK_COMPONENT_SWIZZLE_IDENTITY,
@@ -1217,7 +1170,7 @@ void BlitScreen::CreateRawImages(const Tegra::FramebufferConfig& framebuffer) {
1217 const u32 down_shift = Settings::values.resolution_info.down_shift; 1170 const u32 down_shift = Settings::values.resolution_info.down_shift;
1218 aa_image = create_image(true, up_scale, down_shift); 1171 aa_image = create_image(true, up_scale, down_shift);
1219 aa_commit = create_commit(aa_image); 1172 aa_commit = create_commit(aa_image);
1220 aa_image_view = create_image_view(aa_image); 1173 aa_image_view = create_image_view(aa_image, true);
1221 VkExtent2D size{ 1174 VkExtent2D size{
1222 .width = (up_scale * framebuffer.width) >> down_shift, 1175 .width = (up_scale * framebuffer.width) >> down_shift,
1223 .height = (up_scale * framebuffer.height) >> down_shift, 1176 .height = (up_scale * framebuffer.height) >> down_shift,
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp
index daa128399..e30fcb1ed 100644
--- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp
@@ -7,7 +7,6 @@
7#include <span> 7#include <span>
8#include <vector> 8#include <vector>
9 9
10#include "video_core/buffer_cache/buffer_cache.h"
11#include "video_core/renderer_vulkan/maxwell_to_vk.h" 10#include "video_core/renderer_vulkan/maxwell_to_vk.h"
12#include "video_core/renderer_vulkan/vk_buffer_cache.h" 11#include "video_core/renderer_vulkan/vk_buffer_cache.h"
13#include "video_core/renderer_vulkan/vk_scheduler.h" 12#include "video_core/renderer_vulkan/vk_scheduler.h"
@@ -502,6 +501,36 @@ void BufferCacheRuntime::BindVertexBuffer(u32 index, VkBuffer buffer, u32 offset
502 } 501 }
503} 502}
504 503
504void BufferCacheRuntime::BindVertexBuffers(VideoCommon::HostBindings<Buffer>& bindings) {
505 boost::container::small_vector<VkBuffer, 32> buffer_handles;
506 for (u32 index = 0; index < bindings.buffers.size(); ++index) {
507 auto handle = bindings.buffers[index]->Handle();
508 if (handle == VK_NULL_HANDLE) {
509 bindings.offsets[index] = 0;
510 bindings.sizes[index] = VK_WHOLE_SIZE;
511 if (!device.HasNullDescriptor()) {
512 ReserveNullBuffer();
513 handle = *null_buffer;
514 }
515 }
516 buffer_handles.push_back(handle);
517 }
518 if (device.IsExtExtendedDynamicStateSupported()) {
519 scheduler.Record([bindings = std::move(bindings),
520 buffer_handles = std::move(buffer_handles)](vk::CommandBuffer cmdbuf) {
521 cmdbuf.BindVertexBuffers2EXT(
522 bindings.min_index, bindings.max_index - bindings.min_index, buffer_handles.data(),
523 bindings.offsets.data(), bindings.sizes.data(), bindings.strides.data());
524 });
525 } else {
526 scheduler.Record([bindings = std::move(bindings),
527 buffer_handles = std::move(buffer_handles)](vk::CommandBuffer cmdbuf) {
528 cmdbuf.BindVertexBuffers(bindings.min_index, bindings.max_index - bindings.min_index,
529 buffer_handles.data(), bindings.offsets.data());
530 });
531 }
532}
533
505void BufferCacheRuntime::BindTransformFeedbackBuffer(u32 index, VkBuffer buffer, u32 offset, 534void BufferCacheRuntime::BindTransformFeedbackBuffer(u32 index, VkBuffer buffer, u32 offset,
506 u32 size) { 535 u32 size) {
507 if (!device.IsExtTransformFeedbackSupported()) { 536 if (!device.IsExtTransformFeedbackSupported()) {
@@ -523,6 +552,23 @@ void BufferCacheRuntime::BindTransformFeedbackBuffer(u32 index, VkBuffer buffer,
523 }); 552 });
524} 553}
525 554
555void BufferCacheRuntime::BindTransformFeedbackBuffers(VideoCommon::HostBindings<Buffer>& bindings) {
556 if (!device.IsExtTransformFeedbackSupported()) {
557 // Already logged in the rasterizer
558 return;
559 }
560 boost::container::small_vector<VkBuffer, 4> buffer_handles;
561 for (u32 index = 0; index < bindings.buffers.size(); ++index) {
562 buffer_handles.push_back(bindings.buffers[index]->Handle());
563 }
564 scheduler.Record([bindings = std::move(bindings),
565 buffer_handles = std::move(buffer_handles)](vk::CommandBuffer cmdbuf) {
566 cmdbuf.BindTransformFeedbackBuffersEXT(0, static_cast<u32>(buffer_handles.size()),
567 buffer_handles.data(), bindings.offsets.data(),
568 bindings.sizes.data());
569 });
570}
571
526void BufferCacheRuntime::ReserveNullBuffer() { 572void BufferCacheRuntime::ReserveNullBuffer() {
527 if (null_buffer) { 573 if (null_buffer) {
528 return; 574 return;
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h
index 92b4f7859..cdeef8846 100644
--- a/src/video_core/renderer_vulkan/vk_buffer_cache.h
+++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h
@@ -18,6 +18,7 @@ namespace Vulkan {
18class Device; 18class Device;
19class DescriptorPool; 19class DescriptorPool;
20class Scheduler; 20class Scheduler;
21struct HostVertexBinding;
21 22
22class BufferCacheRuntime; 23class BufferCacheRuntime;
23 24
@@ -97,8 +98,12 @@ public:
97 98
98 void BindVertexBuffer(u32 index, VkBuffer buffer, u32 offset, u32 size, u32 stride); 99 void BindVertexBuffer(u32 index, VkBuffer buffer, u32 offset, u32 size, u32 stride);
99 100
101 void BindVertexBuffers(VideoCommon::HostBindings<Buffer>& bindings);
102
100 void BindTransformFeedbackBuffer(u32 index, VkBuffer buffer, u32 offset, u32 size); 103 void BindTransformFeedbackBuffer(u32 index, VkBuffer buffer, u32 offset, u32 size);
101 104
105 void BindTransformFeedbackBuffers(VideoCommon::HostBindings<Buffer>& bindings);
106
102 std::span<u8> BindMappedUniformBuffer([[maybe_unused]] size_t stage, 107 std::span<u8> BindMappedUniformBuffer([[maybe_unused]] size_t stage,
103 [[maybe_unused]] u32 binding_index, u32 size) { 108 [[maybe_unused]] u32 binding_index, u32 size) {
104 const StagingBufferRef ref = staging_pool.Request(size, MemoryUsage::Upload); 109 const StagingBufferRef ref = staging_pool.Request(size, MemoryUsage::Upload);
diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp
index 733e70d9d..73e585c2b 100644
--- a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp
+++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp
@@ -115,7 +115,7 @@ void ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute,
115 115
116 static constexpr size_t max_elements = 64; 116 static constexpr size_t max_elements = 64;
117 boost::container::static_vector<VideoCommon::ImageViewInOut, max_elements> views; 117 boost::container::static_vector<VideoCommon::ImageViewInOut, max_elements> views;
118 boost::container::static_vector<VkSampler, max_elements> samplers; 118 boost::container::static_vector<VideoCommon::SamplerId, max_elements> samplers;
119 119
120 const auto& qmd{kepler_compute.launch_description}; 120 const auto& qmd{kepler_compute.launch_description};
121 const auto& cbufs{qmd.const_buffer_config}; 121 const auto& cbufs{qmd.const_buffer_config};
@@ -160,8 +160,8 @@ void ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute,
160 const auto handle{read_handle(desc, index)}; 160 const auto handle{read_handle(desc, index)};
161 views.push_back({handle.first}); 161 views.push_back({handle.first});
162 162
163 Sampler* const sampler = texture_cache.GetComputeSampler(handle.second); 163 VideoCommon::SamplerId sampler = texture_cache.GetComputeSamplerId(handle.second);
164 samplers.push_back(sampler->Handle()); 164 samplers.push_back(sampler);
165 } 165 }
166 } 166 }
167 for (const auto& desc : info.image_descriptors) { 167 for (const auto& desc : info.image_descriptors) {
@@ -192,7 +192,7 @@ void ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute,
192 buffer_cache.BindHostComputeBuffers(); 192 buffer_cache.BindHostComputeBuffers();
193 193
194 RescalingPushConstant rescaling; 194 RescalingPushConstant rescaling;
195 const VkSampler* samplers_it{samplers.data()}; 195 const VideoCommon::SamplerId* samplers_it{samplers.data()};
196 const VideoCommon::ImageViewInOut* views_it{views.data()}; 196 const VideoCommon::ImageViewInOut* views_it{views.data()};
197 PushImageDescriptors(texture_cache, guest_descriptor_queue, info, rescaling, samplers_it, 197 PushImageDescriptors(texture_cache, guest_descriptor_queue, info, rescaling, samplers_it,
198 views_it); 198 views_it);
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
index 506b78f08..c1595642e 100644
--- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
+++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
@@ -298,7 +298,7 @@ void GraphicsPipeline::AddTransition(GraphicsPipeline* transition) {
298template <typename Spec> 298template <typename Spec>
299void GraphicsPipeline::ConfigureImpl(bool is_indexed) { 299void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
300 std::array<VideoCommon::ImageViewInOut, MAX_IMAGE_ELEMENTS> views; 300 std::array<VideoCommon::ImageViewInOut, MAX_IMAGE_ELEMENTS> views;
301 std::array<VkSampler, MAX_IMAGE_ELEMENTS> samplers; 301 std::array<VideoCommon::SamplerId, MAX_IMAGE_ELEMENTS> samplers;
302 size_t sampler_index{}; 302 size_t sampler_index{};
303 size_t view_index{}; 303 size_t view_index{};
304 304
@@ -367,8 +367,8 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
367 const auto handle{read_handle(desc, index)}; 367 const auto handle{read_handle(desc, index)};
368 views[view_index++] = {handle.first}; 368 views[view_index++] = {handle.first};
369 369
370 Sampler* const sampler{texture_cache.GetGraphicsSampler(handle.second)}; 370 VideoCommon::SamplerId sampler{texture_cache.GetGraphicsSamplerId(handle.second)};
371 samplers[sampler_index++] = sampler->Handle(); 371 samplers[sampler_index++] = sampler;
372 } 372 }
373 } 373 }
374 if constexpr (Spec::has_images) { 374 if constexpr (Spec::has_images) {
@@ -453,7 +453,7 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
453 453
454 RescalingPushConstant rescaling; 454 RescalingPushConstant rescaling;
455 RenderAreaPushConstant render_area; 455 RenderAreaPushConstant render_area;
456 const VkSampler* samplers_it{samplers.data()}; 456 const VideoCommon::SamplerId* samplers_it{samplers.data()};
457 const VideoCommon::ImageViewInOut* views_it{views.data()}; 457 const VideoCommon::ImageViewInOut* views_it{views.data()};
458 const auto prepare_stage{[&](size_t stage) LAMBDA_FORCEINLINE { 458 const auto prepare_stage{[&](size_t stage) LAMBDA_FORCEINLINE {
459 buffer_cache.BindHostStageBuffers(stage); 459 buffer_cache.BindHostStageBuffers(stage);
diff --git a/src/video_core/renderer_vulkan/vk_master_semaphore.cpp b/src/video_core/renderer_vulkan/vk_master_semaphore.cpp
index b128c4f6e..5eeda08d2 100644
--- a/src/video_core/renderer_vulkan/vk_master_semaphore.cpp
+++ b/src/video_core/renderer_vulkan/vk_master_semaphore.cpp
@@ -3,6 +3,7 @@
3 3
4#include <thread> 4#include <thread>
5 5
6#include "common/polyfill_ranges.h"
6#include "common/settings.h" 7#include "common/settings.h"
7#include "video_core/renderer_vulkan/vk_master_semaphore.h" 8#include "video_core/renderer_vulkan/vk_master_semaphore.h"
8#include "video_core/vulkan_common/vulkan_device.h" 9#include "video_core/vulkan_common/vulkan_device.h"
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
index 9482e91b0..a2cfb2105 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
@@ -350,6 +350,7 @@ PipelineCache::PipelineCache(RasterizerVulkan& rasterizer_, const Device& device
350 .has_broken_spirv_subgroup_mask_vector_extract_dynamic = 350 .has_broken_spirv_subgroup_mask_vector_extract_dynamic =
351 driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY}; 351 driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY};
352 host_info = Shader::HostTranslateInfo{ 352 host_info = Shader::HostTranslateInfo{
353 .support_float64 = device.IsFloat64Supported(),
353 .support_float16 = device.IsFloat16Supported(), 354 .support_float16 = device.IsFloat16Supported(),
354 .support_int64 = device.IsShaderInt64Supported(), 355 .support_int64 = device.IsShaderInt64Supported(),
355 .needs_demote_reorder = 356 .needs_demote_reorder =
@@ -357,6 +358,7 @@ PipelineCache::PipelineCache(RasterizerVulkan& rasterizer_, const Device& device
357 .support_snorm_render_buffer = true, 358 .support_snorm_render_buffer = true,
358 .support_viewport_index_layer = device.IsExtShaderViewportIndexLayerSupported(), 359 .support_viewport_index_layer = device.IsExtShaderViewportIndexLayerSupported(),
359 .support_geometry_shader_passthrough = device.IsNvGeometryShaderPassthroughSupported(), 360 .support_geometry_shader_passthrough = device.IsNvGeometryShaderPassthroughSupported(),
361 .support_conditional_barrier = device.SupportsConditionalBarriers(),
360 }; 362 };
361 363
362 if (device.GetMaxVertexInputAttributes() < Maxwell::NumVertexAttributes) { 364 if (device.GetMaxVertexInputAttributes() < Maxwell::NumVertexAttributes) {
@@ -703,10 +705,7 @@ std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline(
703std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline( 705std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline(
704 ShaderPools& pools, const ComputePipelineCacheKey& key, Shader::Environment& env, 706 ShaderPools& pools, const ComputePipelineCacheKey& key, Shader::Environment& env,
705 PipelineStatistics* statistics, bool build_in_parallel) try { 707 PipelineStatistics* statistics, bool build_in_parallel) try {
706 // TODO: Remove this when Intel fixes their shader compiler. 708 if (device.HasBrokenCompute()) {
707 // https://github.com/IGCIT/Intel-GPU-Community-Issue-Tracker-IGCIT/issues/159
708 if (device.GetDriverID() == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS &&
709 !Settings::values.enable_compute_pipelines.GetValue()) {
710 LOG_ERROR(Render_Vulkan, "Skipping 0x{:016x}", key.Hash()); 709 LOG_ERROR(Render_Vulkan, "Skipping 0x{:016x}", key.Hash());
711 return nullptr; 710 return nullptr;
712 } 711 }
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.h b/src/video_core/renderer_vulkan/vk_pipeline_cache.h
index 15aa7e224..e323ea0fd 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.h
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.h
@@ -92,9 +92,9 @@ struct ShaderPools {
92 inst.ReleaseContents(); 92 inst.ReleaseContents();
93 } 93 }
94 94
95 Shader::ObjectPool<Shader::IR::Inst> inst; 95 Shader::ObjectPool<Shader::IR::Inst> inst{8192};
96 Shader::ObjectPool<Shader::IR::Block> block; 96 Shader::ObjectPool<Shader::IR::Block> block{32};
97 Shader::ObjectPool<Shader::Maxwell::Flow::Block> flow_block; 97 Shader::ObjectPool<Shader::Maxwell::Flow::Block> flow_block{32};
98}; 98};
99 99
100class PipelineCache : public VideoCommon::ShaderCache { 100class PipelineCache : public VideoCommon::ShaderCache {
diff --git a/src/video_core/renderer_vulkan/vk_swapchain.cpp b/src/video_core/renderer_vulkan/vk_swapchain.cpp
index afcf34fba..d3cddac69 100644
--- a/src/video_core/renderer_vulkan/vk_swapchain.cpp
+++ b/src/video_core/renderer_vulkan/vk_swapchain.cpp
@@ -231,7 +231,12 @@ void Swapchain::CreateSwapchain(const VkSurfaceCapabilitiesKHR& capabilities, bo
231 .imageSharingMode = VK_SHARING_MODE_EXCLUSIVE, 231 .imageSharingMode = VK_SHARING_MODE_EXCLUSIVE,
232 .queueFamilyIndexCount = 0, 232 .queueFamilyIndexCount = 0,
233 .pQueueFamilyIndices = nullptr, 233 .pQueueFamilyIndices = nullptr,
234#ifdef ANDROID
235 // On Android, do not allow surface rotation to deviate from the frontend.
236 .preTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR,
237#else
234 .preTransform = capabilities.currentTransform, 238 .preTransform = capabilities.currentTransform,
239#endif
235 .compositeAlpha = alpha_flags, 240 .compositeAlpha = alpha_flags,
236 .presentMode = present_mode, 241 .presentMode = present_mode,
237 .clipped = VK_FALSE, 242 .clipped = VK_FALSE,
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
index 8711e2a87..f025f618b 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
@@ -1802,27 +1802,36 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const Tegra::Texture::TSCEntry& t
1802 // Some games have samplers with garbage. Sanitize them here. 1802 // Some games have samplers with garbage. Sanitize them here.
1803 const f32 max_anisotropy = std::clamp(tsc.MaxAnisotropy(), 1.0f, 16.0f); 1803 const f32 max_anisotropy = std::clamp(tsc.MaxAnisotropy(), 1.0f, 16.0f);
1804 1804
1805 sampler = device.GetLogical().CreateSampler(VkSamplerCreateInfo{ 1805 const auto create_sampler = [&](const f32 anisotropy) {
1806 .sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO, 1806 return device.GetLogical().CreateSampler(VkSamplerCreateInfo{
1807 .pNext = pnext, 1807 .sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
1808 .flags = 0, 1808 .pNext = pnext,
1809 .magFilter = MaxwellToVK::Sampler::Filter(tsc.mag_filter), 1809 .flags = 0,
1810 .minFilter = MaxwellToVK::Sampler::Filter(tsc.min_filter), 1810 .magFilter = MaxwellToVK::Sampler::Filter(tsc.mag_filter),
1811 .mipmapMode = MaxwellToVK::Sampler::MipmapMode(tsc.mipmap_filter), 1811 .minFilter = MaxwellToVK::Sampler::Filter(tsc.min_filter),
1812 .addressModeU = MaxwellToVK::Sampler::WrapMode(device, tsc.wrap_u, tsc.mag_filter), 1812 .mipmapMode = MaxwellToVK::Sampler::MipmapMode(tsc.mipmap_filter),
1813 .addressModeV = MaxwellToVK::Sampler::WrapMode(device, tsc.wrap_v, tsc.mag_filter), 1813 .addressModeU = MaxwellToVK::Sampler::WrapMode(device, tsc.wrap_u, tsc.mag_filter),
1814 .addressModeW = MaxwellToVK::Sampler::WrapMode(device, tsc.wrap_p, tsc.mag_filter), 1814 .addressModeV = MaxwellToVK::Sampler::WrapMode(device, tsc.wrap_v, tsc.mag_filter),
1815 .mipLodBias = tsc.LodBias(), 1815 .addressModeW = MaxwellToVK::Sampler::WrapMode(device, tsc.wrap_p, tsc.mag_filter),
1816 .anisotropyEnable = static_cast<VkBool32>(max_anisotropy > 1.0f ? VK_TRUE : VK_FALSE), 1816 .mipLodBias = tsc.LodBias(),
1817 .maxAnisotropy = max_anisotropy, 1817 .anisotropyEnable = static_cast<VkBool32>(anisotropy > 1.0f ? VK_TRUE : VK_FALSE),
1818 .compareEnable = tsc.depth_compare_enabled, 1818 .maxAnisotropy = anisotropy,
1819 .compareOp = MaxwellToVK::Sampler::DepthCompareFunction(tsc.depth_compare_func), 1819 .compareEnable = tsc.depth_compare_enabled,
1820 .minLod = tsc.mipmap_filter == TextureMipmapFilter::None ? 0.0f : tsc.MinLod(), 1820 .compareOp = MaxwellToVK::Sampler::DepthCompareFunction(tsc.depth_compare_func),
1821 .maxLod = tsc.mipmap_filter == TextureMipmapFilter::None ? 0.25f : tsc.MaxLod(), 1821 .minLod = tsc.mipmap_filter == TextureMipmapFilter::None ? 0.0f : tsc.MinLod(),
1822 .borderColor = 1822 .maxLod = tsc.mipmap_filter == TextureMipmapFilter::None ? 0.25f : tsc.MaxLod(),
1823 arbitrary_borders ? VK_BORDER_COLOR_FLOAT_CUSTOM_EXT : ConvertBorderColor(color), 1823 .borderColor =
1824 .unnormalizedCoordinates = VK_FALSE, 1824 arbitrary_borders ? VK_BORDER_COLOR_FLOAT_CUSTOM_EXT : ConvertBorderColor(color),
1825 }); 1825 .unnormalizedCoordinates = VK_FALSE,
1826 });
1827 };
1828
1829 sampler = create_sampler(max_anisotropy);
1830
1831 const f32 max_anisotropy_default = static_cast<f32>(1U << tsc.max_anisotropy);
1832 if (max_anisotropy > max_anisotropy_default) {
1833 sampler_default_anisotropy = create_sampler(max_anisotropy_default);
1834 }
1826} 1835}
1827 1836
1828Framebuffer::Framebuffer(TextureCacheRuntime& runtime, std::span<ImageView*, NUM_RT> color_buffers, 1837Framebuffer::Framebuffer(TextureCacheRuntime& runtime, std::span<ImageView*, NUM_RT> color_buffers,
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h
index 0f7a5ffd4..f14525dcb 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.h
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.h
@@ -279,8 +279,17 @@ public:
279 return *sampler; 279 return *sampler;
280 } 280 }
281 281
282 [[nodiscard]] VkSampler HandleWithDefaultAnisotropy() const noexcept {
283 return *sampler_default_anisotropy;
284 }
285
286 [[nodiscard]] bool HasAddedAnisotropy() const noexcept {
287 return static_cast<bool>(sampler_default_anisotropy);
288 }
289
282private: 290private:
283 vk::Sampler sampler; 291 vk::Sampler sampler;
292 vk::Sampler sampler_default_anisotropy;
284}; 293};
285 294
286class Framebuffer { 295class Framebuffer {
diff --git a/src/video_core/texture_cache/image_info.cpp b/src/video_core/texture_cache/image_info.cpp
index e8ddde691..b72788c6d 100644
--- a/src/video_core/texture_cache/image_info.cpp
+++ b/src/video_core/texture_cache/image_info.cpp
@@ -22,6 +22,9 @@ using Tegra::Texture::TICEntry;
22using VideoCore::Surface::PixelFormat; 22using VideoCore::Surface::PixelFormat;
23using VideoCore::Surface::SurfaceType; 23using VideoCore::Surface::SurfaceType;
24 24
25constexpr u32 RescaleHeightThreshold = 288;
26constexpr u32 DownscaleHeightThreshold = 512;
27
25ImageInfo::ImageInfo(const TICEntry& config) noexcept { 28ImageInfo::ImageInfo(const TICEntry& config) noexcept {
26 forced_flushed = config.IsPitchLinear() && !Settings::values.use_reactive_flushing.GetValue(); 29 forced_flushed = config.IsPitchLinear() && !Settings::values.use_reactive_flushing.GetValue();
27 dma_downloaded = forced_flushed; 30 dma_downloaded = forced_flushed;
@@ -113,8 +116,9 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept {
113 layer_stride = CalculateLayerStride(*this); 116 layer_stride = CalculateLayerStride(*this);
114 maybe_unaligned_layer_stride = CalculateLayerSize(*this); 117 maybe_unaligned_layer_stride = CalculateLayerSize(*this);
115 rescaleable &= (block.depth == 0) && resources.levels == 1; 118 rescaleable &= (block.depth == 0) && resources.levels == 1;
116 rescaleable &= size.height > 256 || GetFormatType(format) != SurfaceType::ColorTexture; 119 rescaleable &= size.height > RescaleHeightThreshold ||
117 downscaleable = size.height > 512; 120 GetFormatType(format) != SurfaceType::ColorTexture;
121 downscaleable = size.height > DownscaleHeightThreshold;
118 } 122 }
119} 123}
120 124
@@ -152,8 +156,8 @@ ImageInfo::ImageInfo(const Maxwell3D::Regs::RenderTargetConfig& ct,
152 size.depth = ct.depth; 156 size.depth = ct.depth;
153 } else { 157 } else {
154 rescaleable = block.depth == 0; 158 rescaleable = block.depth == 0;
155 rescaleable &= size.height > 256; 159 rescaleable &= size.height > RescaleHeightThreshold;
156 downscaleable = size.height > 512; 160 downscaleable = size.height > DownscaleHeightThreshold;
157 type = ImageType::e2D; 161 type = ImageType::e2D;
158 resources.layers = ct.depth; 162 resources.layers = ct.depth;
159 } 163 }
@@ -232,8 +236,8 @@ ImageInfo::ImageInfo(const Fermi2D::Surface& config) noexcept {
232 .height = config.height, 236 .height = config.height,
233 .depth = 1, 237 .depth = 1,
234 }; 238 };
235 rescaleable = block.depth == 0 && size.height > 256; 239 rescaleable = block.depth == 0 && size.height > RescaleHeightThreshold;
236 downscaleable = size.height > 512; 240 downscaleable = size.height > DownscaleHeightThreshold;
237 } 241 }
238} 242}
239 243
@@ -275,8 +279,8 @@ ImageInfo::ImageInfo(const Tegra::DMA::ImageOperand& config) noexcept {
275 resources.layers = 1; 279 resources.layers = 1;
276 layer_stride = CalculateLayerStride(*this); 280 layer_stride = CalculateLayerStride(*this);
277 maybe_unaligned_layer_stride = CalculateLayerSize(*this); 281 maybe_unaligned_layer_stride = CalculateLayerSize(*this);
278 rescaleable = block.depth == 0 && size.height > 256; 282 rescaleable = block.depth == 0 && size.height > RescaleHeightThreshold;
279 downscaleable = size.height > 512; 283 downscaleable = size.height > DownscaleHeightThreshold;
280} 284}
281 285
282} // namespace VideoCommon 286} // namespace VideoCommon
diff --git a/src/video_core/texture_cache/image_view_base.cpp b/src/video_core/texture_cache/image_view_base.cpp
index d134b6738..0c5f4450d 100644
--- a/src/video_core/texture_cache/image_view_base.cpp
+++ b/src/video_core/texture_cache/image_view_base.cpp
@@ -45,4 +45,56 @@ ImageViewBase::ImageViewBase(const ImageInfo& info, const ImageViewInfo& view_in
45 45
46ImageViewBase::ImageViewBase(const NullImageViewParams&) : image_id{NULL_IMAGE_ID} {} 46ImageViewBase::ImageViewBase(const NullImageViewParams&) : image_id{NULL_IMAGE_ID} {}
47 47
48bool ImageViewBase::SupportsAnisotropy() const noexcept {
49 const bool has_mips = range.extent.levels > 1;
50 const bool is_2d = type == ImageViewType::e2D || type == ImageViewType::e2DArray;
51 if (!has_mips || !is_2d) {
52 return false;
53 }
54
55 switch (format) {
56 case PixelFormat::R8_UNORM:
57 case PixelFormat::R8_SNORM:
58 case PixelFormat::R8_SINT:
59 case PixelFormat::R8_UINT:
60 case PixelFormat::BC4_UNORM:
61 case PixelFormat::BC4_SNORM:
62 case PixelFormat::BC5_UNORM:
63 case PixelFormat::BC5_SNORM:
64 case PixelFormat::R32G32_FLOAT:
65 case PixelFormat::R32G32_SINT:
66 case PixelFormat::R32_FLOAT:
67 case PixelFormat::R16_FLOAT:
68 case PixelFormat::R16_UNORM:
69 case PixelFormat::R16_SNORM:
70 case PixelFormat::R16_UINT:
71 case PixelFormat::R16_SINT:
72 case PixelFormat::R16G16_UNORM:
73 case PixelFormat::R16G16_FLOAT:
74 case PixelFormat::R16G16_UINT:
75 case PixelFormat::R16G16_SINT:
76 case PixelFormat::R16G16_SNORM:
77 case PixelFormat::R8G8_UNORM:
78 case PixelFormat::R8G8_SNORM:
79 case PixelFormat::R8G8_SINT:
80 case PixelFormat::R8G8_UINT:
81 case PixelFormat::R32G32_UINT:
82 case PixelFormat::R32_UINT:
83 case PixelFormat::R32_SINT:
84 case PixelFormat::G4R4_UNORM:
85 // Depth formats
86 case PixelFormat::D32_FLOAT:
87 case PixelFormat::D16_UNORM:
88 // Stencil formats
89 case PixelFormat::S8_UINT:
90 // DepthStencil formats
91 case PixelFormat::D24_UNORM_S8_UINT:
92 case PixelFormat::S8_UINT_D24_UNORM:
93 case PixelFormat::D32_FLOAT_S8_UINT:
94 return false;
95 default:
96 return true;
97 }
98}
99
48} // namespace VideoCommon 100} // namespace VideoCommon
diff --git a/src/video_core/texture_cache/image_view_base.h b/src/video_core/texture_cache/image_view_base.h
index a25ae1d4a..87549ffff 100644
--- a/src/video_core/texture_cache/image_view_base.h
+++ b/src/video_core/texture_cache/image_view_base.h
@@ -33,6 +33,8 @@ struct ImageViewBase {
33 return type == ImageViewType::Buffer; 33 return type == ImageViewType::Buffer;
34 } 34 }
35 35
36 [[nodiscard]] bool SupportsAnisotropy() const noexcept;
37
36 ImageId image_id{}; 38 ImageId image_id{};
37 GPUVAddr gpu_addr = 0; 39 GPUVAddr gpu_addr = 0;
38 PixelFormat format{}; 40 PixelFormat format{};
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index c7f7448e9..d58bb69ff 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -186,6 +186,10 @@ void TextureCache<P>::FillComputeImageViews(std::span<ImageViewInOut> views) {
186 186
187template <class P> 187template <class P>
188void TextureCache<P>::CheckFeedbackLoop(std::span<const ImageViewInOut> views) { 188void TextureCache<P>::CheckFeedbackLoop(std::span<const ImageViewInOut> views) {
189 if (!Settings::values.barrier_feedback_loops.GetValue()) {
190 return;
191 }
192
189 const bool requires_barrier = [&] { 193 const bool requires_barrier = [&] {
190 for (const auto& view : views) { 194 for (const auto& view : views) {
191 if (!view.id) { 195 if (!view.id) {
@@ -222,30 +226,50 @@ void TextureCache<P>::CheckFeedbackLoop(std::span<const ImageViewInOut> views) {
222 226
223template <class P> 227template <class P>
224typename P::Sampler* TextureCache<P>::GetGraphicsSampler(u32 index) { 228typename P::Sampler* TextureCache<P>::GetGraphicsSampler(u32 index) {
229 return &slot_samplers[GetGraphicsSamplerId(index)];
230}
231
232template <class P>
233typename P::Sampler* TextureCache<P>::GetComputeSampler(u32 index) {
234 return &slot_samplers[GetComputeSamplerId(index)];
235}
236
237template <class P>
238SamplerId TextureCache<P>::GetGraphicsSamplerId(u32 index) {
225 if (index > channel_state->graphics_sampler_table.Limit()) { 239 if (index > channel_state->graphics_sampler_table.Limit()) {
226 LOG_DEBUG(HW_GPU, "Invalid sampler index={}", index); 240 LOG_DEBUG(HW_GPU, "Invalid sampler index={}", index);
227 return &slot_samplers[NULL_SAMPLER_ID]; 241 return NULL_SAMPLER_ID;
228 } 242 }
229 const auto [descriptor, is_new] = channel_state->graphics_sampler_table.Read(index); 243 const auto [descriptor, is_new] = channel_state->graphics_sampler_table.Read(index);
230 SamplerId& id = channel_state->graphics_sampler_ids[index]; 244 SamplerId& id = channel_state->graphics_sampler_ids[index];
231 if (is_new) { 245 if (is_new) {
232 id = FindSampler(descriptor); 246 id = FindSampler(descriptor);
233 } 247 }
234 return &slot_samplers[id]; 248 return id;
235} 249}
236 250
237template <class P> 251template <class P>
238typename P::Sampler* TextureCache<P>::GetComputeSampler(u32 index) { 252SamplerId TextureCache<P>::GetComputeSamplerId(u32 index) {
239 if (index > channel_state->compute_sampler_table.Limit()) { 253 if (index > channel_state->compute_sampler_table.Limit()) {
240 LOG_DEBUG(HW_GPU, "Invalid sampler index={}", index); 254 LOG_DEBUG(HW_GPU, "Invalid sampler index={}", index);
241 return &slot_samplers[NULL_SAMPLER_ID]; 255 return NULL_SAMPLER_ID;
242 } 256 }
243 const auto [descriptor, is_new] = channel_state->compute_sampler_table.Read(index); 257 const auto [descriptor, is_new] = channel_state->compute_sampler_table.Read(index);
244 SamplerId& id = channel_state->compute_sampler_ids[index]; 258 SamplerId& id = channel_state->compute_sampler_ids[index];
245 if (is_new) { 259 if (is_new) {
246 id = FindSampler(descriptor); 260 id = FindSampler(descriptor);
247 } 261 }
248 return &slot_samplers[id]; 262 return id;
263}
264
265template <class P>
266const typename P::Sampler& TextureCache<P>::GetSampler(SamplerId id) const noexcept {
267 return slot_samplers[id];
268}
269
270template <class P>
271typename P::Sampler& TextureCache<P>::GetSampler(SamplerId id) noexcept {
272 return slot_samplers[id];
249} 273}
250 274
251template <class P> 275template <class P>
@@ -280,7 +304,7 @@ void TextureCache<P>::SynchronizeComputeDescriptors() {
280} 304}
281 305
282template <class P> 306template <class P>
283bool TextureCache<P>::RescaleRenderTargets(bool is_clear) { 307bool TextureCache<P>::RescaleRenderTargets() {
284 auto& flags = maxwell3d->dirty.flags; 308 auto& flags = maxwell3d->dirty.flags;
285 u32 scale_rating = 0; 309 u32 scale_rating = 0;
286 bool rescaled = false; 310 bool rescaled = false;
@@ -318,13 +342,13 @@ bool TextureCache<P>::RescaleRenderTargets(bool is_clear) {
318 ImageViewId& color_buffer_id = render_targets.color_buffer_ids[index]; 342 ImageViewId& color_buffer_id = render_targets.color_buffer_ids[index];
319 if (flags[Dirty::ColorBuffer0 + index] || force) { 343 if (flags[Dirty::ColorBuffer0 + index] || force) {
320 flags[Dirty::ColorBuffer0 + index] = false; 344 flags[Dirty::ColorBuffer0 + index] = false;
321 BindRenderTarget(&color_buffer_id, FindColorBuffer(index, is_clear)); 345 BindRenderTarget(&color_buffer_id, FindColorBuffer(index));
322 } 346 }
323 check_rescale(color_buffer_id, tmp_color_images[index]); 347 check_rescale(color_buffer_id, tmp_color_images[index]);
324 } 348 }
325 if (flags[Dirty::ZetaBuffer] || force) { 349 if (flags[Dirty::ZetaBuffer] || force) {
326 flags[Dirty::ZetaBuffer] = false; 350 flags[Dirty::ZetaBuffer] = false;
327 BindRenderTarget(&render_targets.depth_buffer_id, FindDepthBuffer(is_clear)); 351 BindRenderTarget(&render_targets.depth_buffer_id, FindDepthBuffer());
328 } 352 }
329 check_rescale(render_targets.depth_buffer_id, tmp_depth_image); 353 check_rescale(render_targets.depth_buffer_id, tmp_depth_image);
330 354
@@ -389,7 +413,7 @@ void TextureCache<P>::UpdateRenderTargets(bool is_clear) {
389 return; 413 return;
390 } 414 }
391 415
392 const bool rescaled = RescaleRenderTargets(is_clear); 416 const bool rescaled = RescaleRenderTargets();
393 if (is_rescaling != rescaled) { 417 if (is_rescaling != rescaled) {
394 flags[Dirty::RescaleViewports] = true; 418 flags[Dirty::RescaleViewports] = true;
395 flags[Dirty::RescaleScissors] = true; 419 flags[Dirty::RescaleScissors] = true;
@@ -1658,7 +1682,7 @@ SamplerId TextureCache<P>::FindSampler(const TSCEntry& config) {
1658} 1682}
1659 1683
1660template <class P> 1684template <class P>
1661ImageViewId TextureCache<P>::FindColorBuffer(size_t index, bool is_clear) { 1685ImageViewId TextureCache<P>::FindColorBuffer(size_t index) {
1662 const auto& regs = maxwell3d->regs; 1686 const auto& regs = maxwell3d->regs;
1663 if (index >= regs.rt_control.count) { 1687 if (index >= regs.rt_control.count) {
1664 return ImageViewId{}; 1688 return ImageViewId{};
@@ -1672,11 +1696,11 @@ ImageViewId TextureCache<P>::FindColorBuffer(size_t index, bool is_clear) {
1672 return ImageViewId{}; 1696 return ImageViewId{};
1673 } 1697 }
1674 const ImageInfo info(regs.rt[index], regs.anti_alias_samples_mode); 1698 const ImageInfo info(regs.rt[index], regs.anti_alias_samples_mode);
1675 return FindRenderTargetView(info, gpu_addr, is_clear); 1699 return FindRenderTargetView(info, gpu_addr);
1676} 1700}
1677 1701
1678template <class P> 1702template <class P>
1679ImageViewId TextureCache<P>::FindDepthBuffer(bool is_clear) { 1703ImageViewId TextureCache<P>::FindDepthBuffer() {
1680 const auto& regs = maxwell3d->regs; 1704 const auto& regs = maxwell3d->regs;
1681 if (!regs.zeta_enable) { 1705 if (!regs.zeta_enable) {
1682 return ImageViewId{}; 1706 return ImageViewId{};
@@ -1686,18 +1710,16 @@ ImageViewId TextureCache<P>::FindDepthBuffer(bool is_clear) {
1686 return ImageViewId{}; 1710 return ImageViewId{};
1687 } 1711 }
1688 const ImageInfo info(regs.zeta, regs.zeta_size, regs.anti_alias_samples_mode); 1712 const ImageInfo info(regs.zeta, regs.zeta_size, regs.anti_alias_samples_mode);
1689 return FindRenderTargetView(info, gpu_addr, is_clear); 1713 return FindRenderTargetView(info, gpu_addr);
1690} 1714}
1691 1715
1692template <class P> 1716template <class P>
1693ImageViewId TextureCache<P>::FindRenderTargetView(const ImageInfo& info, GPUVAddr gpu_addr, 1717ImageViewId TextureCache<P>::FindRenderTargetView(const ImageInfo& info, GPUVAddr gpu_addr) {
1694 bool is_clear) {
1695 const auto options = is_clear ? RelaxedOptions::Samples : RelaxedOptions{};
1696 ImageId image_id{}; 1718 ImageId image_id{};
1697 bool delete_state = has_deleted_images; 1719 bool delete_state = has_deleted_images;
1698 do { 1720 do {
1699 has_deleted_images = false; 1721 has_deleted_images = false;
1700 image_id = FindOrInsertImage(info, gpu_addr, options); 1722 image_id = FindOrInsertImage(info, gpu_addr);
1701 delete_state |= has_deleted_images; 1723 delete_state |= has_deleted_images;
1702 } while (has_deleted_images); 1724 } while (has_deleted_images);
1703 has_deleted_images = delete_state; 1725 has_deleted_images = delete_state;
diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h
index 3bfa92154..44232b961 100644
--- a/src/video_core/texture_cache/texture_cache_base.h
+++ b/src/video_core/texture_cache/texture_cache_base.h
@@ -159,6 +159,18 @@ public:
159 /// Get the sampler from the compute descriptor table in the specified index 159 /// Get the sampler from the compute descriptor table in the specified index
160 Sampler* GetComputeSampler(u32 index); 160 Sampler* GetComputeSampler(u32 index);
161 161
162 /// Get the sampler id from the graphics descriptor table in the specified index
163 SamplerId GetGraphicsSamplerId(u32 index);
164
165 /// Get the sampler id from the compute descriptor table in the specified index
166 SamplerId GetComputeSamplerId(u32 index);
167
168 /// Return a constant reference to the given sampler id
169 [[nodiscard]] const Sampler& GetSampler(SamplerId id) const noexcept;
170
171 /// Return a reference to the given sampler id
172 [[nodiscard]] Sampler& GetSampler(SamplerId id) noexcept;
173
162 /// Refresh the state for graphics image view and sampler descriptors 174 /// Refresh the state for graphics image view and sampler descriptors
163 void SynchronizeGraphicsDescriptors(); 175 void SynchronizeGraphicsDescriptors();
164 176
@@ -166,9 +178,8 @@ public:
166 void SynchronizeComputeDescriptors(); 178 void SynchronizeComputeDescriptors();
167 179
168 /// Updates the Render Targets if they can be rescaled 180 /// Updates the Render Targets if they can be rescaled
169 /// @param is_clear True when the render targets are being used for clears
170 /// @retval True if the Render Targets have been rescaled. 181 /// @retval True if the Render Targets have been rescaled.
171 bool RescaleRenderTargets(bool is_clear); 182 bool RescaleRenderTargets();
172 183
173 /// Update bound render targets and upload memory if necessary 184 /// Update bound render targets and upload memory if necessary
174 /// @param is_clear True when the render targets are being used for clears 185 /// @param is_clear True when the render targets are being used for clears
@@ -324,14 +335,13 @@ private:
324 [[nodiscard]] SamplerId FindSampler(const TSCEntry& config); 335 [[nodiscard]] SamplerId FindSampler(const TSCEntry& config);
325 336
326 /// Find or create an image view for the given color buffer index 337 /// Find or create an image view for the given color buffer index
327 [[nodiscard]] ImageViewId FindColorBuffer(size_t index, bool is_clear); 338 [[nodiscard]] ImageViewId FindColorBuffer(size_t index);
328 339
329 /// Find or create an image view for the depth buffer 340 /// Find or create an image view for the depth buffer
330 [[nodiscard]] ImageViewId FindDepthBuffer(bool is_clear); 341 [[nodiscard]] ImageViewId FindDepthBuffer();
331 342
332 /// Find or create a view for a render target with the given image parameters 343 /// Find or create a view for a render target with the given image parameters
333 [[nodiscard]] ImageViewId FindRenderTargetView(const ImageInfo& info, GPUVAddr gpu_addr, 344 [[nodiscard]] ImageViewId FindRenderTargetView(const ImageInfo& info, GPUVAddr gpu_addr);
334 bool is_clear);
335 345
336 /// Iterates over all the images in a region calling func 346 /// Iterates over all the images in a region calling func
337 template <typename Func> 347 template <typename Func>
diff --git a/src/video_core/textures/texture.cpp b/src/video_core/textures/texture.cpp
index 4a80a59f9..d8b88d9bc 100644
--- a/src/video_core/textures/texture.cpp
+++ b/src/video_core/textures/texture.cpp
@@ -62,7 +62,12 @@ std::array<float, 4> TSCEntry::BorderColor() const noexcept {
62} 62}
63 63
64float TSCEntry::MaxAnisotropy() const noexcept { 64float TSCEntry::MaxAnisotropy() const noexcept {
65 if (max_anisotropy == 0 && mipmap_filter != TextureMipmapFilter::Linear) { 65 const bool is_suitable_mipmap_filter = mipmap_filter != TextureMipmapFilter::None;
66 const bool has_regular_lods = min_lod_clamp == 0 && max_lod_clamp >= 256;
67 const bool is_bilinear_filter = min_filter == TextureFilter::Linear &&
68 reduction_filter == SamplerReduction::WeightedAverage;
69 if (max_anisotropy == 0 && (!is_suitable_mipmap_filter || !has_regular_lods ||
70 !is_bilinear_filter || depth_compare_enabled)) {
66 return 1.0f; 71 return 1.0f;
67 } 72 }
68 const auto anisotropic_settings = Settings::values.max_anisotropy.GetValue(); 73 const auto anisotropic_settings = Settings::values.max_anisotropy.GetValue();
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp
index 0158b6b0d..fa9cde75b 100644
--- a/src/video_core/vulkan_common/vulkan_device.cpp
+++ b/src/video_core/vulkan_common/vulkan_device.cpp
@@ -344,6 +344,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
344 const bool is_qualcomm = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY; 344 const bool is_qualcomm = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY;
345 const bool is_turnip = driver_id == VK_DRIVER_ID_MESA_TURNIP; 345 const bool is_turnip = driver_id == VK_DRIVER_ID_MESA_TURNIP;
346 const bool is_s8gen2 = device_id == 0x43050a01; 346 const bool is_s8gen2 = device_id == 0x43050a01;
347 const bool is_arm = driver_id == VK_DRIVER_ID_ARM_PROPRIETARY;
347 348
348 if ((is_mvk || is_qualcomm || is_turnip) && !is_suitable) { 349 if ((is_mvk || is_qualcomm || is_turnip) && !is_suitable) {
349 LOG_WARNING(Render_Vulkan, "Unsuitable driver, continuing anyway"); 350 LOG_WARNING(Render_Vulkan, "Unsuitable driver, continuing anyway");
@@ -386,10 +387,11 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
386 IsFormatSupported(VK_FORMAT_D24_UNORM_S8_UINT, 387 IsFormatSupported(VK_FORMAT_D24_UNORM_S8_UINT,
387 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, FormatType::Optimal); 388 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, FormatType::Optimal);
388 389
390 supports_conditional_barriers = !(is_intel_anv || is_intel_windows);
391
389 CollectPhysicalMemoryInfo(); 392 CollectPhysicalMemoryInfo();
390 CollectToolingInfo(); 393 CollectToolingInfo();
391 394
392#ifdef ANDROID
393 if (is_qualcomm || is_turnip) { 395 if (is_qualcomm || is_turnip) {
394 LOG_WARNING(Render_Vulkan, 396 LOG_WARNING(Render_Vulkan,
395 "Qualcomm and Turnip drivers have broken VK_EXT_custom_border_color"); 397 "Qualcomm and Turnip drivers have broken VK_EXT_custom_border_color");
@@ -409,7 +411,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
409 extensions.push_descriptor = false; 411 extensions.push_descriptor = false;
410 loaded_extensions.erase(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME); 412 loaded_extensions.erase(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME);
411 413
412#ifdef ARCHITECTURE_arm64 414#if defined(ANDROID) && defined(ARCHITECTURE_arm64)
413 // Patch the driver to enable BCn textures. 415 // Patch the driver to enable BCn textures.
414 const auto major = (properties.properties.driverVersion >> 24) << 2; 416 const auto major = (properties.properties.driverVersion >> 24) << 2;
415 const auto minor = (properties.properties.driverVersion >> 12) & 0xFFFU; 417 const auto minor = (properties.properties.driverVersion >> 12) & 0xFFFU;
@@ -429,18 +431,23 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
429 } else { 431 } else {
430 LOG_WARNING(Render_Vulkan, "Adreno driver can't be patched to enable BCn textures"); 432 LOG_WARNING(Render_Vulkan, "Adreno driver can't be patched to enable BCn textures");
431 } 433 }
432#endif // ARCHITECTURE_arm64 434#endif
433 } 435 }
434 436
435 const bool is_arm = driver_id == VK_DRIVER_ID_ARM_PROPRIETARY;
436 if (is_arm) { 437 if (is_arm) {
437 must_emulate_scaled_formats = true; 438 must_emulate_scaled_formats = true;
438 439
439 LOG_WARNING(Render_Vulkan, "ARM drivers have broken VK_EXT_extended_dynamic_state"); 440 LOG_WARNING(Render_Vulkan, "ARM drivers have broken VK_EXT_extended_dynamic_state");
440 extensions.extended_dynamic_state = false; 441 extensions.extended_dynamic_state = false;
441 loaded_extensions.erase(VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME); 442 loaded_extensions.erase(VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME);
443
444 LOG_WARNING(Render_Vulkan, "ARM drivers have broken VK_EXT_extended_dynamic_state2");
445 features.extended_dynamic_state2.extendedDynamicState2 = false;
446 features.extended_dynamic_state2.extendedDynamicState2LogicOp = false;
447 features.extended_dynamic_state2.extendedDynamicState2PatchControlPoints = false;
448 extensions.extended_dynamic_state2 = false;
449 loaded_extensions.erase(VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME);
442 } 450 }
443#endif // ANDROID
444 451
445 if (is_nvidia) { 452 if (is_nvidia) {
446 const u32 nv_major_version = (properties.properties.driverVersion >> 22) & 0x3ff; 453 const u32 nv_major_version = (properties.properties.driverVersion >> 22) & 0x3ff;
@@ -555,6 +562,9 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
555 LOG_WARNING(Render_Vulkan, "Intel proprietary drivers do not support MSAA image blits"); 562 LOG_WARNING(Render_Vulkan, "Intel proprietary drivers do not support MSAA image blits");
556 cant_blit_msaa = true; 563 cant_blit_msaa = true;
557 } 564 }
565 has_broken_compute =
566 CheckBrokenCompute(properties.driver.driverID, properties.properties.driverVersion) &&
567 !Settings::values.enable_compute_pipelines.GetValue();
558 if (is_intel_anv || (is_qualcomm && !is_s8gen2)) { 568 if (is_intel_anv || (is_qualcomm && !is_s8gen2)) {
559 LOG_WARNING(Render_Vulkan, "Driver does not support native BGR format"); 569 LOG_WARNING(Render_Vulkan, "Driver does not support native BGR format");
560 must_emulate_bgr565 = true; 570 must_emulate_bgr565 = true;
@@ -776,9 +786,6 @@ bool Device::GetSuitability(bool requires_swapchain) {
776 786
777 FOR_EACH_VK_FEATURE_EXT(FEATURE_EXTENSION); 787 FOR_EACH_VK_FEATURE_EXT(FEATURE_EXTENSION);
778 FOR_EACH_VK_EXTENSION(EXTENSION); 788 FOR_EACH_VK_EXTENSION(EXTENSION);
779#ifdef _WIN32
780 FOR_EACH_VK_EXTENSION_WIN32(EXTENSION);
781#endif
782 789
783#undef FEATURE_EXTENSION 790#undef FEATURE_EXTENSION
784#undef EXTENSION 791#undef EXTENSION
@@ -797,11 +804,6 @@ bool Device::GetSuitability(bool requires_swapchain) {
797 804
798 FOR_EACH_VK_RECOMMENDED_EXTENSION(LOG_EXTENSION); 805 FOR_EACH_VK_RECOMMENDED_EXTENSION(LOG_EXTENSION);
799 FOR_EACH_VK_MANDATORY_EXTENSION(CHECK_EXTENSION); 806 FOR_EACH_VK_MANDATORY_EXTENSION(CHECK_EXTENSION);
800#ifdef _WIN32
801 FOR_EACH_VK_MANDATORY_EXTENSION_WIN32(CHECK_EXTENSION);
802#else
803 FOR_EACH_VK_MANDATORY_EXTENSION_GENERIC(CHECK_EXTENSION);
804#endif
805 807
806 if (requires_swapchain) { 808 if (requires_swapchain) {
807 CHECK_EXTENSION(VK_KHR_SWAPCHAIN_EXTENSION_NAME); 809 CHECK_EXTENSION(VK_KHR_SWAPCHAIN_EXTENSION_NAME);
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h
index d62a103a1..0b634a876 100644
--- a/src/video_core/vulkan_common/vulkan_device.h
+++ b/src/video_core/vulkan_common/vulkan_device.h
@@ -10,6 +10,7 @@
10#include <vector> 10#include <vector>
11 11
12#include "common/common_types.h" 12#include "common/common_types.h"
13#include "common/logging/log.h"
13#include "common/settings.h" 14#include "common/settings.h"
14#include "video_core/vulkan_common/vulkan_wrapper.h" 15#include "video_core/vulkan_common/vulkan_wrapper.h"
15 16
@@ -68,7 +69,6 @@
68 EXTENSION(EXT, VERTEX_ATTRIBUTE_DIVISOR, vertex_attribute_divisor) \ 69 EXTENSION(EXT, VERTEX_ATTRIBUTE_DIVISOR, vertex_attribute_divisor) \
69 EXTENSION(KHR, DRAW_INDIRECT_COUNT, draw_indirect_count) \ 70 EXTENSION(KHR, DRAW_INDIRECT_COUNT, draw_indirect_count) \
70 EXTENSION(KHR, DRIVER_PROPERTIES, driver_properties) \ 71 EXTENSION(KHR, DRIVER_PROPERTIES, driver_properties) \
71 EXTENSION(KHR, EXTERNAL_MEMORY_FD, external_memory_fd) \
72 EXTENSION(KHR, PUSH_DESCRIPTOR, push_descriptor) \ 72 EXTENSION(KHR, PUSH_DESCRIPTOR, push_descriptor) \
73 EXTENSION(KHR, SAMPLER_MIRROR_CLAMP_TO_EDGE, sampler_mirror_clamp_to_edge) \ 73 EXTENSION(KHR, SAMPLER_MIRROR_CLAMP_TO_EDGE, sampler_mirror_clamp_to_edge) \
74 EXTENSION(KHR, SHADER_FLOAT_CONTROLS, shader_float_controls) \ 74 EXTENSION(KHR, SHADER_FLOAT_CONTROLS, shader_float_controls) \
@@ -80,9 +80,6 @@
80 EXTENSION(NV, VIEWPORT_ARRAY2, viewport_array2) \ 80 EXTENSION(NV, VIEWPORT_ARRAY2, viewport_array2) \
81 EXTENSION(NV, VIEWPORT_SWIZZLE, viewport_swizzle) 81 EXTENSION(NV, VIEWPORT_SWIZZLE, viewport_swizzle)
82 82
83#define FOR_EACH_VK_EXTENSION_WIN32(EXTENSION) \
84 EXTENSION(KHR, EXTERNAL_MEMORY_WIN32, external_memory_win32)
85
86// Define extensions which must be supported. 83// Define extensions which must be supported.
87#define FOR_EACH_VK_MANDATORY_EXTENSION(EXTENSION_NAME) \ 84#define FOR_EACH_VK_MANDATORY_EXTENSION(EXTENSION_NAME) \
88 EXTENSION_NAME(VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME) \ 85 EXTENSION_NAME(VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME) \
@@ -90,12 +87,6 @@
90 EXTENSION_NAME(VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME) \ 87 EXTENSION_NAME(VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME) \
91 EXTENSION_NAME(VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME) 88 EXTENSION_NAME(VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME)
92 89
93#define FOR_EACH_VK_MANDATORY_EXTENSION_GENERIC(EXTENSION_NAME) \
94 EXTENSION_NAME(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME)
95
96#define FOR_EACH_VK_MANDATORY_EXTENSION_WIN32(EXTENSION_NAME) \
97 EXTENSION_NAME(VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME)
98
99// Define extensions where the absence of the extension may result in a degraded experience. 90// Define extensions where the absence of the extension may result in a degraded experience.
100#define FOR_EACH_VK_RECOMMENDED_EXTENSION(EXTENSION_NAME) \ 91#define FOR_EACH_VK_RECOMMENDED_EXTENSION(EXTENSION_NAME) \
101 EXTENSION_NAME(VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME) \ 92 EXTENSION_NAME(VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME) \
@@ -300,6 +291,11 @@ public:
300 return GetDriverID() != VK_DRIVER_ID_QUALCOMM_PROPRIETARY; 291 return GetDriverID() != VK_DRIVER_ID_QUALCOMM_PROPRIETARY;
301 } 292 }
302 293
294 /// Returns true if the device suppors float64 natively.
295 bool IsFloat64Supported() const {
296 return features.features.shaderFloat64;
297 }
298
303 /// Returns true if the device supports float16 natively. 299 /// Returns true if the device supports float16 natively.
304 bool IsFloat16Supported() const { 300 bool IsFloat16Supported() const {
305 return features.shader_float16_int8.shaderFloat16; 301 return features.shader_float16_int8.shaderFloat16;
@@ -523,6 +519,11 @@ public:
523 return has_renderdoc || has_nsight_graphics || Settings::values.renderer_debug.GetValue(); 519 return has_renderdoc || has_nsight_graphics || Settings::values.renderer_debug.GetValue();
524 } 520 }
525 521
522 /// @returns True if compute pipelines can cause crashing.
523 bool HasBrokenCompute() const {
524 return has_broken_compute;
525 }
526
526 /// Returns true when the device does not properly support cube compatibility. 527 /// Returns true when the device does not properly support cube compatibility.
527 bool HasBrokenCubeImageCompability() const { 528 bool HasBrokenCubeImageCompability() const {
528 return has_broken_cube_compatibility; 529 return has_broken_cube_compatibility;
@@ -580,6 +581,26 @@ public:
580 return properties.properties.limits.maxVertexInputBindings; 581 return properties.properties.limits.maxVertexInputBindings;
581 } 582 }
582 583
584 bool SupportsConditionalBarriers() const {
585 return supports_conditional_barriers;
586 }
587
588 [[nodiscard]] static constexpr bool CheckBrokenCompute(VkDriverId driver_id,
589 u32 driver_version) {
590 if (driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS) {
591 const u32 major = VK_API_VERSION_MAJOR(driver_version);
592 const u32 minor = VK_API_VERSION_MINOR(driver_version);
593 const u32 patch = VK_API_VERSION_PATCH(driver_version);
594 if (major == 0 && minor == 405 && patch < 286) {
595 LOG_WARNING(
596 Render_Vulkan,
597 "Intel proprietary drivers 0.405.0 until 0.405.286 have broken compute");
598 return true;
599 }
600 }
601 return false;
602 }
603
583private: 604private:
584 /// Checks if the physical device is suitable and configures the object state 605 /// Checks if the physical device is suitable and configures the object state
585 /// with all necessary info about its properties. 606 /// with all necessary info about its properties.
@@ -627,7 +648,6 @@ private:
627 FOR_EACH_VK_FEATURE_1_3(FEATURE); 648 FOR_EACH_VK_FEATURE_1_3(FEATURE);
628 FOR_EACH_VK_FEATURE_EXT(FEATURE); 649 FOR_EACH_VK_FEATURE_EXT(FEATURE);
629 FOR_EACH_VK_EXTENSION(EXTENSION); 650 FOR_EACH_VK_EXTENSION(EXTENSION);
630 FOR_EACH_VK_EXTENSION_WIN32(EXTENSION);
631 651
632#undef EXTENSION 652#undef EXTENSION
633#undef FEATURE 653#undef FEATURE
@@ -674,6 +694,7 @@ private:
674 bool is_integrated{}; ///< Is GPU an iGPU. 694 bool is_integrated{}; ///< Is GPU an iGPU.
675 bool is_virtual{}; ///< Is GPU a virtual GPU. 695 bool is_virtual{}; ///< Is GPU a virtual GPU.
676 bool is_non_gpu{}; ///< Is SoftwareRasterizer, FPGA, non-GPU device. 696 bool is_non_gpu{}; ///< Is SoftwareRasterizer, FPGA, non-GPU device.
697 bool has_broken_compute{}; ///< Compute shaders can cause crashes
677 bool has_broken_cube_compatibility{}; ///< Has broken cube compatibility bit 698 bool has_broken_cube_compatibility{}; ///< Has broken cube compatibility bit
678 bool has_renderdoc{}; ///< Has RenderDoc attached 699 bool has_renderdoc{}; ///< Has RenderDoc attached
679 bool has_nsight_graphics{}; ///< Has Nsight Graphics attached 700 bool has_nsight_graphics{}; ///< Has Nsight Graphics attached
@@ -683,6 +704,7 @@ private:
683 bool must_emulate_bgr565{}; ///< Emulates BGR565 by swizzling RGB565 format. 704 bool must_emulate_bgr565{}; ///< Emulates BGR565 by swizzling RGB565 format.
684 bool dynamic_state3_blending{}; ///< Has all blending features of dynamic_state3. 705 bool dynamic_state3_blending{}; ///< Has all blending features of dynamic_state3.
685 bool dynamic_state3_enables{}; ///< Has all enables features of dynamic_state3. 706 bool dynamic_state3_enables{}; ///< Has all enables features of dynamic_state3.
707 bool supports_conditional_barriers{}; ///< Allows barriers in conditional control flow.
686 u64 device_access_memory{}; ///< Total size of device local memory in bytes. 708 u64 device_access_memory{}; ///< Total size of device local memory in bytes.
687 u32 sets_per_pool{}; ///< Sets per Description Pool 709 u32 sets_per_pool{}; ///< Sets per Description Pool
688 710
diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt
index 84d9ca796..733c296e4 100644
--- a/src/yuzu/CMakeLists.txt
+++ b/src/yuzu/CMakeLists.txt
@@ -210,6 +210,8 @@ add_executable(yuzu
210 util/url_request_interceptor.h 210 util/url_request_interceptor.h
211 util/util.cpp 211 util/util.cpp
212 util/util.h 212 util/util.h
213 vk_device_info.cpp
214 vk_device_info.h
213 compatdb.cpp 215 compatdb.cpp
214 compatdb.h 216 compatdb.h
215 yuzu.qrc 217 yuzu.qrc
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index 6288fef62..edc206a25 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -101,6 +101,12 @@ const std::map<Settings::RendererBackend, QString> Config::renderer_backend_text
101 {Settings::RendererBackend::Null, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Null"))}, 101 {Settings::RendererBackend::Null, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Null"))},
102}; 102};
103 103
104const std::map<Settings::ShaderBackend, QString> Config::shader_backend_texts_map = {
105 {Settings::ShaderBackend::GLSL, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "GLSL"))},
106 {Settings::ShaderBackend::GLASM, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "GLASM"))},
107 {Settings::ShaderBackend::SPIRV, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "SPIRV"))},
108};
109
104// This shouldn't have anything except static initializers (no functions). So 110// This shouldn't have anything except static initializers (no functions). So
105// QKeySequence(...).toString() is NOT ALLOWED HERE. 111// QKeySequence(...).toString() is NOT ALLOWED HERE.
106// This must be in alphabetical order according to action name as it must have the same order as 112// This must be in alphabetical order according to action name as it must have the same order as
@@ -754,6 +760,8 @@ void Config::ReadRendererValues() {
754 ReadGlobalSetting(Settings::values.use_fast_gpu_time); 760 ReadGlobalSetting(Settings::values.use_fast_gpu_time);
755 ReadGlobalSetting(Settings::values.use_vulkan_driver_pipeline_cache); 761 ReadGlobalSetting(Settings::values.use_vulkan_driver_pipeline_cache);
756 ReadGlobalSetting(Settings::values.enable_compute_pipelines); 762 ReadGlobalSetting(Settings::values.enable_compute_pipelines);
763 ReadGlobalSetting(Settings::values.use_video_framerate);
764 ReadGlobalSetting(Settings::values.barrier_feedback_loops);
757 ReadGlobalSetting(Settings::values.bg_red); 765 ReadGlobalSetting(Settings::values.bg_red);
758 ReadGlobalSetting(Settings::values.bg_green); 766 ReadGlobalSetting(Settings::values.bg_green);
759 ReadGlobalSetting(Settings::values.bg_blue); 767 ReadGlobalSetting(Settings::values.bg_blue);
@@ -1409,6 +1417,8 @@ void Config::SaveRendererValues() {
1409 WriteGlobalSetting(Settings::values.use_fast_gpu_time); 1417 WriteGlobalSetting(Settings::values.use_fast_gpu_time);
1410 WriteGlobalSetting(Settings::values.use_vulkan_driver_pipeline_cache); 1418 WriteGlobalSetting(Settings::values.use_vulkan_driver_pipeline_cache);
1411 WriteGlobalSetting(Settings::values.enable_compute_pipelines); 1419 WriteGlobalSetting(Settings::values.enable_compute_pipelines);
1420 WriteGlobalSetting(Settings::values.use_video_framerate);
1421 WriteGlobalSetting(Settings::values.barrier_feedback_loops);
1412 WriteGlobalSetting(Settings::values.bg_red); 1422 WriteGlobalSetting(Settings::values.bg_red);
1413 WriteGlobalSetting(Settings::values.bg_green); 1423 WriteGlobalSetting(Settings::values.bg_green);
1414 WriteGlobalSetting(Settings::values.bg_blue); 1424 WriteGlobalSetting(Settings::values.bg_blue);
diff --git a/src/yuzu/configuration/config.h b/src/yuzu/configuration/config.h
index ad590ea9e..0fd4baf6b 100644
--- a/src/yuzu/configuration/config.h
+++ b/src/yuzu/configuration/config.h
@@ -54,6 +54,7 @@ public:
54 static const std::map<bool, QString> use_docked_mode_texts_map; 54 static const std::map<bool, QString> use_docked_mode_texts_map;
55 static const std::map<Settings::GPUAccuracy, QString> gpu_accuracy_texts_map; 55 static const std::map<Settings::GPUAccuracy, QString> gpu_accuracy_texts_map;
56 static const std::map<Settings::RendererBackend, QString> renderer_backend_texts_map; 56 static const std::map<Settings::RendererBackend, QString> renderer_backend_texts_map;
57 static const std::map<Settings::ShaderBackend, QString> shader_backend_texts_map;
57 58
58 static constexpr UISettings::Theme default_theme{ 59 static constexpr UISettings::Theme default_theme{
59#ifdef _WIN32 60#ifdef _WIN32
diff --git a/src/yuzu/configuration/configure_dialog.cpp b/src/yuzu/configuration/configure_dialog.cpp
index 8e76a819a..bdf83ebfe 100644
--- a/src/yuzu/configuration/configure_dialog.cpp
+++ b/src/yuzu/configuration/configure_dialog.cpp
@@ -6,6 +6,7 @@
6#include "common/settings.h" 6#include "common/settings.h"
7#include "core/core.h" 7#include "core/core.h"
8#include "ui_configure.h" 8#include "ui_configure.h"
9#include "vk_device_info.h"
9#include "yuzu/configuration/config.h" 10#include "yuzu/configuration/config.h"
10#include "yuzu/configuration/configure_audio.h" 11#include "yuzu/configuration/configure_audio.h"
11#include "yuzu/configuration/configure_cpu.h" 12#include "yuzu/configuration/configure_cpu.h"
@@ -28,6 +29,7 @@
28 29
29ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_, 30ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_,
30 InputCommon::InputSubsystem* input_subsystem, 31 InputCommon::InputSubsystem* input_subsystem,
32 std::vector<VkDeviceInfo::Record>& vk_device_records,
31 Core::System& system_, bool enable_web_config) 33 Core::System& system_, bool enable_web_config)
32 : QDialog(parent), ui{std::make_unique<Ui::ConfigureDialog>()}, 34 : QDialog(parent), ui{std::make_unique<Ui::ConfigureDialog>()},
33 registry(registry_), system{system_}, audio_tab{std::make_unique<ConfigureAudio>(system_, 35 registry(registry_), system{system_}, audio_tab{std::make_unique<ConfigureAudio>(system_,
@@ -38,7 +40,8 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_,
38 general_tab{std::make_unique<ConfigureGeneral>(system_, this)}, 40 general_tab{std::make_unique<ConfigureGeneral>(system_, this)},
39 graphics_advanced_tab{std::make_unique<ConfigureGraphicsAdvanced>(system_, this)}, 41 graphics_advanced_tab{std::make_unique<ConfigureGraphicsAdvanced>(system_, this)},
40 graphics_tab{std::make_unique<ConfigureGraphics>( 42 graphics_tab{std::make_unique<ConfigureGraphics>(
41 system_, [&]() { graphics_advanced_tab->ExposeComputeOption(); }, this)}, 43 system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); },
44 this)},
42 hotkeys_tab{std::make_unique<ConfigureHotkeys>(system_.HIDCore(), this)}, 45 hotkeys_tab{std::make_unique<ConfigureHotkeys>(system_.HIDCore(), this)},
43 input_tab{std::make_unique<ConfigureInput>(system_, this)}, 46 input_tab{std::make_unique<ConfigureInput>(system_, this)},
44 network_tab{std::make_unique<ConfigureNetwork>(system_, this)}, 47 network_tab{std::make_unique<ConfigureNetwork>(system_, this)},
diff --git a/src/yuzu/configuration/configure_dialog.h b/src/yuzu/configuration/configure_dialog.h
index a086a07c4..2a08b7fee 100644
--- a/src/yuzu/configuration/configure_dialog.h
+++ b/src/yuzu/configuration/configure_dialog.h
@@ -4,7 +4,9 @@
4#pragma once 4#pragma once
5 5
6#include <memory> 6#include <memory>
7#include <vector>
7#include <QDialog> 8#include <QDialog>
9#include "yuzu/vk_device_info.h"
8 10
9namespace Core { 11namespace Core {
10class System; 12class System;
@@ -40,8 +42,9 @@ class ConfigureDialog : public QDialog {
40 42
41public: 43public:
42 explicit ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_, 44 explicit ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_,
43 InputCommon::InputSubsystem* input_subsystem, Core::System& system_, 45 InputCommon::InputSubsystem* input_subsystem,
44 bool enable_web_config = true); 46 std::vector<VkDeviceInfo::Record>& vk_device_records,
47 Core::System& system_, bool enable_web_config = true);
45 ~ConfigureDialog() override; 48 ~ConfigureDialog() override;
46 49
47 void ApplyConfiguration(); 50 void ApplyConfiguration();
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp
index 431585216..a4965524a 100644
--- a/src/yuzu/configuration/configure_graphics.cpp
+++ b/src/yuzu/configuration/configure_graphics.cpp
@@ -1,10 +1,6 @@
1// SPDX-FileCopyrightText: 2016 Citra Emulator Project 1// SPDX-FileCopyrightText: 2016 Citra Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later 2// SPDX-License-Identifier: GPL-2.0-or-later
3 3
4// Include this early to include Vulkan headers how we want to
5#include "video_core/vulkan_common/vulkan_device.h"
6#include "video_core/vulkan_common/vulkan_wrapper.h"
7
8#include <algorithm> 4#include <algorithm>
9#include <functional> 5#include <functional>
10#include <iosfwd> 6#include <iosfwd>
@@ -34,13 +30,11 @@
34#include "common/settings.h" 30#include "common/settings.h"
35#include "core/core.h" 31#include "core/core.h"
36#include "ui_configure_graphics.h" 32#include "ui_configure_graphics.h"
37#include "video_core/vulkan_common/vulkan_instance.h"
38#include "video_core/vulkan_common/vulkan_library.h"
39#include "video_core/vulkan_common/vulkan_surface.h"
40#include "yuzu/configuration/configuration_shared.h" 33#include "yuzu/configuration/configuration_shared.h"
41#include "yuzu/configuration/configure_graphics.h" 34#include "yuzu/configuration/configure_graphics.h"
42#include "yuzu/qt_common.h" 35#include "yuzu/qt_common.h"
43#include "yuzu/uisettings.h" 36#include "yuzu/uisettings.h"
37#include "yuzu/vk_device_info.h"
44 38
45static const std::vector<VkPresentModeKHR> default_present_modes{VK_PRESENT_MODE_IMMEDIATE_KHR, 39static const std::vector<VkPresentModeKHR> default_present_modes{VK_PRESENT_MODE_IMMEDIATE_KHR,
46 VK_PRESENT_MODE_FIFO_KHR}; 40 VK_PRESENT_MODE_FIFO_KHR};
@@ -77,9 +71,10 @@ static constexpr Settings::VSyncMode PresentModeToSetting(VkPresentModeKHR mode)
77} 71}
78 72
79ConfigureGraphics::ConfigureGraphics(const Core::System& system_, 73ConfigureGraphics::ConfigureGraphics(const Core::System& system_,
74 std::vector<VkDeviceInfo::Record>& records_,
80 const std::function<void()>& expose_compute_option_, 75 const std::function<void()>& expose_compute_option_,
81 QWidget* parent) 76 QWidget* parent)
82 : QWidget(parent), ui{std::make_unique<Ui::ConfigureGraphics>()}, 77 : QWidget(parent), ui{std::make_unique<Ui::ConfigureGraphics>()}, records{records_},
83 expose_compute_option{expose_compute_option_}, system{system_} { 78 expose_compute_option{expose_compute_option_}, system{system_} {
84 vulkan_device = Settings::values.vulkan_device.GetValue(); 79 vulkan_device = Settings::values.vulkan_device.GetValue();
85 RetrieveVulkanDevices(); 80 RetrieveVulkanDevices();
@@ -504,47 +499,19 @@ void ConfigureGraphics::UpdateAPILayout() {
504 } 499 }
505} 500}
506 501
507void ConfigureGraphics::RetrieveVulkanDevices() try { 502void ConfigureGraphics::RetrieveVulkanDevices() {
508 if (UISettings::values.has_broken_vulkan) {
509 return;
510 }
511
512 using namespace Vulkan;
513
514 auto* window = this->window()->windowHandle();
515 auto wsi = QtCommon::GetWindowSystemInfo(window);
516
517 vk::InstanceDispatch dld;
518 const auto library = OpenLibrary();
519 const vk::Instance instance = CreateInstance(*library, dld, VK_API_VERSION_1_1, wsi.type);
520 const std::vector<VkPhysicalDevice> physical_devices = instance.EnumeratePhysicalDevices();
521 vk::SurfaceKHR surface = CreateSurface(instance, wsi);
522
523 vulkan_devices.clear(); 503 vulkan_devices.clear();
524 vulkan_devices.reserve(physical_devices.size()); 504 vulkan_devices.reserve(records.size());
525 device_present_modes.clear(); 505 device_present_modes.clear();
526 device_present_modes.reserve(physical_devices.size()); 506 device_present_modes.reserve(records.size());
527 for (const VkPhysicalDevice device : physical_devices) { 507 for (const auto& record : records) {
528 const auto physical_device = vk::PhysicalDevice(device, dld); 508 vulkan_devices.push_back(QString::fromStdString(record.name));
529 const std::string name = physical_device.GetProperties().deviceName; 509 device_present_modes.push_back(record.vsync_support);
530 const std::vector<VkPresentModeKHR> present_modes = 510
531 physical_device.GetSurfacePresentModesKHR(*surface); 511 if (record.has_broken_compute) {
532 vulkan_devices.push_back(QString::fromStdString(name));
533 device_present_modes.push_back(present_modes);
534
535 VkPhysicalDeviceDriverProperties driver_properties{};
536 driver_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES;
537 driver_properties.pNext = nullptr;
538 VkPhysicalDeviceProperties2 properties{};
539 properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR;
540 properties.pNext = &driver_properties;
541 dld.vkGetPhysicalDeviceProperties2(physical_device, &properties);
542 if (driver_properties.driverID == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS) {
543 expose_compute_option(); 512 expose_compute_option();
544 } 513 }
545 } 514 }
546} catch (const Vulkan::vk::Exception& exception) {
547 LOG_ERROR(Frontend, "Failed to enumerate devices with error: {}", exception.what());
548} 515}
549 516
550Settings::RendererBackend ConfigureGraphics::GetCurrentGraphicsBackend() const { 517Settings::RendererBackend ConfigureGraphics::GetCurrentGraphicsBackend() const {
diff --git a/src/yuzu/configuration/configure_graphics.h b/src/yuzu/configuration/configure_graphics.h
index 364b1cac2..be9310b74 100644
--- a/src/yuzu/configuration/configure_graphics.h
+++ b/src/yuzu/configuration/configure_graphics.h
@@ -12,6 +12,7 @@
12#include <qobjectdefs.h> 12#include <qobjectdefs.h>
13#include <vulkan/vulkan_core.h> 13#include <vulkan/vulkan_core.h>
14#include "common/common_types.h" 14#include "common/common_types.h"
15#include "vk_device_info.h"
15 16
16class QEvent; 17class QEvent;
17class QObject; 18class QObject;
@@ -39,6 +40,7 @@ class ConfigureGraphics : public QWidget {
39 40
40public: 41public:
41 explicit ConfigureGraphics(const Core::System& system_, 42 explicit ConfigureGraphics(const Core::System& system_,
43 std::vector<VkDeviceInfo::Record>& records,
42 const std::function<void()>& expose_compute_option_, 44 const std::function<void()>& expose_compute_option_,
43 QWidget* parent = nullptr); 45 QWidget* parent = nullptr);
44 ~ConfigureGraphics() override; 46 ~ConfigureGraphics() override;
@@ -77,6 +79,7 @@ private:
77 ConfigurationShared::CheckState use_disk_shader_cache; 79 ConfigurationShared::CheckState use_disk_shader_cache;
78 ConfigurationShared::CheckState use_asynchronous_gpu_emulation; 80 ConfigurationShared::CheckState use_asynchronous_gpu_emulation;
79 81
82 std::vector<VkDeviceInfo::Record>& records;
80 std::vector<QString> vulkan_devices; 83 std::vector<QString> vulkan_devices;
81 std::vector<std::vector<VkPresentModeKHR>> device_present_modes; 84 std::vector<std::vector<VkPresentModeKHR>> device_present_modes;
82 std::vector<VkPresentModeKHR> 85 std::vector<VkPresentModeKHR>
diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp
index 896863f87..c0a044767 100644
--- a/src/yuzu/configuration/configure_graphics_advanced.cpp
+++ b/src/yuzu/configuration/configure_graphics_advanced.cpp
@@ -42,6 +42,9 @@ void ConfigureGraphicsAdvanced::SetConfiguration() {
42 Settings::values.use_vulkan_driver_pipeline_cache.GetValue()); 42 Settings::values.use_vulkan_driver_pipeline_cache.GetValue());
43 ui->enable_compute_pipelines_checkbox->setChecked( 43 ui->enable_compute_pipelines_checkbox->setChecked(
44 Settings::values.enable_compute_pipelines.GetValue()); 44 Settings::values.enable_compute_pipelines.GetValue());
45 ui->use_video_framerate_checkbox->setChecked(Settings::values.use_video_framerate.GetValue());
46 ui->barrier_feedback_loops_checkbox->setChecked(
47 Settings::values.barrier_feedback_loops.GetValue());
45 48
46 if (Settings::IsConfiguringGlobal()) { 49 if (Settings::IsConfiguringGlobal()) {
47 ui->gpu_accuracy->setCurrentIndex( 50 ui->gpu_accuracy->setCurrentIndex(
@@ -91,6 +94,11 @@ void ConfigureGraphicsAdvanced::ApplyConfiguration() {
91 ConfigurationShared::ApplyPerGameSetting(&Settings::values.enable_compute_pipelines, 94 ConfigurationShared::ApplyPerGameSetting(&Settings::values.enable_compute_pipelines,
92 ui->enable_compute_pipelines_checkbox, 95 ui->enable_compute_pipelines_checkbox,
93 enable_compute_pipelines); 96 enable_compute_pipelines);
97 ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_video_framerate,
98 ui->use_video_framerate_checkbox, use_video_framerate);
99 ConfigurationShared::ApplyPerGameSetting(&Settings::values.barrier_feedback_loops,
100 ui->barrier_feedback_loops_checkbox,
101 barrier_feedback_loops);
94} 102}
95 103
96void ConfigureGraphicsAdvanced::changeEvent(QEvent* event) { 104void ConfigureGraphicsAdvanced::changeEvent(QEvent* event) {
@@ -125,6 +133,10 @@ void ConfigureGraphicsAdvanced::SetupPerGameUI() {
125 Settings::values.max_anisotropy.UsingGlobal()); 133 Settings::values.max_anisotropy.UsingGlobal());
126 ui->enable_compute_pipelines_checkbox->setEnabled( 134 ui->enable_compute_pipelines_checkbox->setEnabled(
127 Settings::values.enable_compute_pipelines.UsingGlobal()); 135 Settings::values.enable_compute_pipelines.UsingGlobal());
136 ui->use_video_framerate_checkbox->setEnabled(
137 Settings::values.use_video_framerate.UsingGlobal());
138 ui->barrier_feedback_loops_checkbox->setEnabled(
139 Settings::values.barrier_feedback_loops.UsingGlobal());
128 140
129 return; 141 return;
130 } 142 }
@@ -149,6 +161,12 @@ void ConfigureGraphicsAdvanced::SetupPerGameUI() {
149 ConfigurationShared::SetColoredTristate(ui->enable_compute_pipelines_checkbox, 161 ConfigurationShared::SetColoredTristate(ui->enable_compute_pipelines_checkbox,
150 Settings::values.enable_compute_pipelines, 162 Settings::values.enable_compute_pipelines,
151 enable_compute_pipelines); 163 enable_compute_pipelines);
164 ConfigurationShared::SetColoredTristate(ui->use_video_framerate_checkbox,
165 Settings::values.use_video_framerate,
166 use_video_framerate);
167 ConfigurationShared::SetColoredTristate(ui->barrier_feedback_loops_checkbox,
168 Settings::values.barrier_feedback_loops,
169 barrier_feedback_loops);
152 ConfigurationShared::SetColoredComboBox( 170 ConfigurationShared::SetColoredComboBox(
153 ui->gpu_accuracy, ui->label_gpu_accuracy, 171 ui->gpu_accuracy, ui->label_gpu_accuracy,
154 static_cast<int>(Settings::values.gpu_accuracy.GetValue(true))); 172 static_cast<int>(Settings::values.gpu_accuracy.GetValue(true)));
diff --git a/src/yuzu/configuration/configure_graphics_advanced.h b/src/yuzu/configuration/configure_graphics_advanced.h
index 1c7b636b9..369a7c83e 100644
--- a/src/yuzu/configuration/configure_graphics_advanced.h
+++ b/src/yuzu/configuration/configure_graphics_advanced.h
@@ -47,6 +47,8 @@ private:
47 ConfigurationShared::CheckState use_fast_gpu_time; 47 ConfigurationShared::CheckState use_fast_gpu_time;
48 ConfigurationShared::CheckState use_vulkan_driver_pipeline_cache; 48 ConfigurationShared::CheckState use_vulkan_driver_pipeline_cache;
49 ConfigurationShared::CheckState enable_compute_pipelines; 49 ConfigurationShared::CheckState enable_compute_pipelines;
50 ConfigurationShared::CheckState use_video_framerate;
51 ConfigurationShared::CheckState barrier_feedback_loops;
50 52
51 const Core::System& system; 53 const Core::System& system;
52}; 54};
diff --git a/src/yuzu/configuration/configure_graphics_advanced.ui b/src/yuzu/configuration/configure_graphics_advanced.ui
index 37757a918..d527a6f38 100644
--- a/src/yuzu/configuration/configure_graphics_advanced.ui
+++ b/src/yuzu/configuration/configure_graphics_advanced.ui
@@ -192,6 +192,26 @@ Compute pipelines are always enabled on all other drivers.</string>
192 </widget> 192 </widget>
193 </item> 193 </item>
194 <item> 194 <item>
195 <widget class="QCheckBox" name="use_video_framerate_checkbox">
196 <property name="toolTip">
197 <string>Run the game at normal speed during video playback, even when the framerate is unlocked.</string>
198 </property>
199 <property name="text">
200 <string>Sync to framerate of video playback</string>
201 </property>
202 </widget>
203 </item>
204 <item>
205 <widget class="QCheckBox" name="barrier_feedback_loops_checkbox">
206 <property name="toolTip">
207 <string>Improves rendering of transparency effects in specific games.</string>
208 </property>
209 <property name="text">
210 <string>Barrier feedback loops</string>
211 </property>
212 </widget>
213 </item>
214 <item>
195 <widget class="QWidget" name="af_layout" native="true"> 215 <widget class="QWidget" name="af_layout" native="true">
196 <layout class="QHBoxLayout" name="horizontalLayout_1"> 216 <layout class="QHBoxLayout" name="horizontalLayout_1">
197 <property name="leftMargin"> 217 <property name="leftMargin">
diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp
index 7ac162586..eb96e6068 100644
--- a/src/yuzu/configuration/configure_per_game.cpp
+++ b/src/yuzu/configuration/configure_per_game.cpp
@@ -6,6 +6,7 @@
6#include <memory> 6#include <memory>
7#include <string> 7#include <string>
8#include <utility> 8#include <utility>
9#include <vector>
9 10
10#include <fmt/format.h> 11#include <fmt/format.h>
11 12
@@ -34,8 +35,10 @@
34#include "yuzu/configuration/configure_system.h" 35#include "yuzu/configuration/configure_system.h"
35#include "yuzu/uisettings.h" 36#include "yuzu/uisettings.h"
36#include "yuzu/util/util.h" 37#include "yuzu/util/util.h"
38#include "yuzu/vk_device_info.h"
37 39
38ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::string& file_name, 40ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::string& file_name,
41 std::vector<VkDeviceInfo::Record>& vk_device_records,
39 Core::System& system_) 42 Core::System& system_)
40 : QDialog(parent), 43 : QDialog(parent),
41 ui(std::make_unique<Ui::ConfigurePerGame>()), title_id{title_id_}, system{system_} { 44 ui(std::make_unique<Ui::ConfigurePerGame>()), title_id{title_id_}, system{system_} {
@@ -50,7 +53,7 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st
50 general_tab = std::make_unique<ConfigureGeneral>(system_, this); 53 general_tab = std::make_unique<ConfigureGeneral>(system_, this);
51 graphics_advanced_tab = std::make_unique<ConfigureGraphicsAdvanced>(system_, this); 54 graphics_advanced_tab = std::make_unique<ConfigureGraphicsAdvanced>(system_, this);
52 graphics_tab = std::make_unique<ConfigureGraphics>( 55 graphics_tab = std::make_unique<ConfigureGraphics>(
53 system_, [&]() { graphics_advanced_tab->ExposeComputeOption(); }, this); 56 system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); }, this);
54 input_tab = std::make_unique<ConfigureInputPerGame>(system_, game_config.get(), this); 57 input_tab = std::make_unique<ConfigureInputPerGame>(system_, game_config.get(), this);
55 system_tab = std::make_unique<ConfigureSystem>(system_, this); 58 system_tab = std::make_unique<ConfigureSystem>(system_, this);
56 59
diff --git a/src/yuzu/configuration/configure_per_game.h b/src/yuzu/configuration/configure_per_game.h
index 85752f1fa..7ec1ded06 100644
--- a/src/yuzu/configuration/configure_per_game.h
+++ b/src/yuzu/configuration/configure_per_game.h
@@ -5,11 +5,13 @@
5 5
6#include <memory> 6#include <memory>
7#include <string> 7#include <string>
8#include <vector>
8 9
9#include <QDialog> 10#include <QDialog>
10#include <QList> 11#include <QList>
11 12
12#include "core/file_sys/vfs_types.h" 13#include "core/file_sys/vfs_types.h"
14#include "vk_device_info.h"
13#include "yuzu/configuration/config.h" 15#include "yuzu/configuration/config.h"
14 16
15namespace Core { 17namespace Core {
@@ -45,6 +47,7 @@ class ConfigurePerGame : public QDialog {
45public: 47public:
46 // Cannot use std::filesystem::path due to https://bugreports.qt.io/browse/QTBUG-73263 48 // Cannot use std::filesystem::path due to https://bugreports.qt.io/browse/QTBUG-73263
47 explicit ConfigurePerGame(QWidget* parent, u64 title_id_, const std::string& file_name, 49 explicit ConfigurePerGame(QWidget* parent, u64 title_id_, const std::string& file_name,
50 std::vector<VkDeviceInfo::Record>& vk_device_records,
48 Core::System& system_); 51 Core::System& system_);
49 ~ConfigurePerGame() override; 52 ~ConfigurePerGame() override;
50 53
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp
index 286ccc5cd..f1ae312c6 100644
--- a/src/yuzu/configuration/configure_system.cpp
+++ b/src/yuzu/configuration/configure_system.cpp
@@ -144,8 +144,7 @@ void ConfigureSystem::ApplyConfiguration() {
144 if (ui->custom_rtc_checkbox->isChecked()) { 144 if (ui->custom_rtc_checkbox->isChecked()) {
145 Settings::values.custom_rtc = ui->custom_rtc_edit->dateTime().toSecsSinceEpoch(); 145 Settings::values.custom_rtc = ui->custom_rtc_edit->dateTime().toSecsSinceEpoch();
146 if (system.IsPoweredOn()) { 146 if (system.IsPoweredOn()) {
147 const s64 posix_time{*Settings::values.custom_rtc + 147 const s64 posix_time{*Settings::values.custom_rtc};
148 Service::Time::TimeManager::GetExternalTimeZoneOffset()};
149 system.GetTimeManager().UpdateLocalSystemClockTime(posix_time); 148 system.GetTimeManager().UpdateLocalSystemClockTime(posix_time);
150 } 149 }
151 } else { 150 } else {
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 145fea5f1..8768a7c3c 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -147,6 +147,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
147#include "yuzu/startup_checks.h" 147#include "yuzu/startup_checks.h"
148#include "yuzu/uisettings.h" 148#include "yuzu/uisettings.h"
149#include "yuzu/util/clickable_label.h" 149#include "yuzu/util/clickable_label.h"
150#include "yuzu/vk_device_info.h"
150 151
151#ifdef YUZU_DBGHELP 152#ifdef YUZU_DBGHELP
152#include "yuzu/mini_dump.h" 153#include "yuzu/mini_dump.h"
@@ -440,6 +441,8 @@ GMainWindow::GMainWindow(std::unique_ptr<Config> config_, bool has_broken_vulkan
440 441
441 renderer_status_button->setDisabled(true); 442 renderer_status_button->setDisabled(true);
442 renderer_status_button->setChecked(false); 443 renderer_status_button->setChecked(false);
444 } else {
445 VkDeviceInfo::PopulateRecords(vk_device_records, this->window()->windowHandle());
443 } 446 }
444 447
445#if defined(HAVE_SDL2) && !defined(_WIN32) 448#if defined(HAVE_SDL2) && !defined(_WIN32)
@@ -3067,7 +3070,7 @@ InstallResult GMainWindow::InstallNSPXCI(const QString& filename) {
3067 return false; 3070 return false;
3068 } 3071 }
3069 3072
3070 std::array<u8, 0x1000> buffer{}; 3073 std::vector<u8> buffer(1_MiB);
3071 3074
3072 for (std::size_t i = 0; i < src->GetSize(); i += buffer.size()) { 3075 for (std::size_t i = 0; i < src->GetSize(); i += buffer.size()) {
3073 if (install_progress->wasCanceled()) { 3076 if (install_progress->wasCanceled()) {
@@ -3494,7 +3497,8 @@ void GMainWindow::OnConfigure() {
3494 const auto old_language_index = Settings::values.language_index.GetValue(); 3497 const auto old_language_index = Settings::values.language_index.GetValue();
3495 3498
3496 Settings::SetConfiguringGlobal(true); 3499 Settings::SetConfiguringGlobal(true);
3497 ConfigureDialog configure_dialog(this, hotkey_registry, input_subsystem.get(), *system, 3500 ConfigureDialog configure_dialog(this, hotkey_registry, input_subsystem.get(),
3501 vk_device_records, *system,
3498 !multiplayer_state->IsHostingPublicRoom()); 3502 !multiplayer_state->IsHostingPublicRoom());
3499 connect(&configure_dialog, &ConfigureDialog::LanguageChanged, this, 3503 connect(&configure_dialog, &ConfigureDialog::LanguageChanged, this,
3500 &GMainWindow::OnLanguageChanged); 3504 &GMainWindow::OnLanguageChanged);
@@ -3765,7 +3769,7 @@ void GMainWindow::OpenPerGameConfiguration(u64 title_id, const std::string& file
3765 const auto v_file = Core::GetGameFileFromPath(vfs, file_name); 3769 const auto v_file = Core::GetGameFileFromPath(vfs, file_name);
3766 3770
3767 Settings::SetConfiguringGlobal(false); 3771 Settings::SetConfiguringGlobal(false);
3768 ConfigurePerGame dialog(this, title_id, file_name, *system); 3772 ConfigurePerGame dialog(this, title_id, file_name, vk_device_records, *system);
3769 dialog.LoadFromFile(v_file); 3773 dialog.LoadFromFile(v_file);
3770 const auto result = dialog.exec(); 3774 const auto result = dialog.exec();
3771 3775
@@ -4116,7 +4120,13 @@ void GMainWindow::UpdateDockedButton() {
4116void GMainWindow::UpdateAPIText() { 4120void GMainWindow::UpdateAPIText() {
4117 const auto api = Settings::values.renderer_backend.GetValue(); 4121 const auto api = Settings::values.renderer_backend.GetValue();
4118 const auto renderer_status_text = Config::renderer_backend_texts_map.find(api)->second; 4122 const auto renderer_status_text = Config::renderer_backend_texts_map.find(api)->second;
4119 renderer_status_button->setText(renderer_status_text.toUpper()); 4123 renderer_status_button->setText(
4124 api == Settings::RendererBackend::OpenGL
4125 ? tr("%1 %2").arg(
4126 renderer_status_text.toUpper(),
4127 Config::shader_backend_texts_map.find(Settings::values.shader_backend.GetValue())
4128 ->second)
4129 : renderer_status_text.toUpper());
4120} 4130}
4121 4131
4122void GMainWindow::UpdateFilterText() { 4132void GMainWindow::UpdateFilterText() {
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index 6bb70972f..e0e775d87 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -118,6 +118,10 @@ enum class ReinitializeKeyBehavior {
118 Warning, 118 Warning,
119}; 119};
120 120
121namespace VkDeviceInfo {
122class Record;
123}
124
121class GMainWindow : public QMainWindow { 125class GMainWindow : public QMainWindow {
122 Q_OBJECT 126 Q_OBJECT
123 127
@@ -418,6 +422,8 @@ private:
418 422
419 GameListPlaceholder* game_list_placeholder; 423 GameListPlaceholder* game_list_placeholder;
420 424
425 std::vector<VkDeviceInfo::Record> vk_device_records;
426
421 // Status bar elements 427 // Status bar elements
422 QLabel* message_label = nullptr; 428 QLabel* message_label = nullptr;
423 QLabel* shader_building_label = nullptr; 429 QLabel* shader_building_label = nullptr;
diff --git a/src/yuzu/vk_device_info.cpp b/src/yuzu/vk_device_info.cpp
new file mode 100644
index 000000000..7c26a3dc7
--- /dev/null
+++ b/src/yuzu/vk_device_info.cpp
@@ -0,0 +1,61 @@
1// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include <utility>
5#include <vector>
6#include "common/dynamic_library.h"
7#include "common/logging/log.h"
8#include "video_core/vulkan_common/vulkan_device.h"
9#include "video_core/vulkan_common/vulkan_instance.h"
10#include "video_core/vulkan_common/vulkan_library.h"
11#include "video_core/vulkan_common/vulkan_surface.h"
12#include "video_core/vulkan_common/vulkan_wrapper.h"
13#include "vulkan/vulkan_core.h"
14#include "yuzu/qt_common.h"
15#include "yuzu/vk_device_info.h"
16
17class QWindow;
18
19namespace VkDeviceInfo {
20Record::Record(std::string_view name_, const std::vector<VkPresentModeKHR>& vsync_modes_,
21 bool has_broken_compute_)
22 : name{name_}, vsync_support{vsync_modes_}, has_broken_compute{has_broken_compute_} {}
23
24Record::~Record() = default;
25
26void PopulateRecords(std::vector<Record>& records, QWindow* window) try {
27 using namespace Vulkan;
28
29 auto wsi = QtCommon::GetWindowSystemInfo(window);
30
31 vk::InstanceDispatch dld;
32 const auto library = OpenLibrary();
33 const vk::Instance instance = CreateInstance(*library, dld, VK_API_VERSION_1_1, wsi.type);
34 const std::vector<VkPhysicalDevice> physical_devices = instance.EnumeratePhysicalDevices();
35 vk::SurfaceKHR surface = CreateSurface(instance, wsi);
36
37 records.clear();
38 records.reserve(physical_devices.size());
39 for (const VkPhysicalDevice device : physical_devices) {
40 const auto physical_device = vk::PhysicalDevice(device, dld);
41 const std::string name = physical_device.GetProperties().deviceName;
42 const std::vector<VkPresentModeKHR> present_modes =
43 physical_device.GetSurfacePresentModesKHR(*surface);
44
45 VkPhysicalDeviceDriverProperties driver_properties{};
46 driver_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES;
47 driver_properties.pNext = nullptr;
48 VkPhysicalDeviceProperties2 properties{};
49 properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR;
50 properties.pNext = &driver_properties;
51 dld.vkGetPhysicalDeviceProperties2(physical_device, &properties);
52
53 bool has_broken_compute{Vulkan::Device::CheckBrokenCompute(
54 driver_properties.driverID, properties.properties.driverVersion)};
55
56 records.push_back(VkDeviceInfo::Record(name, present_modes, has_broken_compute));
57 }
58} catch (const Vulkan::vk::Exception& exception) {
59 LOG_ERROR(Frontend, "Failed to enumerate devices with error: {}", exception.what());
60}
61} // namespace VkDeviceInfo
diff --git a/src/yuzu/vk_device_info.h b/src/yuzu/vk_device_info.h
new file mode 100644
index 000000000..bda8262f4
--- /dev/null
+++ b/src/yuzu/vk_device_info.h
@@ -0,0 +1,36 @@
1// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include <algorithm>
7#include <iterator>
8#include <memory>
9#include <string>
10#include <string_view>
11#include <vector>
12#include "common/common_types.h"
13#include "vulkan/vulkan_core.h"
14
15class QWindow;
16
17namespace Settings {
18enum class VSyncMode : u32;
19}
20// #include "common/settings.h"
21
22namespace VkDeviceInfo {
23// Short class to record Vulkan driver information for configuration purposes
24class Record {
25public:
26 explicit Record(std::string_view name, const std::vector<VkPresentModeKHR>& vsync_modes,
27 bool has_broken_compute);
28 ~Record();
29
30 const std::string name;
31 const std::vector<VkPresentModeKHR> vsync_support;
32 const bool has_broken_compute;
33};
34
35void PopulateRecords(std::vector<Record>& records, QWindow* window);
36} // namespace VkDeviceInfo
diff --git a/vcpkg.json b/vcpkg.json
index 26f545c6c..7d9e631a1 100644
--- a/vcpkg.json
+++ b/vcpkg.json
@@ -1,7 +1,7 @@
1{ 1{
2 "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", 2 "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
3 "name": "yuzu", 3 "name": "yuzu",
4 "builtin-baseline": "656fcc6ab2b05c6d999b7eaca717027ac3738f71", 4 "builtin-baseline": "cbf56573a987527b39272e88cbdd11389b78c6e4",
5 "version": "1.0", 5 "version": "1.0",
6 "dependencies": [ 6 "dependencies": [
7 "boost-algorithm", 7 "boost-algorithm",